From 092828dbbe4f79cf2f8a51fe5687d3d212a0e880 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:59:25 +0530 Subject: [PATCH 01/17] Feature(Reservations): UI-31879: Reservations --- .../github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go | 3437 ++++++++++++++--- examples/ibm-is-ng/main.tf | 27 + ibm/provider/provider.go | 5 + .../vpc/data_source_ibm_is_reservation.go | 430 +++ .../data_source_ibm_is_reservation_test.go | 58 + .../vpc/data_source_ibm_is_reservations.go | 452 +++ .../data_source_ibm_is_reservations_test.go | 46 + .../vpc/resource_ibm_is_reservation.go | 647 ++++ .../resource_ibm_is_reservation_activate.go | 421 ++ ...source_ibm_is_reservation_activate_test.go | 110 + .../vpc/resource_ibm_is_reservation_test.go | 111 + website/docs/d/is_reservation.html.markdown | 151 + website/docs/d/is_reservations.html.markdown | 143 + website/docs/r/is_reservation.html.markdown | 164 + .../r/is_reservation_activate.html.markdown | 144 + 15 files changed, 5708 insertions(+), 638 deletions(-) create mode 100644 ibm/service/vpc/data_source_ibm_is_reservation.go create mode 100644 ibm/service/vpc/data_source_ibm_is_reservation_test.go create mode 100644 ibm/service/vpc/data_source_ibm_is_reservations.go create mode 100644 ibm/service/vpc/data_source_ibm_is_reservations_test.go create mode 100644 ibm/service/vpc/resource_ibm_is_reservation.go create mode 100644 ibm/service/vpc/resource_ibm_is_reservation_activate.go create mode 100644 ibm/service/vpc/resource_ibm_is_reservation_activate_test.go create mode 100644 ibm/service/vpc/resource_ibm_is_reservation_test.go create mode 100644 website/docs/d/is_reservation.html.markdown create mode 100644 website/docs/d/is_reservations.html.markdown create mode 100644 website/docs/r/is_reservation.html.markdown create mode 100644 website/docs/r/is_reservation_activate.html.markdown diff --git a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index 31a36972c6..7f391f67bc 100644 --- a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -5402,6 +5402,15 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt if listInstancesOptions.PlacementGroupName != nil { builder.AddQuery("placement_group.name", fmt.Sprint(*listInstancesOptions.PlacementGroupName)) } + if listInstancesOptions.ReservationID != nil { + builder.AddQuery("reservation.id", fmt.Sprint(*listInstancesOptions.ReservationID)) + } + if listInstancesOptions.ReservationCRN != nil { + builder.AddQuery("reservation.crn", fmt.Sprint(*listInstancesOptions.ReservationCRN)) + } + if listInstancesOptions.ReservationName != nil { + builder.AddQuery("reservation.name", fmt.Sprint(*listInstancesOptions.ReservationName)) + } request, err := builder.Build() if err != nil { @@ -8840,6 +8849,596 @@ func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, return } +// ListReservations : List all reservations +// This request lists all reservations in the region. A reservation provides reserved capacity for a specified profile +// in a specified zone. A reservation can also include a long-term committed use discount. +// +// The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations +// with identical `created_at` property values will in turn be sorted by ascending `name` property values. +func (vpc *VpcV1) ListReservations(listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + return vpc.ListReservationsWithContext(context.Background(), listReservationsOptions) +} + +// ListReservationsWithContext is an alternate form of the ListReservations method which supports a Context parameter +func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listReservationsOptions, "listReservationsOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listReservationsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListReservations") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listReservationsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listReservationsOptions.Start)) + } + if listReservationsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listReservationsOptions.Limit)) + } + if listReservationsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listReservationsOptions.Name)) + } + if listReservationsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listReservationsOptions.ResourceGroupID)) + } + if listReservationsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listReservationsOptions.ZoneName)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservationCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateReservation : Create a reservation +// This request creates a new reservation from a reservation prototype object. The prototype object is structured in the +// same way as a retrieved reservation, and contains the information necessary to create the new reservation. +func (vpc *VpcV1) CreateReservation(createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.CreateReservationWithContext(context.Background(), createReservationOptions) +} + +// CreateReservationWithContext is an alternate form of the CreateReservation method which supports a Context parameter +func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createReservationOptions, "createReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createReservationOptions, "createReservationOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + if err != nil { + return + } + + for headerName, headerValue := range createReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + body := make(map[string]interface{}) + if createReservationOptions.Capacity != nil { + body["capacity"] = createReservationOptions.Capacity + } + if createReservationOptions.CommittedUse != nil { + body["committed_use"] = createReservationOptions.CommittedUse + } + if createReservationOptions.Profile != nil { + body["profile"] = createReservationOptions.Profile + } + if createReservationOptions.Zone != nil { + body["zone"] = createReservationOptions.Zone + } + if createReservationOptions.AffinityPolicy != nil { + body["affinity_policy"] = createReservationOptions.AffinityPolicy + } + if createReservationOptions.Name != nil { + body["name"] = createReservationOptions.Name + } + if createReservationOptions.ResourceGroup != nil { + body["resource_group"] = createReservationOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteReservation : Delete a reservation +// This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are +// not allowed to be deleted. +func (vpc *VpcV1) DeleteReservation(deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.DeleteReservationWithContext(context.Background(), deleteReservationOptions) +} + +// DeleteReservationWithContext is an alternate form of the DeleteReservation method which supports a Context parameter +func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteReservationOptions, "deleteReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteReservationOptions, "deleteReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *deleteReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetReservation : Retrieve a reservation +// This request retrieves a single reservation specified by identifier in the URL. +func (vpc *VpcV1) GetReservation(getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.GetReservationWithContext(context.Background(), getReservationOptions) +} + +// GetReservationWithContext is an alternate form of the GetReservation method which supports a Context parameter +func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getReservationOptions, "getReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getReservationOptions, "getReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *getReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateReservation : Update a reservation +// This request updates a reservation with the information provided in a reservation patch object. The patch object is +// structured in the same way as a retrieved reservation and needs to contain only the information to be updated. +func (vpc *VpcV1) UpdateReservation(updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.UpdateReservationWithContext(context.Background(), updateReservationOptions) +} + +// UpdateReservationWithContext is an alternate form of the UpdateReservation method which supports a Context parameter +func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateReservationOptions, "updateReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateReservationOptions, "updateReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *updateReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateReservationOptions.ReservationPatch) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ActivateReservation : Activate a reservation +// This request activates a reservation. For this request to succeed, the reservation status must be `inactive`. +func (vpc *VpcV1) ActivateReservation(activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { + return vpc.ActivateReservationWithContext(context.Background(), activateReservationOptions) +} + +// ActivateReservationWithContext is an alternate form of the ActivateReservation method which supports a Context parameter +func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(activateReservationOptions, "activateReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(activateReservationOptions, "activateReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *activateReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range activateReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ActivateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + response, err = vpc.Service.Request(request, nil) + + return +} + +// ActivateReservationOptions : The ActivateReservation options. +type ActivateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewActivateReservationOptions : Instantiate ActivateReservationOptions +func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { + return &ActivateReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { + options.Headers = param + return options +} + +// CreateReservationOptions : The CreateReservation options. +type CreateReservationOptions struct { + // The capacity reservation configuration to use. + Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` + + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + Profile *ReservationProfilePrototype `json:"profile" validate:"required"` + + // The zone to use for this reservation. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested. + AffinityPolicy *string `json:"affinity_policy,omitempty"` + + // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the CreateReservationOptions.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested. +const ( + CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" +) + +// NewCreateReservationOptions : Instantiate CreateReservationOptions +func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { + return &CreateReservationOptions{ + Capacity: capacity, + CommittedUse: committedUse, + Profile: profile, + Zone: zone, + } +} + +// SetCapacity : Allow user to set Capacity +func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { + _options.Capacity = capacity + return _options +} + +// SetCommittedUse : Allow user to set CommittedUse +func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { + _options.CommittedUse = committedUse + return _options +} + +// SetProfile : Allow user to set Profile +func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { + _options.Profile = profile + return _options +} + +// SetZone : Allow user to set Zone +func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { + _options.Zone = zone + return _options +} + +// SetAffinityPolicy : Allow user to set AffinityPolicy +func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { + _options.AffinityPolicy = core.StringPtr(affinityPolicy) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { + _options.ResourceGroup = resourceGroup + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { + options.Headers = param + return options +} + +// DeleteReservationOptions : The DeleteReservation options. +type DeleteReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteReservationOptions : Instantiate DeleteReservationOptions +func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { + return &DeleteReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { + options.Headers = param + return options +} + +// GetReservationOptions : The GetReservation options. +type GetReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetReservationOptions : Instantiate GetReservationOptions +func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { + return &GetReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { + options.Headers = param + return options +} + // ListDedicatedHostGroups : List all dedicated host groups // This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for // placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. @@ -43113,6 +43712,13 @@ type Instance struct { // server instance. Profile *InstanceProfileReference `json:"profile" validate:"required"` + // The reservation used by this virtual server instance. + // + // If absent, no reservation is in use. + Reservation *ReservationReference `json:"reservation,omitempty"` + + ReservationAffinity *InstanceReservationAffinity `json:"reservation_affinity" validate:"required"` + // The resource group for this instance. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -43279,6 +43885,14 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } + err = core.UnmarshalModel(m, "reservation", &obj.Reservation, UnmarshalReservationReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinity) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -45975,6 +46589,46 @@ func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result return } +// InstanceHealthReason : InstanceHealthReason struct +type InstanceHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + InstanceHealthReasonCodeReservationCapacityUnavailableConst = "reservation_capacity_unavailable" + InstanceHealthReasonCodeReservationDeletedConst = "reservation_deleted" + InstanceHealthReasonCodeReservationExpiredConst = "reservation_expired" + InstanceHealthReasonCodeReservationFailedConst = "reservation_failed" +) + +// UnmarshalInstanceHealthReason unmarshals an instance of InstanceHealthReason from the specified map of raw messages. +func UnmarshalInstanceHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceInitialization : InstanceInitialization struct type InstanceInitialization struct { // The default trusted profile configuration specified at virtual server instance @@ -46256,6 +46910,8 @@ type InstancePatch struct { // - Support the number of network interfaces the instance currently has. Profile InstancePatchProfileIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in // this value will result in a corresponding decrease to // `total_network_bandwidth`. @@ -46285,6 +46941,10 @@ func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPatch) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return @@ -46536,6 +47196,8 @@ type InstanceProfile struct { PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` + ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` + TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` @@ -46600,6 +47262,10 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "reservation_terms", &obj.ReservationTerms, UnmarshalInstanceProfileReservationTerms) + if err != nil { + return + } err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) if err != nil { return @@ -47441,6 +48107,42 @@ func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result inte return } +// InstanceProfileReservationTerms : InstanceProfileReservationTerms struct +type InstanceProfileReservationTerms struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported committed use terms for a reservation using this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileReservationTerms.Type property. +// The type for this profile field. +const ( + InstanceProfileReservationTermsTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileReservationTerms.Values property. +const ( + InstanceProfileReservationTermsValuesOneYearConst = "one_year" + InstanceProfileReservationTermsValuesThreeYearConst = "three_year" +) + +// UnmarshalInstanceProfileReservationTerms unmarshals an instance of InstanceProfileReservationTerms from the specified map of raw messages. +func UnmarshalInstanceProfileReservationTerms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileReservationTerms) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVcpu : InstanceProfileVcpu struct // Models which "extend" this model: // - InstanceProfileVcpuFixed @@ -47723,6 +48425,8 @@ type InstancePrototype struct { // in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -47813,330 +48517,476 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReference : InstanceReference struct -type InstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. -func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceStatusReason : InstanceStatusReason struct -type InstanceStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the InstanceStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - InstanceStatusReasonCodeCannotStartConst = "cannot_start" - InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" - InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" - InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" - InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" - InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" -) - -// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. -func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplate : InstanceTemplate struct -// Models which "extend" this model: -// - InstanceTemplateInstanceByImageInstanceTemplateContext -// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext -// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext -type InstanceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` -} - -func (*InstanceTemplate) isaInstanceTemplate() bool { - return true -} - -type InstanceTemplateIntf interface { - isaInstanceTemplate() bool -} - -// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReference : InstanceReference struct +type InstanceReference struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` + + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. +func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinity : InstanceReservationAffinity struct +type InstanceReservationAffinity struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` are available for use. + Policy *string `json:"policy" validate:"required"` + + // The pool of reservations available for use by this virtual server instance. + Pool []ReservationReference `json:"pool" validate:"required"` +} + +// Constants associated with the InstanceReservationAffinity.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` are available for use. +const ( + InstanceReservationAffinityPolicyDisabledConst = "disabled" + InstanceReservationAffinityPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinity unmarshals an instance of InstanceReservationAffinity from the specified map of raw messages. +func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinity) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPatch : InstanceReservationAffinityPatch struct +type InstanceReservationAffinityPatch struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` will be available for use + // + // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. + // + // The policy must be `disabled` if `placement_target` is specified. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance, replacing the existing pool of + // reservations. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is + // `manual`. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPatch.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` will be available for use +// +// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. +// +// The policy must be `disabled` if `placement_target` is specified. +const ( + InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" + InstanceReservationAffinityPatchPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPatch unmarshals an instance of InstanceReservationAffinityPatch from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPatch) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPrototype : InstanceReservationAffinityPrototype struct +type InstanceReservationAffinityPrototype struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` will be available for use + // + // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. + // + // The policy must be `disabled` if `placement_target` is specified. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is + // `manual`. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPrototype.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` will be available for use +// +// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. +// +// The policy must be `disabled` if `placement_target` is specified. +const ( + InstanceReservationAffinityPrototypePolicyDisabledConst = "disabled" + InstanceReservationAffinityPrototypePolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPrototype unmarshals an instance of InstanceReservationAffinityPrototype from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceStatusReason : InstanceStatusReason struct +type InstanceStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + InstanceStatusReasonCodeCannotStartConst = "cannot_start" + InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" + InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" + InstanceStatusReasonCodeCannotStartReservationCapacityConst = "cannot_start_reservation_capacity" + InstanceStatusReasonCodeCannotStartReservationExpiredConst = "cannot_start_reservation_expired" + InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" + InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" + InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" +) + +// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. +func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplate : InstanceTemplate struct +// Models which "extend" this model: +// - InstanceTemplateInstanceByImageInstanceTemplateContext +// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext +// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext +type InstanceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + // The metadata service configuration. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` + + // The placement restrictions to use for the virtual server instance. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change + // in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` +} + +func (*InstanceTemplate) isaInstanceTemplate() bool { + return true +} + +type InstanceTemplateIntf interface { + isaInstanceTemplate() bool +} + +// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. +func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } @@ -48383,6 +49233,8 @@ type InstanceTemplatePrototype struct { // in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -48474,6 +49326,10 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -50714,6 +51570,15 @@ type ListInstancesOptions struct { // group name. PlacementGroupName *string `json:"placement_group.name,omitempty"` + // Filters the collection to instances with a `reservation.id` property matching the specified identifier. + ReservationID *string `json:"reservation.id,omitempty"` + + // Filters the collection to instances with a `reservation.crn` property matching the specified CRN. + ReservationCRN *string `json:"reservation.crn,omitempty"` + + // Filters the collection to resources with a `reservation.name` property matching the exact specified name. + ReservationName *string `json:"reservation.name,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -50801,6 +51666,24 @@ func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName s return _options } +// SetReservationID : Allow user to set ReservationID +func (_options *ListInstancesOptions) SetReservationID(reservationID string) *ListInstancesOptions { + _options.ReservationID = core.StringPtr(reservationID) + return _options +} + +// SetReservationCRN : Allow user to set ReservationCRN +func (_options *ListInstancesOptions) SetReservationCRN(reservationCRN string) *ListInstancesOptions { + _options.ReservationCRN = core.StringPtr(reservationCRN) + return _options +} + +// SetReservationName : Allow user to set ReservationName +func (_options *ListInstancesOptions) SetReservationName(reservationName string) *ListInstancesOptions { + _options.ReservationName = core.StringPtr(reservationName) + return _options +} + // SetHeaders : Allow user to set Headers func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { options.Headers = param @@ -51421,6 +52304,68 @@ func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegi return options } +// ListReservationsOptions : The ListReservations options. +type ListReservationsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListReservationsOptions : Instantiate ListReservationsOptions +func (*VpcV1) NewListReservationsOptions() *ListReservationsOptions { + return &ListReservationsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListReservationsOptions) SetStart(start string) *ListReservationsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListReservationsOptions) SetLimit(limit int64) *ListReservationsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListReservationsOptions) SetName(name string) *ListReservationsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListReservationsOptions) SetResourceGroupID(resourceGroupID string) *ListReservationsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListReservationsOptions) SetZoneName(zoneName string) *ListReservationsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListReservationsOptions) SetHeaders(param map[string]string) *ListReservationsOptions { + options.Headers = param + return options +} + // ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. type ListSecurityGroupRulesOptions struct { // The security group identifier. @@ -60239,6 +61184,892 @@ func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]str return options } +// Reservation : Reservation struct +type Reservation struct { + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + AffinityPolicy *string `json:"affinity_policy" validate:"required"` + + // The capacity configuration for this reservation + // + // If absent, this reservation has no assigned capacity. + Capacity *ReservationCapacity `json:"capacity,omitempty"` + + // The committed use configuration for this reservation. + // + // If absent, this reservation has no commitment for use. + CommittedUse *ReservationCommittedUse `json:"committed_use,omitempty"` + + // The date and time that the reservation was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` + + // The URL for this reservation. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of this reservation. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. + Profile ReservationProfileIntf `json:"profile" validate:"required"` + + // The resource group for this reservation. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the reservation. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ReservationStatusReason `json:"status_reasons" validate:"required"` + + // The zone for this reservation. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the Reservation.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationAffinityPolicyRestrictedConst = "restricted" +) + +// Constants associated with the Reservation.LifecycleState property. +// The lifecycle state of this reservation. +const ( + ReservationLifecycleStateDeletingConst = "deleting" + ReservationLifecycleStateFailedConst = "failed" + ReservationLifecycleStatePendingConst = "pending" + ReservationLifecycleStateStableConst = "stable" + ReservationLifecycleStateSuspendedConst = "suspended" + ReservationLifecycleStateUpdatingConst = "updating" + ReservationLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Reservation.ResourceType property. +// The resource type. +const ( + ReservationResourceTypeReservationConst = "reservation" +) + +// Constants associated with the Reservation.Status property. +// The status of the reservation. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationStatusActivatingConst = "activating" + ReservationStatusActiveConst = "active" + ReservationStatusDeactivatingConst = "deactivating" + ReservationStatusExpiredConst = "expired" + ReservationStatusFailedConst = "failed" + ReservationStatusInactiveConst = "inactive" +) + +// UnmarshalReservation unmarshals an instance of Reservation from the specified map of raw messages. +func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Reservation) + err = core.UnmarshalPrimitive(m, "affinity_policy", &obj.AffinityPolicy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUse) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalReservationStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacity : The capacity configuration for this reservation +// +// If absent, this reservation has no assigned capacity. +type ReservationCapacity struct { + // The amount allocated to this capacity reservation. + Allocated *int64 `json:"allocated" validate:"required"` + + // The amount of this capacity reservation available for new attachments. + Available *int64 `json:"available" validate:"required"` + + // The status of the capacity reservation: + // - `allocating`: The capacity reservation is being allocated for use + // - `allocated`: The total capacity of the reservation has been allocated for use + // - `degraded`: The capacity reservation has been allocated for use, but some of the + // capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more + // information. + // - `unallocated`: The capacity reservation is not allocated for use + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The total amount of this capacity reservation. + Total *int64 `json:"total" validate:"required"` + + // The amount of this capacity reservation used by existing attachments. + Used *int64 `json:"used" validate:"required"` +} + +// Constants associated with the ReservationCapacity.Status property. +// The status of the capacity reservation: +// - `allocating`: The capacity reservation is being allocated for use +// - `allocated`: The total capacity of the reservation has been allocated for use +// - `degraded`: The capacity reservation has been allocated for use, but some of the +// capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more +// information. +// - `unallocated`: The capacity reservation is not allocated for use +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCapacityStatusAllocatedConst = "allocated" + ReservationCapacityStatusAllocatingConst = "allocating" + ReservationCapacityStatusDegradedConst = "degraded" + ReservationCapacityStatusUnallocatedConst = "unallocated" +) + +// UnmarshalReservationCapacity unmarshals an instance of ReservationCapacity from the specified map of raw messages. +func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacity) + err = core.UnmarshalPrimitive(m, "allocated", &obj.Allocated) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "available", &obj.Available) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "used", &obj.Used) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacityPatch : The capacity reservation configuration to use. +// +// The configuration can only be changed for reservations with a `status` of `inactive`. +type ReservationCapacityPatch struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total,omitempty"` +} + +// UnmarshalReservationCapacityPatch unmarshals an instance of ReservationCapacityPatch from the specified map of raw messages. +func UnmarshalReservationCapacityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPatch) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacityPrototype : The capacity reservation configuration to use. +type ReservationCapacityPrototype struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total" validate:"required"` +} + +// NewReservationCapacityPrototype : Instantiate ReservationCapacityPrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCapacityPrototype(total int64) (_model *ReservationCapacityPrototype, err error) { + _model = &ReservationCapacityPrototype{ + Total: core.Int64Ptr(total), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationCapacityPrototype unmarshals an instance of ReservationCapacityPrototype from the specified map of raw messages. +func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPrototype) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCollection : ReservationCollection struct +type ReservationCollection struct { + // A link to the first page of resources. + First *ReservationCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservationCollectionNext `json:"next,omitempty"` + + // Collection of reservations. + Reservations []Reservation `json:"reservations" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalReservationCollection unmarshals an instance of ReservationCollection from the specified map of raw messages. +func UnmarshalReservationCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservationCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservationCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservations", &obj.Reservations, UnmarshalReservation) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservationCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ReservationCollectionFirst : A link to the first page of resources. +type ReservationCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservationCollectionFirst unmarshals an instance of ReservationCollectionFirst from the specified map of raw messages. +func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservationCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservationCollectionNext unmarshals an instance of ReservationCollectionNext from the specified map of raw messages. +func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUse : The committed use reservation configuration. +type ReservationCommittedUse struct { + // The expiration date and time for this committed use reservation. + ExpirationAt *strfmt.DateTime `json:"expiration_at" validate:"required"` + + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy" validate:"required"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Term *string `json:"term" validate:"required"` +} + +// Constants associated with the ReservationCommittedUse.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUseExpirationPolicyReleaseConst = "release" + ReservationCommittedUseExpirationPolicyRenewConst = "renew" +) + +// UnmarshalReservationCommittedUse unmarshals an instance of ReservationCommittedUse from the specified map of raw messages. +func UnmarshalReservationCommittedUse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUse) + err = core.UnmarshalPrimitive(m, "expiration_at", &obj.ExpirationAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUsePatch : ReservationCommittedUsePatch struct +type ReservationCommittedUsePatch struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. The term can only + // be changed for a reservation with a `status` of + // `inactive`. + Term *string `json:"term,omitempty"` +} + +// Constants associated with the ReservationCommittedUsePatch.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUsePatchExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePatchExpirationPolicyRenewConst = "renew" +) + +// UnmarshalReservationCommittedUsePatch unmarshals an instance of ReservationCommittedUsePatch from the specified map of raw messages. +func UnmarshalReservationCommittedUsePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePatch) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUsePrototype : ReservationCommittedUsePrototype struct +type ReservationCommittedUsePrototype struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. + Term *string `json:"term" validate:"required"` +} + +// Constants associated with the ReservationCommittedUsePrototype.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUsePrototypeExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePrototypeExpirationPolicyRenewConst = "renew" +) + +// NewReservationCommittedUsePrototype : Instantiate ReservationCommittedUsePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCommittedUsePrototype(term string) (_model *ReservationCommittedUsePrototype, err error) { + _model = &ReservationCommittedUsePrototype{ + Term: core.StringPtr(term), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationCommittedUsePrototype unmarshals an instance of ReservationCommittedUsePrototype from the specified map of raw messages. +func UnmarshalReservationCommittedUsePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePrototype) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentity : Identifies a reservation by a unique property. +// Models which "extend" this model: +// - ReservationIdentityByID +// - ReservationIdentityByCRN +// - ReservationIdentityByHref +type ReservationIdentity struct { + // The unique identifier for this reservation. + ID *string `json:"id,omitempty"` + + // The CRN for this reservation. + CRN *string `json:"crn,omitempty"` + + // The URL for this reservation. + Href *string `json:"href,omitempty"` +} + +func (*ReservationIdentity) isaReservationIdentity() bool { + return true +} + +type ReservationIdentityIntf interface { + isaReservationIdentity() bool +} + +// UnmarshalReservationIdentity unmarshals an instance of ReservationIdentity from the specified map of raw messages. +func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationPatch : ReservationPatch struct +type ReservationPatch struct { + // The capacity reservation configuration to use. + // + // The configuration can only be changed for reservations with a `status` of `inactive`. + Capacity *ReservationCapacityPatch `json:"capacity,omitempty"` + + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePatch `json:"committed_use,omitempty"` + + // The name for this reservation. The name must not be used by another reservation in the region. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + // + // The profile can only be changed for a reservation with a `status` of `inactive`. + Profile *ReservationProfilePatch `json:"profile,omitempty"` +} + +// UnmarshalReservationPatch unmarshals an instance of ReservationPatch from the specified map of raw messages. +func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationPatch) + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacityPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUsePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfilePatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the ReservationPatch +func (reservationPatch *ReservationPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(reservationPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// ReservationProfile : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. +// Models which "extend" this model: +// - ReservationProfileInstanceProfileReference +type ReservationProfile struct { + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` + + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the ReservationProfile.ResourceType property. +// The resource type. +const ( + ReservationProfileResourceTypeInstanceProfileConst = "instance_profile" +) + +func (*ReservationProfile) isaReservationProfile() bool { + return true +} + +type ReservationProfileIntf interface { + isaReservationProfile() bool +} + +// UnmarshalReservationProfile unmarshals an instance of ReservationProfile from the specified map of raw messages. +func UnmarshalReservationProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfile) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationProfilePatch : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +// +// The profile can only be changed for a reservation with a `status` of `inactive`. +type ReservationProfilePatch struct { + // The globally unique name of the profile. + Name *string `json:"name,omitempty"` + + // The resource type of the profile. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the ReservationProfilePatch.ResourceType property. +// The resource type of the profile. +const ( + ReservationProfilePatchResourceTypeInstanceProfileConst = "instance_profile" +) + +// UnmarshalReservationProfilePatch unmarshals an instance of ReservationProfilePatch from the specified map of raw messages. +func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationProfilePrototype : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +type ReservationProfilePrototype struct { + // The globally unique name of the profile. + Name *string `json:"name" validate:"required"` + + // The resource type of the profile. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationProfilePrototype.ResourceType property. +// The resource type of the profile. +const ( + ReservationProfilePrototypeResourceTypeInstanceProfileConst = "instance_profile" +) + +// NewReservationProfilePrototype : Instantiate ReservationProfilePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationProfilePrototype(name string, resourceType string) (_model *ReservationProfilePrototype, err error) { + _model = &ReservationProfilePrototype{ + Name: core.StringPtr(name), + ResourceType: core.StringPtr(resourceType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationProfilePrototype unmarshals an instance of ReservationProfilePrototype from the specified map of raw messages. +func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationReference : ReservationReference struct +type ReservationReference struct { + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ReservationReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this reservation. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` + + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationReference.ResourceType property. +// The resource type. +const ( + ReservationReferenceResourceTypeReservationConst = "reservation" +) + +// UnmarshalReservationReference unmarshals an instance of ReservationReference from the specified map of raw messages. +func UnmarshalReservationReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservationReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ReservationReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalReservationReferenceDeleted unmarshals an instance of ReservationReferenceDeleted from the specified map of raw messages. +func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationStatusReason : ReservationStatusReason struct +type ReservationStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the ReservationStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ReservationStatusReasonCodeCannotActivateNoCapacityAvailableConst = "cannot_activate_no_capacity_available" + ReservationStatusReasonCodeCannotRenewUnsupportedProfileTermConst = "cannot_renew_unsupported_profile_term" +) + +// UnmarshalReservationStatusReason unmarshals an instance of ReservationStatusReason from the specified map of raw messages. +func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ReservedIP : ReservedIP struct type ReservedIP struct { // The IP address. @@ -68582,6 +70413,44 @@ func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// UpdateReservationOptions : The UpdateReservation options. +type UpdateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // The reservation patch. + ReservationPatch map[string]interface{} `json:"Reservation_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateReservationOptions : Instantiate UpdateReservationOptions +func (*VpcV1) NewUpdateReservationOptions(id string, reservationPatch map[string]interface{}) *UpdateReservationOptions { + return &UpdateReservationOptions{ + ID: core.StringPtr(id), + ReservationPatch: reservationPatch, + } +} + +// SetID : Allow user to set ID +func (_options *UpdateReservationOptions) SetID(id string) *UpdateReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetReservationPatch : Allow user to set ReservationPatch +func (_options *UpdateReservationOptions) SetReservationPatch(reservationPatch map[string]interface{}) *UpdateReservationOptions { + _options.ReservationPatch = reservationPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateReservationOptions) SetHeaders(param map[string]string) *UpdateReservationOptions { + options.Headers = param + return options +} + // UpdateSecurityGroupOptions : The UpdateSecurityGroup options. type UpdateSecurityGroupOptions struct { // The security group identifier. @@ -82874,6 +84743,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -82962,6 +84833,10 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83049,6 +84924,8 @@ type InstancePrototypeInstanceByImage struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -83130,6 +85007,10 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83217,6 +85098,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -83295,6 +85178,10 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83381,6 +85268,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -83474,6 +85363,189 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePrototypeInstanceByVolume : Create an instance by using a boot volume. +// This model "extends" InstancePrototype +type InstancePrototypeInstanceByVolume struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} + +// NewInstancePrototypeInstanceByVolume : Instantiate InstancePrototypeInstanceByVolume (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByVolume(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByVolume, err error) { + _model = &InstancePrototypeInstanceByVolume{ + BootVolumeAttachment: bootVolumeAttachment, + PrimaryNetworkInterface: primaryNetworkInterface, + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByVolume) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83494,31 +85566,112 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateIdentityByCRN : InstanceTemplateIdentityByCRN struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByCRN struct { + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` +} + +// NewInstanceTemplateIdentityByCRN : Instantiate InstanceTemplateIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByCRN(crn string) (_model *InstanceTemplateIdentityByCRN, err error) { + _model = &InstanceTemplateIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceTemplateIdentityByCRN) isaInstanceTemplateIdentity() bool { + return true +} + +// UnmarshalInstanceTemplateIdentityByCRN unmarshals an instance of InstanceTemplateIdentityByCRN from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateIdentityByHref : InstanceTemplateIdentityByHref struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByHref struct { + // The URL for this instance template. + Href *string `json:"href" validate:"required"` +} + +// NewInstanceTemplateIdentityByHref : Instantiate InstanceTemplateIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByHref(href string) (_model *InstanceTemplateIdentityByHref, err error) { + _model = &InstanceTemplateIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceTemplateIdentityByHref) isaInstanceTemplateIdentity() bool { + return true +} + +// UnmarshalInstanceTemplateIdentityByHref unmarshals an instance of InstanceTemplateIdentityByHref from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateIdentityByID : InstanceTemplateIdentityByID struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByID struct { + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` +} + +// NewInstanceTemplateIdentityByID : Instantiate InstanceTemplateIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByID(id string) (_model *InstanceTemplateIdentityByID, err error) { + _model = &InstanceTemplateIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceTemplateIdentityByID) isaInstanceTemplateIdentity() bool { + return true +} + +// UnmarshalInstanceTemplateIdentityByID unmarshals an instance of InstanceTemplateIdentityByID from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -83526,9 +85679,9 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes return } -// InstancePrototypeInstanceByVolume : Create an instance by using a boot volume. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByVolume struct { +// InstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Create an instance template that creates instances by using a catalog offering. +// This model "extends" InstanceTemplatePrototype +type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -83555,10 +85708,8 @@ type InstancePrototypeInstanceByVolume struct { MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. @@ -83569,6 +85720,8 @@ type InstancePrototypeInstanceByVolume struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -83588,8 +85741,18 @@ type InstancePrototypeInstanceByVolume struct { // If specified, it must match the VPC for the subnets of the instance network interfaces. VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` // The additional instance network interfaces to create. NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` @@ -83601,10 +85764,10 @@ type InstancePrototypeInstanceByVolume struct { Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// NewInstancePrototypeInstanceByVolume : Instantiate InstancePrototypeInstanceByVolume (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolume(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByVolume, err error) { - _model = &InstancePrototypeInstanceByVolume{ - BootVolumeAttachment: bootVolumeAttachment, +// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOffering (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOffering, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOffering{ + CatalogOffering: catalogOffering, PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, } @@ -83612,13 +85775,13 @@ func (*VpcV1) NewInstancePrototypeInstanceByVolume(bootVolumeAttachment *VolumeA return } -func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByVolume) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return @@ -83647,6 +85810,10 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83667,112 +85834,23 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByCRN : InstanceTemplateIdentityByCRN struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByCRN struct { - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstanceTemplateIdentityByCRN : Instantiate InstanceTemplateIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByCRN(crn string) (_model *InstanceTemplateIdentityByCRN, err error) { - _model = &InstanceTemplateIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByCRN) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByCRN unmarshals an instance of InstanceTemplateIdentityByCRN from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByHref : InstanceTemplateIdentityByHref struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByHref struct { - // The URL for this instance template. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceTemplateIdentityByHref : Instantiate InstanceTemplateIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByHref(href string) (_model *InstanceTemplateIdentityByHref, err error) { - _model = &InstanceTemplateIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByHref) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByHref unmarshals an instance of InstanceTemplateIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByID : InstanceTemplateIdentityByID struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByID struct { - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` -} - -// NewInstanceTemplateIdentityByID : Instantiate InstanceTemplateIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByID(id string) (_model *InstanceTemplateIdentityByID, err error) { - _model = &InstanceTemplateIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByID) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByID unmarshals an instance of InstanceTemplateIdentityByID from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -83780,9 +85858,9 @@ func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result return } -// InstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Create an instance template that creates instances by using a catalog offering. +// InstanceTemplatePrototypeInstanceTemplateByImage : Create an instance template that creates instances by using an image. // This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { +type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -83821,6 +85899,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -83843,15 +85923,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The boot volume attachment to create for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` // The additional instance network interfaces to create. NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` @@ -83863,10 +85936,10 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOffering (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOffering, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOffering{ - CatalogOffering: catalogOffering, +// NewInstanceTemplatePrototypeInstanceTemplateByImage : Instantiate InstanceTemplatePrototypeInstanceTemplateByImage (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImage(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByImage, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByImage{ + Image: image, PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, } @@ -83874,13 +85947,13 @@ func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(cata return } -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return @@ -83909,6 +85982,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -83933,7 +86010,7 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } @@ -83953,9 +86030,9 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s return } -// InstanceTemplatePrototypeInstanceTemplateByImage : Create an instance template that creates instances by using an image. +// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Create an instance template that creates instances by using a snapshot. // This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByImage struct { +type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -83994,6 +86071,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -84014,10 +86093,7 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { VPC VPCIdentityIntf `json:"vpc,omitempty"` // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` // The additional instance network interfaces to create. NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` @@ -84029,10 +86105,10 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateByImage : Instantiate InstanceTemplatePrototypeInstanceTemplateByImage (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImage(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByImage, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByImage{ - Image: image, +// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot{ + BootVolumeAttachment: bootVolumeAttachment, PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, } @@ -84040,13 +86116,13 @@ func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImage(image ImageIde return } -func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return @@ -84075,6 +86151,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -84095,11 +86175,7 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } @@ -84119,9 +86195,9 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json return } -// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Create an instance template that creates instances by using a snapshot. +// InstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Create an instance template from an existing instance template. // This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { +type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -84160,164 +86236,7 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Create an instance template from an existing instance template. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -84412,6 +86331,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -84516,6 +86439,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -84610,6 +86535,10 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -84706,6 +86635,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -84793,6 +86724,10 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -84889,6 +86824,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -84973,6 +86910,10 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -88452,6 +90393,141 @@ func UnmarshalRegionIdentityByName(m map[string]json.RawMessage, result interfac return } +// ReservationIdentityByCRN : ReservationIdentityByCRN struct +// This model "extends" ReservationIdentity +type ReservationIdentityByCRN struct { + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` +} + +// NewReservationIdentityByCRN : Instantiate ReservationIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByCRN(crn string) (_model *ReservationIdentityByCRN, err error) { + _model = &ReservationIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByCRN) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByCRN unmarshals an instance of ReservationIdentityByCRN from the specified map of raw messages. +func UnmarshalReservationIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentityByHref : ReservationIdentityByHref struct +// This model "extends" ReservationIdentity +type ReservationIdentityByHref struct { + // The URL for this reservation. + Href *string `json:"href" validate:"required"` +} + +// NewReservationIdentityByHref : Instantiate ReservationIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByHref(href string) (_model *ReservationIdentityByHref, err error) { + _model = &ReservationIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByHref) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByHref unmarshals an instance of ReservationIdentityByHref from the specified map of raw messages. +func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentityByID : ReservationIdentityByID struct +// This model "extends" ReservationIdentity +type ReservationIdentityByID struct { + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` +} + +// NewReservationIdentityByID : Instantiate ReservationIdentityByID (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByID(id string) (_model *ReservationIdentityByID, err error) { + _model = &ReservationIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByID) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByID unmarshals an instance of ReservationIdentityByID from the specified map of raw messages. +func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationProfileInstanceProfileReference : ReservationProfileInstanceProfileReference struct +// This model "extends" ReservationProfile +type ReservationProfileInstanceProfileReference struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationProfileInstanceProfileReference.ResourceType property. +// The resource type. +const ( + ReservationProfileInstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" +) + +func (*ReservationProfileInstanceProfileReference) isaReservationProfile() bool { + return true +} + +// UnmarshalReservationProfileInstanceProfileReference unmarshals an instance of ReservationProfileInstanceProfileReference from the specified map of raw messages. +func UnmarshalReservationProfileInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfileInstanceProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ReservedIPTargetPrototypeEndpointGatewayIdentity : ReservedIPTargetPrototypeEndpointGatewayIdentity struct // Models which "extend" this model: // - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID @@ -100023,6 +102099,91 @@ func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMe return pager.GetAllWithContext(context.Background()) } +// ReservationsPager can be used to simplify the use of the "ListReservations" method. +type ReservationsPager struct { + hasNext bool + options *ListReservationsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewReservationsPager returns a new ReservationsPager instance. +func (vpc *VpcV1) NewReservationsPager(options *ListReservationsOptions) (pager *ReservationsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListReservationsOptions = *options + pager = &ReservationsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *ReservationsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *ReservationsPager) GetNextWithContext(ctx context.Context) (page []Reservation, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListReservationsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Reservations + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *ReservationsPager) GetAllWithContext(ctx context.Context) (allItems []Reservation, err error) { + for pager.HasNext() { + var nextPage []Reservation + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *ReservationsPager) GetNext() (page []Reservation, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *ReservationsPager) GetAll() (allItems []Reservation, err error) { + return pager.GetAllWithContext(context.Background()) +} + // DedicatedHostGroupsPager can be used to simplify the use of the "ListDedicatedHostGroups" method. type DedicatedHostGroupsPager struct { hasNext bool diff --git a/examples/ibm-is-ng/main.tf b/examples/ibm-is-ng/main.tf index b4ce696697..e0dd2f542c 100644 --- a/examples/ibm-is-ng/main.tf +++ b/examples/ibm-is-ng/main.tf @@ -1385,3 +1385,30 @@ resource "ibm_is_image_deprecate" "example" { resource "ibm_is_image_obsolete" "example" { image = ibm_is_image.image1.id } + +//reservation + +resource "ibm_is_reservation" "example" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" +} + +resource "ibm_is_reservation_activate" "example" { + reservation = ibm_is_reservation.example.id +} + +data "ibm_is_reservations" "example" { +} + +data "ibm_is_reservation" "example" { + identifier = ibm_is_reservation.example.id +} diff --git a/ibm/provider/provider.go b/ibm/provider/provider.go index 935ec84fbe..0b7d19e4f8 100644 --- a/ibm/provider/provider.go +++ b/ibm/provider/provider.go @@ -468,6 +468,8 @@ func Provider() *schema.Provider { "ibm_is_public_gateways": vpc.DataSourceIBMISPublicGateways(), "ibm_is_region": vpc.DataSourceIBMISRegion(), "ibm_is_regions": vpc.DataSourceIBMISRegions(), + "ibm_is_reservation": vpc.DataSourceIBMIsReservation(), + "ibm_is_reservations": vpc.DataSourceIBMIsReservations(), "ibm_is_ssh_key": vpc.DataSourceIBMISSSHKey(), "ibm_is_ssh_keys": vpc.DataSourceIBMIsSshKeys(), "ibm_is_subnet": vpc.DataSourceIBMISSubnet(), @@ -1054,6 +1056,8 @@ func Provider() *schema.Provider { "ibm_is_share_replica_operations": vpc.ResourceIbmIsShareReplicaOperations(), "ibm_is_share_mount_target": vpc.ResourceIBMIsShareMountTarget(), "ibm_is_subnet": vpc.ResourceIBMISSubnet(), + "ibm_is_reservation": vpc.ResourceIBMISReservation(), + "ibm_is_reservation_activate": vpc.ResourceIBMISReservationActivate(), "ibm_is_subnet_reserved_ip": vpc.ResourceIBMISReservedIP(), "ibm_is_subnet_network_acl_attachment": vpc.ResourceIBMISSubnetNetworkACLAttachment(), "ibm_is_subnet_public_gateway_attachment": vpc.ResourceIBMISSubnetPublicGatewayAttachment(), @@ -1484,6 +1488,7 @@ func Validator() validate.ValidatorDict { "ibm_is_vpn_gateway": vpc.ResourceIBMISVPNGatewayValidator(), "ibm_is_vpn_server": vpc.ResourceIBMIsVPNServerValidator(), "ibm_is_vpn_server_route": vpc.ResourceIBMIsVPNServerRouteValidator(), + "ibm_is_reservation": vpc.ResourceIBMISReservationValidator(), "ibm_kms_key_rings": kms.ResourceIBMKeyRingValidator(), "ibm_dns_glb_monitor": dnsservices.ResourceIBMPrivateDNSGLBMonitorValidator(), "ibm_dns_custom_resolver_forwarding_rule": dnsservices.ResourceIBMPrivateDNSForwardingRuleValidator(), diff --git a/ibm/service/vpc/data_source_ibm_is_reservation.go b/ibm/service/vpc/data_source_ibm_is_reservation.go new file mode 100644 index 0000000000..d943c688d7 --- /dev/null +++ b/ibm/service/vpc/data_source_ibm_is_reservation.go @@ -0,0 +1,430 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsReservation() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsReservationRead, + + Schema: map[string]*schema.Schema{ + + "identifier": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "identifier"}, + Description: "The reservation identifier.", + }, + + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ExactlyOneOf: []string{"name", "identifier"}, + Description: "The unique user-defined name for this reservation.", + }, + + "affinity_policy": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The affinity policy to use for this reservation.", + }, + "capacity": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "The capacity configuration for this reservation. If absent, this reservation has no assigned capacity.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allocated": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount allocated to this capacity reservation.", + }, + "available": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation available for new attachments.", + }, + "status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the capacity reservation.", + }, + "total": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The total amount of this capacity reservation.", + }, + "used": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation used by existing attachments.", + }, + }, + }, + }, + "committed_use": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "The committed use configuration for this reservation. If absent, this reservation has no commitment for use.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "expiration_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The expiration date and time for this committed use reservation.", + }, + "expiration_policy": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy to apply when the committed use term expires.", + }, + "term": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The term for this committed use reservation.", + }, + }, + }, + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the reservation was created.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + "lifecycle_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the reservation.", + }, + "profile": { + Type: schema.TypeList, + Computed: true, + Description: "The profile for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance profile.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this virtual server instance profile.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "resource_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The type of resource referenced.", + }, + "status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the reservation.", + }, + "status_reasons": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current status (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason.", + }, + "message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason.", + }, + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, + "zone": { + Type: schema.TypeString, + Computed: true, + Description: "The zone for this reservation.", + }, + }, + } +} + +func dataSourceIBMIsReservationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + var reservation *vpcv1.Reservation + + if v, ok := d.GetOk("identifier"); ok { + id := v.(string) + getReservationOptions := &vpcv1.GetReservationOptions{} + getReservationOptions.SetID(id) + reservationInfo, response, err := sess.GetReservationWithContext(context, getReservationOptions) + if err != nil { + log.Printf("[DEBUG] GetReservationWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] GetReservationWithContext failed %s\n%s", err, response)) + } + reservation = reservationInfo + + } else if v, ok := d.GetOk("name"); ok { + + name := v.(string) + start := "" + allrecs := []vpcv1.Reservation{} + for { + listReservationsOptions := &vpcv1.ListReservationsOptions{} + if start != "" { + listReservationsOptions.Start = &start + } + reservationCollection, response, err := sess.ListReservationsWithContext(context, listReservationsOptions) + if err != nil { + log.Printf("[DEBUG] ListReservationsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] ListReservationsWithContext failed %s\n%s", err, response)) + } + if reservationCollection != nil && *reservationCollection.TotalCount == int64(0) { + break + } + start = flex.GetNext(reservationCollection.Next) + allrecs = append(allrecs, reservationCollection.Reservations...) + if start == "" { + break + } + } + for _, reservationInfo := range allrecs { + if *reservationInfo.Name == name { + reservation = &reservationInfo + break + } + } + if reservation == nil { + return diag.FromErr(fmt.Errorf("[ERROR] No reservation found with name (%s)", name)) + } + } + + d.SetId(*reservation.ID) + if err = d.Set("affinity_policy", reservation.AffinityPolicy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting affinity_policy: %s", err)) + } + if reservation.Capacity != nil { + capacityList := []map[string]interface{}{} + capacityMap := dataSourceReservationCapacityToMap(*reservation.Capacity) + capacityList = append(capacityList, capacityMap) + if err = d.Set("capacity", capacityList); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting capacity: %s", err)) + } + } + if reservation.CommittedUse != nil { + committedUseList := []map[string]interface{}{} + committedUseMap := dataSourceReservationCommittedUseToMap(*reservation.CommittedUse) + committedUseList = append(committedUseList, committedUseMap) + if err = d.Set("committed_use", committedUseList); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting committed_use: %s", err)) + } + } + if err = d.Set("created_at", reservation.CreatedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + if err = d.Set("crn", reservation.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("href", reservation.Href); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) + } + if err = d.Set("lifecycle_state", reservation.LifecycleState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) + } + if err = d.Set("name", reservation.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if reservation.Profile != nil { + profileList := []map[string]interface{}{} + profile := reservation.Profile.(*vpcv1.ReservationProfile) + profileMap := dataSourceReservationProfileToMap(*profile) + profileList = append(profileList, profileMap) + if err = d.Set("profile", profileList); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile: %s", err)) + } + } + if reservation.ResourceGroup != nil { + resourceGroupList := []map[string]interface{}{} + resourceGroupMap := dataSourceReservationResourceGroupToMap(*reservation.ResourceGroup) + resourceGroupList = append(resourceGroupList, resourceGroupMap) + if err = d.Set("resource_group", resourceGroupList); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) + } + } + if err = d.Set("resource_type", reservation.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) + } + if err = d.Set("status", reservation.Status); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) + } + if reservation.StatusReasons != nil { + statusReasonsList := []map[string]interface{}{} + for _, statusReasonsItem := range reservation.StatusReasons { + statusReasonsList = append(statusReasonsList, dataSourceReservationStatusReasonsToMap(statusReasonsItem)) + } + if err = d.Set("status_reasons", statusReasonsList); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status_reasons: %s", err)) + } + } + zone := "" + if reservation.Zone != nil && reservation.Zone.Name != nil { + zone = *reservation.Zone.Name + } + if err = d.Set("zone", zone); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone: %s", err)) + } + return nil +} + +func dataSourceReservationProfileToMap(profileItem vpcv1.ReservationProfile) (profileMap map[string]interface{}) { + profileMap = map[string]interface{}{} + + if profileItem.Href != nil { + profileMap["href"] = profileItem.Href + } + if profileItem.Name != nil { + profileMap["name"] = profileItem.Name + } + if profileItem.ResourceType != nil { + profileMap["resource_type"] = profileItem.ResourceType + } + return profileMap +} + +func dataSourceReservationResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + return resourceGroupMap +} + +func dataSourceReservationCapacityToMap(capacityItem vpcv1.ReservationCapacity) (capacityMap map[string]interface{}) { + capacityMap = map[string]interface{}{} + + if capacityItem.Allocated != nil { + capacityMap["allocated"] = capacityItem.Allocated + } + if capacityItem.Available != nil { + capacityMap["available"] = capacityItem.Available + } + if capacityItem.Total != nil { + capacityMap["total"] = capacityItem.Total + } + if capacityItem.Used != nil { + capacityMap["used"] = capacityItem.Used + } + if capacityItem.Status != nil { + capacityMap["status"] = capacityItem.Status + } + return capacityMap +} + +func dataSourceReservationCommittedUseToMap(committedUseItem vpcv1.ReservationCommittedUse) (committedUseMap map[string]interface{}) { + committedUseMap = map[string]interface{}{} + + if committedUseItem.ExpirationAt != nil { + committedUseMap["expiration_at"] = committedUseItem.ExpirationAt.String() + } + if committedUseItem.ExpirationPolicy != nil { + committedUseMap["expiration_policy"] = committedUseItem.ExpirationPolicy + } + if committedUseItem.Term != nil { + committedUseMap["term"] = committedUseItem.Term + } + return committedUseMap +} + +func dataSourceReservationStatusReasonsToMap(statusReasonsItem vpcv1.ReservationStatusReason) (statusReasonsMap map[string]interface{}) { + statusReasonsMap = map[string]interface{}{} + + if statusReasonsItem.Code != nil { + statusReasonsMap["code"] = statusReasonsItem.Code + } + if statusReasonsItem.Message != nil { + statusReasonsMap["message"] = statusReasonsItem.Message + } + if statusReasonsItem.MoreInfo != nil { + statusReasonsMap["more_info"] = statusReasonsItem.MoreInfo + } + return statusReasonsMap +} diff --git a/ibm/service/vpc/data_source_ibm_is_reservation_test.go b/ibm/service/vpc/data_source_ibm_is_reservation_test.go new file mode 100644 index 0000000000..d51926cc28 --- /dev/null +++ b/ibm/service/vpc/data_source_ibm_is_reservation_test.go @@ -0,0 +1,58 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMISReservationDatasource_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testDSCheckIBMISReservationConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "id"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "created_at"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "crn"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "href"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "lifecycle_state"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "name"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "profile.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_group.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_type"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "zone"), + ), + }, + }, + }) +} + +func testDSCheckIBMISReservationConfig() string { + return fmt.Sprintf(` + resource "ibm_is_reservation" "res" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" + } + data "ibm_is_reservation" "ds_res" { + name = ibm_is_reservation.res.id + }`) +} diff --git a/ibm/service/vpc/data_source_ibm_is_reservations.go b/ibm/service/vpc/data_source_ibm_is_reservations.go new file mode 100644 index 0000000000..9a285461dc --- /dev/null +++ b/ibm/service/vpc/data_source_ibm_is_reservations.go @@ -0,0 +1,452 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsReservations() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsReservationsRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Description: "Filters the collection to resources with the exact specified name", + Optional: true, + }, + "zone_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Filters the collection to resources with a zone name property matching the exact specified name.", + }, + "resource_group": { + Type: schema.TypeString, + Description: "Filters the collection to resources in the resource group with the specified identifier", + Optional: true, + }, + "reservations": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of reservations.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "affinity_policy": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The affinity policy to use for this reservation.", + }, + "capacity": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "The capacity configuration for this reservation. If absent, this reservation has no assigned capacity.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allocated": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount allocated to this capacity reservation.", + }, + "available": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation available for new attachments.", + }, + "status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the capacity reservation.", + }, + "total": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The total amount of this capacity reservation.", + }, + "used": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation used by existing attachments.", + }, + }, + }, + }, + "committed_use": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "The committed use configuration for this reservation. If absent, this reservation has no commitment for use.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "expiration_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The expiration date and time for this committed use reservation.", + }, + "expiration_policy": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy to apply when the committed use term expires.", + }, + "term": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The term for this committed use reservation.", + }, + }, + }, + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the reservation was created.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + "lifecycle_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the reservation.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique user-defined name for this reservation.", + }, + "profile": { + Type: schema.TypeList, + Computed: true, + Description: "The profile for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance profile.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this virtual server instance profile.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "resource_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The type of resource referenced.", + }, + "status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the reservation.", + }, + "status_reasons": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current status (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason.", + }, + "message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason.", + }, + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, + "zone": { + Type: schema.TypeString, + Computed: true, + Description: "The zone for this reservation.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsReservationsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + zoneName := d.Get("zone_name").(string) + resourceGroupId := d.Get("resource_group").(string) + + start := "" + matchReservations := []vpcv1.Reservation{} + + var name string + if v, ok := d.GetOk("name"); ok { + name = v.(string) + } + + for { + listReservationsOptions := &vpcv1.ListReservationsOptions{} + if start != "" { + listReservationsOptions.Start = &start + } + if name != "" { + listReservationsOptions.SetName(name) + } + if zoneName != "" { + listReservationsOptions.SetZoneName(zoneName) + } + if resourceGroupId != "" { + listReservationsOptions.SetResourceGroupID(resourceGroupId) + } + reservationCollection, response, err := sess.ListReservationsWithContext(context, listReservationsOptions) + if err != nil { + log.Printf("[DEBUG] ListReservationsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] ListReservationsWithContext failed %s\n%s", err, response)) + } + if reservationCollection != nil && *reservationCollection.TotalCount == int64(0) { + break + } + start = flex.GetNext(reservationCollection.Next) + matchReservations = append(matchReservations, reservationCollection.Reservations...) + if start == "" { + break + } + } + + d.SetId(dataSourceIBMIsReservationsID(d)) + + if matchReservations != nil { + err = d.Set("reservations", dataSourceReservationCollectionFlattenReservations(matchReservations)) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting reservations %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsReservationsID returns a reasonable ID for the list. +func dataSourceIBMIsReservationsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceReservationCollectionFlattenReservations(result []vpcv1.Reservation) (reservations []map[string]interface{}) { + for _, reservationsItem := range result { + reservations = append(reservations, dataSourceReservationCollectionReservationsToMap(reservationsItem)) + } + return reservations +} + +func dataSourceReservationCollectionReservationsToMap(reservationsItem vpcv1.Reservation) (reservationsMap map[string]interface{}) { + reservationsMap = map[string]interface{}{} + + if reservationsItem.AffinityPolicy != nil { + reservationsMap["affinity_policy"] = reservationsItem.AffinityPolicy + } + if reservationsItem.Capacity != nil { + capacityList := []map[string]interface{}{} + capacityMap := dataSourceReservationCollectionReservationsCapacityToMap(*reservationsItem.Capacity) + capacityList = append(capacityList, capacityMap) + reservationsMap["capacity"] = capacityList + } + if reservationsItem.CommittedUse != nil { + committedUseList := []map[string]interface{}{} + committedUseMap := dataSourceReservationCollectionReservationsCommittedUseToMap(*reservationsItem.CommittedUse) + committedUseList = append(committedUseList, committedUseMap) + reservationsMap["committed_use"] = committedUseList + } + if reservationsItem.CreatedAt != nil { + reservationsMap["created_at"] = reservationsItem.CreatedAt.String() + } + if reservationsItem.CRN != nil { + reservationsMap["crn"] = reservationsItem.CRN + } + if reservationsItem.Href != nil { + reservationsMap["href"] = reservationsItem.Href + } + if reservationsItem.ID != nil { + reservationsMap["id"] = reservationsItem.ID + } + if reservationsItem.LifecycleState != nil { + reservationsMap["lifecycle_state"] = reservationsItem.LifecycleState + } + if reservationsItem.Name != nil { + reservationsMap["name"] = reservationsItem.Name + } + if reservationsItem.Profile != nil { + profileList := []map[string]interface{}{} + profile := reservationsItem.Profile.(*vpcv1.ReservationProfile) + profileMap := dataSourceReservationCollectionReservationsProfileToMap(*profile) + profileList = append(profileList, profileMap) + reservationsMap["profile"] = profileList + } + if reservationsItem.ResourceGroup != nil { + resourceGroupList := []map[string]interface{}{} + resourceGroupMap := dataSourceReservationCollectionReservationsResourceGroupToMap(*reservationsItem.ResourceGroup) + resourceGroupList = append(resourceGroupList, resourceGroupMap) + reservationsMap["resource_group"] = resourceGroupList + } + if reservationsItem.ResourceType != nil { + reservationsMap["resource_type"] = reservationsItem.ResourceType + } + if reservationsItem.Status != nil { + reservationsMap["status"] = reservationsItem.Status + } + if reservationsItem.StatusReasons != nil { + statusReasonsList := []map[string]interface{}{} + for _, statusReasonsItem := range reservationsItem.StatusReasons { + statusReasonsList = append(statusReasonsList, dataSourceReservationCollectionReservationsStatusReasonsToMap(statusReasonsItem)) + } + reservationsMap["status_reasons"] = statusReasonsList + } + if reservationsItem.Zone != nil && reservationsItem.Zone.Name != nil { + reservationsMap["zone"] = *reservationsItem.Zone.Name + } + return reservationsMap +} + +func dataSourceReservationCollectionReservationsProfileToMap(profileItem vpcv1.ReservationProfile) (profileMap map[string]interface{}) { + profileMap = map[string]interface{}{} + + if profileItem.Href != nil { + profileMap["href"] = profileItem.Href + } + if profileItem.Name != nil { + profileMap["name"] = profileItem.Name + } + if profileItem.ResourceType != nil { + profileMap["resource_type"] = profileItem.ResourceType + } + return profileMap +} + +func dataSourceReservationCollectionReservationsResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + return resourceGroupMap +} + +func dataSourceReservationCollectionReservationsCapacityToMap(capacityItem vpcv1.ReservationCapacity) (capacityMap map[string]interface{}) { + capacityMap = map[string]interface{}{} + + if capacityItem.Allocated != nil { + capacityMap["allocated"] = capacityItem.Allocated + } + if capacityItem.Available != nil { + capacityMap["available"] = capacityItem.Available + } + if capacityItem.Total != nil { + capacityMap["total"] = capacityItem.Total + } + if capacityItem.Used != nil { + capacityMap["used"] = capacityItem.Used + } + if capacityItem.Status != nil { + capacityMap["status"] = capacityItem.Status + } + return capacityMap +} + +func dataSourceReservationCollectionReservationsCommittedUseToMap(committedUseItem vpcv1.ReservationCommittedUse) (committedUseMap map[string]interface{}) { + committedUseMap = map[string]interface{}{} + + if committedUseItem.ExpirationAt != nil { + committedUseMap["expiration_at"] = committedUseItem.ExpirationAt.String() + } + if committedUseItem.ExpirationPolicy != nil { + committedUseMap["expiration_policy"] = committedUseItem.ExpirationPolicy + } + if committedUseItem.Term != nil { + committedUseMap["term"] = committedUseItem.Term + } + return committedUseMap +} + +func dataSourceReservationCollectionReservationsStatusReasonsToMap(statusReasonsItem vpcv1.ReservationStatusReason) (statusReasonsMap map[string]interface{}) { + statusReasonsMap = map[string]interface{}{} + + if statusReasonsItem.Code != nil { + statusReasonsMap["code"] = statusReasonsItem.Code + } + if statusReasonsItem.Message != nil { + statusReasonsMap["message"] = statusReasonsItem.Message + } + if statusReasonsItem.MoreInfo != nil { + statusReasonsMap["more_info"] = statusReasonsItem.MoreInfo + } + return statusReasonsMap +} diff --git a/ibm/service/vpc/data_source_ibm_is_reservations_test.go b/ibm/service/vpc/data_source_ibm_is_reservations_test.go new file mode 100644 index 0000000000..ac7419cebf --- /dev/null +++ b/ibm/service/vpc/data_source_ibm_is_reservations_test.go @@ -0,0 +1,46 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMIsReservationsDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIBMIsReservationsDataSourceConfigBasic(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.affinity_policy"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.created_at"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.crn"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.href"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.id"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.lifecycle_state"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.name"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.status"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.zone"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.resource_type"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.profile.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservations.example", "reservations.0.resource_group.#"), + ), + }, + }, + }) +} + +func testAccCheckIBMIsReservationsDataSourceConfigBasic() string { + return fmt.Sprintf(` + data "ibm_is_reservations" "example" { + } + `) +} diff --git a/ibm/service/vpc/resource_ibm_is_reservation.go b/ibm/service/vpc/resource_ibm_is_reservation.go new file mode 100644 index 0000000000..24475e3ba8 --- /dev/null +++ b/ibm/service/vpc/resource_ibm_is_reservation.go @@ -0,0 +1,647 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isReservation = "reservation" + isReservationName = "name" + isReservationAffinityPolicy = "affinity_policy" + isReservationCapacity = "capacity" + isReservationCapacityTotal = "total" + isReservationCommittedUse = "committed_use" + isReservationComittedUseExpirationPolicy = "expiration_policy" + isReservationComittedUseTerm = "term" + isReservationProfile = "profile" + isReservationProfileName = "name" + isReservationProfileResourceType = "resource_type" + isReservationResourceGroup = "resource_group" + isReservationZone = "zone" + + isReservationCapacityAllocated = "allocated" + isReservationCapacityAvailable = "available" + isReservationCapacityStatus = "status" + isReservationCapacityUsed = "used" + isReservationCommittedUseExpirationAt = "expiration_at" + isReservationCreatedAt = "created_at" + isReservationCrn = "crn" + isReservationHref = "href" + isReservationId = "id" + isReservationLifecycleState = "lifecycle_state" + isReservationProfileHref = "href" + isReservationResourceGroupHref = "href" + isReservationResourceGroupId = "id" + isReservationResourceGroupName = "name" + isReservationResourceType = "resource_type" + isReservationStatusReasons = "status_reasons" + isReservationStatusReasonCode = "code" + isReservationStatusReasonMessage = "message" + isReservationStatusReasonMoreInfo = "more_info" + isReservationZoneHref = "href" + isReservationZoneName = "name" + isReservationStatus = "status" +) + +func ResourceIBMISReservation() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMISReservationCreate, + Read: resourceIBMISReservationRead, + Update: resourceIBMISReservationUpdate, + Delete: resourceIBMISReservationDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicy: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_is_reservation", isReservationAffinityPolicy), + Description: "The affinity policy to use for this reservation", + }, + isReservationCapacity: &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Required: true, + Description: "The capacity reservation configuration to use", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationCapacityTotal: &schema.Schema{ + Type: schema.TypeInt, + Required: true, + Description: "The total amount to use for this capacity reservation.", + }, + isReservationCapacityAllocated: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount allocated to this capacity reservation.", + }, + isReservationCapacityAvailable: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation available for new attachments.", + }, + isReservationCapacityUsed: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation used by existing attachments.", + }, + isReservationCapacityStatus: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the capacity reservation.", + }, + }, + }, + }, + isReservationCommittedUse: &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Required: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationComittedUseExpirationPolicy: &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The maximum number of days to keep each backup after creation.", + }, + isReservationComittedUseTerm: &schema.Schema{ + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_is_reservation", isReservationComittedUseTerm), + Description: "The maximum number of recent backups to keep. If unspecified, there will be no maximum.", + }, + isReservationCommittedUseExpirationAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The expiration date and time for this committed use reservation.", + }, + }, + }, + }, + isReservationCreatedAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the reservation was created.", + }, + isReservationCrn: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validate.InvokeValidator("ibm_is_reservation", isReservationName), + Description: "Reservation name", + }, + isReservationProfile: &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Required: true, + Description: "The profile to use for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationProfileName: &schema.Schema{ + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_is_reservation", isReservationProfileName), + Description: "The globally unique name for this virtual server instance profile.", + }, + isReservationProfileResourceType: &schema.Schema{ + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_is_reservation", isReservationProfileResourceType), + Description: "The resource type of the profile.", + }, + isReservationProfileHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance profile.", + }, + }, + }, + }, + isReservationResourceGroup: &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationResourceGroupHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + isReservationResourceGroupId: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The unique identifier for this resource group", + }, + isReservationResourceGroupName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name for this resource group.", + }, + }, + }, + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the reservation.", + }, + isReservationStatusReasons: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationStatusReasonCode: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: " snake case string succinctly identifying the status reason.", + }, + isReservationStatusReasonMessage: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "An explanation of the status reason", + }, + isReservationStatusReasonMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, + isReservationZone: { + Type: schema.TypeString, + Required: true, + Description: "The globally unique name for this zone.", + }, + }, + } +} + +func ResourceIBMISReservationValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + affinityPolicy := "restricted" + term := "one_year,three_year" + resourceType := "instance_profile" + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$`, + MinValueLength: 1, + MaxValueLength: 63}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationAffinityPolicy, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: affinityPolicy}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationComittedUseTerm, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: term}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationProfileResourceType, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: resourceType}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationProfileName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$`, + MinValueLength: 1, + MaxValueLength: 63}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isReservationZone, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$`, + MinValueLength: 1, + MaxValueLength: 63}) + ibmISVPCResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_reservation", Schema: validateSchema} + return &ibmISVPCResourceValidator +} + +func resourceIBMISReservationCreate(d *schema.ResourceData, meta interface{}) error { + + createReservationOptions := &vpcv1.CreateReservationOptions{} + if _, ok := d.GetOk(isReservationCapacity); ok { + resCapacity := d.Get(isReservationCapacity + ".0").(map[string]interface{}) + reservationCapacityPrototype := &vpcv1.ReservationCapacityPrototype{} + + if resCapacity[isReservationCapacityTotal] != nil { + reservationCapacityPrototype.Total = core.Int64Ptr(int64(resCapacity[isReservationCapacityTotal].(int))) + } + createReservationOptions.Capacity = reservationCapacityPrototype + } + + if _, ok := d.GetOk(isReservationCommittedUse); ok { + resCommittedUse := d.Get(isReservationCommittedUse + ".0").(map[string]interface{}) + reservationCommittedUsePrototype := &vpcv1.ReservationCommittedUsePrototype{} + + if resCommittedUse[isReservationComittedUseTerm] != nil { + reservationCommittedUsePrototype.Term = core.StringPtr(resCommittedUse[isReservationComittedUseTerm].(string)) + } + if resCommittedUse[isReservationComittedUseExpirationPolicy] != nil { + reservationCommittedUsePrototype.ExpirationPolicy = core.StringPtr(resCommittedUse[isReservationComittedUseExpirationPolicy].(string)) + } + createReservationOptions.CommittedUse = reservationCommittedUsePrototype + } + + if _, ok := d.GetOk(isReservationProfile); ok { + resProfile := d.Get(isReservationProfile + ".0").(map[string]interface{}) + reservationProfilePrototype := &vpcv1.ReservationProfilePrototype{} + + if resProfile[isReservationProfileName] != nil { + reservationProfilePrototype.Name = core.StringPtr(resProfile[isReservationProfileName].(string)) + } + if resProfile[isReservationProfileResourceType] != nil { + reservationProfilePrototype.ResourceType = core.StringPtr(resProfile[isReservationProfileResourceType].(string)) + } + createReservationOptions.Profile = reservationProfilePrototype + } + + if _, ok := d.GetOk(isReservationZone); ok { + zone := core.StringPtr(d.Get(isReservationZone).(string)) + createReservationOptions.Zone = &vpcv1.ZoneIdentity{Name: zone} + } + + if name, ok := d.GetOk(isReservationName); ok { + createReservationOptions.Name = core.StringPtr(name.(string)) + } + + if affPol, ok := d.GetOk(isReservationAffinityPolicy); ok { + createReservationOptions.AffinityPolicy = core.StringPtr(affPol.(string)) + } + sess, err := vpcClient(meta) + + reservation, response, err := sess.CreateReservation(createReservationOptions) + if err != nil { + log.Printf("[DEBUG] Reservation creation err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Reservation %s\n%v", err, response) + } + d.SetId(*reservation.ID) + log.Printf("[INFO] Reservation : %s", *reservation.ID) + + return resourceIBMISReservationRead(d, meta) +} + +func resourceIBMISReservationRead(d *schema.ResourceData, meta interface{}) error { + + id := d.Id() + + sess, err := vpcClient(meta) + if err != nil { + return err + } + getReservationOptions := &vpcv1.GetReservationOptions{ + ID: &id, + } + reservation, response, err := sess.GetReservation(getReservationOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error Getting Reservation (%s): %s\n%s", id, err, response) + } + + if reservation.AffinityPolicy != nil { + if err = d.Set(isReservationAffinityPolicy, reservation.AffinityPolicy); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationAffinityPolicy, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationAffinityPolicy, err) + } + } + + if reservation.Capacity != nil { + capacityMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.Capacity.Allocated != nil { + finalList[isReservationCapacityAllocated] = flex.IntValue(reservation.Capacity.Allocated) + } + if reservation.Capacity.Available != nil { + finalList[isReservationCapacityAvailable] = flex.IntValue(reservation.Capacity.Available) + } + if reservation.Capacity.Total != nil { + finalList[isReservationCapacityTotal] = flex.IntValue(reservation.Capacity.Total) + } + if reservation.Capacity.Used != nil { + finalList[isReservationCapacityUsed] = flex.IntValue(reservation.Capacity.Used) + } + if reservation.Capacity.Status != nil { + finalList[isReservationCapacityStatus] = reservation.Capacity.Status + } + capacityMap = append(capacityMap, finalList) + d.Set(isReservationCapacity, capacityMap) + } + + if reservation.CommittedUse != nil { + committedUseMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.CommittedUse.ExpirationAt != nil { + finalList[isReservationCommittedUseExpirationAt] = flex.DateTimeToString(reservation.CommittedUse.ExpirationAt) + } + if reservation.CommittedUse.ExpirationPolicy != nil { + finalList[isReservationComittedUseExpirationPolicy] = *reservation.CommittedUse.ExpirationPolicy + } + if reservation.CommittedUse.Term != nil { + finalList[isReservationComittedUseTerm] = *reservation.CommittedUse.Term + } + committedUseMap = append(committedUseMap, finalList) + d.Set(isReservationCommittedUse, committedUseMap) + } + + if reservation.CreatedAt != nil { + if err = d.Set(isReservationCreatedAt, flex.DateTimeToString(reservation.CreatedAt)); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationCreatedAt, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationCreatedAt, err) + } + } + + if reservation.CRN != nil { + if err = d.Set(isReservationCrn, reservation.CRN); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationCrn, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationCrn, err) + } + } + + if reservation.Href != nil { + if err = d.Set(isReservationHref, reservation.Href); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationHref, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationHref, err) + } + } + + if reservation.LifecycleState != nil { + if err = d.Set(isReservationLifecycleState, reservation.LifecycleState); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationLifecycleState, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationLifecycleState, err) + } + } + + if reservation.Name != nil { + if err = d.Set(isReservationName, reservation.Name); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationName, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationName, err) + } + } + + if reservation.Profile != nil { + profileMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + profileItem := reservation.Profile.(*vpcv1.ReservationProfile) + + if profileItem.Href != nil { + finalList[isReservationProfileHref] = profileItem.Href + } + if profileItem.Name != nil { + finalList[isReservationProfileName] = profileItem.Name + } + if profileItem.ResourceType != nil { + finalList[isReservationProfileResourceType] = profileItem.ResourceType + } + profileMap = append(profileMap, finalList) + d.Set(isReservationProfile, profileMap) + } + + if reservation.ResourceGroup != nil { + rgMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.ResourceGroup.Href != nil { + finalList[isReservationResourceGroupHref] = reservation.ResourceGroup.Href + } + if reservation.ResourceGroup.ID != nil { + finalList[isReservationResourceGroupId] = reservation.ResourceGroup.ID + } + if reservation.ResourceGroup.Name != nil { + finalList[isReservationResourceGroupName] = reservation.ResourceGroup.Name + } + rgMap = append(rgMap, finalList) + d.Set(isReservationResourceGroup, rgMap) + } + + if reservation.ResourceType != nil { + if err = d.Set(isReservationResourceType, reservation.ResourceType); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationResourceType, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationResourceType, err) + } + } + + if reservation.Status != nil { + if err = d.Set(isReservationStatus, reservation.Status); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationStatus, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationStatus, err) + } + } + + if reservation.StatusReasons != nil { + srLen := len(reservation.StatusReasons) + srList := []vpcv1.ReservationStatusReason{} + + for i := 0; i < srLen; i++ { + srList = append(srList, reservation.StatusReasons[i]) + } + d.Set(isReservationStatusReasons, srList) + } + + if reservation.Zone != nil && reservation.Zone.Name != nil { + if err = d.Set(isReservationZone, reservation.Zone.Name); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationZone, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationZone, err) + } + } + return nil +} + +func resourceIBMISReservationUpdate(d *schema.ResourceData, meta interface{}) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + hasChanged := false + name := "" + + reservationPatchModel := &vpcv1.ReservationPatch{} + if d.HasChange(isReservationName) { + name = d.Get(isReservationName).(string) + reservationPatchModel.Name = &name + hasChanged = true + } + if d.HasChange(isReservationCapacity) { + capacityIntf := d.Get(isReservationCapacity) + capacityMap := capacityIntf.([]interface{})[0].(map[string]interface{}) + if d.HasChange(isReservationCapacity + ".0." + isReservationCapacityTotal) { + if totalIntf, ok := capacityMap[isReservationCapacityTotal]; ok { + reservationPatchModel.Capacity = &vpcv1.ReservationCapacityPatch{ + Total: core.Int64Ptr(int64(totalIntf.(int))), + } + } + } + } + if d.HasChange(isReservationCommittedUse) { + committedUseIntf := d.Get(isReservationCommittedUse) + committedUseMap := committedUseIntf.([]interface{})[0].(map[string]interface{}) + cuPatch := &vpcv1.ReservationCommittedUsePatch{} + if d.HasChange(isReservationCommittedUse + ".0." + isReservationComittedUseExpirationPolicy) { + if expPolIntf, ok := committedUseMap[isReservationComittedUseExpirationPolicy]; ok { + cuPatch.ExpirationPolicy = core.StringPtr(string(expPolIntf.(string))) + } + } + if d.HasChange(isReservationCommittedUse + ".0." + isReservationComittedUseTerm) { + if termIntf, ok := committedUseMap[isReservationComittedUseTerm]; ok { + cuPatch.Term = core.StringPtr(string(termIntf.(string))) + } + } + reservationPatchModel.CommittedUse = cuPatch + } + if d.HasChange(isReservationProfile) { + profileIntf := d.Get(isReservationProfile) + profileMap := profileIntf.([]interface{})[0].(map[string]interface{}) + profPatch := &vpcv1.ReservationProfilePatch{} + if d.HasChange(isReservationProfile + ".0." + isReservationProfileName) { + if profNameIntf, ok := profileMap[isReservationProfileName]; ok { + profPatch.Name = core.StringPtr(string(profNameIntf.(string))) + } + } + if d.HasChange(isReservationProfile + ".0." + isReservationProfileResourceType) { + if resTypeIntf, ok := profileMap[isReservationProfileResourceType]; ok { + profPatch.ResourceType = core.StringPtr(string(resTypeIntf.(string))) + } + } + reservationPatchModel.Profile = profPatch + } + if hasChanged { + reservationPatch, err := reservationPatchModel.AsPatch() + if err != nil { + return fmt.Errorf("[ERROR] Error calling asPatch for ReservationPatch: %s", err) + } + updateReservationOptions := &vpcv1.UpdateReservationOptions{} + updateReservationOptions.ReservationPatch = reservationPatch + updateReservationOptions.ID = core.StringPtr(d.Id()) + _, response, err := sess.UpdateReservation(updateReservationOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Updating Reservation : %s\n%s", err, response) + } + } + return resourceIBMISReservationRead(d, meta) +} + +func resourceIBMISReservationDelete(d *schema.ResourceData, meta interface{}) error { + id := d.Id() + sess, err := vpcClient(meta) + if err != nil { + return err + } + + deleteReservationOptions := &vpcv1.DeleteReservationOptions{ + ID: &id, + } + _, _, err = sess.DeleteReservation(deleteReservationOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Reservation : %s", err) + } + d.SetId("") + return nil +} diff --git a/ibm/service/vpc/resource_ibm_is_reservation_activate.go b/ibm/service/vpc/resource_ibm_is_reservation_activate.go new file mode 100644 index 0000000000..8379f63eb8 --- /dev/null +++ b/ibm/service/vpc/resource_ibm_is_reservation_activate.go @@ -0,0 +1,421 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "fmt" + "log" + "runtime/debug" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMISReservationActivate() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMISReservationActivateCreate, + Read: resourceIBMISReservationActivateRead, + Delete: resourceIBMISReservationActivateDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + isReservation: &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The unique identifier for this reservation.", + }, + isReservationAffinityPolicy: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The affinity policy to use for this reservation", + }, + isReservationCapacity: &schema.Schema{ + Type: schema.TypeList, + ForceNew: true, + Computed: true, + Description: "The capacity reservation configuration to use", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationCapacityTotal: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The total amount to use for this capacity reservation.", + }, + isReservationCapacityAllocated: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount allocated to this capacity reservation.", + }, + isReservationCapacityAvailable: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation available for new attachments.", + }, + isReservationCapacityUsed: &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The amount of this capacity reservation used by existing attachments.", + }, + isReservationCapacityStatus: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the capacity reservation.", + }, + }, + }, + }, + isReservationCommittedUse: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationComittedUseExpirationPolicy: &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The maximum number of days to keep each backup after creation.", + }, + isReservationComittedUseTerm: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The maximum number of recent backups to keep. If unspecified, there will be no maximum.", + }, + isReservationCommittedUseExpirationAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The expiration date and time for this committed use reservation.", + }, + }, + }, + }, + isReservationCreatedAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the reservation was created.", + }, + isReservationCrn: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "Reservation name", + }, + isReservationProfile: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The profile used for this reservation.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationProfileName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this virtual server instance profile.", + }, + isReservationProfileResourceType: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type of the profile.", + }, + isReservationProfileHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance profile.", + }, + }, + }, + }, + isReservationResourceGroup: &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationResourceGroupHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + isReservationResourceGroupId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group", + }, + isReservationResourceGroupName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name for this resource group.", + }, + }, + }, + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the reservation.", + }, + isReservationStatusReasons: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The committed use configuration to use for this reservation", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationStatusReasonCode: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: " snake case string succinctly identifying the status reason.", + }, + isReservationStatusReasonMessage: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason", + }, + isReservationStatusReasonMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, + isReservationZone: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this zone.", + }, + }, + } +} +func resourceIBMISReservationActivateCreate(d *schema.ResourceData, meta interface{}) error { + + id := d.Get(isReservation).(string) + activateReservationOptions := &vpcv1.ActivateReservationOptions{ + ID: core.StringPtr(id), + } + + sess, err := vpcClient(meta) + if err != nil { + return err + } + + response, err := sess.ActivateReservation(activateReservationOptions) + if err != nil { + log.Printf("[DEBUG] Reservation activation err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while activating Reservation %s\n%v", err, response) + } + log.Printf("[INFO] Reservation activated: %s", id) + d.SetId(id) + + return resourceIBMISReservationActivateRead(d, meta) +} + +func resourceIBMISReservationActivateRead(d *schema.ResourceData, meta interface{}) error { + + id := d.Id() + + sess, err := vpcClient(meta) + defer func() { + + log.Println("stacktrace from panic: \n", err, string(debug.Stack())) + + }() + if err != nil { + return err + } + getReservationOptions := &vpcv1.GetReservationOptions{ + ID: &id, + } + reservation, response, err := sess.GetReservation(getReservationOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error Getting Reservation (%s): %s\n%s", id, err, response) + } + + if reservation.AffinityPolicy != nil { + if err = d.Set(isReservationAffinityPolicy, reservation.AffinityPolicy); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationAffinityPolicy, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationAffinityPolicy, err) + } + } + + if reservation.Capacity != nil { + capacityMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.Capacity.Allocated != nil { + finalList[isReservationCapacityAllocated] = flex.IntValue(reservation.Capacity.Allocated) + } + if reservation.Capacity.Available != nil { + finalList[isReservationCapacityAvailable] = flex.IntValue(reservation.Capacity.Available) + } + if reservation.Capacity.Total != nil { + finalList[isReservationCapacityTotal] = flex.IntValue(reservation.Capacity.Total) + } + if reservation.Capacity.Used != nil { + finalList[isReservationCapacityUsed] = flex.IntValue(reservation.Capacity.Used) + } + if reservation.Capacity.Status != nil { + finalList[isReservationCapacityStatus] = reservation.Capacity.Status + } + capacityMap = append(capacityMap, finalList) + d.Set(isReservationCapacity, capacityMap) + } + + if reservation.CommittedUse != nil { + committedUseMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.CommittedUse.ExpirationAt != nil { + finalList[isReservationCommittedUseExpirationAt] = flex.DateTimeToString(reservation.CommittedUse.ExpirationAt) + } + if reservation.CommittedUse.ExpirationPolicy != nil { + finalList[isReservationComittedUseExpirationPolicy] = *reservation.CommittedUse.ExpirationPolicy + } + if reservation.CommittedUse.Term != nil { + finalList[isReservationComittedUseTerm] = *reservation.CommittedUse.Term + } + committedUseMap = append(committedUseMap, finalList) + d.Set(isReservationCommittedUse, committedUseMap) + } + + if reservation.CreatedAt != nil { + if err = d.Set(isReservationCreatedAt, flex.DateTimeToString(reservation.CreatedAt)); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationCreatedAt, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationCreatedAt, err) + } + } + + if reservation.CRN != nil { + if err = d.Set(isReservationCrn, reservation.CRN); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationCrn, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationCrn, err) + } + } + + if reservation.Href != nil { + if err = d.Set(isReservationHref, reservation.Href); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationHref, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationHref, err) + } + } + + if reservation.LifecycleState != nil { + if err = d.Set(isReservationLifecycleState, reservation.LifecycleState); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationLifecycleState, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationLifecycleState, err) + } + } + + if reservation.Name != nil { + if err = d.Set(isReservationName, reservation.Name); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationName, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationName, err) + } + } + + if reservation.Profile != nil { + profileMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + profileItem := reservation.Profile.(*vpcv1.ReservationProfile) + + if profileItem.Href != nil { + finalList[isReservationProfileHref] = profileItem.Href + } + if profileItem.Name != nil { + finalList[isReservationProfileName] = profileItem.Name + } + if profileItem.ResourceType != nil { + finalList[isReservationProfileResourceType] = profileItem.ResourceType + } + profileMap = append(profileMap, finalList) + d.Set(isReservationProfile, profileMap) + } + + if reservation.ResourceGroup != nil { + rgMap := []map[string]interface{}{} + finalList := map[string]interface{}{} + + if reservation.ResourceGroup.Href != nil { + finalList[isReservationResourceGroupHref] = reservation.ResourceGroup.Href + } + if reservation.ResourceGroup.ID != nil { + finalList[isReservationResourceGroupId] = reservation.ResourceGroup.ID + } + if reservation.ResourceGroup.Name != nil { + finalList[isReservationResourceGroupName] = reservation.ResourceGroup.Name + } + rgMap = append(rgMap, finalList) + d.Set(isReservationResourceGroup, rgMap) + } + + if reservation.ResourceType != nil { + if err = d.Set(isReservationResourceType, reservation.ResourceType); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationResourceType, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationResourceType, err) + } + } + + if reservation.Status != nil { + if err = d.Set(isReservationStatus, reservation.Status); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationStatus, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationStatus, err) + } + } + + if reservation.StatusReasons != nil { + srLen := len(reservation.StatusReasons) + srList := []vpcv1.ReservationStatusReason{} + + for i := 0; i < srLen; i++ { + srList = append(srList, reservation.StatusReasons[i]) + } + d.Set(isReservationStatusReasons, srList) + } + + if reservation.Zone != nil && reservation.Zone.Name != nil { + if err = d.Set(isReservationZone, reservation.Zone.Name); err != nil { + log.Printf("[ERROR] Error setting %s: %s", isReservationZone, err) + return fmt.Errorf("[ERROR] Error setting %s: %s", isReservationZone, err) + } + } + return nil +} + +func resourceIBMISReservationActivateDelete(d *schema.ResourceData, meta interface{}) error { + d.SetId("") + return nil +} diff --git a/ibm/service/vpc/resource_ibm_is_reservation_activate_test.go b/ibm/service/vpc/resource_ibm_is_reservation_activate_test.go new file mode 100644 index 0000000000..eef1f6127c --- /dev/null +++ b/ibm/service/vpc/resource_ibm_is_reservation_activate_test.go @@ -0,0 +1,110 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc_test + +import ( + "errors" + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccIBMISReservationActivate_basic(t *testing.T) { + var reservation string + name := fmt.Sprintf("tfresa-name-%d", acctest.RandIntRange(10, 100)) + zone := "us-east-3" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheckImage(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: checkReservationActivateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMISReservationActivateConfig(name, zone), + Check: resource.ComposeTestCheckFunc( + testAccCheckIBMISReservationActivateExists("ibm_is_reservation.isExampleReservation", reservation), + resource.TestCheckResourceAttr( + "ibm_is_reservation.isExampleReservation", "name", name), + resource.TestCheckResourceAttr( + "ibm_is_reservation.isExampleReservation", "status", "active"), + ), + }, + }, + }) +} + +func checkReservationActivateDestroy(s *terraform.State) error { + + sess, _ := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_is_reservation" { + continue + } + + getresoptions := &vpcv1.GetReservationOptions{ + ID: &rs.Primary.ID, + } + _, _, err := sess.GetReservation(getresoptions) + if err == nil { + fmt.Printf("Reservation %s still exists: %s", rs.Primary.ID, err.Error()) + } + } + + return nil +} + +func testAccCheckIBMISReservationActivateExists(n, image string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return errors.New("No Record ID is set") + } + + sess, _ := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() + getimgoptions := &vpcv1.GetReservationOptions{ + ID: &rs.Primary.ID, + } + foundReservation, _, err := sess.GetReservation(getimgoptions) + if err != nil { + return err + } + image = *foundReservation.ID + + return nil + } +} + +func testAccCheckIBMISReservationActivateConfig(name, zone string) string { + return fmt.Sprintf(` + resource "ibm_is_reservation" "isExampleReservation" { + capacity { + total = 10 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + name = "%s" + zone = "%s" + } + resource ibm_is_reservation_activate activate { + reservation = ibm_is_reservation.isExampleReservation.id + } + `, name, zone) +} diff --git a/ibm/service/vpc/resource_ibm_is_reservation_test.go b/ibm/service/vpc/resource_ibm_is_reservation_test.go new file mode 100644 index 0000000000..2cc8a45d8d --- /dev/null +++ b/ibm/service/vpc/resource_ibm_is_reservation_test.go @@ -0,0 +1,111 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc_test + +import ( + "errors" + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccIBMISReservation_basic(t *testing.T) { + var reservation string + name := fmt.Sprintf("tfres-name-%d", acctest.RandIntRange(10, 100)) + zone := "us-east-3" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: checkReservationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMISReservationConfig(name, zone), + Check: resource.ComposeTestCheckFunc( + testAccCheckIBMISReservationExists("ibm_is_reservation.isExampleReservation", reservation), + resource.TestCheckResourceAttr("ibm_is_reservation.isExampleReservation", "name", name), + resource.TestCheckResourceAttr("ibm_is_reservation.isExampleReservation", "zone", zone), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "affinity_policy"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "created_at"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "crn"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "id"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "resource_type"), + resource.TestCheckResourceAttrSet("ibm_is_reservation.isExampleReservation", "status"), + ), + }, + }, + }) +} + +func checkReservationDestroy(s *terraform.State) error { + + sess, _ := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_is_reservation" { + continue + } + + getresoptions := &vpcv1.GetReservationOptions{ + ID: &rs.Primary.ID, + } + _, _, err := sess.GetReservation(getresoptions) + if err == nil { + fmt.Printf("Reservation %s still exists: %s", rs.Primary.ID, err.Error()) + } + } + + return nil +} + +func testAccCheckIBMISReservationExists(n, image string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return errors.New("No Record ID is set") + } + + sess, _ := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() + getimgoptions := &vpcv1.GetReservationOptions{ + ID: &rs.Primary.ID, + } + foundReservation, _, err := sess.GetReservation(getimgoptions) + if err != nil { + return err + } + image = *foundReservation.ID + + return nil + } +} + +func testAccCheckIBMISReservationConfig(name, zone string) string { + return fmt.Sprintf(` + resource "ibm_is_reservation" "isExampleReservation" { + capacity { + total = 10 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + name = "%s" + zone = "%s" + }`, name, zone) +} diff --git a/website/docs/d/is_reservation.html.markdown b/website/docs/d/is_reservation.html.markdown new file mode 100644 index 0000000000..461ab020e9 --- /dev/null +++ b/website/docs/d/is_reservation.html.markdown @@ -0,0 +1,151 @@ +--- +subcategory: "VPC infrastructure" +layout: "ibm" +page_title: "IBM : reservation" +description: |- + Manages IBM Cloud reservations. +--- + +# ibm_is_reservation +Retrieve information of an existing reservation as a read only data source. + +**Note:** +VPC infrastructure services are a regional specific based endpoint, by default targets to `us-south`. Please make sure to target right region in the provider block as shown in the `provider.tf` file, if VPC service is created in region other than `us-south`. + +**provider.tf** + +```terraform +provider "ibm" { + region = "eu-gb" +} +``` + +## Example usage +// Example to retrieve the reservation information by using reservation name. + +```terraform +resource "ibm_is_reservation" "res" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" +} +data "ibm_is_reservation" "ds_res" { + name = ibm_is_reservation.res.name +} + +``` +// Example to retrieve the reservation information by using reservation ID. + +```terraform +resource "ibm_is_reservation" "res" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" + } + data "ibm_is_reservation" "ds_res" { + identifier = ibm_is_reservation.res.id + } + +``` + +## Argument reference +Review the argument references that you can specify for your data source. + +- `identifier` - (Optional, String) The ID of the reservation,`name` and `identifier` are mutually exclusive. +- `name` - (Optional, String) The name of the reservation,`name` and `identifier` are mutually exclusive. + +## Attribute reference +In addition to all argument reference list, you can access the following attribute references after your data source is created. + +- `affinity_policy` - (String) The affinity policy to use for this reservation. +- `capacity` - (List) The capacity configuration for this reservation. If absent, this reservation has no assigned capacity. + + Nested scheme for `capacity`: + - `allocated` - (Integer) The amount allocated to this capacity reservation. + - `available` - (Integer) The amount of this capacity reservation available for new attachments. + - `status` - (String) The status of the capacity reservation: + ->**status** +
• allocating: The capacity reservation is being allocated for use +
• allocated: The total capacity of the reservation has been allocated for use +
• degraded: The capacity reservation has been allocated for use, but some of the capacity is not available +
• unallocated: The capacity reservation is not allocated for use + - `total` - (Integer) The total amount of this capacity reservation. + - `used` - (Integer) The amount of this capacity reservation used by existing attachments. +- `committed_use` - (List) The committed use configuration for this reservation. If absent, this reservation has no commitment for use. + + Nested scheme for `committed_use`: + - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. + - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy** +
• release: Release any available capacity and let the reservation expire +
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire + - `term` - (String) The status of the capacity reservation: + ->**term** +
• one_year: 1 year +
• three_year: 3 years +- `created_at` - (Timestamp) The date and time that the reservation was created. +- `crn` - (String) The CRN for this reservation. +- `href` - (String) The URL for this reservation. +- `id` - (String) The unique identifier for this reservation. +- `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state** +
• deleting +
• failed +
• pending +
• stable +
• suspended +
• updating +
• waiting +- `profile` - (List) The virtual server instance profile this reservation. + + Nested scheme for `profile`: + - `href` - (String) The URL for this virtual server instance profile. + - `name` - (String) The globally unique name for this virtual server instance profile. + - `resource_type` - (string) The resource type + ->**resource_type** +
• instance_profile +- `resource_group` - (List) The resource group for this reservation. + + Nested scheme for `resource_group`: + - `href` - (String) The URL for this resource group. + - `id` - (String) The unique identifier for this resource group. + - `name` - (String) The name for this resource group. +- `resource_type` - (String) The resource type. + ->**resource_type** +
• reservation +- `status` - (String) The status of the reservation. + ->**status** +
• activating +
• active +
• deactivating +
• expired +
• failed +
• inactive +- `status_reasons` - (List) The reasons for the current status (if any). + + Nested scheme for `status_reasons`: + - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code** +
• cannot_activate_no_capacity_available +
• cannot_renew_unsupported_profile_term + - `message` - (String) An explanation of the status reason. + - `more_info` - (string) Link to documentation about this status reason +- `zone` - (String) The globally unique name for this zone. \ No newline at end of file diff --git a/website/docs/d/is_reservations.html.markdown b/website/docs/d/is_reservations.html.markdown new file mode 100644 index 0000000000..4bee0d0079 --- /dev/null +++ b/website/docs/d/is_reservations.html.markdown @@ -0,0 +1,143 @@ +--- +subcategory: "VPC infrastructure" +layout: "ibm" +page_title: "IBM : Reservations" +description: |- + Manages IBM Cloud infrastructure reservations. +--- + +# ibm_is_reservations +Retrieve information of an existing reservations as a read only data source. + +**Note:** +VPC infrastructure services are a regional specific based endpoint, by default targets to `us-south`. Please make sure to target right region in the provider block as shown in the `provider.tf` file, if VPC service is created in region other than `us-south`. + +**provider.tf** + +```terraform +provider "ibm" { + region = "eu-gb" +} +``` + +## Example usage + +```terraform + +data "ibm_resource_group" "example" { + name = "Default" +} + +resource "ibm_is_reservation" "res" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" +} +data "ibm_is_reservations" "example1" { +} + +data "ibm_is_reservations" "example2" { + resource_group = data.ibm_resource_group.example.id +} + +data "ibm_is_reservations" "example3" { + zone_name = ibm_is_reservation.res.zone +} +``` + +## Argument reference + +Review the argument references that you can specify for your data source. + +* `resource_group` - (Optional, string) The id of the resource group. +* `zone_name` - (Optional, string) The name of the zone. + +## Attribute reference +You can access the following attribute references after your data source is created. + +- `reservations` - (List) Collection of reservations + +Nested scheme for `reservations`: + - `affinity_policy` - (String) The affinity policy to use for this reservation. + - `capacity` - (List) The capacity configuration for this reservation. If absent, this reservation has no assigned capacity. + + Nested scheme for `capacity`: + - `allocated` - (Integer) The amount allocated to this capacity reservation. + - `available` - (Integer) The amount of this capacity reservation available for new attachments. + - `status` - (String) The status of the capacity reservation: + ->**status** +
• allocating: The capacity reservation is being allocated for use +
• allocated: The total capacity of the reservation has been allocated for use +
• degraded: The capacity reservation has been allocated for use, but some of the capacity is not available +
• unallocated: The capacity reservation is not allocated for use + - `total` - (Integer) The total amount of this capacity reservation. + - `used` - (Integer) The amount of this capacity reservation used by existing attachments. + - `committed_use` - (List) The committed use configuration for this reservation. If absent, this reservation has no commitment for use. + + Nested scheme for `committed_use`: + - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. + - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy** +
• release: Release any available capacity and let the reservation expire +
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire + - `term` - (String) The status of the capacity reservation: + ->**term** +
• one_year: 1 year +
• three_year: 3 years + - `created_at` - (Timestamp) The date and time that the reservation was created. + - `crn` - (String) The CRN for this reservation. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state** +
• deleting +
• failed +
• pending +
• stable +
• suspended +
• updating +
• waiting + - `profile` - (List) The virtual server instance profile this reservation. + + Nested scheme for `profile`: + - `href` - (String) The URL for this virtual server instance profile. + - `name` - (String) The globally unique name for this virtual server instance profile. + - `resource_type` - (string) The resource type + ->**resource_type** +
• instance_profile + - `resource_group` - (List) The resource group for this reservation. + + Nested scheme for `resource_group`: + - `href` - (String) The URL for this resource group. + - `id` - (String) The unique identifier for this resource group. + - `name` - (String) The name for this resource group. + - `resource_type` - (String) The resource type. + ->**resource_type** +
• reservation + - `status` - (String) The status of the reservation. + ->**status** +
• activating +
• active +
• deactivating +
• expired +
• failed +
• inactive + - `status_reasons` - (List) The reasons for the current status (if any). + + Nested scheme for `status_reasons`: + - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code** +
• cannot_activate_no_capacity_available +
• cannot_renew_unsupported_profile_term + - `message` - (String) An explanation of the status reason. + - `more_info` - (string) Link to documentation about this status reason + - `zone` - (String) The globally unique name for this zone. \ No newline at end of file diff --git a/website/docs/r/is_reservation.html.markdown b/website/docs/r/is_reservation.html.markdown new file mode 100644 index 0000000000..4304c1c73a --- /dev/null +++ b/website/docs/r/is_reservation.html.markdown @@ -0,0 +1,164 @@ +--- + +subcategory: "VPC infrastructure" +layout: "ibm" +page_title: "IBM : reservation" +description: |- + Manages IBM reservation. +--- + +# ibm_is_reservation +Create, update, or delete a reservation. + +**Note:** +VPC infrastructure services are a regional specific based endpoint, by default targets to `us-south`. Please make sure to target right region in the provider block as shown in the `provider.tf` file, if VPC service is created in region other than `us-south`. + +**provider.tf** + +```terraform +provider "ibm" { + region = "eu-gb" +} +``` + + +## Example usage + +```terraform +resource "ibm_is_reservation" "example" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-terraform-1" +} +``` + + +## Argument reference +Review the argument references that you can specify for your resource. + +- `affinity_policy` - (Optional, String) affinity policy to use for this reservation. [ **restricted** ] +- `capacity` - (List) The capacity reservation configuration to use. + + Nested scheme for `capacity`: + - `total` - (Integer) The total amount to use for this capacity reservation. +- `committed_use` - (List) The committed use configuration to use for this reservation. + + Nested scheme for `committed_use`: + - `expiration_policy` - (Optional, String) The policy to apply when the committed use term expires. [**release**, **renew**] + ~> **Note:** + **•** `release` Release any available capacity and let the reservation expire.
+ **•** `renew` Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire.
+ - `term` - (String) The term for this committed use reservation. [**one_year**, **three_year**] +- `name` - (Optional, String) The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the name will be a hyphenated list of randomly-selected words. +- `profile` - (List) The virtual server instance profile to use for this reservation. + + Nested scheme for `profile`: + - `name` - (String) The globally unique name of the profile. + - `resource_type` - (String) The resource type of the profile. [ **instance_profile** ] +- `resource_group` - (Optional, List) The resource group to use. If unspecified, the account's default resource group will be used. + + Nested scheme for `resource_group`: + - `id` - (String) The unique identifier for this resource group. +- `zone` - (String) The zone to use for this reservation. + + +## Attribute reference +You can access the following attribute references after your data source is created. +- `affinity_policy` - (String) The affinity policy to use for this reservation. +- `capacity` - (List) The capacity configuration for this reservation. If absent, this reservation has no assigned capacity. + + Nested scheme for `capacity`: + - `allocated` - (Integer) The amount allocated to this capacity reservation. + - `available` - (Integer) The amount of this capacity reservation available for new attachments. + - `status` - (String) The status of the capacity reservation: + ->**status** +
• allocating: The capacity reservation is being allocated for use +
• allocated: The total capacity of the reservation has been allocated for use +
• degraded: The capacity reservation has been allocated for use, but some of the capacity is not available +
• unallocated: The capacity reservation is not allocated for use + - `total` - (Integer) The total amount of this capacity reservation. + - `used` - (Integer) The amount of this capacity reservation used by existing attachments. +- `committed_use` - (List) The committed use configuration for this reservation. If absent, this reservation has no commitment for use. + + Nested scheme for `committed_use`: + - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. + - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy** +
• release: Release any available capacity and let the reservation expire +
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire + - `term` - (String) The status of the capacity reservation: + ->**term** +
• one_year: 1 year +
• three_year: 3 years +- `created_at` - (Timestamp) The date and time that the reservation was created. +- `crn` - (String) The CRN for this reservation. +- `href` - (String) The URL for this reservation. +- `id` - (String) The unique identifier for this reservation. +- `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state** +
• deleting +
• failed +
• pending +
• stable +
• suspended +
• updating +
• waiting +- `profile` - (List) The virtual server instance profile this reservation. + + Nested scheme for `profile`: + - `href` - (String) The URL for this virtual server instance profile. + - `name` - (String) The globally unique name for this virtual server instance profile. + - `resource_type` - (string) The resource type + ->**resource_type** +
• instance_profile +- `resource_group` - (List) The resource group for this reservation. + + Nested scheme for `resource_group`: + - `href` - (String) The URL for this resource group. + - `id` - (String) The unique identifier for this resource group. + - `name` - (String) The name for this resource group. +- `resource_type` - (String) The resource type. + ->**resource_type** +
• reservation +- `status` - (String) The status of the reservation. + ->**status** +
• activating +
• active +
• deactivating +
• expired +
• failed +
• inactive +- `status_reasons` - (List) The reasons for the current status (if any). + + Nested scheme for `status_reasons`: + - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code** +
• cannot_activate_no_capacity_available +
• cannot_renew_unsupported_profile_term + - `message` - (String) An explanation of the status reason. + - `more_info` - (string) Link to documentation about this status reason +- `zone` - (String) The globally unique name for this zone. + +## Import +The `ibm_is_reservation` resource can be imported by using the ID. + +**Syntax** + +``` +$ terraform import ibm_is_reservation.example +``` + +**Example** + +``` +$ terraform import ibm_is_reservation.example d7bec597-4726-451f-8a63-e62e6f12122c +``` diff --git a/website/docs/r/is_reservation_activate.html.markdown b/website/docs/r/is_reservation_activate.html.markdown new file mode 100644 index 0000000000..db11c02e88 --- /dev/null +++ b/website/docs/r/is_reservation_activate.html.markdown @@ -0,0 +1,144 @@ +--- + +subcategory: "VPC infrastructure" +layout: "ibm" +page_title: "IBM: is_reservation_activate" +description: |- + Activates IBM VPC custom reservation. +--- + +# ibm_is_reservation_activate + +Provide support to activate a reservation. This resource activates a reservation, resulting in its status becoming `active`. + +**Note:** +VPC infrastructure services are a regional specific based endpoint, by default targets to `us-south`. Please make sure to target right region in the provider block as shown in the `provider.tf` file, if VPC service is created in region other than `us-south`. + +**provider.tf** + +```terraform +provider "ibm" { + region = "eu-gb" +} +``` + +## Example usage + +```terraform +resource "ibm_is_reservation" "example" { + capacity { + total = 10 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-terraform-1" +} + +resource "ibm_is_reservation_activate" "example_activation" { + reservation = ibm_is_reservation.example.id +} +``` + +## Argument reference +Review the argument references that you can specify for your resource. + +- `reservation` - (Required, Forces new resource, String) The id of the reservation to be activated. + +## Attribute reference +You can access the following attribute references after your data source is created. +- `affinity_policy` - (String) The affinity policy to use for this reservation. +- `capacity` - (List) The capacity configuration for this reservation. If absent, this reservation has no assigned capacity. + + Nested scheme for `capacity`: + - `allocated` - (Integer) The amount allocated to this capacity reservation. + - `available` - (Integer) The amount of this capacity reservation available for new attachments. + - `status` - (String) The status of the capacity reservation: + ->**status** +
• allocating: The capacity reservation is being allocated for use +
• allocated: The total capacity of the reservation has been allocated for use +
• degraded: The capacity reservation has been allocated for use, but some of the capacity is not available +
• unallocated: The capacity reservation is not allocated for use + - `total` - (Integer) The total amount of this capacity reservation. + - `used` - (Integer) The amount of this capacity reservation used by existing attachments. +- `committed_use` - (List) The committed use configuration for this reservation. If absent, this reservation has no commitment for use. + + Nested scheme for `committed_use`: + - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. + - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy** +
• release: Release any available capacity and let the reservation expire +
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire + - `term` - (String) The status of the capacity reservation: + ->**term** +
• one_year: 1 year +
• three_year: 3 years +- `created_at` - (Timestamp) The date and time that the reservation was created. +- `crn` - (String) The CRN for this reservation. +- `href` - (String) The URL for this reservation. +- `id` - (String) The unique identifier for this reservation. +- `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state** +
• deleting +
• failed +
• pending +
• stable +
• suspended +
• updating +
• waiting +- `profile` - (List) The virtual server instance profile this reservation. + + Nested scheme for `profile`: + - `href` - (String) The URL for this virtual server instance profile. + - `name` - (String) The globally unique name for this virtual server instance profile. + - `resource_type` - (string) The resource type + ->**resource_type** +
• instance_profile +- `resource_group` - (List) The resource group for this reservation. + + Nested scheme for `resource_group`: + - `href` - (String) The URL for this resource group. + - `id` - (String) The unique identifier for this resource group. + - `name` - (String) The name for this resource group. +- `resource_type` - (String) The resource type. + ->**resource_type** +
• reservation +- `status` - (String) The status of the reservation. + ->**status** +
• activating +
• active +
• deactivating +
• expired +
• failed +
• inactive +- `status_reasons` - (List) The reasons for the current status (if any). + + Nested scheme for `status_reasons`: + - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code** +
• cannot_activate_no_capacity_available +
• cannot_renew_unsupported_profile_term + - `message` - (String) An explanation of the status reason. + - `more_info` - (string) Link to documentation about this status reason +- `zone` - (String) The globally unique name for this zone. + + +## Import +The `ibm_is_reservation_activate` resource can be imported by using reservation ID. + +**Syntax** + +``` +$ terraform import ibm_is_reservation_activate.example_activation +``` + +**Example** + +``` +$ terraform import ibm_is_reservation_activate.example_activation d7bec597-4726-451f-8a63-e62e6f121c32c +``` From a9e2c5f691057607088e5c7c5cda50909b315f39 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:13:37 +0530 Subject: [PATCH 02/17] fix docs --- website/docs/d/is_reservation.html.markdown | 12 ++++++++++-- website/docs/d/is_reservations.html.markdown | 12 ++++++++++-- website/docs/r/is_reservation.html.markdown | 12 ++++++++++-- website/docs/r/is_reservation_activate.html.markdown | 12 ++++++++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/website/docs/d/is_reservation.html.markdown b/website/docs/d/is_reservation.html.markdown index 461ab020e9..74e211f5ae 100644 --- a/website/docs/d/is_reservation.html.markdown +++ b/website/docs/d/is_reservation.html.markdown @@ -81,7 +81,8 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `capacity`: - `allocated` - (Integer) The amount allocated to this capacity reservation. - `available` - (Integer) The amount of this capacity reservation available for new attachments. - - `status` - (String) The status of the capacity reservation: + - `status` - (String) The status of the capacity reservation. + ->**status**
• allocating: The capacity reservation is being allocated for use
• allocated: The total capacity of the reservation has been allocated for use @@ -94,10 +95,12 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `committed_use`: - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy**
• release: Release any available capacity and let the reservation expire
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire - - `term` - (String) The status of the capacity reservation: + - `term` - (String) The term for this committed use reservation. + ->**term**
• one_year: 1 year
• three_year: 3 years @@ -106,6 +109,7 @@ In addition to all argument reference list, you can access the following attribu - `href` - (String) The URL for this reservation. - `id` - (String) The unique identifier for this reservation. - `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state**
• deleting
• failed @@ -120,6 +124,7 @@ In addition to all argument reference list, you can access the following attribu - `href` - (String) The URL for this virtual server instance profile. - `name` - (String) The globally unique name for this virtual server instance profile. - `resource_type` - (string) The resource type + ->**resource_type**
• instance_profile - `resource_group` - (List) The resource group for this reservation. @@ -129,9 +134,11 @@ In addition to all argument reference list, you can access the following attribu - `id` - (String) The unique identifier for this resource group. - `name` - (String) The name for this resource group. - `resource_type` - (String) The resource type. + ->**resource_type**
• reservation - `status` - (String) The status of the reservation. + ->**status**
• activating
• active @@ -143,6 +150,7 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `status_reasons`: - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code**
• cannot_activate_no_capacity_available
• cannot_renew_unsupported_profile_term diff --git a/website/docs/d/is_reservations.html.markdown b/website/docs/d/is_reservations.html.markdown index 4bee0d0079..fdab2af9eb 100644 --- a/website/docs/d/is_reservations.html.markdown +++ b/website/docs/d/is_reservations.html.markdown @@ -73,7 +73,8 @@ Nested scheme for `reservations`: Nested scheme for `capacity`: - `allocated` - (Integer) The amount allocated to this capacity reservation. - `available` - (Integer) The amount of this capacity reservation available for new attachments. - - `status` - (String) The status of the capacity reservation: + - `status` - (String) The status of the capacity reservation. + ->**status**
• allocating: The capacity reservation is being allocated for use
• allocated: The total capacity of the reservation has been allocated for use @@ -86,10 +87,12 @@ Nested scheme for `reservations`: Nested scheme for `committed_use`: - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy**
• release: Release any available capacity and let the reservation expire
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire - - `term` - (String) The status of the capacity reservation: + - `term` - (String) The term for this committed use reservation. + ->**term**
• one_year: 1 year
• three_year: 3 years @@ -98,6 +101,7 @@ Nested scheme for `reservations`: - `href` - (String) The URL for this reservation. - `id` - (String) The unique identifier for this reservation. - `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state**
• deleting
• failed @@ -112,6 +116,7 @@ Nested scheme for `reservations`: - `href` - (String) The URL for this virtual server instance profile. - `name` - (String) The globally unique name for this virtual server instance profile. - `resource_type` - (string) The resource type + ->**resource_type**
• instance_profile - `resource_group` - (List) The resource group for this reservation. @@ -121,9 +126,11 @@ Nested scheme for `reservations`: - `id` - (String) The unique identifier for this resource group. - `name` - (String) The name for this resource group. - `resource_type` - (String) The resource type. + ->**resource_type**
• reservation - `status` - (String) The status of the reservation. + ->**status**
• activating
• active @@ -135,6 +142,7 @@ Nested scheme for `reservations`: Nested scheme for `status_reasons`: - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code**
• cannot_activate_no_capacity_available
• cannot_renew_unsupported_profile_term diff --git a/website/docs/r/is_reservation.html.markdown b/website/docs/r/is_reservation.html.markdown index 4304c1c73a..53fcc98aa2 100644 --- a/website/docs/r/is_reservation.html.markdown +++ b/website/docs/r/is_reservation.html.markdown @@ -79,7 +79,8 @@ You can access the following attribute references after your data source is crea Nested scheme for `capacity`: - `allocated` - (Integer) The amount allocated to this capacity reservation. - `available` - (Integer) The amount of this capacity reservation available for new attachments. - - `status` - (String) The status of the capacity reservation: + - `status` - (String) The status of the capacity reservation. + ->**status**
• allocating: The capacity reservation is being allocated for use
• allocated: The total capacity of the reservation has been allocated for use @@ -92,10 +93,12 @@ You can access the following attribute references after your data source is crea Nested scheme for `committed_use`: - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy**
• release: Release any available capacity and let the reservation expire
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire - - `term` - (String) The status of the capacity reservation: + - `term` - (String) The term for this committed use reservation. + ->**term**
• one_year: 1 year
• three_year: 3 years @@ -104,6 +107,7 @@ You can access the following attribute references after your data source is crea - `href` - (String) The URL for this reservation. - `id` - (String) The unique identifier for this reservation. - `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state**
• deleting
• failed @@ -118,6 +122,7 @@ You can access the following attribute references after your data source is crea - `href` - (String) The URL for this virtual server instance profile. - `name` - (String) The globally unique name for this virtual server instance profile. - `resource_type` - (string) The resource type + ->**resource_type**
• instance_profile - `resource_group` - (List) The resource group for this reservation. @@ -127,9 +132,11 @@ You can access the following attribute references after your data source is crea - `id` - (String) The unique identifier for this resource group. - `name` - (String) The name for this resource group. - `resource_type` - (String) The resource type. + ->**resource_type**
• reservation - `status` - (String) The status of the reservation. + ->**status**
• activating
• active @@ -141,6 +148,7 @@ You can access the following attribute references after your data source is crea Nested scheme for `status_reasons`: - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code**
• cannot_activate_no_capacity_available
• cannot_renew_unsupported_profile_term diff --git a/website/docs/r/is_reservation_activate.html.markdown b/website/docs/r/is_reservation_activate.html.markdown index db11c02e88..a60c5c890d 100644 --- a/website/docs/r/is_reservation_activate.html.markdown +++ b/website/docs/r/is_reservation_activate.html.markdown @@ -58,7 +58,8 @@ You can access the following attribute references after your data source is crea Nested scheme for `capacity`: - `allocated` - (Integer) The amount allocated to this capacity reservation. - `available` - (Integer) The amount of this capacity reservation available for new attachments. - - `status` - (String) The status of the capacity reservation: + - `status` - (String) The status of the capacity reservation. + ->**status**
• allocating: The capacity reservation is being allocated for use
• allocated: The total capacity of the reservation has been allocated for use @@ -71,10 +72,12 @@ You can access the following attribute references after your data source is crea Nested scheme for `committed_use`: - `expiration_at` - (Timestamp) The expiration date and time for this committed use reservation. - `expiration_policy` - (String) The policy to apply when the committed use term expires. + ->**expiration_policy**
• release: Release any available capacity and let the reservation expire
• renew: Renew for another term, provided the term remains listed in the reservation_terms for the profile. Otherwise, let the reservation expire - - `term` - (String) The status of the capacity reservation: + - `term` - (String) The term for this committed use reservation. + ->**term**
• one_year: 1 year
• three_year: 3 years @@ -83,6 +86,7 @@ You can access the following attribute references after your data source is crea - `href` - (String) The URL for this reservation. - `id` - (String) The unique identifier for this reservation. - `lifecycle_state` - (String) The lifecycle state of this reservation. + ->**lifecycle_state**
• deleting
• failed @@ -97,6 +101,7 @@ You can access the following attribute references after your data source is crea - `href` - (String) The URL for this virtual server instance profile. - `name` - (String) The globally unique name for this virtual server instance profile. - `resource_type` - (string) The resource type + ->**resource_type**
• instance_profile - `resource_group` - (List) The resource group for this reservation. @@ -106,9 +111,11 @@ You can access the following attribute references after your data source is crea - `id` - (String) The unique identifier for this resource group. - `name` - (String) The name for this resource group. - `resource_type` - (String) The resource type. + ->**resource_type**
• reservation - `status` - (String) The status of the reservation. + ->**status**
• activating
• active @@ -120,6 +127,7 @@ You can access the following attribute references after your data source is crea Nested scheme for `status_reasons`: - `code` - (String) A snake case string succinctly identifying the status reason. + ->**code**
• cannot_activate_no_capacity_available
• cannot_renew_unsupported_profile_term From 3fe04768910f2b88f5e072a6ddaf1f1e79728cb0 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:52:15 +0530 Subject: [PATCH 03/17] Fix terraform formatting --- website/docs/d/is_reservation.html.markdown | 58 +++++++++---------- website/docs/d/is_reservations.html.markdown | 24 ++++---- website/docs/r/is_reservation.html.markdown | 2 +- .../r/is_reservation_activate.html.markdown | 2 +- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/website/docs/d/is_reservation.html.markdown b/website/docs/d/is_reservation.html.markdown index 74e211f5ae..387f4a903d 100644 --- a/website/docs/d/is_reservation.html.markdown +++ b/website/docs/d/is_reservation.html.markdown @@ -25,21 +25,21 @@ provider "ibm" { ```terraform resource "ibm_is_reservation" "res" { - capacity { - total = 5 - } - committed_use { - term = "one_year" - } - profile { - name = "ba2-2x8" - resource_type = "instance_profile" - } - zone = "us-east-3" - name = "reservation-name" + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" } data "ibm_is_reservation" "ds_res" { - name = ibm_is_reservation.res.name + name = ibm_is_reservation.res.name } ``` @@ -47,22 +47,22 @@ data "ibm_is_reservation" "ds_res" { ```terraform resource "ibm_is_reservation" "res" { - capacity { - total = 5 - } - committed_use { - term = "one_year" - } - profile { - name = "ba2-2x8" - resource_type = "instance_profile" - } - zone = "us-east-3" - name = "reservation-name" - } - data "ibm_is_reservation" "ds_res" { - identifier = ibm_is_reservation.res.id - } + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" +} +data "ibm_is_reservation" "ds_res" { + identifier = ibm_is_reservation.res.id +} ``` diff --git a/website/docs/d/is_reservations.html.markdown b/website/docs/d/is_reservations.html.markdown index fdab2af9eb..6ed2bf458d 100644 --- a/website/docs/d/is_reservations.html.markdown +++ b/website/docs/d/is_reservations.html.markdown @@ -29,18 +29,18 @@ data "ibm_resource_group" "example" { } resource "ibm_is_reservation" "res" { - capacity { - total = 5 - } - committed_use { - term = "one_year" - } - profile { - name = "ba2-2x8" - resource_type = "instance_profile" - } - zone = "us-east-3" - name = "reservation-name" + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" } data "ibm_is_reservations" "example1" { } diff --git a/website/docs/r/is_reservation.html.markdown b/website/docs/r/is_reservation.html.markdown index 53fcc98aa2..4644dc0303 100644 --- a/website/docs/r/is_reservation.html.markdown +++ b/website/docs/r/is_reservation.html.markdown @@ -33,7 +33,7 @@ resource "ibm_is_reservation" "example" { term = "one_year" } profile { - name = "ba2-2x8" + name = "ba2-2x8" resource_type = "instance_profile" } zone = "us-east-3" diff --git a/website/docs/r/is_reservation_activate.html.markdown b/website/docs/r/is_reservation_activate.html.markdown index a60c5c890d..551e17cbf1 100644 --- a/website/docs/r/is_reservation_activate.html.markdown +++ b/website/docs/r/is_reservation_activate.html.markdown @@ -33,7 +33,7 @@ resource "ibm_is_reservation" "example" { term = "one_year" } profile { - name = "ba2-2x8" + name = "ba2-2x8" resource_type = "instance_profile" } zone = "us-east-3" From 2fc4f47fa207535cdbde78e1d760fccb96971f04 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:07:29 +0530 Subject: [PATCH 04/17] instance reservation --- .github/workflows/go.yml | 2 +- .github/workflows/issues.yml | 2 +- .github/workflows/release.yml | 2 +- .secrets.baseline | 106 +- CHANGELOG.md | 207 + NOTICE | 2 +- .../IBM/vpc-go-sdk/.bumpversion.cfg | 13 - .../github.com/IBM/vpc-go-sdk/.gitattributes | 1 - common/github.com/IBM/vpc-go-sdk/.gitignore | 18 - common/github.com/IBM/vpc-go-sdk/.releaserc | 21 - common/github.com/IBM/vpc-go-sdk/.travis.yml | 39 - common/github.com/IBM/vpc-go-sdk/CHANGELOG.md | 96 - .../IBM/vpc-go-sdk/CODE_OF_CONDUCT.md | 76 - .../github.com/IBM/vpc-go-sdk/CONTRIBUTING.md | 14 - common/github.com/IBM/vpc-go-sdk/Makefile | 23 - .../IBM/vpc-go-sdk/common/headers_test.go | 30 - common/github.com/IBM/vpc-go-sdk/go.sum | 143 - .../github.com/{IBM => }/vpc-go-sdk/LICENSE | 0 .../{IBM => }/vpc-go-sdk/common/headers.go | 0 .../{IBM => }/vpc-go-sdk/common/version.go | 0 common/github.com/{IBM => }/vpc-go-sdk/go.mod | 12 +- .../{IBM => }/vpc-go-sdk/vpcv1/vpc_v1.go | 3220 +- examples/ibm-atracker/README.md | 18 +- examples/ibm-atracker/main.tf | 6 +- examples/ibm-atracker/variables.tf | 7 +- examples/ibm-atracker/versions.tf | 8 +- examples/ibm-cis/main.tf | 26 +- examples/ibm-cos-bucket/main.tf | 9 +- examples/ibm-database/main.tf | 11 +- examples/ibm-is-ng/main.tf | 14 + examples/ibm-metrics-router/README.md | 2 +- examples/ibm-metrics-router/variables.tf | 2 +- examples/ibm-schematics/README.md | 155 +- examples/ibm-schematics/main.tf | 144 + examples/ibm-schematics/outputs.tf | 32 + examples/ibm-schematics/variables.tf | 129 +- examples/ibm-schematics/versions.tf | 14 +- examples/ibm-usage-reports/README.md | 93 + examples/ibm-usage-reports/main.tf | 20 + examples/ibm-usage-reports/outputs.tf | 6 + examples/ibm-usage-reports/variables.tf | 58 + examples/ibm-usage-reports/versions.tf | 9 + go.mod | 66 +- go.sum | 257 +- ibm/acctest/acctest.go | 54 + ibm/conns/config.go | 48 + ibm/flex/structures.go | 16 - ibm/provider/provider.go | 175 +- ibm/service/cos/data_source_ibm_cos_bucket.go | 15 +- .../database/data_source_ibm_database.go | 14 - .../database/data_source_ibm_database_test.go | 4 +- ibm/service/database/resource_ibm_database.go | 324 +- .../resource_ibm_database_cassandra_test.go | 127 +- .../resource_ibm_database_edb_test.go | 51 +- ...bm_database_elasticsearch_platinum_test.go | 871 + ...esource_ibm_database_elasticsearch_test.go | 122 +- .../resource_ibm_database_etcd_test.go | 47 +- ...ce_ibm_database_mongodb_enterprise_test.go | 55 +- ...urce_ibm_database_mongodb_sharding_test.go | 49 +- .../resource_ibm_database_mongodb_test.go | 47 +- .../resource_ibm_database_mysql_test.go | 34 +- .../resource_ibm_database_postgresql_test.go | 403 +- .../resource_ibm_database_rabbitmq_test.go | 47 +- .../resource_ibm_database_redis_test.go | 47 +- ..._source_ibm_en_destination_custom_email.go | 179 + ...ce_ibm_en_destination_custom_email_test.go | 67 + ...source_ibm_en_subscription_custom_email.go | 297 + ...e_ibm_en_subscription_custom_email_test.go | 84 + ...esource_ibm_en_destination_custom_email.go | 274 + ...ce_ibm_en_destination_custom_email_test.go | 147 + ...source_ibm_en_subscription_custom_email.go | 423 + ...e_ibm_en_subscription_custom_email_test.go | 171 + ...ta_source_ibm_event_streams_schema_test.go | 5 +- .../data_source_ibm_event_streams_topic.go | 12 +- ...ata_source_ibm_event_streams_topic_test.go | 49 +- .../resource_ibm_event_streams_schema.go | 12 +- .../resource_ibm_event_streams_schema_test.go | 8 +- .../resource_ibm_event_streams_topic.go | 70 +- .../resource_ibm_event_streams_topic_test.go | 13 +- ibm/service/kms/resource_ibm_kms_key_rings.go | 4 +- ...rce_ibm_container_ingress_secret_opaque.go | 33 +- ...bm_container_ingress_secret_opaque_test.go | 147 +- ...source_ibm_container_ingress_secret_tls.go | 26 +- ...e_ibm_container_ingress_secret_tls_test.go | 120 +- .../data_source_ibm_metrics_router_targets.go | 2 +- .../resource_ibm_metrics_router_target.go | 2 +- .../power/data_source_ibm_pi_datacenter.go | 94 + .../data_source_ibm_pi_datacenter_test.go | 35 + .../power/data_source_ibm_pi_datacenters.go | 97 + .../data_source_ibm_pi_datacenters_test.go | 31 + ...ata_source_ibm_pi_storage_pool_capacity.go | 8 +- ...ta_source_ibm_pi_storage_pools_capacity.go | 17 +- .../power/data_source_ibm_pi_workspace.go | 103 + .../data_source_ibm_pi_workspace_test.go | 34 + .../power/data_source_ibm_pi_workspaces.go | 120 + .../data_source_ibm_pi_workspaces_test.go | 35 + ibm/service/power/ibm_pi_constants.go | 17 + ...source_ibm_scc_provider_type_collection.go | 5 +- ...e_ibm_scc_provider_type_collection_test.go | 7 +- ibm/service/scc/resource_ibm_scc_profile.go | 25 +- .../scc/resource_ibm_scc_profile_test.go | 4 + .../data_source_ibm_schematics_agent.go | 972 + ...data_source_ibm_schematics_agent_deploy.go | 132 + ...source_ibm_schematics_agent_deploy_test.go | 84 + ...data_source_ibm_schematics_agent_health.go | 124 + ...source_ibm_schematics_agent_health_test.go | 83 + .../data_source_ibm_schematics_agent_prs.go | 129 + ...ta_source_ibm_schematics_agent_prs_test.go | 83 + .../data_source_ibm_schematics_agent_test.go | 183 + .../data_source_ibm_schematics_agents.go | 363 + .../data_source_ibm_schematics_agents_test.go | 36 + .../data_source_ibm_schematics_output.go | 4 +- .../data_source_ibm_schematics_policies.go | 283 + ...ata_source_ibm_schematics_policies_test.go | 37 + .../data_source_ibm_schematics_policy.go | 479 + .../data_source_ibm_schematics_policy_test.go | 133 + .../data_source_ibm_schematics_workspace.go | 3 +- .../resource_ibm_schematics_action.go | 26 - .../resource_ibm_schematics_agent.go | 1332 + .../resource_ibm_schematics_agent_deploy.go | 286 + ...source_ibm_schematics_agent_deploy_test.go | 163 + .../resource_ibm_schematics_agent_health.go | 228 + ...source_ibm_schematics_agent_health_test.go | 164 + .../resource_ibm_schematics_agent_prs.go | 225 + .../resource_ibm_schematics_agent_prs_test.go | 162 + .../resource_ibm_schematics_agent_test.go | 251 + .../resource_ibm_schematics_policy.go | 769 + .../resource_ibm_schematics_policy_test.go | 196 + .../resource_ibm_schematics_workspace.go | 24 +- .../data_source_ibm_sm_arbitrary_secret.go | 51 +- ...ata_source_ibm_sm_arbitrary_secret_test.go | 11 +- ...ta_source_ibm_sm_iam_credentials_secret.go | 49 +- ...data_source_ibm_sm_imported_certificate.go | 50 +- ...source_ibm_sm_imported_certificate_test.go | 11 +- .../data_source_ibm_sm_kv_secret.go | 51 +- .../data_source_ibm_sm_kv_secret_test.go | 11 +- .../data_source_ibm_sm_private_certificate.go | 50 +- ..._source_ibm_sm_private_certificate_test.go | 11 +- .../data_source_ibm_sm_public_certificate.go | 51 +- ...a_source_ibm_sm_public_certificate_test.go | 11 +- ..._source_ibm_sm_username_password_secret.go | 51 +- ...ce_ibm_sm_username_password_secret_test.go | 11 +- .../resource_ibm_sm_public_certificate.go | 5 +- ibm/service/secretsmanager/utils.go | 65 + ibm/service/usagereports/README.md | 11 + .../data_source_ibm_billing_snapshot_list.go | 365 + ...a_source_ibm_billing_snapshot_list_test.go | 45 + .../resource_ibm_billing_report_snapshot.go | 473 + ...source_ibm_billing_report_snapshot_test.go | 116 + .../vpc/data_source_ibm_is_backup_policies.go | 101 + .../vpc/data_source_ibm_is_backup_policy.go | 102 + .../data_source_ibm_is_bare_metal_servers.go | 24 +- .../vpc/data_source_ibm_is_dedicated_host.go | 68 +- ...ta_source_ibm_is_dedicated_host_profile.go | 9 +- ...a_source_ibm_is_dedicated_host_profiles.go | 8 + .../vpc/data_source_ibm_is_dedicated_hosts.go | 36 + .../vpc/data_source_ibm_is_instance.go | 180 +- .../data_source_ibm_is_instance_profile.go | 53 + .../data_source_ibm_is_instance_profiles.go | 32 + .../data_source_ibm_is_instance_template.go | 39 + .../data_source_ibm_is_instance_templates.go | 38 + .../vpc/data_source_ibm_is_instances.go | 161 + .../data_source_ibm_is_share_mount_target.go | 16 - .../vpc/data_source_ibm_is_vpc_test.go | 2 +- .../vpc/data_source_ibm_is_vpn_gateway.go | 78 +- ...ta_source_ibm_is_vpn_gateway_connection.go | 27 + ...a_source_ibm_is_vpn_gateway_connections.go | 26 +- .../vpc/data_source_ibm_is_vpn_gateways.go | 66 +- .../vpc/data_source_ibm_is_vpn_server.go | 61 + .../data_source_ibm_is_vpn_server_route.go | 69 + .../data_source_ibm_is_vpn_server_routes.go | 66 + .../vpc/data_source_ibm_is_vpn_servers.go | 57 + .../vpc/resource_ibm_is_backup_policy.go | 143 +- .../vpc/resource_ibm_is_backup_policy_test.go | 146 + .../vpc/resource_ibm_is_dedicated_host.go | 38 + .../resource_ibm_is_dedicated_host_test.go | 1 + ibm/service/vpc/resource_ibm_is_instance.go | 368 +- .../vpc/resource_ibm_is_instance_template.go | 67 + .../vpc/resource_ibm_is_instance_test.go | 79 + ibm/service/vpc/resource_ibm_is_lb.go | 13 +- ibm/service/vpc/resource_ibm_is_lb_test.go | 94 + ...ource_ibm_is_vpc_dns_resolution_binding.go | 2 +- .../vpc/resource_ibm_is_vpn_gateway.go | 115 +- ...urce_ibm_is_vpn_gateway_connection_test.go | 2 + ...resource_ibm_is_vpn_gateway_connections.go | 45 +- .../vpc/resource_ibm_is_vpn_gateway_test.go | 2 + ibm/service/vpc/resource_ibm_is_vpn_server.go | 93 + .../vpc/resource_ibm_is_vpn_server_route.go | 100 + .../resource_ibm_is_vpn_server_route_test.go | 1 + metadata/provider_metadata.json | 87960 ++++++++-------- version/version.go | 2 +- website/allowed-subcategories.txt | 1 + website/docs/d/atracker_routes.html.markdown | 2 +- website/docs/d/atracker_targets.html.markdown | 2 +- .../d/billing_snapshot_list.html.markdown | 70 + .../en_destination_custom_email.html.markdown | 55 + ...copy.markdown => en_sources.html.markdown} | 0 ...en_subscription_custom_email.html.markdown | 66 + .../d/en_subscription_email.html.markdown | 4 +- .../docs/d/is_backup_policies.html.markdown | 15 +- website/docs/d/is_backup_policy.html.markdown | 14 + website/docs/d/is_bare_metal_servers.markdown | 3 - .../docs/d/is_dedicated_host.html.markdown | 9 + .../d/is_dedicated_host_profile.html.markdown | 1 + .../is_dedicated_host_profiles.html.markdown | 1 + .../docs/d/is_dedicated_hosts.html.markdown | 9 + website/docs/d/is_flow_log.html.markdown | 4 +- website/docs/d/is_instance.html.markdown | 1 + .../docs/d/is_instance_profile.html.markdown | 2 + .../docs/d/is_instance_profiles.html.markdown | 3 +- website/docs/d/is_instances.html.markdown | 1 + .../d/is_share_mount_target.html.markdown | 48 +- .../d/is_share_mount_targets.html.markdown | 49 +- website/docs/d/is_vpn_gateway.html.markdown | 22 +- .../d/is_vpn_gateway_connection.html.markdown | 7 + .../is_vpn_gateway_connections.html.markdown | 6 + website/docs/d/is_vpn_gateways.html.markdown | 63 +- website/docs/d/is_vpn_server.html.markdown | 20 + .../docs/d/is_vpn_server_route.html.markdown | 20 + .../docs/d/is_vpn_server_routes.html.markdown | 20 + website/docs/d/is_vpn_servers.html.markdown | 20 +- .../d/metrics_router_targets.html.markdown | 2 +- website/docs/d/pi_datacenter.html.markdown | 64 + website/docs/d/pi_datacenters.html.markdown | 61 + .../docs/d/pi_storage_pool_capacity.markdown | 1 + .../docs/d/pi_storage_pools_capacity.markdown | 1 + website/docs/d/pi_workspace.html.markdown | 71 + website/docs/d/pi_workspaces.html.markdown | 73 + .../docs/d/scc_control_library.html.markdown | 2 +- .../d/scc_instance_settings.html.markdown | 1 + .../docs/d/scc_latest_reports.html.markdown | 2 +- website/docs/d/scc_profile.html.markdown | 2 +- .../d/scc_profile_attachment.html.markdown | 2 +- .../docs/d/scc_provider_type.html.markdown | 2 +- ...scc_provider_type_collection.html.markdown | 2 +- .../scc_provider_type_instance.html.markdown | 2 +- website/docs/d/scc_report.html.markdown | 2 +- .../docs/d/scc_report_controls.html.markdown | 2 +- .../d/scc_report_evaluations.html.markdown | 2 +- .../docs/d/scc_report_resources.html.markdown | 2 +- website/docs/d/scc_report_rule.html.markdown | 2 +- .../docs/d/scc_report_summary.html.markdown | 2 +- website/docs/d/scc_report_tags.html.markdown | 2 +- .../scc_report_violation_drift.html.markdown | 2 +- website/docs/d/scc_rule.html.markdown | 2 +- website/docs/d/schematics_agent.html.markdown | 165 + .../d/schematics_agent_deploy.html.markdown | 50 + .../d/schematics_agent_health.html.markdown | 48 + .../docs/d/schematics_agent_prs.html.markdown | 48 + .../docs/d/schematics_agents.html.markdown | 72 + .../docs/d/schematics_policies.html.markdown | 62 + .../docs/d/schematics_policy.html.markdown | 102 + .../docs/d/sm_arbitrary_secret.html.markdown | 18 +- .../d/sm_iam_credentials_secret.html.markdown | 21 +- .../d/sm_imported_certificate.html.markdown | 19 +- website/docs/d/sm_kv_secret.html.markdown | 19 +- .../d/sm_private_certificate.html.markdown | 85 +- .../d/sm_public_certificate.html.markdown | 20 +- .../sm_username_password_secret.html.markdown | 20 +- .../r/billing_report_snapshot.html.markdown | 113 + .../cd_tekton_pipeline_trigger.html.markdown | 3 +- ...tainer_ingress_secret_opaque.html.markdown | 7 +- ...container_ingress_secret_tls.html.markdown | 1 + ...bucket_website_configuration.html.markdown | 9 +- website/docs/r/database.html.markdown | 96 +- .../en_destination_custom_email.html.markdown | 95 + .../r/en_destination_huawei.html.markdown | 2 +- ...en_subscription_custom_email.html.markdown | 111 + .../docs/r/iam_service_policy.html.markdown | 1 + website/docs/r/is_backup_policy.html.markdown | 31 + .../docs/r/is_dedicated_host.html.markdown | 9 + website/docs/r/is_instance.html.markdown | 5 +- website/docs/r/is_lb.html.markdown | 2 +- .../r/is_share_mount_target.html.markdown | 22 +- website/docs/r/is_vpc.html.markdown | 2 +- website/docs/r/is_vpn_gateway.html.markdown | 21 + .../r/is_vpn_gateway_connection.html.markdown | 6 + website/docs/r/is_vpn_server.html.markdown | 21 +- .../docs/r/is_vpn_server_route.html.markdown | 20 + website/docs/r/kms_key.html.markdown | 3 +- website/docs/r/kms_key_rings.html.markdown | 4 +- .../docs/r/scc_control_library.html.markdown | 2 +- website/docs/r/scc_profile.html.markdown | 2 +- .../r/scc_profile_attachment.html.markdown | 8 +- .../scc_provider_type_instance.html.markdown | 2 +- website/docs/r/scc_rule.html.markdown | 2 +- .../docs/r/schematics_action.html.markdown | 22 +- website/docs/r/schematics_agent.html.markdown | 206 + .../r/schematics_agent_deploy.html.markdown | 59 + .../r/schematics_agent_health.html.markdown | 58 + .../docs/r/schematics_agent_prs.html.markdown | 58 + .../docs/r/schematics_policy.html.markdown | 126 + .../r/sm_imported_certificate.html.markdown | 2 +- .../r/trusted_profile_template.html.markdown | 2 +- 294 files changed, 68180 insertions(+), 44029 deletions(-) delete mode 100644 common/github.com/IBM/vpc-go-sdk/.bumpversion.cfg delete mode 100644 common/github.com/IBM/vpc-go-sdk/.gitattributes delete mode 100644 common/github.com/IBM/vpc-go-sdk/.gitignore delete mode 100644 common/github.com/IBM/vpc-go-sdk/.releaserc delete mode 100644 common/github.com/IBM/vpc-go-sdk/.travis.yml delete mode 100644 common/github.com/IBM/vpc-go-sdk/CHANGELOG.md delete mode 100644 common/github.com/IBM/vpc-go-sdk/CODE_OF_CONDUCT.md delete mode 100644 common/github.com/IBM/vpc-go-sdk/CONTRIBUTING.md delete mode 100644 common/github.com/IBM/vpc-go-sdk/Makefile delete mode 100644 common/github.com/IBM/vpc-go-sdk/common/headers_test.go delete mode 100644 common/github.com/IBM/vpc-go-sdk/go.sum rename common/github.com/{IBM => }/vpc-go-sdk/LICENSE (100%) rename common/github.com/{IBM => }/vpc-go-sdk/common/headers.go (100%) rename common/github.com/{IBM => }/vpc-go-sdk/common/version.go (100%) rename common/github.com/{IBM => }/vpc-go-sdk/go.mod (53%) rename common/github.com/{IBM => }/vpc-go-sdk/vpcv1/vpc_v1.go (97%) create mode 100644 examples/ibm-usage-reports/README.md create mode 100644 examples/ibm-usage-reports/main.tf create mode 100644 examples/ibm-usage-reports/outputs.tf create mode 100644 examples/ibm-usage-reports/variables.tf create mode 100644 examples/ibm-usage-reports/versions.tf create mode 100644 ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go create mode 100644 ibm/service/eventnotification/data_source_ibm_en_destination_custom_email.go create mode 100644 ibm/service/eventnotification/data_source_ibm_en_destination_custom_email_test.go create mode 100644 ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email.go create mode 100644 ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email_test.go create mode 100644 ibm/service/eventnotification/resource_ibm_en_destination_custom_email.go create mode 100644 ibm/service/eventnotification/resource_ibm_en_destination_custom_email_test.go create mode 100644 ibm/service/eventnotification/resource_ibm_en_subscription_custom_email.go create mode 100644 ibm/service/eventnotification/resource_ibm_en_subscription_custom_email_test.go create mode 100644 ibm/service/power/data_source_ibm_pi_datacenter.go create mode 100644 ibm/service/power/data_source_ibm_pi_datacenter_test.go create mode 100644 ibm/service/power/data_source_ibm_pi_datacenters.go create mode 100644 ibm/service/power/data_source_ibm_pi_datacenters_test.go create mode 100644 ibm/service/power/data_source_ibm_pi_workspace.go create mode 100644 ibm/service/power/data_source_ibm_pi_workspace_test.go create mode 100644 ibm/service/power/data_source_ibm_pi_workspaces.go create mode 100644 ibm/service/power/data_source_ibm_pi_workspaces_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_deploy_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_health.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_health_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_prs.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_prs_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agent_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agents.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_agents_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_policies.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_policies_test.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_policy.go create mode 100644 ibm/service/schematics/data_source_ibm_schematics_policy_test.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_deploy.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_health.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_health_test.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_prs.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_agent_test.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_policy.go create mode 100644 ibm/service/schematics/resource_ibm_schematics_policy_test.go create mode 100644 ibm/service/usagereports/README.md create mode 100644 ibm/service/usagereports/data_source_ibm_billing_snapshot_list.go create mode 100644 ibm/service/usagereports/data_source_ibm_billing_snapshot_list_test.go create mode 100644 ibm/service/usagereports/resource_ibm_billing_report_snapshot.go create mode 100644 ibm/service/usagereports/resource_ibm_billing_report_snapshot_test.go create mode 100644 website/docs/d/billing_snapshot_list.html.markdown create mode 100644 website/docs/d/en_destination_custom_email.html.markdown rename website/docs/d/{en_sources.html copy.markdown => en_sources.html.markdown} (100%) create mode 100644 website/docs/d/en_subscription_custom_email.html.markdown create mode 100644 website/docs/d/pi_datacenter.html.markdown create mode 100644 website/docs/d/pi_datacenters.html.markdown create mode 100644 website/docs/d/pi_workspace.html.markdown create mode 100644 website/docs/d/pi_workspaces.html.markdown create mode 100644 website/docs/d/schematics_agent.html.markdown create mode 100644 website/docs/d/schematics_agent_deploy.html.markdown create mode 100644 website/docs/d/schematics_agent_health.html.markdown create mode 100644 website/docs/d/schematics_agent_prs.html.markdown create mode 100644 website/docs/d/schematics_agents.html.markdown create mode 100644 website/docs/d/schematics_policies.html.markdown create mode 100644 website/docs/d/schematics_policy.html.markdown create mode 100644 website/docs/r/billing_report_snapshot.html.markdown create mode 100644 website/docs/r/en_destination_custom_email.html.markdown create mode 100644 website/docs/r/en_subscription_custom_email.html.markdown create mode 100644 website/docs/r/schematics_agent.html.markdown create mode 100644 website/docs/r/schematics_agent_deploy.html.markdown create mode 100644 website/docs/r/schematics_agent_health.html.markdown create mode 100644 website/docs/r/schematics_agent_prs.html.markdown create mode 100644 website/docs/r/schematics_policy.html.markdown diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6d600c9bad..7cb93f42ef 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,7 @@ jobs: id: go - name: Check out code into the Go module directory - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 - name: Get dependencies run: | diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 0d6ce9eea1..2f84d395ef 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -6,7 +6,7 @@ jobs: labelIssues: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.0 + - uses: actions/checkout@v4.1.1 - name: Apply Issue Labels uses: github/issue-labeler@v3.2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2acc15555e..d727809c5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4.1.1 - name: Unshallow run: git fetch --prune --unshallow diff --git a/.secrets.baseline b/.secrets.baseline index 0b3ce98f4b..abde119aa3 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.mod|go.sum|.*.map|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-09-19T16:31:40Z", + "generated_at": "2023-10-18T18:46:12Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -642,7 +642,7 @@ "hashed_secret": "ba02c5a1aad447298fcfbd962a953e7706b8b430", "is_secret": false, "is_verified": false, - "line_number": 25, + "line_number": 27, "type": "Hex High Entropy String", "verified_result": null } @@ -652,7 +652,7 @@ "hashed_secret": "5ffafdbd72224c86c3601bacfa0b6f04f308b9f6", "is_secret": false, "is_verified": false, - "line_number": 62, + "line_number": 67, "type": "Secret Keyword", "verified_result": null } @@ -742,7 +742,7 @@ "hashed_secret": "731438016c5ab94431f61820f35e3ae5f8ad6004", "is_secret": false, "is_verified": false, - "line_number": 353, + "line_number": 383, "type": "Secret Keyword", "verified_result": null }, @@ -750,7 +750,7 @@ "hashed_secret": "12da2e35d6b50c902c014f1ab9e3032650368df7", "is_secret": false, "is_verified": false, - "line_number": 359, + "line_number": 389, "type": "Secret Keyword", "verified_result": null }, @@ -758,7 +758,7 @@ "hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6", "is_secret": false, "is_verified": false, - "line_number": 1065, + "line_number": 1100, "type": "Base64 High Entropy String", "verified_result": null } @@ -792,7 +792,7 @@ "hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670", "is_secret": false, "is_verified": false, - "line_number": 3248, + "line_number": 3250, "type": "Secret Keyword", "verified_result": null }, @@ -800,7 +800,7 @@ "hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6", "is_secret": false, "is_verified": false, - "line_number": 3261, + "line_number": 3263, "type": "Secret Keyword", "verified_result": null }, @@ -808,7 +808,7 @@ "hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1", "is_secret": false, "is_verified": false, - "line_number": 3302, + "line_number": 3304, "type": "Secret Keyword", "verified_result": null } @@ -836,7 +836,7 @@ "hashed_secret": "1a0334cfa65f4be58b9d914b8e96e9d9478bfbac", "is_secret": false, "is_verified": false, - "line_number": 3242, + "line_number": 3226, "type": "Secret Keyword", "verified_result": null } @@ -846,7 +846,7 @@ "hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9", "is_secret": false, "is_verified": false, - "line_number": 1763, + "line_number": 1779, "type": "Secret Keyword", "verified_result": null }, @@ -854,7 +854,7 @@ "hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437", "is_secret": false, "is_verified": false, - "line_number": 1769, + "line_number": 1785, "type": "Secret Keyword", "verified_result": null } @@ -2119,6 +2119,16 @@ "verified_result": null } ], + "ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go": [ + { + "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", + "is_secret": false, + "is_verified": false, + "line_number": 779, + "type": "Secret Keyword", + "verified_result": null + } + ], "ibm/service/database/resource_ibm_database_elasticsearch_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", @@ -2772,7 +2782,17 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 373, + "line_number": 403, + "type": "Secret Keyword", + "verified_result": null + } + ], + "ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque_test.go": [ + { + "hashed_secret": "5df29b80b97dab81130058ac9af4a9b9d1c091b4", + "is_secret": false, + "is_verified": false, + "line_number": 247, "type": "Secret Keyword", "verified_result": null } @@ -2782,7 +2802,17 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 267, + "line_number": 292, + "type": "Secret Keyword", + "verified_result": null + } + ], + "ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls_test.go": [ + { + "hashed_secret": "5df29b80b97dab81130058ac9af4a9b9d1c091b4", + "is_secret": false, + "is_verified": false, + "line_number": 216, "type": "Secret Keyword", "verified_result": null } @@ -2900,7 +2930,7 @@ "hashed_secret": "83747cea2b26d7652ed39218ddcdb1461c570535", "is_secret": false, "is_verified": false, - "line_number": 80, + "line_number": 79, "type": "Hex High Entropy String", "verified_result": null } @@ -2920,7 +2950,7 @@ "hashed_secret": "83747cea2b26d7652ed39218ddcdb1461c570535", "is_secret": false, "is_verified": false, - "line_number": 95, + "line_number": 94, "type": "Hex High Entropy String", "verified_result": null } @@ -2940,7 +2970,7 @@ "hashed_secret": "49f3bb8f759241df51c899d3725d877bad58f66e", "is_secret": false, "is_verified": false, - "line_number": 1414, + "line_number": 1405, "type": "Secret Keyword", "verified_result": null }, @@ -2948,7 +2978,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 1417, + "line_number": 1408, "type": "Secret Keyword", "verified_result": null } @@ -3014,7 +3044,7 @@ "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 177, + "line_number": 185, "type": "Secret Keyword", "verified_result": null }, @@ -3022,7 +3052,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 317, + "line_number": 312, "type": "Secret Keyword", "verified_result": null } @@ -3070,7 +3100,7 @@ "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 189, + "line_number": 197, "type": "Secret Keyword", "verified_result": null }, @@ -3078,7 +3108,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 345, + "line_number": 339, "type": "Secret Keyword", "verified_result": null } @@ -3088,7 +3118,7 @@ "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 227, + "line_number": 235, "type": "Secret Keyword", "verified_result": null }, @@ -3096,7 +3126,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 420, + "line_number": 414, "type": "Secret Keyword", "verified_result": null } @@ -3142,7 +3172,7 @@ "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 292, + "line_number": 299, "type": "Secret Keyword", "verified_result": null }, @@ -3150,7 +3180,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 489, + "line_number": 482, "type": "Secret Keyword", "verified_result": null } @@ -3244,7 +3274,7 @@ "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", "is_secret": false, "is_verified": false, - "line_number": 46, + "line_number": 48, "type": "Secret Keyword", "verified_result": null } @@ -3272,7 +3302,7 @@ "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 154, + "line_number": 162, "type": "Secret Keyword", "verified_result": null }, @@ -3280,7 +3310,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 283, + "line_number": 278, "type": "Secret Keyword", "verified_result": null } @@ -3616,7 +3646,7 @@ "hashed_secret": "4d55af37dbbb6a42088d917caa1ca25428ec42c9", "is_secret": false, "is_verified": false, - "line_number": 788, + "line_number": 849, "type": "Secret Keyword", "verified_result": null } @@ -3646,7 +3676,7 @@ "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", "is_secret": false, "is_verified": false, - "line_number": 92841, + "line_number": 93883, "type": "Secret Keyword", "verified_result": null }, @@ -3654,7 +3684,7 @@ "hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd", "is_secret": false, "is_verified": false, - "line_number": 115304, + "line_number": 116309, "type": "Secret Keyword", "verified_result": null }, @@ -3662,7 +3692,7 @@ "hashed_secret": "1e5c2f367f02e47a8c160cda1cd9d91decbac441", "is_secret": false, "is_verified": false, - "line_number": 145758, + "line_number": 147225, "type": "Secret Keyword", "verified_result": null } @@ -4201,14 +4231,6 @@ "line_number": 24, "type": "Secret Keyword", "verified_result": null - }, - { - "hashed_secret": "69d7a780b792608707bd8579c295cb5028505f0b", - "is_secret": false, - "is_verified": false, - "line_number": 24, - "type": "Box Credentials", - "verified_result": null } ], "website/docs/r/en_destination_ios.html.markdown": [ @@ -4758,7 +4780,7 @@ } ] }, - "version": "0.13.1+ibm.52.dss", + "version": "0.13.1+ibm.61.dss", "word_list": { "file": null, "hash": null diff --git a/CHANGELOG.md b/CHANGELOG.md index 25bf01ca5b..cf3fc33d49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,210 @@ +# 1.59.0 (Oct 30, 2023) + +Features +* Support Usage Reports + - **Datasources** + - ibm_billing_snapshot_list + - **Resources** + - ibm_billing_report_snapshot + +* Support Power Instance + - **Datasources** + - ibm_pi_workspace + - ibm_pi_workspaces + - ibm_pi_datacenter + - ibm_pi_datacenters + +* Support Schematics Agents + - **Datasources** + - ibm_schematics_policies + - ibm_schematics_policy + - ibm_schematics_agents + - ibm_schematics_agent + - ibm_schematics_agent_prs + - ibm_schematics_agent_deploy + - ibm_schematics_agent_health + - **Resources** + - ibm_schematics_policy + - ibm_schematics_agent + - ibm_schematics_agent_prs + - ibm_schematics_agent_deploy + - ibm_schematics_agent_health + +* Support Event Notification + - **Datasources** + - ibm_en_destination_custom_email + - ibm_en_subscription_custom_email + - **Resources** + - ibm_en_destination_custom_email + - ibm_en_subscription_custom_email + + +Enhancements +* Get secret by name ([4825](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4825)) +* VPN for VPC: Customer should be able to recover their gateway or server for unhealthy status ([4858](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4858)) +* support for tf 1.5 in schematics workspace ([4853](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4853)) +* Deprecated match_resource_types and Intoduced match_resource_type ([4863](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4863)) +* Enterprise BaaS feature ([4845](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4845)) +* sarama golang library update ([4810](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4810)) +* Adding NUMA and Profile Status to instance, instance profile and dedicated hosts ([4871](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4871)) +* update terraform as per latest eventstreams go sdk release 1.4.0 ([4862](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4862)) +* Add path to invoke update without determining changed CRN data, add validator for name of secrets ([4859](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4859)) +* Feature: ReplicationEnabledField for Storage Pool ([4875](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4875)) +* Remove deprecated scaling attributes ([4481](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4481)) +* update CD Go SDK version ([4887](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4887)) +* Adding updates to the scc resources/datasources ([4865](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4865)) +* Add support for Elasticsearch Platinum ([4712](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4712)) +* Add support for security groups for network load balancers ([4888](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4888)) + + +Bug Fixes +* Fix handling of bundle_certs in Secrets Manager public cert ([4854](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4854)) +* add description in docs for Key Protect ([4846](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4846)) +* Update iam_service_policy.html.markdown ([4836](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4836)) +* v1.58.0 ibm_container_cluster_config: new endpoint_type returning self-signed private endpoint ([4861](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4861)) +* Doc correction: Share mount target doc corrections ([4889](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4889)) +* Fix indentation for subcategory ([4891](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4891)) + +# 1.59.0-beta0 (Oct 25, 2023) + +Features +* Support Usage Reports + - **Datasources** + - ibm_billing_snapshot_list + - **Resources** + - ibm_billing_report_snapshot + +* Support Power Instance + - **Datasources** + - ibm_pi_workspace + - ibm_pi_workspaces + - ibm_pi_datacenter + - ibm_pi_datacenters + +* Support Schematics Agents + - **Datasources** + - ibm_schematics_policies + - ibm_schematics_policy + - ibm_schematics_agents + - ibm_schematics_agent + - ibm_schematics_agent_prs + - ibm_schematics_agent_deploy + - ibm_schematics_agent_health + - **Resources** + - ibm_schematics_policy + - ibm_schematics_agent + - ibm_schematics_agent_prs + - ibm_schematics_agent_deploy + - ibm_schematics_agent_health + +* Support Event Notification + - **Datasources** + - ibm_en_destination_custom_email + - ibm_en_subscription_custom_email + - **Resources** + - ibm_en_destination_custom_email + - ibm_en_subscription_custom_email + + +Enhancements +* Get secret by name ([4825](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4825)) +* VPN for VPC: Customer should be able to recover their gateway or server for unhealthy status ([4858](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4858)) +* support for tf 1.5 in schematics workspace ([4853](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4853)) +* Deprecated match_resource_types and Intoduced match_resource_type ([4863](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4863)) +* Enterprise BaaS feature ([4845](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4845)) +* sarama golang library update ([4810](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4810)) +* Adding NUMA and Profile Status to instance, instance profile and dedicated hosts ([4871](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4871)) +* update terraform as per latest eventstreams go sdk release 1.4.0 ([4862](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4862)) +* Add path to invoke update without determining changed CRN data, add validator for name of secrets ([4859](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4859)) +* Feature: ReplicationEnabledField for Storage Pool ([4875](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4875)) + +Bug Fixes +* Fix handling of bundle_certs in Secrets Manager public cert ([4854](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4854)) +* add description in docs for Key Protect ([4846](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4846)) +* Update iam_service_policy.html.markdown ([4836](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4836)) +* v1.58.0 ibm_container_cluster_config: new endpoint_type returning self-signed private endpoint ([4861](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4861)) + +# 1.58.1 (Oct 04, 2023) + +Bug Fixes +* Timing issue while destroying Key Protect resources ([4837](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4837)) +* ibm_cos_bucket data lookup is throwing NoSuchWebsiteConfiguration in new version 1.58.0 ([4838](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4838)) +* Metrics router and atracker: Updated platform-services-go-sdk to fetch Madrid endpoint ([4830](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4830)) + +# 1.58.0 (Sep 29, 2023) + +Features +* Support Satellite Cluster + - **Resources** + - ibm_satellite_storage_configuration + - ibm_satellite_storage_assignment + - **Datasources** + - ibm_satellite_storage_configuration + - ibm_satellite_storage_assignment +* Support Security and Compliance + - **Resources** + - ibm_scc_rule + - ibm_scc_control_library + - ibm_scc_profile + - ibm_scc_profile_attachment + - ibm_scc_provider_type_instance + - **Datasources** + - ibm_scc_instance_settings + - ibm_scc_control_library + - ibm_scc_profile + - ibm_scc_profile_attachment + - ibm_scc_provider_type + - ibm_scc_provider_type_collection + - ibm_scc_provider_type_instance + - ibm_scc_latest_reports + - ibm_scc_report + - ibm_scc_report_controls + - ibm_scc_report_evaluations + - ibm_scc_report_resources + - ibm_scc_report_rule + - ibm_scc_report_summary + - ibm_scc_report_tags + - ibm_scc_report_violation_drift + - ibm_scc_rule + +* Support CD Toolchain + - **Datasources** + - ibm_cd_toolchains +* Support Virtual Private Cloud + - **Resources** + - ibm_is_vpc_dns_resolution_binding + - **Datasources** + - ibm_is_vpc_dns_resolution_binding + - ibm_is_vpc_dns_resolution_bindings + + +Enhancements +* Added retry mechanism and new SDK generator 3.78 ([4776](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4776)) +* Add default cluster versions to cluster versions data source ([4799](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4799)) +* Add description for keys and force_delete for deleteKeyRings for IBM ([4767](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4767)) +* Retry cloud connection create/update when vpc is unavailable ([4766](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4766)) +* Adding support for COS Static Web hosting ([4766](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4766)) +* add support for endpoint parameter in cluster_config ([4793](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4793)) +* fix(IAM Policy Management): allow sourceServiceName to be optional for authorizational policies ([4804](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4804)) + +BugFixes +* ops_manager User Creation ([4755](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4755)) +* fix(share-iops): Share Iops range fix for dp2 ([4807](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4807)) +* fix(VSI-Profile-patch): Remove validation for VSI profile patching ([4824](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4824)) + + +# 1.58.0-beta1 (Sep 25, 2023) +Features +* Support CD Toolchain + - **Datasources** + - ibm_cd_toolchains +* Support Virtual Private Cloud + - **Resources** + - ibm_is_vpc_dns_resolution_binding + - **Datasources** + - ibm_is_vpc_dns_resolution_binding + - ibm_is_vpc_dns_resolution_bindings + # 1.58.0-beta0 (Sep 10, 2023) Features diff --git a/NOTICE b/NOTICE index 23f94ce86c..8f06d939c8 100644 --- a/NOTICE +++ b/NOTICE @@ -45,7 +45,7 @@ The Program includes some or all of the following that IBM obtained under the BS MIT License The Program includes some or all of the following that IBM obtained under the MIT License: -* github.com/Shopify/sarama +* github.com/IBM/sarama * github.com/apparentlymart/go-cidr * github.com/ghodss/yaml * github.com/golang-jwt/jwt diff --git a/common/github.com/IBM/vpc-go-sdk/.bumpversion.cfg b/common/github.com/IBM/vpc-go-sdk/.bumpversion.cfg deleted file mode 100644 index 75285ab0b2..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/.bumpversion.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[bumpversion] -current_version = 0.6.0 -commit = True -message = Update version {current_version} -> {new_version} [skip ci] - -[bumpversion:file:common/version.go] -search = const Version = "{current_version}" -replace = const Version = "{new_version}" - -[bumpversion:file:README.md] -search = {current_version} -replace = {new_version} - diff --git a/common/github.com/IBM/vpc-go-sdk/.gitattributes b/common/github.com/IBM/vpc-go-sdk/.gitattributes deleted file mode 100644 index 3bfcae65ad..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.enc binary \ No newline at end of file diff --git a/common/github.com/IBM/vpc-go-sdk/.gitignore b/common/github.com/IBM/vpc-go-sdk/.gitignore deleted file mode 100644 index 2be5a24d4d..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# OS stuff -.DS_Store - -# generator files -.openapi-generator-ignore -.openapi-generator/VERSION - -# credentials -.env -*.env - -# ignore vendor/ -vendor/ - -/.project -/.openapi-generator/ - -main/ \ No newline at end of file diff --git a/common/github.com/IBM/vpc-go-sdk/.releaserc b/common/github.com/IBM/vpc-go-sdk/.releaserc deleted file mode 100644 index a746388363..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/.releaserc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "debug": true, - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - [ - "@semantic-release/exec", - { - "prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch" - } - ], - [ - "@semantic-release/git", - { - "message": "chore(release): ${nextRelease.version} release notes [skip ci]\n\n${nextRelease.notes}" - } - ], - "@semantic-release/github" - ] -} diff --git a/common/github.com/IBM/vpc-go-sdk/.travis.yml b/common/github.com/IBM/vpc-go-sdk/.travis.yml deleted file mode 100644 index 464cdde97c..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: go - -dist: xenial - -notifications: - email: true - -go: -- 1.14.x - -env: - global: - - GO111MODULE=on - -before_install: -- sudo apt-get update -- sudo apt-get install python -- nvm install 12 -- npm install -g npm@6.x - -install: -- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.37.1 - -script: -- make travis-ci - -# before_deploy: -# - pip install --user bump2version -# - npm install @semantic-release/changelog -# - npm install @semantic-release/exec -# - npm install @semantic-release/git -# - npm install @semantic-release/github - -# deploy: -# - provider: script -# script: npx semantic-release -# skip_cleanup: true -# on: -# branch: master diff --git a/common/github.com/IBM/vpc-go-sdk/CHANGELOG.md b/common/github.com/IBM/vpc-go-sdk/CHANGELOG.md deleted file mode 100644 index 37bf62185e..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/CHANGELOG.md +++ /dev/null @@ -1,96 +0,0 @@ -## [1.0.1](https://github.com/IBM/vpc-go-sdk/compare/v1.0.0...v1.0.1) (2021-04-07) - - -### Bug Fixes - -* **release:** Update SDKs to use API version 2021-03-30 ([#27](https://github.com/IBM/vpc-go-sdk/issues/27)) ([ba27a36](https://github.com/IBM/vpc-go-sdk/commit/ba27a36f743d07a1cae4fb45f83478adf4d33d79)) - -# [1.0.0](https://github.com/IBM/vpc-go-sdk/compare/v0.4.2...v1.0.0) (2021-03-16) - - -### Performance Improvements - -* **Instance-groups:** Update VPC SDK with API version 2021-03-09 ([#23](https://github.com/IBM/vpc-go-sdk/issues/23)) ([d6dc319](https://github.com/IBM/vpc-go-sdk/commit/d6dc319bb5aa19aff4fd89872198b6e573545110)) - - -### BREAKING CHANGES - -* **Instance-groups:** - Methods for Instance group manager is now producing InstanceGroupManagerIntf instead of InstanceGroupManager - -## [0.4.2](https://github.com/IBM/vpc-go-sdk/compare/v0.4.1...v0.4.2) (2021-03-02) - - -### Bug Fixes - -* **release:** Update SDKs to use API version 2021-02-09 ([#20](https://github.com/IBM/vpc-go-sdk/issues/20)) ([ae348ee](https://github.com/IBM/vpc-go-sdk/commit/ae348ee347f7405fac4ab4574392673a9194f6bd)) - -## [0.4.1](https://github.com/IBM/vpc-go-sdk/compare/v0.4.0...v0.4.1) (2021-01-18) - - -### Bug Fixes - -* **release:** Update SDKs to use API version 2020-01-12 ([#18](https://github.com/IBM/vpc-go-sdk/issues/18)) ([d8c2134](https://github.com/IBM/vpc-go-sdk/commit/d8c21345b1ed032484fbaf57456d4f476423b5fc)) - -# [0.4.0](https://github.com/IBM/vpc-go-sdk/compare/v0.3.1...v0.4.0) (2020-12-17) - - -### Features - -* **enhancement:** Update VPC service with API version 2020-12-15 ([#17](https://github.com/IBM/vpc-go-sdk/issues/17)) ([affcaed](https://github.com/IBM/vpc-go-sdk/commit/affcaed4e8f7e515148cb9aac82755ad2a3ea8ca)) - -## [0.3.1](https://github.com/IBM/vpc-go-sdk/compare/v0.3.0...v0.3.1) (2020-11-20) - - -### Bug Fixes - -* **SecurityGroup:** Update both VPC services fixing security group issue. ([#16](https://github.com/IBM/vpc-go-sdk/issues/16)) ([270decd](https://github.com/IBM/vpc-go-sdk/commit/270decd989abd0ed5b9cd101d6c7a2fcb9deecc2)) - -# [0.3.0](https://github.com/IBM/vpc-go-sdk/compare/v0.2.0...v0.3.0) (2020-11-20) - - -### Features - -* **SDK:** Update VPC Gen2 and Gen1 services with API version 2020-11-17 ([#15](https://github.com/IBM/vpc-go-sdk/issues/15)) ([6f97a1a](https://github.com/IBM/vpc-go-sdk/commit/6f97a1a643dce6d76f8ada9caecc49d864b656fa)) - -# [0.2.0](https://github.com/IBM/vpc-go-sdk/compare/v0.1.1...v0.2.0) (2020-10-16) - - -### Features - -* **version update:** Update both services with API version 2020-10-06 ([#14](https://github.com/IBM/vpc-go-sdk/issues/14)) ([179880c](https://github.com/IBM/vpc-go-sdk/commit/179880c4775e0d6e6a9e683546348b34e9f9b785)) - -## [0.1.1](https://github.com/IBM/vpc-go-sdk/compare/v0.1.0...v0.1.1) (2020-09-09) - - -### Bug Fixes - -* **NLB:** update NLB feature ([#13](https://github.com/IBM/vpc-go-sdk/issues/13)) ([99d207d](https://github.com/IBM/vpc-go-sdk/commit/99d207dba81fef5214be63864aa7a4b91af82c89)) - -# [0.1.0](https://github.com/IBM/vpc-go-sdk/compare/v0.0.3...v0.1.0) (2020-09-03) - - -### Features - -* **autoscale:** Add autoscale feature and NLB feature ([#12](https://github.com/IBM/vpc-go-sdk/issues/12)) ([0ee5ea1](https://github.com/IBM/vpc-go-sdk/commit/0ee5ea16247a6f94794674d0499c01e78857d6a4)) - -## [0.0.3](https://github.com/IBM/vpc-go-sdk/compare/v0.0.2...v0.0.3) (2020-08-06) - - -### Bug Fixes - -* **version:** Release SDK for API version 2020-07-28 ([#10](https://github.com/IBM/vpc-go-sdk/issues/10)) ([4550ccc](https://github.com/IBM/vpc-go-sdk/commit/4550cccb167443bad8857dc88fc097ad18061734)) - -## [0.0.2](https://github.com/IBM/vpc-go-sdk/compare/v0.0.1...v0.0.2) (2020-07-06) - - -### Bug Fixes - -* **doc:** Minor update to example code in the README ([#9](https://github.com/IBM/vpc-go-sdk/issues/9)) ([f3841fc](https://github.com/IBM/vpc-go-sdk/commit/f3841fcfbffab66d970ec966b558a48180f0651c)) - -## [0.0.1](https://github.com/IBM/vpc-go-sdk/compare/v0.0.0...v0.0.1) (2020-06-19) - - -### Bug Fixes - -* **go-sdk:** adding semantic release versioning ([#4](https://github.com/IBM/vpc-go-sdk/issues/4)) ([1d92ee5](https://github.com/IBM/vpc-go-sdk/commit/1d92ee5d6481c923382628e8dfc9b9de51cc7ddd)) -* **version:** Update version to enable semantic release ([#6](https://github.com/IBM/vpc-go-sdk/issues/6)) ([2699a61](https://github.com/IBM/vpc-go-sdk/commit/2699a615cd9fad5de60ef442c7512a8744c676a1)) diff --git a/common/github.com/IBM/vpc-go-sdk/CODE_OF_CONDUCT.md b/common/github.com/IBM/vpc-go-sdk/CODE_OF_CONDUCT.md deleted file mode 100644 index 7303c87870..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at phil_adams@us.ibm.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/common/github.com/IBM/vpc-go-sdk/CONTRIBUTING.md b/common/github.com/IBM/vpc-go-sdk/CONTRIBUTING.md deleted file mode 100644 index fee9f665c1..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/CONTRIBUTING.md +++ /dev/null @@ -1,14 +0,0 @@ -# Questions -If you are having problems using the APIs or have a question about IBM Cloud services, -please ask a question at -[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud). - -# Issues -If you encounter an issue with the project, you are welcome to submit a -[bug report](https://github.com/IBM/vpc-go-sdk/issues). -Before that, please search for similar issues. It's possible that someone has already reported the problem. - -# General Information -For general guidance on contributing to this project, please see -[this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/CONTRIBUTING_go.md) - diff --git a/common/github.com/IBM/vpc-go-sdk/Makefile b/common/github.com/IBM/vpc-go-sdk/Makefile deleted file mode 100644 index 81fb2e0b5a..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Makefile - -all: build lint tidy - -travis-ci: build lint tidy test-unit - -build: - go build ./vpcv1 - -test-unit: - go test `go list ./... | grep vpcv1` -v -tags=unit - -test-integration: - go test `go list ./... | grep vpcv1` -v -tags=integration -skipForMockTesting -testCount - -test-examples: - go test `go list ./... | grep vpcv1` -v -tags=examples - -lint: - golangci-lint --timeout=2m run - -tidy: - go mod tidy diff --git a/common/github.com/IBM/vpc-go-sdk/common/headers_test.go b/common/github.com/IBM/vpc-go-sdk/common/headers_test.go deleted file mode 100644 index c8e610ed55..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/common/headers_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package common - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestGetSystemInfo(t *testing.T) { - var sysinfo = GetSystemInfo() - assert.NotNil(t, sysinfo) - assert.True(t, strings.Contains(sysinfo, "arch=")) - assert.True(t, strings.Contains(sysinfo, "os=")) - assert.True(t, strings.Contains(sysinfo, "go.version=")) -} - -func TestGetSdkHeaders(t *testing.T) { - var headers = GetSdkHeaders("myService", "v123", "myOperation") - assert.NotNil(t, headers) - - var foundIt bool - - _, foundIt = headers[HEADER_NAME_USER_AGENT] - assert.True(t, foundIt) - _, foundIt = headers[X_CORRELATION_ID] - assert.True(t, foundIt) - _, foundIt = headers[X_REQUEST_ID] - assert.True(t, foundIt) -} diff --git a/common/github.com/IBM/vpc-go-sdk/go.sum b/common/github.com/IBM/vpc-go-sdk/go.sum deleted file mode 100644 index 88c822dd8e..0000000000 --- a/common/github.com/IBM/vpc-go-sdk/go.sum +++ /dev/null @@ -1,143 +0,0 @@ -github.com/IBM/go-sdk-core/v5 v5.9.1 h1:06pXbD9Rgmqqe2HA5YAeQbB4eYRRFgIoOT+Kh3cp1zo= -github.com/IBM/go-sdk-core/v5 v5.9.1/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= -github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -go.mongodb.org/mongo-driver v1.7.5 h1:ny3p0reEpgsR2cfA5cjgwFZg3Cv/ofFh/8jbhGtz9VI= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= -gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/common/github.com/IBM/vpc-go-sdk/LICENSE b/common/github.com/vpc-go-sdk/LICENSE similarity index 100% rename from common/github.com/IBM/vpc-go-sdk/LICENSE rename to common/github.com/vpc-go-sdk/LICENSE diff --git a/common/github.com/IBM/vpc-go-sdk/common/headers.go b/common/github.com/vpc-go-sdk/common/headers.go similarity index 100% rename from common/github.com/IBM/vpc-go-sdk/common/headers.go rename to common/github.com/vpc-go-sdk/common/headers.go diff --git a/common/github.com/IBM/vpc-go-sdk/common/version.go b/common/github.com/vpc-go-sdk/common/version.go similarity index 100% rename from common/github.com/IBM/vpc-go-sdk/common/version.go rename to common/github.com/vpc-go-sdk/common/version.go diff --git a/common/github.com/IBM/vpc-go-sdk/go.mod b/common/github.com/vpc-go-sdk/go.mod similarity index 53% rename from common/github.com/IBM/vpc-go-sdk/go.mod rename to common/github.com/vpc-go-sdk/go.mod index 84658a9757..2bbba01169 100644 --- a/common/github.com/IBM/vpc-go-sdk/go.mod +++ b/common/github.com/vpc-go-sdk/go.mod @@ -1,18 +1,12 @@ -module github.com/IBM/vpc-go-sdk +module github.ibm.com/ibmcloud/vpc-go-sdk go 1.16 require ( - github.com/IBM/go-sdk-core/v5 v5.12.1 + github.com/IBM/go-sdk-core/v5 v5.10.2 + github.com/IBM/vpc-go-sdk v0.31.0 github.com/go-openapi/strfmt v0.21.3 - github.com/google/uuid v1.1.1 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.20.0 github.com/stretchr/testify v1.8.0 ) - -retract ( - v1.0.2 - v1.0.1 - v1.0.0 -) \ No newline at end of file diff --git a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go similarity index 97% rename from common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go rename to common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index 7f391f67bc..6103f37ef5 100644 --- a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -38,7 +38,7 @@ import ( // VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual // server instances, along with subnets, volumes, load balancers, and more. // -// API Version: 2022-09-20 +// API Version: 2023-10-10 type VpcV1 struct { Service *core.BaseService @@ -46,13 +46,13 @@ type VpcV1 struct { // `2`. generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` - // and `2023-09-20`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` + // and `2023-11-17`. Version *string } // DefaultServiceURL is the default URL to make service requests to. -const DefaultServiceURL = "https://us-south.iaas.cloud.ibm.com/v1" +const DefaultServiceURL = "https://au-syd.iaas.cloud.ibm.com/v1" // DefaultServiceName is the default key used to find external configuration information. const DefaultServiceName = "vpc" @@ -63,8 +63,8 @@ type VpcV1Options struct { URL string Authenticator core.Authenticator - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` - // and `2023-09-20`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` + // and `2023-11-17`. Version *string } @@ -120,9 +120,8 @@ func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { return } } - if options.Version == nil { - options.Version = core.StringPtr("2023-08-08") + options.Version = core.StringPtr("2023-11-16") } service = &VpcV1{ @@ -1170,8 +1169,7 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l // For this request to succeed, `dns.enable_hub` must be `false` for the VPC specified by the identifier in the URL, and // the VPC must not already have a DNS resolution binding. // -// # TODO: finalize topic name with docs team See [Configuring endpoint gateway DNS -// sharing](/docs/vpc?topic=vpc-hub-spoke-model) for more information. +// See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-hub-spoke-model) for more information. func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { return vpc.CreateVPCDnsResolutionBindingWithContext(context.Background(), createVPCDnsResolutionBindingOptions) } @@ -1249,13 +1247,14 @@ func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, // DeleteVPCDnsResolutionBinding : Delete a DNS resolution binding // This request deletes a DNS resolution binding. This operation cannot be reversed. // -// A DNS resolution binding for a VPC with `dns.enable_hub` set to `true` cannot be deleted. -func (vpc *VpcV1) DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (response *core.DetailedResponse, err error) { +// For this request to succeed, the VPC specified by the identifier in the URL must not have +// `dns.resolver.type` set to `delegated`. +func (vpc *VpcV1) DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { return vpc.DeleteVPCDnsResolutionBindingWithContext(context.Background(), deleteVPCDnsResolutionBindingOptions) } // DeleteVPCDnsResolutionBindingWithContext is an alternate form of the DeleteVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (response *core.DetailedResponse, err error) { +func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions cannot be nil") if err != nil { return @@ -1286,6 +1285,7 @@ func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -1295,7 +1295,18 @@ func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) + if err != nil { + return + } + response.Result = result + } return } @@ -1518,13 +1529,13 @@ func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOpt // same way as a retrieved route, and contains the information necessary to create the new route. The request will fail // if the new route will cause a loop. // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { return vpc.CreateVPCRouteWithContext(context.Background(), createVPCRouteOptions) } // CreateVPCRouteWithContext is an alternate form of the CreateVPCRoute method which supports a Context parameter // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteOptions *CreateVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { core.GetLogger().Warn("A deprecated operation has been invoked: CreateVPCRoute") err = core.ValidateNotNil(createVPCRouteOptions, "createVPCRouteOptions cannot be nil") if err != nil { @@ -1596,7 +1607,7 @@ func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCreateVPCRouteResponse) if err != nil { return } @@ -1664,13 +1675,13 @@ func (vpc *VpcV1) DeleteVPCRouteWithContext(ctx context.Context, deleteVPCRouteO // GetVPCRoute : Retrieve a VPC route // This request retrieves a single route specified by the identifier in the URL. // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { return vpc.GetVPCRouteWithContext(context.Background(), getVPCRouteOptions) } // GetVPCRouteWithContext is an alternate form of the GetVPCRoute method which supports a Context parameter // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions *GetVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { core.GetLogger().Warn("A deprecated operation has been invoked: GetVPCRoute") err = core.ValidateNotNil(getVPCRouteOptions, "getVPCRouteOptions cannot be nil") if err != nil { @@ -1718,7 +1729,7 @@ func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetVPCRouteResponse) if err != nil { return } @@ -1732,13 +1743,13 @@ func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions // This request updates a route with the information in a provided route patch. The route patch object is structured in // the same way as a retrieved route and contains only the information to be updated. // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { return vpc.UpdateVPCRouteWithContext(context.Background(), updateVPCRouteOptions) } // UpdateVPCRouteWithContext is an alternate form of the UpdateVPCRoute method which supports a Context parameter // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteOptions *UpdateVPCRouteOptions) (result *Route, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { core.GetLogger().Warn("A deprecated operation has been invoked: UpdateVPCRoute") err = core.ValidateNotNil(updateVPCRouteOptions, "updateVPCRouteOptions cannot be nil") if err != nil { @@ -1792,7 +1803,7 @@ func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalUpdateVPCRouteResponse) if err != nil { return } @@ -5539,6 +5550,9 @@ func (vpc *VpcV1) DeleteInstanceWithContext(ctx context.Context, deleteInstanceO for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + if deleteInstanceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteInstanceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -5656,6 +5670,9 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateInstanceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -6700,8 +6717,8 @@ func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIPWithContext(ctx context.C return } -// ListInstanceNetworkInterfaceIps : List all reserved IPs bound to an instance network interface -// This request lists all reserved IPs bound to an instance network interface. +// ListInstanceNetworkInterfaceIps : List the primary reserved IP for an instance network interface +// This request lists the primary reserved IP for an instance network interface. func (vpc *VpcV1) ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions *ListInstanceNetworkInterfaceIpsOptions) (result *ReservedIPCollectionInstanceNetworkInterfaceContext, response *core.DetailedResponse, err error) { return vpc.ListInstanceNetworkInterfaceIpsWithContext(context.Background(), listInstanceNetworkInterfaceIpsOptions) } @@ -6770,9 +6787,8 @@ func (vpc *VpcV1) ListInstanceNetworkInterfaceIpsWithContext(ctx context.Context return } -// GetInstanceNetworkInterfaceIP : Retrieve bound reserved IP -// This request retrieves the specified reserved IP address if it is bound to the network interface and instance -// specified in the URL. +// GetInstanceNetworkInterfaceIP : Retrieve the primary reserved IP +// This request retrieves the primary reserved IP for an instance network interface. func (vpc *VpcV1) GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { return vpc.GetInstanceNetworkInterfaceIPWithContext(context.Background(), getInstanceNetworkInterfaceIPOptions) } @@ -9259,186 +9275,6 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe return } -// ActivateReservationOptions : The ActivateReservation options. -type ActivateReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewActivateReservationOptions : Instantiate ActivateReservationOptions -func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { - return &ActivateReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { - options.Headers = param - return options -} - -// CreateReservationOptions : The CreateReservation options. -type CreateReservationOptions struct { - // The capacity reservation configuration to use. - Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` - - // The committed use configuration to use for this reservation. - CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // reservation. - Profile *ReservationProfilePrototype `json:"profile" validate:"required"` - - // The zone to use for this reservation. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The affinity policy to use for this reservation: - // - `restricted`: The reservation must be manually requested. - AffinityPolicy *string `json:"affinity_policy,omitempty"` - - // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateReservationOptions.AffinityPolicy property. -// The affinity policy to use for this reservation: -// - `restricted`: The reservation must be manually requested. -const ( - CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" -) - -// NewCreateReservationOptions : Instantiate CreateReservationOptions -func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { - return &CreateReservationOptions{ - Capacity: capacity, - CommittedUse: committedUse, - Profile: profile, - Zone: zone, - } -} - -// SetCapacity : Allow user to set Capacity -func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { - _options.Capacity = capacity - return _options -} - -// SetCommittedUse : Allow user to set CommittedUse -func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { - _options.CommittedUse = committedUse - return _options -} - -// SetProfile : Allow user to set Profile -func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { - _options.Profile = profile - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { - _options.Zone = zone - return _options -} - -// SetAffinityPolicy : Allow user to set AffinityPolicy -func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { - _options.AffinityPolicy = core.StringPtr(affinityPolicy) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { - options.Headers = param - return options -} - -// DeleteReservationOptions : The DeleteReservation options. -type DeleteReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteReservationOptions : Instantiate DeleteReservationOptions -func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { - return &DeleteReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { - options.Headers = param - return options -} - -// GetReservationOptions : The GetReservation options. -type GetReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetReservationOptions : Instantiate GetReservationOptions -func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { - return &GetReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { - options.Headers = param - return options -} - // ListDedicatedHostGroups : List all dedicated host groups // This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for // placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. @@ -10550,6 +10386,9 @@ func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBacku if createBackupPolicyOptions.ResourceGroup != nil { body["resource_group"] = createBackupPolicyOptions.ResourceGroup } + if createBackupPolicyOptions.Scope != nil { + body["scope"] = createBackupPolicyOptions.Scope + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -11811,15 +11650,6 @@ func (vpc *VpcV1) ListBareMetalServersWithContext(ctx context.Context, listBareM if listBareMetalServersOptions.VPCName != nil { builder.AddQuery("vpc.name", fmt.Sprint(*listBareMetalServersOptions.VPCName)) } - if listBareMetalServersOptions.NetworkInterfacesSubnetID != nil { - builder.AddQuery("network_interfaces.subnet.id", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetID)) - } - if listBareMetalServersOptions.NetworkInterfacesSubnetCRN != nil { - builder.AddQuery("network_interfaces.subnet.crn", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetCRN)) - } - if listBareMetalServersOptions.NetworkInterfacesSubnetName != nil { - builder.AddQuery("network_interfaces.subnet.name", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetName)) - } request, err := builder.Build() if err != nil { @@ -12804,8 +12634,8 @@ func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx co return } -// ListBareMetalServerNetworkInterfaceIps : List all reserved IPs bound to a bare metal server network interface -// This request lists all reserved IPs bound to a bare metal server network interface. +// ListBareMetalServerNetworkInterfaceIps : List the primary reserved IP for a bare metal server network interface +// This request lists the primary reserved IP for a bare metal server network interface. func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { return vpc.ListBareMetalServerNetworkInterfaceIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceIpsOptions) } @@ -12868,9 +12698,8 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context. return } -// GetBareMetalServerNetworkInterfaceIP : Retrieve bound reserved IP -// This request retrieves the specified reserved IP address if it is bound to the network interface for the bare metal -// server specified in the URL. +// GetBareMetalServerNetworkInterfaceIP : Retrieve the primary reserved IP +// This request retrieves the primary reserved IP for a bare metal server network interface. func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { return vpc.GetBareMetalServerNetworkInterfaceIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceIPOptions) } @@ -15432,12 +15261,12 @@ func (vpc *VpcV1) DeleteShareSourceWithContext(ctx context.Context, deleteShareS // GetShareSource : Retrieve the source file share for a replica file share // This request retrieves the source file share associated with the replica file share specified by the identifier in // the URL. -func (vpc *VpcV1) GetShareSource(getShareSourceOptions *GetShareSourceOptions) (result *Share, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) GetShareSource(getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { return vpc.GetShareSourceWithContext(context.Background(), getShareSourceOptions) } // GetShareSourceWithContext is an alternate form of the GetShareSource method which supports a Context parameter -func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceOptions *GetShareSourceOptions) (result *Share, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getShareSourceOptions, "getShareSourceOptions cannot be nil") if err != nil { return @@ -15483,7 +15312,7 @@ func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareReference) if err != nil { return } @@ -17995,7 +17824,7 @@ func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listS // - A bare metal server network interface identifier // - A virtual network interface identifier // - A VPN server identifier -// - An application load balancer identifier +// - A load balancer identifier // - An endpoint gateway identifier // - An instance network interface identifier // @@ -18122,7 +17951,7 @@ func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecu // - A bare metal server network interface identifier // - A virtual network interface identifier // - A VPN server identifier -// - An application load balancer identifier +// - A load balancer identifier // - An endpoint gateway identifier // - An instance network interface identifier // @@ -24410,6 +24239,34 @@ func UnmarshalAccountReference(m map[string]json.RawMessage, result interface{}) return } +// ActivateReservationOptions : The ActivateReservation options. +type ActivateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewActivateReservationOptions : Instantiate ActivateReservationOptions +func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { + return &ActivateReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { + options.Headers = param + return options +} + // AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { // The bare metal server identifier. @@ -24864,6 +24721,22 @@ type BackupPolicy struct { // The CRN for this backup policy. CRN *string `json:"crn" validate:"required"` + // The reasons for the current `health_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The URL for this backup policy. Href *string `json:"href" validate:"required"` @@ -24901,8 +24774,26 @@ type BackupPolicy struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The scope for this backup policy. + Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` } +// Constants associated with the BackupPolicy.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + BackupPolicyHealthStateDegradedConst = "degraded" + BackupPolicyHealthStateFaultedConst = "faulted" + BackupPolicyHealthStateInapplicableConst = "inapplicable" + BackupPolicyHealthStateOkConst = "ok" +) + // Constants associated with the BackupPolicy.LifecycleState property. // The lifecycle state of the backup policy. const ( @@ -24938,6 +24829,14 @@ func UnmarshalBackupPolicy(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -24978,6 +24877,10 @@ func UnmarshalBackupPolicy(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -25074,6 +24977,43 @@ func UnmarshalBackupPolicyCollectionNext(m map[string]json.RawMessage, result in return } +// BackupPolicyHealthReason : BackupPolicyHealthReason struct +type BackupPolicyHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the BackupPolicyHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + BackupPolicyHealthReasonCodeMissingServiceAuthorizationPoliciesConst = "missing_service_authorization_policies" +) + +// UnmarshalBackupPolicyHealthReason unmarshals an instance of BackupPolicyHealthReason from the specified map of raw messages. +func UnmarshalBackupPolicyHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // BackupPolicyJob : BackupPolicyJob struct type BackupPolicyJob struct { // Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is @@ -26096,6 +26036,83 @@ func UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(m map[string]json.RawM return } +// BackupPolicyScope : The scope for this backup policy. +// Models which "extend" this model: +// - BackupPolicyScopeEnterpriseReference +// - BackupPolicyScopeAccountReference +type BackupPolicyScope struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` + + // The unique identifier for this enterprise. + ID *string `json:"id,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the BackupPolicyScope.ResourceType property. +// The resource type. +const ( + BackupPolicyScopeResourceTypeEnterpriseConst = "enterprise" +) + +func (*BackupPolicyScope) isaBackupPolicyScope() bool { + return true +} + +type BackupPolicyScopeIntf interface { + isaBackupPolicyScope() bool +} + +// UnmarshalBackupPolicyScope unmarshals an instance of BackupPolicyScope from the specified map of raw messages. +func UnmarshalBackupPolicyScope(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScope) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyScopePrototype : The scope to use for this backup policy. +// +// If unspecified, the policy will be scoped to the account. +// Models which "extend" this model: +// - BackupPolicyScopePrototypeEnterpriseIdentity +type BackupPolicyScopePrototype struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` +} + +func (*BackupPolicyScopePrototype) isaBackupPolicyScopePrototype() bool { + return true +} + +type BackupPolicyScopePrototypeIntf interface { + isaBackupPolicyScopePrototype() bool +} + +// UnmarshalBackupPolicyScopePrototype unmarshals an instance of BackupPolicyScopePrototype from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // BareMetalServer : BareMetalServer struct type BareMetalServer struct { // The total bandwidth (in megabits per second) shared across the bare metal server network interfaces. @@ -26921,10 +26938,10 @@ type BareMetalServerNetworkInterface struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface - // - Cannot directly use an IEEE 802.1q VLAN tag. + // - Cannot directly use an IEEE 802.1Q tag. // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its // array of `allowed_vlans`. - // - Must use an IEEE 802.1q tag. + // - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // @@ -26960,15 +26977,22 @@ type BareMetalServerNetworkInterface struct { // The bare metal server network interface type. Type *string `json:"type" validate:"required"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // Indicates if the interface can float to any other server within the same - // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal - // server in the resource group. Applies only to `vlan` type interfaces. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. Vlan *int64 `json:"vlan,omitempty"` } @@ -26980,10 +27004,10 @@ type BareMetalServerNetworkInterface struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface -// - Cannot directly use an IEEE 802.1q VLAN tag. +// - Cannot directly use an IEEE 802.1Q tag. // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its // array of `allowed_vlans`. -// - Must use an IEEE 802.1q tag. +// - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // @@ -27148,7 +27172,8 @@ type BareMetalServerNetworkInterfacePatch struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface, replacing any existing VLAN IDs. The specified + // values must include IDs for all `vlan` interfaces currently using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` // If `true`: @@ -27228,11 +27253,11 @@ type BareMetalServerNetworkInterfacePrototype struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface - // - Cannot directly use an IEEE 802.1q VLAN tag. + // - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its // array of `allowed_vlans`. - // - Must use an IEEE 802.1q tag. + // - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. @@ -27257,15 +27282,22 @@ type BareMetalServerNetworkInterfacePrototype struct { // The associated subnet. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // Indicates if the interface can float to any other server within the same - // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal - // server in the resource group. Applies only to `vlan` type interfaces. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. Vlan *int64 `json:"vlan,omitempty"` } @@ -27278,11 +27310,11 @@ type BareMetalServerNetworkInterfacePrototype struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface -// - Cannot directly use an IEEE 802.1q VLAN tag. +// - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its // array of `allowed_vlans`. -// - Must use an IEEE 802.1q tag. +// - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. @@ -27411,7 +27443,7 @@ type BareMetalServerPrimaryNetworkInterfacePrototype struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` // If `true`: @@ -27433,7 +27465,7 @@ type BareMetalServerPrimaryNetworkInterfacePrototype struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface - // - Cannot directly use an IEEE 802.1q VLAN tag. + // - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. InterfaceType *string `json:"interface_type,omitempty"` @@ -27466,7 +27498,7 @@ type BareMetalServerPrimaryNetworkInterfacePrototype struct { // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface -// - Cannot directly use an IEEE 802.1q VLAN tag. +// - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" @@ -29067,9 +29099,14 @@ type CreateBackupPolicyOptions struct { Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The scope to use for this backup policy. + // + // If unspecified, the policy will be scoped to the account. + Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -29117,6 +29154,12 @@ func (_options *CreateBackupPolicyOptions) SetResourceGroup(resourceGroup Resour return _options } +// SetScope : Allow user to set Scope +func (_options *CreateBackupPolicyOptions) SetScope(scope BackupPolicyScopePrototypeIntf) *CreateBackupPolicyOptions { + _options.Scope = scope + return _options +} + // SetHeaders : Allow user to set Headers func (options *CreateBackupPolicyOptions) SetHeaders(param map[string]string) *CreateBackupPolicyOptions { options.Headers = param @@ -29352,15 +29395,12 @@ type CreateBareMetalServerOptions struct { NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - // The VPC this bare metal server will reside in. - // - // If specified, it must match the VPC for the subnets that the network interfaces of - // the bare metal server are attached to. + // Identifies a VPC by a unique property. VPC VPCIdentityIntf `json:"vpc,omitempty"` // Allows users to set headers on API requests @@ -29459,7 +29499,7 @@ type CreateDedicatedHostGroupOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -29571,7 +29611,7 @@ type CreateEndpointGatewayOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. @@ -29670,7 +29710,8 @@ type CreateFlowLogCollectorOptions struct { // The Cloud Object Storage bucket where the collected flows will be logged. // The bucket must exist and an IAM service authorization must grant // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - // access to the bucket. + // access to the bucket. For more information, see [Creating a flow log + // collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). StorageBucket LegacyCloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` // The target this collector will collect flow logs for. If the target is an instance, @@ -29686,7 +29727,7 @@ type CreateFlowLogCollectorOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -29759,7 +29800,7 @@ type CreateIkePolicyOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -30223,7 +30264,7 @@ type CreateInstanceGroupOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -30300,7 +30341,7 @@ type CreateInstanceNetworkInterfaceOptions struct { // The associated subnet. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // Indicates whether source IP spoofing is allowed on this instance interface. + // Indicates whether source IP spoofing is allowed on this instance network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -30512,7 +30553,7 @@ type CreateIpsecPolicyOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -30630,7 +30671,7 @@ type CreateKeyOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The crypto-system used by this key. @@ -31143,7 +31184,7 @@ type CreateLoadBalancerOptions struct { Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Indicates whether route mode is enabled for this load balancer. @@ -31541,7 +31582,7 @@ type CreatePlacementGroupOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -31607,7 +31648,7 @@ type CreatePublicGatewayOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -31658,6 +31699,102 @@ func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// CreateReservationOptions : The CreateReservation options. +type CreateReservationOptions struct { + // The capacity reservation configuration to use. + Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` + + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + Profile *ReservationProfilePrototype `json:"profile" validate:"required"` + + // The zone to use for this reservation. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested. + AffinityPolicy *string `json:"affinity_policy,omitempty"` + + // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the CreateReservationOptions.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested. +const ( + CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" +) + +// NewCreateReservationOptions : Instantiate CreateReservationOptions +func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { + return &CreateReservationOptions{ + Capacity: capacity, + CommittedUse: committedUse, + Profile: profile, + Zone: zone, + } +} + +// SetCapacity : Allow user to set Capacity +func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { + _options.Capacity = capacity + return _options +} + +// SetCommittedUse : Allow user to set CommittedUse +func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { + _options.CommittedUse = committedUse + return _options +} + +// SetProfile : Allow user to set Profile +func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { + _options.Profile = profile + return _options +} + +// SetZone : Allow user to set Zone +func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { + _options.Zone = zone + return _options +} + +// SetAffinityPolicy : Allow user to set AffinityPolicy +func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { + _options.AffinityPolicy = core.StringPtr(affinityPolicy) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { + _options.ResourceGroup = resourceGroup + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { + options.Headers = param + return options +} + // CreateSecurityGroupOptions : The CreateSecurityGroup options. type CreateSecurityGroupOptions struct { // The VPC this security group will reside in. @@ -31668,7 +31805,7 @@ type CreateSecurityGroupOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, @@ -32026,6 +32163,156 @@ func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string return options } +// CreateVPCRouteResponse : CreateVPCRouteResponse struct +type CreateVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` + + // The zone the route applies to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the CreateVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + CreateVPCRouteResponseActionDelegateConst = "delegate" + CreateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + CreateVPCRouteResponseActionDeliverConst = "deliver" + CreateVPCRouteResponseActionDropConst = "drop" +) + +// Constants associated with the CreateVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. +const ( + CreateVPCRouteResponseLifecycleStateDeletingConst = "deleting" + CreateVPCRouteResponseLifecycleStateFailedConst = "failed" + CreateVPCRouteResponseLifecycleStatePendingConst = "pending" + CreateVPCRouteResponseLifecycleStateStableConst = "stable" + CreateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + CreateVPCRouteResponseLifecycleStateUpdatingConst = "updating" + CreateVPCRouteResponseLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the CreateVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + CreateVPCRouteResponseOriginServiceConst = "service" + CreateVPCRouteResponseOriginUserConst = "user" +) + +// UnmarshalCreateVPCRouteResponse unmarshals an instance of CreateVPCRouteResponse from the specified map of raw messages. +func UnmarshalCreateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CreateVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // CreateVolumeOptions : The CreateVolume options. type CreateVolumeOptions struct { // The volume prototype object. @@ -32210,7 +32497,7 @@ type CreateVPCOptions struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests @@ -32751,7 +33038,7 @@ type CreateVPNServerOptions struct { Protocol *string `json:"protocol,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The security groups to use for this VPN server. If unspecified, the VPC's default security group is used. @@ -33130,6 +33417,9 @@ type DedicatedHost struct { // The name for this dedicated host. The name is unique across all dedicated hosts in the region. Name *string `json:"name" validate:"required"` + // The dedicated host NUMA configuration. + Numa *DedicatedHostNuma `json:"numa" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this // dedicated host. Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` @@ -33249,6 +33539,10 @@ func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } + err = core.UnmarshalModel(m, "numa", &obj.Numa, UnmarshalDedicatedHostNuma) + if err != nil { + return + } err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) if err != nil { return @@ -33934,6 +34228,54 @@ func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, r return } +// DedicatedHostNuma : The dedicated host NUMA configuration. +type DedicatedHostNuma struct { + // The total number of NUMA nodes for this dedicated host. + Count *int64 `json:"count" validate:"required"` + + // The NUMA nodes for this dedicated host. + Nodes []DedicatedHostNumaNode `json:"nodes" validate:"required"` +} + +// UnmarshalDedicatedHostNuma unmarshals an instance of DedicatedHostNuma from the specified map of raw messages. +func UnmarshalDedicatedHostNuma(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostNuma) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + err = core.UnmarshalModel(m, "nodes", &obj.Nodes, UnmarshalDedicatedHostNumaNode) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostNumaNode : The dedicated host NUMA node configuration. +type DedicatedHostNumaNode struct { + // The available VCPU for this NUMA node. + AvailableVcpu *int64 `json:"available_vcpu" validate:"required"` + + // The total VCPU capacity for this NUMA node. + Vcpu *int64 `json:"vcpu" validate:"required"` +} + +// UnmarshalDedicatedHostNumaNode unmarshals an instance of DedicatedHostNumaNode from the specified map of raw messages. +func UnmarshalDedicatedHostNumaNode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostNumaNode) + err = core.UnmarshalPrimitive(m, "available_vcpu", &obj.AvailableVcpu) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vcpu", &obj.Vcpu) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // DedicatedHostPatch : DedicatedHostPatch struct type DedicatedHostPatch struct { // If set to true, instances can be placed on this dedicated host. @@ -33993,6 +34335,21 @@ type DedicatedHostProfile struct { SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` + // The status of the dedicated host profile: + // - `previous`: This dedicated host profile is an older revision, but remains provisionable + // and usable. + // - `current`: This profile is the latest revision. + // + // Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming + // conventions] + // (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how + // generations are defined within a dedicated host profile. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + // The instance profiles usable by instances placed on dedicated hosts with this profile. SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` @@ -34015,6 +34372,25 @@ const ( DedicatedHostProfileFamilyMemoryConst = "memory" ) +// Constants associated with the DedicatedHostProfile.Status property. +// The status of the dedicated host profile: +// - `previous`: This dedicated host profile is an older revision, but remains provisionable +// and usable. +// - `current`: This profile is the latest revision. +// +// Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming +// conventions] +// (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how +// generations are defined within a dedicated host profile. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileStatusCurrentConst = "current" + DedicatedHostProfileStatusPreviousConst = "previous" +) + // UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(DedicatedHostProfile) @@ -34046,6 +34422,10 @@ func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interfac if err != nil { return } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) if err != nil { return @@ -34709,7 +35089,7 @@ type DedicatedHostPrototype struct { Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The dedicated host group for this dedicated host. @@ -35827,6 +36207,9 @@ type DeleteInstanceOptions struct { // The virtual server instance identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -35844,6 +36227,12 @@ func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteInstanceOptions) SetIfMatch(ifMatch string) *DeleteInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { options.Headers = param @@ -36361,6 +36750,34 @@ func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// DeleteReservationOptions : The DeleteReservation options. +type DeleteReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteReservationOptions : Instantiate DeleteReservationOptions +func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { + return &DeleteReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { + options.Headers = param + return options +} + // DeleteSecurityGroupOptions : The DeleteSecurityGroup options. type DeleteSecurityGroupOptions struct { // The security group identifier. @@ -37343,6 +37760,10 @@ type EndpointGateway struct { // The reserved IPs bound to this endpoint gateway. Ips []ReservedIPReference `json:"ips" validate:"required"` + // The reasons for the current `lifecycle_state` (if any): + // - `dns_resolution_binding_pending`: the DNS resolution binding is being set up. + LifecycleReasons []EndpointGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // The lifecycle state of the endpoint gateway. LifecycleState *string `json:"lifecycle_state" validate:"required"` @@ -37436,6 +37857,10 @@ func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayLifecycleReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return @@ -37568,6 +37993,44 @@ func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result return } +// EndpointGatewayLifecycleReason : EndpointGatewayLifecycleReason struct +type EndpointGatewayLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the EndpointGatewayLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + EndpointGatewayLifecycleReasonCodeDnsResolutionBindingPendingConst = "dns_resolution_binding_pending" + EndpointGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalEndpointGatewayLifecycleReason unmarshals an instance of EndpointGatewayLifecycleReason from the specified map of raw messages. +func UnmarshalEndpointGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayPatch : EndpointGatewayPatch struct type EndpointGatewayPatch struct { // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in @@ -37892,8 +38355,8 @@ type FailoverShareOptions struct { // - `fail`: Fail the operation, resulting in the replication relationship being unchanged. // - `split`: Split the replica from its source, resulting in two individual read-write // file shares. Because the final sync was not completed, the replica may be - // out-of-date. This is useful in disaster recovery scenarios where the source is known - // to be unreachable. + // out-of-date. This occurs in disaster recovery scenarios where the source is known to + // be unreachable. FallbackPolicy *string `json:"fallback_policy,omitempty"` // The failover timeout in seconds. @@ -37910,8 +38373,8 @@ type FailoverShareOptions struct { // - `fail`: Fail the operation, resulting in the replication relationship being unchanged. // - `split`: Split the replica from its source, resulting in two individual read-write // file shares. Because the final sync was not completed, the replica may be -// out-of-date. This is useful in disaster recovery scenarios where the source is known -// to be unreachable. +// out-of-date. This occurs in disaster recovery scenarios where the source is known to +// be unreachable. const ( FailoverShareOptionsFallbackPolicyFailConst = "fail" FailoverShareOptionsFallbackPolicySplitConst = "split" @@ -38180,7 +38643,7 @@ type FloatingIPPrototype struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The zone this floating IP will reside in. @@ -38503,7 +38966,9 @@ type FlowLogCollector struct { // The resource group for this flow log collector. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The Cloud Object Storage bucket where the collected flows are logged. + // The Cloud Object Storage bucket where the collected flows are logged. For more + // information, see [Viewing flow log + // objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). StorageBucket *LegacyCloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` // The target this collector is collecting flow logs for. @@ -40671,6 +41136,34 @@ func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetReg return options } +// GetReservationOptions : The GetReservation options. +type GetReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetReservationOptions : Instantiate GetReservationOptions +func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { + return &GetReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { + options.Headers = param + return options +} + // GetSecurityGroupOptions : The GetSecurityGroup options. type GetSecurityGroupOptions struct { // The security group identifier. @@ -41113,6 +41606,156 @@ func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) return options } +// GetVPCRouteResponse : GetVPCRouteResponse struct +type GetVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` + + // The zone the route applies to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the GetVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + GetVPCRouteResponseActionDelegateConst = "delegate" + GetVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + GetVPCRouteResponseActionDeliverConst = "deliver" + GetVPCRouteResponseActionDropConst = "drop" +) + +// Constants associated with the GetVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. +const ( + GetVPCRouteResponseLifecycleStateDeletingConst = "deleting" + GetVPCRouteResponseLifecycleStateFailedConst = "failed" + GetVPCRouteResponseLifecycleStatePendingConst = "pending" + GetVPCRouteResponseLifecycleStateStableConst = "stable" + GetVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + GetVPCRouteResponseLifecycleStateUpdatingConst = "updating" + GetVPCRouteResponseLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the GetVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + GetVPCRouteResponseOriginServiceConst = "service" + GetVPCRouteResponseOriginUserConst = "user" +) + +// UnmarshalGetVPCRouteResponse unmarshals an instance of GetVPCRouteResponse from the specified map of raw messages. +func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // GetVirtualNetworkInterfaceOptions : The GetVirtualNetworkInterface options. type GetVirtualNetworkInterfaceOptions struct { // The virtual network interface identifier. @@ -43397,7 +44040,7 @@ type ImagePrototype struct { ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. @@ -43671,6 +44314,27 @@ type Instance struct { // The virtual server instance GPU configuration. Gpu *InstanceGpu `json:"gpu,omitempty"` + // The reasons for the current instance `health_state` (if any): + // - `reservation_capacity_unavailable`: The reservation affinity pool has no + // available capacity. + // - `reservation_deleted`: The reservation affinity pool has a deleted reservation. + // - `reservation_expired`: The reservation affinity pool has an expired reservation. + // - `reservation_failed`: The reservation affinity pool has a failed reservation. + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []InstanceHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The URL for this virtual server instance. Href *string `json:"href" validate:"required"` @@ -43702,6 +44366,11 @@ type Instance struct { // The network interfaces for this instance, including the primary network interface. NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` + // The number of NUMA nodes this virtual server instance is provisioned on. + // + // This property will be absent if the instance's `status` is not `running`. + NumaCount *int64 `json:"numa_count,omitempty"` + // The placement restrictions for the virtual server instance. PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` @@ -43763,6 +44432,21 @@ type Instance struct { Zone *ZoneReference `json:"zone" validate:"required"` } +// Constants associated with the Instance.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + InstanceHealthStateDegradedConst = "degraded" + InstanceHealthStateFaultedConst = "faulted" + InstanceHealthStateInapplicableConst = "inapplicable" + InstanceHealthStateOkConst = "ok" +) + // Constants associated with the Instance.LifecycleState property. // The lifecycle state of the virtual server instance. const ( @@ -43837,6 +44521,14 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalInstanceHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -43873,6 +44565,10 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } + err = core.UnmarshalPrimitive(m, "numa_count", &obj.NumaCount) + if err != nil { + return + } err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) if err != nil { return @@ -46686,6 +47382,7 @@ func UnmarshalInstanceInitializationDefaultTrustedProfile(m map[string]json.RawM return } +// InstanceInitializationPassword : InstanceInitializationPassword struct type InstanceInitializationPassword struct { // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` @@ -46895,6 +47592,8 @@ type InstancePatch struct { // The placement restrictions to use for the virtual server instance. For the placement // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. + // + // If set, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` // The profile to use for this virtual server instance. For the profile to be changed, @@ -47192,12 +47891,32 @@ type InstanceProfile struct { NetworkInterfaceCount InstanceProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` + NumaCount InstanceProfileNumaCountIntf `json:"numa_count,omitempty"` + OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance profile: + // - `previous`: This instance profile is an older revision, but remains provisionable and + // usable. + // - `current`: This profile is the latest revision. + // + // Note that revisions are indicated by the generation of an instance profile. Refer to the + // [profile naming conventions] + // (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how + // generations are defined within an instance profile. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` @@ -47207,6 +47926,31 @@ type InstanceProfile struct { VcpuManufacturer *InstanceProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` } +// Constants associated with the InstanceProfile.ResourceType property. +// The resource type. +const ( + InstanceProfileResourceTypeInstanceProfileConst = "instance_profile" +) + +// Constants associated with the InstanceProfile.Status property. +// The status of the instance profile: +// - `previous`: This instance profile is an older revision, but remains provisionable and +// usable. +// - `current`: This profile is the latest revision. +// +// Note that revisions are indicated by the generation of an instance profile. Refer to the +// [profile naming conventions] +// (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how +// generations are defined within an instance profile. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the +// unexpected property value was encountered. +const ( + InstanceProfileStatusCurrentConst = "current" + InstanceProfileStatusPreviousConst = "previous" +) + // UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceProfile) @@ -47254,6 +47998,10 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "numa_count", &obj.NumaCount, UnmarshalInstanceProfileNumaCount) + if err != nil { + return + } err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) if err != nil { return @@ -47266,6 +48014,14 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) if err != nil { return @@ -47957,6 +48713,47 @@ func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interfa return } +// InstanceProfileNumaCount : InstanceProfileNumaCount struct +// Models which "extend" this model: +// - InstanceProfileNumaCountFixed +// - InstanceProfileNumaCountDependent +type InstanceProfileNumaCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfileNumaCount.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountTypeFixedConst = "fixed" +) + +func (*InstanceProfileNumaCount) isaInstanceProfileNumaCount() bool { + return true +} + +type InstanceProfileNumaCountIntf interface { + isaInstanceProfileNumaCount() bool +} + +// UnmarshalInstanceProfileNumaCount unmarshals an instance of InstanceProfileNumaCount from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileNetworkInterfaceCount : InstanceProfileNetworkInterfaceCount struct // Models which "extend" this model: // - InstanceProfileNetworkInterfaceCountRange @@ -48090,8 +48887,17 @@ type InstanceProfileReference struct { // The globally unique name for this virtual server instance profile. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } +// Constants associated with the InstanceProfileReference.ResourceType property. +// The resource type. +const ( + InstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" +) + // UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceProfileReference) @@ -48103,6 +48909,10 @@ func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result inte if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -48416,6 +49226,8 @@ type InstancePrototype struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -48428,7 +49240,7 @@ type InstancePrototype struct { ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -48678,9 +49490,7 @@ type InstanceReservationAffinityPatch struct { // - `disabled`: Reservations will not be used // - `manual`: Reservations in `pool` will be available for use // - // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. - // - // The policy must be `disabled` if `placement_target` is specified. + // The policy must be `disabled` if `placement_target` is set. Policy *string `json:"policy,omitempty"` // The pool of reservations available for use by this virtual server instance, replacing the existing pool of @@ -48699,9 +49509,7 @@ type InstanceReservationAffinityPatch struct { // - `disabled`: Reservations will not be used // - `manual`: Reservations in `pool` will be available for use // -// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. -// -// The policy must be `disabled` if `placement_target` is specified. +// The policy must be `disabled` if `placement_target` is set. const ( InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" InstanceReservationAffinityPatchPolicyManualConst = "manual" @@ -48869,6 +49677,8 @@ type InstanceTemplate struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -49224,6 +50034,8 @@ type InstanceTemplatePrototype struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -49236,7 +50048,7 @@ type InstanceTemplatePrototype struct { ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -50282,18 +51094,6 @@ type ListBareMetalServersOptions struct { // Filters the collection to resources with a `vpc.name` property matching the exact specified name. VPCName *string `json:"vpc.name,omitempty"` - // Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.id` - // property matching the specified identifier. - NetworkInterfacesSubnetID *string `json:"network_interfaces.subnet.id,omitempty"` - - // Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.crn` - // property matching the specified CRN. - NetworkInterfacesSubnetCRN *string `json:"network_interfaces.subnet.crn,omitempty"` - - // Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.name` - // property matching the exact specified name. - NetworkInterfacesSubnetName *string `json:"network_interfaces.subnet.name,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } @@ -50345,24 +51145,6 @@ func (_options *ListBareMetalServersOptions) SetVPCName(vpcName string) *ListBar return _options } -// SetNetworkInterfacesSubnetID : Allow user to set NetworkInterfacesSubnetID -func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetID(networkInterfacesSubnetID string) *ListBareMetalServersOptions { - _options.NetworkInterfacesSubnetID = core.StringPtr(networkInterfacesSubnetID) - return _options -} - -// SetNetworkInterfacesSubnetCRN : Allow user to set NetworkInterfacesSubnetCRN -func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetCRN(networkInterfacesSubnetCRN string) *ListBareMetalServersOptions { - _options.NetworkInterfacesSubnetCRN = core.StringPtr(networkInterfacesSubnetCRN) - return _options -} - -// SetNetworkInterfacesSubnetName : Allow user to set NetworkInterfacesSubnetName -func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetName(networkInterfacesSubnetName string) *ListBareMetalServersOptions { - _options.NetworkInterfacesSubnetName = core.StringPtr(networkInterfacesSubnetName) - return _options -} - // SetHeaders : Allow user to set Headers func (options *ListBareMetalServersOptions) SetHeaders(param map[string]string) *ListBareMetalServersOptions { options.Headers = param @@ -54176,6 +54958,8 @@ type LoadBalancer struct { // The security groups targeting this load balancer. // + // If empty, all inbound and outbound traffic is allowed. + // // Applicable only for load balancers that support security groups. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` @@ -58300,7 +59084,7 @@ type NetworkACLPrototype struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The VPC this network ACL will reside in. @@ -59266,7 +60050,7 @@ func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, resul // NetworkInterface : NetworkInterface struct type NetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this instance interface. + // Indicates whether source IP spoofing is allowed on this instance network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the instance network interface was created. @@ -59615,7 +60399,7 @@ func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json. // NetworkInterfacePatch : NetworkInterfacePatch struct type NetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this instance interface. + // Indicates whether source IP spoofing is allowed on this instance network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -59650,7 +60434,7 @@ func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string // NetworkInterfacePrototype : NetworkInterfacePrototype struct type NetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this instance interface. + // Indicates whether source IP spoofing is allowed on this instance network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -60499,7 +61283,7 @@ type PublicGatewayFloatingIPPrototype struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` } @@ -62801,7 +63585,7 @@ func UnmarshalResourceFilter(m map[string]json.RawMessage, result interface{}) ( } // ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource -// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. +// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. // Models which "extend" this model: // - ResourceGroupIdentityByID type ResourceGroupIdentity struct { @@ -66356,16 +67140,16 @@ type ShareMountTargetVirtualNetworkInterfacePrototype struct { // an available address on the subnet will be automatically selected and reserved. PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // The resource group to use for this virtual network interface. If unspecified, the + // share's resource group will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC // for the subnet is used. SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The associated subnet. Required if `primary_ip` does not specify a reserved IP and - // `primary_ip.address` is not specified. + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } @@ -66921,7 +67705,9 @@ type SharePrototype struct { UserTags []string `json:"user_tags,omitempty"` // The zone this file share will reside in. - // For a replica share, this must be a different zone in the same region as the source share. + // + // For a replica share, this must be a different zone in the same region as the + // source share. Zone ZoneIdentityIntf `json:"zone" validate:"required"` // The access control mode for the share: @@ -66945,7 +67731,7 @@ type SharePrototype struct { InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The size of the file share rounded up to the next gigabyte. @@ -67792,7 +68578,7 @@ type SnapshotPrototype struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. @@ -68467,7 +69253,7 @@ type SubnetPrototype struct { PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The routing table to use for this subnet. If unspecified, the default routing table @@ -69731,6 +70517,10 @@ type UpdateInstanceOptions struct { // The instance patch. InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -69755,6 +70545,12 @@ func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateInstanceOptions) SetIfMatch(ifMatch string) *UpdateInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { options.Headers = param @@ -70767,6 +71563,156 @@ func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string return options } +// UpdateVPCRouteResponse : UpdateVPCRouteResponse struct +type UpdateVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` + + // The zone the route applies to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the UpdateVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + UpdateVPCRouteResponseActionDelegateConst = "delegate" + UpdateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + UpdateVPCRouteResponseActionDeliverConst = "deliver" + UpdateVPCRouteResponseActionDropConst = "drop" +) + +// Constants associated with the UpdateVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. +const ( + UpdateVPCRouteResponseLifecycleStateDeletingConst = "deleting" + UpdateVPCRouteResponseLifecycleStateFailedConst = "failed" + UpdateVPCRouteResponseLifecycleStatePendingConst = "pending" + UpdateVPCRouteResponseLifecycleStateStableConst = "stable" + UpdateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + UpdateVPCRouteResponseLifecycleStateUpdatingConst = "updating" + UpdateVPCRouteResponseLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the UpdateVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + UpdateVPCRouteResponseOriginServiceConst = "service" + UpdateVPCRouteResponseOriginUserConst = "user" +) + +// UnmarshalUpdateVPCRouteResponse unmarshals an instance of UpdateVPCRouteResponse from the specified map of raw messages. +func UnmarshalUpdateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UpdateVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // UpdateVirtualNetworkInterfaceOptions : The UpdateVirtualNetworkInterface options. type UpdateVirtualNetworkInterfaceOptions struct { // The virtual network interface identifier. @@ -70958,6 +71904,7 @@ type UpdateVPCOptions struct { VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. IfMatch *string `json:"If-Match,omitempty"` // Allows users to set headers on API requests @@ -71942,6 +72889,14 @@ type VpcdnsResolver struct { VPC *VPCReferenceDnsResolverContext `json:"vpc,omitempty"` // The manually specified DNS servers for this VPC. + // + // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the + // affinity for that zone first, followed by the unique DNS servers from other zones. + // + // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. ManualServers []DnsServer `json:"manual_servers,omitempty"` // The configuration of the system DNS resolver for this VPC. @@ -72044,6 +72999,14 @@ type VpcdnsResolverPatch struct { // - have a unique `zone_affinity`, or // - not have a `zone_affinity`. // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + // // `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is `manual`. ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` @@ -72131,6 +73094,14 @@ type VpcdnsResolverPrototype struct { // // - have a unique `zone_affinity`, or // - not have a `zone_affinity`. + // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` } @@ -72233,6 +73204,7 @@ type VPCHealthReason struct { // A snake case string succinctly identifying the reason for this health state. const ( VPCHealthReasonCodeDnsResolutionBindingFailedConst = "dns_resolution_binding_failed" + VPCHealthReasonCodeInternalErrorConst = "internal_error" ) // UnmarshalVPCHealthReason unmarshals an instance of VPCHealthReason from the specified map of raw messages. @@ -72595,12 +73567,44 @@ type VPNGateway struct { // The VPN gateway's CRN. CRN *string `json:"crn" validate:"required"` + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The VPN gateway's canonical URL. Href *string `json:"href" validate:"required"` // The unique identifier for this VPN gateway. ID *string `json:"id" validate:"required"` + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + // Collection of VPN gateway members. Members []VPNGatewayMember `json:"members" validate:"required"` @@ -72613,9 +73617,6 @@ type VPNGateway struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the VPN gateway. - Status *string `json:"status" validate:"required"` - Subnet *SubnetReference `json:"subnet" validate:"required"` // The VPC this VPN gateway resides in. @@ -72625,19 +73626,37 @@ type VPNGateway struct { Mode *string `json:"mode,omitempty"` } -// Constants associated with the VPNGateway.ResourceType property. -// The resource type. +// Constants associated with the VPNGateway.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. const ( - VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" + VPNGatewayHealthStateDegradedConst = "degraded" + VPNGatewayHealthStateFaultedConst = "faulted" + VPNGatewayHealthStateInapplicableConst = "inapplicable" + VPNGatewayHealthStateOkConst = "ok" ) -// Constants associated with the VPNGateway.Status property. -// The status of the VPN gateway. +// Constants associated with the VPNGateway.LifecycleState property. +// The lifecycle state of the VPN gateway. const ( - VPNGatewayStatusAvailableConst = "available" - VPNGatewayStatusDeletingConst = "deleting" - VPNGatewayStatusFailedConst = "failed" - VPNGatewayStatusPendingConst = "pending" + VPNGatewayLifecycleStateDeletingConst = "deleting" + VPNGatewayLifecycleStateFailedConst = "failed" + VPNGatewayLifecycleStatePendingConst = "pending" + VPNGatewayLifecycleStateStableConst = "stable" + VPNGatewayLifecycleStateSuspendedConst = "suspended" + VPNGatewayLifecycleStateUpdatingConst = "updating" + VPNGatewayLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGateway.ResourceType property. +// The resource type. +const ( + VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" ) // Constants associated with the VPNGateway.Mode property. @@ -72669,6 +73688,14 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -72677,6 +73704,14 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) if err != nil { return @@ -72693,10 +73728,6 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return @@ -72854,6 +73885,27 @@ type VPNGatewayConnection struct { // The status of a VPN gateway connection. Status *string `json:"status" validate:"required"` + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + // Routing protocols are disabled for this VPN gateway connection. RoutingProtocol *string `json:"routing_protocol,omitempty"` @@ -72966,6 +74018,10 @@ func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interfac if err != nil { return } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return @@ -73572,6 +74628,27 @@ type VPNGatewayConnectionStaticRouteModeTunnel struct { // The status of the VPN Tunnel. Status *string `json:"status" validate:"required"` + + // The reasons for the current VPN gateway connection tunnels status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` } // Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. @@ -73592,12 +74669,209 @@ func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionStatusReason : VPNGatewayConnectionStatusReason struct +type VPNGatewayConnectionStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway connection's status. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + VPNGatewayConnectionStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" + VPNGatewayConnectionStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" + VPNGatewayConnectionStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" + VPNGatewayConnectionStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" + VPNGatewayConnectionStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayConnectionStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" + VPNGatewayConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayConnectionStatusReason unmarshals an instance of VPNGatewayConnectionStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct +type VPNGatewayConnectionTunnelStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway connection tunnel's status. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionTunnelStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + VPNGatewayConnectionTunnelStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" + VPNGatewayConnectionTunnelStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayConnectionTunnelStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayConnectionTunnelStatusReason unmarshals an instance of VPNGatewayConnectionTunnelStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnelStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnelStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayHealthReason : VPNGatewayHealthReason struct +type VPNGatewayHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNGatewayHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" + VPNGatewayHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNGatewayHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNGatewayHealthReason unmarshals an instance of VPNGatewayHealthReason from the specified map of raw messages. +func UnmarshalVPNGatewayHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayLifecycleReason : VPNGatewayLifecycleReason struct +type VPNGatewayLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNGatewayLifecycleReason unmarshals an instance of VPNGatewayLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } // VPNGatewayMember : VPNGatewayMember struct type VPNGatewayMember struct { + // The reasons for the current VPN gateway member health_state (if any): + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayMemberHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + + // The reasons for the current VPN gateway member lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayMemberLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway member. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The reserved IP address assigned to the VPN gateway member. // // This property will be present only when the VPN gateway status is `available`. @@ -73608,11 +74882,35 @@ type VPNGatewayMember struct { // The high availability role assigned to the VPN gateway member. Role *string `json:"role" validate:"required"` - - // The status of the VPN gateway member. - Status *string `json:"status" validate:"required"` } +// Constants associated with the VPNGatewayMember.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNGatewayMemberHealthStateDegradedConst = "degraded" + VPNGatewayMemberHealthStateFaultedConst = "faulted" + VPNGatewayMemberHealthStateInapplicableConst = "inapplicable" + VPNGatewayMemberHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGatewayMember.LifecycleState property. +// The lifecycle state of the VPN gateway member. +const ( + VPNGatewayMemberLifecycleStateDeletingConst = "deleting" + VPNGatewayMemberLifecycleStateFailedConst = "failed" + VPNGatewayMemberLifecycleStatePendingConst = "pending" + VPNGatewayMemberLifecycleStateStableConst = "stable" + VPNGatewayMemberLifecycleStateSuspendedConst = "suspended" + VPNGatewayMemberLifecycleStateUpdatingConst = "updating" + VPNGatewayMemberLifecycleStateWaitingConst = "waiting" +) + // Constants associated with the VPNGatewayMember.Role property. // The high availability role assigned to the VPN gateway member. const ( @@ -73620,18 +74918,25 @@ const ( VPNGatewayMemberRoleStandbyConst = "standby" ) -// Constants associated with the VPNGatewayMember.Status property. -// The status of the VPN gateway member. -const ( - VPNGatewayMemberStatusAvailableConst = "available" - VPNGatewayMemberStatusDeletingConst = "deleting" - VPNGatewayMemberStatusFailedConst = "failed" - VPNGatewayMemberStatusPendingConst = "pending" -) - // UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(VPNGatewayMember) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayMemberHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayMemberLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalReservedIPReference) if err != nil { return @@ -73644,7 +74949,78 @@ func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayMemberHealthReason : VPNGatewayMemberHealthReason struct +type VPNGatewayMemberHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayMemberHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNGatewayMemberHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNGatewayMemberHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNGatewayMemberHealthReason unmarshals an instance of VPNGatewayMemberHealthReason from the specified map of raw messages. +func UnmarshalVPNGatewayMemberHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMemberHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayMemberLifecycleReason : VPNGatewayMemberLifecycleReason struct +type VPNGatewayMemberLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayMemberLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNGatewayMemberLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNGatewayMemberLifecycleReason unmarshals an instance of VPNGatewayMemberLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMemberLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -73689,7 +75065,7 @@ type VPNGatewayPrototype struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Identifies a subnet by a unique property. @@ -73791,6 +75167,23 @@ type VPNServer struct { // Indicates whether the split tunneling is enabled on this VPN server. EnableSplitTunneling *bool `json:"enable_split_tunneling" validate:"required"` + // The reasons for the current VPN server health_state (if any): + // - `cannot_access_client_certificate`: VPN server's client certificate is inaccessible + // (verify certificate exists and that IAM policies grant `VPN server for VPC` access to + // `Secrets Manager`) + // - `cannot_access_server_certificate`: VPN server's server certificate is inaccessible + // (verify certificate exists and that IAM policies grant `VPN server for VPC` access to + // `Secrets Manager`) + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNServerHealthReason `json:"health_reasons" validate:"required"` + // The health of this resource. // - `ok`: No abnormal behavior detected // - `degraded`: Experiencing compromised performance, capacity, or connectivity @@ -73809,6 +75202,15 @@ type VPNServer struct { // The unique identifier for this VPN server. ID *string `json:"id" validate:"required"` + // The reasons for the current VPN server lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // The lifecycle state of the VPN server. LifecycleState *string `json:"lifecycle_state" validate:"required"` @@ -73923,6 +75325,10 @@ func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err e if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerHealthReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { return @@ -73939,6 +75345,10 @@ func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err e if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerLifecycleReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return @@ -74440,6 +75850,84 @@ func UnmarshalVPNServerCollectionNext(m map[string]json.RawMessage, result inter return } +// VPNServerHealthReason : VPNServerHealthReason struct +type VPNServerHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNServerHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNServerHealthReasonCodeCannotAccessClientCertificateConst = "cannot_access_client_certificate" + VPNServerHealthReasonCodeCannotAccessServerCertificateConst = "cannot_access_server_certificate" + VPNServerHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" + VPNServerHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNServerHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNServerHealthReason unmarshals an instance of VPNServerHealthReason from the specified map of raw messages. +func UnmarshalVPNServerHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNServerLifecycleReason : VPNServerLifecycleReason struct +type VPNServerLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNServerLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNServerLifecycleReason unmarshals an instance of VPNServerLifecycleReason from the specified map of raw messages. +func UnmarshalVPNServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNServerPatch : VPNServerPatch struct type VPNServerPatch struct { // The certificate instance for this VPN server. @@ -74587,12 +76075,38 @@ type VPNServerRoute struct { // be dropped. Destination *string `json:"destination" validate:"required"` + // The reasons for the current VPN server route health_state (if any): + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNServerRouteHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The URL for this VPN route. Href *string `json:"href" validate:"required"` // The unique identifier for this VPN route. ID *string `json:"id" validate:"required"` + // The reasons for the current VPN server route lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNServerRouteLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // The lifecycle state of the VPN route. LifecycleState *string `json:"lifecycle_state" validate:"required"` @@ -74618,6 +76132,21 @@ const ( VPNServerRouteActionTranslateConst = "translate" ) +// Constants associated with the VPNServerRoute.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNServerRouteHealthStateDegradedConst = "degraded" + VPNServerRouteHealthStateFaultedConst = "faulted" + VPNServerRouteHealthStateInapplicableConst = "inapplicable" + VPNServerRouteHealthStateOkConst = "ok" +) + // Constants associated with the VPNServerRoute.LifecycleState property. // The lifecycle state of the VPN route. const ( @@ -74651,6 +76180,14 @@ func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerRouteHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -74659,6 +76196,10 @@ func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerRouteLifecycleReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return @@ -74767,6 +76308,80 @@ func UnmarshalVPNServerRouteCollectionNext(m map[string]json.RawMessage, result return } +// VPNServerRouteHealthReason : VPNServerRouteHealthReason struct +type VPNServerRouteHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNServerRouteHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNServerRouteHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNServerRouteHealthReason unmarshals an instance of VPNServerRouteHealthReason from the specified map of raw messages. +func UnmarshalVPNServerRouteHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNServerRouteLifecycleReason : VPNServerRouteLifecycleReason struct +type VPNServerRouteLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNServerRouteLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNServerRouteLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNServerRouteLifecycleReason unmarshals an instance of VPNServerRouteLifecycleReason from the specified map of raw messages. +func UnmarshalVPNServerRouteLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNServerRoutePatch : VPNServerRoutePatch struct type VPNServerRoutePatch struct { // The name for this VPN server route. The name must not be used by another route for the VPN server. @@ -75115,10 +76730,6 @@ type VirtualNetworkInterfaceReferenceAttachmentContext struct { // The CRN for this virtual network interface. CRN *string `json:"crn" validate:"required"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VirtualNetworkInterfaceReferenceAttachmentContextDeleted `json:"deleted,omitempty"` - // The URL for this virtual network interface. Href *string `json:"href" validate:"required"` @@ -75145,10 +76756,6 @@ func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]jso if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContextDeleted) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -75169,24 +76776,6 @@ func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]jso return } -// VirtualNetworkInterfaceReferenceAttachmentContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VirtualNetworkInterfaceReferenceAttachmentContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceReferenceAttachmentContextDeleted unmarshals an instance of VirtualNetworkInterfaceReferenceAttachmentContextDeleted from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceAttachmentContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // VirtualNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary // information. type VirtualNetworkInterfaceReferenceDeleted struct { @@ -75205,24 +76794,6 @@ func UnmarshalVirtualNetworkInterfaceReferenceDeleted(m map[string]json.RawMessa return } -// VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted unmarshals an instance of VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // VirtualNetworkInterfaceTarget : A virtual network interface target. // // The resource types that can be virtual network interface targets are expected to expand in the future. When iterating @@ -76622,7 +78193,7 @@ type VolumePrototype struct { Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -77303,6 +78874,116 @@ func UnmarshalBackupPolicyJobSourceVolumeReference(m map[string]json.RawMessage, return } +// BackupPolicyScopePrototypeEnterpriseIdentity : Identifies an enterprise by a unique property. +// Models which "extend" this model: +// - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN +// This model "extends" BackupPolicyScopePrototype +type BackupPolicyScopePrototypeEnterpriseIdentity struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` +} + +func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { + return true +} + +type BackupPolicyScopePrototypeEnterpriseIdentityIntf interface { + BackupPolicyScopePrototypeIntf + isaBackupPolicyScopePrototypeEnterpriseIdentity() bool +} + +func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototype() bool { + return true +} + +// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentity from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototypeEnterpriseIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyScopeAccountReference : BackupPolicyScopeAccountReference struct +// This model "extends" BackupPolicyScope +type BackupPolicyScopeAccountReference struct { + // The unique identifier for this account. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the BackupPolicyScopeAccountReference.ResourceType property. +// The resource type. +const ( + BackupPolicyScopeAccountReferenceResourceTypeAccountConst = "account" +) + +func (*BackupPolicyScopeAccountReference) isaBackupPolicyScope() bool { + return true +} + +// UnmarshalBackupPolicyScopeAccountReference unmarshals an instance of BackupPolicyScopeAccountReference from the specified map of raw messages. +func UnmarshalBackupPolicyScopeAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopeAccountReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyScopeEnterpriseReference : BackupPolicyScopeEnterpriseReference struct +// This model "extends" BackupPolicyScope +type BackupPolicyScopeEnterpriseReference struct { + // The CRN for this enterprise. + CRN *string `json:"crn" validate:"required"` + + // The unique identifier for this enterprise. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the BackupPolicyScopeEnterpriseReference.ResourceType property. +// The resource type. +const ( + BackupPolicyScopeEnterpriseReferenceResourceTypeEnterpriseConst = "enterprise" +) + +func (*BackupPolicyScopeEnterpriseReference) isaBackupPolicyScope() bool { + return true +} + +// UnmarshalBackupPolicyScopeEnterpriseReference unmarshals an instance of BackupPolicyScopeEnterpriseReference from the specified map of raw messages. +func UnmarshalBackupPolicyScopeEnterpriseReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopeEnterpriseReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // BareMetalServerBootTargetBareMetalServerDiskReference : BareMetalServerBootTargetBareMetalServerDiskReference struct // This model "extends" BareMetalServerBootTarget type BareMetalServerBootTargetBareMetalServerDiskReference struct { @@ -77630,14 +79311,14 @@ type BareMetalServerNetworkInterfaceByPci struct { // The bare metal server network interface type. Type *string `json:"type" validate:"required"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` // - `pci`: a physical PCI device which can only be created or deleted when the bare metal // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface - // - Cannot directly use an IEEE 802.1q VLAN tag. + // - Cannot directly use an IEEE 802.1Q tag. InterfaceType *string `json:"interface_type" validate:"required"` } @@ -77668,7 +79349,7 @@ const ( // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface -// - Cannot directly use an IEEE 802.1q VLAN tag. +// - Cannot directly use an IEEE 802.1Q tag. const ( BareMetalServerNetworkInterfaceByPciInterfaceTypePciConst = "pci" ) @@ -77808,19 +79489,26 @@ type BareMetalServerNetworkInterfaceByVlan struct { // The bare metal server network interface type. Type *string `json:"type" validate:"required"` - // Indicates if the interface can float to any other server within the same - // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal - // server in the resource group. Applies only to `vlan` type interfaces. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array // of `allowed_vlans`. - // - Must use an IEEE 802.1q tag. + // - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. InterfaceType *string `json:"interface_type" validate:"required"` - // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. Vlan *int64 `json:"vlan" validate:"required"` } @@ -77849,7 +79537,7 @@ const ( // Constants associated with the BareMetalServerNetworkInterfaceByVlan.InterfaceType property. // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array // of `allowed_vlans`. -// - Must use an IEEE 802.1q tag. +// - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. const ( @@ -78074,14 +79762,14 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPc // The associated subnet. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` // - `pci`: a physical PCI device which can only be created or deleted when the bare metal // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface - // - Cannot directly use an IEEE 802.1q VLAN tag. + // - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. InterfaceType *string `json:"interface_type" validate:"required"` } @@ -78091,7 +79779,7 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPc // server is stopped // - Has an `allowed_vlans` property which controls the VLANs that will be permitted // to use the PCI interface -// - Cannot directly use an IEEE 802.1q VLAN tag. +// - Cannot directly use an IEEE 802.1Q tag. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypePciConst = "pci" @@ -78186,27 +79874,34 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVl // The associated subnet. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // Indicates if the interface can float to any other server within the same - // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal - // server in the resource group. Applies only to `vlan` type interfaces. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array // of `allowed_vlans`. - // - Must use an IEEE 802.1q tag. + // - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. InterfaceType *string `json:"interface_type" validate:"required"` - // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. Vlan *int64 `json:"vlan" validate:"required"` } // Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.InterfaceType property. // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array // of `allowed_vlans`. -// - Must use an IEEE 802.1q tag. +// - Must use an IEEE 802.1Q tag. // - Has its own security groups and does not inherit those of the PCI device through // which traffic flows. // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. @@ -84242,6 +85937,70 @@ func UnmarshalInstanceProfileMemoryRange(m map[string]json.RawMessage, result in return } +// InstanceProfileNumaCountDependent : The total number of NUMA nodes for an instance with this profile depends on its configuration and the capacity +// constraints within the zone. +// This model "extends" InstanceProfileNumaCount +type InstanceProfileNumaCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the InstanceProfileNumaCountDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountDependentTypeDependentConst = "dependent" +) + +func (*InstanceProfileNumaCountDependent) isaInstanceProfileNumaCount() bool { + return true +} + +// UnmarshalInstanceProfileNumaCountDependent unmarshals an instance of InstanceProfileNumaCountDependent from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileNumaCountFixed : The total number of NUMA nodes for an instance with this profile. +// This model "extends" InstanceProfileNumaCount +type InstanceProfileNumaCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileNumaCountFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfileNumaCountFixed) isaInstanceProfileNumaCount() bool { + return true +} + +// UnmarshalInstanceProfileNumaCountFixed unmarshals an instance of InstanceProfileNumaCountFixed from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileNetworkInterfaceCountDependent : The number of network interfaces supported on an instance with this profile is dependent on its configuration. // This model "extends" InstanceProfileNetworkInterfaceCount type InstanceProfileNetworkInterfaceCountDependent struct { @@ -84736,6 +86495,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -84917,6 +86678,8 @@ type InstancePrototypeInstanceByImage struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -85091,6 +86854,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -85261,6 +87026,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -85455,6 +87222,8 @@ type InstancePrototypeInstanceByVolume struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -85713,6 +87482,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -85892,6 +87663,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -86064,6 +87837,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -86229,6 +88004,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -86432,6 +88209,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -86628,6 +88407,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -86817,6 +88598,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -90215,7 +91998,7 @@ type PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct { Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` } @@ -90996,10 +92779,6 @@ type ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext str // The CRN for this virtual network interface. CRN *string `json:"crn" validate:"required"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted `json:"deleted,omitempty"` - // The URL for this virtual network interface. Href *string `json:"href" validate:"required"` @@ -91030,10 +92809,6 @@ func UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetCo if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -93115,16 +94890,16 @@ type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceProt // an available address on the subnet will be automatically selected and reserved. PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + // The resource group to use for this virtual network interface. If unspecified, the + // share's resource group will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC // for the subnet is used. SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The associated subnet. Required if `primary_ip` does not specify a reserved IP and - // `primary_ip.address` is not specified. + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } @@ -93612,151 +95387,153 @@ type SharePrototypeShareBySize struct { // Tags for this resource. UserTags []string `json:"user_tags,omitempty"` - // The zone this file share will reside in. For a replica share, this must be a different zone in the same region as - // the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. Mount targets for this share - // require a virtual network interface. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // Mount targets for this share require a VPC. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The root key to use to wrap the data encryption key for the share. - // - // If unspecified, the `encryption` type for the share will be `provider_managed`. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The owner assigned to the file share at creation. Subsequent changes to the owner - // must be performed by a client that has mounted the file share. - InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size" validate:"required"` -} - -// Constants associated with the SharePrototypeShareBySize.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. Mount targets for this share -// require a virtual network interface. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// Mount targets for this share require a VPC. -const ( - SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" - SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" -) - -// NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { - _model = &SharePrototypeShareBySize{ - Profile: profile, - Zone: zone, - Size: core.Int64Ptr(size), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SharePrototypeShareBySize) isaSharePrototype() bool { - return true -} - -// UnmarshalSharePrototypeShareBySize unmarshals an instance of SharePrototypeShareBySize from the specified map of raw messages. -func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareBySize) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for `access_control_mode`, -// `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. -// This model "extends" SharePrototype -type SharePrototypeShareBySourceShare struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // The zone this file share will reside in. + // + // For a replica share, this must be a different zone in the same region as the source share. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The access control mode for the share: + // + // - `security_group`: The security groups on the virtual network interface for a + // mount target control access to the mount target. Mount targets for this share + // require a virtual network interface. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // Mount targets for this share require a VPC. + AccessControlMode *string `json:"access_control_mode,omitempty"` + + // The root key to use to wrap the data encryption key for the share. + // + // If unspecified, the `encryption` type for the share will be `provider_managed`. + // + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The owner assigned to the file share at creation. Subsequent changes to the owner + // must be performed by a client that has mounted the file share. + InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The size of the file share rounded up to the next gigabyte. + // + // The maximum size for a share may increase in the future. + Size *int64 `json:"size" validate:"required"` +} + +// Constants associated with the SharePrototypeShareBySize.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a +// mount target control access to the mount target. Mount targets for this share +// require a virtual network interface. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// Mount targets for this share require a VPC. +const ( + SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" + SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" +) + +// NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) +func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { + _model = &SharePrototypeShareBySize{ + Profile: profile, + Zone: zone, + Size: core.Int64Ptr(size), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SharePrototypeShareBySize) isaSharePrototype() bool { + return true +} + +// UnmarshalSharePrototypeShareBySize unmarshals an instance of SharePrototypeShareBySize from the specified map of raw messages. +func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePrototypeShareBySize) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for `access_control_mode`, +// `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. +// This model "extends" SharePrototype +type SharePrototypeShareBySourceShare struct { + // The maximum input/output operations per second (IOPS) for the file share. The share must be in the + // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // + // In addition, each client accessing the share will be restricted to 48,000 IOPS. + Iops *int64 `json:"iops,omitempty"` + + // The mount targets for the file share. Each mount target must be in a unique VPC. + MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` + + // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be + // a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The + // profile must support the share's specified IOPS and size. + Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` + + ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` + + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this file share will reside in. // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The - // profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. For a replica share, this must be a different zone in the same region as - // the source share. + // For a replica share, this must be a different zone in the same region as the source share. Zone ZoneIdentityIntf `json:"zone" validate:"required"` // The cron specification for the file share replication schedule. @@ -94520,6 +96297,14 @@ type VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype struct { // // - have a unique `zone_affinity`, or // - not have a `zone_affinity`. + // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. ManualServers []DnsServerPrototype `json:"manual_servers" validate:"required"` // The type of the DNS resolver to use. @@ -94650,6 +96435,14 @@ type VpcdnsResolverTypeManual struct { Servers []DnsServer `json:"servers" validate:"required"` // The manually specified DNS servers for this VPC. + // + // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the + // affinity for that zone first, followed by the unique DNS servers from other zones. + // + // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. ManualServers []DnsServer `json:"manual_servers" validate:"required"` // The type of the DNS resolver used for the VPC. @@ -95336,6 +97129,27 @@ type VPNGatewayConnectionPolicyMode struct { // The status of a VPN gateway connection. Status *string `json:"status" validate:"required"` + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + // The local CIDRs for this resource. LocalCIDRs []string `json:"local_cidrs" validate:"required"` @@ -95432,6 +97246,10 @@ func UnmarshalVPNGatewayConnectionPolicyMode(m map[string]json.RawMessage, resul if err != nil { return } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) if err != nil { return @@ -95663,6 +97481,27 @@ type VPNGatewayConnectionStaticRouteMode struct { // The status of a VPN gateway connection. Status *string `json:"status" validate:"required"` + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + // Routing protocols are disabled for this VPN gateway connection. RoutingProtocol *string `json:"routing_protocol" validate:"required"` @@ -95765,6 +97604,10 @@ func UnmarshalVPNGatewayConnectionStaticRouteMode(m map[string]json.RawMessage, if err != nil { return } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return @@ -95789,12 +97632,44 @@ type VPNGatewayPolicyMode struct { // The VPN gateway's CRN. CRN *string `json:"crn" validate:"required"` + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The VPN gateway's canonical URL. Href *string `json:"href" validate:"required"` // The unique identifier for this VPN gateway. ID *string `json:"id" validate:"required"` + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + // Collection of VPN gateway members. Members []VPNGatewayMember `json:"members" validate:"required"` @@ -95807,9 +97682,6 @@ type VPNGatewayPolicyMode struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the VPN gateway. - Status *string `json:"status" validate:"required"` - Subnet *SubnetReference `json:"subnet" validate:"required"` // The VPC this VPN gateway resides in. @@ -95819,19 +97691,37 @@ type VPNGatewayPolicyMode struct { Mode *string `json:"mode" validate:"required"` } -// Constants associated with the VPNGatewayPolicyMode.ResourceType property. -// The resource type. +// Constants associated with the VPNGatewayPolicyMode.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. const ( - VPNGatewayPolicyModeResourceTypeVPNGatewayConst = "vpn_gateway" + VPNGatewayPolicyModeHealthStateDegradedConst = "degraded" + VPNGatewayPolicyModeHealthStateFaultedConst = "faulted" + VPNGatewayPolicyModeHealthStateInapplicableConst = "inapplicable" + VPNGatewayPolicyModeHealthStateOkConst = "ok" ) -// Constants associated with the VPNGatewayPolicyMode.Status property. -// The status of the VPN gateway. +// Constants associated with the VPNGatewayPolicyMode.LifecycleState property. +// The lifecycle state of the VPN gateway. const ( - VPNGatewayPolicyModeStatusAvailableConst = "available" - VPNGatewayPolicyModeStatusDeletingConst = "deleting" - VPNGatewayPolicyModeStatusFailedConst = "failed" - VPNGatewayPolicyModeStatusPendingConst = "pending" + VPNGatewayPolicyModeLifecycleStateDeletingConst = "deleting" + VPNGatewayPolicyModeLifecycleStateFailedConst = "failed" + VPNGatewayPolicyModeLifecycleStatePendingConst = "pending" + VPNGatewayPolicyModeLifecycleStateStableConst = "stable" + VPNGatewayPolicyModeLifecycleStateSuspendedConst = "suspended" + VPNGatewayPolicyModeLifecycleStateUpdatingConst = "updating" + VPNGatewayPolicyModeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayPolicyMode.ResourceType property. +// The resource type. +const ( + VPNGatewayPolicyModeResourceTypeVPNGatewayConst = "vpn_gateway" ) // Constants associated with the VPNGatewayPolicyMode.Mode property. @@ -95859,6 +97749,14 @@ func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interfac if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -95867,6 +97765,14 @@ func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interfac if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) if err != nil { return @@ -95883,10 +97789,6 @@ func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return @@ -96029,12 +97931,44 @@ type VPNGatewayRouteMode struct { // The VPN gateway's CRN. CRN *string `json:"crn" validate:"required"` + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The VPN gateway's canonical URL. Href *string `json:"href" validate:"required"` // The unique identifier for this VPN gateway. ID *string `json:"id" validate:"required"` + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + // Collection of VPN gateway members. Members []VPNGatewayMember `json:"members" validate:"required"` @@ -96047,9 +97981,6 @@ type VPNGatewayRouteMode struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the VPN gateway. - Status *string `json:"status" validate:"required"` - Subnet *SubnetReference `json:"subnet" validate:"required"` // The VPC this VPN gateway resides in. @@ -96059,19 +97990,37 @@ type VPNGatewayRouteMode struct { Mode *string `json:"mode" validate:"required"` } -// Constants associated with the VPNGatewayRouteMode.ResourceType property. -// The resource type. +// Constants associated with the VPNGatewayRouteMode.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. const ( - VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" + VPNGatewayRouteModeHealthStateDegradedConst = "degraded" + VPNGatewayRouteModeHealthStateFaultedConst = "faulted" + VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" + VPNGatewayRouteModeHealthStateOkConst = "ok" ) -// Constants associated with the VPNGatewayRouteMode.Status property. -// The status of the VPN gateway. +// Constants associated with the VPNGatewayRouteMode.LifecycleState property. +// The lifecycle state of the VPN gateway. const ( - VPNGatewayRouteModeStatusAvailableConst = "available" - VPNGatewayRouteModeStatusDeletingConst = "deleting" - VPNGatewayRouteModeStatusFailedConst = "failed" - VPNGatewayRouteModeStatusPendingConst = "pending" + VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" + VPNGatewayRouteModeLifecycleStateFailedConst = "failed" + VPNGatewayRouteModeLifecycleStatePendingConst = "pending" + VPNGatewayRouteModeLifecycleStateStableConst = "stable" + VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" + VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" + VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayRouteMode.ResourceType property. +// The resource type. +const ( + VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" ) // Constants associated with the VPNGatewayRouteMode.Mode property. @@ -96099,6 +98048,14 @@ func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -96107,6 +98064,14 @@ func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) if err != nil { return @@ -96123,10 +98088,6 @@ func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return @@ -97045,6 +99006,41 @@ func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{ return } +// BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct +// This model "extends" BackupPolicyScopePrototypeEnterpriseIdentity +type BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct { + // The CRN for this enterprise. + CRN *string `json:"crn" validate:"required"` +} + +// NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : Instantiate BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(crn string) (_model *BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN, err error) { + _model = &BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { + return true +} + +func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototype() bool { + return true +} + +// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayReservedIPReservedIPIdentityByHref : EndpointGatewayReservedIPReservedIPIdentityByHref struct // This model "extends" EndpointGatewayReservedIPReservedIPIdentity type EndpointGatewayReservedIPReservedIPIdentityByHref struct { diff --git a/examples/ibm-atracker/README.md b/examples/ibm-atracker/README.md index eb76c6ceb2..c7ac19e610 100644 --- a/examples/ibm-atracker/README.md +++ b/examples/ibm-atracker/README.md @@ -2,7 +2,7 @@ This example illustrates how to use the AtrackerV2 -These types of resources are supported: +The following types of resources are supported: * Activity Tracker Target * Activity Tracker Route @@ -10,7 +10,7 @@ These types of resources are supported: ## Usage -To run this example you need to execute: +To run this example, execute the following commands: ```bash $ terraform init @@ -29,7 +29,10 @@ atracker_target resource: resource "atracker_target" "atracker_target_instance" { name = var.atracker_target_name target_type = var.atracker_target_target_type + region = var.atracker_target_region cos_endpoint = var.atracker_target_cos_endpoint + logdna_endpoint = var.atracker_target_logdna_endpoint + eventstreams_endpoint = var.atracker_target_eventstreams_endpoint } ``` atracker_route resource: @@ -37,7 +40,6 @@ atracker_route resource: ```hcl resource "atracker_route" "atracker_route_instance" { name = var.atracker_route_name - receive_global_events = var.atracker_route_receive_global_events rules = var.atracker_route_rules } ``` @@ -98,9 +100,15 @@ data "atracker_routes" "atracker_routes_instance" { | name | The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. | `string` | true | | target_type | The type of the target. | `string` | true | | cos_endpoint | Property values for a Cloud Object Storage Endpoint. | `` | true | +| eventstreams_endpoint | Property values for the Event Streams Endpoint in responses. | `` | false | | name | The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`. | `string` | true | -| receive_global_events | Indicates whether or not all global events should be forwarded to this region. | `bool` | true | -| rules | Routing rules that will be evaluated in their order of the array. | `list()` | true | +| rules | The routing rules that will be evaluated in their order of the array. Once a rule is matched, the remaining rules in the route definition will be skipped. | `list()` | true | +| default_targets | The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. | `list(string)` | false | +| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false | +| metadata_region_primary | To store all your meta data in a single region. | `string` | true | +| metadata_region_backup | To store all your meta data in a backup region. | `string` | false | +| private_api_endpoint_only | If you set this true then you cannot access api through public network. | `bool` | true | +| region | Limit the query to the specified region. | `string` | false | | name | The name of the target resource. | `string` | false | | name | The name of the route. | `string` | false | diff --git a/examples/ibm-atracker/main.tf b/examples/ibm-atracker/main.tf index a44f4cec1d..c6d6787889 100644 --- a/examples/ibm-atracker/main.tf +++ b/examples/ibm-atracker/main.tf @@ -41,8 +41,10 @@ resource "ibm_atracker_target" atracker_target_eventstreams_instance { // Provision atracker_route resource instance resource "ibm_atracker_route" "atracker_route_instance" { name = var.atracker_route_name - receive_global_events = var.atracker_route_receive_global_events - rules = var.atracker_route_rules + rules { + target_ids = [ ibm_atracker_target.atracker_target_instance.id ] + locations = [ "us-south" ] + } } // Provision atracker_settings resource instance diff --git a/examples/ibm-atracker/variables.tf b/examples/ibm-atracker/variables.tf index 09adc4bc0b..911bcfee60 100644 --- a/examples/ibm-atracker/variables.tf +++ b/examples/ibm-atracker/variables.tf @@ -15,6 +15,12 @@ variable "atracker_target_target_type" { default = "cloud_object_storage" } +variable "atracker_target_region" { + description = "Included this optional field if you used it to create a target in a different region other than the one you are connected." + type = string + default = "us-south" +} + // Resource arguments for atracker_route variable "atracker_route_name" { description = "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`." @@ -66,5 +72,4 @@ variable "atracker_settings_permitted_target_regions" { type = list(string) default = [ "us-south" ] } - // Data source arguments for atracker_endpoints diff --git a/examples/ibm-atracker/versions.tf b/examples/ibm-atracker/versions.tf index ee0f9705a2..4049a00043 100644 --- a/examples/ibm-atracker/versions.tf +++ b/examples/ibm-atracker/versions.tf @@ -1,3 +1,9 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 1.0" + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + version = "1.52.0-beta0" + } + } } \ No newline at end of file diff --git a/examples/ibm-cis/main.tf b/examples/ibm-cis/main.tf index f62f18e20a..44165eb784 100644 --- a/examples/ibm-cis/main.tf +++ b/examples/ibm-cis/main.tf @@ -532,10 +532,10 @@ data "ibm_cis_logpush_jobs" "test" { } #CIS MTLS instance -resource "ibm_cis_mtls" “test” { +resource "ibm_cis_mtls" "test" { cis_id = ibm_cis.web_domain.id domain_id = ibm_cis_domain.web_domain.id - certificate = < 0.12 | +| terraform | ~> 1.5 | ## Providers | Name | Version | |------|---------| -| ibm | 1.13.1 | +| ibm | 1.58.1 | ## Inputs @@ -207,7 +318,37 @@ data "schematics_job" "schematics_job_instance" { | workspace_id | The ID of the workspace for which you want to retrieve detailed information. To find the workspace ID, use the `GET /v1/workspaces` API. | `string` | true | | action_id | Use GET or actions API to look up the action IDs in your IBM Cloud account. | `string` | true | | job_id | Use GET jobs API to look up the Job IDs in your IBM Cloud account. | `string` | true | - +| schematics_policy_name | Name of Schematics customization policy. | `string` | true | +| schematics_policy_description | The description of Schematics customization policy. | `string` | false | +| schematics_policy_resource_group | The resource group name for the policy. By default, Policy will be created in `default` Resource Group. | `string` | false | +| schematics_policy_tags | Tags for the Schematics customization policy. | `list(string)` | false | +| schematics_policy_location | List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. | `string` | false | +| schematics_policy_kind | Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. | `string` | false | +| target | The objects for the Schematics policy. | `` | false | +| parameter | The parameter to tune the Schematics policy. | `` | false | +| scoped_resources | List of scoped Schematics resources targeted by the policy. | `list()` | false | +| schematics_agent_name | The name of the agent (must be unique, for an account). | `string` | true | +| schematics_agent_resource_group | The resource-group name for the agent. By default, agent will be registered in Default Resource Group. | `string` | true | +| schematics_agent_version | Agent version. | `string` | true | +| schematics_agent_schematics_location | List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit thejegccnhbrgfulbgbrnftiuudlikviubvnnhlbkcfrhl +e location of the IBM Cloud resources, provisioned using Schematics. | `string` | true | +| schematics_agent_agent_location | The location where agent is deployed in the user environment. | `string` | true | +| agent_infrastructure | The infrastructure parameters used by the agent. | `` | true | +| schematics_agent_description | Agent description. | `string` | false | +| schematics_agent_tags | Tags for the agent. | `list(string)` | false | +| agent_metadata | The metadata of an agent. | `list()` | false | +| agent_inputs | Additional input variables for the agent. | `list()` | false | +| user_state | User defined status of the agent. | `` | false | +| agent_kpi | Schematics Agent key performance indicators. | `` | false | +| schematics_agent_prs_agent_id | Agent ID to get the details of agent. | `string` | true | +| schematics_agent_prs_force | Equivalent to -force options in the command line, default is false. | `bool` | false | +| schematics_agent_deploy_agent_id | Agent ID to get the details of agent. | `string` | true | +| schematics_agent_deploy_force | Equivalent to -force options in the command line, default is false. | `bool` | false | +| schematics_agent_health_agent_id | Agent ID to get the details of agent. | `string` | true | +| schematics_agent_health_force | Equivalent to -force options in the command line, default is false. | `bool` | false | +| schematics_policies_policy_kind | Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. | `string` | false | +| schematics_policy_policy_id | ID to get the details of policy. | `string` | true | +| schematics_agent_agent_id | Agent ID to get the details of agent. | `string` | true | ## Outputs | Name | Description | @@ -217,6 +358,8 @@ data "schematics_job" "schematics_job_instance" { | schematics_job | schematics_job object | | schematics_output | schematics_output object | | schematics_state | schematics_state object | -| schematics_workspace | schematics_workspace object | -| schematics_action | schematics_action object | -| schematics_job | schematics_job object | +| ibm_schematics_policy | schematics_policy resource instance | +| ibm_schematics_agent | schematics_agent resource instance | +| ibm_schematics_agent_prs | schematics_agent_prs resource instance | +| ibm_schematics_agent_deploy | schematics_agent_deploy resource instance | +| ibm_schematics_agent_health | schematics_agent_health resource instance | diff --git a/examples/ibm-schematics/main.tf b/examples/ibm-schematics/main.tf index 2ad82673fc..c1129177da 100644 --- a/examples/ibm-schematics/main.tf +++ b/examples/ibm-schematics/main.tf @@ -87,3 +87,147 @@ data "ibm_schematics_action" "schematics_action_instance" { data "ibm_schematics_job" "schematics_job_instance" { job_id = var.schematics_job_job_id } + +// Provision schematics_policy resource instance +resource "ibm_schematics_policy" "schematics_policy_instance" { + name = var.schematics_policy_name + description = var.schematics_policy_description + resource_group = var.schematics_policy_resource_group + tags = var.schematics_policy_tags + location = var.schematics_policy_location + kind = var.schematics_policy_kind + target { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + parameter { + agent_assignment_policy_parameter { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + } + scoped_resources { + kind = "workspace" + id = "id" + } +} + +// Provision schematics_agent resource instance +resource "ibm_schematics_agent" "schematics_agent_instance" { + name = var.schematics_agent_name + resource_group = var.schematics_agent_resource_group + version = var.schematics_agent_version + schematics_location = var.schematics_agent_schematics_location + agent_location = var.schematics_agent_agent_location + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + description = var.schematics_agent_description + tags = var.schematics_agent_tags + agent_metadata { + name = "purpose" + value = ["git", "terraform", "ansible"] + } + agent_inputs { + name = "name" + value = "value" + use_default = true + metadata { + type = "boolean" + aliases = [ "aliases" ] + description = "description" + cloud_data_type = "cloud_data_type" + default_value = "default_value" + link_status = "normal" + secure = true + immutable = true + hidden = true + required = true + options = [ "options" ] + min_value = 1 + max_value = 1 + min_length = 1 + max_length = 1 + matches = "matches" + position = 1 + group_by = "group_by" + source = "source" + } + } + user_state { + state = "enable" + } + agent_kpi { + availability_indicator = "available" + lifecycle_indicator = "consistent" + percent_usage_indicator = "percent_usage_indicator" + application_indicators = [ null ] + infra_indicators = [ null ] + } +} + +// Provision schematics_agent_prs resource instance +resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = var.schematics_agent_prs_agent_id + force = var.schematics_agent_prs_force +} + +// Provision schematics_agent_deploy resource instance +resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = var.schematics_agent_deploy_agent_id + force = var.schematics_agent_deploy_force +} + +// Provision schematics_agent_health resource instance +resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = var.schematics_agent_health_agent_id + force = var.schematics_agent_health_force +} + +// Create schematics_policies data source +data "ibm_schematics_policies" "schematics_policies_instance" { + policy_kind = var.schematics_policies_policy_kind +} + + +// Create schematics_policy data source +data "ibm_schematics_policy" "schematics_policy_instance" { + policy_id = ibm_schematics_policy.schematics_policy_instance.id +} + +// Create schematics_agents data source +data "ibm_schematics_agents" "schematics_agents_instance" { +} +// Create schematics_agent data source +data "ibm_schematics_agent" "schematics_agent_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id +} +// Create schematics_agent_prs data source +data "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id +} +// Create schematics_agent_deploy data source +data "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id +} +// Create schematics_agent_health data source +data "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id +} \ No newline at end of file diff --git a/examples/ibm-schematics/outputs.tf b/examples/ibm-schematics/outputs.tf index c6804a05dd..cbd8cb9c1f 100644 --- a/examples/ibm-schematics/outputs.tf +++ b/examples/ibm-schematics/outputs.tf @@ -16,3 +16,35 @@ output "ibm_schematics_job" { value = ibm_schematics_job.schematics_job_instance description = "schematics_job resource instance" } + +// This allows schematics_policy data to be referenced by other resources and the terraform CLI +// Modify this if only certain data should be exposed +output "ibm_schematics_policy" { + value = ibm_schematics_policy.schematics_policy_instance + description = "schematics_policy resource instance" +} +// This allows schematics_agent data to be referenced by other resources and the terraform CLI +// Modify this if only certain data should be exposed +output "ibm_schematics_agent" { + value = ibm_schematics_agent.schematics_agent_instance + description = "schematics_agent resource instance" +} +// This allows schematics_agent_prs data to be referenced by other resources and the terraform CLI +// Modify this if only certain data should be exposed +output "ibm_schematics_agent_prs" { + value = ibm_schematics_agent_prs.schematics_agent_prs_instance + description = "schematics_agent_prs resource instance" +} +// This allows schematics_agent_deploy data to be referenced by other resources and the terraform CLI +// Modify this if only certain data should be exposed +output "ibm_schematics_agent_deploy" { + value = ibm_schematics_agent_deploy.schematics_agent_deploy_instance + description = "schematics_agent_deploy resource instance" +} +// This allows schematics_agent_health data to be referenced by other resources and the terraform CLI +// Modify this if only certain data should be exposed +output "ibm_schematics_agent_health" { + value = ibm_schematics_agent_health.schematics_agent_health_instance + description = "schematics_agent_health resource instance" +} + diff --git a/examples/ibm-schematics/variables.tf b/examples/ibm-schematics/variables.tf index fd975da4de..7d52f21bb1 100644 --- a/examples/ibm-schematics/variables.tf +++ b/examples/ibm-schematics/variables.tf @@ -132,7 +132,7 @@ variable "schematics_action_bastion" { default = [ { example: "object" } ] } variable "schematics_action_targets_ini" { - description = "Inventory of host and host group for the playbook in `INI` file format. For example, `"targets_ini": "[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5"`. For more information, about an inventory host group syntax, see [Inventory host groups](/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps)." + description = "Inventory of host and host group for the playbook in `INI` file format. For example, `'targets_ini': '[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5'`. For more information, about an inventory host group syntax, see [Inventory host groups](/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps)." type = string default = "placeholder" } @@ -287,3 +287,130 @@ variable "schematics_job_job_id" { type = string default = "job_id" } + + +// Resource arguments for schematics_policy +variable "schematics_policy_name" { + description = "Name of Schematics customization policy." + type = string + default = "Agent1-DevWS" +} +variable "schematics_policy_description" { + description = "The description of Schematics customization policy." + type = string + default = "Policy for job execution of secured workspaces on agent1" +} +variable "schematics_policy_resource_group" { + description = "The resource group name for the policy. By default, Policy will be created in `default` Resource Group." + type = string + default = "Default" +} +variable "schematics_policy_tags" { + description = "Tags for the Schematics customization policy." + type = list(string) + default = ["policy:secured-job"] +} +variable "schematics_policy_location" { + description = "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics." + type = string + default = "us-south" +} +variable "schematics_policy_kind" { + description = "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution." + type = string + default = "agent_assignment_policy" +} + +// Resource arguments for schematics_agent +variable "schematics_agent_name" { + description = "The name of the agent (must be unique, for an account)." + type = string + default = "MyDevAgent" +} +variable "schematics_agent_resource_group" { + description = "The resource-group name for the agent. By default, agent will be registered in Default Resource Group." + type = string + default = "Default" +} +variable "schematics_agent_version" { + description = "Agent version." + type = string + default = "1.0.0-beta2" +} +variable "schematics_agent_schematics_location" { + description = "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics." + type = string + default = "us-south" +} +variable "schematics_agent_agent_location" { + description = "The location where agent is deployed in the user environment." + type = string + default = "us-south" +} +variable "schematics_agent_description" { + description = "Agent description." + type = string + default = "Create Agent" +} +variable "schematics_agent_tags" { + description = "Tags for the agent." + type = list(string) + default = [ "tags" ] +} + +// Resource arguments for schematics_agent_prs +variable "schematics_agent_prs_agent_id" { + description = "Agent ID to get the details of agent." + type = string + default = "agent_id" +} +variable "schematics_agent_prs_force" { + description = "Equivalent to -force options in the command line, default is false." + type = bool + default = true +} + +// Resource arguments for schematics_agent_deploy +variable "schematics_agent_deploy_agent_id" { + description = "Agent ID to get the details of agent." + type = string + default = "agent_id" +} +variable "schematics_agent_deploy_force" { + description = "Equivalent to -force options in the command line, default is false." + type = bool + default = true +} + +// Resource arguments for schematics_agent_health +variable "schematics_agent_health_agent_id" { + description = "Agent ID to get the details of agent." + type = string + default = "agent_id" +} +variable "schematics_agent_health_force" { + description = "Equivalent to -force options in the command line, default is false." + type = bool + default = true +} + +// Data source arguments for schematics_policies +variable "schematics_policies_policy_kind" { + description = "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution." + type = string + default = "agent_assignment_policy" +} + +// Data source arguments for schematics_policy +variable "schematics_policy_policy_id" { + description = "ID to get the details of policy." + type = string + default = "policy_id" +} + +// Data source arguments for schematics_agent +variable "schematics_agent_agent_id" { + description = "Agent ID to get the details of agent." + type = string + default = "agent_id" +} \ No newline at end of file diff --git a/examples/ibm-schematics/versions.tf b/examples/ibm-schematics/versions.tf index 2c7021a3aa..f4431d843e 100644 --- a/examples/ibm-schematics/versions.tf +++ b/examples/ibm-schematics/versions.tf @@ -1,8 +1,8 @@ terraform { - required_providers { - ibm = { - source = "IBM-Cloud/ibm" - version = "1.19.0" - } - } - } \ No newline at end of file + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + version = "1.58.1" + } + } +} \ No newline at end of file diff --git a/examples/ibm-usage-reports/README.md b/examples/ibm-usage-reports/README.md new file mode 100644 index 0000000000..d588bda6dd --- /dev/null +++ b/examples/ibm-usage-reports/README.md @@ -0,0 +1,93 @@ +# Example for UsageReportsV4 + +This example illustrates how to use the UsageReportsV4 + +The following types of resources are supported: + +* billing_report_snapshot + +## Usage + +To run this example, execute the following commands: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +Run `terraform destroy` when you don't need these resources. + + +## UsageReportsV4 resources + +billing_report_snapshot resource: + +```hcl +resource "billing_report_snapshot" "billing_report_snapshot_instance" { + account_id = var.billing_report_snapshot_account_id + interval = var.billing_report_snapshot_interval + versioning = var.billing_report_snapshot_versioning + report_types = var.billing_report_snapshot_report_types + cos_reports_folder = var.billing_report_snapshot_cos_reports_folder + cos_bucket = var.billing_report_snapshot_cos_bucket + cos_location = var.billing_report_snapshot_cos_location +} +``` + +## UsageReportsV4 data sources + +billing_snapshot_list data source: + +```hcl +data "billing_snapshot_list" "billing_snapshot_list_instance" { + account_id = var.billing_snapshot_list_account_id + month = var.billing_snapshot_list_month + date_from = var.billing_snapshot_list_date_from + date_to = var.billing_snapshot_list_date_to +} +``` + +## Assumptions + +1. TODO + +## Notes + +1. TODO + +## Requirements + +| Name | Version | +|------|---------| +| terraform | ~> 0.12 | + +## Providers + +| Name | Version | +|------|---------| +| ibm | 1.13.1 | + +## Inputs + +| Name | Description | Type | Required | +|------|-------------|------|---------| +| ibmcloud\_api\_key | IBM Cloud API key | `string` | true | +| account_id | Account ID for which billing report snapshot is configured. | `string` | true | +| interval | Frequency of taking the snapshot of the billing reports. | `string` | true | +| versioning | A new version of report is created or the existing report version is overwritten with every update. | `string` | false | +| report_types | The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]. | `list(string)` | false | +| cos_reports_folder | The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports". | `string` | false | +| cos_bucket | The name of the COS bucket to store the snapshot of the billing reports. | `string` | true | +| cos_location | Region of the COS instance. | `string` | true | +| account_id | Account ID for which the billing report snapshot is requested. | `string` | true | +| month | The month for which billing report snapshot is requested. Format is yyyy-mm. | `string` | true | +| date_from | Timestamp in milliseconds for which billing report snapshot is requested. | `number` | false | +| date_to | Timestamp in milliseconds for which billing report snapshot is requested. | `number` | false | + +## Outputs + +| Name | Description | +|------|-------------| +| billing_report_snapshot | billing_report_snapshot object | +| billing_snapshot_list | billing_snapshot_list object | diff --git a/examples/ibm-usage-reports/main.tf b/examples/ibm-usage-reports/main.tf new file mode 100644 index 0000000000..3eb1c866da --- /dev/null +++ b/examples/ibm-usage-reports/main.tf @@ -0,0 +1,20 @@ +provider "ibm" { + ibmcloud_api_key = var.ibmcloud_api_key +} + +// Provision billing_report_snapshot resource instance +resource "ibm_billing_report_snapshot" "billing_report_snapshot_instance" { + interval = var.billing_report_snapshot_interval + versioning = var.billing_report_snapshot_versioning + report_types = var.billing_report_snapshot_report_types + cos_reports_folder = var.billing_report_snapshot_cos_reports_folder + cos_bucket = var.billing_report_snapshot_cos_bucket + cos_location = var.billing_report_snapshot_cos_location +} + +// Create billing_snapshot_list data source +data "ibm_billing_snapshot_list" "billing_snapshot_list_instance" { + month = var.billing_snapshot_list_month + date_from = var.billing_snapshot_list_date_from + date_to = var.billing_snapshot_list_date_to +} diff --git a/examples/ibm-usage-reports/outputs.tf b/examples/ibm-usage-reports/outputs.tf new file mode 100644 index 0000000000..5c12aed70b --- /dev/null +++ b/examples/ibm-usage-reports/outputs.tf @@ -0,0 +1,6 @@ +// This output allows billing_report_snapshot data to be referenced by other resources and the terraform CLI +// Modify this output if only certain data should be exposed +output "ibm_billing_report_snapshot" { + value = ibm_billing_report_snapshot.billing_report_snapshot_instance + description = "billing_report_snapshot resource instance" +} diff --git a/examples/ibm-usage-reports/variables.tf b/examples/ibm-usage-reports/variables.tf new file mode 100644 index 0000000000..d8c62e6b2f --- /dev/null +++ b/examples/ibm-usage-reports/variables.tf @@ -0,0 +1,58 @@ +variable "ibmcloud_api_key" { + description = "IBM Cloud API key" + type = string +} + +// Resource arguments for billing_report_snapshot +variable "billing_report_snapshot_interval" { + description = "Frequency of taking the snapshot of the billing reports." + type = string + default = "daily" +} +variable "billing_report_snapshot_versioning" { + description = "A new version of report is created or the existing report version is overwritten with every update." + type = string + default = "new" +} +variable "billing_report_snapshot_report_types" { + description = "The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]." + type = list(string) + default = ["account_summary","enterprise_summary","account_resource_instance_usage"] +} +variable "billing_report_snapshot_cos_reports_folder" { + description = "The billing reports root folder to store the billing reports snapshots. Defaults to \"IBMCloud-Billing-Reports\"." + type = string + default = "IBMCloud-Billing-Reports" +} +variable "billing_report_snapshot_cos_bucket" { + description = "The name of the COS bucket to store the snapshot of the billing reports." + type = string + default = "bucket_name" +} +variable "billing_report_snapshot_cos_location" { + description = "Region of the COS instance." + type = string + default = "us-south" +} + +// Data source arguments for billing_snapshot_list +variable "billing_snapshot_list_account_id" { + description = "Account ID for which the billing report snapshot is requested." + type = string + default = "abc" +} +variable "billing_snapshot_list_month" { + description = "The month for which billing report snapshot is requested. Format is yyyy-mm." + type = string + default = "2023-02" +} +variable "billing_snapshot_list_date_from" { + description = "Timestamp in milliseconds for which billing report snapshot is requested." + type = number + default = 1675209600000 +} +variable "billing_snapshot_list_date_to" { + description = "Timestamp in milliseconds for which billing report snapshot is requested." + type = number + default = 1675987200000 +} diff --git a/examples/ibm-usage-reports/versions.tf b/examples/ibm-usage-reports/versions.tf new file mode 100644 index 0000000000..54c9d03e8d --- /dev/null +++ b/examples/ibm-usage-reports/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + version = "1.52.0-beta0" + } + } +} diff --git a/go.mod b/go.mod index 7b9cfb3a94..885e6653f7 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/IBM-Cloud/terraform-provider-ibm go 1.18 require ( - github.com/IBM-Cloud/bluemix-go v0.0.0-20230926060322-15952e0c95c9 + github.com/IBM-Cloud/bluemix-go v0.0.0-20231017073329-75ebe90c98ba github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230822142550-30562e113de9 - github.com/IBM-Cloud/power-go-client v1.2.4 + github.com/IBM-Cloud/power-go-client v1.5.2 github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca github.com/IBM/appconfiguration-go-admin-sdk v0.3.0 github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f @@ -13,9 +13,9 @@ require ( github.com/IBM/cloudant-go-sdk v0.0.43 github.com/IBM/code-engine-go-sdk v0.0.0-20230606173928-4863db061918 github.com/IBM/container-registry-go-sdk v1.1.0 - github.com/IBM/continuous-delivery-go-sdk v1.2.0 - github.com/IBM/event-notifications-go-admin-sdk v0.2.4 - github.com/IBM/eventstreams-go-sdk v1.2.0 + github.com/IBM/continuous-delivery-go-sdk v1.2.1 + github.com/IBM/event-notifications-go-admin-sdk v0.2.7 + github.com/IBM/eventstreams-go-sdk v1.4.0 github.com/IBM/go-sdk-core/v3 v3.2.4 github.com/IBM/go-sdk-core/v5 v5.14.1 github.com/IBM/ibm-cos-sdk-go v1.10.0 @@ -24,16 +24,15 @@ require ( github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta github.com/IBM/keyprotect-go-client v0.12.2 github.com/IBM/networking-go-sdk v0.42.2 - github.com/IBM/platform-services-go-sdk v0.48.1 + github.com/IBM/platform-services-go-sdk v0.52.0 github.com/IBM/project-go-sdk v0.0.10 github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 - github.com/IBM/scc-go-sdk/v5 v5.1.2 - github.com/IBM/schematics-go-sdk v0.2.1 - github.com/IBM/secrets-manager-go-sdk/v2 v2.0.0 + github.com/IBM/scc-go-sdk/v5 v5.1.3 + github.com/IBM/schematics-go-sdk v0.2.2 + github.com/IBM/secrets-manager-go-sdk/v2 v2.0.1 github.com/IBM/vpc-beta-go-sdk v0.6.0 - github.com/IBM/vpc-go-sdk v0.42.0 + github.com/IBM/vpc-go-sdk v0.43.0 github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 - github.com/Shopify/sarama v1.29.1 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/akamai/AkamaiOPEN-edgegrid-golang/v5 v5.0.0 github.com/apache/openwhisk-client-go v0.0.0-20200201143223-a804fb82d105 @@ -54,7 +53,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rook/rook v1.11.4 github.com/softlayer/softlayer-go v1.0.3 - golang.org/x/crypto v0.9.0 + golang.org/x/crypto v0.14.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible k8s.io/api v0.26.3 @@ -63,6 +62,7 @@ require ( ) require ( + github.com/IBM/sarama v1.41.2 k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 sigs.k8s.io/controller-runtime v0.14.1 ) @@ -87,8 +87,8 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect - github.com/eapache/go-resiliency v1.2.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/go-resiliency v1.4.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/emicklei/go-restful/v3 v3.10.0 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect @@ -96,16 +96,17 @@ require ( github.com/frankban/quicktest v1.14.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-jose/go-jose/v3 v3.0.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/analysis v0.21.2 // indirect - github.com/go-openapi/errors v0.20.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/analysis v0.21.4 // indirect + github.com/go-openapi/errors v0.20.4 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/loads v0.21.1 // indirect - github.com/go-openapi/runtime v0.23.0 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-openapi/validate v0.20.3 // indirect + github.com/go-openapi/loads v0.21.2 // indirect + github.com/go-openapi/runtime v0.26.0 // indirect + github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/validate v0.22.1 // indirect github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect @@ -156,7 +157,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect github.com/leodido/go-urn v1.2.3 // indirect github.com/libopenstorage/secrets v0.0.0-20220823020833-2ecadaf59d8a // indirect @@ -180,6 +181,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.7.0 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -191,23 +193,25 @@ require ( github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.3 // indirect + github.com/stretchr/testify v1.8.4 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/zclconf/go-cty v1.11.0 // indirect go.mongodb.org/mongo-driver v1.11.6 // indirect + go.opentelemetry.io/otel v1.14.0 // indirect + go.opentelemetry.io/otel/trace v1.14.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect - golang.org/x/net v0.10.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect - google.golang.org/grpc v1.57.0 // indirect + google.golang.org/grpc v1.57.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -226,10 +230,10 @@ replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt replace github.com/portworx/sched-ops v0.0.0-20200831185134-3e8010dc7056 => github.com/portworx/sched-ops v0.20.4-openstorage-rc3 // required by rook v1.7 +replace github.com/IBM/vpc-go-sdk v0.43.0 => ./common/github.com/vpc-go-sdk + exclude ( github.com/kubernetes-incubator/external-storage v0.20.4-openstorage-rc2 k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/client-go v12.0.0+incompatible ) - -replace github.com/IBM/vpc-go-sdk v0.42.0 => ./common/github.com/IBM/vpc-go-sdk diff --git a/go.sum b/go.sum index 4dbdae4213..5f50eeb5c2 100644 --- a/go.sum +++ b/go.sum @@ -100,13 +100,13 @@ github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/IBM-Cloud/bluemix-go v0.0.0-20230926060322-15952e0c95c9 h1:/0dlV9eCpjcVZa2IgkQgdvDFn8w6OvwFo1U2h1Oxccw= -github.com/IBM-Cloud/bluemix-go v0.0.0-20230926060322-15952e0c95c9/go.mod h1:7FlvPHwmpz3AO0yFXUArYXF4lUCf5y0e4sH4OKh2jjs= +github.com/IBM-Cloud/bluemix-go v0.0.0-20231017073329-75ebe90c98ba h1:8U4HByOYJiaGWBpGjdRIzyzu0NBzjywh//CZnSbEsPw= +github.com/IBM-Cloud/bluemix-go v0.0.0-20231017073329-75ebe90c98ba/go.mod h1:mt+O8ryLVANrBKlA4RxKdENp3q6Q7mKQIi2nkiibZbU= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230822142550-30562e113de9 h1:sXRzCK3Glxpyu66Tu2NjztLdT5sDwj4qly+MJKRhdWY= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230822142550-30562e113de9/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= -github.com/IBM-Cloud/power-go-client v1.2.4 h1:4y/ubiOXpMg3xyBryfgfsa8hae/9Dn5WLdvphoxvgsQ= -github.com/IBM-Cloud/power-go-client v1.2.4/go.mod h1:0YVWoIQN5I5IvyhO/m4yxgPJqCh9QjceN2FNlVpYlOQ= +github.com/IBM-Cloud/power-go-client v1.5.2 h1:p8+vY9+wtr4BIa2+Y4EVI0jlvRg+FLWsbOpWYNlKXDw= +github.com/IBM-Cloud/power-go-client v1.5.2/go.mod h1:Vd8aSxWA30soUhE2U+tmzaYDUVNOmQE3/npny7BsN6Y= github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw= github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs= @@ -123,12 +123,12 @@ github.com/IBM/code-engine-go-sdk v0.0.0-20230606173928-4863db061918 h1:RfHezAVs github.com/IBM/code-engine-go-sdk v0.0.0-20230606173928-4863db061918/go.mod h1:IP6U/1NxgxzPeYdyiEwMaZyzelTw82JGHWl7bY78eQM= github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTphE9Ag8ho28yXjc= github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs= -github.com/IBM/continuous-delivery-go-sdk v1.2.0 h1:FcgB5EvVrZLUnyR4S/mBocHHo9gJ5IQkSlCa6nqmr2A= -github.com/IBM/continuous-delivery-go-sdk v1.2.0/go.mod h1:oW51tS5/MDCcEM7lUvjK1H9GFC/oKsRbyYfmvGyMGmw= -github.com/IBM/event-notifications-go-admin-sdk v0.2.4 h1:WWUxwrKQxvExEK+xaAQOs6gP54LvJDPi3KatDTMfwh0= -github.com/IBM/event-notifications-go-admin-sdk v0.2.4/go.mod h1:1TlGAFP47DybbovJfHtYYgSI8xpLL8Q0wao6vsAlb6c= -github.com/IBM/eventstreams-go-sdk v1.2.0 h1:eP0afHArMGjwhGqvZAhhu/3EDKRch2JehpveqF1TUjs= -github.com/IBM/eventstreams-go-sdk v1.2.0/go.mod h1:2tuAxaYLctfqfr5jvyqSrxxEQGMwYPm3yJGWSj85YVQ= +github.com/IBM/continuous-delivery-go-sdk v1.2.1 h1:MVclWmjW6LevbYgrA7PGJzS+Dmqy3/JBYUpBp/ct+Vk= +github.com/IBM/continuous-delivery-go-sdk v1.2.1/go.mod h1:oW51tS5/MDCcEM7lUvjK1H9GFC/oKsRbyYfmvGyMGmw= +github.com/IBM/event-notifications-go-admin-sdk v0.2.7 h1:Y6YPiXZO3/oAhs7rY6ekowJAsf9J05g2UFq3wjFkuCs= +github.com/IBM/event-notifications-go-admin-sdk v0.2.7/go.mod h1:iI6/TJt4GQBDsl8NYzoIYGnsNjMG0kOVIEl7mcM5v1E= +github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM= +github.com/IBM/eventstreams-go-sdk v1.4.0/go.mod h1:2tuAxaYLctfqfr5jvyqSrxxEQGMwYPm3yJGWSj85YVQ= github.com/IBM/go-sdk-core/v3 v3.0.0/go.mod h1:JI5NS2+iCoY/D8Oq3JNEZNA7qO42agu6fnaUmDsRcJA= github.com/IBM/go-sdk-core/v3 v3.2.4 h1:WKYJYYKlZnw1y/gM+Qbf5EQVAL9xaoD54+ooJZz/iBQ= github.com/IBM/go-sdk-core/v3 v3.2.4/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0= @@ -139,7 +139,6 @@ github.com/IBM/go-sdk-core/v5 v5.7.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE= github.com/IBM/go-sdk-core/v5 v5.9.5/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE= github.com/IBM/go-sdk-core/v5 v5.10.2/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI= -github.com/IBM/go-sdk-core/v5 v5.12.1/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI= github.com/IBM/go-sdk-core/v5 v5.14.1 h1:WR1r0zz+gDW++xzZjF41r9ueY4JyjS2vgZjiYs8lO3c= github.com/IBM/go-sdk-core/v5 v5.14.1/go.mod h1:MUvIr/1mgGh198ZXL+ByKz9Qs1JoEh80v/96x8jPXNY= github.com/IBM/ibm-cos-sdk-go v1.3.1/go.mod h1:YLBAYobEA8bD27P7xpMwSQeNQu6W3DNBtBComXrRzRY= @@ -156,20 +155,23 @@ github.com/IBM/keyprotect-go-client v0.12.2 h1:Cjxcqin9Pl0xz3MnxdiVd4v/eIa79xL3h github.com/IBM/keyprotect-go-client v0.12.2/go.mod h1:yr8h2noNgU8vcbs+vhqoXp3Lmv73PI0zAc6VMgFvWwM= github.com/IBM/networking-go-sdk v0.42.2 h1:caqjx4jyFHi10Vlf3skHvlL6K3YJRVstsmCBmvdyqkA= github.com/IBM/networking-go-sdk v0.42.2/go.mod h1:lTUZwtUkMANMnrLHFIgRhHrkBfwASY/Iho1fabaPHxo= -github.com/IBM/platform-services-go-sdk v0.48.1 h1:TT+v28xaaFDolswhFLc+2ut6KXukoNyJGhlhuJupV7g= -github.com/IBM/platform-services-go-sdk v0.48.1/go.mod h1:6LxcUhIaSLP4SuQJXF9oLXBamSQogs5D9BcVwr4hmfU= +github.com/IBM/platform-services-go-sdk v0.52.0 h1:hbf640xE8T0Rwy2IUf5Pu4OATabGS4IDMnEInXUXs4o= +github.com/IBM/platform-services-go-sdk v0.52.0/go.mod h1:6LxcUhIaSLP4SuQJXF9oLXBamSQogs5D9BcVwr4hmfU= github.com/IBM/project-go-sdk v0.0.10 h1:vHSuemwZ4S4c6BEb22tzsEcPTs/5LnZ0yKpP3GG/GL8= github.com/IBM/project-go-sdk v0.0.10/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig= github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4= github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0= -github.com/IBM/scc-go-sdk/v5 v5.1.2 h1:9axGtNlP3bHhoE9yJgCuc+g5/VdyhYqfhZ5oS3ovCFI= -github.com/IBM/scc-go-sdk/v5 v5.1.2/go.mod h1:YtAVlzq10bwR82QX4ZavhDIwa1s85RuVO9N/KmXVcuk= -github.com/IBM/schematics-go-sdk v0.2.1 h1:byATysGD+Z1k/wdtNqQmKALcAPjgSLuSyzcabh1jRAw= -github.com/IBM/schematics-go-sdk v0.2.1/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= -github.com/IBM/secrets-manager-go-sdk/v2 v2.0.0 h1:Lx4Bvim/MfoHEYR+n312bty5DirAJypBGGS9YZo3zCw= -github.com/IBM/secrets-manager-go-sdk/v2 v2.0.0/go.mod h1:jagqWmjZ0zUEqh5jdGB42ApSQS40fu2LWw6pdg8JJko= +github.com/IBM/sarama v1.41.2 h1:ZDBZfGPHAD4uuAtSv4U22fRZBgst0eEwGFzLj0fb85c= +github.com/IBM/sarama v1.41.2/go.mod h1:xdpu7sd6OE1uxNdjYTSKUfY8FaKkJES9/+EyjSgiGQk= +github.com/IBM/scc-go-sdk/v5 v5.1.3 h1:8zqJx/HgChTlMaC21HzthIR4HbFkuJ3dR/D68254jRg= +github.com/IBM/scc-go-sdk/v5 v5.1.3/go.mod h1:YtAVlzq10bwR82QX4ZavhDIwa1s85RuVO9N/KmXVcuk= +github.com/IBM/schematics-go-sdk v0.2.2 h1:8S3hoVLzF/ZRgWDaLqwHnLmZvlEBHCKgHszmMh7yD2E= +github.com/IBM/schematics-go-sdk v0.2.2/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= +github.com/IBM/secrets-manager-go-sdk/v2 v2.0.1 h1:0Ouu31RsuOLdH26oNsnPErEjctWTplLEIXxwExnTZT0= +github.com/IBM/secrets-manager-go-sdk/v2 v2.0.1/go.mod h1:jagqWmjZ0zUEqh5jdGB42ApSQS40fu2LWw6pdg8JJko= github.com/IBM/vpc-beta-go-sdk v0.6.0 h1:wfM3AcW3zOM3xsRtZ+EA6+sESlGUjQ6Yf4n5QQyz4uc= github.com/IBM/vpc-beta-go-sdk v0.6.0/go.mod h1:fzHDAQIqH/5yJmYsKodKHLcqxMDT+yfH6vZjdiw8CQA= +github.com/IBM/vpc-go-sdk v0.31.0/go.mod h1:jYjS3EySPkC7DuOg33gMHtm8DcIf75Tc+Gxo3zmMBTQ= github.com/Jeffail/gabs v1.1.1 h1:V0uzR08Hj22EX8+8QMhyI9sX2hwRu+/RJhJUmnwda/E= github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 h1:vuquMR410psHNax14XKNWa0Ae/kYgWJcXi0IFuX60N0= @@ -203,9 +205,6 @@ github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 h1:VauE2GcJNZFun2O github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a/go.mod h1:D73UAuEPckrDorYZdtlCu2ySOLuPB5W4rhIkmmc/XbI= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.29.1 h1:wBAacXbYVLmWieEA/0X/JagDdCZ8NVFOfS6l6+2u5S0= -github.com/Shopify/sarama v1.29.1/go.mod h1:mdtqvCSg8JOxk8PmpTNGyo6wzd4BMm4QXSfDnTXmgkE= -github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= @@ -266,7 +265,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -387,10 +385,11 @@ github.com/duosecurity/duo_api_golang v0.0.0-20190308151101-6c680f768e74/go.mod github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= -github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= +github.com/eapache/go-resiliency v1.4.0 h1:3OK9bWpPk5q6pbFAaYSEwD9CLUSHG8bnZuqX2yMt3B0= +github.com/eapache/go-resiliency v1.4.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= @@ -434,11 +433,9 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= @@ -486,8 +483,12 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= @@ -497,27 +498,20 @@ github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70t github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= -github.com/go-openapi/analysis v0.20.0/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= -github.com/go-openapi/analysis v0.20.1/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= -github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.1/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= +github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= +github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -530,7 +524,6 @@ github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3Hfo github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= @@ -538,47 +531,30 @@ github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= -github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= -github.com/go-openapi/loads v0.21.0/go.mod h1:rHYve9nZrQ4CJhyeIIFJINGCg1tQpx2yJrrNo8sf1ws= -github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.23.0 h1:HX6ET2sHCIvaKeDDQoU01CtO1ekg5EkekHSkLTtWXH0= -github.com/go-openapi/runtime v0.23.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= +github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQjTcc= +github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= -github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.10/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= -github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.20.2/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= @@ -592,24 +568,15 @@ github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/ github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= -github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-openapi/validate v0.20.3 h1:GZPPhhKSZrE8HjB4eEkoYAZmoWA4+tCemSgINH1/vKw= -github.com/go-openapi/validate v0.20.3/go.mod h1:goDdqVGiigM3jChcrYJxD2joalke3ZXeftD16byIjA4= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-ozzo/ozzo-validation v3.6.0+incompatible h1:msy24VGS42fKO9K1vLz82/GeYW1cILu7Nuuj1N3BBkE= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= @@ -631,6 +598,8 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= @@ -715,7 +684,6 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -764,6 +732,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 h1:2XF1Vzq06X+inNqgJ9tRnGuw+ZVCB3FazXODD6JE1R8= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1052,7 +1021,6 @@ github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nD github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= github.com/jcmturner/gokrb5/v8 v8.0.0/go.mod h1:4/sqKY8Yzo/TIQ8MoCyk/EPcjb+czI9czxHcdXuZbFA= -github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= @@ -1112,10 +1080,9 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1157,7 +1124,6 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -1219,9 +1185,7 @@ github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1D github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -1290,7 +1254,19 @@ github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3 github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= +github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc= +github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= +github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= +github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= +github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= +github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= +github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1311,7 +1287,19 @@ github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9 github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= -github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= +github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= +github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= @@ -1324,7 +1312,6 @@ github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab/go.mo github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47/go.mod h1:u7NRAjtYVAKokiI9LouzTv4mhds8P4S1TwdVAfbjKSk= github.com/openshift/client-go v0.0.0-20230324103026-3f1513df25e0 h1:ftAVjdiw4/Bnav0Fvw9mxoa0kU1lGK8GKRn28eja8Ik= github.com/openshift/client-go v0.0.0-20230324103026-3f1513df25e0/go.mod h1:8jtoeGR9UNGacP00O4WBeSFY3WaP7t0gkm9NZOSSWmg= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= @@ -1346,7 +1333,6 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= @@ -1356,9 +1342,10 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.2.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pires/go-proxyproto v0.6.1 h1:EBupykFmo22SDjv4fQVQd2J9NOoLPmyZA/15ldOGkPw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1519,8 +1506,8 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tencentcloud/tencentcloud-sdk-go v3.0.171+incompatible h1:K3fcS92NS8cRntIdu8Uqy2ZSePvX73nNhOkKuPGJLXQ= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -1559,10 +1546,8 @@ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23n github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= @@ -1595,17 +1580,13 @@ go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.2.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.mongodb.org/mongo-driver v1.11.6 h1:XM7G6PjiGAO5betLF13BIa5TlLUUE3uJ/2Ox3Lz1K+o= go.mongodb.org/mongo-driver v1.11.6/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY= go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= @@ -1619,6 +1600,11 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1661,7 +1647,6 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1670,9 +1655,12 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1711,8 +1699,13 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1755,7 +1748,6 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -1774,7 +1766,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1784,11 +1775,18 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1822,8 +1820,10 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1922,18 +1922,33 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1945,10 +1960,16 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2031,8 +2052,14 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2158,8 +2185,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= +google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/ibm/acctest/acctest.go b/ibm/acctest/acctest.go index 00957a3a8d..19b72beb82 100644 --- a/ibm/acctest/acctest.go +++ b/ibm/acctest/acctest.go @@ -68,6 +68,7 @@ var ( UpdatedCertCRN string SecretCRN string SecretCRN2 string + EnterpriseCRN string InstanceCRN string SecretGroupID string RegionName string @@ -229,6 +230,16 @@ var ( // Enterprise Management var Account_to_be_imported string +// Billing Snapshot Configuration +var Cos_bucket string +var Cos_location string +var Cos_bucket_update string +var Cos_location_update string +var Cos_reports_folder string +var Snapshot_date_from string +var Snapshot_date_to string +var Snapshot_month string + // Secuity and Complinace Center var ( SccApiEndpoint string @@ -1216,6 +1227,38 @@ func init() { if Account_to_be_imported == "" { fmt.Println("[INFO] Set the environment variable ACCOUNT_TO_BE_IMPORTED for testing import enterprise account resource else tests will fail if this is not set correctly") } + Cos_bucket = os.Getenv("COS_BUCKET") + if Cos_bucket == "" { + fmt.Println("[INFO] Set the environment variable COS_BUCKET for testing CRUD operations on billing snapshot configuration APIs") + } + Cos_location = os.Getenv("COS_LOCATION") + if Cos_location == "" { + fmt.Println("[INFO] Set the environment variable COS_LOCATION for testing CRUD operations on billing snapshot configuration APIs") + } + Cos_bucket_update = os.Getenv("COS_BUCKET_UPDATE") + if Cos_bucket_update == "" { + fmt.Println("[INFO] Set the environment variable COS_BUCKET_UPDATE for testing update operation on billing snapshot configuration API") + } + Cos_location_update = os.Getenv("COS_LOCATION_UPDATE") + if Cos_location_update == "" { + fmt.Println("[INFO] Set the environment variable COS_LOCATION_UPDATE for testing update operation on billing snapshot configuration API") + } + Cos_reports_folder = os.Getenv("COS_REPORTS_FOLDER") + if Cos_reports_folder == "" { + fmt.Println("[INFO] Set the environment variable COS_REPORTS_FOLDER for testing CRUD operations on billing snapshot configuration APIs") + } + Snapshot_date_from = os.Getenv("SNAPSHOT_DATE_FROM") + if Snapshot_date_from == "" { + fmt.Println("[INFO] Set the environment variable SNAPSHOT_DATE_FROM for testing CRUD operations on billing snapshot configuration APIs") + } + Snapshot_date_to = os.Getenv("SNAPSHOT_DATE_TO") + if Snapshot_date_to == "" { + fmt.Println("[INFO] Set the environment variable SNAPSHOT_DATE_TO for testing CRUD operations on billing snapshot configuration APIs") + } + Snapshot_month = os.Getenv("SNAPSHOT_MONTH") + if Snapshot_month == "" { + fmt.Println("[INFO] Set the environment variable SNAPSHOT_MONTH for testing CRUD operations on billing snapshot configuration APIs") + } HpcsAdmin1 = os.Getenv("IBM_HPCS_ADMIN1") if HpcsAdmin1 == "" { fmt.Println("[WARN] Set the environment variable IBM_HPCS_ADMIN1 with a VALID HPCS Admin Key1 Path") @@ -1444,6 +1487,11 @@ func init() { fmt.Println("[WARN] Set the environment variable IES_API_KEY for testing Event streams targets, the tests will fail if this is not set") } + EnterpriseCRN = os.Getenv("ENTERPRISE_CRN") + if EnterpriseCRN == "" { + fmt.Println("[WARN] Set the environment variable ENTERPRISE_CRN for testing enterprise backup policy, the tests will fail if this is not set") + } + CeResourceGroupID = os.Getenv("IBM_CODE_ENGINE_RESOURCE_GROUP_ID") if CeResourceGroupID == "" { CeResourceGroupID = "" @@ -1616,6 +1664,12 @@ func TestAccPreCheckCodeEngine(t *testing.T) { } } +func TestAccPreCheckUsage(t *testing.T) { + if v := os.Getenv("IC_API_KEY"); v == "" { + t.Fatal("IC_API_KEY must be set for acceptance tests") + } +} + func TestAccPreCheckScc(t *testing.T) { TestAccPreCheck(t) if SccApiEndpoint == "" { diff --git a/ibm/conns/config.go b/ibm/conns/config.go index 335239bd5c..ff89bd307f 100644 --- a/ibm/conns/config.go +++ b/ibm/conns/config.go @@ -77,6 +77,7 @@ import ( "github.com/IBM/platform-services-go-sdk/metricsrouterv3" resourcecontroller "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" resourcemanager "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" + "github.com/IBM/platform-services-go-sdk/usagereportsv4" project "github.com/IBM/project-go-sdk/projectv1" "github.com/IBM/push-notifications-go-sdk/pushservicev1" schematicsv1 "github.com/IBM/schematics-go-sdk/schematicsv1" @@ -297,6 +298,7 @@ type ClientSession interface { CdTektonPipelineV2() (*cdtektonpipelinev2.CdTektonPipelineV2, error) CodeEngineV2() (*codeengine.CodeEngineV2, error) ProjectV1() (*project.ProjectV1, error) + UsageReportsV4() (*usagereportsv4.UsageReportsV4, error) } type clientSession struct { @@ -618,6 +620,15 @@ type clientSession struct { // Project options projectClient *project.ProjectV1 projectClientErr error + + // Usage Reports options + usageReportsClient *usagereportsv4.UsageReportsV4 + usageReportsClientErr error +} + +// Usage Reports +func (session clientSession) UsageReportsV4() (*usagereportsv4.UsageReportsV4, error) { + return session.usageReportsClient, session.usageReportsClientErr } // AppIDAPI provides AppID Service APIs ... @@ -1604,6 +1615,43 @@ func (c *Config) ClientSession() (interface{}, error) { session.contextBasedRestrictionsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Context Based Restrictions service: %q", err) } + // // Usage Reports Service Client + usageReportsURL := usagereportsv4.DefaultServiceURL + if c.Visibility == "private" { + if c.Region == "us-south" || c.Region == "us-east" { + usageReportsURL = ContructEndpoint(fmt.Sprintf("private.%s.usagereports", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) + } else { + fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") + usageReportsURL = ContructEndpoint("private.us-south.usagereports", fmt.Sprintf("%s/v1", cloudEndpoint)) + } + } + if c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + usageReportsURL = ContructEndpoint(fmt.Sprintf("private.%s.usagereports", c.Region), + fmt.Sprintf("%s/v1", cloudEndpoint)) + } else { + usageReportsURL = usagereportsv4.DefaultServiceURL + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + usageReportsURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_USAGE_REPORTS_API_ENDPOINT", c.Region, usageReportsURL) + } + usageReportsClientOptions := &usagereportsv4.UsageReportsV4Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_USAGE_REPORTS_API_ENDPOINT"}, usageReportsURL), + } + usageReportsClient, err := usagereportsv4.NewUsageReportsV4(usageReportsClientOptions) + if err != nil { + session.usageReportsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Usage Reports API service: %q", err) + } + if usageReportsClient != nil && usageReportsClient.Service != nil { + usageReportsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + usageReportsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.usageReportsClient = usageReportsClient + // CATALOG MANAGEMENT Service catalogManagementURL := "https://cm.globalcatalog.cloud.ibm.com/api/v1-beta" if c.Visibility == "private" { diff --git a/ibm/flex/structures.go b/ibm/flex/structures.go index 6e83233742..5f89a520a6 100644 --- a/ibm/flex/structures.go +++ b/ibm/flex/structures.go @@ -2746,22 +2746,6 @@ func ResourceVolumeAttachmentValidate(diff *schema.ResourceDiff) error { return nil } -func InstanceProfileValidate(diff *schema.ResourceDiff) error { - if diff.Id() != "" && diff.HasChange("profile") { - o, n := diff.GetChange("profile") - old := o.(string) - new := n.(string) - log.Println("old profile : ", old) - log.Println("new profile : ", new) - if !strings.Contains(old, "d") && strings.Contains(new, "d") { - diff.ForceNew("profile") - } else if strings.Contains(old, "d") && !strings.Contains(new, "d") { - diff.ForceNew("profile") - } - } - return nil -} - func ResourceIPSecPolicyValidate(diff *schema.ResourceDiff) error { newEncAlgo := diff.Get("encryption_algorithm").(string) diff --git a/ibm/provider/provider.go b/ibm/provider/provider.go index 0b7d19e4f8..0b7eae2870 100644 --- a/ibm/provider/provider.go +++ b/ibm/provider/provider.go @@ -50,6 +50,7 @@ import ( "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/usagereports" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -571,6 +572,13 @@ func Provider() *schema.Provider { "ibm_schematics_job": schematics.DataSourceIBMSchematicsJob(), "ibm_schematics_inventory": schematics.DataSourceIBMSchematicsInventory(), "ibm_schematics_resource_query": schematics.DataSourceIBMSchematicsResourceQuery(), + "ibm_schematics_policies": schematics.DataSourceIbmSchematicsPolicies(), + "ibm_schematics_policy": schematics.DataSourceIbmSchematicsPolicy(), + "ibm_schematics_agents": schematics.DataSourceIbmSchematicsAgents(), + "ibm_schematics_agent": schematics.DataSourceIbmSchematicsAgent(), + "ibm_schematics_agent_prs": schematics.DataSourceIbmSchematicsAgentPrs(), + "ibm_schematics_agent_deploy": schematics.DataSourceIbmSchematicsAgentDeploy(), + "ibm_schematics_agent_health": schematics.DataSourceIbmSchematicsAgentHealth(), // Added for Power Resources "ibm_pi_catalog_images": power.DataSourceIBMPICatalogImages(), @@ -620,6 +628,10 @@ func Provider() *schema.Provider { "ibm_pi_volume_remote_copy_relationship": power.DataSourceIBMPIVolumeRemoteCopyRelationship(), "ibm_pi_volume_onboardings": power.DataSourceIBMPIVolumeOnboardings(), "ibm_pi_volume_onboarding": power.DataSourceIBMPIVolumeOnboarding(), + "ibm_pi_workspace": power.DatasourceIBMPIWorkspace(), + "ibm_pi_workspaces": power.DatasourceIBMPIWorkspaces(), + "ibm_pi_datacenter": power.DataSourceIBMPIDatacenter(), + "ibm_pi_datacenters": power.DataSourceIBMPIDatacenters(), // Added for private dns zones @@ -666,6 +678,9 @@ func Provider() *schema.Provider { "ibm_enterprise_account_groups": enterprise.DataSourceIBMEnterpriseAccountGroups(), "ibm_enterprise_accounts": enterprise.DataSourceIBMEnterpriseAccounts(), + // //Added for Usage Reports + "ibm_billing_snapshot_list": usagereports.DataSourceIBMBillingSnapshotList(), + // Added for Secrets Manager // V1 data sources: "ibm_secrets_manager_secrets": secretsmanager.DataSourceIBMSecretsManagerSecrets(), @@ -760,44 +775,46 @@ func Provider() *schema.Provider { "ibm_cbr_rule": contextbasedrestrictions.DataSourceIBMCbrRule(), // Added for Event Notifications - "ibm_en_source": eventnotification.DataSourceIBMEnSource(), - "ibm_en_destinations": eventnotification.DataSourceIBMEnDestinations(), - "ibm_en_topic": eventnotification.DataSourceIBMEnTopic(), - "ibm_en_topics": eventnotification.DataSourceIBMEnTopics(), - "ibm_en_subscriptions": eventnotification.DataSourceIBMEnSubscriptions(), - "ibm_en_destination_webhook": eventnotification.DataSourceIBMEnWebhookDestination(), - "ibm_en_destination_android": eventnotification.DataSourceIBMEnFCMDestination(), - "ibm_en_destination_ios": eventnotification.DataSourceIBMEnAPNSDestination(), - "ibm_en_destination_chrome": eventnotification.DataSourceIBMEnChromeDestination(), - "ibm_en_destination_firefox": eventnotification.DataSourceIBMEnFirefoxDestination(), - "ibm_en_destination_slack": eventnotification.DataSourceIBMEnSlackDestination(), - "ibm_en_subscription_sms": eventnotification.DataSourceIBMEnSMSSubscription(), - "ibm_en_subscription_email": eventnotification.DataSourceIBMEnEmailSubscription(), - "ibm_en_subscription_webhook": eventnotification.DataSourceIBMEnWebhookSubscription(), - "ibm_en_subscription_android": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_subscription_ios": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_subscription_chrome": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_subscription_firefox": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_subscription_slack": eventnotification.DataSourceIBMEnSlackSubscription(), - "ibm_en_subscription_safari": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_safari": eventnotification.DataSourceIBMEnSafariDestination(), - "ibm_en_destination_msteams": eventnotification.DataSourceIBMEnMSTeamsDestination(), - "ibm_en_subscription_msteams": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_cf": eventnotification.DataSourceIBMEnCFDestination(), - "ibm_en_subscription_cf": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_pagerduty": eventnotification.DataSourceIBMEnPagerDutyDestination(), - "ibm_en_subscription_pagerduty": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_integration": eventnotification.DataSourceIBMEnIntegration(), - "ibm_en_integrations": eventnotification.DataSourceIBMEnIntegrations(), - "ibm_en_destination_sn": eventnotification.DataSourceIBMEnServiceNowDestination(), - "ibm_en_subscription_sn": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_ce": eventnotification.DataSourceIBMEnCodeEngineDestination(), - "ibm_en_subscription_ce": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_cos": eventnotification.DataSourceIBMEnCOSDestination(), - "ibm_en_subscription_cos": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_destination_huawei": eventnotification.DataSourceIBMEnHuaweiDestination(), - "ibm_en_subscription_huawei": eventnotification.DataSourceIBMEnFCMSubscription(), - "ibm_en_sources": eventnotification.DataSourceIBMEnSources(), + "ibm_en_source": eventnotification.DataSourceIBMEnSource(), + "ibm_en_destinations": eventnotification.DataSourceIBMEnDestinations(), + "ibm_en_topic": eventnotification.DataSourceIBMEnTopic(), + "ibm_en_topics": eventnotification.DataSourceIBMEnTopics(), + "ibm_en_subscriptions": eventnotification.DataSourceIBMEnSubscriptions(), + "ibm_en_destination_webhook": eventnotification.DataSourceIBMEnWebhookDestination(), + "ibm_en_destination_android": eventnotification.DataSourceIBMEnFCMDestination(), + "ibm_en_destination_ios": eventnotification.DataSourceIBMEnAPNSDestination(), + "ibm_en_destination_chrome": eventnotification.DataSourceIBMEnChromeDestination(), + "ibm_en_destination_firefox": eventnotification.DataSourceIBMEnFirefoxDestination(), + "ibm_en_destination_slack": eventnotification.DataSourceIBMEnSlackDestination(), + "ibm_en_subscription_sms": eventnotification.DataSourceIBMEnSMSSubscription(), + "ibm_en_subscription_email": eventnotification.DataSourceIBMEnEmailSubscription(), + "ibm_en_subscription_webhook": eventnotification.DataSourceIBMEnWebhookSubscription(), + "ibm_en_subscription_android": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_subscription_ios": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_subscription_chrome": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_subscription_firefox": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_subscription_slack": eventnotification.DataSourceIBMEnSlackSubscription(), + "ibm_en_subscription_safari": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_safari": eventnotification.DataSourceIBMEnSafariDestination(), + "ibm_en_destination_msteams": eventnotification.DataSourceIBMEnMSTeamsDestination(), + "ibm_en_subscription_msteams": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_cf": eventnotification.DataSourceIBMEnCFDestination(), + "ibm_en_subscription_cf": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_pagerduty": eventnotification.DataSourceIBMEnPagerDutyDestination(), + "ibm_en_subscription_pagerduty": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_integration": eventnotification.DataSourceIBMEnIntegration(), + "ibm_en_integrations": eventnotification.DataSourceIBMEnIntegrations(), + "ibm_en_destination_sn": eventnotification.DataSourceIBMEnServiceNowDestination(), + "ibm_en_subscription_sn": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_ce": eventnotification.DataSourceIBMEnCodeEngineDestination(), + "ibm_en_subscription_ce": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_cos": eventnotification.DataSourceIBMEnCOSDestination(), + "ibm_en_subscription_cos": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_destination_huawei": eventnotification.DataSourceIBMEnHuaweiDestination(), + "ibm_en_subscription_huawei": eventnotification.DataSourceIBMEnFCMSubscription(), + "ibm_en_sources": eventnotification.DataSourceIBMEnSources(), + "ibm_en_destination_custom_email": eventnotification.DataSourceIBMEnCustomEmailDestination(), + "ibm_en_subscription_custom_email": eventnotification.DataSourceIBMEnCustomEmailSubscription(), // Added for Toolchain "ibm_cd_toolchain": cdtoolchain.DataSourceIBMCdToolchain(), @@ -1198,12 +1215,20 @@ func Provider() *schema.Provider { "ibm_enterprise_account_group": enterprise.ResourceIBMEnterpriseAccountGroup(), "ibm_enterprise_account": enterprise.ResourceIBMEnterpriseAccount(), + // //Added for Usage Reports + "ibm_billing_report_snapshot": usagereports.ResourceIBMBillingReportSnapshot(), + // Added for Schematics "ibm_schematics_workspace": schematics.ResourceIBMSchematicsWorkspace(), "ibm_schematics_action": schematics.ResourceIBMSchematicsAction(), "ibm_schematics_job": schematics.ResourceIBMSchematicsJob(), "ibm_schematics_inventory": schematics.ResourceIBMSchematicsInventory(), "ibm_schematics_resource_query": schematics.ResourceIBMSchematicsResourceQuery(), + "ibm_schematics_policy": schematics.ResourceIbmSchematicsPolicy(), + "ibm_schematics_agent": schematics.ResourceIbmSchematicsAgent(), + "ibm_schematics_agent_prs": schematics.ResourceIbmSchematicsAgentPrs(), + "ibm_schematics_agent_deploy": schematics.ResourceIbmSchematicsAgentDeploy(), + "ibm_schematics_agent_health": schematics.ResourceIbmSchematicsAgentHealth(), // Added for Secrets Manager "ibm_sm_secret_group": secretsmanager.AddInstanceFields(secretsmanager.ResourceIbmSmSecretGroup()), @@ -1269,40 +1294,42 @@ func Provider() *schema.Provider { "ibm_cbr_rule": contextbasedrestrictions.ResourceIBMCbrRule(), // Added for Event Notifications - "ibm_en_source": eventnotification.ResourceIBMEnSource(), - "ibm_en_topic": eventnotification.ResourceIBMEnTopic(), - "ibm_en_destination_webhook": eventnotification.ResourceIBMEnWebhookDestination(), - "ibm_en_destination_android": eventnotification.ResourceIBMEnFCMDestination(), - "ibm_en_destination_chrome": eventnotification.ResourceIBMEnChromeDestination(), - "ibm_en_destination_firefox": eventnotification.ResourceIBMEnFirefoxDestination(), - "ibm_en_destination_ios": eventnotification.ResourceIBMEnAPNSDestination(), - "ibm_en_destination_slack": eventnotification.ResourceIBMEnSlackDestination(), - "ibm_en_subscription_sms": eventnotification.ResourceIBMEnSMSSubscription(), - "ibm_en_subscription_email": eventnotification.ResourceIBMEnEmailSubscription(), - "ibm_en_subscription_webhook": eventnotification.ResourceIBMEnWebhookSubscription(), - "ibm_en_subscription_android": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_subscription_ios": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_subscription_chrome": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_subscription_firefox": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_subscription_slack": eventnotification.ResourceIBMEnSlackSubscription(), - "ibm_en_subscription_safari": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_safari": eventnotification.ResourceIBMEnSafariDestination(), - "ibm_en_destination_msteams": eventnotification.ResourceIBMEnMSTeamsDestination(), - "ibm_en_subscription_msteams": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_cf": eventnotification.ResourceIBMEnCFDestination(), - "ibm_en_subscription_cf": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_pagerduty": eventnotification.ResourceIBMEnPagerDutyDestination(), - "ibm_en_subscription_pagerduty": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_integration": eventnotification.ResourceIBMEnIntegration(), - "ibm_en_destination_sn": eventnotification.ResourceIBMEnServiceNowDestination(), - "ibm_en_subscription_sn": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_ce": eventnotification.ResourceIBMEnCodeEngineDestination(), - "ibm_en_subscription_ce": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_cos": eventnotification.ResourceIBMEnCOSDestination(), - "ibm_en_subscription_cos": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_destination_huawei": eventnotification.ResourceIBMEnHuaweiDestination(), - "ibm_en_subscription_huawei": eventnotification.ResourceIBMEnFCMSubscription(), - "ibm_en_ibmsource": eventnotification.ResourceIBMEnIBMSource(), + "ibm_en_source": eventnotification.ResourceIBMEnSource(), + "ibm_en_topic": eventnotification.ResourceIBMEnTopic(), + "ibm_en_destination_webhook": eventnotification.ResourceIBMEnWebhookDestination(), + "ibm_en_destination_android": eventnotification.ResourceIBMEnFCMDestination(), + "ibm_en_destination_chrome": eventnotification.ResourceIBMEnChromeDestination(), + "ibm_en_destination_firefox": eventnotification.ResourceIBMEnFirefoxDestination(), + "ibm_en_destination_ios": eventnotification.ResourceIBMEnAPNSDestination(), + "ibm_en_destination_slack": eventnotification.ResourceIBMEnSlackDestination(), + "ibm_en_subscription_sms": eventnotification.ResourceIBMEnSMSSubscription(), + "ibm_en_subscription_email": eventnotification.ResourceIBMEnEmailSubscription(), + "ibm_en_subscription_webhook": eventnotification.ResourceIBMEnWebhookSubscription(), + "ibm_en_subscription_android": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_subscription_ios": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_subscription_chrome": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_subscription_firefox": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_subscription_slack": eventnotification.ResourceIBMEnSlackSubscription(), + "ibm_en_subscription_safari": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_safari": eventnotification.ResourceIBMEnSafariDestination(), + "ibm_en_destination_msteams": eventnotification.ResourceIBMEnMSTeamsDestination(), + "ibm_en_subscription_msteams": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_cf": eventnotification.ResourceIBMEnCFDestination(), + "ibm_en_subscription_cf": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_pagerduty": eventnotification.ResourceIBMEnPagerDutyDestination(), + "ibm_en_subscription_pagerduty": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_integration": eventnotification.ResourceIBMEnIntegration(), + "ibm_en_destination_sn": eventnotification.ResourceIBMEnServiceNowDestination(), + "ibm_en_subscription_sn": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_ce": eventnotification.ResourceIBMEnCodeEngineDestination(), + "ibm_en_subscription_ce": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_cos": eventnotification.ResourceIBMEnCOSDestination(), + "ibm_en_subscription_cos": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_destination_huawei": eventnotification.ResourceIBMEnHuaweiDestination(), + "ibm_en_subscription_huawei": eventnotification.ResourceIBMEnFCMSubscription(), + "ibm_en_ibmsource": eventnotification.ResourceIBMEnIBMSource(), + "ibm_en_destination_custom_email": eventnotification.ResourceIBMEnCustomEmailDestination(), + "ibm_en_subscription_custom_email": eventnotification.ResourceIBMEnCustomEmailSubscription(), // Added for Toolchain "ibm_cd_toolchain": cdtoolchain.ResourceIBMCdToolchain(), @@ -1497,6 +1524,7 @@ func Validator() validate.ValidatorDict { "ibm_schematics_workspace": schematics.ResourceIBMSchematicsWorkspaceValidator(), "ibm_schematics_inventory": schematics.ResourceIBMSchematicsInventoryValidator(), "ibm_schematics_resource_query": schematics.ResourceIBMSchematicsResourceQueryValidator(), + "ibm_schematics_policy": schematics.ResourceIbmSchematicsPolicyValidator(), "ibm_resource_instance": resourcecontroller.ResourceIBMResourceInstanceValidator(), "ibm_resource_key": resourcecontroller.ResourceIBMResourceKeyValidator(), "ibm_is_virtual_endpoint_gateway": vpc.ResourceIBMISEndpointGatewayValidator(), @@ -1583,6 +1611,9 @@ func Validator() validate.ValidatorDict { "ibm_iam_policy_template": iampolicy.ResourceIBMIAMPolicyTemplateValidator(), "ibm_iam_policy_template_version": iampolicy.ResourceIBMIAMPolicyTemplateVersionValidator(), + // // Added for Usage Reports + "ibm_billing_report_snapshot": usagereports.ResourceIBMBillingReportSnapshotValidator(), + // // Added for Secrets Manager "ibm_sm_secret_group": secretsmanager.ResourceIbmSmSecretGroupValidator(), "ibm_sm_en_registration": secretsmanager.ResourceIbmSmEnRegistrationValidator(), diff --git a/ibm/service/cos/data_source_ibm_cos_bucket.go b/ibm/service/cos/data_source_ibm_cos_bucket.go index 0af4dccfed..e45744b986 100644 --- a/ibm/service/cos/data_source_ibm_cos_bucket.go +++ b/ibm/service/cos/data_source_ibm_cos_bucket.go @@ -851,16 +851,14 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error getBucketWebsiteConfigurationInput := &s3.GetBucketWebsiteInput{ Bucket: aws.String(bucketName), } - - outputBucketWebsite, err := s3Client.GetBucketWebsite(getBucketWebsiteConfigurationInput) - var outputBucketWebsiteptr *s3.WebsiteConfiguration - outputBucketWebsiteptr = (*s3.WebsiteConfiguration)(outputBucketWebsite) - if err != nil && !strings.Contains(err.Error(), "AccessDenied: Access Denied") { + outputwebsite, err := s3Client.GetBucketWebsite(getBucketWebsiteConfigurationInput) + var outputptr *s3.WebsiteConfiguration + outputptr = (*s3.WebsiteConfiguration)(outputwebsite) + if err != nil && !strings.Contains(err.Error(), "AccessDenied: Access Denied") && !strings.Contains(err.Error(), "The specified bucket does not have a website configuration") { return err } - - if outputBucketWebsite != nil { - websiteConfiguration := flex.WebsiteConfigurationGet(outputBucketWebsiteptr) + if outputwebsite.IndexDocument != nil || outputwebsite.RedirectAllRequestsTo != nil { + websiteConfiguration := flex.WebsiteConfigurationGet(outputptr) if len(websiteConfiguration) > 0 { d.Set("website_configuration", websiteConfiguration) } @@ -868,7 +866,6 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error if websiteEndpoint != "" { d.Set("website_endpoint", websiteEndpoint) } - } return nil diff --git a/ibm/service/database/data_source_ibm_database.go b/ibm/service/database/data_source_ibm_database.go index 0b944a9949..be79a83bf2 100644 --- a/ibm/service/database/data_source_ibm_database.go +++ b/ibm/service/database/data_source_ibm_database.go @@ -89,18 +89,6 @@ func DataSourceIBMDatabaseInstance() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "members_memory_allocation_mb": { - Description: "Memory allocation required for cluster", - Type: schema.TypeInt, - Computed: true, - Deprecated: "This field is deprecated please use groups", - }, - "members_disk_allocation_mb": { - Description: "Disk allocation required for cluster", - Type: schema.TypeInt, - Computed: true, - Deprecated: "This field is deprecated please use groups", - }, "platform_options": { Description: "Platform-specific options for this deployment.r", Type: schema.TypeSet, @@ -668,8 +656,6 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("[ERROR] Error getting database groups: %s", err) } d.Set("groups", flex.FlattenIcdGroups(groupList)) - d.Set("members_memory_allocation_mb", groupList.Groups[0].Memory.AllocationMb) - d.Set("members_disk_allocation_mb", groupList.Groups[0].Disk.AllocationMb) getAutoscalingConditionsOptions := &clouddatabasesv5.GetAutoscalingConditionsOptions{ ID: &instance.ID, diff --git a/ibm/service/database/data_source_ibm_database_test.go b/ibm/service/database/data_source_ibm_database_test.go index 67c92961e7..500ff603c7 100644 --- a/ibm/service/database/data_source_ibm_database_test.go +++ b/ibm/service/database/data_source_ibm_database_test.go @@ -36,8 +36,8 @@ func TestAccIBMDatabaseDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr(dataName, "plan", "standard"), resource.TestCheckResourceAttr(dataName, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(dataName, "adminuser", "admin"), - resource.TestCheckResourceAttr(dataName, "members_memory_allocation_mb", "2048"), - resource.TestCheckResourceAttr(dataName, "members_disk_allocation_mb", "10240"), + resource.TestCheckResourceAttr(dataName, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(dataName, "groups.0.disk.0.allocation_mb", "10240"), resource.TestCheckResourceAttr(dataName, "allowlist.#", "0"), resource.TestCheckResourceAttr(dataName, "tags.#", "1"), ), diff --git a/ibm/service/database/resource_ibm_database.go b/ibm/service/database/resource_ibm_database.go index 19479695a9..1cbe4913cf 100644 --- a/ibm/service/database/resource_ibm_database.go +++ b/ibm/service/database/resource_ibm_database.go @@ -187,74 +187,6 @@ func ResourceIBMDatabaseInstance() *schema.Resource { Computed: true, ForceNew: true, }, - "members_memory_allocation_mb": { - Description: "Memory allocation required for cluster", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"node_count", "node_memory_allocation_mb", "node_disk_allocation_mb", "node_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "members_disk_allocation_mb": { - Description: "Disk allocation required for cluster", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"node_count", "node_memory_allocation_mb", "node_disk_allocation_mb", "node_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "members_cpu_allocation_count": { - Description: "CPU allocation required for cluster", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"node_count", "node_memory_allocation_mb", "node_disk_allocation_mb", "node_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "node_count": { - Description: "Total number of nodes in the cluster", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"members_memory_allocation_mb", "members_disk_allocation_mb", "members_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "node_memory_allocation_mb": { - Description: "Memory allocation per node", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"members_memory_allocation_mb", "members_disk_allocation_mb", "members_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "node_disk_allocation_mb": { - Description: "Disk allocation per node", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"members_memory_allocation_mb", "members_disk_allocation_mb", "members_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "node_cpu_allocation_count": { - Description: "CPU allocation per node", - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"members_memory_allocation_mb", "members_disk_allocation_mb", "members_cpu_allocation_count", "group"}, - Deprecated: "use group instead", - }, - "plan_validation": { - Description: "For elasticsearch and postgres perform database parameter validation during the plan phase. Otherwise, database parameter validation happens in apply phase.", - Type: schema.TypeBool, - Optional: true, - Default: true, - DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { - if o == "" { - return true - } - return false - }, - }, "service_endpoints": { Description: "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", Type: schema.TypeString, @@ -472,9 +404,8 @@ func ResourceIBMDatabaseInstance() *schema.Resource { }, }, "group": { - Type: schema.TypeSet, - Optional: true, - ConflictsWith: []string{"members_memory_allocation_mb", "members_disk_allocation_mb", "members_cpu_allocation_count", "node_memory_allocation_mb", "node_disk_allocation_mb", "node_cpu_allocation_count", "node_count"}, + Type: schema.TypeSet, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "group_id": { @@ -907,7 +838,7 @@ func ResourceIBMICDValidator() *validate.ResourceValidator { Identifier: "plan", ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, Type: validate.TypeString, - AllowedValues: "standard, enterprise, enterprise-sharding", + AllowedValues: "standard, enterprise, enterprise-sharding, platinum", Required: true}) validateSchema = append(validateSchema, validate.ValidateSchema{ @@ -985,6 +916,10 @@ func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (g service = "mongodbee" } + if service == "elasticsearch" && _plan == "platinum" { + service = "elasticsearchpl" + } + if service == "mongodb" && _plan == "enterprise-sharding" { service = "mongodbees" } @@ -999,28 +934,6 @@ func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (g return getDefaultScalingGroupsResponse.Groups, nil } -func getDatabaseServiceDefaults(service string, meta interface{}) (*icdv4.Group, error) { - icdClient, err := meta.(conns.ClientSession).ICDAPI() - if err != nil { - return nil, fmt.Errorf("[ERROR] Error getting database client settings: %s", err) - } - - var dbType string - if service == "databases-for-cassandra" { - dbType = "datastax_enterprise_full" - } else if strings.HasPrefix(service, "messages-for-") { - dbType = service[len("messages-for-"):] - } else { - dbType = service[len("databases-for-"):] - } - - groupDefaults, err := icdClient.Groups().GetDefaultGroups(dbType) - if err != nil { - return nil, fmt.Errorf("ICD API is down for plan validation, set plan_validation=false %s", err) - } - return &groupDefaults.Groups[0], nil -} - func getInitialNodeCount(service string, plan string, meta interface{}) (int, error) { groups, err := getDefaultScalingGroups(service, plan, meta) @@ -1110,45 +1023,6 @@ type CountLimit struct { CanScaleDown bool } -func checkCountValue(name string, limits CountLimit, divider int, diff *schema.ResourceDiff) error { - groupLimit := GroupResource{ - Units: limits.Units, - Allocation: limits.AllocationCount, - Minimum: limits.MinimumCount, - Maximum: limits.MaximumCount, - StepSize: limits.StepSizeCount, - IsAdjustable: limits.IsAdjustable, - IsOptional: limits.IsOptional, - CanScaleDown: limits.CanScaleDown, - } - return checkGroupValue(name, groupLimit, divider, diff) -} - -type MbLimit struct { - Units string - AllocationMb int - MinimumMb int - MaximumMb int - StepSizeMb int - IsAdjustable bool - IsOptional bool - CanScaleDown bool -} - -func checkMbValue(name string, limits MbLimit, divider int, diff *schema.ResourceDiff) error { - groupLimit := GroupResource{ - Units: limits.Units, - Allocation: limits.AllocationMb, - Minimum: limits.MinimumMb, - Maximum: limits.MaximumMb, - StepSize: limits.StepSizeMb, - IsAdjustable: limits.IsAdjustable, - IsOptional: limits.IsOptional, - CanScaleDown: limits.CanScaleDown, - } - return checkGroupValue(name, groupLimit, divider, diff) -} - func resourceIBMDatabaseInstanceDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) (err error) { err = flex.ResourceTagsCustomizeDiff(diff) if err != nil { @@ -1156,67 +1030,6 @@ func resourceIBMDatabaseInstanceDiff(_ context.Context, diff *schema.ResourceDif } service := diff.Get("service").(string) - planPhase := diff.Get("plan_validation").(bool) - - if service == "databases-for-postgresql" || - service == "databases-for-elasticsearch" || - service == "databases-for-cassandra" || - service == "databases-for-enterprisedb" { - if planPhase { - groupDefaults, err := getDatabaseServiceDefaults(service, meta) - if err != nil { - return err - } - - err = checkMbValue("members_memory_allocation_mb", MbLimit(groupDefaults.Memory), 1, diff) - if err != nil { - return err - } - - err = checkMbValue("members_disk_allocation_mb", MbLimit(groupDefaults.Disk), 1, diff) - if err != nil { - return err - } - - err = checkCountValue("members_cpu_allocation_count", CountLimit(groupDefaults.Cpu), 1, diff) - if err != nil { - return err - } - - err = checkCountValue("node_count", CountLimit(groupDefaults.Members), 1, diff) - if err != nil { - return err - } - - var divider = groupDefaults.Members.MinimumCount - err = checkMbValue("node_memory_allocation_mb", MbLimit(groupDefaults.Memory), divider, diff) - if err != nil { - return err - } - - err = checkMbValue("node_disk_allocation_mb", MbLimit(groupDefaults.Disk), divider, diff) - if err != nil { - return err - } - - if diff.HasChange("node_cpu_allocation_count") { - err = checkCountValue("node_cpu_allocation_count", CountLimit(groupDefaults.Cpu), divider, diff) - if err != nil { - return err - } - } else if diff.HasChange("node_count") { - if _, ok := diff.GetOk("node_cpu_allocation_count"); !ok { - _, newSetting := diff.GetChange("node_count") - min := groupDefaults.Cpu.MinimumCount / divider - if newSetting != min { - return fmt.Errorf("node_cpu_allocation_count must be set when node_count is greater then the minimum %d", min) - } - } - } - } - } else if diff.HasChange("node_count") || diff.HasChange("node_memory_allocation_mb") || diff.HasChange("node_disk_allocation_mb") || diff.HasChange("node_cpu_allocation_count") { - return fmt.Errorf("[ERROR] node_count, node_memory_allocation_mb, node_disk_allocation_mb, node_cpu_allocation_count only supported for postgresql, elasticsearch and cassandra") - } _, logicalReplicationSet := diff.GetOk("logical_replication_slot") @@ -1373,24 +1186,6 @@ func resourceIBMDatabaseInstanceCreate(context context.Context, d *schema.Resour } } } - if memory, ok := d.GetOk("members_memory_allocation_mb"); ok { - params.Memory = memory.(int) - } - if memory, ok := d.GetOk("node_memory_allocation_mb"); ok { - params.Memory = memory.(int) * initialNodeCount - } - if disk, ok := d.GetOk("members_disk_allocation_mb"); ok { - params.Disk = disk.(int) - } - if disk, ok := d.GetOk("node_disk_allocation_mb"); ok { - params.Disk = disk.(int) * initialNodeCount - } - if cpu, ok := d.GetOk("members_cpu_allocation_count"); ok { - params.CPU = cpu.(int) - } - if cpu, ok := d.GetOk("node_cpu_allocation_count"); ok { - params.CPU = cpu.(int) * initialNodeCount - } if version, ok := d.GetOk("version"); ok { params.Version = version.(string) } @@ -1451,20 +1246,6 @@ func resourceIBMDatabaseInstanceCreate(context context.Context, d *schema.Resour return diag.FromErr(err) } - if node_count, ok := d.GetOk("node_count"); ok { - if initialNodeCount != node_count { - icdClient, err := meta.(conns.ClientSession).ICDAPI() - if err != nil { - return diag.FromErr(fmt.Errorf("[ERROR] Error getting database client settings: %s", err)) - } - - err = horizontalScale(d, meta, icdClient) - if err != nil { - return diag.FromErr(err) - } - } - } - if group, ok := d.GetOk("group"); ok { groups := expandGroups(group.(*schema.Set).List()) groupsResponse, err := getGroups(*instance.ID, meta) @@ -1863,16 +1644,6 @@ func resourceIBMDatabaseInstanceRead(context context.Context, d *schema.Resource } d.Set("groups", flex.FlattenIcdGroups(groupList)) - d.Set("node_count", groupList.Groups[0].Members.AllocationCount) - - d.Set("members_memory_allocation_mb", groupList.Groups[0].Memory.AllocationMb) - d.Set("node_memory_allocation_mb", groupList.Groups[0].Memory.AllocationMb/groupList.Groups[0].Members.AllocationCount) - - d.Set("members_disk_allocation_mb", groupList.Groups[0].Disk.AllocationMb) - d.Set("node_disk_allocation_mb", groupList.Groups[0].Disk.AllocationMb/groupList.Groups[0].Members.AllocationCount) - - d.Set("members_cpu_allocation_count", groupList.Groups[0].Cpu.AllocationCount) - d.Set("node_cpu_allocation_count", groupList.Groups[0].Cpu.AllocationCount/groupList.Groups[0].Members.AllocationCount) getAutoscalingConditionsOptions := &clouddatabasesv5.GetAutoscalingConditionsOptions{ ID: instance.ID, @@ -1985,19 +1756,11 @@ func resourceIBMDatabaseInstanceUpdate(context context.Context, d *schema.Resour return diag.FromErr(fmt.Errorf("[ERROR] Error getting database client settings: %s", err)) } - icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error getting database client settings: %s", err)) } icdId := flex.EscapeUrlParm(instanceID) - if d.HasChange("node_count") { - err = horizontalScale(d, meta, icdClient) - if err != nil { - return diag.FromErr(err) - } - } - if d.HasChange("configuration") { if config, ok := d.GetOk("configuration"); ok { var rawConfig map[string]json.RawMessage @@ -2034,54 +1797,6 @@ func resourceIBMDatabaseInstanceUpdate(context context.Context, d *schema.Resour } } - if d.HasChange("members_memory_allocation_mb") || d.HasChange("members_disk_allocation_mb") || d.HasChange("members_cpu_allocation_count") || d.HasChange("node_memory_allocation_mb") || d.HasChange("node_disk_allocation_mb") || d.HasChange("node_cpu_allocation_count") { - params := icdv4.GroupReq{} - if d.HasChange("members_memory_allocation_mb") { - memory := d.Get("members_memory_allocation_mb").(int) - memoryReq := icdv4.MemoryReq{AllocationMb: memory} - params.GroupBdy.Memory = &memoryReq - } - if d.HasChange("node_memory_allocation_mb") || d.HasChange("node_count") { - memory := d.Get("node_memory_allocation_mb").(int) - count := d.Get("node_count").(int) - memoryReq := icdv4.MemoryReq{AllocationMb: memory * count} - params.GroupBdy.Memory = &memoryReq - } - if d.HasChange("members_disk_allocation_mb") { - disk := d.Get("members_disk_allocation_mb").(int) - diskReq := icdv4.DiskReq{AllocationMb: disk} - params.GroupBdy.Disk = &diskReq - } - if d.HasChange("node_disk_allocation_mb") || d.HasChange("node_count") { - disk := d.Get("node_disk_allocation_mb").(int) - count := d.Get("node_count").(int) - diskReq := icdv4.DiskReq{AllocationMb: disk * count} - params.GroupBdy.Disk = &diskReq - } - if d.HasChange("members_cpu_allocation_count") { - cpu := d.Get("members_cpu_allocation_count").(int) - cpuReq := icdv4.CpuReq{AllocationCount: cpu} - params.GroupBdy.Cpu = &cpuReq - } - if d.HasChange("node_cpu_allocation_mb") || d.HasChange("node_count") { - cpu := d.Get("node_cpu_allocation_count").(int) - count := d.Get("node_count").(int) - CpuReq := icdv4.CpuReq{AllocationCount: cpu * count} - params.GroupBdy.Cpu = &CpuReq - } - - task, err := icdClient.Groups().UpdateGroup(icdId, "member", params) - if err != nil { - return diag.FromErr(fmt.Errorf("[ERROR] Error updating database scaling group: %s", err)) - } - - _, err = waitForDatabaseTaskComplete(task.Id, d, meta, d.Timeout(schema.TimeoutUpdate)) - if err != nil { - return diag.FromErr(fmt.Errorf( - "[ERROR] Error waiting for database (%s) scaling group update task to complete: %s", icdId, err)) - } - } - if d.HasChange("group") { oldGroup, newGroup := d.GetChange("group") if oldGroup == nil { @@ -2418,31 +2133,6 @@ func resourceIBMDatabaseInstanceUpdate(context context.Context, d *schema.Resour return resourceIBMDatabaseInstanceRead(context, d, meta) } -func horizontalScale(d *schema.ResourceData, meta interface{}, icdClient icdv4.ICDServiceAPI) error { - params := icdv4.GroupReq{} - - icdId := flex.EscapeUrlParm(d.Id()) - - members := d.Get("node_count").(int) - membersReq := icdv4.MembersReq{AllocationCount: members} - params.GroupBdy.Members = &membersReq - - _, err := icdClient.Groups().UpdateGroup(icdId, "member", params) - - if err != nil { - return fmt.Errorf("[ERROR] Error updating database scaling group: %s", err) - } - - // ScaleOut is handled with an ICD API call, however, the check is is on the instance status - _, err = waitForDatabaseInstanceUpdate(d, meta) - if err != nil { - return fmt.Errorf( - "[ERROR] Error waiting for database (%s) horizontal scale to complete: %s", d.Id(), err) - } - - return nil -} - func getConnectionString(d *schema.ResourceData, userName, connectionEndpoint string, meta interface{}) (flex.CsEntry, error) { csEntry := flex.CsEntry{} icdClient, err := meta.(conns.ClientSession).ICDAPI() diff --git a/ibm/service/database/resource_ibm_database_cassandra_test.go b/ibm/service/database/resource_ibm_database_cassandra_test.go index 3f8b3de7f3..5c5b703e03 100644 --- a/ibm/service/database/resource_ibm_database_cassandra_test.go +++ b/ibm/service/database/resource_ibm_database_cassandra_test.go @@ -35,8 +35,6 @@ func TestAccIBMCassandraDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "36864"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -52,8 +50,6 @@ func TestAccIBMCassandraDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "38400"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -68,8 +64,6 @@ func TestAccIBMCassandraDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "36864"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -101,10 +95,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -122,10 +112,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12416"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -140,10 +126,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -157,10 +139,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "4"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -197,10 +175,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "36864"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), @@ -221,10 +195,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12416"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "37248"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), @@ -243,10 +213,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "36864"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), @@ -264,10 +230,6 @@ func TestAccIBMDatabaseInstance_Cassandra_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-cassandra"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "4"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "12288"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "20480"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "6"), resource.TestCheckResourceAttr(name, "groups.0.count", "4"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "49152"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "81920"), @@ -312,7 +274,7 @@ func TestAccIBMDatabaseInstanceCassandraImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -334,8 +296,6 @@ func testAccCheckIBMDatabaseInstanceCassandraBasic(databaseResourceGroup string, plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 36864 - members_disk_allocation_mb = 61440 users { name = "user123" password = "password12" @@ -368,8 +328,6 @@ func testAccCheckIBMDatabaseInstanceCassandraFullyspecified(databaseResourceGrou plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 38400 - members_disk_allocation_mb = 61440 users { name = "user123" password = "password12" @@ -410,8 +368,6 @@ func testAccCheckIBMDatabaseInstanceCassandraReduced(databaseResourceGroup strin plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 36864 - members_disk_allocation_mb = 61440 timeouts { create = "480m" @@ -436,10 +392,22 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeBasic(databaseResourceGroup str plan = "enterprise" location = "%[3]s" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 12288 - node_disk_allocation_mb = 20480 - node_cpu_allocation_count = 6 + + group { + group_id = "member" + + memory { + allocation_mb = 12288 + } + + disk { + allocation_mb = 20480 + } + + cpu { + allocation_count = 6 + } + } users { name = "user123" @@ -474,10 +442,23 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeFullyspecified(databaseResource location = "%[3]s" version = "5.1" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 12416 - node_disk_allocation_mb = 20480 - node_cpu_allocation_count = 6 + + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 12416 + } + disk { + allocation_mb = 20480 + } + + cpu { + allocation_count = 6 + } + } users { name = "user123" @@ -520,10 +501,22 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeReduced(databaseResourceGroup s location = "%[3]s" version = "5.1" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 12288 - node_disk_allocation_mb = 20480 - node_cpu_allocation_count = 6 + + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 12288 + } + disk { + allocation_mb = 20480 + } + cpu { + allocation_count = 6 + } + } timeouts { create = "480m" @@ -548,10 +541,22 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeScaleOut(databaseResourceGroup plan = "enterprise" location = "%[3]s" adminpassword = "password12" - node_count = 4 - node_memory_allocation_mb = 12288 - node_disk_allocation_mb = 20480 - node_cpu_allocation_count = 6 + + group { + group_id = "member" + members { + allocation_count = 4 + } + memory { + allocation_mb = 12288 + } + disk { + allocation_mb = 20480 + } + cpu { + allocation_count = 6 + } + } timeouts { create = "480m" diff --git a/ibm/service/database/resource_ibm_database_edb_test.go b/ibm/service/database/resource_ibm_database_edb_test.go index 64dccdd1bc..d554fe943e 100644 --- a/ibm/service/database/resource_ibm_database_edb_test.go +++ b/ibm/service/database/resource_ibm_database_edb_test.go @@ -36,8 +36,8 @@ func TestAccIBMEDBDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -56,8 +56,8 @@ func TestAccIBMEDBDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-enterprisedb"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "92160"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "92160"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), @@ -79,8 +79,8 @@ func TestAccIBMEDBDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-enterprisedb"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "92160"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "92160"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -92,7 +92,7 @@ func TestAccIBMEDBDatabaseInstanceBasic(t *testing.T) { ImportState: true, ImportStateVerify: false, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation", "adminpassword"}, + "wait_time_minutes", "adminpassword"}, }, }, }) @@ -111,8 +111,15 @@ func testAccCheckIBMDatabaseInstanceEDBBasic(databaseResourceGroup string, name plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 61440 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 20480 + } + } tags = ["one:two"] users { name = "user123" @@ -144,9 +151,18 @@ func testAccCheckIBMDatabaseInstanceEDBFullyspecified(databaseResourceGroup stri plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 92160 - members_cpu_allocation_count = 12 + group { + group_id = "member" + memory { + allocation_mb = 2048 + } + disk { + allocation_mb = 30720 + } + cpu { + allocation_count = 4 + } + } service_endpoints = "public-and-private" tags = ["one:two"] users { @@ -187,8 +203,15 @@ func testAccCheckIBMDatabaseInstanceEDBReduced(databaseResourceGroup string, nam plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 92160 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 30720 + } + } service_endpoints = "public" tags = ["one:two"] timeouts { diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go new file mode 100644 index 0000000000..1027e878da --- /dev/null +++ b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go @@ -0,0 +1,871 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package database_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMDatabaseInstance_ElasticsearchPlatinum_Basic(t *testing.T) { + t.Parallel() + databaseResourceGroup := "default" + var databaseInstanceOne string + rnd := fmt.Sprintf("tf-Es-%d", acctest.RandIntRange(10, 100)) + testName := rnd + name := "ibm_database." + testName + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumBasic(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "adminuser", "admin"), + resource.TestCheckResourceAttr(name, "allowlist.#", "1"), + resource.TestCheckResourceAttr(name, "users.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.hosts.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.database", ""), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumFullyspecified(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "allowlist.#", "2"), + resource.TestCheckResourceAttr(name, "users.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), + resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumReduced(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), + resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupMigration(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), + resource.TestCheckResourceAttr(name, "whitelist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + // { + // ResourceName: name, + // ImportState: true, + // ImportStateVerify: true, + // }, + }, + }) +} + +func TestAccIBMDatabaseInstance_ElasticsearchPlatinum_Node(t *testing.T) { + t.Parallel() + databaseResourceGroup := "default" + var databaseInstanceOne string + rnd := fmt.Sprintf("tf-Es-%d", acctest.RandIntRange(10, 100)) + testName := rnd + name := "ibm_database." + testName + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeBasic(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "adminuser", "admin"), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "5120"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + + resource.TestCheckResourceAttr(name, "allowlist.#", "1"), + resource.TestCheckResourceAttr(name, "users.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.hosts.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.database", ""), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeFullyspecified(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "allowlist.#", "2"), + resource.TestCheckResourceAttr(name, "users.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), + resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeReduced(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeScaleOut(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "4"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + //{ + // ResourceName: name, + // ImportState: true, + // ImportStateVerify: true, + //}, + }, + }) +} + +func TestAccIBMDatabaseInstance_ElasticsearchPlatinum_Group(t *testing.T) { + t.Parallel() + databaseResourceGroup := "default" + var databaseInstanceOne string + rnd := fmt.Sprintf("tf-Es-%d", acctest.RandIntRange(10, 100)) + testName := rnd + name := "ibm_database." + testName + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupBasic(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "adminuser", "admin"), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "5120"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + + resource.TestCheckResourceAttr(name, "allowlist.#", "1"), + resource.TestCheckResourceAttr(name, "users.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.hosts.#", "1"), + resource.TestCheckResourceAttr(name, "connectionstrings.0.database", ""), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupFullyspecified(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "groups.0.count", "3"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), + resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), + resource.TestCheckResourceAttr(name, "allowlist.#", "2"), + resource.TestCheckResourceAttr(name, "users.#", "2"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), + resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupReduced(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "3"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "groups.0.count", "3"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), + resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), + resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupScaleOut(databaseResourceGroup, testName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), + resource.TestCheckResourceAttr(name, "name", testName), + resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(name, "plan", "platinum"), + resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), + resource.TestCheckResourceAttr(name, "node_count", "4"), + resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), + resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), + resource.TestCheckResourceAttr(name, "groups.0.count", "4"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "24576"), + resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "12"), + resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "users.#", "0"), + resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), + ), + }, + //{ + // ResourceName: name, + // ImportState: true, + // ImportStateVerify: true, + //}, + }, + }) +} + +// TestAccIBMDatabaseInstance_CreateAfterManualDestroy not required as tested by resource_instance tests + +func TestAccIBMDatabaseInstanceElasticsearchPlatinumImport(t *testing.T) { + t.Parallel() + databaseResourceGroup := "default" + var databaseInstanceOne string + serviceName := fmt.Sprintf("tf-Es-%d", acctest.RandIntRange(10, 100)) + //serviceName := "test_acc" + resourceName := "ibm_database." + serviceName + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMDatabaseInstanceElasticsearchPlatinumImport(databaseResourceGroup, serviceName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMDatabaseInstanceExists(resourceName, &databaseInstanceOne), + resource.TestCheckResourceAttr(resourceName, "name", serviceName), + resource.TestCheckResourceAttr(resourceName, "service", "databases-for-elasticsearch"), + resource.TestCheckResourceAttr(resourceName, "plan", "platinum"), + resource.TestCheckResourceAttr(resourceName, "location", acc.IcdDbRegion), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "wait_time_minutes", "plan_validation"}, + }, + }, + }) +} + +// func testAccCheckIBMDatabaseInstanceDestroy(s *terraform.State) etc in resource_ibm_database_postgresql_test.go + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumBasic(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + group { + group_id = "member" + + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + } + users { + name = "user123" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumFullyspecified(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + users { + name = "user123" + password = "password12" + } + users { + name = "user124" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + allowlist { + address = "172.168.1.1/32" + description = "desc" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumReduced(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupMigration(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + group { + group_id = "member" + + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeBasic(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 5120 + } + cpu { + allocation_count = 3 + } + } + + users { + name = "user123" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeFullyspecified(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + users { + name = "user123" + password = "password12" + } + users { + name = "user124" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + allowlist { + address = "172.168.1.1/32" + description = "desc" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeReduced(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumNodeScaleOut(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + group { + group_id = "member" + members { + allocation_count = 4 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupBasic(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 5120 + } + cpu { + allocation_count = 3 + } + } + + users { + name = "user123" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupFullyspecified(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + users { + name = "user123" + password = "password12" + } + users { + name = "user124" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + allowlist { + address = "172.168.1.1/32" + description = "desc" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupReduced(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumGroupScaleOut(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + adminpassword = "password12" + + group { + group_id = "member" + members { + allocation_count = 4 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + `, databaseResourceGroup, name, acc.IcdDbRegion) +} + +func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumImport(databaseResourceGroup string, name string) string { + return fmt.Sprintf(` + data "ibm_resource_group" "test_acc" { + is_default = true + # name = "%[1]s" + } + + resource "ibm_database" "%[2]s" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "%[2]s" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "%[3]s" + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } + } + + `, databaseResourceGroup, name, acc.IcdDbRegion) +} diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_test.go index b8b7455bca..cb5fb613c1 100644 --- a/ibm/service/database/resource_ibm_database_elasticsearch_test.go +++ b/ibm/service/database/resource_ibm_database_elasticsearch_test.go @@ -35,8 +35,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "15360"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -53,8 +51,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "18432"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -69,8 +65,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "18432"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -121,10 +115,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "5120"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -142,10 +132,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -160,10 +146,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -177,10 +159,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Node(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "4"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -217,10 +195,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "5120"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -238,10 +212,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), @@ -260,10 +230,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), @@ -281,10 +247,6 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "4"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), resource.TestCheckResourceAttr(name, "groups.0.count", "4"), resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "24576"), @@ -333,7 +295,7 @@ func TestAccIBMDatabaseInstanceElasticsearchImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -355,8 +317,6 @@ func testAccCheckIBMDatabaseInstanceElasticsearchBasic(databaseResourceGroup str plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 15360 users { name = "user123" password = "password12" @@ -389,8 +349,6 @@ func testAccCheckIBMDatabaseInstanceElasticsearchFullyspecified(databaseResource plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 18432 users { name = "user123" password = "password12" @@ -432,8 +390,6 @@ func testAccCheckIBMDatabaseInstanceElasticsearchReduced(databaseResourceGroup s plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 18432 timeouts { create = "120m" @@ -493,11 +449,22 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeBasic(databaseResourceGroup plan = "standard" location = "%[3]s" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 5120 - node_cpu_allocation_count = 3 + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 5120 + } + cpu { + allocation_count = 3 + } + } users { name = "user123" password = "password12" @@ -530,10 +497,21 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeFullyspecified(databaseReso plan = "standard" location = "%[3]s" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 6144 - node_cpu_allocation_count = 3 + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } users { name = "user123" password = "password12" @@ -574,10 +552,21 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeReduced(databaseResourceGro plan = "standard" location = "%[3]s" adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 6144 - node_cpu_allocation_count = 3 + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } timeouts { create = "120m" @@ -602,10 +591,21 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeScaleOut(databaseResourceGr plan = "standard" location = "%[3]s" adminpassword = "password12" - node_count = 4 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 6144 - node_cpu_allocation_count = 3 + group { + group_id = "member" + members { + allocation_count = 4 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 6144 + } + cpu { + allocation_count = 3 + } + } timeouts { create = "120m" diff --git a/ibm/service/database/resource_ibm_database_etcd_test.go b/ibm/service/database/resource_ibm_database_etcd_test.go index c362210aaa..42d7a83c0c 100644 --- a/ibm/service/database/resource_ibm_database_etcd_test.go +++ b/ibm/service/database/resource_ibm_database_etcd_test.go @@ -36,8 +36,8 @@ func TestAccIBMDatabaseInstance_Etcd_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "root"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "9216"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "184320"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -55,8 +55,8 @@ func TestAccIBMDatabaseInstance_Etcd_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-etcd"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "64512"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "18432"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "193536"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -69,8 +69,8 @@ func TestAccIBMDatabaseInstance_Etcd_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-etcd"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "64512"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "9216"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "193536"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -110,7 +110,7 @@ func TestAccIBMDatabaseInstanceEtcdImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -132,8 +132,15 @@ func testAccCheckIBMDatabaseInstanceEtcdBasic(databaseResourceGroup string, name plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 61440 + group { + group_id = "member" + memory { + allocation_mb = 3072 + } + disk { + allocation_mb = 61440 + } + } users { name = "user123" password = "password12" @@ -160,8 +167,15 @@ func testAccCheckIBMDatabaseInstanceEtcdFullyspecified(databaseResourceGroup str plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 64512 + group { + group_id = "member" + memory { + allocation_mb = 6144 + } + disk { + allocation_mb = 64512 + } + } users { name = "user123" password = "password12" @@ -197,8 +211,15 @@ func testAccCheckIBMDatabaseInstanceEtcdReduced(databaseResourceGroup string, na plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 64512 + group { + group_id = "member" + memory { + allocation_mb = 3072 + } + disk { + allocation_mb = 64512 + } + } } `, databaseResourceGroup, name, acc.IcdDbRegion) } diff --git a/ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go b/ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go index 74974d9675..e8a11917ae 100644 --- a/ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go +++ b/ibm/service/database/resource_ibm_database_mongodb_enterprise_test.go @@ -36,9 +36,9 @@ func TestAccIBMMongoDBEnterpriseDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "43008"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "43008"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -56,9 +56,9 @@ func TestAccIBMMongoDBEnterpriseDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "86016"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "86016"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "users.1.type", "ops_manager"), @@ -80,9 +80,9 @@ func TestAccIBMMongoDBEnterpriseDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "43008"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "43008"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), resource.TestCheckResourceAttr(name, "tags.#", "1"), @@ -93,7 +93,7 @@ func TestAccIBMMongoDBEnterpriseDatabaseInstanceBasic(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation", "adminpassword", "connectionstrings.0.queryoptions"}, + "wait_time_minutes", "adminpassword", "connectionstrings.0.queryoptions"}, }, }, }) @@ -121,9 +121,9 @@ func TestAccIBMMongoDBEnterpriseDatabaseInstanceGroupBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "43008"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "43008"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.0.name", "admin"), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), @@ -151,9 +151,16 @@ func testAccCheckIBMDatabaseInstanceMongoDBEnterpriseBasic(databaseResourceGroup plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_disk_allocation_mb = 61440 - members_memory_allocation_mb = 43008 tags = ["one:two"] + group { + group_id = "member" + memory { + allocation_mb = 14336 + } + disk { + allocation_mb = 20480 + } + } users { name = "user123" password = "password12" @@ -185,10 +192,19 @@ func testAccCheckIBMDatabaseInstanceMongoDBEnterpriseFullyspecified(databaseReso plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 86016 - members_disk_allocation_mb = 122880 - members_cpu_allocation_count = 27 tags = ["one:two"] + group { + group_id = "member" + memory { + allocation_mb = 28672 + } + disk { + allocation_mb = 40960 + } + cpu { + allocation_count = 9 + } + } users { name = "user123" password = "password12" @@ -229,10 +245,17 @@ func testAccCheckIBMDatabaseInstanceMongoDBEnterpriseReduced(databaseResourceGro plan = "enterprise" location = "%[3]s" adminpassword = "password12" - members_disk_allocation_mb = 122880 - members_memory_allocation_mb = 43008 service_endpoints = "public" tags = ["one:two"] + group { + group_id = "member" + memory { + allocation_mb = 14336 + } + disk { + allocation_mb = 40960 + } + } timeouts { create = "480m" update = "480m" diff --git a/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go b/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go index 7ced69aa72..3b8a8e7dbb 100644 --- a/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go +++ b/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go @@ -36,8 +36,8 @@ func TestAccIBMMongoDBShardingDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "enterprise-sharding"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "86016"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "122880"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "43008"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -54,8 +54,8 @@ func TestAccIBMMongoDBShardingDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "enterprise-sharding"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "86016"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "122880"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "86016"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -71,8 +71,8 @@ func TestAccIBMMongoDBShardingDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "enterprise-sharding"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "86016"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "122880"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "43008"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "122880"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -95,8 +95,15 @@ func testAccCheckIBMDatabaseInstanceMongoDBShardingBasic(databaseResourceGroup s plan = "enterprise-sharding" location = "%[3]s" adminpassword = "password12" - members_disk_allocation_mb = 122880 - members_memory_allocation_mb = 86016 + group { + group_id = "member" + memory { + allocation_mb = 14336 + } + disk { + allocation_mb = 20480 + } + } users { name = "user123" password = "password12" @@ -128,9 +135,18 @@ func testAccCheckIBMDatabaseInstanceMongoDBShardingFullyspecified(databaseResour plan = "enterprise-sharding" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 86016 - members_disk_allocation_mb = 122880 - members_cpu_allocation_count = 36 + group { + group_id = "member" + memory { + allocation_mb = 28672 + } + disk { + allocation_mb = 40960 + } + cpu { + allocation_count = 9 + } + } users { name = "user123" password = "password12" @@ -171,8 +187,15 @@ func testAccCheckIBMDatabaseInstanceMongoDBShardingReduced(databaseResourceGroup plan = "enterprise-sharding" location = "%[3]s" adminpassword = "password12" - members_disk_allocation_mb = 122880 - members_memory_allocation_mb = 86016 + group { + group_id = "member" + memory { + allocation_mb = 14336 + } + disk { + allocation_mb = 40960 + } + } service_endpoints = "public" timeouts { create = "480m" diff --git a/ibm/service/database/resource_ibm_database_mongodb_test.go b/ibm/service/database/resource_ibm_database_mongodb_test.go index a96b59e67c..683d02fa14 100644 --- a/ibm/service/database/resource_ibm_database_mongodb_test.go +++ b/ibm/service/database/resource_ibm_database_mongodb_test.go @@ -36,10 +36,10 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), resource.TestMatchResourceAttr(name, "connectionstrings.1.certname", regexp.MustCompile("[-a-z0-9]*")), @@ -54,10 +54,10 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), resource.TestCheckResourceAttr(name, "connectionstrings.0.scheme", "mongodb"), @@ -71,8 +71,8 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "30720"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -117,7 +117,7 @@ func TestAccIBMDatabaseInstanceMongodbImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "connectionstrings", "plan_validation"}, + "wait_time_minutes", "connectionstrings"}, }, }, }) @@ -136,8 +136,15 @@ func testAccCheckIBMDatabaseInstanceMongodbBasic(databaseResourceGroup string, n plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 30720 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 10240 + } + } users { name = "user123" password = "password12" @@ -163,8 +170,15 @@ func testAccCheckIBMDatabaseInstanceMongodbFullyspecified(databaseResourceGroup plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 30720 + group { + group_id = "member" + memory { + allocation_mb = 2048 + } + disk { + allocation_mb = 10240 + } + } users { name = "user123" password = "password12" @@ -198,8 +212,15 @@ func testAccCheckIBMDatabaseInstanceMongodbReduced(databaseResourceGroup string, plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 30720 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 10240 + } + } } `, databaseResourceGroup, name, acc.IcdDbRegion) diff --git a/ibm/service/database/resource_ibm_database_mysql_test.go b/ibm/service/database/resource_ibm_database_mysql_test.go index 423d48d800..d88873886a 100644 --- a/ibm/service/database/resource_ibm_database_mysql_test.go +++ b/ibm/service/database/resource_ibm_database_mysql_test.go @@ -35,8 +35,8 @@ func TestAccIBMMysqlDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "61440"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -55,8 +55,8 @@ func TestAccIBMMysqlDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mysql"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "92160"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "92160"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), @@ -87,8 +87,15 @@ func testAccCheckIBMDatabaseInstanceMysqlBasic(databaseResourceGroup string, nam plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 61440 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 20480 + } + } tags = ["one:two"] users { name = "user123" @@ -120,9 +127,18 @@ func testAccCheckIBMDatabaseInstanceMysqlFullyspecified(databaseResourceGroup st plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 92160 - members_cpu_allocation_count = 12 + group { + group_id = "member" + memory { + allocation_mb = 2048 + } + disk { + allocation_mb = 30720 + } + cpu { + allocation_count = 4 + } + } service_endpoints = "public-and-private" tags = ["one:two"] users { diff --git a/ibm/service/database/resource_ibm_database_postgresql_test.go b/ibm/service/database/resource_ibm_database_postgresql_test.go index 609cbbb712..15866b186c 100644 --- a/ibm/service/database/resource_ibm_database_postgresql_test.go +++ b/ibm/service/database/resource_ibm_database_postgresql_test.go @@ -57,9 +57,9 @@ func TestAccIBMDatabaseInstancePostgresBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "10240"), - resource.TestCheckResourceAttr(name, "members_cpu_allocation_count", "0"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "20480"), + resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "0"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -79,8 +79,8 @@ func TestAccIBMDatabaseInstancePostgresBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "4096"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "14336"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "28672"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "3"), @@ -104,158 +104,6 @@ func TestAccIBMDatabaseInstancePostgresBasic(t *testing.T) { }) } -func TestAccIBMDatabaseInstancePostgresGroupMigration(t *testing.T) { - t.Parallel() - databaseResourceGroup := "default" - var databaseInstanceOne string - rnd := fmt.Sprintf("tf-Pgress-%d", acctest.RandIntRange(10, 100)) - testName := rnd - name := "ibm_database." + testName - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acc.TestAccPreCheck(t) }, - Providers: acc.TestAccProviders, - CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckIBMDatabaseInstancePostgresGroupDeprecated(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "10240"), - resource.TestCheckResourceAttr(name, "members_cpu_allocation_count", "6"), - ), - }, - { - Config: testAccCheckIBMDatabaseInstancePostgresGroupMigrated(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "10240"), - resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), - ), - }, - }, - }) -} - -func TestAccIBMDatabaseInstancePostgresNode(t *testing.T) { - t.Parallel() - databaseResourceGroup := "default" - var databaseInstanceOne string - rnd := fmt.Sprintf("tf-Pgress-%d", acctest.RandIntRange(10, 100)) - testName := rnd - name := "ibm_database." + testName - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acc.TestAccPreCheck(t) }, - Providers: acc.TestAccProviders, - CheckDestroy: testAccCheckIBMDatabaseInstanceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckIBMDatabaseInstancePostgresNodeBasic(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "node_count", "2"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "5120"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), - resource.TestCheckResourceAttr(name, "service_endpoints", "public"), - resource.TestCheckResourceAttr(name, "allowlist.#", "1"), - resource.TestCheckResourceAttr(name, "users.#", "1"), - resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), - resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), - resource.TestMatchResourceAttr(name, "connectionstrings.1.certname", regexp.MustCompile("[-a-z0-9]*")), - resource.TestMatchResourceAttr(name, "connectionstrings.1.certbase64", regexp.MustCompile("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")), - resource.TestCheckResourceAttr(name, "tags.#", "1"), - ), - }, - { - Config: testAccCheckIBMDatabaseInstancePostgresNodeFullyspecified(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "2"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "7168"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), - resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), - resource.TestCheckResourceAttr(name, "allowlist.#", "2"), - resource.TestCheckResourceAttr(name, "users.#", "2"), - resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), - resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), - resource.TestCheckResourceAttr(name, "connectionstrings.0.hosts.#", "1"), - resource.TestCheckResourceAttr(name, "connectionstrings.0.scheme", "postgres"), - resource.TestMatchResourceAttr(name, "connectionstrings.0.certname", regexp.MustCompile("[-a-z0-9]*")), - resource.TestMatchResourceAttr(name, "connectionstrings.0.certbase64", regexp.MustCompile("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")), - resource.TestMatchResourceAttr(name, "connectionstrings.0.database", regexp.MustCompile("[-a-z0-9]+")), - resource.TestCheckResourceAttr(name, "tags.#", "1"), - ), - }, - { - Config: testAccCheckIBMDatabaseInstancePostgresNodeReduced(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "2"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "7168"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), - resource.TestCheckResourceAttr(name, "allowlist.#", "0"), - resource.TestCheckResourceAttr(name, "users.#", "0"), - resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), - resource.TestCheckResourceAttr(name, "tags.#", "1"), - ), - }, - { - Config: testAccCheckIBMDatabaseInstancePostgresNodeScaleOut(databaseResourceGroup, testName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckIBMDatabaseInstanceExists(name, &databaseInstanceOne), - resource.TestCheckResourceAttr(name, "name", testName), - resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), - resource.TestCheckResourceAttr(name, "plan", "standard"), - resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "node_count", "3"), - resource.TestCheckResourceAttr(name, "node_memory_allocation_mb", "1024"), - resource.TestCheckResourceAttr(name, "node_disk_allocation_mb", "7168"), - resource.TestCheckResourceAttr(name, "node_cpu_allocation_count", "3"), - resource.TestCheckResourceAttr(name, "allowlist.#", "0"), - resource.TestCheckResourceAttr(name, "users.#", "0"), - resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), - resource.TestCheckResourceAttr(name, "tags.#", "1"), - ), - }, - // { - // ResourceName: name, - // ImportState: true, - // ImportStateVerify: true, - // }, - }, - }) -} - func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { t.Parallel() databaseResourceGroup := "default" @@ -279,8 +127,8 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "10240"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "20480"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), @@ -301,8 +149,8 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2304"), - resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "14336"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4608"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "28672"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), @@ -326,8 +174,8 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "14336"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "28672"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), @@ -344,8 +192,8 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "21504"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "43008"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), @@ -387,7 +235,7 @@ func TestAccIBMDatabaseInstancePostgresImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -568,8 +416,15 @@ func testAccCheckIBMDatabaseInstancePostgresBasic(databaseResourceGroup string, plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 2048 - members_disk_allocation_mb = 10240 + group { + group_id = "member" + memory { + allocation_mb = 2048 + } + disk { + allocation_mb = 10240 + } + } tags = ["one:two"] users { name = "user123" @@ -608,9 +463,18 @@ func testAccCheckIBMDatabaseInstancePostgresFullyspecified(databaseResourceGroup plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 4096 - members_disk_allocation_mb = 14336 - members_cpu_allocation_count = 6 + group { + group_id = "member" + memory { + allocation_mb = 4096 + } + disk { + allocation_mb = 14336 + } + cpu { + allocation_count = 6 + } + } service_endpoints = "public-and-private" tags = ["one:two"] users { @@ -654,203 +518,6 @@ func testAccCheckIBMDatabaseInstancePostgresFullyspecified(databaseResourceGroup `, databaseResourceGroup, name, acc.IcdDbRegion) } -func testAccCheckIBMDatabaseInstancePostgresReduced(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - members_memory_allocation_mb = 2048 - members_disk_allocation_mb = 14336 - service_endpoints = "public" - tags = ["one:two"] - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - -func testAccCheckIBMDatabaseInstancePostgresGroupDeprecated(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - service_endpoints = "public" - tags = ["one:two"] - - members_memory_allocation_mb = 2048 - members_disk_allocation_mb = 10240 - members_cpu_allocation_count = 6 - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - -func testAccCheckIBMDatabaseInstancePostgresGroupMigrated(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - service_endpoints = "public" - tags = ["one:two"] - - group { - group_id = "member" - - memory { - allocation_mb = 1024 - } - - disk { - allocation_mb = 5120 - } - - cpu { - allocation_count = 3 - } - - members { - allocation_count = 2 - } - } - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - -func testAccCheckIBMDatabaseInstancePostgresNodeBasic(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - node_count = 2 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 5120 - node_cpu_allocation_count = 3 - tags = ["one:two"] - users { - name = "user123" - password = "password12" - } - allowlist { - address = "172.168.1.2/32" - description = "desc1" - } - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - -func testAccCheckIBMDatabaseInstancePostgresNodeFullyspecified(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - node_count = 2 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 7168 - node_cpu_allocation_count = 3 - service_endpoints = "public-and-private" - tags = ["one:two"] - users { - name = "user123" - password = "password12" - } - users { - name = "user124" - password = "password12" - } - allowlist { - address = "172.168.1.2/32" - description = "desc1" - } - allowlist { - address = "172.168.1.1/32" - description = "desc" - } - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - -func testAccCheckIBMDatabaseInstancePostgresNodeReduced(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - node_count = 2 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 7168 - node_cpu_allocation_count = 3 - service_endpoints = "public" - tags = ["one:two"] - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} -func testAccCheckIBMDatabaseInstancePostgresNodeScaleOut(databaseResourceGroup string, name string) string { - return fmt.Sprintf(` - data "ibm_resource_group" "test_acc" { - name = "%[1]s" - } - - resource "ibm_database" "%[2]s" { - resource_group_id = data.ibm_resource_group.test_acc.id - name = "%[2]s" - service = "databases-for-postgresql" - plan = "standard" - location = "%[3]s" - adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 7168 - node_cpu_allocation_count = 3 - service_endpoints = "public" - tags = ["one:two"] - } - `, databaseResourceGroup, name, acc.IcdDbRegion) -} - func testAccCheckIBMDatabaseInstancePostgresGroupBasic(databaseResourceGroup string, name string) string { return fmt.Sprintf(` data "ibm_resource_group" "test_acc" { diff --git a/ibm/service/database/resource_ibm_database_rabbitmq_test.go b/ibm/service/database/resource_ibm_database_rabbitmq_test.go index f7ada694d9..93a4bc0456 100644 --- a/ibm/service/database/resource_ibm_database_rabbitmq_test.go +++ b/ibm/service/database/resource_ibm_database_rabbitmq_test.go @@ -35,8 +35,8 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "3072"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), @@ -53,8 +53,8 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "messages-for-rabbitmq"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "6144"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "6144"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), @@ -69,8 +69,8 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "messages-for-rabbitmq"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "3072"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "6144"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -115,7 +115,7 @@ func TestAccIBMDatabaseInstanceRabbitmqImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -137,8 +137,15 @@ func testAccCheckIBMDatabaseInstanceRabbitmqBasic(databaseResourceGroup string, plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 3072 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 1024 + } + } users { name = "user123" password = "password12" @@ -170,8 +177,15 @@ func testAccCheckIBMDatabaseInstanceRabbitmqFullyspecified(databaseResourceGroup plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 6144 - members_disk_allocation_mb = 6144 + group { + group_id = "member" + memory { + allocation_mb = 2048 + } + disk { + allocation_mb = 2048 + } + } users { name = "user123" password = "password12" @@ -207,8 +221,15 @@ func testAccCheckIBMDatabaseInstanceRabbitmqReduced(databaseResourceGroup string plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 3072 - members_disk_allocation_mb = 6144 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 2048 + } + } } `, databaseResourceGroup, name, acc.IcdDbRegion) } diff --git a/ibm/service/database/resource_ibm_database_redis_test.go b/ibm/service/database/resource_ibm_database_redis_test.go index bf51217e20..3a0f4cd85a 100644 --- a/ibm/service/database/resource_ibm_database_redis_test.go +++ b/ibm/service/database/resource_ibm_database_redis_test.go @@ -36,8 +36,8 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "2048"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.0.name", "admin"), @@ -52,8 +52,8 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-redis"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "2304"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2304"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "4096"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), ), }, @@ -64,9 +64,9 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-redis"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.IcdDbRegion), - resource.TestCheckResourceAttr(name, "members_memory_allocation_mb", "2048"), - resource.TestCheckResourceAttr(name, "members_disk_allocation_mb", "4096"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "4096"), ), }, { @@ -117,7 +117,7 @@ func TestAccIBMDatabaseInstanceRedisImport(t *testing.T) { ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ - "wait_time_minutes", "plan_validation"}, + "wait_time_minutes"}, }, }, }) @@ -169,8 +169,15 @@ func testAccCheckIBMDatabaseInstanceRedisBasic(databaseResourceGroup string, nam plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 2048 - members_disk_allocation_mb = 2048 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 1024 + } + } allowlist { address = "172.168.1.2/32" description = "desc1" @@ -202,8 +209,15 @@ func testAccCheckIBMDatabaseInstanceRedisFullyspecified(databaseResourceGroup st plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 2304 - members_disk_allocation_mb = 4096 + group { + group_id = "member" + memory { + allocation_mb = 1152 + } + disk { + allocation_mb = 2048 + } + } allowlist { address = "172.168.1.2/32" description = "desc1" @@ -230,8 +244,15 @@ func testAccCheckIBMDatabaseInstanceRedisReduced(databaseResourceGroup string, n plan = "standard" location = "%[3]s" adminpassword = "password12" - members_memory_allocation_mb = 2048 - members_disk_allocation_mb = 4096 + group { + group_id = "member" + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 2048 + } + } } `, databaseResourceGroup, name, acc.IcdDbRegion) } diff --git a/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email.go b/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email.go new file mode 100644 index 0000000000..c5480a1901 --- /dev/null +++ b/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email.go @@ -0,0 +1,179 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" +) + +func DataSourceIBMEnCustomEmailDestination() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMEnCustomEmailDestinationRead, + + Schema: map[string]*schema.Schema{ + "instance_guid": { + Type: schema.TypeString, + Required: true, + Description: "Unique identifier for IBM Cloud Event Notifications instance.", + }, + "destination_id": { + Type: schema.TypeString, + Required: true, + Description: "Unique identifier for Destination.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Destination name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Destination description.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Destination type slack.", + }, + "config": { + Type: schema.TypeList, + Computed: true, + Description: "Payload describing a destination configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "params": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Computed: true, + Description: "The custom doamin", + }, + }, + }, + }, + }, + }, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Last updated time.", + }, + "subscription_count": { + Type: schema.TypeInt, + Computed: true, + Description: "Number of subscriptions.", + }, + "subscription_names": { + Type: schema.TypeList, + Computed: true, + Description: "List of subscriptions.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceIBMEnCustomEmailDestinationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.GetDestinationOptions{} + + options.SetInstanceID(d.Get("instance_guid").(string)) + options.SetID(d.Get("destination_id").(string)) + + result, response, err := enClient.GetDestinationWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("GetDestination failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *options.InstanceID, *options.ID)) + + if err = d.Set("name", result.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + if result.Description != nil { + if err = d.Set("description", result.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + } + + if err = d.Set("type", result.Type); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) + } + + if result.Config != nil { + err = d.Set("config", enSlackDestinationFlattenConfig(*result.Config)) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting config %s", err)) + } + } + + if result.SubscriptionNames != nil { + err = d.Set("subscription_names", result.SubscriptionNames) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_names %s", err)) + } + } + + if err = d.Set("updated_at", flex.DateTimeToString(result.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) + } + + return nil +} + +func enCustomEmailDestinationFlattenConfig(result en.DestinationConfig) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := enCustomEmailDestinationConfigToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func enCustomEmailDestinationConfigToMap(configItem en.DestinationConfig) (configMap map[string]interface{}) { + configMap = map[string]interface{}{} + + if configItem.Params != nil { + paramsList := []map[string]interface{}{} + paramsMap := enCustomEmailDestinationConfigParamsToMap(configItem.Params) + paramsList = append(paramsList, paramsMap) + configMap["params"] = paramsList + } + + return configMap +} + +func enCustomEmailDestinationConfigParamsToMap(paramsItem en.DestinationConfigOneOfIntf) (paramsMap map[string]interface{}) { + paramsMap = map[string]interface{}{} + + params := paramsItem.(*en.DestinationConfigOneOf) + + if params.URL != nil { + paramsMap["domain"] = params.Domain + } + return paramsMap +} diff --git a/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email_test.go b/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email_test.go new file mode 100644 index 0000000000..da2ae0a12f --- /dev/null +++ b/ibm/service/eventnotification/data_source_ibm_en_destination_custom_email_test.go @@ -0,0 +1,67 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMEnCustomEmailDestinationDataSourceBasic(t *testing.T) { + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + instanceName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMEnCustomEmailDestinationDataSourceConfigBasic(instanceName, name, description), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "id"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "instance_guid"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "name"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "description"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "type"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "destination_id"), + resource.TestCheckResourceAttrSet("data.ibm_en_destination_custom_email.en_destination_data_6", "subscription_count"), + ), + }, + }, + }) +} + +func testAccCheckIBMEnCustomEmailDestinationDataSourceConfigBasic(instanceName, name, description string) string { + return fmt.Sprintf(` + resource "ibm_resource_instance" "en_destination_datasource2" { + name = "%s" + location = "us-south" + plan = "standard" + service = "event-notifications" + } + + resource "ibm_en_destination_custom_email" "en_destination_datasource_4" { + instance_guid = ibm_resource_instance.en_destination_resource.guid + name = "%s" + type = "smtp_custom" + description = "%s" + config { + params { + domain = "mailx.com" + } + } + } + + data "ibm_en_destination_custom_email" "en_destination_data_6" { + instance_guid = ibm_resource_instance.en_destination_datasource2.guid + destination_id = ibm_en_destination_custom_email.en_destination_datasource_4.destination_id + } + `, instanceName, name, description) +} diff --git a/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email.go b/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email.go new file mode 100644 index 0000000000..34fc8a66df --- /dev/null +++ b/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email.go @@ -0,0 +1,297 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" +) + +func DataSourceIBMEnCustomEmailSubscription() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMEnCustomEmailSubscriptionRead, + + Schema: map[string]*schema.Schema{ + "instance_guid": { + Type: schema.TypeString, + Required: true, + Description: "Unique identifier for IBM Cloud Event Notifications instance.", + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + Description: "Unique identifier for result.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Subscription name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Subscription description.", + }, + "destination_id": { + Type: schema.TypeString, + Computed: true, + Description: "The destination ID.", + }, + "topic_id": { + Type: schema.TypeString, + Computed: true, + Description: "Topic ID.", + }, + "attributes": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "add_notification_payload": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to add the notification payload to the email.", + }, + "reply_to_mail": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address to reply to.", + }, + "reply_to_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address user name to reply to.", + }, + "from_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address username of source email address.", + }, + "from_email": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email from where it is sourced", + }, + "template_id_notification": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The templete id for notification", + }, + "template_id_invitation": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The templete id for invitation", + }, + // "invited": { + // Type: schema.TypeList, + // Optional: true, + // Computed: true, + // Description: "The email id to be invited", + // }, + // "subscribed": { + // Type: schema.TypeList, + // Optional: true, + // Computed: true, + // Description: "The Email address which should be subscribed from smtp_ibm.", + // }, + // "unsubscribed": { + // Type: schema.TypeList, + // Optional: true, + // Computed: true, + // Description: "The Email address which should be unsubscribed from smtp_ibm.", + // }, + "invited": { + Type: schema.TypeList, + Computed: true, + Description: "The invited item schema", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "email": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address to reply to.", + }, + "updated_at": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The updated date of invitation", + }, + "expires_at": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The expiry date of invitation mail", + }, + }, + }, + }, + "subscribed": { + Type: schema.TypeList, + Computed: true, + Description: "The email subscribed items schema", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "email": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address to reply to.", + }, + "updated_at": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The updated date of susbcription", + }, + }, + }, + }, + "unsubscribed": { + Type: schema.TypeList, + Computed: true, + Description: "The unsusbscribed email items schema", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "email": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The email address to reply to.", + }, + "updated_at": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The updated date of unsusbcription", + }, + }, + }, + }, + }, + }, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Last updated time.", + }, + }, + } +} + +func dataSourceIBMEnCustomEmailSubscriptionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + getSubscriptionOptions := &en.GetSubscriptionOptions{} + + getSubscriptionOptions.SetInstanceID(d.Get("instance_guid").(string)) + getSubscriptionOptions.SetID(d.Get("subscription_id").(string)) + + result, response, err := enClient.GetSubscriptionWithContext(context, getSubscriptionOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("GetSubscriptionWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *getSubscriptionOptions.InstanceID, *getSubscriptionOptions.ID)) + + if err = d.Set("name", result.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + if result.Description != nil { + if err = d.Set("description", result.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + } + if err = d.Set("updated_at", result.UpdatedAt); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + + if err = d.Set("destination_id", result.DestinationID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) + } + + if err = d.Set("topic_id", result.TopicID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_id: %s", err)) + } + + if result.Attributes != nil { + if err = d.Set("attributes", enEmailSubscriptionFlattenAttributes(result.Attributes)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting attributes %s", err)) + } + } + + return nil +} + +func enCustomEmailSubscriptionFlattenAttributes(result en.SubscriptionAttributesIntf) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + + attributes := result.(*en.SubscriptionAttributes) + + finalMap := enCustomEmailSubscriptionToMap(attributes) + // finalList = append(finalList, finalMap) + // invitedmap := make(map[string]interface{}) + // if attributes.Invited != nil { + // invitedmap["invited"] = attributes.Invited + // } + // finalList = append(finalList, invitedmap) + // subscribedmap := make(map[string]interface{}) + // if attributes.Subscribed != nil { + // subscribedmap["subscribed"] = attributes.Subscribed + // } + // finalList = append(finalList, subscribedmap) + // unsubscribedmap := make(map[string]interface{}) + // if attributes.Unsubscribed != nil { + // unsubscribedmap["unsubscribed"] = attributes.Unsubscribed + // } + // finalList = append(finalList, unsubscribedmap) + finalList = append(finalList, finalMap) + + return finalList +} + +func enCustomEmailSubscriptionToMap(attributeItem *en.SubscriptionAttributes) (attributeMap map[string]interface{}) { + attributeMap = map[string]interface{}{} + + if attributeItem.AddNotificationPayload != nil { + attributeMap["add_notification_payload"] = attributeItem.AddNotificationPayload + } + if attributeItem.ReplyToMail != nil { + attributeMap["reply_to_mail"] = attributeItem.ReplyToMail + } + if attributeItem.ReplyToName != nil { + attributeMap["reply_to_name"] = attributeItem.ReplyToName + } + if attributeItem.FromName != nil { + attributeMap["from_name"] = attributeItem.FromName + } + if attributeItem.FromEmail != nil { + attributeMap["from_email"] = attributeItem.FromEmail + } + if attributeItem.TemplateIDNotification != nil { + attributeMap["template_id_notification"] = attributeItem.TemplateIDNotification + } + if attributeItem.TemplateIDInvitation != nil { + attributeMap["template_id_invitation"] = attributeItem.TemplateIDInvitation + } + return attributeMap +} diff --git a/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email_test.go b/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email_test.go new file mode 100644 index 0000000000..b3e7504975 --- /dev/null +++ b/ibm/service/eventnotification/data_source_ibm_en_subscription_custom_email_test.go @@ -0,0 +1,84 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMEnCustomEmailSubscriptionDataSourceAllArgs(t *testing.T) { + instanceName := fmt.Sprintf("tf_instance_%d", acctest.RandIntRange(10, 100)) + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMEnCustomEmailSubscriptionDataSourceConfig(instanceName, name, description), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "id"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "instance_guid"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "subscription_id"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "name"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "description"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "destination_type"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "destination_id"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "destination_name"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "topic_id"), + resource.TestCheckResourceAttrSet("data.ibm_en_subscription_custom_email.data_subscription_1", "topic_name"), + ), + }, + }, + }) +} + +func testAccCheckIBMEnCustomEmailSubscriptionDataSourceConfig(instanceName, name, description string) string { + return fmt.Sprintf(` + resource "ibm_resource_instance" "en_subscription_datasource" { + name = "%s" + location = "us-south" + plan = "standard" + service = "event-notifications" + } + + resource "ibm_en_topic" "en_topic_resource_4" { + instance_guid = ibm_resource_instance.en_subscription_datasource.guid + name = "tf_topic_name_0664" + description = "tf_topic_description_0455" + } + + + resource "ibm_en_subscription_custom_email" "en_subscription_resource_4" { + name = "%s" + description = "%s" + instance_guid = ibm_resource_instance.en_subscription_datasource.guid + topic_id = ibm_en_topic.en_topic_resource_4.topic_id + destination_id = "ibm_resource_instance.ibm_en_destination_custom_email.destination_id" + attributes { + add_notification_payload = true + reply_to_mail = "en@ibm.com" + reply_to_name = "EYS ORG" + from_name="ABC ORG" + from_mail="Testuser@mailx.com" + invited = ["testmail@mailx.com"] + + } + } + + data "ibm_en_subscription_custom_email" "data_subscription_1" { + instance_guid = ibm_resource_instance.en_subscription_datasource.guid + subscription_id = ibm_en_subscription_custom_email.en_subscription_resource_4.subscription_id + } + + `, instanceName, name, description) +} diff --git a/ibm/service/eventnotification/resource_ibm_en_destination_custom_email.go b/ibm/service/eventnotification/resource_ibm_en_destination_custom_email.go new file mode 100644 index 0000000000..2392065817 --- /dev/null +++ b/ibm/service/eventnotification/resource_ibm_en_destination_custom_email.go @@ -0,0 +1,274 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" +) + +func ResourceIBMEnCustomEmailDestination() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMEnCustomEmailDestinationCreate, + ReadContext: resourceIBMEnCustomEmailDestinationRead, + UpdateContext: resourceIBMEnCustomEmailDestinationUpdate, + DeleteContext: resourceIBMEnCustomEmailDestinationDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "instance_guid": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Unique identifier for IBM Cloud Event Notifications instance.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "The Destintion name.", + }, + "type": { + Type: schema.TypeString, + Required: true, + Description: "The type of Destination type smtp_custom.", + }, + "description": { + Type: schema.TypeString, + Optional: true, + Description: "The Destination description.", + }, + "config": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Payload describing a destination configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "params": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Required: true, + Description: "Domain for the Custom Domain Email Destination", + }, + }, + }, + }, + }, + }, + }, + "destination_id": { + Type: schema.TypeString, + Computed: true, + Description: "Destination ID", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Last updated time.", + }, + "subscription_count": { + Type: schema.TypeInt, + Computed: true, + Description: "Number of subscriptions.", + }, + "subscription_names": { + Type: schema.TypeList, + Computed: true, + Description: "List of subscriptions.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +func resourceIBMEnCustomEmailDestinationCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.CreateDestinationOptions{} + + options.SetInstanceID(d.Get("instance_guid").(string)) + options.SetName(d.Get("name").(string)) + + options.SetType(d.Get("type").(string)) + destinationtype := d.Get("type").(string) + if _, ok := d.GetOk("description"); ok { + options.SetDescription(d.Get("description").(string)) + } + if _, ok := d.GetOk("config"); ok { + config := CustomEmaildestinationConfigMapToDestinationConfig(d.Get("config.0.params.0").(map[string]interface{}), destinationtype) + options.SetConfig(&config) + } + + result, response, err := enClient.CreateDestinationWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("CreateDestinationWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *options.InstanceID, *result.ID)) + + return resourceIBMEnServiceNowDestinationRead(context, d, meta) +} + +func resourceIBMEnCustomEmailDestinationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.GetDestinationOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + result, response, err := enClient.GetDestinationWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("GetDestinationWithContext failed %s\n%s", err, response)) + } + + if err = d.Set("instance_guid", options.InstanceID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) + } + + if err = d.Set("destination_id", options.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) + } + + if err = d.Set("name", result.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + if err = d.Set("type", result.Type); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) + } + + if err = d.Set("description", result.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + + if result.Config != nil { + err = d.Set("config", enCustomEmailDestinationFlattenConfig(*result.Config)) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting config %s", err)) + } + } + + if err = d.Set("updated_at", flex.DateTimeToString(result.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) + } + + if err = d.Set("subscription_names", result.SubscriptionNames); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_names: %s", err)) + } + + return nil +} + +func resourceIBMEnCustomEmailDestinationUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.UpdateDestinationOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + if ok := d.HasChanges("name", "description", "config"); ok { + options.SetName(d.Get("name").(string)) + + if _, ok := d.GetOk("description"); ok { + options.SetDescription(d.Get("description").(string)) + } + + destinationtype := d.Get("type").(string) + if _, ok := d.GetOk("config"); ok { + config := CustomEmaildestinationConfigMapToDestinationConfig(d.Get("config.0.params.0").(map[string]interface{}), destinationtype) + options.SetConfig(&config) + } + _, response, err := enClient.UpdateDestinationWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("UpdateDestinationWithContext failed %s\n%s", err, response)) + } + + return resourceIBMEnCustomEmailDestinationRead(context, d, meta) + } + + return nil +} + +func resourceIBMEnCustomEmailDestinationDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.DeleteDestinationOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + response, err := enClient.DeleteDestinationWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("DeleteDestinationWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} + +func CustomEmaildestinationConfigMapToDestinationConfig(configParams map[string]interface{}, destinationtype string) en.DestinationConfig { + params := new(en.DestinationConfigOneOfCustomDomainEmailDestinationConfig) + if configParams["domain"] != nil { + params.Domain = core.StringPtr(configParams["domain"].(string)) + } + + destinationConfig := new(en.DestinationConfig) + destinationConfig.Params = params + return *destinationConfig +} diff --git a/ibm/service/eventnotification/resource_ibm_en_destination_custom_email_test.go b/ibm/service/eventnotification/resource_ibm_en_destination_custom_email_test.go new file mode 100644 index 0000000000..c57a0c93da --- /dev/null +++ b/ibm/service/eventnotification/resource_ibm_en_destination_custom_email_test.go @@ -0,0 +1,147 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" +) + +func TestAccIBMEnCustomEmailDestinationAllArgs(t *testing.T) { + var config en.Destination + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + instanceName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + newName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + newDescription := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMEnServiceNowDestinationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMEnCustomEmailDestinationConfig(instanceName, name, description), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMEnCustomEmailDestinationExists("ibm_en_destination_custom_email.en_destination_resource_1", config), + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "name", name), + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "type", "smtp_custom"), + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "description", description), + ), + }, + { + Config: testAccCheckIBMEnCustomEmailDestinationConfig(instanceName, newName, newDescription), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "name", newName), + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "type", "smtp_custom"), + resource.TestCheckResourceAttr("ibm_en_destination_custom_email.en_destination_resource_1", "description", newDescription), + ), + }, + { + ResourceName: "ibm_en_destination_custom_email.en_destination_resource_1", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIBMEnCustomEmailDestinationConfig(instanceName, name, description string) string { + return fmt.Sprintf(` + resource "ibm_resource_instance" "en_destination_resource" { + name = "%s" + location = "us-south" + plan = "standard" + service = "event-notifications" + } + + resource "ibm_en_destination_custom_email" "en_destination_resource_1" { + instance_guid = ibm_resource_instance.en_destination_resource.guid + name = "%s" + type = "smtp_custom" + description = "%s" + config { + params { + domain = "mailx.com" + } + } + } + `, instanceName, name, description) +} + +func testAccCheckIBMEnCustomEmailDestinationExists(n string, obj en.Destination) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + enClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return err + } + + options := &en.GetDestinationOptions{} + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + result, _, err := enClient.GetDestination(options) + if err != nil { + return err + } + + obj = *result + return nil + } +} + +func testAccCheckIBMEnCustomEmailDestinationDestroy(s *terraform.State) error { + enClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "en_destination_resource_1" { + continue + } + + options := &en.GetDestinationOptions{} + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + // Try to find the key + _, response, err := enClient.GetDestination(options) + + if err == nil { + return fmt.Errorf("en_destination still exists: %s", rs.Primary.ID) + } else if response.StatusCode != 404 { + return fmt.Errorf("[ERROR] Error checking for en_destination (%s) has been destroyed: %s", rs.Primary.ID, err) + } + } + + return nil +} diff --git a/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email.go b/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email.go new file mode 100644 index 0000000000..ee10c86569 --- /dev/null +++ b/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email.go @@ -0,0 +1,423 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" + "github.com/IBM/go-sdk-core/v5/core" +) + +func ResourceIBMEnCustomEmailSubscription() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMEnCustomEmailSubscriptionCreate, + ReadContext: resourceIBMEnCustomEmailSubscriptionRead, + UpdateContext: resourceIBMEnCustomEmailSubscriptionUpdate, + DeleteContext: resourceIBMEnCustomEmailSubscriptionDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "instance_guid": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Unique identifier for IBM Cloud Event Notifications instance.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Subscription name.", + }, + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Subscription description.", + }, + "destination_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Destination ID.", + }, + "topic_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Topic ID.", + }, + "attributes": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "add_notification_payload": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to add the notification payload to the email.", + }, + "reply_to_mail": { + Type: schema.TypeString, + Optional: true, + Description: "The email address to reply to.", + }, + "reply_to_name": { + Type: schema.TypeString, + Optional: true, + Description: "The name of the email address user to reply to.", + }, + "from_name": { + Type: schema.TypeString, + Optional: true, + Description: "The name of email address from which email is sourced.", + }, + "from_email": { + Type: schema.TypeString, + Optional: true, + Description: "The email from where it is sourced", + }, + "template_id_notification": { + Type: schema.TypeString, + Optional: true, + Description: "The templete id for notification", + }, + "template_id_invitation": { + Type: schema.TypeString, + Optional: true, + Description: "The templete id for invitation", + }, + "invited": { + Type: schema.TypeList, + Optional: true, + Description: "The Email address send the invite to in case of smtp_ibm.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "add": { + Type: schema.TypeList, + Optional: true, + Description: "The Email address which should be added to smtp_ibm.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "remove": { + Type: schema.TypeList, + Optional: true, + Description: "The email id to be removed in case of smtp_ibm destination type.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + "subscription_id": { + Type: schema.TypeString, + Computed: true, + Description: "Subscription ID.", + }, + "destination_type": { + Type: schema.TypeString, + Computed: true, + Description: "The type of Destination.", + }, + "destination_name": { + Type: schema.TypeString, + Computed: true, + Description: "The Destintion name.", + }, + "topic_name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the topic.", + }, + "from": { + Type: schema.TypeString, + Computed: true, + Description: "From Email ID (it will be displayed only in case of smtp_ibm destination type).", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Last updated time.", + }, + }, + } +} + +func resourceIBMEnCustomEmailSubscriptionCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.CreateSubscriptionOptions{} + + options.SetInstanceID(d.Get("instance_guid").(string)) + + options.SetName(d.Get("name").(string)) + options.SetTopicID(d.Get("topic_id").(string)) + options.SetDestinationID(d.Get("destination_id").(string)) + + if _, ok := d.GetOk("description"); ok { + options.SetDescription(d.Get("description").(string)) + } + + attributes := CustomEmailattributesMapToAttributes(d.Get("attributes.0").(map[string]interface{})) + options.SetAttributes(&attributes) + + result, response, err := enClient.CreateSubscriptionWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("CreateSubscriptionWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *options.InstanceID, *result.ID)) + + return resourceIBMEnCustomEmailSubscriptionRead(context, d, meta) +} + +func resourceIBMEnCustomEmailSubscriptionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.GetSubscriptionOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + result, response, err := enClient.GetSubscriptionWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("GetSubscriptionWithContext failed %s\n%s", err, response)) + } + + if err = d.Set("instance_guid", options.InstanceID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) + } + + if err = d.Set("subscription_id", result.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) + } + + if err = d.Set("name", result.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + if result.Description != nil { + if err = d.Set("description", result.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + } + + if result.From != nil { + if err = d.Set("from", result.From); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting from: %s", err)) + } + } + + if err = d.Set("destination_id", result.DestinationID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) + } + + if err = d.Set("destination_type", result.DestinationType); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_type: %s", err)) + } + + if result.DestinationName != nil { + if err = d.Set("destination_name", result.DestinationName); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_name: %s", err)) + } + } + + if err = d.Set("topic_id", result.TopicID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_id: %s", err)) + } + + if result.TopicName != nil { + if err = d.Set("topic_name", result.TopicName); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_name: %s", err)) + } + } + + if err = d.Set("updated_at", result.UpdatedAt); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + + return nil +} + +func resourceIBMEnCustomEmailSubscriptionUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.UpdateSubscriptionOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + if ok := d.HasChanges("name", "description", "attributes"); ok { + options.SetName(d.Get("name").(string)) + + if _, ok := d.GetOk("description"); ok { + options.SetDescription(d.Get("description").(string)) + } + + attributes := CustomEmailattributesupdateMapToAttributes(d.Get("attributes.0").(map[string]interface{})) + options.SetAttributes(&attributes) + + _, response, err := enClient.UpdateSubscriptionWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("UpdateSubscriptionWithContext failed %s\n%s", err, response)) + } + + return resourceIBMEnCustomEmailSubscriptionRead(context, d, meta) + } + + return nil +} + +func resourceIBMEnCustomEmailSubscriptionDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return diag.FromErr(err) + } + + options := &en.DeleteSubscriptionOptions{} + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + response, err := enClient.DeleteSubscriptionWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("DeleteSubscriptionWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} + +func CustomEmailattributesMapToAttributes(attributeMap map[string]interface{}) en.SubscriptionCreateAttributes { + attributesCreate := en.SubscriptionCreateAttributes{} + if attributeMap["invited"] != nil { + invited := []string{} + for _, invitedItem := range attributeMap["invited"].([]interface{}) { + invited = append(invited, invitedItem.(string)) + } + attributesCreate.Invited = invited + } + + if attributeMap["add_notification_payload"] != nil { + attributesCreate.AddNotificationPayload = core.BoolPtr(attributeMap["add_notification_payload"].(bool)) + } + + if attributeMap["reply_to_mail"] != nil { + attributesCreate.ReplyToMail = core.StringPtr(attributeMap["reply_to_mail"].(string)) + } + + if attributeMap["reply_to_name"] != nil { + attributesCreate.ReplyToName = core.StringPtr(attributeMap["reply_to_name"].(string)) + } + + if attributeMap["from_name"] != nil { + attributesCreate.FromName = core.StringPtr(attributeMap["from_name"].(string)) + } + + if attributeMap["from_email"] != nil { + attributesCreate.FromEmail = core.StringPtr(attributeMap["from_email"].(string)) + } + + if attributeMap["template_id_notification"] != nil { + attributesCreate.TemplateIDNotification = core.StringPtr(attributeMap["template_id_notification"].(string)) + } + + if attributeMap["template_id_invitation"] != nil { + attributesCreate.TemplateIDInvitation = core.StringPtr(attributeMap["template_id_invitation"].(string)) + } + + return attributesCreate +} + +func CustomEmailattributesupdateMapToAttributes(attributeMap map[string]interface{}) en.SubscriptionUpdateAttributesCustomEmailUpdateAttributes { + updateattributes := en.SubscriptionUpdateAttributesCustomEmailUpdateAttributes{} + + addemail := new(en.UpdateAttributesInvited) + if attributeMap["add"] != nil { + to := []string{} + for _, toItem := range attributeMap["add"].([]interface{}) { + to = append(to, toItem.(string)) + } + addemail.Add = to + } + updateattributes.Invited = addemail + + if attributeMap["remove"] != nil { + rmemail := []string{} + for _, removeitem := range attributeMap["remove"].([]interface{}) { + rmemail = append(rmemail, removeitem.(string)) + } + + addemail.Remove = rmemail + } + updateattributes.Invited = addemail + + if attributeMap["add_notification_payload"] != nil { + updateattributes.AddNotificationPayload = core.BoolPtr(attributeMap["add_notification_payload"].(bool)) + } + + if attributeMap["reply_to_mail"] != nil { + updateattributes.ReplyToMail = core.StringPtr(attributeMap["reply_to_mail"].(string)) + } + + if attributeMap["reply_to_name"] != nil { + updateattributes.ReplyToName = core.StringPtr(attributeMap["reply_to_name"].(string)) + } + + if attributeMap["from_name"] != nil { + updateattributes.FromName = core.StringPtr(attributeMap["from_name"].(string)) + } + + if attributeMap["from_email"] != nil { + updateattributes.FromEmail = core.StringPtr(attributeMap["from_email"].(string)) + } + + if attributeMap["template_id_notification"] != nil { + updateattributes.TemplateIDNotification = core.StringPtr(attributeMap["template_id_notification"].(string)) + } + + if attributeMap["template_id_invitation"] != nil { + updateattributes.TemplateIDInvitation = core.StringPtr(attributeMap["template_id_invitation"].(string)) + } + + return updateattributes +} diff --git a/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email_test.go b/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email_test.go new file mode 100644 index 0000000000..cac5824d94 --- /dev/null +++ b/ibm/service/eventnotification/resource_ibm_en_subscription_custom_email_test.go @@ -0,0 +1,171 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package eventnotification_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" +) + +func TestAccIBMEnCustomDomainSubscriptionAllArgs(t *testing.T) { + var conf en.Subscription + instanceName := fmt.Sprintf("tf_instance_%d", acctest.RandIntRange(10, 100)) + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + newName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + newDescription := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMEnEmailSubscriptionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMEnCustomDomainSubscriptionConfig(instanceName, name, description), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMEnCustomDomainSubscriptionExists("ibm_en_subscription_email.en_subscription_resource_1", conf), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "name"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "description"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "topic_id"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "updated_at"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "instance_guid"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "destination_id"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "destination_type"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "subscription_id"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.#"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.reply_to_mail"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.reply_to_name"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.from_name"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.from_email"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.add_notification_payload"), + resource.TestCheckResourceAttrSet("ibm_en_subscription_custom_email.en_subscription_resource_1", "attributes.0.invited"), + ), + }, + { + Config: testAccCheckIBMEnCustomDomainSubscriptionConfig(instanceName, newName, newDescription), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_en_subscription_custom_email.en_subscription_resource_1", "name", newName), + resource.TestCheckResourceAttr("ibm_en_subscription_custom_email.en_subscription_resource_1", "description", newDescription), + ), + }, + { + ResourceName: "ibm_en_subscription_custom_email.en_subscription_resource_1", + ImportState: true, + ImportStateVerify: false, + }, + }, + }) +} + +func testAccCheckIBMEnCustomDomainSubscriptionConfig(instanceName, name, description string) string { + return fmt.Sprintf(` + resource "ibm_resource_instance" "en_subscription_resource" { + name = "%s" + location = "us-south" + plan = "standard" + service = "event-notifications" + } + + resource "ibm_en_topic" "en_topic_resource_2" { + instance_guid = ibm_resource_instance.en_subscription_resource.guid + name = "tf_topic_name_0234" + description = "tf_topic_description_0235" + } + + + resource "ibm_en_subscription_custom_email" "en_subscription_resource_1" { + name = "%s" + description = "%s" + instance_guid = ibm_resource_instance.en_subscription_resource.guid + topic_id = ibm_en_topic.en_topic_resource_2.topic_id + destination_id = "ibm_resource_instance.ibm_en_destination_custom_email.destination_id" + attributes { + add_notification_payload = true + reply_to_mail = "en@ibm.com" + reply_to_name = "EYS ORG" + from_name="ABC ORG" + from_mail="Testuser@mailx.com" + invited = ["testmail@gmail.com"] + + } + } + `, instanceName, name, description) +} + +func testAccCheckIBMEnCustomDomainSubscriptionExists(n string, obj en.Subscription) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + enClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return err + } + + options := &en.GetSubscriptionOptions{} + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + subscription, _, err := enClient.GetSubscription(options) + if err != nil { + return err + } + + obj = *subscription + return nil + } +} + +func testAccCheckIBMEnCustomDomainSubscriptionDestroy(s *terraform.State) error { + enClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).EventNotificationsApiV1() + if err != nil { + return err + } + + for _, rs := range s.RootModule().Resources { + if rs.Type != "en_subscription_resource_1" { + continue + } + + options := &en.GetSubscriptionOptions{} + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + options.SetInstanceID(parts[0]) + options.SetID(parts[1]) + + // Try to find the key + _, response, err := enClient.GetSubscription(options) + + if err == nil { + return fmt.Errorf("en_subscription still exists: %s", rs.Primary.ID) + } else if response.StatusCode != 404 { + return fmt.Errorf("[ERROR] Error checking for en_subscription (%s) has been destroyed: %s", rs.Primary.ID, err) + } + } + + return nil +} diff --git a/ibm/service/eventstreams/data_source_ibm_event_streams_schema_test.go b/ibm/service/eventstreams/data_source_ibm_event_streams_schema_test.go index 4ee7aeb3e6..2301b1e36c 100644 --- a/ibm/service/eventstreams/data_source_ibm_event_streams_schema_test.go +++ b/ibm/service/eventstreams/data_source_ibm_event_streams_schema_test.go @@ -8,7 +8,6 @@ import ( "testing" acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -22,7 +21,7 @@ func TestAccIBMEventStreamsSchemaDataSourceBasic(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsSchemaDataSourceConfigBasic(MZREnterpriseInstanceName, mySchemaID), + Config: testAccCheckIBMEventStreamsSchemaDataSourceConfigBasic(getTestInstanceName(mzrKey), mySchemaID), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_schema.es_schema", "kafka_http_url"), @@ -31,7 +30,7 @@ func TestAccIBMEventStreamsSchemaDataSourceBasic(t *testing.T) { ), }, { - Config: testAccCheckIBMEventStreamsSchemaDataSourceConfigBasic(SZREnterpriseInstanceName, mySchemaID), + Config: testAccCheckIBMEventStreamsSchemaDataSourceConfigBasic(getTestInstanceName(szrKey), mySchemaID), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_schema.es_schema", "kafka_http_url"), diff --git a/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go b/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go index bfa4b67e0d..a12133a9da 100644 --- a/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go +++ b/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go @@ -4,15 +4,17 @@ package eventstreams import ( + "context" "fmt" "log" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func DataSourceIBMEventStreamsTopic() *schema.Resource { return &schema.Resource{ - Read: dataSourceIBMEventStreamsTopicRead, + ReadContext: dataSourceIBMEventStreamsTopicRead, Schema: map[string]*schema.Schema{ "resource_instance_id": { Type: schema.TypeString, @@ -49,16 +51,16 @@ func DataSourceIBMEventStreamsTopic() *schema.Resource { } } -func dataSourceIBMEventStreamsTopicRead(d *schema.ResourceData, meta interface{}) error { +func dataSourceIBMEventStreamsTopicRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { adminClient, instanceCRN, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG]dataSourceIBMEventStreamsTopicRead createSaramaAdminClient err %s", err) - return err + return diag.FromErr(err) } topics, err := adminClient.ListTopics() if err != nil { log.Printf("[DEBUG]dataSourceIBMEventStreamsTopicRead ListTopics err %s", err) - return err + return diag.FromErr(err) } topicName := d.Get("name").(string) for name := range topics { @@ -71,5 +73,5 @@ func dataSourceIBMEventStreamsTopicRead(d *schema.ResourceData, meta interface{} } } log.Printf("[DEBUG]dataSourceIBMEventStreamsTopicRead topic %s does not exist", topicName) - return fmt.Errorf("topic %s does not exist", topicName) + return diag.FromErr(fmt.Errorf("topic %s does not exist", topicName)) } diff --git a/ibm/service/eventstreams/data_source_ibm_event_streams_topic_test.go b/ibm/service/eventstreams/data_source_ibm_event_streams_topic_test.go index 727eb35e5c..89607c3c11 100644 --- a/ibm/service/eventstreams/data_source_ibm_event_streams_topic_test.go +++ b/ibm/service/eventstreams/data_source_ibm_event_streams_topic_test.go @@ -5,6 +5,7 @@ package eventstreams_test import ( "fmt" + "os" "testing" acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" @@ -12,46 +13,72 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -var ( - MZREnterpriseInstanceName = "mh-preprod-customer-us-south-wp" - SZREnterpriseInstanceName = "mh-preprod-customer-us-south-szr" - standardInstanceName = "hyperion-preprod-spp-a-service" - topicName = "kafka-java-console-sample-topic" +const ( + mzrKey = "MZR_INSTANCE_NAME" + szrKey = "SZR_INSTANCE_NAME" + stdKey = "STD_INSTANCE_NAME" + MZREnterpriseInstanceName = "ES Preprod Pipeline MZR" + SZREnterpriseInstanceName = "ES Integration Pipeline SZR" + standardInstanceName = "hyperion-preprod-spp09-us-south-a-service" + testTopicName = "kafka-java-console-sample-topic" ) +func getTestInstanceName(envKey string) string { + instance := os.Getenv(envKey) + if len(instance) == 0 { + switch envKey { + case mzrKey: + instance = MZREnterpriseInstanceName + case szrKey: + instance = SZREnterpriseInstanceName + case stdKey: + instance = standardInstanceName + } + } + return instance +} + +func getTestTopicName() string { + topic := os.Getenv("TEST_TOPIC") + if len(topic) == 0 { + topic = testTopicName + } + return topic +} + func TestAccIBMEventStreamsTopicDataSourceBasic(t *testing.T) { resource.Test(t, resource.TestCase{ Providers: acc.TestAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(MZREnterpriseInstanceName, topicName), + Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(getTestInstanceName(mzrKey), getTestTopicName()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "id"), - resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", topicName), + resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", getTestTopicName()), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_http_url"), ), }, { - Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(SZREnterpriseInstanceName, topicName), + Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(getTestInstanceName(szrKey), getTestTopicName()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "id"), - resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", topicName), + resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", getTestTopicName()), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_http_url"), ), }, { - Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(standardInstanceName, topicName), + Config: testAccCheckIBMEventStreamsTopicDataSourceConfigBasic(getTestInstanceName(stdKey), getTestTopicName()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "id"), - resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", topicName), + resource.TestCheckResourceAttr("data.ibm_event_streams_topic.es_topic", "name", getTestTopicName()), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_brokers_sasl.0"), resource.TestCheckResourceAttrSet("data.ibm_event_streams_topic.es_topic", "kafka_http_url"), ), diff --git a/ibm/service/eventstreams/resource_ibm_event_streams_schema.go b/ibm/service/eventstreams/resource_ibm_event_streams_schema.go index 7d4865eb9b..bc4a0d7125 100644 --- a/ibm/service/eventstreams/resource_ibm_event_streams_schema.go +++ b/ibm/service/eventstreams/resource_ibm_event_streams_schema.go @@ -293,7 +293,17 @@ func resourceIBMEventStreamsSchemaDelete(context context.Context, d *schema.Reso schemaID := d.Get("schema_id").(string) deleteSchemaOptions.SetID(schemaID) - response, err := schemaregistryClient.DeleteSchemaWithContext(context, deleteSchemaOptions) + setSchemaOptions := &schemaregistryv1.SetSchemaStateOptions{} + setSchemaOptions.SetID(schemaID) + setSchemaOptions.SetState("DISABLED") + + // set schema state to disabled before deleting + response, err := schemaregistryClient.SetSchemaStateWithContext(context, setSchemaOptions) + if err != nil { + log.Printf("[DEBUG] SetSchemaStateWithContext failed %s\n%s", err, response) + } + + response, err = schemaregistryClient.DeleteSchemaWithContext(context, deleteSchemaOptions) if err != nil { log.Printf("[DEBUG] DeleteSchemaWithContext failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("DeleteSchemaWithContext failed %s\n%s", err, response)) diff --git a/ibm/service/eventstreams/resource_ibm_event_streams_schema_test.go b/ibm/service/eventstreams/resource_ibm_event_streams_schema_test.go index be31c72f98..6b9accb182 100644 --- a/ibm/service/eventstreams/resource_ibm_event_streams_schema_test.go +++ b/ibm/service/eventstreams/resource_ibm_event_streams_schema_test.go @@ -28,7 +28,7 @@ func TestAccIBMEventStreamsSchemaBasic(t *testing.T) { CheckDestroy: testAccCheckIBMEventStreamsSchemaDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsSchemaConfigBasicWithExistingInstance(SZREnterpriseInstanceName, "szr"), + Config: testAccCheckIBMEventStreamsSchemaConfigBasicWithExistingInstance(getTestInstanceName(szrKey), "szr"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsSchemaExists("ibm_event_streams_schema.es_schema", conf, ""), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), @@ -38,7 +38,7 @@ func TestAccIBMEventStreamsSchemaBasic(t *testing.T) { ), }, { - Config: testAccCheckIBMEventStreamsSchemaConfigBasicWithExistingInstance(MZREnterpriseInstanceName, "mzr"), + Config: testAccCheckIBMEventStreamsSchemaConfigBasicWithExistingInstance(getTestInstanceName(mzrKey), "mzr"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsSchemaExists("ibm_event_streams_schema.es_schema", conf, ""), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), @@ -60,7 +60,7 @@ func TestAccIBMEventStreamsSchemaAllArgs(t *testing.T) { CheckDestroy: testAccCheckIBMEventStreamsSchemaDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsSchemaWithSchemaIDWithExistingInstance(MZREnterpriseInstanceName, schemaID), + Config: testAccCheckIBMEventStreamsSchemaWithSchemaIDWithExistingInstance(getTestInstanceName(mzrKey), schemaID), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsSchemaExists("ibm_event_streams_schema.es_schema", conf, schemaID), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_http_url"), @@ -81,7 +81,7 @@ func TestAccIBMEventStreamsSchemaImport(t *testing.T) { CheckDestroy: testAccCheckIBMEventStreamsSchemaDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsSchemaWithSchemaIDWithExistingInstance(MZREnterpriseInstanceName, schemaID), + Config: testAccCheckIBMEventStreamsSchemaWithSchemaIDWithExistingInstance(getTestInstanceName(mzrKey), schemaID), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsSchemaExists("ibm_event_streams_schema.es_schema", conf, schemaID), resource.TestCheckResourceAttrSet("ibm_event_streams_schema.es_schema", "schema"), diff --git a/ibm/service/eventstreams/resource_ibm_event_streams_topic.go b/ibm/service/eventstreams/resource_ibm_event_streams_topic.go index 9df1bf1026..a682866ea8 100644 --- a/ibm/service/eventstreams/resource_ibm_event_streams_topic.go +++ b/ibm/service/eventstreams/resource_ibm_event_streams_topic.go @@ -4,6 +4,7 @@ package eventstreams import ( + "context" "fmt" "log" "os" @@ -12,7 +13,8 @@ import ( "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -25,7 +27,7 @@ const ( ) var ( - brokerVersion = sarama.V2_6_0_0 + brokerVersion = sarama.V3_3_0_0 adminClientTimeout = 30 * time.Second allowedTopicConfigs = []string{ "cleanup.policy", @@ -46,12 +48,11 @@ var ( func ResourceIBMEventStreamsTopic() *schema.Resource { return &schema.Resource{ - Exists: resourceIBMEventStreamsTopicExists, - Create: resourceIBMEventStreamsTopicCreate, - Read: resourceIBMEventStreamsTopicRead, - Update: resourceIBMEventStreamsTopicUpdate, - Delete: resourceIBMEventStreamsTopicDelete, - Importer: &schema.ResourceImporter{}, + CreateContext: resourceIBMEventStreamsTopicCreate, + ReadContext: resourceIBMEventStreamsTopicRead, + UpdateContext: resourceIBMEventStreamsTopicUpdate, + DeleteContext: resourceIBMEventStreamsTopicDelete, + Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ "resource_instance_id": { Type: schema.TypeString, @@ -93,7 +94,8 @@ func ResourceIBMEventStreamsTopic() *schema.Resource { // key is instance's CRN var clientPool = map[string]sarama.ClusterAdmin{} -func resourceIBMEventStreamsTopicExists(d *schema.ResourceData, meta interface{}) (bool, error) { +func resourceIBMEventStreamsTopicExists(context context.Context, d *schema.ResourceData, meta interface{}) (bool, error) { + log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists") adminClient, _, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists createSaramaAdminClient err %s", err) @@ -103,28 +105,29 @@ func resourceIBMEventStreamsTopicExists(d *schema.ResourceData, meta interface{} topicsMetadata, err := adminClient.DescribeTopics([]string{topicName}) if err != nil { descErr := fmt.Errorf("[ERROR] Error describing topic %s : %v", topicName, err) - log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics err %v", descErr) + log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics: %s, err %v", topicName, descErr) return false, descErr } if len(topicsMetadata) == 0 { descErr := fmt.Errorf("no metadata was returned for topic %s", topicName) - log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics err %v", descErr) + log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics: %s, err %v", topicName, descErr) return false, descErr } if topicsMetadata[0].Err != sarama.ErrNoError { metadataErr := topicsMetadata[0].Err - log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics err %v", metadataErr) + log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics: %s, err %v", topicName, metadataErr) return false, metadataErr } log.Printf("[INFO] resourceIBMEventStreamsTopicExists topic %s exists", topicName) return true, nil } -func resourceIBMEventStreamsTopicCreate(d *schema.ResourceData, meta interface{}) error { +func resourceIBMEventStreamsTopicCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[DEBUG] resourceIBMEventStreamsTopicCreate") adminClient, instanceCRN, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicCreate createSaramaAdminClient err %s", err) - return err + return diag.FromErr(err) } topicName := d.Get("name").(string) partitions := d.Get("partitions").(int) @@ -138,37 +141,38 @@ func resourceIBMEventStreamsTopicCreate(d *schema.ResourceData, meta interface{} if err != nil { if kafkaErr, ok := err.(*sarama.TopicError); ok { if kafkaErr != nil && kafkaErr.Err == sarama.ErrTopicAlreadyExists { - exists, err := resourceIBMEventStreamsTopicExists(d, meta) + exists, err := resourceIBMEventStreamsTopicExists(context, d, meta) if err != nil { - log.Printf("[DEBUG] resourceIBMEventStreamsTopicCreate resourceIBMEventStreamsTopicExists err %s", err) - return err + log.Printf("[DEBUG] resourceIBMEventStreamsTopicCreate resourceIBMEventStreamsTopicExists: %s, err %s", topicName, err) + return diag.FromErr(err) } if exists { d.SetId(getTopicID(instanceCRN, topicName)) - return resourceIBMEventStreamsTopicRead(d, meta) + return resourceIBMEventStreamsTopicRead(context, d, meta) } } } - log.Printf("[ERROR] resourceIBMEventStreamsTopicCreate CreateTopic err %s", err) - return err + log.Printf("[ERROR] resourceIBMEventStreamsTopicCreate CreateTopic: %s, err %s", topicName, err) + return diag.FromErr(err) } log.Printf("[INFO] resourceIBMEventStreamsTopicCreate CreateTopic: topic is %s, detail is %v", topicName, topicDetail) d.SetId(getTopicID(instanceCRN, topicName)) - return resourceIBMEventStreamsTopicRead(d, meta) + return resourceIBMEventStreamsTopicRead(context, d, meta) } -func resourceIBMEventStreamsTopicRead(d *schema.ResourceData, meta interface{}) error { +func resourceIBMEventStreamsTopicRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[DEBUG] resourceIBMEventStreamsTopicRead") adminClient, instanceCRN, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicRead createSaramaAdminClient err %s", err) - return err + return diag.FromErr(err) } topicID := d.Id() topicName := getTopicName(topicID) topics, err := adminClient.ListTopics() if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicRead ListTopics err %s", err) - return err + return diag.FromErr(err) } for name, detail := range topics { if name == topicName { @@ -192,11 +196,12 @@ func resourceIBMEventStreamsTopicRead(d *schema.ResourceData, meta interface{}) return nil } -func resourceIBMEventStreamsTopicUpdate(d *schema.ResourceData, meta interface{}) error { +func resourceIBMEventStreamsTopicUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[DEBUG] resourceIBMEventStreamsTopicUpdate") adminClient, _, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicUpdate createSaramaAdminClient err %s", err) - return err + return diag.FromErr(err) } topicName := d.Get("name").(string) if d.HasChange("partitions") { @@ -207,7 +212,7 @@ func resourceIBMEventStreamsTopicUpdate(d *schema.ResourceData, meta interface{} err = adminClient.CreatePartitions(topicName, int32(newPartitions), nil, false) if err != nil { log.Printf("[DEBUG]resourceIBMEventStreamsTopicUpdate CreatePartitions err %s", err) - return err + return diag.FromErr(err) } d.Set("partitions", int32(newPartitions)) log.Printf("[INFO]resourceIBMEventStreamsTopicUpdate partitions is set to %d", newPartitions) @@ -218,19 +223,20 @@ func resourceIBMEventStreamsTopicUpdate(d *schema.ResourceData, meta interface{} err = adminClient.AlterConfig(sarama.TopicResource, topicName, configEntries, false) if err != nil { log.Printf("[DEBUG]resourceIBMEventStreamsTopicUpdate AlterConfig err %s", err) - return err + return diag.FromErr(err) } d.Set("config", topicDetail2Config(configEntries)) log.Printf("[INFO]resourceIBMEventStreamsTopicUpdate config is set to %v", topicDetail2Config(configEntries)) } - return resourceIBMEventStreamsTopicRead(d, meta) + return resourceIBMEventStreamsTopicRead(context, d, meta) } -func resourceIBMEventStreamsTopicDelete(d *schema.ResourceData, meta interface{}) error { +func resourceIBMEventStreamsTopicDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[DEBUG] resourceIBMEventStreamsTopicDelete") adminClient, _, err := createSaramaAdminClient(d, meta) if err != nil { log.Printf("[DEBUG] resourceIBMEventStreamsTopicDelete createSaramaAdminClient err %s", err) - return err + return diag.FromErr(err) } topicName := d.Get("name").(string) err = adminClient.DeleteTopic(topicName) @@ -243,7 +249,7 @@ func resourceIBMEventStreamsTopicDelete(d *schema.ResourceData, meta interface{} } } log.Printf("[DEBUG] resourceIBMEventStreamsTopicDelete DeleteTopic err %s", err) - return err + return diag.FromErr(err) } d.SetId("") log.Printf("[INFO]resourceIBMEventStreamsTopicDelete topic %s deleted", topicName) diff --git a/ibm/service/eventstreams/resource_ibm_event_streams_topic_test.go b/ibm/service/eventstreams/resource_ibm_event_streams_topic_test.go index da48089b23..ba446d6eff 100644 --- a/ibm/service/eventstreams/resource_ibm_event_streams_topic_test.go +++ b/ibm/service/eventstreams/resource_ibm_event_streams_topic_test.go @@ -72,8 +72,6 @@ func TestAccIBMEventStreamsTopicResourceBasic(t *testing.T) { }) } -var existingInstanceName = "hyperion-preprod-spp-a-service" - func TestAccIBMEventStreamsTopicResourceWithExistingInstance(t *testing.T) { topicName := fmt.Sprintf("es_topic_%d", acctest.RandInt()) partitions := 1 @@ -86,7 +84,7 @@ func TestAccIBMEventStreamsTopicResourceWithExistingInstance(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckIBMEventStreamsTopicWithExistingInstanceWithoutConfig(existingInstanceName, topicName, partitions), + Config: testAccCheckIBMEventStreamsTopicWithExistingInstanceWithoutConfig(getTestInstanceName(stdKey), topicName, partitions), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsTopicExists("ibm_event_streams_topic.es_topic", topicName), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_brokers_sasl.0"), @@ -100,7 +98,7 @@ func TestAccIBMEventStreamsTopicResourceWithExistingInstance(t *testing.T) { ), }, { - Config: testAccCheckIBMEventStreamsTopicWithExistingInstanceWithConfig(existingInstanceName, topicName, partitions, cleanupPolicy, retentionBytes, retentionMs, segmentBytes), + Config: testAccCheckIBMEventStreamsTopicWithExistingInstanceWithConfig(getTestInstanceName(stdKey), topicName, partitions, cleanupPolicy, retentionBytes, retentionMs, segmentBytes), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMEventStreamsTopicExists("ibm_event_streams_topic.es_topic", topicName), resource.TestCheckResourceAttrSet("data.ibm_resource_instance.es_instance", "extensions.kafka_brokers_sasl.0"), @@ -348,12 +346,11 @@ func testAccCheckIBMEventStreamsTopicExists(n, topicName string) resource.TestCh var ( instanceCRN = "crn:v1:staging:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:c822a30e-bfff-4867-85ec-b805eeab1835::" - mytopicName = "mytopic" - topicID = "crn:v1:staging:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:c822a30e-bfff-4867-85ec-b805eeab1835:topic:mytopic" + topicID = "crn:v1:staging:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:c822a30e-bfff-4867-85ec-b805eeab1835:topic:" + getTestTopicName() ) func TestGetTopicID(t *testing.T) { - gotTopicID := getTopicID(instanceCRN, mytopicName) + gotTopicID := getTopicID(instanceCRN, getTestTopicName()) assert.Equal(t, topicID, gotTopicID) } @@ -364,7 +361,7 @@ func TestGetInstanceCRN(t *testing.T) { func TestGetTopicName(t *testing.T) { gotTopicName := getTopicName(topicID) - assert.Equal(t, mytopicName, gotTopicName) + assert.Equal(t, getTestTopicName(), gotTopicName) } func getTopicID(instanceCRN string, topicName string) string { diff --git a/ibm/service/kms/resource_ibm_kms_key_rings.go b/ibm/service/kms/resource_ibm_kms_key_rings.go index 5f4bc85c70..f64278dda8 100644 --- a/ibm/service/kms/resource_ibm_kms_key_rings.go +++ b/ibm/service/kms/resource_ibm_kms_key_rings.go @@ -153,7 +153,9 @@ func resourceIBMKmsKeyRingDelete(d *schema.ResourceData, meta interface{}) error err = kpAPI.DeleteKeyRing(context.Background(), id[0], kp.WithForce(force_delete)) if err != nil { kpError := err.(*kp.Error) - if kpError.StatusCode == 404 { + // Key ring deletion used to occur by silencing the 409 failed deletion and allowing instance deletion to clean it up + // Will be deprecated in the future in favor of force_delete flag + if kpError.StatusCode == 404 || kpError.StatusCode == 409 { return nil } else { return fmt.Errorf(" failed to Destroy key ring with error: %s", err) diff --git a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque.go b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque.go index d3879c1e23..8dee8ac3f7 100644 --- a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque.go +++ b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque.go @@ -45,6 +45,9 @@ func ResourceIBMContainerIngressSecretOpaque() *schema.Resource { Required: true, Description: "Secret name", ForceNew: true, + ValidateFunc: validate.InvokeValidator( + "ibm_container_ingress_secret_opaque", + "secret_name"), }, "secret_namespace": { Type: schema.TypeString, @@ -73,6 +76,16 @@ func ResourceIBMContainerIngressSecretOpaque() *schema.Resource { Computed: true, Description: "Status of the secret", }, + "update_secret": { + Type: schema.TypeInt, + Optional: true, + Description: "Updates secret from secrets manager if value is changed (increment each usage)", + }, + "last_updated_timestamp": { + Type: schema.TypeString, + Computed: true, + Description: "Timestamp secret was last updated", + }, "fields": { Type: schema.TypeSet, Required: true, @@ -122,6 +135,16 @@ func ResourceIBMContainerIngressSecretOpaqueValidator() *validate.ResourceValida CloudDataType: "cluster", CloudDataRange: []string{"resolved_to:id"}}) + validateSchema = append(validateSchema, validate.ValidateSchema{ + Identifier: "secret_name", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$`, + MinValueLength: 1, + MaxValueLength: 63, + }) + iBMContainerIngressInstanceValidator := validate.ResourceValidator{ResourceName: "ibm_container_ingress_secret_opaque", Schema: validateSchema} return &iBMContainerIngressInstanceValidator } @@ -205,6 +228,7 @@ func resourceIBMContainerIngressSecretOpaqueRead(d *schema.ResourceData, meta in d.Set("persistence", ingressSecretConfig.Persistence) d.Set("user_managed", ingressSecretConfig.UserManaged) d.Set("status", ingressSecretConfig.Status) + d.Set("last_updated_timestamp", ingressSecretConfig.LastUpdatedTimestamp) if len(ingressSecretConfig.Fields) > 0 { d.Set("fields", flex.FlattenOpaqueSecret(ingressSecretConfig.Fields)) @@ -261,6 +285,7 @@ func resourceIBMContainerIngressSecretOpaqueUpdate(d *schema.ResourceData, meta Namespace: secretNamespace, } + ingressAPI := ingressClient.Ingresses() if d.HasChange("fields") { oldList, newList := d.GetChange("fields") @@ -276,7 +301,6 @@ func resourceIBMContainerIngressSecretOpaqueUpdate(d *schema.ResourceData, meta remove := os.Difference(ns).List() add := ns.Difference(os).List() - ingressAPI := ingressClient.Ingresses() if len(remove) > 0 { actualSecret, err := ingressAPI.GetIngressSecret(cluster, secretName, secretNamespace) if err != nil { @@ -342,8 +366,13 @@ func resourceIBMContainerIngressSecretOpaqueUpdate(d *schema.ResourceData, meta return err } } + } else if d.HasChange("update_secret") { + // user wants to force an upstream secret update from secrets manager onto kube cluster w/out changing crn + _, err = ingressAPI.UpdateIngressSecret(params) + if err != nil { + return err + } } - return resourceIBMContainerIngressSecretOpaqueRead(d, meta) } diff --git a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque_test.go b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque_test.go index 5aa03e59c9..6e214768b2 100644 --- a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque_test.go +++ b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_opaque_test.go @@ -5,6 +5,7 @@ package kubernetes_test import ( "fmt" + "regexp" "strings" "testing" @@ -70,7 +71,124 @@ func TestAccIBMContainerIngressSecretOpaque_Basic(t *testing.T) { ResourceName: "ibm_container_ingress_secret_opaque.secret", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"region", "issuer_name"}, + ImportStateVerifyIgnore: []string{"region", "issuer_name", "update_secret"}, + }, + }, + }) +} + +func TestAccIBMContainerIngressSecretOpaque_InvalidName(t *testing.T) { + secretName := fmt.Sprintf(")-tf-container-ingress-secret-name-opaque-%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMContainerIngressSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMContainerIngressSecretOpaqueBasic(secretName), + ExpectError: regexp.MustCompile(".*should match regexp"), + }, + }, + }) +} + +func TestAccIBMContainerIngressSecretOpaque_ForceUpdate(t *testing.T) { + secretName := fmt.Sprintf("tf-container-ingress-secret-name-opaque-update-%d", acctest.RandIntRange(10, 100)) + + var originalTS string + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMContainerIngressSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMContainerIngressSecretOpaqueForceUpdateCreate(secretName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "cluster", acc.ClusterName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "persistence", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "type", "Opaque"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "fields.#", "1"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "status", "created"), + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_opaque.secret", "last_updated_timestamp", func(value string) error { + originalTS = value + return nil + }), + ), + }, + { + Config: testAccCheckIBMContainerIngressSecretOpaqueForceUpdate(secretName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "cluster", acc.ClusterName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "persistence", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "type", "Opaque"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "fields.#", "1"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "status", "created"), + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_opaque.secret", "last_updated_timestamp", func(value string) error { + if originalTS == value { + return fmt.Errorf("error timestamp not changed, indicates update didnt go through. original: %s, actual: %s", originalTS, value) + } + originalTS = value // check if another update will execute without a change to `update_secret` + return nil + }), + ), + }, + { + Config: testAccCheckIBMContainerIngressSecretOpaqueForceUpdate(secretName), + ExpectNonEmptyPlan: false, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "cluster", acc.ClusterName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "persistence", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "type", "Opaque"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "fields.#", "1"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_opaque.secret", "status", "created"), + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_opaque.secret", "last_updated_timestamp", func(value string) error { + if originalTS != value { + return fmt.Errorf("error timestamp has changed, indicates update was called again even though no modification of fields. exptected: %s, actual: %s", originalTS, value) + } + return nil + }), + ), + }, + { + ResourceName: "ibm_container_ingress_secret_opaque.secret", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"region", "issuer_name", "update_secret"}, }, }, }) @@ -134,3 +252,30 @@ resource "ibm_container_ingress_secret_opaque" "secret" { } }`, secretName, "ibm-cert-store", acc.ClusterName, true, acc.SecretCRN) } + +func testAccCheckIBMContainerIngressSecretOpaqueForceUpdateCreate(secretName string) string { + return fmt.Sprintf(` +resource "ibm_container_ingress_secret_opaque" "secret" { + secret_name = "%s" + secret_namespace = "%s" + cluster = "%s" + persistence = "%t" + fields { + crn = "%s" + } +}`, secretName, "ibm-cert-store", acc.ClusterName, true, acc.SecretCRN) +} + +func testAccCheckIBMContainerIngressSecretOpaqueForceUpdate(secretName string) string { + return fmt.Sprintf(` +resource "ibm_container_ingress_secret_opaque" "secret" { + secret_name = "%s" + secret_namespace = "%s" + cluster = "%s" + persistence = "%t" + update_secret = "%d" + fields { + crn = "%s" + } +}`, secretName, "ibm-cert-store", acc.ClusterName, true, 1, acc.SecretCRN) +} diff --git a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls.go b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls.go index aa7b4ec694..625e1d7286 100644 --- a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls.go +++ b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls.go @@ -44,6 +44,10 @@ func ResourceIBMContainerIngressSecretTLS() *schema.Resource { Required: true, Description: "Secret name", ForceNew: true, + ValidateFunc: validate.InvokeValidator( + "ibm_container_ingress_secret_tls", + "secret_name", + ), }, "secret_namespace": { Type: schema.TypeString, @@ -91,6 +95,11 @@ func ResourceIBMContainerIngressSecretTLS() *schema.Resource { Computed: true, Description: "Timestamp secret was last updated", }, + "update_secret": { + Type: schema.TypeInt, + Optional: true, + Description: "Updates secret from secrets manager if value is changed (increment each usage)", + }, }, } } @@ -106,6 +115,15 @@ func ResourceIBMContainerIngressSecretTLSValidator() *validate.ResourceValidator CloudDataType: "cluster", CloudDataRange: []string{"resolved_to:id"}}) + validateSchema = append(validateSchema, validate.ValidateSchema{ + Identifier: "secret_name", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$`, + MinValueLength: 1, + MaxValueLength: 63, + }) iBMContainerIngressInstanceValidator := validate.ResourceValidator{ResourceName: "ibm_container_ingress_secret_tls", Schema: validateSchema} return &iBMContainerIngressInstanceValidator } @@ -228,14 +246,20 @@ func resourceIBMContainerIngressSecretTLSUpdate(d *schema.ResourceData, meta int Namespace: secretNamespace, } + ingressAPI := ingressClient.Ingresses() if d.HasChange("cert_crn") { params.CRN = d.Get("cert_crn").(string) - ingressAPI := ingressClient.Ingresses() _, err := ingressAPI.UpdateIngressSecret(params) if err != nil { return err } + } else if d.HasChange("update_secret") { + // user wants to force an upstream secret update from secrets manager onto kube cluster w/out changing crn + _, err = ingressAPI.UpdateIngressSecret(params) + if err != nil { + return err + } } return resourceIBMContainerIngressSecretTLSRead(d, meta) diff --git a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls_test.go b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls_test.go index 36be6b606a..d2edc360de 100644 --- a/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls_test.go +++ b/ibm/service/kubernetes/resource_ibm_container_ingress_secret_tls_test.go @@ -5,6 +5,7 @@ package kubernetes_test import ( "fmt" + "regexp" "strings" "testing" @@ -64,7 +65,112 @@ func TestAccIBMContainerIngressSecretTLS_Basic(t *testing.T) { ResourceName: "ibm_container_ingress_secret_tls.secret", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"region", "issuer_name"}, + ImportStateVerifyIgnore: []string{"region", "issuer_name", "update_secret"}, + }, + }, + }) +} + +func TestAccIBMContainerIngressSecretTLS_InvalidName(t *testing.T) { + secretName := fmt.Sprintf("-)tf-container-ingress-secret-name-%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMContainerIngressSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMContainerIngressSecretTLSBasic(secretName), + ExpectError: regexp.MustCompile(".*should match regexp"), + }, + }, + }) +} + +// test ability to flip update_secret field to get upstream secret update from secrets manager instance via ingress API +func TestAccIBMContainerIngressSecretTLS_BasicForceUpdate(t *testing.T) { + secretName := fmt.Sprintf("tf-container-ingress-secret-name-%d", acctest.RandIntRange(10, 100)) + + var originalTS string + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMContainerIngressSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMContainerIngressSecretTLSBasic(secretName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "cluster", acc.ClusterName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "cert_crn", acc.CertCRN), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "persistence", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "type", "TLS"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "status", "created"), + + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_tls.secret", "last_updated_timestamp", func(value string) error { + originalTS = value + return nil + }), + ), + }, + { + Config: testAccCheckIBMContainerIngressSecretTLSForceUpdate(secretName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "cert_crn", acc.CertCRN), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "status", "created"), + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_tls.secret", "last_updated_timestamp", func(value string) error { + if originalTS == value { + return fmt.Errorf("error timestamp not changed, indicates update didnt go through. original: %s, actual: %s", originalTS, value) + } + originalTS = value // check if another update will execute without a change to `update_secret` + return nil + }), + ), + }, + { + Config: testAccCheckIBMContainerIngressSecretTLSForceUpdate(secretName), + ExpectNonEmptyPlan: false, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_name", secretName), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "secret_namespace", "ibm-cert-store"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "cert_crn", acc.CertCRN), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "user_managed", "true"), + resource.TestCheckResourceAttr( + "ibm_container_ingress_secret_tls.secret", "status", "created"), + resource.TestCheckResourceAttrWith("ibm_container_ingress_secret_tls.secret", "last_updated_timestamp", func(value string) error { + if originalTS != value { + return fmt.Errorf("error timestamp has changed, indicates update was called again even though no modification of fields. exptected: %s, actual: %s", originalTS, value) + } + return nil + }), + ), + }, + { + ResourceName: "ibm_container_ingress_secret_tls.secret", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"region", "issuer_name", "update_secret"}, }, }, }) @@ -121,3 +227,15 @@ resource "ibm_container_ingress_secret_tls" "secret" { persistence = "%t" }`, acc.ClusterName, secretName, "ibm-cert-store", acc.UpdatedCertCRN, true) } + +func testAccCheckIBMContainerIngressSecretTLSForceUpdate(secretName string) string { + return fmt.Sprintf(` +resource "ibm_container_ingress_secret_tls" "secret" { + cluster = "%s" + secret_name = "%s" + secret_namespace = "%s" + cert_crn = "%s" + persistence = "%t" + update_secret = "%d" +}`, acc.ClusterName, secretName, "ibm-cert-store", acc.CertCRN, true, 1) +} diff --git a/ibm/service/metricsrouter/data_source_ibm_metrics_router_targets.go b/ibm/service/metricsrouter/data_source_ibm_metrics_router_targets.go index d7c3cf7784..af6d852f87 100644 --- a/ibm/service/metricsrouter/data_source_ibm_metrics_router_targets.go +++ b/ibm/service/metricsrouter/data_source_ibm_metrics_router_targets.go @@ -50,7 +50,7 @@ func DataSourceIBMMetricsRouterTargets() *schema.Resource { "destination_crn": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The CRN of the destination service instance or resource.", + Description: "The CRN of the destination service instance or resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring&interface=ui#target-monitoring-ui) for details.", }, "target_type": &schema.Schema{ Type: schema.TypeString, diff --git a/ibm/service/metricsrouter/resource_ibm_metrics_router_target.go b/ibm/service/metricsrouter/resource_ibm_metrics_router_target.go index a23bc3408e..3ab0fe5941 100644 --- a/ibm/service/metricsrouter/resource_ibm_metrics_router_target.go +++ b/ibm/service/metricsrouter/resource_ibm_metrics_router_target.go @@ -36,7 +36,7 @@ func ResourceIBMMetricsRouterTarget() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validate.InvokeValidator("ibm_metrics_router_target", "destination_crn"), - Description: "The CRN of a destination service instance or resource.", + Description: "The CRN of a destination service instance or resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring&interface=ui#target-monitoring-ui) for details.", }, "region": &schema.Schema{ Type: schema.TypeString, diff --git a/ibm/service/power/data_source_ibm_pi_datacenter.go b/ibm/service/power/data_source_ibm_pi_datacenter.go new file mode 100644 index 0000000000..2404570273 --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_datacenter.go @@ -0,0 +1,94 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + DatacenterRegion = "region" + DatacenterType = "type" + DatacenterUrl = "url" +) + +func DataSourceIBMPIDatacenter() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIDatacenterRead, + Schema: map[string]*schema.Schema{ + Arg_DatacenterZone: { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.NoZeroValues, + }, + Attr_DatacenterCapabilities: { + Type: schema.TypeMap, + Computed: true, + Description: "Datacenter Capabilities", + Elem: &schema.Schema{ + Type: schema.TypeBool, + }, + }, + Attr_DatacenterHref: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter href", + }, + Attr_DatacenterLocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Datacenter location", + }, + Attr_DatacenterStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter status", + }, + Attr_DatacenterType: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter type", + }, + }, + } +} +func dataSourceIBMPIDatacenterRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // session + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + datacenterZone := sess.Options.Zone + if region, ok := d.GetOk(Arg_DatacenterZone); ok { + datacenterZone = region.(string) + } + client := instance.NewIBMPIDatacenterClient(ctx, sess, "") + dcData, err := client.Get(datacenterZone) + if err != nil { + return diag.FromErr(err) + } + var genID, _ = uuid.GenerateUUID() + d.SetId(genID) + d.Set(Attr_DatacenterCapabilities, dcData.Capabilities) + dclocation := map[string]interface{}{ + DatacenterRegion: *dcData.Location.Region, + DatacenterType: *dcData.Location.Type, + DatacenterUrl: *dcData.Location.URL, + } + d.Set(Attr_DatacenterLocation, flex.Flatten(dclocation)) + d.Set(Attr_DatacenterStatus, dcData.Status) + d.Set(Attr_DatacenterType, dcData.Type) + d.Set(Attr_DatacenterHref, dcData.Href) + + return nil +} diff --git a/ibm/service/power/data_source_ibm_pi_datacenter_test.go b/ibm/service/power/data_source_ibm_pi_datacenter_test.go new file mode 100644 index 0000000000..cc289ca32d --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_datacenter_test.go @@ -0,0 +1,35 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMPIDatacenterDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMPIDatacenterDataSourceConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_pi_datacenter.test", "id"), + ), + }, + }, + }) +} + +func testAccCheckIBMPIDatacenterDataSourceConfig() string { + return fmt.Sprintf(` + data "ibm_pi_datacenter" "test" { + pi_datacenter_zone = "dal12" + } + `) +} diff --git a/ibm/service/power/data_source_ibm_pi_datacenters.go b/ibm/service/power/data_source_ibm_pi_datacenters.go new file mode 100644 index 0000000000..949ba4741a --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_datacenters.go @@ -0,0 +1,97 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + Datacenters = "datacenters" +) + +func DataSourceIBMPIDatacenters() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIDatacentersRead, + Schema: map[string]*schema.Schema{ + Datacenters: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + Attr_DatacenterCapabilities: { + Type: schema.TypeMap, + Computed: true, + Description: "Datacenter Capabilities", + Elem: &schema.Schema{ + Type: schema.TypeBool, + }, + }, + Attr_DatacenterHref: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter href", + }, + Attr_DatacenterLocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Datacenter location", + }, + Attr_DatacenterStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter status", + }, + Attr_DatacenterType: { + Type: schema.TypeString, + Computed: true, + Description: "Datacenter type", + }, + }, + }, + }, + }, + } +} +func dataSourceIBMPIDatacentersRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // session + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + client := instance.NewIBMPIDatacenterClient(ctx, sess, "") + datacentersData, err := client.GetAll() + if err != nil { + return diag.FromErr(err) + } + datacenters := make([]map[string]interface{}, 0, len(datacentersData.Datacenters)) + for _, datacenter := range datacentersData.Datacenters { + if datacenter != nil { + dc := map[string]interface{}{ + Attr_DatacenterCapabilities: datacenter.Capabilities, + Attr_DatacenterLocation: map[string]interface{}{ + DatacenterRegion: datacenter.Location.Region, + DatacenterType: datacenter.Location.Type, + DatacenterUrl: datacenter.Location.URL, + }, + Attr_DatacenterStatus: datacenter.Status, + Attr_DatacenterType: datacenter.Type, + Attr_DatacenterHref: datacenter.Href, + } + datacenters = append(datacenters, dc) + } + + } + var clientgenU, _ = uuid.GenerateUUID() + d.SetId(clientgenU) + d.Set(Datacenters, datacenters) + return nil +} diff --git a/ibm/service/power/data_source_ibm_pi_datacenters_test.go b/ibm/service/power/data_source_ibm_pi_datacenters_test.go new file mode 100644 index 0000000000..21271d7d54 --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_datacenters_test.go @@ -0,0 +1,31 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMPIDatacentersDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMPIDatacentersDataSourceConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_pi_datacenters.test", "id"), + ), + }, + }, + }) +} + +func testAccCheckIBMPIDatacentersDataSourceConfig() string { + return fmt.Sprintf(`data "ibm_pi_datacenters" "test" {}`) +} diff --git a/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go index f48c7696ae..84500c05d0 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go @@ -54,6 +54,11 @@ func DataSourceIBMPIStoragePoolCapacity() *schema.Resource { Computed: true, Description: "Total pool capacity (GB)", }, + ReplicationEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Replication status of the storage pool", + }, }, } } @@ -75,10 +80,9 @@ func dataSourceIBMPIStoragePoolCapacityRead(ctx context.Context, d *schema.Resou } d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, storagePool)) - d.Set(MaxAllocationSize, *sp.MaxAllocationSize) d.Set(StorageType, sp.StorageType) d.Set(TotalCapacity, sp.TotalCapacity) - + d.Set(ReplicationEnabled, *sp.ReplicationEnabled) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go index bd3f3a7a7c..4e64ec5209 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go @@ -28,6 +28,7 @@ const ( StoragePool = "storage_pool" StorageType = "storage_type" TotalCapacity = "total_capacity" + ReplicationEnabled = "replication_enabled" ) func DataSourceIBMPIStoragePoolsCapacity() *schema.Resource { @@ -71,6 +72,11 @@ func DataSourceIBMPIStoragePoolsCapacity() *schema.Resource { Computed: true, Description: "Total pool capacity (GB)", }, + ReplicationEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Replication status of the storage pool", + }, }, }, }, @@ -79,6 +85,7 @@ func DataSourceIBMPIStoragePoolsCapacity() *schema.Resource { } func dataSourceIBMPIStoragePoolsCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) @@ -109,11 +116,13 @@ func dataSourceIBMPIStoragePoolsCapacityRead(ctx context.Context, d *schema.Reso result := make([]map[string]interface{}, 0, len(spc.StoragePoolsCapacity)) for _, sp := range spc.StoragePoolsCapacity { data := map[string]interface{}{ - MaxAllocationSize: *sp.MaxAllocationSize, - PoolName: sp.PoolName, - StorageType: sp.StorageType, - TotalCapacity: sp.TotalCapacity, + MaxAllocationSize: *sp.MaxAllocationSize, + PoolName: sp.PoolName, + StorageType: sp.StorageType, + TotalCapacity: sp.TotalCapacity, + ReplicationEnabled: *sp.ReplicationEnabled, } + result = append(result, data) } d.Set(StoragePoolsCapacity, result) diff --git a/ibm/service/power/data_source_ibm_pi_workspace.go b/ibm/service/power/data_source_ibm_pi_workspace.go new file mode 100644 index 0000000000..6fb23303ea --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_workspace.go @@ -0,0 +1,103 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + WorkspaceCreationDate = "creation_date" + WorkspaceCRN = "crn" + WorkspaceRegion = "region" + WorkspaceType = "type" + WorkspaceUrl = "url" +) + +func DatasourceIBMPIWorkspace() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIWorkspaceRead, + Schema: map[string]*schema.Schema{ + Arg_CloudInstanceID: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + Attr_WorkspaceCapabilities: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace Capabilities", + Elem: &schema.Schema{ + Type: schema.TypeBool, + }, + }, + Attr_WorkspaceDetails: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace information", + }, + Attr_WorkspaceLocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace location", + }, + Attr_WorkspaceName: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace name", + }, + Attr_WorkspaceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace status", + }, + Attr_WorkspaceType: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace type", + }, + }, + } +} + +func dataSourceIBMPIWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // session + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + client := instance.NewIBMPIWorkspacesClient(ctx, sess, cloudInstanceID) + wsData, err := client.Get(cloudInstanceID) + if err != nil { + return diag.FromErr(err) + } + + d.Set(Attr_WorkspaceName, wsData.Name) + d.Set(Attr_WorkspaceStatus, wsData.Status) + d.Set(Attr_WorkspaceType, wsData.Type) + d.Set(Attr_WorkspaceCapabilities, wsData.Capabilities) + wsdetails := map[string]interface{}{ + WorkspaceCreationDate: wsData.Details.CreationDate.String(), + WorkspaceCRN: *wsData.Details.Crn, + } + d.Set(Attr_WorkspaceDetails, flex.Flatten(wsdetails)) + wslocation := map[string]interface{}{ + WorkspaceRegion: *wsData.Location.Region, + WorkspaceType: wsData.Location.Type, + WorkspaceUrl: wsData.Location.URL, + } + d.Set(Attr_WorkspaceLocation, flex.Flatten(wslocation)) + d.SetId(*wsData.ID) + return nil +} diff --git a/ibm/service/power/data_source_ibm_pi_workspace_test.go b/ibm/service/power/data_source_ibm_pi_workspace_test.go new file mode 100644 index 0000000000..b2adea8072 --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_workspace_test.go @@ -0,0 +1,34 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMPIWorkspaceDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMPIWorkspaceDataSourceConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_pi_workspace.test", "pi_workspace_name"), + ), + }, + }, + }) +} +func testAccCheckIBMPIWorkspaceDataSourceConfig() string { + return fmt.Sprintf(` + data "ibm_pi_workspace" "test" { + pi_cloud_instance_id = "%s" + } + `, acc.Pi_cloud_instance_id) +} diff --git a/ibm/service/power/data_source_ibm_pi_workspaces.go b/ibm/service/power/data_source_ibm_pi_workspaces.go new file mode 100644 index 0000000000..c66e924b63 --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_workspaces.go @@ -0,0 +1,120 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + Workspaces = "workspaces" +) + +func DatasourceIBMPIWorkspaces() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIWorkspacesRead, + Schema: map[string]*schema.Schema{ + Arg_CloudInstanceID: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + Workspaces: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + Attr_WorkspaceCapabilities: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace Capabilities", + Elem: &schema.Schema{ + Type: schema.TypeBool, + }, + }, + Attr_WorkspaceDetails: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace information", + }, + Attr_WorkspaceID: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace ID", + }, + Attr_WorkspaceLocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Workspace location", + }, + Attr_WorkspaceName: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace name", + }, + Attr_WorkspaceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace status", + }, + Attr_WorkspaceType: { + Type: schema.TypeString, + Computed: true, + Description: "Workspace type", + }, + }, + }, + }, + }, + } +} +func dataSourceIBMPIWorkspacesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // session + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + client := instance.NewIBMPIWorkspacesClient(ctx, sess, cloudInstanceID) + wsData, err := client.GetAll() + if err != nil { + return diag.FromErr(err) + } + workspaces := make([]map[string]interface{}, 0, len(wsData.Workspaces)) + for _, ws := range wsData.Workspaces { + if ws != nil { + workspace := map[string]interface{}{ + Attr_WorkspaceName: ws.Name, + Attr_WorkspaceID: ws.ID, + Attr_WorkspaceStatus: ws.Status, + Attr_WorkspaceType: ws.Type, + Attr_WorkspaceCapabilities: ws.Capabilities, + Attr_WorkspaceDetails: map[string]interface{}{ + WorkspaceCreationDate: ws.Details.CreationDate.String(), + WorkspaceCRN: *ws.Details.Crn, + }, + Attr_WorkspaceLocation: map[string]interface{}{ + WorkspaceRegion: *ws.Location.Region, + WorkspaceType: ws.Location.Type, + WorkspaceUrl: ws.Location.URL, + }, + } + workspaces = append(workspaces, workspace) + } + } + var clientgenU, _ = uuid.GenerateUUID() + d.SetId(clientgenU) + d.Set(Workspaces, workspaces) + return nil +} diff --git a/ibm/service/power/data_source_ibm_pi_workspaces_test.go b/ibm/service/power/data_source_ibm_pi_workspaces_test.go new file mode 100644 index 0000000000..076d65a342 --- /dev/null +++ b/ibm/service/power/data_source_ibm_pi_workspaces_test.go @@ -0,0 +1,35 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power_test + +import ( + "fmt" + "testing" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccIBMPIWorkspacesDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMPIWorkspacesDataSourceConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_pi_workspaces.test", "id"), + ), + }, + }, + }) +} + +func testAccCheckIBMPIWorkspacesDataSourceConfig() string { + return fmt.Sprintf(` + data "ibm_pi_workspaces" "test" { + pi_cloud_instance_id = "%s" + } + `, acc.Pi_cloud_instance_id) +} diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 40e8dbf0a5..ee62773462 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -148,4 +148,21 @@ const ( StatusPending = "PENDING" SctionStart = "start" SctionStop = "stop" + + // Workspaces + Attr_WorkspaceCapabilities = "pi_workspace_capabilities" + Attr_WorkspaceDetails = "pi_workspace_details" + Attr_WorkspaceID = "pi_workspace_id" + Attr_WorkspaceLocation = "pi_workspace_location" + Attr_WorkspaceName = "pi_workspace_name" + Attr_WorkspaceStatus = "pi_workspace_status" + Attr_WorkspaceType = "pi_workspace_type" + + // Datacenter + Arg_DatacenterZone = "pi_datacenter_zone" + Attr_DatacenterCapabilities = "pi_datacenter_capabilities" + Attr_DatacenterLocation = "pi_datacenter_location" + Attr_DatacenterStatus = "pi_datacenter_status" + Attr_DatacenterType = "pi_datacenter_type" + Attr_DatacenterHref = "pi_datacenter_href" ) diff --git a/ibm/service/scc/data_source_ibm_scc_provider_type_collection.go b/ibm/service/scc/data_source_ibm_scc_provider_type_collection.go index 6cd8ad1e0f..35c21de13d 100644 --- a/ibm/service/scc/data_source_ibm_scc_provider_type_collection.go +++ b/ibm/service/scc/data_source_ibm_scc_provider_type_collection.go @@ -19,7 +19,7 @@ import ( ) func DataSourceIbmSccProviderTypeCollection() *schema.Resource { - return &schema.Resource{ + return AddSchemaData(&schema.Resource{ ReadContext: dataSourceIbmSccProviderTypeCollectionRead, Schema: map[string]*schema.Schema{ @@ -115,7 +115,7 @@ func DataSourceIbmSccProviderTypeCollection() *schema.Resource { }, }, }, - } + }) } func dataSourceIbmSccProviderTypeCollectionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -125,6 +125,7 @@ func dataSourceIbmSccProviderTypeCollectionRead(context context.Context, d *sche } listProviderTypesOptions := &securityandcompliancecenterapiv3.ListProviderTypesOptions{} + listProviderTypesOptions.SetInstanceID(d.Get("instance_id").(string)) providerTypesCollection, response, err := securityAndComplianceCenterApIsClient.ListProviderTypesWithContext(context, listProviderTypesOptions) if err != nil { diff --git a/ibm/service/scc/data_source_ibm_scc_provider_type_collection_test.go b/ibm/service/scc/data_source_ibm_scc_provider_type_collection_test.go index b6a6969e9b..8838d2a0d0 100644 --- a/ibm/service/scc/data_source_ibm_scc_provider_type_collection_test.go +++ b/ibm/service/scc/data_source_ibm_scc_provider_type_collection_test.go @@ -18,7 +18,7 @@ func TestAccIbmSccProviderTypeCollectionDataSourceBasic(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIbmSccProviderTypeCollectionDataSourceConfigBasic(), + Config: testAccCheckIbmSccProviderTypeCollectionDataSourceConfigBasic(acc.SccInstanceID), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_scc_provider_type_collection.scc_provider_type_collection_instance", "id"), ), @@ -27,9 +27,10 @@ func TestAccIbmSccProviderTypeCollectionDataSourceBasic(t *testing.T) { }) } -func testAccCheckIbmSccProviderTypeCollectionDataSourceConfigBasic() string { +func testAccCheckIbmSccProviderTypeCollectionDataSourceConfigBasic(instanceID string) string { return fmt.Sprintf(` data "ibm_scc_provider_type_collection" "scc_provider_type_collection_instance" { + instance_id = "%s" } - `) + `, instanceID) } diff --git a/ibm/service/scc/resource_ibm_scc_profile.go b/ibm/service/scc/resource_ibm_scc_profile.go index 0ba57cdf76..c48be7df14 100644 --- a/ibm/service/scc/resource_ibm_scc_profile.go +++ b/ibm/service/scc/resource_ibm_scc_profile.go @@ -58,12 +58,12 @@ func ResourceIbmSccProfile() *schema.Resource { Schema: map[string]*schema.Schema{ "control_library_id": { Type: schema.TypeString, - Optional: true, + Required: true, Description: "The ID of the control library that contains the profile.", }, "control_id": { Type: schema.TypeString, - Optional: true, + Required: true, Description: "The unique ID of the control inside the control library.", }, "control_library_version": { @@ -267,6 +267,7 @@ func ResourceIbmSccProfile() *schema.Resource { "profile_version": { Type: schema.TypeString, Computed: true, + Optional: true, Description: "The version status of the profile.", }, "version_group_label": { @@ -274,11 +275,6 @@ func ResourceIbmSccProfile() *schema.Resource { Computed: true, Description: "The version group label of the profile.", }, - "instance_id": { - Type: schema.TypeString, - Computed: true, - Description: "The instance ID.", - }, "latest": { Type: schema.TypeBool, Computed: true, @@ -372,6 +368,8 @@ func resourceIbmSccProfileCreate(context context.Context, d *schema.ResourceData bodyModelMap["profile_type"] = "custom" if _, ok := d.GetOk("controls"); ok { bodyModelMap["controls"] = d.Get("controls") + } else { + bodyModelMap["controls"] = []interface{}{} } if _, ok := d.GetOk("default_parameters"); ok { bodyModelMap["default_parameters"] = d.Get("default_parameters") @@ -553,7 +551,9 @@ func resourceIbmSccProfileUpdate(context context.Context, d *schema.ResourceData if d.HasChange("profile_description") { hasChange = true } - + if d.HasChange("profile_version") { + hasChange = true + } if hasChange { if _, ok := d.GetOk("controls"); ok { bodyModelMap["controls"] = d.Get("controls") @@ -567,14 +567,16 @@ func resourceIbmSccProfileUpdate(context context.Context, d *schema.ResourceData if _, ok := d.GetOk("profile_description"); ok { bodyModelMap["profile_description"] = d.Get("profile_description") } - + if _, ok := d.GetOk("profile_version"); ok { + bodyModelMap["profile_version"] = d.Get("profile_version") + } convertedModel, err := resourceIbmSccProfileMapToReplaceProfileOptions(bodyModelMap) if err != nil { return diag.FromErr(err) } replaceProfileOptions = convertedModel - replaceProfileOptions.SetProfileID(d.Id()) + replaceProfileOptions.SetProfileID(d.Get("profile_id").(string)) _, response, err := securityandcompliancecenterapiClient.ReplaceProfileWithContext(context, replaceProfileOptions) if err != nil { log.Printf("[DEBUG] ReplaceProfileWithContext failed %s\n%s", err, response) @@ -670,6 +672,8 @@ func resourceIbmSccProfileMapToProfilePrototype(modelMap map[string]interface{}) } } model.DefaultParameters = defaultParameters + // TODO: Validate all the Controls have default Parameters for any parameters found + // Use the instance_id associated return model, nil } @@ -678,6 +682,7 @@ func resourceIbmSccProfileMapToReplaceProfileOptions(modelMap map[string]interfa model.ProfileName = core.StringPtr(modelMap["profile_name"].(string)) model.ProfileDescription = core.StringPtr(modelMap["profile_description"].(string)) model.ProfileType = core.StringPtr(modelMap["profile_type"].(string)) + model.ProfileVersion = core.StringPtr(modelMap["profile_version"].(string)) controls := []securityandcompliancecenterapiv3.ProfileControlsPrototype{} for _, controlsItem := range modelMap["controls"].([]interface{}) { controlsItemModel, err := resourceIbmSccProfileMapToProfileControlsPrototype(controlsItem.(map[string]interface{})) diff --git a/ibm/service/scc/resource_ibm_scc_profile_test.go b/ibm/service/scc/resource_ibm_scc_profile_test.go index 7823df8ad0..0708724cbd 100644 --- a/ibm/service/scc/resource_ibm_scc_profile_test.go +++ b/ibm/service/scc/resource_ibm_scc_profile_test.go @@ -59,6 +59,7 @@ func TestAccIbmSccProfileAllArgs(t *testing.T) { profileType := "custom" profileNameUpdate := profileName profileDescriptionUpdate := profileDescription + profileVersion := "0.0.0" profileTypeUpdate := profileType resource.Test(t, resource.TestCase{ @@ -73,6 +74,7 @@ func TestAccIbmSccProfileAllArgs(t *testing.T) { resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_name", profileName), resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_description", profileDescription), resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_type", profileType), + resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_version", profileVersion), ), }, resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccIbmSccProfileAllArgs(t *testing.T) { resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_name", profileNameUpdate), resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_description", profileDescriptionUpdate), resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_type", profileTypeUpdate), + resource.TestCheckResourceAttr("ibm_scc_profile.scc_profile_instance", "profile_version", profileVersion), ), }, resource.TestStep{ @@ -197,6 +200,7 @@ func testAccCheckIbmSccProfileConfig(instanceID string, profileName string, prof profile_name = "%s" profile_description = "%s" profile_type = "%s" + profile_version = "0.0.0" controls { control_library_id = resource.ibm_scc_control_library.scc_control_library_instance.control_library_id control_id = resource.ibm_scc_control_library.scc_control_library_instance.controls[0].control_id diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent.go b/ibm/service/schematics/data_source_ibm_schematics_agent.go new file mode 100644 index 0000000000..a5c21acfd5 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent.go @@ -0,0 +1,972 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsAgent() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsAgentRead, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Agent ID to get the details of agent.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name of the agent (must be unique, for an account).", + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent description.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource-group name for the agent. By default, agent will be registered in Default Resource Group.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Tags for the agent.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "schematics_location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "agent_location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The location where agent is deployed in the user environment.", + }, + "agent_infrastructure": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The infrastructure parameters used by the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "infra_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Type of target agent infrastructure.", + }, + "cluster_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The cluster ID where agent services will be running.", + }, + "cluster_resource_group": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource group of the cluster (is it required?).", + }, + "cos_instance_name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The COS instance name to store the agent logs.", + }, + "cos_bucket_name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The COS bucket name used to store the logs.", + }, + "cos_bucket_region": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The COS bucket region.", + }, + }, + }, + }, + "agent_metadata": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The metadata of an agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the metadata.", + }, + "value": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Value of the metadata name.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "agent_inputs": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Additional input variables for the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name of the variable. For example, `name = \"inventory username\"`.", + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The value for the variable or reference to the value. For example, `value = \"\"`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls.", + }, + "use_default": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used.", + }, + "metadata": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "An user editable metadata for the variables.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Type of the variable.", + }, + "aliases": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The list of aliases for the variable name.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The description of the meta data.", + }, + "cloud_data_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Cloud data type of the variable. eg. resource_group_id, region, vpc_id.", + }, + "default_value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Default value for the variable only if the override value is not specified.", + }, + "link_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The status of the link.", + }, + "secure": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Is the variable secure or sensitive ?.", + }, + "immutable": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Is the variable readonly ?.", + }, + "hidden": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "If **true**, the variable is not displayed on UI or Command line.", + }, + "required": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "If the variable required?.", + }, + "options": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "min_value": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The minimum value of the variable. Applicable for the integer type.", + }, + "max_value": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The maximum value of the variable. Applicable for the integer type.", + }, + "min_length": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The minimum length of the variable value. Applicable for the string type.", + }, + "max_length": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The maximum length of the variable value. Applicable for the string type.", + }, + "matches": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The regex for the variable value.", + }, + "position": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The relative position of this variable in a list.", + }, + "group_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The display name of the group this variable belongs to.", + }, + "source": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The source of this meta-data.", + }, + }, + }, + }, + "link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The reference link to the variable value By default the expression points to `$self.value`.", + }, + }, + }, + }, + "user_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "User defined status of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "agent_crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent crn, obtained from the Schematics agent deployment configuration.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent resource id.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent creation date-time.", + }, + "creation_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The email address of an user who created the agent.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent registration updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who updated the agent registration.", + }, + "system_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Computed state of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent Status.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent status message.", + }, + }, + }, + }, + "agent_kpi": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Schematics Agent key performance indicators.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "availability_indicator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Overall availability indicator reported by the agent.", + }, + "lifecycle_indicator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Overall lifecycle indicator reported by the agents.", + }, + "percent_usage_indicator": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Percentage usage of the agent resources.", + }, + "application_indicators": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Agent application key performance indicators.", + Elem: &schema.Schema{ + Type: schema.TypeMap, + }, + }, + "infra_indicators": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Agent infrastructure key performance indicators.", + Elem: &schema.Schema{ + Type: schema.TypeMap, + }, + }, + }, + }, + }, + "recent_prs_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Run a pre-requisite scanner for deploying agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent prs job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent prs job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the pre-requisite scanner job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the pre-requisite scanner job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full pre-requisite scanner job logs.", + }, + }, + }, + }, + "recent_deploy_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Post-installations checks for Agent health.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent deploy job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent deploy job.", + }, + "is_redeployed": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "True, when the same version of the agent was redeployed.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the agent deployment job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the agent deployment job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full agent deployment job logs.", + }, + }, + }, + }, + "recent_health_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Agent health check.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent health check job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent health check job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the health-check job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the health-check job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full health-check job logs.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIbmSchematicsAgentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s", *getAgentDataOptions.AgentID)) + + if err = d.Set("name", agentData.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + + if err = d.Set("description", agentData.Description); err != nil { + return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + } + + if err = d.Set("resource_group", agentData.ResourceGroup); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + } + + if err = d.Set("version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) + } + + if err = d.Set("schematics_location", agentData.SchematicsLocation); err != nil { + return diag.FromErr(fmt.Errorf("Error setting schematics_location: %s", err)) + } + + if err = d.Set("agent_location", agentData.AgentLocation); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_location: %s", err)) + } + + agentInfrastructure := []map[string]interface{}{} + if agentData.AgentInfrastructure != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentInfrastructureToMap(agentData.AgentInfrastructure) + if err != nil { + return diag.FromErr(err) + } + agentInfrastructure = append(agentInfrastructure, modelMap) + } + if err = d.Set("agent_infrastructure", agentInfrastructure); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_infrastructure %s", err)) + } + + agentMetadata := []map[string]interface{}{} + if agentData.AgentMetadata != nil { + for _, modelItem := range agentData.AgentMetadata { + modelMap, err := dataSourceIbmSchematicsAgentAgentMetadataInfoToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + agentMetadata = append(agentMetadata, modelMap) + } + } + if err = d.Set("agent_metadata", agentMetadata); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_metadata %s", err)) + } + + agentInputs := []map[string]interface{}{} + if agentData.AgentInputs != nil { + for _, modelItem := range agentData.AgentInputs { + modelMap, err := dataSourceIbmSchematicsAgentVariableDataToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + agentInputs = append(agentInputs, modelMap) + } + } + if err = d.Set("agent_inputs", agentInputs); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_inputs %s", err)) + } + + userState := []map[string]interface{}{} + if agentData.UserState != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentUserStateToMap(agentData.UserState) + if err != nil { + return diag.FromErr(err) + } + userState = append(userState, modelMap) + } + if err = d.Set("user_state", userState); err != nil { + return diag.FromErr(fmt.Errorf("Error setting user_state %s", err)) + } + + if err = d.Set("agent_crn", agentData.AgentCrn); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_crn: %s", err)) + } + + if err = d.Set("id", agentData.ID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + } + + if err = d.Set("created_at", flex.DateTimeToString(agentData.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if err = d.Set("creation_by", agentData.CreationBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting creation_by: %s", err)) + } + + if err = d.Set("updated_at", flex.DateTimeToString(agentData.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + + if err = d.Set("updated_by", agentData.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + + systemState := []map[string]interface{}{} + if agentData.SystemState != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentSystemStatusToMap(agentData.SystemState) + if err != nil { + return diag.FromErr(err) + } + systemState = append(systemState, modelMap) + } + if err = d.Set("system_state", systemState); err != nil { + return diag.FromErr(fmt.Errorf("Error setting system_state %s", err)) + } + + agentKpi := []map[string]interface{}{} + if agentData.AgentKpi != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentKPIDataToMap(agentData.AgentKpi) + if err != nil { + return diag.FromErr(err) + } + agentKpi = append(agentKpi, modelMap) + } + if err = d.Set("agent_kpi", agentKpi); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_kpi %s", err)) + } + + recentPrsJob := []map[string]interface{}{} + if agentData.RecentPrsJob != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentDataRecentPrsJobToMap(agentData.RecentPrsJob) + if err != nil { + return diag.FromErr(err) + } + recentPrsJob = append(recentPrsJob, modelMap) + } + if err = d.Set("recent_prs_job", recentPrsJob); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_prs_job %s", err)) + } + + recentDeployJob := []map[string]interface{}{} + if agentData.RecentDeployJob != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentDataRecentDeployJobToMap(agentData.RecentDeployJob) + if err != nil { + return diag.FromErr(err) + } + recentDeployJob = append(recentDeployJob, modelMap) + } + if err = d.Set("recent_deploy_job", recentDeployJob); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_deploy_job %s", err)) + } + + recentHealthJob := []map[string]interface{}{} + if agentData.RecentHealthJob != nil { + modelMap, err := dataSourceIbmSchematicsAgentAgentDataRecentHealthJobToMap(agentData.RecentHealthJob) + if err != nil { + return diag.FromErr(err) + } + recentHealthJob = append(recentHealthJob, modelMap) + } + if err = d.Set("recent_health_job", recentHealthJob); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_health_job %s", err)) + } + + return nil +} + +func dataSourceIbmSchematicsAgentAgentInfrastructureToMap(model *schematicsv1.AgentInfrastructure) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.InfraType != nil { + modelMap["infra_type"] = *model.InfraType + } + if model.ClusterID != nil { + modelMap["cluster_id"] = *model.ClusterID + } + if model.ClusterResourceGroup != nil { + modelMap["cluster_resource_group"] = *model.ClusterResourceGroup + } + if model.CosInstanceName != nil { + modelMap["cos_instance_name"] = *model.CosInstanceName + } + if model.CosBucketName != nil { + modelMap["cos_bucket_name"] = *model.CosBucketName + } + if model.CosBucketRegion != nil { + modelMap["cos_bucket_region"] = *model.CosBucketRegion + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentMetadataInfoToMap(model *schematicsv1.AgentMetadataInfo) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = *model.Name + } + if model.Value != nil { + modelMap["value"] = model.Value + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentVariableDataToMap(model *schematicsv1.VariableData) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = *model.Name + } + if model.Value != nil { + modelMap["value"] = *model.Value + } + if model.UseDefault != nil { + modelMap["use_default"] = *model.UseDefault + } + if model.Metadata != nil { + metadataMap, err := dataSourceIbmSchematicsAgentVariableMetadataToMap(model.Metadata) + if err != nil { + return modelMap, err + } + modelMap["metadata"] = []map[string]interface{}{metadataMap} + } + if model.Link != nil { + modelMap["link"] = *model.Link + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentVariableMetadataToMap(model *schematicsv1.VariableMetadata) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Type != nil { + modelMap["type"] = *model.Type + } + if model.Aliases != nil { + modelMap["aliases"] = model.Aliases + } + if model.Description != nil { + modelMap["description"] = *model.Description + } + if model.CloudDataType != nil { + modelMap["cloud_data_type"] = *model.CloudDataType + } + if model.DefaultValue != nil { + modelMap["default_value"] = *model.DefaultValue + } + if model.LinkStatus != nil { + modelMap["link_status"] = *model.LinkStatus + } + if model.Secure != nil { + modelMap["secure"] = *model.Secure + } + if model.Immutable != nil { + modelMap["immutable"] = *model.Immutable + } + if model.Hidden != nil { + modelMap["hidden"] = *model.Hidden + } + if model.Required != nil { + modelMap["required"] = *model.Required + } + if model.Options != nil { + modelMap["options"] = model.Options + } + if model.MinValue != nil { + modelMap["min_value"] = *model.MinValue + } + if model.MaxValue != nil { + modelMap["max_value"] = *model.MaxValue + } + if model.MinLength != nil { + modelMap["min_length"] = *model.MinLength + } + if model.MaxLength != nil { + modelMap["max_length"] = *model.MaxLength + } + if model.Matches != nil { + modelMap["matches"] = *model.Matches + } + if model.Position != nil { + modelMap["position"] = *model.Position + } + if model.GroupBy != nil { + modelMap["group_by"] = *model.GroupBy + } + if model.Source != nil { + modelMap["source"] = *model.Source + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentUserStateToMap(model *schematicsv1.AgentUserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.SetBy != nil { + modelMap["set_by"] = *model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentSystemStatusToMap(model *schematicsv1.AgentSystemStatus) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.StatusCode != nil { + modelMap["status_code"] = *model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = *model.StatusMessage + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentKPIDataToMap(model *schematicsv1.AgentKPIData) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AvailabilityIndicator != nil { + modelMap["availability_indicator"] = *model.AvailabilityIndicator + } + if model.LifecycleIndicator != nil { + modelMap["lifecycle_indicator"] = *model.LifecycleIndicator + } + if model.PercentUsageIndicator != nil { + modelMap["percent_usage_indicator"] = *model.PercentUsageIndicator + } + if model.ApplicationIndicators != nil { + } + if model.InfraIndicators != nil { + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentDataRecentPrsJobToMap(model *schematicsv1.AgentDataRecentPrsJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = *model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = *model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = *model.UpdatedBy + } + if model.AgentVersion != nil { + modelMap["agent_version"] = *model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = *model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = *model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = *model.LogURL + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentDataRecentDeployJobToMap(model *schematicsv1.AgentDataRecentDeployJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = *model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = *model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = *model.UpdatedBy + } + if model.IsRedeployed != nil { + modelMap["is_redeployed"] = *model.IsRedeployed + } + if model.AgentVersion != nil { + modelMap["agent_version"] = *model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = *model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = *model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = *model.LogURL + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentAgentDataRecentHealthJobToMap(model *schematicsv1.AgentDataRecentHealthJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = *model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = *model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = *model.UpdatedBy + } + if model.AgentVersion != nil { + modelMap["agent_version"] = *model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = *model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = *model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = *model.LogURL + } + return modelMap, nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go new file mode 100644 index 0000000000..7fa062e5b4 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go @@ -0,0 +1,132 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsAgentDeploy() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsAgentDeployRead, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Agent ID to get the details of agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent deploy job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent deploy job.", + }, + "is_redeployed": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "True, when the same version of the agent was redeployed.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the agent deployment job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the agent deployment job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full agent deployment job logs.", + }, + }, + } +} + +func dataSourceIbmSchematicsAgentDeployRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId(DataSourceIBMSchematicsAgentID(d)) + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + d.SetId(DataSourceIBMSchematicsAgentID(d)) + + if agentData.RecentDeployJob != nil { + + if err = d.Set("agent_id", getAgentDataOptions.AgentID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentDeployJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } else if agentData.RecentDeployJob.JobID != nil { + d.SetId(fmt.Sprintf("%s", *agentData.RecentDeployJob.JobID)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentDeployJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentDeployJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("is_redeployed", agentData.RecentDeployJob.IsRedeployed); err != nil { + return diag.FromErr(fmt.Errorf("Error setting is_redeployed: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentDeployJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentDeployJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentDeployJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + return nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_deploy_test.go b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy_test.go new file mode 100644 index 0000000000..dc89e8d162 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy_test.go @@ -0,0 +1,84 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsAgentDeployDataSourceBasic(t *testing.T) { + agentDeployJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDeployDataSourceConfigBasic(agentDeployJobAgentID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_id"), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentDeployDataSourceAllArgs(t *testing.T) { + agentDeployJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + agentDeployJobForce := "false" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDeployDataSourceConfig(agentDeployJobAgentID, agentDeployJobForce), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "job_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "updated_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "is_redeployed"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_version"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "status_code"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "status_message"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "log_url"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentDeployDataSourceConfigBasic(agentDeployJobAgentID string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = "%s" + } + data "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = ibm_schematics_agent_deploy.schematics_agent_deploy_instance.agent_id + } + `, agentDeployJobAgentID) +} + +func testAccCheckIbmSchematicsAgentDeployDataSourceConfig(agentDeployJobAgentID string, agentDeployJobForce string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = "%s" + force = %s + } + + data "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = ibm_schematics_agent_deploy.schematics_agent_deploy_instance.agent_id + } + `, agentDeployJobAgentID, agentDeployJobForce) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_health.go b/ibm/service/schematics/data_source_ibm_schematics_agent_health.go new file mode 100644 index 0000000000..87ea05609d --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_health.go @@ -0,0 +1,124 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsAgentHealth() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsAgentHealthRead, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Agent ID to get the details of agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent health check job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent health check job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the health-check job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the health-check job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full health-check job logs.", + }, + }, + } +} + +func dataSourceIbmSchematicsAgentHealthRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId(DataSourceIBMSchematicsAgentID(d)) + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + d.SetId(DataSourceIBMSchematicsAgentID(d)) + + if agentData.RecentHealthJob != nil { + + if err = d.Set("agent_id", getAgentDataOptions.AgentID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentHealthJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } else if agentData.RecentHealthJob.JobID != nil { + d.SetId(fmt.Sprintf("%s", *agentData.RecentHealthJob.JobID)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentHealthJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentHealthJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentHealthJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentHealthJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentHealthJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + return nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_health_test.go b/ibm/service/schematics/data_source_ibm_schematics_agent_health_test.go new file mode 100644 index 0000000000..e7351e4e8e --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_health_test.go @@ -0,0 +1,83 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsAgentHealthDataSourceBasic(t *testing.T) { + agentHealthJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentHealthDataSourceConfigBasic(agentHealthJobAgentID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "agent_id"), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentHealthDataSourceAllArgs(t *testing.T) { + agentHealthJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + agentHealthJobForce := "false" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentHealthDataSourceConfig(agentHealthJobAgentID, agentHealthJobForce), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "agent_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "job_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "updated_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "agent_version"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "status_code"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "status_message"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_health.schematics_agent_health_instance", "log_url"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentHealthDataSourceConfigBasic(agentHealthJobAgentID string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = "%s" + } + + data "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = ibm_schematics_agent_health.schematics_agent_health.agent_id + } + `, agentHealthJobAgentID) +} + +func testAccCheckIbmSchematicsAgentHealthDataSourceConfig(agentHealthJobAgentID string, agentHealthJobForce string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = "%s" + force = %s + } + + data "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = ibm_schematics_agent_health.schematics_agent_health.agent_id + } + `, agentHealthJobAgentID, agentHealthJobForce) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go b/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go new file mode 100644 index 0000000000..e0c4eb613f --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go @@ -0,0 +1,129 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsAgentPrs() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsAgentPrsRead, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Agent ID to get the details of agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent prs job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent prs job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the pre-requisite scanner job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the pre-requisite scanner job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full pre-requisite scanner job logs.", + }, + }, + } +} + +func dataSourceIbmSchematicsAgentPrsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId(DataSourceIBMSchematicsAgentID(d)) + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + d.SetId(DataSourceIBMSchematicsAgentID(d)) + + if agentData.RecentPrsJob != nil { + + if err = d.Set("agent_id", getAgentDataOptions.AgentID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentPrsJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } else if agentData.RecentPrsJob.JobID != nil { + d.SetId(fmt.Sprintf("%s", *agentData.RecentPrsJob.JobID)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentPrsJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentPrsJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentPrsJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentPrsJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentPrsJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + return nil +} + +// DataSourceIBMSchematicsAgentID returns a reasonable ID +func DataSourceIBMSchematicsAgentID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_prs_test.go b/ibm/service/schematics/data_source_ibm_schematics_agent_prs_test.go new file mode 100644 index 0000000000..3a1e4be7fd --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_prs_test.go @@ -0,0 +1,83 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsAgentPrsDataSourceBasic(t *testing.T) { + agentPRSJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentPrsDataSourceConfigBasic(agentPRSJobAgentID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_id"), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentPrsDataSourceAllArgs(t *testing.T) { + agentPRSJobAgentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + agentPRSJobForce := "false" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentPrsDataSourceConfig(agentPRSJobAgentID, agentPRSJobForce), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "job_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "updated_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_version"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "status_code"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "status_message"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent_prs.schematics_agent_prs_instance", "log_url"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentPrsDataSourceConfigBasic(agentPRSJobAgentID string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = "%s" + } + + data "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = ibm_schematics_agent_prs.schematics_agent_prs_instance.agent_id + } + `, agentPRSJobAgentID) +} + +func testAccCheckIbmSchematicsAgentPrsDataSourceConfig(agentPRSJobAgentID string, agentPRSJobForce string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = "%s" + force = %s + } + + data "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = ibm_schematics_agent_prs.schematics_agent_prs_instance.agent_id + } + `, agentPRSJobAgentID, agentPRSJobForce) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_test.go b/ibm/service/schematics/data_source_ibm_schematics_agent_test.go new file mode 100644 index 0000000000..f3ec02934b --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_test.go @@ -0,0 +1,183 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsAgentDataSourceBasic(t *testing.T) { + agentDataName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + agentDataVersion := "1.0.0-beta2" + agentDataSchematicsLocation := "us-south" + agentDataAgentLocation := "eu-de" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDataSourceConfigBasic(agentDataName, agentDataVersion, agentDataSchematicsLocation, agentDataAgentLocation), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "name"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "resource_group"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "version"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "schematics_location"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_location"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_infrastructure.#"), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentDataSourceAllArgs(t *testing.T) { + agentDataName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + agentDataVersion := "1.0.0-beta2" + agentDataSchematicsLocation := "us-south" + agentDataAgentLocation := "eu-de" + agentDataDescription := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDataSourceConfig(agentDataName, agentDataVersion, agentDataSchematicsLocation, agentDataAgentLocation, agentDataDescription), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "name"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "description"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "resource_group"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "tags.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "version"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "schematics_location"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_location"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_infrastructure.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_metadata.#"), + resource.TestCheckResourceAttr("data.ibm_schematics_agent.schematics_agent_instance", "agent_metadata.0.name", agentDataName), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_inputs.#"), + resource.TestCheckResourceAttr("data.ibm_schematics_agent.schematics_agent_instance", "agent_inputs.0.name", agentDataName), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_inputs.0.value"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_inputs.0.use_default"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_inputs.0.link"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "user_state.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_crn"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "created_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "creation_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "updated_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "updated_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "system_state.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "agent_kpi.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "recent_prs_job.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "recent_deploy_job.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agent.schematics_agent_instance", "recent_health_job.#"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentDataSourceConfigBasic(agentDataName string, agentDataVersion string, agentDataSchematicsLocation string, agentDataAgentLocation string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent" "schematics_agent_instance" { + name = "%s" + resource_group = "Default" + version = "%s" + schematics_location = "%s" + agent_location = "%s" + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + } + + data "ibm_schematics_agent" "schematics_agent_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id + } + `, agentDataName, agentDataVersion, agentDataSchematicsLocation, agentDataAgentLocation) +} + +func testAccCheckIbmSchematicsAgentDataSourceConfig(agentDataName string, agentDataVersion string, agentDataSchematicsLocation string, agentDataAgentLocation string, agentDataDescription string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent" "schematics_agent_instance" { + name = "%s" + resource_group = "Default" + version = "%s" + schematics_location = "%s" + agent_location = "%s" + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + description = "%s" + tags = "FIXME" + agent_metadata { + name = "purpose" + value = ["git", "terraform", "ansible"] + } + agent_inputs { + name = "name" + value = "value" + use_default = true + metadata { + type = "boolean" + aliases = [ "aliases" ] + description = "description" + cloud_data_type = "cloud_data_type" + default_value = "default_value" + link_status = "normal" + secure = true + immutable = true + hidden = true + required = true + options = [ "options" ] + min_value = 1 + max_value = 1 + min_length = 1 + max_length = 1 + matches = "matches" + position = 1 + group_by = "group_by" + source = "source" + } + link = "link" + } + user_state { + state = "enable" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + agent_kpi { + availability_indicator = "available" + lifecycle_indicator = "consistent" + percent_usage_indicator = "percent_usage_indicator" + application_indicators = [ null ] + infra_indicators = [ null ] + } + } + + data "ibm_schematics_agent" "schematics_agent_instance" { + agent_id = ibm_schematics_agent.schematics_agent_instance.id + } + `, agentDataName, agentDataVersion, agentDataSchematicsLocation, agentDataAgentLocation, agentDataDescription) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agents.go b/ibm/service/schematics/data_source_ibm_schematics_agents.go new file mode 100644 index 0000000000..2b37171461 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agents.go @@ -0,0 +1,363 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsAgents() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsAgentsRead, + + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The name of the agent (must be unique, for an account).", + }, + "total_count": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The total number of records.", + }, + "limit": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The number of records returned.", + }, + "offset": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The skipped number of records.", + }, + "agents": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The list of agents in the account.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name of the agent (must be unique, for an account).", + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent description.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource-group name for the agent. By default, Agent will be registered in Default Resource Group.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Tags for the agent.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "agent_location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The location where agent is deployed in the user environment.", + }, + "location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "profile_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IAM trusted profile id, used by the Agent instance.", + }, + "agent_crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Agent crn, obtained from the Schematics Agent deployment configuration.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Agent registration id.", + }, + "registered_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Agent registration date-time.", + }, + "registered_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The email address of an user who registered the Agent.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Agent registration updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who updated the Agent registration.", + }, + "user_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "User defined status of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "connection_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Connection status of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent Connection Status * `Connected` When Schematics is able to connect to the agent. * `Disconnected` When Schematics is able not connect to the agent.", + }, + "checked_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the connection state is modified.", + }, + }, + }, + }, + "system_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Computed state of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent Status.", + }, + "message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Agent status message.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIbmSchematicsAgentsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + listAgentOptions := &schematicsv1.ListAgentOptions{} + + agentList, response, err := schematicsClient.ListAgentWithContext(context, listAgentOptions) + if err != nil { + log.Printf("[DEBUG] ListAgentWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListAgentWithContext failed %s\n%s", err, response)) + } + + // Use the provided filter argument and construct a new list with only the requested resource(s) + var matchAgents []schematicsv1.Agent + var name string + var suppliedFilter bool + + if v, ok := d.GetOk("name"); ok { + name = v.(string) + suppliedFilter = true + for _, data := range agentList.Agents { + if *data.Name == name { + matchAgents = append(matchAgents, data) + } + } + } else { + matchAgents = agentList.Agents + } + agentList.Agents = matchAgents + + if suppliedFilter { + if len(agentList.Agents) == 0 { + log.Printf("[DEBUG] no Agents found with name %s\n", name) + // return diag.FromErr(fmt.Errorf("no Agents found with name %s", name)) + } + d.SetId(name) + } else { + d.SetId(dataSourceIbmSchematicsAgentsID(d)) + } + + if err = d.Set("total_count", flex.IntValue(agentList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + } + + if err = d.Set("limit", flex.IntValue(agentList.Limit)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting limit: %s", err)) + } + + if err = d.Set("offset", flex.IntValue(agentList.Offset)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting offset: %s", err)) + } + + agents := []map[string]interface{}{} + if agentList.Agents != nil { + for _, modelItem := range agentList.Agents { + modelMap, err := dataSourceIbmSchematicsAgentsAgentToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + agents = append(agents, modelMap) + } + } + if err = d.Set("agents", agents); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agents %s", err)) + } + + return nil +} + +// dataSourceIbmSchematicsAgentsID returns a reasonable ID for the list. +func dataSourceIbmSchematicsAgentsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceIbmSchematicsAgentsAgentToMap(model *schematicsv1.Agent) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = *model.Name + } + if model.Description != nil { + modelMap["description"] = *model.Description + } + if model.ResourceGroup != nil { + modelMap["resource_group"] = *model.ResourceGroup + } + if model.Tags != nil { + modelMap["tags"] = model.Tags + } + if model.AgentLocation != nil { + modelMap["agent_location"] = *model.AgentLocation + } + if model.Location != nil { + modelMap["location"] = *model.Location + } + if model.ProfileID != nil { + modelMap["profile_id"] = *model.ProfileID + } + if model.AgentCrn != nil { + modelMap["agent_crn"] = *model.AgentCrn + } + if model.ID != nil { + modelMap["id"] = *model.ID + } + if model.RegisteredAt != nil { + modelMap["registered_at"] = model.RegisteredAt.String() + } + if model.RegisteredBy != nil { + modelMap["registered_by"] = *model.RegisteredBy + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = *model.UpdatedBy + } + if model.UserState != nil { + userStateMap, err := dataSourceIbmSchematicsAgentsAgentUserStateToMap(model.UserState) + if err != nil { + return modelMap, err + } + modelMap["user_state"] = []map[string]interface{}{userStateMap} + } + if model.ConnectionState != nil { + connectionStateMap, err := dataSourceIbmSchematicsAgentsConnectionStateToMap(model.ConnectionState) + if err != nil { + return modelMap, err + } + modelMap["connection_state"] = []map[string]interface{}{connectionStateMap} + } + if model.SystemState != nil { + systemStateMap, err := dataSourceIbmSchematicsAgentsAgentSystemStateToMap(model.SystemState) + if err != nil { + return modelMap, err + } + modelMap["system_state"] = []map[string]interface{}{systemStateMap} + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentsAgentUserStateToMap(model *schematicsv1.AgentUserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.SetBy != nil { + modelMap["set_by"] = *model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentsConnectionStateToMap(model *schematicsv1.ConnectionState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.CheckedAt != nil { + modelMap["checked_at"] = model.CheckedAt.String() + } + return modelMap, nil +} + +func dataSourceIbmSchematicsAgentsAgentSystemStateToMap(model *schematicsv1.AgentSystemState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.Message != nil { + modelMap["message"] = *model.Message + } + return modelMap, nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_agents_test.go b/ibm/service/schematics/data_source_ibm_schematics_agents_test.go new file mode 100644 index 0000000000..ea9b65b48a --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_agents_test.go @@ -0,0 +1,36 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsAgentsDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentsDataSourceConfigBasic(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_agents.schematics_agents_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_agents.schematics_agents_instance", "offset"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentsDataSourceConfigBasic() string { + return fmt.Sprintf(` + data "ibm_schematics_agents" "schematics_agents_instance" { + } + `) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_output.go b/ibm/service/schematics/data_source_ibm_schematics_output.go index e3b4949aaa..ec81390106 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_output.go +++ b/ibm/service/schematics/data_source_ibm_schematics_output.go @@ -94,7 +94,7 @@ func dataSourceIBMSchematicsOutputRead(d *schema.ResourceData, meta interface{}) outputJSON = string(outputByte[:]) // items := map[string]interface{} for _, value := range output { - for key, val := range value.(map[string]interface{}) { + for key, val := range value { val2 := val.(map[string]interface{})["value"] items[key] = val2 } @@ -145,7 +145,7 @@ func dataSourceOutputValuesListOutputValuesToMap(outputValuesItem schematicsv1.O m := []flex.Map{} for _, outputValues := range outputValuesItem.OutputValues { - m = append(m, flex.Flatten(outputValues.(map[string]interface{}))) + m = append(m, flex.Flatten(outputValues)) } if outputValuesItem.OutputValues != nil { diff --git a/ibm/service/schematics/data_source_ibm_schematics_policies.go b/ibm/service/schematics/data_source_ibm_schematics_policies.go new file mode 100644 index 0000000000..7cfe407d0e --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_policies.go @@ -0,0 +1,283 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsPolicies() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsPoliciesRead, + + Schema: map[string]*schema.Schema{ + "policy_kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + }, + "total_count": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The total number of policy records.", + }, + "limit": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The number of policy records returned.", + }, + "offset": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The skipped number of policy records.", + }, + "policies": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The list of Schematics policies.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The name of Schematics customization policy.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The system generated Policy Id.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy CRN.", + }, + "account": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Account id.", + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The description of Schematics customization policy.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Resource-group name for the Policy. By default, Policy will be created in Default Resource Group.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Tags for the Schematics customization policy.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "User defined status of the Schematics object.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "policy_kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy creation time.", + }, + "created_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user who created the Policy.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy updation time.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIbmSchematicsPoliciesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + listPolicyOptions := &schematicsv1.ListPolicyOptions{} + + policyList, response, err := schematicsClient.ListPolicyWithContext(context, listPolicyOptions) + if err != nil { + log.Printf("[DEBUG] ListPolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListPolicyWithContext failed %s\n%s", err, response)) + } + + // Use the provided filter argument and construct a new list with only the requested resource(s) + var matchPolicies []schematicsv1.PolicyLite + var policyKind string + var suppliedFilter bool + + if v, ok := d.GetOk("policy_kind"); ok { + policyKind = v.(string) + suppliedFilter = true + for _, data := range policyList.Policies { + if data.PolicyKind != nil { + if *data.PolicyKind == policyKind { + matchPolicies = append(matchPolicies, data) + } + } + } + } else { + matchPolicies = policyList.Policies + } + policyList.Policies = matchPolicies + + if suppliedFilter { + if len(policyList.Policies) == 0 { + log.Printf("[DEBUG] no Policies found with policyKind %s\n", policyKind) + // return diag.FromErr(fmt.Errorf("no Policies found with policyKind %s", policyKind)) + } + d.SetId(policyKind) + } else { + d.SetId(dataSourceIbmSchematicsPoliciesID(d)) + } + + if err = d.Set("total_count", flex.IntValue(policyList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + } + + if err = d.Set("limit", flex.IntValue(policyList.Limit)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting limit: %s", err)) + } + + if err = d.Set("offset", flex.IntValue(policyList.Offset)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting offset: %s", err)) + } + + policies := []map[string]interface{}{} + if policyList.Policies != nil { + for _, modelItem := range policyList.Policies { + modelMap, err := dataSourceIbmSchematicsPoliciesPolicyLiteToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + policies = append(policies, modelMap) + } + } + if err = d.Set("policies", policies); err != nil { + return diag.FromErr(fmt.Errorf("Error setting policies %s", err)) + } + + return nil +} + +// dataSourceIbmSchematicsPoliciesID returns a reasonable ID for the list. +func dataSourceIbmSchematicsPoliciesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceIbmSchematicsPoliciesPolicyLiteToMap(model *schematicsv1.PolicyLite) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = *model.Name + } + if model.ID != nil { + modelMap["id"] = *model.ID + } + if model.Crn != nil { + modelMap["crn"] = *model.Crn + } + if model.Account != nil { + modelMap["account"] = *model.Account + } + if model.Description != nil { + modelMap["description"] = *model.Description + } + if model.ResourceGroup != nil { + modelMap["resource_group"] = *model.ResourceGroup + } + if model.Tags != nil { + modelMap["tags"] = model.Tags + } + if model.Location != nil { + modelMap["location"] = *model.Location + } + if model.State != nil { + stateMap, err := dataSourceIbmSchematicsPoliciesUserStateToMap(model.State) + if err != nil { + return modelMap, err + } + modelMap["state"] = []map[string]interface{}{stateMap} + } + if model.PolicyKind != nil { + modelMap["policy_kind"] = *model.PolicyKind + } + if model.CreatedAt != nil { + modelMap["created_at"] = model.CreatedAt.String() + } + if model.CreatedBy != nil { + modelMap["created_by"] = *model.CreatedBy + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPoliciesUserStateToMap(model *schematicsv1.UserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.SetBy != nil { + modelMap["set_by"] = *model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_policies_test.go b/ibm/service/schematics/data_source_ibm_schematics_policies_test.go new file mode 100644 index 0000000000..a1ed441df9 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_policies_test.go @@ -0,0 +1,37 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsPoliciesDataSourceBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsPoliciesDataSourceConfigBasic(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_policies.schematics_policies_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policies.schematics_policies_instance", "offset"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsPoliciesDataSourceConfigBasic() string { + return fmt.Sprintf(` + data "ibm_schematics_policies" "schematics_policies_instance" { + policy_kind = "agent_assignment_policy" + } + `) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_policy.go b/ibm/service/schematics/data_source_ibm_schematics_policy.go new file mode 100644 index 0000000000..51b2c40256 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_policy.go @@ -0,0 +1,479 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIbmSchematicsPolicy() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSchematicsPolicyRead, + + Schema: map[string]*schema.Schema{ + "policy_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "ID to get the details of policy.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of Schematics customization policy.", + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The description of Schematics customization policy.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource group name for the policy. By default, Policy will be created in `default` Resource Group.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Tags for the Schematics customization policy.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "location": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "User defined status of the Schematics object.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + }, + "target": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The objects for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "selector_kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Types of schematics object selector.", + }, + "selector_ids": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "selector_scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the Schematics automation resource.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The tag based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "resource_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The resource group based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "locations": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The location based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "parameter": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The parameter to tune the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_assignment_policy_parameter": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Parameters for the `agent_assignment_policy`.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "selector_kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Types of schematics object selector.", + }, + "selector_ids": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "selector_scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the Schematics automation resource.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The tag based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "resource_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The resource group based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "locations": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The location based selector.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The system generated policy Id.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy CRN.", + }, + "account": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Account id.", + }, + "scoped_resources": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "List of scoped Schematics resources targeted by the policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the Schematics automation resource.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Schematics resource Id.", + }, + }, + }, + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy creation time.", + }, + "created_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user who created the policy.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy updation time.", + }, + }, + } +} + +func dataSourceIbmSchematicsPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getPolicyOptions := &schematicsv1.GetPolicyOptions{} + + getPolicyOptions.SetPolicyID(d.Get("policy_id").(string)) + + policy, response, err := schematicsClient.GetPolicyWithContext(context, getPolicyOptions) + if err != nil { + log.Printf("[DEBUG] GetPolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetPolicyWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s", *getPolicyOptions.PolicyID)) + + if err = d.Set("name", policy.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + + if err = d.Set("description", policy.Description); err != nil { + return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + } + + if err = d.Set("resource_group", policy.ResourceGroup); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + } + + if err = d.Set("location", policy.Location); err != nil { + return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + } + + state := []map[string]interface{}{} + if policy.State != nil { + modelMap, err := dataSourceIbmSchematicsPolicyUserStateToMap(policy.State) + if err != nil { + return diag.FromErr(err) + } + state = append(state, modelMap) + } + if err = d.Set("state", state); err != nil { + return diag.FromErr(fmt.Errorf("Error setting state %s", err)) + } + + if err = d.Set("kind", policy.Kind); err != nil { + return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + } + + target := []map[string]interface{}{} + if policy.Target != nil { + modelMap, err := dataSourceIbmSchematicsPolicyPolicyObjectsToMap(policy.Target) + if err != nil { + return diag.FromErr(err) + } + target = append(target, modelMap) + } + if err = d.Set("target", target); err != nil { + return diag.FromErr(fmt.Errorf("Error setting target %s", err)) + } + + parameter := []map[string]interface{}{} + if policy.Parameter != nil { + modelMap, err := dataSourceIbmSchematicsPolicyPolicyParameterToMap(policy.Parameter) + if err != nil { + return diag.FromErr(err) + } + parameter = append(parameter, modelMap) + } + if err = d.Set("parameter", parameter); err != nil { + return diag.FromErr(fmt.Errorf("Error setting parameter %s", err)) + } + + if err = d.Set("id", policy.ID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + } + + if err = d.Set("crn", policy.Crn); err != nil { + return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + } + + if err = d.Set("account", policy.Account); err != nil { + return diag.FromErr(fmt.Errorf("Error setting account: %s", err)) + } + + scopedResources := []map[string]interface{}{} + if policy.ScopedResources != nil { + for _, modelItem := range policy.ScopedResources { + modelMap, err := dataSourceIbmSchematicsPolicyScopedResourceToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + scopedResources = append(scopedResources, modelMap) + } + } + if err = d.Set("scoped_resources", scopedResources); err != nil { + return diag.FromErr(fmt.Errorf("Error setting scoped_resources %s", err)) + } + + if err = d.Set("created_at", flex.DateTimeToString(policy.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if err = d.Set("created_by", policy.CreatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + } + + if err = d.Set("updated_at", flex.DateTimeToString(policy.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + + return nil +} + +func dataSourceIbmSchematicsPolicyUserStateToMap(model *schematicsv1.UserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = *model.State + } + if model.SetBy != nil { + modelMap["set_by"] = *model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPolicyPolicyObjectsToMap(model *schematicsv1.PolicyObjects) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.SelectorKind != nil { + modelMap["selector_kind"] = *model.SelectorKind + } + if model.SelectorIds != nil { + modelMap["selector_ids"] = model.SelectorIds + } + if model.SelectorScope != nil { + selectorScope := []map[string]interface{}{} + for _, selectorScopeItem := range model.SelectorScope { + selectorScopeItemMap, err := dataSourceIbmSchematicsPolicyPolicyObjectSelectorToMap(&selectorScopeItem) + if err != nil { + return modelMap, err + } + selectorScope = append(selectorScope, selectorScopeItemMap) + } + modelMap["selector_scope"] = selectorScope + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPolicyPolicyObjectSelectorToMap(model *schematicsv1.PolicyObjectSelector) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Kind != nil { + modelMap["kind"] = *model.Kind + } + if model.Tags != nil { + modelMap["tags"] = model.Tags + } + if model.ResourceGroups != nil { + modelMap["resource_groups"] = model.ResourceGroups + } + if model.Locations != nil { + modelMap["locations"] = model.Locations + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPolicyPolicyParameterToMap(model *schematicsv1.PolicyParameter) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentAssignmentPolicyParameter != nil { + agentAssignmentPolicyParameterMap, err := dataSourceIbmSchematicsPolicyAgentAssignmentPolicyParameterToMap(model.AgentAssignmentPolicyParameter) + if err != nil { + return modelMap, err + } + modelMap["agent_assignment_policy_parameter"] = []map[string]interface{}{agentAssignmentPolicyParameterMap} + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPolicyAgentAssignmentPolicyParameterToMap(model *schematicsv1.AgentAssignmentPolicyParameter) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.SelectorKind != nil { + modelMap["selector_kind"] = *model.SelectorKind + } + if model.SelectorIds != nil { + modelMap["selector_ids"] = model.SelectorIds + } + if model.SelectorScope != nil { + selectorScope := []map[string]interface{}{} + for _, selectorScopeItem := range model.SelectorScope { + selectorScopeItemMap, err := dataSourceIbmSchematicsPolicyPolicyObjectSelectorToMap(&selectorScopeItem) + if err != nil { + return modelMap, err + } + selectorScope = append(selectorScope, selectorScopeItemMap) + } + modelMap["selector_scope"] = selectorScope + } + return modelMap, nil +} + +func dataSourceIbmSchematicsPolicyScopedResourceToMap(model *schematicsv1.ScopedResource) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Kind != nil { + modelMap["kind"] = *model.Kind + } + if model.ID != nil { + modelMap["id"] = *model.ID + } + return modelMap, nil +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_policy_test.go b/ibm/service/schematics/data_source_ibm_schematics_policy_test.go new file mode 100644 index 0000000000..a31976aa94 --- /dev/null +++ b/ibm/service/schematics/data_source_ibm_schematics_policy_test.go @@ -0,0 +1,133 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIbmSchematicsPolicyDataSourceBasic(t *testing.T) { + policyName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + policyKind := "agent_assignment_policy" + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsPolicyDataSourceConfigBasic(policyName, policyKind), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "policy_id"), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsPolicyDataSourceAllArgs(t *testing.T) { + policyName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + policyDescription := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + policyResourceGroup := fmt.Sprintf("tf_resource_group_%d", acctest.RandIntRange(10, 100)) + policyLocation := "us-south" + policyKind := "agent_assignment_policy" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsPolicyDataSourceConfig(policyName, policyDescription, policyResourceGroup, policyLocation, policyKind), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "policy_id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "name"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "description"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "resource_group"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "tags.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "location"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "state.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "kind"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "target.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "parameter.#"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "crn"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "account"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "scoped_resources.#"), + resource.TestCheckResourceAttr("data.ibm_schematics_policy.schematics_policy_instance", "scoped_resources.0.kind", policyKind), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "scoped_resources.0.id"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "created_at"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "created_by"), + resource.TestCheckResourceAttrSet("data.ibm_schematics_policy.schematics_policy_instance", "updated_at"), + ), + }, + }, + }) +} + +func testAccCheckIbmSchematicsPolicyDataSourceConfigBasic(policyName, policyKind string) string { + return fmt.Sprintf(` + resource "ibm_schematics_policy" "schematics_policy_instance" { + name = "%s" + kind = "%s" + } + + data "ibm_schematics_policy" "schematics_policy_instance" { + policy_id = ibm_schematics_policy.schematics_policy_instance.id + } + `, policyName, policyKind) +} + +func testAccCheckIbmSchematicsPolicyDataSourceConfig(policyName string, policyDescription string, policyResourceGroup string, policyLocation string, policyKind string) string { + return fmt.Sprintf(` + resource "ibm_schematics_policy" "schematics_policy_instance" { + name = "%s" + description = "%s" + resource_group = "%s" + tags = "FIXME" + location = "%s" + state { + state = "draft" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + kind = "%s" + target { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + parameter { + agent_assignment_policy_parameter { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + } + scoped_resources { + kind = "workspace" + id = "id" + } + } + + data "ibm_schematics_policy" "schematics_policy_instance" { + policy_id = ibm_schematics_policy.schematics_policy_instance.id + } + `, policyName, policyDescription, policyResourceGroup, policyLocation, policyKind) +} diff --git a/ibm/service/schematics/data_source_ibm_schematics_workspace.go b/ibm/service/schematics/data_source_ibm_schematics_workspace.go index c523e18bb0..d6855d253f 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_workspace.go +++ b/ibm/service/schematics/data_source_ibm_schematics_workspace.go @@ -917,8 +917,7 @@ func dataSourceWorkspaceResponseTemplateDataToMap(templateDataItem schematicsv1. if templateDataItem.ValuesMetadata != nil { valuesMetadata := []map[string]interface{}{} for _, valuesMetadataItem := range templateDataItem.ValuesMetadata { - valuesMetadataItemMap := dataSourceIbmSchematicsWorkspaceVariableMetadataToMap(&valuesMetadataItem) - valuesMetadata = append(valuesMetadata, valuesMetadataItemMap) + valuesMetadata = append(valuesMetadata, valuesMetadataItem) } templateDataMap["values_metadata"] = valuesMetadata } diff --git a/ibm/service/schematics/resource_ibm_schematics_action.go b/ibm/service/schematics/resource_ibm_schematics_action.go index 5b7efef5f5..cf291e7807 100644 --- a/ibm/service/schematics/resource_ibm_schematics_action.go +++ b/ibm/service/schematics/resource_ibm_schematics_action.go @@ -858,7 +858,6 @@ func ResourceIBMSchematicsAction() *schema.Resource { }, "sys_lock": { Type: schema.TypeList, - Optional: true, Computed: true, Description: "System lock status.", Elem: &schema.Resource{ @@ -1072,14 +1071,6 @@ func resourceIBMSchematicsActionCreate(context context.Context, d *schema.Resour } createActionOptions.SetSettings(settings) } - if _, ok := d.GetOk("state"); ok { - state := resourceIBMSchematicsActionMapToActionState(d.Get("state.0").(map[string]interface{})) - createActionOptions.SetState(&state) - } - if _, ok := d.GetOk("sys_lock"); ok { - sysLock := resourceIBMSchematicsActionMapToSystemLock(d.Get("sys_lock.0").(map[string]interface{})) - createActionOptions.SetSysLock(&sysLock) - } if _, ok := d.GetOk("x_github_token"); ok { createActionOptions.SetXGithubToken(d.Get("x_github_token").(string)) } @@ -1913,23 +1904,6 @@ func resourceIBMSchematicsActionUpdate(context context.Context, d *schema.Resour updateActionOptions.SetSettings(settings) hasChange = true } - if d.HasChange("state") { - stateAttr := d.Get("state").([]interface{}) - if len(stateAttr) > 0 { - state := resourceIBMSchematicsActionMapToActionState(d.Get("state.0").(map[string]interface{})) - updateActionOptions.SetState(&state) - hasChange = true - } - } - if d.HasChange("sys_lock") { - sysLockAttr := d.Get("sys_lock").([]interface{}) - if len(sysLockAttr) > 0 { - sysLock := resourceIBMSchematicsActionMapToSystemLock(d.Get("sys_lock.0").(map[string]interface{})) - updateActionOptions.SetSysLock(&sysLock) - hasChange = true - } - } - if hasChange { _, response, err := schematicsClient.UpdateActionWithContext(context, updateActionOptions) if err != nil { diff --git a/ibm/service/schematics/resource_ibm_schematics_agent.go b/ibm/service/schematics/resource_ibm_schematics_agent.go new file mode 100644 index 0000000000..edfbf33540 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent.go @@ -0,0 +1,1332 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func ResourceIbmSchematicsAgent() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSchematicsAgentCreate, + ReadContext: resourceIbmSchematicsAgentRead, + UpdateContext: resourceIbmSchematicsAgentUpdate, + DeleteContext: resourceIbmSchematicsAgentDelete, + Importer: &schema.ResourceImporter{}, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The name of the agent (must be unique, for an account).", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The resource-group name for the agent. By default, agent will be registered in Default Resource Group.", + }, + "version": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Agent version.", + }, + "schematics_location": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "agent_location": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The location where agent is deployed in the user environment.", + }, + "agent_infrastructure": &schema.Schema{ + Type: schema.TypeList, + MinItems: 1, + MaxItems: 1, + Required: true, + Description: "The infrastructure parameters used by the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "infra_type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Type of target agent infrastructure.", + }, + "cluster_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The cluster ID where agent services will be running.", + }, + "cluster_resource_group": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The resource group of the cluster (is it required?).", + }, + "cos_instance_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The COS instance name to store the agent logs.", + }, + "cos_bucket_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The COS bucket name used to store the logs.", + }, + "cos_bucket_region": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The COS bucket region.", + }, + }, + }, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Agent description.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "Tags for the agent.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "agent_metadata": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "The metadata of an agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Name of the metadata.", + }, + "value": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "Value of the metadata name.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + "agent_inputs": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "Additional input variables for the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The name of the variable. For example, `name = \"inventory username\"`.", + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The value for the variable or reference to the value. For example, `value = \"\"`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls.", + }, + "use_default": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used.", + }, + "metadata": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "An user editable metadata for the variables.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Type of the variable.", + }, + "aliases": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "The list of aliases for the variable name.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The description of the meta data.", + }, + "cloud_data_type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Cloud data type of the variable. eg. resource_group_id, region, vpc_id.", + }, + "default_value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Default value for the variable only if the override value is not specified.", + }, + "link_status": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The status of the link.", + }, + "secure": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "Is the variable secure or sensitive ?.", + }, + "immutable": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "Is the variable readonly ?.", + }, + "hidden": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "If **true**, the variable is not displayed on UI or Command line.", + }, + "required": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "If the variable required?.", + }, + "options": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "min_value": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The minimum value of the variable. Applicable for the integer type.", + }, + "max_value": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The maximum value of the variable. Applicable for the integer type.", + }, + "min_length": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The minimum length of the variable value. Applicable for the string type.", + }, + "max_length": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The maximum length of the variable value. Applicable for the string type.", + }, + "matches": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The regex for the variable value.", + }, + "position": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The relative position of this variable in a list.", + }, + "group_by": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The display name of the group this variable belongs to.", + }, + "source": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The source of this meta-data.", + }, + }, + }, + }, + "link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The reference link to the variable value By default the expression points to `$self.value`.", + }, + }, + }, + }, + "user_state": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "User defined status of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "agent_kpi": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "Schematics Agent key performance indicators.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "availability_indicator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Overall availability indicator reported by the agent.", + }, + "lifecycle_indicator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Overall lifecycle indicator reported by the agents.", + }, + "percent_usage_indicator": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Percentage usage of the agent resources.", + }, + "application_indicators": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "Agent application key performance indicators.", + Elem: &schema.Schema{Type: schema.TypeMap}, + }, + "infra_indicators": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "Agent infrastructure key performance indicators.", + Elem: &schema.Schema{Type: schema.TypeMap}, + }, + }, + }, + }, + "agent_crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent crn, obtained from the Schematics agent deployment configuration.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent creation date-time.", + }, + "creation_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The email address of an user who created the agent.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent registration updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who updated the agent registration.", + }, + "system_state": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Computed state of the agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "status_code": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Agent Status.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The agent status message.", + }, + }, + }, + }, + "recent_prs_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Run a pre-requisite scanner for deploying agent.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent prs job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent prs job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Final result of the pre-requisite scanner job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The outcome of the pre-requisite scanner job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "URL to the full pre-requisite scanner job logs.", + }, + }, + }, + }, + "recent_deploy_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Post-installations checks for Agent health.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent deploy job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent deploy job.", + }, + "is_redeployed": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "True, when the same version of the agent was redeployed.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Final result of the agent deployment job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The outcome of the agent deployment job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "URL to the full agent deployment job logs.", + }, + }, + }, + }, + "recent_health_job": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Agent health check.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Id of the agent.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent health check job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent health check job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Final result of the health-check job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The outcome of the health-check job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "URL to the full health-check job logs.", + }, + }, + }, + }, + }, + } +} + +func resourceIbmSchematicsAgentCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + createAgentDataOptions := &schematicsv1.CreateAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + } + + createAgentDataOptions.SetName(d.Get("name").(string)) + createAgentDataOptions.SetResourceGroup(d.Get("resource_group").(string)) + createAgentDataOptions.SetVersion(d.Get("version").(string)) + createAgentDataOptions.SetSchematicsLocation(d.Get("schematics_location").(string)) + createAgentDataOptions.SetAgentLocation(d.Get("agent_location").(string)) + agentInfrastructureModel, err := resourceIbmSchematicsAgentMapToAgentInfrastructure(d.Get("agent_infrastructure.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createAgentDataOptions.SetAgentInfrastructure(agentInfrastructureModel) + if _, ok := d.GetOk("description"); ok { + createAgentDataOptions.SetDescription(d.Get("description").(string)) + } + if _, ok := d.GetOk("tags"); ok { + createAgentDataOptions.SetTags(d.Get("tags").([]string)) + } + if _, ok := d.GetOk("agent_metadata"); ok { + var agentMetadata []schematicsv1.AgentMetadataInfo + for _, e := range d.Get("agent_metadata").([]interface{}) { + value := e.(map[string]interface{}) + agentMetadataItem, err := resourceIbmSchematicsAgentMapToAgentMetadataInfo(value) + if err != nil { + return diag.FromErr(err) + } + agentMetadata = append(agentMetadata, *agentMetadataItem) + } + createAgentDataOptions.SetAgentMetadata(agentMetadata) + } + if _, ok := d.GetOk("agent_inputs"); ok { + var agentInputs []schematicsv1.VariableData + for _, e := range d.Get("agent_inputs").([]interface{}) { + value := e.(map[string]interface{}) + agentInputsItem, err := resourceIbmSchematicsAgentMapToVariableData(value) + if err != nil { + return diag.FromErr(err) + } + agentInputs = append(agentInputs, *agentInputsItem) + } + createAgentDataOptions.SetAgentInputs(agentInputs) + } + if _, ok := d.GetOk("user_state"); ok { + userStateModel, err := resourceIbmSchematicsAgentMapToAgentUserState(d.Get("user_state.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createAgentDataOptions.SetUserState(userStateModel) + } + if _, ok := d.GetOk("agent_kpi"); ok { + agentKpiModel, err := resourceIbmSchematicsAgentMapToAgentKPIData(d.Get("agent_kpi.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createAgentDataOptions.SetAgentKpi(agentKpiModel) + } + + agentData, response, err := schematicsClient.CreateAgentDataWithContext(context, createAgentDataOptions) + if err != nil { + log.Printf("[DEBUG] CreateAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("CreateAgentDataWithContext failed %s\n%s", err, response)) + } + + d.SetId(*agentData.ID) + + return resourceIbmSchematicsAgentRead(context, d, meta) +} + +func resourceIbmSchematicsAgentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + getAgentDataOptions.SetAgentID(d.Id()) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + + if err = d.Set("name", agentData.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("resource_group", agentData.ResourceGroup); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + } + if err = d.Set("version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) + } + if err = d.Set("schematics_location", agentData.SchematicsLocation); err != nil { + return diag.FromErr(fmt.Errorf("Error setting schematics_location: %s", err)) + } + if err = d.Set("agent_location", agentData.AgentLocation); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_location: %s", err)) + } + agentInfrastructureMap, err := resourceIbmSchematicsAgentAgentInfrastructureToMap(agentData.AgentInfrastructure) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("agent_infrastructure", []map[string]interface{}{agentInfrastructureMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_infrastructure: %s", err)) + } + if err = d.Set("description", agentData.Description); err != nil { + return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + } + if agentData.Tags != nil { + if err = d.Set("tags", agentData.Tags); err != nil { + return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) + } + } + agentMetadata := []map[string]interface{}{} + if agentData.AgentMetadata != nil { + for _, agentMetadataItem := range agentData.AgentMetadata { + agentMetadataItemMap, err := resourceIbmSchematicsAgentAgentMetadataInfoToMap(&agentMetadataItem) + if err != nil { + return diag.FromErr(err) + } + agentMetadata = append(agentMetadata, agentMetadataItemMap) + } + } + if err = d.Set("agent_metadata", agentMetadata); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_metadata: %s", err)) + } + agentInputs := []map[string]interface{}{} + if agentData.AgentInputs != nil { + for _, agentInputsItem := range agentData.AgentInputs { + agentInputsItemMap, err := resourceIbmSchematicsAgentVariableDataToMap(&agentInputsItem) + if err != nil { + return diag.FromErr(err) + } + agentInputs = append(agentInputs, agentInputsItemMap) + } + } + if err = d.Set("agent_inputs", agentInputs); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_inputs: %s", err)) + } + if agentData.UserState != nil { + userStateMap, err := resourceIbmSchematicsAgentAgentUserStateToMap(agentData.UserState) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("user_state", []map[string]interface{}{userStateMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting user_state: %s", err)) + } + } + if agentData.AgentKpi != nil { + agentKpiMap, err := resourceIbmSchematicsAgentAgentKPIDataToMap(agentData.AgentKpi) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("agent_kpi", []map[string]interface{}{agentKpiMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_kpi: %s", err)) + } + } + if err = d.Set("agent_crn", agentData.AgentCrn); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_crn: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(agentData.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("creation_by", agentData.CreationBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting creation_by: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if agentData.SystemState != nil { + systemStateMap, err := resourceIbmSchematicsAgentAgentSystemStatusToMap(agentData.SystemState) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("system_state", []map[string]interface{}{systemStateMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting system_state: %s", err)) + } + } + if agentData.RecentPrsJob != nil { + recentPrsJobMap, err := resourceIbmSchematicsAgentAgentDataRecentPrsJobToMap(agentData.RecentPrsJob) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("recent_prs_job", []map[string]interface{}{recentPrsJobMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_prs_job: %s", err)) + } + } + if agentData.RecentDeployJob != nil { + recentDeployJobMap, err := resourceIbmSchematicsAgentAgentDataRecentDeployJobToMap(agentData.RecentDeployJob) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("recent_deploy_job", []map[string]interface{}{recentDeployJobMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_deploy_job: %s", err)) + } + } + if agentData.RecentHealthJob != nil { + recentHealthJobMap, err := resourceIbmSchematicsAgentAgentDataRecentHealthJobToMap(agentData.RecentHealthJob) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("recent_health_job", []map[string]interface{}{recentHealthJobMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting recent_health_job: %s", err)) + } + } + + return nil +} + +func resourceIbmSchematicsAgentUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + updateAgentDataOptions := &schematicsv1.UpdateAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + } + + updateAgentDataOptions.SetAgentID(d.Id()) + + hasChange := false + + if d.HasChange("name") || d.HasChange("resource_group") || d.HasChange("version") || d.HasChange("schematics_location") || d.HasChange("agent_location") || d.HasChange("agent_infrastructure") { + updateAgentDataOptions.SetName(d.Get("name").(string)) + updateAgentDataOptions.SetResourceGroup(d.Get("resource_group").(string)) + updateAgentDataOptions.SetVersion(d.Get("version").(string)) + updateAgentDataOptions.SetSchematicsLocation(d.Get("schematics_location").(string)) + updateAgentDataOptions.SetAgentLocation(d.Get("agent_location").(string)) + agentInfrastructure, err := resourceIbmSchematicsAgentMapToAgentInfrastructure(d.Get("agent_infrastructure.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updateAgentDataOptions.SetAgentInfrastructure(agentInfrastructure) + hasChange = true + } + if d.HasChange("description") { + updateAgentDataOptions.SetDescription(d.Get("description").(string)) + hasChange = true + } + if d.HasChange("tags") { + updateAgentDataOptions.SetTags(d.Get("tags").([]string)) + hasChange = true + } + if d.HasChange("agent_metadata") { + var agentMetadata []schematicsv1.AgentMetadataInfo + for _, e := range d.Get("agent_metadata").([]interface{}) { + value := e.(map[string]interface{}) + agentMetadataItem, err := resourceIbmSchematicsAgentMapToAgentMetadataInfo(value) + if err != nil { + return diag.FromErr(err) + } + agentMetadata = append(agentMetadata, *agentMetadataItem) + } + updateAgentDataOptions.SetAgentMetadata(agentMetadata) + hasChange = true + } + if d.HasChange("agent_inputs") { + // TODO: handle AgentInputs of type TypeList -- not primitive, not model + var agentInputs []schematicsv1.VariableData + for _, e := range d.Get("agent_inputs").([]interface{}) { + value := e.(map[string]interface{}) + agentInputsItem, err := resourceIbmSchematicsAgentMapToVariableData(value) + if err != nil { + return diag.FromErr(err) + } + agentInputs = append(agentInputs, *agentInputsItem) + } + updateAgentDataOptions.SetAgentInputs(agentInputs) + hasChange = true + } + if d.HasChange("user_state") { + userState, err := resourceIbmSchematicsAgentMapToAgentUserState(d.Get("user_state.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updateAgentDataOptions.SetUserState(userState) + hasChange = true + } + if d.HasChange("agent_kpi") { + agentKpi, err := resourceIbmSchematicsAgentMapToAgentKPIData(d.Get("agent_kpi.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updateAgentDataOptions.SetAgentKpi(agentKpi) + hasChange = true + } + + if hasChange { + _, response, err := schematicsClient.UpdateAgentDataWithContext(context, updateAgentDataOptions) + if err != nil { + log.Printf("[DEBUG] UpdateAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("UpdateAgentDataWithContext failed %s\n%s", err, response)) + } + } + + return resourceIbmSchematicsAgentRead(context, d, meta) +} + +func resourceIbmSchematicsAgentDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + deleteAgentDataOptions := &schematicsv1.DeleteAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + } + + deleteAgentDataOptions.SetAgentID(d.Id()) + + response, err := schematicsClient.DeleteAgentDataWithContext(context, deleteAgentDataOptions) + if err != nil { + log.Printf("[DEBUG] DeleteAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeleteAgentDataWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} + +func resourceIbmSchematicsAgentMapToAgentInfrastructure(modelMap map[string]interface{}) (*schematicsv1.AgentInfrastructure, error) { + model := &schematicsv1.AgentInfrastructure{} + if modelMap["infra_type"] != nil && modelMap["infra_type"].(string) != "" { + model.InfraType = core.StringPtr(modelMap["infra_type"].(string)) + } + if modelMap["cluster_id"] != nil && modelMap["cluster_id"].(string) != "" { + model.ClusterID = core.StringPtr(modelMap["cluster_id"].(string)) + } + if modelMap["cluster_resource_group"] != nil && modelMap["cluster_resource_group"].(string) != "" { + model.ClusterResourceGroup = core.StringPtr(modelMap["cluster_resource_group"].(string)) + } + if modelMap["cos_instance_name"] != nil && modelMap["cos_instance_name"].(string) != "" { + model.CosInstanceName = core.StringPtr(modelMap["cos_instance_name"].(string)) + } + if modelMap["cos_bucket_name"] != nil && modelMap["cos_bucket_name"].(string) != "" { + model.CosBucketName = core.StringPtr(modelMap["cos_bucket_name"].(string)) + } + if modelMap["cos_bucket_region"] != nil && modelMap["cos_bucket_region"].(string) != "" { + model.CosBucketRegion = core.StringPtr(modelMap["cos_bucket_region"].(string)) + } + return model, nil +} + +func resourceIbmSchematicsAgentMapToAgentMetadataInfo(modelMap map[string]interface{}) (*schematicsv1.AgentMetadataInfo, error) { + model := &schematicsv1.AgentMetadataInfo{} + if modelMap["name"] != nil && modelMap["name"].(string) != "" { + model.Name = core.StringPtr(modelMap["name"].(string)) + } + if modelMap["value"] != nil { + value := []string{} + for _, valueItem := range modelMap["value"].([]interface{}) { + value = append(value, valueItem.(string)) + } + model.Value = value + } + return model, nil +} + +func resourceIbmSchematicsAgentMapToVariableData(modelMap map[string]interface{}) (*schematicsv1.VariableData, error) { + model := &schematicsv1.VariableData{} + if modelMap["name"] != nil && modelMap["name"].(string) != "" { + model.Name = core.StringPtr(modelMap["name"].(string)) + } + if modelMap["value"] != nil && modelMap["value"].(string) != "" { + model.Value = core.StringPtr(modelMap["value"].(string)) + } + if modelMap["use_default"] != nil { + model.UseDefault = core.BoolPtr(modelMap["use_default"].(bool)) + } + if modelMap["metadata"] != nil && len(modelMap["metadata"].([]interface{})) > 0 { + MetadataModel, err := resourceIbmSchematicsAgentMapToVariableMetadata(modelMap["metadata"].([]interface{})[0].(map[string]interface{})) + if err != nil { + return model, err + } + model.Metadata = MetadataModel + } + if modelMap["link"] != nil && modelMap["link"].(string) != "" { + model.Link = core.StringPtr(modelMap["link"].(string)) + } + return model, nil +} + +func resourceIbmSchematicsAgentMapToVariableMetadata(modelMap map[string]interface{}) (*schematicsv1.VariableMetadata, error) { + model := &schematicsv1.VariableMetadata{} + if modelMap["type"] != nil && modelMap["type"].(string) != "" { + model.Type = core.StringPtr(modelMap["type"].(string)) + } + if modelMap["aliases"] != nil { + aliases := []string{} + for _, aliasesItem := range modelMap["aliases"].([]interface{}) { + aliases = append(aliases, aliasesItem.(string)) + } + model.Aliases = aliases + } + if modelMap["description"] != nil && modelMap["description"].(string) != "" { + model.Description = core.StringPtr(modelMap["description"].(string)) + } + if modelMap["cloud_data_type"] != nil && modelMap["cloud_data_type"].(string) != "" { + model.CloudDataType = core.StringPtr(modelMap["cloud_data_type"].(string)) + } + if modelMap["default_value"] != nil && modelMap["default_value"].(string) != "" { + model.DefaultValue = core.StringPtr(modelMap["default_value"].(string)) + } + if modelMap["link_status"] != nil && modelMap["link_status"].(string) != "" { + model.LinkStatus = core.StringPtr(modelMap["link_status"].(string)) + } + if modelMap["secure"] != nil { + model.Secure = core.BoolPtr(modelMap["secure"].(bool)) + } + if modelMap["immutable"] != nil { + model.Immutable = core.BoolPtr(modelMap["immutable"].(bool)) + } + if modelMap["hidden"] != nil { + model.Hidden = core.BoolPtr(modelMap["hidden"].(bool)) + } + if modelMap["required"] != nil { + model.Required = core.BoolPtr(modelMap["required"].(bool)) + } + if modelMap["options"] != nil { + options := []string{} + for _, optionsItem := range modelMap["options"].([]interface{}) { + options = append(options, optionsItem.(string)) + } + model.Options = options + } + if modelMap["min_value"] != nil { + model.MinValue = core.Int64Ptr(int64(modelMap["min_value"].(int))) + } + if modelMap["max_value"] != nil { + model.MaxValue = core.Int64Ptr(int64(modelMap["max_value"].(int))) + } + if modelMap["min_length"] != nil { + model.MinLength = core.Int64Ptr(int64(modelMap["min_length"].(int))) + } + if modelMap["max_length"] != nil { + model.MaxLength = core.Int64Ptr(int64(modelMap["max_length"].(int))) + } + if modelMap["matches"] != nil && modelMap["matches"].(string) != "" { + model.Matches = core.StringPtr(modelMap["matches"].(string)) + } + if modelMap["position"] != nil { + model.Position = core.Int64Ptr(int64(modelMap["position"].(int))) + } + if modelMap["group_by"] != nil && modelMap["group_by"].(string) != "" { + model.GroupBy = core.StringPtr(modelMap["group_by"].(string)) + } + if modelMap["source"] != nil && modelMap["source"].(string) != "" { + model.Source = core.StringPtr(modelMap["source"].(string)) + } + return model, nil +} + +func resourceIbmSchematicsAgentMapToAgentUserState(modelMap map[string]interface{}) (*schematicsv1.AgentUserState, error) { + model := &schematicsv1.AgentUserState{} + if modelMap["state"] != nil && modelMap["state"].(string) != "" { + model.State = core.StringPtr(modelMap["state"].(string)) + } + if modelMap["set_by"] != nil && modelMap["set_by"].(string) != "" { + model.SetBy = core.StringPtr(modelMap["set_by"].(string)) + } + if modelMap["set_at"] != nil { + + } + return model, nil +} + +func resourceIbmSchematicsAgentMapToAgentKPIData(modelMap map[string]interface{}) (*schematicsv1.AgentKPIData, error) { + model := &schematicsv1.AgentKPIData{} + if modelMap["availability_indicator"] != nil && modelMap["availability_indicator"].(string) != "" { + model.AvailabilityIndicator = core.StringPtr(modelMap["availability_indicator"].(string)) + } + if modelMap["lifecycle_indicator"] != nil && modelMap["lifecycle_indicator"].(string) != "" { + model.LifecycleIndicator = core.StringPtr(modelMap["lifecycle_indicator"].(string)) + } + if modelMap["percent_usage_indicator"] != nil && modelMap["percent_usage_indicator"].(string) != "" { + model.PercentUsageIndicator = core.StringPtr(modelMap["percent_usage_indicator"].(string)) + } + if modelMap["application_indicators"] != nil { + applicationIndicators := []interface{}{} + for _, applicationIndicatorsItem := range modelMap["application_indicators"].([]interface{}) { + applicationIndicators = append(applicationIndicators, applicationIndicatorsItem) + } + model.ApplicationIndicators = applicationIndicators + } + if modelMap["infra_indicators"] != nil { + infraIndicators := []interface{}{} + for _, infraIndicatorsItem := range modelMap["infra_indicators"].([]interface{}) { + infraIndicators = append(infraIndicators, infraIndicatorsItem) + } + model.InfraIndicators = infraIndicators + } + return model, nil +} + +func resourceIbmSchematicsAgentAgentInfrastructureToMap(model *schematicsv1.AgentInfrastructure) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.InfraType != nil { + modelMap["infra_type"] = model.InfraType + } + if model.ClusterID != nil { + modelMap["cluster_id"] = model.ClusterID + } + if model.ClusterResourceGroup != nil { + modelMap["cluster_resource_group"] = model.ClusterResourceGroup + } + if model.CosInstanceName != nil { + modelMap["cos_instance_name"] = model.CosInstanceName + } + if model.CosBucketName != nil { + modelMap["cos_bucket_name"] = model.CosBucketName + } + if model.CosBucketRegion != nil { + modelMap["cos_bucket_region"] = model.CosBucketRegion + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentMetadataInfoToMap(model *schematicsv1.AgentMetadataInfo) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = model.Name + } + if model.Value != nil { + modelMap["value"] = model.Value + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentVariableDataToMap(model *schematicsv1.VariableData) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = model.Name + } + if model.Value != nil { + modelMap["value"] = model.Value + } + if model.UseDefault != nil { + modelMap["use_default"] = model.UseDefault + } + if model.Metadata != nil { + metadataMap, err := resourceIbmSchematicsAgentVariableMetadataToMap(model.Metadata) + if err != nil { + return modelMap, err + } + modelMap["metadata"] = []map[string]interface{}{metadataMap} + } + if model.Link != nil { + modelMap["link"] = model.Link + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentVariableMetadataToMap(model *schematicsv1.VariableMetadata) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Type != nil { + modelMap["type"] = model.Type + } + if model.Aliases != nil { + modelMap["aliases"] = model.Aliases + } + if model.Description != nil { + modelMap["description"] = model.Description + } + if model.CloudDataType != nil { + modelMap["cloud_data_type"] = model.CloudDataType + } + if model.DefaultValue != nil { + modelMap["default_value"] = model.DefaultValue + } + if model.LinkStatus != nil { + modelMap["link_status"] = model.LinkStatus + } + if model.Secure != nil { + modelMap["secure"] = model.Secure + } + if model.Immutable != nil { + modelMap["immutable"] = model.Immutable + } + if model.Hidden != nil { + modelMap["hidden"] = model.Hidden + } + if model.Required != nil { + modelMap["required"] = model.Required + } + if model.Options != nil { + modelMap["options"] = model.Options + } + if model.MinValue != nil { + modelMap["min_value"] = flex.IntValue(model.MinValue) + } + if model.MaxValue != nil { + modelMap["max_value"] = flex.IntValue(model.MaxValue) + } + if model.MinLength != nil { + modelMap["min_length"] = flex.IntValue(model.MinLength) + } + if model.MaxLength != nil { + modelMap["max_length"] = flex.IntValue(model.MaxLength) + } + if model.Matches != nil { + modelMap["matches"] = model.Matches + } + if model.Position != nil { + modelMap["position"] = flex.IntValue(model.Position) + } + if model.GroupBy != nil { + modelMap["group_by"] = model.GroupBy + } + if model.Source != nil { + modelMap["source"] = model.Source + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentUserStateToMap(model *schematicsv1.AgentUserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = model.State + } + if model.SetBy != nil { + modelMap["set_by"] = model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentKPIDataToMap(model *schematicsv1.AgentKPIData) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AvailabilityIndicator != nil { + modelMap["availability_indicator"] = model.AvailabilityIndicator + } + if model.LifecycleIndicator != nil { + modelMap["lifecycle_indicator"] = model.LifecycleIndicator + } + if model.PercentUsageIndicator != nil { + modelMap["percent_usage_indicator"] = model.PercentUsageIndicator + } + if model.ApplicationIndicators != nil { + applicationIndicators := []map[string]interface{}{} + for _, applicationIndicatorsItem := range model.ApplicationIndicators { + applicationIndicators = append(applicationIndicators, applicationIndicatorsItem.(map[string]interface{})) + } + modelMap["application_indicators"] = applicationIndicators + } + if model.InfraIndicators != nil { + infraIndicators := []map[string]interface{}{} + for _, infraIndicatorsItem := range model.InfraIndicators { + infraIndicators = append(infraIndicators, infraIndicatorsItem.(map[string]interface{})) + } + modelMap["infra_indicators"] = infraIndicators + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentSystemStatusToMap(model *schematicsv1.AgentSystemStatus) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.StatusCode != nil { + modelMap["status_code"] = model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = model.StatusMessage + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentDataRecentPrsJobToMap(model *schematicsv1.AgentDataRecentPrsJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = model.UpdatedBy + } + if model.AgentVersion != nil { + modelMap["agent_version"] = model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = model.LogURL + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentDataRecentDeployJobToMap(model *schematicsv1.AgentDataRecentDeployJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = model.UpdatedBy + } + if model.IsRedeployed != nil { + modelMap["is_redeployed"] = model.IsRedeployed + } + if model.AgentVersion != nil { + modelMap["agent_version"] = model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = model.LogURL + } + return modelMap, nil +} + +func resourceIbmSchematicsAgentAgentDataRecentHealthJobToMap(model *schematicsv1.AgentDataRecentHealthJob) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentID != nil { + modelMap["agent_id"] = model.AgentID + } + if model.JobID != nil { + modelMap["job_id"] = model.JobID + } + if model.UpdatedAt != nil { + modelMap["updated_at"] = model.UpdatedAt.String() + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = model.UpdatedBy + } + if model.AgentVersion != nil { + modelMap["agent_version"] = model.AgentVersion + } + if model.StatusCode != nil { + modelMap["status_code"] = model.StatusCode + } + if model.StatusMessage != nil { + modelMap["status_message"] = model.StatusMessage + } + if model.LogURL != nil { + modelMap["log_url"] = model.LogURL + } + return modelMap, nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go b/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go new file mode 100644 index 0000000000..ec9564c686 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go @@ -0,0 +1,286 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func ResourceIbmSchematicsAgentDeploy() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSchematicsAgentDeployCreate, + ReadContext: resourceIbmSchematicsAgentDeployRead, + UpdateContext: resourceIbmSchematicsAgentDeployUpdate, + DeleteContext: resourceIbmSchematicsAgentDeployDelete, + Importer: &schema.ResourceImporter{}, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Agent ID to get the details of agent.", + }, + "force": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "Equivalent to -force options in the command line, default is false.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent deploy job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent deploy job.", + }, + "is_redeployed": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "True, when the same version of the agent was redeployed.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the agent deployment job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the agent deployment job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full agent deployment job logs.", + }, + }, + } +} + +func resourceIbmSchematicsAgentDeployCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + + deployAgentJobOptions := &schematicsv1.DeployAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + deployAgentJobOptions.Headers = ff + deployAgentJobOptions.SetAgentID(d.Get("agent_id").(string)) + if _, ok := d.GetOk("force"); ok { + deployAgentJobOptions.SetForce(d.Get("force").(bool)) + } + + agentDeployJob, response, err := schematicsClient.DeployAgentJobWithContext(context, deployAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] DeployAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeployAgentJobWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *deployAgentJobOptions.AgentID, *agentDeployJob.JobID)) + log.Printf("[INFO] Agent : %s", *deployAgentJobOptions.AgentID) + d.Set("status_message", *agentDeployJob.StatusMessage) + + _, err = isWaitForAgentAvailable(context, schematicsClient, *deployAgentJobOptions.AgentID, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return diag.FromErr(fmt.Errorf("Waiting for agent to be available failed %s", err)) + } + + return resourceIbmSchematicsAgentDeployRead(context, d, meta) +} + +const ( + agentProvisioningTriggered = "Triggered deployment" + agentProvisioningDone = "success" + agentProvisioningPending = "PENDING" + agentProvisioninFailed = "Job Failed" +) + +func isWaitForAgentAvailable(context context.Context, schematicsClient *schematicsv1.SchematicsV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for agent (%s) to be available.", id) + stateConf := &resource.StateChangeConf{ + Pending: []string{"retry", agentProvisioningPending, agentProvisioningTriggered}, + Target: []string{agentProvisioningDone, agentProvisioninFailed, ""}, + Refresh: agentRefreshFunc(schematicsClient, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForStateContext(context) +} +func agentRefreshFunc(schematicsClient *schematicsv1.SchematicsV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + AgentID: core.StringPtr(id), + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + agent, response, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error Getting Agent: %s\n%s", err, response) + } + if *agent.RecentDeployJob.StatusMessage == agentProvisioninFailed || *agent.RecentDeployJob.StatusMessage == agentProvisioningDone { + return agent, agentProvisioningDone, nil + } + return agent, agentProvisioningPending, nil + } +} + +func resourceIbmSchematicsAgentDeployRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + getAgentDataOptions.SetAgentID(parts[0]) + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + if agentData.RecentDeployJob != nil { + + if err = d.Set("agent_id", parts[0]); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentDeployJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentDeployJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentDeployJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentDeployJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentDeployJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentDeployJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + return nil +} + +func resourceIbmSchematicsAgentDeployUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + deployAgentJobOptions := &schematicsv1.DeployAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + deployAgentJobOptions.Headers = ff + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + deployAgentJobOptions.SetAgentID(parts[0]) + + hasChange := false + + if d.HasChange("agent_id") { + return diag.FromErr(fmt.Errorf("Cannot update resource property \"%s\" with the ForceNew annotation."+ + " The resource must be re-created to update this property.", "agent_id")) + } + if d.HasChange("force") { + deployAgentJobOptions.SetForce(d.Get("force").(bool)) + hasChange = true + } + + if hasChange { + agentDeployJob, response, err := schematicsClient.DeployAgentJobWithContext(context, deployAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] DeployAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeployAgentJobWithContext failed %s\n%s", err, response)) + } + d.SetId(fmt.Sprintf("%s/%s", *deployAgentJobOptions.AgentID, *agentDeployJob.JobID)) + d.Set("status_message", *agentDeployJob.StatusMessage) + + _, err = isWaitForAgentAvailable(context, schematicsClient, parts[0], d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return diag.FromErr(fmt.Errorf("Waiting for agent to be available failed %s", err)) + } + } + + return resourceIbmSchematicsAgentDeployRead(context, d, meta) +} + +func resourceIbmSchematicsAgentDeployDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + d.SetId("") + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go new file mode 100644 index 0000000000..bd73dc2fcf --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go @@ -0,0 +1,163 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func TestAccIbmSchematicsAgentDeployBasic(t *testing.T) { + var conf *schematicsv1.AgentDataRecentDeployJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentDeployDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDeployConfigBasic(agentID), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentDeployExists("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_id", agentID), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentDeployAllArgs(t *testing.T) { + var conf *schematicsv1.AgentDataRecentDeployJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + force := "false" + forceUpdate := "true" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentDeployDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDeployConfig(agentID, force), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentDeployExists("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "force", force), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentDeployConfig(agentID, forceUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_deploy.schematics_agent_deploy_instance", "force", forceUpdate), + ), + }, + resource.TestStep{ + ResourceName: "ibm_schematics_agent_deploy.schematics_agent_deploy_instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentDeployConfigBasic(agentID string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = "%s" + } + `, agentID) +} + +func testAccCheckIbmSchematicsAgentDeployConfig(agentID string, force string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = "%s" + force = %s + } + `, agentID, force) +} + +func testAccCheckIbmSchematicsAgentDeployExists(n string, obj *schematicsv1.AgentDataRecentDeployJob) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agentData, _, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err != nil { + return err + } + + obj = agentData.RecentDeployJob + return nil + } +} + +func testAccCheckIbmSchematicsAgentDeployDestroy(s *terraform.State) error { + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_schematics_agent_deploy" { + continue + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agent, response, err := schematicsClient.GetAgentData(getAgentDataOptions) + + if err == nil && agent.RecentDeployJob != nil { + // Agent Deploy Job can never really truely be deleted + return nil + } else if response.StatusCode != 404 { + return fmt.Errorf("Error checking for schematics_agent (%s) has been destroyed: %s", parts[0], err) + } + } + + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_health.go b/ibm/service/schematics/resource_ibm_schematics_agent_health.go new file mode 100644 index 0000000000..01f9e5c34b --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_health.go @@ -0,0 +1,228 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func ResourceIbmSchematicsAgentHealth() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSchematicsAgentHealthCreate, + ReadContext: resourceIbmSchematicsAgentHealthRead, + UpdateContext: resourceIbmSchematicsAgentHealthUpdate, + DeleteContext: resourceIbmSchematicsAgentHealthDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Agent ID to get the details of agent.", + }, + "force": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "Equivalent to -force options in the command line, default is false.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent health check job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent health check job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the health-check job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the health-check job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full health-check job logs.", + }, + }, + } +} + +func resourceIbmSchematicsAgentHealthCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + + healthCheckAgentJobOptions := &schematicsv1.HealthCheckAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + healthCheckAgentJobOptions.Headers = ff + + healthCheckAgentJobOptions.SetAgentID(d.Get("agent_id").(string)) + if _, ok := d.GetOk("force"); ok { + healthCheckAgentJobOptions.SetForce(d.Get("force").(bool)) + } + + agentHealthJob, response, err := schematicsClient.HealthCheckAgentJobWithContext(context, healthCheckAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] HealthCheckAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("HealthCheckAgentJobWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *healthCheckAgentJobOptions.AgentID, *agentHealthJob.JobID)) + + return resourceIbmSchematicsAgentHealthRead(context, d, meta) +} + +func resourceIbmSchematicsAgentHealthRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + + if agentData.RecentHealthJob != nil { + + if err = d.Set("agent_id", parts[0]); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentHealthJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentHealthJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentHealthJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentHealthJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentHealthJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentHealthJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + + return nil +} + +func resourceIbmSchematicsAgentHealthUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + + healthCheckAgentJobOptions := &schematicsv1.HealthCheckAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + healthCheckAgentJobOptions.Headers = ff + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + healthCheckAgentJobOptions.SetAgentID(parts[0]) + + hasChange := false + + if d.HasChange("agent_id") { + return diag.FromErr(fmt.Errorf("Cannot update resource property \"%s\" with the ForceNew annotation."+ + " The resource must be re-created to update this property.", "agent_id")) + } + if d.HasChange("force") { + healthCheckAgentJobOptions.SetForce(d.Get("force").(bool)) + hasChange = true + } + + if hasChange { + agentHealthJob, response, err := schematicsClient.HealthCheckAgentJobWithContext(context, healthCheckAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] HealthCheckAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("HealthCheckAgentJobWithContext failed %s\n%s", err, response)) + } + d.SetId(fmt.Sprintf("%s/%s", *healthCheckAgentJobOptions.AgentID, *agentHealthJob.JobID)) + } + + return resourceIbmSchematicsAgentHealthRead(context, d, meta) +} + +func resourceIbmSchematicsAgentHealthDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + d.SetId("") + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go new file mode 100644 index 0000000000..3b20dc5dd5 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go @@ -0,0 +1,164 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func TestAccIbmSchematicsAgentHealthBasic(t *testing.T) { + var conf *schematicsv1.AgentDataRecentHealthJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentHealthDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentHealthConfigBasic(agentID), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentHealthExists("ibm_schematics_agent_health.schematics_agent_health_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_health.schematics_agent_health_instance", "agent_id", agentID), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentHealthAllArgs(t *testing.T) { + var conf *schematicsv1.AgentDataRecentHealthJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + force := "false" + forceUpdate := "true" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentHealthDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentHealthConfig(agentID, force), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentHealthExists("ibm_schematics_agent_health.schematics_agent_health_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_health.schematics_agent_health_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_health.schematics_agent_health_instance", "force", force), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentHealthConfig(agentID, forceUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_agent_health.schematics_agent_health_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_health.schematics_agent_health_instance", "force", forceUpdate), + ), + }, + resource.TestStep{ + ResourceName: "ibm_schematics_agent_health.schematics_agent_health_instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentHealthConfigBasic(agentID string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = "%s" + } + `, agentID) +} + +func testAccCheckIbmSchematicsAgentHealthConfig(agentID string, force string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = "%s" + force = %s + } + `, agentID, force) +} + +func testAccCheckIbmSchematicsAgentHealthExists(n string, obj *schematicsv1.AgentDataRecentHealthJob) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agentData, _, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err != nil { + return err + } + + obj = agentData.RecentHealthJob + return nil + } +} + +func testAccCheckIbmSchematicsAgentHealthDestroy(s *terraform.State) error { + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_schematics_agent_health" { + continue + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agent, response, err := schematicsClient.GetAgentData(getAgentDataOptions) + + if err == nil && agent.RecentHealthJob != nil { + // Agent health Job can never really truely be deleted + return nil + } else if response.StatusCode != 404 { + return fmt.Errorf("Error checking for schematics_agent (%s) has been destroyed: %s", parts[0], err) + } + + } + + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_prs.go b/ibm/service/schematics/resource_ibm_schematics_agent_prs.go new file mode 100644 index 0000000000..a672152b16 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_prs.go @@ -0,0 +1,225 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v3/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func ResourceIbmSchematicsAgentPrs() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSchematicsAgentPrsCreate, + ReadContext: resourceIbmSchematicsAgentPrsRead, + UpdateContext: resourceIbmSchematicsAgentPrsUpdate, + DeleteContext: resourceIbmSchematicsAgentPrsDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "agent_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Agent ID to get the details of agent.", + }, + "force": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Description: "Equivalent to -force options in the command line, default is false.", + }, + "job_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Job Id.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The agent prs job updation time.", + }, + "updated_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who ran the agent prs job.", + }, + "agent_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Agent version.", + }, + "status_code": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Final result of the pre-requisite scanner job.", + }, + "status_message": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The outcome of the pre-requisite scanner job, in a formatted log string.", + }, + "log_url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "URL to the full pre-requisite scanner job logs.", + }, + }, + } +} + +func resourceIbmSchematicsAgentPrsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + + prsAgentJobOptions := &schematicsv1.PrsAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + prsAgentJobOptions.Headers = ff + prsAgentJobOptions.SetAgentID(d.Get("agent_id").(string)) + if _, ok := d.GetOk("force"); ok { + prsAgentJobOptions.SetForce(d.Get("force").(bool)) + } + + agentPrsJob, response, err := schematicsClient.PrsAgentJobWithContext(context, prsAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] PrsAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("PrsAgentJobWithContext failed %s\n%s", err, response)) + } + + d.SetId(fmt.Sprintf("%s/%s", *prsAgentJobOptions.AgentID, *agentPrsJob.JobID)) + + return resourceIbmSchematicsAgentPrsRead(context, d, meta) +} + +func resourceIbmSchematicsAgentPrsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetAgentDataWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetAgentDataWithContext failed %s\n%s", err, response)) + } + if agentData.RecentPrsJob != nil { + + if err = d.Set("agent_id", parts[0]); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_id: %s", err)) + } + if err = d.Set("job_id", agentData.RecentPrsJob.JobID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting job_id: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(agentData.RecentPrsJob.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", agentData.RecentPrsJob.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + } + if err = d.Set("agent_version", agentData.Version); err != nil { + return diag.FromErr(fmt.Errorf("Error setting agent_version: %s", err)) + } + if err = d.Set("status_code", agentData.RecentPrsJob.StatusCode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_code: %s", err)) + } + if err = d.Set("status_message", agentData.RecentPrsJob.StatusMessage); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status_message: %s", err)) + } + if err = d.Set("log_url", agentData.RecentPrsJob.LogURL); err != nil { + return diag.FromErr(fmt.Errorf("Error setting log_url: %s", err)) + } + + } + return nil +} + +func resourceIbmSchematicsAgentPrsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + session, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + iamAccessToken := session.Config.IAMAccessToken + iamRefreshToken := session.Config.IAMRefreshToken + + prsAgentJobOptions := &schematicsv1.PrsAgentJobOptions{} + ff := map[string]string{ + "X-Feature-Agents": "true", + "Authorization": iamAccessToken, + "refresh_token": iamRefreshToken, + } + prsAgentJobOptions.Headers = ff + + parts, err := flex.SepIdParts(d.Id(), "/") + if err != nil { + return diag.FromErr(err) + } + + prsAgentJobOptions.SetAgentID(parts[0]) + + hasChange := false + + if d.HasChange("agent_id") { + return diag.FromErr(fmt.Errorf("Cannot update resource property \"%s\" with the ForceNew annotation."+ + " The resource must be re-created to update this property.", "agent_id")) + } + if d.HasChange("force") { + prsAgentJobOptions.SetForce(d.Get("force").(bool)) + hasChange = true + } + + if hasChange { + agentPrsJob, response, err := schematicsClient.PrsAgentJobWithContext(context, prsAgentJobOptions) + if err != nil { + log.Printf("[DEBUG] PrsAgentJobWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("PrsAgentJobWithContext failed %s\n%s", err, response)) + } + d.SetId(fmt.Sprintf("%s/%s", *prsAgentJobOptions.AgentID, *agentPrsJob.JobID)) + } + + return resourceIbmSchematicsAgentPrsRead(context, d, meta) +} + +func resourceIbmSchematicsAgentPrsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + d.SetId("") + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go new file mode 100644 index 0000000000..66894e0125 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go @@ -0,0 +1,162 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func TestAccIbmSchematicsAgentPrsBasic(t *testing.T) { + var conf *schematicsv1.AgentDataRecentPrsJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentPrsDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentPrsConfigBasic(agentID), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentPrsExists("ibm_schematics_agent_prs.schematics_agent_prs_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_id", agentID), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentPrsAllArgs(t *testing.T) { + var conf *schematicsv1.AgentDataRecentPrsJob + agentID := fmt.Sprintf("tf_agent_id_%d", acctest.RandIntRange(10, 100)) + force := "false" + forceUpdate := "true" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentPrsDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentPrsConfig(agentID, force), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentPrsExists("ibm_schematics_agent_prs.schematics_agent_prs_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_prs.schematics_agent_prs_instance", "force", force), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentPrsConfig(agentID, forceUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_agent_prs.schematics_agent_prs_instance", "agent_id", agentID), + resource.TestCheckResourceAttr("ibm_schematics_agent_prs.schematics_agent_prs_instance", "force", forceUpdate), + ), + }, + resource.TestStep{ + ResourceName: "ibm_schematics_agent_prs.schematics_agent_prs_instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentPrsConfigBasic(agentID string) string { + return fmt.Sprintf(` + resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = "%s" + } + `, agentID) +} + +func testAccCheckIbmSchematicsAgentPrsConfig(agentID string, force string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = "%s" + force = %s + } + `, agentID, force) +} + +func testAccCheckIbmSchematicsAgentPrsExists(n string, obj *schematicsv1.AgentDataRecentPrsJob) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agentData, _, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err != nil { + return err + } + + obj = agentData.RecentPrsJob + return nil + } +} + +func testAccCheckIbmSchematicsAgentPrsDestroy(s *terraform.State) error { + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_schematics_agent_prs" { + continue + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + + parts, err := flex.SepIdParts(rs.Primary.ID, "/") + if err != nil { + return err + } + + getAgentDataOptions.SetAgentID(parts[0]) + + agent, response, err := schematicsClient.GetAgentData(getAgentDataOptions) + + if err == nil && agent.RecentPrsJob != nil { + // Agent PRS Job can never really truely be deleted + return nil + } else if response.StatusCode != 404 { + return fmt.Errorf("Error checking for schematics_agent (%s) has been destroyed: %s", parts[0], err) + } + } + + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_test.go new file mode 100644 index 0000000000..b4fcbcc098 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_agent_test.go @@ -0,0 +1,251 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func TestAccIbmSchematicsAgentBasic(t *testing.T) { + var conf schematicsv1.AgentData + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + version := "1.0.0-beta2" + schematicsLocation := "us-south" + agentLocation := "eu-de" + nameUpdate := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + versionUpdate := "1.0.0-beta2" + schematicsLocationUpdate := "us-east" + agentLocationUpdate := "eu-gb" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentConfigBasic(name, version, schematicsLocation, agentLocation), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentExists("ibm_schematics_agent.schematics_agent_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "name", name), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "version", version), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "schematics_location", schematicsLocation), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "agent_location", agentLocation), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentConfigBasic(nameUpdate, versionUpdate, schematicsLocationUpdate, agentLocationUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "name", nameUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "version", versionUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "schematics_location", schematicsLocationUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "agent_location", agentLocationUpdate), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsAgentAllArgs(t *testing.T) { + var conf schematicsv1.AgentData + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + version := "1.0.0-beta2" + schematicsLocation := "us-south" + agentLocation := "eu-de" + nameUpdate := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + versionUpdate := "1.0.0-beta2" + schematicsLocationUpdate := "us-east" + agentLocationUpdate := "eu-gb" + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + descriptionUpdate := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsAgentDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentConfig(name, version, schematicsLocation, agentLocation, description), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsAgentExists("ibm_schematics_agent.schematics_agent_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "name", name), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "version", version), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "schematics_location", schematicsLocation), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "agent_location", agentLocation), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "description", description), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsAgentConfig(nameUpdate, versionUpdate, schematicsLocationUpdate, agentLocationUpdate, descriptionUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "name", nameUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "version", versionUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "schematics_location", schematicsLocationUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "agent_location", agentLocationUpdate), + resource.TestCheckResourceAttr("ibm_schematics_agent.schematics_agent_instance", "description", descriptionUpdate), + ), + }, + resource.TestStep{ + ResourceName: "ibm_schematics_agent.schematics_agent_instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIbmSchematicsAgentConfigBasic(name string, version string, schematicsLocation string, agentLocation string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent" "schematics_agent_instance" { + name = "%s" + resource_group = "Default" + version = "%s" + schematics_location = "%s" + agent_location = "%s" + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + } + `, name, version, schematicsLocation, agentLocation) +} + +func testAccCheckIbmSchematicsAgentConfig(name string, version string, schematicsLocation string, agentLocation string, description string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_agent" "schematics_agent_instance" { + name = "%s" + resource_group = "default" + version = "%s" + schematics_location = "%s" + agent_location = "%s" + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + description = "%s" + tags = "FIXME" + agent_metadata { + name = "purpose" + value = ["git", "terraform", "ansible"] + } + agent_inputs { + name = "name" + value = "value" + use_default = true + metadata { + type = "boolean" + aliases = [ "aliases" ] + description = "description" + cloud_data_type = "cloud_data_type" + default_value = "default_value" + link_status = "normal" + secure = true + immutable = true + hidden = true + required = true + options = [ "options" ] + min_value = 1 + max_value = 1 + min_length = 1 + max_length = 1 + matches = "matches" + position = 1 + group_by = "group_by" + source = "source" + } + link = "link" + } + user_state { + state = "enable" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + agent_kpi { + availability_indicator = "available" + lifecycle_indicator = "consistent" + percent_usage_indicator = "percent_usage_indicator" + application_indicators = [ null ] + infra_indicators = [ null ] + } + } + `, name, version, schematicsLocation, agentLocation, description) +} + +func testAccCheckIbmSchematicsAgentExists(n string, obj schematicsv1.AgentData) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + } + + getAgentDataOptions.SetAgentID(rs.Primary.ID) + + agentData, _, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err != nil { + return err + } + + obj = *agentData + return nil + } +} + +func testAccCheckIbmSchematicsAgentDestroy(s *terraform.State) error { + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_schematics_agent" { + continue + } + + getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ + XFeatureAgents: core.BoolPtr(true), + } + + getAgentDataOptions.SetAgentID(rs.Primary.ID) + + // Try to find the key + _, response, err := schematicsClient.GetAgentData(getAgentDataOptions) + if err == nil { + return nil + // TODO: uncomment the following lines of code once the agent delete actually deletes agentdoc + // return fmt.Errorf("schematics_agent still exists: %s", rs.Primary.ID) + } else if response.StatusCode != 404 { + return fmt.Errorf("Error checking for schematics_agent (%s) has been destroyed: %s", rs.Primary.ID, err) + } + } + + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_policy.go b/ibm/service/schematics/resource_ibm_schematics_policy.go new file mode 100644 index 0000000000..66f2d6cea5 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_policy.go @@ -0,0 +1,769 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func ResourceIbmSchematicsPolicy() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSchematicsPolicyCreate, + ReadContext: resourceIbmSchematicsPolicyRead, + UpdateContext: resourceIbmSchematicsPolicyUpdate, + DeleteContext: resourceIbmSchematicsPolicyDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Name of Schematics customization policy.", + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The description of Schematics customization policy.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The resource group name for the policy. By default, Policy will be created in `default` Resource Group.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "Tags for the Schematics customization policy.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "location": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "state": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "User defined status of the Schematics object.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "state": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + }, + "set_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Name of the User who set the state of the Object.", + }, + "set_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "When the User who set the state of the Object.", + }, + }, + }, + }, + "kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_schematics_policy", "kind"), + Description: "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + }, + "target": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "The objects for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "selector_kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Types of schematics object selector.", + }, + "selector_ids": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "selector_scope": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Name of the Schematics automation resource.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The tag based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "resource_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The resource group based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "locations": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The location based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + }, + }, + }, + "parameter": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "The parameter to tune the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "agent_assignment_policy_parameter": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "Parameters for the `agent_assignment_policy`.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "selector_kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Types of schematics object selector.", + }, + "selector_ids": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "selector_scope": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Name of the Schematics automation resource.", + }, + "tags": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The tag based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "resource_groups": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The resource group based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "locations": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The location based selector.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "scoped_resources": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Description: "List of scoped Schematics resources targeted by the policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kind": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Name of the Schematics automation resource.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Schematics resource Id.", + }, + }, + }, + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy CRN.", + }, + "account": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The Account id.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy creation time.", + }, + "created_by": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user who created the policy.", + }, + "updated_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy updation time.", + }, + }, + } +} + +func ResourceIbmSchematicsPolicyValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "kind", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: "agent_assignment_policy", + }, + ) + + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_policy", Schema: validateSchema} + return &resourceValidator +} + +func resourceIbmSchematicsPolicyCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + createPolicyOptions := &schematicsv1.CreatePolicyOptions{} + + if _, ok := d.GetOk("name"); ok { + createPolicyOptions.SetName(d.Get("name").(string)) + } + if _, ok := d.GetOk("description"); ok { + createPolicyOptions.SetDescription(d.Get("description").(string)) + } + if _, ok := d.GetOk("resource_group"); ok { + createPolicyOptions.SetResourceGroup(d.Get("resource_group").(string)) + } + if _, ok := d.GetOk("tags"); ok { + createPolicyOptions.SetTags(d.Get("tags").([]string)) + } + if _, ok := d.GetOk("location"); ok { + createPolicyOptions.SetLocation(d.Get("location").(string)) + } + if _, ok := d.GetOk("state"); ok { + stateModel, err := resourceIbmSchematicsPolicyMapToUserState(d.Get("state.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createPolicyOptions.SetState(stateModel) + } + if _, ok := d.GetOk("kind"); ok { + createPolicyOptions.SetKind(d.Get("kind").(string)) + } + if _, ok := d.GetOk("target"); ok { + targetModel, err := resourceIbmSchematicsPolicyMapToPolicyObjects(d.Get("target.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createPolicyOptions.SetTarget(targetModel) + } + if _, ok := d.GetOk("parameter"); ok { + parameterModel, err := resourceIbmSchematicsPolicyMapToPolicyParameter(d.Get("parameter.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + createPolicyOptions.SetParameter(parameterModel) + } + if _, ok := d.GetOk("scoped_resources"); ok { + var scopedResources []schematicsv1.ScopedResource + for _, e := range d.Get("scoped_resources").([]interface{}) { + value := e.(map[string]interface{}) + scopedResourcesItem, err := resourceIbmSchematicsPolicyMapToScopedResource(value) + if err != nil { + return diag.FromErr(err) + } + scopedResources = append(scopedResources, *scopedResourcesItem) + } + createPolicyOptions.SetScopedResources(scopedResources) + } + + policy, response, err := schematicsClient.CreatePolicyWithContext(context, createPolicyOptions) + if err != nil { + log.Printf("[DEBUG] CreatePolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("CreatePolicyWithContext failed %s\n%s", err, response)) + } + + d.SetId(*policy.ID) + + return resourceIbmSchematicsPolicyRead(context, d, meta) +} + +func resourceIbmSchematicsPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getPolicyOptions := &schematicsv1.GetPolicyOptions{} + + getPolicyOptions.SetPolicyID(d.Id()) + + policy, response, err := schematicsClient.GetPolicyWithContext(context, getPolicyOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetPolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetPolicyWithContext failed %s\n%s", err, response)) + } + + if err = d.Set("name", policy.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("description", policy.Description); err != nil { + return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + } + if err = d.Set("resource_group", policy.ResourceGroup); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + } + if policy.Tags != nil { + if err = d.Set("tags", policy.Tags); err != nil { + return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) + } + } + if err = d.Set("location", policy.Location); err != nil { + return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + } + if policy.State != nil { + stateMap, err := resourceIbmSchematicsPolicyUserStateToMap(policy.State) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("state", []map[string]interface{}{stateMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + } + } + if err = d.Set("kind", policy.Kind); err != nil { + return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + } + if policy.Target != nil { + targetMap, err := resourceIbmSchematicsPolicyPolicyObjectsToMap(policy.Target) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("target", []map[string]interface{}{targetMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting target: %s", err)) + } + } + if policy.Parameter != nil { + parameterMap, err := resourceIbmSchematicsPolicyPolicyParameterToMap(policy.Parameter) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("parameter", []map[string]interface{}{parameterMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting parameter: %s", err)) + } + } + scopedResources := []map[string]interface{}{} + if policy.ScopedResources != nil { + for _, scopedResourcesItem := range policy.ScopedResources { + scopedResourcesItemMap, err := resourceIbmSchematicsPolicyScopedResourceToMap(&scopedResourcesItem) + if err != nil { + return diag.FromErr(err) + } + scopedResources = append(scopedResources, scopedResourcesItemMap) + } + } + if err = d.Set("scoped_resources", scopedResources); err != nil { + return diag.FromErr(fmt.Errorf("Error setting scoped_resources: %s", err)) + } + if err = d.Set("crn", policy.Crn); err != nil { + return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + } + if err = d.Set("account", policy.Account); err != nil { + return diag.FromErr(fmt.Errorf("Error setting account: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(policy.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("created_by", policy.CreatedBy); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(policy.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + } + + return nil +} + +func resourceIbmSchematicsPolicyUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + updatePolicyOptions := &schematicsv1.UpdatePolicyOptions{} + + updatePolicyOptions.SetPolicyID(d.Id()) + + hasChange := false + + if d.HasChange("name") { + updatePolicyOptions.SetName(d.Get("name").(string)) + hasChange = true + } + if d.HasChange("description") { + updatePolicyOptions.SetDescription(d.Get("description").(string)) + hasChange = true + } + if d.HasChange("resource_group") { + updatePolicyOptions.SetResourceGroup(d.Get("resource_group").(string)) + hasChange = true + } + if d.HasChange("tags") { + // TODO: handle Tags of type TypeList -- not primitive, not model + hasChange = true + } + if d.HasChange("location") { + updatePolicyOptions.SetLocation(d.Get("location").(string)) + hasChange = true + } + if d.HasChange("state") { + state, err := resourceIbmSchematicsPolicyMapToUserState(d.Get("state.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updatePolicyOptions.SetState(state) + hasChange = true + } + if d.HasChange("kind") { + updatePolicyOptions.SetKind(d.Get("kind").(string)) + hasChange = true + } + if d.HasChange("target") { + target, err := resourceIbmSchematicsPolicyMapToPolicyObjects(d.Get("target.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updatePolicyOptions.SetTarget(target) + hasChange = true + } + if d.HasChange("parameter") { + parameter, err := resourceIbmSchematicsPolicyMapToPolicyParameter(d.Get("parameter.0").(map[string]interface{})) + if err != nil { + return diag.FromErr(err) + } + updatePolicyOptions.SetParameter(parameter) + hasChange = true + } + if d.HasChange("scoped_resources") { + // TODO: handle ScopedResources of type TypeList -- not primitive, not model + hasChange = true + } + + if hasChange { + _, response, err := schematicsClient.UpdatePolicyWithContext(context, updatePolicyOptions) + if err != nil { + log.Printf("[DEBUG] UpdatePolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("UpdatePolicyWithContext failed %s\n%s", err, response)) + } + } + + return resourceIbmSchematicsPolicyRead(context, d, meta) +} + +func resourceIbmSchematicsPolicyDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + deletePolicyOptions := &schematicsv1.DeletePolicyOptions{} + + deletePolicyOptions.SetPolicyID(d.Id()) + + response, err := schematicsClient.DeletePolicyWithContext(context, deletePolicyOptions) + if err != nil { + log.Printf("[DEBUG] DeletePolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeletePolicyWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} + +func resourceIbmSchematicsPolicyMapToUserState(modelMap map[string]interface{}) (*schematicsv1.UserState, error) { + model := &schematicsv1.UserState{} + if modelMap["state"] != nil && modelMap["state"].(string) != "" { + model.State = core.StringPtr(modelMap["state"].(string)) + } + if modelMap["set_by"] != nil && modelMap["set_by"].(string) != "" { + model.SetBy = core.StringPtr(modelMap["set_by"].(string)) + } + if modelMap["set_at"] != nil { + + } + return model, nil +} + +func resourceIbmSchematicsPolicyMapToPolicyObjects(modelMap map[string]interface{}) (*schematicsv1.PolicyObjects, error) { + model := &schematicsv1.PolicyObjects{} + if modelMap["selector_kind"] != nil && modelMap["selector_kind"].(string) != "" { + model.SelectorKind = core.StringPtr(modelMap["selector_kind"].(string)) + } + if modelMap["selector_ids"] != nil { + selectorIds := []string{} + for _, selectorIdsItem := range modelMap["selector_ids"].([]interface{}) { + selectorIds = append(selectorIds, selectorIdsItem.(string)) + } + model.SelectorIds = selectorIds + } + if modelMap["selector_scope"] != nil { + selectorScope := []schematicsv1.PolicyObjectSelector{} + for _, selectorScopeItem := range modelMap["selector_scope"].([]interface{}) { + selectorScopeItemModel, err := resourceIbmSchematicsPolicyMapToPolicyObjectSelector(selectorScopeItem.(map[string]interface{})) + if err != nil { + return model, err + } + selectorScope = append(selectorScope, *selectorScopeItemModel) + } + model.SelectorScope = selectorScope + } + return model, nil +} + +func resourceIbmSchematicsPolicyMapToPolicyObjectSelector(modelMap map[string]interface{}) (*schematicsv1.PolicyObjectSelector, error) { + model := &schematicsv1.PolicyObjectSelector{} + if modelMap["kind"] != nil && modelMap["kind"].(string) != "" { + model.Kind = core.StringPtr(modelMap["kind"].(string)) + } + if modelMap["tags"] != nil { + tags := []string{} + for _, tagsItem := range modelMap["tags"].([]interface{}) { + tags = append(tags, tagsItem.(string)) + } + model.Tags = tags + } + if modelMap["resource_groups"] != nil { + resourceGroups := []string{} + for _, resourceGroupsItem := range modelMap["resource_groups"].([]interface{}) { + resourceGroups = append(resourceGroups, resourceGroupsItem.(string)) + } + model.ResourceGroups = resourceGroups + } + if modelMap["locations"] != nil { + locations := []string{} + for _, locationsItem := range modelMap["locations"].([]interface{}) { + locations = append(locations, locationsItem.(string)) + } + model.Locations = locations + } + return model, nil +} + +func resourceIbmSchematicsPolicyMapToPolicyParameter(modelMap map[string]interface{}) (*schematicsv1.PolicyParameter, error) { + model := &schematicsv1.PolicyParameter{} + if modelMap["agent_assignment_policy_parameter"] != nil && len(modelMap["agent_assignment_policy_parameter"].([]interface{})) > 0 { + AgentAssignmentPolicyParameterModel, err := resourceIbmSchematicsPolicyMapToAgentAssignmentPolicyParameter(modelMap["agent_assignment_policy_parameter"].([]interface{})[0].(map[string]interface{})) + if err != nil { + return model, err + } + model.AgentAssignmentPolicyParameter = AgentAssignmentPolicyParameterModel + } + return model, nil +} + +func resourceIbmSchematicsPolicyMapToAgentAssignmentPolicyParameter(modelMap map[string]interface{}) (*schematicsv1.AgentAssignmentPolicyParameter, error) { + model := &schematicsv1.AgentAssignmentPolicyParameter{} + if modelMap["selector_kind"] != nil && modelMap["selector_kind"].(string) != "" { + model.SelectorKind = core.StringPtr(modelMap["selector_kind"].(string)) + } + if modelMap["selector_ids"] != nil { + selectorIds := []string{} + for _, selectorIdsItem := range modelMap["selector_ids"].([]interface{}) { + selectorIds = append(selectorIds, selectorIdsItem.(string)) + } + model.SelectorIds = selectorIds + } + if modelMap["selector_scope"] != nil { + selectorScope := []schematicsv1.PolicyObjectSelector{} + for _, selectorScopeItem := range modelMap["selector_scope"].([]interface{}) { + selectorScopeItemModel, err := resourceIbmSchematicsPolicyMapToPolicyObjectSelector(selectorScopeItem.(map[string]interface{})) + if err != nil { + return model, err + } + selectorScope = append(selectorScope, *selectorScopeItemModel) + } + model.SelectorScope = selectorScope + } + return model, nil +} + +func resourceIbmSchematicsPolicyMapToScopedResource(modelMap map[string]interface{}) (*schematicsv1.ScopedResource, error) { + model := &schematicsv1.ScopedResource{} + if modelMap["kind"] != nil && modelMap["kind"].(string) != "" { + model.Kind = core.StringPtr(modelMap["kind"].(string)) + } + if modelMap["id"] != nil && modelMap["id"].(string) != "" { + model.ID = core.StringPtr(modelMap["id"].(string)) + } + return model, nil +} + +func resourceIbmSchematicsPolicyUserStateToMap(model *schematicsv1.UserState) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.State != nil { + modelMap["state"] = model.State + } + if model.SetBy != nil { + modelMap["set_by"] = model.SetBy + } + if model.SetAt != nil { + modelMap["set_at"] = model.SetAt.String() + } + return modelMap, nil +} + +func resourceIbmSchematicsPolicyPolicyObjectsToMap(model *schematicsv1.PolicyObjects) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.SelectorKind != nil { + modelMap["selector_kind"] = model.SelectorKind + } + if model.SelectorIds != nil { + modelMap["selector_ids"] = model.SelectorIds + } + if model.SelectorScope != nil { + selectorScope := []map[string]interface{}{} + for _, selectorScopeItem := range model.SelectorScope { + selectorScopeItemMap, err := resourceIbmSchematicsPolicyPolicyObjectSelectorToMap(&selectorScopeItem) + if err != nil { + return modelMap, err + } + selectorScope = append(selectorScope, selectorScopeItemMap) + } + modelMap["selector_scope"] = selectorScope + } + return modelMap, nil +} + +func resourceIbmSchematicsPolicyPolicyObjectSelectorToMap(model *schematicsv1.PolicyObjectSelector) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Kind != nil { + modelMap["kind"] = model.Kind + } + if model.Tags != nil { + modelMap["tags"] = model.Tags + } + if model.ResourceGroups != nil { + modelMap["resource_groups"] = model.ResourceGroups + } + if model.Locations != nil { + modelMap["locations"] = model.Locations + } + return modelMap, nil +} + +func resourceIbmSchematicsPolicyPolicyParameterToMap(model *schematicsv1.PolicyParameter) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AgentAssignmentPolicyParameter != nil { + agentAssignmentPolicyParameterMap, err := resourceIbmSchematicsPolicyAgentAssignmentPolicyParameterToMap(model.AgentAssignmentPolicyParameter) + if err != nil { + return modelMap, err + } + modelMap["agent_assignment_policy_parameter"] = []map[string]interface{}{agentAssignmentPolicyParameterMap} + } + return modelMap, nil +} + +func resourceIbmSchematicsPolicyAgentAssignmentPolicyParameterToMap(model *schematicsv1.AgentAssignmentPolicyParameter) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.SelectorKind != nil { + modelMap["selector_kind"] = model.SelectorKind + } + if model.SelectorIds != nil { + modelMap["selector_ids"] = model.SelectorIds + } + if model.SelectorScope != nil { + selectorScope := []map[string]interface{}{} + for _, selectorScopeItem := range model.SelectorScope { + selectorScopeItemMap, err := resourceIbmSchematicsPolicyPolicyObjectSelectorToMap(&selectorScopeItem) + if err != nil { + return modelMap, err + } + selectorScope = append(selectorScope, selectorScopeItemMap) + } + modelMap["selector_scope"] = selectorScope + } + return modelMap, nil +} + +func resourceIbmSchematicsPolicyScopedResourceToMap(model *schematicsv1.ScopedResource) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Kind != nil { + modelMap["kind"] = model.Kind + } + if model.ID != nil { + modelMap["id"] = model.ID + } + return modelMap, nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_policy_test.go b/ibm/service/schematics/resource_ibm_schematics_policy_test.go new file mode 100644 index 0000000000..dbae396bd5 --- /dev/null +++ b/ibm/service/schematics/resource_ibm_schematics_policy_test.go @@ -0,0 +1,196 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func TestAccIbmSchematicsPolicyBasic(t *testing.T) { + var conf schematicsv1.Policy + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + kind := "agent_assignment_policy" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsPolicyDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsPolicyConfigBasic(name, kind), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsPolicyExists("ibm_schematics_policy.schematics_policy_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "name", name), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "kind", kind), + ), + }, + }, + }) +} + +func TestAccIbmSchematicsPolicyAllArgs(t *testing.T) { + var conf schematicsv1.Policy + name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + resourceGroup := fmt.Sprintf("tf_resource_group_%d", acctest.RandIntRange(10, 100)) + location := "us-south" + kind := "agent_assignment_policy" + nameUpdate := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + descriptionUpdate := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + resourceGroupUpdate := fmt.Sprintf("tf_resource_group_%d", acctest.RandIntRange(10, 100)) + locationUpdate := "eu-de" + kindUpdate := "agent_assignment_policy" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIbmSchematicsPolicyDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIbmSchematicsPolicyConfig(name, description, resourceGroup, location, kind), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIbmSchematicsPolicyExists("ibm_schematics_policy.schematics_policy_instance", conf), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "name", name), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "description", description), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "resource_group", resourceGroup), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "location", location), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "kind", kind), + ), + }, + resource.TestStep{ + Config: testAccCheckIbmSchematicsPolicyConfig(nameUpdate, descriptionUpdate, resourceGroupUpdate, locationUpdate, kindUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "name", nameUpdate), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "description", descriptionUpdate), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "resource_group", resourceGroupUpdate), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "location", locationUpdate), + resource.TestCheckResourceAttr("ibm_schematics_policy.schematics_policy_instance", "kind", kindUpdate), + ), + }, + resource.TestStep{ + ResourceName: "ibm_schematics_policy.schematics_policy_instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIbmSchematicsPolicyConfigBasic(name string, kind string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_policy" "schematics_policy_instance" { + name = "%s" + kind = "%s" + } + `, name, kind) +} + +func testAccCheckIbmSchematicsPolicyConfig(name string, description string, resourceGroup string, location string, kind string) string { + return fmt.Sprintf(` + + resource "ibm_schematics_policy" "schematics_policy_instance" { + name = "%s" + description = "%s" + resource_group = "%s" + tags = "FIXME" + location = "%s" + state { + state = "draft" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + kind = "%s" + target { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + parameter { + agent_assignment_policy_parameter { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + } + scoped_resources { + kind = "workspace" + id = "id" + } + } + `, name, description, resourceGroup, location, kind) +} + +func testAccCheckIbmSchematicsPolicyExists(n string, obj schematicsv1.Policy) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + + getPolicyOptions := &schematicsv1.GetPolicyOptions{} + + getPolicyOptions.SetPolicyID(rs.Primary.ID) + + policy, _, err := schematicsClient.GetPolicy(getPolicyOptions) + if err != nil { + return err + } + + obj = *policy + return nil + } +} + +func testAccCheckIbmSchematicsPolicyDestroy(s *terraform.State) error { + schematicsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).SchematicsV1() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_schematics_policy" { + continue + } + + getPolicyOptions := &schematicsv1.GetPolicyOptions{} + + getPolicyOptions.SetPolicyID(rs.Primary.ID) + + // Try to find the key + _, response, err := schematicsClient.GetPolicy(getPolicyOptions) + + if err == nil { + return fmt.Errorf("schematics_policy still exists: %s", rs.Primary.ID) + } else if response.StatusCode != 404 { + return fmt.Errorf("Error checking for schematics_policy (%s) has been destroyed: %s", rs.Primary.ID, err) + } + } + + return nil +} diff --git a/ibm/service/schematics/resource_ibm_schematics_workspace.go b/ibm/service/schematics/resource_ibm_schematics_workspace.go index eb69c76cc4..b6309bf51d 100644 --- a/ibm/service/schematics/resource_ibm_schematics_workspace.go +++ b/ibm/service/schematics/resource_ibm_schematics_workspace.go @@ -576,7 +576,7 @@ func ResourceIBMSchematicsWorkspaceValidator() *validate.ResourceValidator { Identifier: schematicsWorkspaceTemplateType, ValidateFunctionIdentifier: validate.ValidateRegexp, Type: validate.TypeString, - Regexp: `^terraform_v(?:0\.11|0\.12|0\.13|0\.14|0\.15|1\.0|1\.1|1\.2|1\.3|1\.4)(?:\.\d+)?$`, + Regexp: `^terraform_v(?:0\.11|0\.12|0\.13|0\.14|0\.15|1\.0|1\.1|1\.2|1\.3|1\.4|1\.5)(?:\.\d+)?$`, Default: "[]", Optional: true}) @@ -807,9 +807,9 @@ func resourceIBMSchematicsWorkspaceMapToSharedTargetData(sharedTargetDataMap map sharedTargetData.ClusterType = core.StringPtr(sharedTargetDataMap["cluster_type"].(string)) } if sharedTargetDataMap["entitlement_keys"] != nil { - entitlementKeys := []interface{}{} - for _, entitlementKeysItem := range sharedTargetDataMap["entitlement_keys"].([]interface{}) { - entitlementKeys = append(entitlementKeys, entitlementKeysItem.(interface{})) + entitlementKeys := []map[string]interface{}{} + for _, entitlementKeysItem := range sharedTargetDataMap["entitlement_keys"].([]map[string]interface{}) { + entitlementKeys = append(entitlementKeys, entitlementKeysItem) } sharedTargetData.EntitlementKeys = entitlementKeys } @@ -836,9 +836,9 @@ func resourceIBMSchematicsWorkspaceMapToTemplateSourceDataRequest(templateSource templateSourceDataRequest := schematicsv1.TemplateSourceDataRequest{} if templateSourceDataRequestMap["env_values"] != nil { - envValues := []interface{}{} - for _, envValuesItem := range templateSourceDataRequestMap["env_values"].([]interface{}) { - envValues = append(envValues, envValuesItem.(interface{})) + envValues := []map[string]interface{}{} + for _, envValuesItem := range templateSourceDataRequestMap["env_values"].([]map[string]interface{}) { + envValues = append(envValues, envValuesItem) } templateSourceDataRequest.EnvValues = envValues } @@ -861,10 +861,9 @@ func resourceIBMSchematicsWorkspaceMapToTemplateSourceDataRequest(templateSource templateSourceDataRequest.Values = core.StringPtr(templateSourceDataRequestMap["values"].(string)) } if templateSourceDataRequestMap["values_metadata"] != nil { - valuesMetadata := make([]schematicsv1.VariableMetadata, 0) - for _, valuesMetadataItem := range templateSourceDataRequestMap["values_metadata"].([]interface{}) { - valuesMetadataItemModel := resourceIBMSchematicsWorkspaceMapToWorkspaceValuesMetadataRequest(valuesMetadataItem.(map[string]interface{})) - valuesMetadata = append(valuesMetadata, valuesMetadataItemModel) + valuesMetadata := []map[string]interface{}{} + for _, valuesMetadataItem := range templateSourceDataRequestMap["values_metadata"].([]map[string]interface{}) { + valuesMetadata = append(valuesMetadata, valuesMetadataItem) } templateSourceDataRequest.ValuesMetadata = valuesMetadata } @@ -1435,8 +1434,7 @@ func resourceIBMSchematicsWorkspaceTemplateSourceDataResponseToMap(templateSourc if templateSourceDataResponse.ValuesMetadata != nil { valuesMetadata := []map[string]interface{}{} for _, valuesMetadataItem := range templateSourceDataResponse.ValuesMetadata { - valuesMetadataItemMap := dataSourceIbmSchematicsWorkspaceVariableMetadataToMap(&valuesMetadataItem) - valuesMetadata = append(valuesMetadata, valuesMetadataItemMap) + valuesMetadata = append(valuesMetadata, valuesMetadataItem) } templateSourceDataResponseMap["values_metadata"] = valuesMetadata } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret.go b/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret.go index 39a1f2ed4d..7572a8d2f0 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmArbitrarySecret() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmArbitrarySecret() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -123,29 +131,16 @@ func DataSourceIbmSmArbitrarySecret() *schema.Resource { } func dataSourceIbmSmArbitrarySecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - secretIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + secret, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, ArbitrarySecretType) + if diagError != nil { + return diagError } - arbitrarySecret := secretIntf.(*secretsmanagerv2.ArbitrarySecret) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + arbitrarySecret := secret.(*secretsmanagerv2.ArbitrarySecret) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *arbitrarySecret.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret_test.go index d5a1064749..9675cb28a4 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_arbitrary_secret_test.go @@ -29,6 +29,8 @@ func TestAccIbmSmArbitrarySecretDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_arbitrary_secret.sm_arbitrary_secret", "secret_type"), resource.TestCheckResourceAttrSet("data.ibm_sm_arbitrary_secret.sm_arbitrary_secret", "updated_at"), resource.TestCheckResourceAttrSet("data.ibm_sm_arbitrary_secret.sm_arbitrary_secret", "versions_total"), + resource.TestCheckResourceAttrSet("data.ibm_sm_arbitrary_secret.sm_arbitrary_secret_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_arbitrary_secret.sm_arbitrary_secret_by_name", "secret_group_name"), ), }, }, @@ -53,5 +55,12 @@ func testAccCheckIbmSmArbitrarySecretDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_arbitrary_secret.sm_arbitrary_secret_instance.secret_id } - `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) + + data "ibm_sm_arbitrary_secret" "sm_arbitrary_secret_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_arbitrary_secret.sm_arbitrary_secret_instance.name + secret_group_name = "default" + } + `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_iam_credentials_secret.go b/ibm/service/secretsmanager/data_source_ibm_sm_iam_credentials_secret.go index 97fad84689..75ad6a8306 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_iam_credentials_secret.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_iam_credentials_secret.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmIamCredentialsSecret() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmIamCredentialsSecret() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -185,29 +193,16 @@ func DataSourceIbmSmIamCredentialsSecret() *schema.Resource { } func dataSourceIbmSmIamCredentialsSecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - iAMCredentialsSecretIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + iAMCredentialsSecretIntf, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, IAMCredentialsSecretType) + if diagError != nil { + return diagError } - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) iAMCredentialsSecret := iAMCredentialsSecretIntf.(*secretsmanagerv2.IAMCredentialsSecret) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *iAMCredentialsSecret.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate.go b/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate.go index f970710277..cb1b9f4f6c 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmImportedCertificate() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmImportedCertificate() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -197,29 +205,15 @@ func DataSourceIbmSmImportedCertificate() *schema.Resource { } func dataSourceIbmSmImportedCertificateRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - - importedCertificateIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + importedCertificateIntf, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, ImportedCertSecretType) + if diagError != nil { + return diagError } importedCertificate := importedCertificateIntf.(*secretsmanagerv2.ImportedCertificate) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *importedCertificate.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate_test.go index c4e2727092..76c9ba5b6a 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_imported_certificate_test.go @@ -37,6 +37,8 @@ func TestAccIbmSmImportedCertificateDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_imported_certificate.sm_imported_certificate", "serial_number"), resource.TestCheckResourceAttrSet("data.ibm_sm_imported_certificate.sm_imported_certificate", "validity.#"), resource.TestCheckResourceAttrSet("data.ibm_sm_imported_certificate.sm_imported_certificate", "certificate"), + resource.TestCheckResourceAttrSet("data.ibm_sm_imported_certificate.sm_imported_certificate_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_imported_certificate.sm_imported_certificate_by_name", "secret_group_name"), ), }, }, @@ -61,5 +63,12 @@ func testAccCheckIbmSmImportedCertificateDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_imported_certificate.sm_imported_certificate_instance.secret_id } - `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerImportedCertificatePathToCertificate, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) + + data "ibm_sm_imported_certificate" "sm_imported_certificate_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_imported_certificate.sm_imported_certificate_instance.name + secret_group_name = "default" + } + `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerImportedCertificatePathToCertificate, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret.go b/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret.go index 0f958d4401..49e78f615f 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmKvSecret() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmKvSecret() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -121,29 +129,16 @@ func DataSourceIbmSmKvSecret() *schema.Resource { } func dataSourceIbmSmKvSecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - kVSecretIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + secret, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, KvSecretType) + if diagError != nil { + return diagError } - kVSecret := kVSecretIntf.(*secretsmanagerv2.KVSecret) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + kVSecret := secret.(*secretsmanagerv2.KVSecret) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *kVSecret.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret_test.go index 158241b2d9..072af95792 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_kv_secret_test.go @@ -30,6 +30,8 @@ func TestAccIbmSmKvSecretDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_kv_secret.sm_kv_secret", "updated_at"), resource.TestCheckResourceAttrSet("data.ibm_sm_kv_secret.sm_kv_secret", "versions_total"), resource.TestCheckResourceAttrSet("data.ibm_sm_kv_secret.sm_kv_secret", "data.%"), + resource.TestCheckResourceAttrSet("data.ibm_sm_kv_secret.sm_kv_secret_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_kv_secret.sm_kv_secret_by_name", "secret_group_name"), ), }, }, @@ -54,5 +56,12 @@ func testAccCheckIbmSmKvSecretDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_kv_secret.sm_kv_secret_instance.secret_id } - `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) + + data "ibm_sm_kv_secret" "sm_kv_secret_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_kv_secret.sm_kv_secret_instance.name + secret_group_name = "default" + } + `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate.go b/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate.go index bb8c07068f..31043b4a78 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmPrivateCertificate() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmPrivateCertificate() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -250,30 +258,16 @@ func DataSourceIbmSmPrivateCertificate() *schema.Resource { } func dataSourceIbmSmPrivateCertificateRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - - privateCertificateIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + privateCertificateIntf, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, PrivateCertSecretType) + if diagError != nil { + return diagError } privateCertificate := privateCertificateIntf.(*secretsmanagerv2.PrivateCertificate) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *privateCertificate.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate_test.go index d714a0a499..cfe6ad93c3 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_private_certificate_test.go @@ -37,6 +37,8 @@ func TestAccIbmSmPrivateCertificateDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_private_certificate.sm_private_certificate", "validity.#"), resource.TestCheckResourceAttrSet("data.ibm_sm_private_certificate.sm_private_certificate", "certificate"), resource.TestCheckResourceAttrSet("data.ibm_sm_private_certificate.sm_private_certificate", "private_key"), + resource.TestCheckResourceAttrSet("data.ibm_sm_private_certificate.sm_private_certificate_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_private_certificate.sm_private_certificate_by_name", "secret_group_name"), ), }, }, @@ -88,8 +90,15 @@ func testAccCheckIbmSmPrivateCertificateDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_private_certificate.sm_private_certificate_instance.secret_id } + + data "ibm_sm_private_certificate" "sm_private_certificate_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_private_certificate.sm_private_certificate_instance.name + secret_group_name = "default" + } `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, - acc.SecretsManagerInstanceRegion) + acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate.go b/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate.go index 612fe7bcf4..20bfe5e1dd 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,11 +19,12 @@ func DataSourceIbmSmPublicCertificate() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, - "created_by": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -74,15 +72,24 @@ func DataSourceIbmSmPublicCertificate() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -300,30 +307,16 @@ func DataSourceIbmSmPublicCertificate() *schema.Resource { } func dataSourceIbmSmPublicCertificateSecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) - } - - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - - publicCertificateIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + publicCertificateIntf, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, PublicCertSecretType) + if diagError != nil { + return diagError } publicCertificate := publicCertificateIntf.(*secretsmanagerv2.PublicCertificate) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *publicCertificate.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate_test.go index f267181ee3..0b97d93b51 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_public_certificate_test.go @@ -30,6 +30,8 @@ func TestAccIbmSmPublicCertificateDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_public_certificate.sm_public_certificate", "common_name"), resource.TestCheckResourceAttrSet("data.ibm_sm_public_certificate.sm_public_certificate", "key_algorithm"), resource.TestCheckResourceAttrSet("data.ibm_sm_public_certificate.sm_public_certificate", "rotation.#"), + resource.TestCheckResourceAttrSet("data.ibm_sm_public_certificate.sm_public_certificate_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_public_certificate.sm_public_certificate_by_name", "secret_group_name"), ), }, }, @@ -68,8 +70,15 @@ func testAccCheckIbmSmPublicCertificateDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_public_certificate.sm_public_certificate_instance.secret_id } + + data "ibm_sm_public_certificate" "sm_public_certificate_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_public_certificate.sm_public_certificate_instance.name + secret_group_name = "default" + } `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerPublicCertificateLetsEncryptEnvironment, acc.SecretsManagerPublicCertificateLetsEncryptPrivateKey, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerPublicCertificateCisCrn, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, generatePublicCertCommonName(), - acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) + acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret.go b/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret.go index aa45838aaa..5a9fa84aff 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret.go @@ -6,12 +6,9 @@ package secretsmanager import ( "context" "fmt" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" ) @@ -22,9 +19,11 @@ func DataSourceIbmSmUsernamePasswordSecret() *schema.Resource { Schema: map[string]*schema.Schema{ "secret_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The ID of the secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + Description: "The ID of the secret.", }, "created_by": &schema.Schema{ Type: schema.TypeString, @@ -73,15 +72,24 @@ func DataSourceIbmSmUsernamePasswordSecret() *schema.Resource { Description: "The number of locks of the secret.", }, "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The human-readable name of your secret.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"secret_id", "name"}, + RequiredWith: []string{"secret_group_name"}, + Description: "The human-readable name of your secret.", }, "secret_group_id": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "A v4 UUID identifier, or `default` secret group.", }, + "secret_group_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + RequiredWith: []string{"name"}, + Description: "The human-readable name of your secret group.", + }, "secret_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -162,29 +170,16 @@ func DataSourceIbmSmUsernamePasswordSecret() *schema.Resource { } func dataSourceIbmSmUsernamePasswordSecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() - if err != nil { - return diag.FromErr(err) + secret, region, instanceId, diagError := getSecretByIdOrByName(context, d, meta, UsernamePasswordSecretType) + if diagError != nil { + return diagError } - region := getRegion(secretsManagerClient, d) - instanceId := d.Get("instance_id").(string) - secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) - - getSecretOptions := &secretsmanagerv2.GetSecretOptions{} - - secretId := d.Get("secret_id").(string) - getSecretOptions.SetID(secretId) - - usernamePasswordSecretIntf, response, err := secretsManagerClient.GetSecretWithContext(context, getSecretOptions) - if err != nil { - log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) - } - usernamePasswordSecret := usernamePasswordSecretIntf.(*secretsmanagerv2.UsernamePasswordSecret) + usernamePasswordSecret := secret.(*secretsmanagerv2.UsernamePasswordSecret) - d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, secretId)) + d.SetId(fmt.Sprintf("%s/%s/%s", region, instanceId, *usernamePasswordSecret.ID)) + var err error if err = d.Set("region", region); err != nil { return diag.FromErr(fmt.Errorf("Error setting region: %s", err)) } diff --git a/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret_test.go b/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret_test.go index 4a81435667..57c04216e8 100644 --- a/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret_test.go +++ b/ibm/service/secretsmanager/data_source_ibm_sm_username_password_secret_test.go @@ -32,6 +32,8 @@ func TestAccIbmSmUsernamePasswordSecretDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_sm_username_password_secret.sm_username_password_secret", "rotation.#"), resource.TestCheckResourceAttrSet("data.ibm_sm_username_password_secret.sm_username_password_secret", "username"), resource.TestCheckResourceAttrSet("data.ibm_sm_username_password_secret.sm_username_password_secret", "password"), + resource.TestCheckResourceAttrSet("data.ibm_sm_username_password_secret.sm_username_password_secret_by_name", "name"), + resource.TestCheckResourceAttrSet("data.ibm_sm_username_password_secret.sm_username_password_secret_by_name", "secret_group_name"), ), }, }, @@ -62,5 +64,12 @@ func testAccCheckIbmSmUsernamePasswordSecretDataSourceConfigBasic() string { region = "%s" secret_id = ibm_sm_username_password_secret.sm_username_password_secret_instance.secret_id } - `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) + + data "ibm_sm_username_password_secret" "sm_username_password_secret_by_name" { + instance_id = "%s" + region = "%s" + name = ibm_sm_username_password_secret.sm_username_password_secret_instance.name + secret_group_name = "default" + } + `, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion, acc.SecretsManagerInstanceID, acc.SecretsManagerInstanceRegion) } diff --git a/ibm/service/secretsmanager/resource_ibm_sm_public_certificate.go b/ibm/service/secretsmanager/resource_ibm_sm_public_certificate.go index 38a9853b6e..fb268ad8ed 100644 --- a/ibm/service/secretsmanager/resource_ibm_sm_public_certificate.go +++ b/ibm/service/secretsmanager/resource_ibm_sm_public_certificate.go @@ -781,8 +781,9 @@ func resourceIbmSmPublicCertificateMapToSecretPrototype(d *schema.ResourceData) model.Dns = core.StringPtr(d.Get("dns").(string)) } } - if _, ok := d.GetOk("bundle_certs"); ok { - model.BundleCerts = core.BoolPtr(d.Get("bundle_certs").(bool)) + bundleCerts, ok := d.GetOkExists("bundle_certs") + if ok { + model.BundleCerts = core.BoolPtr(bundleCerts.(bool)) } if _, ok := d.GetOk("rotation"); ok { RotationModel, err := resourceIbmSmPublicCertificateMapToPublicCertificateRotationPolicy(d.Get("rotation").([]interface{})[0].(map[string]interface{})) diff --git a/ibm/service/secretsmanager/utils.go b/ibm/service/secretsmanager/utils.go index 5de0e6ccd9..a00f44c9af 100644 --- a/ibm/service/secretsmanager/utils.go +++ b/ibm/service/secretsmanager/utils.go @@ -1,16 +1,31 @@ package secretsmanager import ( + "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2" "github.com/go-openapi/strfmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "log" "os" "strconv" "strings" "time" ) +const ( + ArbitrarySecretType = "arbitrary" + UsernamePasswordSecretType = "username_password" + IAMCredentialsSecretType = "iam_credentials" + KvSecretType = "kv" + ImportedCertSecretType = "imported_cert" + PublicCertSecretType = "public_cert" + PrivateCertSecretType = "private_cert" +) + func getRegion(originalClient *secretsmanagerv2.SecretsManagerV2, d *schema.ResourceData) string { _, ok := d.GetOk("region") if ok { @@ -116,3 +131,53 @@ func DateTimeToRFC3339(dt *strfmt.DateTime) (s string) { } return } + +func getSecretByIdOrByName(context context.Context, d *schema.ResourceData, meta interface{}, secretType string) (secretsmanagerv2.SecretIntf, string, string, diag.Diagnostics) { + + secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV2() + if err != nil { + return nil, "", "", diag.FromErr(err) + } + region := getRegion(secretsManagerClient, d) + instanceId := d.Get("instance_id").(string) + secretsManagerClient = getClientWithInstanceEndpoint(secretsManagerClient, instanceId, region, getEndpointType(secretsManagerClient, d)) + + secretId := d.Get("secret_id").(string) + secretName := d.Get("name").(string) + groupName := d.Get("secret_group_name").(string) + + log.Printf("[DEBUG] getSecretByIdOrByName %q %q %q %q\n", secretId, secretName, groupName, secretType) + + var secretIntf secretsmanagerv2.SecretIntf + var response *core.DetailedResponse + + if secretId != "" { + getSecretOptions := &secretsmanagerv2.GetSecretOptions{} + getSecretOptions.SetID(secretId) + + secretIntf, response, err = secretsManagerClient.GetSecretWithContext(context, getSecretOptions) + if err != nil { + log.Printf("[DEBUG] GetSecretWithContext failed %s\n%s", err, response) + return nil, "", "", diag.FromErr(fmt.Errorf("GetSecretWithContext failed %s\n%s", err, response)) + } + return secretIntf, region, instanceId, nil + } + + if secretName != "" && groupName != "" { + // Locate secret by name + getSecretByNameOptions := &secretsmanagerv2.GetSecretByNameTypeOptions{} + + getSecretByNameOptions.SetName(secretName) + getSecretByNameOptions.SetSecretType(secretType) + getSecretByNameOptions.SetSecretGroupName(groupName) + + secretIntf, response, err = secretsManagerClient.GetSecretByNameTypeWithContext(context, getSecretByNameOptions) + if err != nil { + log.Printf("[DEBUG] GetSecretByNameTypeWithContext failed %s\n%s", err, response) + return nil, "", "", diag.FromErr(fmt.Errorf("GetSecretByNameTypeWithContext failed %s\n%s", err, response)) + } + return secretIntf, region, instanceId, nil + } + + return nil, "", "", diag.FromErr(fmt.Errorf("Missing required arguments. Please make sure that either \"secret_id\" or \"name\" and \"secret_group_name\" are provided\n")) +} diff --git a/ibm/service/usagereports/README.md b/ibm/service/usagereports/README.md new file mode 100644 index 0000000000..9b2d5ef7a2 --- /dev/null +++ b/ibm/service/usagereports/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/billing_report_snapshot) +* IBM API Docs: [IBM API Docs for ]() +* IBM SDK: [IBM SDK for ](https://github.com/IBM/appconfiguration-go-admin-sdk/tree/master/usagereportsv4) diff --git a/ibm/service/usagereports/data_source_ibm_billing_snapshot_list.go b/ibm/service/usagereports/data_source_ibm_billing_snapshot_list.go new file mode 100644 index 0000000000..b5a688212c --- /dev/null +++ b/ibm/service/usagereports/data_source_ibm_billing_snapshot_list.go @@ -0,0 +1,365 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package usagereports + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/platform-services-go-sdk/usagereportsv4" +) + +func DataSourceIBMBillingSnapshotList() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMBillingSnapshotListRead, + + Schema: map[string]*schema.Schema{ + "month": { + Type: schema.TypeString, + Required: true, + Description: "The month for which billing report snapshot is requested. Format is yyyy-mm.", + }, + "date_from": { + Type: schema.TypeInt, + Optional: true, + Description: "Timestamp in milliseconds for which billing report snapshot is requested.", + }, + "date_to": { + Type: schema.TypeInt, + Optional: true, + Description: "Timestamp in milliseconds for which billing report snapshot is requested.", + }, + "snapshotcount": { + Type: schema.TypeInt, + Computed: true, + Description: "Number of total snapshots.", + }, + "snapshots": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Computed: true, + Description: "Account ID for which billing report snapshot is configured.", + }, + "month": { + Type: schema.TypeString, + Computed: true, + Description: "Month of captured snapshot.", + }, + "account_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of account. Possible values are [enterprise, account].", + }, + "expected_processed_at": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp of snapshot processed.", + }, + "state": { + Type: schema.TypeString, + Computed: true, + Description: "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + }, + "billing_period": { + Type: schema.TypeList, + Computed: true, + Description: "Period of billing in snapshot.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start": { + Type: schema.TypeString, + Computed: true, + Description: "Date and time of start of billing in the respective snapshot.", + }, + "end": { + Type: schema.TypeString, + Computed: true, + Description: "Date and time of end of billing in the respective snapshot.", + }, + }, + }, + }, + "snapshot_id": { + Type: schema.TypeString, + Computed: true, + Description: "Id of the snapshot captured.", + }, + "charset": { + Type: schema.TypeString, + Computed: true, + Description: "Character encoding used.", + }, + "compression": { + Type: schema.TypeString, + Computed: true, + Description: "Compression format of the snapshot report.", + }, + "content_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of content stored in snapshot report.", + }, + "bucket": { + Type: schema.TypeString, + Computed: true, + Description: "The name of the COS bucket to store the snapshot of the billing reports.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Version of the snapshot.", + }, + "created_on": { + Type: schema.TypeString, + Computed: true, + Description: "Date and time of creation of snapshot.", + }, + "report_types": { + Type: schema.TypeList, + Computed: true, + Description: "List of report types configured for the snapshot.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type of billing report of the snapshot. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Version of the snapshot.", + }, + }, + }, + }, + "files": { + Type: schema.TypeList, + Computed: true, + Description: "List of location of reports.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "report_types": { + Type: schema.TypeString, + Computed: true, + Description: "The type of billing report stored. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + }, + "location": { + Type: schema.TypeString, + Computed: true, + Description: "Absolute path of the billing report in the COS instance.", + }, + "account_id": { + Type: schema.TypeString, + Computed: true, + Description: "Account ID for which billing report is captured.", + }, + }, + }, + }, + "processed_at": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp at which snapshot is captured.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMBillingSnapshotListRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + usageReportsClient, err := meta.(conns.ClientSession).UsageReportsV4() + if err != nil { + return diag.FromErr(err) + } + + var next_ref string + var snapshotList []usagereportsv4.SnapshotListSnapshotsItem + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + for { + getReportsSnapshotOptions := &usagereportsv4.GetReportsSnapshotOptions{} + if next_ref != "" { + getReportsSnapshotOptions.SetStart(next_ref) + } + + getReportsSnapshotOptions.SetAccountID(userDetails.UserAccount) + getReportsSnapshotOptions.SetMonth(d.Get("month").(string)) + if _, ok := d.GetOk("date_from"); ok { + getReportsSnapshotOptions.SetDateFrom(int64(d.Get("date_from").(int))) + } + if _, ok := d.GetOk("date_to"); ok { + getReportsSnapshotOptions.SetDateTo(int64(d.Get("date_to").(int))) + } + + snapshotListResponse, response, err := usageReportsClient.GetReportsSnapshotWithContext(context, getReportsSnapshotOptions) + if err != nil { + log.Printf("[DEBUG] GetReportsSnapshotWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetReportsSnapshotWithContext failed %s\n%s", err, response)) + } + if snapshotListResponse.Snapshots != nil && len(snapshotListResponse.Snapshots) > 0 { + snapshotList = append(snapshotList, snapshotListResponse.Snapshots...) + } + if snapshotListResponse.Next == nil || snapshotListResponse.Next.Offset == nil { + break + } + next_ref = *snapshotListResponse.Next.Offset + if err != nil { + log.Printf("[DEBUG] ListAccountGroupsWithContext failed. Error occurred while parsing NextURL: %s", err) + return diag.FromErr(err) + } + if next_ref == "" { + break + } + } + + d.SetId(dataSourceIBMBillingSnapshotListID(d)) + + if len(snapshotList) == 0 { + return diag.FromErr(fmt.Errorf("no snapshots found for account: %s", userDetails.UserAccount)) + } + + snapshots := []map[string]interface{}{} + for _, modelItem := range snapshotList { + modelMap, err := dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + snapshots = append(snapshots, modelMap) + } + if err = d.Set("snapshots", snapshots); err != nil { + return diag.FromErr(fmt.Errorf("Error setting snapshots %s", err)) + } + + return nil +} + +// dataSourceIBMBillingSnapshotListID returns a reasonable ID for the list. +func dataSourceIBMBillingSnapshotListID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemToMap(model *usagereportsv4.SnapshotListSnapshotsItem) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.AccountID != nil { + modelMap["account_id"] = model.AccountID + } + if model.Month != nil { + modelMap["month"] = model.Month + } + if model.AccountType != nil { + modelMap["account_type"] = model.AccountType + } + if model.ExpectedProcessedAt != nil { + modelMap["expected_processed_at"] = flex.IntValue(model.ExpectedProcessedAt) + } + if model.State != nil { + modelMap["state"] = model.State + } + if model.BillingPeriod != nil { + billingPeriodMap, err := dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemBillingPeriodToMap(model.BillingPeriod) + if err != nil { + return modelMap, err + } + modelMap["billing_period"] = []map[string]interface{}{billingPeriodMap} + } + if model.SnapshotID != nil { + modelMap["snapshot_id"] = model.SnapshotID + } + if model.Charset != nil { + modelMap["charset"] = model.Charset + } + if model.Compression != nil { + modelMap["compression"] = model.Compression + } + if model.ContentType != nil { + modelMap["content_type"] = model.ContentType + } + if model.Bucket != nil { + modelMap["bucket"] = model.Bucket + } + if model.Version != nil { + modelMap["version"] = model.Version + } + if model.CreatedOn != nil { + modelMap["created_on"] = model.CreatedOn + } + if model.ReportTypes != nil { + reportTypes := []map[string]interface{}{} + for _, reportTypesItem := range model.ReportTypes { + reportTypesItemMap, err := dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemReportTypesItemToMap(&reportTypesItem) + if err != nil { + return modelMap, err + } + reportTypes = append(reportTypes, reportTypesItemMap) + } + modelMap["report_types"] = reportTypes + } + if model.Files != nil { + files := []map[string]interface{}{} + for _, filesItem := range model.Files { + filesItemMap, err := dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemFilesItemToMap(&filesItem) + if err != nil { + return modelMap, err + } + files = append(files, filesItemMap) + } + modelMap["files"] = files + } + if model.ProcessedAt != nil { + modelMap["processed_at"] = flex.IntValue(model.ProcessedAt) + } + return modelMap, nil +} + +func dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemBillingPeriodToMap(model *usagereportsv4.SnapshotListSnapshotsItemBillingPeriod) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Start != nil { + modelMap["start"] = model.Start + } + if model.End != nil { + modelMap["end"] = model.End + } + return modelMap, nil +} + +func dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemReportTypesItemToMap(model *usagereportsv4.SnapshotListSnapshotsItemReportTypesItem) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Type != nil { + modelMap["type"] = model.Type + } + if model.Version != nil { + modelMap["version"] = model.Version + } + return modelMap, nil +} + +func dataSourceIBMBillingSnapshotListSnapshotListSnapshotsItemFilesItemToMap(model *usagereportsv4.SnapshotListSnapshotsItemFilesItem) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.ReportTypes != nil { + modelMap["report_types"] = model.ReportTypes + } + if model.Location != nil { + modelMap["location"] = model.Location + } + if model.AccountID != nil { + modelMap["account_id"] = model.AccountID + } + return modelMap, nil +} diff --git a/ibm/service/usagereports/data_source_ibm_billing_snapshot_list_test.go b/ibm/service/usagereports/data_source_ibm_billing_snapshot_list_test.go new file mode 100644 index 0000000000..e195d730be --- /dev/null +++ b/ibm/service/usagereports/data_source_ibm_billing_snapshot_list_test.go @@ -0,0 +1,45 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package usagereports_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" +) + +func TestAccIBMBillingSnapshotListDataSourceBasic(t *testing.T) { + month := acc.Snapshot_month + date_from := acc.Snapshot_date_from + date_to := acc.Snapshot_date_to + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheckUsage(t) }, + Providers: acc.TestAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMBillingSnapshotListDataSourceConfigBasic(month, date_from, date_to), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_billing_snapshot_list.billing_snapshot_list_instance", "id"), + resource.TestCheckResourceAttrSet("data.ibm_billing_snapshot_list.billing_snapshot_list_instance", "month"), + ), + }, + }, + }) +} + +func testAccCheckIBMBillingSnapshotListDataSourceConfigBasic(month string, date_from string, date_to string) string { + from, _ := strconv.ParseInt(date_from, 10, 64) + to, _ := strconv.ParseInt(date_to, 10, 64) + return fmt.Sprintf(` + data "ibm_billing_snapshot_list" "billing_snapshot_list_instance" { + month = "%s" + date_from = "%d" + date_to = "%d" + } + `, month, from, to) +} diff --git a/ibm/service/usagereports/resource_ibm_billing_report_snapshot.go b/ibm/service/usagereports/resource_ibm_billing_report_snapshot.go new file mode 100644 index 0000000000..efa9f4f649 --- /dev/null +++ b/ibm/service/usagereports/resource_ibm_billing_report_snapshot.go @@ -0,0 +1,473 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package usagereports + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/usagereportsv4" +) + +func ResourceIBMBillingReportSnapshot() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMBillingReportSnapshotCreate, + ReadContext: resourceIBMBillingReportSnapshotRead, + UpdateContext: resourceIBMBillingReportSnapshotUpdate, + DeleteContext: resourceIBMBillingReportSnapshotDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "interval": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_billing_report_snapshot", "interval"), + Description: "Frequency of taking the snapshot of the billing reports.", + }, + "versioning": { + Type: schema.TypeString, + Optional: true, + Default: "new", + ValidateFunc: validate.InvokeValidator("ibm_billing_report_snapshot", "versioning"), + Description: "A new version of report is created or the existing report version is overwritten with every update.", + }, + "report_types": { + Type: schema.TypeList, + Optional: true, + Description: "The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "cos_reports_folder": { + Type: schema.TypeString, + Optional: true, + Default: "IBMCloud-Billing-Reports", + Description: "The billing reports root folder to store the billing reports snapshots. Defaults to \"IBMCloud-Billing-Reports\".", + }, + "cos_bucket": { + Type: schema.TypeString, + Required: true, + Description: "The name of the COS bucket to store the snapshot of the billing reports.", + }, + "cos_location": { + Type: schema.TypeString, + Required: true, + Description: "Region of the COS instance.", + }, + "state": { + Type: schema.TypeString, + Computed: true, + Description: "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + }, + "account_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of account. Possible values are [enterprise, account].", + }, + "compression": { + Type: schema.TypeString, + Computed: true, + Description: "Compression format of the snapshot report.", + }, + "content_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of content stored in snapshot report.", + }, + "cos_endpoint": { + Type: schema.TypeString, + Computed: true, + Description: "The endpoint of the COS instance.", + }, + "created_at": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp in milliseconds when the snapshot configuration was created.", + }, + "last_updated_at": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp in milliseconds when the snapshot configuration was last updated.", + }, + "history": { + Type: schema.TypeList, + Computed: true, + Description: "List of previous versions of the snapshot configurations.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp in milliseconds when the snapshot configuration was created.", + }, + "end_time": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp in milliseconds when the snapshot configuration ends.", + }, + "updated_by": { + Type: schema.TypeString, + Computed: true, + Description: "Account that updated the billing snapshot configuration.", + }, + "account_id": { + Type: schema.TypeString, + Computed: true, + Description: "Account ID for which billing report snapshot is configured.", + }, + "state": { + Type: schema.TypeString, + Computed: true, + Description: "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + }, + "account_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of account. Possible values [enterprise, account].", + }, + "interval": { + Type: schema.TypeString, + Computed: true, + Description: "Frequency of taking the snapshot of the billing reports.", + }, + "versioning": { + Type: schema.TypeString, + Computed: true, + Description: "A new version of report is created or the existing report version is overwritten with every update.", + }, + "report_types": { + Type: schema.TypeList, + Computed: true, + Description: "The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "compression": { + Type: schema.TypeString, + Computed: true, + Description: "Compression format of the snapshot report.", + }, + "content_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of content stored in snapshot report.", + }, + "cos_reports_folder": { + Type: schema.TypeString, + Computed: true, + Description: "The billing reports root folder to store the billing reports snapshots. Defaults to \"IBMCloud-Billing-Reports\".", + }, + "cos_bucket": { + Type: schema.TypeString, + Computed: true, + Description: "The name of the COS bucket to store the snapshot of the billing reports.", + }, + "cos_location": { + Type: schema.TypeString, + Computed: true, + Description: "Region of the COS instance.", + }, + "cos_endpoint": { + Type: schema.TypeString, + Computed: true, + Description: "The endpoint of the COS instance.", + }, + }, + }, + }, + }, + } +} + +func ResourceIBMBillingReportSnapshotValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "interval", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "daily", + }, + validate.ValidateSchema{ + Identifier: "versioning", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: "new, overwrite", + }, + ) + + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_billing_report_snapshot", Schema: validateSchema} + return &resourceValidator +} + +func resourceIBMBillingReportSnapshotCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + usageReportsClient, err := meta.(conns.ClientSession).UsageReportsV4() + if err != nil { + return diag.FromErr(err) + } + + createReportsSnapshotConfigOptions := &usagereportsv4.CreateReportsSnapshotConfigOptions{} + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + createReportsSnapshotConfigOptions.SetAccountID(userDetails.UserAccount) + createReportsSnapshotConfigOptions.SetInterval(d.Get("interval").(string)) + createReportsSnapshotConfigOptions.SetCosBucket(d.Get("cos_bucket").(string)) + createReportsSnapshotConfigOptions.SetCosLocation(d.Get("cos_location").(string)) + if _, ok := d.GetOk("cos_reports_folder"); ok { + createReportsSnapshotConfigOptions.SetCosReportsFolder(d.Get("cos_reports_folder").(string)) + } + if _, ok := d.GetOk("report_types"); ok { + var reportTypes []string + for _, v := range d.Get("report_types").([]interface{}) { + reportTypesItem := v.(string) + reportTypes = append(reportTypes, reportTypesItem) + } + createReportsSnapshotConfigOptions.SetReportTypes(reportTypes) + } + if _, ok := d.GetOk("versioning"); ok { + createReportsSnapshotConfigOptions.SetVersioning(d.Get("versioning").(string)) + } + + snapshotConfig, response, err := usageReportsClient.CreateReportsSnapshotConfigWithContext(context, createReportsSnapshotConfigOptions) + if err != nil { + log.Printf("[DEBUG] CreateReportsSnapshotConfigWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("CreateReportsSnapshotConfigWithContext failed %s\n%s", err, response)) + } + + d.SetId(*snapshotConfig.AccountID) + + return resourceIBMBillingReportSnapshotRead(context, d, meta) +} + +func resourceIBMBillingReportSnapshotRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + usageReportsClient, err := meta.(conns.ClientSession).UsageReportsV4() + if err != nil { + return diag.FromErr(err) + } + + getReportsSnapshotConfigOptions := &usagereportsv4.GetReportsSnapshotConfigOptions{} + + getReportsSnapshotConfigOptions.SetAccountID(d.Id()) + + snapshotConfig, response, err := usageReportsClient.GetReportsSnapshotConfigWithContext(context, getReportsSnapshotConfigOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] GetReportsSnapshotConfigWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetReportsSnapshotConfigWithContext failed %s\n%s", err, response)) + } + + if err = d.Set("interval", snapshotConfig.Interval); err != nil { + return diag.FromErr(fmt.Errorf("Error setting interval: %s", err)) + } + if !core.IsNil(snapshotConfig.Versioning) { + if err = d.Set("versioning", snapshotConfig.Versioning); err != nil { + return diag.FromErr(fmt.Errorf("Error setting versioning: %s", err)) + } + } + if !core.IsNil(snapshotConfig.ReportTypes) { + if err = d.Set("report_types", snapshotConfig.ReportTypes); err != nil { + return diag.FromErr(fmt.Errorf("Error setting report_types: %s", err)) + } + } + if !core.IsNil(snapshotConfig.CosReportsFolder) { + if err = d.Set("cos_reports_folder", snapshotConfig.CosReportsFolder); err != nil { + return diag.FromErr(fmt.Errorf("Error setting cos_reports_folder: %s", err)) + } + } + if err = d.Set("cos_bucket", snapshotConfig.CosBucket); err != nil { + return diag.FromErr(fmt.Errorf("Error setting cos_bucket: %s", err)) + } + if err = d.Set("cos_location", snapshotConfig.CosLocation); err != nil { + return diag.FromErr(fmt.Errorf("Error setting cos_location: %s", err)) + } + if !core.IsNil(snapshotConfig.State) { + if err = d.Set("state", snapshotConfig.State); err != nil { + return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + } + } + if !core.IsNil(snapshotConfig.AccountType) { + if err = d.Set("account_type", snapshotConfig.AccountType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting account_type: %s", err)) + } + } + if !core.IsNil(snapshotConfig.Compression) { + if err = d.Set("compression", snapshotConfig.Compression); err != nil { + return diag.FromErr(fmt.Errorf("Error setting compression: %s", err)) + } + } + if !core.IsNil(snapshotConfig.ContentType) { + if err = d.Set("content_type", snapshotConfig.ContentType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting content_type: %s", err)) + } + } + if !core.IsNil(snapshotConfig.CosEndpoint) { + if err = d.Set("cos_endpoint", snapshotConfig.CosEndpoint); err != nil { + return diag.FromErr(fmt.Errorf("Error setting cos_endpoint: %s", err)) + } + } + if !core.IsNil(snapshotConfig.CreatedAt) { + if err = d.Set("created_at", flex.IntValue(snapshotConfig.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + } + if !core.IsNil(snapshotConfig.LastUpdatedAt) { + if err = d.Set("last_updated_at", flex.IntValue(snapshotConfig.LastUpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting last_updated_at: %s", err)) + } + } + if !core.IsNil(snapshotConfig.History) { + history := []map[string]interface{}{} + for _, historyItem := range snapshotConfig.History { + historyItemMap, err := resourceIBMBillingReportSnapshotSnapshotConfigHistoryItemToMap(&historyItem) + if err != nil { + return diag.FromErr(err) + } + history = append(history, historyItemMap) + } + if err = d.Set("history", history); err != nil { + return diag.FromErr(fmt.Errorf("Error setting history: %s", err)) + } + } + + return nil +} + +func resourceIBMBillingReportSnapshotUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + usageReportsClient, err := meta.(conns.ClientSession).UsageReportsV4() + if err != nil { + return diag.FromErr(err) + } + + updateReportsSnapshotConfigOptions := &usagereportsv4.UpdateReportsSnapshotConfigOptions{} + + updateReportsSnapshotConfigOptions.SetAccountID(d.Id()) + + hasChange := false + + if d.HasChange("interval") { + updateReportsSnapshotConfigOptions.SetInterval(d.Get("interval").(string)) + hasChange = true + } + if d.HasChange("cos_bucket") { + updateReportsSnapshotConfigOptions.SetCosBucket(d.Get("cos_bucket").(string)) + hasChange = true + } + if d.HasChange("cos_location") { + updateReportsSnapshotConfigOptions.SetCosLocation(d.Get("cos_location").(string)) + hasChange = true + } + if d.HasChange("cos_reports_folder") { + updateReportsSnapshotConfigOptions.SetCosReportsFolder(d.Get("cos_reports_folder").(string)) + hasChange = true + } + if d.HasChange("report_types") { + var reportTypes []string + for _, v := range d.Get("report_types").([]interface{}) { + reportTypesItem := v.(string) + reportTypes = append(reportTypes, reportTypesItem) + } + updateReportsSnapshotConfigOptions.SetReportTypes(reportTypes) + hasChange = true + } + if d.HasChange("versioning") { + updateReportsSnapshotConfigOptions.SetVersioning(d.Get("versioning").(string)) + hasChange = true + } + + if hasChange { + _, response, err := usageReportsClient.UpdateReportsSnapshotConfigWithContext(context, updateReportsSnapshotConfigOptions) + if err != nil { + log.Printf("[DEBUG] UpdateReportsSnapshotConfigWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("UpdateReportsSnapshotConfigWithContext failed %s\n%s", err, response)) + } + } + + return resourceIBMBillingReportSnapshotRead(context, d, meta) +} + +func resourceIBMBillingReportSnapshotDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + usageReportsClient, err := meta.(conns.ClientSession).UsageReportsV4() + if err != nil { + return diag.FromErr(err) + } + + deleteReportsSnapshotConfigOptions := &usagereportsv4.DeleteReportsSnapshotConfigOptions{} + + deleteReportsSnapshotConfigOptions.SetAccountID(d.Id()) + + response, err := usageReportsClient.DeleteReportsSnapshotConfigWithContext(context, deleteReportsSnapshotConfigOptions) + if err != nil { + log.Printf("[DEBUG] DeleteReportsSnapshotConfigWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeleteReportsSnapshotConfigWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} + +func resourceIBMBillingReportSnapshotSnapshotConfigHistoryItemToMap(model *usagereportsv4.SnapshotConfigHistoryItem) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.StartTime != nil { + modelMap["start_time"] = flex.IntValue(model.StartTime) + } + if model.EndTime != nil { + modelMap["end_time"] = flex.IntValue(model.EndTime) + } + if model.UpdatedBy != nil { + modelMap["updated_by"] = model.UpdatedBy + } + if model.AccountID != nil { + modelMap["account_id"] = model.AccountID + } + if model.State != nil { + modelMap["state"] = model.State + } + if model.AccountType != nil { + modelMap["account_type"] = model.AccountType + } + if model.Interval != nil { + modelMap["interval"] = model.Interval + } + if model.Versioning != nil { + modelMap["versioning"] = model.Versioning + } + if model.ReportTypes != nil { + modelMap["report_types"] = model.ReportTypes + } + if model.Compression != nil { + modelMap["compression"] = model.Compression + } + if model.ContentType != nil { + modelMap["content_type"] = model.ContentType + } + if model.CosReportsFolder != nil { + modelMap["cos_reports_folder"] = model.CosReportsFolder + } + if model.CosBucket != nil { + modelMap["cos_bucket"] = model.CosBucket + } + if model.CosLocation != nil { + modelMap["cos_location"] = model.CosLocation + } + if model.CosEndpoint != nil { + modelMap["cos_endpoint"] = model.CosEndpoint + } + return modelMap, nil +} diff --git a/ibm/service/usagereports/resource_ibm_billing_report_snapshot_test.go b/ibm/service/usagereports/resource_ibm_billing_report_snapshot_test.go new file mode 100644 index 0000000000..008725309b --- /dev/null +++ b/ibm/service/usagereports/resource_ibm_billing_report_snapshot_test.go @@ -0,0 +1,116 @@ +// Copyright IBM Corp. 2023 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package usagereports_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/platform-services-go-sdk/usagereportsv4" +) + +func TestAccIBMBillingReportSnapshotBasic(t *testing.T) { + var conf usagereportsv4.SnapshotConfig + interval := "daily" + cosBucket := acc.Cos_bucket + cosLocation := acc.Cos_location + intervalUpdate := "daily" + cosBucketUpdate := acc.Cos_bucket_update + cosLocationUpdate := acc.Cos_location_update + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheckUsage(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMBillingReportSnapshotDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMBillingReportSnapshotConfigBasic(interval, cosBucket, cosLocation), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckIBMBillingReportSnapshotExists("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", conf), + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "interval", interval), + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "cos_bucket", cosBucket), + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "cos_location", cosLocation), + ), + }, + { + Config: testAccCheckIBMBillingReportSnapshotConfigBasic(intervalUpdate, cosBucketUpdate, cosLocationUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "interval", intervalUpdate), + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "cos_bucket", cosBucketUpdate), + resource.TestCheckResourceAttr("ibm_billing_report_snapshot.billing_report_snapshot_instance_1", "cos_location", cosLocationUpdate), + ), + }, + }, + }) +} + +func testAccCheckIBMBillingReportSnapshotConfigBasic(interval string, cosBucket string, cosLocation string) string { + return fmt.Sprintf(` + resource "ibm_billing_report_snapshot" "billing_report_snapshot_instance_1" { + interval = "%s" + cos_bucket = "%s" + cos_location = "%s" + report_types = ["account_summary", "account_resource_instance_usage"] + } + `, interval, cosBucket, cosLocation) +} + +func testAccCheckIBMBillingReportSnapshotExists(n string, obj usagereportsv4.SnapshotConfig) resource.TestCheckFunc { + + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + usageReportsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).UsageReportsV4() + if err != nil { + return err + } + + getReportsSnapshotConfigOptions := &usagereportsv4.GetReportsSnapshotConfigOptions{} + + getReportsSnapshotConfigOptions.SetAccountID(rs.Primary.ID) + + snapshotConfig, _, err := usageReportsClient.GetReportsSnapshotConfig(getReportsSnapshotConfigOptions) + if err != nil { + return err + } + + obj = *snapshotConfig + return nil + } +} + +func testAccCheckIBMBillingReportSnapshotDestroy(s *terraform.State) error { + usageReportsClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).UsageReportsV4() + if err != nil { + return err + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "ibm_billing_report_snapshot" { + continue + } + + getReportsSnapshotConfigOptions := &usagereportsv4.GetReportsSnapshotConfigOptions{} + + getReportsSnapshotConfigOptions.SetAccountID(rs.Primary.ID) + + // Try to find the key + res, response, err := usageReportsClient.GetReportsSnapshotConfig(getReportsSnapshotConfigOptions) + + if !(response.StatusCode == 200 && *res.State == "disabled") { + return fmt.Errorf("billing_report_snapshot still exists: %s", rs.Primary.ID) + } else if err != nil { + return fmt.Errorf("Error checking for billing_report_snapshot (%s) has been destroyed: %s", rs.Primary.ID, err) + } + } + + return nil +} diff --git a/ibm/service/vpc/data_source_ibm_is_backup_policies.go b/ibm/service/vpc/data_source_ibm_is_backup_policies.go index 1ca4bde5be..d9f03c7f53 100644 --- a/ibm/service/vpc/data_source_ibm_is_backup_policies.go +++ b/ibm/service/vpc/data_source_ibm_is_backup_policies.go @@ -166,6 +166,59 @@ func DataSourceIBMIsBackupPolicies() *schema.Resource { Computed: true, Description: "The type of resource referenced.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, }, }, @@ -298,10 +351,58 @@ func dataSourceBackupPolicyCollectionBackupPoliciesToMap(backupPoliciesItem vpcv if backupPoliciesItem.ResourceType != nil { backupPoliciesMap["resource_type"] = backupPoliciesItem.ResourceType } + if backupPoliciesItem.HealthReasons != nil { + healthReasonsList := []map[string]interface{}{} + for _, healthReasonsItem := range backupPoliciesItem.HealthReasons { + healthReasonsList = append(healthReasonsList, dataSourceBackupPolicyCollectionPoliciesHealthReasonsToMap(healthReasonsItem)) + } + backupPoliciesMap["health_reasons"] = healthReasonsList + } + if backupPoliciesItem.HealthState != nil { + backupPoliciesMap["health_state"] = backupPoliciesItem.HealthState + } + if backupPoliciesItem.Scope != nil { + scopeList := []map[string]interface{}{} + scopeMap := dataSourceBackupPolicyCollectionBackupPoliciesScopeToMap(*backupPoliciesItem.Scope.(*vpcv1.BackupPolicyScope)) + scopeList = append(scopeList, scopeMap) + backupPoliciesMap["scope"] = scopeList + } return backupPoliciesMap } +func dataSourceBackupPolicyCollectionPoliciesHealthReasonsToMap(statusReasonsItem vpcv1.BackupPolicyHealthReason) (healthReasonsMap map[string]interface{}) { + healthReasonsMap = map[string]interface{}{} + + if statusReasonsItem.Code != nil { + healthReasonsMap["code"] = statusReasonsItem.Code + } + if statusReasonsItem.Message != nil { + healthReasonsMap["message"] = statusReasonsItem.Message + } + if statusReasonsItem.MoreInfo != nil { + healthReasonsMap["more_info"] = statusReasonsItem.MoreInfo + } + + return healthReasonsMap +} + +func dataSourceBackupPolicyCollectionBackupPoliciesScopeToMap(scopeItem vpcv1.BackupPolicyScope) (scopeMap map[string]interface{}) { + scopeMap = map[string]interface{}{} + + if scopeItem.CRN != nil { + scopeMap["crn"] = scopeItem.CRN + } + if scopeItem.ID != nil { + scopeMap["id"] = scopeItem.ID + } + if scopeItem.ResourceType != nil { + scopeMap["resource_type"] = scopeItem.ResourceType + } + + return scopeMap +} + func dataSourceBackupPolicyCollectionBackupPoliciesPlansToMap(plansItem vpcv1.BackupPolicyPlanReference) (plansMap map[string]interface{}) { plansMap = map[string]interface{}{} diff --git a/ibm/service/vpc/data_source_ibm_is_backup_policy.go b/ibm/service/vpc/data_source_ibm_is_backup_policy.go index 1aa3b6ca81..7baaafa6cb 100644 --- a/ibm/service/vpc/data_source_ibm_is_backup_policy.go +++ b/ibm/service/vpc/data_source_ibm_is_backup_policy.go @@ -149,6 +149,59 @@ func DataSourceIBMIsBackupPolicy() *schema.Resource { Computed: true, Description: "The type of resource referenced.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, } } @@ -237,6 +290,32 @@ func dataSourceIBMIsBackupPolicyRead(context context.Context, d *schema.Resource } } + if backupPolicy.HealthReasons != nil { + healthReasonsList := make([]map[string]interface{}, 0) + for _, sr := range backupPolicy.HealthReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR["code"] = *sr.Code + currentSR["message"] = *sr.Message + if sr.MoreInfo != nil { + currentSR["more_info"] = *sr.Message + } + healthReasonsList = append(healthReasonsList, currentSR) + } + } + d.Set("health_reasons", healthReasonsList) + } + if err = d.Set("health_state", backupPolicy.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + + if backupPolicy.Scope != nil { + err = d.Set("scope", dataSourceBackupPolicyFlattenScope(*backupPolicy.Scope.(*vpcv1.BackupPolicyScope))) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scope: %s", err)) + } + } + matchResourceType := make([]string, 0) if backupPolicy.MatchResourceTypes != nil { for _, matchResourceTyp := range backupPolicy.MatchResourceTypes { @@ -266,6 +345,29 @@ func dataSourceIBMIsBackupPolicyRead(context context.Context, d *schema.Resource return nil } +func dataSourceBackupPolicyFlattenScope(result vpcv1.BackupPolicyScope) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceBackupPolicyScopeToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} +func dataSourceBackupPolicyScopeToMap(scopeItem vpcv1.BackupPolicyScope) (scopeMap map[string]interface{}) { + scopeMap = map[string]interface{}{} + + if scopeItem.CRN != nil { + scopeMap["crn"] = scopeItem.CRN + } + if scopeItem.ID != nil { + scopeMap["id"] = scopeItem.ID + } + if scopeItem.ResourceType != nil { + scopeMap["resource_type"] = scopeItem.ResourceType + } + + return scopeMap +} + func dataSourceBackupPolicyFlattenPlans(result []vpcv1.BackupPolicyPlanReference) (plans []map[string]interface{}) { for _, plansItem := range result { plans = append(plans, dataSourceBackupPolicyPlansToMap(plansItem)) diff --git a/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go b/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go index b659a318b2..d3ad3b6409 100644 --- a/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go +++ b/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go @@ -485,18 +485,18 @@ func dataSourceIBMISBareMetalServersRead(context context.Context, d *schema.Reso vpcCrn := vpcCrnIntf.(string) listBareMetalServersOptions.VPCCRN = &vpcCrn } - if subnetIntf, ok := d.GetOk("network_interfaces_subnet"); ok { - subnetId := subnetIntf.(string) - listBareMetalServersOptions.NetworkInterfacesSubnetID = &subnetId - } - if subnetNameIntf, ok := d.GetOk("network_interfaces_subnet_name"); ok { - subnetName := subnetNameIntf.(string) - listBareMetalServersOptions.NetworkInterfacesSubnetName = &subnetName - } - if subnetCrnIntf, ok := d.GetOk("network_interfaces_subnet_crn"); ok { - subnetCrn := subnetCrnIntf.(string) - listBareMetalServersOptions.NetworkInterfacesSubnetCRN = &subnetCrn - } + // if subnetIntf, ok := d.GetOk("network_interfaces_subnet"); ok { + // subnetId := subnetIntf.(string) + // listBareMetalServersOptions.NetworkInterfacesSubnetID = &subnetId + // } + // if subnetNameIntf, ok := d.GetOk("network_interfaces_subnet_name"); ok { + // subnetName := subnetNameIntf.(string) + // listBareMetalServersOptions.NetworkInterfacesSubnetName = &subnetName + // } + // if subnetCrnIntf, ok := d.GetOk("network_interfaces_subnet_crn"); ok { + // subnetCrn := subnetCrnIntf.(string) + // listBareMetalServersOptions.NetworkInterfacesSubnetCRN = &subnetCrn + // } for { if start != "" { diff --git a/ibm/service/vpc/data_source_ibm_is_dedicated_host.go b/ibm/service/vpc/data_source_ibm_is_dedicated_host.go index db563e252c..c224e1ddd3 100644 --- a/ibm/service/vpc/data_source_ibm_is_dedicated_host.go +++ b/ibm/service/vpc/data_source_ibm_is_dedicated_host.go @@ -250,6 +250,39 @@ func DataSourceIbmIsDedicatedHost() *schema.Resource { Computed: true, Description: "The total amount of memory in gibibytes for this host.", }, + "numa": { + Type: schema.TypeList, + Computed: true, + Description: "The dedicated host NUMA configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "count": { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of NUMA nodes for this dedicated host", + }, + "nodes": { + Type: schema.TypeList, + Computed: true, + Description: "The NUMA nodes for this dedicated host.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "available_vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The available VCPU for this NUMA node.", + }, + "vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The total VCPU capacity for this NUMA node.", + }, + }, + }, + }, + }, + }, + }, "profile": { Type: schema.TypeList, Computed: true, @@ -430,7 +463,11 @@ func dataSourceIbmIsDedicatedHostRead(context context.Context, d *schema.Resourc if err = d.Set("name", dedicatedHost.Name); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } - + if dedicatedHost.Numa != nil { + if err = d.Set("numa", dataSourceDedicatedHostFlattenNumaNodes(*dedicatedHost.Numa)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting numa nodes: %s", err)) + } + } if dedicatedHost.Profile != nil { err = d.Set("profile", dataSourceDedicatedHostFlattenProfile(*dedicatedHost.Profile)) if err != nil { @@ -603,6 +640,35 @@ func dataSourceDedicatedHostInstancesDeletedToMap(deletedItem vpcv1.InstanceRefe return deletedMap } +func dataSourceDedicatedHostFlattenNumaNodes(nodeItem vpcv1.DedicatedHostNuma) (numaNodes []map[string]interface{}) { + numaNodeMap := map[string]interface{}{} + + if nodeItem.Count != nil { + numaNodeMap["count"] = *nodeItem.Count + } + if nodeItem.Nodes != nil { + nodesList := []map[string]interface{}{} + for _, nodeItem := range nodeItem.Nodes { + nodesList = append(nodesList, dataSourceDedicatedHostNodesToMap(nodeItem)) + } + numaNodeMap["nodes"] = nodesList + } + numaNodes = append(numaNodes, numaNodeMap) + return numaNodes +} + +func dataSourceDedicatedHostNodesToMap(nodes vpcv1.DedicatedHostNumaNode) (node map[string]interface{}) { + node = map[string]interface{}{} + + if nodes.AvailableVcpu != nil { + node["available_vcpu"] = nodes.AvailableVcpu + } + if nodes.Vcpu != nil { + node["vcpu"] = nodes.Vcpu + } + return node +} + func dataSourceDedicatedHostFlattenProfile(result vpcv1.DedicatedHostProfileReference) (finalList []map[string]interface{}) { finalList = []map[string]interface{}{} finalMap := dataSourceDedicatedHostProfileToMap(result) diff --git a/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go b/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go index 689919680e..ac9c632c29 100644 --- a/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go +++ b/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go @@ -238,6 +238,11 @@ func DataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the dedicated host profile.", + }, "vcpu_architecture": { Type: schema.TypeList, Computed: true, @@ -354,7 +359,9 @@ func dataSourceIbmIsDedicatedHostProfileRead(context context.Context, d *schema. return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks %s", err)) } } - + if dedicatedHostProfile.Status != nil { + d.Set("status", dedicatedHostProfile.Status) + } if err = d.Set("family", dedicatedHostProfile.Family); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting family: %s", err)) } diff --git a/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go b/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go index 32405f10c6..fb7478fd73 100644 --- a/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go +++ b/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go @@ -245,6 +245,11 @@ func DataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the dedicated host profile.", + }, "vcpu_architecture": { Type: schema.TypeList, @@ -467,6 +472,9 @@ func dataSourceDedicatedHostProfileCollectionProfilesToMap(profilesItem vpcv1.De socketCountList = append(socketCountList, socketCountMap) profilesMap["socket_count"] = socketCountList } + if profilesItem.Status != nil { + profilesMap["status"] = *profilesItem.Status + } if profilesItem.SupportedInstanceProfiles != nil { supportedInstanceProfilesList := []map[string]interface{}{} for _, supportedInstanceProfilesItem := range profilesItem.SupportedInstanceProfiles { diff --git a/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go b/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go index f775e26284..bf3d709b20 100644 --- a/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go +++ b/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go @@ -275,6 +275,39 @@ func DataSourceIbmIsDedicatedHosts() *schema.Resource { Computed: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, + "numa": { + Type: schema.TypeList, + Computed: true, + Description: "The dedicated host NUMA configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "count": { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of NUMA nodes for this dedicated host", + }, + "nodes": { + Type: schema.TypeList, + Computed: true, + Description: "The NUMA nodes for this dedicated host.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "available_vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The available VCPU for this NUMA node.", + }, + "vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The total VCPU capacity for this NUMA node.", + }, + }, + }, + }, + }, + }, + }, "profile": { Type: schema.TypeList, Computed: true, @@ -509,6 +542,9 @@ func dataSourceDedicatedHostCollectionDedicatedHostsToMap(dedicatedHostsItem vpc if dedicatedHostsItem.Name != nil { dedicatedHostsMap["name"] = dedicatedHostsItem.Name } + if dedicatedHostsItem.Numa != nil { + dedicatedHostsMap["numa"] = dataSourceDedicatedHostFlattenNumaNodes(*dedicatedHostsItem.Numa) + } if dedicatedHostsItem.Profile != nil { profileList := []map[string]interface{}{} profileMap := dataSourceDedicatedHostCollectionDedicatedHostsProfileToMap(*dedicatedHostsItem.Profile) diff --git a/ibm/service/vpc/data_source_ibm_is_instance.go b/ibm/service/vpc/data_source_ibm_is_instance.go index 7eda5dac54..8504c301fd 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance.go +++ b/ibm/service/vpc/data_source_ibm_is_instance.go @@ -34,6 +34,13 @@ const ( isInstanceNicReservedIpName = "name" isInstanceNicReservedIpId = "reserved_ip" isInstanceNicReservedIpResourceType = "resource_type" + + isInstanceReservation = "reservation" + isReservationDeleted = "deleted" + isReservationDeletedMoreInfo = "more_info" + isReservationAffinity = "reservation_affinity" + isReservationAffinityPool = "pool" + isReservationAffinityPolicyResp = "policy" ) func DataSourceIBMISInstance() *schema.Resource { @@ -531,6 +538,12 @@ func DataSourceIBMISInstance() *schema.Resource { Description: "Instance memory", }, + "numa_count": { + Type: schema.TypeInt, + Computed: true, + Description: "The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`.", + }, + isInstanceStatus: { Type: schema.TypeString, Computed: true, @@ -691,6 +704,115 @@ func DataSourceIBMISInstance() *schema.Resource { }, }, }, + isInstanceReservation: { + Type: schema.TypeList, + Computed: true, + Description: "The reservation used by this virtual server instance", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + isReservationAffinity: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicyResp: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The pool of reservations available for use by this virtual server instance.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, } } @@ -779,7 +901,9 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } d.Set(isInstanceMemory, *instance.Memory) - + if instance.NumaCount != nil { + d.Set("numa_count", *instance.NumaCount) + } gpuList := make([]map[string]interface{}, 0) if instance.Gpu != nil { currentGpu := map[string]interface{}{} @@ -1104,10 +1228,64 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er d.Set(isInstanceResourceGroup, instance.ResourceGroup.ID) d.Set(flex.ResourceGroupName, instance.ResourceGroup.Name) } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + poolList := make([]map[string]interface{}, 0) + for _, pool := range instance.ReservationAffinity.Pool { + res := map[string]interface{}{} + + res[isReservationId] = *pool.ID + res[isReservationHref] = *pool.Href + res[isReservationName] = *pool.Name + res[isReservationCrn] = *pool.CRN + res[isReservationResourceType] = *pool.ResourceType + if pool.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*pool.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + poolList = append(poolList, res) + } + reservationAffinityMap[isReservationAffinityPool] = poolList + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + d.Set(isReservationAffinity, reservationAffinity) + } + if instance.Reservation != nil { + res := map[string]interface{}{} + + res[isReservationId] = *instance.Reservation.ID + res[isReservationHref] = *instance.Reservation.Href + res[isReservationName] = *instance.Reservation.Name + res[isReservationCrn] = *instance.Reservation.CRN + res[isReservationResourceType] = *instance.Reservation.ResourceType + if instance.Reservation.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*instance.Reservation.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + d.Set(isInstanceReservation, res) + } return nil } +func dataSourceInstanceReservationDeletedToMap(deletedItem vpcv1.ReservationReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + const opensshv1Magic = "openssh-key-v1" type opensshPrivateKey struct { diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profile.go b/ibm/service/vpc/data_source_ibm_is_instance_profile.go index 24815b68dc..2eee0d374a 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profile.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profile.go @@ -486,6 +486,24 @@ func DataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, + "numa_count": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field.", + }, + "value": { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field.", + }, + }, + }, + }, "port_speed": { Type: schema.TypeList, Computed: true, @@ -504,6 +522,11 @@ func DataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the instance profile.", + }, isInstanceVCPUArchitecture: &schema.Schema{ Type: schema.TypeList, Computed: true, @@ -638,6 +661,9 @@ func instanceProfileGet(d *schema.ResourceData, meta interface{}, name string) e } } + if profile.Status != nil { + d.Set("status", profile.Status) + } if profile.Bandwidth != nil { err = d.Set("bandwidth", dataSourceInstanceProfileFlattenBandwidth(*profile.Bandwidth.(*vpcv1.InstanceProfileBandwidth))) if err != nil { @@ -696,6 +722,12 @@ func instanceProfileGet(d *schema.ResourceData, meta interface{}, name string) e return err } } + if profile.NumaCount != nil { + err = d.Set("numa_count", dataSourceInstanceProfileFlattenNumaCount(*profile.NumaCount.(*vpcv1.InstanceProfileNumaCount))) + if err != nil { + return err + } + } if profile.PortSpeed != nil { err = d.Set("port_speed", dataSourceInstanceProfileFlattenPortSpeed(*profile.PortSpeed.(*vpcv1.InstanceProfilePortSpeed))) if err != nil { @@ -1182,3 +1214,24 @@ func dataSourceInstanceProfileTotalVolumeBandwidthToMap(bandwidthItem vpcv1.Inst return bandwidthMap } + +func dataSourceInstanceProfileFlattenNumaCount(result vpcv1.InstanceProfileNumaCount) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceInstanceProfileNumaCountToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceInstanceProfileNumaCountToMap(numaItem vpcv1.InstanceProfileNumaCount) (numaMap map[string]interface{}) { + numaMap = map[string]interface{}{} + + if numaItem.Type != nil { + numaMap["type"] = numaItem.Type + } + if numaItem.Value != nil { + numaMap["value"] = numaItem.Value + } + + return numaMap +} diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profiles.go b/ibm/service/vpc/data_source_ibm_is_instance_profiles.go index 6fc76a2cc4..83b7788780 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profiles.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profiles.go @@ -487,6 +487,24 @@ func DataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, + "numa_count": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field.", + }, + "value": { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field.", + }, + }, + }, + }, "port_speed": { Type: schema.TypeList, Computed: true, @@ -505,6 +523,11 @@ func DataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the instance profile.", + }, "vcpu_architecture": { Type: schema.TypeList, Computed: true, @@ -640,6 +663,9 @@ func instanceProfilesList(d *schema.ResourceData, meta interface{}) error { l["architecture_values"] = profile.OsArchitecture.Values } } + if profile.Status != nil { + l["status"] = *profile.Status + } if profile.Bandwidth != nil { bandwidthList := []map[string]interface{}{} bandwidthMap := dataSourceInstanceProfileBandwidthToMap(*profile.Bandwidth.(*vpcv1.InstanceProfileBandwidth)) @@ -689,6 +715,12 @@ func instanceProfilesList(d *schema.ResourceData, meta interface{}) error { networkInterfaceCountList = append(networkInterfaceCountList, networkInterfaceCountMap) l["network_interface_count"] = networkInterfaceCountList } + if profile.NumaCount != nil { + numaCountList := []map[string]interface{}{} + numaCountMap := dataSourceInstanceProfileNumaCountToMap(*profile.NumaCount.(*vpcv1.InstanceProfileNumaCount)) + numaCountList = append(numaCountList, numaCountMap) + l["numa_count"] = numaCountList + } if profile.PortSpeed != nil { portSpeedList := []map[string]interface{}{} portSpeedMap := dataSourceInstanceProfilePortSpeedToMap(*profile.PortSpeed.(*vpcv1.InstanceProfilePortSpeed)) diff --git a/ibm/service/vpc/data_source_ibm_is_instance_template.go b/ibm/service/vpc/data_source_ibm_is_instance_template.go index 7a683ccfc2..3625e6135b 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_template.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_template.go @@ -397,6 +397,24 @@ func DataSourceIBMISInstanceTemplate() *schema.Resource { }, }, }, + isReservationAffinity: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicyResp: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation associated with this template.", + }, + }, + }, + }, }, } } @@ -503,6 +521,27 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso d.Set("placement_target", placementTargetList) } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + pool := instance.ReservationAffinity.Pool[0] + res := "" + if idPool, ok := pool.(*vpcv1.ReservationIdentityByID); ok { + res = *idPool.ID + } else if crnPool, ok := pool.(*vpcv1.ReservationIdentityByCRN); ok { + res = *crnPool.CRN + } else if hrefPool, ok := pool.(*vpcv1.ReservationIdentityByHref); ok { + res = *hrefPool.Href + } + reservationAffinityMap[isReservationAffinityPool] = res + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + d.Set(isReservationAffinity, reservationAffinity) + } + if instance.TotalVolumeBandwidth != nil { d.Set(isInstanceTotalVolumeBandwidth, int(*instance.TotalVolumeBandwidth)) } diff --git a/ibm/service/vpc/data_source_ibm_is_instance_templates.go b/ibm/service/vpc/data_source_ibm_is_instance_templates.go index 02db3fa65f..ed40d4dd75 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_templates.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_templates.go @@ -428,6 +428,24 @@ func DataSourceIBMISInstanceTemplates() *schema.Resource { Type: schema.TypeString, Computed: true, }, + isReservationAffinity: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicyResp: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation associated with this template.", + }, + }, + }, + }, }, }, }, @@ -725,6 +743,26 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface bootVolList = append(bootVolList, bootVol) template[isInstanceTemplatesBootVolumeAttachment] = bootVolList } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + pool := instance.ReservationAffinity.Pool[0] + res := "" + if idPool, ok := pool.(*vpcv1.ReservationIdentityByID); ok { + res = *idPool.ID + } else if crnPool, ok := pool.(*vpcv1.ReservationIdentityByCRN); ok { + res = *crnPool.CRN + } else if hrefPool, ok := pool.(*vpcv1.ReservationIdentityByHref); ok { + res = *hrefPool.Href + } + reservationAffinityMap[isReservationAffinityPool] = res + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + template[isReservationAffinity] = reservationAffinity + } if instance.ResourceGroup != nil { rg := instance.ResourceGroup diff --git a/ibm/service/vpc/data_source_ibm_is_instances.go b/ibm/service/vpc/data_source_ibm_is_instances.go index cb5d92ac4d..5d2049b148 100644 --- a/ibm/service/vpc/data_source_ibm_is_instances.go +++ b/ibm/service/vpc/data_source_ibm_is_instances.go @@ -116,6 +116,11 @@ func DataSourceIBMISInstances() *schema.Resource { Computed: true, Description: "Instance memory", }, + "numa_count": { + Type: schema.TypeInt, + Computed: true, + Description: "The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`.", + }, isInstanceMetadataServiceEnabled: { Type: schema.TypeBool, Computed: true, @@ -652,6 +657,115 @@ func DataSourceIBMISInstances() *schema.Resource { }, }, }, + isInstanceReservation: { + Type: schema.TypeList, + Computed: true, + Description: "The reservation used by this virtual server instance", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + isReservationAffinity: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicyResp: { + Type: schema.TypeString, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The pool of reservations available for use by this virtual server instance.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, @@ -835,6 +949,9 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { l["crn"] = *instance.CRN l["name"] = *instance.Name l["memory"] = *instance.Memory + if instance.NumaCount != nil { + l["numa_count"] = *instance.NumaCount + } if instance.MetadataService != nil { l[isInstanceMetadataServiceEnabled] = *instance.MetadataService.Enabled metadataService := []map[string]interface{}{} @@ -1086,6 +1203,50 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { if instance.Disks != nil { l[isInstanceDisks] = dataSourceInstanceFlattenDisks(instance.Disks) } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + poolList := make([]map[string]interface{}, 0) + for _, pool := range instance.ReservationAffinity.Pool { + res := map[string]interface{}{} + + res[isReservationId] = *pool.ID + res[isReservationHref] = *pool.Href + res[isReservationName] = *pool.Name + res[isReservationCrn] = *pool.CRN + res[isReservationResourceType] = *pool.ResourceType + if pool.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*pool.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + poolList = append(poolList, res) + } + reservationAffinityMap[isReservationAffinityPool] = poolList + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + l[isReservationAffinity] = reservationAffinity + } + if instance.Reservation != nil { + res := map[string]interface{}{} + + res[isReservationId] = *instance.Reservation.ID + res[isReservationHref] = *instance.Reservation.Href + res[isReservationName] = *instance.Reservation.Name + res[isReservationCrn] = *instance.Reservation.CRN + res[isReservationResourceType] = *instance.Reservation.ResourceType + if instance.Reservation.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*instance.Reservation.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + l[isInstanceReservation] = res + } instancesInfo = append(instancesInfo, l) } diff --git a/ibm/service/vpc/data_source_ibm_is_share_mount_target.go b/ibm/service/vpc/data_source_ibm_is_share_mount_target.go index 0da8b036af..f1da5dd2bf 100644 --- a/ibm/service/vpc/data_source_ibm_is_share_mount_target.go +++ b/ibm/service/vpc/data_source_ibm_is_share_mount_target.go @@ -443,12 +443,6 @@ func dataSourceShareTargetVNIToMap(VNIItem vpcv1.VirtualNetworkInterfaceReferenc if VNIItem.CRN != nil { subnetMap["crn"] = VNIItem.CRN } - if VNIItem.Deleted != nil { - deletedList := []map[string]interface{}{} - deletedMap := dataSourceShareTargetVNIDeletedToMap(*VNIItem.Deleted) - deletedList = append(deletedList, deletedMap) - subnetMap["deleted"] = deletedList - } if VNIItem.Href != nil { subnetMap["href"] = VNIItem.Href } @@ -465,13 +459,3 @@ func dataSourceShareTargetVNIToMap(VNIItem vpcv1.VirtualNetworkInterfaceReferenc return subnetMap } - -func dataSourceShareTargetVNIDeletedToMap(deletedItem vpcv1.VirtualNetworkInterfaceReferenceAttachmentContextDeleted) (deletedMap map[string]interface{}) { - deletedMap = map[string]interface{}{} - - if deletedItem.MoreInfo != nil { - deletedMap["more_info"] = deletedItem.MoreInfo - } - - return deletedMap -} diff --git a/ibm/service/vpc/data_source_ibm_is_vpc_test.go b/ibm/service/vpc/data_source_ibm_is_vpc_test.go index 3fafd5a3c2..99ba4eaf97 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpc_test.go +++ b/ibm/service/vpc/data_source_ibm_is_vpc_test.go @@ -56,7 +56,7 @@ func TestAccIBMISVPCDatasource_dns(t *testing.T) { { Config: testDSCheckIBMISVPCDnsConfig(name, server1Add, enableHubTrue), Check: resource.ComposeTestCheckFunc( - testAccCheckIBMISVPCExists("ibm_is_vpc.testacc_vpc", vpc), + testAccCheckIBMISVPCExists("ibm_is_vpc.testacc_vpc1", vpc), resource.TestCheckResourceAttr( "data.ibm_is_vpc.ds_vpc", "name", name), resource.TestCheckResourceAttrSet("data.ibm_is_vpc.ds_vpc", "cse_source_addresses.#"), diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go b/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go index b6443b0a9f..9fb96fd3c8 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go @@ -159,6 +159,67 @@ func DataSourceIBMISVPNGateway() *schema.Resource { Computed: true, Description: "The status of the VPN gateway.", }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "lifecycle_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the VPN route.", + }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "subnet": { Type: schema.TypeList, Computed: true, @@ -356,10 +417,18 @@ func dataSourceIBMIsVPNGatewayRead(context context.Context, d *schema.ResourceDa if err = d.Set("resource_type", vpnGateway.ResourceType); err != nil { return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) } - if err = d.Set("status", vpnGateway.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + if err = d.Set("health_state", vpnGateway.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + if err := d.Set("health_reasons", resourceVPNGatewayRouteFlattenHealthReasons(vpnGateway.HealthReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_reasons: %s", err)) + } + if err = d.Set("lifecycle_state", vpnGateway.LifecycleState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) + } + if err := d.Set("lifecycle_reasons", resourceVPNGatewayFlattenLifecycleReasons(vpnGateway.LifecycleReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err)) } - if vpnGateway.Subnet != nil { err = d.Set("subnet", dataSourceVPNGatewayFlattenSubnet(*vpnGateway.Subnet)) if err != nil { @@ -454,9 +523,6 @@ func dataSourceVPNGatewayMembersToMap(membersItem vpcv1.VPNGatewayMember) (membe if membersItem.Role != nil { membersMap["role"] = membersItem.Role } - if membersItem.Status != nil { - membersMap["status"] = membersItem.Status - } return membersMap } diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go b/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go index 92ac553630..d9fdca1993 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go @@ -205,6 +205,30 @@ func DataSourceIBMISVPNGatewayConnection() *schema.Resource { Computed: true, Description: "The status of a VPN gateway connection.", }, + "status_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current status (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, "routing_protocol": { Type: schema.TypeString, Computed: true, @@ -382,6 +406,9 @@ func dataSourceIBMIsVPNGatewayConnectionRead(context context.Context, d *schema. if err = d.Set("status", vpnGatewayConnection.Status); err != nil { return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) } + if err := d.Set("status_reasons", resourceVPNGatewayConnectionFlattenLifecycleReasons(vpnGatewayConnection.StatusReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status_reasons: %s", err)) + } if err = d.Set("routing_protocol", vpnGatewayConnection.RoutingProtocol); err != nil { return diag.FromErr(fmt.Errorf("Error setting routing_protocol: %s", err)) } diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go b/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go index f073c31951..d7f0ef16ca 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go @@ -112,7 +112,30 @@ func DataSourceIBMISVPNGatewayConnections() *schema.Resource { Computed: true, Description: "VPN gateway connection status", }, - + isVPNGatewayConnectionStatusreasons: { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current status (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, isVPNGatewayConnectionTunnels: { Type: schema.TypeList, Computed: true, @@ -202,6 +225,7 @@ func dataSourceIBMVPNGatewayConnectionsRead(d *schema.ResourceData, meta interfa gatewayconnection[isVPNGatewayConnectionPeerAddress] = *data.PeerAddress gatewayconnection[isVPNGatewayConnectionResourcetype] = *data.ResourceType gatewayconnection[isVPNGatewayConnectionStatus] = *data.Status + gatewayconnection[isVPNGatewayConnectionStatusreasons] = resourceVPNGatewayConnectionFlattenLifecycleReasons(data.StatusReasons) //if data.Tunnels != nil { if len(data.Tunnels) > 0 { vpcTunnelsList := make([]map[string]interface{}, 0) diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go b/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go index 5301873f78..89c8bdde9f 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go @@ -98,7 +98,67 @@ func DataSourceIBMISVPNGateways() *schema.Resource { Computed: true, Description: "The status of the VPN gateway", }, + isVPNGatewayHealthState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + isVPNGatewayHealthReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + isVPNGatewayLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the VPN route.", + }, + isVPNGatewayLifecycleReasons: { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, isVPNGatewaySubnet: { Type: schema.TypeString, Computed: true, @@ -218,7 +278,10 @@ func dataSourceIBMVPNGatewaysRead(d *schema.ResourceData, meta interface{}) erro gateway[isVPNGatewayName] = *data.Name gateway[isVPNGatewayCreatedAt] = data.CreatedAt.String() gateway[isVPNGatewayResourceType] = *data.ResourceType - gateway[isVPNGatewayStatus] = *data.Status + gateway[isVPNGatewayHealthState] = *data.HealthState + gateway[isVPNGatewayHealthReasons] = resourceVPNGatewayRouteFlattenHealthReasons(data.HealthReasons) + gateway[isVPNGatewayLifecycleState] = *data.LifecycleState + gateway[isVPNGatewayLifecycleReasons] = resourceVPNGatewayFlattenLifecycleReasons(data.LifecycleReasons) gateway[isVPNGatewayMode] = *data.Mode gateway[isVPNGatewayResourceGroup] = *data.ResourceGroup.ID gateway[isVPNGatewaySubnet] = *data.Subnet.ID @@ -243,7 +306,6 @@ func dataSourceIBMVPNGatewaysRead(d *schema.ResourceData, meta interface{}) erro if memberIP.PublicIP != nil { currentMemberIP["address"] = *memberIP.PublicIP.Address currentMemberIP["role"] = *memberIP.Role - currentMemberIP["status"] = *memberIP.Status vpcMembersIpsList = append(vpcMembersIpsList, currentMemberIP) } if memberIP.PrivateIP != nil && memberIP.PrivateIP.Address != nil { diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_server.go b/ibm/service/vpc/data_source_ibm_is_vpn_server.go index ae44bcdec9..4595cb40ef 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_server.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_server.go @@ -128,6 +128,31 @@ func DataSourceIBMIsVPNServer() *schema.Resource { Computed: true, Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "hostname": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -143,6 +168,32 @@ func DataSourceIBMIsVPNServer() *schema.Resource { Computed: true, Description: "The lifecycle state of the VPN server.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "port": &schema.Schema{ Type: schema.TypeInt, Computed: true, @@ -497,6 +548,11 @@ func dataSourceIBMIsVPNServerRead(context context.Context, d *schema.ResourceDat if err = d.Set("health_state", vpnServer.HealthState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) } + if vpnServer.HealthReasons != nil { + if err := d.Set("health_reasons", resourceVPNServerFlattenHealthReasons(vpnServer.HealthReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_reasons: %s", err)) + } + } if err = d.Set("hostname", vpnServer.Hostname); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting hostname: %s", err)) } @@ -506,6 +562,11 @@ func dataSourceIBMIsVPNServerRead(context context.Context, d *schema.ResourceDat if err = d.Set("lifecycle_state", vpnServer.LifecycleState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } + if vpnServer.LifecycleReasons != nil { + if err := d.Set("lifecycle_reasons", resourceVPNServerFlattenLifecycleReasons(vpnServer.LifecycleReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err)) + } + } if err = d.Set("name", vpnServer.Name); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_server_route.go b/ibm/service/vpc/data_source_ibm_is_vpn_server_route.go index bc3e254e74..d071f889af 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_server_route.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_server_route.go @@ -61,11 +61,67 @@ func DataSourceIBMIsVPNServerRoute() *schema.Resource { Computed: true, Description: "The URL for this VPN route.", }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "lifecycle_state": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "The lifecycle state of the VPN route.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "resource_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -154,9 +210,22 @@ func dataSourceIBMIsVPNServerRouteRead(context context.Context, d *schema.Resour if err = d.Set("href", vpnServerRoute.Href); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } + if err = d.Set("health_state", vpnServerRoute.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + if vpnServerRoute.HealthReasons != nil { + if err := d.Set("health_reasons", resourceVPNServerRouteFlattenHealthReasons(vpnServerRoute.HealthReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_reasons: %s", err)) + } + } if err = d.Set("lifecycle_state", vpnServerRoute.LifecycleState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } + if vpnServerRoute.LifecycleReasons != nil { + if err := d.Set("lifecycle_reasons", resourceVPNServerRouteFlattenLifecycleReasons(vpnServerRoute.LifecycleReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err)) + } + } if err = d.Set("name", vpnServerRoute.Name); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_server_routes.go b/ibm/service/vpc/data_source_ibm_is_vpn_server_routes.go index e0c034e09f..5142635924 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_server_routes.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_server_routes.go @@ -57,11 +57,67 @@ func DataSourceIBMIsVPNServerRoutes() *schema.Resource { Computed: true, Description: "The unique identifier for this VPN route.", }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "lifecycle_state": &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "The lifecycle state of the VPN route.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "name": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -186,9 +242,19 @@ func dataSourceVPNServerRouteCollectionRoutesToMap(routesItem vpcv1.VPNServerRou if routesItem.ID != nil { routesMap["id"] = routesItem.ID } + if routesItem.HealthState != nil { + routesMap["health_state"] = routesItem.HealthState + } + if routesItem.HealthReasons != nil { + routesMap["health_reasons"] = resourceVPNServerRouteFlattenHealthReasons(routesItem.HealthReasons) + } if routesItem.LifecycleState != nil { routesMap["lifecycle_state"] = routesItem.LifecycleState } + if routesItem.LifecycleReasons != nil { + routesMap["lifecycle_reasons"] = resourceVPNServerRouteFlattenLifecycleReasons(routesItem.LifecycleReasons) + + } if routesItem.Name != nil { routesMap["name"] = routesItem.Name } diff --git a/ibm/service/vpc/data_source_ibm_is_vpn_servers.go b/ibm/service/vpc/data_source_ibm_is_vpn_servers.go index 811fb12696..06a4e29d92 100644 --- a/ibm/service/vpc/data_source_ibm_is_vpn_servers.go +++ b/ibm/service/vpc/data_source_ibm_is_vpn_servers.go @@ -124,6 +124,31 @@ func DataSourceIBMIsVPNServers() *schema.Resource { Computed: true, Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "hostname": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -144,6 +169,32 @@ func DataSourceIBMIsVPNServers() *schema.Resource { Computed: true, Description: "The lifecycle state of the VPN server.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "name": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -539,6 +590,9 @@ func dataSourceVPNServerCollectionVPNServersToMap(vpnServersItem vpcv1.VPNServer if vpnServersItem.HealthState != nil { vpnServersMap["health_state"] = vpnServersItem.HealthState } + if vpnServersItem.HealthReasons != nil { + vpnServersMap["health_reasons"] = resourceVPNServerFlattenHealthReasons(vpnServersItem.HealthReasons) + } if vpnServersItem.Hostname != nil { vpnServersMap["hostname"] = vpnServersItem.Hostname } @@ -551,6 +605,9 @@ func dataSourceVPNServerCollectionVPNServersToMap(vpnServersItem vpcv1.VPNServer if vpnServersItem.LifecycleState != nil { vpnServersMap["lifecycle_state"] = vpnServersItem.LifecycleState } + if vpnServersItem.LifecycleReasons != nil { + vpnServersMap["lifecycle_reasons"] = resourceVPNServerFlattenLifecycleReasons(vpnServersItem.LifecycleReasons) + } if vpnServersItem.Name != nil { vpnServersMap["name"] = vpnServersItem.Name } diff --git a/ibm/service/vpc/resource_ibm_is_backup_policy.go b/ibm/service/vpc/resource_ibm_is_backup_policy.go index c2d16166ee..2f9f94e9a6 100644 --- a/ibm/service/vpc/resource_ibm_is_backup_policy.go +++ b/ibm/service/vpc/resource_ibm_is_backup_policy.go @@ -27,12 +27,22 @@ func ResourceIBMIsBackupPolicy() *schema.Resource { Schema: map[string]*schema.Schema{ "match_resource_types": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Set: schema.HashString, - Description: "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeSet, + Optional: true, + Computed: true, + Set: schema.HashString, + Deprecated: "match_resource_types is being deprecated. Use match_resource_type instead", + Description: "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", + ConflictsWith: []string{"match_resource_type"}, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "match_resource_type": { + Type: schema.TypeString, + Optional: true, + Default: "volume", + ConflictsWith: []string{"match_resource_types"}, + ValidateFunc: validate.InvokeValidator("ibm_is_backup_policy", "match_resource_types"), + Description: "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", }, "match_user_tags": &schema.Schema{ Type: schema.TypeSet, @@ -88,6 +98,61 @@ func ResourceIBMIsBackupPolicy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current health_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource", + }, + "scope": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Optional: true, + MaxItems: 1, + Description: "The scope for this backup policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "The CRN for this enterprise.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this enterprise or account.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, }, } } @@ -118,7 +183,7 @@ func ResourceIBMIsBackupPolicyValidator() *validate.ResourceValidator { ) validateSchema = append(validateSchema, validate.ValidateSchema{ - Identifier: "match_resource_types", + Identifier: "match_resource_type", ValidateFunctionIdentifier: validate.ValidateRegexpLen, Type: validate.TypeString, Optional: true, @@ -139,9 +204,14 @@ func resourceIBMIsBackupPolicyCreate(context context.Context, d *schema.Resource createBackupPolicyOptions := &vpcv1.CreateBackupPolicyOptions{} - if _, ok := d.GetOk("match_resource_types"); ok { + if matchResourceType, ok := d.GetOk("match_resource_type"); ok { + matchResourceTypes := matchResourceType.(string) + matchResourceTypesList := []string{matchResourceTypes} + createBackupPolicyOptions.SetMatchResourceTypes(matchResourceTypesList) + } else if _, ok := d.GetOk("match_resource_types"); ok { createBackupPolicyOptions.SetMatchResourceTypes(flex.ExpandStringList((d.Get("match_resource_types").(*schema.Set)).List())) } + if _, ok := d.GetOk("match_user_tags"); ok { createBackupPolicyOptions.SetMatchUserTags((flex.ExpandStringList((d.Get("match_user_tags").(*schema.Set)).List()))) } @@ -156,6 +226,17 @@ func resourceIBMIsBackupPolicyCreate(context context.Context, d *schema.Resource createBackupPolicyOptions.SetResourceGroup(&resourceGroup) } + if _, ok := d.GetOk("scope"); ok { + bkpPolicyScopePrototypeMap := d.Get("scope.0").(map[string]interface{}) + bkpPolicyScopePrototype := vpcv1.BackupPolicyScopePrototype{} + if bkpPolicyScopePrototypeMap["crn"] != nil { + if crnStr := bkpPolicyScopePrototypeMap["crn"].(string); crnStr != "" { + bkpPolicyScopePrototype.CRN = core.StringPtr(crnStr) + } + } + createBackupPolicyOptions.SetScope(&bkpPolicyScopePrototype) + } + backupPolicy, response, err := vpcClient.CreateBackupPolicyWithContext(context, createBackupPolicyOptions) if err != nil { log.Printf("[DEBUG] CreateBackupPolicyWithContext failed %s\n%s", err, response) @@ -192,6 +273,13 @@ func resourceIBMIsBackupPolicyRead(context context.Context, d *schema.ResourceDa return diag.FromErr(fmt.Errorf("[ERROR] Error setting match_resource_types: %s", err)) } } + if backupPolicy.MatchResourceTypes != nil { + for _, matchResourceTypes := range backupPolicy.MatchResourceTypes { + if err = d.Set("match_resource_type", matchResourceTypes); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting match_resource_type: %s", err)) + } + } + } if backupPolicy.MatchUserTags != nil { if err = d.Set("match_user_tags", backupPolicy.MatchUserTags); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting match_user_tags: %s", err)) @@ -244,6 +332,35 @@ func resourceIBMIsBackupPolicyRead(context context.Context, d *schema.ResourceDa } } + if backupPolicy.HealthReasons != nil { + healthReasonsList := make([]map[string]interface{}, 0) + for _, sr := range backupPolicy.HealthReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR["code"] = *sr.Code + currentSR["message"] = *sr.Message + if sr.MoreInfo != nil { + currentSR["more_info"] = *sr.Message + } + healthReasonsList = append(healthReasonsList, currentSR) + } + } + d.Set("health_reasons", healthReasonsList) + } + if err = d.Set("health_state", backupPolicy.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + + if backupPolicy.Scope != nil { + scope := []map[string]interface{}{} + scopeMap := resourceIbmIsBackupPolicyScopeToMap(*backupPolicy.Scope.(*vpcv1.BackupPolicyScope)) + scope = append(scope, scopeMap) + + if err = d.Set("scope", scope); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scope: %s", err)) + } + } + if err = d.Set("version", response.Headers.Get("Etag")); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) } @@ -251,6 +368,16 @@ func resourceIBMIsBackupPolicyRead(context context.Context, d *schema.ResourceDa return nil } +func resourceIbmIsBackupPolicyScopeToMap(scope vpcv1.BackupPolicyScope) map[string]interface{} { + scopeMap := map[string]interface{}{} + + scopeMap["crn"] = scope.CRN + scopeMap["id"] = scope.ID + scopeMap["resource_type"] = scope.ResourceType + + return scopeMap +} + func resourceIBMIsBackupPolicyUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { vpcClient, err := vpcClient(meta) if err != nil { diff --git a/ibm/service/vpc/resource_ibm_is_backup_policy_test.go b/ibm/service/vpc/resource_ibm_is_backup_policy_test.go index da096e107e..d6a0426b4f 100644 --- a/ibm/service/vpc/resource_ibm_is_backup_policy_test.go +++ b/ibm/service/vpc/resource_ibm_is_backup_policy_test.go @@ -69,6 +69,59 @@ func TestAccIBMIsBackupPolicyBasic(t *testing.T) { }) } +func TestAccIBMIsBackupPolicyMatchResourceType(t *testing.T) { + vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100)) + name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100)) + subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100)) + sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100)) + volname := fmt.Sprintf("tf-vol-%d", acctest.RandIntRange(10, 100)) + backupPolicyName := fmt.Sprintf("tfbakuppolicyname%d", acctest.RandIntRange(10, 100)) + backupPolicyNameUpdate := fmt.Sprintf("tfbakuppolicyname%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMIsBackupPolicyDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIBMIsBackupPolicyConfigMatchResourceType(backupPolicyName, vpcname, subnetname, sshname, volname, name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_is_backup_policy.is_backup_policy", "name", backupPolicyName), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_resource_types.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_user_tags.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_group"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "created_at"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "crn"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "href"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_type"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "version"), + ), + }, + resource.TestStep{ + Config: testAccCheckIBMIsBackupPolicyConfigMatchResourceType(backupPolicyNameUpdate, vpcname, subnetname, sshname, volname, name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_is_backup_policy.is_backup_policy", "name", backupPolicyNameUpdate), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_resource_types.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_user_tags.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_group"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "created_at"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "crn"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "href"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_type"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "version"), + ), + }, + { + ResourceName: "ibm_is_backup_policy.is_backup_policy", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckIBMIsBackupPolicyConfigBasic(backupPolicyName string, vpcname, subnetname, sshname, volName, name string) string { return fmt.Sprintf(` resource "ibm_is_vpc" "testacc_vpc" { @@ -116,6 +169,54 @@ func testAccCheckIBMIsBackupPolicyConfigBasic(backupPolicyName string, vpcname, }`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, volName, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, backupPolicyName) } +func testAccCheckIBMIsBackupPolicyConfigMatchResourceType(backupPolicyName string, vpcname, subnetname, sshname, volName, name string) string { + return fmt.Sprintf(` + resource "ibm_is_vpc" "testacc_vpc" { + name = "%s" + } + + resource "ibm_is_subnet" "testacc_subnet" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + ipv4_cidr_block = "%s" + } + + resource "ibm_is_ssh_key" "testacc_sshkey" { + name = "%s" + // public_key = file("../../test-fixtures/.ssh/id_rsa") + public_key = file("~/.ssh/id_rsa.pub") + } + + resource "ibm_is_volume" "storage" { + name = "%s" + profile = "10iops-tier" + zone = "%s" + # capacity= 200 + tags = ["tag-0"] + } + + resource "ibm_is_instance" "testacc_instance" { + name = "%s" + image = "%s" + profile = "%s" + primary_network_interface { + subnet = ibm_is_subnet.testacc_subnet.id + } + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + keys = [ibm_is_ssh_key.testacc_sshkey.id] + volumes = [ibm_is_volume.storage.id] + } + + resource "ibm_is_backup_policy" "is_backup_policy" { + depends_on = [ibm_is_instance.testacc_instance] + match_user_tags = ["tag-0"] + match_resource_type = "volume" + name = "%s" + }`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, volName, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName, backupPolicyName) +} + func testAccCheckIBMIsBackupPolicyDestroy(s *terraform.State) error { vpcClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() @@ -143,3 +244,48 @@ func testAccCheckIBMIsBackupPolicyDestroy(s *terraform.State) error { return nil } + +func TestAccIBMIsBackupPolicyBasicWithScope(t *testing.T) { + backupPolicyName := fmt.Sprintf("tfbakuppolicyname%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMIsBackupPolicyDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccCheckIBMIsBackupPolicyConfigBasicWithScope(backupPolicyName, acc.EnterpriseCRN), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_is_backup_policy.is_backup_policy", "name", backupPolicyName), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_resource_types.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "match_user_tags.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_group"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "created_at"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "crn"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "href"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "scope.#"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "scope.0.id"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "resource_type"), + resource.TestCheckResourceAttrSet("ibm_is_backup_policy.is_backup_policy", "version"), + ), + }, + { + ResourceName: "ibm_is_backup_policy.is_backup_policy", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckIBMIsBackupPolicyConfigBasicWithScope(backupPolicyName, entCrn string) string { + return fmt.Sprintf(` + resource "ibm_is_backup_policy" "is_backup_policy" { + match_user_tags = ["dev:test"] + name = "%s" + scope { + crn = "%s" + } + }`, backupPolicyName, entCrn) +} diff --git a/ibm/service/vpc/resource_ibm_is_dedicated_host.go b/ibm/service/vpc/resource_ibm_is_dedicated_host.go index 37f76ba67c..09d1fec740 100644 --- a/ibm/service/vpc/resource_ibm_is_dedicated_host.go +++ b/ibm/service/vpc/resource_ibm_is_dedicated_host.go @@ -76,6 +76,39 @@ func ResourceIbmIsDedicatedHost() *schema.Resource { ValidateFunc: validate.InvokeValidator("ibm_is_dedicated_host", "name"), Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, + "numa": { + Type: schema.TypeList, + Computed: true, + Description: "The dedicated host NUMA configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "count": { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of NUMA nodes for this dedicated host", + }, + "nodes": { + Type: schema.TypeList, + Computed: true, + Description: "The NUMA nodes for this dedicated host.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "available_vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The available VCPU for this NUMA node.", + }, + "vcpu": { + Type: schema.TypeInt, + Computed: true, + Description: "The total VCPU capacity for this NUMA node.", + }, + }, + }, + }, + }, + }, + }, "profile": { Type: schema.TypeString, Required: true, @@ -529,6 +562,11 @@ func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceD if err = d.Set("name", dedicatedHost.Name); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } + if dedicatedHost.Numa != nil { + if err = d.Set("numa", dataSourceDedicatedHostFlattenNumaNodes(*dedicatedHost.Numa)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting numa: %s", err)) + } + } if err = d.Set("profile", *dedicatedHost.Profile.Name); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile: %s", err)) diff --git a/ibm/service/vpc/resource_ibm_is_dedicated_host_test.go b/ibm/service/vpc/resource_ibm_is_dedicated_host_test.go index de2fdc3f39..f07d05376a 100644 --- a/ibm/service/vpc/resource_ibm_is_dedicated_host_test.go +++ b/ibm/service/vpc/resource_ibm_is_dedicated_host_test.go @@ -33,6 +33,7 @@ func TestAccIbmIsDedicatedHostBasic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIbmIsDedicatedHostExists(resname, conf), resource.TestCheckResourceAttr(resname, "name", dhname), + resource.TestCheckResourceAttrSet(resname, "numa"), resource.TestCheckResourceAttr(resname, "disks.#", "2"), resource.TestCheckResourceAttrSet(resname, "disks.0.name"), resource.TestCheckResourceAttrSet(resname, "disks.0.size"), diff --git a/ibm/service/vpc/resource_ibm_is_instance.go b/ibm/service/vpc/resource_ibm_is_instance.go index 1f82d0249d..c71a18bfc1 100644 --- a/ibm/service/vpc/resource_ibm_is_instance.go +++ b/ibm/service/vpc/resource_ibm_is_instance.go @@ -174,10 +174,6 @@ func ResourceIBMISInstance() *schema.Resource { }, CustomizeDiff: customdiff.All( - customdiff.Sequence( - func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return flex.InstanceProfileValidate(diff) - }), customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { return flex.ResourceTagsCustomizeDiff(diff) @@ -998,6 +994,119 @@ func ResourceIBMISInstance() *schema.Resource { }, }, }, + isInstanceReservation: { + Type: schema.TypeList, + Computed: true, + Description: "The reservation used by this virtual server instance", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + isReservationAffinity: { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "policy": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "The pool of reservations available for use by this virtual server instance.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + isReservationCrn: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this reservation.", + }, + isReservationHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reservation.", + }, + isReservationName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this reservation. The name is unique across all reservations in the region.", + }, + isReservationResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + isReservationDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationDeletedMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, } } @@ -1212,6 +1321,32 @@ func instanceCreateByImage(d *schema.ResourceData, meta interface{}, profile, na } + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } + if primnicintf, ok := d.GetOk(isInstancePrimaryNetworkInterface); ok { primnic := primnicintf.([]interface{})[0].(map[string]interface{}) subnetintf, _ := primnic[isInstanceNicSubnet] @@ -1585,6 +1720,32 @@ func instanceCreateByCatalogOffering(d *schema.ResourceData, meta interface{}, p } + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } + if primnicintf, ok := d.GetOk(isInstancePrimaryNetworkInterface); ok { primnic := primnicintf.([]interface{})[0].(map[string]interface{}) subnetintf, _ := primnic[isInstanceNicSubnet] @@ -1956,6 +2117,32 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, } } + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } + if primnicintf, ok := d.GetOk(isInstancePrimaryNetworkInterface); ok { primnic := primnicintf.([]interface{})[0].(map[string]interface{}) subnetintf, _ := primnic[isInstanceNicSubnet] @@ -2319,6 +2506,33 @@ func instanceCreateBySnapshot(d *schema.ResourceData, meta interface{}, profile, Volume: volTemplate, } } + + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } + if totalVolBandwidthIntf, ok := d.GetOk(isInstanceTotalVolumeBandwidth); ok { totalVolBandwidthStr := int64(totalVolBandwidthIntf.(int)) instanceproto.TotalVolumeBandwidth = &totalVolBandwidthStr @@ -2658,6 +2872,33 @@ func instanceCreateByVolume(d *schema.ResourceData, meta interface{}, profile, n } instanceproto.BootVolumeAttachment = bootVolAttachment } + + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } + if totalVolBandwidthIntf, ok := d.GetOk(isInstanceTotalVolumeBandwidth); ok { totalVolBandwidthStr := int64(totalVolBandwidthIntf.(int)) instanceproto.TotalVolumeBandwidth = &totalVolBandwidthStr @@ -3234,6 +3475,50 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { primaryNicList = append(primaryNicList, currentPrimNic) d.Set(isInstancePrimaryNetworkInterface, primaryNicList) } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + poolList := make([]map[string]interface{}, 0) + for _, pool := range instance.ReservationAffinity.Pool { + res := map[string]interface{}{} + + res[isReservationId] = *pool.ID + res[isReservationHref] = *pool.Href + res[isReservationName] = *pool.Name + res[isReservationCrn] = *pool.CRN + res[isReservationResourceType] = *pool.ResourceType + if pool.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*pool.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + poolList = append(poolList, res) + } + reservationAffinityMap[isReservationAffinityPool] = poolList + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + d.Set(isReservationAffinity, reservationAffinity) + } + if instance.Reservation != nil { + res := map[string]interface{}{} + + res[isReservationId] = *instance.Reservation.ID + res[isReservationHref] = *instance.Reservation.Href + res[isReservationName] = *instance.Reservation.Name + res[isReservationCrn] = *instance.Reservation.CRN + res[isReservationResourceType] = *instance.Reservation.ResourceType + if instance.Reservation.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceInstanceReservationDeletedToMap(*instance.Reservation.Deleted) + deletedList = append(deletedList, deletedMap) + res[isReservationDeleted] = deletedList + } + d.Set(isInstanceReservation, res) + } if instance.NetworkInterfaces != nil { interfacesList := make([]map[string]interface{}, 0) @@ -3305,7 +3590,9 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { if instance.Image != nil { d.Set(isInstanceImage, *instance.Image.ID) } - + if instance.NumaCount != nil { + d.Set("numa_count", int(*instance.NumaCount)) + } d.Set(isInstanceStatus, *instance.Status) //set the status reasons @@ -3466,6 +3753,68 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } id := d.Id() + resPol := "reservation_affinity.0.policy" + resPool := "reservation_affinity.0.pool" + + if (d.HasChange(resPol) || d.HasChange(resPool)) && !d.IsNewResource() { + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + getinsOptions := &vpcv1.GetInstanceOptions{ + ID: &id, + } + _, response, err := instanceC.GetInstance(getinsOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error getting instance (%s): %s\n%s", id, err, response) + } + eTag := response.Headers.Get("ETag") + + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinityPatch = &vpcv1.InstanceReservationAffinityPatch{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinityPatch.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinityPatch.Pool = resAffPool + } + } + } + + instancePatchModel := &vpcv1.InstancePatch{ + ReservationAffinity: resAffinityPatch, + } + mpatch, err := instancePatchModel.AsPatch() + if err != nil { + return fmt.Errorf("[ERROR] Error calling asPatch with reservation affinity: %s", err) + } + //Detaching the reservation from the reserved instance + if policyStr == "disabled" { + resAffMap := mpatch["reservation_affinity"].(map[string]interface{}) + resAffMap["pool"] = nil + mpatch["reservation_affinity"] = resAffMap + } + param := &vpcv1.UpdateInstanceOptions{ + InstancePatch: mpatch, + ID: &id, + } + param.IfMatch = &eTag + _, _, err = instanceC.UpdateInstance(param) + if err != nil { + return err + } + } + } + bootVolSize := "boot_volume.0.size" if d.HasChange(bootVolSize) && !d.IsNewResource() { old, new := d.GetChange(bootVolSize) @@ -4582,6 +4931,15 @@ func resourceIbmIsInstanceInstancePlacementToMap(instancePlacement vpcv1.Instanc return instancePlacementMap } +func resourceIbmIsInstanceReservationAffinityPoolToMap(reservationPool vpcv1.ReservationReference) map[string]interface{} { + resAffPoolMap := map[string]interface{}{} + + resAffPoolMap["crn"] = reservationPool.CRN + resAffPoolMap["href"] = reservationPool.Href + resAffPoolMap["id"] = reservationPool.ID + return resAffPoolMap +} + func resourceIbmIsInstanceDedicatedHostGroupReferenceDeletedToMap(dedicatedHostGroupReferenceDeleted vpcv1.DedicatedHostGroupReferenceDeleted) map[string]interface{} { dedicatedHostGroupReferenceDeletedMap := map[string]interface{}{} diff --git a/ibm/service/vpc/resource_ibm_is_instance_template.go b/ibm/service/vpc/resource_ibm_is_instance_template.go index 65f01f51c5..33cbf5c134 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_template.go +++ b/ibm/service/vpc/resource_ibm_is_instance_template.go @@ -581,6 +581,27 @@ func ResourceIBMISInstanceTemplate() *schema.Resource { }, }, }, + isReservationAffinity: { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationAffinityPolicyResp: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The reservation affinity policy to use for this virtual server instance.", + }, + isReservationAffinityPool: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The ID of the reservation associated with this template.", + }, + }, + }, + }, }, } } @@ -1198,6 +1219,31 @@ func instanceTemplateCreate(d *schema.ResourceData, meta interface{}, profile, n } instanceproto.PlacementTarget = dHostGrpPlaementTarget } + if resAffinity, ok := d.GetOk(isReservationAffinity); ok { + resAff := resAffinity.([]interface{})[0].(map[string]interface{}) + var resAffinity = &vpcv1.InstanceReservationAffinityPrototype{} + policy, ok := resAff["policy"] + policyStr := policy.(string) + if policyStr != "" && ok { + resAffinity.Policy = &policyStr + } + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok := id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinity.Pool = resAffPool + } + } + } + instanceproto.ReservationAffinity = resAffinity + } if placementGroupInf, ok := d.GetOk(isPlacementTargetPlacementGroup); ok { placementGrpStr := placementGroupInf.(string) @@ -1587,6 +1633,27 @@ func instanceTemplateGet(d *schema.ResourceData, meta interface{}, ID string) er } + if instance.ReservationAffinity != nil { + reservationAffinity := []map[string]interface{}{} + reservationAffinityMap := map[string]interface{}{} + + reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil { + pool := instance.ReservationAffinity.Pool[0] + res := "" + if idPool, ok := pool.(*vpcv1.ReservationIdentityByID); ok { + res = *idPool.ID + } else if crnPool, ok := pool.(*vpcv1.ReservationIdentityByCRN); ok { + res = *crnPool.CRN + } else if hrefPool, ok := pool.(*vpcv1.ReservationIdentityByHref); ok { + res = *hrefPool.Href + } + reservationAffinityMap[isReservationAffinityPool] = res + } + reservationAffinity = append(reservationAffinity, reservationAffinityMap) + d.Set(isReservationAffinity, reservationAffinity) + } + if instance.Profile != nil { instanceProfileIntf := instance.Profile identity := instanceProfileIntf.(*vpcv1.InstanceProfileIdentity) diff --git a/ibm/service/vpc/resource_ibm_is_instance_test.go b/ibm/service/vpc/resource_ibm_is_instance_test.go index 6e6dfc69aa..fcaccd41dc 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_test.go +++ b/ibm/service/vpc/resource_ibm_is_instance_test.go @@ -68,6 +68,8 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE "ibm_is_instance.testacc_instance", "vcpu.#"), resource.TestCheckResourceAttrSet( "ibm_is_instance.testacc_instance", "vcpu.0.manufacturer"), + resource.TestCheckResourceAttrSet( + "ibm_is_instance.testacc_instance", "numa_count"), ), }, }, @@ -851,6 +853,36 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE }) } +func TestAccIBMISInstance_Reservation(t *testing.T) { + var instance string + vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100)) + name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100)) + subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100)) + reservationname := fmt.Sprintf("tf-reservation-%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMISInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, reservationname), + Check: resource.ComposeTestCheckFunc( + testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance), + resource.TestCheckResourceAttr( + "ibm_is_instance.testacc_instance", "name", name), + resource.TestCheckResourceAttr( + "ibm_is_instance.testacc_instance", "zone", acc.ISZoneName), + resource.TestCheckResourceAttr( + "ibm_is_instance.testacc_instance", "reservation_affinity.0.policy", "manual"), + resource.TestCheckResourceAttrSet( + "ibm_is_instance.testacc_instance", "reservation_affinity.0.pool"), + ), + }, + }, + }) +} + func testAccCheckIBMISInstanceDestroy(s *terraform.State) error { instanceC, _ := acc.TestAccProvider.Meta().(conns.ClientSession).VpcV1API() @@ -1639,6 +1671,53 @@ func testAccCheckIBMISInstancePlacement(vpcname, subnetname, sshname, publicKey, `, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, publicKey, volName, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.DedicatedHostGroupID, acc.ISZoneName, acc.DedicatedHostName) } +func testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, reservationid string) string { + return fmt.Sprintf(` + resource "ibm_is_vpc" "testacc_vpc" { + name = "%s" + } + + resource "ibm_is_subnet" "testacc_subnet" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + ipv4_cidr_block = "%s" + } + + resource "ibm_is_reservation" "testacc_reservation" { + capacity { + total = 10 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "%s" + } + + resource "ibm_is_instance" "testacc_instance" { + name = "%s" + image = "%s" + profile = "%s" + primary_network_interface { + subnet = ibm_is_subnet.testacc_subnet.id + } + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + reservation_affinity { + policy = "manual" + pool { + id = ibm_is_reservation.testacc_reservation.id + } + } + } + + `, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName) +} + func testAccCheckIBMISInstanceByVolume(vpcname, subnetname, sshname, publicKey, volName, name, name1, sname string) string { return testAccCheckIBMISVolumeConfigSnapshot(vpcname, subnetname, sshname, publicKey, volName, name, sname) + fmt.Sprintf(` diff --git a/ibm/service/vpc/resource_ibm_is_lb.go b/ibm/service/vpc/resource_ibm_is_lb.go index 66f6ebac1a..4e58d0483c 100644 --- a/ibm/service/vpc/resource_ibm_is_lb.go +++ b/ibm/service/vpc/resource_ibm_is_lb.go @@ -189,13 +189,12 @@ func ResourceIBMISLB() *schema.Resource { }, isLBSecurityGroups: { - Type: schema.TypeSet, - Computed: true, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Description: "Load Balancer securitygroups list", - ConflictsWith: []string{isLBProfile}, + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Load Balancer securitygroups list", }, isLBSecurityGroupsSupported: { diff --git a/ibm/service/vpc/resource_ibm_is_lb_test.go b/ibm/service/vpc/resource_ibm_is_lb_test.go index 01d9a0919e..4dcb832567 100644 --- a/ibm/service/vpc/resource_ibm_is_lb_test.go +++ b/ibm/service/vpc/resource_ibm_is_lb_test.go @@ -330,6 +330,50 @@ func TestAccIBMISLB_basic_network(t *testing.T) { }, }) } +func TestAccIBMISLB_basic_network_security_group(t *testing.T) { + var lb string + vpcname := fmt.Sprintf("tflb-vpc-%d", acctest.RandIntRange(10, 100)) + subnetname := fmt.Sprintf("tflb-subnet-name-%d", acctest.RandIntRange(10, 100)) + nlbName := fmt.Sprintf("tfnlbcreate%d", acctest.RandIntRange(10, 100)) + nlbName1 := fmt.Sprintf("tfnlbupdate%d", acctest.RandIntRange(10, 100)) + securityGroup := fmt.Sprintf("tflbsecuritygroup%d", acctest.RandIntRange(10, 100)) + securityGroup2 := fmt.Sprintf("tflbsecuritygroup2%d", acctest.RandIntRange(10, 100)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMISLBDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMISLBNetworkSgConfig(vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, nlbName, securityGroup), + Check: resource.ComposeTestCheckFunc( + testAccCheckIBMISLBExists("ibm_is_lb.testacc_NLB", lb), + resource.TestCheckResourceAttr( + "ibm_is_lb.testacc_NLB", "name", nlbName), + resource.TestCheckResourceAttrSet( + "ibm_is_lb.testacc_NLB", "hostname"), + resource.TestCheckResourceAttrSet( + "ibm_is_lb.testacc_NLB", "security_groups.#"), + resource.TestCheckResourceAttr( + "ibm_is_lb.testacc_NLB", "security_groups.#", "1"), + ), + }, + + { + Config: testAccCheckIBMISLBNetworkSgUpdateConfig(vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, nlbName1, securityGroup, securityGroup2), + Check: resource.ComposeTestCheckFunc( + testAccCheckIBMISLBExists("ibm_is_lb.testacc_NLB", lb), + resource.TestCheckResourceAttr( + "ibm_is_lb.testacc_NLB", "name", nlbName1), + resource.TestCheckResourceAttrSet( + "ibm_is_lb.testacc_NLB", "security_groups.#"), + resource.TestCheckResourceAttr( + "ibm_is_lb.testacc_NLB", "security_groups.#", "2"), + ), + }, + }, + }) +} func TestAccIBMISLB_basic_network_vnf(t *testing.T) { var lb string @@ -582,6 +626,56 @@ func testAccCheckIBMISLBNetworkConfig(vpcname, subnetname, zone, cidr, nlbName s profile = "network-fixed" }`, vpcname, subnetname, zone, cidr, nlbName) +} +func testAccCheckIBMISLBNetworkSgConfig(vpcname, subnetname, zone, cidr, nlbName, securityGroup string) string { + return fmt.Sprintf(` + resource "ibm_is_vpc" "testacc_vpc" { + name = "%s" + } + resource "ibm_is_subnet" "testacc_subnet" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + ipv4_cidr_block = "%s" + } + resource "ibm_is_security_group" "testacc_security_group" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + } + resource "ibm_is_lb" "testacc_NLB" { + name = "%s" + subnets = [ibm_is_subnet.testacc_subnet.id] + security_groups = [ibm_is_security_group.testacc_security_group.id] + profile = "network-fixed" + }`, vpcname, subnetname, zone, cidr, securityGroup, nlbName) + +} +func testAccCheckIBMISLBNetworkSgUpdateConfig(vpcname, subnetname, zone, cidr, nlbName, securityGroup, securityGroup2 string) string { + return fmt.Sprintf(` + resource "ibm_is_vpc" "testacc_vpc" { + name = "%s" + } + resource "ibm_is_subnet" "testacc_subnet" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + zone = "%s" + ipv4_cidr_block = "%s" + } + resource "ibm_is_security_group" "testacc_security_group" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + } + resource "ibm_is_security_group" "testacc_security_group2" { + name = "%s" + vpc = ibm_is_vpc.testacc_vpc.id + } + resource "ibm_is_lb" "testacc_NLB" { + name = "%s" + subnets = [ibm_is_subnet.testacc_subnet.id] + security_groups = [ibm_is_security_group.testacc_security_group.id, ibm_is_security_group.testacc_security_group2.id] + profile = "network-fixed" + }`, vpcname, subnetname, zone, cidr, securityGroup, securityGroup2, nlbName) + } func testAccCheckIBMISLBNetworkRouteModeConfig(vpcname, subnetname, zone, cidr, nlbName string, routeMode bool) string { diff --git a/ibm/service/vpc/resource_ibm_is_vpc_dns_resolution_binding.go b/ibm/service/vpc/resource_ibm_is_vpc_dns_resolution_binding.go index 3ec4a1ff60..b83c374d5b 100644 --- a/ibm/service/vpc/resource_ibm_is_vpc_dns_resolution_binding.go +++ b/ibm/service/vpc/resource_ibm_is_vpc_dns_resolution_binding.go @@ -404,7 +404,7 @@ func resourceIBMIsVPCDnsResolutionBindingDelete(context context.Context, d *sche deleteVPCDnsResolutionBindingOptions.SetVPCID(vpcId) deleteVPCDnsResolutionBindingOptions.SetID(id) - response, err := sess.DeleteVPCDnsResolutionBindingWithContext(context, deleteVPCDnsResolutionBindingOptions) + _, response, err := sess.DeleteVPCDnsResolutionBindingWithContext(context, deleteVPCDnsResolutionBindingOptions) if err != nil { log.Printf("[DEBUG] DeleteVPCDnsResolutionBindingWithContext failed %s\n%s", err, response) if response.StatusCode != 404 { diff --git a/ibm/service/vpc/resource_ibm_is_vpn_gateway.go b/ibm/service/vpc/resource_ibm_is_vpn_gateway.go index 86f9635ead..d2d25a5e20 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_gateway.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_gateway.go @@ -37,6 +37,10 @@ const ( isVPNGatewayPrivateIPAddress = "private_ip_address" isVPNGatewayPrivateIPAddress2 = "private_ip_address2" isVPNGatewayAccessTags = "access_tags" + isVPNGatewayHealthState = "health_state" + isVPNGatewayHealthReasons = "health_reasons" + isVPNGatewayLifecycleState = "lifecycle_state" + isVPNGatewayLifecycleReasons = "lifecycle_reasons" ) func ResourceIBMISVPNGateway() *schema.Resource { @@ -96,6 +100,37 @@ func ResourceIBMISVPNGateway() *schema.Resource { Description: "The status of the VPN gateway", }, + isVPNGatewayHealthState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + isVPNGatewayHealthReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, + isVPNGatewayPublicIPAddress: { Type: schema.TypeString, Computed: true, @@ -178,6 +213,37 @@ func ResourceIBMISVPNGateway() *schema.Resource { Computed: true, Description: "Created Time of the VPN Gateway", }, + isVPNGatewayLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the VPN route.", + }, + isVPNGatewayLifecycleReasons: { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, isVPNGatewayMode: { Type: schema.TypeString, Optional: true, @@ -410,7 +476,7 @@ func isVpnGatewayRefreshFunc(vpnGateway *vpcv1.VpcV1, id string) resource.StateR } vpnGateway := vpnGatewayIntf.(*vpcv1.VPNGateway) - if *vpnGateway.Status == "available" || *vpnGateway.Status == "failed" || *vpnGateway.Status == "running" { + if *vpnGateway.LifecycleState == "stable" || *vpnGateway.LifecycleState == "failed" || *vpnGateway.LifecycleState == "suspended" { return vpnGateway, isVPNGatewayProvisioningDone, nil } @@ -448,7 +514,18 @@ func vpngwGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isVPNGatewayName, *vpnGateway.Name) d.Set(isVPNGatewaySubnet, *vpnGateway.Subnet.ID) - d.Set(isVPNGatewayStatus, *vpnGateway.Status) + if err = d.Set(isVPNGatewayHealthState, vpnGateway.HealthState); err != nil { + return fmt.Errorf("[ERROR] Error setting health_state: %s", err) + } + if err := d.Set(isVPNGatewayHealthReasons, resourceVPNGatewayRouteFlattenHealthReasons(vpnGateway.HealthReasons)); err != nil { + return fmt.Errorf("[ERROR] Error setting health_reasons: %s", err) + } + if err = d.Set(isVPNGatewayLifecycleState, vpnGateway.LifecycleState); err != nil { + return fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err) + } + if err := d.Set(isVPNGatewayLifecycleReasons, resourceVPNGatewayFlattenLifecycleReasons(vpnGateway.LifecycleReasons)); err != nil { + return fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err) + } members := []vpcv1.VPNGatewayMember{} for _, member := range vpnGateway.Members { members = append(members, member) @@ -488,7 +565,6 @@ func vpngwGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(flex.ResourceName, *vpnGateway.Name) d.Set(flex.ResourceCRN, *vpnGateway.CRN) d.Set(isVPNGatewayCRN, *vpnGateway.CRN) - d.Set(flex.ResourceStatus, *vpnGateway.Status) if vpnGateway.ResourceGroup != nil { d.Set(flex.ResourceGroupName, *vpnGateway.ResourceGroup.Name) d.Set(isVPNGatewayResourceGroup, *vpnGateway.ResourceGroup.ID) @@ -501,7 +577,6 @@ func vpngwGet(d *schema.ResourceData, meta interface{}, id string) error { if memberIP.PublicIP != nil { currentMemberIP["address"] = *memberIP.PublicIP.Address currentMemberIP["role"] = *memberIP.Role - currentMemberIP["status"] = *memberIP.Status vpcMembersIpsList = append(vpcMembersIpsList, currentMemberIP) } if memberIP.PrivateIP != nil && memberIP.PrivateIP.Address != nil { @@ -698,3 +773,35 @@ func vpngwExists(d *schema.ResourceData, meta interface{}, id string) (bool, err } return true, nil } + +func resourceVPNGatewayRouteFlattenHealthReasons(healthReasons []vpcv1.VPNGatewayHealthReason) (healthReasonsList []map[string]interface{}) { + healthReasonsList = make([]map[string]interface{}, 0) + for _, lr := range healthReasons { + currentLR := map[string]interface{}{} + if lr.Code != nil && lr.Message != nil { + currentLR[isInstanceLifecycleReasonsCode] = *lr.Code + currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message + if lr.MoreInfo != nil { + currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo + } + healthReasonsList = append(healthReasonsList, currentLR) + } + } + return healthReasonsList +} + +func resourceVPNGatewayFlattenLifecycleReasons(lifecycleReasons []vpcv1.VPNGatewayLifecycleReason) (lifecycleReasonsList []map[string]interface{}) { + lifecycleReasonsList = make([]map[string]interface{}, 0) + for _, lr := range lifecycleReasons { + currentLR := map[string]interface{}{} + if lr.Code != nil && lr.Message != nil { + currentLR[isInstanceLifecycleReasonsCode] = *lr.Code + currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message + if lr.MoreInfo != nil { + currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo + } + lifecycleReasonsList = append(lifecycleReasonsList, currentLR) + } + } + return lifecycleReasonsList +} diff --git a/ibm/service/vpc/resource_ibm_is_vpn_gateway_connection_test.go b/ibm/service/vpc/resource_ibm_is_vpn_gateway_connection_test.go index a059e3da97..df01d576f7 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_gateway_connection_test.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_gateway_connection_test.go @@ -44,6 +44,8 @@ func TestAccIBMISVPNGatewayConnection_basic(t *testing.T) { "ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "name", name1), resource.TestCheckResourceAttrSet( "ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "gateway_connection"), + resource.TestCheckResourceAttrSet("ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "health_state"), ), }, { diff --git a/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go b/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go index 8d6ed56da4..edd346cae6 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go @@ -39,6 +39,7 @@ const ( isVPNGatewayConnectionTunnels = "tunnels" isVPNGatewayConnectionResourcetype = "resource_type" isVPNGatewayConnectionCreatedat = "created_at" + isVPNGatewayConnectionStatusreasons = "status_reasons" ) func ResourceIBMISVPNGatewayConnection() *schema.Resource { @@ -152,7 +153,30 @@ func ResourceIBMISVPNGatewayConnection() *schema.Resource { Computed: true, Description: "VPN gateway connection status", }, - + isVPNGatewayConnectionStatusreasons: { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current status (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason.", + }, + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason.", + }, + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about this status reason.", + }, + }, + }, + }, flex.RelatedCRN: { Type: schema.TypeString, Computed: true, @@ -405,6 +429,9 @@ func vpngwconGet(d *schema.ResourceData, meta interface{}, gID, gConnID string) if vpnGatewayConnection.Status != nil { d.Set(isVPNGatewayConnectionStatus, *vpnGatewayConnection.Status) } + if err := d.Set(isVPNGatewayConnectionStatusreasons, resourceVPNGatewayConnectionFlattenLifecycleReasons(vpnGatewayConnection.StatusReasons)); err != nil { + return fmt.Errorf("[ERROR] Error setting status_reasons: %s", err) + } if vpnGatewayConnection.ResourceType != nil { d.Set(isVPNGatewayConnectionResourcetype, *vpnGatewayConnection.ResourceType) } @@ -677,3 +704,19 @@ func vpngwconExists(d *schema.ResourceData, meta interface{}, gID, gConnID strin } return true, nil } + +func resourceVPNGatewayConnectionFlattenLifecycleReasons(statusReasons []vpcv1.VPNGatewayConnectionStatusReason) (statusReasonsList []map[string]interface{}) { + statusReasonsList = make([]map[string]interface{}, 0) + for _, lr := range statusReasons { + currentLR := map[string]interface{}{} + if lr.Code != nil && lr.Message != nil { + currentLR[isInstanceLifecycleReasonsCode] = *lr.Code + currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message + if lr.MoreInfo != nil { + currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo + } + statusReasonsList = append(statusReasonsList, currentLR) + } + } + return statusReasonsList +} diff --git a/ibm/service/vpc/resource_ibm_is_vpn_gateway_test.go b/ibm/service/vpc/resource_ibm_is_vpn_gateway_test.go index dbec6075d8..4b68e3e4f8 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_gateway_test.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_gateway_test.go @@ -35,6 +35,8 @@ func TestAccIBMISVPNGateway_basic(t *testing.T) { testAccCheckIBMISVPNGatewayExists("ibm_is_vpn_gateway.testacc_vpnGateway", vpnGateway), resource.TestCheckResourceAttr( "ibm_is_vpn_gateway.testacc_vpnGateway", "name", name1), + resource.TestCheckResourceAttrSet("ibm_is_vpn_gateway.testacc_vpnGateway", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_vpn_gateway.testacc_vpnGateway", "health_state"), ), }, }, diff --git a/ibm/service/vpc/resource_ibm_is_vpn_server.go b/ibm/service/vpc/resource_ibm_is_vpn_server.go index 34c13515ba..23a6e5ecdb 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_server.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_server.go @@ -142,6 +142,31 @@ func ResourceIBMIsVPNServer() *schema.Resource { Computed: true, Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "hostname": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -162,6 +187,32 @@ func ResourceIBMIsVPNServer() *schema.Resource { Computed: true, Description: "The lifecycle state of the VPN server.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "name": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -675,6 +726,11 @@ func resourceIBMIsVPNServerRead(context context.Context, d *schema.ResourceData, if err = d.Set("health_state", vpnServer.HealthState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) } + if vpnServer.HealthReasons != nil { + if err := d.Set("health_reasons", resourceVPNServerFlattenHealthReasons(vpnServer.HealthReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_reasons: %s", err)) + } + } if err = d.Set("hostname", vpnServer.Hostname); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting hostname: %s", err)) } @@ -684,6 +740,11 @@ func resourceIBMIsVPNServerRead(context context.Context, d *schema.ResourceData, if err = d.Set("lifecycle_state", vpnServer.LifecycleState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } + if vpnServer.LifecycleReasons != nil { + if err := d.Set("lifecycle_reasons", resourceVPNServerFlattenLifecycleReasons(vpnServer.LifecycleReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err)) + } + } privateIps := []map[string]interface{}{} for _, privateIpsItem := range vpnServer.PrivateIps { privateIpsItemMap := resourceIBMIsVPNServerReservedIPReferenceToMap(privateIpsItem) @@ -978,3 +1039,35 @@ func isWaitForVPNServerDeleted(context context.Context, sess *vpcv1.VpcV1, d *sc return stateConf.WaitForState() } + +func resourceVPNServerFlattenLifecycleReasons(lifecycleReasons []vpcv1.VPNServerLifecycleReason) (lifecycleReasonsList []map[string]interface{}) { + lifecycleReasonsList = make([]map[string]interface{}, 0) + for _, lr := range lifecycleReasons { + currentLR := map[string]interface{}{} + if lr.Code != nil && lr.Message != nil { + currentLR[isInstanceLifecycleReasonsCode] = *lr.Code + currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message + if lr.MoreInfo != nil { + currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo + } + lifecycleReasonsList = append(lifecycleReasonsList, currentLR) + } + } + return lifecycleReasonsList +} + +func resourceVPNServerFlattenHealthReasons(healthReasons []vpcv1.VPNServerHealthReason) (healthReasonsList []map[string]interface{}) { + healthReasonsList = make([]map[string]interface{}, 0) + for _, hr := range healthReasons { + currentHR := map[string]interface{}{} + if hr.Code != nil && hr.Message != nil { + currentHR[isVolumeHealthReasonsCode] = *hr.Code + currentHR[isVolumeHealthReasonsMessage] = *hr.Message + if hr.MoreInfo != nil { + currentHR[isVolumeHealthReasonsMoreInfo] = *hr.MoreInfo + } + healthReasonsList = append(healthReasonsList, currentHR) + } + } + return healthReasonsList +} diff --git a/ibm/service/vpc/resource_ibm_is_vpn_server_route.go b/ibm/service/vpc/resource_ibm_is_vpn_server_route.go index 50d611ef20..ed38a19bd8 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_server_route.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_server_route.go @@ -82,6 +82,36 @@ func ResourceIBMIsVPNServerRoute() *schema.Resource { Computed: true, Description: "The date and time that the VPN route was created.", }, + "health_state": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + }, + "health_reasons": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this health state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this health state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this health state.", + }, + }, + }, + }, "href": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -92,6 +122,32 @@ func ResourceIBMIsVPNServerRoute() *schema.Resource { Computed: true, Description: "The lifecycle state of the VPN route.", }, + "lifecycle_reasons": { + Type: schema.TypeList, + Computed: true, + Description: "The reasons for the current lifecycle_state (if any).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "code": { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the reason for this lifecycle state.", + }, + + "message": { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the reason for this lifecycle state.", + }, + + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about the reason for this lifecycle state.", + }, + }, + }, + }, "resource_type": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -246,12 +302,25 @@ func resourceIBMIsVPNServerRouteRead(context context.Context, d *schema.Resource if err = d.Set("created_at", flex.DateTimeToString(vpnServerRoute.CreatedAt)); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } + if err = d.Set("health_state", vpnServerRoute.HealthState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_state: %s", err)) + } + if vpnServerRoute.HealthReasons != nil { + if err := d.Set("health_reasons", resourceVPNServerRouteFlattenHealthReasons(vpnServerRoute.HealthReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting health_reasons: %s", err)) + } + } if err = d.Set("href", vpnServerRoute.Href); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("lifecycle_state", vpnServerRoute.LifecycleState); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } + if vpnServerRoute.LifecycleReasons != nil { + if err := d.Set("lifecycle_reasons", resourceVPNServerRouteFlattenLifecycleReasons(vpnServerRoute.LifecycleReasons)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_reasons: %s", err)) + } + } if err = d.Set("resource_type", vpnServerRoute.ResourceType); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } @@ -365,3 +434,34 @@ func isWaitForVPNServerRouteDeleted(context context.Context, sess *vpcv1.VpcV1, return stateConf.WaitForState() } + +func resourceVPNServerRouteFlattenLifecycleReasons(lifecycleReasons []vpcv1.VPNServerRouteLifecycleReason) (lifecycleReasonsList []map[string]interface{}) { + lifecycleReasonsList = make([]map[string]interface{}, 0) + for _, lr := range lifecycleReasons { + currentLR := map[string]interface{}{} + if lr.Code != nil && lr.Message != nil { + currentLR[isInstanceLifecycleReasonsCode] = *lr.Code + currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message + if lr.MoreInfo != nil { + currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo + } + lifecycleReasonsList = append(lifecycleReasonsList, currentLR) + } + } + return lifecycleReasonsList +} +func resourceVPNServerRouteFlattenHealthReasons(healthReasons []vpcv1.VPNServerRouteHealthReason) (healthReasonsList []map[string]interface{}) { + healthReasonsList = make([]map[string]interface{}, 0) + for _, hr := range healthReasons { + currentHR := map[string]interface{}{} + if hr.Code != nil && hr.Message != nil { + currentHR[isVolumeHealthReasonsCode] = *hr.Code + currentHR[isVolumeHealthReasonsMessage] = *hr.Message + if hr.MoreInfo != nil { + currentHR[isVolumeHealthReasonsMoreInfo] = *hr.MoreInfo + } + healthReasonsList = append(healthReasonsList, currentHR) + } + } + return healthReasonsList +} diff --git a/ibm/service/vpc/resource_ibm_is_vpn_server_route_test.go b/ibm/service/vpc/resource_ibm_is_vpn_server_route_test.go index f8cc2a01b3..8c7c207493 100644 --- a/ibm/service/vpc/resource_ibm_is_vpn_server_route_test.go +++ b/ibm/service/vpc/resource_ibm_is_vpn_server_route_test.go @@ -54,6 +54,7 @@ func TestAccIBMIsVPNServerRouteBasic(t *testing.T) { resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "created_at"), resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "href"), resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "lifecycle_state"), + resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "health_state"), resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "resource_type"), resource.TestCheckResourceAttrSet("ibm_is_vpn_server_route.is_vpn_server_route", "vpn_route"), ), diff --git a/metadata/provider_metadata.json b/metadata/provider_metadata.json index 154c4cfa43..595fc1b0cd 100644 --- a/metadata/provider_metadata.json +++ b/metadata/provider_metadata.json @@ -142,12 +142,6 @@ } ], "ibm_app": [ - { - "name": "instances", - "type": "TypeInt", - "description": "The number of instances", - "computed": true - }, { "name": "buildpack", "type": "TypeString", @@ -155,49 +149,49 @@ "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The name for the app", - "required": true + "name": "environment_json", + "type": "TypeMap", + "description": "Key/value pairs of all the environment variables to run in your app. Does not include any system or service variables.", + "computed": true }, { - "name": "service_instance_guid", + "name": "route_guid", "type": "TypeSet", - "description": "Define the service instance guids that should be bound to this application.", + "description": "Define the route guids which should be bound to the application.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "package_state", + "name": "state", "type": "TypeString", - "description": "The state of the application package whether staged, pending etc", + "description": "The state of the application", "computed": true }, { - "name": "health_check_http_endpoint", - "type": "TypeString", - "description": "Endpoint called to determine if the app is healthy.", + "name": "instances", + "type": "TypeInt", + "description": "The number of instances", "computed": true }, { - "name": "environment_json", - "type": "TypeMap", - "description": "Key/value pairs of all the environment variables to run in your app. Does not include any system or service variables.", + "name": "health_check_http_endpoint", + "type": "TypeString", + "description": "Endpoint called to determine if the app is healthy.", "computed": true }, { - "name": "memory", - "type": "TypeInt", - "description": "The amount of memory each instance should have. In megabytes.", + "name": "health_check_type", + "type": "TypeString", + "description": "Type of health check to perform.", "computed": true }, { - "name": "state", + "name": "name", "type": "TypeString", - "description": "The state of the application", - "computed": true + "description": "The name for the app", + "required": true }, { "name": "space_guid", @@ -206,18 +200,30 @@ "required": true }, { - "name": "route_guid", + "name": "memory", + "type": "TypeInt", + "description": "The amount of memory each instance should have. In megabytes.", + "computed": true + }, + { + "name": "disk_quota", + "type": "TypeInt", + "description": "The maximum amount of disk available to an instance of an app. In megabytes.", + "computed": true + }, + { + "name": "service_instance_guid", "type": "TypeSet", - "description": "Define the route guids which should be bound to the application.", + "description": "Define the service instance guids that should be bound to this application.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "health_check_type", + "name": "package_state", "type": "TypeString", - "description": "Type of health check to perform.", + "description": "The state of the application package whether staged, pending etc", "computed": true }, { @@ -225,21 +231,59 @@ "type": "TypeInt", "description": "Timeout in seconds for health checking of an staged app when starting up.", "computed": true - }, - { - "name": "disk_quota", - "type": "TypeInt", - "description": "The maximum amount of disk available to an instance of an app. In megabytes.", - "computed": true } ], "ibm_app_config_collection": [ { - "name": "href", + "name": "collection_id", "type": "TypeString", - "description": "Collection URL.", + "description": "Collection Id of the collection.", + "required": true + }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "required": true + }, + { + "name": "created_time", + "type": "TypeString", + "description": "Creation time of the collection.", + "computed": true + }, + { + "name": "updated_time", + "type": "TypeString", + "description": "Last modified time of the collection data.", + "computed": true + }, + { + "name": "properties_count", + "type": "TypeInt", + "description": "Number of properties associated with the collection.", "computed": true }, + { + "name": "properties", + "type": "TypeList", + "description": "List of properties associated with the collection.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the Property.", + "computed": true + }, + "property_id": { + "name": "property_id", + "type": "TypeString", + "description": "property id.", + "computed": true + } + } + }, { "name": "features", "type": "TypeList", @@ -260,12 +304,6 @@ } } }, - { - "name": "name", - "type": "TypeString", - "description": "Collection name.", - "computed": true - }, { "name": "include", "type": "TypeList", @@ -289,43 +327,11 @@ "computed": true }, { - "name": "created_time", - "type": "TypeString", - "description": "Creation time of the collection.", - "computed": true - }, - { - "name": "updated_time", + "name": "href", "type": "TypeString", - "description": "Last modified time of the collection data.", + "description": "Collection URL.", "computed": true }, - { - "name": "properties", - "type": "TypeList", - "description": "List of properties associated with the collection.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the Property.", - "computed": true - }, - "property_id": { - "name": "property_id", - "type": "TypeString", - "description": "property id.", - "computed": true - } - } - }, - { - "name": "guid", - "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "required": true - }, { "name": "features_count", "type": "TypeInt", @@ -333,15 +339,9 @@ "computed": true }, { - "name": "collection_id", + "name": "name", "type": "TypeString", - "description": "Collection Id of the collection.", - "required": true - }, - { - "name": "properties_count", - "type": "TypeInt", - "description": "Number of properties associated with the collection.", + "description": "Collection name.", "computed": true }, { @@ -352,33 +352,6 @@ } ], "ibm_app_config_collections": [ - { - "name": "limit", - "type": "TypeInt", - "description": "The number of records to retrieve.", - "optional": true - }, - { - "name": "offset", - "type": "TypeInt", - "description": "Skipped number of records.", - "optional": true - }, - { - "name": "total_count", - "type": "TypeInt", - "description": "Total number of records.", - "computed": true - }, - { - "name": "include", - "type": "TypeList", - "description": "Include feature, property details in the response.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "expand", "type": "TypeBool", @@ -492,52 +465,42 @@ "type": "TypeString", "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", "required": true - } - ], - "ibm_app_config_environment": [ - { - "name": "color_code", - "type": "TypeString", - "description": "Color code to distinguish the environment. The Hex code for the color. For example `#FF0000` for `red`.", - "computed": true }, { - "name": "updated_time", - "type": "TypeString", - "description": "Last modified time of the environment data.", - "computed": true + "name": "limit", + "type": "TypeInt", + "description": "The number of records to retrieve.", + "optional": true }, { - "name": "guid", - "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "immutable": true, - "required": true + "name": "offset", + "type": "TypeInt", + "description": "Skipped number of records.", + "optional": true }, { - "name": "environment_id", - "type": "TypeString", - "description": "Environment Id.", - "required": true + "name": "total_count", + "type": "TypeInt", + "description": "Total number of records.", + "computed": true }, { - "name": "expand", - "type": "TypeBool", - "description": "If set to `true`, returns expanded view of the resource details.", - "optional": true - }, + "name": "include", + "type": "TypeList", + "description": "Include feature, property details in the response.", + "optional": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_app_config_environment": [ { "name": "name", "type": "TypeString", "description": "Environment name.", "computed": true }, - { - "name": "description", - "type": "TypeString", - "description": "Environment description.", - "computed": true - }, { "name": "tags", "type": "TypeString", @@ -551,14 +514,6 @@ "description": "Creation time of the environment.", "computed": true }, - { - "name": "href", - "type": "TypeString", - "description": "Environment URL.", - "computed": true - } - ], - "ibm_app_config_environments": [ { "name": "guid", "type": "TypeString", @@ -567,58 +522,55 @@ "required": true }, { - "name": "limit", - "type": "TypeInt", - "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", + "name": "expand", + "type": "TypeBool", + "description": "If set to `true`, returns expanded view of the resource details.", "optional": true }, { - "name": "total_count", - "type": "TypeInt", - "description": "Total number of records.", + "name": "color_code", + "type": "TypeString", + "description": "Color code to distinguish the environment. The Hex code for the color. For example `#FF0000` for `red`.", "computed": true }, { - "name": "first", - "type": "TypeList", - "description": "URL to navigate to the first page of records.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "URL of the response.", - "computed": true - } - } + "name": "updated_time", + "type": "TypeString", + "description": "Last modified time of the environment data.", + "computed": true }, { - "name": "previous", - "type": "TypeList", - "description": "URL to navigate to the previous list of records.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "URL of the response.", - "computed": true - } - } + "name": "href", + "type": "TypeString", + "description": "Environment URL.", + "computed": true }, { - "name": "tags", + "name": "environment_id", "type": "TypeString", - "description": "filter the resources to be returned based on the associated tags. Returns resources associated with any of the specified tags.", - "cloud_data_type": "tags", - "optional": true + "description": "Environment Id.", + "required": true }, + { + "name": "description", + "type": "TypeString", + "description": "Environment description.", + "computed": true + } + ], + "ibm_app_config_environments": [ { "name": "expand", "type": "TypeBool", "description": "If set to `true`, returns expanded view of the resource details.", "optional": true }, + { + "name": "limit", + "type": "TypeInt", + "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", + "optional": true + }, { "name": "offset", "type": "TypeInt", @@ -682,9 +634,23 @@ } }, { - "name": "next", + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "immutable": true, + "required": true + }, + { + "name": "tags", + "type": "TypeString", + "description": "filter the resources to be returned based on the associated tags. Returns resources associated with any of the specified tags.", + "cloud_data_type": "tags", + "optional": true + }, + { + "name": "first", "type": "TypeList", - "description": "URL to navigate to the next list of records.", + "description": "URL to navigate to the first page of records.", "computed": true, "elem": { "href": { @@ -696,9 +662,9 @@ } }, { - "name": "last", + "name": "previous", "type": "TypeList", - "description": "URL to navigate to the last page of records.", + "description": "URL to navigate to the previous list of records.", "computed": true, "elem": { "href": { @@ -708,43 +674,47 @@ "computed": true } } - } - ], - "ibm_app_config_feature": [ - { - "name": "feature_id", - "type": "TypeString", - "description": "Feature Id.", - "required": true }, { - "name": "includes", - "type": "TypeString", - "description": "Include the associated collections in the response.", - "optional": true + "name": "last", + "type": "TypeList", + "description": "URL to navigate to the last page of records.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "URL of the response.", + "computed": true + } + } }, { - "name": "description", - "type": "TypeString", - "description": "Feature description.", + "name": "total_count", + "type": "TypeInt", + "description": "Total number of records.", "computed": true }, { - "name": "created_time", - "type": "TypeString", - "description": "Creation time of the feature flag.", - "computed": true - }, + "name": "next", + "type": "TypeList", + "description": "URL to navigate to the next list of records.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "URL of the response.", + "computed": true + } + } + } + ], + "ibm_app_config_feature": [ { - "name": "updated_time", + "name": "disabled_value", "type": "TypeString", - "description": "Last modified time of the feature flag data.", - "computed": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "The state of the feature flag.", + "description": "Value of the feature when it is disabled. The value can be Boolean, String or a Numeric value as per the `type` attribute.", "computed": true }, { @@ -761,41 +731,21 @@ "computed": true }, { - "name": "rollout_percentage", - "type": "TypeInt", - "description": "Rollout percentage of the feature.", + "name": "description", + "type": "TypeString", + "description": "Feature description.", "computed": true }, { - "name": "collections", - "type": "TypeList", - "description": "List of collection id representing the collections that are associated with the specified feature flag.", - "computed": true, - "elem": { - "collection_id": { - "name": "collection_id", - "type": "TypeString", - "description": "Collection id.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the collection.", - "computed": true - } - } - }, - { - "name": "name", + "name": "includes", "type": "TypeString", - "description": "Feature name.", - "computed": true + "description": "Include the associated collections in the response.", + "optional": true }, { - "name": "type", + "name": "enabled_value", "type": "TypeString", - "description": "Type of the feature (BOOLEAN, STRING, NUMERIC).", + "description": "Value of the feature when it is enabled. The value can be Boolean, String or a Numeric value as per the `type` attribute.", "computed": true }, { @@ -842,10 +792,30 @@ } }, { - "name": "guid", + "name": "collections", + "type": "TypeList", + "description": "List of collection id representing the collections that are associated with the specified feature flag.", + "computed": true, + "elem": { + "collection_id": { + "name": "collection_id", + "type": "TypeString", + "description": "Collection id.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the collection.", + "computed": true + } + } + }, + { + "name": "updated_time", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "required": true + "description": "Last modified time of the feature flag data.", + "computed": true }, { "name": "environment_id", @@ -854,49 +824,55 @@ "required": true }, { - "name": "enabled_value", + "name": "name", "type": "TypeString", - "description": "Value of the feature when it is enabled. The value can be Boolean, String or a Numeric value as per the `type` attribute.", + "description": "Feature name.", "computed": true }, { - "name": "disabled_value", + "name": "feature_id", "type": "TypeString", - "description": "Value of the feature when it is disabled. The value can be Boolean, String or a Numeric value as per the `type` attribute.", - "computed": true + "description": "Feature Id.", + "required": true }, { - "name": "href", + "name": "type", "type": "TypeString", - "description": "Feature flag URL.", + "description": "Type of the feature (BOOLEAN, STRING, NUMERIC).", "computed": true - } - ], - "ibm_app_config_features": [ + }, { - "name": "expand", + "name": "enabled", "type": "TypeBool", - "description": "If set to `true`, returns expanded view of the resource details.", - "optional": true + "description": "The state of the feature flag.", + "computed": true }, { - "name": "total_count", + "name": "rollout_percentage", "type": "TypeInt", - "description": "Number of records returned in the current response.", + "description": "Rollout percentage of the feature.", "computed": true }, { - "name": "guid", + "name": "created_time", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "required": true + "description": "Creation time of the feature flag.", + "computed": true }, { - "name": "environment_id", + "name": "href", "type": "TypeString", - "description": "Environment Id.", - "required": true + "description": "Feature flag URL.", + "computed": true }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "required": true + } + ], + "ibm_app_config_features": [ { "name": "collections", "type": "TypeList", @@ -907,22 +883,36 @@ } }, { - "name": "tags", - "type": "TypeString", - "description": "Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.", - "cloud_data_type": "tags", + "name": "segments", + "type": "TypeList", + "description": "Filter features by a list of comma separated segments.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "expand", + "type": "TypeBool", + "description": "If set to `true`, returns expanded view of the resource details.", "optional": true }, { - "name": "offset", + "name": "limit", "type": "TypeInt", - "description": "The number of records to skip. By specifying `offset`, you retrieve a subset of items that starts with the `offset` value. Use `offset` with `limit` to page through the available records.", + "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", "optional": true }, { - "name": "first", + "name": "total_count", + "type": "TypeInt", + "description": "Number of records returned in the current response.", + "computed": true + }, + { + "name": "next", "type": "TypeList", - "description": "URL to navigate to the first page of records.", + "description": "URL to navigate to the next list of records.", "computed": true, "elem": { "href": { @@ -934,9 +924,9 @@ } }, { - "name": "last", + "name": "previous", "type": "TypeList", - "description": "URL to navigate to the last page of records.", + "description": "URL to navigate to the previous list of records.", "computed": true, "elem": { "href": { @@ -948,24 +938,28 @@ } }, { - "name": "includes", - "type": "TypeList", - "description": "Include the associated collections or targeting rules details in the response.", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "environment_id", + "type": "TypeString", + "description": "Environment Id.", + "required": true }, { - "name": "limit", + "name": "tags", + "type": "TypeString", + "description": "Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.", + "cloud_data_type": "tags", + "optional": true + }, + { + "name": "offset", "type": "TypeInt", - "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", + "description": "The number of records to skip. By specifying `offset`, you retrieve a subset of items that starts with the `offset` value. Use `offset` with `limit` to page through the available records.", "optional": true }, { - "name": "previous", + "name": "first", "type": "TypeList", - "description": "URL to navigate to the previous list of records.", + "description": "URL to navigate to the first page of records.", "computed": true, "elem": { "href": { @@ -977,9 +971,9 @@ } }, { - "name": "next", + "name": "last", "type": "TypeList", - "description": "URL to navigate to the next list of records.", + "description": "URL to navigate to the last page of records.", "computed": true, "elem": { "href": { @@ -990,6 +984,12 @@ } } }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "required": true + }, { "name": "sort", "type": "TypeString", @@ -997,9 +997,9 @@ "optional": true }, { - "name": "segments", + "name": "includes", "type": "TypeList", - "description": "Filter features by a list of comma separated segments.", + "description": "Include the associated collections or targeting rules details in the response.", "optional": true, "elem": { "type": "TypeString" @@ -1156,28 +1156,6 @@ } ], "ibm_app_config_properties": [ - { - "name": "include", - "type": "TypeList", - "description": "Include the associated collections or targeting rules details in the response.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "environment_id", - "type": "TypeString", - "description": "Environment Id.", - "required": true - }, - { - "name": "tags", - "type": "TypeString", - "description": "Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.", - "cloud_data_type": "tags", - "optional": true - }, { "name": "collections", "type": "TypeList", @@ -1187,15 +1165,6 @@ "type": "TypeString" } }, - { - "name": "segments", - "type": "TypeList", - "description": "Filter features by a list of comma separated segments.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "expand", "type": "TypeBool", @@ -1203,10 +1172,13 @@ "optional": true }, { - "name": "total_count", - "type": "TypeInt", - "description": "Number of records returned in the current response.", - "computed": true + "name": "include", + "type": "TypeList", + "description": "Include the associated collections or targeting rules details in the response.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { "name": "guid", @@ -1221,9 +1193,10 @@ "optional": true }, { - "name": "limit", - "type": "TypeInt", - "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", + "name": "tags", + "type": "TypeString", + "description": "Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.", + "cloud_data_type": "tags", "optional": true }, { @@ -1356,46 +1329,42 @@ "computed": true } } - } - ], - "ibm_app_config_property": [ + }, { - "name": "segment_rules", + "name": "total_count", + "type": "TypeInt", + "description": "Number of records returned in the current response.", + "computed": true + }, + { + "name": "environment_id", + "type": "TypeString", + "description": "Environment Id.", + "required": true + }, + { + "name": "segments", "type": "TypeList", - "description": "Specify the targeting rules that is used to set different property values for different segments.", - "computed": true, + "description": "Filter features by a list of comma separated segments.", + "optional": true, "elem": { - "order": { - "name": "order", - "type": "TypeInt", - "description": "Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.", - "computed": true - }, - "rules": { - "name": "rules", - "type": "TypeList", - "description": "Rules array.", - "computed": true, - "elem": { - "segments": { - "name": "segments", - "type": "TypeList", - "description": "List of segment ids that are used for targeting using the rule.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value to be used for evaluation for this rule. The value can be Boolean, String or a Numeric value as per the `type` attribute.", - "computed": true - } + "type": "TypeString" } }, + { + "name": "limit", + "type": "TypeInt", + "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", + "optional": true + } + ], + "ibm_app_config_property": [ + { + "name": "property_id", + "type": "TypeString", + "description": "Property Id.", + "required": true + }, { "name": "segment_exists", "type": "TypeBool", @@ -1403,34 +1372,39 @@ "computed": true }, { - "name": "type", + "name": "created_time", "type": "TypeString", - "description": "Type of the Property (BOOLEAN, STRING, NUMERIC).", + "description": "Creation time of the property.", "computed": true }, { - "name": "tags", + "name": "guid", "type": "TypeString", - "description": "Tags associated with the property.", - "cloud_data_type": "tags", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Property description.", "computed": true }, { - "name": "guid", + "name": "updated_time", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "required": true + "description": "Last modified time of the property data.", + "computed": true }, { - "name": "property_id", + "name": "name", "type": "TypeString", - "description": "Property Id.", - "required": true + "description": "Property name.", + "computed": true }, { - "name": "value", + "name": "type", "type": "TypeString", - "description": "Value of the Property. The value can be Boolean, String or a Numeric value as per the `type` attribute.", + "description": "Type of the Property (BOOLEAN, STRING, NUMERIC).", "computed": true }, { @@ -1454,22 +1428,10 @@ } }, { - "name": "created_time", - "type": "TypeString", - "description": "Creation time of the property.", - "computed": true - }, - { - "name": "updated_time", - "type": "TypeString", - "description": "Last modified time of the property data.", - "computed": true - }, - { - "name": "href", + "name": "environment_id", "type": "TypeString", - "description": "Property URL.", - "computed": true + "description": "Environment Id.", + "required": true }, { "name": "include", @@ -1478,21 +1440,59 @@ "optional": true }, { - "name": "name", + "name": "value", "type": "TypeString", - "description": "Property name.", + "description": "Value of the Property. The value can be Boolean, String or a Numeric value as per the `type` attribute.", "computed": true }, { - "name": "environment_id", + "name": "tags", "type": "TypeString", - "description": "Environment Id.", - "required": true + "description": "Tags associated with the property.", + "cloud_data_type": "tags", + "computed": true }, { - "name": "description", + "name": "segment_rules", + "type": "TypeList", + "description": "Specify the targeting rules that is used to set different property values for different segments.", + "computed": true, + "elem": { + "order": { + "name": "order", + "type": "TypeInt", + "description": "Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.", + "computed": true + }, + "rules": { + "name": "rules", + "type": "TypeList", + "description": "Rules array.", + "computed": true, + "elem": { + "segments": { + "name": "segments", + "type": "TypeList", + "description": "List of segment ids that are used for targeting using the rule.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value to be used for evaluation for this rule. The value can be Boolean, String or a Numeric value as per the `type` attribute.", + "computed": true + } + } + }, + { + "name": "href", "type": "TypeString", - "description": "Property description.", + "description": "Property URL.", "computed": true } ], @@ -1510,9 +1510,10 @@ "computed": true }, { - "name": "description", + "name": "tags", "type": "TypeString", - "description": "Segment description.", + "description": "Tags associated with the segment.", + "cloud_data_type": "tags", "computed": true }, { @@ -1522,9 +1523,9 @@ "computed": true }, { - "name": "updated_time", + "name": "href", "type": "TypeString", - "description": "Last modified time of the segment data.", + "description": "Segment flag URL.", "computed": true }, { @@ -1547,6 +1548,26 @@ } } }, + { + "name": "properties", + "type": "TypeList", + "description": "List of Features associated with the segment.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the Property.", + "computed": true + }, + "property_id": { + "name": "property_id", + "type": "TypeString", + "description": "property id.", + "computed": true + } + } + }, { "name": "segment_id", "type": "TypeString", @@ -1554,10 +1575,9 @@ "required": true }, { - "name": "tags", + "name": "description", "type": "TypeString", - "description": "Tags associated with the segment.", - "cloud_data_type": "tags", + "description": "Segment description.", "computed": true }, { @@ -1570,9 +1590,9 @@ } }, { - "name": "href", + "name": "updated_time", "type": "TypeString", - "description": "Segment flag URL.", + "description": "Last modified time of the segment data.", "computed": true }, { @@ -1603,26 +1623,6 @@ } } } - }, - { - "name": "properties", - "type": "TypeList", - "description": "List of Features associated with the segment.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the Property.", - "computed": true - }, - "property_id": { - "name": "property_id", - "type": "TypeString", - "description": "property id.", - "computed": true - } - } } ], "ibm_app_config_segments": [ @@ -1639,12 +1639,36 @@ "cloud_data_type": "tags", "optional": true }, + { + "name": "sort", + "type": "TypeString", + "description": "Sort the segment details based on the specified attribute.", + "optional": true + }, + { + "name": "include", + "type": "TypeString", + "description": "Segment details to include the associated rules in the response", + "optional": true + }, + { + "name": "expand", + "type": "TypeBool", + "description": "If set to `true`, returns expanded view of the resource details.", + "optional": true + }, { "name": "limit", "type": "TypeInt", "description": "The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use `limit` with `offset` to page through the available records.", "optional": true }, + { + "name": "total_count", + "type": "TypeInt", + "description": "Total number of records.", + "optional": true + }, { "name": "offset", "type": "TypeInt", @@ -1769,45 +1793,9 @@ "computed": true } } - }, - { - "name": "sort", - "type": "TypeString", - "description": "Sort the segment details based on the specified attribute.", - "optional": true - }, - { - "name": "include", - "type": "TypeString", - "description": "Segment details to include the associated rules in the response", - "optional": true - }, - { - "name": "expand", - "type": "TypeBool", - "description": "If set to `true`, returns expanded view of the resource details.", - "optional": true - }, - { - "name": "total_count", - "type": "TypeInt", - "description": "Total number of records.", - "optional": true } ], "ibm_app_config_snapshot": [ - { - "name": "updated_time", - "type": "TypeString", - "description": "Last modified time of the git config data.", - "computed": true - }, - { - "name": "last_sync_time", - "type": "TypeString", - "description": "Latest time when the snapshot was synced to git.", - "computed": true - }, { "name": "guid", "type": "TypeString", @@ -1820,24 +1808,6 @@ "description": "Git config id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only", "required": true }, - { - "name": "git_config_name", - "type": "TypeString", - "description": "Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only", - "computed": true - }, - { - "name": "git_url", - "type": "TypeString", - "description": "Git url which will be used to connect to the github account.", - "computed": true - }, - { - "name": "git_branch", - "type": "TypeString", - "description": "Branch name to which you need to write or update the configuration.", - "computed": true - }, { "name": "git_file_path", "type": "TypeString", @@ -1845,9 +1815,9 @@ "computed": true }, { - "name": "created_time", + "name": "updated_time", "type": "TypeString", - "description": "Creation time of the git config.", + "description": "Last modified time of the git config data.", "computed": true }, { @@ -1876,6 +1846,36 @@ } } }, + { + "name": "git_config_name", + "type": "TypeString", + "description": "Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only", + "computed": true + }, + { + "name": "git_url", + "type": "TypeString", + "description": "Git url which will be used to connect to the github account.", + "computed": true + }, + { + "name": "git_branch", + "type": "TypeString", + "description": "Branch name to which you need to write or update the configuration.", + "computed": true + }, + { + "name": "created_time", + "type": "TypeString", + "description": "Creation time of the git config.", + "computed": true + }, + { + "name": "last_sync_time", + "type": "TypeString", + "description": "Latest time when the snapshot was synced to git.", + "computed": true + }, { "name": "environment", "type": "TypeList", @@ -2066,6 +2066,12 @@ } ], "ibm_app_route": [ + { + "name": "path", + "type": "TypeString", + "description": "The path of the route", + "optional": true + }, { "name": "port", "type": "TypeString", @@ -2089,21 +2095,9 @@ "type": "TypeString", "description": "The host of the route", "optional": true - }, - { - "name": "path", - "type": "TypeString", - "description": "The path of the route", - "optional": true } ], "ibm_appid_action_url": [ - { - "name": "url", - "type": "TypeString", - "description": "The action URL", - "computed": true - }, { "name": "tenant_id", "type": "TypeString", @@ -2115,16 +2109,17 @@ "type": "TypeString", "description": "The type of the action: `on_user_verified` - the URL of your custom user verified page, `on_reset_password` - the URL of your custom reset password page", "required": true + }, + { + "name": "url", + "type": "TypeString", + "description": "The action URL", + "computed": true } ], "ibm_appid_apm": [ { - "name": "prevent_password_with_username", - "type": "TypeBool", - "computed": true - }, - { - "name": "password_reuse", + "name": "lockout_policy", "type": "TypeList", "computed": true, "elem": { @@ -2133,32 +2128,54 @@ "type": "TypeBool", "computed": true }, - "max_password_reuse": { - "name": "max_password_reuse", + "lockout_time_sec": { + "name": "lockout_time_sec", + "type": "TypeInt", + "computed": true + }, + "num_of_attempts": { + "name": "num_of_attempts", "type": "TypeInt", "computed": true } } }, { - "name": "password_expiration", + "name": "min_password_change_interval", "type": "TypeList", "computed": true, "elem": { - "days_to_expire": { - "name": "days_to_expire", - "type": "TypeInt", - "computed": true - }, "enabled": { "name": "enabled", "type": "TypeBool", "computed": true + }, + "min_hours_to_change_password": { + "name": "min_hours_to_change_password", + "type": "TypeInt", + "computed": true } } }, { - "name": "lockout_policy", + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "required": true + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "`true` if APM is enabled", + "computed": true + }, + { + "name": "prevent_password_with_username", + "type": "TypeBool", + "computed": true + }, + { + "name": "password_reuse", "type": "TypeList", "computed": true, "elem": { @@ -2167,49 +2184,38 @@ "type": "TypeBool", "computed": true }, - "lockout_time_sec": { - "name": "lockout_time_sec", - "type": "TypeInt", - "computed": true - }, - "num_of_attempts": { - "name": "num_of_attempts", + "max_password_reuse": { + "name": "max_password_reuse", "type": "TypeInt", "computed": true } } }, { - "name": "min_password_change_interval", + "name": "password_expiration", "type": "TypeList", "computed": true, "elem": { + "days_to_expire": { + "name": "days_to_expire", + "type": "TypeInt", + "computed": true + }, "enabled": { "name": "enabled", "type": "TypeBool", "computed": true - }, - "min_hours_to_change_password": { - "name": "min_hours_to_change_password", - "type": "TypeInt", - "computed": true } } - }, - { - "name": "tenant_id", - "type": "TypeString", - "description": "The AppID instance GUID", - "required": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "`true` if APM is enabled", - "computed": true } ], "ibm_appid_application": [ + { + "name": "type", + "type": "TypeString", + "description": "The type of application. Allowed types are `regularwebapp` and `singlepageapp`.", + "computed": true + }, { "name": "tenant_id", "type": "TypeString", @@ -2251,15 +2257,21 @@ "type": "TypeString", "description": "This URL returns OAuth Authorization Server Metadata", "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of application. Allowed types are `regularwebapp` and `singlepageapp`.", - "computed": true } ], "ibm_appid_application_roles": [ + { + "name": "tenant_id", + "type": "TypeString", + "description": "The service `tenantId`", + "required": true + }, + { + "name": "client_id", + "type": "TypeString", + "description": "The `client_id` is a public identifier for applications", + "required": true + }, { "name": "roles", "type": "TypeSet", @@ -2279,18 +2291,6 @@ "computed": true } } - }, - { - "name": "tenant_id", - "type": "TypeString", - "description": "The service `tenantId`", - "required": true - }, - { - "name": "client_id", - "type": "TypeString", - "description": "The `client_id` is a public identifier for applications", - "required": true } ], "ibm_appid_application_scopes": [ @@ -2434,27 +2434,27 @@ ], "ibm_appid_cloud_directory_user": [ { - "name": "tenant_id", - "type": "TypeString", - "description": "The AppID instance GUID", - "required": true + "name": "active", + "type": "TypeBool", + "description": "Determines if the user account is active or not", + "computed": true }, { - "name": "subject", - "type": "TypeString", - "description": "The user's identifier ('subject' in identity token)", + "name": "locked_until", + "type": "TypeInt", + "description": "Integer (epoch time in milliseconds), determines till when the user account will be locked", "computed": true }, { - "name": "display_name", + "name": "user_name", "type": "TypeString", - "description": "Cloud Directory user display name", + "description": "Optional username", "computed": true }, { - "name": "user_name", + "name": "status", "type": "TypeString", - "description": "Optional username", + "description": "Current user status: `PENDING` or `CONFIRMED`", "computed": true }, { @@ -2478,16 +2478,10 @@ } }, { - "name": "active", - "type": "TypeBool", - "description": "Determines if the user account is active or not", - "computed": true - }, - { - "name": "locked_until", - "type": "TypeInt", - "description": "Integer (epoch time in milliseconds), determines till when the user account will be locked", - "computed": true + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "required": true }, { "name": "user_id", @@ -2496,9 +2490,15 @@ "required": true }, { - "name": "status", + "name": "subject", "type": "TypeString", - "description": "Current user status: `PENDING` or `CONFIRMED`", + "description": "The user's identifier ('subject' in identity token)", + "computed": true + }, + { + "name": "display_name", + "type": "TypeString", + "description": "Cloud Directory user display name", "computed": true }, { @@ -2524,23 +2524,17 @@ ], "ibm_appid_idp_cloud_directory": [ { - "name": "is_active", - "type": "TypeBool", - "computed": true - }, - { - "name": "self_service_enabled", + "name": "reset_password_enabled", "type": "TypeBool", - "description": "Allow users to manage their account from your app", "computed": true }, { - "name": "reset_password_enabled", - "type": "TypeBool", + "name": "identity_confirm_access_mode", + "type": "TypeString", "computed": true }, { - "name": "identity_confirm_access_mode", + "name": "identity_field", "type": "TypeString", "computed": true }, @@ -2551,13 +2545,14 @@ "required": true }, { - "name": "welcome_enabled", + "name": "is_active", "type": "TypeBool", "computed": true }, { - "name": "reset_password_notification_enabled", + "name": "signup_enabled", "type": "TypeBool", + "description": "Allow users to sign-up to your app", "computed": true }, { @@ -2569,14 +2564,19 @@ } }, { - "name": "identity_field", - "type": "TypeString", + "name": "self_service_enabled", + "type": "TypeBool", + "description": "Allow users to manage their account from your app", "computed": true }, { - "name": "signup_enabled", + "name": "welcome_enabled", + "type": "TypeBool", + "computed": true + }, + { + "name": "reset_password_notification_enabled", "type": "TypeBool", - "description": "Allow users to sign-up to your app", "computed": true } ], @@ -2641,12 +2641,6 @@ } ], "ibm_appid_idp_google": [ - { - "name": "redirect_url", - "type": "TypeString", - "description": "Paste the URI into the Authorized redirect URIs field in the Google Developer Console", - "computed": true - }, { "name": "tenant_id", "type": "TypeString", @@ -2678,6 +2672,12 @@ "computed": true } } + }, + { + "name": "redirect_url", + "type": "TypeString", + "description": "Paste the URI into the Authorized redirect URIs field in the Google Developer Console", + "computed": true } ], "ibm_appid_idp_saml": [ @@ -2858,6 +2858,12 @@ } ], "ibm_appid_password_regex": [ + { + "name": "regex", + "type": "TypeString", + "description": "The escaped regex expression rule for acceptable password", + "computed": true + }, { "name": "tenant_id", "type": "TypeString", @@ -2875,12 +2881,6 @@ "type": "TypeString", "description": "Custom error message", "computed": true - }, - { - "name": "regex", - "type": "TypeString", - "description": "The escaped regex expression rule for acceptable password", - "computed": true } ], "ibm_appid_redirect_urls": [ @@ -2901,6 +2901,12 @@ } ], "ibm_appid_role": [ + { + "name": "role_id", + "type": "TypeString", + "description": "Role ID", + "required": true + }, { "name": "tenant_id", "type": "TypeString", @@ -2939,12 +2945,6 @@ } } } - }, - { - "name": "role_id", - "type": "TypeString", - "description": "Role ID", - "required": true } ], "ibm_appid_roles": [ @@ -3032,12 +3032,6 @@ } ], "ibm_appid_token_config": [ - { - "name": "access_token_expires_in", - "type": "TypeInt", - "description": "The length of time for which access tokens are valid in seconds", - "computed": true - }, { "name": "refresh_token_expires_in", "type": "TypeInt", @@ -3114,6 +3108,12 @@ "type": "TypeString", "description": "The service `tenantId`", "required": true + }, + { + "name": "access_token_expires_in", + "type": "TypeInt", + "description": "The length of time for which access tokens are valid in seconds", + "computed": true } ], "ibm_appid_user_roles": [ @@ -3256,12 +3256,6 @@ } ], "ibm_atracker_targets": [ - { - "name": "name", - "type": "TypeString", - "description": "The name of the target resource.", - "optional": true - }, { "name": "targets", "type": "TypeList", @@ -3494,56 +3488,205 @@ } } } - } - ], - "ibm_cbr_rule": [ - { - "name": "rule_id", - "type": "TypeString", - "description": "The ID of a rule.", - "required": true }, { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "The rule CRN.", - "cloud_data_type": "crn", - "computed": true + "description": "The name of the target resource.", + "optional": true + } + ], + "ibm_billing_snapshot_list": [ + { + "name": "date_to", + "type": "TypeInt", + "description": "Timestamp in milliseconds for which billing report snapshot is requested.", + "optional": true }, { - "name": "description", - "type": "TypeString", - "description": "The description of the rule.", + "name": "snapshotcount", + "type": "TypeInt", + "description": "Number of total snapshots.", "computed": true }, { - "name": "contexts", + "name": "snapshots", "type": "TypeList", - "description": "The contexts this rule applies to.", "computed": true, "elem": { - "attributes": { - "name": "attributes", + "account_id": { + "name": "account_id", + "type": "TypeString", + "description": "Account ID for which billing report snapshot is configured.", + "computed": true + }, + "account_type": { + "name": "account_type", + "type": "TypeString", + "description": "Type of account. Possible values are [enterprise, account].", + "computed": true + }, + "billing_period": { + "name": "billing_period", "type": "TypeList", - "description": "The attributes.", + "description": "Period of billing in snapshot.", "computed": true, "elem": { - "name": { - "name": "name", + "end": { + "name": "end", "type": "TypeString", - "description": "The attribute name.", + "description": "Date and time of end of billing in the respective snapshot.", "computed": true }, - "value": { - "name": "value", + "start": { + "name": "start", "type": "TypeString", - "description": "The attribute value.", + "description": "Date and time of start of billing in the respective snapshot.", "computed": true } } + }, + "bucket": { + "name": "bucket", + "type": "TypeString", + "description": "The name of the COS bucket to store the snapshot of the billing reports.", + "computed": true + }, + "charset": { + "name": "charset", + "type": "TypeString", + "description": "Character encoding used.", + "computed": true + }, + "compression": { + "name": "compression", + "type": "TypeString", + "description": "Compression format of the snapshot report.", + "computed": true + }, + "content_type": { + "name": "content_type", + "type": "TypeString", + "description": "Type of content stored in snapshot report.", + "computed": true + }, + "created_on": { + "name": "created_on", + "type": "TypeString", + "description": "Date and time of creation of snapshot.", + "computed": true + }, + "expected_processed_at": { + "name": "expected_processed_at", + "type": "TypeInt", + "description": "Timestamp of snapshot processed.", + "computed": true + }, + "files": { + "name": "files", + "type": "TypeList", + "description": "List of location of reports.", + "computed": true, + "elem": { + "account_id": { + "name": "account_id", + "type": "TypeString", + "description": "Account ID for which billing report is captured.", + "computed": true + }, + "location": { + "name": "location", + "type": "TypeString", + "description": "Absolute path of the billing report in the COS instance.", + "computed": true + }, + "report_types": { + "name": "report_types", + "type": "TypeString", + "description": "The type of billing report stored. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + "computed": true + } + } + }, + "month": { + "name": "month", + "type": "TypeString", + "description": "Month of captured snapshot.", + "computed": true + }, + "processed_at": { + "name": "processed_at", + "type": "TypeInt", + "description": "Timestamp at which snapshot is captured.", + "computed": true + }, + "report_types": { + "name": "report_types", + "type": "TypeList", + "description": "List of report types configured for the snapshot.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of billing report of the snapshot. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Version of the snapshot.", + "computed": true + } + } + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "TypeString", + "description": "Id of the snapshot captured.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Version of the snapshot.", + "computed": true } } }, + { + "name": "month", + "type": "TypeString", + "description": "The month for which billing report snapshot is requested. Format is yyyy-mm.", + "required": true + }, + { + "name": "date_from", + "type": "TypeInt", + "description": "Timestamp in milliseconds for which billing report snapshot is requested.", + "optional": true + } + ], + "ibm_cbr_rule": [ + { + "name": "crn", + "type": "TypeString", + "description": "The rule CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of the rule.", + "computed": true + }, { "name": "resources", "type": "TypeList", @@ -3604,6 +3747,58 @@ } } }, + { + "name": "href", + "type": "TypeString", + "description": "The href link to the resource.", + "computed": true + }, + { + "name": "last_modified_at", + "type": "TypeString", + "description": "The last time the resource was modified.", + "computed": true + }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "IAM ID of the user or service which modified the resource.", + "computed": true + }, + { + "name": "rule_id", + "type": "TypeString", + "description": "The ID of a rule.", + "required": true + }, + { + "name": "contexts", + "type": "TypeList", + "description": "The contexts this rule applies to.", + "computed": true, + "elem": { + "attributes": { + "name": "attributes", + "type": "TypeList", + "description": "The attributes.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "The attribute name.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The attribute value.", + "computed": true + } + } + } + } + }, { "name": "operations", "type": "TypeList", @@ -3626,9 +3821,9 @@ } }, { - "name": "href", + "name": "enforcement_mode", "type": "TypeString", - "description": "The href link to the resource.", + "description": "The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced.", "computed": true }, { @@ -3642,37 +3837,19 @@ "type": "TypeString", "description": "IAM ID of the user or service which created the resource.", "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAM ID of the user or service which modified the resource.", - "computed": true - }, - { - "name": "enforcement_mode", - "type": "TypeString", - "description": "The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "The last time the resource was modified.", - "computed": true } ], "ibm_cbr_zone": [ { - "name": "zone_id", + "name": "last_modified_at", "type": "TypeString", - "description": "The ID of a zone.", - "required": true + "description": "The last time the resource was modified.", + "computed": true }, { - "name": "excluded_count", - "type": "TypeInt", - "description": "The number of excluded addresses in the zone.", + "name": "account_id", + "type": "TypeString", + "description": "The id of the account owning this zone.", "computed": true }, { @@ -3734,15 +3911,9 @@ } }, { - "name": "href", + "name": "created_at", "type": "TypeString", - "description": "The href link to the resource.", - "computed": true - }, - { - "name": "address_count", - "type": "TypeInt", - "description": "The number of addresses in the zone.", + "description": "The time the resource was created.", "computed": true }, { @@ -3772,15 +3943,9 @@ } }, { - "name": "created_at", - "type": "TypeString", - "description": "The time the resource was created.", - "computed": true - }, - { - "name": "created_by_id", + "name": "last_modified_by_id", "type": "TypeString", - "description": "IAM ID of the user or service which created the resource.", + "description": "IAM ID of the user or service which modified the resource.", "computed": true }, { @@ -3791,36 +3956,77 @@ "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the zone.", + "name": "address_count", + "type": "TypeInt", + "description": "The number of addresses in the zone.", "computed": true }, { - "name": "account_id", + "name": "excluded_count", + "type": "TypeInt", + "description": "The number of excluded addresses in the zone.", + "computed": true + }, + { + "name": "created_by_id", "type": "TypeString", - "description": "The id of the account owning this zone.", + "description": "IAM ID of the user or service which created the resource.", "computed": true }, { - "name": "last_modified_at", + "name": "zone_id", "type": "TypeString", - "description": "The last time the resource was modified.", + "description": "The ID of a zone.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the zone.", "computed": true }, { - "name": "last_modified_by_id", + "name": "href", "type": "TypeString", - "description": "IAM ID of the user or service which modified the resource.", + "description": "The href link to the resource.", "computed": true } ], "ibm_cd_tekton_pipeline": [ { - "name": "status", - "type": "TypeString", - "description": "Pipeline status.", - "computed": true + "name": "resource_group", + "type": "TypeList", + "description": "The resource group in which the pipeline was created.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "ID.", + "computed": true + } + } + }, + { + "name": "toolchain", + "type": "TypeList", + "description": "Toolchain object containing references to the parent toolchain.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for the toolchain that contains the Tekton pipeline.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "UUID.", + "computed": true + } + } }, { "name": "definitions", @@ -3903,48 +4109,81 @@ } }, { - "name": "worker", + "name": "properties", "type": "TypeList", - "description": "Details of the worker used to run the pipeline.", + "description": "Tekton pipeline's environment properties.", "computed": true, "elem": { - "id": { - "name": "id", + "enum": { + "name": "enum", + "type": "TypeList", + "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "href": { + "name": "href", "type": "TypeString", - "description": "ID of the worker.", + "description": "API URL for interacting with the property.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Name of the worker. Computed based on the worker ID.", + "description": "Property name.", + "computed": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", "computed": true }, "type": { "name": "type", "type": "TypeString", - "description": "Type of the worker. Computed based on the worker ID.", + "description": "Property type.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Property value. Any string value is valid.", "computed": true } } }, { - "name": "enable_notifications", - "type": "TypeBool", - "description": "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", + "name": "build_number", + "type": "TypeInt", + "description": "The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs.", "computed": true }, { - "name": "enable_partial_cloning", + "name": "next_build_number", + "type": "TypeInt", + "description": "The build number that will be used for the next pipeline run.", + "computed": true + }, + { + "name": "enabled", "type": "TypeBool", - "description": "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", + "description": "Flag whether this pipeline is enabled.", "computed": true }, { - "name": "pipeline_id", + "name": "status", "type": "TypeString", - "description": "ID of current instance.", - "required": true + "description": "Pipeline status.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Standard RFC 3339 Date Time String.", + "computed": true }, { "name": "triggers", @@ -4216,68 +4455,47 @@ } }, { - "name": "runs_url", - "type": "TypeString", - "description": "URL for this pipeline showing the list of pipeline runs.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the pipeline.", - "computed": true - }, - { - "name": "next_build_number", - "type": "TypeInt", - "description": "The build number that will be used for the next pipeline run.", - "computed": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "Flag whether this pipeline is enabled.", - "computed": true - }, - { - "name": "resource_group", + "name": "worker", "type": "TypeList", - "description": "The resource group in which the pipeline was created.", - "cloud_data_type": "resource_group", + "description": "Details of the worker used to run the pipeline.", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "ID.", + "description": "ID of the worker.", "computed": true - } - } - }, - { - "name": "toolchain", - "type": "TypeList", - "description": "Toolchain object containing references to the parent toolchain.", - "computed": true, - "elem": { - "crn": { - "name": "crn", + }, + "name": { + "name": "name", "type": "TypeString", - "description": "The CRN for the toolchain that contains the Tekton pipeline.", + "description": "Name of the worker. Computed based on the worker ID.", "computed": true }, - "id": { - "name": "id", + "type": { + "name": "type", "type": "TypeString", - "description": "UUID.", + "description": "Type of the worker. Computed based on the worker ID.", "computed": true } } }, { - "name": "updated_at", + "name": "runs_url", "type": "TypeString", - "description": "Standard RFC 3339 Date Time String.", + "description": "URL for this pipeline showing the list of pipeline runs.", + "computed": true + }, + { + "name": "pipeline_id", + "type": "TypeString", + "description": "ID of current instance.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "String.", "computed": true }, { @@ -4287,72 +4505,25 @@ "computed": true }, { - "name": "build_number", - "type": "TypeInt", - "description": "The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs.", + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the pipeline.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "String.", + "name": "enable_notifications", + "type": "TypeBool", + "description": "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", "computed": true }, { - "name": "properties", - "type": "TypeList", - "description": "Tekton pipeline's environment properties.", - "computed": true, - "elem": { - "enum": { - "name": "enum", - "type": "TypeList", - "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the property.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Property name.", - "computed": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Property type.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Property value. Any string value is valid.", - "computed": true - } - } + "name": "enable_partial_cloning", + "type": "TypeBool", + "description": "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", + "computed": true } ], "ibm_cd_tekton_pipeline_definition": [ - { - "name": "pipeline_id", - "type": "TypeString", - "description": "The Tekton pipeline ID.", - "required": true - }, { "name": "definition_id", "type": "TypeString", @@ -4424,42 +4595,15 @@ "type": "TypeString", "description": "API URL for interacting with the definition.", "computed": true - } - ], - "ibm_cd_tekton_pipeline_property": [ - { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the property.", - "computed": true - }, - { - "name": "enum", - "type": "TypeList", - "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "type", - "type": "TypeString", - "description": "Property type.", - "computed": true - }, - { - "name": "path", - "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "computed": true }, { "name": "pipeline_id", "type": "TypeString", "description": "The Tekton pipeline ID.", "required": true - }, + } + ], + "ibm_cd_tekton_pipeline_property": [ { "name": "property_name", "type": "TypeString", @@ -4477,173 +4621,42 @@ "type": "TypeString", "description": "Property value. Any string value is valid.", "computed": true - } - ], - "ibm_cd_tekton_pipeline_trigger": [ - { - "name": "pipeline_id", - "type": "TypeString", - "description": "The Tekton pipeline ID.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Trigger name.", - "computed": true - }, - { - "name": "cron", - "type": "TypeString", - "description": "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", - "computed": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "Flag whether the trigger is enabled.", - "computed": true - }, - { - "name": "favorite", - "type": "TypeBool", - "description": "Mark the trigger as a favorite.", - "computed": true - }, - { - "name": "timezone", - "type": "TypeString", - "description": "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", - "computed": true }, { - "name": "trigger_id", + "name": "href", "type": "TypeString", - "description": "The trigger ID.", - "required": true - }, - { - "name": "properties", - "type": "TypeList", - "description": "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", - "computed": true, - "elem": { - "enum": { - "name": "enum", - "type": "TypeList", - "description": "Options for `single_select` property type. Only needed for `single_select` property type.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the trigger property.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Property name.", - "computed": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Property type.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Property value. Any string value is valid.", - "computed": true - } - } - }, - { - "name": "tags", - "type": "TypeList", - "description": "Optional trigger tags array.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "max_concurrent_runs", - "type": "TypeInt", - "description": "Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger.", + "description": "API URL for interacting with the property.", "computed": true }, { - "name": "events", + "name": "enum", "type": "TypeList", - "description": "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "secret", - "type": "TypeList", - "description": "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", - "computed": true, - "elem": { - "algorithm": { - "name": "algorithm", - "type": "TypeString", - "description": "Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type.", - "computed": true - }, - "key_name": { - "name": "key_name", - "type": "TypeString", - "description": "Secret name, not needed if type is `internal_validation`.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Secret location, not needed if secret type is `internal_validation`.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Secret type.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Secret value, not needed if secret type is `internal_validation`.", - "computed": true - } - } - }, { "name": "type", "type": "TypeString", - "description": "Trigger type.", + "description": "Property type.", "computed": true }, { - "name": "href", + "name": "path", "type": "TypeString", - "description": "API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers.", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", "computed": true }, + { + "name": "pipeline_id", + "type": "TypeString", + "description": "The Tekton pipeline ID.", + "required": true + } + ], + "ibm_cd_tekton_pipeline_trigger": [ { "name": "worker", "type": "TypeList", @@ -4670,12 +4683,34 @@ } } }, + { + "name": "enabled", + "type": "TypeBool", + "description": "Flag whether the trigger is enabled.", + "computed": true + }, + { + "name": "timezone", + "type": "TypeString", + "description": "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", + "computed": true + }, { "name": "event_listener", "type": "TypeString", "description": "Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline.", "computed": true }, + { + "name": "tags", + "type": "TypeList", + "description": "Optional trigger tags array.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "source", "type": "TypeList", @@ -4742,38 +4777,101 @@ } } }, + { + "name": "secret", + "type": "TypeList", + "description": "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", + "computed": true, + "elem": { + "algorithm": { + "name": "algorithm", + "type": "TypeString", + "description": "Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type.", + "computed": true + }, + "key_name": { + "name": "key_name", + "type": "TypeString", + "description": "Secret name, not needed if type is `internal_validation`.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Secret location, not needed if secret type is `internal_validation`.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Secret type.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Secret value, not needed if secret type is `internal_validation`.", + "computed": true + } + } + }, { "name": "webhook_url", "type": "TypeString", "description": "Webhook URL that can be used to trigger pipeline runs.", "computed": true - } - ], - "ibm_cd_tekton_pipeline_trigger_property": [ + }, { - "name": "pipeline_id", + "name": "type", "type": "TypeString", - "description": "The Tekton pipeline ID.", - "required": true + "description": "Trigger type.", + "computed": true }, { - "name": "name", + "name": "favorite", + "type": "TypeBool", + "description": "Mark the trigger as a favorite.", + "computed": true + }, + { + "name": "href", "type": "TypeString", - "description": "Property name.", + "description": "API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers.", "computed": true }, { - "name": "value", + "name": "max_concurrent_runs", + "type": "TypeInt", + "description": "Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger.", + "computed": true + }, + { + "name": "cron", "type": "TypeString", - "description": "Property value. Any string value is valid.", + "description": "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", "computed": true }, { - "name": "path", + "name": "pipeline_id", "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "description": "The Tekton pipeline ID.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Trigger name.", "computed": true }, + { + "name": "events", + "type": "TypeList", + "description": "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "trigger_id", "type": "TypeString", @@ -4781,11 +4879,72 @@ "required": true }, { - "name": "property_name", + "name": "properties", + "type": "TypeList", + "description": "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + "computed": true, + "elem": { + "enum": { + "name": "enum", + "type": "TypeList", + "description": "Options for `single_select` property type. Only needed for `single_select` property type.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the trigger property.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Property name.", + "computed": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Property type.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Property value. Any string value is valid.", + "computed": true + } + } + } + ], + "ibm_cd_tekton_pipeline_trigger_property": [ + { + "name": "trigger_id", "type": "TypeString", - "description": "The property name.", + "description": "The trigger ID.", "required": true }, + { + "name": "name", + "type": "TypeString", + "description": "Property name.", + "computed": true + }, + { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -4806,22 +4965,27 @@ "type": "TypeString", "description": "Property type.", "computed": true - } - ], - "ibm_cd_toolchain": [ + }, { - "name": "account_id", + "name": "pipeline_id", "type": "TypeString", - "description": "Account ID where toolchain can be found.", - "computed": true + "description": "The Tekton pipeline ID.", + "required": true }, { - "name": "resource_group_id", + "name": "property_name", "type": "TypeString", - "description": "Resource group where the toolchain is located.", - "cloud_data_type": "resource_group", - "computed": true + "description": "The property name.", + "required": true }, + { + "name": "value", + "type": "TypeString", + "description": "Property value. Any string value is valid.", + "computed": true + } + ], + "ibm_cd_toolchain": [ { "name": "updated_at", "type": "TypeString", @@ -4841,34 +5005,36 @@ "computed": true }, { - "name": "crn", + "name": "account_id", "type": "TypeString", - "description": "Toolchain CRN.", - "cloud_data_type": "crn", + "description": "Account ID where toolchain can be found.", "computed": true }, { - "name": "href", + "name": "location", "type": "TypeString", - "description": "URI that can be used to retrieve toolchain.", + "description": "Toolchain region.", + "cloud_data_type": "region", "computed": true }, { - "name": "ui_href", + "name": "resource_group_id", "type": "TypeString", - "description": "URL of a user-facing user interface for this toolchain.", + "description": "Resource group where the toolchain is located.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "created_at", + "name": "crn", "type": "TypeString", - "description": "Toolchain creation timestamp.", + "description": "Toolchain CRN.", + "cloud_data_type": "crn", "computed": true }, { - "name": "created_by", + "name": "ui_href", "type": "TypeString", - "description": "Identity that created the toolchain.", + "description": "URL of a user-facing user interface for this toolchain.", "computed": true }, { @@ -4888,58 +5054,25 @@ "computed": true }, { - "name": "location", - "type": "TypeString", - "description": "Toolchain region.", - "cloud_data_type": "region", - "computed": true - } - ], - "ibm_cd_toolchain_tool_appconfig": [ - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "toolchain_crn", + "name": "href", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "URI that can be used to retrieve toolchain.", "computed": true }, { - "name": "href", + "name": "created_at", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Toolchain creation timestamp.", "computed": true }, { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } - }, - { - "name": "updated_at", + "name": "created_by", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Identity that created the toolchain.", "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_appconfig": [ { "name": "tool_id", "type": "TypeString", @@ -4954,10 +5087,9 @@ "computed": true }, { - "name": "crn", + "name": "toolchain_crn", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -4966,6 +5098,12 @@ "description": "Name of the tool.", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "parameters", "type": "TypeList", @@ -5011,13 +5149,18 @@ } }, { - "name": "state", + "name": "toolchain_id", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "ID of the toolchain.", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true - } - ], - "ibm_cd_toolchain_tool_artifactory": [ + }, { "name": "href", "type": "TypeString", @@ -5044,18 +5187,71 @@ } } }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_artifactory": [ + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "name", "type": "TypeString", "description": "Name of the tool.", "computed": true }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "toolchain_crn", "type": "TypeString", "description": "CRN of toolchain which the tool is bound to.", "computed": true }, + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } + }, { "name": "updated_at", "type": "TypeString", @@ -5132,21 +5328,24 @@ } }, { - "name": "state", + "name": "tool_id", "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "description": "ID of the tool bound to the toolchain.", + "required": true }, { - "name": "toolchain_id", + "name": "crn", "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + } + ], + "ibm_cd_toolchain_tool_bitbucketgit": [ { - "name": "tool_id", + "name": "toolchain_id", "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", + "description": "ID of the toolchain.", "required": true }, { @@ -5162,14 +5361,26 @@ "description": "Tool CRN.", "cloud_data_type": "crn", "computed": true - } - ], - "ibm_cd_toolchain_tool_bitbucketgit": [ + }, { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } }, { "name": "name", @@ -5183,6 +5394,30 @@ "description": "Latest tool update timestamp.", "computed": true }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "ID of the tool bound to the toolchain.", + "required": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "parameters", "type": "TypeList", @@ -5274,109 +5509,13 @@ "computed": true } } - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } } ], "ibm_cd_toolchain_tool_custom": [ { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "updated_at", + "name": "href", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "URI representing the tool.", "computed": true }, { @@ -5436,9 +5575,29 @@ } }, { - "name": "href", + "name": "crn", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "ID of the tool bound to the toolchain.", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -5466,6 +5625,24 @@ "type": "TypeString", "description": "Name of the tool.", "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true } ], "ibm_cd_toolchain_tool_devopsinsights": [ @@ -5496,17 +5673,11 @@ "computed": true }, { - "name": "state", + "name": "updated_at", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Latest tool update timestamp.", "computed": true }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, { "name": "crn", "type": "TypeString", @@ -5521,42 +5692,80 @@ "computed": true }, { - "name": "updated_at", + "name": "resource_group_id", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", "computed": true }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true + }, { "name": "tool_id", "type": "TypeString", "description": "ID of the tool bound to the toolchain.", "required": true - }, + } + ], + "ibm_cd_toolchain_tool_eventnotifications": [ { - "name": "resource_group_id", + "name": "toolchain_id", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true + "description": "ID of the toolchain.", + "required": true }, { "name": "toolchain_crn", "type": "TypeString", "description": "CRN of toolchain which the tool is bound to.", "computed": true - } - ], - "ibm_cd_toolchain_tool_eventnotifications": [ + }, { - "name": "updated_at", + "name": "parameters", + "type": "TypeList", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "computed": true, + "elem": { + "instance_crn": { + "name": "instance_crn", + "type": "TypeString", + "description": "The CRN of the Event Notifications service instance.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name used to identify this tool integration.", + "computed": true + } + } + }, + { + "name": "state", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Current configuration state of the tool.", "computed": true }, { - "name": "toolchain_id", + "name": "tool_id", "type": "TypeString", - "description": "ID of the toolchain.", + "description": "ID of the tool bound to the toolchain.", "required": true }, { @@ -5573,12 +5782,6 @@ "cloud_data_type": "crn", "computed": true }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, { "name": "href", "type": "TypeString", @@ -5612,39 +5815,51 @@ "computed": true }, { - "name": "parameters", + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_githubconsolidated": [ + { + "name": "referent", "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "description": "Information on URIs to access this resource through the UI or API.", "computed": true, "elem": { - "instance_crn": { - "name": "instance_crn", + "api_href": { + "name": "api_href", "type": "TypeString", - "description": "The CRN of the Event Notifications service instance.", + "description": "URI representing this resource through an API.", "computed": true }, - "name": { - "name": "name", + "ui_href": { + "name": "ui_href", "type": "TypeString", - "description": "The name used to identify this tool integration.", + "description": "URI representing this resource through the UI.", "computed": true } } }, { - "name": "tool_id", + "name": "state", "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true + "description": "Current configuration state of the tool.", + "computed": true }, { - "name": "state", + "name": "toolchain_crn", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "CRN of toolchain which the tool is bound to.", "computed": true - } - ], - "ibm_cd_toolchain_tool_githubconsolidated": [ + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -5683,38 +5898,6 @@ "cloud_data_type": "crn", "computed": true }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -5843,12 +6026,6 @@ "computed": true } } - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true } ], "ibm_cd_toolchain_tool_gitlab": [ @@ -5860,9 +6037,21 @@ "computed": true }, { - "name": "toolchain_crn", + "name": "updated_at", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true }, { @@ -5891,37 +6080,6 @@ "description": "Name of the tool.", "computed": true }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -6045,14 +6203,6 @@ } } }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - } - ], - "ibm_cd_toolchain_tool_hashicorpvault": [ { "name": "toolchain_id", "type": "TypeString", @@ -6073,72 +6223,29 @@ "computed": true }, { - "name": "referent", + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_hashicorpvault": [ + { + "name": "parameters", "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", "computed": true, "elem": { - "api_href": { - "name": "api_href", + "authentication_method": { + "name": "authentication_method", "type": "TypeString", - "description": "URI representing this resource through an API.", + "description": "The authentication method for your HashiCorp Vault instance.", "computed": true }, - "ui_href": { - "name": "ui_href", + "dashboard_url": { + "name": "dashboard_url", "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, - { - "name": "parameters", - "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", - "computed": true, - "elem": { - "authentication_method": { - "name": "authentication_method", - "type": "TypeString", - "description": "The authentication method for your HashiCorp Vault instance.", - "computed": true - }, - "dashboard_url": { - "name": "dashboard_url", - "type": "TypeString", - "description": "The URL of the HashiCorp Vault server dashboard for this integration. In the graphical UI, this is the dashboard that the browser will navigate to when you click the HashiCorp Vault integration tile.", + "description": "The URL of the HashiCorp Vault server dashboard for this integration. In the graphical UI, this is the dashboard that the browser will navigate to when you click the HashiCorp Vault integration tile.", "computed": true }, "default_secret": { @@ -6212,14 +6319,84 @@ "type": "TypeString", "description": "Current configuration state of the tool.", "computed": true + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "ID of the tool bound to the toolchain.", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } } ], "ibm_cd_toolchain_tool_hostedgit": [ { - "name": "state", + "name": "toolchain_id", "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "description": "ID of the toolchain.", + "required": true }, { "name": "tool_id", @@ -6235,15 +6412,16 @@ "computed": true }, { - "name": "toolchain_crn", + "name": "crn", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true }, { - "name": "href", + "name": "name", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Name of the tool.", "computed": true }, { @@ -6352,16 +6530,21 @@ } }, { - "name": "toolchain_id", + "name": "state", "type": "TypeString", - "description": "ID of the toolchain.", - "required": true + "description": "Current configuration state of the tool.", + "computed": true }, { - "name": "crn", + "name": "toolchain_crn", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true }, { @@ -6384,12 +6567,6 @@ } } }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, { "name": "updated_at", "type": "TypeString", @@ -6399,16 +6576,9 @@ ], "ibm_cd_toolchain_tool_jenkins": [ { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "resource_group_id", + "name": "toolchain_crn", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -6438,23 +6608,36 @@ } }, { - "name": "name", + "name": "updated_at", "type": "TypeString", - "description": "Name of the tool.", + "description": "Latest tool update timestamp.", "computed": true }, { - "name": "updated_at", + "name": "state", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Current configuration state of the tool.", "computed": true }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true + }, { "name": "tool_id", "type": "TypeString", "description": "ID of the tool bound to the toolchain.", "required": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -6463,9 +6646,9 @@ "computed": true }, { - "name": "toolchain_crn", + "name": "name", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Name of the tool.", "computed": true }, { @@ -6507,27 +6690,9 @@ "computed": true } } - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true } ], "ibm_cd_toolchain_tool_jira": [ - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -6535,28 +6700,22 @@ "computed": true }, { - "name": "updated_at", + "name": "resource_group_id", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "state", + "name": "toolchain_crn", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true - }, - { - "name": "crn", + "name": "href", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "URI representing the tool.", "computed": true }, { @@ -6579,6 +6738,12 @@ } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "parameters", "type": "TypeList", @@ -6619,69 +6784,16 @@ } }, { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - } - ], - "ibm_cd_toolchain_tool_keyprotect": [ - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", + "name": "state", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Current configuration state of the tool.", "computed": true }, { - "name": "name", + "name": "toolchain_id", "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, - { - "name": "parameters", - "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", - "computed": true, - "elem": { - "instance_name": { - "name": "instance_name", - "type": "TypeString", - "description": "The name of the Key Protect service instance.", - "computed": true - }, - "location": { - "name": "location", - "type": "TypeString", - "description": "The IBM Cloud location where the Key Protect service instance is located.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name used to identify this tool integration. Secret references include this name to identify the secrets store where the secrets reside. All secrets store tools integrated into a toolchain should have a unique name to allow secret resolution to function properly.", - "computed": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "The name of the resource group where the Key Protect service instance is located.", - "computed": true - } - } + "description": "ID of the toolchain.", + "required": true }, { "name": "tool_id", @@ -6689,6 +6801,15 @@ "description": "ID of the tool bound to the toolchain.", "required": true }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + } + ], + "ibm_cd_toolchain_tool_keyprotect": [ { "name": "resource_group_id", "type": "TypeString", @@ -6696,6 +6817,13 @@ "cloud_data_type": "resource_group", "computed": true }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "referent", "type": "TypeList", @@ -6735,19 +6863,15 @@ "required": true }, { - "name": "crn", + "name": "tool_id", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - } - ], - "ibm_cd_toolchain_tool_nexus": [ + "description": "ID of the tool bound to the toolchain.", + "required": true + }, { - "name": "crn", + "name": "toolchain_crn", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -6762,6 +6886,60 @@ "description": "Name of the tool.", "computed": true }, + { + "name": "parameters", + "type": "TypeList", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "computed": true, + "elem": { + "instance_name": { + "name": "instance_name", + "type": "TypeString", + "description": "The name of the Key Protect service instance.", + "computed": true + }, + "location": { + "name": "location", + "type": "TypeString", + "description": "The IBM Cloud location where the Key Protect service instance is located.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name used to identify this tool integration. Secret references include this name to identify the secrets store where the secrets reside. All secrets store tools integrated into a toolchain should have a unique name to allow secret resolution to function properly.", + "computed": true + }, + "resource_group_name": { + "name": "resource_group_name", + "type": "TypeString", + "description": "The name of the resource group where the Key Protect service instance is located.", + "computed": true + } + } + } + ], + "ibm_cd_toolchain_tool_nexus": [ + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } + }, { "name": "parameters", "type": "TypeList", @@ -6819,6 +6997,31 @@ } } }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain.", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "state", "type": "TypeString", @@ -6826,9 +7029,9 @@ "computed": true }, { - "name": "toolchain_id", + "name": "tool_id", "type": "TypeString", - "description": "ID of the toolchain.", + "description": "ID of the tool bound to the toolchain.", "required": true }, { @@ -6839,45 +7042,25 @@ "computed": true }, { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true }, { "name": "updated_at", "type": "TypeString", "description": "Latest tool update timestamp.", "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_pagerduty": [ { "name": "tool_id", "type": "TypeString", "description": "ID of the tool bound to the toolchain.", "required": true }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - } - ], - "ibm_cd_toolchain_tool_pagerduty": [ { "name": "resource_group_id", "type": "TypeString", @@ -6886,38 +7069,17 @@ "computed": true }, { - "name": "crn", + "name": "href", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "URI representing the tool.", "computed": true }, { - "name": "toolchain_crn", + "name": "updated_at", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Latest tool update timestamp.", "computed": true }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } - }, { "name": "parameters", "type": "TypeList", @@ -6958,22 +7120,37 @@ "required": true }, { - "name": "tool_id", + "name": "crn", "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "updated_at", + "name": "toolchain_crn", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } }, { "name": "name", @@ -6984,23 +7161,35 @@ ], "ibm_cd_toolchain_tool_pipeline": [ { - "name": "parameters", + "name": "referent", "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "description": "Information on URIs to access this resource through the UI or API.", "computed": true, "elem": { - "name": { - "name": "name", + "api_href": { + "name": "api_href", "type": "TypeString", - "description": "The name used for this tool integration.", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", "computed": true } } }, { - "name": "state", + "name": "name", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Name of the tool.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", "computed": true }, { @@ -7030,15 +7219,29 @@ "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Name of the tool.", + "description": "URI representing the tool.", "computed": true }, { - "name": "updated_at", + "name": "parameters", + "type": "TypeList", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "The name used for this tool integration.", + "computed": true + } + } + }, + { + "name": "state", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Current configuration state of the tool.", "computed": true }, { @@ -7046,6 +7249,28 @@ "type": "TypeString", "description": "ID of the toolchain.", "required": true + } + ], + "ibm_cd_toolchain_tool_privateworker": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true }, { "name": "href", @@ -7072,9 +7297,13 @@ "computed": true } } - } - ], - "ibm_cd_toolchain_tool_privateworker": [ + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true + }, { "name": "toolchain_id", "type": "TypeString", @@ -7093,12 +7322,6 @@ "description": "CRN of toolchain which the tool is bound to.", "computed": true }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -7131,59 +7354,25 @@ "type": "TypeString", "description": "Current configuration state of the tool.", "computed": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_saucelabs": [ { "name": "href", "type": "TypeString", "description": "URI representing the tool.", "computed": true }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "computed": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "computed": true - } - } - }, { "name": "name", "type": "TypeString", "description": "Name of the tool.", "computed": true - } - ], - "ibm_cd_toolchain_tool_saucelabs": [ + }, { - "name": "updated_at", + "name": "state", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Current configuration state of the tool.", "computed": true }, { @@ -7193,10 +7382,11 @@ "required": true }, { - "name": "tool_id", + "name": "resource_group_id", "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true }, { "name": "crn", @@ -7211,12 +7401,6 @@ "description": "CRN of toolchain which the tool is bound to.", "computed": true }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "referent", "type": "TypeList", @@ -7238,16 +7422,9 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, - { - "name": "resource_group_id", + "name": "updated_at", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", + "description": "Latest tool update timestamp.", "computed": true }, { @@ -7272,31 +7449,24 @@ } }, { - "name": "state", + "name": "tool_id", "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "description": "ID of the tool bound to the toolchain.", + "required": true } ], "ibm_cd_toolchain_tool_secretsmanager": [ { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "toolchain_crn", + "name": "name", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Name of the tool.", "computed": true }, { - "name": "updated_at", + "name": "toolchain_id", "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true + "description": "ID of the toolchain.", + "required": true }, { "name": "tool_id", @@ -7304,6 +7474,13 @@ "description": "ID of the tool bound to the toolchain.", "required": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -7311,6 +7488,12 @@ "cloud_data_type": "crn", "computed": true }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -7338,9 +7521,9 @@ } }, { - "name": "name", + "name": "updated_at", "type": "TypeString", - "description": "Name of the tool.", + "description": "Latest tool update timestamp.", "computed": true }, { @@ -7392,58 +7575,9 @@ "type": "TypeString", "description": "Current configuration state of the tool.", "computed": true - }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain.", - "required": true } ], "ibm_cd_toolchain_tool_securitycompliance": [ - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, { "name": "toolchain_id", "type": "TypeString", @@ -7470,6 +7604,18 @@ } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true + }, { "name": "parameters", "type": "TypeList", @@ -7562,12 +7708,43 @@ } } }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "ID of the tool bound to the toolchain.", + "required": true + }, { "name": "resource_group_id", "type": "TypeString", "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true } ], "ibm_cd_toolchain_tool_slack": [ @@ -7578,10 +7755,10 @@ "required": true }, { - "name": "toolchain_crn", + "name": "tool_id", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true + "description": "ID of the tool bound to the toolchain.", + "required": true }, { "name": "referent", @@ -7603,6 +7780,12 @@ } } }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true + }, { "name": "parameters", "type": "TypeList", @@ -7666,12 +7849,6 @@ "description": "Current configuration state of the tool.", "computed": true }, - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, { "name": "resource_group_id", "type": "TypeString", @@ -7687,15 +7864,15 @@ "computed": true }, { - "name": "href", + "name": "toolchain_crn", "type": "TypeString", - "description": "URI representing the tool.", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Name of the tool.", + "description": "URI representing the tool.", "computed": true }, { @@ -7706,19 +7883,6 @@ } ], "ibm_cd_toolchain_tool_sonarqube": [ - { - "name": "tool_id", - "type": "TypeString", - "description": "ID of the tool bound to the toolchain.", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, { "name": "href", "type": "TypeString", @@ -7726,10 +7890,24 @@ "computed": true }, { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "computed": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "computed": true + } + } }, { "name": "parameters", @@ -7770,6 +7948,12 @@ } } }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, { "name": "toolchain_id", "type": "TypeString", @@ -7790,36 +7974,124 @@ "computed": true }, { - "name": "referent", + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "ID of the tool bound to the toolchain.", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + } + ], + "ibm_cd_toolchains": [ + { + "name": "resource_group_id", + "type": "TypeString", + "description": "The resource group ID where the toolchains exist.", + "cloud_data_type": "resource_group", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of toolchain to look up.", + "optional": true + }, + { + "name": "toolchains", "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", + "description": "Toolchain results returned from the collection.", "computed": true, "elem": { - "api_href": { - "name": "api_href", + "account_id": { + "name": "account_id", "type": "TypeString", - "description": "URI representing this resource through an API.", + "description": "Account ID where toolchain can be found.", + "computed": true + }, + "created_at": { + "name": "created_at", + "type": "TypeString", + "description": "Toolchain creation timestamp.", + "computed": true + }, + "created_by": { + "name": "created_by", + "type": "TypeString", + "description": "Identity that created the toolchain.", + "computed": true + }, + "crn": { + "name": "crn", + "type": "TypeString", + "description": "Toolchain CRN.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Describes the toolchain.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "URI that can be used to retrieve toolchain.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "Toolchain ID.", + "computed": true + }, + "location": { + "name": "location", + "type": "TypeString", + "description": "Toolchain region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Toolchain name.", + "computed": true + }, + "resource_group_id": { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the toolchain is located.", "computed": true }, "ui_href": { "name": "ui_href", "type": "TypeString", - "description": "URI representing this resource through the UI.", + "description": "URL of a user-facing user interface for this toolchain.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Latest toolchain update timestamp.", "computed": true } } - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true } ], "ibm_cis": [ @@ -7836,22 +8108,17 @@ "computed": true }, { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, - { - "name": "resource_controller_url", + "name": "resource_status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The status of the resource", "computed": true }, { - "name": "guid", + "name": "resource_group_id", "type": "TypeString", - "description": "Unique identifier of resource instance", - "computed": true + "description": "The id of the resource group in which the cis instance is present", + "cloud_data_type": "resource_group", + "optional": true }, { "name": "service", @@ -7860,21 +8127,21 @@ "computed": true }, { - "name": "status", + "name": "plan", "type": "TypeString", - "description": "The resource instance status", + "description": "The plan type of the cis instance", "computed": true }, { - "name": "plan", + "name": "status", "type": "TypeString", - "description": "The plan type of the cis instance", + "description": "The resource instance status", "computed": true }, { - "name": "resource_status", + "name": "resource_controller_url", "type": "TypeString", - "description": "The status of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { @@ -7884,11 +8151,10 @@ "required": true }, { - "name": "resource_group_id", + "name": "guid", "type": "TypeString", - "description": "The id of the resource group in which the cis instance is present", - "cloud_data_type": "resource_group", - "optional": true + "description": "Unique identifier of resource instance", + "computed": true }, { "name": "location", @@ -7896,9 +8162,25 @@ "description": "The location or the environment in which cis instance exists", "cloud_data_type": "region", "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true } ], "ibm_cis_alerts": [ + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, { "name": "alert_policies", "type": "TypeList", @@ -7972,28 +8254,9 @@ "computed": true } } - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] } ], "ibm_cis_bot_analytics": [ - { - "name": "result", - "type": "TypeString", - "description": "Bot Analytics result", - "computed": true, - "elem": { - "type": "TypeMap" - } - }, { "name": "cis_id", "type": "TypeString", @@ -8027,25 +8290,18 @@ "type": "TypeString", "description": "Datetime for end of query", "required": true - } - ], - "ibm_cis_bot_managements": [ - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] }, { - "name": "domain_id", + "name": "result", "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, + "description": "Bot Analytics result", + "computed": true, + "elem": { + "type": "TypeMap" + } + } + ], + "ibm_cis_bot_managements": [ { "name": "fight_mode", "type": "TypeString", @@ -8075,181 +8331,197 @@ "type": "TypeString", "description": "Use Latest Model", "computed": true + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "Associated CIS domain", + "required": true } ], "ibm_cis_cache_settings": [ { - "name": "development_mode", + "name": "serve_stale_content", "type": "TypeList", - "description": "Development mode setting", + "description": "Serve Stale Content", "computed": true, "elem": { "editable": { "name": "editable", "type": "TypeBool", - "description": "development mode editable", + "description": "serve stale content editable", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "development mode id", + "description": "serve stale content id", "computed": true }, "modified_on": { "name": "modified_on", "type": "TypeString", - "description": "development mode modified on", + "description": "serve stale content modified on", "computed": true }, "value": { "name": "value", "type": "TypeString", - "description": "development mode value", + "description": "serve stale content value", "computed": true } } }, { - "name": "query_string_sort", + "name": "browser_expiration", "type": "TypeList", - "description": "Query String sort setting", + "description": "Browser Expiration setting", "computed": true, "elem": { "editable": { "name": "editable", "type": "TypeBool", - "description": "query string sort editable", + "description": "browser expiration editable", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "query string sort id", + "description": "browser expiration id", "computed": true }, "modified_on": { "name": "modified_on", "type": "TypeString", - "description": "query string sort modified on", + "description": "browser expiration modified on", "computed": true }, "value": { "name": "value", - "type": "TypeString", - "description": "query qtring sort value", + "type": "TypeInt", + "description": "browser expiration value", "computed": true } } }, { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, - { - "name": "caching_level", + "name": "development_mode", "type": "TypeList", - "description": "Cache Level Setting", + "description": "Development mode setting", "computed": true, "elem": { "editable": { "name": "editable", "type": "TypeBool", - "description": "cache level editable", + "description": "development mode editable", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "cache level id", + "description": "development mode id", "computed": true }, "modified_on": { "name": "modified_on", "type": "TypeString", - "description": "cache level modified on", + "description": "development mode modified on", "computed": true }, "value": { "name": "value", "type": "TypeString", - "description": "cache level value", + "description": "development mode value", "computed": true } } }, { - "name": "serve_stale_content", + "name": "query_string_sort", "type": "TypeList", - "description": "Serve Stale Content", + "description": "Query String sort setting", "computed": true, "elem": { "editable": { "name": "editable", "type": "TypeBool", - "description": "serve stale content editable", + "description": "query string sort editable", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "serve stale content id", + "description": "query string sort id", "computed": true }, "modified_on": { "name": "modified_on", "type": "TypeString", - "description": "serve stale content modified on", + "description": "query string sort modified on", "computed": true }, "value": { "name": "value", "type": "TypeString", - "description": "serve stale content value", + "description": "query qtring sort value", "computed": true } } }, { - "name": "browser_expiration", + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "Associated CIS domain", + "required": true + }, + { + "name": "caching_level", "type": "TypeList", - "description": "Browser Expiration setting", + "description": "Cache Level Setting", "computed": true, "elem": { "editable": { "name": "editable", "type": "TypeBool", - "description": "browser expiration editable", + "description": "cache level editable", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "browser expiration id", + "description": "cache level id", "computed": true }, "modified_on": { "name": "modified_on", "type": "TypeString", - "description": "browser expiration modified on", + "description": "cache level modified on", "computed": true }, "value": { "name": "value", - "type": "TypeInt", - "description": "browser expiration value", + "type": "TypeString", + "description": "cache level value", "computed": true } } @@ -8516,6 +8788,22 @@ } ], "ibm_cis_dns_records": [ + { + "name": "cis_id", + "type": "TypeString", + "description": "DNS Zone CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "Zone Id", + "required": true + }, { "name": "file", "type": "TypeString", @@ -8607,25 +8895,28 @@ "computed": true } } + } + ], + "ibm_cis_domain": [ + { + "name": "original_name_servers", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "cis_id", + "name": "domain_id", "type": "TypeString", - "description": "DNS Zone CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "computed": true }, { - "name": "domain_id", + "name": "verification_key", "type": "TypeString", - "description": "Zone Id", - "required": true - } - ], - "ibm_cis_domain": [ + "optional": true, + "computed": true + }, { "name": "cis_id", "type": "TypeString", @@ -8643,27 +8934,13 @@ "required": true }, { - "name": "status", - "type": "TypeString", + "name": "paused", + "type": "TypeBool", "computed": true }, { - "name": "original_name_servers", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "type", + "name": "status", "type": "TypeString", - "description": "CISzone - Domain Type", - "computed": true - }, - { - "name": "paused", - "type": "TypeBool", "computed": true }, { @@ -8675,14 +8952,9 @@ } }, { - "name": "domain_id", - "type": "TypeString", - "computed": true - }, - { - "name": "verification_key", + "name": "type", "type": "TypeString", - "optional": true, + "description": "CISzone - Domain Type", "computed": true }, { @@ -8884,67 +9156,6 @@ } ], "ibm_cis_firewall": [ - { - "name": "ua_rule", - "type": "TypeList", - "description": "User Agent Rule Data", - "computed": true, - "elem": { - "configuration": { - "name": "configuration", - "type": "TypeList", - "computed": true, - "elem": { - "target": { - "name": "target", - "type": "TypeString", - "description": "Target type", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Target value", - "computed": true - } - } - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "description", - "computed": true - }, - "mode": { - "name": "mode", - "type": "TypeString", - "description": "user agent rule mode", - "computed": true - }, - "paused": { - "name": "paused", - "type": "TypeBool", - "description": "Rule whether paused or not", - "computed": true - }, - "ua_rule_id": { - "name": "ua_rule_id", - "type": "TypeString", - "description": "firewall identifier", - "computed": true - } - } - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, { "name": "domain_id", "type": "TypeString", @@ -9061,6 +9272,67 @@ "computed": true } } + }, + { + "name": "ua_rule", + "type": "TypeList", + "description": "User Agent Rule Data", + "computed": true, + "elem": { + "configuration": { + "name": "configuration", + "type": "TypeList", + "computed": true, + "elem": { + "target": { + "name": "target", + "type": "TypeString", + "description": "Target type", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Target value", + "computed": true + } + } + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "description", + "computed": true + }, + "mode": { + "name": "mode", + "type": "TypeString", + "description": "user agent rule mode", + "computed": true + }, + "paused": { + "name": "paused", + "type": "TypeBool", + "description": "Rule whether paused or not", + "computed": true + }, + "ua_rule_id": { + "name": "ua_rule_id", + "type": "TypeString", + "description": "firewall identifier", + "computed": true + } + } + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] } ], "ibm_cis_firewall_rules": [ @@ -9709,6 +9981,76 @@ } ], "ibm_cis_origin_auths": [ + { + "name": "request_type", + "type": "TypeString", + "description": "Associated CIS Request Type", + "default_value": "zone_level", + "optional": true + }, + { + "name": "origin_pull_settings_enabled", + "type": "TypeBool", + "description": "CIS origin auth settings enabled or disabled", + "computed": true + }, + { + "name": "origin_pull_certs", + "type": "TypeList", + "description": "Certficate list", + "computed": true, + "elem": { + "cert_expires_on": { + "name": "cert_expires_on", + "type": "TypeString", + "description": "CIS origin auth certificate expiry time", + "computed": true + }, + "cert_id": { + "name": "cert_id", + "type": "TypeString", + "description": "CIS origin auth certificate id", + "computed": true + }, + "cert_issuer": { + "name": "cert_issuer", + "type": "TypeString", + "description": "CIS origin auth certificate issue", + "computed": true + }, + "cert_serial_number": { + "name": "cert_serial_number", + "type": "TypeString", + "description": "CIS origin auth certificate Serial Number", + "computed": true + }, + "cert_signature": { + "name": "cert_signature", + "type": "TypeString", + "description": "CIS origin auth certificate signature", + "computed": true + }, + "cert_status": { + "name": "cert_status", + "type": "TypeString", + "description": "CIS origin auth certificate active or not", + "computed": true + }, + "cert_uploaded_on": { + "name": "cert_uploaded_on", + "type": "TypeString", + "description": "CIS origin auth certificate upldate time", + "computed": true + }, + "certificate": { + "name": "certificate", + "type": "TypeString", + "description": "CIS origin auth certificate detail", + "secure": true, + "computed": true + } + } + }, { "name": "cis_id", "type": "TypeString", @@ -9731,89 +10073,9 @@ "description": "Associated CIS host name", "default_value": "no_host", "optional": true - }, - { - "name": "request_type", - "type": "TypeString", - "description": "Associated CIS Request Type", - "default_value": "zone_level", - "optional": true - }, - { - "name": "origin_pull_settings_enabled", - "type": "TypeBool", - "description": "CIS origin auth settings enabled or disabled", - "computed": true - }, - { - "name": "origin_pull_certs", - "type": "TypeList", - "description": "Certficate list", - "computed": true, - "elem": { - "cert_expires_on": { - "name": "cert_expires_on", - "type": "TypeString", - "description": "CIS origin auth certificate expiry time", - "computed": true - }, - "cert_id": { - "name": "cert_id", - "type": "TypeString", - "description": "CIS origin auth certificate id", - "computed": true - }, - "cert_issuer": { - "name": "cert_issuer", - "type": "TypeString", - "description": "CIS origin auth certificate issue", - "computed": true - }, - "cert_serial_number": { - "name": "cert_serial_number", - "type": "TypeString", - "description": "CIS origin auth certificate Serial Number", - "computed": true - }, - "cert_signature": { - "name": "cert_signature", - "type": "TypeString", - "description": "CIS origin auth certificate signature", - "computed": true - }, - "cert_status": { - "name": "cert_status", - "type": "TypeString", - "description": "CIS origin auth certificate active or not", - "computed": true - }, - "cert_uploaded_on": { - "name": "cert_uploaded_on", - "type": "TypeString", - "description": "CIS origin auth certificate upldate time", - "computed": true - }, - "certificate": { - "name": "certificate", - "type": "TypeString", - "description": "CIS origin auth certificate detail", - "secure": true, - "computed": true - } - } } ], "ibm_cis_origin_pools": [ - { - "name": "cis_id", - "type": "TypeString", - "description": "DNS Zone CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, { "name": "cis_origin_pools", "type": "TypeList", @@ -9939,9 +10201,7 @@ "computed": true } } - } - ], - "ibm_cis_page_rules": [ + }, { "name": "cis_id", "type": "TypeString", @@ -9951,13 +10211,9 @@ "cloud_data_range": [ "service:internet-svcs" ] - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "DNS Zone ID", - "required": true - }, + } + ], + "ibm_cis_page_rules": [ { "name": "cis_page_rules", "type": "TypeList", @@ -10072,6 +10328,22 @@ } } } + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "DNS Zone CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "DNS Zone ID", + "required": true } ], "ibm_cis_range_apps": [ @@ -10449,6 +10721,22 @@ } ], "ibm_cis_waf_packages": [ + { + "name": "cis_id", + "type": "TypeString", + "description": "DNS Zone CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "CIS domain id", + "required": true + }, { "name": "waf_packages", "type": "TypeList", @@ -10486,11 +10774,13 @@ "computed": true } } - }, + } + ], + "ibm_cis_waf_rules": [ { "name": "cis_id", "type": "TypeString", - "description": "DNS Zone CRN", + "description": "CIS instance crn", "cloud_data_type": "resource_instance", "required": true, "cloud_data_range": [ @@ -10500,11 +10790,9 @@ { "name": "domain_id", "type": "TypeString", - "description": "CIS domain id", + "description": "CISzone - Domain", "required": true - } - ], - "ibm_cis_waf_rules": [ + }, { "name": "package_id", "type": "TypeString", @@ -10583,22 +10871,6 @@ "computed": true } } - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "CISzone - Domain", - "required": true } ], "ibm_cis_webhooks": [ @@ -10646,6 +10918,12 @@ } ], "ibm_cloud_shell_account_settings": [ + { + "name": "updated_at", + "type": "TypeInt", + "description": "Timestamp of last update in Unix epoch time.", + "computed": true + }, { "name": "updated_by", "type": "TypeString", @@ -10653,9 +10931,15 @@ "computed": true }, { - "name": "rev", - "type": "TypeString", - "description": "Unique revision number for the settings object.", + "name": "default_enable_new_features", + "type": "TypeBool", + "description": "You can choose which Cloud Shell features are available in the account and whether any new features are enabled as they become available. The feature settings apply only to the enabled Cloud Shell locations.", + "computed": true + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "When enabled, Cloud Shell is available to all users in the account.", "computed": true }, { @@ -10665,9 +10949,15 @@ "computed": true }, { - "name": "enabled", + "name": "created_by", + "type": "TypeString", + "description": "IAM ID of creator.", + "computed": true + }, + { + "name": "default_enable_new_regions", "type": "TypeBool", - "description": "When enabled, Cloud Shell is available to all users in the account.", + "description": "Set whether Cloud Shell is enabled in a specific location for the account. The location determines where user and session data are stored. By default, users are routed to the nearest available location.", "computed": true }, { @@ -10723,59 +11013,77 @@ "required": true }, { - "name": "created_by", + "name": "rev", "type": "TypeString", - "description": "IAM ID of creator.", + "description": "Unique revision number for the settings object.", "computed": true + } + ], + "ibm_cloudant": [ + { + "name": "tags", + "type": "TypeSet", + "description": "Tags of Resource Instance", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "default_enable_new_features", - "type": "TypeBool", - "description": "You can choose which Cloud Shell features are available in the account and whether any new features are enabled as they become available. The feature settings apply only to the enabled Cloud Shell locations.", + "name": "guid", + "type": "TypeString", + "description": "Guid of resource instance", "computed": true }, { - "name": "default_enable_new_regions", - "type": "TypeBool", - "description": "Set whether Cloud Shell is enabled in a specific location for the account. The location determines where user and session data are stored. By default, users are routed to the nearest available location.", + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "updated_at", - "type": "TypeInt", - "description": "Timestamp of last update in Unix epoch time.", + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true - } - ], - "ibm_cloudant": [ + }, { - "name": "resource_crn", + "name": "enable_cors", + "type": "TypeBool", + "description": "Boolean value to turn CORS on and off.", + "computed": true + }, + { + "name": "name", "type": "TypeString", - "description": "The crn of the resource", + "description": "Resource instance name for example, myobjectstorage", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "The id of the resource group in which the instance is present", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, { - "name": "features", - "type": "TypeList", - "description": "List of enabled optional features.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "plan", + "type": "TypeString", + "description": "The plan type of the instance", + "computed": true }, { - "name": "features_flags", - "type": "TypeList", - "description": "List of feature flags.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "version", + "type": "TypeString", + "description": "Vendor version.", + "computed": true }, { - "name": "capacity", - "type": "TypeInt", - "description": "A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.", + "name": "include_data_events", + "type": "TypeBool", + "description": "Include data event types in events sent to IBM Cloud Activity Tracker with LogDNA for the IBM Cloudant instance. By default only emitted events are of \"management\" type.", "computed": true }, { @@ -10788,23 +11096,41 @@ } }, { - "name": "enable_cors", - "type": "TypeBool", - "description": "Boolean value to turn CORS on and off.", + "name": "location", + "type": "TypeString", + "description": "The location or the environment in which instance exists", + "cloud_data_type": "region", + "optional": true, "computed": true }, { - "name": "service", + "name": "status", "type": "TypeString", - "description": "The service type of the instance", + "description": "The resource instance status", "computed": true }, { - "name": "plan", + "name": "crn", "type": "TypeString", - "description": "The plan type of the instance", + "description": "CRN of resource instance", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "extensions", + "type": "TypeMap", + "description": "The extended metadata as a map associated with the resource instance.", "computed": true }, + { + "name": "features_flags", + "type": "TypeList", + "description": "List of feature flags.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "cors_config", "type": "TypeList", @@ -10829,38 +11155,9 @@ } }, { - "name": "extensions", - "type": "TypeMap", - "description": "The extended metadata as a map associated with the resource instance.", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Vendor version.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags of Resource Instance", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "guid", + "name": "service", "type": "TypeString", - "description": "Guid of resource instance", + "description": "The service type of the instance", "computed": true }, { @@ -10870,97 +11167,34 @@ "computed": true }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Resource instance name for example, myobjectstorage", - "required": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The resource instance status", - "computed": true - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, - { - "name": "include_data_events", - "type": "TypeBool", - "description": "Include data event types in events sent to IBM Cloud Activity Tracker with LogDNA for the IBM Cloudant instance. By default only emitted events are of \"management\" type.", - "computed": true - }, - { - "name": "resource_group_id", + "name": "resource_crn", "type": "TypeString", - "description": "The id of the resource group in which the instance is present", - "cloud_data_type": "resource_group", - "optional": true, + "description": "The crn of the resource", "computed": true }, { - "name": "location", + "name": "resource_status", "type": "TypeString", - "description": "The location or the environment in which instance exists", - "cloud_data_type": "region", - "optional": true, - "computed": true - } - ], - "ibm_cloudant_database": [ - { - "name": "doc_count", - "type": "TypeInt", - "description": "A count of the documents in the specified database.", + "description": "The status of the resource", "computed": true }, { - "name": "props", + "name": "features", "type": "TypeList", - "description": "The database properties.", + "description": "List of enabled optional features.", "computed": true, "elem": { - "partitioned": { - "name": "partitioned", - "type": "TypeBool", - "description": "The value is `true` for a partitioned database.", - "computed": true - } + "type": "TypeString" } }, { - "name": "uuid", - "type": "TypeString", - "description": "The UUID of the database.", + "name": "capacity", + "type": "TypeInt", + "description": "A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.", "computed": true - }, - { - "name": "db", - "type": "TypeString", - "description": "Path parameter to specify the database name.", - "required": true - }, - { - "name": "instance_crn", - "type": "TypeString", - "description": "Cloudant Instance CRN.", - "required": true - }, + } + ], + "ibm_cloudant_database": [ { "name": "cluster", "type": "TypeList", @@ -10994,29 +11228,79 @@ } }, { - "name": "compacted_seq", + "name": "doc_count", + "type": "TypeInt", + "description": "A count of the documents in the specified database.", + "computed": true + }, + { + "name": "uuid", "type": "TypeString", - "description": "An opaque string that describes the compaction state of the database.", + "description": "The UUID of the database.", "computed": true }, { - "name": "engine", + "name": "instance_crn", "type": "TypeString", - "description": "The engine used for the database.", + "description": "Cloudant Instance CRN.", + "required": true + }, + { + "name": "compacted_seq", + "type": "TypeString", + "description": "An opaque string that describes the compaction state of the database.", "computed": true }, + { + "name": "props", + "type": "TypeList", + "description": "The database properties.", + "computed": true, + "elem": { + "partitioned": { + "name": "partitioned", + "type": "TypeBool", + "description": "The value is `true` for a partitioned database.", + "computed": true + } + } + }, { "name": "committed_update_seq", "type": "TypeString", "description": "An opaque string that describes the committed state of the database.", "computed": true }, + { + "name": "update_seq", + "type": "TypeString", + "description": "An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.", + "computed": true + }, + { + "name": "compact_running", + "type": "TypeBool", + "description": "True if the database compaction routine is operating on this database.", + "computed": true + }, { "name": "disk_format_version", "type": "TypeInt", "description": "The version of the physical format used for the data when it is stored on disk.", "computed": true }, + { + "name": "doc_del_count", + "type": "TypeInt", + "description": "Number of deleted documents.", + "computed": true + }, + { + "name": "engine", + "type": "TypeString", + "description": "The engine used for the database.", + "computed": true + }, { "name": "sizes", "type": "TypeList", @@ -11044,25 +11328,64 @@ } }, { - "name": "update_seq", + "name": "db", "type": "TypeString", - "description": "An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates.", + "description": "Path parameter to specify the database name.", + "required": true + } + ], + "ibm_cm_catalog": [ + { + "name": "short_description", + "type": "TypeString", + "description": "Description in the requested language.", "computed": true }, { - "name": "compact_running", - "type": "TypeBool", - "description": "True if the database compaction routine is operating on this database.", - "computed": true + "name": "features", + "type": "TypeList", + "description": "List of features associated with this catalog.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Feature description.", + "computed": true + }, + "description_i18n": { + "name": "description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "title": { + "name": "title", + "type": "TypeString", + "description": "Heading.", + "computed": true + }, + "title_i18n": { + "name": "title_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } }, { - "name": "doc_del_count", - "type": "TypeInt", - "description": "Number of deleted documents.", + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group id the catalog is owned by.", + "cloud_data_type": "resource_group", "computed": true - } - ], - "ibm_cm_catalog": [ + }, { "name": "syndication_settings", "type": "TypeList", @@ -11227,50 +11550,64 @@ } }, { - "name": "kind", + "name": "label_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "short_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "url", "type": "TypeString", - "description": "Kind of catalog. Supported kinds are offering and vpe.", + "description": "The url for this specific catalog.", "computed": true }, { - "name": "catalog_identifier", + "name": "crn", "type": "TypeString", - "description": "Catalog identifier.", - "required": true + "description": "CRN associated with the catalog.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "id", - "type": "TypeString", - "description": "Unique ID.", + "name": "disabled", + "type": "TypeBool", + "description": "Denotes whether a catalog is disabled.", "computed": true }, { - "name": "short_description", + "name": "updated", "type": "TypeString", - "description": "Description in the requested language.", + "description": "The date-time this catalog was last updated.", "computed": true }, { - "name": "tags", - "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "owning_account", + "type": "TypeString", + "description": "Account that owns catalog.", + "computed": true }, { - "name": "offerings_url", + "name": "catalog_identifier", "type": "TypeString", - "description": "URL path to offerings.", - "computed": true + "description": "Catalog identifier.", + "required": true }, { - "name": "resource_group_id", + "name": "id", "type": "TypeString", - "description": "Resource group id the catalog is owned by.", - "cloud_data_type": "resource_group", + "description": "Unique ID.", "computed": true }, { @@ -11286,23 +11623,84 @@ "computed": true }, { - "name": "catalog_banner_url", + "name": "offerings_url", "type": "TypeString", - "description": "URL for a banner image for this catalog.", + "description": "URL path to offerings.", "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "CRN associated with the catalog.", - "cloud_data_type": "crn", - "computed": true + "name": "catalog_filters", + "type": "TypeList", + "description": "Filters for account and catalog filters.", + "computed": true, + "elem": { + "category_filters": { + "name": "category_filters", + "type": "TypeMap", + "description": "Filter against offering properties.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "id_filters": { + "name": "id_filters", + "type": "TypeList", + "description": "Filter on offering ID's. There is an include filter and an exclule filter. Both can be set.", + "computed": true, + "elem": { + "exclude": { + "name": "exclude", + "type": "TypeList", + "description": "Offering filter terms.", + "computed": true, + "elem": { + "filter_terms": { + "name": "filter_terms", + "type": "TypeList", + "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + "include": { + "name": "include", + "type": "TypeList", + "description": "Offering filter terms.", + "computed": true, + "elem": { + "filter_terms": { + "name": "filter_terms", + "type": "TypeList", + "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + } + } + }, + "include_all": { + "name": "include_all", + "type": "TypeBool", + "description": "-\u003e true - Include all of the public catalog when filtering. Further settings will specifically exclude some offerings. false - Exclude all of the public catalog when filtering. Further settings will specifically include some offerings.", + "computed": true + } + } }, { - "name": "created", - "type": "TypeString", - "description": "The date-time this catalog was created.", - "computed": true + "name": "metadata", + "type": "TypeMap", + "description": "Catalog specific metadata.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "target_account_contexts", @@ -11376,172 +11774,109 @@ "computed": true }, { - "name": "features", + "name": "catalog_banner_url", + "type": "TypeString", + "description": "URL for a banner image for this catalog.", + "computed": true + }, + { + "name": "tags", "type": "TypeList", - "description": "List of features associated with this catalog.", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", "computed": true, "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Feature description.", - "computed": true - }, - "description_i18n": { - "name": "description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "title": { - "name": "title", - "type": "TypeString", - "description": "Heading.", - "computed": true - }, - "title_i18n": { - "name": "title_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - } + "type": "TypeString" } }, + { + "name": "created", + "type": "TypeString", + "description": "The date-time this catalog was created.", + "computed": true + }, + { + "name": "kind", + "type": "TypeString", + "description": "Kind of catalog. Supported kinds are offering and vpe.", + "computed": true + } + ], + "ibm_cm_object": [ { "name": "updated", "type": "TypeString", - "description": "The date-time this catalog was last updated.", + "description": "The date and time this catalog was last updated.", "computed": true }, { - "name": "metadata", - "type": "TypeMap", - "description": "Catalog specific metadata.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "object_id", + "type": "TypeString", + "description": "Object identifier.", + "required": true }, { - "name": "label_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "rev", + "type": "TypeString", + "description": "Cloudant revision.", + "computed": true }, { - "name": "short_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "crn", + "type": "TypeString", + "description": "The crn for this specific object.", + "cloud_data_type": "crn", + "computed": true }, { "name": "url", "type": "TypeString", - "description": "The url for this specific catalog.", + "description": "The url for this specific object.", "computed": true }, { - "name": "disabled", - "type": "TypeBool", - "description": "Denotes whether a catalog is disabled.", + "name": "parent_id", + "type": "TypeString", + "description": "The parent for this specific object.", "computed": true }, { - "name": "owning_account", + "name": "created", "type": "TypeString", - "description": "Account that owns catalog.", + "description": "The date and time this catalog was created.", "computed": true }, { - "name": "catalog_filters", - "type": "TypeList", - "description": "Filters for account and catalog filters.", + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog identifier.", + "required": true + }, + { + "name": "label_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "computed": true, "elem": { - "category_filters": { - "name": "category_filters", - "type": "TypeMap", - "description": "Filter against offering properties.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "id_filters": { - "name": "id_filters", - "type": "TypeList", - "description": "Filter on offering ID's. There is an include filter and an exclule filter. Both can be set.", - "computed": true, - "elem": { - "exclude": { - "name": "exclude", - "type": "TypeList", - "description": "Offering filter terms.", - "computed": true, - "elem": { - "filter_terms": { - "name": "filter_terms", - "type": "TypeList", - "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - "include": { - "name": "include", - "type": "TypeList", - "description": "Offering filter terms.", - "computed": true, - "elem": { - "filter_terms": { - "name": "filter_terms", - "type": "TypeList", - "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - } - } - }, - "include_all": { - "name": "include_all", - "type": "TypeBool", - "description": "-\u003e true - Include all of the public catalog when filtering. Further settings will specifically exclude some offerings. false - Exclude all of the public catalog when filtering. Further settings will specifically include some offerings.", - "computed": true - } + "type": "TypeString" } - } - ], - "ibm_cm_object": [ + }, { - "name": "crn", + "name": "label", "type": "TypeString", - "description": "The crn for this specific object.", - "cloud_data_type": "crn", + "description": "Display name in the requested language.", "computed": true }, { - "name": "created", + "name": "name", "type": "TypeString", - "description": "The date and time this catalog was created.", + "description": "The programmatic name of this object.", + "computed": true + }, + { + "name": "short_description", + "type": "TypeString", + "description": "Short description in the requested language.", "computed": true }, { @@ -11553,6 +11888,50 @@ "type": "TypeString" } }, + { + "name": "publish", + "type": "TypeList", + "description": "Publish information.", + "computed": true, + "elem": { + "ibm_approved": { + "name": "ibm_approved", + "type": "TypeBool", + "description": "Indicates if this offering has been approved for use by all IBMers.", + "computed": true + }, + "permit_ibm_public_publish": { + "name": "permit_ibm_public_publish", + "type": "TypeBool", + "description": "Is it permitted to request publishing to IBM or Public.", + "computed": true + }, + "portal_approval_record": { + "name": "portal_approval_record", + "type": "TypeString", + "description": "The portal's approval record ID.", + "computed": true + }, + "portal_url": { + "name": "portal_url", + "type": "TypeString", + "description": "The portal UI URL.", + "computed": true + }, + "public_approved": { + "name": "public_approved", + "type": "TypeBool", + "description": "Indicates if this offering has been approved for use by all IBM Cloud users.", + "computed": true + } + } + }, + { + "name": "catalog_name", + "type": "TypeString", + "description": "The name of the catalog.", + "computed": true + }, { "name": "catalog_object_id", "type": "TypeString", @@ -11560,14 +11939,21 @@ "computed": true }, { - "name": "label_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "name": "tags", + "type": "TypeList", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" } }, + { + "name": "kind", + "type": "TypeString", + "description": "Kind of object.", + "computed": true + }, { "name": "state", "type": "TypeList", @@ -11607,164 +11993,317 @@ } }, { - "name": "catalog_name", + "name": "data", "type": "TypeString", - "description": "The name of the catalog.", + "description": "Stringified map of data values for this object.", "computed": true - }, + } + ], + "ibm_cm_offering": [ { - "name": "name", - "type": "TypeString", - "description": "The programmatic name of this object.", - "computed": true + "name": "rating", + "type": "TypeList", + "description": "Repository info for offerings.", + "computed": true, + "elem": { + "four_star_count": { + "name": "four_star_count", + "type": "TypeInt", + "description": "Four start rating.", + "computed": true + }, + "one_star_count": { + "name": "one_star_count", + "type": "TypeInt", + "description": "One start rating.", + "computed": true + }, + "three_star_count": { + "name": "three_star_count", + "type": "TypeInt", + "description": "Three start rating.", + "computed": true + }, + "two_star_count": { + "name": "two_star_count", + "type": "TypeInt", + "description": "Two start rating.", + "computed": true + } + } }, { - "name": "updated", + "name": "created", "type": "TypeString", - "description": "The date and time this catalog was last updated.", + "description": "The date and time this catalog was created.", "computed": true }, { - "name": "publish", + "name": "media", "type": "TypeList", - "description": "Publish information.", + "description": "A list of media items related to this offering.", "computed": true, "elem": { - "ibm_approved": { - "name": "ibm_approved", - "type": "TypeBool", - "description": "Indicates if this offering has been approved for use by all IBMers.", + "api_url": { + "name": "api_url", + "type": "TypeString", + "description": "CM API specific URL of the specified media item.", "computed": true }, - "permit_ibm_public_publish": { - "name": "permit_ibm_public_publish", - "type": "TypeBool", - "description": "Is it permitted to request publishing to IBM or Public.", + "caption": { + "name": "caption", + "type": "TypeString", + "description": "Caption for this media item.", "computed": true }, - "portal_approval_record": { - "name": "portal_approval_record", + "caption_i18n": { + "name": "caption_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "thumbnail_url": { + "name": "thumbnail_url", "type": "TypeString", - "description": "The portal's approval record ID.", + "description": "Thumbnail URL for this media item.", "computed": true }, - "portal_url": { - "name": "portal_url", + "type": { + "name": "type", "type": "TypeString", - "description": "The portal UI URL.", + "description": "Type of this media item.", "computed": true }, - "public_approved": { - "name": "public_approved", - "type": "TypeBool", - "description": "Indicates if this offering has been approved for use by all IBM Cloud users.", + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item.", "computed": true + }, + "url_proxy": { + "name": "url_proxy", + "type": "TypeList", + "description": "Offering URL proxy information.", + "computed": true, + "elem": { + "sha": { + "name": "sha", + "type": "TypeString", + "description": "SHA256 fingerprint of image.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item being proxied.", + "computed": true + } + } } } }, { - "name": "data", + "name": "product_kind", "type": "TypeString", - "description": "Stringified map of data values for this object.", + "description": "The product kind. Valid values are module, solution, or empty string.", "computed": true }, { - "name": "object_id", - "type": "TypeString", - "description": "Object identifier.", - "required": true - }, - { - "name": "rev", - "type": "TypeString", - "description": "Cloudant revision.", - "computed": true + "name": "permit_request_ibm_public_publish", + "type": "TypeBool", + "description": "Is it permitted to request publishing to IBM or Public.", + "computed": true, + "deprecated": "This argument is deprecated" }, { - "name": "url", - "type": "TypeString", - "description": "The url for this specific object.", - "computed": true + "name": "public_publish_approved", + "type": "TypeBool", + "description": "Indicates if this offering has been approved for use by all IBM Cloud users.", + "computed": true, + "deprecated": "This argument is deprecated" }, { - "name": "parent_id", + "name": "publish_public_crn", "type": "TypeString", - "description": "The parent for this specific object.", + "description": "The crn of the public catalog entry of this offering.", "computed": true }, { - "name": "label", + "name": "portal_ui_url", "type": "TypeString", - "description": "Display name in the requested language.", + "description": "The portal UI URL.", "computed": true }, { - "name": "tags", - "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "short_description", + "name": "crn", "type": "TypeString", - "description": "Short description in the requested language.", + "description": "The crn for this specific offering.", + "cloud_data_type": "crn", "computed": true }, { - "name": "kind", + "name": "name", "type": "TypeString", - "description": "Kind of object.", + "description": "The programmatic name of this offering.", "computed": true }, { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog identifier.", - "required": true - } - ], - "ibm_cm_offering": [ - { - "name": "disclaimer", + "name": "offering_support_url", "type": "TypeString", - "description": "A disclaimer for this offering.", + "description": "[deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering.", "computed": true }, { - "name": "hidden", + "name": "share_with_all", "type": "TypeBool", - "description": "Determine if this offering should be displayed in the Consumption UI.", + "description": "Denotes public availability of an Offering - if share_enabled is true.", "computed": true }, { - "name": "crn", + "name": "offering_identifier", "type": "TypeString", - "description": "The crn for this specific offering.", - "cloud_data_type": "crn", + "description": "Computed Offering ID.", "computed": true }, { - "name": "offering_icon_url", - "type": "TypeString", - "description": "URL for an icon associated with this offering.", - "computed": true + "name": "metadata", + "type": "TypeMap", + "description": "Map of metadata values for this offering.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "created", - "type": "TypeString", - "description": "The date and time this catalog was created.", + "name": "hidden", + "type": "TypeBool", + "description": "Determine if this offering should be displayed in the Consumption UI.", "computed": true }, { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog identifier.", - "immutable": true, - "required": true + "name": "provider_info", + "type": "TypeList", + "description": "Information on the provider for this offering, or omitted if no provider information is given.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The id of this provider.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of this provider.", + "computed": true + } + } + }, + { + "name": "badges", + "type": "TypeList", + "description": "A list of badges for this offering.", + "computed": true, + "elem": { + "authority": { + "name": "authority", + "type": "TypeString", + "description": "Authority for the current badge.", + "computed": true + }, + "constraints": { + "name": "constraints", + "type": "TypeList", + "description": "An optional set of constraints indicating which versions in an Offering have this particular badge.", + "computed": true, + "elem": { + "rule": { + "name": "rule", + "type": "TypeString", + "description": "Rule for the current constraint.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the current constraint.", + "computed": true + } + } + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the current badge.", + "computed": true + }, + "description_i18n": { + "name": "description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "icon": { + "name": "icon", + "type": "TypeString", + "description": "Icon for the current badge.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the current badge.", + "computed": true + }, + "label": { + "name": "label", + "type": "TypeString", + "description": "Display name for the current badge.", + "computed": true + }, + "label_i18n": { + "name": "label_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "learn_more_links": { + "name": "learn_more_links", + "type": "TypeList", + "description": "Learn more links for a badge.", + "computed": true, + "elem": { + "first_party": { + "name": "first_party", + "type": "TypeString", + "description": "First party link.", + "computed": true + }, + "third_party": { + "name": "third_party", + "type": "TypeString", + "description": "Third party link.", + "computed": true + } + } + }, + "tag": { + "name": "tag", + "type": "TypeString", + "description": "Tag for the current badge.", + "computed": true + } + } }, { "name": "url", @@ -11773,10 +12312,23 @@ "computed": true }, { - "name": "updated", - "type": "TypeString", - "description": "The date and time this catalog was last updated.", - "computed": true + "name": "tags", + "type": "TypeList", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "long_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "kinds", @@ -13817,171 +14369,6 @@ } } }, - { - "name": "portal_approval_record", - "type": "TypeString", - "description": "The portal's approval record ID.", - "computed": true - }, - { - "name": "catalog_name", - "type": "TypeString", - "description": "The name of the catalog.", - "computed": true - }, - { - "name": "image_pull_keys", - "type": "TypeList", - "description": "Image pull keys for this offering.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Key description.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Key name.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Key value.", - "computed": true - } - } - }, - { - "name": "offering_id", - "type": "TypeString", - "description": "Offering identifier.", - "immutable": true, - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The programmatic name of this offering.", - "computed": true - }, - { - "name": "offering_support_url", - "type": "TypeString", - "description": "[deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering.", - "computed": true - }, - { - "name": "short_description", - "type": "TypeString", - "description": "Short description in the requested language.", - "computed": true - }, - { - "name": "long_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "features", - "type": "TypeList", - "description": "list of features associated with this offering.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Feature description.", - "computed": true - }, - "description_i18n": { - "name": "description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "title": { - "name": "title", - "type": "TypeString", - "description": "Heading.", - "computed": true - }, - "title_i18n": { - "name": "title_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - { - "name": "share_with_all", - "type": "TypeBool", - "description": "Denotes public availability of an Offering - if share_enabled is true.", - "computed": true - }, - { - "name": "share_with_ibm", - "type": "TypeBool", - "description": "Denotes IBM employee availability of an Offering - if share_enabled is true.", - "computed": true - }, - { - "name": "label", - "type": "TypeString", - "description": "Display Name in the requested language.", - "computed": true - }, - { - "name": "portal_ui_url", - "type": "TypeString", - "description": "The portal UI URL.", - "computed": true - }, - { - "name": "deprecate_pending", - "type": "TypeList", - "description": "Deprecation information for an Offering.", - "computed": true, - "elem": { - "deprecate_date": { - "name": "deprecate_date", - "type": "TypeString", - "description": "Date of deprecation.", - "computed": true - }, - "deprecate_state": { - "name": "deprecate_state", - "type": "TypeString", - "description": "Deprecation state.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "computed": true - } - } - }, - { - "name": "product_kind", - "type": "TypeString", - "description": "The product kind. Valid values are module, solution, or empty string.", - "computed": true - }, { "name": "rev", "type": "TypeString", @@ -13989,84 +14376,17 @@ "computed": true }, { - "name": "permit_request_ibm_public_publish", - "type": "TypeBool", - "description": "Is it permitted to request publishing to IBM or Public.", - "computed": true, - "deprecated": "This argument is deprecated" - }, - { - "name": "keywords", - "type": "TypeList", - "description": "List of keywords associated with offering, typically used to search for it.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "pc_managed", - "type": "TypeBool", - "description": "Offering is managed by Partner Center.", - "computed": true - }, - { - "name": "metadata", - "type": "TypeMap", - "description": "Map of metadata values for this offering.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "offering_identifier", + "name": "catalog_name", "type": "TypeString", - "description": "Computed Offering ID.", + "description": "The name of the catalog.", "computed": true }, { - "name": "offering_docs_url", + "name": "disclaimer", "type": "TypeString", - "description": "URL for an additional docs with this offering.", + "description": "A disclaimer for this offering.", "computed": true }, - { - "name": "share_with_access_list", - "type": "TypeList", - "description": "A list of account IDs to add to this offering's access list.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "public_publish_approved", - "type": "TypeBool", - "description": "Indicates if this offering has been approved for use by all IBM Cloud users.", - "computed": true, - "deprecated": "This argument is deprecated" - }, - { - "name": "provider_info", - "type": "TypeList", - "description": "Information on the provider for this offering, or omitted if no provider information is given.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "The id of this provider.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of this provider.", - "computed": true - } - } - }, { "name": "support", "type": "TypeList", @@ -14252,25 +14572,49 @@ } }, { - "name": "media", + "name": "label", + "type": "TypeString", + "description": "Display Name in the requested language.", + "computed": true + }, + { + "name": "label_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "share_with_access_list", "type": "TypeList", - "description": "A list of media items related to this offering.", + "description": "A list of account IDs to add to this offering's access list.", "computed": true, "elem": { - "api_url": { - "name": "api_url", - "type": "TypeString", - "description": "CM API specific URL of the specified media item.", - "computed": true - }, - "caption": { - "name": "caption", + "type": "TypeString" + } + }, + { + "name": "public_original_crn", + "type": "TypeString", + "description": "The original offering CRN that this publish entry came from.", + "computed": true + }, + { + "name": "features", + "type": "TypeList", + "description": "list of features associated with this offering.", + "computed": true, + "elem": { + "description": { + "name": "description", "type": "TypeString", - "description": "Caption for this media item.", + "description": "Feature description.", "computed": true }, - "caption_i18n": { - "name": "caption_i18n", + "description_i18n": { + "name": "description_i18n", "type": "TypeMap", "description": "A map of translated strings, by language code.", "computed": true, @@ -14278,103 +14622,104 @@ "type": "TypeString" } }, - "thumbnail_url": { - "name": "thumbnail_url", - "type": "TypeString", - "description": "Thumbnail URL for this media item.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of this media item.", - "computed": true - }, - "url": { - "name": "url", + "title": { + "name": "title", "type": "TypeString", - "description": "URL of the specified media item.", + "description": "Heading.", "computed": true }, - "url_proxy": { - "name": "url_proxy", - "type": "TypeList", - "description": "Offering URL proxy information.", + "title_i18n": { + "name": "title_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "computed": true, "elem": { - "sha": { - "name": "sha", - "type": "TypeString", - "description": "SHA256 fingerprint of image.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the specified media item being proxied.", - "computed": true - } + "type": "TypeString" } } } }, { - "name": "publish_approved", + "name": "share_with_ibm", "type": "TypeBool", - "description": "Offering has been approved to publish to permitted to IBM or Public Catalog.", + "description": "Denotes IBM employee availability of an Offering - if share_enabled is true.", "computed": true }, { - "name": "tags", - "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", + "name": "updated", + "type": "TypeString", + "description": "The date and time this catalog was last updated.", + "computed": true + }, + { + "name": "short_description", + "type": "TypeString", + "description": "Short description in the requested language.", + "computed": true + }, + { + "name": "short_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "rating", + "name": "long_description", + "type": "TypeString", + "description": "Long description in the requested language.", + "computed": true + }, + { + "name": "image_pull_keys", "type": "TypeList", - "description": "Repository info for offerings.", + "description": "Image pull keys for this offering.", "computed": true, "elem": { - "four_star_count": { - "name": "four_star_count", - "type": "TypeInt", - "description": "Four start rating.", - "computed": true - }, - "one_star_count": { - "name": "one_star_count", - "type": "TypeInt", - "description": "One start rating.", + "description": { + "name": "description", + "type": "TypeString", + "description": "Key description.", "computed": true }, - "three_star_count": { - "name": "three_star_count", - "type": "TypeInt", - "description": "Three start rating.", + "name": { + "name": "name", + "type": "TypeString", + "description": "Key name.", "computed": true }, - "two_star_count": { - "name": "two_star_count", - "type": "TypeInt", - "description": "Two start rating.", + "value": { + "name": "value", + "type": "TypeString", + "description": "Key value.", "computed": true } } }, { - "name": "short_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog identifier.", + "immutable": true, + "required": true + }, + { + "name": "keywords", + "type": "TypeList", + "description": "List of keywords associated with offering, typically used to search for it.", "computed": true, "elem": { "type": "TypeString" } }, + { + "name": "publish_approved", + "type": "TypeBool", + "description": "Offering has been approved to publish to permitted to IBM or Public Catalog.", + "computed": true + }, { "name": "share_enabled", "type": "TypeBool", @@ -14382,10 +14727,11 @@ "computed": true }, { - "name": "public_original_crn", - "type": "TypeString", - "description": "The original offering CRN that this publish entry came from.", - "computed": true + "name": "ibm_publish_approved", + "type": "TypeBool", + "description": "Indicates if this offering has been approved for use by all IBMers.", + "computed": true, + "deprecated": "This argument is deprecated" }, { "name": "repo_info", @@ -14408,147 +14754,67 @@ } }, { - "name": "label_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "ibm_publish_approved", - "type": "TypeBool", - "description": "Indicates if this offering has been approved for use by all IBMers.", - "computed": true, - "deprecated": "This argument is deprecated" - }, - { - "name": "publish_public_crn", + "name": "portal_approval_record", "type": "TypeString", - "description": "The crn of the public catalog entry of this offering.", + "description": "The portal's approval record ID.", "computed": true }, { - "name": "badges", + "name": "deprecate_pending", "type": "TypeList", - "description": "A list of badges for this offering.", + "description": "Deprecation information for an Offering.", "computed": true, "elem": { - "authority": { - "name": "authority", - "type": "TypeString", - "description": "Authority for the current badge.", - "computed": true - }, - "constraints": { - "name": "constraints", - "type": "TypeList", - "description": "An optional set of constraints indicating which versions in an Offering have this particular badge.", - "computed": true, - "elem": { - "rule": { - "name": "rule", - "type": "TypeString", - "description": "Rule for the current constraint.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the current constraint.", - "computed": true - } - } - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the current badge.", - "computed": true - }, - "description_i18n": { - "name": "description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "icon": { - "name": "icon", - "type": "TypeString", - "description": "Icon for the current badge.", - "computed": true - }, - "id": { - "name": "id", + "deprecate_date": { + "name": "deprecate_date", "type": "TypeString", - "description": "ID of the current badge.", + "description": "Date of deprecation.", "computed": true }, - "label": { - "name": "label", + "deprecate_state": { + "name": "deprecate_state", "type": "TypeString", - "description": "Display name for the current badge.", + "description": "Deprecation state.", "computed": true }, - "label_i18n": { - "name": "label_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "learn_more_links": { - "name": "learn_more_links", - "type": "TypeList", - "description": "Learn more links for a badge.", - "computed": true, - "elem": { - "first_party": { - "name": "first_party", - "type": "TypeString", - "description": "First party link.", - "computed": true - }, - "third_party": { - "name": "third_party", - "type": "TypeString", - "description": "Third party link.", - "computed": true - } - } - }, - "tag": { - "name": "tag", + "description": { + "name": "description", "type": "TypeString", - "description": "Tag for the current badge.", "computed": true } } }, { - "name": "long_description", + "name": "offering_id", "type": "TypeString", - "description": "Long description in the requested language.", + "description": "Offering identifier.", + "immutable": true, + "required": true + }, + { + "name": "offering_icon_url", + "type": "TypeString", + "description": "URL for an icon associated with this offering.", "computed": true - } - ], - "ibm_cm_offering_instance": [ + }, { - "name": "offering_id", + "name": "offering_docs_url", "type": "TypeString", - "description": "Offering ID this instance was created from.", + "description": "URL for an additional docs with this offering.", "computed": true }, { - "name": "version", + "name": "pc_managed", + "type": "TypeBool", + "description": "Offering is managed by Partner Center.", + "computed": true + } + ], + "ibm_cm_offering_instance": [ + { + "name": "channel", "type": "TypeString", - "description": "The version this instance was installed from (not version id).", + "description": "channel to target for the operator subscription. Required for operator bundles", "computed": true }, { @@ -14558,31 +14824,27 @@ "required": true }, { - "name": "crn", + "name": "catalog_id", "type": "TypeString", - "description": "platform CRN for this instance.", - "cloud_data_type": "crn", + "description": "Catalog ID this instance was created from.", "computed": true }, { - "name": "label", + "name": "offering_id", "type": "TypeString", - "description": "the label for this instance.", + "description": "Offering ID this instance was created from.", "computed": true }, { - "name": "cluster_namespaces", - "type": "TypeList", - "description": "List of target namespaces to install into.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "cluster_all_namespaces", + "type": "TypeBool", + "description": "designate to install into all namespaces.", + "computed": true }, { - "name": "install_plan", + "name": "schematics_workspace_id", "type": "TypeString", - "description": "install plan for the subscription of the operator- can be either Automatic or Manual. Required for operator bundles", + "description": "id of the schematics workspace, for offerings installed through schematics", "computed": true }, { @@ -14592,58 +14854,68 @@ "computed": true }, { - "name": "catalog_id", + "name": "_rev", "type": "TypeString", - "description": "Catalog ID this instance was created from.", + "description": "Cloudant Revision for this instance", "computed": true }, { - "name": "kind_format", + "name": "label", "type": "TypeString", - "description": "the format this instance has (helm, operator, ova...).", + "description": "the label for this instance.", "computed": true }, { - "name": "cluster_all_namespaces", - "type": "TypeBool", - "description": "designate to install into all namespaces.", + "name": "version", + "type": "TypeString", + "description": "The version this instance was installed from (not version id).", "computed": true }, { - "name": "schematics_workspace_id", + "name": "cluster_region", "type": "TypeString", - "description": "id of the schematics workspace, for offerings installed through schematics", + "description": "Cluster region (e.g., us-south).", "computed": true }, { - "name": "_rev", + "name": "cluster_namespaces", + "type": "TypeList", + "description": "List of target namespaces to install into.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "install_plan", "type": "TypeString", - "description": "Cloudant Revision for this instance", + "description": "install plan for the subscription of the operator- can be either Automatic or Manual. Required for operator bundles", "computed": true }, { - "name": "cluster_id", + "name": "crn", "type": "TypeString", - "description": "Cluster ID.", + "description": "platform CRN for this instance.", + "cloud_data_type": "crn", "computed": true }, { - "name": "cluster_region", + "name": "kind_format", "type": "TypeString", - "description": "Cluster region (e.g., us-south).", + "description": "the format this instance has (helm, operator, ova...).", "computed": true }, { - "name": "resource_group_id", + "name": "cluster_id", "type": "TypeString", - "description": "id of the resource group", - "cloud_data_type": "resource_group", + "description": "Cluster ID.", "computed": true }, { - "name": "channel", + "name": "resource_group_id", "type": "TypeString", - "description": "channel to target for the operator subscription. Required for operator bundles", + "description": "id of the resource group", + "cloud_data_type": "resource_group", "computed": true } ], @@ -14662,72 +14934,6 @@ } ], "ibm_cm_version": [ - { - "name": "pre_install", - "type": "TypeList", - "description": "Optional pre-install instructions.", - "computed": true, - "elem": { - "delete_script": { - "name": "delete_script", - "type": "TypeString", - "description": "Optional script that if run will remove the installed version.", - "computed": true - }, - "instructions": { - "name": "instructions", - "type": "TypeString", - "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", - "computed": true - }, - "instructions_i18n": { - "name": "instructions_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "scope": { - "name": "scope", - "type": "TypeString", - "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", - "computed": true - }, - "script": { - "name": "script", - "type": "TypeString", - "description": "Optional script that needs to be run post any pre-condition script.", - "computed": true - }, - "script_permission": { - "name": "script_permission", - "type": "TypeString", - "description": "Optional iam permissions that are required on the target cluster to run this script.", - "computed": true - } - } - }, - { - "name": "package_version", - "type": "TypeString", - "description": "Version of the package used to create this version.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Version's CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Version of content type.", - "computed": true - }, { "name": "flavor", "type": "TypeList", @@ -14764,187 +14970,965 @@ } }, { - "name": "required_resources", + "name": "outputs", "type": "TypeList", - "description": "Resource requirments for installation.", + "description": "List of output values for this version.", "computed": true, "elem": { - "type": { - "name": "type", + "description": { + "name": "description", "type": "TypeString", - "description": "Type of requirement.", + "description": "Output description.", "computed": true }, - "value": { - "name": "value", + "key": { + "name": "key", "type": "TypeString", - "description": "mem, disk, cores, and nodes can be parsed as an int. targetVersion will be a semver range value.", + "description": "Output key.", "computed": true } } }, { - "name": "solution_info", + "name": "state", "type": "TypeList", - "description": "Version Solution Information. Only supported for Product kind Solution.", + "description": "Offering state.", "computed": true, "elem": { - "architecture_diagrams": { - "name": "architecture_diagrams", + "current": { + "name": "current", + "type": "TypeString", + "description": "one of: new, validated, account-published, ibm-published, public-published.", + "computed": true + }, + "current_entered": { + "name": "current_entered", + "type": "TypeString", + "description": "Date and time of current request.", + "computed": true + }, + "pending": { + "name": "pending", + "type": "TypeString", + "description": "one of: new, validated, account-published, ibm-published, public-published.", + "computed": true + }, + "pending_requested": { + "name": "pending_requested", + "type": "TypeString", + "description": "Date and time of pending request.", + "computed": true + }, + "previous": { + "name": "previous", + "type": "TypeString", + "description": "one of: new, validated, account-published, ibm-published, public-published.", + "computed": true + } + } + }, + { + "name": "created", + "type": "TypeString", + "description": "The date and time this version was created.", + "computed": true + }, + { + "name": "configuration", + "type": "TypeList", + "description": "List of user solicited overrides.", + "computed": true, + "elem": { + "custom_config": { + "name": "custom_config", "type": "TypeList", - "description": "Architecture diagrams for this solution.", + "description": "Render type.", "computed": true, "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of this diagram.", - "computed": true - }, - "description_i18n": { - "name": "description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "diagram": { - "name": "diagram", + "associations": { + "name": "associations", "type": "TypeList", - "description": "Offering Media information.", + "description": "List of parameters that are associated with this configuration.", "computed": true, "elem": { - "api_url": { - "name": "api_url", - "type": "TypeString", - "description": "CM API specific URL of the specified media item.", - "computed": true - }, - "caption": { - "name": "caption", - "type": "TypeString", - "description": "Caption for this media item.", - "computed": true - }, - "caption_i18n": { - "name": "caption_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "thumbnail_url": { - "name": "thumbnail_url", - "type": "TypeString", - "description": "Thumbnail URL for this media item.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of this media item.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the specified media item.", - "computed": true - }, - "url_proxy": { - "name": "url_proxy", + "parameters": { + "name": "parameters", "type": "TypeList", - "description": "Offering URL proxy information.", + "description": "Parameters for this association.", "computed": true, "elem": { - "sha": { - "name": "sha", + "name": { + "name": "name", "type": "TypeString", - "description": "SHA256 fingerprint of image.", + "description": "Name of this parameter.", "computed": true }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the specified media item being proxied.", + "options_refresh": { + "name": "options_refresh", + "type": "TypeBool", + "description": "Refresh options.", "computed": true } } } } - } - } - }, - "cost_estimate": { - "name": "cost_estimate", - "type": "TypeList", - "description": "Cost estimate definition.", - "computed": true, - "elem": { - "currency": { - "name": "currency", + }, + "config_constraints": { + "name": "config_constraints", + "type": "TypeMap", + "description": "Map of constraint parameters that will be passed to the custom widget.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "grouping": { + "name": "grouping", "type": "TypeString", - "description": "Cost estimate currency.", + "description": "Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment).", "computed": true }, - "diff_total_hourly_cost": { - "name": "diff_total_hourly_cost", - "type": "TypeString", - "description": "Difference in total hourly cost.", + "grouping_index": { + "name": "grouping_index", + "type": "TypeInt", + "description": "Determines the order that this configuration item shows in that particular grouping.", "computed": true }, - "diff_total_monthly_cost": { - "name": "diff_total_monthly_cost", + "original_grouping": { + "name": "original_grouping", "type": "TypeString", - "description": "Difference in total monthly cost.", + "description": "Original grouping type for this configuration (3 types - Target, Resource, and Deployment).", "computed": true }, - "past_total_hourly_cost": { - "name": "past_total_hourly_cost", + "type": { + "name": "type", "type": "TypeString", - "description": "Past total hourly cost.", + "description": "ID of the widget type.", + "computed": true + } + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "The default value as a JSON encoded string. To use a secret when the type is password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Key description.", + "computed": true + }, + "display_name": { + "name": "display_name", + "type": "TypeString", + "description": "Display name for configuration type.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "Hide values.", + "computed": true + }, + "key": { + "name": "key", + "type": "TypeString", + "description": "Configuration key.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of options of type.", + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "required": { + "name": "required", + "type": "TypeBool", + "description": "Is key required to install.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Value type (string, boolean, int).", + "computed": true + }, + "type_metadata": { + "name": "type_metadata", + "type": "TypeString", + "description": "The original type, as found in the source being onboarded.", + "computed": true + }, + "value_constraint": { + "name": "value_constraint", + "type": "TypeString", + "description": "Constraint associated with value, e.g., for string type - regx:[a-z].", + "computed": true + } + } + }, + { + "name": "iam_permissions", + "type": "TypeList", + "description": "List of IAM permissions that are required to consume this version.", + "computed": true, + "elem": { + "resources": { + "name": "resources", + "type": "TypeList", + "description": "Resources for this permission.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Resource description.", "computed": true }, - "past_total_monthly_cost": { - "name": "past_total_monthly_cost", + "name": { + "name": "name", "type": "TypeString", - "description": "Past total monthly cost.", + "description": "Resource name.", "computed": true }, - "projects": { - "name": "projects", + "role_crns": { + "name": "role_crns", "type": "TypeList", - "description": "Cost estimate projects.", + "description": "Role CRNs for this permission.", "computed": true, "elem": { - "breakdown": { - "name": "breakdown", - "type": "TypeList", - "description": "Cost breakdown definition.", - "computed": true, - "elem": { - "resources": { - "name": "resources", - "type": "TypeList", - "description": "Resources.", - "computed": true, - "elem": { - "cost_components": { - "name": "cost_components", - "type": "TypeList", - "description": "Cost components.", - "computed": true, - "elem": { - "hourly_cost": { - "name": "hourly_cost", - "type": "TypeString", - "description": "Cost component hourly cost.", - "computed": true - }, + "type": "TypeString" + } + } + } + }, + "role_crns": { + "name": "role_crns", + "type": "TypeList", + "description": "Role CRNs for this permission.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "service_name": { + "name": "service_name", + "type": "TypeString", + "description": "Service name.", + "computed": true + } + } + }, + { + "name": "pre_install", + "type": "TypeList", + "description": "Optional pre-install instructions.", + "computed": true, + "elem": { + "delete_script": { + "name": "delete_script", + "type": "TypeString", + "description": "Optional script that if run will remove the installed version.", + "computed": true + }, + "instructions": { + "name": "instructions", + "type": "TypeString", + "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", + "computed": true + }, + "instructions_i18n": { + "name": "instructions_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "scope": { + "name": "scope", + "type": "TypeString", + "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", + "computed": true + }, + "script": { + "name": "script", + "type": "TypeString", + "description": "Optional script that needs to be run post any pre-condition script.", + "computed": true + }, + "script_permission": { + "name": "script_permission", + "type": "TypeString", + "description": "Optional iam permissions that are required on the target cluster to run this script.", + "computed": true + } + } + }, + { + "name": "licenses", + "type": "TypeList", + "description": "List of licenses the product was built with.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "License description.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "License ID.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "license name.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "type of license e.g., Apache xxx.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL for the license text.", + "computed": true + } + } + }, + { + "name": "whitelisted_accounts", + "type": "TypeList", + "description": "Whitelisted accounts for version.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "deprecated", + "type": "TypeBool", + "description": "read only field, indicating if this version is deprecated.", + "computed": true + }, + { + "name": "version_loc_id", + "type": "TypeString", + "description": "A dotted value of `catalogID`.`versionID`.", + "required": true + }, + { + "name": "rev", + "type": "TypeString", + "description": "Cloudant revision.", + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Version of content type.", + "computed": true + }, + { + "name": "offering_id", + "type": "TypeString", + "description": "Offering ID.", + "computed": true + }, + { + "name": "kind_id", + "type": "TypeString", + "description": "Kind ID.", + "computed": true + }, + { + "name": "repo_url", + "type": "TypeString", + "description": "Content's repo URL.", + "computed": true + }, + { + "name": "single_instance", + "type": "TypeBool", + "description": "Denotes if single instance can be deployed to a given cluster.", + "computed": true + }, + { + "name": "long_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "tgz_url", + "type": "TypeString", + "description": "File used to on-board this version.", + "computed": true + }, + { + "name": "metadata", + "type": "TypeList", + "description": "Generic data to be included with content being onboarded. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "end_deploy_time": { + "name": "end_deploy_time", + "type": "TypeString", + "description": "The time validation ended.", + "computed": true + }, + "est_deploy_time": { + "name": "est_deploy_time", + "type": "TypeFloat", + "description": "The estimated time validation takes.", + "computed": true + }, + "example_name": { + "name": "example_name", + "type": "TypeString", + "description": "Working directory of source files.", + "computed": true + }, + "file": { + "name": "file", + "type": "TypeList", + "description": "Details for the stored image file. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "size": { + "name": "size", + "type": "TypeInt", + "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "images": { + "name": "images", + "type": "TypeList", + "description": "Image operating system. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "minimum_provisioned_size": { + "name": "minimum_provisioned_size", + "type": "TypeInt", + "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", + "computed": true + }, + "modules": { + "name": "modules", + "type": "TypeList", + "description": "Terraform modules.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the module.", + "computed": true + }, + "offering_reference": { + "name": "offering_reference", + "type": "TypeList", + "description": "Terraform modules.", + "computed": true, + "elem": { + "catalog_id": { + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog ID of the module reference.", + "computed": true + }, + "flavor": { + "name": "flavor", + "type": "TypeString", + "description": "Flavor of the module.", + "computed": true + }, + "flavors": { + "name": "flavors", + "type": "TypeList", + "description": "Flavors of the module.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the offering module.", + "computed": true + }, + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Kind of the offeringmodule.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeString", + "description": "Metadata of the module.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the offering module.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Version of the offering module.", + "computed": true + } + } + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of the module.", + "computed": true + } + } + }, + "operating_system": { + "name": "operating_system", + "type": "TypeList", + "description": "Operating system included in this image. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "Operating system architecture. Required for virtual server image for VPC.", + "computed": true + }, + "dedicated_host_only": { + "name": "dedicated_host_only", + "type": "TypeBool", + "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", + "computed": true + }, + "display_name": { + "name": "display_name", + "type": "TypeString", + "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "family": { + "name": "family", + "type": "TypeString", + "description": "Software family for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "URL for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Globally unique name for this operating system Required for virtual server image for VPC.", + "computed": true + }, + "vendor": { + "name": "vendor", + "type": "TypeString", + "description": "Vendor of the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Major release version of this operating system. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "source_url": { + "name": "source_url", + "type": "TypeString", + "description": "Version source URL.", + "computed": true + }, + "start_deploy_time": { + "name": "start_deploy_time", + "type": "TypeString", + "description": "The time validation started.", + "computed": true + }, + "terraform_version": { + "name": "terraform_version", + "type": "TypeString", + "description": "Terraform version.", + "computed": true + }, + "usage": { + "name": "usage", + "type": "TypeString", + "description": "Usage text for the version.", + "computed": true + }, + "usage_template": { + "name": "usage_template", + "type": "TypeString", + "description": "Usage text for the version.", + "computed": true + }, + "validated_terraform_version": { + "name": "validated_terraform_version", + "type": "TypeString", + "description": "Version name.", + "computed": true + }, + "version_name": { + "name": "version_name", + "type": "TypeString", + "description": "Version name.", + "computed": true + }, + "vsi_vpc": { + "name": "vsi_vpc", + "type": "TypeList", + "description": "VSI VPC version information", + "computed": true, + "elem": { + "file": { + "name": "file", + "type": "TypeList", + "description": "Details for the stored image file. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "size": { + "name": "size", + "type": "TypeInt", + "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "images": { + "name": "images", + "type": "TypeList", + "description": "Image operating system. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "minimum_provisioned_size": { + "name": "minimum_provisioned_size", + "type": "TypeInt", + "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", + "computed": true + }, + "operating_system": { + "name": "operating_system", + "type": "TypeList", + "description": "Operating system included in this image. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "Operating system architecture. Required for virtual server image for VPC.", + "computed": true + }, + "dedicated_host_only": { + "name": "dedicated_host_only", + "type": "TypeBool", + "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", + "computed": true + }, + "display_name": { + "name": "display_name", + "type": "TypeString", + "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "family": { + "name": "family", + "type": "TypeString", + "description": "Software family for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "URL for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Globally unique name for this operating system Required for virtual server image for VPC.", + "computed": true + }, + "vendor": { + "name": "vendor", + "type": "TypeString", + "description": "Vendor of the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Major release version of this operating system. Required for virtual server image for VPC.", + "computed": true + } + } + } + } + }, + "working_directory": { + "name": "working_directory", + "type": "TypeString", + "description": "Working directory of source files.", + "computed": true + } + } + }, + { + "name": "required_resources", + "type": "TypeList", + "description": "Resource requirments for installation.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of requirement.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "mem, disk, cores, and nodes can be parsed as an int. targetVersion will be a semver range value.", + "computed": true + } + } + }, + { + "name": "solution_info", + "type": "TypeList", + "description": "Version Solution Information. Only supported for Product kind Solution.", + "computed": true, + "elem": { + "architecture_diagrams": { + "name": "architecture_diagrams", + "type": "TypeList", + "description": "Architecture diagrams for this solution.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of this diagram.", + "computed": true + }, + "description_i18n": { + "name": "description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "diagram": { + "name": "diagram", + "type": "TypeList", + "description": "Offering Media information.", + "computed": true, + "elem": { + "api_url": { + "name": "api_url", + "type": "TypeString", + "description": "CM API specific URL of the specified media item.", + "computed": true + }, + "caption": { + "name": "caption", + "type": "TypeString", + "description": "Caption for this media item.", + "computed": true + }, + "caption_i18n": { + "name": "caption_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "thumbnail_url": { + "name": "thumbnail_url", + "type": "TypeString", + "description": "Thumbnail URL for this media item.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of this media item.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item.", + "computed": true + }, + "url_proxy": { + "name": "url_proxy", + "type": "TypeList", + "description": "Offering URL proxy information.", + "computed": true, + "elem": { + "sha": { + "name": "sha", + "type": "TypeString", + "description": "SHA256 fingerprint of image.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item being proxied.", + "computed": true + } + } + } + } + } + } + }, + "cost_estimate": { + "name": "cost_estimate", + "type": "TypeList", + "description": "Cost estimate definition.", + "computed": true, + "elem": { + "currency": { + "name": "currency", + "type": "TypeString", + "description": "Cost estimate currency.", + "computed": true + }, + "diff_total_hourly_cost": { + "name": "diff_total_hourly_cost", + "type": "TypeString", + "description": "Difference in total hourly cost.", + "computed": true + }, + "diff_total_monthly_cost": { + "name": "diff_total_monthly_cost", + "type": "TypeString", + "description": "Difference in total monthly cost.", + "computed": true + }, + "past_total_hourly_cost": { + "name": "past_total_hourly_cost", + "type": "TypeString", + "description": "Past total hourly cost.", + "computed": true + }, + "past_total_monthly_cost": { + "name": "past_total_monthly_cost", + "type": "TypeString", + "description": "Past total monthly cost.", + "computed": true + }, + "projects": { + "name": "projects", + "type": "TypeList", + "description": "Cost estimate projects.", + "computed": true, + "elem": { + "breakdown": { + "name": "breakdown", + "type": "TypeList", + "description": "Cost breakdown definition.", + "computed": true, + "elem": { + "resources": { + "name": "resources", + "type": "TypeList", + "description": "Resources.", + "computed": true, + "elem": { + "cost_components": { + "name": "cost_components", + "type": "TypeList", + "description": "Cost components.", + "computed": true, + "elem": { + "hourly_cost": { + "name": "hourly_cost", + "type": "TypeString", + "description": "Cost component hourly cost.", + "computed": true + }, "hourly_quantity": { "name": "hourly_quantity", "type": "TypeString", @@ -15479,606 +16463,195 @@ "computed": true }, { - "name": "metadata", + "name": "crn", + "type": "TypeString", + "description": "Version's CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog ID.", + "computed": true + }, + { + "name": "package_version", + "type": "TypeString", + "description": "Version of the package used to create this version.", + "computed": true + }, + { + "name": "image_pull_key_name", + "type": "TypeString", + "description": "ID of the image pull key to use from Offering.ImagePullKeys.", + "computed": true + }, + { + "name": "deprecate_pending", "type": "TypeList", - "description": "Generic data to be included with content being onboarded. Required for virtual server image for VPC.", + "description": "Deprecation information for an Offering.", "computed": true, "elem": { - "end_deploy_time": { - "name": "end_deploy_time", + "deprecate_date": { + "name": "deprecate_date", "type": "TypeString", - "description": "The time validation ended.", + "description": "Date of deprecation.", "computed": true }, - "est_deploy_time": { - "name": "est_deploy_time", - "type": "TypeFloat", - "description": "The estimated time validation takes.", + "deprecate_state": { + "name": "deprecate_state", + "type": "TypeString", + "description": "Deprecation state.", "computed": true }, - "example_name": { - "name": "example_name", + "description": { + "name": "description", "type": "TypeString", - "description": "Working directory of source files.", + "computed": true + } + } + }, + { + "name": "is_consumable", + "type": "TypeBool", + "description": "Is the version able to be shared.", + "computed": true + }, + { + "name": "sha", + "type": "TypeString", + "description": "hash of the content.", + "computed": true + }, + { + "name": "updated", + "type": "TypeString", + "description": "The date and time this version was last updated.", + "computed": true + }, + { + "name": "validation", + "type": "TypeList", + "description": "Validation response.", + "computed": true, + "elem": { + "last_operation": { + "name": "last_operation", + "type": "TypeString", + "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", "computed": true }, - "file": { - "name": "file", - "type": "TypeList", - "description": "Details for the stored image file. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "size": { - "name": "size", - "type": "TypeInt", - "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", - "computed": true - } - } - }, - "images": { - "name": "images", - "type": "TypeList", - "description": "Image operating system. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", - "computed": true - } - } + "message": { + "name": "message", + "type": "TypeString", + "description": "Any message needing to be conveyed as part of the validation job.", + "computed": true }, - "minimum_provisioned_size": { - "name": "minimum_provisioned_size", - "type": "TypeInt", - "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", + "requested": { + "name": "requested", + "type": "TypeString", + "description": "Date and time of last validation was requested.", "computed": true }, - "modules": { - "name": "modules", - "type": "TypeList", - "description": "Terraform modules.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the module.", - "computed": true - }, - "offering_reference": { - "name": "offering_reference", - "type": "TypeList", - "description": "Terraform modules.", - "computed": true, - "elem": { - "catalog_id": { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog ID of the module reference.", - "computed": true - }, - "flavor": { - "name": "flavor", - "type": "TypeString", - "description": "Flavor of the module.", - "computed": true - }, - "flavors": { - "name": "flavors", - "type": "TypeList", - "description": "Flavors of the module.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of the offering module.", - "computed": true - }, - "kind": { - "name": "kind", - "type": "TypeString", - "description": "Kind of the offeringmodule.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeString", - "description": "Metadata of the module.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the offering module.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Version of the offering module.", - "computed": true - } - } - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of the module.", - "computed": true - } - } + "state": { + "name": "state", + "type": "TypeString", + "description": "Current validation state - \u003cempty\u003e, in_progress, valid, invalid, expired.", + "computed": true }, - "operating_system": { - "name": "operating_system", - "type": "TypeList", - "description": "Operating system included in this image. Required for virtual server image for VPC.", + "target": { + "name": "target", + "type": "TypeMap", + "description": "Validation target information (e.g. cluster_id, region, namespace, etc). Values will vary by Content type.", "computed": true, "elem": { - "architecture": { - "name": "architecture", - "type": "TypeString", - "description": "Operating system architecture. Required for virtual server image for VPC.", - "computed": true - }, - "dedicated_host_only": { - "name": "dedicated_host_only", - "type": "TypeBool", - "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", - "computed": true - }, - "display_name": { - "name": "display_name", - "type": "TypeString", - "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "family": { - "name": "family", - "type": "TypeString", - "description": "Software family for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "URL for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Globally unique name for this operating system Required for virtual server image for VPC.", - "computed": true - }, - "vendor": { - "name": "vendor", - "type": "TypeString", - "description": "Vendor of the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Major release version of this operating system. Required for virtual server image for VPC.", - "computed": true - } + "type": "TypeString" } }, - "source_url": { - "name": "source_url", + "validated": { + "name": "validated", "type": "TypeString", - "description": "Version source URL.", + "description": "Date and time of last successful validation.", "computed": true - }, - "start_deploy_time": { - "name": "start_deploy_time", + } + } + }, + { + "name": "install", + "type": "TypeList", + "description": "Script information.", + "computed": true, + "elem": { + "delete_script": { + "name": "delete_script", "type": "TypeString", - "description": "The time validation started.", + "description": "Optional script that if run will remove the installed version.", "computed": true }, - "terraform_version": { - "name": "terraform_version", + "instructions": { + "name": "instructions", "type": "TypeString", - "description": "Terraform version.", - "computed": true - }, - "usage": { - "name": "usage", - "type": "TypeString", - "description": "Usage text for the version.", - "computed": true - }, - "usage_template": { - "name": "usage_template", - "type": "TypeString", - "description": "Usage text for the version.", - "computed": true - }, - "validated_terraform_version": { - "name": "validated_terraform_version", - "type": "TypeString", - "description": "Version name.", - "computed": true - }, - "version_name": { - "name": "version_name", - "type": "TypeString", - "description": "Version name.", - "computed": true - }, - "vsi_vpc": { - "name": "vsi_vpc", - "type": "TypeList", - "description": "VSI VPC version information", - "computed": true, - "elem": { - "file": { - "name": "file", - "type": "TypeList", - "description": "Details for the stored image file. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "size": { - "name": "size", - "type": "TypeInt", - "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", - "computed": true - } - } - }, - "images": { - "name": "images", - "type": "TypeList", - "description": "Image operating system. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", - "computed": true - } - } - }, - "minimum_provisioned_size": { - "name": "minimum_provisioned_size", - "type": "TypeInt", - "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", - "computed": true - }, - "operating_system": { - "name": "operating_system", - "type": "TypeList", - "description": "Operating system included in this image. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "architecture": { - "name": "architecture", - "type": "TypeString", - "description": "Operating system architecture. Required for virtual server image for VPC.", - "computed": true - }, - "dedicated_host_only": { - "name": "dedicated_host_only", - "type": "TypeBool", - "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", - "computed": true - }, - "display_name": { - "name": "display_name", - "type": "TypeString", - "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "family": { - "name": "family", - "type": "TypeString", - "description": "Software family for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "URL for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Globally unique name for this operating system Required for virtual server image for VPC.", - "computed": true - }, - "vendor": { - "name": "vendor", - "type": "TypeString", - "description": "Vendor of the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Major release version of this operating system. Required for virtual server image for VPC.", - "computed": true - } - } - } - } - }, - "working_directory": { - "name": "working_directory", - "type": "TypeString", - "description": "Working directory of source files.", - "computed": true - } - } - }, - { - "name": "validation", - "type": "TypeList", - "description": "Validation response.", - "computed": true, - "elem": { - "last_operation": { - "name": "last_operation", - "type": "TypeString", - "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "Any message needing to be conveyed as part of the validation job.", - "computed": true - }, - "requested": { - "name": "requested", - "type": "TypeString", - "description": "Date and time of last validation was requested.", - "computed": true - }, - "state": { - "name": "state", - "type": "TypeString", - "description": "Current validation state - \u003cempty\u003e, in_progress, valid, invalid, expired.", + "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", "computed": true }, - "target": { - "name": "target", + "instructions_i18n": { + "name": "instructions_i18n", "type": "TypeMap", - "description": "Validation target information (e.g. cluster_id, region, namespace, etc). Values will vary by Content type.", + "description": "A map of translated strings, by language code.", "computed": true, "elem": { "type": "TypeString" } }, - "validated": { - "name": "validated", - "type": "TypeString", - "description": "Date and time of last successful validation.", - "computed": true - } - } - }, - { - "name": "long_description", - "type": "TypeString", - "description": "Long description for version.", - "computed": true - }, - { - "name": "single_instance", - "type": "TypeBool", - "description": "Denotes if single instance can be deployed to a given cluster.", - "computed": true - }, - { - "name": "long_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "deprecate_pending", - "type": "TypeList", - "description": "Deprecation information for an Offering.", - "computed": true, - "elem": { - "deprecate_date": { - "name": "deprecate_date", + "scope": { + "name": "scope", "type": "TypeString", - "description": "Date of deprecation.", + "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", "computed": true }, - "deprecate_state": { - "name": "deprecate_state", + "script": { + "name": "script", "type": "TypeString", - "description": "Deprecation state.", + "description": "Optional script that needs to be run post any pre-condition script.", "computed": true }, - "description": { - "name": "description", + "script_permission": { + "name": "script_permission", "type": "TypeString", + "description": "Optional iam permissions that are required on the target cluster to run this script.", "computed": true } } }, { - "name": "catalog_id", + "name": "image_manifest_url", "type": "TypeString", - "description": "Catalog ID.", + "description": "If set, denotes a url to a YAML file with list of container images used by this version.", "computed": true }, { - "name": "repo_url", + "name": "long_description", "type": "TypeString", - "description": "Content's repo URL.", + "description": "Long description for version.", "computed": true }, { - "name": "outputs", - "type": "TypeList", - "description": "List of output values for this version.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Output description.", - "computed": true - }, - "key": { - "name": "key", - "type": "TypeString", - "description": "Output key.", - "computed": true - } - } - }, - { - "name": "iam_permissions", + "name": "tags", "type": "TypeList", - "description": "List of IAM permissions that are required to consume this version.", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", "computed": true, "elem": { - "resources": { - "name": "resources", - "type": "TypeList", - "description": "Resources for this permission.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Resource description.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Resource name.", - "computed": true - }, - "role_crns": { - "name": "role_crns", - "type": "TypeList", - "description": "Role CRNs for this permission.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - "role_crns": { - "name": "role_crns", - "type": "TypeList", - "description": "Role CRNs for this permission.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "service_name": { - "name": "service_name", - "type": "TypeString", - "description": "Service name.", - "computed": true - } + "type": "TypeString" } }, { - "name": "sha", - "type": "TypeString", - "description": "hash of the content.", - "computed": true - }, - { - "name": "updated", + "name": "source_url", "type": "TypeString", - "description": "The date and time this version was last updated.", + "description": "Content's source URL (e.g git repo).", "computed": true }, - { - "name": "install", - "type": "TypeList", - "description": "Script information.", - "computed": true, - "elem": { - "delete_script": { - "name": "delete_script", - "type": "TypeString", - "description": "Optional script that if run will remove the installed version.", - "computed": true - }, - "instructions": { - "name": "instructions", - "type": "TypeString", - "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", - "computed": true - }, - "instructions_i18n": { - "name": "instructions_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "scope": { - "name": "scope", - "type": "TypeString", - "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", - "computed": true - }, - "script": { - "name": "script", - "type": "TypeString", - "description": "Optional script that needs to be run post any pre-condition script.", - "computed": true - }, - "script_permission": { - "name": "script_permission", - "type": "TypeString", - "description": "Optional iam permissions that are required on the target cluster to run this script.", - "computed": true - } - } - }, { "name": "entitlement", "type": "TypeList", @@ -16120,337 +16693,163 @@ } } }, - { - "name": "deprecated", - "type": "TypeBool", - "description": "read only field, indicating if this version is deprecated.", - "computed": true - }, { "name": "version_locator", "type": "TypeString", "description": "A dotted value of `catalogID`.`versionID`.", "computed": true - }, - { - "name": "created", - "type": "TypeString", - "description": "The date and time this version was created.", - "computed": true - }, - { - "name": "offering_id", - "type": "TypeString", - "description": "Offering ID.", - "computed": true - }, + } + ], + "ibm_code_engine_app": [ { - "name": "kind_id", - "type": "TypeString", - "description": "Kind ID.", + "name": "run_as_user", + "type": "TypeInt", + "description": "Optional user ID (UID) to run the app (e.g., `1001`).", "computed": true }, { - "name": "tags", + "name": "run_commands", "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", + "description": "Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "whitelisted_accounts", - "type": "TypeList", - "description": "Whitelisted accounts for version.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "scale_min_instances", + "type": "TypeInt", + "description": "Optional minimum number of instances for this app. If you set this value to `0`, the app will scale down to zero, if not hit by any request for some time.", + "computed": true }, { - "name": "version_loc_id", + "name": "app_id", "type": "TypeString", - "description": "A dotted value of `catalogID`.`versionID`.", - "required": true + "description": "The identifier of the resource.", + "computed": true }, { - "name": "source_url", + "name": "image_secret", "type": "TypeString", - "description": "Content's source URL (e.g git repo).", + "description": "Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.", "computed": true }, { - "name": "image_manifest_url", + "name": "project_id", "type": "TypeString", - "description": "If set, denotes a url to a YAML file with list of container images used by this version.", + "description": "The ID of the project.", + "required": true + }, + { + "name": "scale_request_timeout", + "type": "TypeInt", + "description": "Optional amount of time in seconds that is allowed for a running app to respond to a request.", "computed": true }, { - "name": "image_pull_key_name", + "name": "image_reference", "type": "TypeString", - "description": "ID of the image pull key to use from Offering.ImagePullKeys.", + "description": "The name of the image that is used for this app. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY` and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the default is `latest`. If the image reference points to a registry that requires authentication, make sure to also specify the property `image_secret`.", "computed": true }, { - "name": "licenses", + "name": "run_env_variables", "type": "TypeList", - "description": "List of licenses the product was built with.", + "description": "References to config maps, secrets or literal values, which are exposed as environment variables in the application.", "computed": true, "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "License description.", - "computed": true - }, - "id": { - "name": "id", + "key": { + "name": "key", "type": "TypeString", - "description": "License ID.", + "description": "The key to reference as environment variable.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "license name.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "type of license e.g., Apache xxx.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL for the license text.", - "computed": true - } - } - }, - { - "name": "state", - "type": "TypeList", - "description": "Offering state.", - "computed": true, - "elem": { - "current": { - "name": "current", - "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", + "description": "The name of the environment variable.", "computed": true }, - "current_entered": { - "name": "current_entered", + "prefix": { + "name": "prefix", "type": "TypeString", - "description": "Date and time of current request.", + "description": "A prefix that can be added to all keys of a full secret or config map reference.", "computed": true }, - "pending": { - "name": "pending", + "reference": { + "name": "reference", "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", + "description": "The name of the secret or config map.", "computed": true }, - "pending_requested": { - "name": "pending_requested", + "type": { + "name": "type", "type": "TypeString", - "description": "Date and time of pending request.", + "description": "Specify the type of the environment variable.", "computed": true }, - "previous": { - "name": "previous", + "value": { + "name": "value", "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", + "description": "The literal value of the environment variable.", "computed": true } } }, { - "name": "is_consumable", - "type": "TypeBool", - "description": "Is the version able to be shared.", - "computed": true - }, - { - "name": "rev", + "name": "name", "type": "TypeString", - "description": "Cloudant revision.", - "computed": true + "description": "The name of your application.", + "required": true }, { - "name": "tgz_url", - "type": "TypeString", - "description": "File used to on-board this version.", + "name": "image_port", + "type": "TypeInt", + "description": "Optional port the app listens on. While the app will always be exposed via port `443` for end users, this port is used to connect to the port that is exposed by the container image.", "computed": true }, { - "name": "configuration", + "name": "run_volume_mounts", "type": "TypeList", - "description": "List of user solicited overrides.", + "description": "Mounts of config maps or secrets.", "computed": true, "elem": { - "custom_config": { - "name": "custom_config", - "type": "TypeList", - "description": "Render type.", - "computed": true, - "elem": { - "associations": { - "name": "associations", - "type": "TypeList", - "description": "List of parameters that are associated with this configuration.", - "computed": true, - "elem": { - "parameters": { - "name": "parameters", - "type": "TypeList", - "description": "Parameters for this association.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of this parameter.", - "computed": true - }, - "options_refresh": { - "name": "options_refresh", - "type": "TypeBool", - "description": "Refresh options.", - "computed": true - } - } - } - } - }, - "config_constraints": { - "name": "config_constraints", - "type": "TypeMap", - "description": "Map of constraint parameters that will be passed to the custom widget.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "grouping": { - "name": "grouping", - "type": "TypeString", - "description": "Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment).", - "computed": true - }, - "grouping_index": { - "name": "grouping_index", - "type": "TypeInt", - "description": "Determines the order that this configuration item shows in that particular grouping.", - "computed": true - }, - "original_grouping": { - "name": "original_grouping", - "type": "TypeString", - "description": "Original grouping type for this configuration (3 types - Target, Resource, and Deployment).", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "ID of the widget type.", - "computed": true - } - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "The default value as a JSON encoded string. To use a secret when the type is password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`.", - "computed": true - }, - "description": { - "name": "description", + "mount_path": { + "name": "mount_path", "type": "TypeString", - "description": "Key description.", + "description": "The path that should be mounted.", "computed": true }, - "display_name": { - "name": "display_name", + "name": { + "name": "name", "type": "TypeString", - "description": "Display name for configuration type.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "Hide values.", + "description": "The name of the mount.", "computed": true }, - "key": { - "name": "key", + "reference": { + "name": "reference", "type": "TypeString", - "description": "Configuration key.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of options of type.", - "computed": true, - "elem": { - "type": "TypeMap" - } - }, - "required": { - "name": "required", - "type": "TypeBool", - "description": "Is key required to install.", + "description": "The name of the referenced secret or config map.", "computed": true }, "type": { "name": "type", "type": "TypeString", - "description": "Value type (string, boolean, int).", - "computed": true - }, - "type_metadata": { - "name": "type_metadata", - "type": "TypeString", - "description": "The original type, as found in the source being onboarded.", - "computed": true - }, - "value_constraint": { - "name": "value_constraint", - "type": "TypeString", - "description": "Constraint associated with value, e.g., for string type - regx:[a-z].", + "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", "computed": true } } - } - ], - "ibm_code_engine_app": [ - { - "name": "endpoint_internal", - "type": "TypeString", - "description": "URL to app that is only visible within the project.", - "computed": true - }, - { - "name": "image_secret", - "type": "TypeString", - "description": "Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.", - "computed": true }, { - "name": "scale_min_instances", + "name": "scale_concurrency", "type": "TypeInt", - "description": "Optional minimum number of instances for this app. If you set this value to `0`, the app will scale down to zero, if not hit by any request for some time.", + "description": "Optional maximum number of requests that can be processed concurrently per instance.", "computed": true }, { - "name": "resource_type", + "name": "endpoint_internal", "type": "TypeString", - "description": "The type of the app.", + "description": "URL to app that is only visible within the project.", "computed": true }, { @@ -16463,9 +16862,9 @@ } }, { - "name": "run_as_user", - "type": "TypeInt", - "description": "Optional user ID (UID) to run the app (e.g., `1001`).", + "name": "scale_memory_limit", + "type": "TypeString", + "description": "Optional amount of memory set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", "computed": true }, { @@ -16475,71 +16874,33 @@ "computed": true }, { - "name": "scale_ephemeral_storage_limit", + "name": "scale_cpu_limit", "type": "TypeString", - "description": "Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "description": "Optional number of CPU set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", "computed": true }, { - "name": "scale_memory_limit", + "name": "managed_domain_mappings", "type": "TypeString", - "description": "Optional amount of memory set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "description": "Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.", "computed": true }, { - "name": "project_id", - "type": "TypeString", - "description": "The ID of the project.", - "required": true + "name": "scale_initial_instances", + "type": "TypeInt", + "description": "Optional initial number of instances that are created upon app creation or app update.", + "computed": true }, { - "name": "run_env_variables", - "type": "TypeList", - "description": "References to config maps, secrets or literal values, which are exposed as environment variables in the application.", - "computed": true, - "elem": { - "key": { - "name": "key", - "type": "TypeString", - "description": "The key to reference as environment variable.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of the environment variable.", - "computed": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "A prefix that can be added to all keys of a full secret or config map reference.", - "computed": true - }, - "reference": { - "name": "reference", - "type": "TypeString", - "description": "The name of the secret or config map.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Specify the type of the environment variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The literal value of the environment variable.", - "computed": true - } - } + "name": "run_service_account", + "type": "TypeString", + "description": "Optional name of the service account. For built-in service accounts, you can use the shortened names `manager` , `none`, `reader`, and `writer`.", + "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "The current status of the app.", + "name": "scale_max_instances", + "type": "TypeInt", + "description": "Optional maximum number of instances for this app. If you set this value to `0`, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See [Limits and quotas for Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-limits).", "computed": true }, { @@ -16574,65 +16935,6 @@ "description": "The timestamp when the resource was created.", "computed": true }, - { - "name": "endpoint", - "type": "TypeString", - "description": "Optional URL to invoke app. Depending on visibility this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.", - "computed": true - }, - { - "name": "app_id", - "type": "TypeString", - "description": "The identifier of the resource.", - "computed": true - }, - { - "name": "run_commands", - "type": "TypeList", - "description": "Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "run_volume_mounts", - "type": "TypeList", - "description": "Mounts of config maps or secrets.", - "computed": true, - "elem": { - "mount_path": { - "name": "mount_path", - "type": "TypeString", - "description": "The path that should be mounted.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of the mount.", - "computed": true - }, - "reference": { - "name": "reference", - "type": "TypeString", - "description": "The name of the referenced secret or config map.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", - "computed": true - } - } - }, - { - "name": "scale_request_timeout", - "type": "TypeInt", - "description": "Optional amount of time in seconds that is allowed for a running app to respond to a request.", - "computed": true - }, { "name": "entity_tag", "type": "TypeString", @@ -16640,79 +16942,37 @@ "computed": true }, { - "name": "href", + "name": "resource_type", "type": "TypeString", - "description": "When you provision a new app, a URL is created identifying the location of the instance.", + "description": "The type of the app.", "computed": true }, { - "name": "image_reference", + "name": "scale_ephemeral_storage_limit", "type": "TypeString", - "description": "The name of the image that is used for this app. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY` and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the default is `latest`. If the image reference points to a registry that requires authentication, make sure to also specify the property `image_secret`.", + "description": "Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", "computed": true }, { - "name": "scale_cpu_limit", + "name": "status", "type": "TypeString", - "description": "Optional number of CPU set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", - "computed": true - }, - { - "name": "scale_max_instances", - "type": "TypeInt", - "description": "Optional maximum number of instances for this app. If you set this value to `0`, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See [Limits and quotas for Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-limits).", - "computed": true - }, - { - "name": "image_port", - "type": "TypeInt", - "description": "Optional port the app listens on. While the app will always be exposed via port `443` for end users, this port is used to connect to the port that is exposed by the container image.", + "description": "The current status of the app.", "computed": true }, { - "name": "run_service_account", + "name": "endpoint", "type": "TypeString", - "description": "Optional name of the service account. For built-in service accounts, you can use the shortened names `manager` , `none`, `reader`, and `writer`.", - "computed": true - }, - { - "name": "scale_concurrency", - "type": "TypeInt", - "description": "Optional maximum number of requests that can be processed concurrently per instance.", + "description": "Optional URL to invoke app. Depending on visibility this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of your application.", - "required": true - }, - { - "name": "managed_domain_mappings", + "name": "href", "type": "TypeString", - "description": "Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.", - "computed": true - }, - { - "name": "scale_initial_instances", - "type": "TypeInt", - "description": "Optional initial number of instances that are created upon app creation or app update.", + "description": "When you provision a new app, a URL is created identifying the location of the instance.", "computed": true } ], "ibm_code_engine_binding": [ - { - "name": "resource_type", - "type": "TypeString", - "description": "The type of the binding.", - "computed": true - }, - { - "name": "secret_name", - "type": "TypeString", - "description": "The service access secret that is bound to a component.", - "computed": true - }, { "name": "status", "type": "TypeString", @@ -16762,61 +17022,43 @@ "type": "TypeString", "description": "The value that is set as prefix in the component that is bound.", "computed": true - } - ], - "ibm_code_engine_build": [ - { - "name": "output_secret", - "type": "TypeString", - "description": "The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.", - "computed": true }, { "name": "resource_type", "type": "TypeString", - "description": "The type of the build.", - "computed": true - }, - { - "name": "source_context_dir", - "type": "TypeString", - "description": "Option directory in the repository that contains the buildpacks file or the Dockerfile.", - "computed": true - }, - { - "name": "strategy_type", - "type": "TypeString", - "description": "The strategy to use for building the image.", + "description": "The type of the binding.", "computed": true }, { - "name": "entity_tag", + "name": "secret_name", "type": "TypeString", - "description": "The version of the build instance, which is used to achieve optimistic locking.", + "description": "The service access secret that is bound to a component.", "computed": true - }, + } + ], + "ibm_code_engine_build": [ { - "name": "created_at", + "name": "source_url", "type": "TypeString", - "description": "The timestamp when the resource was created.", + "description": "The URL of the code repository. This field is required if the `source_type` is `git`. If the `source_type` value is `local`, this field must be omitted. If the repository is publicly available you can provide a 'https' URL like `https://github.com/IBM/CodeEngine`. If the repository requires authentication, you need to provide a 'ssh' URL like `git@github.com:IBM/CodeEngine.git` along with a `source_secret` that points to a secret of format `ssh_auth`.", "computed": true }, { - "name": "href", + "name": "source_context_dir", "type": "TypeString", - "description": "When you provision a new build, a URL is created identifying the location of the instance.", + "description": "Option directory in the repository that contains the buildpacks file or the Dockerfile.", "computed": true }, { - "name": "build_id", + "name": "source_revision", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "Commit, tag, or branch in the source repository to pull. This field is optional if the `source_type` is `git` and uses the HEAD of default branch if not specified. If the `source_type` value is `local`, this field must be omitted.", "computed": true }, { - "name": "source_url", + "name": "status", "type": "TypeString", - "description": "The URL of the code repository. This field is required if the `source_type` is `git`. If the `source_type` value is `local`, this field must be omitted. If the repository is publicly available you can provide a 'https' URL like `https://github.com/IBM/CodeEngine`. If the repository requires authentication, you need to provide a 'ssh' URL like `git@github.com:IBM/CodeEngine.git` along with a `source_secret` that points to a secret of format `ssh_auth`.", + "description": "The current status of the build.", "computed": true }, { @@ -16834,51 +17076,45 @@ } }, { - "name": "strategy_spec_file", + "name": "strategy_size", "type": "TypeString", - "description": "Optional path to the specification file that is used for build strategies for building an image.", + "description": "Optional size for the build, which determines the amount of resources used. Build sizes are `small`, `medium`, `large`, `xlarge`.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of your build.", - "required": true - }, - { - "name": "source_revision", + "name": "created_at", "type": "TypeString", - "description": "Commit, tag, or branch in the source repository to pull. This field is optional if the `source_type` is `git` and uses the HEAD of default branch if not specified. If the `source_type` value is `local`, this field must be omitted.", + "description": "The timestamp when the resource was created.", "computed": true }, { - "name": "source_type", + "name": "build_id", "type": "TypeString", - "description": "Specifies the type of source to determine if your build source is in a repository or based on local source code.* local - For builds from local source code.* git - For builds from git version controlled source code.", + "description": "The identifier of the resource.", "computed": true }, { - "name": "strategy_size", + "name": "resource_type", "type": "TypeString", - "description": "Optional size for the build, which determines the amount of resources used. Build sizes are `small`, `medium`, `large`, `xlarge`.", + "description": "The type of the build.", "computed": true }, { - "name": "output_image", + "name": "source_secret", "type": "TypeString", - "description": "The name of the image.", + "description": "Name of the secret that is used access the repository source. This field is optional if the `source_type` is `git`. Additionally, if the `source_url` points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If the `source_type` value is `local`, this field must be omitted.", "computed": true }, { - "name": "source_secret", + "name": "source_type", "type": "TypeString", - "description": "Name of the secret that is used access the repository source. This field is optional if the `source_type` is `git`. Additionally, if the `source_url` points to a repository that requires authentication, the build will be created but cannot access any source code, until this property is provided, too. If the `source_type` value is `local`, this field must be omitted.", + "description": "Specifies the type of source to determine if your build source is in a repository or based on local source code.* local - For builds from local source code.* git - For builds from git version controlled source code.", "computed": true }, { - "name": "status", + "name": "strategy_spec_file", "type": "TypeString", - "description": "The current status of the build.", + "description": "Optional path to the specification file that is used for build strategies for building an image.", "computed": true }, { @@ -16892,42 +17128,45 @@ "type": "TypeString", "description": "The ID of the project.", "required": true - } - ], - "ibm_code_engine_config_map": [ - { - "name": "data", - "type": "TypeMap", - "description": "The key-value pair for the config map. Values must be specified in `KEY=VALUE` format.", - "computed": true, - "elem": { - "type": "TypeString" - } }, { - "name": "entity_tag", + "name": "output_secret", "type": "TypeString", - "description": "The version of the config map instance, which is used to achieve optimistic locking.", + "description": "The secret that is required to access the image registry. Make sure that the secret is granted with push permissions towards the specified container registry namespace.", "computed": true }, { "name": "href", "type": "TypeString", - "description": "When you provision a new config map, a URL is created identifying the location of the instance.", + "description": "When you provision a new build, a URL is created identifying the location of the instance.", "computed": true }, { - "name": "config_map_id", + "name": "output_image", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "The name of the image.", "computed": true }, { - "name": "resource_type", + "name": "strategy_type", "type": "TypeString", - "description": "The type of the config map.", + "description": "The strategy to use for building the image.", "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The name of your build.", + "required": true + }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "The version of the build instance, which is used to achieve optimistic locking.", + "computed": true + } + ], + "ibm_code_engine_config_map": [ { "name": "project_id", "type": "TypeString", @@ -16945,38 +17184,83 @@ "type": "TypeString", "description": "The timestamp when the resource was created.", "computed": true - } - ], - "ibm_code_engine_job": [ + }, + { + "name": "data", + "type": "TypeMap", + "description": "The key-value pair for the config map. Values must be specified in `KEY=VALUE` format.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "entity_tag", "type": "TypeString", - "description": "The version of the job instance, which is used to achieve optimistic locking.", + "description": "The version of the config map instance, which is used to achieve optimistic locking.", "computed": true }, { "name": "href", "type": "TypeString", - "description": "When you provision a new job, a URL is created identifying the location of the instance.", + "description": "When you provision a new config map, a URL is created identifying the location of the instance.", "computed": true }, { - "name": "run_commands", - "type": "TypeList", - "description": "Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "config_map_id", + "type": "TypeString", + "description": "The identifier of the resource.", + "computed": true }, { - "name": "run_volume_mounts", - "type": "TypeList", - "description": "Optional mounts of config maps or a secrets.", - "computed": true, - "elem": { - "mount_path": { - "name": "mount_path", + "name": "resource_type", + "type": "TypeString", + "description": "The type of the config map.", + "computed": true + } + ], + "ibm_code_engine_job": [ + { + "name": "job_id", + "type": "TypeString", + "description": "The identifier of the resource.", + "computed": true + }, + { + "name": "image_secret", + "type": "TypeString", + "description": "The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.", + "computed": true + }, + { + "name": "run_commands", + "type": "TypeList", + "description": "Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "run_mode", + "type": "TypeString", + "description": "The mode for runs of the job. Valid values are `task` and `daemon`. In `task` mode, the `max_execution_time` and `retry_limit` properties apply. In `daemon` mode, since there is no timeout and failed instances are restarted indefinitely, the `max_execution_time` and `retry_limit` properties are not allowed.", + "computed": true + }, + { + "name": "run_service_account", + "type": "TypeString", + "description": "The name of the service account. For built-in service accounts, you can use the shortened names `manager`, `none`, `reader`, and `writer`. This property must not be set on a job run, which references a job template.", + "computed": true + }, + { + "name": "run_volume_mounts", + "type": "TypeList", + "description": "Optional mounts of config maps or a secrets.", + "computed": true, + "elem": { + "mount_path": { + "name": "mount_path", "type": "TypeString", "description": "The path that should be mounted.", "computed": true @@ -17001,12 +17285,6 @@ } } }, - { - "name": "project_id", - "type": "TypeString", - "description": "The ID of the project.", - "required": true - }, { "name": "created_at", "type": "TypeString", @@ -17014,41 +17292,32 @@ "computed": true }, { - "name": "resource_type", - "type": "TypeString", - "description": "The type of the job.", - "computed": true - }, - { - "name": "scale_array_spec", + "name": "scale_cpu_limit", "type": "TypeString", - "description": "Define a custom set of array indices as comma-separated list containing single values and hyphen-separated ranges like `5,12-14,23,27`. Each instance can pick up its array index via environment variable `JOB_INDEX`. The number of unique array indices specified here determines the number of job instances to run.", + "description": "Optional amount of CPU set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", "computed": true }, { - "name": "scale_memory_limit", + "name": "href", "type": "TypeString", - "description": "Optional amount of memory set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", - "computed": true - }, - { - "name": "scale_retry_limit", - "type": "TypeInt", - "description": "The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if `run_mode` is `task`.", + "description": "When you provision a new job, a URL is created identifying the location of the instance.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "The name of your job.", - "required": true - }, { "name": "image_reference", "type": "TypeString", "description": "The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY` and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the default is `latest`. If the image reference points to a registry that requires authentication, make sure to also specify the property `image_secret`.", "computed": true }, + { + "name": "run_arguments", + "type": "TypeList", + "description": "Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "run_env_variables", "type": "TypeList", @@ -17094,15 +17363,9 @@ } }, { - "name": "run_mode", - "type": "TypeString", - "description": "The mode for runs of the job. Valid values are `task` and `daemon`. In `task` mode, the `max_execution_time` and `retry_limit` properties apply. In `daemon` mode, since there is no timeout and failed instances are restarted indefinitely, the `max_execution_time` and `retry_limit` properties are not allowed.", - "computed": true - }, - { - "name": "run_service_account", + "name": "scale_array_spec", "type": "TypeString", - "description": "The name of the service account. For built-in service accounts, you can use the shortened names `manager`, `none`, `reader`, and `writer`. This property must not be set on a job run, which references a job template.", + "description": "Define a custom set of array indices as comma-separated list containing single values and hyphen-separated ranges like `5,12-14,23,27`. Each instance can pick up its array index via environment variable `JOB_INDEX`. The number of unique array indices specified here determines the number of job instances to run.", "computed": true }, { @@ -17112,69 +17375,60 @@ "computed": true }, { - "name": "scale_max_execution_time", - "type": "TypeInt", - "description": "The maximum execution time in seconds for runs of the job. This property can only be specified if `run_mode` is `task`.", - "computed": true - }, - { - "name": "job_id", + "name": "scale_memory_limit", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "Optional amount of memory set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", "computed": true }, { - "name": "run_as_user", + "name": "scale_retry_limit", "type": "TypeInt", - "description": "The user ID (UID) to run the job (e.g., 1001).", + "description": "The number of times to rerun an instance of the job before the job is marked as failed. This property can only be specified if `run_mode` is `task`.", "computed": true }, { - "name": "scale_cpu_limit", + "name": "project_id", "type": "TypeString", - "description": "Optional amount of CPU set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", - "computed": true + "description": "The ID of the project.", + "required": true }, { - "name": "image_secret", + "name": "name", "type": "TypeString", - "description": "The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.", - "computed": true + "description": "The name of your job.", + "required": true }, { - "name": "run_arguments", - "type": "TypeList", - "description": "Set arguments for the job that are passed to start job run containers. If not specified an empty string array will be applied and the arguments specified by the container image, will be used to start the container.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - ], - "ibm_code_engine_project": [ - { - "name": "account_id", + "name": "entity_tag", "type": "TypeString", - "description": "An alphanumeric value identifying the account ID.", + "description": "The version of the job instance, which is used to achieve optimistic locking.", "computed": true }, { "name": "resource_type", "type": "TypeString", - "description": "The type of the project.", + "description": "The type of the job.", "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "The current state of the project. For example, if the project is created and ready to get used, it will return active.", + "name": "run_as_user", + "type": "TypeInt", + "description": "The user ID (UID) to run the job (e.g., 1001).", "computed": true }, { - "name": "resource_group_id", + "name": "scale_max_execution_time", + "type": "TypeInt", + "description": "The maximum execution time in seconds for runs of the job. This property can only be specified if `run_mode` is `task`.", + "computed": true + } + ], + "ibm_code_engine_project": [ + { + "name": "region", "type": "TypeString", - "description": "The ID of the resource group.", - "cloud_data_type": "resource_group", + "description": "The region for your project deployment. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.", + "cloud_data_type": "region", "computed": true }, { @@ -17184,16 +17438,15 @@ "required": true }, { - "name": "created_at", + "name": "account_id", "type": "TypeString", - "description": "The timestamp when the project was created.", + "description": "An alphanumeric value identifying the account ID.", "computed": true }, { - "name": "crn", + "name": "created_at", "type": "TypeString", - "description": "The CRN of the project.", - "cloud_data_type": "crn", + "description": "The timestamp when the project was created.", "computed": true }, { @@ -17209,39 +17462,43 @@ "computed": true }, { - "name": "region", + "name": "crn", "type": "TypeString", - "description": "The region for your project deployment. Possible values: 'au-syd', 'br-sao', 'ca-tor', 'eu-de', 'eu-gb', 'jp-osa', 'jp-tok', 'us-east', 'us-south'.", - "cloud_data_type": "region", + "description": "The CRN of the project.", + "cloud_data_type": "crn", "computed": true - } - ], - "ibm_code_engine_secret": [ + }, { - "name": "created_at", + "name": "resource_group_id", "type": "TypeString", - "description": "The timestamp when the resource was created.", + "description": "The ID of the resource group.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "href", + "name": "resource_type", "type": "TypeString", - "description": "When you provision a new secret, a URL is created identifying the location of the instance.", + "description": "The type of the project.", "computed": true }, { - "name": "data", - "type": "TypeMap", - "description": "Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters, `-`, `_` or `.` and must not be exceed a max length of 253 characters. Each value field can consists of any character and must not be exceed a max length of 1048576 characters.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "status", + "type": "TypeString", + "description": "The current state of the project. For example, if the project is created and ready to get used, it will return active.", + "computed": true + } + ], + "ibm_code_engine_secret": [ + { + "name": "name", + "type": "TypeString", + "description": "The name of your secret.", + "required": true }, { - "name": "entity_tag", + "name": "created_at", "type": "TypeString", - "description": "The version of the secret instance, which is used to achieve optimistic locking.", + "description": "The timestamp when the resource was created.", "computed": true }, { @@ -17251,15 +17508,15 @@ "computed": true }, { - "name": "secret_id", + "name": "resource_type", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "The type of the secret.", "computed": true }, { - "name": "resource_type", + "name": "secret_id", "type": "TypeString", - "description": "The type of the secret.", + "description": "The identifier of the resource.", "computed": true }, { @@ -17337,53 +17594,52 @@ "required": true }, { - "name": "name", + "name": "data", + "type": "TypeMap", + "description": "Data container that allows to specify config parameters and their values as a key-value map. Each key field must consist of alphanumeric characters, `-`, `_` or `.` and must not be exceed a max length of 253 characters. Each value field can consists of any character and must not be exceed a max length of 1048576 characters.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "entity_tag", "type": "TypeString", - "description": "The name of your secret.", - "required": true + "description": "The version of the secret instance, which is used to achieve optimistic locking.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "When you provision a new secret, a URL is created identifying the location of the instance.", + "computed": true } ], "ibm_compute_bare_metal": [ { - "name": "public_ipv4_address", + "name": "hostname", "type": "TypeString", - "description": "The public IPv4 address of the bare metal server.", + "description": "The hostname of the bare metal server", + "optional": true, "computed": true }, { - "name": "private_subnet", - "type": "TypeInt", - "description": "The private subnet used for the private network interface of the server.", + "name": "private_ipv4_address", + "type": "TypeString", + "description": "The private IPv4 address of the bare metal server.", "computed": true }, { - "name": "os_reference_code", + "name": "datacenter", "type": "TypeString", + "description": "Datacenter in which the bare metal is deployed", "computed": true }, { - "name": "tags", - "type": "TypeList", - "description": "Tags associated with this bare metal server.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "ipv6_address", + "name": "os_reference_code", "type": "TypeString", - "description": "The public IPv6 address of the bare metal server", "computed": true }, - { - "name": "most_recent", - "type": "TypeBool", - "description": "If true and multiple entries are found, the most recently created bare metal is used. If false, an error is returned", - "default_value": false, - "optional": true - }, { "name": "global_identifier", "type": "TypeString", @@ -17392,10 +17648,15 @@ "computed": true }, { - "name": "domain", + "name": "network_speed", + "type": "TypeInt", + "description": "The connection speed, expressed in Mbps, for the server network components.", + "computed": true + }, + { + "name": "public_ipv4_address", "type": "TypeString", - "description": "The domain of the bare metal server", - "optional": true, + "description": "The public IPv4 address of the bare metal server.", "computed": true }, { @@ -17404,74 +17665,80 @@ "computed": true }, { - "name": "redundant_power_supply", - "type": "TypeBool", - "description": "When the value is `true`, it indicates additional power supply is provided.", + "name": "private_vlan_id", + "type": "TypeInt", + "description": "The private VLAN used for the private network interface of the server.", "computed": true }, { - "name": "ipv6_enabled", - "type": "TypeBool", - "description": "Indicates whether the public IPv6 address enabled or not", + "name": "user_metadata", + "type": "TypeString", + "description": "Arbitrary data available to the computing server.", "computed": true }, { - "name": "private_ipv4_address_id", + "name": "memory", "type": "TypeInt", + "description": "The amount of memory in gigabytes, for the server.", "computed": true }, { - "name": "private_network_only", + "name": "unbonded_network", "type": "TypeBool", - "description": "Specifies whether the server only has access to the private network.", + "description": "When the value is `true`, two physical network interfaces are provided without a bonding configuration.", "computed": true }, { - "name": "memory", + "name": "secondary_ip_count", "type": "TypeInt", - "description": "The amount of memory in gigabytes, for the server.", + "description": "The number of secondary IPv4 addresses of the bare metal server.", "computed": true }, { - "name": "block_storage_ids", - "type": "TypeSet", - "description": "Block storage to which this computing server have access.", + "name": "public_vlan_id", + "type": "TypeInt", + "description": "The public VLAN used for the public network interface of the server.", + "computed": true + }, + { + "name": "tags", + "type": "TypeList", + "description": "Tags associated with this bare metal server.", + "cloud_data_type": "tags", "computed": true, "elem": { - "type": "TypeInt" + "type": "TypeString" } }, { - "name": "private_ipv4_address", - "type": "TypeString", - "description": "The private IPv4 address of the bare metal server.", + "name": "ipv6_enabled", + "type": "TypeBool", + "description": "Indicates whether the public IPv6 address enabled or not", "computed": true }, { - "name": "public_subnet", - "type": "TypeInt", - "description": "The public subnet used for the public network interface of the server.", + "name": "ipv6_address", + "type": "TypeString", + "description": "The public IPv6 address of the bare metal server", "computed": true }, { - "name": "redundant_network", + "name": "most_recent", "type": "TypeBool", - "description": "When the value is `true`, two physical network interfaces are provided with a bonding configuration.", - "computed": true + "description": "If true and multiple entries are found, the most recently created bare metal is used. If false, an error is returned", + "default_value": false, + "optional": true }, { - "name": "secondary_ip_addresses", - "type": "TypeList", - "description": "The public secondary IPv4 addresses of the bare metal server.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "domain", + "type": "TypeString", + "description": "The domain of the bare metal server", + "optional": true, + "computed": true }, { - "name": "public_vlan_id", + "name": "private_ipv4_address_id", "type": "TypeInt", - "description": "The public VLAN used for the public network interface of the server.", "computed": true }, { @@ -17481,40 +17748,45 @@ "computed": true }, { - "name": "notes", - "type": "TypeString", - "description": "Notes associated with the server.", + "name": "private_network_only", + "type": "TypeBool", + "description": "Specifies whether the server only has access to the private network.", "computed": true }, { - "name": "hostname", - "type": "TypeString", - "description": "The hostname of the bare metal server", - "optional": true, + "name": "redundant_network", + "type": "TypeBool", + "description": "When the value is `true`, two physical network interfaces are provided with a bonding configuration.", "computed": true }, { - "name": "network_speed", - "type": "TypeInt", - "description": "The connection speed, expressed in Mbps, for the server network components.", - "computed": true + "name": "file_storage_ids", + "type": "TypeSet", + "description": "File storage to which this computing server have access.", + "computed": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "user_metadata", - "type": "TypeString", - "description": "Arbitrary data available to the computing server.", + "name": "ipv6_address_id", + "type": "TypeInt", "computed": true }, { - "name": "ipv6_address_id", + "name": "private_subnet", "type": "TypeInt", + "description": "The private subnet used for the private network interface of the server.", "computed": true }, { - "name": "datacenter", - "type": "TypeString", - "description": "Datacenter in which the bare metal is deployed", - "computed": true + "name": "secondary_ip_addresses", + "type": "TypeList", + "description": "The public secondary IPv4 addresses of the bare metal server.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "public_bandwidth", @@ -17523,48 +17795,63 @@ "computed": true }, { - "name": "private_vlan_id", + "name": "public_subnet", "type": "TypeInt", - "description": "The private VLAN used for the private network interface of the server.", + "description": "The public subnet used for the public network interface of the server.", "computed": true }, { - "name": "unbonded_network", + "name": "notes", + "type": "TypeString", + "description": "Notes associated with the server.", + "computed": true + }, + { + "name": "redundant_power_supply", "type": "TypeBool", - "description": "When the value is `true`, two physical network interfaces are provided without a bonding configuration.", + "description": "When the value is `true`, it indicates additional power supply is provided.", "computed": true }, { - "name": "file_storage_ids", + "name": "block_storage_ids", "type": "TypeSet", - "description": "File storage to which this computing server have access.", + "description": "Block storage to which this computing server have access.", "computed": true, "elem": { "type": "TypeInt" } - }, + } + ], + "ibm_compute_image_template": [ { - "name": "secondary_ip_count", + "name": "id", "type": "TypeInt", - "description": "The number of secondary IPv4 addresses of the bare metal server.", + "description": "The internal id of the image template", "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of this image template", + "required": true } ], - "ibm_compute_image_template": [ + "ibm_compute_placement_group": [ { "name": "name", "type": "TypeString", - "description": "The name of this image template", "required": true }, { - "name": "id", - "type": "TypeInt", - "description": "The internal id of the image template", + "name": "datacenter", + "type": "TypeString", "computed": true - } - ], - "ibm_compute_placement_group": [ + }, + { + "name": "pod", + "type": "TypeString", + "computed": true + }, { "name": "rule", "type": "TypeString", @@ -17591,43 +17878,9 @@ "computed": true } } - }, - { - "name": "name", - "type": "TypeString", - "required": true - }, - { - "name": "datacenter", - "type": "TypeString", - "computed": true - }, - { - "name": "pod", - "type": "TypeString", - "computed": true } ], "ibm_compute_reserved_capacity": [ - { - "name": "most_recent", - "type": "TypeBool", - "description": "If true and multiple entries are found, the most recently created reserved capacity is used. If false, an error is returned", - "default_value": false, - "optional": true - }, - { - "name": "datacenter", - "type": "TypeString", - "description": "Dataceneter name", - "computed": true - }, - { - "name": "pod", - "type": "TypeString", - "description": "Pod name", - "computed": true - }, { "name": "instances", "type": "TypeInt", @@ -17667,15 +17920,28 @@ "type": "TypeString", "description": "Name of reserved instance", "required": true - } - ], - "ibm_compute_ssh_key": [ + }, { - "name": "public_key", + "name": "most_recent", + "type": "TypeBool", + "description": "If true and multiple entries are found, the most recently created reserved capacity is used. If false, an error is returned", + "default_value": false, + "optional": true + }, + { + "name": "datacenter", "type": "TypeString", - "description": "The public ssh key", + "description": "Dataceneter name", "computed": true }, + { + "name": "pod", + "type": "TypeString", + "description": "Pod name", + "computed": true + } + ], + "ibm_compute_ssh_key": [ { "name": "fingerprint", "type": "TypeString", @@ -17700,23 +17966,23 @@ "type": "TypeString", "description": "The label associated with the ssh key", "required": true - } - ], - "ibm_compute_vm_instance": [ + }, { - "name": "public_ipv6_subnet", + "name": "public_key", "type": "TypeString", + "description": "The public ssh key", "computed": true - }, + } + ], + "ibm_compute_vm_instance": [ { - "name": "public_ipv6_subnet_id", - "type": "TypeString", + "name": "private_subnet_id", + "type": "TypeInt", "computed": true }, { - "name": "datacenter", + "name": "public_ipv6_subnet", "type": "TypeString", - "description": "Datacenter in which the virtual guest is deployed", "computed": true }, { @@ -17726,22 +17992,13 @@ "computed": true }, { - "name": "private_subnet_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "ip_address_id_private", - "type": "TypeInt", - "computed": true - }, - { - "name": "ipv4_address", + "name": "power_state", "type": "TypeString", + "description": "The current power state of a virtual guest.", "computed": true }, { - "name": "ip_address_id", + "name": "ip_address_id_private", "type": "TypeInt", "computed": true }, @@ -17751,16 +18008,17 @@ "computed": true }, { - "name": "hostname", + "name": "domain", "type": "TypeString", - "description": "The hostname of the virtual guest", + "description": "The domain of the virtual guest", "required": true }, { - "name": "cores", - "type": "TypeInt", - "description": "Number of cpu cores", - "computed": true + "name": "most_recent", + "type": "TypeBool", + "description": "If true and multiple entries are found, the most recently created virtual guest is used. If false, an error is returned", + "default_value": false, + "optional": true }, { "name": "private_interface_id", @@ -17768,52 +18026,46 @@ "computed": true }, { - "name": "power_state", - "type": "TypeString", - "description": "The current power state of a virtual guest.", + "name": "public_subnet_id", + "type": "TypeInt", "computed": true }, { - "name": "secondary_ip_addresses", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "ipv4_address", + "type": "TypeString", + "computed": true }, { - "name": "secondary_ip_count", + "name": "ip_address_id", "type": "TypeInt", "computed": true }, { - "name": "domain", - "type": "TypeString", - "description": "The domain of the virtual guest", - "required": true + "name": "ipv6_address_id", + "type": "TypeInt", + "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "The VSI status", + "name": "secondary_ip_count", + "type": "TypeInt", "computed": true }, { - "name": "public_interface_id", + "name": "cores", "type": "TypeInt", + "description": "Number of cpu cores", "computed": true }, { - "name": "public_subnet_id", + "name": "public_interface_id", "type": "TypeInt", "computed": true }, { - "name": "most_recent", - "type": "TypeBool", - "description": "If true and multiple entries are found, the most recently created virtual guest is used. If false, an error is returned", - "default_value": false, - "optional": true + "name": "status", + "type": "TypeString", + "description": "The VSI status", + "computed": true }, { "name": "ipv4_address_private", @@ -17821,29 +18073,32 @@ "computed": true }, { - "name": "ipv6_address_id", - "type": "TypeInt", + "name": "public_ipv6_subnet_id", + "type": "TypeString", "computed": true - } - ], - "ibm_container_addons": [ + }, { - "name": "cluster", + "name": "secondary_ip_addresses", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "hostname", "type": "TypeString", - "description": "Cluster Name or ID", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "The hostname of the virtual guest", + "required": true }, { - "name": "resource_group_id", + "name": "datacenter", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", + "description": "Datacenter in which the virtual guest is deployed", "computed": true - }, + } + ], + "ibm_container_addons": [ { "name": "addons", "type": "TypeList", @@ -17920,9 +18175,44 @@ "computed": true } } + }, + { + "name": "cluster", + "type": "TypeString", + "description": "Cluster Name or ID", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "computed": true } ], "ibm_container_alb": [ + { + "name": "user_ip", + "type": "TypeString", + "description": "IP assigned by the user", + "computed": true + }, + { + "name": "enable", + "type": "TypeBool", + "description": "set to true if ALB needs to be enabled", + "computed": true + }, + { + "name": "disable_deployment", + "type": "TypeBool", + "description": "Set to true if ALB needs to be disabled", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -17952,36 +18242,27 @@ "type": "TypeString", "description": "Cluster id", "computed": true - }, + } + ], + "ibm_container_alb_cert": [ { - "name": "user_ip", + "name": "cluster_crn", "type": "TypeString", - "description": "IP assigned by the user", - "computed": true + "description": "cluster CRN", + "computed": true, + "deprecated": "This field is depricated and is not available in v2 version of ingress api" }, { - "name": "enable", - "type": "TypeBool", - "description": "set to true if ALB needs to be enabled", + "name": "cloud_cert_instance_id", + "type": "TypeString", + "description": "cloud cert instance ID", "computed": true }, { - "name": "disable_deployment", - "type": "TypeBool", - "description": "Set to true if ALB needs to be disabled", - "computed": true - } - ], - "ibm_container_alb_cert": [ - { - "name": "cluster_id", + "name": "secret_name", "type": "TypeString", - "description": "Cluster ID", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "Secret name", + "required": true }, { "name": "namespace", @@ -17997,30 +18278,18 @@ "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "Secret Status", - "computed": true - }, - { - "name": "domain_name", + "name": "expires_on", "type": "TypeString", - "description": "Domain name", + "description": "Certificate expaire on date", "computed": true }, { - "name": "cluster_crn", + "name": "issuer_name", "type": "TypeString", - "description": "cluster CRN", + "description": "certificate issuer name", "computed": true, "deprecated": "This field is depricated and is not available in v2 version of ingress api" }, - { - "name": "cloud_cert_instance_id", - "type": "TypeString", - "description": "cloud cert instance ID", - "computed": true - }, { "name": "cert_crn", "type": "TypeString", @@ -18028,32 +18297,29 @@ "computed": true }, { - "name": "secret_name", + "name": "cluster_id", "type": "TypeString", - "description": "Secret name", - "required": true + "description": "Cluster ID", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "expires_on", + "name": "status", "type": "TypeString", - "description": "Certificate expaire on date", + "description": "Secret Status", "computed": true }, { - "name": "issuer_name", + "name": "domain_name", "type": "TypeString", - "description": "certificate issuer name", - "computed": true, - "deprecated": "This field is depricated and is not available in v2 version of ingress api" + "description": "Domain name", + "computed": true } ], "ibm_container_bind_service": [ - { - "name": "service_key_name", - "type": "TypeString", - "description": "Key info", - "computed": true - }, { "name": "cluster_name_id", "type": "TypeString", @@ -18083,14 +18349,103 @@ "type": "TypeString", "description": "namespace ID", "required": true + }, + { + "name": "service_key_name", + "type": "TypeString", + "description": "Key info", + "computed": true } ], "ibm_container_cluster": [ { - "name": "is_trusted", - "type": "TypeBool", + "name": "cluster_name_id", + "type": "TypeString", + "description": "Name or id of the cluster", + "optional": true, + "deprecated": "use name instead" + }, + { + "name": "worker_count", + "type": "TypeInt", + "description": "Number of workers", + "computed": true + }, + { + "name": "albs", + "type": "TypeList", + "computed": true, + "elem": { + "alb_ip": { + "name": "alb_ip", + "type": "TypeString", + "computed": true + }, + "alb_type": { + "name": "alb_type", + "type": "TypeString", + "computed": true + }, + "disable_deployment": { + "name": "disable_deployment", + "type": "TypeBool", + "computed": true + }, + "enable": { + "name": "enable", + "type": "TypeBool", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "computed": true + }, + "num_of_instances": { + "name": "num_of_instances", + "type": "TypeString", + "computed": true + }, + "resize": { + "name": "resize", + "type": "TypeBool", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "computed": true + } + } + }, + { + "name": "ingress_hostname", + "type": "TypeString", + "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "Name or id of the cluster", + "cloud_data_type": "cluster", + "optional": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, { "name": "alb_type", "type": "TypeString", @@ -18098,18 +18453,56 @@ "optional": true }, { - "name": "org_guid", + "name": "private_service_endpoint", + "type": "TypeBool", + "computed": true + }, + { + "name": "resource_controller_url", "type": "TypeString", - "description": "The bluemix organization guid this cluster belongs to", - "optional": true, - "deprecated": "This field is deprecated" + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", + "computed": true }, { - "name": "account_guid", + "name": "public_service_endpoint_url", "type": "TypeString", - "description": "The bluemix account guid this cluster belongs to", - "optional": true, - "deprecated": "This field is deprecated" + "computed": true + }, + { + "name": "server_url", + "type": "TypeString", + "computed": true + }, + { + "name": "list_bounded_services", + "type": "TypeBool", + "description": "If set to false bounded services won't be listed.", + "default_value": true, + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN of resource instance", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "image_security_enforcement", + "type": "TypeBool", + "description": "True if image security enforcement is enabled", + "computed": true + }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, + { + "name": "is_trusted", + "type": "TypeBool", + "computed": true }, { "name": "worker_pools", @@ -18180,6 +18573,33 @@ } } }, + { + "name": "bounded_services", + "type": "TypeSet", + "computed": true, + "elem": { + "namespace": { + "name": "namespace", + "type": "TypeString", + "computed": true + }, + "service_id": { + "name": "service_id", + "type": "TypeString", + "computed": true + }, + "service_key_name": { + "name": "service_key_name", + "type": "TypeString", + "computed": true + }, + "service_name": { + "name": "service_name", + "type": "TypeString", + "computed": true + } + } + }, { "name": "ingress_secret", "type": "TypeString", @@ -18187,12 +18607,18 @@ "computed": true }, { - "name": "space_guid", + "name": "org_guid", "type": "TypeString", - "description": "The bluemix space guid this cluster belongs to", + "description": "The bluemix organization guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, { "name": "region", "type": "TypeString", @@ -18202,11 +18628,6 @@ "computed": true, "deprecated": "This field is deprecated" }, - { - "name": "server_url", - "type": "TypeString", - "computed": true - }, { "name": "api_key_owner_name", "type": "TypeString", @@ -18214,41 +18635,33 @@ "computed": true }, { - "name": "resource_crn", + "name": "api_key_owner_email", "type": "TypeString", - "description": "The crn of the resource", + "description": "email id of the key owner", "computed": true }, { - "name": "name", + "name": "account_guid", "type": "TypeString", - "description": "Name or id of the cluster", - "cloud_data_type": "cluster", + "description": "The bluemix account guid this cluster belongs to", "optional": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "deprecated": "This field is deprecated" }, { - "name": "ingress_hostname", + "name": "private_service_endpoint_url", "type": "TypeString", "computed": true }, { - "name": "public_service_endpoint", - "type": "TypeBool", - "computed": true - }, - { - "name": "api_key_id", + "name": "resource_name", "type": "TypeString", - "description": "ID of APIkey", + "description": "The name of the resource", "computed": true }, { - "name": "resource_name", + "name": "resource_crn", "type": "TypeString", - "description": "The name of the resource", + "description": "The crn of the resource", "computed": true }, { @@ -18260,155 +18673,7 @@ } }, { - "name": "private_service_endpoint", - "type": "TypeBool", - "computed": true - }, - { - "name": "image_security_enforcement", - "type": "TypeBool", - "description": "True if image security enforcement is enabled", - "computed": true - }, - { - "name": "cluster_name_id", - "type": "TypeString", - "description": "Name or id of the cluster", - "optional": true, - "deprecated": "use name instead" - }, - { - "name": "albs", - "type": "TypeList", - "computed": true, - "elem": { - "alb_ip": { - "name": "alb_ip", - "type": "TypeString", - "computed": true - }, - "alb_type": { - "name": "alb_type", - "type": "TypeString", - "computed": true - }, - "disable_deployment": { - "name": "disable_deployment", - "type": "TypeBool", - "computed": true - }, - "enable": { - "name": "enable", - "type": "TypeBool", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "computed": true - }, - "num_of_instances": { - "name": "num_of_instances", - "type": "TypeString", - "computed": true - }, - "resize": { - "name": "resize", - "type": "TypeBool", - "computed": true - }, - "state": { - "name": "state", - "type": "TypeString", - "computed": true - } - } - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "public_service_endpoint_url", - "type": "TypeString", - "computed": true - }, - { - "name": "api_key_owner_email", - "type": "TypeString", - "description": "email id of the key owner", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "list_bounded_services", - "type": "TypeBool", - "description": "If set to false bounded services won't be listed.", - "default_value": true, - "optional": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "worker_count", - "type": "TypeInt", - "description": "Number of workers", - "computed": true - }, - { - "name": "bounded_services", - "type": "TypeSet", - "computed": true, - "elem": { - "namespace": { - "name": "namespace", - "type": "TypeString", - "computed": true - }, - "service_id": { - "name": "service_id", - "type": "TypeString", - "computed": true - }, - "service_key_name": { - "name": "service_key_name", - "type": "TypeString", - "computed": true - }, - "service_name": { - "name": "service_name", - "type": "TypeString", - "computed": true - } - } - }, - { - "name": "vlans", + "name": "vlans", "type": "TypeList", "computed": true, "elem": { @@ -18455,43 +18720,33 @@ } }, { - "name": "private_service_endpoint_url", + "name": "space_guid", "type": "TypeString", + "description": "The bluemix space guid this cluster belongs to", + "optional": true, + "deprecated": "This field is deprecated" + }, + { + "name": "public_service_endpoint", + "type": "TypeBool", "computed": true }, { - "name": "resource_group_name", + "name": "api_key_id", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "ID of APIkey", "computed": true } ], "ibm_container_cluster_config": [ { - "name": "account_guid", + "name": "region", "type": "TypeString", - "description": "The bluemix account guid this cluster belongs to", + "description": "The cluster region", + "cloud_data_type": "region", "optional": true, "deprecated": "This field is deprecated" }, - { - "name": "download", - "type": "TypeBool", - "description": "If set to false will not download the config, otherwise they are downloaded each time but onto the same path for a given cluster name/id", - "default_value": true, - "optional": true - }, - { - "name": "config_file_path", - "type": "TypeString", - "description": "The absolute path to the kubernetes config yml file", - "computed": true - }, - { - "name": "host", - "type": "TypeString", - "computed": true - }, { "name": "resource_group_id", "type": "TypeString", @@ -18499,16 +18754,6 @@ "cloud_data_type": "resource_group", "optional": true }, - { - "name": "cluster_name_id", - "type": "TypeString", - "description": "The name/id of the cluster", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, { "name": "config_dir", "type": "TypeString", @@ -18517,51 +18762,49 @@ "computed": true }, { - "name": "network", + "name": "download", "type": "TypeBool", - "description": "If set to true will download the Calico network config with the Admin config", - "default_value": false, + "description": "If set to false will not download the config, otherwise they are downloaded each time but onto the same path for a given cluster name/id", + "default_value": true, "optional": true }, { - "name": "calico_config_file_path", + "name": "admin_key", "type": "TypeString", - "description": "The absolute path to the calico network config file", + "secure": true, "computed": true }, { - "name": "region", + "name": "org_guid", "type": "TypeString", - "description": "The cluster region", - "cloud_data_type": "region", + "description": "The bluemix organization guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, { - "name": "admin", + "name": "network", "type": "TypeBool", - "description": "If set to true will download the config for admin", + "description": "If set to true will download the Calico network config with the Admin config", "default_value": false, "optional": true }, { - "name": "admin_certificate", + "name": "config_file_path", "type": "TypeString", - "secure": true, + "description": "The absolute path to the kubernetes config yml file", "computed": true }, { - "name": "token", + "name": "admin_certificate", "type": "TypeString", "secure": true, "computed": true }, { - "name": "org_guid", + "name": "ca_certificate", "type": "TypeString", - "description": "The bluemix organization guid this cluster belongs to", - "optional": true, - "deprecated": "This field is deprecated" + "secure": true, + "computed": true }, { "name": "space_guid", @@ -18570,6 +18813,13 @@ "optional": true, "deprecated": "This field is deprecated" }, + { + "name": "admin", + "type": "TypeBool", + "description": "If set to true will download the config for admin", + "default_value": false, + "optional": true + }, { "name": "endpoint_type", "type": "TypeString", @@ -18577,44 +18827,54 @@ "optional": true }, { - "name": "admin_key", + "name": "calico_config_file_path", "type": "TypeString", - "secure": true, + "description": "The absolute path to the calico network config file", "computed": true }, { - "name": "ca_certificate", - "type": "TypeString", - "secure": true, - "computed": true - } - ], - "ibm_container_cluster_versions": [ - { - "name": "default_kube_version", + "name": "host", "type": "TypeString", - "description": "Default kube-version", "computed": true }, { - "name": "org_guid", + "name": "account_guid", "type": "TypeString", - "description": "The bluemix organization guid this cluster belongs to", + "description": "The bluemix account guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, { - "name": "account_guid", + "name": "cluster_name_id", "type": "TypeString", - "description": "The bluemix account guid this cluster belongs to", + "description": "The name/id of the cluster", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "token", + "type": "TypeString", + "secure": true, + "computed": true + } + ], + "ibm_container_cluster_versions": [ + { + "name": "org_guid", + "type": "TypeString", + "description": "The bluemix organization guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, { - "name": "default_openshift_version", + "name": "resource_group_id", "type": "TypeString", - "description": "Default openshift-version", - "computed": true + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true }, { "name": "valid_kube_versions", @@ -18626,13 +18886,16 @@ } }, { - "name": "valid_openshift_versions", - "type": "TypeList", - "description": "List of supported openshift-versions", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "default_openshift_version", + "type": "TypeString", + "description": "Default openshift-version", + "computed": true + }, + { + "name": "default_kube_version", + "type": "TypeString", + "description": "Default kube-version", + "computed": true }, { "name": "space_guid", @@ -18641,6 +18904,13 @@ "optional": true, "deprecated": "This field is deprecated" }, + { + "name": "account_guid", + "type": "TypeString", + "description": "The bluemix account guid this cluster belongs to", + "optional": true, + "deprecated": "This field is deprecated" + }, { "name": "region", "type": "TypeString", @@ -18650,11 +18920,13 @@ "deprecated": "This field is deprecated" }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true + "name": "valid_openshift_versions", + "type": "TypeList", + "description": "List of supported openshift-versions", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_container_cluster_worker": [ @@ -18668,13 +18940,6 @@ "type": "TypeString", "computed": true }, - { - "name": "space_guid", - "type": "TypeString", - "description": "The bluemix space guid this cluster belongs to", - "optional": true, - "deprecated": "This field is deprecated" - }, { "name": "region", "type": "TypeString", @@ -18684,25 +18949,26 @@ "deprecated": "This field is deprecated" }, { - "name": "state", + "name": "resource_group_id", "type": "TypeString", - "description": "State of the worker", - "computed": true + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true }, { - "name": "status", + "name": "private_vlan", "type": "TypeString", - "description": "Status of the worker", "computed": true }, { - "name": "private_vlan", + "name": "public_vlan", "type": "TypeString", "computed": true }, { - "name": "public_vlan", + "name": "status", "type": "TypeString", + "description": "Status of the worker", "computed": true }, { @@ -18713,18 +18979,18 @@ "deprecated": "This field is deprecated" }, { - "name": "account_guid", + "name": "space_guid", "type": "TypeString", - "description": "The bluemix account guid this cluster belongs to", + "description": "The bluemix space guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, { - "name": "resource_group_id", + "name": "account_guid", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true + "description": "The bluemix account guid this cluster belongs to", + "optional": true, + "deprecated": "This field is deprecated" }, { "name": "resource_controller_url", @@ -18737,9 +19003,21 @@ "type": "TypeString", "description": "ID of the worker", "required": true + }, + { + "name": "state", + "type": "TypeString", + "description": "State of the worker", + "computed": true } ], "ibm_container_dedicated_host": [ + { + "name": "host_id", + "type": "TypeString", + "description": "The id of the dedicated host", + "required": true + }, { "name": "host_pool_id", "type": "TypeString", @@ -18870,15 +19148,22 @@ "type": "TypeString", "description": "The zone of the dedicated host", "computed": true - }, - { - "name": "host_id", - "type": "TypeString", - "description": "The id of the dedicated host", - "required": true } ], "ibm_container_dedicated_host_flavor": [ + { + "name": "region", + "type": "TypeString", + "description": "The region of the dedicated host flavor", + "cloud_data_type": "region", + "computed": true + }, + { + "name": "deprecated", + "type": "TypeBool", + "description": "Describes if the dedicated host flavor is deprecated", + "computed": true + }, { "name": "max_vcpus", "type": "TypeInt", @@ -18926,19 +19211,6 @@ "type": "TypeString", "description": "The class of the dedicated host flavor", "computed": true - }, - { - "name": "region", - "type": "TypeString", - "description": "The region of the dedicated host flavor", - "cloud_data_type": "region", - "computed": true - }, - { - "name": "deprecated", - "type": "TypeBool", - "description": "Describes if the dedicated host flavor is deprecated", - "computed": true } ], "ibm_container_dedicated_host_flavors": [ @@ -19102,18 +19374,6 @@ } ], "ibm_container_ingress_instance": [ - { - "name": "instance_name", - "type": "TypeString", - "description": "Instance registration name", - "required": true - }, - { - "name": "secret_group_id", - "type": "TypeString", - "description": "Secret group for the instance registration", - "computed": true - }, { "name": "status", "type": "TypeString", @@ -19132,12 +19392,6 @@ "description": "If the instance was created by the user", "computed": true }, - { - "name": "instance_crn", - "type": "TypeString", - "description": "Instance CRN id", - "computed": true - }, { "name": "cluster", "type": "TypeString", @@ -19148,6 +19402,12 @@ "resolved_to:id" ] }, + { + "name": "instance_name", + "type": "TypeString", + "description": "Instance registration name", + "required": true + }, { "name": "is_default", "type": "TypeBool", @@ -19159,9 +19419,51 @@ "type": "TypeString", "description": "Name of the secret group for the instance", "computed": true + }, + { + "name": "instance_crn", + "type": "TypeString", + "description": "Instance CRN id", + "computed": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "Secret group for the instance registration", + "computed": true } ], "ibm_container_ingress_secret_opaque": [ + { + "name": "secret_name", + "type": "TypeString", + "description": "Secret name", + "required": true + }, + { + "name": "secret_namespace", + "type": "TypeString", + "description": "Secret namespace", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Opaque secret type", + "computed": true + }, + { + "name": "persistence", + "type": "TypeBool", + "description": "Persistence of secret", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the secret", + "computed": true + }, { "name": "user_managed", "type": "TypeBool", @@ -19209,36 +19511,6 @@ "cloud_data_range": [ "resolved_to:id" ] - }, - { - "name": "secret_name", - "type": "TypeString", - "description": "Secret name", - "required": true - }, - { - "name": "secret_namespace", - "type": "TypeString", - "description": "Secret namespace", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Opaque secret type", - "computed": true - }, - { - "name": "persistence", - "type": "TypeBool", - "description": "Persistence of secret", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the secret", - "computed": true } ], "ibm_container_ingress_secret_tls": [ @@ -19254,24 +19526,12 @@ "description": "Certificate expires on date", "computed": true }, - { - "name": "last_updated_timestamp", - "type": "TypeString", - "description": "Timestamp secret was last updated", - "computed": true - }, { "name": "secret_name", "type": "TypeString", "description": "Secret name", "required": true }, - { - "name": "secret_namespace", - "type": "TypeString", - "description": "Secret namespace", - "required": true - }, { "name": "cert_crn", "type": "TypeString", @@ -19279,9 +19539,9 @@ "computed": true }, { - "name": "type", - "type": "TypeString", - "description": "Type TLS", + "name": "user_managed", + "type": "TypeBool", + "description": "If the secret was created by the user", "computed": true }, { @@ -19290,6 +19550,18 @@ "description": "Secret Status", "computed": true }, + { + "name": "domain_name", + "type": "TypeString", + "description": "Domain name", + "computed": true + }, + { + "name": "last_updated_timestamp", + "type": "TypeString", + "description": "Timestamp secret was last updated", + "computed": true + }, { "name": "cluster", "type": "TypeString", @@ -19301,15 +19573,15 @@ ] }, { - "name": "user_managed", - "type": "TypeBool", - "description": "If the secret was created by the user", - "computed": true + "name": "secret_namespace", + "type": "TypeString", + "description": "Secret namespace", + "required": true }, { - "name": "domain_name", + "name": "type", "type": "TypeString", - "description": "Domain name", + "description": "Type TLS", "computed": true } ], @@ -19391,6 +19663,30 @@ } ], "ibm_container_storage_attachment": [ + { + "name": "volume_attachment_name", + "type": "TypeString", + "description": "Volume attachment name", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Volume attachment status", + "computed": true + }, + { + "name": "volume_type", + "type": "TypeString", + "description": "The type of volume", + "computed": true + }, + { + "name": "volume_attachment_id", + "type": "TypeString", + "description": "The volume attachment ID", + "required": true + }, { "name": "cluster", "type": "TypeString", @@ -19423,33 +19719,51 @@ "type": "TypeString", "description": "Volume ID", "computed": true + } + ], + "ibm_container_vpc_alb": [ + { + "name": "load_balancer_hostname", + "type": "TypeString", + "computed": true }, { - "name": "volume_attachment_name", + "name": "state", "type": "TypeString", - "description": "Volume attachment name", "computed": true }, { - "name": "status", + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true + }, + { + "name": "alb_type", "type": "TypeString", - "description": "Volume attachment status", "computed": true }, { - "name": "volume_type", + "name": "cluster", "type": "TypeString", - "description": "The type of volume", "computed": true }, { - "name": "volume_attachment_id", + "name": "enable", + "type": "TypeBool", + "computed": true + }, + { + "name": "disable_deployment", + "type": "TypeBool", + "computed": true + }, + { + "name": "zone", "type": "TypeString", - "description": "The volume attachment ID", - "required": true - } - ], - "ibm_container_vpc_alb": [ + "computed": true + }, { "name": "alb_id", "type": "TypeString", @@ -19457,64 +19771,162 @@ "required": true }, { - "name": "cluster", + "name": "name", "type": "TypeString", "computed": true }, { - "name": "load_balancer_hostname", + "name": "resize", + "type": "TypeBool", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "computed": true + } + ], + "ibm_container_vpc_cluster": [ + { + "name": "private_service_endpoint_url", "type": "TypeString", "computed": true }, { - "name": "name", + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_name", "type": "TypeString", + "description": "The name of the resource", "computed": true }, { - "name": "resize", - "type": "TypeBool", + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", "computed": true }, { - "name": "state", + "name": "worker_count", + "type": "TypeInt", + "description": "Number of workers", + "computed": true + }, + { + "name": "pod_subnet", "type": "TypeString", + "description": "Custom subnet CIDR to provide private IP addresses for pods", "computed": true }, { - "name": "status", + "name": "ingress_secret", "type": "TypeString", + "secure": true, "computed": true }, { - "name": "zone", + "name": "public_service_endpoint", + "type": "TypeBool", + "computed": true + }, + { + "name": "service_subnet", "type": "TypeString", + "description": "Custom subnet CIDR to provide private IP addresses for services", "computed": true }, { - "name": "alb_type", + "name": "health", "type": "TypeString", "computed": true }, { - "name": "enable", + "name": "image_security_enforcement", "type": "TypeBool", + "description": "True if image security enforcement is enabled", "computed": true }, { - "name": "disable_deployment", + "name": "private_service_endpoint", "type": "TypeBool", "computed": true }, { - "name": "resource_group_id", + "name": "public_service_endpoint_url", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", + "computed": true + }, + { + "name": "workers", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "api_key_id", + "type": "TypeString", + "description": "ID of APIkey", + "computed": true + }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "api_key_owner_email", + "type": "TypeString", + "description": "email id of the key owner", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name or id of the cluster", + "cloud_data_type": "cluster", + "optional": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "alb_type", + "type": "TypeString", + "default_value": "all", "optional": true - } - ], - "ibm_container_vpc_cluster": [ + }, + { + "name": "ingress_hostname", + "type": "TypeString", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "computed": true + }, { "name": "worker_pools", "type": "TypeList", @@ -19641,68 +20053,8 @@ } }, { - "name": "alb_type", - "type": "TypeString", - "default_value": "all", - "optional": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true - }, - { - "name": "worker_count", - "type": "TypeInt", - "description": "Number of workers", - "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "master_url", - "type": "TypeString", - "computed": true - }, - { - "name": "api_key_owner_name", - "type": "TypeString", - "description": "Name of the key owner", - "computed": true - }, - { - "name": "api_key_owner_email", - "type": "TypeString", - "description": "email id of the key owner", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "service_subnet", - "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for services", - "computed": true - }, - { - "name": "pod_subnet", - "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for pods", - "computed": true - }, - { - "name": "ingress_secret", + "name": "kube_version", "type": "TypeString", - "secure": true, "computed": true }, { @@ -19713,76 +20065,14 @@ "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "The status of the cluster master", - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name or id of the cluster", - "cloud_data_type": "cluster", - "optional": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, - { - "name": "ingress_hostname", - "type": "TypeString", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "computed": true - }, - { - "name": "private_service_endpoint_url", - "type": "TypeString", - "computed": true - }, - { - "name": "kube_version", + "name": "master_url", "type": "TypeString", "computed": true }, { - "name": "public_service_endpoint", - "type": "TypeBool", - "computed": true - }, - { - "name": "private_service_endpoint", - "type": "TypeBool", - "computed": true - }, - { - "name": "api_key_id", + "name": "status", "type": "TypeString", - "description": "ID of APIkey", + "description": "The status of the cluster master", "computed": true }, { @@ -19792,19 +20082,6 @@ "optional": true, "deprecated": "use name instead" }, - { - "name": "workers", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "health", - "type": "TypeString", - "computed": true - }, { "name": "albs", "type": "TypeList", @@ -19861,34 +20138,23 @@ "computed": true }, { - "name": "public_service_endpoint_url", + "name": "api_key_owner_name", "type": "TypeString", - "computed": true - }, - { - "name": "image_security_enforcement", - "type": "TypeBool", - "description": "True if image security enforcement is enabled", + "description": "Name of the key owner", "computed": true } ], "ibm_container_vpc_cluster_alb": [ { - "name": "resize", - "type": "TypeBool", - "computed": true - }, - { - "name": "zone", + "name": "status", "type": "TypeString", "computed": true }, { - "name": "resource_group_id", + "name": "alb_id", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true + "description": "ALB ID", + "required": true }, { "name": "alb_type", @@ -19896,8 +20162,8 @@ "computed": true }, { - "name": "disable_deployment", - "type": "TypeBool", + "name": "cluster", + "type": "TypeString", "computed": true }, { @@ -19911,42 +20177,44 @@ "computed": true }, { - "name": "load_balancer_hostname", + "name": "state", "type": "TypeString", "computed": true }, { - "name": "state", - "type": "TypeString", + "name": "disable_deployment", + "type": "TypeBool", "computed": true }, { - "name": "status", + "name": "load_balancer_hostname", "type": "TypeString", "computed": true }, { - "name": "alb_id", - "type": "TypeString", - "description": "ALB ID", - "required": true + "name": "resize", + "type": "TypeBool", + "computed": true }, { - "name": "cluster", + "name": "zone", "type": "TypeString", "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true } ], "ibm_container_vpc_cluster_worker": [ { - "name": "cluster_name_id", + "name": "kube_version", "type": "TypeString", - "description": "Name or ID of the cluster", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "kube version of the worker", + "computed": true }, { "name": "state", @@ -19954,18 +20222,6 @@ "description": "State of the worker", "computed": true }, - { - "name": "pool_id", - "type": "TypeString", - "description": "worker pool id", - "computed": true - }, - { - "name": "pool_name", - "type": "TypeString", - "description": "worker pool name", - "computed": true - }, { "name": "network_interfaces", "type": "TypeList", @@ -19989,73 +20245,69 @@ } }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "worker_id", + "name": "host_pool_id", "type": "TypeString", - "description": "ID of the worker", - "required": true + "description": "ID of the dedicated host pool this worker is associated with", + "computed": true }, { - "name": "kube_version", + "name": "resource_controller_url", "type": "TypeString", - "description": "kube version of the worker", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", "computed": true }, { - "name": "host_pool_id", + "name": "worker_id", "type": "TypeString", - "description": "ID of the dedicated host pool this worker is associated with", - "computed": true + "description": "ID of the worker", + "required": true }, { - "name": "resource_controller_url", + "name": "cluster_name_id", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true + "description": "Name or ID of the cluster", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { "name": "flavor", "type": "TypeString", "description": "flavor of the worker", "computed": true - } - ], - "ibm_container_vpc_cluster_worker_pool": [ + }, { - "name": "resource_group_id", + "name": "pool_id", "type": "TypeString", - "cloud_data_type": "resource_group", + "description": "worker pool id", "computed": true }, { - "name": "kms_instance_id", + "name": "pool_name", "type": "TypeString", + "description": "worker pool name", "computed": true }, { - "name": "crk", + "name": "resource_group_id", "type": "TypeString", - "computed": true - }, + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true + } + ], + "ibm_container_vpc_cluster_worker_pool": [ { - "name": "cluster", + "name": "host_pool_id", "type": "TypeString", - "description": "Cluster name", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "computed": true }, { - "name": "flavor", - "type": "TypeString", + "name": "autoscale_enabled", + "type": "TypeBool", + "description": "Autoscaling is enabled on the workerpool", "computed": true }, { @@ -20081,23 +20333,6 @@ "description": "The operating system of the workers in the worker pool", "computed": true }, - { - "name": "kms_account_id", - "type": "TypeString", - "computed": true - }, - { - "name": "autoscale_enabled", - "type": "TypeBool", - "description": "Autoscaling is enabled on the workerpool", - "computed": true - }, - { - "name": "worker_pool_name", - "type": "TypeString", - "description": "worker pool name", - "required": true - }, { "name": "secondary_storage", "type": "TypeList", @@ -20136,6 +20371,43 @@ } } }, + { + "name": "worker_count", + "type": "TypeInt", + "computed": true + }, + { + "name": "isolation", + "type": "TypeString", + "computed": true + }, + { + "name": "cluster", + "type": "TypeString", + "description": "Cluster name", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "flavor", + "type": "TypeString", + "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "worker_pool_name", + "type": "TypeString", + "description": "worker pool name", + "required": true + }, { "name": "labels", "type": "TypeMap", @@ -20145,49 +20417,90 @@ } }, { - "name": "vpc_id", + "name": "kms_instance_id", "type": "TypeString", "computed": true }, { - "name": "worker_count", - "type": "TypeInt", + "name": "vpc_id", + "type": "TypeString", "computed": true }, { - "name": "isolation", + "name": "crk", "type": "TypeString", "computed": true }, { - "name": "host_pool_id", + "name": "kms_account_id", "type": "TypeString", "computed": true } ], "ibm_container_vpc_worker_pool": [ { - "name": "kms_instance_id", + "name": "autoscale_enabled", + "type": "TypeBool", + "description": "Autoscaling is enabled on the workerpool", + "computed": true + }, + { + "name": "labels", + "type": "TypeMap", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group_id", "type": "TypeString", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "autoscale_enabled", - "type": "TypeBool", - "description": "Autoscaling is enabled on the workerpool", + "name": "kms_instance_id", + "type": "TypeString", "computed": true }, { - "name": "worker_pool_name", + "name": "kms_account_id", "type": "TypeString", - "description": "worker pool name", - "required": true + "computed": true + }, + { + "name": "zones", + "type": "TypeSet", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "computed": true + }, + "subnet_id": { + "name": "subnet_id", + "type": "TypeString", + "computed": true + } + } }, { "name": "host_pool_id", "type": "TypeString", "computed": true }, + { + "name": "crk", + "type": "TypeString", + "computed": true + }, + { + "name": "cluster", + "type": "TypeString", + "description": "Cluster name", + "required": true + }, { "name": "secondary_storage", "type": "TypeList", @@ -20227,25 +20540,20 @@ } }, { - "name": "vpc_id", - "type": "TypeString", + "name": "worker_count", + "type": "TypeInt", "computed": true }, { - "name": "resource_group_id", + "name": "isolation", "type": "TypeString", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "worker_count", - "type": "TypeInt", "computed": true }, { - "name": "crk", + "name": "worker_pool_name", "type": "TypeString", - "computed": true + "description": "worker pool name", + "required": true }, { "name": "flavor", @@ -20259,52 +20567,32 @@ "computed": true }, { - "name": "labels", - "type": "TypeMap", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "isolation", + "name": "vpc_id", "type": "TypeString", "computed": true - }, + } + ], + "ibm_container_worker_pool": [ { - "name": "kms_account_id", + "name": "cluster", "type": "TypeString", - "computed": true + "description": "Name or ID of the cluster", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "cluster", + "name": "worker_pool_name", "type": "TypeString", - "description": "Cluster name", + "description": "worker pool name", "required": true }, { - "name": "zones", - "type": "TypeSet", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "computed": true - }, - "subnet_id": { - "name": "subnet_id", - "type": "TypeString", - "computed": true - } - } - } - ], - "ibm_container_worker_pool": [ - { - "name": "hardware", - "type": "TypeString", - "description": "Hardware type", + "name": "disk_encryption", + "type": "TypeBool", + "description": "worker node disk encrypted if set to true", "computed": true }, { @@ -20352,26 +20640,10 @@ "computed": true }, { - "name": "autoscale_enabled", - "type": "TypeBool", - "description": "Autoscaling is enabled on the workerpool", - "computed": true - }, - { - "name": "cluster", - "type": "TypeString", - "description": "Name or ID of the cluster", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, - { - "name": "worker_pool_name", + "name": "operating_system", "type": "TypeString", - "description": "worker pool name", - "required": true + "description": "The operating system of the workers in the worker pool", + "computed": true }, { "name": "machine_type", @@ -20386,15 +20658,9 @@ "computed": true }, { - "name": "disk_encryption", - "type": "TypeBool", - "description": "worker node disk encrypted if set to true", - "computed": true - }, - { - "name": "operating_system", + "name": "hardware", "type": "TypeString", - "description": "The operating system of the workers in the worker pool", + "description": "Hardware type", "computed": true }, { @@ -20403,118 +20669,211 @@ "description": "ID of the resource group.", "cloud_data_type": "resource_group", "computed": true + }, + { + "name": "autoscale_enabled", + "type": "TypeBool", + "description": "Autoscaling is enabled on the workerpool", + "computed": true } ], "ibm_cos_bucket": [ { - "name": "bucket_type", - "type": "TypeString", - "options": "single_site_location,region_location,cross_region_location", - "optional": true - }, - { - "name": "object_lock_configuration", + "name": "website_configuration", "type": "TypeList", - "description": "Bucket level object lock settings includes Days, Years, Mode.", "computed": true, "elem": { - "object_lock_enabled": { - "name": "object_lock_enabled", - "type": "TypeString", - "description": "Enable object lock on a COS bucket. This can be used to enable objectlock on an existing bucket", - "computed": true + "error_document": { + "name": "error_document", + "type": "TypeList", + "computed": true, + "elem": { + "key": { + "name": "key", + "type": "TypeString", + "computed": true + } + } }, - "object_lock_rule": { - "name": "object_lock_rule", + "index_document": { + "name": "index_document", "type": "TypeList", "computed": true, "elem": { - "default_retention": { - "name": "default_retention", + "suffix": { + "name": "suffix", + "type": "TypeString", + "computed": true + } + } + }, + "redirect_all_requests_to": { + "name": "redirect_all_requests_to", + "type": "TypeList", + "computed": true, + "elem": { + "host_name": { + "name": "host_name", + "type": "TypeString", + "computed": true + }, + "protocol": { + "name": "protocol", + "type": "TypeString", + "computed": true + } + } + }, + "routing_rule": { + "name": "routing_rule", + "type": "TypeList", + "description": "Rules that define when a redirect is applied and the redirect behavior.", + "computed": true, + "elem": { + "condition": { + "name": "condition", "type": "TypeList", - "description": "An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.", + "description": "A condition that must be met for the specified redirect to be applie.", "computed": true, "elem": { - "days": { - "name": "days", - "type": "TypeInt", - "description": "Retention period in terms of days after which the object can be deleted.", + "http_error_code_returned_equals": { + "name": "http_error_code_returned_equals", + "type": "TypeString", + "description": "The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..", "computed": true }, - "mode": { - "name": "mode", + "key_prefix_equals": { + "name": "key_prefix_equals", "type": "TypeString", - "description": "Retention modes apply different levels of protection to the objects.", + "description": "The object key name prefix when the redirect is applied..", + "computed": true + } + } + }, + "redirect": { + "name": "redirect", + "type": "TypeList", + "description": ".", + "computed": true, + "elem": { + "host_name": { + "name": "host_name", + "type": "TypeString", + "description": "The host name the request should be redirected to.", "computed": true }, - "years": { - "name": "years", - "type": "TypeInt", - "description": "Retention period in terms of years after which the object can be deleted.", + "http_redirect_code": { + "name": "http_redirect_code", + "type": "TypeString", + "description": "The HTTP redirect code to use on the response. Valid codes are 3XX except 300..", + "computed": true + }, + "protocol": { + "name": "protocol", + "type": "TypeString", + "description": "Protocol to be used in the Location header that is returned in the response.", + "computed": true + }, + "replace_key_prefix_with": { + "name": "replace_key_prefix_with", + "type": "TypeString", + "description": "The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.", + "computed": true + }, + "replace_key_with": { + "name": "replace_key_with", + "type": "TypeString", + "description": "The object key to be used in the Location header that is returned in the response.", "computed": true } } } } + }, + "routing_rules": { + "name": "routing_rules", + "type": "TypeString", + "description": "Rules that define when a redirect is applied and the redirect behavior.", + "optional": true, + "computed": true } } }, { - "name": "endpoint_type", + "name": "s3_endpoint_private", "type": "TypeString", - "description": "public or private", - "default_value": "public", - "options": "public,private,direct", - "optional": true + "description": "Private endpoint for the COS bucket", + "computed": true }, { - "name": "archive_rule", + "name": "metrics_monitoring", "type": "TypeList", - "description": "Enable configuration archive_rule (glacier/accelerated) to COS Bucket after a defined period of time", "computed": true, "elem": { - "days": { - "name": "days", - "type": "TypeInt", + "metrics_monitoring_crn": { + "name": "metrics_monitoring_crn", + "type": "TypeString", + "description": "Instance of IBM Cloud Monitoring that will receive the bucket metrics.", "computed": true }, - "enable": { - "name": "enable", + "request_metrics_enabled": { + "name": "request_metrics_enabled", "type": "TypeBool", - "description": "Enable or disable an archive rule for a bucket", - "computed": true - }, - "rule_id": { - "name": "rule_id", - "type": "TypeString", + "description": "Request metrics will be sent to the monitoring service.", "computed": true }, - "type": { - "name": "type", - "type": "TypeString", + "usage_metrics_enabled": { + "name": "usage_metrics_enabled", + "type": "TypeBool", + "description": "Usage metrics will be sent to the monitoring service.", "computed": true } } }, { - "name": "replication_rule", + "name": "activity_tracking", "type": "TypeList", - "description": "Replicate objects between buckets, replicate across source and destination. A container for replication rules can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.", "computed": true, "elem": { - "deletemarker_replication_status": { - "name": "deletemarker_replication_status", - "type": "TypeBool", - "description": "Indicates whether to replicate delete markers. It should be either Enable or Disable", - "computed": true - }, - "destination_bucket_crn": { - "name": "destination_bucket_crn", + "activity_tracker_crn": { + "name": "activity_tracker_crn", "type": "TypeString", - "description": "The Cloud Resource Name (CRN) of the bucket where you want COS to store the results", + "description": "The instance of Activity Tracker that will receive object event data", "computed": true }, - "enable": { + "read_data_events": { + "name": "read_data_events", + "type": "TypeBool", + "description": "If set to true, all object read events will be sent to Activity Tracker.", + "computed": true + }, + "write_data_events": { + "name": "write_data_events", + "type": "TypeBool", + "description": "If set to true, all object write events will be sent to Activity Tracker.", + "computed": true + } + } + }, + { + "name": "replication_rule", + "type": "TypeList", + "description": "Replicate objects between buckets, replicate across source and destination. A container for replication rules can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB.", + "computed": true, + "elem": { + "deletemarker_replication_status": { + "name": "deletemarker_replication_status", + "type": "TypeBool", + "description": "Indicates whether to replicate delete markers. It should be either Enable or Disable", + "computed": true + }, + "destination_bucket_crn": { + "name": "destination_bucket_crn", + "type": "TypeString", + "description": "The Cloud Resource Name (CRN) of the bucket where you want COS to store the results", + "computed": true + }, + "enable": { "name": "enable", "type": "TypeBool", "description": "Enable or disable an replication rule for a bucket", @@ -20539,6 +20898,17 @@ } } }, + { + "name": "kms_key_crn", + "type": "TypeString", + "description": "CRN of the key you want to use data at rest encryption", + "computed": true + }, + { + "name": "single_site_location", + "type": "TypeString", + "computed": true + }, { "name": "object_lock", "type": "TypeBool", @@ -20546,12 +20916,47 @@ "computed": true }, { - "name": "abort_incomplete_multipart_upload_days", + "name": "bucket_name", + "type": "TypeString", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN of resource instance", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "s3_endpoint_direct", + "type": "TypeString", + "description": "Direct endpoint for the COS bucket", + "computed": true + }, + { + "name": "region_location", + "type": "TypeString", + "computed": true + }, + { + "name": "storage_class", + "type": "TypeString", + "computed": true + }, + { + "name": "expire_rule", "type": "TypeList", + "description": "Enable configuration expire_rule to COS Bucket", "computed": true, "elem": { - "days_after_initiation": { - "name": "days_after_initiation", + "date": { + "name": "date", + "type": "TypeString", + "description": "Specifies the date when the specific rule action takes effect.", + "computed": true + }, + "days": { + "name": "days", "type": "TypeInt", "description": "Specifies the number of days when the specific rule action takes effect.", "computed": true @@ -20559,7 +20964,13 @@ "enable": { "name": "enable", "type": "TypeBool", - "description": "Enable or disable rule for a bucket", + "description": "Enable or disable an archive rule for a bucket", + "computed": true + }, + "expired_object_delete_marker": { + "name": "expired_object_delete_marker", + "type": "TypeBool", + "description": "Expired object delete markers can be automatically cleaned up to improve performance in bucket. This cannot be used alongside version expiration.", "computed": true }, "prefix": { @@ -20571,7 +20982,6 @@ "rule_id": { "name": "rule_id", "type": "TypeString", - "description": "Unique identifier for the rule. Rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", "computed": true } } @@ -20583,9 +20993,12 @@ "computed": true }, { - "name": "bucket_name", + "name": "endpoint_type", "type": "TypeString", - "required": true + "description": "public or private", + "default_value": "public", + "options": "public,private,direct", + "optional": true }, { "name": "s3_endpoint_public", @@ -20594,201 +21007,124 @@ "computed": true }, { - "name": "s3_endpoint_direct", - "type": "TypeString", - "description": "Direct endpoint for the COS bucket", - "computed": true - }, - { - "name": "object_versioning", + "name": "abort_incomplete_multipart_upload_days", "type": "TypeList", - "description": "Protect objects from accidental deletion or overwrites. Versioning allows you to keep multiple versions of an object protecting from unintentional data loss.", "computed": true, "elem": { + "days_after_initiation": { + "name": "days_after_initiation", + "type": "TypeInt", + "description": "Specifies the number of days when the specific rule action takes effect.", + "computed": true + }, "enable": { "name": "enable", "type": "TypeBool", - "description": "Enable or suspend the versioning for objects in the bucket", + "description": "Enable or disable rule for a bucket", + "computed": true + }, + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "The rule applies to any objects with keys that match this prefix", + "computed": true + }, + "rule_id": { + "name": "rule_id", + "type": "TypeString", + "description": "Unique identifier for the rule. Rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", "computed": true } } }, { - "name": "resource_instance_id", - "type": "TypeString", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:cloud-object-storage" - ] - }, - { - "name": "storage_class", - "type": "TypeString", - "computed": true - }, - { - "name": "s3_endpoint_private", - "type": "TypeString", - "description": "Private endpoint for the COS bucket", - "computed": true - }, - { - "name": "allowed_ip", - "type": "TypeList", - "description": "List of IPv4 or IPv6 addresses", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "activity_tracking", + "name": "object_versioning", "type": "TypeList", + "description": "Protect objects from accidental deletion or overwrites. Versioning allows you to keep multiple versions of an object protecting from unintentional data loss.", "computed": true, "elem": { - "activity_tracker_crn": { - "name": "activity_tracker_crn", - "type": "TypeString", - "description": "The instance of Activity Tracker that will receive object event data", - "computed": true - }, - "read_data_events": { - "name": "read_data_events", - "type": "TypeBool", - "description": "If set to true, all object read events will be sent to Activity Tracker.", - "computed": true - }, - "write_data_events": { - "name": "write_data_events", + "enable": { + "name": "enable", "type": "TypeBool", - "description": "If set to true, all object write events will be sent to Activity Tracker.", + "description": "Enable or suspend the versioning for objects in the bucket", "computed": true } } }, { - "name": "website_endpoint", - "type": "TypeString", - "computed": true - }, - { - "name": "key_protect", - "type": "TypeString", - "description": "CRN of the key you want to use data at rest encryption", - "computed": true - }, - { - "name": "kms_key_crn", - "type": "TypeString", - "description": "CRN of the key you want to use data at rest encryption", - "computed": true - }, - { - "name": "region_location", - "type": "TypeString", - "computed": true - }, - { - "name": "retention_rule", + "name": "noncurrent_version_expiration", "type": "TypeList", - "description": "A retention policy is enabled at the IBM Cloud Object Storage bucket level. Minimum, maximum and default retention period are defined by this policy and apply to all objects in the bucket.", + "description": "Enable configuration expire_rule to COS Bucket after a defined period of time", "computed": true, "elem": { - "default": { - "name": "default", - "type": "TypeInt", - "description": "If an object is stored in the bucket without specifying a custom retention period.", + "enable": { + "name": "enable", + "type": "TypeBool", + "description": "Enable or disable an expire rule for a bucket", "computed": true }, - "maximum": { - "name": "maximum", + "noncurrent_days": { + "name": "noncurrent_days", "type": "TypeInt", - "description": "Maximum duration of time an object can be kept unmodified in the bucket.", + "description": "Specifies the number of days when the specific rule action takes effect.", "computed": true }, - "minimum": { - "name": "minimum", - "type": "TypeInt", - "description": "Minimum duration of time an object must be kept unmodified in the bucket", + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "The rule applies to any objects with keys that match this prefix", "computed": true }, - "permanent": { - "name": "permanent", - "type": "TypeBool", - "description": "Enable or disable the permanent retention policy on the bucket", + "rule_id": { + "name": "rule_id", + "type": "TypeString", + "description": "Unique identifier for the rule.Expire rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", "computed": true } } }, { - "name": "satellite_location_id", + "name": "bucket_region", "type": "TypeString", "optional": true }, { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "single_site_location", + "name": "cross_region_location", "type": "TypeString", "computed": true }, { - "name": "cross_region_location", + "name": "resource_instance_id", "type": "TypeString", - "computed": true + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:cloud-object-storage" + ] }, { - "name": "bucket_region", + "name": "satellite_location_id", "type": "TypeString", "optional": true }, { - "name": "metrics_monitoring", + "name": "allowed_ip", "type": "TypeList", + "description": "List of IPv4 or IPv6 addresses", "computed": true, "elem": { - "metrics_monitoring_crn": { - "name": "metrics_monitoring_crn", - "type": "TypeString", - "description": "Instance of IBM Cloud Monitoring that will receive the bucket metrics.", - "computed": true - }, - "request_metrics_enabled": { - "name": "request_metrics_enabled", - "type": "TypeBool", - "description": "Request metrics will be sent to the monitoring service.", - "computed": true - }, - "usage_metrics_enabled": { - "name": "usage_metrics_enabled", - "type": "TypeBool", - "description": "Usage metrics will be sent to the monitoring service.", - "computed": true - } + "type": "TypeString" } }, { - "name": "expire_rule", + "name": "archive_rule", "type": "TypeList", - "description": "Enable configuration expire_rule to COS Bucket", + "description": "Enable configuration archive_rule (glacier/accelerated) to COS Bucket after a defined period of time", "computed": true, "elem": { - "date": { - "name": "date", - "type": "TypeString", - "description": "Specifies the date when the specific rule action takes effect.", - "computed": true - }, "days": { "name": "days", "type": "TypeInt", - "description": "Specifies the number of days when the specific rule action takes effect.", "computed": true }, "enable": { @@ -20797,212 +21133,137 @@ "description": "Enable or disable an archive rule for a bucket", "computed": true }, - "expired_object_delete_marker": { - "name": "expired_object_delete_marker", - "type": "TypeBool", - "description": "Expired object delete markers can be automatically cleaned up to improve performance in bucket. This cannot be used alongside version expiration.", - "computed": true - }, - "prefix": { - "name": "prefix", + "rule_id": { + "name": "rule_id", "type": "TypeString", - "description": "The rule applies to any objects with keys that match this prefix", "computed": true }, - "rule_id": { - "name": "rule_id", + "type": { + "name": "type", "type": "TypeString", "computed": true } } }, { - "name": "noncurrent_version_expiration", + "name": "retention_rule", "type": "TypeList", - "description": "Enable configuration expire_rule to COS Bucket after a defined period of time", + "description": "A retention policy is enabled at the IBM Cloud Object Storage bucket level. Minimum, maximum and default retention period are defined by this policy and apply to all objects in the bucket.", "computed": true, "elem": { - "enable": { - "name": "enable", - "type": "TypeBool", - "description": "Enable or disable an expire rule for a bucket", + "default": { + "name": "default", + "type": "TypeInt", + "description": "If an object is stored in the bucket without specifying a custom retention period.", "computed": true }, - "noncurrent_days": { - "name": "noncurrent_days", + "maximum": { + "name": "maximum", "type": "TypeInt", - "description": "Specifies the number of days when the specific rule action takes effect.", + "description": "Maximum duration of time an object can be kept unmodified in the bucket.", "computed": true }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "The rule applies to any objects with keys that match this prefix", + "minimum": { + "name": "minimum", + "type": "TypeInt", + "description": "Minimum duration of time an object must be kept unmodified in the bucket", "computed": true }, - "rule_id": { - "name": "rule_id", - "type": "TypeString", - "description": "Unique identifier for the rule.Expire rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", + "permanent": { + "name": "permanent", + "type": "TypeBool", + "description": "Enable or disable the permanent retention policy on the bucket", "computed": true } } }, { - "name": "website_configuration", + "name": "object_lock_configuration", "type": "TypeList", + "description": "Bucket level object lock settings includes Days, Years, Mode.", "computed": true, "elem": { - "error_document": { - "name": "error_document", - "type": "TypeList", - "computed": true, - "elem": { - "key": { - "name": "key", - "type": "TypeString", - "computed": true - } - } - }, - "index_document": { - "name": "index_document", - "type": "TypeList", - "computed": true, - "elem": { - "suffix": { - "name": "suffix", - "type": "TypeString", - "computed": true - } - } - }, - "redirect_all_requests_to": { - "name": "redirect_all_requests_to", - "type": "TypeList", - "computed": true, - "elem": { - "host_name": { - "name": "host_name", - "type": "TypeString", - "computed": true - }, - "protocol": { - "name": "protocol", - "type": "TypeString", - "computed": true - } - } + "object_lock_enabled": { + "name": "object_lock_enabled", + "type": "TypeString", + "description": "Enable object lock on a COS bucket. This can be used to enable objectlock on an existing bucket", + "computed": true }, - "routing_rule": { - "name": "routing_rule", + "object_lock_rule": { + "name": "object_lock_rule", "type": "TypeList", - "description": "Rules that define when a redirect is applied and the redirect behavior.", "computed": true, "elem": { - "condition": { - "name": "condition", - "type": "TypeList", - "description": "A condition that must be met for the specified redirect to be applie.", - "computed": true, - "elem": { - "http_error_code_returned_equals": { - "name": "http_error_code_returned_equals", - "type": "TypeString", - "description": "The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..", - "computed": true - }, - "key_prefix_equals": { - "name": "key_prefix_equals", - "type": "TypeString", - "description": "The object key name prefix when the redirect is applied..", - "computed": true - } - } - }, - "redirect": { - "name": "redirect", + "default_retention": { + "name": "default_retention", "type": "TypeList", - "description": ".", + "description": "An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.", "computed": true, "elem": { - "host_name": { - "name": "host_name", - "type": "TypeString", - "description": "The host name the request should be redirected to.", - "computed": true - }, - "http_redirect_code": { - "name": "http_redirect_code", - "type": "TypeString", - "description": "The HTTP redirect code to use on the response. Valid codes are 3XX except 300..", - "computed": true - }, - "protocol": { - "name": "protocol", - "type": "TypeString", - "description": "Protocol to be used in the Location header that is returned in the response.", + "days": { + "name": "days", + "type": "TypeInt", + "description": "Retention period in terms of days after which the object can be deleted.", "computed": true }, - "replace_key_prefix_with": { - "name": "replace_key_prefix_with", + "mode": { + "name": "mode", "type": "TypeString", - "description": "The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.", + "description": "Retention modes apply different levels of protection to the objects.", "computed": true }, - "replace_key_with": { - "name": "replace_key_with", - "type": "TypeString", - "description": "The object key to be used in the Location header that is returned in the response.", + "years": { + "name": "years", + "type": "TypeInt", + "description": "Retention period in terms of years after which the object can be deleted.", "computed": true } } } } - }, - "routing_rules": { - "name": "routing_rules", - "type": "TypeString", - "description": "Rules that define when a redirect is applied and the redirect behavior.", - "optional": true, - "computed": true } } - } - ], - "ibm_cos_bucket_object": [ + }, { - "name": "body", + "name": "website_endpoint", "type": "TypeString", - "description": "COS object body", "computed": true }, { - "name": "endpoint_type", + "name": "bucket_type", "type": "TypeString", - "description": "COS endpoint type: public, private, direct", - "default_value": "public", + "options": "single_site_location,region_location,cross_region_location", "optional": true }, { - "name": "object_lock_legal_hold_status", + "name": "key_protect", + "type": "TypeString", + "description": "CRN of the key you want to use data at rest encryption", + "computed": true + } + ], + "ibm_cos_bucket_object": [ + { + "name": "etag", "type": "TypeString", + "description": "COS object MD5 hexdigest", "computed": true }, { - "name": "object_lock_retain_until_date", + "name": "object_lock_legal_hold_status", "type": "TypeString", "computed": true }, { - "name": "website_redirect", + "name": "body", "type": "TypeString", + "description": "COS object body", "computed": true }, { - "name": "bucket_location", + "name": "bucket_crn", "type": "TypeString", - "description": "COS bucket location", + "description": "COS bucket CRN", "required": true }, { @@ -21012,25 +21273,31 @@ "computed": true }, { - "name": "last_modified", + "name": "endpoint_type", + "type": "TypeString", + "description": "COS endpoint type: public, private, direct", + "default_value": "public", + "optional": true + }, + { + "name": "version_id", "type": "TypeString", - "description": "COS object last modified date", "computed": true }, { - "name": "object_lock_mode", + "name": "object_sql_url", "type": "TypeString", "computed": true }, { - "name": "version_id", + "name": "object_lock_retain_until_date", "type": "TypeString", "computed": true }, { - "name": "bucket_crn", + "name": "bucket_location", "type": "TypeString", - "description": "COS bucket CRN", + "description": "COS bucket location", "required": true }, { @@ -21040,19 +21307,24 @@ "computed": true }, { - "name": "etag", + "name": "key", "type": "TypeString", - "description": "COS object MD5 hexdigest", + "description": "COS object key", + "required": true + }, + { + "name": "last_modified", + "type": "TypeString", + "description": "COS object last modified date", "computed": true }, { - "name": "key", + "name": "object_lock_mode", "type": "TypeString", - "description": "COS object key", - "required": true + "computed": true }, { - "name": "object_sql_url", + "name": "website_redirect", "type": "TypeString", "computed": true } @@ -21124,6 +21396,28 @@ } ], "ibm_database": [ + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Resource instance name for example, my Database instance", + "cloud_data_type": "cloud-database", + "required": true, + "cloud_data_range": [ + "resolved_to:name" + ] + }, + { + "name": "plan", + "type": "TypeString", + "description": "The plan type of the Database instance", + "computed": true + }, { "name": "version", "type": "TypeString", @@ -21159,6 +21453,200 @@ } } }, + { + "name": "groups", + "type": "TypeList", + "computed": true, + "elem": { + "count": { + "name": "count", + "type": "TypeInt", + "description": "Count of scaling groups for the instance", + "computed": true + }, + "cpu": { + "name": "cpu", + "type": "TypeList", + "computed": true, + "elem": { + "allocation_count": { + "name": "allocation_count", + "type": "TypeInt", + "description": "The current cpu allocation count", + "computed": true + }, + "can_scale_down": { + "name": "can_scale_down", + "type": "TypeBool", + "description": "Can the number of CPUs be scaled down as well as up", + "computed": true + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "TypeBool", + "description": "Are the number of CPUs adjustable", + "computed": true + }, + "minimum_count": { + "name": "minimum_count", + "type": "TypeInt", + "description": "The minimum number of cpus allowed", + "computed": true + }, + "step_size_count": { + "name": "step_size_count", + "type": "TypeInt", + "description": "The number of CPUs allowed to step up or down by", + "computed": true + }, + "units": { + "name": "units", + "type": "TypeString", + "description": "The .", + "computed": true + } + } + }, + "disk": { + "name": "disk", + "type": "TypeList", + "computed": true, + "elem": { + "allocation_mb": { + "name": "allocation_mb", + "type": "TypeInt", + "description": "The current disk allocation", + "computed": true + }, + "can_scale_down": { + "name": "can_scale_down", + "type": "TypeBool", + "description": "Can the disk size be scaled down as well as up", + "computed": true + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "TypeBool", + "description": "Is the disk size adjustable", + "computed": true + }, + "minimum_mb": { + "name": "minimum_mb", + "type": "TypeInt", + "description": "The minimum disk size allowed", + "computed": true + }, + "step_size_mb": { + "name": "step_size_mb", + "type": "TypeInt", + "description": "The step size disk increases or decreases in", + "computed": true + }, + "units": { + "name": "units", + "type": "TypeString", + "description": "The units disk is allocated in", + "computed": true + } + } + }, + "group_id": { + "name": "group_id", + "type": "TypeString", + "description": "Scaling group name", + "computed": true + }, + "memory": { + "name": "memory", + "type": "TypeList", + "computed": true, + "elem": { + "allocation_mb": { + "name": "allocation_mb", + "type": "TypeInt", + "description": "The current memory allocation for a group instance", + "computed": true + }, + "can_scale_down": { + "name": "can_scale_down", + "type": "TypeBool", + "description": "Can memory scale down as well as up.", + "computed": true + }, + "is_adjustable": { + "name": "is_adjustable", + "type": "TypeBool", + "description": "Is the memory size adjustable.", + "computed": true + }, + "minimum_mb": { + "name": "minimum_mb", + "type": "TypeInt", + "description": "The minimum memory size for a group instance", + "computed": true + }, + "step_size_mb": { + "name": "step_size_mb", + "type": "TypeInt", + "description": "The step size memory increases or decreases in.", + "computed": true + }, + "units": { + "name": "units", + "type": "TypeString", + "description": "The units memory is allocated in.", + "computed": true + } + } + } + } + }, + { + "name": "adminpassword", + "type": "TypeString", + "description": "The admin user id for the instance", + "secure": true, + "computed": true + }, + { + "name": "platform_options", + "type": "TypeSet", + "description": "Platform-specific options for this deployment.r", + "computed": true, + "elem": { + "backup_encryption_key_crn": { + "name": "backup_encryption_key_crn", + "type": "TypeString", + "description": "Backup encryption key crn", + "computed": true + }, + "disk_encryption_key_crn": { + "name": "disk_encryption_key_crn", + "type": "TypeString", + "description": "Disk encryption key crn", + "computed": true + } + } + }, + { + "name": "location", + "type": "TypeString", + "description": "The location or the region in which the Database instance exists", + "cloud_data_type": "region", + "optional": true + }, + { + "name": "guid", + "type": "TypeString", + "description": "Unique identifier of resource instance", + "computed": true + }, + { + "name": "adminuser", + "type": "TypeString", + "description": "The admin user id for the instance", + "computed": true + }, { "name": "allowlist", "type": "TypeSet", @@ -21178,12 +21666,46 @@ } } }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, { "name": "resource_group_name", "type": "TypeString", "description": "The resource group name in which resource is provisioned", "computed": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "The id of the resource group in which the Database instance is present", + "cloud_data_type": "resource_group", + "optional": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "service", + "type": "TypeString", + "description": "The name of the Cloud Database service", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The resource instance status", + "computed": true + }, { "name": "auto_scaling", "type": "TypeList", @@ -21362,403 +21884,257 @@ } }, { - "name": "service", + "name": "configuration_schema", "type": "TypeString", - "description": "The name of the Cloud Database service", - "optional": true + "description": "The configuration schema in JSON format", + "computed": true }, { - "name": "plan", + "name": "resource_status", "type": "TypeString", - "description": "The plan type of the Database instance", + "description": "The status of the resource", + "computed": true + } + ], + "ibm_database_backup": [ + { + "name": "download_link", + "type": "TypeString", + "description": "URI which is currently available for file downloading.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Date and time when this backup was created.", + "computed": true + }, + { + "name": "backup_id", + "type": "TypeString", + "description": "Backup ID.", + "required": true + }, + { + "name": "deployment_id", + "type": "TypeString", + "description": "ID of the deployment this backup relates to.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of backup.", "computed": true }, { "name": "status", "type": "TypeString", - "description": "The resource instance status", + "description": "The status of this backup.", "computed": true }, { - "name": "platform_options", - "type": "TypeSet", - "description": "Platform-specific options for this deployment.r", + "name": "is_downloadable", + "type": "TypeBool", + "description": "Is this backup available to download?.", + "computed": true + }, + { + "name": "is_restorable", + "type": "TypeBool", + "description": "Can this backup be used to restore an instance?.", + "computed": true + } + ], + "ibm_database_backups": [ + { + "name": "deployment_id", + "type": "TypeString", + "description": "ID of the deployment this backup relates to.", + "cloud_data_type": "cloud-database", + "optional": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "backups", + "type": "TypeList", + "description": "An array of backups.", "computed": true, "elem": { - "backup_encryption_key_crn": { - "name": "backup_encryption_key_crn", + "backup_id": { + "name": "backup_id", "type": "TypeString", - "description": "Backup encryption key crn", + "description": "ID of this backup.", "computed": true }, - "disk_encryption_key_crn": { - "name": "disk_encryption_key_crn", + "created_at": { + "name": "created_at", "type": "TypeString", - "description": "Disk encryption key crn", + "description": "Date and time when this backup was created.", + "computed": true + }, + "deployment_id": { + "name": "deployment_id", + "type": "TypeString", + "description": "ID of the deployment this backup relates to.", + "computed": true + }, + "download_link": { + "name": "download_link", + "type": "TypeString", + "description": "URI which is currently available for file downloading.", + "computed": true + }, + "is_downloadable": { + "name": "is_downloadable", + "type": "TypeBool", + "description": "Is this backup available to download?.", + "computed": true + }, + "is_restorable": { + "name": "is_restorable", + "type": "TypeBool", + "description": "Can this backup be used to restore an instance?.", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of this backup.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of backup.", "computed": true } } - }, + } + ], + "ibm_database_connection": [ { - "name": "groups", + "name": "stomp_ssl", "type": "TypeList", "computed": true, "elem": { - "count": { - "name": "count", - "type": "TypeInt", - "description": "Count of scaling groups for the instance", - "computed": true - }, - "cpu": { - "name": "cpu", + "authentication": { + "name": "authentication", "type": "TypeList", + "description": "Authentication data for Connection String.", "computed": true, "elem": { - "allocation_count": { - "name": "allocation_count", - "type": "TypeInt", - "description": "The current cpu allocation count", - "computed": true - }, - "can_scale_down": { - "name": "can_scale_down", - "type": "TypeBool", - "description": "Can the number of CPUs be scaled down as well as up", - "computed": true - }, - "is_adjustable": { - "name": "is_adjustable", - "type": "TypeBool", - "description": "Are the number of CPUs adjustable", - "computed": true - }, - "minimum_count": { - "name": "minimum_count", - "type": "TypeInt", - "description": "The minimum number of cpus allowed", + "method": { + "name": "method", + "type": "TypeString", + "description": "Authentication method for this credential.", "computed": true }, - "step_size_count": { - "name": "step_size_count", - "type": "TypeInt", - "description": "The number of CPUs allowed to step up or down by", + "password": { + "name": "password", + "type": "TypeString", + "description": "Password part of credential.", "computed": true }, - "units": { - "name": "units", + "username": { + "name": "username", "type": "TypeString", - "description": "The .", + "description": "Username part of credential.", "computed": true } } }, - "disk": { - "name": "disk", + "browser_accessible": { + "name": "browser_accessible", + "type": "TypeBool", + "description": "Indicates the address is accessible by browser.", + "computed": true + }, + "certificate": { + "name": "certificate", "type": "TypeList", "computed": true, "elem": { - "allocation_mb": { - "name": "allocation_mb", - "type": "TypeInt", - "description": "The current disk allocation", - "computed": true - }, - "can_scale_down": { - "name": "can_scale_down", - "type": "TypeBool", - "description": "Can the disk size be scaled down as well as up", - "computed": true - }, - "is_adjustable": { - "name": "is_adjustable", - "type": "TypeBool", - "description": "Is the disk size adjustable", - "computed": true - }, - "minimum_mb": { - "name": "minimum_mb", - "type": "TypeInt", - "description": "The minimum disk size allowed", - "computed": true - }, - "step_size_mb": { - "name": "step_size_mb", - "type": "TypeInt", - "description": "The step size disk increases or decreases in", + "certificate_base64": { + "name": "certificate_base64", + "type": "TypeString", + "description": "Base64 encoded version of the certificate.", "computed": true }, - "units": { - "name": "units", + "name": { + "name": "name", "type": "TypeString", - "description": "The units disk is allocated in", + "description": "Name associated with the certificate.", "computed": true } } }, - "group_id": { - "name": "group_id", - "type": "TypeString", - "description": "Scaling group name", - "computed": true + "composed": { + "name": "composed", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } }, - "memory": { - "name": "memory", + "hosts": { + "name": "hosts", "type": "TypeList", "computed": true, "elem": { - "allocation_mb": { - "name": "allocation_mb", - "type": "TypeInt", - "description": "The current memory allocation for a group instance", - "computed": true - }, - "can_scale_down": { - "name": "can_scale_down", - "type": "TypeBool", - "description": "Can memory scale down as well as up.", - "computed": true - }, - "is_adjustable": { - "name": "is_adjustable", - "type": "TypeBool", - "description": "Is the memory size adjustable.", - "computed": true - }, - "minimum_mb": { - "name": "minimum_mb", - "type": "TypeInt", - "description": "The minimum memory size for a group instance", + "hostname": { + "name": "hostname", + "type": "TypeString", + "description": "Hostname for connection.", "computed": true }, - "step_size_mb": { - "name": "step_size_mb", + "port": { + "name": "port", "type": "TypeInt", - "description": "The step size memory increases or decreases in.", - "computed": true - }, - "units": { - "name": "units", - "type": "TypeString", - "description": "The units memory is allocated in.", + "description": "Port number for connection.", "computed": true } } - } - } - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Resource instance name for example, my Database instance", - "cloud_data_type": "cloud-database", - "required": true, - "cloud_data_range": [ - "resolved_to:name" - ] - }, - { - "name": "guid", - "type": "TypeString", - "description": "Unique identifier of resource instance", - "computed": true - }, - { - "name": "adminpassword", - "type": "TypeString", - "description": "The admin user id for the instance", - "secure": true, - "computed": true - }, - { - "name": "members_disk_allocation_mb", - "type": "TypeInt", - "description": "Disk allocation required for cluster", - "computed": true, - "deprecated": "This field is deprecated please use groups" - }, - { - "name": "configuration_schema", - "type": "TypeString", - "description": "The configuration schema in JSON format", - "computed": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The id of the resource group in which the Database instance is present", - "cloud_data_type": "resource_group", - "optional": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, - { - "name": "location", - "type": "TypeString", - "description": "The location or the region in which the Database instance exists", - "cloud_data_type": "region", - "optional": true - }, - { - "name": "adminuser", - "type": "TypeString", - "description": "The admin user id for the instance", - "computed": true - }, - { - "name": "members_memory_allocation_mb", - "type": "TypeInt", - "description": "Memory allocation required for cluster", - "computed": true, - "deprecated": "This field is deprecated please use groups" - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - "computed": true - } - ], - "ibm_database_backup": [ - { - "name": "is_restorable", - "type": "TypeBool", - "description": "Can this backup be used to restore an instance?.", - "computed": true - }, - { - "name": "download_link", - "type": "TypeString", - "description": "URI which is currently available for file downloading.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "Date and time when this backup was created.", - "computed": true - }, - { - "name": "backup_id", - "type": "TypeString", - "description": "Backup ID.", - "required": true - }, - { - "name": "deployment_id", - "type": "TypeString", - "description": "ID of the deployment this backup relates to.", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of backup.", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of this backup.", - "computed": true - }, - { - "name": "is_downloadable", - "type": "TypeBool", - "description": "Is this backup available to download?.", - "computed": true - } - ], - "ibm_database_backups": [ - { - "name": "backups", - "type": "TypeList", - "description": "An array of backups.", - "computed": true, - "elem": { - "backup_id": { - "name": "backup_id", - "type": "TypeString", - "description": "ID of this backup.", - "computed": true }, - "created_at": { - "name": "created_at", + "path": { + "name": "path", "type": "TypeString", - "description": "Date and time when this backup was created.", + "description": "Path for URI connection.", "computed": true }, - "deployment_id": { - "name": "deployment_id", - "type": "TypeString", - "description": "ID of the deployment this backup relates to.", - "computed": true + "query_options": { + "name": "query_options", + "type": "TypeMap", + "description": "Query options to add to the URI connection.", + "computed": true, + "elem": { + "type": "TypeString" + } }, - "download_link": { - "name": "download_link", + "scheme": { + "name": "scheme", "type": "TypeString", - "description": "URI which is currently available for file downloading.", - "computed": true - }, - "is_downloadable": { - "name": "is_downloadable", - "type": "TypeBool", - "description": "Is this backup available to download?.", + "description": "Scheme/protocol for URI connection.", "computed": true }, - "is_restorable": { - "name": "is_restorable", + "ssl": { + "name": "ssl", "type": "TypeBool", - "description": "Can this backup be used to restore an instance?.", - "computed": true - }, - "status": { - "name": "status", - "type": "TypeString", - "description": "The status of this backup.", + "description": "Indicates ssl is required for the connection.", "computed": true }, "type": { "name": "type", "type": "TypeString", - "description": "The type of backup.", + "description": "Type of connection being described.", "computed": true } } }, { - "name": "deployment_id", - "type": "TypeString", - "description": "ID of the deployment this backup relates to.", - "cloud_data_type": "cloud-database", - "optional": true, - "cloud_data_range": [ - "resolved_to:id" - ] - } - ], - "ibm_database_connection": [ - { - "name": "analytics", + "name": "bi_connector", "type": "TypeList", "computed": true, "elem": { @@ -21876,7 +22252,7 @@ } }, { - "name": "ops_manager", + "name": "mysql", "type": "TypeList", "computed": true, "elem": { @@ -21939,6 +22315,12 @@ "type": "TypeString" } }, + "database": { + "name": "database", + "type": "TypeString", + "description": "Name of the database to use in the URI connection.", + "computed": true + }, "hosts": { "name": "hosts", "type": "TypeList", @@ -21994,19 +22376,7 @@ } }, { - "name": "user_id", - "type": "TypeString", - "description": "User ID.", - "required": true - }, - { - "name": "certificate_root", - "type": "TypeString", - "description": "Optional certificate root path to prepend certificate names. Certificates would be stored in this directory for use by other commands.", - "optional": true - }, - { - "name": "postgres", + "name": "rediss", "type": "TypeList", "computed": true, "elem": { @@ -22071,8 +22441,8 @@ }, "database": { "name": "database", - "type": "TypeString", - "description": "Name of the database to use in the URI connection.", + "type": "TypeInt", + "description": "Number of the database to use in the URI connection.", "computed": true }, "hosts": { @@ -22130,7 +22500,7 @@ } }, { - "name": "mqtts", + "name": "amqps", "type": "TypeList", "computed": true, "elem": { @@ -22248,7 +22618,7 @@ } }, { - "name": "mongodb", + "name": "mqtts", "type": "TypeList", "computed": true, "elem": { @@ -22311,12 +22681,6 @@ "type": "TypeString" } }, - "database": { - "name": "database", - "type": "TypeString", - "description": "Name of the database to use in the URI connection.", - "computed": true - }, "hosts": { "name": "hosts", "type": "TypeList", @@ -22351,12 +22715,6 @@ "type": "TypeString" } }, - "replica_set": { - "name": "replica_set", - "type": "TypeString", - "description": "Name of the replica set to use in the URI connection.", - "computed": true - }, "scheme": { "name": "scheme", "type": "TypeString", @@ -22378,7 +22736,7 @@ } }, { - "name": "bi_connector", + "name": "grpc", "type": "TypeList", "computed": true, "elem": { @@ -22496,30 +22854,40 @@ } }, { - "name": "user_type", - "type": "TypeString", - "description": "User type.", - "required": true - }, - { - "name": "cli", + "name": "mongodb", "type": "TypeList", - "description": "CLI Connection.", "computed": true, "elem": { - "arguments": { - "name": "arguments", + "authentication": { + "name": "authentication", "type": "TypeList", - "description": "Sets of arguments to call the executable with. The outer array corresponds to a possible way to call the CLI; the inner array is the set of arguments to use with that call.", + "description": "Authentication data for Connection String.", "computed": true, "elem": { - "type": "TypeString" + "method": { + "name": "method", + "type": "TypeString", + "description": "Authentication method for this credential.", + "computed": true + }, + "password": { + "name": "password", + "type": "TypeString", + "description": "Password part of credential.", + "computed": true + }, + "username": { + "name": "username", + "type": "TypeString", + "description": "Username part of credential.", + "computed": true + } } }, - "bin": { - "name": "bin", - "type": "TypeString", - "description": "The name of the executable the CLI should run.", + "browser_accessible": { + "name": "browser_accessible", + "type": "TypeBool", + "description": "Indicates the address is accessible by browser.", "computed": true }, "certificate": { @@ -22549,15 +22917,64 @@ "type": "TypeString" } }, - "environment": { - "name": "environment", + "database": { + "name": "database", + "type": "TypeString", + "description": "Name of the database to use in the URI connection.", + "computed": true + }, + "hosts": { + "name": "hosts", + "type": "TypeList", + "computed": true, + "elem": { + "hostname": { + "name": "hostname", + "type": "TypeString", + "description": "Hostname for connection.", + "computed": true + }, + "port": { + "name": "port", + "type": "TypeInt", + "description": "Port number for connection.", + "computed": true + } + } + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "Path for URI connection.", + "computed": true + }, + "query_options": { + "name": "query_options", "type": "TypeMap", - "description": "A map of environment variables for a CLI connection.", + "description": "Query options to add to the URI connection.", "computed": true, "elem": { "type": "TypeString" } }, + "replica_set": { + "name": "replica_set", + "type": "TypeString", + "description": "Name of the replica set to use in the URI connection.", + "computed": true + }, + "scheme": { + "name": "scheme", + "type": "TypeString", + "description": "Scheme/protocol for URI connection.", + "computed": true + }, + "ssl": { + "name": "ssl", + "type": "TypeBool", + "description": "Indicates ssl is required for the connection.", + "computed": true + }, "type": { "name": "type", "type": "TypeString", @@ -22638,7 +23055,7 @@ } }, { - "name": "rediss", + "name": "emp", "type": "TypeList", "computed": true, "elem": { @@ -22701,12 +23118,6 @@ "type": "TypeString" } }, - "database": { - "name": "database", - "type": "TypeInt", - "description": "Number of the database to use in the URI connection.", - "computed": true - }, "hosts": { "name": "hosts", "type": "TypeList", @@ -22762,7 +23173,20 @@ } }, { - "name": "https", + "name": "user_type", + "type": "TypeString", + "description": "User type.", + "required": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "Endpoint Type. The endpoint must be enabled on the deployment before its connection information can be fetched.", + "required": true, + "options": "public, private, public-and-private" + }, + { + "name": "postgres", "type": "TypeList", "computed": true, "elem": { @@ -22825,6 +23249,12 @@ "type": "TypeString" } }, + "database": { + "name": "database", + "type": "TypeString", + "description": "Name of the database to use in the URI connection.", + "computed": true + }, "hosts": { "name": "hosts", "type": "TypeList", @@ -22880,40 +23310,40 @@ } }, { - "name": "emp", + "name": "deployment_id", + "type": "TypeString", + "description": "Deployment ID.", + "cloud_data_type": "cloud-database", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "certificate_root", + "type": "TypeString", + "description": "Optional certificate root path to prepend certificate names. Certificates would be stored in this directory for use by other commands.", + "optional": true + }, + { + "name": "cli", "type": "TypeList", + "description": "CLI Connection.", "computed": true, "elem": { - "authentication": { - "name": "authentication", + "arguments": { + "name": "arguments", "type": "TypeList", - "description": "Authentication data for Connection String.", + "description": "Sets of arguments to call the executable with. The outer array corresponds to a possible way to call the CLI; the inner array is the set of arguments to use with that call.", "computed": true, "elem": { - "method": { - "name": "method", - "type": "TypeString", - "description": "Authentication method for this credential.", - "computed": true - }, - "password": { - "name": "password", - "type": "TypeString", - "description": "Password part of credential.", - "computed": true - }, - "username": { - "name": "username", - "type": "TypeString", - "description": "Username part of credential.", - "computed": true - } + "type": "TypeString" } }, - "browser_accessible": { - "name": "browser_accessible", - "type": "TypeBool", - "description": "Indicates the address is accessible by browser.", + "bin": { + "name": "bin", + "type": "TypeString", + "description": "The name of the executable the CLI should run.", "computed": true }, "certificate": { @@ -22943,52 +23373,15 @@ "type": "TypeString" } }, - "hosts": { - "name": "hosts", - "type": "TypeList", - "computed": true, - "elem": { - "hostname": { - "name": "hostname", - "type": "TypeString", - "description": "Hostname for connection.", - "computed": true - }, - "port": { - "name": "port", - "type": "TypeInt", - "description": "Port number for connection.", - "computed": true - } - } - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "Path for URI connection.", - "computed": true - }, - "query_options": { - "name": "query_options", + "environment": { + "name": "environment", "type": "TypeMap", - "description": "Query options to add to the URI connection.", + "description": "A map of environment variables for a CLI connection.", "computed": true, "elem": { "type": "TypeString" } }, - "scheme": { - "name": "scheme", - "type": "TypeString", - "description": "Scheme/protocol for URI connection.", - "computed": true - }, - "ssl": { - "name": "ssl", - "type": "TypeBool", - "description": "Indicates ssl is required for the connection.", - "computed": true - }, "type": { "name": "type", "type": "TypeString", @@ -22998,24 +23391,7 @@ } }, { - "name": "deployment_id", - "type": "TypeString", - "description": "Deployment ID.", - "cloud_data_type": "cloud-database", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "Endpoint Type. The endpoint must be enabled on the deployment before its connection information can be fetched.", - "required": true, - "options": "public, private, public-and-private" - }, - { - "name": "amqps", + "name": "https", "type": "TypeList", "computed": true, "elem": { @@ -23133,7 +23509,7 @@ } }, { - "name": "stomp_ssl", + "name": "analytics", "type": "TypeList", "computed": true, "elem": { @@ -23251,7 +23627,7 @@ } }, { - "name": "grpc", + "name": "ops_manager", "type": "TypeList", "computed": true, "elem": { @@ -23369,128 +23745,10 @@ } }, { - "name": "mysql", - "type": "TypeList", - "computed": true, - "elem": { - "authentication": { - "name": "authentication", - "type": "TypeList", - "description": "Authentication data for Connection String.", - "computed": true, - "elem": { - "method": { - "name": "method", - "type": "TypeString", - "description": "Authentication method for this credential.", - "computed": true - }, - "password": { - "name": "password", - "type": "TypeString", - "description": "Password part of credential.", - "computed": true - }, - "username": { - "name": "username", - "type": "TypeString", - "description": "Username part of credential.", - "computed": true - } - } - }, - "browser_accessible": { - "name": "browser_accessible", - "type": "TypeBool", - "description": "Indicates the address is accessible by browser.", - "computed": true - }, - "certificate": { - "name": "certificate", - "type": "TypeList", - "computed": true, - "elem": { - "certificate_base64": { - "name": "certificate_base64", - "type": "TypeString", - "description": "Base64 encoded version of the certificate.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name associated with the certificate.", - "computed": true - } - } - }, - "composed": { - "name": "composed", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "database": { - "name": "database", - "type": "TypeString", - "description": "Name of the database to use in the URI connection.", - "computed": true - }, - "hosts": { - "name": "hosts", - "type": "TypeList", - "computed": true, - "elem": { - "hostname": { - "name": "hostname", - "type": "TypeString", - "description": "Hostname for connection.", - "computed": true - }, - "port": { - "name": "port", - "type": "TypeInt", - "description": "Port number for connection.", - "computed": true - } - } - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "Path for URI connection.", - "computed": true - }, - "query_options": { - "name": "query_options", - "type": "TypeMap", - "description": "Query options to add to the URI connection.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "scheme": { - "name": "scheme", - "type": "TypeString", - "description": "Scheme/protocol for URI connection.", - "computed": true - }, - "ssl": { - "name": "ssl", - "type": "TypeBool", - "description": "Indicates ssl is required for the connection.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of connection being described.", - "computed": true - } - } + "name": "user_id", + "type": "TypeString", + "description": "User ID.", + "required": true } ], "ibm_database_point_in_time_recovery": [ @@ -23538,6 +23796,12 @@ } ], "ibm_database_task": [ + { + "name": "deployment_id", + "type": "TypeString", + "description": "ID of the deployment the task is being performed on.", + "computed": true + }, { "name": "progress_percent", "type": "TypeInt", @@ -23567,12 +23831,6 @@ "type": "TypeString", "description": "The status of the task.", "computed": true - }, - { - "name": "deployment_id", - "type": "TypeString", - "description": "ID of the deployment the task is being performed on.", - "computed": true } ], "ibm_database_tasks": [ @@ -23632,15 +23890,27 @@ ], "ibm_dl_export_route_filter": [ { - "name": "le", - "type": "TypeInt", - "description": "The maximum matching length of the prefix-set", + "name": "ex_filter_id", + "type": "TypeString", + "description": "Export route Filter identifier", + "required": true + }, + { + "name": "action", + "type": "TypeString", + "description": "Determines whether the routes that match the prefix-set will be permit or deny", "computed": true }, { - "name": "prefix", + "name": "created_at", "type": "TypeString", - "description": "IP prefix representing an address and mask length of the prefix-set", + "description": "The date and time of the export route filter was created", + "computed": true + }, + { + "name": "le", + "type": "TypeInt", + "description": "The maximum matching length of the prefix-set", "computed": true }, { @@ -23655,12 +23925,6 @@ "description": "The Direct Link gateway identifier", "required": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time of the export route filter was created", - "computed": true - }, { "name": "before", "type": "TypeString", @@ -23674,15 +23938,9 @@ "computed": true }, { - "name": "ex_filter_id", - "type": "TypeString", - "description": "Export route Filter identifier", - "required": true - }, - { - "name": "action", + "name": "prefix", "type": "TypeString", - "description": "Determines whether the routes that match the prefix-set will be permit or deny", + "description": "IP prefix representing an address and mask length of the prefix-set", "computed": true } ], @@ -23753,109 +24011,68 @@ ], "ibm_dl_gateway": [ { - "name": "completion_notice_reject_reason", - "type": "TypeString", - "description": "Reason for completion notice rejection", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN (Cloud Resource Name) of this gateway", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Gateway resource group", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "authentication_key", - "type": "TypeString", - "description": "BGP MD5 authentication key", - "computed": true - }, - { - "name": "bfd_status", - "type": "TypeString", - "description": "BFD Status", - "computed": true - }, - { - "name": "bgp_asn", - "type": "TypeInt", - "description": "BGP ASN", - "computed": true - }, - { - "name": "bgp_ibm_cidr", - "type": "TypeString", - "description": "BGP IBM CIDR", - "computed": true - }, - { - "name": "vlan", - "type": "TypeInt", - "description": "VLAN allocated for this gateway", - "computed": true - }, - { - "name": "gateway_vcs", + "name": "as_prepends", "type": "TypeList", - "description": "Collection of direct link gateway virtual connections", + "description": "List of AS Prepend configuration information", "computed": true, "elem": { "created_at": { "name": "created_at", "type": "TypeString", - "description": "The date and time resource was created", + "description": "The date and time AS Prepend was created", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this virtual connection", + "description": "The date and time AS Prepend was created", "computed": true }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this virtual connection. Virtualconnection names are unique within a gateway. This is the name of thevirtual connection itself, the network being connected may have its ownname attribute", + "length": { + "name": "length", + "type": "TypeInt", + "description": "Number of times the ASN to appended to the AS Path", "computed": true }, - "network_account": { - "name": "network_account", + "policy": { + "name": "policy", "type": "TypeString", - "description": "For virtual connections across two different IBM Cloud Accounts network_account indicates the account that owns the target network.", + "description": "Route type this AS Prepend applies to", "computed": true }, - "network_id": { - "name": "network_id", + "prefix": { + "name": "prefix", "type": "TypeString", - "description": "Unique identifier of the target network. For type=vpc virtual connections this is the CRN of the target VPC. This field does not apply to type=classic connections.", + "description": "Comma separated list of prefixes this AS Prepend applies to. Maximum of 10 prefixes. If not specified, this AS Prepend applies to all prefixes.", "computed": true }, - "status": { - "name": "status", - "type": "TypeString", - "description": "Status of the virtual connection.Possible values: [pending,attached,approval_pending,rejected,expired,deleting,detached_by_network_pending,detached_by_network]", - "computed": true + "specific_prefixes": { + "name": "specific_prefixes", + "type": "TypeList", + "description": "Array of prefixes this AS Prepend applies to", + "computed": true, + "elem": { + "type": "TypeString" + } }, - "type": { - "name": "type", + "updated_at": { + "name": "updated_at", "type": "TypeString", - "description": "The type of virtual connection. (classic,vpc)", + "description": "The date and time AS Prepend was updated", "computed": true } } }, { - "name": "bfd_multiplier", - "type": "TypeInt", - "description": "BFD Multiplier", + "name": "authentication_key", + "type": "TypeString", + "description": "BGP MD5 authentication key", + "computed": true + }, + { + "name": "bgp_status", + "type": "TypeString", + "description": "Gateway BGP status", "computed": true }, { @@ -23864,12 +24081,24 @@ "description": "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", "computed": true }, + { + "name": "type", + "type": "TypeString", + "description": "Gateway type", + "computed": true + }, { "name": "cross_connect_router", "type": "TypeString", "description": "Cross connect router", "computed": true }, + { + "name": "metered", + "type": "TypeBool", + "description": "Metered billing option", + "computed": true + }, { "name": "operational_status", "type": "TypeString", @@ -23877,15 +24106,21 @@ "computed": true }, { - "name": "type", + "name": "port", "type": "TypeString", - "description": "Gateway type", + "description": "Gateway port", "computed": true }, { - "name": "default_export_route_filter", + "name": "bfd_status_updated_at", "type": "TypeString", - "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "description": "BFD Status", + "computed": true + }, + { + "name": "bgp_ibm_cidr", + "type": "TypeString", + "description": "BGP IBM CIDR", "computed": true }, { @@ -23968,12 +24203,38 @@ } } }, + { + "name": "change_request", + "type": "TypeString", + "description": "Changes pending approval for provider managed Direct Link Connect gateways", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN (Cloud Resource Name) of this gateway", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "bgp_status_updated_at", + "type": "TypeString", + "description": "Date and time BGP status was updated", + "optional": true, + "computed": true + }, { "name": "link_status", "type": "TypeString", "description": "Gateway link status", "computed": true }, + { + "name": "default_import_route_filter", + "type": "TypeString", + "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "computed": true + }, { "name": "link_status_updated_at", "type": "TypeString", @@ -23994,15 +24255,21 @@ "computed": true }, { - "name": "port", - "type": "TypeString", - "description": "Gateway port", + "name": "provider_api_managed", + "type": "TypeBool", + "description": "Indicates whether gateway was created through a provider portal", "computed": true }, { - "name": "bfd_status_updated_at", + "name": "speed_mbps", + "type": "TypeInt", + "description": "Gateway speed in megabits per second", + "computed": true + }, + { + "name": "bgp_base_cidr", "type": "TypeString", - "description": "BFD Status", + "description": "BGP base CIDR", "computed": true }, { @@ -24012,98 +24279,108 @@ "computed": true }, { - "name": "default_import_route_filter", + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this gateway", + "required": true + }, + { + "name": "default_export_route_filter", "type": "TypeString", "description": "The default directional route filter action that applies to routes that do not match any directional route filters", "computed": true }, { - "name": "bgp_base_cidr", - "type": "TypeString", - "description": "BGP base CIDR", + "name": "bfd_interval", + "type": "TypeInt", + "description": "BFD Interval", "computed": true }, { - "name": "bgp_status", + "name": "bgp_asn", + "type": "TypeInt", + "description": "BGP ASN", + "computed": true + }, + { + "name": "completion_notice_reject_reason", "type": "TypeString", - "description": "Gateway BGP status", + "description": "Reason for completion notice rejection", "computed": true }, { - "name": "name", + "name": "vlan", + "type": "TypeInt", + "description": "VLAN allocated for this gateway", + "computed": true + }, + { + "name": "resource_group", "type": "TypeString", - "description": "The unique user-defined name for this gateway", - "required": true + "description": "Gateway resource group", + "cloud_data_type": "resource_group", + "computed": true }, { - "name": "as_prepends", + "name": "gateway_vcs", "type": "TypeList", - "description": "List of AS Prepend configuration information", + "description": "Collection of direct link gateway virtual connections", "computed": true, "elem": { "created_at": { "name": "created_at", "type": "TypeString", - "description": "The date and time AS Prepend was created", + "description": "The date and time resource was created", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The date and time AS Prepend was created", + "description": "The unique identifier for this virtual connection", "computed": true }, - "length": { - "name": "length", - "type": "TypeInt", - "description": "Number of times the ASN to appended to the AS Path", + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this virtual connection. Virtualconnection names are unique within a gateway. This is the name of thevirtual connection itself, the network being connected may have its ownname attribute", "computed": true }, - "policy": { - "name": "policy", + "network_account": { + "name": "network_account", "type": "TypeString", - "description": "Route type this AS Prepend applies to", + "description": "For virtual connections across two different IBM Cloud Accounts network_account indicates the account that owns the target network.", "computed": true }, - "prefix": { - "name": "prefix", + "network_id": { + "name": "network_id", "type": "TypeString", - "description": "Comma separated list of prefixes this AS Prepend applies to. Maximum of 10 prefixes. If not specified, this AS Prepend applies to all prefixes.", + "description": "Unique identifier of the target network. For type=vpc virtual connections this is the CRN of the target VPC. This field does not apply to type=classic connections.", "computed": true }, - "specific_prefixes": { - "name": "specific_prefixes", - "type": "TypeList", - "description": "Array of prefixes this AS Prepend applies to", - "computed": true, - "elem": { - "type": "TypeString" - } + "status": { + "name": "status", + "type": "TypeString", + "description": "Status of the virtual connection.Possible values: [pending,attached,approval_pending,rejected,expired,deleting,detached_by_network_pending,detached_by_network]", + "computed": true }, - "updated_at": { - "name": "updated_at", + "type": { + "name": "type", "type": "TypeString", - "description": "The date and time AS Prepend was updated", + "description": "The type of virtual connection. (classic,vpc)", "computed": true } } }, { - "name": "change_request", - "type": "TypeString", - "description": "Changes pending approval for provider managed Direct Link Connect gateways", - "computed": true - }, - { - "name": "metered", - "type": "TypeBool", - "description": "Metered billing option", + "name": "bfd_multiplier", + "type": "TypeInt", + "description": "BFD Multiplier", "computed": true }, { - "name": "bfd_interval", - "type": "TypeInt", - "description": "BFD Interval", + "name": "bfd_status", + "type": "TypeString", + "description": "BFD Status", "computed": true }, { @@ -24112,12 +24389,6 @@ "description": "BGP customer edge router CIDR", "computed": true }, - { - "name": "global", - "type": "TypeBool", - "description": "Gateways with global routing (true) can connect to networks outside their associated region", - "computed": true - }, { "name": "bgp_ibm_asn", "type": "TypeInt", @@ -24125,22 +24396,9 @@ "computed": true }, { - "name": "bgp_status_updated_at", - "type": "TypeString", - "description": "Date and time BGP status was updated", - "optional": true, - "computed": true - }, - { - "name": "provider_api_managed", + "name": "global", "type": "TypeBool", - "description": "Indicates whether gateway was created through a provider portal", - "computed": true - }, - { - "name": "speed_mbps", - "type": "TypeInt", - "description": "Gateway speed in megabits per second", + "description": "Gateways with global routing (true) can connect to networks outside their associated region", "computed": true } ], @@ -24500,13 +24758,6 @@ } ], "ibm_dl_import_route_filter": [ - { - "name": "gateway", - "type": "TypeString", - "description": "The Direct Link gateway identifier", - "immutable": true, - "required": true - }, { "name": "im_filter_id", "type": "TypeString", @@ -24515,39 +24766,40 @@ "required": true }, { - "name": "ge", - "type": "TypeInt", - "description": "The minimum matching length of the prefix-set", + "name": "before", + "type": "TypeString", + "description": "Identifier of the next route filter to be considered", "computed": true }, { - "name": "updated_at", + "name": "created_at", "type": "TypeString", - "description": "The date and time of the import route filter was last updated", + "description": "The date and time of the import route filter was created", "computed": true }, { - "name": "action", - "type": "TypeString", - "description": "Determines whether the routes that match the prefix-set will be permit or deny", + "name": "le", + "type": "TypeInt", + "description": "The maximum matching length of the prefix-set", "computed": true }, { - "name": "before", + "name": "gateway", "type": "TypeString", - "description": "Identifier of the next route filter to be considered", - "computed": true + "description": "The Direct Link gateway identifier", + "immutable": true, + "required": true }, { - "name": "created_at", + "name": "action", "type": "TypeString", - "description": "The date and time of the import route filter was created", + "description": "Determines whether the routes that match the prefix-set will be permit or deny", "computed": true }, { - "name": "le", + "name": "ge", "type": "TypeInt", - "description": "The maximum matching length of the prefix-set", + "description": "The minimum matching length of the prefix-set", "computed": true }, { @@ -24555,6 +24807,12 @@ "type": "TypeString", "description": "IP prefix representing an address and mask length of the prefix-set", "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time of the import route filter was last updated", + "computed": true } ], "ibm_dl_import_route_filters": [ @@ -25024,6 +25282,46 @@ } ], "ibm_dl_route_report": [ + { + "name": "gateway_routes", + "type": "TypeList", + "description": "List of gateway routes", + "computed": true, + "elem": { + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "Prefix for gateway routes", + "computed": true + } + } + }, + { + "name": "on_prem_routes", + "type": "TypeList", + "description": "List of onprem routes", + "computed": true, + "elem": { + "as_path": { + "name": "as_path", + "type": "TypeString", + "description": "The BGP AS path of the route", + "computed": true + }, + "next_hop": { + "name": "next_hop", + "type": "TypeString", + "description": "Next Hop address", + "computed": true + }, + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "Prefix for onprem routes", + "computed": true + } + } + }, { "name": "overlapping_routes", "type": "TypeList", @@ -25059,9 +25357,9 @@ } }, { - "name": "status", + "name": "updated_at", "type": "TypeString", - "description": "Route report status", + "description": "The date and time resource was created", "computed": true }, { @@ -25104,52 +25402,6 @@ } } }, - { - "name": "gateway_routes", - "type": "TypeList", - "description": "List of gateway routes", - "computed": true, - "elem": { - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "Prefix for gateway routes", - "computed": true - } - } - }, - { - "name": "on_prem_routes", - "type": "TypeList", - "description": "List of onprem routes", - "computed": true, - "elem": { - "as_path": { - "name": "as_path", - "type": "TypeString", - "description": "The BGP AS path of the route", - "computed": true - }, - "next_hop": { - "name": "next_hop", - "type": "TypeString", - "description": "Next Hop address", - "computed": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "Prefix for onprem routes", - "computed": true - } - } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The date and time resource was created", - "computed": true - }, { "name": "virtual_connection_routes", "type": "TypeList", @@ -25201,6 +25453,12 @@ "computed": true } } + }, + { + "name": "status", + "type": "TypeString", + "description": "Route report status", + "computed": true } ], "ibm_dl_route_reports": [ @@ -25493,6 +25751,16 @@ } ], "ibm_dns_custom_resolver_secondary_zones": [ + { + "name": "instance_id", + "type": "TypeString", + "description": "The GUID of the DNS Services instance.", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + }, { "name": "resolver_id", "type": "TypeString", @@ -25551,16 +25819,6 @@ "computed": true } } - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "The GUID of the DNS Services instance.", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] } ], "ibm_dns_custom_resolvers": [ @@ -25659,15 +25917,6 @@ } ], "ibm_dns_domain_registration": [ - { - "name": "name_servers", - "type": "TypeList", - "description": "Custom name servers for the domain registration", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "id", "type": "TypeInt", @@ -25679,6 +25928,15 @@ "type": "TypeString", "description": "The name of the domain registration", "required": true + }, + { + "name": "name_servers", + "type": "TypeList", + "description": "Custom name servers for the domain registration", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_dns_glb_monitors": [ @@ -26043,6 +26301,22 @@ } ], "ibm_dns_permitted_networks": [ + { + "name": "instance_id", + "type": "TypeString", + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + }, + { + "name": "zone_id", + "type": "TypeString", + "description": "Zone ID", + "required": true + }, { "name": "dns_permitted_networks", "type": "TypeList", @@ -26098,41 +26372,9 @@ "computed": true } } - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] - }, - { - "name": "zone_id", - "type": "TypeString", - "description": "Zone ID", - "required": true } ], "ibm_dns_resource_records": [ - { - "name": "instance_id", - "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] - }, - { - "name": "zone_id", - "type": "TypeString", - "description": "Zone Id", - "required": true - }, { "name": "dns_resource_records", "type": "TypeList", @@ -26170,14 +26412,25 @@ "computed": true } } - } - ], - "ibm_dns_secondary": [ + }, { - "name": "master_ip_address", + "name": "instance_id", "type": "TypeString", - "computed": true + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] }, + { + "name": "zone_id", + "type": "TypeString", + "description": "Zone Id", + "required": true + } + ], + "ibm_dns_secondary": [ { "name": "transfer_frequency", "type": "TypeInt", @@ -26198,19 +26451,14 @@ "type": "TypeString", "description": "The name of the secondary", "required": true + }, + { + "name": "master_ip_address", + "type": "TypeString", + "computed": true } ], "ibm_dns_zones": [ - { - "name": "instance_id", - "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] - }, { "name": "dns_zones", "type": "TypeList", @@ -26266,21 +26514,19 @@ "computed": true } } - } - ], - "ibm_en_destination_android": [ - { - "name": "destination_id", - "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true }, { - "name": "name", + "name": "instance_id", "type": "TypeString", - "description": "Destination name.", - "computed": true - }, + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + } + ], + "ibm_en_destination_android": [ { "name": "config", "type": "TypeList", @@ -26321,20 +26567,23 @@ } }, { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true }, { - "name": "instance_guid", + "name": "destination_id", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "description": "Unique identifier for Destination.", "required": true }, + { + "name": "name", + "type": "TypeString", + "description": "Destination name.", + "computed": true + }, { "name": "description", "type": "TypeString", @@ -26354,13 +26603,49 @@ "computed": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true } ], "ibm_en_destination_ce": [ + { + "name": "type", + "type": "TypeString", + "description": "Destination type Webhook.", + "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true + }, { "name": "name", "type": "TypeString", @@ -26368,15 +26653,15 @@ "computed": true }, { - "name": "description", - "type": "TypeString", - "description": "Destination description.", + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true }, { - "name": "type", + "name": "description", "type": "TypeString", - "description": "Destination type Webhook.", + "description": "Destination description.", "computed": true }, { @@ -26429,16 +26714,9 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, + } + ], + "ibm_en_destination_cf": [ { "name": "instance_guid", "type": "TypeString", @@ -26446,23 +26724,9 @@ "required": true }, { - "name": "destination_id", - "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - } - ], - "ibm_en_destination_cf": [ - { - "name": "updated_at", + "name": "description", "type": "TypeString", - "description": "Last updated time.", + "description": "Destination description.", "computed": true }, { @@ -26526,44 +26790,23 @@ } }, { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "description", + "name": "updated_at", "type": "TypeString", - "description": "Destination description.", + "description": "Last updated time.", "computed": true } ], "ibm_en_destination_chrome": [ { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "name", + "name": "description", "type": "TypeString", - "description": "Destination name.", + "description": "Destination description.", "computed": true }, { - "name": "updated_at", + "name": "type", "type": "TypeString", - "description": "Last updated time.", + "description": "Destination type push_chrome.", "computed": true }, { @@ -26601,31 +26844,26 @@ } }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "destination_id", + "name": "instance_guid", "type": "TypeString", - "description": "Unique identifier for Destination.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, { - "name": "description", + "name": "destination_id", "type": "TypeString", - "description": "Destination description.", - "computed": true + "description": "Unique identifier for Destination.", + "required": true }, - { - "name": "type", - "type": "TypeString", - "description": "Destination type push_chrome.", - "computed": true - } - ], - "ibm_en_destination_cos": [ { "name": "name", "type": "TypeString", @@ -26643,6 +26881,14 @@ "type": "TypeInt", "description": "Number of subscriptions.", "computed": true + } + ], + "ibm_en_destination_cos": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true }, { "name": "subscription_names", @@ -26660,10 +26906,10 @@ "required": true }, { - "name": "destination_id", + "name": "name", "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true + "description": "Destination name.", + "computed": true }, { "name": "description", @@ -26709,25 +26955,49 @@ } } } + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true } ], - "ibm_en_destination_firefox": [ + "ibm_en_destination_custom_email": [ { - "name": "type", + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "description", "type": "TypeString", - "description": "Destination type push_firefox.", + "description": "Destination description.", "computed": true }, { - "name": "instance_guid", + "name": "destination_id", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "description": "Unique identifier for Destination.", "required": true }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "Destination description.", + "description": "Destination name.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Destination type slack.", "computed": true }, { @@ -26741,17 +27011,11 @@ "type": "TypeList", "computed": true, "elem": { - "pre_prod": { - "name": "pre_prod", - "type": "TypeBool", - "description": "The flag to enable destination as pre-prod or prod", - "computed": true - }, - "website_url": { - "name": "website_url", + "domain": { + "name": "domain", "type": "TypeString", - "description": "The website url", - "optional": true + "description": "The custom doamin", + "computed": true } } } @@ -26764,11 +27028,22 @@ "computed": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + } + ], + "ibm_en_destination_firefox": [ { "name": "subscription_names", "type": "TypeList", @@ -26779,9 +27054,9 @@ } }, { - "name": "destination_id", + "name": "instance_guid", "type": "TypeString", - "description": "Unique identifier for Destination.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, { @@ -26789,13 +27064,11 @@ "type": "TypeString", "description": "Destination name.", "computed": true - } - ], - "ibm_en_destination_huawei": [ + }, { - "name": "description", + "name": "type", "type": "TypeString", - "description": "Destination description.", + "description": "Destination type push_firefox.", "computed": true }, { @@ -26809,61 +27082,54 @@ "type": "TypeList", "computed": true, "elem": { - "client_id": { - "name": "client_id", - "type": "TypeString", - "description": "ClientID for the Huawei account oauth.", - "computed": true - }, - "client_secret": { - "name": "client_secret", - "type": "TypeString", - "description": "ClientSecret for the Huawei account oauth", - "computed": true - }, "pre_prod": { "name": "pre_prod", "type": "TypeBool", "description": "The flag to enable destination as pre-prod or prod", "computed": true + }, + "website_url": { + "name": "website_url", + "type": "TypeString", + "description": "The website url", + "optional": true } } } } }, { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true }, { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true }, { - "name": "instance_guid", + "name": "description", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true + "description": "Destination description.", + "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + } + ], + "ibm_en_destination_huawei": [ { "name": "destination_id", "type": "TypeString", "description": "Unique identifier for Destination.", "required": true }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -26871,13 +27137,11 @@ "computed": true }, { - "name": "type", - "type": "TypeString", - "description": "Destination type push_android.", + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true - } - ], - "ibm_en_destination_ios": [ + }, { "name": "updated_at", "type": "TypeString", @@ -26893,6 +27157,12 @@ "type": "TypeString" } }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, { "name": "description", "type": "TypeString", @@ -26902,13 +27172,63 @@ { "name": "type", "type": "TypeString", - "description": "Destination type push_ios.", + "description": "Destination type push_android.", "computed": true }, { - "name": "certificate_content_type", + "name": "config", + "type": "TypeList", + "description": "Payload describing a destination configuration.", + "computed": true, + "elem": { + "params": { + "name": "params", + "type": "TypeList", + "computed": true, + "elem": { + "client_id": { + "name": "client_id", + "type": "TypeString", + "description": "ClientID for the Huawei account oauth.", + "computed": true + }, + "client_secret": { + "name": "client_secret", + "type": "TypeString", + "description": "ClientSecret for the Huawei account oauth", + "computed": true + }, + "pre_prod": { + "name": "pre_prod", + "type": "TypeBool", + "description": "The flag to enable destination as pre-prod or prod", + "computed": true + } + } + } + } + } + ], + "ibm_en_destination_ios": [ + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", "type": "TypeString", - "description": "The Certificate Content Type to be set p8/p12.", + "description": "Destination name.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Destination description.", "computed": true }, { @@ -26917,6 +27237,12 @@ "description": "The Certificate File.", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "config", "type": "TypeList", @@ -26993,33 +27319,30 @@ "required": true }, { - "name": "name", + "name": "type", "type": "TypeString", - "description": "Destination name.", + "description": "Destination type push_ios.", + "computed": true + }, + { + "name": "certificate_content_type", + "type": "TypeString", + "description": "The Certificate Content Type to be set p8/p12.", "computed": true } ], "ibm_en_destination_msteams": [ { - "name": "config", - "type": "TypeList", - "description": "Payload describing a destination configuration.", - "computed": true, - "elem": { - "params": { - "name": "params", - "type": "TypeList", - "computed": true, - "elem": { - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of msteams", - "computed": true - } - } - } - } + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Destination description.", + "computed": true }, { "name": "updated_at", @@ -27043,9 +27366,9 @@ } }, { - "name": "destination_id", + "name": "instance_guid", "type": "TypeString", - "description": "Unique identifier for Destination.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, { @@ -27054,12 +27377,6 @@ "description": "Destination name.", "computed": true }, - { - "name": "description", - "type": "TypeString", - "description": "Destination description.", - "computed": true - }, { "name": "type", "type": "TypeString", @@ -27067,40 +27384,28 @@ "computed": true }, { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - } - ], - "ibm_en_destination_pagerduty": [ - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, - { - "name": "subscription_names", + "name": "config", "type": "TypeList", - "description": "List of subscriptions.", + "description": "Payload describing a destination configuration.", "computed": true, "elem": { - "type": "TypeString" + "params": { + "name": "params", + "type": "TypeList", + "computed": true, + "elem": { + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of msteams", + "computed": true + } + } + } } - }, - { - "name": "destination_id", - "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Destination name.", - "computed": true - }, + } + ], + "ibm_en_destination_pagerduty": [ { "name": "description", "type": "TypeString", @@ -27140,38 +27445,6 @@ "description": "Last updated time.", "computed": true }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Destination type push_chrome.", - "computed": true - } - ], - "ibm_en_destination_safari": [ - { - "name": "name", - "type": "TypeString", - "description": "Destination name.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Destination description.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, { "name": "subscription_count", "type": "TypeInt", @@ -27199,10 +27472,36 @@ "description": "Unique identifier for Destination.", "required": true }, + { + "name": "name", + "type": "TypeString", + "description": "Destination name.", + "computed": true + }, { "name": "type", "type": "TypeString", - "description": "Destination type push_ios.", + "description": "Destination type push_chrome.", + "computed": true + } + ], + "ibm_en_destination_safari": [ + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Destination description.", + "computed": true + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true }, { @@ -27261,13 +27560,52 @@ } } } + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Destination name.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Destination type push_ios.", + "computed": true } ], "ibm_en_destination_slack": [ { - "name": "name", + "name": "instance_guid", "type": "TypeString", - "description": "Destination name.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Destination description.", "computed": true }, { @@ -27277,10 +27615,13 @@ "computed": true }, { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "destination_id", @@ -27289,9 +27630,9 @@ "required": true }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "Destination description.", + "description": "Destination name.", "computed": true }, { @@ -27326,18 +27667,33 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_en_destination_sn": [ + { + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Destination name.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Destination type push_chrome.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "subscription_count", "type": "TypeInt", @@ -27350,24 +27706,12 @@ "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, - { - "name": "destination_id", - "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true - }, { "name": "description", "type": "TypeString", "description": "Destination description.", "computed": true }, - { - "name": "type", - "type": "TypeString", - "description": "Destination type push_chrome.", - "computed": true - }, { "name": "config", "type": "TypeList", @@ -27413,18 +27757,6 @@ } } }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Destination name.", - "computed": true - }, { "name": "subscription_names", "type": "TypeList", @@ -27436,51 +27768,6 @@ } ], "ibm_en_destination_webhook": [ - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "destination_id", - "type": "TypeString", - "description": "Unique identifier for Destination.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Destination name.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Destination description.", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Destination type Webhook.", - "computed": true - }, { "name": "config", "type": "TypeList", @@ -27526,6 +27813,51 @@ } } }, + { + "name": "type", + "type": "TypeString", + "description": "Destination type Webhook.", + "computed": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Unique identifier for Destination.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Destination name.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Destination description.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "instance_guid", "type": "TypeString", @@ -27607,6 +27939,12 @@ } ], "ibm_en_integration": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "instance_guid", "type": "TypeString", @@ -27618,12 +27956,6 @@ "type": "TypeString", "description": "Unique identifier for Source.", "required": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true } ], "ibm_en_integrations": [ @@ -27673,6 +28005,18 @@ } ], "ibm_en_source": [ + { + "name": "description", + "type": "TypeString", + "description": "Source description.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "enabled", "type": "TypeBool", @@ -27696,18 +28040,6 @@ "type": "TypeString", "description": "Source name.", "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Source description.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true } ], "ibm_en_sources": [ @@ -27781,18 +28113,6 @@ } ], "ibm_en_subscription_android": [ - { - "name": "subscription_id", - "type": "TypeString", - "description": "Unique identifier for result.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "computed": true - }, { "name": "description", "type": "TypeString", @@ -27822,27 +28142,21 @@ "type": "TypeString", "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true - } - ], - "ibm_en_subscription_ce": [ - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "computed": true }, { - "name": "updated_at", + "name": "subscription_id", "type": "TypeString", - "description": "Last updated time.", - "computed": true + "description": "Unique identifier for result.", + "required": true }, { - "name": "instance_guid", + "name": "name", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, + "description": "Subscription name.", + "computed": true + } + ], + "ibm_en_subscription_ce": [ { "name": "subscription_id", "type": "TypeString", @@ -27866,9 +28180,33 @@ "type": "TypeString", "description": "The destination ID.", "computed": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true } ], "ibm_en_subscription_cf": [ + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, { "name": "description", "type": "TypeString", @@ -27904,27 +28242,9 @@ "type": "TypeString", "description": "Unique identifier for result.", "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "computed": true } ], "ibm_en_subscription_chrome": [ - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, { "name": "instance_guid", "type": "TypeString", @@ -27954,21 +28274,21 @@ "type": "TypeString", "description": "The destination ID.", "computed": true - } - ], - "ibm_en_subscription_cos": [ + }, { - "name": "name", + "name": "topic_id", "type": "TypeString", - "description": "Subscription name.", + "description": "Topic ID.", "computed": true }, { - "name": "description", + "name": "updated_at", "type": "TypeString", - "description": "Subscription description.", + "description": "Last updated time.", "computed": true - }, + } + ], + "ibm_en_subscription_cos": [ { "name": "destination_id", "type": "TypeString", @@ -27998,9 +28318,27 @@ "type": "TypeString", "description": "Unique identifier for result.", "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true } ], - "ibm_en_subscription_email": [ + "ibm_en_subscription_custom_email": [ + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true + }, { "name": "destination_id", "type": "TypeString", @@ -28024,6 +28362,13 @@ "description": "Whether to add the notification payload to the email.", "computed": true }, + "from_email": { + "name": "from_email", + "type": "TypeString", + "description": "The email from where it is sourced", + "optional": true, + "computed": true + }, "from_name": { "name": "from_name", "type": "TypeString", @@ -28096,6 +28441,20 @@ } } }, + "template_id_invitation": { + "name": "template_id_invitation", + "type": "TypeString", + "description": "The templete id for invitation", + "optional": true, + "computed": true + }, + "template_id_notification": { + "name": "template_id_notification", + "type": "TypeString", + "description": "The templete id for notification", + "optional": true, + "computed": true + }, "unsubscribed": { "name": "unsubscribed", "type": "TypeList", @@ -28138,56 +28497,6 @@ "description": "Unique identifier for result.", "required": true }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "computed": true - } - ], - "ibm_en_subscription_firefox": [ - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "computed": true - }, - { - "name": "destination_id", - "type": "TypeString", - "description": "The destination ID.", - "computed": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Unique identifier for result.", - "required": true - }, { "name": "name", "type": "TypeString", @@ -28195,19 +28504,7 @@ "computed": true } ], - "ibm_en_subscription_huawei": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Unique identifier for result.", - "required": true - }, + "ibm_en_subscription_email": [ { "name": "name", "type": "TypeString", @@ -28233,25 +28530,150 @@ "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - } - ], - "ibm_en_subscription_ios": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Unique identifier for result.", - "required": true - }, + "name": "attributes", + "type": "TypeList", + "computed": true, + "elem": { + "add_notification_payload": { + "name": "add_notification_payload", + "type": "TypeBool", + "description": "Whether to add the notification payload to the email.", + "computed": true + }, + "from_name": { + "name": "from_name", + "type": "TypeString", + "description": "The email address username of source email address.", + "optional": true, + "computed": true + }, + "invited": { + "name": "invited", + "type": "TypeList", + "description": "The invited item schema", + "computed": true, + "elem": { + "email": { + "name": "email", + "type": "TypeString", + "description": "The email address to reply to.", + "optional": true, + "computed": true + }, + "expires_at": { + "name": "expires_at", + "type": "TypeString", + "description": "The expiry date of invitation mail", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The updated date of invitation", + "optional": true, + "computed": true + } + } + }, + "reply_to_mail": { + "name": "reply_to_mail", + "type": "TypeString", + "description": "The email address to reply to.", + "optional": true, + "computed": true + }, + "reply_to_name": { + "name": "reply_to_name", + "type": "TypeString", + "description": "The email address user name to reply to.", + "optional": true, + "computed": true + }, + "subscribed": { + "name": "subscribed", + "type": "TypeList", + "description": "The email subscribed items schema", + "computed": true, + "elem": { + "email": { + "name": "email", + "type": "TypeString", + "description": "The email address to reply to.", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The updated date of susbcription", + "optional": true, + "computed": true + } + } + }, + "unsubscribed": { + "name": "unsubscribed", + "type": "TypeList", + "description": "The unsusbscribed email items schema", + "computed": true, + "elem": { + "email": { + "name": "email", + "type": "TypeString", + "description": "The email address to reply to.", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The updated date of unsusbcription", + "optional": true, + "computed": true + } + } + } + } + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Unique identifier for result.", + "required": true + } + ], + "ibm_en_subscription_firefox": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Unique identifier for result.", + "required": true + }, { "name": "name", "type": "TypeString", @@ -28270,6 +28692,14 @@ "description": "The destination ID.", "computed": true }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "computed": true + } + ], + "ibm_en_subscription_huawei": [ { "name": "topic_id", "type": "TypeString", @@ -28281,15 +28711,83 @@ "type": "TypeString", "description": "Last updated time.", "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Unique identifier for result.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "The destination ID.", + "computed": true } ], - "ibm_en_subscription_msteams": [ + "ibm_en_subscription_ios": [ + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Unique identifier for result.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, { "name": "description", "type": "TypeString", "description": "Subscription description.", "computed": true }, + { + "name": "destination_id", + "type": "TypeString", + "description": "The destination ID.", + "computed": true + } + ], + "ibm_en_subscription_msteams": [ { "name": "destination_id", "type": "TypeString", @@ -28325,6 +28823,12 @@ "type": "TypeString", "description": "Subscription name.", "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true } ], "ibm_en_subscription_pagerduty": [ @@ -28416,6 +28920,24 @@ } ], "ibm_en_subscription_slack": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Unique identifier for result.", + "required": true + }, { "name": "name", "type": "TypeString", @@ -28452,7 +28974,9 @@ "optional": true } } - }, + } + ], + "ibm_en_subscription_sms": [ { "name": "updated_at", "type": "TypeString", @@ -28470,9 +28994,31 @@ "type": "TypeString", "description": "Unique identifier for result.", "required": true - } - ], - "ibm_en_subscription_sms": [ + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "The destination ID.", + "computed": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "computed": true + }, { "name": "attributes", "type": "TypeList", @@ -28553,51 +29099,15 @@ } } } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, + } + ], + "ibm_en_subscription_sn": [ { "name": "instance_guid", "type": "TypeString", "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Unique identifier for result.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "computed": true - }, - { - "name": "destination_id", - "type": "TypeString", - "description": "The destination ID.", - "computed": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "computed": true - } - ], - "ibm_en_subscription_sn": [ { "name": "subscription_id", "type": "TypeString", @@ -28633,27 +29143,9 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true } ], "ibm_en_subscription_webhook": [ - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, { "name": "subscription_id", "type": "TypeString", @@ -28705,6 +29197,18 @@ "computed": true } } + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true } ], "ibm_en_subscriptions": [ @@ -28790,42 +29294,62 @@ } ], "ibm_en_topic": [ - { - "name": "source_count", - "type": "TypeInt", - "description": "Number of sources.", - "computed": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Unique identifier for Topic.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the topic.", - "computed": true - }, { "name": "description", "type": "TypeString", "description": "Description of the topic.", "computed": true }, + { + "name": "subscriptions", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "computed": true + }, + "destination_id": { + "name": "destination_id", + "type": "TypeString", + "description": "The destination ID.", + "computed": true + }, + "destination_type": { + "name": "destination_type", + "type": "TypeString", + "description": "The type of destination.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "Subscription ID.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "computed": true + }, + "topic_id": { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + } + } + }, { "name": "sources", "type": "TypeList", @@ -28885,69 +29409,43 @@ } }, { - "name": "subscriptions", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "computed": true - }, - "destination_id": { - "name": "destination_id", - "type": "TypeString", - "description": "The destination ID.", - "computed": true - }, - "destination_type": { - "name": "destination_type", - "type": "TypeString", - "description": "The type of destination.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Subscription ID.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "computed": true - }, - "topic_id": { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "computed": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - } - } + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true }, { "name": "updated_at", "type": "TypeString", "description": "Last time the topic was updated.", "computed": true - } - ], - "ibm_en_topics": [ + }, { - "name": "search_key", + "name": "instance_guid", "type": "TypeString", - "description": "Filter the topic by name", - "optional": true + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "required": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Unique identifier for Topic.", + "required": true }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the topic.", + "computed": true + }, + { + "name": "source_count", + "type": "TypeInt", + "description": "Number of sources.", + "computed": true + } + ], + "ibm_en_topics": [ { "name": "topics", "type": "TypeList", @@ -29006,6 +29504,12 @@ "type": "TypeInt", "description": "Number of topics.", "computed": true + }, + { + "name": "search_key", + "type": "TypeString", + "description": "Filter the topic by name", + "optional": true } ], "ibm_enterprise_account_groups": [ @@ -29115,6 +29619,12 @@ } ], "ibm_enterprise_accounts": [ + { + "name": "name", + "type": "TypeString", + "description": "The name of the account.", + "optional": true + }, { "name": "accounts", "type": "TypeList", @@ -29224,12 +29734,6 @@ "computed": true } } - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the account.", - "optional": true } ], "ibm_enterprises": [ @@ -29351,21 +29855,6 @@ } ], "ibm_event_streams_topic": [ - { - "name": "kafka_http_url", - "type": "TypeString", - "description": "The API endpoint for interacting with Event Streams REST API", - "computed": true - }, - { - "name": "kafka_brokers_sasl", - "type": "TypeList", - "description": "Kafka brokers addresses for interacting with Kafka native API", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "name", "type": "TypeString", @@ -29393,9 +29882,54 @@ "cloud_data_range": [ "service:event-streams" ] + }, + { + "name": "kafka_http_url", + "type": "TypeString", + "description": "The API endpoint for interacting with Event Streams REST API", + "computed": true + }, + { + "name": "kafka_brokers_sasl", + "type": "TypeList", + "description": "Kafka brokers addresses for interacting with Kafka native API", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_function_action": [ + { + "name": "namespace", + "type": "TypeString", + "description": "Name of the namespace.", + "required": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Semantic version of the item.", + "computed": true + }, + { + "name": "annotations", + "type": "TypeString", + "description": "All annotations set on action by user and those set by the IBM Cloud Function backend/API.", + "computed": true + }, + { + "name": "target_endpoint_url", + "type": "TypeString", + "description": "Action target endpoint URL.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of action.", + "required": true + }, { "name": "exec", "type": "TypeList", @@ -29443,15 +29977,15 @@ } }, { - "name": "annotations", - "type": "TypeString", - "description": "All annotations set on action by user and those set by the IBM Cloud Function backend/API.", + "name": "publish", + "type": "TypeBool", + "description": "Action visibilty.", "computed": true }, { - "name": "target_endpoint_url", + "name": "parameters", "type": "TypeString", - "description": "Action target endpoint URL.", + "description": "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", "computed": true }, { @@ -29459,18 +29993,6 @@ "type": "TypeString", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "Name of action.", - "required": true - }, - { - "name": "namespace", - "type": "TypeString", - "description": "Name of the namespace.", - "required": true - }, { "name": "limits", "type": "TypeList", @@ -29495,24 +30017,6 @@ "computed": true } } - }, - { - "name": "publish", - "type": "TypeBool", - "description": "Action visibilty.", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the item.", - "computed": true - }, - { - "name": "parameters", - "type": "TypeString", - "description": "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", - "computed": true } ], "ibm_function_namespace": [ @@ -29544,18 +30048,6 @@ } ], "ibm_function_package": [ - { - "name": "name", - "type": "TypeString", - "description": "Name of the package.", - "required": true - }, - { - "name": "namespace", - "type": "TypeString", - "description": "Name of the namespace.", - "required": true - }, { "name": "publish", "type": "TypeBool", @@ -29590,21 +30082,21 @@ "name": "package_id", "type": "TypeString", "computed": true - } - ], - "ibm_function_rule": [ + }, { - "name": "action_name", + "name": "name", "type": "TypeString", - "description": "Name of an action.", - "computed": true + "description": "Name of the package.", + "required": true }, { - "name": "status", + "name": "namespace", "type": "TypeString", - "description": "Status of the rule.", - "computed": true - }, + "description": "Name of the namespace.", + "required": true + } + ], + "ibm_function_rule": [ { "name": "publish", "type": "TypeBool", @@ -29639,9 +30131,39 @@ "type": "TypeString", "description": "Name of the trigger.", "computed": true + }, + { + "name": "action_name", + "type": "TypeString", + "description": "Name of an action.", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status of the rule.", + "computed": true } ], "ibm_function_trigger": [ + { + "name": "version", + "type": "TypeString", + "description": "Semantic version of the trigger.", + "computed": true + }, + { + "name": "annotations", + "type": "TypeString", + "description": "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", + "computed": true + }, + { + "name": "parameters", + "type": "TypeString", + "description": "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", + "computed": true + }, { "name": "trigger_id", "type": "TypeString", @@ -29664,27 +30186,47 @@ "type": "TypeBool", "description": "Trigger Visibility.", "computed": true - }, + } + ], + "ibm_hpcs": [ { - "name": "version", + "name": "resource_group_id", "type": "TypeString", - "description": "Semantic version of the trigger.", + "description": "The id of the resource group in which the instance is present", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, { - "name": "annotations", + "name": "units", + "type": "TypeInt", + "description": "The number of operational crypto units for your service instance", + "computed": true + }, + { + "name": "failover_units", + "type": "TypeInt", + "description": "The number of failover crypto units for your service instance", + "computed": true + }, + { + "name": "service_endpoints", "type": "TypeString", - "description": "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", + "description": "Types of the service endpoints. Possible values are `public-and-private`, `private-only`.", "computed": true }, { - "name": "parameters", + "name": "guid", "type": "TypeString", - "description": "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", + "description": "Guid of resource instance", "computed": true - } - ], - "ibm_hpcs": [ + }, + { + "name": "extensions", + "type": "TypeMap", + "description": "The extended metadata as a map associated with the resource instance.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -29692,16 +30234,19 @@ "required": true }, { - "name": "units", - "type": "TypeInt", - "description": "The number of operational crypto units for your service instance", + "name": "location", + "type": "TypeString", + "description": "The location or the environment in which instance exists", + "cloud_data_type": "region", + "optional": true, "computed": true }, { - "name": "failover_units", - "type": "TypeInt", - "description": "The number of failover crypto units for your service instance", - "computed": true + "name": "service", + "type": "TypeString", + "description": "The service type of the instance", + "default_value": "hs-crypto", + "optional": true }, { "name": "plan", @@ -29710,9 +30255,16 @@ "computed": true }, { - "name": "extensions", - "type": "TypeMap", - "description": "The extended metadata as a map associated with the resource instance.", + "name": "status", + "type": "TypeString", + "description": "The resource instance status", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN of resource instance", + "cloud_data_type": "crn", "computed": true }, { @@ -29784,79 +30336,15 @@ "computed": true } } - }, - { - "name": "guid", - "type": "TypeString", - "description": "Guid of resource instance", - "computed": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The id of the resource group in which the instance is present", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "location", - "type": "TypeString", - "description": "The location or the environment in which instance exists", - "cloud_data_type": "region", - "optional": true, - "computed": true - }, - { - "name": "service", - "type": "TypeString", - "description": "The service type of the instance", - "default_value": "hs-crypto", - "optional": true - }, - { - "name": "service_endpoints", - "type": "TypeString", - "description": "Types of the service endpoints. Possible values are `public-and-private`, `private-only`.", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The resource instance status", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true } ], "ibm_hpcs_key_template": [ { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the UKO instance this resource exists in.", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:hs-crypto" - ] - }, - { - "name": "template_id", + "name": "uko_vault", "type": "TypeString", - "description": "UUID of the template.", + "description": "The UUID of the Vault in which the update is to take place.", "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "Description of the key template.", - "computed": true - }, { "name": "vault", "type": "TypeList", @@ -29884,9 +30372,22 @@ } }, { - "name": "version", - "type": "TypeInt", - "description": "Version of the key template. Every time the key template is updated, the version will be updated automatically.", + "name": "region", + "type": "TypeString", + "description": "The region of the UKO instance this resource exists in.", + "cloud_data_type": "region", + "required": true + }, + { + "name": "template_id", + "type": "TypeString", + "description": "UUID of the template.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the key template.", "computed": true }, { @@ -29928,24 +30429,17 @@ } }, { - "name": "created_at", + "name": "updated_at", "type": "TypeString", - "description": "Date and time when the key template was created.", + "description": "Date and time when the key template was updated.", "computed": true }, { - "name": "href", + "name": "created_by", "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", + "description": "ID of the user that created the key template.", "computed": true }, - { - "name": "region", - "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", - "cloud_data_type": "region", - "required": true - }, { "name": "keystores", "type": "TypeList", @@ -29981,127 +30475,129 @@ } }, { - "name": "uko_vault", + "name": "instance_id", "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "required": true + "description": "The ID of the UKO instance this resource exists in.", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:hs-crypto" + ] }, { - "name": "name", + "name": "version", + "type": "TypeInt", + "description": "Version of the key template. Every time the key template is updated, the version will be updated automatically.", + "computed": true + }, + { + "name": "updated_by", "type": "TypeString", - "description": "Name of the key template.", + "description": "ID of the user that updated the key.", "computed": true }, { - "name": "updated_at", + "name": "href", "type": "TypeString", - "description": "Date and time when the key template was updated.", + "description": "A URL that uniquely identifies your cloud resource.", "computed": true }, { - "name": "created_by", + "name": "description", "type": "TypeString", - "description": "ID of the user that created the key template.", + "description": "Description of the key template.", "computed": true }, { - "name": "updated_by", + "name": "created_at", "type": "TypeString", - "description": "ID of the user that updated the key.", + "description": "Date and time when the key template was created.", "computed": true } ], "ibm_hpcs_keystore": [ { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Name of the target keystore. It can be changed in the future.", + "description": "A URL that uniquely identifies your cloud resource.", "computed": true }, { - "name": "type", + "name": "aws_access_key_id", "type": "TypeString", - "description": "Type of keystore.", + "description": "The access key id used for connecting to this instance of AWS KMS.", + "secure": true, "computed": true }, { - "name": "updated_at", + "name": "azure_resource_group", "type": "TypeString", - "description": "Date and time when the target keystore was last updated.", + "description": "Resource group in Azure.", "computed": true }, { - "name": "ibm_api_key", + "name": "ibm_api_endpoint", "type": "TypeString", - "description": "The IBM Cloud API key to be used for connecting to this IBM Cloud keystore.", - "secure": true, + "description": "API endpoint of the IBM Cloud keystore.", "computed": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", - "cloud_data_type": "region", - "required": true - }, - { - "name": "keystore_id", - "type": "TypeString", - "description": "UUID of the keystore.", - "required": true - }, - { - "name": "href", + "name": "ibm_key_ring", "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", + "description": "The key ring of an IBM Cloud KMS Keystore.", "computed": true }, { - "name": "google_location", + "name": "location", "type": "TypeString", - "description": "Location represents the geographical region where a Cloud KMS resource is stored and can be accessed. A key's location impacts the performance of applications using the key.", + "description": "Geographic location of the keystore, if available.", + "cloud_data_type": "region", "computed": true }, { - "name": "azure_subscription_id", - "type": "TypeString", - "description": "Subscription ID in Azure.", - "computed": true + "name": "groups", + "type": "TypeList", + "description": "List of groups that this keystore belongs to.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "ibm_iam_endpoint", + "name": "updated_at", "type": "TypeString", - "description": "Endpoint of the IAM service for this IBM Cloud keystore.", + "description": "Date and time when the target keystore was last updated.", "computed": true }, { - "name": "ibm_instance_id", + "name": "google_project_id", "type": "TypeString", - "description": "The instance ID of the IBM Cloud keystore.", + "description": "The project id associated with this keystore.", "computed": true }, { - "name": "created_at", + "name": "azure_tenant", "type": "TypeString", - "description": "Date and time when the target keystore was created.", + "description": "Azure tenant that the Key Vault is associated with,.", "computed": true }, { - "name": "created_by", + "name": "region", "type": "TypeString", - "description": "ID of the user that created the key.", - "computed": true + "description": "The region of the UKO instance this resource exists in.", + "cloud_data_type": "region", + "required": true }, { - "name": "google_project_id", + "name": "updated_by", "type": "TypeString", - "description": "The project id associated with this keystore.", + "description": "ID of the user that last updated the key.", "computed": true }, { - "name": "google_private_key_id", + "name": "google_credentials", "type": "TypeString", - "description": "The private key id associated with this keystore.", + "description": "The value of the JSON key represented in the Base64 format.", "computed": true }, { @@ -30111,25 +30607,21 @@ "computed": true }, { - "name": "instance_id", + "name": "azure_service_principal_client_id", "type": "TypeString", - "description": "The ID of the UKO instance this resource exists in.", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:hs-crypto" - ] + "description": "Azure service principal client ID.", + "computed": true }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "Description of the keystore.", + "description": "Name of the target keystore. It can be changed in the future.", "computed": true }, { - "name": "updated_by", + "name": "type", "type": "TypeString", - "description": "ID of the user that last updated the key.", + "description": "Type of keystore.", "computed": true }, { @@ -30140,101 +30632,59 @@ "computed": true }, { - "name": "vault", - "type": "TypeList", - "description": "Reference to a vault.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the referenced vault.", - "computed": true - } - } - }, - { - "name": "location", + "name": "azure_environment", "type": "TypeString", - "description": "Geographic location of the keystore, if available.", - "cloud_data_type": "region", + "description": "Azure environment, usually 'Azure'.", "computed": true }, { - "name": "ibm_key_ring", + "name": "ibm_variant", "type": "TypeString", - "description": "The key ring of an IBM Cloud KMS Keystore.", + "description": "Possible IBM Cloud KMS variants.", "computed": true }, { - "name": "azure_service_name", + "name": "keystore_id", "type": "TypeString", - "description": "Service name of the key vault instance from the Azure portal.", - "computed": true + "description": "UUID of the keystore.", + "required": true }, { - "name": "azure_environment", + "name": "created_at", "type": "TypeString", - "description": "Azure environment, usually 'Azure'.", + "description": "Date and time when the target keystore was created.", "computed": true }, { - "name": "azure_service_principal_client_id", + "name": "google_key_ring", "type": "TypeString", - "description": "Azure service principal client ID.", + "description": "A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys.", "computed": true }, { - "name": "azure_tenant", + "name": "aws_region", "type": "TypeString", - "description": "Azure tenant that the Key Vault is associated with,.", + "description": "AWS Region.", "computed": true }, { - "name": "uko_vault", - "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "required": true - }, - { - "name": "azure_resource_group", + "name": "azure_service_name", "type": "TypeString", - "description": "Resource group in Azure.", + "description": "Service name of the key vault instance from the Azure portal.", "computed": true }, { - "name": "ibm_api_endpoint", + "name": "ibm_iam_endpoint", "type": "TypeString", - "description": "API endpoint of the IBM Cloud keystore.", + "description": "Endpoint of the IAM service for this IBM Cloud keystore.", "computed": true }, { - "name": "ibm_variant", + "name": "google_location", "type": "TypeString", - "description": "Possible IBM Cloud KMS variants.", + "description": "Location represents the geographical region where a Cloud KMS resource is stored and can be accessed. A key's location impacts the performance of applications using the key.", "computed": true }, - { - "name": "groups", - "type": "TypeList", - "description": "List of groups that this keystore belongs to.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "azure_service_principal_password", "type": "TypeString", @@ -30243,32 +30693,30 @@ "computed": true }, { - "name": "aws_region", + "name": "ibm_api_key", "type": "TypeString", - "description": "AWS Region.", + "description": "The IBM Cloud API key to be used for connecting to this IBM Cloud keystore.", + "secure": true, "computed": true }, { - "name": "aws_access_key_id", + "name": "google_private_key_id", "type": "TypeString", - "description": "The access key id used for connecting to this instance of AWS KMS.", - "secure": true, + "description": "The private key id associated with this keystore.", "computed": true }, { - "name": "google_credentials", + "name": "azure_subscription_id", "type": "TypeString", - "description": "The value of the JSON key represented in the Base64 format.", + "description": "Subscription ID in Azure.", "computed": true }, { - "name": "google_key_ring", + "name": "uko_vault", "type": "TypeString", - "description": "A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys.", - "computed": true - } - ], - "ibm_hpcs_managed_key": [ + "description": "The UUID of the Vault in which the update is to take place.", + "required": true + }, { "name": "vault", "type": "TypeList", @@ -30296,11 +30744,21 @@ } }, { - "name": "algorithm", + "name": "description", "type": "TypeString", - "description": "The algorithm of the key.", + "description": "Description of the keystore.", "computed": true }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the UKO instance this resource exists in.", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:hs-crypto" + ] + }, { "name": "created_by", "type": "TypeString", @@ -30308,9 +30766,68 @@ "computed": true }, { - "name": "referenced_keystores", + "name": "ibm_instance_id", + "type": "TypeString", + "description": "The instance ID of the IBM Cloud keystore.", + "computed": true + } + ], + "ibm_hpcs_managed_key": [ + { + "name": "key_id", + "type": "TypeString", + "description": "UUID of the key.", + "required": true + }, + { + "name": "activation_date", + "type": "TypeString", + "description": "First day when the key is active.", + "computed": true + }, + { + "name": "tags", "type": "TypeList", - "description": "referenced keystores.", + "description": "Key-value pairs associated with the key.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of a tag.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value of a tag.", + "computed": true + } + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Date and time when the key was created.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Date and time when the key was last updated.", + "computed": true + }, + { + "name": "uko_vault", + "type": "TypeString", + "description": "The UUID of the Vault in which the update is to take place.", + "required": true + }, + { + "name": "template", + "type": "TypeList", + "description": "Reference to a key template.", "computed": true, "elem": { "href": { @@ -30328,17 +30845,23 @@ "name": { "name": "name", "type": "TypeString", - "description": "Name of the target keystore.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of keystore.", + "description": "Name of the key template.", "computed": true } } }, + { + "name": "description", + "type": "TypeString", + "description": "Description of the managed key.", + "computed": true + }, + { + "name": "label", + "type": "TypeString", + "description": "The label of the key.", + "computed": true + }, { "name": "instances", "type": "TypeList", @@ -30400,10 +30923,10 @@ } }, { - "name": "key_id", + "name": "href", "type": "TypeString", - "description": "UUID of the key.", - "required": true + "description": "A URL that uniquely identifies your cloud resource.", + "computed": true }, { "name": "region", @@ -30413,9 +30936,9 @@ "required": true }, { - "name": "label", + "name": "state", "type": "TypeString", - "description": "The label of the key.", + "description": "The state of the key.", "computed": true }, { @@ -30439,30 +30962,15 @@ } }, { - "name": "tags", - "type": "TypeList", - "description": "Key-value pairs associated with the key.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of a tag.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value of a tag.", - "computed": true - } - } + "name": "expiration_date", + "type": "TypeString", + "description": "Last day when the key is active.", + "computed": true }, { - "name": "updated_at", + "name": "updated_by", "type": "TypeString", - "description": "Date and time when the key was last updated.", + "description": "ID of the user that last updated the key.", "computed": true }, { @@ -30476,27 +30984,9 @@ ] }, { - "name": "created_at", - "type": "TypeString", - "description": "Date and time when the key was created.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", - "computed": true - }, - { - "name": "expiration_date", - "type": "TypeString", - "description": "Last day when the key is active.", - "computed": true - }, - { - "name": "template", + "name": "vault", "type": "TypeList", - "description": "Reference to a key template.", + "description": "Reference to a vault.", "computed": true, "elem": { "href": { @@ -30514,23 +31004,11 @@ "name": { "name": "name", "type": "TypeString", - "description": "Name of the key template.", + "description": "Name of the referenced vault.", "computed": true } } }, - { - "name": "description", - "type": "TypeString", - "description": "Description of the managed key.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "The state of the key.", - "computed": true - }, { "name": "size", "type": "TypeString", @@ -30538,47 +31016,67 @@ "computed": true }, { - "name": "activation_date", + "name": "algorithm", "type": "TypeString", - "description": "First day when the key is active.", + "description": "The algorithm of the key.", "computed": true }, { - "name": "updated_by", + "name": "created_by", "type": "TypeString", - "description": "ID of the user that last updated the key.", + "description": "ID of the user that created the key.", "computed": true }, { - "name": "uko_vault", - "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "required": true + "name": "referenced_keystores", + "type": "TypeList", + "description": "referenced keystores.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "A URL that uniquely identifies your cloud resource.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the target keystore.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of keystore.", + "computed": true + } + } } ], "ibm_hpcs_vault": [ { - "name": "vault_id", - "type": "TypeString", - "description": "UUID of the vault.", - "required": true - }, - { - "name": "description", + "name": "created_at", "type": "TypeString", - "description": "Description of the vault.", + "description": "Date and time when the vault was created.", "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "ID of the user that created the vault.", + "description": "Date and time when the vault was last updated.", "computed": true }, { - "name": "href", + "name": "updated_by", "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", + "description": "ID of the user that last updated the vault.", "computed": true }, { @@ -30592,35 +31090,41 @@ ] }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", - "cloud_data_type": "region", - "required": true + "description": "Name of the vault.", + "computed": true }, { - "name": "updated_at", + "name": "description", "type": "TypeString", - "description": "Date and time when the vault was last updated.", + "description": "Description of the vault.", "computed": true }, { - "name": "updated_by", + "name": "created_by", "type": "TypeString", - "description": "ID of the user that last updated the vault.", + "description": "ID of the user that created the vault.", "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Name of the vault.", + "description": "A URL that uniquely identifies your cloud resource.", "computed": true }, { - "name": "created_at", + "name": "region", "type": "TypeString", - "description": "Date and time when the vault was created.", - "computed": true + "description": "The region of the UKO instance this resource exists in.", + "cloud_data_type": "region", + "required": true + }, + { + "name": "vault_id", + "type": "TypeString", + "description": "UUID of the vault.", + "required": true } ], "ibm_iam_access_group": [ @@ -30967,41 +31471,21 @@ ], "ibm_iam_access_group_template_assignment": [ { - "name": "offset", - "type": "TypeInt", - "description": "Index of the first item returned in the response.", - "computed": true - }, - { - "name": "total_count", - "type": "TypeInt", - "description": "Total number of items matching the query.", + "name": "account_id", + "type": "TypeString", + "description": "Enterprise account ID.", "computed": true }, { - "name": "first", - "type": "TypeList", - "description": "A link object.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "A string containing the link’s URL.", - "computed": true - } - } - }, - { - "name": "template_version", + "name": "template_id", "type": "TypeString", - "description": "Filter results by Template Version.", + "description": "Filter results by Template Id.", "optional": true }, { - "name": "template_id", + "name": "template_version", "type": "TypeString", - "description": "Filter results by Template Id.", + "description": "Filter results by Template Version.", "optional": true }, { @@ -31028,6 +31512,32 @@ "description": "Maximum number of items returned in the response.", "computed": true }, + { + "name": "offset", + "type": "TypeInt", + "description": "Index of the first item returned in the response.", + "computed": true + }, + { + "name": "total_count", + "type": "TypeInt", + "description": "Total number of items matching the query.", + "computed": true + }, + { + "name": "first", + "type": "TypeList", + "description": "A link object.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "A string containing the link’s URL.", + "computed": true + } + } + }, { "name": "last", "type": "TypeList", @@ -31127,35 +31637,9 @@ "computed": true } } - }, - { - "name": "account_id", - "type": "TypeString", - "description": "Enterprise account ID.", - "computed": true } ], "ibm_iam_access_group_template_versions": [ - { - "name": "template_id", - "type": "TypeString", - "description": "ID of the template that you want to list all versions of.", - "required": true - }, - { - "name": "first", - "type": "TypeList", - "description": "A link object.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "A string containing the link’s URL.", - "computed": true - } - } - }, { "name": "previous", "type": "TypeList", @@ -31453,19 +31937,122 @@ "computed": true } } + }, + { + "name": "template_id", + "type": "TypeString", + "description": "ID of the template that you want to list all versions of.", + "required": true + }, + { + "name": "first", + "type": "TypeList", + "description": "A link object.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "A string containing the link’s URL.", + "computed": true + } + } } ], "ibm_iam_account_settings": [ { - "name": "entity_tag", + "name": "session_expiration_in_seconds", "type": "TypeString", - "description": "Version of the account settings.", + "description": "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", "computed": true }, { - "name": "session_expiration_in_seconds", + "name": "history", + "type": "TypeList", + "description": "History of the Account Settings.", + "computed": true, + "elem": { + "action": { + "name": "action", + "type": "TypeString", + "description": "Action of the history entry.", + "computed": true + }, + "iam_id": { + "name": "iam_id", + "type": "TypeString", + "description": "IAM ID of the identity which triggered the action.", + "computed": true + }, + "iam_id_account": { + "name": "iam_id_account", + "type": "TypeString", + "description": "Account of the identity which triggered the action.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "Message which summarizes the executed action.", + "computed": true + }, + "params": { + "name": "params", + "type": "TypeList", + "description": "Params of the history entry.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "timestamp": { + "name": "timestamp", + "type": "TypeString", + "description": "Timestamp when the action was triggered.", + "computed": true + } + } + }, + { + "name": "max_sessions_per_identity", "type": "TypeString", - "description": "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", + "description": "Defines the max allowed sessions per identity required by the account. Valid values: * Any whole number greater than 0 * NOT_SET - To unset account setting and use service default.", + "computed": true + }, + { + "name": "system_access_token_expiration_in_seconds", + "type": "TypeString", + "description": "Defines the access token expiration in seconds. Valid values: * Any whole number between '900' and '3600' * NOT_SET - To unset account setting and use service default.", + "computed": true + }, + { + "name": "system_refresh_token_expiration_in_seconds", + "type": "TypeString", + "description": "Defines the refresh token expiration in seconds. Valid values: * Any whole number between '900' and '2592000' * NOT_SET - To unset account setting and use service default.", + "computed": true + }, + { + "name": "restrict_create_service_id", + "type": "TypeString", + "description": "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "Unique ID of the account.", + "computed": true + }, + { + "name": "restrict_create_platform_apikey", + "type": "TypeString", + "description": "Defines whether or not creating platform API keys is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", + "computed": true + }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "Version of the account settings.", "computed": true }, { @@ -31476,9 +32063,9 @@ "optional": true }, { - "name": "restrict_create_service_id", + "name": "mfa", "type": "TypeString", - "description": "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", + "description": "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", "computed": true }, { @@ -31508,15 +32095,47 @@ "computed": true }, { - "name": "account_id", + "name": "allowed_ip_addresses", "type": "TypeString", - "description": "Unique ID of the account.", + "description": "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", + "computed": true + } + ], + "ibm_iam_account_settings_template": [ + { + "name": "template_id", + "type": "TypeString", + "description": "ID of the account settings template.", + "required": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Template Created At.", + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Version of the account settings template.", + "optional": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of the trusted profile template. Describe the template for enterprise account users.", + "computed": true + }, + { + "name": "committed", + "type": "TypeBool", + "description": "Committed flag determines if the template is ready for assignment.", "computed": true }, { "name": "history", "type": "TypeList", - "description": "History of the Account Settings.", + "description": "History of the Template.", "computed": true, "elem": { "action": { @@ -31561,48 +32180,29 @@ } }, { - "name": "system_access_token_expiration_in_seconds", - "type": "TypeString", - "description": "Defines the access token expiration in seconds. Valid values: * Any whole number between '900' and '3600' * NOT_SET - To unset account setting and use service default.", - "computed": true - }, - { - "name": "system_refresh_token_expiration_in_seconds", - "type": "TypeString", - "description": "Defines the refresh token expiration in seconds. Valid values: * Any whole number between '900' and '2592000' * NOT_SET - To unset account setting and use service default.", - "computed": true - }, - { - "name": "restrict_create_platform_apikey", - "type": "TypeString", - "description": "Defines whether or not creating platform API keys is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", - "computed": true + "name": "include_history", + "type": "TypeBool", + "description": "Defines if the entity history is included in the response.", + "default_value": false, + "optional": true }, { - "name": "allowed_ip_addresses", + "name": "last_modified_at", "type": "TypeString", - "description": "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", + "description": "Template last modified at.", "computed": true }, { - "name": "mfa", + "name": "last_modified_by_id", "type": "TypeString", - "description": "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", + "description": "IAMid of the identity that made the latest modification.", "computed": true }, { - "name": "max_sessions_per_identity", + "name": "id", "type": "TypeString", - "description": "Defines the max allowed sessions per identity required by the account. Valid values: * Any whole number greater than 0 * NOT_SET - To unset account setting and use service default.", + "description": "ID of the the template.", "computed": true - } - ], - "ibm_iam_account_settings_template": [ - { - "name": "version", - "type": "TypeString", - "description": "Version of the account settings template.", - "optional": true }, { "name": "account_id", @@ -31611,9 +32211,9 @@ "computed": true }, { - "name": "committed", - "type": "TypeBool", - "description": "Committed flag determines if the template is ready for assignment.", + "name": "name", + "type": "TypeString", + "description": "The name of the trusted profile template. This is visible only in the enterprise account.", "computed": true }, { @@ -31697,6 +32297,12 @@ } } }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "Entity tag for this templateId-version combination.", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -31709,71 +32315,142 @@ "type": "TypeString", "description": "IAMid of the creator.", "computed": true + } + ], + "ibm_iam_account_settings_template_assignment": [ + { + "name": "account_id", + "type": "TypeString", + "description": "Enterprise account Id.", + "computed": true }, { "name": "template_id", "type": "TypeString", - "description": "ID of the account settings template.", - "required": true + "description": "Template Id.", + "optional": true }, { - "name": "name", + "name": "created_at", "type": "TypeString", - "description": "The name of the trusted profile template. This is visible only in the enterprise account.", + "description": "Assignment created at.", "computed": true }, { - "name": "history", + "name": "created_by_id", + "type": "TypeString", + "description": "IAMid of the identity that created the assignment.", + "computed": true + }, + { + "name": "last_modified_at", + "type": "TypeString", + "description": "Assignment modified at.", + "computed": true + }, + { + "name": "id", + "type": "TypeString", + "description": "Assignment record Id.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "Href.", + "computed": true + }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "IAMid of the identity that last modified the assignment.", + "computed": true + }, + { + "name": "assignment_id", + "type": "TypeString", + "description": "ID of the Assignment Record.", + "required": true + }, + { + "name": "context", "type": "TypeList", - "description": "History of the Template.", + "description": "Context with key properties for problem determination.", "computed": true, "elem": { - "action": { - "name": "action", + "cluster_name": { + "name": "cluster_name", "type": "TypeString", - "description": "Action of the history entry.", + "description": "The cluster name.", "computed": true }, - "iam_id": { - "name": "iam_id", + "elapsed_time": { + "name": "elapsed_time", "type": "TypeString", - "description": "IAM ID of the identity which triggered the action.", + "description": "The elapsed time in msec.", "computed": true }, - "iam_id_account": { - "name": "iam_id_account", + "end_time": { + "name": "end_time", "type": "TypeString", - "description": "Account of the identity which triggered the action.", + "description": "The finish time of the request.", "computed": true }, - "message": { - "name": "message", + "host": { + "name": "host", "type": "TypeString", - "description": "Message which summarizes the executed action.", + "description": "The host of the server instance processing the request.", "computed": true }, - "params": { - "name": "params", - "type": "TypeList", - "description": "Params of the history entry.", - "computed": true, - "elem": { - "type": "TypeString" - } + "instance_id": { + "name": "instance_id", + "type": "TypeString", + "description": "The instance ID of the server instance processing the request.", + "computed": true }, - "timestamp": { - "name": "timestamp", + "operation": { + "name": "operation", "type": "TypeString", - "description": "Timestamp when the action was triggered.", + "description": "The operation of the inbound REST request.", + "computed": true + }, + "start_time": { + "name": "start_time", + "type": "TypeString", + "description": "The start time of the request.", + "computed": true + }, + "thread_id": { + "name": "thread_id", + "type": "TypeString", + "description": "The thread ID of the server instance processing the request.", + "computed": true + }, + "transaction_id": { + "name": "transaction_id", + "type": "TypeString", + "description": "The transaction ID of the inbound REST request.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "The URL of that cluster.", + "computed": true + }, + "user_agent": { + "name": "user_agent", + "type": "TypeString", + "description": "The user agent of the inbound REST request.", "computed": true } } }, { - "name": "entity_tag", + "name": "target_type", "type": "TypeString", - "description": "Entity tag for this templateId-version combination.", - "computed": true + "description": "Assignment target type.", + "optional": true }, { "name": "include_history", @@ -31783,60 +32460,21 @@ "optional": true }, { - "name": "id", - "type": "TypeString", - "description": "ID of the the template.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The description of the trusted profile template. Describe the template for enterprise account users.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "Template Created At.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "Template last modified at.", - "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAMid of the identity that made the latest modification.", - "computed": true - } - ], - "ibm_iam_account_settings_template_assignment": [ - { - "name": "created_by_id", - "type": "TypeString", - "description": "IAMid of the identity that created the assignment.", - "computed": true + "name": "template_version", + "type": "TypeInt", + "description": "Template version.", + "optional": true }, { - "name": "assignment_id", + "name": "target", "type": "TypeString", - "description": "ID of the Assignment Record.", - "required": true - }, - { - "name": "include_history", - "type": "TypeBool", - "description": "Defines if the entity history is included in the response.", - "default_value": false, + "description": "Assignment target.", "optional": true }, { - "name": "account_id", + "name": "status", "type": "TypeString", - "description": "Enterprise account Id.", + "description": "Assignment status.", "computed": true }, { @@ -31924,140 +32562,6 @@ } } }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAMid of the identity that last modified the assignment.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "Template Id.", - "optional": true - }, - { - "name": "template_version", - "type": "TypeInt", - "description": "Template version.", - "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "Assignment created at.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "Assignment modified at.", - "computed": true - }, - { - "name": "entity_tag", - "type": "TypeString", - "description": "Entity tag for this assignment record.", - "computed": true - }, - { - "name": "context", - "type": "TypeList", - "description": "Context with key properties for problem determination.", - "computed": true, - "elem": { - "cluster_name": { - "name": "cluster_name", - "type": "TypeString", - "description": "The cluster name.", - "computed": true - }, - "elapsed_time": { - "name": "elapsed_time", - "type": "TypeString", - "description": "The elapsed time in msec.", - "computed": true - }, - "end_time": { - "name": "end_time", - "type": "TypeString", - "description": "The finish time of the request.", - "computed": true - }, - "host": { - "name": "host", - "type": "TypeString", - "description": "The host of the server instance processing the request.", - "computed": true - }, - "instance_id": { - "name": "instance_id", - "type": "TypeString", - "description": "The instance ID of the server instance processing the request.", - "computed": true - }, - "operation": { - "name": "operation", - "type": "TypeString", - "description": "The operation of the inbound REST request.", - "computed": true - }, - "start_time": { - "name": "start_time", - "type": "TypeString", - "description": "The start time of the request.", - "computed": true - }, - "thread_id": { - "name": "thread_id", - "type": "TypeString", - "description": "The thread ID of the server instance processing the request.", - "computed": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "TypeString", - "description": "The transaction ID of the inbound REST request.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "The URL of that cluster.", - "computed": true - }, - "user_agent": { - "name": "user_agent", - "type": "TypeString", - "description": "The user agent of the inbound REST request.", - "computed": true - } - } - }, - { - "name": "id", - "type": "TypeString", - "description": "Assignment record Id.", - "computed": true - }, - { - "name": "target_type", - "type": "TypeString", - "description": "Assignment target type.", - "optional": true - }, - { - "name": "target", - "type": "TypeString", - "description": "Assignment target.", - "optional": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Assignment status.", - "computed": true - }, { "name": "history", "type": "TypeList", @@ -32106,9 +32610,9 @@ } }, { - "name": "href", + "name": "entity_tag", "type": "TypeString", - "description": "Href.", + "description": "Entity tag for this assignment record.", "computed": true } ], @@ -32133,9 +32637,15 @@ "computed": true }, { - "name": "created_by", + "name": "description", "type": "TypeString", - "description": "IAM ID of the user or service which created the API key.", + "description": "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", + "computed": true + }, + { + "name": "iam_id", + "type": "TypeString", + "description": "The iam_id that this API key authenticates.", "computed": true }, { @@ -32151,27 +32661,21 @@ "computed": true }, { - "name": "modified_at", - "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", - "computed": true - }, - { - "name": "name", + "name": "created_by", "type": "TypeString", - "description": "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", + "description": "IAM ID of the user or service which created the API key.", "computed": true }, { - "name": "description", + "name": "modified_at", "type": "TypeString", - "description": "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", + "description": "If set contains a date time string of the last modification date in ISO format.", "computed": true }, { - "name": "iam_id", + "name": "name", "type": "TypeString", - "description": "The iam_id that this API key authenticates.", + "description": "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", "computed": true }, { @@ -32183,22 +32687,22 @@ ], "ibm_iam_auth_token": [ { - "name": "uaa_refresh_token", + "name": "uaa_access_token", "type": "TypeString", "computed": true }, { - "name": "iam_access_token", + "name": "uaa_refresh_token", "type": "TypeString", "computed": true }, { - "name": "iam_refresh_token", + "name": "iam_access_token", "type": "TypeString", "computed": true }, { - "name": "uaa_access_token", + "name": "iam_refresh_token", "type": "TypeString", "computed": true } @@ -32312,116 +32816,12 @@ } ], "ibm_iam_policy_assignment": [ - { - "name": "template_id", - "type": "TypeString", - "description": "policy template id.", - "computed": true - }, - { - "name": "target_type", - "type": "TypeString", - "description": "Assignment target type.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The href URL that links to the policies assignments API by policy assignment ID.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The UTC timestamp when the policy assignment was created.", - "computed": true - }, - { - "name": "target", - "type": "TypeString", - "description": "assignment target id.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "The UTC timestamp when the policy assignment was last modified.", - "computed": true - }, - { - "name": "options", - "type": "TypeList", - "description": "List of objects with required properties for a policy assignment.", - "computed": true, - "elem": { - "root_requester_id": { - "name": "root_requester_id", - "type": "TypeString", - "description": "The policy assignment requester id.", - "computed": true - }, - "root_template_id": { - "name": "root_template_id", - "type": "TypeString", - "description": "The template id where this policy is being assigned from.", - "computed": true - }, - "root_template_version": { - "name": "root_template_version", - "type": "TypeString", - "description": "The template version where this policy is being assigned from.", - "computed": true - }, - "subject_id": { - "name": "subject_id", - "type": "TypeString", - "description": "The policy subject id.", - "computed": true - }, - "subject_type": { - "name": "subject_type", - "type": "TypeString", - "description": "The policy subject type; either 'iam_id' or 'access_group_id'.", - "computed": true - } - } - }, - { - "name": "account_id", - "type": "TypeString", - "description": "Enterprise accountID.", - "computed": true - }, { "name": "assignment_id", "type": "TypeString", "description": "The policy template assignment ID.", "required": true }, - { - "name": "template_version", - "type": "TypeString", - "description": "policy template version.", - "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "The iam ID of the entity that last modified the policy assignment.", - "computed": true - }, - { - "name": "id", - "type": "TypeString", - "description": "Policy assignment ID.", - "computed": true - }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "The iam ID of the entity that created the policy assignment.", - "computed": true - }, { "name": "resources", "type": "TypeList", @@ -32543,21 +32943,113 @@ "computed": true } } - } - ], - "ibm_iam_policy_assignments": [ + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The UTC timestamp when the policy assignment was created.", + "computed": true + }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "The iam ID of the entity that last modified the policy assignment.", + "computed": true + }, + { + "name": "options", + "type": "TypeList", + "description": "List of objects with required properties for a policy assignment.", + "computed": true, + "elem": { + "root_requester_id": { + "name": "root_requester_id", + "type": "TypeString", + "description": "The policy assignment requester id.", + "computed": true + }, + "root_template_id": { + "name": "root_template_id", + "type": "TypeString", + "description": "The template id where this policy is being assigned from.", + "computed": true + }, + "root_template_version": { + "name": "root_template_version", + "type": "TypeString", + "description": "The template version where this policy is being assigned from.", + "computed": true + }, + "subject_id": { + "name": "subject_id", + "type": "TypeString", + "description": "The policy subject id.", + "computed": true + }, + "subject_type": { + "name": "subject_type", + "type": "TypeString", + "description": "The policy subject type; either 'iam_id' or 'access_group_id'.", + "computed": true + } + } + }, + { + "name": "id", + "type": "TypeString", + "description": "Policy assignment ID.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The href URL that links to the policies assignments API by policy assignment ID.", + "computed": true + }, + { + "name": "target_type", + "type": "TypeString", + "description": "Assignment target type.", + "computed": true + }, + { + "name": "last_modified_at", + "type": "TypeString", + "description": "The UTC timestamp when the policy assignment was last modified.", + "computed": true + }, + { + "name": "target", + "type": "TypeString", + "description": "assignment target id.", + "computed": true + }, + { + "name": "created_by_id", + "type": "TypeString", + "description": "The iam ID of the entity that created the policy assignment.", + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "Enterprise accountID.", + "computed": true + }, { "name": "template_id", "type": "TypeString", - "description": "Optional template id.", - "optional": true + "description": "policy template id.", + "computed": true }, { "name": "template_version", "type": "TypeString", - "description": "Optional policy template version.", - "optional": true - }, + "description": "policy template version.", + "computed": true + } + ], + "ibm_iam_policy_assignments": [ { "name": "policy_assignments", "type": "TypeList", @@ -32797,6 +33289,18 @@ "computed": true } } + }, + { + "name": "template_id", + "type": "TypeString", + "description": "Optional template id.", + "optional": true + }, + { + "name": "template_version", + "type": "TypeString", + "description": "Optional policy template version.", + "optional": true } ], "ibm_iam_policy_template": [ @@ -33150,6 +33654,24 @@ } ], "ibm_iam_role_actions": [ + { + "name": "reader_plus", + "type": "TypeList", + "description": "readerplus action ids", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "writer", + "type": "TypeList", + "description": "writer action ids", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "actions", "type": "TypeMap", @@ -33180,34 +33702,9 @@ "elem": { "type": "TypeString" } - }, - { - "name": "reader_plus", - "type": "TypeList", - "description": "readerplus action ids", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "writer", - "type": "TypeList", - "description": "writer action ids", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_iam_roles": [ - { - "name": "service", - "type": "TypeString", - "description": "The Service Name", - "immutable": true, - "optional": true - }, { "name": "roles", "type": "TypeList", @@ -33229,6 +33726,13 @@ "computed": true } } + }, + { + "name": "service", + "type": "TypeString", + "description": "The Service Name", + "immutable": true, + "optional": true } ], "ibm_iam_service_id": [ @@ -33486,10 +33990,33 @@ ], "ibm_iam_trusted_profile": [ { - "name": "crn", + "name": "description", "type": "TypeString", - "description": "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", - "cloud_data_type": "crn", + "description": "The optional description of the trusted profile. The 'description' property is only available if a description was provided during a create of a trusted profile.", + "computed": true + }, + { + "name": "template_id", + "type": "TypeString", + "description": "Template id the profile was created from.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "If set contains a date time string of the creation date in ISO format.", + "computed": true + }, + { + "name": "iam_id", + "type": "TypeString", + "description": "The iam_id of this trusted profile.", + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "ID of the account that this trusted profile belong to.", "computed": true }, { @@ -33504,6 +34031,30 @@ "description": "IMS user ID of the trusted profile.", "computed": true }, + { + "name": "profile_id", + "type": "TypeString", + "description": "ID of the trusted profile to get.", + "cloud_data_type": "iam", + "required": true, + "cloud_data_range": [ + "service:trusted_profile", + "resolved_to:id" + ] + }, + { + "name": "crn", + "type": "TypeString", + "description": "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "assignment_id", + "type": "TypeString", + "description": "Id of assignment that assigned the template.", + "computed": true + }, { "name": "history", "type": "TypeList", @@ -33564,33 +34115,35 @@ "computed": true }, { - "name": "created_at", + "name": "modified_at", "type": "TypeString", - "description": "If set contains a date time string of the creation date in ISO format.", + "description": "If set contains a date time string of the last modification date in ISO format.", "computed": true - }, + } + ], + "ibm_iam_trusted_profile_claim_rule": [ { - "name": "modified_at", + "name": "realm_name", "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", + "description": "The realm name of the Idp this claim rule applies to.", "computed": true }, { - "name": "iam_id", - "type": "TypeString", - "description": "The iam_id of this trusted profile.", + "name": "expiration", + "type": "TypeInt", + "description": "Session expiration in seconds.", "computed": true }, { - "name": "account_id", + "name": "cr_type", "type": "TypeString", - "description": "ID of the account that this trusted profile belong to.", + "description": "The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, IKS_SA, ROKS_SA.", "computed": true }, { "name": "profile_id", "type": "TypeString", - "description": "ID of the trusted profile to get.", + "description": "ID of the trusted profile.", "cloud_data_type": "iam", "required": true, "cloud_data_range": [ @@ -33599,30 +34152,10 @@ ] }, { - "name": "description", - "type": "TypeString", - "description": "The optional description of the trusted profile. The 'description' property is only available if a description was provided during a create of a trusted profile.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "Template id the profile was created from.", - "computed": true - }, - { - "name": "assignment_id", - "type": "TypeString", - "description": "Id of assignment that assigned the template.", - "computed": true - } - ], - "ibm_iam_trusted_profile_claim_rule": [ - { - "name": "cr_type", + "name": "rule_id", "type": "TypeString", - "description": "The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, IKS_SA, ROKS_SA.", - "computed": true + "description": "ID of the claim rule to get.", + "required": true }, { "name": "entity_tag", @@ -33631,21 +34164,21 @@ "computed": true }, { - "name": "modified_at", + "name": "name", "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", + "description": "The optional claim rule name.", "computed": true }, { - "name": "realm_name", + "name": "created_at", "type": "TypeString", - "description": "The realm name of the Idp this claim rule applies to.", + "description": "If set contains a date time string of the creation date in ISO format.", "computed": true }, { - "name": "name", + "name": "modified_at", "type": "TypeString", - "description": "The optional claim rule name.", + "description": "If set contains a date time string of the last modification date in ISO format.", "computed": true }, { @@ -33654,12 +34187,6 @@ "description": "Type of the Calim rule, either 'Profile-SAML' or 'Profile-CR'.", "computed": true }, - { - "name": "expiration", - "type": "TypeInt", - "description": "Session expiration in seconds.", - "computed": true - }, { "name": "conditions", "type": "TypeList", @@ -33685,29 +34212,6 @@ "computed": true } } - }, - { - "name": "profile_id", - "type": "TypeString", - "description": "ID of the trusted profile.", - "cloud_data_type": "iam", - "required": true, - "cloud_data_range": [ - "service:trusted_profile", - "resolved_to:id" - ] - }, - { - "name": "rule_id", - "type": "TypeString", - "description": "ID of the claim rule to get.", - "required": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "If set contains a date time string of the creation date in ISO format.", - "computed": true } ], "ibm_iam_trusted_profile_claim_rules": [ @@ -33812,6 +34316,18 @@ } ], "ibm_iam_trusted_profile_identities": [ + { + "name": "profile_id", + "type": "TypeString", + "description": "ID of the trusted profile.", + "required": true + }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "Entity tag of the profile identities response.", + "computed": true + }, { "name": "identities", "type": "TypeList", @@ -33852,27 +34368,9 @@ "computed": true } } - }, - { - "name": "profile_id", - "type": "TypeString", - "description": "ID of the trusted profile.", - "required": true - }, - { - "name": "entity_tag", - "type": "TypeString", - "description": "Entity tag of the profile identities response.", - "computed": true } ], "ibm_iam_trusted_profile_identity": [ - { - "name": "profile_id", - "type": "TypeString", - "description": "ID of the trusted profile.", - "required": true - }, { "name": "identity_type", "type": "TypeString", @@ -33917,56 +34415,15 @@ "type": "TypeString", "description": "Description of the identity that can assume the trusted profile. This is optional field for all the types of identities. When this field is not set for the identity type 'serviceid' then the description of the service id is used. Description is recommended for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'.", "computed": true - } - ], - "ibm_iam_trusted_profile_link": [ + }, { "name": "profile_id", "type": "TypeString", "description": "ID of the trusted profile.", - "cloud_data_type": "iam", - "required": true, - "cloud_data_range": [ - "service:trusted_profile", - "resolved_to:id" - ] - }, - { - "name": "link_id", - "type": "TypeString", - "description": "ID of the link.", "required": true - }, - { - "name": "entity_tag", - "type": "TypeString", - "description": "version of the claim rule.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "If set contains a date time string of the creation date in ISO format.", - "computed": true - }, - { - "name": "modified_at", - "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Optional name of the Link.", - "computed": true - }, - { - "name": "cr_type", - "type": "TypeString", - "description": "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.", - "computed": true - }, + } + ], + "ibm_iam_trusted_profile_link": [ { "name": "link", "type": "TypeList", @@ -33991,6 +34448,53 @@ "computed": true } } + }, + { + "name": "profile_id", + "type": "TypeString", + "description": "ID of the trusted profile.", + "cloud_data_type": "iam", + "required": true, + "cloud_data_range": [ + "service:trusted_profile", + "resolved_to:id" + ] + }, + { + "name": "link_id", + "type": "TypeString", + "description": "ID of the link.", + "required": true + }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "version of the claim rule.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "If set contains a date time string of the creation date in ISO format.", + "computed": true + }, + { + "name": "modified_at", + "type": "TypeString", + "description": "If set contains a date time string of the last modification date in ISO format.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Optional name of the Link.", + "computed": true + }, + { + "name": "cr_type", + "type": "TypeString", + "description": "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.", + "computed": true } ], "ibm_iam_trusted_profile_links": [ @@ -34076,23 +34580,6 @@ } ], "ibm_iam_trusted_profile_policy": [ - { - "name": "profile_id", - "type": "TypeString", - "description": "UUID of trusted profile", - "cloud_data_type": "iam", - "optional": true, - "cloud_data_range": [ - "service:trusted_profile", - "resolved_to:id" - ] - }, - { - "name": "iam_id", - "type": "TypeString", - "description": "IAM ID of trusted profile", - "optional": true - }, { "name": "sort", "type": "TypeString", @@ -34312,21 +34799,56 @@ } } } + }, + { + "name": "profile_id", + "type": "TypeString", + "description": "UUID of trusted profile", + "cloud_data_type": "iam", + "optional": true, + "cloud_data_range": [ + "service:trusted_profile", + "resolved_to:id" + ] + }, + { + "name": "iam_id", + "type": "TypeString", + "description": "IAM ID of trusted profile", + "optional": true } ], "ibm_iam_trusted_profile_template": [ { - "name": "name", + "name": "last_modified_at", "type": "TypeString", - "description": "The name of the trusted profile template. This is visible only in the enterprise account.", + "description": "Timestamp of when the template was last modified.", "computed": true }, { - "name": "description", + "name": "created_at", "type": "TypeString", - "description": "The description of the trusted profile template. Describe the template for enterprise account users.", + "description": "Timestamp of when the template was created.", + "computed": true + }, + { + "name": "created_by_id", + "type": "TypeString", + "description": "IAMid of the creator.", "computed": true }, + { + "name": "template_id", + "type": "TypeString", + "description": "ID of the trusted profile template.", + "required": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Version of the Profile Template.", + "optional": true + }, { "name": "profile", "type": "TypeList", @@ -34446,6 +34968,26 @@ } } }, + { + "name": "policy_template_references", + "type": "TypeList", + "description": "Existing policy templates that you can reference to assign access in the trusted profile component.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of Access Policy Template.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Version of Access Policy Template.", + "computed": true + } + } + }, { "name": "history", "type": "TypeList", @@ -34494,29 +35036,29 @@ } }, { - "name": "entity_tag", + "name": "name", "type": "TypeString", - "description": "Entity tag for this templateId-version combination.", + "description": "The name of the trusted profile template. This is visible only in the enterprise account.", "computed": true }, { - "name": "crn", + "name": "description", "type": "TypeString", - "description": "Cloud resource name.", - "cloud_data_type": "crn", + "description": "The description of the trusted profile template. Describe the template for enterprise account users.", "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "Timestamp of when the template was created.", + "name": "committed", + "type": "TypeBool", + "description": "Committed flag determines if the template is ready for assignment.", "computed": true }, { - "name": "version", + "name": "crn", "type": "TypeString", - "description": "Version of the Profile Template.", - "optional": true + "description": "Cloud resource name.", + "cloud_data_type": "crn", + "computed": true }, { "name": "include_history", @@ -34532,21 +35074,15 @@ "computed": true }, { - "name": "last_modified_at", + "name": "account_id", "type": "TypeString", - "description": "Timestamp of when the template was last modified.", + "description": "ID of the account where the template resides.", "computed": true }, { - "name": "template_id", - "type": "TypeString", - "description": "ID of the trusted profile template.", - "required": true - }, - { - "name": "created_by_id", + "name": "entity_tag", "type": "TypeString", - "description": "IAMid of the creator.", + "description": "Entity tag for this templateId-version combination.", "computed": true }, { @@ -34554,63 +35090,25 @@ "type": "TypeString", "description": "IAMid of the identity that made the latest modification.", "computed": true - }, - { - "name": "policy_template_references", - "type": "TypeList", - "description": "Existing policy templates that you can reference to assign access in the trusted profile component.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of Access Policy Template.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Version of Access Policy Template.", - "computed": true - } - } - }, - { - "name": "committed", - "type": "TypeBool", - "description": "Committed flag determines if the template is ready for assignment.", - "computed": true - }, - { - "name": "account_id", - "type": "TypeString", - "description": "ID of the account where the template resides.", - "computed": true } ], "ibm_iam_trusted_profile_template_assignment": [ { - "name": "assignment_id", + "name": "account_id", "type": "TypeString", - "description": "ID of the Assignment Record.", - "required": true - }, - { - "name": "template_version", - "type": "TypeInt", - "description": "Template version.", + "description": "Enterprise account Id.", "computed": true }, { - "name": "status", + "name": "target_type", "type": "TypeString", - "description": "Assignment status.", + "description": "Assignment target type.", "computed": true }, { - "name": "created_at", + "name": "href", "type": "TypeString", - "description": "Assignment created at.", + "description": "Href.", "computed": true }, { @@ -34626,6 +35124,104 @@ "default_value": false, "optional": true }, + { + "name": "id", + "type": "TypeString", + "description": "Assignment record Id.", + "computed": true + }, + { + "name": "created_by_id", + "type": "TypeString", + "description": "IAMid of the identity that created the assignment.", + "computed": true + }, + { + "name": "context", + "type": "TypeList", + "description": "Context with key properties for problem determination.", + "computed": true, + "elem": { + "cluster_name": { + "name": "cluster_name", + "type": "TypeString", + "description": "The cluster name.", + "computed": true + }, + "elapsed_time": { + "name": "elapsed_time", + "type": "TypeString", + "description": "The elapsed time in msec.", + "computed": true + }, + "end_time": { + "name": "end_time", + "type": "TypeString", + "description": "The finish time of the request.", + "computed": true + }, + "host": { + "name": "host", + "type": "TypeString", + "description": "The host of the server instance processing the request.", + "computed": true + }, + "instance_id": { + "name": "instance_id", + "type": "TypeString", + "description": "The instance ID of the server instance processing the request.", + "computed": true + }, + "operation": { + "name": "operation", + "type": "TypeString", + "description": "The operation of the inbound REST request.", + "computed": true + }, + "start_time": { + "name": "start_time", + "type": "TypeString", + "description": "The start time of the request.", + "computed": true + }, + "thread_id": { + "name": "thread_id", + "type": "TypeString", + "description": "The thread ID of the server instance processing the request.", + "computed": true + }, + "transaction_id": { + "name": "transaction_id", + "type": "TypeString", + "description": "The transaction ID of the inbound REST request.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "The URL of that cluster.", + "computed": true + }, + "user_agent": { + "name": "user_agent", + "type": "TypeString", + "description": "The user agent of the inbound REST request.", + "computed": true + } + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Assignment created at.", + "computed": true + }, + { + "name": "template_version", + "type": "TypeInt", + "description": "Template version.", + "computed": true + }, { "name": "resources", "type": "TypeList", @@ -34783,6 +35379,24 @@ } } }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "IAMid of the identity that last modified the assignment.", + "computed": true + }, + { + "name": "assignment_id", + "type": "TypeString", + "description": "ID of the Assignment Record.", + "required": true + }, + { + "name": "template_id", + "type": "TypeString", + "description": "Template Id.", + "computed": true + }, { "name": "history", "type": "TypeList", @@ -34831,135 +35445,48 @@ } }, { - "name": "created_by_id", - "type": "TypeString", - "description": "IAMid of the identity that created the assignment.", - "computed": true - }, - { - "name": "context", - "type": "TypeList", - "description": "Context with key properties for problem determination.", - "computed": true, - "elem": { - "cluster_name": { - "name": "cluster_name", - "type": "TypeString", - "description": "The cluster name.", - "computed": true - }, - "elapsed_time": { - "name": "elapsed_time", - "type": "TypeString", - "description": "The elapsed time in msec.", - "computed": true - }, - "end_time": { - "name": "end_time", - "type": "TypeString", - "description": "The finish time of the request.", - "computed": true - }, - "host": { - "name": "host", - "type": "TypeString", - "description": "The host of the server instance processing the request.", - "computed": true - }, - "instance_id": { - "name": "instance_id", - "type": "TypeString", - "description": "The instance ID of the server instance processing the request.", - "computed": true - }, - "operation": { - "name": "operation", - "type": "TypeString", - "description": "The operation of the inbound REST request.", - "computed": true - }, - "start_time": { - "name": "start_time", - "type": "TypeString", - "description": "The start time of the request.", - "computed": true - }, - "thread_id": { - "name": "thread_id", - "type": "TypeString", - "description": "The thread ID of the server instance processing the request.", - "computed": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "TypeString", - "description": "The transaction ID of the inbound REST request.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "The URL of that cluster.", - "computed": true - }, - "user_agent": { - "name": "user_agent", - "type": "TypeString", - "description": "The user agent of the inbound REST request.", - "computed": true - } - } - }, - { - "name": "id", - "type": "TypeString", - "description": "Assignment record Id.", - "computed": true - }, - { - "name": "template_id", + "name": "last_modified_at", "type": "TypeString", - "description": "Template Id.", + "description": "Assignment modified at.", "computed": true }, { - "name": "href", + "name": "target", "type": "TypeString", - "description": "Href.", + "description": "Assignment target.", "computed": true }, { - "name": "last_modified_by_id", + "name": "status", "type": "TypeString", - "description": "IAMid of the identity that last modified the assignment.", + "description": "Assignment status.", "computed": true - }, + } + ], + "ibm_iam_trusted_profiles": [ { "name": "account_id", "type": "TypeString", - "description": "Enterprise account Id.", - "computed": true + "description": "Account ID to query for trusted profiles.", + "optional": true }, { - "name": "target_type", + "name": "name", "type": "TypeString", - "description": "Assignment target type.", - "computed": true + "description": "Name of the profile", + "cloud_data_type": "iam", + "optional": true, + "cloud_data_range": [ + "service:trusted_profile", + "resolved_to:name" + ] }, { - "name": "target", - "type": "TypeString", - "description": "Assignment target.", - "computed": true + "name": "include_history", + "type": "TypeBool", + "description": "Defines if the entity history is included in the response. Default is false", + "optional": true }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "Assignment modified at.", - "computed": true - } - ], - "ibm_iam_trusted_profiles": [ { "name": "profiles", "type": "TypeList", @@ -35080,32 +35607,27 @@ "computed": true } } - }, + } + ], + "ibm_iam_user_mfa_enrollments": [ { "name": "account_id", "type": "TypeString", - "description": "Account ID to query for trusted profiles.", - "optional": true + "description": "ID of the account.", + "required": true }, { - "name": "name", + "name": "iam_id", "type": "TypeString", - "description": "Name of the profile", - "cloud_data_type": "iam", - "optional": true, - "cloud_data_range": [ - "service:trusted_profile", - "resolved_to:name" - ] + "description": "iam_id of the user. This user must be the member of the account.", + "required": true }, { - "name": "include_history", - "type": "TypeBool", - "description": "Defines if the entity history is included in the response. Default is false", - "optional": true - } - ], - "ibm_iam_user_mfa_enrollments": [ + "name": "effective_mfa_type", + "type": "TypeString", + "description": "currently effective mfa type i.e. id_based_mfa or account_based_mfa.", + "computed": true + }, { "name": "id_based_mfa", "type": "TypeList", @@ -35206,33 +35728,9 @@ } } } - }, - { - "name": "account_id", - "type": "TypeString", - "description": "ID of the account.", - "required": true - }, - { - "name": "iam_id", - "type": "TypeString", - "description": "iam_id of the user. This user must be the member of the account.", - "required": true - }, - { - "name": "effective_mfa_type", - "type": "TypeString", - "description": "currently effective mfa type i.e. id_based_mfa or account_based_mfa.", - "computed": true } ], "ibm_iam_user_policy": [ - { - "name": "sort", - "type": "TypeString", - "description": "Sort query for policies", - "optional": true - }, { "name": "transaction_id", "type": "TypeString", @@ -35404,40 +35902,31 @@ "type": "TypeString", "description": "The ibm id or email of user", "required": true + }, + { + "name": "sort", + "type": "TypeString", + "description": "Sort query for policies", + "optional": true } ], "ibm_iam_user_profile": [ { - "name": "account_id", - "type": "TypeString", - "description": "An alphanumeric value identifying the account ID.", - "computed": true - }, - { - "name": "ibm_id", + "name": "firstname", "type": "TypeString", - "description": "An alphanumeric value identifying the user's IAM ID.", + "description": "The first name of the user.", "computed": true }, { - "name": "allowed_ip_addresses", - "type": "TypeList", - "description": "List of allowed IPv4 or IPv6 addresses", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "user_id", + "name": "altphonenumber", "type": "TypeString", - "description": "The user ID used for login.", + "description": "The alternative phone number of the user.", "computed": true }, { - "name": "lastname", + "name": "ibm_id", "type": "TypeString", - "description": "The last name of the user.", + "description": "An alphanumeric value identifying the user's IAM ID.", "computed": true }, { @@ -35447,9 +35936,9 @@ "computed": true }, { - "name": "altphonenumber", + "name": "account_id", "type": "TypeString", - "description": "The alternative phone number of the user.", + "description": "An alphanumeric value identifying the account ID.", "computed": true }, { @@ -35459,9 +35948,24 @@ "required": true }, { - "name": "firstname", + "name": "allowed_ip_addresses", + "type": "TypeList", + "description": "List of allowed IPv4 or IPv6 addresses", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "user_id", "type": "TypeString", - "description": "The first name of the user.", + "description": "The user ID used for login.", + "computed": true + }, + { + "name": "lastname", + "type": "TypeString", + "description": "The last name of the user.", "computed": true }, { @@ -35548,6 +36052,25 @@ } ], "ibm_is_backup_policies": [ + { + "name": "resource_group", + "type": "TypeString", + "description": "Filters the collection to resources in the resource group with the specified identifier", + "cloud_data_type": "resource_group", + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Filters the collection to resources with the exact specified name", + "optional": true + }, + { + "name": "tag", + "type": "TypeString", + "description": "Filters the collection to resources with the exact tag value", + "optional": true + }, { "name": "backup_policies", "type": "TypeList", @@ -35566,6 +36089,38 @@ "description": "The CRN for this backup policy.", "computed": true }, + "health_reasons": { + "name": "health_reasons", + "type": "TypeList", + "description": "The reasons for the current health_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + "health_state": { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource", + "computed": true + }, "href": { "name": "href", "type": "TypeString", @@ -35691,48 +36246,57 @@ "type": "TypeString", "description": "The type of resource referenced.", "computed": true + }, + "scope": { + "name": "scope", + "type": "TypeList", + "description": "The scope for this backup policy.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this enterprise.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this enterprise or account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } } } - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Filters the collection to resources in the resource group with the specified identifier", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Filters the collection to resources with the exact specified name", - "optional": true - }, - { - "name": "tag", - "type": "TypeString", - "description": "Filters the collection to resources with the exact tag value", - "optional": true } ], "ibm_is_backup_policy": [ { - "name": "resource_type", + "name": "last_job_completed_at", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The date and time that the most recent job for this backup policy completed.", "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the backup policy was created.", - "computed": true + "name": "match_resource_types", + "type": "TypeList", + "description": "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "crn", + "name": "identifier", "type": "TypeString", - "description": "The CRN for this backup policy.", - "cloud_data_type": "crn", - "computed": true + "description": "The backup policy identifier.", + "optional": true }, { "name": "href", @@ -35741,9 +36305,9 @@ "computed": true }, { - "name": "last_job_completed_at", + "name": "lifecycle_state", "type": "TypeString", - "description": "The date and time that the most recent job for this backup policy completed.", + "description": "The lifecycle state of the backup policy.", "computed": true }, { @@ -35755,6 +36319,72 @@ "type": "TypeString" } }, + { + "name": "resource_group", + "type": "TypeList", + "description": "The resource group for this backup policy.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this resource group.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this resource group.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this resource group.", + "computed": true + } + } + }, + { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource", + "computed": true + }, + { + "name": "scope", + "type": "TypeList", + "description": "The scope for this backup policy.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this enterprise.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this enterprise or account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this backup policy.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "plans", "type": "TypeList", @@ -35802,10 +36432,10 @@ } }, { - "name": "identifier", + "name": "resource_type", "type": "TypeString", - "description": "The backup policy identifier.", - "optional": true + "description": "The type of resource referenced.", + "computed": true }, { "name": "name", @@ -35815,55 +36445,75 @@ "computed": true }, { - "name": "lifecycle_state", + "name": "created_at", "type": "TypeString", - "description": "The lifecycle state of the backup policy.", + "description": "The date and time that the backup policy was created.", "computed": true }, { - "name": "match_resource_types", - "type": "TypeList", - "description": "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_group", + "name": "health_reasons", "type": "TypeList", - "description": "The resource group for this backup policy.", - "cloud_data_type": "resource_group", + "description": "The reasons for the current health_state (if any).", "computed": true, "elem": { - "href": { - "name": "href", + "code": { + "name": "code", "type": "TypeString", - "description": "The URL for this resource group.", + "description": "A snake case string succinctly identifying the reason for this health state.", "computed": true }, - "id": { - "name": "id", + "message": { + "name": "message", "type": "TypeString", - "description": "The unique identifier for this resource group.", + "description": "An explanation of the reason for this health state.", "computed": true }, - "name": { - "name": "name", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The user-defined name for this resource group.", + "description": "Link to documentation about the reason for this health state.", "computed": true } } } ], "ibm_is_backup_policy_job": [ + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the backup policy job was created.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this backup policy job.", + "computed": true + }, + { + "name": "job_type", + "type": "TypeString", + "description": "The type of backup policy job.The enumerated values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the unexpected property value was encountered.", + "computed": true + }, + { + "name": "identifier", + "type": "TypeString", + "description": "The backup policy job identifier.", + "required": true + }, { "name": "resource_type", "type": "TypeString", "description": "The resource type.", "computed": true }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the backup policy job.The enumerated values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the unexpected property value was encountered.", + "computed": true + }, { "name": "target_snapshot", "type": "TypeList", @@ -35916,12 +36566,6 @@ } } }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the backup policy job.The enumerated values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the unexpected property value was encountered.", - "computed": true - }, { "name": "backup_policy_plan", "type": "TypeList", @@ -35969,9 +36613,53 @@ } }, { - "name": "created_at", + "name": "completed_at", "type": "TypeString", - "description": "The date and time that the backup policy job was created.", + "description": "The date and time that the backup policy job was completed.", + "computed": true + }, + { + "name": "status_reasons", + "type": "TypeList", + "description": "The reasons for the current status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason:- `internal_error`: Internal error (contact IBM support)- `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state- `snapshot_volume_limit`: The snapshot limit for the source volume has been reached- `source_volume_busy`: The source volume has `busy` set (after multiple retries).", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", + "computed": true + } + } + }, + { + "name": "backup_policy_id", + "type": "TypeString", + "description": "The backup policy identifier.", + "required": true + }, + { + "name": "auto_delete", + "type": "TypeBool", + "description": "Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is always `true`, but may be modifiable in the future.", + "computed": true + }, + { + "name": "auto_delete_after", + "type": "TypeInt", + "description": "If `auto_delete` is `true`, the days after completion that this backup policy job will be deleted. This value may be modifiable in the future.", "computed": true }, { @@ -36019,77 +36707,24 @@ "computed": true } } - }, - { - "name": "auto_delete", - "type": "TypeBool", - "description": "Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is always `true`, but may be modifiable in the future.", - "computed": true - }, - { - "name": "auto_delete_after", - "type": "TypeInt", - "description": "If `auto_delete` is `true`, the days after completion that this backup policy job will be deleted. This value may be modifiable in the future.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this backup policy job.", - "computed": true - }, - { - "name": "job_type", - "type": "TypeString", - "description": "The type of backup policy job.The enumerated values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the unexpected property value was encountered.", - "computed": true - }, + } + ], + "ibm_is_backup_policy_jobs": [ { - "name": "status_reasons", - "type": "TypeList", - "description": "The reasons for the current status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", - "computed": true, + "name": "target_snapshots_crn", + "type": "TypeSet", + "description": "Filters the collection to backup policy jobs with the target snapshot with the specified CRN", + "optional": true, "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason:- `internal_error`: Internal error (contact IBM support)- `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state- `snapshot_volume_limit`: The snapshot limit for the source volume has been reached- `source_volume_busy`: The source volume has `busy` set (after multiple retries).", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the status reason.", - "computed": true - }, - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about this status reason.", - "computed": true - } + "type": "TypeString" } }, { - "name": "backup_policy_id", - "type": "TypeString", - "description": "The backup policy identifier.", - "required": true - }, - { - "name": "identifier", + "name": "backup_policy_plan_id", "type": "TypeString", - "description": "The backup policy job identifier.", - "required": true + "description": "Filters the collection to backup policy jobs with the backup plan with the specified identifier.", + "optional": true }, - { - "name": "completed_at", - "type": "TypeString", - "description": "The date and time that the backup policy job was completed.", - "computed": true - } - ], - "ibm_is_backup_policy_jobs": [ { "name": "status", "type": "TypeString", @@ -36348,24 +36983,37 @@ "elem": { "type": "TypeString" } - }, + } + ], + "ibm_is_backup_policy_plan": [ { - "name": "target_snapshots_crn", - "type": "TypeSet", - "description": "Filters the collection to backup policy jobs with the target snapshot with the specified CRN", - "optional": true, + "name": "clone_policy", + "type": "TypeList", + "computed": true, "elem": { - "type": "TypeString" + "max_snapshots": { + "name": "max_snapshots", + "type": "TypeInt", + "description": "The maximum number of recent snapshots (per source) that will keep clones.", + "computed": true + }, + "zones": { + "name": "zones", + "type": "TypeSet", + "description": "The zone this backup policy plan will create snapshot clones in.", + "computed": true, + "elem": { + "type": "TypeString" + } + } } }, { - "name": "backup_policy_plan_id", + "name": "identifier", "type": "TypeString", - "description": "Filters the collection to backup policy jobs with the backup plan with the specified identifier.", + "description": "The backup policy plan identifier.", "optional": true - } - ], - "ibm_is_backup_policy_plan": [ + }, { "name": "active", "type": "TypeBool", @@ -36381,43 +37029,6 @@ "type": "TypeString" } }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the backup policy plan was created.", - "computed": true - }, - { - "name": "cron_spec", - "type": "TypeString", - "description": "The cron specification for the backup schedule.", - "computed": true - }, - { - "name": "deletion_trigger", - "type": "TypeList", - "computed": true, - "elem": { - "delete_after": { - "name": "delete_after", - "type": "TypeInt", - "description": "The maximum number of days to keep each backup after creation.", - "computed": true - }, - "delete_over_count": { - "name": "delete_over_count", - "type": "TypeInt", - "description": "The maximum number of recent backups to keep. If absent, there is no maximum.", - "computed": true - } - } - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this backup policy plan.", - "computed": true - }, { "name": "remote_region_policy", "type": "TypeList", @@ -36445,33 +37056,36 @@ } }, { - "name": "identifier", + "name": "backup_policy_id", "type": "TypeString", - "description": "The backup policy plan identifier.", - "optional": true + "description": "The backup policy identifier.", + "required": true }, { - "name": "clone_policy", + "name": "deletion_trigger", "type": "TypeList", "computed": true, "elem": { - "max_snapshots": { - "name": "max_snapshots", + "delete_after": { + "name": "delete_after", "type": "TypeInt", - "description": "The maximum number of recent snapshots (per source) that will keep clones.", + "description": "The maximum number of days to keep each backup after creation.", "computed": true }, - "zones": { - "name": "zones", - "type": "TypeSet", - "description": "The zone this backup policy plan will create snapshot clones in.", - "computed": true, - "elem": { - "type": "TypeString" - } + "delete_over_count": { + "name": "delete_over_count", + "type": "TypeInt", + "description": "The maximum number of recent backups to keep. If absent, there is no maximum.", + "computed": true } } }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of this backup policy plan.", + "computed": true + }, { "name": "resource_type", "type": "TypeString", @@ -36479,32 +37093,50 @@ "computed": true }, { - "name": "backup_policy_id", + "name": "copy_user_tags", + "type": "TypeBool", + "description": "Indicates whether to copy the source's user tags to the created resource.", + "computed": true + }, + { + "name": "cron_spec", "type": "TypeString", - "description": "The backup policy identifier.", - "required": true + "description": "The cron specification for the backup schedule.", + "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "The unique user-defined name for this backup policy plan.", - "optional": true, + "description": "The URL for this backup policy plan.", "computed": true }, { - "name": "copy_user_tags", - "type": "TypeBool", - "description": "Indicates whether to copy the source's user tags to the created resource.", + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this backup policy plan.", + "optional": true, "computed": true }, { - "name": "lifecycle_state", + "name": "created_at", "type": "TypeString", - "description": "The lifecycle state of this backup policy plan.", + "description": "The date and time that the backup policy plan was created.", "computed": true } ], "ibm_is_backup_policy_plans": [ + { + "name": "backup_policy_id", + "type": "TypeString", + "description": "The backup policy identifier.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this backup policy plan.", + "optional": true + }, { "name": "plans", "type": "TypeList", @@ -36642,134 +37274,21 @@ "computed": true } } - }, - { - "name": "backup_policy_id", - "type": "TypeString", - "description": "The backup policy identifier.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this backup policy plan.", - "optional": true } ], "ibm_is_bare_metal_server": [ { - "name": "trusted_platform_module", - "type": "TypeList", - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Indicates whether the trusted platform module is enabled.", - "computed": true - }, - "mode": { - "name": "mode", - "type": "TypeString", - "description": "The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's supported_trusted_platform_module_modes", - "computed": true - }, - "supported_modes": { - "name": "supported_modes", - "type": "TypeSet", - "description": "The trusted platform module (TPM) mode:: disabled: No TPM functionality, tpm_2: TPM 2.0. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. Enum: [ disabled, tpm_2 ]", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this bare metal server", - "computed": true - }, - { - "name": "zone", - "type": "TypeString", - "description": "Zone name", - "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "Resource type name", - "computed": true - }, - { - "name": "identifier", - "type": "TypeString", - "optional": true, - "computed": true - }, - { - "name": "memory", + "name": "bandwidth", "type": "TypeInt", - "description": "The amount of memory, truncated to whole gibibytes", - "computed": true - }, - { - "name": "keys", - "type": "TypeSet", - "description": "SSH key Ids for the bare metal server", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "image", - "type": "TypeString", - "description": "image name", + "description": "The total bandwidth (in megabits per second)", "computed": true }, { - "name": "vpc", + "name": "boot_target", "type": "TypeString", - "description": "The VPC the bare metal server is to be a part of", + "description": "The unique identifier for this bare metal server disk", "computed": true }, - { - "name": "status_reasons", - "type": "TypeList", - "computed": true, - "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the status reason", - "computed": true - }, - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about this status reason", - "computed": true - } - } - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "cpu", "type": "TypeList", @@ -36802,18 +37321,6 @@ } } }, - { - "name": "bandwidth", - "type": "TypeInt", - "description": "The total bandwidth (in megabits per second)", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the bare metal server was created", - "computed": true - }, { "name": "primary_network_interface", "type": "TypeList", @@ -36900,6 +37407,173 @@ } } }, + { + "name": "keys", + "type": "TypeSet", + "description": "SSH key Ids for the bare metal server", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "image", + "type": "TypeString", + "description": "image name", + "computed": true + }, + { + "name": "identifier", + "type": "TypeString", + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Bare metal server name", + "optional": true, + "computed": true + }, + { + "name": "trusted_platform_module", + "type": "TypeList", + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Indicates whether the trusted platform module is enabled.", + "computed": true + }, + "mode": { + "name": "mode", + "type": "TypeString", + "description": "The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's supported_trusted_platform_module_modes", + "computed": true + }, + "supported_modes": { + "name": "supported_modes", + "type": "TypeSet", + "description": "The trusted platform module (TPM) mode:: disabled: No TPM functionality, tpm_2: TPM 2.0. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. Enum: [ disabled, tpm_2 ]", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the bare metal server was created", + "computed": true + }, + { + "name": "memory", + "type": "TypeInt", + "description": "The amount of memory, truncated to whole gibibytes", + "computed": true + }, + { + "name": "vpc", + "type": "TypeString", + "description": "The VPC the bare metal server is to be a part of", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "Resource type name", + "computed": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags for the Bare metal server", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this bare metal server", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "profile", + "type": "TypeString", + "description": "profil name", + "computed": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "computed": true + }, + { + "name": "enable_secure_boot", + "type": "TypeBool", + "description": "Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to boot.", + "computed": true + }, + { + "name": "disks", + "type": "TypeList", + "description": "The disks for this bare metal server, including any disks that are associated with the boot_target.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this bare metal server disk", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this bare metal server disk", + "computed": true + }, + "interface_type": { + "name": "interface_type", + "type": "TypeString", + "description": "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this disk", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", + "computed": true + }, + "size": { + "name": "size", + "type": "TypeInt", + "description": "The size of the disk in GB (gigabytes)", + "computed": true + } + } + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this bare metal server", + "computed": true + }, { "name": "network_interfaces", "type": "TypeList", @@ -36981,108 +37655,72 @@ } }, { - "name": "status", - "type": "TypeString", - "description": "Bare metal server status", - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the Bare metal server", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "name", - "type": "TypeString", - "description": "Bare metal server name", - "optional": true, - "computed": true - }, - { - "name": "boot_target", + "name": "resource_group", "type": "TypeString", - "description": "The unique identifier for this bare metal server disk", + "description": "Resource group name", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "crn", + "name": "status", "type": "TypeString", - "description": "The CRN for this bare metal server", - "cloud_data_type": "crn", + "description": "Bare metal server status", "computed": true }, { - "name": "disks", + "name": "status_reasons", "type": "TypeList", - "description": "The disks for this bare metal server, including any disks that are associated with the boot_target.", "computed": true, "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this bare metal server disk", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this bare metal server disk", - "computed": true - }, - "interface_type": { - "name": "interface_type", + "code": { + "name": "code", "type": "TypeString", - "description": "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + "description": "A snake case string succinctly identifying the status reason", "computed": true }, - "name": { - "name": "name", + "message": { + "name": "message", "type": "TypeString", - "description": "The user-defined name for this disk", + "description": "An explanation of the status reason", "computed": true }, - "resource_type": { - "name": "resource_type", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The resource type", - "computed": true - }, - "size": { - "name": "size", - "type": "TypeInt", - "description": "The size of the disk in GB (gigabytes)", + "description": "Link to documentation about this status reason", "computed": true } } }, { - "name": "profile", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_is_bare_metal_server_disk": [ + { + "name": "resource_type", "type": "TypeString", - "description": "profil name", + "description": "The resource type", "computed": true }, { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group name", - "cloud_data_type": "resource_group", + "name": "size", + "type": "TypeInt", + "description": "The size of the disk in GB (gigabytes)", "computed": true }, { - "name": "enable_secure_boot", - "type": "TypeBool", - "description": "Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to boot.", - "computed": true - } - ], - "ibm_is_bare_metal_server_disk": [ + "name": "bare_metal_server", + "type": "TypeString", + "description": "The bare metal server identifier", + "required": true + }, { "name": "disk", "type": "TypeString", @@ -37112,24 +37750,6 @@ "type": "TypeString", "description": "The user-defined name for this disk", "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - }, - { - "name": "size", - "type": "TypeInt", - "description": "The size of the disk in GB (gigabytes)", - "computed": true - }, - { - "name": "bare_metal_server", - "type": "TypeString", - "description": "The bare metal server identifier", - "required": true } ], "ibm_is_bare_metal_server_disks": [ @@ -37185,6 +37805,20 @@ } ], "ibm_is_bare_metal_server_initialization": [ + { + "name": "private_key", + "type": "TypeString", + "description": "Bare Metal Server Private Key file", + "secure": true, + "optional": true + }, + { + "name": "passphrase", + "type": "TypeString", + "description": "Passphrase for Bare Metal Server Private Key file", + "secure": true, + "optional": true + }, { "name": "image", "type": "TypeString", @@ -37251,44 +37885,65 @@ "type": "TypeString", "description": "The bare metal server identifier", "required": true - }, - { - "name": "private_key", - "type": "TypeString", - "description": "Bare Metal Server Private Key file", - "secure": true, - "optional": true - }, - { - "name": "passphrase", - "type": "TypeString", - "description": "Passphrase for Bare Metal Server Private Key file", - "secure": true, - "optional": true } ], "ibm_is_bare_metal_server_network_interface": [ { - "name": "mac_address", + "name": "name", "type": "TypeString", - "description": "The MAC address of the interface. If absent, the value is not known.", + "description": "The user-defined name for this network interface", "computed": true }, { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type : [ subnet_reserved_ip ]", + "name": "port_speed", + "type": "TypeInt", + "description": "The network interface port speed in Mbps", "computed": true }, { - "name": "allowed_vlans", - "type": "TypeSet", - "description": "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + "name": "primary_ip", + "type": "TypeList", + "description": "IPv4, The IP address.", "computed": true, "elem": { - "type": "TypeInt" + "address": { + "name": "address", + "type": "TypeString", + "description": "The globally unique IP address", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this reserved IP", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", + "computed": true + }, + "reserved_ip": { + "name": "reserved_ip", + "type": "TypeString", + "description": "Identifies a reserved IP by a unique property.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", + "computed": true + } } }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the network interface : [ available, deleting, failed, pending ]", + "computed": true + }, { "name": "vlan", "type": "TypeInt", @@ -37296,10 +37951,10 @@ "computed": true }, { - "name": "network_interface", - "type": "TypeString", - "description": "The bare metal server network interface identifier", - "required": true + "name": "allow_interface_to_float", + "type": "TypeBool", + "description": "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + "computed": true }, { "name": "allow_ip_spoofing", @@ -37307,6 +37962,39 @@ "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", "computed": true }, + { + "name": "enable_infrastructure_nat", + "type": "TypeBool", + "description": "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this network interface", + "computed": true + }, + { + "name": "mac_address", + "type": "TypeString", + "description": "The MAC address of the interface. If absent, the value is not known.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of this bare metal server network interface : [ primary, secondary ]", + "computed": true + }, + { + "name": "allowed_vlans", + "type": "TypeSet", + "description": "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + "computed": true, + "elem": { + "type": "TypeInt" + } + }, { "name": "floating_ips", "type": "TypeList", @@ -37353,15 +38041,27 @@ } }, { - "name": "href", + "name": "interface_type", "type": "TypeString", - "description": "The URL for this network interface", + "description": "The network interface type: [ pci, vlan ]", "computed": true }, { - "name": "interface_type", + "name": "bare_metal_server", "type": "TypeString", - "description": "The network interface type: [ pci, vlan ]", + "description": "The bare metal server identifier", + "required": true + }, + { + "name": "network_interface", + "type": "TypeString", + "description": "The bare metal server network interface identifier", + "required": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type : [ subnet_reserved_ip ]", "computed": true }, { @@ -37378,89 +38078,40 @@ "type": "TypeString", "description": "The id of the associated subnet", "computed": true - }, + } + ], + "ibm_is_bare_metal_server_network_interface_floating_ip": [ { - "name": "type", + "name": "name", "type": "TypeString", - "description": "The type of this bare metal server network interface : [ primary, secondary ]", + "description": "Name of the floating IP", "computed": true }, { - "name": "bare_metal_server", + "name": "address", "type": "TypeString", - "description": "The bare metal server identifier", - "required": true - }, - { - "name": "port_speed", - "type": "TypeInt", - "description": "The network interface port speed in Mbps", + "description": "Floating IP address", "computed": true }, { - "name": "status", + "name": "zone", "type": "TypeString", - "description": "The status of the network interface : [ available, deleting, failed, pending ]", - "computed": true - }, - { - "name": "allow_interface_to_float", - "type": "TypeBool", - "description": "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + "description": "Zone name", "computed": true }, { - "name": "enable_infrastructure_nat", - "type": "TypeBool", - "description": "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + "name": "crn", + "type": "TypeString", + "description": "Floating IP crn", + "cloud_data_type": "crn", "computed": true }, { - "name": "name", + "name": "bare_metal_server", "type": "TypeString", - "description": "The user-defined name for this network interface", - "computed": true + "description": "The bare metal server identifier", + "required": true }, - { - "name": "primary_ip", - "type": "TypeList", - "description": "IPv4, The IP address.", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The globally unique IP address", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this reserved IP", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", - "computed": true - }, - "reserved_ip": { - "name": "reserved_ip", - "type": "TypeString", - "description": "Identifies a reserved IP by a unique property.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - } - } - } - ], - "ibm_is_bare_metal_server_network_interface_floating_ip": [ { "name": "floating_ip", "type": "TypeString", @@ -37468,30 +38119,25 @@ "required": true }, { - "name": "status", - "type": "TypeString", - "description": "Floating IP status", - "computed": true - }, - { - "name": "zone", + "name": "target", "type": "TypeString", - "description": "Zone name", + "description": "Target info", "computed": true }, { - "name": "target", + "name": "network_interface", "type": "TypeString", - "description": "Target info", - "computed": true + "description": "The network interface identifier of bare metal server", + "required": true }, { - "name": "crn", + "name": "status", "type": "TypeString", - "description": "Floating IP crn", - "cloud_data_type": "crn", + "description": "Floating IP status", "computed": true - }, + } + ], + "ibm_is_bare_metal_server_network_interface_floating_ips": [ { "name": "bare_metal_server", "type": "TypeString", @@ -37504,20 +38150,6 @@ "description": "The network interface identifier of bare metal server", "required": true }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the floating IP", - "computed": true - }, - { - "name": "address", - "type": "TypeString", - "description": "Floating IP address", - "computed": true - } - ], - "ibm_is_bare_metal_server_network_interface_floating_ips": [ { "name": "floating_ips", "type": "TypeList", @@ -37567,55 +38199,43 @@ "computed": true } } - }, - { - "name": "bare_metal_server", - "type": "TypeString", - "description": "The bare metal server identifier", - "required": true - }, - { - "name": "network_interface", - "type": "TypeString", - "description": "The network interface identifier of bare metal server", - "required": true } ], "ibm_is_bare_metal_server_network_interface_reserved_ip": [ { - "name": "reserved_ip", + "name": "address", "type": "TypeString", - "description": "The reserved IP identifier.", - "required": true + "description": "The IP address", + "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "If set to true, this reserved IP will be automatically deleted", + "name": "owner", + "type": "TypeString", + "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", "computed": true }, { - "name": "href", + "name": "target", "type": "TypeString", - "description": "The URL for this reserved IP.", + "description": "Reserved IP target id.", "computed": true }, { - "name": "owner", + "name": "href", "type": "TypeString", - "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", + "description": "The URL for this reserved IP.", "computed": true }, { - "name": "resource_type", + "name": "name", "type": "TypeString", - "description": "The resource type.", + "description": "The user-defined or system-provided name for this reserved IP.", "computed": true }, { - "name": "target", + "name": "resource_type", "type": "TypeString", - "description": "Reserved IP target id.", + "description": "The resource type.", "computed": true }, { @@ -37631,21 +38251,21 @@ "required": true }, { - "name": "address", + "name": "reserved_ip", "type": "TypeString", - "description": "The IP address", - "computed": true + "description": "The reserved IP identifier.", + "required": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the reserved IP was created.", + "name": "auto_delete", + "type": "TypeBool", + "description": "If set to true, this reserved IP will be automatically deleted", "computed": true }, { - "name": "name", + "name": "created_at", "type": "TypeString", - "description": "The user-defined or system-provided name for this reserved IP.", + "description": "The date and time that the reserved IP was created.", "computed": true } ], @@ -37732,6 +38352,12 @@ } ], "ibm_is_bare_metal_server_network_interfaces": [ + { + "name": "bare_metal_server", + "type": "TypeString", + "description": "The bare metal server identifier", + "required": true + }, { "name": "network_interfaces", "type": "TypeList", @@ -37924,41 +38550,34 @@ "computed": true } } - }, - { - "name": "bare_metal_server", - "type": "TypeString", - "description": "The bare metal server identifier", - "required": true } ], "ibm_is_bare_metal_server_profile": [ { - "name": "memory", + "name": "network_interface_count", "type": "TypeList", - "description": "The memory (in gibibytes) for a bare metal server with this profile", "computed": true, "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field", + "max": { + "name": "max", + "type": "TypeInt", + "description": "The maximum value for this profile field.", "computed": true }, - "value": { - "name": "value", + "min": { + "name": "min", "type": "TypeInt", - "description": "The value for this profile field", + "description": "The minimum value for this profile field.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", "computed": true } } }, - { - "name": "family", - "type": "TypeString", - "description": "The product family this bare metal server profile belongs to", - "computed": true - }, { "name": "resource_type", "type": "TypeString", @@ -37966,9 +38585,9 @@ "computed": true }, { - "name": "cpu_core_count", + "name": "cpu_socket_count", "type": "TypeList", - "description": "The CPU core count for a bare metal server with this profile", + "description": "The number of CPU sockets for a bare metal server with this profile", "computed": true, "elem": { "type": { @@ -37986,21 +38605,27 @@ } }, { - "name": "console_types", + "name": "os_architecture", "type": "TypeList", - "description": "The console type configuration for a bare metal server with this profile.", + "description": "The supported OS architecture(s) for a bare metal server with this profile", "computed": true, "elem": { + "default": { + "name": "default", + "type": "TypeString", + "description": "The default for this profile field", + "computed": true + }, "type": { "name": "type", "type": "TypeString", - "description": "The type for this profile field.", + "description": "The type for this profile field", "computed": true }, "values": { "name": "values", - "type": "TypeList", - "description": "The console types for a bare metal server with this profile.", + "type": "TypeSet", + "description": "The supported OS architecture(s) for a bare metal server with this profile", "computed": true, "elem": { "type": "TypeString" @@ -38008,6 +38633,18 @@ } } }, + { + "name": "name", + "type": "TypeString", + "description": "The name for this bare metal server profile", + "required": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The product family this bare metal server profile belongs to", + "computed": true + }, { "name": "cpu_architecture", "type": "TypeList", @@ -38029,9 +38666,9 @@ } }, { - "name": "supported_trusted_platform_module_modes", + "name": "memory", "type": "TypeList", - "description": "An array of supported trusted platform module (TPM) modes for this bare metal server profile", + "description": "The memory (in gibibytes) for a bare metal server with this profile", "computed": true, "elem": { "type": { @@ -38040,50 +38677,44 @@ "description": "The type for this profile field", "computed": true }, - "values": { - "name": "values", - "type": "TypeSet", - "description": "The supported trusted platform module (TPM) modes", - "computed": true, - "elem": { - "type": "TypeString" - } + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field", + "computed": true } } }, { - "name": "os_architecture", + "name": "href", + "type": "TypeString", + "description": "The URL for this bare metal server profile", + "computed": true + }, + { + "name": "bandwidth", "type": "TypeList", - "description": "The supported OS architecture(s) for a bare metal server with this profile", + "description": "The total bandwidth (in megabits per second) shared across the network interfaces of a bare metal server with this profile", "computed": true, "elem": { - "default": { - "name": "default", - "type": "TypeString", - "description": "The default for this profile field", - "computed": true - }, "type": { "name": "type", "type": "TypeString", "description": "The type for this profile field", "computed": true }, - "values": { - "name": "values", - "type": "TypeSet", - "description": "The supported OS architecture(s) for a bare metal server with this profile", - "computed": true, - "elem": { - "type": "TypeString" - } + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field", + "computed": true } } }, { - "name": "bandwidth", + "name": "cpu_core_count", "type": "TypeList", - "description": "The total bandwidth (in megabits per second) shared across the network interfaces of a bare metal server with this profile", + "description": "The CPU core count for a bare metal server with this profile", "computed": true, "elem": { "type": { @@ -38101,47 +38732,48 @@ } }, { - "name": "network_interface_count", + "name": "supported_trusted_platform_module_modes", "type": "TypeList", + "description": "An array of supported trusted platform module (TPM) modes for this bare metal server profile", "computed": true, "elem": { - "max": { - "name": "max", - "type": "TypeInt", - "description": "The maximum value for this profile field.", + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field", "computed": true }, - "min": { - "name": "min", - "type": "TypeInt", - "description": "The minimum value for this profile field.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true + "values": { + "name": "values", + "type": "TypeSet", + "description": "The supported trusted platform module (TPM) modes", + "computed": true, + "elem": { + "type": "TypeString" + } } } }, { - "name": "cpu_socket_count", + "name": "console_types", "type": "TypeList", - "description": "The number of CPU sockets for a bare metal server with this profile", + "description": "The console type configuration for a bare metal server with this profile.", "computed": true, "elem": { "type": { "name": "type", "type": "TypeString", - "description": "The type for this profile field", + "description": "The type for this profile field.", "computed": true }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "The value for this profile field", - "computed": true + "values": { + "name": "values", + "type": "TypeList", + "description": "The console types for a bare metal server with this profile.", + "computed": true, + "elem": { + "type": "TypeString" + } } } }, @@ -38221,18 +38853,6 @@ } } } - }, - { - "name": "name", - "type": "TypeString", - "description": "The name for this bare metal server profile", - "required": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this bare metal server profile", - "computed": true } ], "ibm_is_bare_metal_server_profiles": [ @@ -38553,12 +39173,6 @@ } ], "ibm_is_bare_metal_servers": [ - { - "name": "network_interfaces_subnet_name", - "type": "TypeString", - "description": "The name of the subnet of the bare metal server network interfaces", - "optional": true - }, { "name": "vpc_crn", "type": "TypeString", @@ -38572,15 +39186,15 @@ "optional": true }, { - "name": "network_interfaces_subnet_crn", + "name": "network_interfaces_subnet", "type": "TypeString", - "description": "The crn of the subnet of the bare metal server network interfaces", + "description": "The ID of the subnet of the bare metal server network interfaces", "optional": true }, { - "name": "network_interfaces_subnet", + "name": "network_interfaces_subnet_crn", "type": "TypeString", - "description": "The ID of the subnet of the bare metal server network interfaces", + "description": "The crn of the subnet of the bare metal server network interfaces", "optional": true }, { @@ -39027,6 +39641,12 @@ "type": "TypeString", "description": "The vpc name this bare metal server is in", "optional": true + }, + { + "name": "network_interfaces_subnet_name", + "type": "TypeString", + "description": "The name of the subnet of the bare metal server network interfaces", + "optional": true } ], "ibm_is_dedicated_host": [ @@ -39039,86 +39659,48 @@ "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this dedicated host.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the dedicated host resource.", - "computed": true - }, - { - "name": "memory", - "type": "TypeInt", - "description": "The total amount of memory in gibibytes for this host.", - "computed": true - }, - { - "name": "profile", + "name": "available_vcpu", "type": "TypeList", - "description": "The profile this dedicated host uses.", + "description": "The available VCPU for the dedicated host.", "computed": true, "elem": { - "href": { - "name": "href", + "architecture": { + "name": "architecture", "type": "TypeString", - "description": "The URL for this dedicated host.", + "description": "The VCPU architecture.", "computed": true }, - "name": { - "name": "name", + "count": { + "name": "count", + "type": "TypeInt", + "description": "The number of VCPUs assigned.", + "computed": true + }, + "manufacturer": { + "name": "manufacturer", "type": "TypeString", - "description": "The globally unique name for this dedicated host profile.", + "description": "The VCPU manufacturer.", "computed": true } } }, { - "name": "socket_count", - "type": "TypeInt", - "description": "The total number of sockets for this host.", + "name": "crn", + "type": "TypeString", + "description": "The CRN for this dedicated host.", + "cloud_data_type": "crn", "computed": true }, { - "name": "supported_instance_profiles", - "type": "TypeList", - "description": "Array of instance profiles that can be used by instances placed on this dedicated host.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this virtual server instance profile.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this virtual server instance profile.", - "computed": true - } - } - }, - { - "name": "host_group", + "name": "href", "type": "TypeString", - "description": "The unique identifier of the dedicated host group this dedicated host belongs to", - "required": true + "description": "The URL for this dedicated host.", + "computed": true }, { - "name": "available_memory", - "type": "TypeInt", - "description": "The amount of memory in gibibytes that is currently available for instances.", + "name": "instance_placement_enabled", + "type": "TypeBool", + "description": "If set to true, instances can be placed on this dedicated host.", "computed": true }, { @@ -39168,27 +39750,54 @@ } }, { - "name": "href", + "name": "provisionable", + "type": "TypeBool", + "description": "Indicates whether this dedicated host is available for instance creation.", + "computed": true + }, + { + "name": "host_group", "type": "TypeString", - "description": "The URL for this dedicated host.", + "description": "The unique identifier of the dedicated host group this dedicated host belongs to", + "required": true + }, + { + "name": "socket_count", + "type": "TypeInt", + "description": "The total number of sockets for this host.", "computed": true }, { - "name": "instance_placement_enabled", - "type": "TypeBool", - "description": "If set to true, instances can be placed on this dedicated host.", + "name": "zone", + "type": "TypeString", + "description": "The globally unique name of the zone this dedicated host resides in.", "computed": true }, { - "name": "provisionable", - "type": "TypeBool", - "description": "Indicates whether this dedicated host is available for instance creation.", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique name of this dedicated host", + "required": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the dedicated host was created.", "computed": true }, { - "name": "resource_type", + "name": "state", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", "computed": true }, { @@ -39218,47 +39827,29 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "The unique name of this dedicated host", - "required": true - }, - { - "name": "available_vcpu", + "name": "supported_instance_profiles", "type": "TypeList", - "description": "The available VCPU for the dedicated host.", + "description": "Array of instance profiles that can be used by instances placed on this dedicated host.", "computed": true, "elem": { - "architecture": { - "name": "architecture", + "href": { + "name": "href", "type": "TypeString", - "description": "The VCPU architecture.", - "computed": true - }, - "count": { - "name": "count", - "type": "TypeInt", - "description": "The number of VCPUs assigned.", + "description": "The URL for this virtual server instance profile.", "computed": true }, - "manufacturer": { - "name": "manufacturer", + "name": { + "name": "name", "type": "TypeString", - "description": "The VCPU manufacturer.", + "description": "The globally unique name for this virtual server instance profile.", "computed": true } } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the dedicated host was created.", - "computed": true - }, - { - "name": "zone", - "type": "TypeString", - "description": "The globally unique name of the zone this dedicated host resides in.", + "name": "available_memory", + "type": "TypeInt", + "description": "The amount of memory in gibibytes that is currently available for instances.", "computed": true }, { @@ -39385,16 +39976,88 @@ } }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the dedicated host resource.", + "computed": true + }, + { + "name": "memory", + "type": "TypeInt", + "description": "The total amount of memory in gibibytes for this host.", + "computed": true + }, + { + "name": "numa", + "type": "TypeList", + "description": "The dedicated host NUMA configuration", "computed": true, "elem": { - "type": "TypeString" + "count": { + "name": "count", + "type": "TypeInt", + "description": "The total number of NUMA nodes for this dedicated host", + "computed": true + }, + "nodes": { + "name": "nodes", + "type": "TypeList", + "description": "The NUMA nodes for this dedicated host.", + "computed": true, + "elem": { + "available_vcpu": { + "name": "available_vcpu", + "type": "TypeInt", + "description": "The available VCPU for this NUMA node.", + "computed": true + }, + "vcpu": { + "name": "vcpu", + "type": "TypeInt", + "description": "The total VCPU capacity for this NUMA node.", + "computed": true + } + } + } } + }, + { + "name": "profile", + "type": "TypeList", + "description": "The profile this dedicated host uses.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this dedicated host.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this dedicated host profile.", + "computed": true + } + } + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The type of resource referenced.", + "computed": true } ], "ibm_is_dedicated_host_disk": [ + { + "name": "supported_instance_interface_types", + "type": "TypeList", + "description": "The instance disk interfaces supported for this dedicated host disk.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "disk", "type": "TypeString", @@ -39402,15 +40065,9 @@ "required": true }, { - "name": "href", - "type": "TypeString", - "description": "The URL for this disk.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined or system-provided name for this disk.", + "name": "available", + "type": "TypeInt", + "description": "The remaining space left for instance placement in GB (gigabytes).", "computed": true }, { @@ -39460,15 +40117,15 @@ } }, { - "name": "interface_type", + "name": "lifecycle_state", "type": "TypeString", - "description": "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "description": "The lifecycle state of this dedicated host disk.", "computed": true }, { - "name": "lifecycle_state", + "name": "name", "type": "TypeString", - "description": "The lifecycle state of this dedicated host disk.", + "description": "The user-defined or system-provided name for this disk.", "computed": true }, { @@ -39483,18 +40140,18 @@ "description": "The type of resource referenced.", "computed": true }, + { + "name": "size", + "type": "TypeInt", + "description": "The size of the disk in GB (gigabytes).", + "computed": true + }, { "name": "dedicated_host", "type": "TypeString", "description": "The dedicated host identifier.", "required": true }, - { - "name": "available", - "type": "TypeInt", - "description": "The remaining space left for instance placement in GB (gigabytes).", - "computed": true - }, { "name": "created_at", "type": "TypeString", @@ -39502,19 +40159,16 @@ "computed": true }, { - "name": "size", - "type": "TypeInt", - "description": "The size of the disk in GB (gigabytes).", + "name": "href", + "type": "TypeString", + "description": "The URL for this disk.", "computed": true }, { - "name": "supported_instance_interface_types", - "type": "TypeList", - "description": "The instance disk interfaces supported for this dedicated host disk.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "interface_type", + "type": "TypeString", + "description": "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "computed": true } ], "ibm_is_dedicated_host_disks": [ @@ -39649,31 +40303,6 @@ } ], "ibm_is_dedicated_host_group": [ - { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "required": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the dedicated host group was created.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this dedicated host group.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "class", - "type": "TypeString", - "description": "The dedicated host profile class for hosts in this group.", - "computed": true - }, { "name": "dedicated_hosts", "type": "TypeList", @@ -39726,12 +40355,6 @@ } } }, - { - "name": "family", - "type": "TypeString", - "description": "The dedicated host profile family for hosts in this group.", - "computed": true - }, { "name": "href", "type": "TypeString", @@ -39751,6 +40374,37 @@ "description": "The type of resource referenced.", "computed": true }, + { + "name": "zone", + "type": "TypeString", + "description": "The globally unique name of the zone this dedicated host group resides in.", + "computed": true + }, + { + "name": "class", + "type": "TypeString", + "description": "The dedicated host profile class for hosts in this group.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the dedicated host group was created.", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this dedicated host group.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The dedicated host profile family for hosts in this group.", + "computed": true + }, { "name": "supported_instance_profiles", "type": "TypeList", @@ -39772,19 +40426,13 @@ } }, { - "name": "zone", + "name": "name", "type": "TypeString", - "description": "The globally unique name of the zone this dedicated host group resides in.", - "computed": true + "description": "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "required": true } ], "ibm_is_dedicated_host_groups": [ - { - "name": "name", - "type": "TypeString", - "description": "The name of the dedicated host group", - "optional": true - }, { "name": "host_groups", "type": "TypeList", @@ -39943,11 +40591,35 @@ "type": "TypeString", "description": "The zone name this dedicated host group is in", "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the dedicated host group", + "optional": true } ], "ibm_is_dedicated_host_profile": [ { - "name": "vcpu_count", + "name": "class", + "type": "TypeString", + "description": "The product class this dedicated host profile belongs to.", + "computed": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The product family this dedicated host profile belongs toThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this dedicated host.", + "computed": true + }, + { + "name": "memory", "type": "TypeList", "computed": true, "elem": { @@ -39999,13 +40671,7 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this virtual server instance profile.", - "optional": true - }, - { - "name": "memory", + "name": "socket_count", "type": "TypeList", "computed": true, "elem": { @@ -40057,7 +40723,7 @@ } }, { - "name": "socket_count", + "name": "vcpu_count", "type": "TypeList", "computed": true, "elem": { @@ -40109,74 +40775,10 @@ } }, { - "name": "href", - "type": "TypeString", - "description": "The URL for this dedicated host.", - "computed": true - }, - { - "name": "supported_instance_profiles", - "type": "TypeList", - "description": "Array of instance profiles that can be used by instances placed on dedicated hosts with this profile.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this virtual server instance profile.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this virtual server instance profile.", - "computed": true - } - } - }, - { - "name": "vcpu_architecture", - "type": "TypeList", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The VCPU architecture for a dedicated host with this profile.", - "computed": true - } - } - }, - { - "name": "vcpu_manufacturer", - "type": "TypeList", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The VCPU manufacturer for a dedicated host with this profile.", - "computed": true - } - } - }, - { - "name": "class", + "name": "name", "type": "TypeString", - "description": "The product class this dedicated host profile belongs to.", - "computed": true + "description": "The globally unique name for this virtual server instance profile.", + "optional": true }, { "name": "disks", @@ -40268,10 +40870,68 @@ } }, { - "name": "family", + "name": "supported_instance_profiles", + "type": "TypeList", + "description": "Array of instance profiles that can be used by instances placed on dedicated hosts with this profile.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this virtual server instance profile.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this virtual server instance profile.", + "computed": true + } + } + }, + { + "name": "status", "type": "TypeString", - "description": "The product family this dedicated host profile belongs toThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "description": "The status of the dedicated host profile.", "computed": true + }, + { + "name": "vcpu_architecture", + "type": "TypeList", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The VCPU architecture for a dedicated host with this profile.", + "computed": true + } + } + }, + { + "name": "vcpu_manufacturer", + "type": "TypeList", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The VCPU manufacturer for a dedicated host with this profile.", + "computed": true + } + } } ], "ibm_is_dedicated_host_profiles": [ @@ -40498,6 +41158,12 @@ } } }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the dedicated host profile.", + "computed": true + }, "supported_instance_profiles": { "name": "supported_instance_profiles", "type": "TypeList", @@ -40618,6 +41284,12 @@ } ], "ibm_is_dedicated_hosts": [ + { + "name": "total_count", + "type": "TypeInt", + "description": "The total number of resources across all pages.", + "computed": true + }, { "name": "host_group", "type": "TypeString", @@ -40913,6 +41585,40 @@ "description": "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", "computed": true }, + "numa": { + "name": "numa", + "type": "TypeList", + "description": "The dedicated host NUMA configuration", + "computed": true, + "elem": { + "count": { + "name": "count", + "type": "TypeInt", + "description": "The total number of NUMA nodes for this dedicated host", + "computed": true + }, + "nodes": { + "name": "nodes", + "type": "TypeList", + "description": "The NUMA nodes for this dedicated host.", + "computed": true, + "elem": { + "available_vcpu": { + "name": "available_vcpu", + "type": "TypeInt", + "description": "The available VCPU for this NUMA node.", + "computed": true + }, + "vcpu": { + "name": "vcpu", + "type": "TypeInt", + "description": "The total VCPU capacity for this NUMA node.", + "computed": true + } + } + } + } + }, "profile": { "name": "profile", "type": "TypeList", @@ -41016,12 +41722,6 @@ "computed": true } } - }, - { - "name": "total_count", - "type": "TypeInt", - "description": "The total number of resources across all pages.", - "computed": true } ], "ibm_is_endpoint_gateway_targets": [ @@ -41080,6 +41780,56 @@ } ], "ibm_is_floating_ip": [ + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the floating IP", + "required": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Floating IP crn", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Floating IP tags", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "address", + "type": "TypeString", + "description": "Floating IP address", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Floating IP status", + "computed": true + }, { "name": "target", "type": "TypeString", @@ -41175,56 +41925,6 @@ "computed": true } } - }, - { - "name": "crn", - "type": "TypeString", - "description": "Floating IP crn", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Floating IP tags", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "zone", - "type": "TypeString", - "description": "Zone name", - "computed": true - }, - { - "name": "address", - "type": "TypeString", - "description": "Floating IP address", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Floating IP status", - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the floating IP", - "required": true } ], "ibm_is_floating_ips": [ @@ -41445,16 +42145,15 @@ ], "ibm_is_flow_log": [ { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the flow log collector was created.", + "name": "auto_delete", + "type": "TypeBool", + "description": "If set to `true`, this flow log collector will be automatically deleted when the target is deleted.", "computed": true }, { - "name": "crn", + "name": "lifecycle_state", "type": "TypeString", - "description": "The CRN for this flow log collector.", - "cloud_data_type": "crn", + "description": "The lifecycle state of the flow log collector.", "computed": true }, { @@ -41484,35 +42183,6 @@ } } }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the flow log collector.", - "computed": true - }, - { - "name": "storage_bucket", - "type": "TypeList", - "description": "The Cloud Object Storage bucket where the collected flows are logged.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name of this COS bucket.", - "computed": true - } - } - }, { "name": "target", "type": "TypeList", @@ -41566,15 +42236,18 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this flow log collector.", - "optional": true + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "identifier", + "name": "name", "type": "TypeString", - "description": "The flow log collector identifier.", + "description": "The unique user-defined name for this flow log collector.", "optional": true }, { @@ -41584,9 +42257,10 @@ "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "If set to `true`, this flow log collector will be automatically deleted when the target is deleted.", + "name": "crn", + "type": "TypeString", + "description": "The CRN for this flow log collector.", + "cloud_data_type": "crn", "computed": true }, { @@ -41595,6 +42269,20 @@ "description": "The URL for this flow log collector.", "computed": true }, + { + "name": "storage_bucket", + "type": "TypeList", + "description": "The Cloud Object Storage bucket where the collected flows are logged.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name of this COS bucket.", + "computed": true + } + } + }, { "name": "vpc", "type": "TypeList", @@ -41640,16 +42328,21 @@ "computed": true } } - } - ], - "ibm_is_flow_logs": [ + }, { - "name": "resource_group", + "name": "identifier", "type": "TypeString", - "description": "The unique identifier of the resource group this flow log belongs to", - "cloud_data_type": "resource_group", + "description": "The flow log collector identifier.", "optional": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the flow log collector was created.", + "computed": true + } + ], + "ibm_is_flow_logs": [ { "name": "vpc", "type": "TypeString", @@ -41777,6 +42470,13 @@ "computed": true } } + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier of the resource group this flow log belongs to", + "cloud_data_type": "resource_group", + "optional": true } ], "ibm_is_ike_policies": [ @@ -41928,51 +42628,6 @@ } ], "ibm_is_ike_policy": [ - { - "name": "encryption_algorithm", - "type": "TypeString", - "description": "The encryption algorithm.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The IKE policy's canonical URL.", - "computed": true - }, - { - "name": "ike_version", - "type": "TypeInt", - "description": "The IKE protocol version.", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeList", - "description": "The resource group for this IKE policy.", - "cloud_data_type": "resource_group", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this resource group.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this resource group.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this resource group.", - "computed": true - } - } - }, { "name": "name", "type": "TypeString", @@ -41985,24 +42640,6 @@ "description": "The IKE policy identifier.", "optional": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this IKE policy was created.", - "computed": true - }, - { - "name": "dh_group", - "type": "TypeInt", - "description": "The Diffie-Hellman group.", - "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - }, { "name": "authentication_algorithm", "type": "TypeString", @@ -42055,17 +42692,80 @@ } } }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this IKE policy was created.", + "computed": true + }, + { + "name": "encryption_algorithm", + "type": "TypeString", + "description": "The encryption algorithm.", + "computed": true + }, { "name": "key_lifetime", "type": "TypeInt", "description": "The key lifetime in seconds.", "computed": true }, + { + "name": "resource_group", + "type": "TypeList", + "description": "The resource group for this IKE policy.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this resource group.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this resource group.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this resource group.", + "computed": true + } + } + }, + { + "name": "dh_group", + "type": "TypeInt", + "description": "The Diffie-Hellman group.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The IKE policy's canonical URL.", + "computed": true + }, + { + "name": "ike_version", + "type": "TypeInt", + "description": "The IKE protocol version.", + "computed": true + }, { "name": "negotiation_mode", "type": "TypeString", "description": "The IKE negotiation mode. Only `main` is supported.", "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true } ], "ibm_is_image": [ @@ -42075,6 +42775,12 @@ "description": "Image id", "optional": true }, + { + "name": "os", + "type": "TypeString", + "description": "Image Operating system", + "computed": true + }, { "name": "encryption", "type": "TypeString", @@ -42082,16 +42788,16 @@ "computed": true }, { - "name": "name", + "name": "created_at", "type": "TypeString", - "description": "Image name", - "optional": true + "description": "The date and time that the image was created", + "computed": true }, { - "name": "visibility", + "name": "obsolescence_at", "type": "TypeString", - "description": "Whether the image is publicly visible or private to the account", - "optional": true + "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "computed": true }, { "name": "checksum", @@ -42106,32 +42812,11 @@ "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "The status of this image", - "computed": true - }, - { - "name": "os", - "type": "TypeString", - "description": "Image Operating system", - "computed": true - }, - { - "name": "created_at", + "name": "architecture", "type": "TypeString", - "description": "The date and time that the image was created", + "description": "The operating system architecture", "computed": true }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "catalog_offering", "type": "TypeList", @@ -42160,16 +42845,15 @@ } }, { - "name": "architecture", + "name": "visibility", "type": "TypeString", - "description": "The operating system architecture", - "computed": true + "description": "Whether the image is publicly visible or private to the account", + "optional": true }, { - "name": "crn", + "name": "status", "type": "TypeString", - "description": "The CRN for this image", - "cloud_data_type": "crn", + "description": "The status of this image", "computed": true }, { @@ -42185,9 +42869,25 @@ "computed": true }, { - "name": "obsolescence_at", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", "type": "TypeString", - "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "description": "Image name", + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this image", + "cloud_data_type": "crn", "computed": true } ], @@ -42199,53 +42899,53 @@ "computed": true }, { - "name": "encrypted_data_key", + "name": "started_at", "type": "TypeString", - "description": "A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto Service.If absent, the export job is for an unencrypted image.", + "description": "The date and time that the image export job started running.If absent, the export job has not yet started.", "computed": true }, { - "name": "started_at", + "name": "completed_at", "type": "TypeString", - "description": "The date and time that the image export job started running.If absent, the export job has not yet started.", + "description": "The date and time that the image export job was completed.If absent, the export job has not yet completed.", "computed": true }, { - "name": "status", + "name": "storage_href", "type": "TypeString", - "description": "The status of this image export job:- `deleting`: Export job is being deleted- `failed`: Export job could not be completed successfully- `queued`: Export job is queued- `running`: Export job is in progress- `succeeded`: Export job was completed successfullyThe exported image object is automatically deleted for `failed` jobs.", + "description": "The Cloud Object Storage location of the exported image object. The object at this location may not exist until the job is started, and will be incomplete while the job is running.After the job completes, the exported image object is not managed by the IBM VPC service, and may be removed or replaced with a different object by any user or service with IAM authorization to the bucket.", "computed": true }, { - "name": "status_reasons", + "name": "storage_object", "type": "TypeList", - "description": "The reasons for the current status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "description": "The Cloud Object Storage object for the exported image. This object may not exist untilthe job is started, and will not be complete until the job completes.", "computed": true, "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason.", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the status reason.", - "computed": true - }, - "more_info": { - "name": "more_info", + "name": { + "name": "name", "type": "TypeString", - "description": "Link to documentation about this status reason.", + "description": "The name of this Cloud Object Storage object. Names are unique within a Cloud Object Storage bucket.", "computed": true } } }, { - "name": "completed_at", + "name": "image", "type": "TypeString", - "description": "The date and time that the image export job was completed.If absent, the export job has not yet completed.", + "description": "The image identifier.", + "required": true + }, + { + "name": "image_export_job", + "type": "TypeString", + "description": "The image export job identifier.", + "required": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the image export job was created.", "computed": true }, { @@ -42255,74 +42955,74 @@ "computed": true }, { - "name": "name", + "name": "resource_type", "type": "TypeString", - "description": "The user-defined name for this image export job.", + "description": "The type of resource referenced.", "computed": true }, { - "name": "storage_bucket", + "name": "status_reasons", "type": "TypeList", - "description": "The Cloud Object Storage bucket of the exported image object.", + "description": "The reasons for the current status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", "computed": true, "elem": { - "crn": { - "name": "crn", + "code": { + "name": "code", "type": "TypeString", - "description": "The CRN of this Cloud Object Storage bucket.", + "description": "A snake case string succinctly identifying the status reason.", "computed": true }, - "name": { - "name": "name", + "message": { + "name": "message", "type": "TypeString", - "description": "The globally unique name of this Cloud Object Storage bucket.", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", "computed": true } } }, { - "name": "created_at", + "name": "encrypted_data_key", "type": "TypeString", - "description": "The date and time that the image export job was created.", + "description": "A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto Service.If absent, the export job is for an unencrypted image.", "computed": true }, { - "name": "image_export_job", - "type": "TypeString", - "description": "The image export job identifier.", - "required": true - }, - { - "name": "resource_type", + "name": "name", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The user-defined name for this image export job.", "computed": true }, { - "name": "storage_href", + "name": "status", "type": "TypeString", - "description": "The Cloud Object Storage location of the exported image object. The object at this location may not exist until the job is started, and will be incomplete while the job is running.After the job completes, the exported image object is not managed by the IBM VPC service, and may be removed or replaced with a different object by any user or service with IAM authorization to the bucket.", + "description": "The status of this image export job:- `deleting`: Export job is being deleted- `failed`: Export job could not be completed successfully- `queued`: Export job is queued- `running`: Export job is in progress- `succeeded`: Export job was completed successfullyThe exported image object is automatically deleted for `failed` jobs.", "computed": true }, { - "name": "storage_object", + "name": "storage_bucket", "type": "TypeList", - "description": "The Cloud Object Storage object for the exported image. This object may not exist untilthe job is started, and will not be complete until the job completes.", + "description": "The Cloud Object Storage bucket of the exported image object.", "computed": true, "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN of this Cloud Object Storage bucket.", + "computed": true + }, "name": { "name": "name", "type": "TypeString", - "description": "The name of this Cloud Object Storage object. Names are unique within a Cloud Object Storage bucket.", + "description": "The globally unique name of this Cloud Object Storage bucket.", "computed": true } } - }, - { - "name": "image", - "type": "TypeString", - "description": "The image identifier.", - "required": true } ], "ibm_is_image_export_jobs": [ @@ -42468,38 +43168,6 @@ } ], "ibm_is_images": [ - { - "name": "resource_group", - "type": "TypeString", - "description": "The id of the resource group", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "catalog_managed", - "type": "TypeBool", - "description": "Lists images managed as part of a catalog offering. If an image is managed, accounts in the same enterprise with access to that catalog can specify the image's catalog offering version CRN to provision virtual server instances using the image", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the image", - "optional": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the image", - "options": "available, deleting, deprecated, failed, obsolete, pending, tentative, unusable", - "optional": true - }, - { - "name": "visibility", - "type": "TypeString", - "description": "Whether the image is publicly visible or private to the account", - "optional": true - }, { "name": "images", "type": "TypeList", @@ -42623,37 +43291,100 @@ "computed": true } } + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The id of the resource group", + "cloud_data_type": "resource_group", + "optional": true + }, + { + "name": "catalog_managed", + "type": "TypeBool", + "description": "Lists images managed as part of a catalog offering. If an image is managed, accounts in the same enterprise with access to that catalog can specify the image's catalog offering version CRN to provision virtual server instances using the image", + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the image", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the image", + "options": "available, deleting, deprecated, failed, obsolete, pending, tentative, unusable", + "optional": true + }, + { + "name": "visibility", + "type": "TypeString", + "description": "Whether the image is publicly visible or private to the account", + "optional": true } ], "ibm_is_instance": [ { - "name": "resource_group_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "vcpu", + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "password", + "type": "TypeString", + "description": "password for Windows Instance", + "secure": true, + "computed": true + }, + { + "name": "volume_attachments", "type": "TypeList", - "description": "Instance vCPU", + "description": "Instance Volume Attachments", "computed": true, "elem": { - "architecture": { - "name": "architecture", + "id": { + "name": "id", "type": "TypeString", - "description": "Instance vCPU Architecture", + "description": "Instance Volume Attachment id", "computed": true }, - "count": { - "name": "count", - "type": "TypeInt", - "description": "Instance vCPU count", + "name": { + "name": "name", + "type": "TypeString", + "description": "Instance Volume Attachment name", "computed": true }, - "manufacturer": { - "name": "manufacturer", + "volume_crn": { + "name": "volume_crn", "type": "TypeString", - "description": "Instance vCPU Manufacturer", + "description": "Instance Boot Volume's volume CRN", + "computed": true + }, + "volume_id": { + "name": "volume_id", + "type": "TypeString", + "description": "Instance Boot Volume's volume id", + "computed": true + }, + "volume_name": { + "name": "volume_name", + "type": "TypeString", + "description": "Instance Boot Volume's volume name", "computed": true } } @@ -42690,6 +43421,28 @@ } } }, + { + "name": "memory", + "type": "TypeInt", + "description": "Instance memory", + "computed": true + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "list of access tags for the instance", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Instance resource group", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -42698,131 +43451,112 @@ "computed": true }, { - "name": "resource_status", + "name": "resource_group_name", "type": "TypeString", - "description": "The status of the resource", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "list of tags for the instance", - "cloud_data_type": "tags", + "name": "metadata_service", + "type": "TypeList", + "description": "The metadata service configuration", "computed": true, "elem": { - "type": "TypeString" + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", + "computed": true + }, + "protocol": { + "name": "protocol", + "type": "TypeString", + "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", + "computed": true + }, + "response_hop_limit": { + "name": "response_hop_limit", + "type": "TypeInt", + "description": "The hop limit (IP time to live) for IP response packets from the metadata service", + "computed": true + } } }, { - "name": "private_key", - "type": "TypeString", - "description": "Instance Private Key file", - "optional": true - }, - { - "name": "password", + "name": "passphrase", "type": "TypeString", - "description": "password for Windows Instance", + "description": "Passphrase for Instance Private Key file", "secure": true, - "computed": true + "optional": true }, { - "name": "vpc", - "type": "TypeString", - "description": "VPC id", + "name": "total_network_bandwidth", + "type": "TypeInt", + "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces.", "computed": true }, { - "name": "zone", + "name": "lifecycle_state", "type": "TypeString", - "description": "Zone name", + "description": "The lifecycle state of the virtual server instance.", "computed": true }, { - "name": "primary_network_interface", + "name": "disks", "type": "TypeList", - "description": "Primary Network interface info", + "description": "Collection of the instance's disks.", "computed": true, "elem": { - "id": { - "name": "id", + "created_at": { + "name": "created_at", "type": "TypeString", - "description": "Instance Primary Network Interface id", + "description": "The date and time that the disk was created.", "computed": true }, - "name": { - "name": "name", + "href": { + "name": "href", "type": "TypeString", - "description": "Instance Primary Network Interface name", + "description": "The URL for this instance disk.", "computed": true }, - "port_speed": { - "name": "port_speed", - "type": "TypeInt", - "description": "Instance Primary Network Interface port speed", + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this instance disk.", "computed": true }, - "primary_ip": { - "name": "primary_ip", - "type": "TypeList", - "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address to reserve, which must not already be reserved on the subnet.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this reserved IP", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", - "computed": true - }, - "reserved_ip": { - "name": "reserved_ip", - "type": "TypeString", - "description": "Identifies a reserved IP by a unique property.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - } - } - }, - "primary_ipv4_address": { - "name": "primary_ipv4_address", + "interface_type": { + "name": "interface_type", "type": "TypeString", - "description": "Instance Primary Network Interface IPV4 Address", + "description": "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", "computed": true }, - "security_groups": { - "name": "security_groups", - "type": "TypeSet", - "description": "Instance Primary Network Interface Security groups", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this disk.", + "computed": true }, - "subnet": { - "name": "subnet", + "resource_type": { + "name": "resource_type", "type": "TypeString", - "description": "Instance Primary Network Interface subnet", + "description": "The resource type.", + "computed": true + }, + "size": { + "name": "size", + "type": "TypeInt", + "description": "The size of the disk in GB (gigabytes).", "computed": true } } }, + { + "name": "name", + "type": "TypeString", + "description": "Instance name", + "required": true + }, { "name": "network_interfaces", "type": "TypeList", @@ -42903,51 +43637,61 @@ } }, { - "name": "memory", - "type": "TypeInt", - "description": "Instance memory", - "computed": true - }, - { - "name": "resource_name", + "name": "image", "type": "TypeString", - "description": "The name of the resource", + "description": "Instance Image", "computed": true }, { - "name": "passphrase", - "type": "TypeString", - "description": "Passphrase for Instance Private Key file", - "secure": true, - "optional": true - }, - { - "name": "bandwidth", + "name": "numa_count", "type": "TypeInt", - "description": "The total bandwidth (in megabits per second) shared across the instance's network interfaces and storage volumes", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the virtual server instance.", + "description": "The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`.", "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "list of access tags for the instance", + "name": "vcpu", + "type": "TypeList", + "description": "Instance vCPU", "computed": true, "elem": { - "type": "TypeString" + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "Instance vCPU Architecture", + "computed": true + }, + "count": { + "name": "count", + "type": "TypeInt", + "description": "Instance vCPU count", + "computed": true + }, + "manufacturer": { + "name": "manufacturer", + "type": "TypeString", + "description": "Instance vCPU Manufacturer", + "computed": true + } } }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, { "name": "availability_policy_host_failure", "type": "TypeString", "description": "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", "computed": true }, + { + "name": "total_volume_bandwidth", + "type": "TypeInt", + "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", + "computed": true + }, { "name": "boot_volume", "type": "TypeList", @@ -42993,131 +43737,56 @@ } }, { - "name": "status", - "type": "TypeString", - "description": "instance status", - "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "placement_target", - "type": "TypeList", - "description": "The placement restrictions for the virtual server instance.", + "name": "volumes", + "type": "TypeSet", + "description": "List of volumes", "computed": true, "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this dedicated host group.", - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this dedicated host group.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this dedicated host group.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The type of resource referenced.", - "computed": true - } + "type": "TypeString" } }, { - "name": "image", + "name": "vpc", "type": "TypeString", - "description": "Instance Image", + "description": "VPC id", "computed": true }, { - "name": "metadata_service_enabled", - "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", - "computed": true + "name": "tags", + "type": "TypeSet", + "description": "list of tags for the instance", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "metadata_service", + "name": "status_reasons", "type": "TypeList", - "description": "The metadata service configuration", + "description": "The reasons for the current status (if any).", "computed": true, "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason", "computed": true }, - "protocol": { - "name": "protocol", + "message": { + "name": "message", "type": "TypeString", - "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", + "description": "An explanation of the status reason", "computed": true }, - "response_hop_limit": { - "name": "response_hop_limit", - "type": "TypeInt", - "description": "The hop limit (IP time to live) for IP response packets from the metadata service", + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason", "computed": true } } }, - { - "name": "profile", - "type": "TypeString", - "description": "Profile info", - "computed": true - }, - { - "name": "total_network_bandwidth", - "type": "TypeInt", - "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Instance name", - "required": true - }, - { - "name": "total_volume_bandwidth", - "type": "TypeInt", - "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", - "computed": true - }, { "name": "lifecycle_reasons", "type": "TypeList", @@ -43145,195 +43814,220 @@ } }, { - "name": "disks", + "name": "placement_target", "type": "TypeList", - "description": "Collection of the instance's disks.", + "description": "The placement restrictions for the virtual server instance.", "computed": true, "elem": { - "created_at": { - "name": "created_at", + "crn": { + "name": "crn", "type": "TypeString", - "description": "The date and time that the disk was created.", + "description": "The CRN for this dedicated host group.", "computed": true }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, "href": { "name": "href", "type": "TypeString", - "description": "The URL for this instance disk.", + "description": "The URL for this dedicated host group.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this instance disk.", - "computed": true - }, - "interface_type": { - "name": "interface_type", - "type": "TypeString", - "description": "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "description": "The unique identifier for this dedicated host group.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this disk.", + "description": "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", "computed": true }, "resource_type": { "name": "resource_type", "type": "TypeString", - "description": "The resource type.", - "computed": true - }, - "size": { - "name": "size", - "type": "TypeInt", - "description": "The size of the disk in GB (gigabytes).", + "description": "The type of resource referenced.", "computed": true } } }, { - "name": "resource_group", + "name": "zone", "type": "TypeString", - "description": "Instance resource group", - "cloud_data_type": "resource_group", + "description": "Zone name", "computed": true }, { - "name": "status_reasons", + "name": "catalog_offering", "type": "TypeList", - "description": "The reasons for the current status (if any).", + "description": "The catalog offering or offering version to use when provisioning this virtual server instance. If an offering is specified, the latest version of that offering will be used. The specified offering or offering version may be in a different account in the same enterprise, subject to IAM policies.", "computed": true, "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason", - "computed": true - }, - "message": { - "name": "message", + "offering_crn": { + "name": "offering_crn", "type": "TypeString", - "description": "An explanation of the status reason", + "description": "Identifies a catalog offering by a unique CRN property", "computed": true }, - "more_info": { - "name": "more_info", + "version_crn": { + "name": "version_crn", "type": "TypeString", - "description": "Link to documentation about this status reason", + "description": "Identifies a version of a catalog offering by a unique CRN property", "computed": true } } }, { - "name": "resource_controller_url", + "name": "status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "instance status", "computed": true }, { - "name": "keys", + "name": "bandwidth", + "type": "TypeInt", + "description": "The total bandwidth (in megabits per second) shared across the instance's network interfaces and storage volumes", + "computed": true + }, + { + "name": "primary_network_interface", "type": "TypeList", - "description": "Instance keys", + "description": "Primary Network interface info", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "Instance key id", + "description": "Instance Primary Network Interface id", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Instance key name", + "description": "Instance Primary Network Interface name", "computed": true - } - } - }, - { - "name": "catalog_offering", - "type": "TypeList", - "description": "The catalog offering or offering version to use when provisioning this virtual server instance. If an offering is specified, the latest version of that offering will be used. The specified offering or offering version may be in a different account in the same enterprise, subject to IAM policies.", - "computed": true, - "elem": { - "offering_crn": { - "name": "offering_crn", + }, + "port_speed": { + "name": "port_speed", + "type": "TypeInt", + "description": "Instance Primary Network Interface port speed", + "computed": true + }, + "primary_ip": { + "name": "primary_ip", + "type": "TypeList", + "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address to reserve, which must not already be reserved on the subnet.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this reserved IP", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", + "computed": true + }, + "reserved_ip": { + "name": "reserved_ip", + "type": "TypeString", + "description": "Identifies a reserved IP by a unique property.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", + "computed": true + } + } + }, + "primary_ipv4_address": { + "name": "primary_ipv4_address", "type": "TypeString", - "description": "Identifies a catalog offering by a unique CRN property", + "description": "Instance Primary Network Interface IPV4 Address", "computed": true }, - "version_crn": { - "name": "version_crn", + "security_groups": { + "name": "security_groups", + "type": "TypeSet", + "description": "Instance Primary Network Interface Security groups", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "subnet": { + "name": "subnet", "type": "TypeString", - "description": "Identifies a version of a catalog offering by a unique CRN property", + "description": "Instance Primary Network Interface subnet", "computed": true } } }, { - "name": "volume_attachments", + "name": "metadata_service_enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", + "computed": true + }, + { + "name": "private_key", + "type": "TypeString", + "description": "Instance Private Key file", + "optional": true + }, + { + "name": "keys", "type": "TypeList", - "description": "Instance Volume Attachments", + "description": "Instance keys", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "Instance Volume Attachment id", + "description": "Instance key id", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Instance Volume Attachment name", - "computed": true - }, - "volume_crn": { - "name": "volume_crn", - "type": "TypeString", - "description": "Instance Boot Volume's volume CRN", - "computed": true - }, - "volume_id": { - "name": "volume_id", - "type": "TypeString", - "description": "Instance Boot Volume's volume id", - "computed": true - }, - "volume_name": { - "name": "volume_name", - "type": "TypeString", - "description": "Instance Boot Volume's volume name", + "description": "Instance key name", "computed": true } } }, { - "name": "volumes", - "type": "TypeSet", - "description": "List of volumes", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "profile", + "type": "TypeString", + "description": "Profile info", + "computed": true } ], "ibm_is_instance_disk": [ - { - "name": "size", - "type": "TypeInt", - "description": "The size of the disk in GB (gigabytes).", - "computed": true - }, - { - "name": "instance", - "type": "TypeString", - "description": "The instance identifier.", - "required": true - }, { "name": "disk", "type": "TypeString", @@ -43369,6 +44063,18 @@ "type": "TypeString", "description": "The resource type.", "computed": true + }, + { + "name": "size", + "type": "TypeInt", + "description": "The size of the disk in GB (gigabytes).", + "computed": true + }, + { + "name": "instance", + "type": "TypeString", + "description": "The instance identifier.", + "required": true } ], "ibm_is_instance_disks": [ @@ -43430,15 +44136,6 @@ } ], "ibm_is_instance_group": [ - { - "name": "subnets", - "type": "TypeList", - "description": "list of subnet IDs", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "application_port", "type": "TypeInt", @@ -43446,17 +44143,10 @@ "computed": true }, { - "name": "load_balancer_pool", - "type": "TypeString", - "description": "load balancer pool ID", - "computed": true - }, - { - "name": "resource_group", + "name": "name", "type": "TypeString", - "description": "Resource group ID", - "cloud_data_type": "resource_group", - "computed": true + "description": "The user-defined name for this instance group", + "required": true }, { "name": "crn", @@ -43466,9 +44156,18 @@ "computed": true }, { - "name": "membership_count", - "type": "TypeInt", - "description": "The number of instances in the instance group", + "name": "subnets", + "type": "TypeList", + "description": "list of subnet IDs", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "load_balancer_pool", + "type": "TypeString", + "description": "load balancer pool ID", "computed": true }, { @@ -43501,44 +44200,33 @@ "type": "TypeString" } }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this instance group", - "required": true - }, { "name": "instance_template", "type": "TypeString", "description": "instance template ID", "computed": true - } - ], - "ibm_is_instance_group_manager": [ + }, { - "name": "name", - "type": "TypeString", - "description": "Name of the instance group manager.", - "required": true + "name": "membership_count", + "type": "TypeInt", + "description": "The number of instances in the instance group", + "computed": true }, { - "name": "manager_type", + "name": "resource_group", "type": "TypeString", - "description": "The type of instance group manager.", + "description": "Resource group ID", + "cloud_data_type": "resource_group", "computed": true - }, + } + ], + "ibm_is_instance_group_manager": [ { "name": "min_membership_count", "type": "TypeInt", "description": "The minimum number of members in a managed instance group", "computed": true }, - { - "name": "manager_id", - "type": "TypeString", - "description": "The ID of instance group manager.", - "computed": true - }, { "name": "policies", "type": "TypeList", @@ -43577,15 +44265,15 @@ "required": true }, { - "name": "aggregation_window", - "type": "TypeInt", - "description": "The time window in seconds to aggregate metrics prior to evaluation", - "computed": true + "name": "name", + "type": "TypeString", + "description": "Name of the instance group manager.", + "required": true }, { - "name": "cooldown", + "name": "aggregation_window", "type": "TypeInt", - "description": "The duration of time in seconds to pause further scale actions after scaling has taken place", + "description": "The time window in seconds to aggregate metrics prior to evaluation", "computed": true }, { @@ -43593,20 +44281,27 @@ "type": "TypeInt", "description": "The maximum number of members in a managed instance group", "computed": true - } - ], - "ibm_is_instance_group_manager_action": [ + }, { - "name": "last_applied_at", + "name": "manager_type", "type": "TypeString", - "description": "The date and time the scheduled action was last applied. If empty the action has never been applied.", + "description": "The type of instance group manager.", "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", + "name": "cooldown", + "type": "TypeInt", + "description": "The duration of time in seconds to pause further scale actions after scaling has taken place", "computed": true }, + { + "name": "manager_id", + "type": "TypeString", + "description": "The ID of instance group manager.", + "computed": true + } + ], + "ibm_is_instance_group_manager_action": [ { "name": "instance_group_manager", "type": "TypeString", @@ -43614,15 +44309,9 @@ "required": true }, { - "name": "run_at", - "type": "TypeString", - "description": "The date and time the scheduled action will run.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The date and time that the instance group manager action was modified.", + "name": "max_membership_count", + "type": "TypeInt", + "description": "The maximum number of members in a managed instance group", "computed": true }, { @@ -43632,27 +44321,37 @@ "computed": true }, { - "name": "target_manager_name", + "name": "resource_type", "type": "TypeString", - "description": "Instance group manager name of type autoscale.", + "description": "The resource type.", "computed": true }, { - "name": "status", + "name": "next_run_at", "type": "TypeString", - "description": "The status of the instance group action- `active`: Action is ready to be run- `completed`: Action was completed successfully- `failed`: Action could not be completed successfully- `incompatible`: Action parameters are not compatible with the group or manager- `omitted`: Action was not applied because this action's manager was disabled.", + "description": "The date and time the scheduled action will next run. If empty the system is currently calculating the next run time.", "computed": true }, { - "name": "action_type", + "name": "auto_delete_timeout", + "type": "TypeInt", + "computed": true + }, + { + "name": "action_id", "type": "TypeString", - "description": "The type of action for the instance group.", + "description": "Instance group manager action ID", "computed": true }, { - "name": "created_at", + "name": "instance_group", "type": "TypeString", - "description": "The date and time that the instance group manager action was modified.", + "description": "instance group ID", + "required": true + }, + { + "name": "auto_delete", + "type": "TypeBool", "computed": true }, { @@ -43662,45 +44361,52 @@ "required": true }, { - "name": "action_id", + "name": "action_type", "type": "TypeString", - "description": "Instance group manager action ID", + "description": "The type of action for the instance group.", "computed": true }, { - "name": "max_membership_count", - "type": "TypeInt", - "description": "The maximum number of members in a managed instance group", + "name": "target_manager_name", + "type": "TypeString", + "description": "Instance group manager name of type autoscale.", "computed": true }, { - "name": "cron_spec", + "name": "last_applied_at", "type": "TypeString", - "description": "The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period.", + "description": "The date and time the scheduled action was last applied. If empty the action has never been applied.", "computed": true }, { - "name": "resource_type", + "name": "created_at", "type": "TypeString", - "description": "The resource type.", + "description": "The date and time that the instance group manager action was modified.", "computed": true }, { - "name": "next_run_at", + "name": "run_at", "type": "TypeString", - "description": "The date and time the scheduled action will next run. If empty the system is currently calculating the next run time.", + "description": "The date and time the scheduled action will run.", "computed": true }, { - "name": "auto_delete_timeout", - "type": "TypeInt", + "name": "target_manager", + "type": "TypeString", + "description": "The unique identifier for this instance group manager of type autoscale.", "computed": true }, { - "name": "instance_group", + "name": "status", "type": "TypeString", - "description": "instance group ID", - "required": true + "description": "The status of the instance group action- `active`: Action is ready to be run- `completed`: Action was completed successfully- `failed`: Action could not be completed successfully- `incompatible`: Action parameters are not compatible with the group or manager- `omitted`: Action was not applied because this action's manager was disabled.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time that the instance group manager action was modified.", + "computed": true }, { "name": "membership_count", @@ -43709,9 +44415,9 @@ "computed": true }, { - "name": "target_manager", + "name": "cron_spec", "type": "TypeString", - "description": "The unique identifier for this instance group manager of type autoscale.", + "description": "The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period.", "computed": true } ], @@ -43908,6 +44614,12 @@ } ], "ibm_is_instance_group_manager_policy": [ + { + "name": "instance_group", + "type": "TypeString", + "description": "instance group ID", + "required": true + }, { "name": "instance_group_manager", "type": "TypeString", @@ -43943,12 +44655,6 @@ "type": "TypeString", "description": "The policy ID", "computed": true - }, - { - "name": "instance_group", - "type": "TypeString", - "description": "instance group ID", - "required": true } ], "ibm_is_instance_group_managers": [ @@ -44047,31 +44753,6 @@ } ], "ibm_is_instance_group_membership": [ - { - "name": "instance_template", - "type": "TypeList", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this instance template.", - "computed": true - }, - "instance_template": { - "name": "instance_template", - "type": "TypeString", - "description": "The unique identifier for this instance template.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this instance template.", - "computed": true - } - } - }, { "name": "load_balancer_pool_member", "type": "TypeString", @@ -44132,6 +44813,31 @@ "computed": true } } + }, + { + "name": "instance_template", + "type": "TypeList", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this instance template.", + "computed": true + }, + "instance_template": { + "name": "instance_template", + "type": "TypeString", + "description": "The unique identifier for this instance template.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this instance template.", + "computed": true + } + } } ], "ibm_is_instance_group_memberships": [ @@ -44560,65 +45266,21 @@ ], "ibm_is_instance_network_interface": [ { - "name": "href", - "type": "TypeString", - "description": "The URL for this network interface.", - "computed": true - }, - { - "name": "primary_ip", + "name": "floating_ips", "type": "TypeList", - "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", + "description": "The floating IPs associated with this network interface.", "computed": true, "elem": { "address": { "name": "address", "type": "TypeString", - "description": "The IP address to reserve, which must not already be reserved on the subnet.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this reserved IP", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", - "computed": true - }, - "reserved_ip": { - "name": "reserved_ip", - "type": "TypeString", - "description": "Identifies a reserved IP by a unique property.", + "description": "The globally unique IP address.", "computed": true }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - } - } - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - }, - { - "name": "subnet", - "type": "TypeList", - "description": "The associated subnet.", - "computed": true, - "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The CRN for this subnet.", + "description": "The CRN for this floating IP.", "computed": true }, "deleted": { @@ -44638,45 +45300,83 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this subnet.", + "description": "The URL for this floating IP.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this subnet.", + "description": "The unique identifier for this floating IP.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this subnet.", + "description": "The unique user-defined name for this floating IP.", "computed": true } } }, { - "name": "allow_ip_spoofing", - "type": "TypeBool", - "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + "name": "status", + "type": "TypeString", + "description": "The status of the network interface.", "computed": true }, { - "name": "floating_ips", + "name": "primary_ipv4_address", + "type": "TypeString", + "description": "The primary IPv4 address.", + "computed": true + }, + { + "name": "primary_ip", "type": "TypeList", - "description": "The floating IPs associated with this network interface.", + "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", "computed": true, "elem": { "address": { "name": "address", "type": "TypeString", - "description": "The globally unique IP address.", + "description": "The IP address to reserve, which must not already be reserved on the subnet.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this reserved IP", "computed": true }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", + "computed": true + }, + "reserved_ip": { + "name": "reserved_ip", + "type": "TypeString", + "description": "Identifies a reserved IP by a unique property.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", + "computed": true + } + } + }, + { + "name": "security_groups", + "type": "TypeList", + "description": "Collection of security groups.", + "computed": true, + "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The CRN for this floating IP.", + "description": "The security group's CRN.", "computed": true }, "deleted": { @@ -44696,33 +45396,51 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this floating IP.", + "description": "The security group's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this floating IP.", + "description": "The unique identifier for this security group.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The unique user-defined name for this floating IP.", + "description": "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", "computed": true } } }, { - "name": "port_speed", - "type": "TypeInt", - "description": "The network interface port speed in Mbps.", + "name": "type", + "type": "TypeString", + "description": "The type of this network interface as it relates to an instance.", "computed": true }, { - "name": "primary_ipv4_address", + "name": "allow_ip_spoofing", + "type": "TypeBool", + "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + "computed": true + }, + { + "name": "href", "type": "TypeString", - "description": "The primary IPv4 address.", + "description": "The URL for this network interface.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this network interface.", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true }, { @@ -44738,15 +45456,27 @@ "required": true }, { - "name": "security_groups", + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the network interface was created.", + "computed": true + }, + { + "name": "port_speed", + "type": "TypeInt", + "description": "The network interface port speed in Mbps.", + "computed": true + }, + { + "name": "subnet", "type": "TypeList", - "description": "Collection of security groups.", + "description": "The associated subnet.", "computed": true, "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The security group's CRN.", + "description": "The CRN for this subnet.", "computed": true }, "deleted": { @@ -44766,49 +45496,55 @@ "href": { "name": "href", "type": "TypeString", - "description": "The security group's canonical URL.", + "description": "The URL for this subnet.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this security group.", + "description": "The unique identifier for this subnet.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + "description": "The user-defined name for this subnet.", "computed": true } } + } + ], + "ibm_is_instance_network_interface_reserved_ip": [ + { + "name": "auto_delete", + "type": "TypeBool", + "description": "If set to true, this reserved IP will be automatically deleted", + "computed": true }, { - "name": "status", + "name": "created_at", "type": "TypeString", - "description": "The status of the network interface.", + "description": "The date and time that the reserved IP was created.", "computed": true }, { - "name": "type", + "name": "href", "type": "TypeString", - "description": "The type of this network interface as it relates to an instance.", + "description": "The URL for this reserved IP.", "computed": true }, { - "name": "created_at", + "name": "instance", "type": "TypeString", - "description": "The date and time that the network interface was created.", - "computed": true + "description": "The instance identifier.", + "required": true }, { - "name": "name", + "name": "network_interface", "type": "TypeString", - "description": "The user-defined name for this network interface.", - "computed": true - } - ], - "ibm_is_instance_network_interface_reserved_ip": [ + "description": "The instance network interface identifier.", + "required": true + }, { "name": "address", "type": "TypeString", @@ -44816,15 +45552,9 @@ "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "If set to true, this reserved IP will be automatically deleted", - "computed": true - }, - { - "name": "created_at", + "name": "resource_type", "type": "TypeString", - "description": "The date and time that the reserved IP was created.", + "description": "The resource type.", "computed": true }, { @@ -44833,12 +45563,6 @@ "description": "Reserved IP target id.", "computed": true }, - { - "name": "network_interface", - "type": "TypeString", - "description": "The instance network interface identifier.", - "required": true - }, { "name": "reserved_ip", "type": "TypeString", @@ -44856,24 +45580,6 @@ "type": "TypeString", "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - }, - { - "name": "instance", - "type": "TypeString", - "description": "The instance identifier.", - "required": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this reserved IP.", - "computed": true } ], "ibm_is_instance_network_interface_reserved_ips": [ @@ -44959,6 +45665,12 @@ } ], "ibm_is_instance_network_interfaces": [ + { + "name": "total_count", + "type": "TypeInt", + "description": "The total number of resources across all pages.", + "computed": true + }, { "name": "instance_name", "type": "TypeString", @@ -45214,158 +45926,19 @@ "computed": true } } - }, - { - "name": "total_count", - "type": "TypeInt", - "description": "The total number of resources across all pages.", - "computed": true } ], "ibm_is_instance_profile": [ { - "name": "disks", - "type": "TypeList", - "description": "Collection of the instance profile's disks.", - "computed": true, - "elem": { - "quantity": { - "name": "quantity", - "type": "TypeList", - "computed": true, - "elem": { - "default": { - "name": "default", - "type": "TypeInt", - "description": "The default value for this profile field.", - "computed": true - }, - "max": { - "name": "max", - "type": "TypeInt", - "description": "The maximum value for this profile field.", - "computed": true - }, - "min": { - "name": "min", - "type": "TypeInt", - "description": "The minimum value for this profile field.", - "computed": true - }, - "step": { - "name": "step", - "type": "TypeInt", - "description": "The increment step value for this profile field.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "The value for this profile field.", - "computed": true - }, - "values": { - "name": "values", - "type": "TypeList", - "description": "The permitted values for this profile field.", - "computed": true, - "elem": { - "type": "TypeInt" - } - } - } - }, - "size": { - "name": "size", - "type": "TypeList", - "computed": true, - "elem": { - "default": { - "name": "default", - "type": "TypeInt", - "description": "The default value for this profile field.", - "computed": true - }, - "max": { - "name": "max", - "type": "TypeInt", - "description": "The maximum value for this profile field.", - "computed": true - }, - "min": { - "name": "min", - "type": "TypeInt", - "description": "The minimum value for this profile field.", - "computed": true - }, - "step": { - "name": "step", - "type": "TypeInt", - "description": "The increment step value for this profile field.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "The value for this profile field.", - "computed": true - }, - "values": { - "name": "values", - "type": "TypeList", - "description": "The permitted values for this profile field.", - "computed": true, - "elem": { - "type": "TypeInt" - } - } - } - }, - "supported_interface_types": { - "name": "supported_interface_types", - "type": "TypeList", - "computed": true, - "elem": { - "default": { - "name": "default", - "type": "TypeString", - "description": "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "values": { - "name": "values", - "type": "TypeList", - "description": "The supported disk interfaces used for attaching the disk.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - } - } + "name": "architecture_type", + "type": "TypeString", + "description": "The type for the OS architecture.", + "computed": true }, { - "name": "memory", + "name": "gpu_count", "type": "TypeList", + "description": "GPU count of this profile", "computed": true, "elem": { "default": { @@ -45415,41 +45988,6 @@ } } }, - { - "name": "architecture", - "type": "TypeString", - "description": "The default OS architecture for an instance with this profile.", - "computed": true - }, - { - "name": "architecture_type", - "type": "TypeString", - "description": "The type for the OS architecture.", - "computed": true - }, - { - "name": "gpu_manufacturer", - "type": "TypeList", - "description": "GPU manufacturer of this profile", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "The type for this profile field.", - "computed": true - }, - "values": { - "name": "values", - "type": "TypeList", - "description": "The possible GPU manufacturer(s) for an instance with this profile", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, { "name": "gpu_memory", "type": "TypeList", @@ -45504,41 +46042,78 @@ } }, { - "name": "href", + "name": "gpu_model", + "type": "TypeList", + "description": "GPU model of this profile", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "values": { + "name": "values", + "type": "TypeList", + "description": "The possible GPU model(s) for an instance with this profile", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + { + "name": "name", "type": "TypeString", - "description": "The URL for this virtual server instance profile.", + "required": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The product family this virtual server instance profile belongs to.", "computed": true }, { - "name": "network_interface_count", - "type": "TypeSet", + "name": "architecture_values", + "type": "TypeList", + "description": "The supported OS architecture(s) for an instance with this profile.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "numa_count", + "type": "TypeList", "computed": true, "elem": { - "max": { - "name": "max", - "type": "TypeInt", - "description": "The maximum value for this profile field", - "computed": true - }, - "min": { - "name": "min", - "type": "TypeInt", - "description": "The minimum value for this profile field", - "computed": true - }, "type": { "name": "type", "type": "TypeString", "description": "The type for this profile field.", "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field.", + "computed": true } } }, { - "name": "port_speed", + "name": "vcpu_architecture", "type": "TypeList", "computed": true, "elem": { + "default": { + "name": "default", + "type": "TypeString", + "description": "The default VCPU architecture for an instance with this profile.", + "computed": true + }, "type": { "name": "type", "type": "TypeString", @@ -45547,14 +46122,20 @@ }, "value": { "name": "value", - "type": "TypeInt", - "description": "The value for this profile field.", + "type": "TypeString", + "description": "The VCPU architecture for an instance with this profile.", "computed": true } } }, { - "name": "vcpu_count", + "name": "href", + "type": "TypeString", + "description": "The URL for this virtual server instance profile.", + "computed": true + }, + { + "name": "memory", "type": "TypeList", "computed": true, "elem": { @@ -45606,13 +46187,32 @@ } }, { - "name": "family", - "type": "TypeString", - "description": "The product family this virtual server instance profile belongs to.", - "computed": true + "name": "network_interface_count", + "type": "TypeSet", + "computed": true, + "elem": { + "max": { + "name": "max", + "type": "TypeInt", + "description": "The maximum value for this profile field", + "computed": true + }, + "min": { + "name": "min", + "type": "TypeInt", + "description": "The minimum value for this profile field", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + } + } }, { - "name": "bandwidth", + "name": "vcpu_count", "type": "TypeList", "computed": true, "elem": { @@ -45664,9 +46264,14 @@ } }, { - "name": "gpu_count", + "name": "architecture", + "type": "TypeString", + "description": "The default OS architecture for an instance with this profile.", + "computed": true + }, + { + "name": "bandwidth", "type": "TypeList", - "description": "GPU count of this profile", "computed": true, "elem": { "default": { @@ -45717,9 +46322,9 @@ } }, { - "name": "gpu_model", + "name": "gpu_manufacturer", "type": "TypeList", - "description": "GPU model of this profile", + "description": "GPU manufacturer of this profile", "computed": true, "elem": { "type": { @@ -45731,7 +46336,7 @@ "values": { "name": "values", "type": "TypeList", - "description": "The possible GPU model(s) for an instance with this profile", + "description": "The possible GPU manufacturer(s) for an instance with this profile", "computed": true, "elem": { "type": "TypeString" @@ -45793,16 +46398,150 @@ } }, { - "name": "vcpu_manufacturer", + "name": "disks", "type": "TypeList", + "description": "Collection of the instance profile's disks.", "computed": true, "elem": { - "default": { - "name": "default", - "type": "TypeString", - "description": "The default VCPU manufacturer for an instance with this profile.", - "computed": true + "quantity": { + "name": "quantity", + "type": "TypeList", + "computed": true, + "elem": { + "default": { + "name": "default", + "type": "TypeInt", + "description": "The default value for this profile field.", + "computed": true + }, + "max": { + "name": "max", + "type": "TypeInt", + "description": "The maximum value for this profile field.", + "computed": true + }, + "min": { + "name": "min", + "type": "TypeInt", + "description": "The minimum value for this profile field.", + "computed": true + }, + "step": { + "name": "step", + "type": "TypeInt", + "description": "The increment step value for this profile field.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field.", + "computed": true + }, + "values": { + "name": "values", + "type": "TypeList", + "description": "The permitted values for this profile field.", + "computed": true, + "elem": { + "type": "TypeInt" + } + } + } + }, + "size": { + "name": "size", + "type": "TypeList", + "computed": true, + "elem": { + "default": { + "name": "default", + "type": "TypeInt", + "description": "The default value for this profile field.", + "computed": true + }, + "max": { + "name": "max", + "type": "TypeInt", + "description": "The maximum value for this profile field.", + "computed": true + }, + "min": { + "name": "min", + "type": "TypeInt", + "description": "The minimum value for this profile field.", + "computed": true + }, + "step": { + "name": "step", + "type": "TypeInt", + "description": "The increment step value for this profile field.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field.", + "computed": true + }, + "values": { + "name": "values", + "type": "TypeList", + "description": "The permitted values for this profile field.", + "computed": true, + "elem": { + "type": "TypeInt" + } + } + } }, + "supported_interface_types": { + "name": "supported_interface_types", + "type": "TypeList", + "computed": true, + "elem": { + "default": { + "name": "default", + "type": "TypeString", + "description": "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "values": { + "name": "values", + "type": "TypeList", + "description": "The supported disk interfaces used for attaching the disk.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + } + } + }, + { + "name": "port_speed", + "type": "TypeList", + "computed": true, + "elem": { "type": { "name": "type", "type": "TypeString", @@ -45811,26 +46550,27 @@ }, "value": { "name": "value", - "type": "TypeString", - "description": "The VCPU manufacturer for an instance with this profile.", + "type": "TypeInt", + "description": "The value for this profile field.", "computed": true } } }, { - "name": "name", + "name": "status", "type": "TypeString", - "required": true + "description": "The status of the instance profile.", + "computed": true }, { - "name": "vcpu_architecture", + "name": "vcpu_manufacturer", "type": "TypeList", "computed": true, "elem": { "default": { "name": "default", "type": "TypeString", - "description": "The default VCPU architecture for an instance with this profile.", + "description": "The default VCPU manufacturer for an instance with this profile.", "computed": true }, "type": { @@ -45842,19 +46582,10 @@ "value": { "name": "value", "type": "TypeString", - "description": "The VCPU architecture for an instance with this profile.", + "description": "The VCPU manufacturer for an instance with this profile.", "computed": true } } - }, - { - "name": "architecture_values", - "type": "TypeList", - "description": "The supported OS architecture(s) for an instance with this profile.", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_is_instance_profiles": [ @@ -46323,6 +47054,25 @@ } } }, + "numa_count": { + "name": "numa_count", + "type": "TypeList", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type for this profile field.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "The value for this profile field.", + "computed": true + } + } + }, "port_speed": { "name": "port_speed", "type": "TypeList", @@ -46342,6 +47092,12 @@ } } }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the instance profile.", + "computed": true + }, "total_volume_bandwidth": { "name": "total_volume_bandwidth", "type": "TypeList", @@ -46501,114 +47257,6 @@ } ], "ibm_is_instance_template": [ - { - "name": "image", - "type": "TypeString", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "computed": true - }, - { - "name": "vpc", - "type": "TypeString", - "computed": true - }, - { - "name": "zone", - "type": "TypeString", - "computed": true - }, - { - "name": "keys", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "default_trusted_profile_target", - "type": "TypeString", - "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", - "computed": true - }, - { - "name": "metadata_service_enabled", - "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", - "computed": true - }, - { - "name": "volume_attachments", - "type": "TypeList", - "computed": true, - "elem": { - "delete_volume_on_instance_delete": { - "name": "delete_volume_on_instance_delete", - "type": "TypeBool", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "computed": true - }, - "volume": { - "name": "volume", - "type": "TypeString", - "computed": true - }, - "volume_prototype": { - "name": "volume_prototype", - "type": "TypeList", - "computed": true, - "elem": { - "capacity": { - "name": "capacity", - "type": "TypeInt", - "description": "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.", - "computed": true - }, - "encryption_key": { - "name": "encryption_key", - "type": "TypeString", - "description": "The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", - "computed": true - }, - "iops": { - "name": "iops", - "type": "TypeInt", - "description": "The maximum I/O operations per second (IOPS) for the volume.", - "computed": true - }, - "profile": { - "name": "profile", - "type": "TypeString", - "description": "The globally unique name for the volume profile to use for this volume.", - "computed": true - }, - "tags": { - "name": "tags", - "type": "TypeSet", - "description": "The user tags associated with this volume.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - } - } - }, - { - "name": "name", - "type": "TypeString", - "optional": true, - "computed": true - }, { "name": "metadata_service", "type": "TypeList", @@ -46636,16 +47284,56 @@ } }, { - "name": "availability_policy_host_failure", + "name": "resource_group", "type": "TypeString", - "description": "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "user_data", + "name": "href", + "type": "TypeString", + "computed": true + }, + { + "name": "crn", "type": "TypeString", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "keys", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "total_volume_bandwidth", + "type": "TypeInt", + "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", "computed": true }, + { + "name": "catalog_offering", + "type": "TypeList", + "description": "The catalog offering or offering version to use when provisioning this virtual server instance template. If an offering is specified, the latest version of that offering will be used. The specified offering or offering version may be in a different account in the same enterprise, subject to IAM policies.", + "computed": true, + "elem": { + "offering_crn": { + "name": "offering_crn", + "type": "TypeString", + "description": "Identifies a catalog offering by a unique CRN property", + "computed": true + }, + "version_crn": { + "name": "version_crn", + "type": "TypeString", + "description": "Identifies a version of a catalog offering by a unique CRN property", + "computed": true + } + } + }, { "name": "placement_target", "type": "TypeList", @@ -46679,39 +47367,45 @@ "computed": true }, { - "name": "crn", + "name": "zone", "type": "TypeString", - "cloud_data_type": "crn", "computed": true }, { - "name": "total_volume_bandwidth", - "type": "TypeInt", - "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", + "name": "metadata_service_enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", "computed": true }, { - "name": "catalog_offering", - "type": "TypeList", - "description": "The catalog offering or offering version to use when provisioning this virtual server instance template. If an offering is specified, the latest version of that offering will be used. The specified offering or offering version may be in a different account in the same enterprise, subject to IAM policies.", - "computed": true, - "elem": { - "offering_crn": { - "name": "offering_crn", - "type": "TypeString", - "description": "Identifies a catalog offering by a unique CRN property", - "computed": true - }, - "version_crn": { - "name": "version_crn", - "type": "TypeString", - "description": "Identifies a version of a catalog offering by a unique CRN property", - "computed": true - } - } + "name": "availability_policy_host_failure", + "type": "TypeString", + "description": "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + "computed": true }, { - "name": "boot_volume_attachment", + "name": "image", + "type": "TypeString", + "computed": true + }, + { + "name": "vpc", + "type": "TypeString", + "computed": true + }, + { + "name": "profile", + "type": "TypeString", + "computed": true + }, + { + "name": "default_trusted_profile_target", + "type": "TypeString", + "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", + "computed": true + }, + { + "name": "volume_attachments", "type": "TypeList", "computed": true, "elem": { @@ -46725,43 +47419,53 @@ "type": "TypeString", "computed": true }, - "profile": { - "name": "profile", + "volume": { + "name": "volume", "type": "TypeString", "computed": true }, - "size": { - "name": "size", - "type": "TypeInt", - "computed": true - }, - "tags": { - "name": "tags", - "type": "TypeSet", - "description": "The user tags associated with this volume.", + "volume_prototype": { + "name": "volume_prototype", + "type": "TypeList", "computed": true, "elem": { - "type": "TypeString" + "capacity": { + "name": "capacity", + "type": "TypeInt", + "description": "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.", + "computed": true + }, + "encryption_key": { + "name": "encryption_key", + "type": "TypeString", + "description": "The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", + "computed": true + }, + "iops": { + "name": "iops", + "type": "TypeInt", + "description": "The maximum I/O operations per second (IOPS) for the volume.", + "computed": true + }, + "profile": { + "name": "profile", + "type": "TypeString", + "description": "The globally unique name for the volume profile to use for this volume.", + "computed": true + }, + "tags": { + "name": "tags", + "type": "TypeSet", + "description": "The user tags associated with this volume.", + "computed": true, + "elem": { + "type": "TypeString" + } + } } - }, - "volume": { - "name": "volume", - "type": "TypeString", - "computed": true } } }, - { - "name": "profile", - "type": "TypeString", - "computed": true - }, - { - "name": "default_trusted_profile_auto_link", - "type": "TypeBool", - "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", - "computed": true - }, { "name": "primary_network_interface", "type": "TypeList", @@ -46875,9 +47579,61 @@ } }, { - "name": "resource_group", + "name": "user_data", "type": "TypeString", - "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "boot_volume_attachment", + "type": "TypeList", + "computed": true, + "elem": { + "delete_volume_on_instance_delete": { + "name": "delete_volume_on_instance_delete", + "type": "TypeBool", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "computed": true + }, + "profile": { + "name": "profile", + "type": "TypeString", + "computed": true + }, + "size": { + "name": "size", + "type": "TypeInt", + "computed": true + }, + "tags": { + "name": "tags", + "type": "TypeSet", + "description": "The user tags associated with this volume.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "volume": { + "name": "volume", + "type": "TypeString", + "computed": true + } + } + }, + { + "name": "name", + "type": "TypeString", + "optional": true, + "computed": true + }, + { + "name": "default_trusted_profile_auto_link", + "type": "TypeBool", + "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", "computed": true } ], @@ -47267,12 +48023,36 @@ } ], "ibm_is_instance_volume_attachment": [ + { + "name": "instance", + "type": "TypeString", + "description": "Instance id", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this volume attachment.", + "required": true + }, { "name": "device", "type": "TypeString", "description": "A unique identifier for the device which is exposed to the instance operating system", "computed": true }, + { + "name": "delete_volume_on_instance_delete", + "type": "TypeBool", + "description": "If set to true, when deleting the instance the volume will also be deleted.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this volume attachment", + "computed": true + }, { "name": "volume_attachment_id", "type": "TypeString", @@ -47285,6 +48065,12 @@ "description": "The status of this volume attachment, one of [ attached, attaching, deleting, detaching ]", "computed": true }, + { + "name": "type", + "type": "TypeString", + "description": "The type of volume attachment one of [ boot, data ]", + "computed": true + }, { "name": "volume_reference", "type": "TypeList", @@ -47322,45 +48108,9 @@ "computed": true } } - }, - { - "name": "instance", - "type": "TypeString", - "description": "Instance id", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this volume attachment.", - "required": true - }, - { - "name": "delete_volume_on_instance_delete", - "type": "TypeBool", - "description": "If set to true, when deleting the instance the volume will also be deleted.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this volume attachment", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of volume attachment one of [ boot, data ]", - "computed": true } ], "ibm_is_instance_volume_attachments": [ - { - "name": "instance", - "type": "TypeString", - "description": "Instance id", - "required": true - }, { "name": "volume_attachments", "type": "TypeList", @@ -47447,25 +48197,32 @@ "elem": {} } } + }, + { + "name": "instance", + "type": "TypeString", + "description": "Instance id", + "required": true } ], "ibm_is_instances": [ { - "name": "instance_group", + "name": "resource_group", "type": "TypeString", - "description": "Instance group ID to filter the instances attached to it", + "description": "Instance resource group", + "cloud_data_type": "resource_group", "optional": true }, { - "name": "instance_group_name", + "name": "dedicated_host_name", "type": "TypeString", - "description": "Instance group name to filter the instances attached to it", + "description": "Name of the dedicated host to filter the instances attached to it", "optional": true }, { - "name": "vpc_name", + "name": "dedicated_host", "type": "TypeString", - "description": "Name of the vpc to filter the instances attached to it", + "description": "ID of the dedicated host to filter the instances attached to it", "optional": true }, { @@ -47815,6 +48572,12 @@ } } }, + "numa_count": { + "name": "numa_count", + "type": "TypeInt", + "description": "The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`.", + "computed": true + }, "placement_target": { "name": "placement_target", "type": "TypeList", @@ -48090,40 +48853,39 @@ } }, { - "name": "vpc", + "name": "instance_group", "type": "TypeString", - "description": "VPC ID to filter the instances attached to it", + "description": "Instance group ID to filter the instances attached to it", "optional": true }, { - "name": "vpc_crn", + "name": "vpc_name", "type": "TypeString", - "description": "VPC CRN to filter the instances attached to it", + "description": "Name of the vpc to filter the instances attached to it", "optional": true }, { - "name": "resource_group", + "name": "vpc_crn", "type": "TypeString", - "description": "Instance resource group", - "cloud_data_type": "resource_group", + "description": "VPC CRN to filter the instances attached to it", "optional": true }, { - "name": "dedicated_host_name", + "name": "placement_group_name", "type": "TypeString", - "description": "Name of the dedicated host to filter the instances attached to it", + "description": "Name of the placement group to filter the instances attached to it", "optional": true }, { - "name": "dedicated_host", + "name": "instance_group_name", "type": "TypeString", - "description": "ID of the dedicated host to filter the instances attached to it", + "description": "Instance group name to filter the instances attached to it", "optional": true }, { - "name": "placement_group_name", + "name": "vpc", "type": "TypeString", - "description": "Name of the placement group to filter the instances attached to it", + "description": "VPC ID to filter the instances attached to it", "optional": true } ], @@ -48277,15 +49039,21 @@ ], "ibm_is_ipsec_policy": [ { - "name": "href", + "name": "ipsec_policy", "type": "TypeString", - "description": "The IPsec policy's canonical URL.", + "description": "The IPsec policy identifier.", + "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this IPsec policy was created.", "computed": true }, { - "name": "key_lifetime", - "type": "TypeInt", - "description": "The key lifetime in seconds.", + "name": "href", + "type": "TypeString", + "description": "The IPsec policy's canonical URL.", "computed": true }, { @@ -48321,36 +49089,6 @@ "description": "The IPsec policy name.", "optional": true }, - { - "name": "ipsec_policy", - "type": "TypeString", - "description": "The IPsec policy identifier.", - "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this IPsec policy was created.", - "computed": true - }, - { - "name": "encapsulation_mode", - "type": "TypeString", - "description": "The encapsulation mode used. Only `tunnel` is supported.", - "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - }, - { - "name": "transform_protocol", - "type": "TypeString", - "description": "The transform protocol used. Only `esp` is supported.", - "computed": true - }, { "name": "authentication_algorithm", "type": "TypeString", @@ -48403,37 +49141,64 @@ } } }, + { + "name": "encapsulation_mode", + "type": "TypeString", + "description": "The encapsulation mode used. Only `tunnel` is supported.", + "computed": true + }, { "name": "encryption_algorithm", "type": "TypeString", "description": "The encryption algorithm.", "computed": true }, + { + "name": "key_lifetime", + "type": "TypeInt", + "description": "The key lifetime in seconds.", + "computed": true + }, { "name": "pfs", "type": "TypeString", "description": "Perfect Forward Secrecy.", "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + }, + { + "name": "transform_protocol", + "type": "TypeString", + "description": "The transform protocol used. Only `esp` is supported.", + "computed": true } ], "ibm_is_lb": [ { - "name": "hostname", - "type": "TypeString", - "description": "Load Balancer Host Name", - "computed": true + "name": "security_groups", + "type": "TypeSet", + "description": "Load Balancer securitygroups list", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "logging", - "type": "TypeBool", - "description": "Logging of Load Balancer", + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "name", + "name": "resource_group_name", "type": "TypeString", - "description": "Load Balancer name", - "required": true + "description": "The resource group name in which resource is provisioned", + "computed": true }, { "name": "dns", @@ -48456,19 +49221,24 @@ } }, { - "name": "security_groups", - "type": "TypeSet", - "description": "Load Balancer securitygroups list", + "name": "operating_status", + "type": "TypeString", + "description": "Load Balancer operating status", + "computed": true + }, + { + "name": "public_ips", + "type": "TypeList", + "description": "Load Balancer Public IPs", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "description": "Tags associated to Load Balancer", - "cloud_data_type": "tags", + "description": "List of access tags", "computed": true, "elem": { "type": "TypeString" @@ -48519,24 +49289,65 @@ "computed": true }, { - "name": "resource_group_name", + "name": "type", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Load Balancer type", "computed": true }, { - "name": "public_ips", + "name": "status", + "type": "TypeString", + "description": "Load Balancer status", + "computed": true + }, + { + "name": "private_ips", "type": "TypeList", - "description": "Load Balancer Public IPs", + "description": "Load Balancer private IPs", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "subnets", + "name": "logging", + "type": "TypeBool", + "description": "Logging of Load Balancer", + "computed": true + }, + { + "name": "listeners", "type": "TypeSet", - "description": "Load Balancer subnets list", + "description": "Load Balancer Listeners list", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "Load Balancer name", + "required": true + }, + { + "name": "udp_supported", + "type": "TypeBool", + "description": "Indicates whether this load balancer supports UDP.", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this Load Balancer", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags associated to Load Balancer", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" @@ -48549,6 +49360,12 @@ "cloud_data_type": "resource_group", "computed": true }, + { + "name": "hostname", + "type": "TypeString", + "description": "Load Balancer Host Name", + "computed": true + }, { "name": "pools", "type": "TypeList", @@ -48638,160 +49455,50 @@ } }, { - "name": "security_group_supported", + "name": "route_mode", "type": "TypeBool", - "description": "Security Group Supported for this Load Balancer", + "description": "Indicates whether route mode is enabled for this load balancer", "computed": true }, { - "name": "access_tags", + "name": "subnets", "type": "TypeSet", - "description": "List of access tags", + "description": "Load Balancer subnets list", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "udp_supported", - "type": "TypeBool", - "description": "Indicates whether this load balancer supports UDP.", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Load Balancer status", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this Load Balancer", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "operating_status", - "type": "TypeString", - "description": "Load Balancer operating status", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Load Balancer type", - "computed": true - }, - { - "name": "route_mode", + "name": "security_group_supported", "type": "TypeBool", - "description": "Indicates whether route mode is enabled for this load balancer", + "description": "Security Group Supported for this Load Balancer", "computed": true - }, - { - "name": "private_ips", - "type": "TypeList", - "description": "Load Balancer private IPs", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "listeners", - "type": "TypeSet", - "description": "Load Balancer Listeners list", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_is_lb_listener": [ { - "name": "accept_proxy_protocol", - "type": "TypeBool", - "description": "If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). Additional restrictions:- If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must match the `accept_proxy_protocol` value of the `https_redirect` listener.- If this listener is the target of another listener's `https_redirect`, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value.", + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this listener was created.", "computed": true }, { - "name": "https_redirect", - "type": "TypeList", - "description": "If specified, the target listener that requests are redirected to.", - "computed": true, - "elem": { - "http_status_code": { - "name": "http_status_code", - "type": "TypeInt", - "description": "The HTTP status code for this redirect.", - "computed": true - }, - "listener": { - "name": "listener", - "type": "TypeList", - "computed": true, - "elem": { - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The listener's canonical URL.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this load balancer listener.", - "computed": true - } - } - }, - "uri": { - "name": "uri", - "type": "TypeString", - "description": "The redirect relative target URI.", - "computed": true - } - } + "name": "port_max", + "type": "TypeInt", + "description": "The inclusive upper bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", + "computed": true }, { - "name": "certificate_instance", - "type": "TypeList", - "description": "The certificate instance used for SSL termination. It is applicable only to `https`protocol.", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this certificate instance.", - "computed": true - } - } + "name": "listener_id", + "type": "TypeString", + "description": "The listener identifier.", + "required": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this listener was created.", + "name": "connection_limit", + "type": "TypeInt", + "description": "The connection limit of the listener.", "computed": true }, { @@ -48834,42 +49541,6 @@ } } }, - { - "name": "port_max", - "type": "TypeInt", - "description": "The inclusive upper bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", - "computed": true - }, - { - "name": "protocol", - "type": "TypeString", - "description": "The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination.", - "computed": true - }, - { - "name": "provisioning_status", - "type": "TypeString", - "description": "The provisioning status of this listener.", - "computed": true - }, - { - "name": "idle_connection_timeout", - "type": "TypeInt", - "description": "idle connection timeout of listener", - "computed": true - }, - { - "name": "lb", - "type": "TypeString", - "description": "The load balancer identifier.", - "required": true - }, - { - "name": "listener_id", - "type": "TypeString", - "description": "The listener identifier.", - "required": true - }, { "name": "policies", "type": "TypeList", @@ -48905,11 +49576,31 @@ } }, { - "name": "connection_limit", + "name": "port", "type": "TypeInt", - "description": "The connection limit of the listener.", + "description": "The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + "computed": true + }, + { + "name": "idle_connection_timeout", + "type": "TypeInt", + "description": "idle connection timeout of listener", "computed": true }, + { + "name": "certificate_instance", + "type": "TypeList", + "description": "The certificate instance used for SSL termination. It is applicable only to `https`protocol.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this certificate instance.", + "computed": true + } + } + }, { "name": "href", "type": "TypeString", @@ -48917,16 +49608,87 @@ "computed": true }, { - "name": "port", - "type": "TypeInt", - "description": "The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + "name": "provisioning_status", + "type": "TypeString", + "description": "The provisioning status of this listener.", "computed": true }, + { + "name": "lb", + "type": "TypeString", + "description": "The load balancer identifier.", + "required": true + }, + { + "name": "https_redirect", + "type": "TypeList", + "description": "If specified, the target listener that requests are redirected to.", + "computed": true, + "elem": { + "http_status_code": { + "name": "http_status_code", + "type": "TypeInt", + "description": "The HTTP status code for this redirect.", + "computed": true + }, + "listener": { + "name": "listener", + "type": "TypeList", + "computed": true, + "elem": { + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The listener's canonical URL.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this load balancer listener.", + "computed": true + } + } + }, + "uri": { + "name": "uri", + "type": "TypeString", + "description": "The redirect relative target URI.", + "computed": true + } + } + }, { "name": "port_min", "type": "TypeInt", "description": "The inclusive lower bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", "computed": true + }, + { + "name": "protocol", + "type": "TypeString", + "description": "The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + "computed": true + }, + { + "name": "accept_proxy_protocol", + "type": "TypeBool", + "description": "If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). Additional restrictions:- If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must match the `accept_proxy_protocol` value of the `https_redirect` listener.- If this listener is the target of another listener's `https_redirect`, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value.", + "computed": true } ], "ibm_is_lb_listener_policies": [ @@ -49119,52 +49881,6 @@ } ], "ibm_is_lb_listener_policy": [ - { - "name": "priority", - "type": "TypeInt", - "description": "Priority of the policy. Lower value indicates higher priority.", - "computed": true - }, - { - "name": "provisioning_status", - "type": "TypeString", - "description": "The provisioning status of this policy.", - "computed": true - }, - { - "name": "rules", - "type": "TypeList", - "description": "The rules for this policy.", - "computed": true, - "elem": { - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The rule's canonical URL.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The rule's unique identifier.", - "computed": true - } - } - }, { "name": "target", "type": "TypeList", @@ -49257,9 +49973,15 @@ } }, { - "name": "policy_id", + "name": "lb", "type": "TypeString", - "description": "The policy identifier.", + "description": "The load balancer identifier.", + "required": true + }, + { + "name": "listener", + "type": "TypeString", + "description": "The listener identifier.", "required": true }, { @@ -49269,27 +49991,55 @@ "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "The listener policy's canonical URL.", + "name": "priority", + "type": "TypeInt", + "description": "Priority of the policy. Lower value indicates higher priority.", "computed": true }, { - "name": "name", + "name": "provisioning_status", "type": "TypeString", - "description": "The user-defined name for this policy.", + "description": "The provisioning status of this policy.", "computed": true }, { - "name": "lb", - "type": "TypeString", - "description": "The load balancer identifier.", - "required": true + "name": "rules", + "type": "TypeList", + "description": "The rules for this policy.", + "computed": true, + "elem": { + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The rule's canonical URL.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The rule's unique identifier.", + "computed": true + } + } }, { - "name": "listener", + "name": "policy_id", "type": "TypeString", - "description": "The listener identifier.", + "description": "The policy identifier.", "required": true }, { @@ -49297,26 +50047,26 @@ "type": "TypeString", "description": "The policy action.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the unexpected property value was encountered.", "computed": true - } - ], - "ibm_is_lb_listener_policy_rule": [ - { - "name": "lb", - "type": "TypeString", - "description": "The load balancer identifier.", - "required": true }, { - "name": "listener", + "name": "href", "type": "TypeString", - "description": "The listener identifier.", - "required": true + "description": "The listener policy's canonical URL.", + "computed": true }, { - "name": "field", + "name": "name", "type": "TypeString", - "description": "The field. This is applicable to `header`, `query`, and `body` rule types.If the rule type is `header`, this property is required.If the rule type is `query`, this is optional. If specified and the rule condition is not`matches_regex`, the value must be percent-encoded.If the rule type is `body`, this is optional.", + "description": "The user-defined name for this policy.", "computed": true + } + ], + "ibm_is_lb_listener_policy_rule": [ + { + "name": "policy", + "type": "TypeString", + "description": "The policy identifier.", + "required": true }, { "name": "provisioning_status", @@ -49325,15 +50075,15 @@ "computed": true }, { - "name": "value", + "name": "type", "type": "TypeString", - "description": "Value to be matched for rule condition.If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded.", + "description": "The type of the rule.Body rules are applied to form-encoded request bodies using the `UTF-8` character set.", "computed": true }, { - "name": "policy", + "name": "listener", "type": "TypeString", - "description": "The policy identifier.", + "description": "The listener identifier.", "required": true }, { @@ -49354,6 +50104,12 @@ "description": "The date and time that this rule was created.", "computed": true }, + { + "name": "field", + "type": "TypeString", + "description": "The field. This is applicable to `header`, `query`, and `body` rule types.If the rule type is `header`, this property is required.If the rule type is `query`, this is optional. If specified and the rule condition is not`matches_regex`, the value must be percent-encoded.If the rule type is `body`, this is optional.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -49361,10 +50117,16 @@ "computed": true }, { - "name": "type", + "name": "value", "type": "TypeString", - "description": "The type of the rule.Body rules are applied to form-encoded request bodies using the `UTF-8` character set.", + "description": "Value to be matched for rule condition.If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded.", "computed": true + }, + { + "name": "lb", + "type": "TypeString", + "description": "The load balancer identifier.", + "required": true } ], "ibm_is_lb_listener_policy_rules": [ @@ -49676,69 +50438,61 @@ "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this pool was created.", - "computed": true - }, - { - "name": "protocol", - "type": "TypeString", - "description": "The protocol used for this load balancer pool.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the unexpected property value was encountered.", - "computed": true - }, - { - "name": "href", + "name": "algorithm", "type": "TypeString", - "description": "The pool's canonical URL.", + "description": "The load balancing algorithm.", "computed": true }, { - "name": "instance_group", + "name": "health_monitor", "type": "TypeList", - "description": "The instance group that is managing this pool.", + "description": "The health monitor of this pool.", "computed": true, "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this instance group.", + "delay": { + "name": "delay", + "type": "TypeInt", + "description": "The health check interval in seconds. Interval must be greater than timeout value.", "computed": true }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } + "max_retries": { + "name": "max_retries", + "type": "TypeInt", + "description": "The health check max retries.", + "computed": true }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this instance group.", + "port": { + "name": "port", + "type": "TypeInt", + "description": "The health check port number. If specified, this overrides the ports specified in the server member resources.", "computed": true }, - "id": { - "name": "id", + "timeout": { + "name": "timeout", + "type": "TypeInt", + "description": "The health check timeout in seconds.", + "computed": true + }, + "type": { + "name": "type", "type": "TypeString", - "description": "The unique identifier for this instance group.", + "description": "The protocol type of this load balancer pool health monitor.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which the unexpected property value was encountered.", "computed": true }, - "name": { - "name": "name", + "url_path": { + "name": "url_path", "type": "TypeString", - "description": "The user-defined name for this instance group.", + "description": "The health check URL path. Applicable only if the health monitor `type` is `http` or`https`. This value must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1).", "computed": true } } }, + { + "name": "href", + "type": "TypeString", + "description": "The pool's canonical URL.", + "computed": true + }, { "name": "members", "type": "TypeList", @@ -49774,9 +50528,9 @@ } }, { - "name": "provisioning_status", + "name": "protocol", "type": "TypeString", - "description": "The provisioning status of this pool.", + "description": "The protocol used for this load balancer pool.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the unexpected property value was encountered.", "computed": true }, { @@ -49792,55 +50546,11 @@ "optional": true }, { - "name": "algorithm", + "name": "provisioning_status", "type": "TypeString", - "description": "The load balancing algorithm.", + "description": "The provisioning status of this pool.", "computed": true }, - { - "name": "health_monitor", - "type": "TypeList", - "description": "The health monitor of this pool.", - "computed": true, - "elem": { - "delay": { - "name": "delay", - "type": "TypeInt", - "description": "The health check interval in seconds. Interval must be greater than timeout value.", - "computed": true - }, - "max_retries": { - "name": "max_retries", - "type": "TypeInt", - "description": "The health check max retries.", - "computed": true - }, - "port": { - "name": "port", - "type": "TypeInt", - "description": "The health check port number. If specified, this overrides the ports specified in the server member resources.", - "computed": true - }, - "timeout": { - "name": "timeout", - "type": "TypeInt", - "description": "The health check timeout in seconds.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The protocol type of this load balancer pool health monitor.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which the unexpected property value was encountered.", - "computed": true - }, - "url_path": { - "name": "url_path", - "type": "TypeString", - "description": "The health check URL path. Applicable only if the health monitor `type` is `http` or`https`. This value must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1).", - "computed": true - } - } - }, { "name": "proxy_protocol", "type": "TypeString", @@ -49866,31 +50576,23 @@ "computed": true } } - } - ], - "ibm_is_lb_pool_member": [ + }, { - "name": "member", + "name": "created_at", "type": "TypeString", - "description": "The member identifier.", - "required": true + "description": "The date and time that this pool was created.", + "computed": true }, { - "name": "target", + "name": "instance_group", "type": "TypeList", - "description": "The pool member target. Load balancers in the `network` family support virtual serverinstances. Load balancers in the `application` family support IP addresses.", + "description": "The instance group that is managing this pool.", "computed": true, "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", - "computed": true - }, "crn": { "name": "crn", "type": "TypeString", - "description": "The CRN for this virtual server instance.", + "description": "The CRN for this instance group.", "computed": true }, "deleted": { @@ -49910,28 +50612,30 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this virtual server instance.", + "description": "The URL for this instance group.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this virtual server instance.", + "description": "The unique identifier for this instance group.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this virtual server instance (and default system hostname).", + "description": "The user-defined name for this instance group.", "computed": true } } - }, + } + ], + "ibm_is_lb_pool_member": [ { - "name": "created_at", + "name": "member", "type": "TypeString", - "description": "The date and time that this member was created.", - "computed": true + "description": "The member identifier.", + "required": true }, { "name": "health", @@ -49951,12 +50655,6 @@ "description": "The port number of the application running in the server member.", "computed": true }, - { - "name": "provisioning_status", - "type": "TypeString", - "description": "The provisioning status of this member.", - "computed": true - }, { "name": "weight", "type": "TypeInt", @@ -49974,6 +50672,70 @@ "type": "TypeString", "description": "The pool identifier.", "required": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this member was created.", + "computed": true + }, + { + "name": "provisioning_status", + "type": "TypeString", + "description": "The provisioning status of this member.", + "computed": true + }, + { + "name": "target", + "type": "TypeList", + "description": "The pool member target. Load balancers in the `network` family support virtual serverinstances. Load balancers in the `application` family support IP addresses.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this virtual server instance.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this virtual server instance.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this virtual server instance.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this virtual server instance (and default system hostname).", + "computed": true + } + } } ], "ibm_is_lb_pool_members": [ @@ -50093,6 +50855,12 @@ } ], "ibm_is_lb_pools": [ + { + "name": "lb", + "type": "TypeString", + "description": "The load balancer identifier.", + "required": true + }, { "name": "pools", "type": "TypeList", @@ -50292,15 +51060,27 @@ } } } - }, - { - "name": "lb", - "type": "TypeString", - "description": "The load balancer identifier.", - "required": true } ], "ibm_is_lb_profile": [ + { + "name": "name", + "type": "TypeString", + "description": "The name for this load balancer profile", + "required": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this load balancer profile", + "computed": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The product family this load balancer profile belongs to", + "computed": true + }, { "name": "route_mode_supported", "type": "TypeBool", @@ -50324,24 +51104,6 @@ "type": "TypeString", "description": "The UDP support type for a load balancer with this profile", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name for this load balancer profile", - "required": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this load balancer profile", - "computed": true - }, - { - "name": "family", - "type": "TypeString", - "description": "The product family this load balancer profile belongs to", - "computed": true } ], "ibm_is_lb_profiles": [ @@ -50681,10 +51443,38 @@ ], "ibm_is_network_acl": [ { - "name": "name", + "name": "crn", "type": "TypeString", - "description": "The network acl name.", - "optional": true + "description": "The CRN for this network ACL.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeList", + "description": "The resource group for this network ACL.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this resource group.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this resource group.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this resource group.", + "computed": true + } + } }, { "name": "rules", @@ -50924,46 +51714,6 @@ } } }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this network ACL.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this network ACL.", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeList", - "description": "The resource group for this network ACL.", - "cloud_data_type": "resource_group", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this resource group.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this resource group.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this resource group.", - "computed": true - } - } - }, { "name": "vpc", "type": "TypeList", @@ -51010,6 +51760,24 @@ } } }, + { + "name": "name", + "type": "TypeString", + "description": "The network acl name.", + "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the network ACL was created.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this network ACL.", + "computed": true + }, { "name": "access_tags", "type": "TypeSet", @@ -51030,20 +51798,14 @@ "type": "TypeString", "description": "The network acl id.", "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the network ACL was created.", - "computed": true } ], "ibm_is_network_acl_rule": [ { - "name": "before", + "name": "name", "type": "TypeString", - "description": "The rule that this rule is immediately before. If absent, this is the last rule.", - "computed": true + "description": "The user-defined name for this rule", + "required": true }, { "name": "udp", @@ -51077,6 +51839,38 @@ } } }, + { + "name": "icmp", + "type": "TypeList", + "description": "The protocol ICMP", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeInt", + "description": "The ICMP traffic code to allow. Valid values from 0 to 255.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeInt", + "description": "The ICMP traffic type to allow. Valid values from 0 to 254.", + "computed": true + } + } + }, + { + "name": "protocol", + "type": "TypeString", + "description": "The protocol to enforce.", + "computed": true + }, + { + "name": "direction", + "type": "TypeString", + "description": "Whether the traffic to be matched is inbound or outbound.", + "computed": true + }, { "name": "tcp", "type": "TypeList", @@ -51110,59 +51904,27 @@ } }, { - "name": "destination", - "type": "TypeString", - "description": "The destination IP address or CIDR block.", - "computed": true - }, - { - "name": "icmp", - "type": "TypeList", - "description": "The protocol ICMP", - "computed": true, - "elem": { - "code": { - "name": "code", - "type": "TypeInt", - "description": "The ICMP traffic code to allow. Valid values from 0 to 255.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeInt", - "description": "The ICMP traffic type to allow. Valid values from 0 to 254.", - "computed": true - } - } - }, - { - "name": "protocol", + "name": "rule_id", "type": "TypeString", - "description": "The protocol to enforce.", + "description": "Network ACL rule id", "computed": true }, { - "name": "action", + "name": "source", "type": "TypeString", - "description": "Whether to allow or deny matching traffic.", + "description": "The source IP address or CIDR block.", "computed": true }, { - "name": "direction", + "name": "href", "type": "TypeString", - "description": "Whether the traffic to be matched is inbound or outbound.", + "description": "The URL for this network ACL rule", "computed": true }, { - "name": "network_acl", - "type": "TypeString", - "description": "Network ACL id", - "required": true - }, - { - "name": "rule_id", + "name": "action", "type": "TypeString", - "description": "Network ACL rule id", + "description": "Whether to allow or deny matching traffic.", "computed": true }, { @@ -51172,25 +51934,37 @@ "computed": true }, { - "name": "source", + "name": "destination", "type": "TypeString", - "description": "The source IP address or CIDR block.", + "description": "The destination IP address or CIDR block.", "computed": true }, { - "name": "name", + "name": "network_acl", "type": "TypeString", - "description": "The user-defined name for this rule", + "description": "Network ACL id", "required": true }, { - "name": "href", + "name": "before", "type": "TypeString", - "description": "The URL for this network ACL rule", + "description": "The rule that this rule is immediately before. If absent, this is the last rule.", "computed": true } ], "ibm_is_network_acl_rules": [ + { + "name": "direction", + "type": "TypeString", + "description": "The direction of the rules to filter", + "optional": true + }, + { + "name": "network_acl", + "type": "TypeString", + "description": "Network ACL id", + "required": true + }, { "name": "rules", "type": "TypeList", @@ -51342,28 +52116,9 @@ } } } - }, - { - "name": "direction", - "type": "TypeString", - "description": "The direction of the rules to filter", - "optional": true - }, - { - "name": "network_acl", - "type": "TypeString", - "description": "Network ACL id", - "required": true } ], "ibm_is_network_acls": [ - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group identifier.", - "cloud_data_type": "resource_group", - "optional": true - }, { "name": "network_acls", "type": "TypeList", @@ -51720,21 +52475,16 @@ } } } - } - ], - "ibm_is_operating_system": [ - { - "name": "vendor", - "type": "TypeString", - "description": "The vendor of the operating system", - "computed": true }, { - "name": "name", + "name": "resource_group", "type": "TypeString", - "description": "The globally unique name for this operating system", - "required": true - }, + "description": "Resource group identifier.", + "cloud_data_type": "resource_group", + "optional": true + } + ], + "ibm_is_operating_system": [ { "name": "architecture", "type": "TypeString", @@ -51770,6 +52520,18 @@ "type": "TypeString", "description": "The URL for this operating system", "computed": true + }, + { + "name": "vendor", + "type": "TypeString", + "description": "The vendor of the operating system", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this operating system", + "required": true } ], "ibm_is_operating_systems": [ @@ -51838,37 +52600,32 @@ "required": true }, { - "name": "href", + "name": "crn", "type": "TypeString", - "description": "The URL for this placement group.", + "description": "The CRN for this placement group.", + "cloud_data_type": "crn", "computed": true }, { - "name": "resource_type", + "name": "strategy", "type": "TypeString", - "description": "The resource type.", + "description": "The strategy for this placement group- `host_spread`: place on different compute hosts- `power_spread`: place on compute hosts that use different power sourcesThe enumerated values for this property may expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the unexpected strategy was encountered.", "computed": true }, { - "name": "access_tags", + "name": "tags", "type": "TypeSet", - "description": "List of access management tags", + "description": "List of tags", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "strategy", - "type": "TypeString", - "description": "The strategy for this placement group- `host_spread`: place on different compute hosts- `power_spread`: place on compute hosts that use different power sourcesThe enumerated values for this property may expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the unexpected strategy was encountered.", - "computed": true - }, - { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", + "description": "List of access management tags", "computed": true, "elem": { "type": "TypeString" @@ -51881,10 +52638,9 @@ "computed": true }, { - "name": "crn", + "name": "href", "type": "TypeString", - "description": "The CRN for this placement group.", - "cloud_data_type": "crn", + "description": "The URL for this placement group.", "computed": true }, { @@ -51919,6 +52675,12 @@ "computed": true } } + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true } ], "ibm_is_placement_groups": [ @@ -52031,9 +52793,9 @@ ], "ibm_is_public_gateway": [ { - "name": "zone", + "name": "vpc", "type": "TypeString", - "description": "Public gateway zone info", + "description": "Public gateway VPC info", "computed": true }, { @@ -52043,15 +52805,15 @@ "computed": true }, { - "name": "resource_crn", + "name": "resource_status", "type": "TypeString", - "description": "The crn of the resource", + "description": "The status of the resource", "computed": true }, { - "name": "vpc", - "type": "TypeString", - "description": "Public gateway VPC info", + "name": "floating_ip", + "type": "TypeMap", + "description": "Public gateway floating IP", "computed": true }, { @@ -52064,15 +52826,6 @@ "type": "TypeString" } }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "crn", "type": "TypeString", @@ -52081,21 +52834,36 @@ "computed": true }, { - "name": "resource_status", + "name": "resource_crn", "type": "TypeString", - "description": "The status of the resource", + "description": "The crn of the resource", "computed": true }, { - "name": "resource_group_name", + "name": "status", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Public gateway instance status", "computed": true }, { - "name": "status", + "name": "zone", "type": "TypeString", - "description": "Public gateway instance status", + "description": "Public gateway zone info", + "computed": true + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true }, { @@ -52104,12 +52872,6 @@ "description": "Public gateway Name", "required": true }, - { - "name": "floating_ip", - "type": "TypeMap", - "description": "Public gateway floating IP", - "computed": true - }, { "name": "resource_group", "type": "TypeString", @@ -52126,6 +52888,13 @@ } ], "ibm_is_public_gateways": [ + { + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier of the resource group this public gateway belongs to", + "cloud_data_type": "resource_group", + "optional": true + }, { "name": "public_gateways", "type": "TypeList", @@ -52230,13 +52999,6 @@ "computed": true } } - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "The unique identifier of the resource group this public gateway belongs to", - "cloud_data_type": "resource_group", - "optional": true } ], "ibm_is_region": [ @@ -52288,23 +53050,33 @@ ], "ibm_is_security_group": [ { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "Security group name", + "required": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "vpc", + "name": "resource_controller_url", "type": "TypeString", - "description": "Security group's resource group id", - "immutable": true, + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_group_name", + "name": "resource_name", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", "computed": true }, { @@ -52327,16 +53099,18 @@ } }, { - "name": "resource_crn", + "name": "crn", "type": "TypeString", "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "name", + "name": "vpc", "type": "TypeString", - "description": "Security group name", - "required": true + "description": "Security group's resource group id", + "immutable": true, + "computed": true }, { "name": "rules", @@ -52394,21 +53168,15 @@ "computed": true } } - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true } ], "ibm_is_security_group_rule": [ + { + "name": "type", + "type": "TypeInt", + "description": "The ICMP traffic type to allow.", + "computed": true + }, { "name": "security_group_rule", "type": "TypeString", @@ -52416,9 +53184,9 @@ "required": true }, { - "name": "href", + "name": "ip_version", "type": "TypeString", - "description": "The URL for this security group rule.", + "description": "The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.", "computed": true }, { @@ -52486,9 +53254,9 @@ } }, { - "name": "type", + "name": "code", "type": "TypeInt", - "description": "The ICMP traffic type to allow.", + "description": "The ICMP traffic code to allow.", "computed": true }, { @@ -52497,6 +53265,12 @@ "description": "The inclusive upper bound of TCP/UDP port range.", "computed": true }, + { + "name": "port_min", + "type": "TypeInt", + "description": "The inclusive lower bound of TCP/UDP port range.", + "computed": true + }, { "name": "security_group", "type": "TypeString", @@ -52504,27 +53278,15 @@ "required": true }, { - "name": "ip_version", + "name": "direction", "type": "TypeString", - "description": "The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.", - "computed": true - }, - { - "name": "code", - "type": "TypeInt", - "description": "The ICMP traffic code to allow.", - "computed": true - }, - { - "name": "port_min", - "type": "TypeInt", - "description": "The inclusive lower bound of TCP/UDP port range.", + "description": "The direction of traffic to enforce, either `inbound` or `outbound`.", "computed": true }, { - "name": "direction", + "name": "href", "type": "TypeString", - "description": "The direction of traffic to enforce, either `inbound` or `outbound`.", + "description": "The URL for this security group rule.", "computed": true } ], @@ -52696,12 +53458,6 @@ } ], "ibm_is_security_group_targets": [ - { - "name": "security_group", - "type": "TypeString", - "description": "Security group id", - "required": true - }, { "name": "targets", "type": "TypeList", @@ -52739,9 +53495,22 @@ "computed": true } } + }, + { + "name": "security_group", + "type": "TypeString", + "description": "Security group id", + "required": true } ], "ibm_is_security_groups": [ + { + "name": "resource_group", + "type": "TypeString", + "description": "resource group identifier.", + "cloud_data_type": "resource_group", + "optional": true + }, { "name": "vpc_id", "type": "TypeString", @@ -53050,20 +53819,51 @@ } } } - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "resource group identifier.", - "cloud_data_type": "resource_group", - "optional": true } ], "ibm_is_share": [ { - "name": "replica_share", + "name": "replication_role", + "type": "TypeString", + "description": "The replication role of the file share.* `none`: This share is not participating in replication.* `replica`: This share is a replication target.* `source`: This share is a replication source.", + "computed": true + }, + { + "name": "replication_status", + "type": "TypeString", + "description": "The replication status of the file share.* `active`: This share is actively participating in replication, and the replica's data is up-to-date with the replication schedule.* `failover_pending`: This share is performing a replication failover.* `initializing`: This share is initializing replication.* `none`: This share is not participating in replication.* `split_pending`: This share is performing a replication split.", + "computed": true + }, + { + "name": "replication_status_reasons", "type": "TypeList", - "description": "The replica file share for this source file share.This property will be present when the `replication_role` is `source`.", + "description": "The reasons for the current replication status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", + "computed": true + } + } + }, + { + "name": "source_share", + "type": "TypeList", + "description": "The source file share for this replica file share.This property will be present when the `replication_role` is `replica`.", "computed": true, "elem": { "crn": { @@ -53113,54 +53913,69 @@ } }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", + "name": "share_targets", + "type": "TypeList", + "description": "Mount targets for the file share.", "computed": true, "elem": { - "type": "TypeString" + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this share target.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this share target.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this share target.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The type of resource referenced.", + "computed": true + } } }, { - "name": "encryption", - "type": "TypeString", - "description": "The type of encryption used for this file share.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the file share.", - "computed": true - }, - { - "name": "replication_status", - "type": "TypeString", - "description": "The replication status of the file share.* `active`: This share is actively participating in replication, and the replica's data is up-to-date with the replication schedule.* `failover_pending`: This share is performing a replication failover.* `initializing`: This share is initializing replication.* `none`: This share is not participating in replication.* `split_pending`: This share is performing a replication split.", - "computed": true - }, - { - "name": "size", + "name": "iops", "type": "TypeInt", - "description": "The size of the file share rounded up to the next gigabyte.", + "description": "The maximum input/output operation performance bandwidth per second for the file share.", "computed": true }, { - "name": "share_targets", + "name": "replica_share", "type": "TypeList", - "description": "Mount targets for the file share.", + "description": "The replica file share for this source file share.This property will be present when the `replication_role` is `source`.", "computed": true, "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this file share.", + "computed": true + }, "deleted": { "name": "deleted", "type": "TypeList", @@ -53178,25 +53993,25 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this share target.", + "description": "The URL for this file share.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this share target.", + "description": "The unique identifier for this file share.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this share target.", + "description": "The unique user-defined name for this file share.", "computed": true }, "resource_type": { "name": "resource_type", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The resource type.", "computed": true } } @@ -53248,125 +54063,62 @@ } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the file share is created.", - "computed": true - }, - { - "name": "encryption_key", + "name": "replication_cron_spec", "type": "TypeString", - "description": "The key used to encrypt this file share. The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", + "description": "The cron specification for the file share replication schedule.This property will be present when the `replication_role` is `replica`.", "computed": true }, { - "name": "href", + "name": "resource_group", "type": "TypeString", - "description": "The URL for this share.", + "description": "The unique identifier of the resource group for this file share.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "profile", - "type": "TypeString", - "description": "The globally unique name of the profile this file share uses.", + "name": "size", + "type": "TypeInt", + "description": "The size of the file share rounded up to the next gigabyte.", "computed": true }, { - "name": "replication_status_reasons", - "type": "TypeList", - "description": "The reasons for the current replication status (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", "computed": true, "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason.", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the status reason.", - "computed": true - }, - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about this status reason.", - "computed": true - } + "type": "TypeString" } }, { - "name": "resource_group", + "name": "name", "type": "TypeString", - "description": "The unique identifier of the resource group for this file share.", - "cloud_data_type": "resource_group", + "description": "Name of the share.", + "optional": true, "computed": true }, { - "name": "source_share", - "type": "TypeList", - "description": "The source file share for this replica file share.This property will be present when the `replication_role` is `replica`.", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this file share.", - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this file share.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this file share.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this file share.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } - } + "name": "encryption", + "type": "TypeString", + "description": "The type of encryption used for this file share.", + "computed": true }, { - "name": "name", + "name": "resource_type", "type": "TypeString", - "description": "Name of the share.", - "optional": true, + "description": "The type of resource referenced.", "computed": true }, { - "name": "access_control_mode", + "name": "encryption_key", "type": "TypeString", - "description": "The access control mode for the share", + "description": "The key used to encrypt this file share. The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this share.", "computed": true }, { @@ -53377,60 +54129,82 @@ "computed": true }, { - "name": "iops", - "type": "TypeInt", - "description": "The maximum input/output operation performance bandwidth per second for the file share.", + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the file share.", "computed": true }, { - "name": "replication_cron_spec", + "name": "profile", "type": "TypeString", - "description": "The cron specification for the file share replication schedule.This property will be present when the `replication_role` is `replica`.", + "description": "The globally unique name of the profile this file share uses.", "computed": true }, { - "name": "replication_role", + "name": "zone", "type": "TypeString", - "description": "The replication role of the file share.* `none`: This share is not participating in replication.* `replica`: This share is a replication target.* `source`: This share is a replication source.", + "description": "The globally unique name of the zone this file share will reside in.", "computed": true }, { - "name": "resource_type", + "name": "access_control_mode", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The access control mode for the share", "computed": true }, { - "name": "zone", - "type": "TypeString", - "description": "The globally unique name of the zone this file share will reside in.", - "computed": true + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "share", "type": "TypeString", "description": "The file share identifier.", "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the file share is created.", + "computed": true } ], "ibm_is_share_mount_target": [ { - "name": "access_control_mode", + "name": "lifecycle_state", "type": "TypeString", - "description": "The access control mode for the share", + "description": "The lifecycle state of the mount target.", "computed": true }, { - "name": "created_at", + "name": "name", "type": "TypeString", - "description": "The date and time that the share target was created.", + "description": "The user-defined name for this share target.", "computed": true }, { - "name": "href", + "name": "share", "type": "TypeString", - "description": "The URL for this share target.", - "computed": true + "description": "The file share identifier.", + "optional": true + }, + { + "name": "mount_target", + "type": "TypeString", + "description": "The share target identifier.", + "optional": true + }, + { + "name": "share_name", + "type": "TypeString", + "description": "The file share name.", + "optional": true }, { "name": "mount_target_name", @@ -53439,14 +54213,27 @@ "optional": true }, { - "name": "transit_encryption", + "name": "created_at", "type": "TypeString", + "description": "The date and time that the share target was created.", "computed": true }, { - "name": "resource_type", + "name": "access_control_mode", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The access control mode for the share", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this share target.", + "computed": true + }, + { + "name": "mount_path", + "type": "TypeString", + "description": "The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future.", "computed": true }, { @@ -53501,6 +54288,17 @@ } } }, + { + "name": "transit_encryption", + "type": "TypeString", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The type of resource referenced.", + "computed": true + }, { "name": "vpc", "type": "TypeList", @@ -53553,18 +54351,6 @@ } } }, - { - "name": "share_name", - "type": "TypeString", - "description": "The file share name.", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this share target.", - "computed": true - }, { "name": "virtual_network_interface", "type": "TypeList", @@ -53616,39 +54402,9 @@ "computed": true } } - }, - { - "name": "share", - "type": "TypeString", - "description": "The file share identifier.", - "optional": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the mount target.", - "computed": true - }, - { - "name": "mount_path", - "type": "TypeString", - "description": "The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future.", - "computed": true - }, - { - "name": "mount_target", - "type": "TypeString", - "description": "The share target identifier.", - "optional": true } ], "ibm_is_share_mount_targets": [ - { - "name": "share", - "type": "TypeString", - "description": "The file share identifier.", - "required": true - }, { "name": "name", "type": "TypeString", @@ -53872,9 +54628,21 @@ } } } + }, + { + "name": "share", + "type": "TypeString", + "description": "The file share identifier.", + "required": true } ], "ibm_is_share_profile": [ + { + "name": "family", + "type": "TypeString", + "description": "The product family this share profile belongs to.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -53995,12 +54763,6 @@ "computed": true } } - }, - { - "name": "family", - "type": "TypeString", - "description": "The product family this share profile belongs to.", - "computed": true } ], "ibm_is_share_profiles": [ @@ -54150,6 +54912,12 @@ } ], "ibm_is_shares": [ + { + "name": "name", + "type": "TypeString", + "description": "Name of the share.", + "optional": true + }, { "name": "resource_group", "type": "TypeString", @@ -54518,20 +55286,13 @@ "type": "TypeInt", "description": "The total number of resources across all pages.", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the share.", - "optional": true } ], "ibm_is_snapshot": [ { - "name": "crn", + "name": "encryption_key", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "A reference to the root key used to wrap the data encryption key for the source volume.", "computed": true }, { @@ -54541,104 +55302,11 @@ "computed": true }, { - "name": "clones", - "type": "TypeSet", - "description": "Zones for creating the snapshot clone", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "copies", - "type": "TypeList", - "description": "The copies of this snapshot in other regions.", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for the copied snapshot.", - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted, and provides some supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for the copied snapshot.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for the copied snapshot.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name for the copied snapshot. The name is unique across all snapshots in the copied snapshot's native region.", - "computed": true - }, - "remote": { - "name": "remote", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this region.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this region.", - "computed": true - } - } - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } - } - }, - { - "name": "name", - "type": "TypeString", - "description": "Snapshot name", - "optional": true - }, - { - "name": "encryption_key", + "name": "source_image", "type": "TypeString", - "description": "A reference to the root key used to wrap the data encryption key for the source volume.", + "description": "If present, the image id from which the data on this volume was most directly provisioned.", "computed": true }, - { - "name": "identifier", - "type": "TypeString", - "description": "Snapshot identifier", - "optional": true - }, { "name": "bootable", "type": "TypeBool", @@ -54646,146 +55314,36 @@ "computed": true }, { - "name": "lifecycle_state", - "type": "TypeString", - "description": "Snapshot lifecycle state", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URL for the snapshot", - "computed": true - }, - { - "name": "resource_type", + "name": "crn", "type": "TypeString", - "description": "The resource type of the snapshot", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "captured_at", + "name": "encryption", "type": "TypeString", - "description": "The date and time that this snapshot was created", + "description": "Encryption type of the snapshot", "computed": true }, { - "name": "source_image", + "name": "identifier", "type": "TypeString", - "description": "If present, the image id from which the data on this volume was most directly provisioned.", - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "source_snapshot", - "type": "TypeList", - "description": "If present, the source snapshot this snapshot was created from.", - "optional": true, - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN of the source snapshot.", - "optional": true, - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for the source snapshot.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for the source snapshot.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region.", - "computed": true - }, - "remote": { - "name": "remote", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this region.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this region.", - "computed": true - } - } - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } - } + "description": "Snapshot identifier", + "optional": true }, { - "name": "operating_system", + "name": "source_volume", "type": "TypeString", - "description": "The globally unique name for the operating system included in this image", + "description": "Snapshot source volume id", "computed": true }, { - "name": "encryption", + "name": "lifecycle_state", "type": "TypeString", - "description": "Encryption type of the snapshot", - "computed": true - }, - { - "name": "size", - "type": "TypeInt", - "description": "The size of the snapshot", + "description": "Snapshot lifecycle state", "computed": true }, - { - "name": "tags", - "type": "TypeSet", - "description": "User Tags for the snapshot", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "backup_policy_plan", "type": "TypeList", @@ -54832,6 +55390,136 @@ } } }, + { + "name": "name", + "type": "TypeString", + "description": "Snapshot name", + "optional": true + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "size", + "type": "TypeInt", + "description": "The size of the snapshot", + "computed": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "User Tags for the snapshot", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "href", + "type": "TypeString", + "description": "URL for the snapshot", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type of the snapshot", + "computed": true + }, + { + "name": "clones", + "type": "TypeSet", + "description": "Zones for creating the snapshot clone", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "captured_at", + "type": "TypeString", + "description": "The date and time that this snapshot was created", + "computed": true + }, + { + "name": "copies", + "type": "TypeList", + "description": "The copies of this snapshot in other regions.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for the copied snapshot.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted, and provides some supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for the copied snapshot.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for the copied snapshot.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for the copied snapshot. The name is unique across all snapshots in the copied snapshot's native region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, { "name": "resource_group", "type": "TypeString", @@ -54840,9 +55528,83 @@ "computed": true }, { - "name": "source_volume", + "name": "source_snapshot", + "type": "TypeList", + "description": "If present, the source snapshot this snapshot was created from.", + "optional": true, + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN of the source snapshot.", + "optional": true, + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for the source snapshot.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for the source snapshot.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "operating_system", "type": "TypeString", - "description": "Snapshot source volume id", + "description": "The globally unique name for the operating system included in this image", "computed": true } ], @@ -54872,11 +55634,6 @@ } ], "ibm_is_snapshot_clones": [ - { - "name": "snapshot", - "type": "TypeString", - "required": true - }, { "name": "clones", "type": "TypeList", @@ -54902,31 +55659,36 @@ "computed": true } } + }, + { + "name": "snapshot", + "type": "TypeString", + "required": true } ], "ibm_is_snapshots": [ { - "name": "source_snapshot_remote_region_name", + "name": "source_image", "type": "TypeString", - "description": "Filters the collection to snapshots with a source snapshot with the exact remote region name.", + "description": "Filters the snapshot collection by source image id", "optional": true }, { - "name": "name", + "name": "source_volume", "type": "TypeString", - "description": "Filters the snapshot collection by snapshot name", + "description": "Filters the snapshot collection by source volume id", "optional": true }, { - "name": "backup_policy_plan_id", + "name": "snapshot_copies_name", "type": "TypeString", - "description": "Filters the collection to backup policy jobs with the backup plan with the specified identifier", + "description": "Filters the collection to snapshots with copies with the exact specified name.", "optional": true }, { - "name": "tag", + "name": "snapshot_copies_crn", "type": "TypeString", - "description": "Filters the collection to resources with the exact tag value", + "description": "Filters the collection to snapshots with copies with the specified CRN.", "optional": true }, { @@ -54936,9 +55698,9 @@ "optional": true }, { - "name": "source_snapshot_id", + "name": "source_snapshot_remote_region_name", "type": "TypeString", - "description": "Filters the collection to resources with the source snapshot with the specified identifier.", + "description": "Filters the collection to snapshots with a source snapshot with the exact remote region name.", "optional": true }, { @@ -54949,15 +55711,15 @@ "optional": true }, { - "name": "source_image", + "name": "name", "type": "TypeString", - "description": "Filters the snapshot collection by source image id", + "description": "Filters the snapshot collection by snapshot name", "optional": true }, { - "name": "snapshot_copies_crn", + "name": "snapshot_copies_id", "type": "TypeString", - "description": "Filters the collection to snapshots with copies with the specified CRN.", + "description": "Filters the collection to snapshots with copies with the specified identifier.", "optional": true }, { @@ -55289,25 +56051,31 @@ } }, { - "name": "source_volume", + "name": "backup_policy_plan_id", "type": "TypeString", - "description": "Filters the snapshot collection by source volume id", + "description": "Filters the collection to backup policy jobs with the backup plan with the specified identifier", "optional": true }, { - "name": "snapshot_copies_id", + "name": "source_snapshot_id", "type": "TypeString", - "description": "Filters the collection to snapshots with copies with the specified identifier.", + "description": "Filters the collection to resources with the source snapshot with the specified identifier.", "optional": true }, { - "name": "snapshot_copies_name", + "name": "tag", "type": "TypeString", - "description": "Filters the collection to snapshots with copies with the exact specified name.", + "description": "Filters the collection to resources with the exact tag value", "optional": true } ], "ibm_is_source_share": [ + { + "name": "share_replica", + "type": "TypeString", + "description": "The replica file share identifier.", + "required": true + }, { "name": "crn", "type": "TypeString", @@ -55332,32 +56100,25 @@ "type": "TypeString", "description": "Name of the share.", "computed": true - }, - { - "name": "share_replica", - "type": "TypeString", - "description": "The replica file share identifier.", - "required": true } ], "ibm_is_ssh_key": [ { - "name": "resource_group", + "name": "fingerprint", "type": "TypeString", - "description": "Resource group ID", - "cloud_data_type": "resource_group", - "optional": true + "description": "The ssh key Fingerprint", + "computed": true }, { - "name": "type", + "name": "public_key", "type": "TypeString", - "description": "The ssh key type", + "description": "SSH Public key data", "computed": true }, { - "name": "length", - "type": "TypeInt", - "description": "The ssh key length", + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", "computed": true }, { @@ -55367,10 +56128,11 @@ "computed": true }, { - "name": "resource_group_name", + "name": "resource_group", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true + "description": "Resource group ID", + "cloud_data_type": "resource_group", + "optional": true }, { "name": "name", @@ -55379,27 +56141,36 @@ "required": true }, { - "name": "fingerprint", + "name": "type", "type": "TypeString", - "description": "The ssh key Fingerprint", + "description": "The ssh key type", "computed": true }, { - "name": "public_key", + "name": "resource_group_name", "type": "TypeString", - "description": "SSH Public key data", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "length", + "type": "TypeInt", + "description": "The ssh key length", "computed": true }, { - "name": "resource_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The name of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -55408,15 +56179,6 @@ "description": "The crn of the resource", "cloud_data_type": "crn", "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_is_ssh_keys": [ @@ -55529,46 +56291,77 @@ } }, { - "name": "network_acl", - "type": "TypeString", - "computed": true - }, - { - "name": "identifier", + "name": "status", "type": "TypeString", - "optional": true - }, - { - "name": "available_ipv4_address_count", - "type": "TypeInt", "computed": true }, { - "name": "crn", + "name": "zone", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", "computed": true }, { - "name": "public_gateway", + "name": "resource_controller_url", "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "vpc", + "name": "resource_name", "type": "TypeString", + "description": "The name of the resource", "computed": true }, { - "name": "zone", - "type": "TypeString", - "computed": true + "name": "routing_table", + "type": "TypeList", + "description": "The routing table for this subnet", + "computed": true, + "elem": { + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this routing table.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this routing table.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this routing table.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } }, { - "name": "ipv4_cidr_block", + "name": "identifier", "type": "TypeString", - "computed": true + "optional": true }, { "name": "total_ipv4_address_count", @@ -55576,46 +56369,39 @@ "computed": true }, { - "name": "vpc_name", + "name": "network_acl", "type": "TypeString", "computed": true }, { - "name": "resource_controller_url", + "name": "ipv4_cidr_block", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", + "name": "available_ipv4_address_count", + "type": "TypeInt", "computed": true }, { - "name": "resource_group_name", + "name": "crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "name", + "name": "public_gateway", "type": "TypeString", - "optional": true, "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "vpc", + "type": "TypeString", + "computed": true }, { - "name": "status", + "name": "vpc_name", "type": "TypeString", "computed": true }, @@ -55632,77 +56418,47 @@ "computed": true }, { - "name": "resource_status", + "name": "name", "type": "TypeString", - "description": "The status of the resource", + "optional": true, "computed": true }, { - "name": "routing_table", - "type": "TypeList", - "description": "The routing table for this subnet", + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "cloud_data_type": "tags", "computed": true, "elem": { - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this routing table.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this routing table.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this routing table.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } + "type": "TypeString" } - } - ], - "ibm_is_subnet_reserved_ip": [ + }, { - "name": "name", + "name": "resource_status", "type": "TypeString", - "description": "The user-defined or system-provided name for this reserved IP.", + "description": "The status of the resource", "computed": true }, { - "name": "resource_type", + "name": "resource_group_name", "type": "TypeString", - "description": "The resource type.", + "description": "The resource group name in which resource is provisioned", "computed": true - }, + } + ], + "ibm_is_subnet_reserved_ip": [ { "name": "target", "type": "TypeString", "description": "Reserved IP target id.", "computed": true }, + { + "name": "target_crn", + "type": "TypeString", + "description": "The crn for target.", + "computed": true + }, { "name": "reserved_ip", "type": "TypeString", @@ -55710,9 +56466,9 @@ "required": true }, { - "name": "lifecycle_state", + "name": "address", "type": "TypeString", - "description": "The lifecycle state of the reserved IP", + "description": "The IP address", "computed": true }, { @@ -55722,15 +56478,15 @@ "computed": true }, { - "name": "created_at", + "name": "name", "type": "TypeString", - "description": "The date and time that the reserved IP was created.", + "description": "The user-defined or system-provided name for this reserved IP.", "computed": true }, { - "name": "href", + "name": "owner", "type": "TypeString", - "description": "The URL for this reserved IP.", + "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", "computed": true }, { @@ -55740,21 +56496,27 @@ "required": true }, { - "name": "address", + "name": "lifecycle_state", "type": "TypeString", - "description": "The IP address", + "description": "The lifecycle state of the reserved IP", "computed": true }, { - "name": "owner", + "name": "created_at", "type": "TypeString", - "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", + "description": "The date and time that the reserved IP was created.", "computed": true }, { - "name": "target_crn", + "name": "href", "type": "TypeString", - "description": "The crn for target.", + "description": "The URL for this reserved IP.", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } ], @@ -55983,73 +56745,27 @@ ], "ibm_is_virtual_endpoint_gateway": [ { - "name": "ips", - "type": "TypeList", - "description": "Endpoint gateway IPs", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "Endpoint gateway IP Address", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The IPs id", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The IPs name", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "Endpoint gateway IP resource type", - "computed": true - } - } - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "name", + "name": "lifecycle_state", "type": "TypeString", - "description": "Endpoint gateway name", - "required": true + "description": "Endpoint gateway lifecycle state", + "computed": true }, { - "name": "health_state", + "name": "vpc", "type": "TypeString", - "description": "Endpoint gateway health state", + "description": "The VPC id", "computed": true }, { - "name": "security_groups", + "name": "tags", "type": "TypeSet", - "description": "Endpoint gateway securitygroups list", + "description": "List of tags for VPE", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "vpc", - "type": "TypeString", - "description": "The VPC id", - "computed": true - }, { "name": "created_at", "type": "TypeString", @@ -56057,29 +56773,28 @@ "computed": true }, { - "name": "crn", + "name": "health_state", "type": "TypeString", - "description": "The CRN for this Endpoint gateway", - "cloud_data_type": "crn", + "description": "Endpoint gateway health state", "computed": true }, { - "name": "resource_group", - "type": "TypeString", - "description": "The resource group id", - "cloud_data_type": "resource_group", + "name": "allow_dns_resolution_binding", + "type": "TypeBool", + "description": "Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.", "computed": true }, { - "name": "resource_type", + "name": "name", "type": "TypeString", - "description": "Endpoint gateway resource type", - "computed": true + "description": "Endpoint gateway name", + "required": true }, { - "name": "lifecycle_state", + "name": "resource_group", "type": "TypeString", - "description": "Endpoint gateway lifecycle state", + "description": "The resource group id", + "cloud_data_type": "resource_group", "computed": true }, { @@ -56103,23 +56818,76 @@ } }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags for VPE", - "cloud_data_type": "tags", + "name": "service_endpoints", + "type": "TypeList", + "description": "The fully qualified domain names for the target service. A fully qualified domain name for the target service", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "service_endpoints", + "name": "ips", "type": "TypeList", - "description": "The fully qualified domain names for the target service. A fully qualified domain name for the target service", + "description": "Endpoint gateway IPs", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "Endpoint gateway IP Address", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The IPs id", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The IPs name", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "Endpoint gateway IP resource type", + "computed": true + } + } + }, + { + "name": "security_groups", + "type": "TypeSet", + "description": "Endpoint gateway securitygroups list", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", "computed": true, "elem": { "type": "TypeString" } + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "Endpoint gateway resource type", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this Endpoint gateway", + "cloud_data_type": "crn", + "computed": true } ], "ibm_is_virtual_endpoint_gateway_ips": [ @@ -56226,6 +56994,12 @@ "type": "TypeString" } }, + "allow_dns_resolution_binding": { + "name": "allow_dns_resolution_binding", + "type": "TypeBool", + "description": "Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.", + "computed": true + }, "created_at": { "name": "created_at", "type": "TypeString", @@ -56364,33 +57138,21 @@ ], "ibm_is_virtual_network_interface": [ { - "name": "virtual_network_interface", - "type": "TypeString", - "description": "The network interface identifier.", - "required": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this virtual network interface.", - "computed": true - }, - { - "name": "lifecycle_state", + "name": "name", "type": "TypeString", - "description": "The lifecycle state of the virtual network interface.", + "description": "The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC.", "computed": true }, { - "name": "security_groups", + "name": "primary_ip", "type": "TypeList", - "description": "The security groups for this virtual network interface.", + "description": "The reserved IP for this virtual network interface.May be absent when `lifecycle_state` is `pending`.", "computed": true, "elem": { - "crn": { - "name": "crn", + "address": { + "name": "address", "type": "TypeString", - "description": "The security group's CRN.", + "description": "The IP address.If the address has not yet been selected, the value will be `0.0.0.0`.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", "computed": true }, "deleted": { @@ -56410,33 +57172,39 @@ "href": { "name": "href", "type": "TypeString", - "description": "The security group's canonical URL.", + "description": "The URL for this reserved IP.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this security group.", + "description": "The unique identifier for this reserved IP.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name for this security group. The name is unique across all security groups for the VPC.", + "description": "The name for this reserved IP. The name is unique across all reserved IPs in a subnet.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } } }, { - "name": "subnet", + "name": "security_groups", "type": "TypeList", - "description": "The associated subnet.", + "description": "The security groups for this virtual network interface.", "computed": true, "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The CRN for this subnet.", + "description": "The security group's CRN.", "computed": true }, "deleted": { @@ -56456,33 +57224,47 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this subnet.", + "description": "The security group's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this subnet.", + "description": "The unique identifier for this security group.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name for this subnet. The name is unique across all subnets in the VPC.", + "description": "The name for this security group. The name is unique across all security groups for the VPC.", + "computed": true + } + } + }, + { + "name": "zone", + "type": "TypeList", + "description": "The zone this virtual network interface resides in.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this zone.", "computed": true }, - "resource_type": { - "name": "resource_type", + "name": { + "name": "name", "type": "TypeString", - "description": "The resource type.", + "description": "The globally unique name for this zone.", "computed": true } } }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "Indicates whether this virtual network interface will be automatically deleted when`target` is deleted.", + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the virtual network interface was created.", "computed": true }, { @@ -56519,43 +57301,23 @@ "computed": true }, { - "name": "zone", - "type": "TypeList", - "description": "The zone this virtual network interface resides in.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this zone.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this zone.", - "computed": true - } - } + "name": "auto_delete", + "type": "TypeBool", + "description": "Indicates whether this virtual network interface will be automatically deleted when`target` is deleted.", + "computed": true }, { - "name": "created_at", + "name": "lifecycle_state", "type": "TypeString", - "description": "The date and time that the virtual network interface was created.", + "description": "The lifecycle state of the virtual network interface.", "computed": true }, { - "name": "primary_ip", + "name": "target", "type": "TypeList", - "description": "The reserved IP for this virtual network interface.May be absent when `lifecycle_state` is `pending`.", + "description": "The target of this virtual network interface.If absent, this virtual network interface is not attached to a target.", "computed": true, "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address.If the address has not yet been selected, the value will be `0.0.0.0`.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", - "computed": true - }, "deleted": { "name": "deleted", "type": "TypeList", @@ -56573,19 +57335,19 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this reserved IP.", + "description": "The URL for this share mount target.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this reserved IP.", + "description": "The unique identifier for this share mount target.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name for this reserved IP. The name is unique across all reserved IPs in a subnet.", + "description": "The name for this share mount target. The name is unique across all targets for the file share.", "computed": true }, "resource_type": { @@ -56648,6 +57410,12 @@ } } }, + { + "name": "virtual_network_interface", + "type": "TypeString", + "description": "The network interface identifier.", + "required": true + }, { "name": "crn", "type": "TypeString", @@ -56656,17 +57424,23 @@ "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC.", + "description": "The URL for this virtual network interface.", "computed": true }, { - "name": "target", + "name": "subnet", "type": "TypeList", - "description": "The target of this virtual network interface.If absent, this virtual network interface is not attached to a target.", + "description": "The associated subnet.", "computed": true, "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this subnet.", + "computed": true + }, "deleted": { "name": "deleted", "type": "TypeList", @@ -56684,19 +57458,19 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this share mount target.", + "description": "The URL for this subnet.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this share mount target.", + "description": "The unique identifier for this subnet.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name for this share mount target. The name is unique across all targets for the file share.", + "description": "The name for this subnet. The name is unique across all subnets in the VPC.", "computed": true }, "resource_type": { @@ -57062,9 +57836,52 @@ ], "ibm_is_volume": [ { - "name": "resource_group_name", + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + { + "name": "resource_crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "Volume encryption key info", + "computed": true + }, + { + "name": "encryption_type", + "type": "TypeString", + "description": "Volume encryption type info", + "computed": true + }, + { + "name": "busy", + "type": "TypeBool", + "description": "Indicates whether this volume is performing an operation that must be serialized. If an operation specifies that it requires serialization, the operation will fail unless this property is `false`.", "computed": true }, { @@ -57124,89 +57941,63 @@ } }, { - "name": "profile", + "name": "resource_group", "type": "TypeString", - "description": "Volume profile name", + "description": "Resource group name", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "health_reasons", - "type": "TypeList", + "name": "tags", + "type": "TypeSet", + "description": "Tags for the volume instance", + "cloud_data_type": "tags", "computed": true, "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the reason for this health state.", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the reason for this health state.", - "computed": true - }, - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about the reason for this health state.", - "computed": true - } + "type": "TypeString" } }, { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "source_snapshot", + "name": "resource_controller_url", "type": "TypeString", - "description": "Identifier of the snapshot from which this volume was cloned", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_name", + "name": "name", "type": "TypeString", - "description": "The name of the resource", - "computed": true + "description": "Volume name", + "required": true }, { - "name": "attachment_state", - "type": "TypeString", - "description": "The attachment state of the volume.", + "name": "active", + "type": "TypeBool", + "description": "Indicates whether a running virtual server instance has an attachment to this volume.", "computed": true }, { - "name": "created_at", + "name": "resource_status", "type": "TypeString", - "description": "The date and time that the volume was created.", + "description": "The status of the resource", "computed": true }, { - "name": "encryption_key", - "type": "TypeString", - "description": "Volume encryption key info", + "name": "bandwidth", + "type": "TypeInt", + "description": "The maximum bandwidth (in megabits per second) for the volume", "computed": true }, { - "name": "health_state", + "name": "crn", "type": "TypeString", - "description": "The health of this resource.", - "computed": true - }, - { - "name": "bandwidth", - "type": "TypeInt", - "description": "The maximum bandwidth (in megabits per second) for the volume", + "description": "CRN value for the volume instance", + "cloud_data_type": "crn", "computed": true }, { - "name": "resource_group", + "name": "status", "type": "TypeString", - "description": "Resource group name", - "cloud_data_type": "resource_group", + "description": "Volume status", "computed": true }, { @@ -57219,22 +58010,15 @@ } }, { - "name": "resource_controller_url", + "name": "source_snapshot", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "Identifier of the snapshot from which this volume was cloned", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Volume name", - "required": true - }, - { - "name": "zone", + "name": "resource_group_name", "type": "TypeString", - "description": "Zone name", - "optional": true, + "description": "The resource group name in which resource is provisioned", "computed": true }, { @@ -57243,16 +58027,6 @@ "description": "Vloume capacity value", "computed": true }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the volume instance", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "iops", "type": "TypeInt", @@ -57260,21 +58034,34 @@ "computed": true }, { - "name": "resource_status", + "name": "created_at", "type": "TypeString", - "description": "The status of the resource", + "description": "The date and time that the volume was created.", "computed": true }, { - "name": "busy", - "type": "TypeBool", - "description": "Indicates whether this volume is performing an operation that must be serialized. If an operation specifies that it requires serialization, the operation will fail unless this property is `false`.", + "name": "profile", + "type": "TypeString", + "description": "Volume profile name", "computed": true }, { - "name": "status", + "name": "health_state", "type": "TypeString", - "description": "Volume status", + "description": "The health of this resource.", + "computed": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "optional": true, + "computed": true + }, + { + "name": "attachment_state", + "type": "TypeString", + "description": "The attachment state of the volume.", "computed": true }, { @@ -57303,22 +58090,9 @@ } }, { - "name": "active", - "type": "TypeBool", - "description": "Indicates whether a running virtual server instance has an attachment to this volume.", - "computed": true - }, - { - "name": "encryption_type", - "type": "TypeString", - "description": "Volume encryption type info", - "computed": true - }, - { - "name": "crn", + "name": "resource_name", "type": "TypeString", - "description": "CRN value for the volume instance", - "cloud_data_type": "crn", + "description": "The name of the resource", "computed": true } ], @@ -57357,24 +58131,6 @@ } ], "ibm_is_volumes": [ - { - "name": "operating_system_architecture", - "type": "TypeString", - "description": "Operating system architecture of the Volume.", - "optional": true - }, - { - "name": "volume_name", - "type": "TypeString", - "description": "Volume name identifier.", - "optional": true - }, - { - "name": "zone_name", - "type": "TypeString", - "description": "Zone name identifier.", - "optional": true - }, { "name": "volumes", "type": "TypeList", @@ -57899,6 +58655,24 @@ "type": "TypeString", "description": "Operating system family of the Volume.", "optional": true + }, + { + "name": "operating_system_architecture", + "type": "TypeString", + "description": "Operating system architecture of the Volume.", + "optional": true + }, + { + "name": "volume_name", + "type": "TypeString", + "description": "Volume name identifier.", + "optional": true + }, + { + "name": "zone_name", + "type": "TypeString", + "description": "Zone name identifier.", + "optional": true } ], "ibm_is_vpc": [ @@ -57914,10 +58688,13 @@ ] }, { - "name": "default_network_acl_crn", - "type": "TypeString", - "description": "Default Network ACL CRN", - "computed": true + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "status", @@ -57925,22 +58702,9 @@ "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "resource_group_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -57963,49 +58727,247 @@ } }, { - "name": "default_routing_table", - "type": "TypeString", - "description": "Default routing table associated with VPC", - "computed": true + "name": "dns", + "type": "TypeList", + "description": "The DNS configuration for this VPC.", + "computed": true, + "elem": { + "enable_hub": { + "name": "enable_hub", + "type": "TypeBool", + "description": "Indicates whether this VPC is enabled as a DNS name resolution hub.", + "computed": true + }, + "resolution_binding_count": { + "name": "resolution_binding_count", + "type": "TypeInt", + "description": "The number of DNS resolution bindings for this VPC.", + "computed": true + }, + "resolver": { + "name": "resolver", + "type": "TypeList", + "description": "The DNS resolver configuration for the VPC.", + "computed": true, + "elem": { + "configuration": { + "name": "configuration", + "type": "TypeString", + "description": "The configuration of the system DNS resolver for this VPC.- `custom_resolver`: A custom DNS resolver is configured for this VPC.- `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when the VPC has either or both of the following: - at least one endpoint gateway residing in it - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it- `default`: The provider default DNS resolvers are configured for this VPC. This system DNS resolver configuration is used when the VPC has: - no custom DNS resolver configured for it, and - no endpoint gateways residing in it, and - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it.", + "computed": true + }, + "manual_servers": { + "name": "manual_servers", + "type": "TypeList", + "description": "The manually specified DNS servers for this VPC.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "The name of the zone. If present, DHCP configuration for this zone will have this DNS server listed first.", + "computed": true + } + } + }, + "servers": { + "name": "servers", + "type": "TypeList", + "description": "The DNS servers for this VPC. The servers are populated:- by the system when `dns.resolver.type` is `system`- using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated`- using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "Zone name, if present, DHCP configuration for this zone will have this DNS server listed first.", + "computed": true + } + } + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of the DNS resolver used for the VPC.- `delegated`: DNS server addresses are provided by the DNS resolver of the VPC specified in `dns.resolver.vpc`.- `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.- `system`: DNS server addresses are provided by the system.", + "computed": true + }, + "vpc": { + "name": "vpc", + "type": "TypeList", + "description": "The VPC whose DNS resolver provides the DNS server addresses for this VPC.The VPC may be remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this VPC. The name is unique across all VPCs in the region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Region name. If present, this property indicates that the referenced resource is remote to this region, and identifies the native region.", + "computed": true + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + } + } + } + } }, { - "name": "default_security_group_crn", + "name": "name", "type": "TypeString", - "description": "Default security group CRN", - "computed": true + "optional": true }, { - "name": "resource_controller_url", + "name": "default_network_acl_crn", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "Default Network ACL CRN", "computed": true }, { - "name": "identifier", + "name": "default_security_group", "type": "TypeString", - "optional": true + "description": "Security group associated with VPC", + "computed": true }, { - "name": "default_security_group_name", + "name": "resource_status", "type": "TypeString", - "description": "Default security group name", + "description": "The status of the resource", "computed": true }, { - "name": "default_security_group", + "name": "identifier", "type": "TypeString", - "description": "Security group associated with VPC", - "computed": true + "optional": true }, { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", + "name": "subnets", + "type": "TypeList", "computed": true, "elem": { - "type": "TypeString" + "available_ipv4_address_count": { + "name": "available_ipv4_address_count", + "type": "TypeInt", + "description": "Available IPv4 address count in the subnet", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "subnet ID", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "subent name", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "subnet status", + "computed": true + }, + "total_ipv4_address_count": { + "name": "total_ipv4_address_count", + "type": "TypeInt", + "description": "Total IPv4 address count in the subnet", + "computed": true + }, + "zone": { + "name": "zone", + "type": "TypeString", + "description": "subnet location", + "computed": true + } } }, + { + "name": "default_network_acl", + "type": "TypeString", + "computed": true + }, { "name": "classic_access", "type": "TypeBool", @@ -58030,13 +58992,29 @@ "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "default_routing_table", + "type": "TypeString", + "description": "Default routing table associated with VPC", + "computed": true + }, + { + "name": "default_security_group_crn", + "type": "TypeString", + "description": "Default security group CRN", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The crn of the resource", + "cloud_data_type": "crn", + "computed": true }, { "name": "resource_name", @@ -58045,11 +59023,43 @@ "computed": true }, { - "name": "resource_crn", + "name": "default_security_group_name", "type": "TypeString", - "description": "The crn of the resource", + "description": "Default security group name", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true }, + { + "name": "health_reasons", + "type": "TypeList", + "description": "The reasons for the current `health_state` (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, { "name": "security_group", "type": "TypeList", @@ -58127,60 +59137,54 @@ } }, { - "name": "default_network_acl", + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "health_state", "type": "TypeString", + "description": "The health of this resource.- `ok`: No abnormal behavior detected- `degraded`: Experiencing compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + } + ], + "ibm_is_vpc_address_prefix": [ + { + "name": "is_default", + "type": "TypeBool", + "description": "Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.", "computed": true }, { "name": "name", "type": "TypeString", - "optional": true + "description": "The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in.", + "computed": true }, { - "name": "subnets", + "name": "zone", "type": "TypeList", + "description": "The zone this address prefix resides in.", "computed": true, "elem": { - "available_ipv4_address_count": { - "name": "available_ipv4_address_count", - "type": "TypeInt", - "description": "Available IPv4 address count in the subnet", - "computed": true - }, - "id": { - "name": "id", + "href": { + "name": "href", "type": "TypeString", - "description": "subnet ID", + "description": "The URL for this zone.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "subent name", - "computed": true - }, - "status": { - "name": "status", - "type": "TypeString", - "description": "subnet status", - "computed": true - }, - "total_ipv4_address_count": { - "name": "total_ipv4_address_count", - "type": "TypeInt", - "description": "Total IPv4 address count in the subnet", - "computed": true - }, - "zone": { - "name": "zone", - "type": "TypeString", - "description": "subnet location", + "description": "The globally unique name for this zone.", "computed": true } } - } - ], - "ibm_is_vpc_address_prefix": [ + }, { "name": "vpc_name", "type": "TypeString", @@ -58188,16 +59192,16 @@ "optional": true }, { - "name": "address_prefix", + "name": "address_prefix_name", "type": "TypeString", - "description": "The address prefix identifier.", + "description": "The address prefix name.", "optional": true }, { - "name": "address_prefix_name", + "name": "cidr", "type": "TypeString", - "description": "The address prefix name.", - "optional": true + "description": "The CIDR block for this prefix.", + "computed": true }, { "name": "created_at", @@ -58217,38 +59221,6 @@ "description": "The URL for this address prefix.", "computed": true }, - { - "name": "is_default", - "type": "TypeBool", - "description": "Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in.", - "computed": true - }, - { - "name": "zone", - "type": "TypeList", - "description": "The zone this address prefix resides in.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this zone.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this zone.", - "computed": true - } - } - }, { "name": "vpc", "type": "TypeString", @@ -58256,10 +59228,10 @@ "optional": true }, { - "name": "cidr", + "name": "address_prefix", "type": "TypeString", - "description": "The CIDR block for this prefix.", - "computed": true + "description": "The address prefix identifier.", + "optional": true } ], "ibm_is_vpc_address_prefixes": [ @@ -58347,30 +59319,67 @@ } ], "ibm_is_vpc_default_routing_table": [ - { - "name": "href", - "type": "TypeString", - "description": "Default Routing table Href", - "computed": true - }, { "name": "is_default", "type": "TypeBool", "description": "Indicates whether this is the default routing table for this VPC", "computed": true }, + { + "name": "routes", + "type": "TypeList", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Route ID", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Route name", + "computed": true + } + } + }, { "name": "default_routing_table", "type": "TypeString", "description": "Default Routing Table ID", "computed": true }, + { + "name": "route_transit_gateway_ingress", + "type": "TypeBool", + "description": "If set to true, this routing table will be used to route traffic that originates from Transit Gateway to this VPC.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "Default Routing table Href", + "computed": true + }, { "name": "created_at", "type": "TypeString", "description": "Default Routing table Created At", "computed": true }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "Default Routing table Lifecycle State", + "computed": true + }, + { + "name": "route_direct_link_ingress", + "type": "TypeBool", + "description": "If set to true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", + "computed": true + }, { "name": "route_internet_ingress", "type": "TypeBool", @@ -58378,9 +59387,9 @@ "computed": true }, { - "name": "route_transit_gateway_ingress", + "name": "route_vpc_zone_ingress", "type": "TypeBool", - "description": "If set to true, this routing table will be used to route traffic that originates from Transit Gateway to this VPC.", + "description": "If set to true, this routing table will be used to route traffic that originates from subnets in other zones in this VPC.", "computed": true }, { @@ -58390,115 +59399,348 @@ "required": true }, { - "name": "route_vpc_zone_ingress", - "type": "TypeBool", - "description": "If set to true, this routing table will be used to route traffic that originates from subnets in other zones in this VPC.", + "name": "name", + "type": "TypeString", + "description": "Default Routing table Name", "computed": true }, { - "name": "routes", + "name": "resource_type", + "type": "TypeString", + "description": "Default Routing table Resource Type", + "computed": true + }, + { + "name": "subnets", "type": "TypeList", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "Route ID", + "description": "Subnet ID", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Route name", + "description": "Subnet name", "computed": true } } - }, + } + ], + "ibm_is_vpc_dns_resolution_binding": [ { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Default Routing table Name", + "description": "The URL for this DNS resolution binding.", "computed": true }, { - "name": "resource_type", + "name": "lifecycle_state", "type": "TypeString", - "description": "Default Routing table Resource Type", + "description": "The lifecycle state of the DNS resolution binding.", "computed": true }, { - "name": "lifecycle_state", + "name": "vpc", + "type": "TypeList", + "description": "The VPC bound to for DNS resolution.The VPC may be remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this VPC. The name is unique across all VPCs in the region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "vpc_id", "type": "TypeString", - "description": "Default Routing table Lifecycle State", - "computed": true + "description": "The VPC identifier.", + "required": true }, { - "name": "route_direct_link_ingress", - "type": "TypeBool", - "description": "If set to true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", + "name": "identifier", + "type": "TypeString", + "description": "The DNS resolution binding identifier.", + "required": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the DNS resolution binding was created.", "computed": true }, { - "name": "subnets", + "name": "endpoint_gateways", "type": "TypeList", + "description": "The endpoint gateways in the bound to VPC that are allowed to participate in this DNS resolution binding.The endpoint gateways may be remote and therefore may not be directly retrievable.", "computed": true, "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this endpoint gateway.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this endpoint gateway.", + "computed": true + }, "id": { "name": "id", "type": "TypeString", - "description": "Subnet ID", + "description": "The unique identifier for this endpoint gateway.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Subnet name", + "description": "The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } } - } - ], - "ibm_is_vpc_routing_table": [ + }, { "name": "name", "type": "TypeString", - "description": "The user-defined name for this routing table.", - "optional": true - }, - { - "name": "route_direct_link_ingress", - "type": "TypeBool", - "description": "Indicates whether this routing table is used to route traffic that originates from[Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + "description": "The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC.", "computed": true }, { - "name": "route_vpc_zone_ingress", - "type": "TypeBool", - "description": "Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true - }, + } + ], + "ibm_is_vpc_dns_resolution_bindings": [ { - "name": "subnets", + "name": "dns_resolution_bindings", "type": "TypeList", - "description": "The subnets to which this routing table is attached.", + "description": "Collection of VPC Dns Resolution Bindings.", "computed": true, "elem": { - "crn": { - "name": "crn", + "created_at": { + "name": "created_at", "type": "TypeString", - "description": "The CRN for this subnet.", + "description": "The date and time that the DNS resolution binding was created.", "computed": true }, - "deleted": { - "name": "deleted", + "endpoint_gateways": { + "name": "endpoint_gateways", "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "description": "The endpoint gateways in the bound to VPC that are allowed to participate in this DNS resolution binding.The endpoint gateways may be remote and therefore may not be directly retrievable.", "computed": true, "elem": { - "more_info": { - "name": "more_info", + "crn": { + "name": "crn", "type": "TypeString", - "description": "Link to documentation about deleted resources.", + "description": "The CRN for this endpoint gateway.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this endpoint gateway.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this endpoint gateway.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } } @@ -58506,35 +59748,161 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this subnet.", + "description": "The URL for this DNS resolution binding.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this subnet.", + "description": "The DNS resolution binding identifier.", + "computed": true + }, + "lifecycle_state": { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the DNS resolution binding.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this subnet.", + "description": "The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true + }, + "vpc": { + "name": "vpc", + "type": "TypeList", + "description": "The VPC bound to for DNS resolution.The VPC may be remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this VPC. The name is unique across all VPCs in the region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } } } }, { - "name": "created_at", + "name": "vpc_id", "type": "TypeString", - "description": "The date and time that this routing table was created.", + "description": "The VPC identifier.", + "required": true + } + ], + "ibm_is_vpc_routing_table": [ + { + "name": "accept_routes_from", + "type": "TypeList", + "description": "The filters specifying the resources that may create routes in this routing table.At present, only the `resource_type` filter is permitted, and only the `vpn_gateway` value is supported, but filter support is expected to expand in the future.", + "computed": true, + "elem": { + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "is_default", + "type": "TypeBool", + "description": "Indicates whether this is the default routing table for this VPC.", "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "The URL for this routing table.", + "name": "route_internet_ingress", + "type": "TypeBool", + "description": "Indicates whether this routing table is used to route traffic that originates from the internet.Incoming traffic will be routed according to the routing table with two exceptions:- Traffic destined for IP addresses associated with public gateways will not be subject to routes in this routing table.- Routes with an action of deliver are treated as drop unless the `next_hop` is an IP address bound to a network interface on a subnet in the route's `zone`. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", "computed": true }, + { + "name": "routing_table", + "type": "TypeString", + "description": "The routing table identifier.", + "optional": true + }, { "name": "lifecycle_state", "type": "TypeString", @@ -58542,24 +59910,28 @@ "computed": true }, { - "name": "route_internet_ingress", + "name": "route_direct_link_ingress", "type": "TypeBool", - "description": "Indicates whether this routing table is used to route traffic that originates from the internet.Incoming traffic will be routed according to the routing table with two exceptions:- Traffic destined for IP addresses associated with public gateways will not be subject to routes in this routing table.- Routes with an action of deliver are treated as drop unless the `next_hop` is an IP address bound to a network interface on a subnet in the route's `zone`. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + "description": "Indicates whether this routing table is used to route traffic that originates from[Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", "computed": true }, { - "name": "accept_routes_from", - "type": "TypeList", - "description": "The filters specifying the resources that may create routes in this routing table.At present, only the `resource_type` filter is permitted, and only the `vpn_gateway` value is supported, but filter support is expected to expand in the future.", - "computed": true, - "elem": { - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } - } + "name": "route_vpc_zone_ingress", + "type": "TypeBool", + "description": "Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this routing table was created.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this routing table.", + "computed": true }, { "name": "resource_type", @@ -58567,6 +59939,12 @@ "description": "The resource type.", "computed": true }, + { + "name": "route_transit_gateway_ingress", + "type": "TypeBool", + "description": "Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + "computed": true + }, { "name": "routes", "type": "TypeList", @@ -58614,25 +59992,71 @@ "required": true }, { - "name": "routing_table", + "name": "name", "type": "TypeString", - "description": "The routing table identifier.", + "description": "The user-defined name for this routing table.", "optional": true }, { - "name": "is_default", - "type": "TypeBool", - "description": "Indicates whether this is the default routing table for this VPC.", - "computed": true - }, - { - "name": "route_transit_gateway_ingress", - "type": "TypeBool", - "description": "Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", - "computed": true + "name": "subnets", + "type": "TypeList", + "description": "The subnets to which this routing table is attached.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this subnet.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this subnet.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this subnet.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this subnet.", + "computed": true + } + } } ], "ibm_is_vpc_routing_table_route": [ + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this route.", + "optional": true + }, + { + "name": "destination", + "type": "TypeString", + "description": "The destination of the route.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -58640,15 +60064,21 @@ "computed": true }, { - "name": "name", + "name": "routing_table", "type": "TypeString", - "description": "The user-defined name for this route.", + "description": "The routing table identifier.", + "required": true + }, + { + "name": "route_id", + "type": "TypeString", + "description": "The VPC routing table route identifier.", "optional": true }, { - "name": "action", + "name": "lifecycle_state", "type": "TypeString", - "description": "The action to perform with a packet matching the route:- `delegate`: delegate to the system's built-in routes- `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound routes- `deliver`: deliver the packet to the specified `next_hop`- `drop`: drop the packet.", + "description": "The lifecycle state of the route.", "computed": true }, { @@ -58658,15 +60088,21 @@ "required": true }, { - "name": "creator", + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the route was created.", + "computed": true + }, + { + "name": "next_hop", "type": "TypeList", - "description": "If present, the resource that created the route. Routes with this property present cannot bedirectly deleted. All routes with an `origin` of `learned` or `service` will have thisproperty set, and future `origin` values may also have this property set.", + "description": "If `action` is `deliver`, the next hop that packets will be delivered to. Forother `action` values, its `address` will be `0.0.0.0`.", "computed": true, "elem": { - "crn": { - "name": "crn", + "address": { + "name": "address", "type": "TypeString", - "description": "The VPN gateway's CRN.", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", "computed": true }, "deleted": { @@ -58686,19 +60122,19 @@ "href": { "name": "href", "type": "TypeString", - "description": "The VPN gateway's canonical URL.", + "description": "The VPN connection's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this VPN gateway.", + "description": "The unique identifier for this VPN gateway connection.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this VPN gateway.", + "description": "The user-defined name for this VPN connection.", "computed": true }, "resource_type": { @@ -58710,21 +60146,27 @@ } }, { - "name": "lifecycle_state", + "name": "origin", "type": "TypeString", - "description": "The lifecycle state of the route.", + "description": "The origin of this route:- `service`: route was directly created by a service- `user`: route was directly created by a userThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the unexpected property value was encountered.", "computed": true }, { - "name": "next_hop", + "name": "action", + "type": "TypeString", + "description": "The action to perform with a packet matching the route:- `delegate`: delegate to the system's built-in routes- `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound routes- `deliver`: deliver the packet to the specified `next_hop`- `drop`: drop the packet.", + "computed": true + }, + { + "name": "creator", "type": "TypeList", - "description": "If `action` is `deliver`, the next hop that packets will be delivered to. Forother `action` values, its `address` will be `0.0.0.0`.", + "description": "If present, the resource that created the route. Routes with this property present cannot bedirectly deleted. All routes with an `origin` of `learned` or `service` will have thisproperty set, and future `origin` values may also have this property set.", "computed": true, "elem": { - "address": { - "name": "address", + "crn": { + "name": "crn", "type": "TypeString", - "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "description": "The VPN gateway's CRN.", "computed": true }, "deleted": { @@ -58744,19 +60186,19 @@ "href": { "name": "href", "type": "TypeString", - "description": "The VPN connection's canonical URL.", + "description": "The VPN gateway's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this VPN gateway connection.", + "description": "The unique identifier for this VPN gateway.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this VPN connection.", + "description": "The user-defined name for this VPN gateway.", "computed": true }, "resource_type": { @@ -58767,6 +60209,12 @@ } } }, + { + "name": "priority", + "type": "TypeInt", + "description": "The route's priority. Smaller values have higher priority. If a routing table contains routes with the same destination, the route with the highest priority (smallest value) is selected.", + "computed": true + }, { "name": "zone", "type": "TypeList", @@ -58786,42 +60234,6 @@ "computed": true } } - }, - { - "name": "route_id", - "type": "TypeString", - "description": "The VPC routing table route identifier.", - "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the route was created.", - "computed": true - }, - { - "name": "destination", - "type": "TypeString", - "description": "The destination of the route.", - "computed": true - }, - { - "name": "origin", - "type": "TypeString", - "description": "The origin of this route:- `service`: route was directly created by a service- `user`: route was directly created by a userThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the unexpected property value was encountered.", - "computed": true - }, - { - "name": "priority", - "type": "TypeInt", - "description": "The route's priority. Smaller values have higher priority. If a routing table contains routes with the same destination, the route with the highest priority (smallest value) is selected.", - "computed": true - }, - { - "name": "routing_table", - "type": "TypeString", - "description": "The routing table identifier.", - "required": true } ], "ibm_is_vpc_routing_table_routes": [ @@ -59105,6 +60517,19 @@ } ], "ibm_is_vpcs": [ + { + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier of the resource group this vpc belongs to", + "cloud_data_type": "resource_group", + "optional": true + }, + { + "name": "classic_access", + "type": "TypeBool", + "description": "Filters the collection to VPCs with the specified classic_access value", + "optional": true + }, { "name": "vpcs", "type": "TypeList", @@ -59197,6 +60622,204 @@ "description": "Default security group name", "computed": true }, + "dns": { + "name": "dns", + "type": "TypeList", + "description": "The DNS configuration for this VPC.", + "computed": true, + "elem": { + "enable_hub": { + "name": "enable_hub", + "type": "TypeBool", + "description": "Indicates whether this VPC is enabled as a DNS name resolution hub.", + "computed": true + }, + "resolution_binding_count": { + "name": "resolution_binding_count", + "type": "TypeInt", + "description": "The number of DNS resolution bindings for this VPC.", + "computed": true + }, + "resolver": { + "name": "resolver", + "type": "TypeList", + "description": "The DNS resolver configuration for the VPC.", + "computed": true, + "elem": { + "configuration": { + "name": "configuration", + "type": "TypeString", + "description": "The configuration of the system DNS resolver for this VPC.- `custom_resolver`: A custom DNS resolver is configured for this VPC.- `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when the VPC has either or both of the following: - at least one endpoint gateway residing in it - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it- `default`: The provider default DNS resolvers are configured for this VPC. This system DNS resolver configuration is used when the VPC has: - no custom DNS resolver configured for it, and - no endpoint gateways residing in it, and - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it.", + "computed": true + }, + "manual_servers": { + "name": "manual_servers", + "type": "TypeList", + "description": "The manually specified DNS servers for this VPC.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "The name of the zone. If present, DHCP configuration for this zone will have this DNS server listed first.", + "computed": true + } + } + }, + "servers": { + "name": "servers", + "type": "TypeList", + "description": "The DNS servers for this VPC. The servers are populated:- by the system when `dns.resolver.type` is `system`- using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated`- using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "Zone name, if present, DHCP configuration for this zone will have this DNS server listed first.", + "computed": true + } + } + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of the DNS resolver used for the VPC.- `delegated`: DNS server addresses are provided by the DNS resolver of the VPC specified in `dns.resolver.vpc`.- `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.- `system`: DNS server addresses are provided by the system.", + "computed": true + }, + "vpc": { + "name": "vpc", + "type": "TypeList", + "description": "The VPC whose DNS resolver provides the DNS server addresses for this VPC.The VPC may be remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this VPC. The name is unique across all VPCs in the region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Region name. If present, this property indicates that the referenced resource is remote to this region, and identifies the native region.", + "computed": true + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + } + } + } + } + }, + "health_reasons": { + "name": "health_reasons", + "type": "TypeList", + "description": "The reasons for the current `health_state` (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + "health_state": { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: No abnormal behavior detected- `degraded`: Experiencing compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, "id": { "name": "id", "type": "TypeString", @@ -59378,101 +61001,65 @@ } } } - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "The unique identifier of the resource group this vpc belongs to", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "classic_access", - "type": "TypeBool", - "description": "Filters the collection to VPCs with the specified classic_access value", - "optional": true } ], "ibm_is_vpn_gateway": [ { - "name": "href", + "name": "health_state", "type": "TypeString", - "description": "The VPN gateway's canonical URL.", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", "computed": true }, { - "name": "members", + "name": "connections", "type": "TypeList", - "description": "Collection of VPN gateway members.", + "description": "Connections for this VPN gateway.", "computed": true, "elem": { - "private_ip_address": { - "name": "private_ip_address", - "type": "TypeString", - "description": "The private IP address assigned to the VPN gateway member. This property will be present only when the VPN gateway status is`available`.", - "computed": true - }, - "public_ip_address": { - "name": "public_ip_address", - "type": "TypeString", - "description": "The public IP address assigned to the VPN gateway member.", - "computed": true - }, - "role": { - "name": "role", - "type": "TypeString", - "description": "The high availability role assigned to the VPN gateway member.", - "computed": true + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } }, - "status": { - "name": "status", - "type": "TypeString", - "description": "The status of the VPN gateway member.", - "computed": true - } - } - }, - { - "name": "resource_group", - "type": "TypeList", - "description": "The resource group for this VPN gateway.", - "cloud_data_type": "resource_group", - "computed": true, - "elem": { "href": { "name": "href", "type": "TypeString", - "description": "The URL for this resource group.", + "description": "The VPN connection's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this resource group.", + "description": "The unique identifier for this VPN gateway connection.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this resource group.", + "description": "The user-defined name for this VPN connection.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } } }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "The VPN gateway's CRN.", - "cloud_data_type": "crn", + "description": "The user-defined name for this VPN gateway.", "computed": true }, { @@ -59482,53 +61069,52 @@ "computed": true }, { - "name": "vpn_gateway_name", - "type": "TypeString", - "description": "The VPN gateway name.", - "optional": true - }, - { - "name": "connections", + "name": "health_reasons", "type": "TypeList", - "description": "Connections for this VPN gateway.", "computed": true, "elem": { - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true }, - "href": { - "name": "href", + "message": { + "name": "message", "type": "TypeString", - "description": "The VPN connection's canonical URL.", + "description": "An explanation of the reason for this health state.", "computed": true }, - "id": { - "name": "id", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The unique identifier for this VPN gateway connection.", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + { + "name": "lifecycle_reasons", + "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", "computed": true }, - "name": { - "name": "name", + "message": { + "name": "message", "type": "TypeString", - "description": "The user-defined name for this VPN connection.", + "description": "An explanation of the reason for this lifecycle state.", "computed": true }, - "resource_type": { - "name": "resource_type", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The resource type.", + "description": "Link to documentation about the reason for this lifecycle state.", "computed": true } } @@ -59578,6 +61164,99 @@ } } }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "crn", + "type": "TypeString", + "description": "The VPN gateway's CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeList", + "description": "The resource group for this VPN gateway.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this resource group.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this resource group.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this resource group.", + "computed": true + } + } + }, + { + "name": "href", + "type": "TypeString", + "description": "The VPN gateway's canonical URL.", + "computed": true + }, + { + "name": "members", + "type": "TypeList", + "description": "Collection of VPN gateway members.", + "computed": true, + "elem": { + "private_ip_address": { + "name": "private_ip_address", + "type": "TypeString", + "description": "The private IP address assigned to the VPN gateway member. This property will be present only when the VPN gateway status is`available`.", + "computed": true + }, + "public_ip_address": { + "name": "public_ip_address", + "type": "TypeString", + "description": "The public IP address assigned to the VPN gateway member.", + "computed": true + }, + "role": { + "name": "role", + "type": "TypeString", + "description": "The high availability role assigned to the VPN gateway member.", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN gateway member.", + "computed": true + } + } + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN gateway.", + "computed": true + }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the VPN route.", + "computed": true + }, { "name": "vpc", "type": "TypeList", @@ -59624,6 +61303,28 @@ } } }, + { + "name": "tags", + "type": "TypeSet", + "description": "VPN Gateway tags list", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "vpn_gateway_name", + "type": "TypeString", + "description": "The VPN gateway name.", + "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this VPN gateway was created.", + "computed": true + }, { "name": "vpn_gateway", "type": "TypeString", @@ -59631,47 +61332,61 @@ "optional": true }, { - "name": "name", + "name": "mode", "type": "TypeString", - "description": "The user-defined name for this VPN gateway.", + "description": "Route mode VPN gateway.", + "computed": true + } + ], + "ibm_is_vpn_gateway_connection": [ + { + "name": "vpn_gateway_connection", + "type": "TypeString", + "description": "The VPN gateway connection identifier.", + "optional": true + }, + { + "name": "authentication_mode", + "type": "TypeString", + "description": "The authentication mode. Only `psk` is currently supported.", "computed": true }, { - "name": "status", + "name": "name", "type": "TypeString", - "description": "The status of the VPN gateway.", + "description": "The user-defined name for this VPN gateway connection.", "computed": true }, { - "name": "mode", + "name": "psk", "type": "TypeString", - "description": "Route mode VPN gateway.", + "description": "The preshared key.", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "VPN Gateway tags list", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true }, { - "name": "created_at", + "name": "status", "type": "TypeString", - "description": "The date and time that this VPN gateway was created.", + "description": "The status of a VPN gateway connection.", "computed": true - } - ], - "ibm_is_vpn_gateway_connection": [ + }, { - "name": "vpn_gateway_connection", + "name": "vpn_gateway", "type": "TypeString", - "description": "The VPN gateway connection identifier.", + "description": "The VPN gateway identifier.", "optional": true }, + { + "name": "admin_state_up", + "type": "TypeBool", + "description": "If set to false, the VPN gateway connection is shut down.", + "computed": true + }, { "name": "dead_peer_detection", "type": "TypeList", @@ -59699,21 +61414,9 @@ } }, { - "name": "status", - "type": "TypeString", - "description": "The status of a VPN gateway connection.", - "computed": true - }, - { - "name": "vpn_gateway", - "type": "TypeString", - "description": "The VPN gateway identifier.", - "optional": true - }, - { - "name": "mode", + "name": "href", "type": "TypeString", - "description": "The mode of the VPN gateway.", + "description": "The VPN connection's canonical URL.", "computed": true }, { @@ -59722,59 +61425,12 @@ "description": "The IP address of the peer VPN gateway.", "computed": true }, - { - "name": "psk", - "type": "TypeString", - "description": "The preshared key.", - "computed": true - }, - { - "name": "routing_protocol", - "type": "TypeString", - "description": "Routing protocols are disabled for this VPN gateway connection.", - "computed": true - }, - { - "name": "tunnels", - "type": "TypeList", - "description": "The VPN tunnel configuration for this VPN gateway connection (in static route mode).", - "computed": true, - "elem": { - "public_ip_address": { - "name": "public_ip_address", - "type": "TypeString", - "description": "The IP address of the VPN gateway member in which the tunnel resides.", - "computed": true - }, - "status": { - "name": "status", - "type": "TypeString", - "description": "The status of the VPN Tunnel.", - "computed": true - } - } - }, - { - "name": "peer_cidrs", - "type": "TypeList", - "description": "The peer CIDRs for this resource.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "vpn_gateway_connection_name", "type": "TypeString", "description": "The VPN gateway connection name.", "optional": true }, - { - "name": "href", - "type": "TypeString", - "description": "The VPN connection's canonical URL.", - "computed": true - }, { "name": "ike_policy", "type": "TypeList", @@ -59821,12 +61477,6 @@ } } }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this VPN gateway connection was created.", - "computed": true - }, { "name": "ipsec_policy", "type": "TypeList", @@ -59874,21 +61524,41 @@ } }, { - "name": "name", + "name": "mode", "type": "TypeString", - "description": "The user-defined name for this VPN gateway connection.", + "description": "The mode of the VPN gateway.", "computed": true }, { - "name": "resource_type", + "name": "routing_protocol", "type": "TypeString", - "description": "The resource type.", + "description": "Routing protocols are disabled for this VPN gateway connection.", "computed": true }, { - "name": "local_cidrs", + "name": "tunnels", "type": "TypeList", - "description": "The local CIDRs for this resource.", + "description": "The VPN tunnel configuration for this VPN gateway connection (in static route mode).", + "computed": true, + "elem": { + "public_ip_address": { + "name": "public_ip_address", + "type": "TypeString", + "description": "The IP address of the VPN gateway member in which the tunnel resides.", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN Tunnel.", + "computed": true + } + } + }, + { + "name": "peer_cidrs", + "type": "TypeList", + "description": "The peer CIDRs for this resource.", "computed": true, "elem": { "type": "TypeString" @@ -59901,16 +61571,45 @@ "optional": true }, { - "name": "admin_state_up", - "type": "TypeBool", - "description": "If set to false, the VPN gateway connection is shut down.", + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this VPN gateway connection was created.", "computed": true }, { - "name": "authentication_mode", - "type": "TypeString", - "description": "The authentication mode. Only `psk` is currently supported.", - "computed": true + "name": "status_reasons", + "type": "TypeList", + "description": "The reasons for the current status (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", + "computed": true + } + } + }, + { + "name": "local_cidrs", + "type": "TypeList", + "description": "The local CIDRs for this resource.", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_is_vpn_gateway_connections": [ @@ -60028,6 +61727,32 @@ "description": "VPN gateway connection status", "computed": true }, + "status_reasons": { + "name": "status_reasons", + "type": "TypeList", + "description": "The reasons for the current status (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", + "computed": true + } + } + }, "timeout": { "name": "timeout", "type": "TypeInt", @@ -60099,6 +61824,69 @@ "description": "The VPN gateway's CRN", "computed": true }, + "health_reasons": { + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + "health_state": { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, + "lifecycle_reasons": { + "name": "lifecycle_reasons", + "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } + } + }, + "lifecycle_state": { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the VPN route.", + "computed": true + }, "members": { "name": "members", "type": "TypeList", @@ -60227,15 +62015,15 @@ ], "ibm_is_vpn_server": [ { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the VPN server was created.", + "name": "client_auto_delete", + "type": "TypeBool", + "description": "If set to `true`, disconnected VPN clients will be automatically deleted after the `client_auto_delete_timeout` time has passed.", "computed": true }, { - "name": "health_state", - "type": "TypeString", - "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "name": "client_auto_delete_timeout", + "type": "TypeInt", + "description": "Hours after which disconnected VPN clients will be automatically deleted. If `0`, disconnected VPN clients will be deleted immediately.", "computed": true }, { @@ -60245,15 +62033,50 @@ "computed": true }, { - "name": "private_ips", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this VPN server", + "optional": true, + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPN server.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "enable_split_tunneling", + "type": "TypeBool", + "description": "Indicates whether the split tunneling is enabled on this VPN server.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPN server.", + "computed": true + }, + { + "name": "security_groups", "type": "TypeList", - "description": "The reserved IPs bound to this VPN server.", + "description": "The security groups targeting this VPN server.", "computed": true, "elem": { - "address": { - "name": "address", + "crn": { + "name": "crn", "type": "TypeString", - "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "description": "The security group's CRN.", "computed": true }, "deleted": { @@ -60273,39 +62096,33 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this reserved IP.", + "description": "The security group's canonical URL.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this reserved IP.", + "description": "The unique identifier for this security group.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined or system-provided name for this reserved IP.", - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", + "description": "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", "computed": true } } }, { - "name": "vpc", + "name": "subnets", "type": "TypeList", - "description": "The VPC this VPN server resides in.", + "description": "The subnets this VPN server is part of.", "computed": true, "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The CRN for this VPC.", + "description": "The CRN for this subnet.", "computed": true }, "deleted": { @@ -60325,104 +62142,65 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this VPC.", + "description": "The URL for this subnet.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this VPC.", + "description": "The unique identifier for this subnet.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The unique user-defined name for this VPC.", + "description": "The user-defined name for this subnet.", "computed": true - } - } - }, - { - "name": "client_dns_server_ips", - "type": "TypeList", - "description": "The DNS server addresses that will be provided to VPN clients that are connected to this VPN server.", - "computed": true, - "elem": { - "address": { - "name": "address", + }, + "resource_type": { + "name": "resource_type", "type": "TypeString", - "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "description": "The resource type.", "computed": true } } }, { - "name": "certificate", + "name": "lifecycle_reasons", "type": "TypeList", - "description": "The certificate instance for this VPN server.", + "description": "The reasons for the current lifecycle_state (if any).", "computed": true, "elem": { - "crn": { - "name": "crn", + "code": { + "name": "code", "type": "TypeString", - "description": "The CRN for this certificate instance.", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", "computed": true } } }, { - "name": "client_idle_timeout", - "type": "TypeInt", - "description": "The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not disconnect idle clients.", - "computed": true - }, - { - "name": "client_ip_pool", - "type": "TypeString", - "description": "The VPN client IPv4 address pool, expressed in CIDR format.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this VPN server.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "enable_split_tunneling", - "type": "TypeBool", - "description": "Indicates whether the split tunneling is enabled on this VPN server.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this VPN server.", - "computed": true - }, - { - "name": "protocol", - "type": "TypeString", - "description": "The transport protocol used by this VPN server.", - "computed": true - }, - { - "name": "identifier", - "type": "TypeString", - "description": "The unique identifier for this VPN server", - "optional": true - }, - { - "name": "subnets", + "name": "private_ips", "type": "TypeList", - "description": "The subnets this VPN server is part of.", + "description": "The reserved IPs bound to this VPN server.", "computed": true, "elem": { - "crn": { - "name": "crn", + "address": { + "name": "address", "type": "TypeString", - "description": "The CRN for this subnet.", + "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", "computed": true }, "deleted": { @@ -60442,19 +62220,19 @@ "href": { "name": "href", "type": "TypeString", - "description": "The URL for this subnet.", + "description": "The URL for this reserved IP.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this subnet.", + "description": "The unique identifier for this reserved IP.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this subnet.", + "description": "The user-defined or system-provided name for this reserved IP.", "computed": true }, "resource_type": { @@ -60466,10 +62244,18 @@ } }, { - "name": "resource_type", - "type": "TypeString", - "description": "The type of resource referenced.", - "computed": true + "name": "certificate", + "type": "TypeList", + "description": "The certificate instance for this VPN server.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this certificate instance.", + "computed": true + } + } }, { "name": "client_authentication", @@ -60498,46 +62284,48 @@ } }, { - "name": "client_auto_delete", - "type": "TypeBool", - "description": "If set to `true`, disconnected VPN clients will be automatically deleted after the `client_auto_delete_timeout` time has passed.", - "computed": true - }, - { - "name": "client_auto_delete_timeout", - "type": "TypeInt", - "description": "Hours after which disconnected VPN clients will be automatically deleted. If `0`, disconnected VPN clients will be deleted immediately.", - "computed": true - }, - { - "name": "hostname", - "type": "TypeString", - "description": "Fully qualified domain name assigned to this VPN server.", - "computed": true - }, - { - "name": "port", + "name": "client_idle_timeout", "type": "TypeInt", - "description": "The port number used by this VPN server.", + "description": "The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not disconnect idle clients.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this VPN server", - "optional": true, - "computed": true + "name": "resource_group", + "type": "TypeList", + "description": "The resource group for this VPN server.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this resource group.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this resource group.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this resource group.", + "computed": true + } + } }, { - "name": "security_groups", + "name": "vpc", "type": "TypeList", - "description": "The security groups targeting this VPN server.", + "description": "The VPC this VPN server resides in.", "computed": true, "elem": { "crn": { "name": "crn", "type": "TypeString", - "description": "The security group's CRN.", + "description": "The CRN for this VPC.", "computed": true }, "deleted": { @@ -60557,78 +62345,137 @@ "href": { "name": "href", "type": "TypeString", - "description": "The security group's canonical URL.", + "description": "The URL for this VPC.", "computed": true }, "id": { "name": "id", "type": "TypeString", - "description": "The unique identifier for this security group.", + "description": "The unique identifier for this VPC.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + "description": "The unique user-defined name for this VPC.", "computed": true } } }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access tags", + "name": "client_dns_server_ips", + "type": "TypeList", + "description": "The DNS server addresses that will be provided to VPN clients that are connected to this VPN server.", "computed": true, "elem": { - "type": "TypeString" + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + } } }, { - "name": "resource_group", + "name": "protocol", + "type": "TypeString", + "description": "The transport protocol used by this VPN server.", + "computed": true + }, + { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, + { + "name": "hostname", + "type": "TypeString", + "description": "Fully qualified domain name assigned to this VPN server.", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The type of resource referenced.", + "computed": true + }, + { + "name": "identifier", + "type": "TypeString", + "description": "The unique identifier for this VPN server", + "optional": true + }, + { + "name": "client_ip_pool", + "type": "TypeString", + "description": "The VPN client IPv4 address pool, expressed in CIDR format.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the VPN server was created.", + "computed": true + }, + { + "name": "health_reasons", "type": "TypeList", - "description": "The resource group for this VPN server.", - "cloud_data_type": "resource_group", "computed": true, "elem": { - "href": { - "name": "href", + "code": { + "name": "code", "type": "TypeString", - "description": "The URL for this resource group.", + "description": "A snake case string succinctly identifying the reason for this health state.", "computed": true }, - "id": { - "name": "id", + "message": { + "name": "message", "type": "TypeString", - "description": "The unique identifier for this resource group.", + "description": "An explanation of the reason for this health state.", "computed": true }, - "name": { - "name": "name", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The user-defined name for this resource group.", + "description": "Link to documentation about the reason for this health state.", "computed": true } } + }, + { + "name": "port", + "type": "TypeInt", + "description": "The port number used by this VPN server.", + "computed": true } ], "ibm_is_vpn_server_client": [ { - "name": "vpn_server", + "name": "common_name", "type": "TypeString", - "description": "The VPN server identifier.", - "required": true + "description": "The common name of client certificate that the VPN client provided when connecting to the server.This property will be present only when the `certificate` client authentication method is enabled on the VPN server.", + "computed": true }, { - "name": "identifier", + "name": "created_at", "type": "TypeString", - "description": "The VPN client identifier.", - "required": true + "description": "The date and time that the VPN client was created.", + "computed": true }, { - "name": "common_name", - "type": "TypeString", - "description": "The common name of client certificate that the VPN client provided when connecting to the server.This property will be present only when the `certificate` client authentication method is enabled on the VPN server.", - "computed": true + "name": "remote_ip", + "type": "TypeList", + "description": "The remote IP address of this VPN client.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + } + } }, { "name": "remote_port", @@ -60637,22 +62484,22 @@ "computed": true }, { - "name": "username", + "name": "resource_type", "type": "TypeString", - "description": "The username that this VPN client provided when connecting to the VPN server.This property will be present only when the`username` client authentication method is enabled on the VPN server.", + "description": "The resource type.", "computed": true }, { - "name": "resource_type", + "name": "username", "type": "TypeString", - "description": "The resource type.", + "description": "The username that this VPN client provided when connecting to the VPN server.This property will be present only when the`username` client authentication method is enabled on the VPN server.", "computed": true }, { - "name": "status", + "name": "identifier", "type": "TypeString", - "description": "The status of the VPN client:- `connected`: the VPN client is `connected` to this VPN server.- `disconnected`: the VPN client is `disconnected` from this VPN server.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the unexpected property value was encountered.", - "computed": true + "description": "The VPN client identifier.", + "required": true }, { "name": "client_ip", @@ -60669,45 +62516,31 @@ } }, { - "name": "created_at", + "name": "href", "type": "TypeString", - "description": "The date and time that the VPN client was created.", + "description": "The URL for this VPN client.", "computed": true }, { - "name": "disconnected_at", + "name": "status", "type": "TypeString", - "description": "The date and time that the VPN client was disconnected.", + "description": "The status of the VPN client:- `connected`: the VPN client is `connected` to this VPN server.- `disconnected`: the VPN client is `disconnected` from this VPN server.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the unexpected property value was encountered.", "computed": true }, { - "name": "href", + "name": "vpn_server", "type": "TypeString", - "description": "The URL for this VPN client.", - "computed": true + "description": "The VPN server identifier.", + "required": true }, { - "name": "remote_ip", - "type": "TypeList", - "description": "The remote IP address of this VPN client.", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", - "computed": true - } - } + "name": "disconnected_at", + "type": "TypeString", + "description": "The date and time that the VPN client was disconnected.", + "computed": true } ], "ibm_is_vpn_server_client_configuration": [ - { - "name": "vpn_server_client_configuration", - "type": "TypeString", - "description": "The VPN client configuration.", - "computed": true - }, { "name": "vpn_server", "type": "TypeString", @@ -60721,15 +62554,15 @@ "description": "The File Path to store configuration.", "immutable": true, "optional": true + }, + { + "name": "vpn_server_client_configuration", + "type": "TypeString", + "description": "The VPN client configuration.", + "computed": true } ], "ibm_is_vpn_server_clients": [ - { - "name": "vpn_server", - "type": "TypeString", - "description": "The VPN server identifier.", - "required": true - }, { "name": "clients", "type": "TypeList", @@ -60819,45 +62652,26 @@ "computed": true } } - } - ], - "ibm_is_vpn_server_route": [ - { - "name": "identifier", - "type": "TypeString", - "description": "The unique identifier for this VPN server route", - "optional": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the VPN route.", - "computed": true }, { "name": "vpn_server", "type": "TypeString", "description": "The VPN server identifier.", "required": true - }, + } + ], + "ibm_is_vpn_server_route": [ { - "name": "name", + "name": "resource_type", "type": "TypeString", - "description": "The unique user-defined name for this VPN server route", - "optional": true, + "description": "The resource type.", "computed": true }, { - "name": "action", + "name": "identifier", "type": "TypeString", - "description": "The action to perform with a packet matching the VPN route:- `translate`: translate the source IP address to one of the private IP addresses of the VPN server.- `deliver`: deliver the packet into the VPC.- `drop`: drop the packetThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the unexpected property value was encountered.", - "computed": true + "description": "The unique identifier for this VPN server route", + "optional": true }, { "name": "created_at", @@ -60865,30 +62679,112 @@ "description": "The date and time that the VPN route was created.", "computed": true }, - { - "name": "destination", - "type": "TypeString", - "description": "The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will be dropped.", - "computed": true - }, { "name": "href", "type": "TypeString", "description": "The URL for this VPN route.", "computed": true - } - ], - "ibm_is_vpn_server_routes": [ - { - "name": "vpn_server", - "type": "TypeString", - "description": "The VPN server identifier.", - "required": true }, { - "name": "routes", + "name": "lifecycle_reasons", "type": "TypeList", - "description": "Collection of VPN routes.", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } + } + }, + { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, + { + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the VPN route.", + "computed": true + }, + { + "name": "vpn_server", + "type": "TypeString", + "description": "The VPN server identifier.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this VPN server route", + "optional": true, + "computed": true + }, + { + "name": "action", + "type": "TypeString", + "description": "The action to perform with a packet matching the VPN route:- `translate`: translate the source IP address to one of the private IP addresses of the VPN server.- `deliver`: deliver the packet into the VPC.- `drop`: drop the packetThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the unexpected property value was encountered.", + "computed": true + }, + { + "name": "destination", + "type": "TypeString", + "description": "The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will be dropped.", + "computed": true + } + ], + "ibm_is_vpn_server_routes": [ + { + "name": "vpn_server", + "type": "TypeString", + "description": "The VPN server identifier.", + "required": true + }, + { + "name": "routes", + "type": "TypeList", + "description": "Collection of VPN routes.", "computed": true, "elem": { "action": { @@ -60909,6 +62805,37 @@ "description": "The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will be dropped.", "computed": true }, + "health_reasons": { + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + "health_state": { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, "href": { "name": "href", "type": "TypeString", @@ -60921,6 +62848,32 @@ "description": "The unique identifier for this VPN route.", "computed": true }, + "lifecycle_reasons": { + "name": "lifecycle_reasons", + "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } + } + }, "lifecycle_state": { "name": "lifecycle_state", "type": "TypeString", @@ -61061,6 +63014,31 @@ "description": "Indicates whether the split tunneling is enabled on this VPN server.", "computed": true }, + "health_reasons": { + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, "health_state": { "name": "health_state", "type": "TypeString", @@ -61085,6 +63063,32 @@ "description": "The unique identifier for this VPN server.", "computed": true }, + "lifecycle_reasons": { + "name": "lifecycle_reasons", + "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } + } + }, "lifecycle_state": { "name": "lifecycle_state", "type": "TypeString", @@ -61341,11 +63345,6 @@ } ], "ibm_is_zone": [ - { - "name": "status", - "type": "TypeString", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -61356,6 +63355,11 @@ "type": "TypeString", "cloud_data_type": "region", "required": true + }, + { + "name": "status", + "type": "TypeString", + "computed": true } ], "ibm_is_zones": [ @@ -61380,6 +63384,44 @@ } ], "ibm_kms_instance_policies": [ + { + "name": "dual_auth_delete", + "type": "TypeList", + "description": "Data associated with the dual auth delete policy for instance", + "computed": true, + "elem": { + "created_by": { + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier for the resource that created the policy.", + "computed": true + }, + "creation_date": { + "name": "creation_date", + "type": "TypeString", + "description": "The date the policy was created. The date format follows RFC 3339.", + "computed": true + }, + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Data associated with enable/disable dual authorization policy for the instance.", + "computed": true + }, + "last_updated": { + "name": "last_updated", + "type": "TypeString", + "description": "Updates when the policy is replaced or modified. The date format follows RFC 3339.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "The unique identifier for the resource that updated the policy.", + "computed": true + } + } + }, { "name": "rotation", "type": "TypeList", @@ -61546,60 +63588,9 @@ "type": "TypeString", "description": "Type of Policy to be Retrieved", "optional": true - }, - { - "name": "dual_auth_delete", - "type": "TypeList", - "description": "Data associated with the dual auth delete policy for instance", - "computed": true, - "elem": { - "created_by": { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier for the resource that created the policy.", - "computed": true - }, - "creation_date": { - "name": "creation_date", - "type": "TypeString", - "description": "The date the policy was created. The date format follows RFC 3339.", - "computed": true - }, - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Data associated with enable/disable dual authorization policy for the instance.", - "computed": true - }, - "last_updated": { - "name": "last_updated", - "type": "TypeString", - "description": "Updates when the policy is replaced or modified. The date format follows RFC 3339.", - "computed": true - }, - "updated_by": { - "name": "updated_by", - "type": "TypeString", - "description": "The unique identifier for the resource that updated the policy.", - "computed": true - } - } } ], "ibm_kms_key": [ - { - "name": "alias", - "type": "TypeString", - "description": "The alias associated with the key", - "optional": true - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private", - "default_value": "public", - "optional": true - }, { "name": "keys", "type": "TypeList", @@ -61770,9 +63761,45 @@ "type": "TypeString", "description": "The name of the key to be fetched", "optional": true + }, + { + "name": "alias", + "type": "TypeString", + "description": "The alias associated with the key", + "optional": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private", + "default_value": "public", + "optional": true } ], "ibm_kms_key_policies": [ + { + "name": "instance_id", + "type": "TypeString", + "description": "Key protect or hpcs instance GUID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:kms|hs-crypto" + ] + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private", + "default_value": "public", + "optional": true + }, + { + "name": "key_id", + "type": "TypeString", + "description": "Key ID of the Key", + "optional": true + }, { "name": "alias", "type": "TypeString", @@ -61892,49 +63919,9 @@ } } } - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "Key protect or hpcs instance GUID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:kms|hs-crypto" - ] - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private", - "default_value": "public", - "optional": true - }, - { - "name": "key_id", - "type": "TypeString", - "description": "Key ID of the Key", - "optional": true } ], "ibm_kms_key_rings": [ - { - "name": "instance_id", - "type": "TypeString", - "description": "Key protect or hpcs instance GUID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:kms|hs-crypto" - ] - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private", - "default_value": "public", - "optional": true - }, { "name": "key_rings", "type": "TypeList", @@ -61957,26 +63944,26 @@ "computed": true } } - } - ], - "ibm_kms_keys": [ - { - "name": "limit", - "type": "TypeInt", - "description": "Limit till the keys to be fetched", - "optional": true }, { - "name": "alias", + "name": "instance_id", "type": "TypeString", - "description": "The name of the key to be fetched", - "optional": true + "description": "Key protect or hpcs instance GUID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:kms|hs-crypto" + ] }, { - "name": "key_id", + "name": "endpoint_type", "type": "TypeString", + "description": "public or private", + "default_value": "public", "optional": true - }, + } + ], + "ibm_kms_keys": [ { "name": "endpoint_type", "type": "TypeString", @@ -62144,6 +64131,23 @@ "type": "TypeString", "description": "The name of the key to be fetched", "optional": true + }, + { + "name": "limit", + "type": "TypeInt", + "description": "Limit till the keys to be fetched", + "optional": true + }, + { + "name": "alias", + "type": "TypeString", + "description": "The name of the key to be fetched", + "optional": true + }, + { + "name": "key_id", + "type": "TypeString", + "optional": true } ], "ibm_kp_key": [ @@ -62192,14 +64196,14 @@ "computed": true }, { - "name": "server_instances_down", + "name": "server_instances_up", "type": "TypeInt", "computed": true }, { - "name": "use_system_public_ip_pool", - "type": "TypeBool", - "computed": true + "name": "name", + "type": "TypeString", + "required": true }, { "name": "description", @@ -62207,69 +64211,59 @@ "computed": true }, { - "name": "datacenter", + "name": "active_connections", + "type": "TypeInt", + "computed": true + }, + { + "name": "ssl_ciphers", + "type": "TypeSet", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "type", "type": "TypeString", "computed": true }, { - "name": "active_connections", - "type": "TypeInt", + "name": "vip", + "type": "TypeString", "computed": true }, { - "name": "health_monitors", + "name": "server_instances", "type": "TypeList", "computed": true, "elem": { - "interval": { - "name": "interval", - "type": "TypeInt", - "computed": true - }, - "max_retries": { - "name": "max_retries", - "type": "TypeInt", - "computed": true - }, - "monitor_id": { - "name": "monitor_id", + "member_id": { + "name": "member_id", "type": "TypeString", "computed": true }, - "port": { - "name": "port", - "type": "TypeInt", + "private_ip_address": { + "name": "private_ip_address", + "type": "TypeString", "computed": true }, - "protocol": { - "name": "protocol", + "status": { + "name": "status", "type": "TypeString", "computed": true }, - "timeout": { - "name": "timeout", + "weight": { + "name": "weight", "type": "TypeInt", "computed": true - }, - "url_path": { - "name": "url_path", - "type": "TypeString", - "computed": true } } }, { - "name": "name", - "type": "TypeString", - "required": true - }, - { - "name": "ssl_ciphers", - "type": "TypeSet", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "server_instances_down", + "type": "TypeInt", + "computed": true }, { "name": "protocols", @@ -62324,45 +64318,55 @@ } }, { - "name": "server_instances", + "name": "health_monitors", "type": "TypeList", "computed": true, "elem": { - "member_id": { - "name": "member_id", - "type": "TypeString", + "interval": { + "name": "interval", + "type": "TypeInt", "computed": true }, - "private_ip_address": { - "name": "private_ip_address", + "max_retries": { + "name": "max_retries", + "type": "TypeInt", + "computed": true + }, + "monitor_id": { + "name": "monitor_id", "type": "TypeString", "computed": true }, - "status": { - "name": "status", + "port": { + "name": "port", + "type": "TypeInt", + "computed": true + }, + "protocol": { + "name": "protocol", "type": "TypeString", "computed": true }, - "weight": { - "name": "weight", + "timeout": { + "name": "timeout", "type": "TypeInt", "computed": true + }, + "url_path": { + "name": "url_path", + "type": "TypeString", + "computed": true } } }, { - "name": "server_instances_up", - "type": "TypeInt", - "computed": true - }, - { - "name": "vip", + "name": "datacenter", "type": "TypeString", "computed": true }, { - "name": "type", - "type": "TypeString", + "name": "use_system_public_ip_pool", + "type": "TypeBool", "computed": true } ], @@ -62515,7 +64519,7 @@ "destination_crn": { "name": "destination_crn", "type": "TypeString", - "description": "The CRN of the destination service instance or resource.", + "description": "The CRN of the destination service instance or resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring\u0026interface=ui#target-monitoring-ui) for details.", "computed": true }, "id": { @@ -62552,40 +64556,6 @@ } ], "ibm_network_vlan": [ - { - "name": "number", - "type": "TypeInt", - "optional": true, - "computed": true - }, - { - "name": "router_hostname", - "type": "TypeString", - "optional": true, - "computed": true - }, - { - "name": "virtual_guests", - "type": "TypeList", - "computed": true, - "elem": { - "domain": { - "name": "domain", - "type": "TypeString", - "computed": true - }, - "hostname": { - "name": "hostname", - "type": "TypeString", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeInt", - "computed": true - } - } - }, { "name": "subnets", "type": "TypeList", @@ -62633,34 +64603,68 @@ "type": "TypeString", "optional": true, "computed": true + }, + { + "name": "number", + "type": "TypeInt", + "optional": true, + "computed": true + }, + { + "name": "router_hostname", + "type": "TypeString", + "optional": true, + "computed": true + }, + { + "name": "virtual_guests", + "type": "TypeList", + "computed": true, + "elem": { + "domain": { + "name": "domain", + "type": "TypeString", + "computed": true + }, + "hostname": { + "name": "hostname", + "type": "TypeString", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeInt", + "computed": true + } + } } ], "ibm_org": [ { - "name": "org", + "name": "name", "type": "TypeString", "description": "Org name, for example myorg@domain", - "optional": true, - "deprecated": "use name instead" + "optional": true }, { - "name": "name", + "name": "org", "type": "TypeString", "description": "Org name, for example myorg@domain", - "optional": true + "optional": true, + "deprecated": "use name instead" } ], "ibm_org_quota": [ { - "name": "trial_db_allowed", - "type": "TypeBool", - "description": "Defines trial db are allowed for organization.", + "name": "memory_limit", + "type": "TypeInt", + "description": "Defines the total memory limit for organization.", "computed": true }, { - "name": "app_instance_limit", + "name": "instance_memory_limit", "type": "TypeInt", - "description": "Defines the total app instance limit for organization.", + "description": "Defines the total instance memory limit for organization.", "computed": true }, { @@ -62670,9 +64674,9 @@ "computed": true }, { - "name": "app_tasks_limit", + "name": "total_service_keys", "type": "TypeInt", - "description": "Defines the total app task limit for organization.", + "description": "Defines the total service keys for organization.", "computed": true }, { @@ -62681,12 +64685,6 @@ "description": "Defines the number of reserved route ports for organization.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "Org quota name, for example qIBM", - "required": true - }, { "name": "total_services", "type": "TypeInt", @@ -62694,34 +64692,40 @@ "computed": true }, { - "name": "memory_limit", - "type": "TypeInt", - "description": "Defines the total memory limit for organization.", + "name": "non_basic_services_allowed", + "type": "TypeBool", + "description": "Define non basic services are allowed for organization.", "computed": true }, { - "name": "total_service_keys", + "name": "total_routes", "type": "TypeInt", - "description": "Defines the total service keys for organization.", + "description": "Defines the total route for organization.", "computed": true }, { - "name": "non_basic_services_allowed", + "name": "trial_db_allowed", "type": "TypeBool", - "description": "Define non basic services are allowed for organization.", + "description": "Defines trial db are allowed for organization.", "computed": true }, { - "name": "total_routes", + "name": "app_instance_limit", "type": "TypeInt", - "description": "Defines the total route for organization.", + "description": "Defines the total app instance limit for organization.", "computed": true }, { - "name": "instance_memory_limit", + "name": "app_tasks_limit", "type": "TypeInt", - "description": "Defines the total instance memory limit for organization.", + "description": "Defines the total app task limit for organization.", "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Org quota name, for example qIBM", + "required": true } ], "ibm_pi_catalog_images": [ @@ -62841,8 +64845,24 @@ "computed": true }, { - "name": "metered", + "name": "networks", + "type": "TypeSet", + "description": "Set of Networks attached to this cloud connection", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "vpc_enabled", "type": "TypeBool", + "description": "Enable VPC for this cloud connection", + "computed": true + }, + { + "name": "classic_enabled", + "type": "TypeBool", + "description": "Enable classic endpoint destination", "computed": true }, { @@ -62852,9 +64872,18 @@ "computed": true }, { - "name": "gre_source_address", + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true + }, + { + "name": "ibm_ip_address", + "type": "TypeString", + "computed": true + }, + { + "name": "port", "type": "TypeString", - "description": "GRE auto-assigned source IP address", "computed": true }, { @@ -62867,8 +64896,9 @@ } }, { - "name": "pi_cloud_instance_id", + "name": "pi_cloud_connection_name", "type": "TypeString", + "description": "Cloud Connection Name to be used", "required": true }, { @@ -62877,29 +64907,18 @@ "computed": true }, { - "name": "ibm_ip_address", - "type": "TypeString", - "computed": true - }, - { - "name": "port", + "name": "gre_source_address", "type": "TypeString", + "description": "GRE auto-assigned source IP address", "computed": true }, { - "name": "pi_cloud_connection_name", - "type": "TypeString", - "description": "Cloud Connection Name to be used", - "required": true - }, - { - "name": "classic_enabled", + "name": "global_routing", "type": "TypeBool", - "description": "Enable classic endpoint destination", "computed": true }, { - "name": "global_routing", + "name": "metered", "type": "TypeBool", "computed": true }, @@ -62907,21 +64926,6 @@ "name": "user_ip_address", "type": "TypeString", "computed": true - }, - { - "name": "networks", - "type": "TypeSet", - "description": "Set of Networks attached to this cloud connection", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "vpc_enabled", - "type": "TypeBool", - "description": "Enable VPC for this cloud connection", - "computed": true } ], "ibm_pi_cloud_connections": [ @@ -63032,6 +65036,47 @@ } ], "ibm_pi_cloud_instance": [ + { + "name": "tenant_id", + "type": "TypeString", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "cloud_data_type": "region", + "computed": true + }, + { + "name": "total_instances", + "type": "TypeFloat", + "computed": true + }, + { + "name": "total_memory_consumed", + "type": "TypeFloat", + "computed": true + }, + { + "name": "total_ssd_storage_consumed", + "type": "TypeFloat", + "computed": true + }, + { + "name": "total_standard_storage_consumed", + "type": "TypeFloat", + "computed": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true + }, + { + "name": "enabled", + "type": "TypeBool", + "computed": true + }, { "name": "pvm_instances", "type": "TypeList", @@ -63069,22 +65114,6 @@ } } }, - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "tenant_id", - "type": "TypeString", - "computed": true - }, - { - "name": "region", - "type": "TypeString", - "cloud_data_type": "region", - "computed": true - }, { "name": "capabilities", "type": "TypeList", @@ -63093,35 +65122,10 @@ "type": "TypeString" } }, - { - "name": "total_instances", - "type": "TypeFloat", - "computed": true - }, - { - "name": "total_standard_storage_consumed", - "type": "TypeFloat", - "computed": true - }, - { - "name": "enabled", - "type": "TypeBool", - "computed": true - }, { "name": "total_processors_consumed", "type": "TypeFloat", "computed": true - }, - { - "name": "total_memory_consumed", - "type": "TypeFloat", - "computed": true - }, - { - "name": "total_ssd_storage_consumed", - "type": "TypeFloat", - "computed": true } ], "ibm_pi_console_languages": [ @@ -63156,24 +65160,89 @@ } } ], - "ibm_pi_dhcp": [ + "ibm_pi_datacenter": [ { - "name": "status", + "name": "pi_datacenter_location", + "type": "TypeMap", + "description": "Datacenter location", + "computed": true + }, + { + "name": "pi_datacenter_status", "type": "TypeString", - "description": "The status of the DHCP Server", + "description": "Datacenter status", "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "pi_datacenter_type", "type": "TypeString", - "required": true + "description": "Datacenter type", + "computed": true }, { - "name": "pi_dhcp_id", + "name": "pi_datacenter_zone", "type": "TypeString", - "description": "The ID of the DHCP Server", - "required": true + "optional": true + }, + { + "name": "pi_datacenter_capabilities", + "type": "TypeMap", + "description": "Datacenter Capabilities", + "computed": true, + "elem": { + "type": "TypeBool" + } }, + { + "name": "pi_datacenter_href", + "type": "TypeString", + "description": "Datacenter href", + "computed": true + } + ], + "ibm_pi_datacenters": [ + { + "name": "datacenters", + "type": "TypeList", + "computed": true, + "elem": { + "pi_datacenter_capabilities": { + "name": "pi_datacenter_capabilities", + "type": "TypeMap", + "description": "Datacenter Capabilities", + "computed": true, + "elem": { + "type": "TypeBool" + } + }, + "pi_datacenter_href": { + "name": "pi_datacenter_href", + "type": "TypeString", + "description": "Datacenter href", + "computed": true + }, + "pi_datacenter_location": { + "name": "pi_datacenter_location", + "type": "TypeMap", + "description": "Datacenter location", + "computed": true + }, + "pi_datacenter_status": { + "name": "pi_datacenter_status", + "type": "TypeString", + "description": "Datacenter status", + "computed": true + }, + "pi_datacenter_type": { + "name": "pi_datacenter_type", + "type": "TypeString", + "description": "Datacenter type", + "computed": true + } + } + } + ], + "ibm_pi_dhcp": [ { "name": "dhcp_id", "type": "TypeString", @@ -63217,14 +65286,26 @@ "type": "TypeString", "description": "The name of the DHCP Server private network", "computed": true - } - ], - "ibm_pi_dhcps": [ + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the DHCP Server", + "computed": true + }, { "name": "pi_cloud_instance_id", "type": "TypeString", "required": true }, + { + "name": "pi_dhcp_id", + "type": "TypeString", + "description": "The ID of the DHCP Server", + "required": true + } + ], + "ibm_pi_dhcps": [ { "name": "servers", "type": "TypeList", @@ -63262,6 +65343,11 @@ "computed": true } } + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true } ], "ibm_pi_disaster_recovery_location": [ @@ -63328,13 +65414,23 @@ } ], "ibm_pi_image": [ + { + "name": "size", + "type": "TypeInt", + "computed": true + }, { "name": "architecture", "type": "TypeString", "computed": true }, { - "name": "storage_pool", + "name": "hypervisor", + "type": "TypeString", + "computed": true + }, + { + "name": "storage_type", "type": "TypeString", "computed": true }, @@ -63355,12 +65451,12 @@ "computed": true }, { - "name": "size", - "type": "TypeInt", + "name": "operatingsystem", + "type": "TypeString", "computed": true }, { - "name": "storage_type", + "name": "storage_pool", "type": "TypeString", "computed": true }, @@ -63368,19 +65464,14 @@ "name": "pi_cloud_instance_id", "type": "TypeString", "required": true - }, - { - "name": "operatingsystem", - "type": "TypeString", - "computed": true - }, - { - "name": "hypervisor", - "type": "TypeString", - "computed": true } ], "ibm_pi_images": [ + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true + }, { "name": "image_info", "type": "TypeList", @@ -63422,54 +65513,31 @@ "computed": true } } - }, - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true } ], "ibm_pi_instance": [ { - "name": "shared_processor_pool_id", - "type": "TypeString", - "computed": true - }, - { - "name": "memory", - "type": "TypeFloat", - "computed": true - }, - { - "name": "health_status", - "type": "TypeString", + "name": "max_virtual_cores", + "type": "TypeInt", "computed": true }, { - "name": "pin_policy", - "type": "TypeString", + "name": "min_virtual_cores", + "type": "TypeInt", "computed": true }, { - "name": "shared_processor_pool", + "name": "pi_cloud_instance_id", "type": "TypeString", - "computed": true + "required": true }, { - "name": "deployment_type", - "type": "TypeString", + "name": "processors", + "type": "TypeFloat", "computed": true }, { - "name": "volumes", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "networks", + "name": "addresses", "type": "TypeList", "computed": true, "elem": { @@ -63503,66 +65571,42 @@ "type": "TypeString", "computed": true } - } - }, - { - "name": "minmem", - "type": "TypeFloat", - "computed": true - }, - { - "name": "max_virtual_cores", - "type": "TypeInt", - "computed": true - }, - { - "name": "storage_type", - "type": "TypeString", - "computed": true + }, + "deprecated": "This field is deprecated, use networks instead" }, { - "name": "storage_pool", + "name": "status", "type": "TypeString", "computed": true }, { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "processors", + "name": "maxproc", "type": "TypeFloat", "computed": true }, { - "name": "proctype", - "type": "TypeString", - "computed": true - }, - { - "name": "min_virtual_cores", + "name": "virtual_cores_assigned", "type": "TypeInt", "computed": true }, { - "name": "maxproc", - "type": "TypeFloat", + "name": "storage_pool", + "type": "TypeString", "computed": true }, { - "name": "maxmem", - "type": "TypeFloat", + "name": "license_repository_capacity", + "type": "TypeInt", "computed": true }, { - "name": "virtual_cores_assigned", - "type": "TypeInt", + "name": "deployment_type", + "type": "TypeString", "computed": true }, { - "name": "storage_pool_affinity", - "type": "TypeBool", + "name": "shared_processor_pool", + "type": "TypeString", "computed": true }, { @@ -63572,7 +65616,7 @@ "required": true }, { - "name": "addresses", + "name": "networks", "type": "TypeList", "computed": true, "elem": { @@ -63606,11 +65650,10 @@ "type": "TypeString", "computed": true } - }, - "deprecated": "This field is deprecated, use networks instead" + } }, { - "name": "status", + "name": "proctype", "type": "TypeString", "computed": true }, @@ -63620,40 +65663,62 @@ "computed": true }, { - "name": "license_repository_capacity", - "type": "TypeInt", + "name": "pin_policy", + "type": "TypeString", + "computed": true + }, + { + "name": "volumes", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "memory", + "type": "TypeFloat", + "computed": true + }, + { + "name": "maxmem", + "type": "TypeFloat", + "computed": true + }, + { + "name": "storage_pool_affinity", + "type": "TypeBool", "computed": true }, { "name": "placement_group_id", "type": "TypeString", "computed": true - } - ], - "ibm_pi_instance_ip": [ + }, { - "name": "pi_instance_name", + "name": "health_status", "type": "TypeString", - "description": "Server Name to be used for pvminstances", - "required": true + "computed": true }, { - "name": "ipoctet", - "type": "TypeString", + "name": "minmem", + "type": "TypeFloat", "computed": true }, { - "name": "ip", + "name": "storage_type", "type": "TypeString", "computed": true }, { - "name": "macaddress", + "name": "shared_processor_pool_id", "type": "TypeString", "computed": true - }, + } + ], + "ibm_pi_instance_ip": [ { - "name": "network_id", + "name": "ipoctet", "type": "TypeString", "computed": true }, @@ -63663,9 +65728,10 @@ "computed": true }, { - "name": "external_ip", + "name": "pi_instance_name", "type": "TypeString", - "computed": true + "description": "Server Name to be used for pvminstances", + "required": true }, { "name": "pi_cloud_instance_id", @@ -63676,6 +65742,26 @@ "name": "pi_network_name", "type": "TypeString", "required": true + }, + { + "name": "ip", + "type": "TypeString", + "computed": true + }, + { + "name": "macaddress", + "type": "TypeString", + "computed": true + }, + { + "name": "network_id", + "type": "TypeString", + "computed": true + }, + { + "name": "external_ip", + "type": "TypeString", + "computed": true } ], "ibm_pi_instance_snapshots": [ @@ -63738,6 +65824,12 @@ } ], "ibm_pi_instance_volumes": [ + { + "name": "pi_instance_name", + "type": "TypeString", + "description": "Instance Name to be used for pvminstances", + "required": true + }, { "name": "pi_cloud_instance_id", "type": "TypeString", @@ -63799,12 +65891,6 @@ "computed": true } } - }, - { - "name": "pi_instance_name", - "type": "TypeString", - "description": "Instance Name to be used for pvminstances", - "required": true } ], "ibm_pi_instances": [ @@ -63987,6 +66073,12 @@ } ], "ibm_pi_keys": [ + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "PI cloud instance ID", + "required": true + }, { "name": "keys", "type": "TypeList", @@ -64012,18 +66104,12 @@ "computed": true } } - }, - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "description": "PI cloud instance ID", - "required": true } ], "ibm_pi_network": [ { - "name": "gateway", - "type": "TypeString", + "name": "vlan_id", + "type": "TypeInt", "computed": true }, { @@ -64032,22 +66118,19 @@ "computed": true }, { - "name": "used_ip_count", + "name": "used_ip_percent", "type": "TypeFloat", "computed": true }, { - "name": "used_ip_percent", - "type": "TypeFloat", + "name": "type", + "type": "TypeString", "computed": true }, { - "name": "dns", - "type": "TypeSet", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true }, { "name": "cidr", @@ -64055,15 +66138,29 @@ "computed": true }, { - "name": "type", + "name": "gateway", "type": "TypeString", "computed": true }, { - "name": "vlan_id", - "type": "TypeInt", + "name": "used_ip_count", + "type": "TypeFloat", "computed": true }, + { + "name": "name", + "type": "TypeString", + "computed": true, + "deprecated": "This value is deprecated in favor ofpi_network_name" + }, + { + "name": "dns", + "type": "TypeSet", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "jumbo", "type": "TypeBool", @@ -64074,17 +66171,6 @@ "type": "TypeString", "description": "Network Name to be used for pvminstances", "required": true - }, - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "computed": true, - "deprecated": "This value is deprecated in favor ofpi_network_name" } ], "ibm_pi_network_port": [ @@ -64144,14 +66230,6 @@ } ], "ibm_pi_placement_group": [ - { - "name": "members", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "pi_placement_group_name", "type": "TypeString", @@ -64166,6 +66244,14 @@ "name": "pi_cloud_instance_id", "type": "TypeString", "required": true + }, + { + "name": "members", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_pi_placement_groups": [ @@ -64207,11 +66293,6 @@ } ], "ibm_pi_public_network": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, { "name": "name", "type": "TypeString", @@ -64226,6 +66307,11 @@ "name": "vlan_id", "type": "TypeInt", "computed": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true } ], "ibm_pi_pvm_snapshots": [ @@ -64293,12 +66379,6 @@ } ], "ibm_pi_sap_profile": [ - { - "name": "pi_sap_profile_id", - "type": "TypeString", - "description": "SAP Profile ID", - "required": true - }, { "name": "certified", "type": "TypeBool", @@ -64327,6 +66407,12 @@ "name": "pi_cloud_instance_id", "type": "TypeString", "required": true + }, + { + "name": "pi_sap_profile_id", + "type": "TypeString", + "description": "SAP Profile ID", + "required": true } ], "ibm_pi_sap_profiles": [ @@ -64380,15 +66466,15 @@ "required": true }, { - "name": "name", - "type": "TypeString", - "description": "Name of the shared processor pool", + "name": "available_cores", + "type": "TypeFloat", + "description": "Shared processor pool available cores", "computed": true }, { - "name": "reserved_cores", - "type": "TypeInt", - "description": "The amount of reserved cores for the shared processor pool", + "name": "allocated_cores", + "type": "TypeFloat", + "description": "Shared processor pool allocated cores", "computed": true }, { @@ -64468,21 +66554,21 @@ "required": true }, { - "name": "host_id", - "type": "TypeInt", - "description": "The host ID where the shared processor pool resides", + "name": "name", + "type": "TypeString", + "description": "Name of the shared processor pool", "computed": true }, { - "name": "available_cores", - "type": "TypeFloat", - "description": "Shared processor pool available cores", + "name": "host_id", + "type": "TypeInt", + "description": "The host ID where the shared processor pool resides", "computed": true }, { - "name": "allocated_cores", - "type": "TypeFloat", - "description": "Shared processor pool allocated cores", + "name": "reserved_cores", + "type": "TypeInt", + "description": "The amount of reserved cores for the shared processor pool", "computed": true }, { @@ -64493,12 +66579,6 @@ } ], "ibm_pi_shared_processor_pools": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "description": "PI cloud instance ID", - "required": true - }, { "name": "shared_processor_pools", "type": "TypeList", @@ -64545,6 +66625,12 @@ "computed": true } } + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "PI cloud instance ID", + "required": true } ], "ibm_pi_spp_placement_group": [ @@ -64578,12 +66664,6 @@ } ], "ibm_pi_spp_placement_groups": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "description": "PI cloud instance ID", - "required": true - }, { "name": "spp_placement_groups", "type": "TypeList", @@ -64613,9 +66693,26 @@ "computed": true } } + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "PI cloud instance ID", + "required": true } ], "ibm_pi_storage_pool_capacity": [ + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true + }, + { + "name": "pi_storage_pool", + "type": "TypeString", + "description": "Storage pool name", + "required": true + }, { "name": "max_allocation_size", "type": "TypeInt", @@ -64635,29 +66732,13 @@ "computed": true }, { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "pi_storage_pool", - "type": "TypeString", - "description": "Storage pool name", - "required": true + "name": "replication_enabled", + "type": "TypeBool", + "description": "Replication status of the storage pool", + "computed": true } ], "ibm_pi_storage_pools_capacity": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "maximum_storage_allocation", - "type": "TypeMap", - "description": "Maximum storage allocation", - "computed": true - }, { "name": "storage_pools_capacity", "type": "TypeList", @@ -64676,6 +66757,12 @@ "description": "Pool name", "computed": true }, + "replication_enabled": { + "name": "replication_enabled", + "type": "TypeBool", + "description": "Replication status of the storage pool", + "computed": true + }, "storage_type": { "name": "storage_type", "type": "TypeString", @@ -64689,15 +66776,20 @@ "computed": true } } - } - ], - "ibm_pi_storage_type_capacity": [ + }, { - "name": "pi_storage_type", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Storage type name", "required": true }, + { + "name": "maximum_storage_allocation", + "type": "TypeMap", + "description": "Maximum storage allocation", + "computed": true + } + ], + "ibm_pi_storage_type_capacity": [ { "name": "maximum_storage_allocation", "type": "TypeMap", @@ -64740,9 +66832,26 @@ "name": "pi_cloud_instance_id", "type": "TypeString", "required": true + }, + { + "name": "pi_storage_type", + "type": "TypeString", + "description": "Storage type name", + "required": true } ], "ibm_pi_storage_types_capacity": [ + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true + }, + { + "name": "maximum_storage_allocation", + "type": "TypeMap", + "description": "Maximum storage allocation", + "computed": true + }, { "name": "storage_types_capacity", "type": "TypeList", @@ -64794,17 +66903,6 @@ "computed": true } } - }, - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, - { - "name": "maximum_storage_allocation", - "type": "TypeMap", - "description": "Maximum storage allocation", - "computed": true } ], "ibm_pi_system_pools": [ @@ -64897,6 +66995,11 @@ } ], "ibm_pi_tenant": [ + { + "name": "enabled", + "type": "TypeBool", + "computed": true + }, { "name": "tenant_name", "type": "TypeString", @@ -64928,20 +67031,9 @@ "name": "creation_date", "type": "TypeString", "computed": true - }, - { - "name": "enabled", - "type": "TypeBool", - "computed": true } ], "ibm_pi_volume": [ - { - "name": "consistency_group_name", - "type": "TypeString", - "description": "Consistency Group Name if volume is a part of volume group", - "computed": true - }, { "name": "group_id", "type": "TypeString", @@ -64961,12 +67053,23 @@ "computed": true }, { - "name": "volume_pool", + "name": "auxiliary_volume_name", "type": "TypeString", + "description": "Indicates auxiliary volume name", "computed": true }, { - "name": "wwn", + "name": "state", + "type": "TypeString", + "computed": true + }, + { + "name": "bootable", + "type": "TypeBool", + "computed": true + }, + { + "name": "volume_pool", "type": "TypeString", "computed": true }, @@ -64977,16 +67080,27 @@ "computed": true }, { - "name": "pi_volume_name", + "name": "auxiliary", + "type": "TypeBool", + "description": "true if volume is auxiliary otherwise false", + "computed": true + }, + { + "name": "consistency_group_name", "type": "TypeString", - "description": "Volume Name to be used for pvminstances", - "required": true + "description": "Consistency Group Name if volume is a part of volume group", + "computed": true }, { "name": "size", "type": "TypeInt", "computed": true }, + { + "name": "disk_type", + "type": "TypeString", + "computed": true + }, { "name": "replication_enabled", "type": "TypeBool", @@ -65006,50 +67120,28 @@ "computed": true }, { - "name": "shareable", - "type": "TypeBool", - "computed": true - }, - { - "name": "bootable", - "type": "TypeBool", - "computed": true - }, - { - "name": "disk_type", + "name": "pi_cloud_instance_id", "type": "TypeString", - "computed": true - }, - { - "name": "auxiliary", - "type": "TypeBool", - "description": "true if volume is auxiliary otherwise false", - "computed": true + "required": true }, { - "name": "auxiliary_volume_name", + "name": "wwn", "type": "TypeString", - "description": "Indicates auxiliary volume name", "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "pi_volume_name", "type": "TypeString", + "description": "Volume Name to be used for pvminstances", "required": true }, { - "name": "state", - "type": "TypeString", + "name": "shareable", + "type": "TypeBool", "computed": true } ], "ibm_pi_volume_flash_copy_mappings": [ - { - "name": "pi_volume_id", - "type": "TypeString", - "description": "Volume ID", - "required": true - }, { "name": "pi_cloud_instance_id", "type": "TypeString", @@ -65103,9 +67195,25 @@ "computed": true } } + }, + { + "name": "pi_volume_id", + "type": "TypeString", + "description": "Volume ID", + "required": true } ], "ibm_pi_volume_group": [ + { + "name": "replication_status", + "type": "TypeString", + "computed": true + }, + { + "name": "consistency_group_name", + "type": "TypeString", + "computed": true + }, { "name": "status_description_errors", "type": "TypeSet", @@ -65152,24 +67260,9 @@ "name": "status", "type": "TypeString", "computed": true - }, - { - "name": "replication_status", - "type": "TypeString", - "computed": true - }, - { - "name": "consistency_group_name", - "type": "TypeString", - "computed": true } ], "ibm_pi_volume_group_details": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "required": true - }, { "name": "volume_group_name", "type": "TypeString", @@ -65229,6 +67322,11 @@ "type": "TypeString", "description": "Name of the volume group", "required": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true } ], "ibm_pi_volume_group_remote_copy_relationships": [ @@ -65338,21 +67436,15 @@ ], "ibm_pi_volume_group_storage_details": [ { - "name": "cycling_mode", - "type": "TypeString", - "description": "Indicates the type of cycling mode used", - "computed": true - }, - { - "name": "number_of_volumes", + "name": "cycle_period_seconds", "type": "TypeInt", - "description": "Number of volumes in volume group", + "description": "Indicates the minimum period in seconds between multiple cycles", "computed": true }, { - "name": "state", + "name": "cycling_mode", "type": "TypeString", - "description": "Indicates the relationship state", + "description": "Indicates the type of cycling mode used", "computed": true }, { @@ -65362,32 +67454,20 @@ "computed": true }, { - "name": "synchronized", + "name": "consistency_group_name", "type": "TypeString", - "description": "Indicates whether the relationship is synchronized", + "description": "The name of consistency group at storage controller level", "computed": true }, - { - "name": "pi_volume_group_id", - "type": "TypeString", - "description": "Volume group ID", - "required": true - }, { "name": "pi_cloud_instance_id", "type": "TypeString", "required": true }, { - "name": "consistency_group_name", - "type": "TypeString", - "description": "The name of consistency group at storage controller level", - "computed": true - }, - { - "name": "cycle_period_seconds", + "name": "number_of_volumes", "type": "TypeInt", - "description": "Indicates the minimum period in seconds between multiple cycles", + "description": "Number of volumes in volume group", "computed": true }, { @@ -65404,6 +67484,24 @@ "elem": { "type": "TypeString" } + }, + { + "name": "state", + "type": "TypeString", + "description": "Indicates the relationship state", + "computed": true + }, + { + "name": "synchronized", + "type": "TypeString", + "description": "Indicates whether the relationship is synchronized", + "computed": true + }, + { + "name": "pi_volume_group_id", + "type": "TypeString", + "description": "Volume group ID", + "required": true } ], "ibm_pi_volume_groups": [ @@ -65544,31 +67642,25 @@ ], "ibm_pi_volume_onboarding": [ { - "name": "progress", - "type": "TypeInt", - "description": "Indicates the progress of volume onboarding operation", - "computed": true - }, - { - "name": "results_onboarded_volumes", + "name": "input_volumes", "type": "TypeList", - "description": "List of volumes which are onboarded successfully", + "description": "List of volumes requested to be onboarded", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "status", - "type": "TypeString", - "description": "Indicates the status of volume onboarding operation", + "name": "progress", + "type": "TypeInt", + "description": "Indicates the progress of volume onboarding operation", "computed": true }, { - "name": "pi_volume_onboarding_id", + "name": "create_time", "type": "TypeString", - "description": "Volume onboarding ID", - "required": true + "description": "Indicates the create time of volume onboarding operation", + "computed": true }, { "name": "description", @@ -65577,9 +67669,9 @@ "computed": true }, { - "name": "input_volumes", + "name": "results_onboarded_volumes", "type": "TypeList", - "description": "List of volumes requested to be onboarded", + "description": "List of volumes which are onboarded successfully", "computed": true, "elem": { "type": "TypeString" @@ -65608,15 +67700,21 @@ } }, { - "name": "pi_cloud_instance_id", + "name": "status", + "type": "TypeString", + "description": "Indicates the status of volume onboarding operation", + "computed": true + }, + { + "name": "pi_volume_onboarding_id", "type": "TypeString", + "description": "Volume onboarding ID", "required": true }, { - "name": "create_time", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Indicates the create time of volume onboarding operation", - "computed": true + "required": true } ], "ibm_pi_volume_onboardings": [ @@ -65663,21 +67761,44 @@ ], "ibm_pi_volume_remote_copy_relationship": [ { - "name": "cycle_period_seconds", - "type": "TypeInt", - "description": "Indicates the minimum period in seconds between multiple cycles", + "name": "pi_volume_id", + "type": "TypeString", + "description": "Volume name", + "required": true + }, + { + "name": "copy_type", + "type": "TypeString", + "description": "Indicates the copy type.", "computed": true }, { - "name": "pi_volume_id", + "name": "cycling_mode", + "type": "TypeString", + "description": "Indicates the type of cycling mode used.", + "computed": true + }, + { + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Volume name", "required": true }, { - "name": "freeze_time", + "name": "name", "type": "TypeString", - "description": "Freeze time of remote copy relationship", + "description": "Remote copy relationship name", + "computed": true + }, + { + "name": "cycle_period_seconds", + "type": "TypeInt", + "description": "Indicates the minimum period in seconds between multiple cycles", + "computed": true + }, + { + "name": "master_changed_volume_name", + "type": "TypeString", + "description": "Name of the volume that is acting as the master change volume for the relationship", "computed": true }, { @@ -65687,9 +67808,9 @@ "computed": true }, { - "name": "state", - "type": "TypeString", - "description": "Indicates the relationship state", + "name": "progress", + "type": "TypeInt", + "description": "Indicates the relationship progress", "computed": true }, { @@ -65705,27 +67826,27 @@ "computed": true }, { - "name": "consistency_group_name", + "name": "auxiliary_volume_name", "type": "TypeString", - "description": "Consistency Group Name if volume is a part of volume group", + "description": "Auxiliary volume name at storage host level", "computed": true }, { - "name": "cycling_mode", + "name": "consistency_group_name", "type": "TypeString", - "description": "Indicates the type of cycling mode used.", + "description": "Consistency Group Name if volume is a part of volume group", "computed": true }, { - "name": "name", + "name": "freeze_time", "type": "TypeString", - "description": "Remote copy relationship name", + "description": "Freeze time of remote copy relationship", "computed": true }, { - "name": "progress", - "type": "TypeInt", - "description": "Indicates the relationship progress", + "name": "primary_role", + "type": "TypeString", + "description": "Indicates whether master/aux volume is playing the primary role", "computed": true }, { @@ -65735,68 +67856,138 @@ "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "state", "type": "TypeString", - "required": true + "description": "Indicates the relationship state", + "computed": true + } + ], + "ibm_pi_workspace": [ + { + "name": "pi_workspace_capabilities", + "type": "TypeMap", + "description": "Workspace Capabilities", + "computed": true, + "elem": { + "type": "TypeBool" + } }, { - "name": "auxiliary_volume_name", - "type": "TypeString", - "description": "Auxiliary volume name at storage host level", + "name": "pi_workspace_details", + "type": "TypeMap", + "description": "Workspace information", "computed": true }, { - "name": "copy_type", - "type": "TypeString", - "description": "Indicates the copy type.", + "name": "pi_workspace_location", + "type": "TypeMap", + "description": "Workspace location", "computed": true }, { - "name": "master_changed_volume_name", + "name": "pi_workspace_name", "type": "TypeString", - "description": "Name of the volume that is acting as the master change volume for the relationship", + "description": "Workspace name", "computed": true }, { - "name": "primary_role", + "name": "pi_workspace_status", "type": "TypeString", - "description": "Indicates whether master/aux volume is playing the primary role", + "description": "Workspace status", "computed": true - } - ], - "ibm_pn_application_chrome": [ + }, { - "name": "server_key", + "name": "pi_workspace_type", "type": "TypeString", - "description": "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", + "description": "Workspace type", "computed": true }, { - "name": "web_site_url", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", - "computed": true - }, + "required": true + } + ], + "ibm_pi_workspaces": [ { - "name": "guid", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Unique guid of the application using the push service.", "required": true + }, + { + "name": "workspaces", + "type": "TypeList", + "computed": true, + "elem": { + "pi_workspace_capabilities": { + "name": "pi_workspace_capabilities", + "type": "TypeMap", + "description": "Workspace Capabilities", + "computed": true, + "elem": { + "type": "TypeBool" + } + }, + "pi_workspace_details": { + "name": "pi_workspace_details", + "type": "TypeMap", + "description": "Workspace information", + "computed": true + }, + "pi_workspace_id": { + "name": "pi_workspace_id", + "type": "TypeString", + "description": "Workspace ID", + "computed": true + }, + "pi_workspace_location": { + "name": "pi_workspace_location", + "type": "TypeMap", + "description": "Workspace location", + "computed": true + }, + "pi_workspace_name": { + "name": "pi_workspace_name", + "type": "TypeString", + "description": "Workspace name", + "computed": true + }, + "pi_workspace_status": { + "name": "pi_workspace_status", + "type": "TypeString", + "description": "Workspace status", + "computed": true + }, + "pi_workspace_type": { + "name": "pi_workspace_type", + "type": "TypeString", + "description": "Workspace type", + "computed": true + } + } } ], - "ibm_project_event_notification": [ + "ibm_pn_application_chrome": [ { - "name": "project_id", + "name": "guid", "type": "TypeString", - "description": "The unique project ID.", + "description": "Unique guid of the application using the push service.", "required": true }, { - "name": "name", + "name": "server_key", "type": "TypeString", - "description": "The project name.", + "description": "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", "computed": true }, + { + "name": "web_site_url", + "type": "TypeString", + "description": "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", + "computed": true + } + ], + "ibm_project_event_notification": [ { "name": "description", "type": "TypeString", @@ -66016,9 +68207,27 @@ "computed": true } } + }, + { + "name": "project_id", + "type": "TypeString", + "description": "The unique project ID.", + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The project name.", + "computed": true } ], "ibm_resource_group": [ + { + "name": "account_id", + "type": "TypeString", + "description": "Account ID", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -66038,49 +68247,34 @@ "computed": true }, { - "name": "teams_url", - "type": "TypeString", - "description": "The URL to access the team details that associated with the resource group.", - "computed": true - }, - { - "name": "quota_url", + "name": "crn", "type": "TypeString", - "description": "The URL to access the quota details that associated with the resource group.", + "description": "The full CRN associated with the resource group", + "cloud_data_type": "crn", "computed": true }, { - "name": "quota_id", + "name": "created_at", "type": "TypeString", - "description": "An alpha-numeric value identifying the quota ID associated with the resource group.", + "description": "The date when the resource group was initially created.", "computed": true }, { - "name": "resource_linkages", - "type": "TypeSet", - "description": "An array of the resources that linked to the resource group", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "state", + "name": "teams_url", "type": "TypeString", - "description": "State of the resource group", + "description": "The URL to access the team details that associated with the resource group.", "computed": true }, { - "name": "crn", + "name": "quota_url", "type": "TypeString", - "description": "The full CRN associated with the resource group", - "cloud_data_type": "crn", + "description": "The URL to access the quota details that associated with the resource group.", "computed": true }, { - "name": "created_at", + "name": "state", "type": "TypeString", - "description": "The date when the resource group was initially created.", + "description": "State of the resource group", "computed": true }, { @@ -66096,10 +68290,19 @@ "computed": true }, { - "name": "account_id", + "name": "quota_id", "type": "TypeString", - "description": "Account ID", + "description": "An alpha-numeric value identifying the quota ID associated with the resource group.", "computed": true + }, + { + "name": "resource_linkages", + "type": "TypeSet", + "description": "An array of the resources that linked to the resource group", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_resource_instance": [ @@ -66112,74 +68315,80 @@ "computed": true }, { - "name": "plan", + "name": "tags", + "type": "TypeSet", + "description": "Tags of Resource Instance", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_name", "type": "TypeString", - "description": "The plan type of the instance", + "description": "The name of the resource", "computed": true }, { - "name": "crn", + "name": "resource_group_id", "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true + "description": "The id of the resource group in which the instance is present", + "cloud_data_type": "resource_group", + "optional": true, + "computed": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "resource_name", + "name": "service", "type": "TypeString", - "description": "The name of the resource", + "description": "The service type of the instance", + "optional": true, "computed": true }, { - "name": "resource_status", + "name": "plan", "type": "TypeString", - "description": "The status of the resource", + "description": "The plan type of the instance", "computed": true }, { - "name": "resource_controller_url", + "name": "status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The resource instance status", "computed": true }, { - "name": "name", + "name": "resource_crn", "type": "TypeString", - "description": "Resource instance name for example, myobjectstorage", - "required": true + "description": "The crn of the resource", + "computed": true }, { - "name": "resource_group_id", + "name": "resource_status", "type": "TypeString", - "description": "The id of the resource group in which the instance is present", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "The status of the resource", + "computed": true }, { - "name": "status", + "name": "resource_group_name", "type": "TypeString", - "description": "The resource instance status", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "Tags of Resource Instance", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "name", + "type": "TypeString", + "description": "Resource instance name for example, myobjectstorage", + "required": true }, { - "name": "service", + "name": "crn", "type": "TypeString", - "description": "The service type of the instance", - "optional": true, + "description": "CRN of resource instance", + "cloud_data_type": "crn", "computed": true }, { @@ -66189,15 +68398,9 @@ "computed": true }, { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "resource_group_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { @@ -66208,22 +68411,6 @@ } ], "ibm_resource_key": [ - { - "name": "resource_instance_id", - "type": "TypeString", - "description": "The id of the resource instance", - "cloud_data_type": "resource_instance", - "optional": true, - "cloud_data_range": [ - "service:%s" - ] - }, - { - "name": "role", - "type": "TypeString", - "description": "User role", - "computed": true - }, { "name": "credentials", "type": "TypeMap", @@ -66231,13 +68418,6 @@ "secure": true, "computed": true }, - { - "name": "credentials_json", - "type": "TypeString", - "description": "Credentials asociated with the key in json string", - "secure": true, - "computed": true - }, { "name": "most_recent", "type": "TypeBool", @@ -66246,21 +68426,16 @@ "optional": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the resource key", - "required": true - }, - { - "name": "resource_alias_id", + "name": "status", "type": "TypeString", - "description": "The id of the resource alias", - "optional": true + "description": "Status of resource key", + "computed": true }, { - "name": "status", + "name": "credentials_json", "type": "TypeString", - "description": "Status of resource key", + "description": "Credentials asociated with the key in json string", + "secure": true, "computed": true }, { @@ -66269,27 +68444,37 @@ "description": "crn of resource key", "cloud_data_type": "crn", "computed": true - } - ], - "ibm_resource_quota": [ + }, { - "name": "type", + "name": "name", "type": "TypeString", - "description": "Type of the quota.", - "computed": true + "description": "The name of the resource key", + "required": true }, { - "name": "max_apps", - "type": "TypeInt", - "description": "Defines the total app limit.", - "computed": true + "name": "resource_instance_id", + "type": "TypeString", + "description": "The id of the resource instance", + "cloud_data_type": "resource_instance", + "optional": true, + "cloud_data_range": [ + "service:%s" + ] }, { - "name": "max_instances_per_app", - "type": "TypeInt", - "description": "Defines the total instances limit per app.", - "computed": true + "name": "resource_alias_id", + "type": "TypeString", + "description": "The id of the resource alias", + "optional": true }, + { + "name": "role", + "type": "TypeString", + "description": "User role", + "computed": true + } + ], + "ibm_resource_quota": [ { "name": "max_app_instance_memory", "type": "TypeString", @@ -66319,9 +68504,40 @@ "type": "TypeString", "description": "Resource quota name, for example Trial Quota", "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Type of the quota.", + "computed": true + }, + { + "name": "max_apps", + "type": "TypeInt", + "description": "Defines the total app limit.", + "computed": true + }, + { + "name": "max_instances_per_app", + "type": "TypeInt", + "description": "Defines the total instances limit per app.", + "computed": true } ], "ibm_resource_tag": [ + { + "name": "resource_type", + "type": "TypeString", + "description": "Resource type on which the tags should be fetched", + "optional": true + }, + { + "name": "tag_type", + "type": "TypeString", + "description": "Tag type on which the tags should be fetched", + "default_value": "user", + "optional": true + }, { "name": "resource_id", "type": "TypeString", @@ -66337,26 +68553,30 @@ "elem": { "type": "TypeString" } + } + ], + "ibm_satellite_attach_host_script": [ + { + "name": "host_script", + "type": "TypeString", + "description": "Attach host script content", + "computed": true }, { - "name": "resource_type", + "name": "custom_script", "type": "TypeString", - "description": "Resource type on which the tags should be fetched", + "description": "The custom script that has to be appended to generated host script file", "optional": true }, { - "name": "tag_type", + "name": "description", "type": "TypeString", - "description": "Tag type on which the tags should be fetched", - "default_value": "user", - "optional": true - } - ], - "ibm_satellite_attach_host_script": [ + "description": "A unique name for the new Satellite location", + "computed": true + }, { - "name": "coreos_host", - "type": "TypeBool", - "description": "If true, returns a CoreOS ignition file for the host. Otherwise, returns a RHEL attach script", + "name": "host_provider", + "type": "TypeString", "optional": true }, { @@ -66389,77 +68609,96 @@ "required": true }, { - "name": "description", - "type": "TypeString", - "description": "A unique name for the new Satellite location", + "name": "coreos_host", + "type": "TypeBool", + "description": "If true, returns a CoreOS ignition file for the host. Otherwise, returns a RHEL attach script", + "optional": true + } + ], + "ibm_satellite_cluster": [ + { + "name": "private_service_endpoint", + "type": "TypeBool", "computed": true }, { - "name": "custom_script", + "name": "resource_group_name", "type": "TypeString", - "description": "The custom script that has to be appended to generated host script file", - "optional": true + "description": "The resource group name in which resource is provisioned", + "computed": true }, { - "name": "host_provider", + "name": "infrastructure_topology", "type": "TypeString", - "optional": true + "description": "String value for single node cluster option.", + "computed": true }, { - "name": "host_script", + "name": "name", "type": "TypeString", - "description": "Attach host script content", - "computed": true - } - ], - "ibm_satellite_cluster": [ + "description": "Name or id of the cluster", + "required": true + }, { - "name": "location", + "name": "state", "type": "TypeString", - "description": "Name or id of the location", - "cloud_data_type": "region", + "description": "The lifecycle state of the cluster", "computed": true }, { - "name": "status", + "name": "kube_version", "type": "TypeString", - "description": "The status of the cluster", + "description": "Kubernetes version", "computed": true }, { - "name": "kube_version", + "name": "resource_group_id", "type": "TypeString", - "description": "Kubernetes version", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, { - "name": "private_service_endpoint", - "type": "TypeBool", + "name": "server_url", + "type": "TypeString", + "description": "The server URL", "computed": true }, { - "name": "name", + "name": "public_service_endpoint_url", "type": "TypeString", - "description": "Name or id of the cluster", - "required": true + "computed": true }, { - "name": "health", + "name": "private_service_endpoint_url", "type": "TypeString", "computed": true }, { - "name": "workers", - "type": "TypeList", + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "state", + "name": "status", + "type": "TypeString", + "description": "The status of the cluster", + "computed": true + }, + { + "name": "health", "type": "TypeString", - "description": "The lifecycle state of the cluster", + "computed": true + }, + { + "name": "worker_count", + "type": "TypeInt", + "description": "Number of workers", "computed": true }, { @@ -66529,25 +68768,6 @@ } } }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "ingress_hostname", - "type": "TypeString", - "computed": true - }, - { - "name": "ingress_secret", - "type": "TypeString", - "secure": true, - "computed": true - }, { "name": "crn", "type": "TypeString", @@ -66555,80 +68775,57 @@ "cloud_data_type": "crn", "computed": true }, - { - "name": "server_url", - "type": "TypeString", - "description": "The server URL", - "computed": true - }, { "name": "public_service_endpoint", "type": "TypeBool", "computed": true }, { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, - { - "name": "worker_count", - "type": "TypeInt", - "description": "Number of workers", - "computed": true - }, - { - "name": "public_service_endpoint_url", - "type": "TypeString", - "computed": true - }, - { - "name": "private_service_endpoint_url", + "name": "location", "type": "TypeString", + "description": "Name or id of the location", + "cloud_data_type": "region", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", + "name": "workers", + "type": "TypeList", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "infrastructure_topology", + "name": "ingress_hostname", "type": "TypeString", - "description": "String value for single node cluster option.", + "computed": true + }, + { + "name": "ingress_secret", + "type": "TypeString", + "secure": true, "computed": true } ], "ibm_satellite_cluster_worker_pool": [ { - "name": "region", + "name": "resource_group_id", "type": "TypeString", - "description": "Name of the region", - "cloud_data_type": "region", + "description": "ID of the resource group", + "cloud_data_type": "resource_group", "optional": true, "computed": true }, { - "name": "worker_count", - "type": "TypeInt", - "description": "The number of workers that are attached", + "name": "auto_scale_enabled", + "type": "TypeBool", + "description": "Enable auto scalling for worker pool", "computed": true }, { - "name": "isolation", + "name": "state", "type": "TypeString", - "description": "Isolation of the worker node", - "computed": true - }, - { - "name": "auto_scale_enabled", - "type": "TypeBool", - "description": "Enable auto scalling for worker pool", + "description": "The state of the worker pool", "computed": true }, { @@ -66649,38 +68846,18 @@ } }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "flavor", - "type": "TypeString", - "description": "The flavor of the satellite worker node", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "The state of the worker pool", - "computed": true - }, - { - "name": "worker_pool_labels", + "name": "host_labels", "type": "TypeMap", - "description": "Labels on all the workers in the worker pool", + "description": "Host labels on the workers", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "host_labels", + "name": "worker_pool_labels", "type": "TypeMap", - "description": "Host labels on the workers", + "description": "Labels on all the workers in the worker pool", "computed": true, "elem": { "type": "TypeString" @@ -66692,6 +68869,26 @@ "description": "The operating system of the hosts in the worker pool", "computed": true }, + { + "name": "region", + "type": "TypeString", + "description": "Name of the region", + "cloud_data_type": "region", + "optional": true, + "computed": true + }, + { + "name": "worker_count", + "type": "TypeInt", + "description": "The number of workers that are attached", + "computed": true + }, + { + "name": "isolation", + "type": "TypeString", + "description": "Isolation of the worker node", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -66703,9 +68900,28 @@ "type": "TypeString", "description": "Cluster name", "required": true + }, + { + "name": "flavor", + "type": "TypeString", + "description": "The flavor of the satellite worker node", + "computed": true } ], "ibm_satellite_cluster_worker_pool_zone_attachment": [ + { + "name": "zone", + "type": "TypeString", + "description": "worker pool zone name", + "required": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "The ID of the resource group that the Satellite location is in. To list the resource group ID of the location, use the `GET /v2/satellite/getController` API method.", + "cloud_data_type": "resource_group", + "optional": true + }, { "name": "worker_count", "type": "TypeInt", @@ -66738,38 +68954,13 @@ "type": "TypeString", "description": "worker pool name", "required": true - }, - { - "name": "zone", - "type": "TypeString", - "description": "worker pool zone name", - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The ID of the resource group that the Satellite location is in. To list the resource group ID of the location, use the `GET /v2/satellite/getController` API method.", - "cloud_data_type": "resource_group", - "optional": true } ], "ibm_satellite_endpoint": [ { - "name": "sni", - "type": "TypeString", - "description": "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", - "computed": true - }, - { - "name": "client_protocol", - "type": "TypeString", - "description": "The protocol in the client application side.", - "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The service or person who created the endpoint. Must be 1000 characters or fewer.", + "name": "timeout", + "type": "TypeInt", + "description": "The inactivity timeout in the Endpoint side.", "computed": true }, { @@ -66803,73 +68994,6 @@ } } }, - { - "name": "client_host", - "type": "TypeString", - "description": "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", - "computed": true - }, - { - "name": "endpoint_id", - "type": "TypeString", - "description": "The Endpoint ID.", - "required": true - }, - { - "name": "connection_type", - "type": "TypeString", - "description": "The type of the endpoint.", - "computed": true - }, - { - "name": "display_name", - "type": "TypeString", - "description": "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", - "computed": true - }, - { - "name": "client_port", - "type": "TypeInt", - "description": "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Whether the Endpoint is active or not.", - "computed": true - }, - { - "name": "service_name", - "type": "TypeString", - "description": "The service name of the endpoint.", - "computed": true - }, - { - "name": "client_mutual_auth", - "type": "TypeBool", - "description": "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", - "computed": true - }, - { - "name": "timeout", - "type": "TypeInt", - "description": "The inactivity timeout in the Endpoint side.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Service instance associated with this location.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "server_protocol", - "type": "TypeString", - "description": "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", - "computed": true - }, { "name": "certs", "type": "TypeList", @@ -66959,34 +69083,65 @@ } }, { - "name": "created_at", + "name": "display_name", "type": "TypeString", - "description": "The time when the Endpoint is created.", + "description": "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", "computed": true }, { - "name": "location", + "name": "reject_unauth", + "type": "TypeBool", + "description": "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", + "computed": true + }, + { + "name": "server_port", + "type": "TypeInt", + "description": "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", + "computed": true + }, + { + "name": "sni", "type": "TypeString", - "description": "The Location ID.", - "cloud_data_type": "region", - "required": true + "description": "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", + "computed": true }, { - "name": "server_host", + "name": "client_protocol", "type": "TypeString", - "description": "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", + "description": "The protocol in the client application side.", "computed": true }, { - "name": "server_port", + "name": "connector_port", "type": "TypeInt", - "description": "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", + "description": "The connector port.", "computed": true }, { - "name": "last_change", + "name": "crn", "type": "TypeString", - "description": "The last time modify the Endpoint configurations.", + "description": "Service instance associated with this location.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Whether the Endpoint is active or not.", + "computed": true + }, + { + "name": "location", + "type": "TypeString", + "description": "The Location ID.", + "cloud_data_type": "region", + "required": true + }, + { + "name": "connection_type", + "type": "TypeString", + "description": "The type of the endpoint.", "computed": true }, { @@ -67053,6 +69208,18 @@ } } }, + { + "name": "created_at", + "type": "TypeString", + "description": "The time when the Endpoint is created.", + "computed": true + }, + { + "name": "last_change", + "type": "TypeString", + "description": "The last time modify the Endpoint configurations.", + "computed": true + }, { "name": "server_mutual_auth", "type": "TypeBool", @@ -67060,19 +69227,93 @@ "computed": true }, { - "name": "reject_unauth", - "type": "TypeBool", - "description": "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", + "name": "created_by", + "type": "TypeString", + "description": "The service or person who created the endpoint. Must be 1000 characters or fewer.", "computed": true }, { - "name": "connector_port", + "name": "service_name", + "type": "TypeString", + "description": "The service name of the endpoint.", + "computed": true + }, + { + "name": "client_port", "type": "TypeInt", - "description": "The connector port.", + "description": "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", + "computed": true + }, + { + "name": "endpoint_id", + "type": "TypeString", + "description": "The Endpoint ID.", + "required": true + }, + { + "name": "client_mutual_auth", + "type": "TypeBool", + "description": "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", + "computed": true + }, + { + "name": "client_host", + "type": "TypeString", + "description": "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", + "computed": true + }, + { + "name": "server_host", + "type": "TypeString", + "description": "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", + "computed": true + }, + { + "name": "server_protocol", + "type": "TypeString", + "description": "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", "computed": true } ], "ibm_satellite_link": [ + { + "name": "location", + "type": "TypeString", + "description": "The Location ID.", + "cloud_data_type": "region", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Service instance associated with this location.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "satellite_link_host", + "type": "TypeString", + "description": "Satellite Link hostname of the location.", + "computed": true + }, + { + "name": "ws_endpoint", + "type": "TypeString", + "description": "The ws endpoint of the location.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Description of the location.", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Enabled/Disabled.", + "computed": true + }, { "name": "created_at", "type": "TypeString", @@ -67160,51 +69401,49 @@ "computed": true } } - }, + } + ], + "ibm_satellite_location": [ { "name": "location", "type": "TypeString", - "description": "The Location ID.", + "description": "A unique name for the new Satellite location", "cloud_data_type": "region", "required": true }, { "name": "description", "type": "TypeString", - "description": "Description of the location.", + "description": "A description of the new Satellite location", "computed": true }, { - "name": "satellite_link_host", + "name": "resource_group_name", "type": "TypeString", - "description": "Satellite Link hostname of the location.", + "description": "Name of the resource group", "computed": true }, { - "name": "ws_endpoint", - "type": "TypeString", - "description": "The ws endpoint of the location.", + "name": "coreos_enabled", + "type": "TypeBool", + "description": "If Red Hat CoreOS features are enabled within the Satellite location", "computed": true }, { - "name": "crn", + "name": "logging_account_id", "type": "TypeString", - "description": "Service instance associated with this location.", - "cloud_data_type": "crn", + "description": "The account ID for IBM Log Analysis with LogDNA log forwarding", "computed": true }, { - "name": "status", + "name": "ingress_hostname", "type": "TypeString", - "description": "Enabled/Disabled.", "computed": true - } - ], - "ibm_satellite_location": [ + }, { - "name": "coreos_enabled", - "type": "TypeBool", - "description": "If Red Hat CoreOS features are enabled within the Satellite location", + "name": "ingress_secret", + "type": "TypeString", + "secure": true, "computed": true }, { @@ -67253,72 +69492,30 @@ } }, { - "name": "managed_from", - "type": "TypeString", - "description": "The IBM Cloud metro from which the Satellite location is managed", - "computed": true - }, - { - "name": "logging_account_id", - "type": "TypeString", - "description": "The account ID for IBM Log Analysis with LogDNA log forwarding", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Location CRN", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "tags", + "name": "zones", "type": "TypeSet", - "cloud_data_type": "tags", + "description": "The names of at least three high availability zones to use for the location", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "created_on", - "type": "TypeString", - "description": "Created Date", - "computed": true - }, - { - "name": "ingress_hostname", - "type": "TypeString", - "computed": true - }, - { - "name": "description", + "name": "crn", "type": "TypeString", - "description": "A description of the new Satellite location", + "description": "Location CRN", + "cloud_data_type": "crn", "computed": true }, { - "name": "zones", + "name": "tags", "type": "TypeSet", - "description": "The names of at least three high availability zones to use for the location", + "cloud_data_type": "tags", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "Name of the resource group", - "computed": true - }, { "name": "host_attached_count", "type": "TypeInt", @@ -67338,17 +69535,23 @@ } }, { - "name": "ingress_secret", + "name": "managed_from", "type": "TypeString", - "secure": true, + "description": "The IBM Cloud metro from which the Satellite location is managed", "computed": true }, { - "name": "location", + "name": "resource_group_id", "type": "TypeString", - "description": "A unique name for the new Satellite location", - "cloud_data_type": "region", - "required": true + "description": "ID of the resource group", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "created_on", + "type": "TypeString", + "description": "Created Date", + "computed": true } ], "ibm_satellite_location_nlb_dns": [ @@ -67426,36 +69629,6 @@ } ], "ibm_satellite_storage_assignment": [ - { - "name": "config_version", - "type": "TypeString", - "description": "The Storage Configuration Version.", - "computed": true - }, - { - "name": "is_assignment_upgrade_available", - "type": "TypeBool", - "description": "Whether an Upgrade is Available for the Assignment.", - "computed": true - }, - { - "name": "assignment_type", - "type": "TypeString", - "description": "The Type of Assignment.", - "computed": true - }, - { - "name": "rollout_error_count", - "type": "TypeInt", - "description": "The Rollout Error Count of the Assignment.", - "computed": true - }, - { - "name": "cluster", - "type": "TypeString", - "description": "ID of the Satellite cluster or Service Cluster that you want to apply the configuration to.", - "computed": true - }, { "name": "config_version_uuid", "type": "TypeString", @@ -67463,9 +69636,9 @@ "computed": true }, { - "name": "rollout_success_count", - "type": "TypeInt", - "description": "The Rollout Success Count of the Assignment.", + "name": "sat_cluster", + "type": "TypeString", + "description": "ID of the Satellite cluster that you applied the configuration to.", "computed": true }, { @@ -67484,33 +69657,33 @@ } }, { - "name": "svc_cluster", + "name": "cluster", "type": "TypeString", - "description": "ID of the Service Cluster that you applied the configuration to.", + "description": "ID of the Satellite cluster or Service Cluster that you want to apply the configuration to.", "computed": true }, { - "name": "sat_cluster", + "name": "svc_cluster", "type": "TypeString", - "description": "ID of the Satellite cluster that you applied the configuration to.", + "description": "ID of the Service Cluster that you applied the configuration to.", "computed": true }, { - "name": "config", + "name": "config_uuid", "type": "TypeString", - "description": "Storage Configuration Name or ID.", + "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", "computed": true }, { - "name": "config_uuid", + "name": "config_version", "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", + "description": "The Storage Configuration Version.", "computed": true }, { - "name": "created", - "type": "TypeString", - "description": "The Time of Creation of the Assignment.", + "name": "rollout_success_count", + "type": "TypeInt", + "description": "The Rollout Success Count of the Assignment.", "computed": true }, { @@ -67520,37 +69693,43 @@ "computed": true }, { - "name": "uuid", + "name": "config", "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Assignment.", - "required": true - } - ], - "ibm_satellite_storage_configuration": [ + "description": "Storage Configuration Name or ID.", + "computed": true + }, { - "name": "config_name", + "name": "assignment_type", "type": "TypeString", - "description": "Name of the Storage Configuration.", - "required": true + "description": "The Type of Assignment.", + "computed": true }, { - "name": "config_version", + "name": "created", "type": "TypeString", - "description": "Version of the Storage Configuration.", + "description": "The Time of Creation of the Assignment.", "computed": true }, { - "name": "storage_template_name", - "type": "TypeString", - "description": "The Storage Template Name.", + "name": "rollout_error_count", + "type": "TypeInt", + "description": "The Rollout Error Count of the Assignment.", "computed": true }, { - "name": "storage_template_version", - "type": "TypeString", - "description": "The Storage Template Version.", + "name": "is_assignment_upgrade_available", + "type": "TypeBool", + "description": "Whether an Upgrade is Available for the Assignment.", "computed": true }, + { + "name": "uuid", + "type": "TypeString", + "description": "The Universally Unique IDentifier (UUID) of the Assignment.", + "required": true + } + ], + "ibm_satellite_storage_configuration": [ { "name": "user_config_parameters", "type": "TypeMap", @@ -67581,6 +69760,30 @@ "description": "The Location Name.", "cloud_data_type": "region", "required": true + }, + { + "name": "config_name", + "type": "TypeString", + "description": "Name of the Storage Configuration.", + "required": true + }, + { + "name": "config_version", + "type": "TypeString", + "description": "Version of the Storage Configuration.", + "computed": true + }, + { + "name": "storage_template_name", + "type": "TypeString", + "description": "The Storage Template Name.", + "computed": true + }, + { + "name": "storage_template_version", + "type": "TypeString", + "description": "The Storage Template Version.", + "computed": true } ], "ibm_scc_account_location": [], @@ -67589,21 +69792,15 @@ "ibm_scc_account_notification_settings": [], "ibm_scc_control_library": [ { - "name": "control_library_id", - "type": "TypeString", - "description": "The control library ID.", - "required": true - }, - { - "name": "account_id", + "name": "created_on", "type": "TypeString", - "description": "The account ID.", + "description": "The date when the control library was created.", "computed": true }, { - "name": "control_library_type", - "type": "TypeString", - "description": "The control library type.", + "name": "control_parents_count", + "type": "TypeInt", + "description": "The number of parent controls in the control library.", "computed": true }, { @@ -67800,41 +69997,53 @@ } }, { - "name": "created_by", - "type": "TypeString", - "description": "The user who created the control library.", - "computed": true + "name": "controls_count", + "type": "TypeInt", + "description": "The number of controls.", + "computed": true }, { - "name": "latest", - "type": "TypeBool", - "description": "The latest version of the control library.", + "name": "account_id", + "type": "TypeString", + "description": "The account ID.", "computed": true }, { - "name": "updated_by", + "name": "control_library_type", "type": "TypeString", - "description": "The user who updated the control library.", + "description": "The control library type.", "computed": true }, { - "name": "controls_count", - "type": "TypeInt", - "description": "The number of controls.", + "name": "updated_on", + "type": "TypeString", + "description": "The date when the control library was updated.", "computed": true }, { - "name": "control_parents_count", - "type": "TypeInt", - "description": "The number of parent controls in the control library.", + "name": "hierarchy_enabled", + "type": "TypeBool", + "description": "The indication of whether hierarchy is enabled for the control library.", "computed": true }, { - "name": "control_library_name", + "name": "updated_by", "type": "TypeString", - "description": "The control library name.", + "description": "The user who updated the control library.", "computed": true }, + { + "name": "latest", + "type": "TypeBool", + "description": "The latest version of the control library.", + "computed": true + }, + { + "name": "control_library_id", + "type": "TypeString", + "description": "The control library ID.", + "required": true + }, { "name": "control_library_description", "type": "TypeString", @@ -67848,28 +70057,30 @@ "computed": true }, { - "name": "created_on", + "name": "created_by", "type": "TypeString", - "description": "The date when the control library was created.", + "description": "The user who created the control library.", "computed": true }, { - "name": "control_library_version", + "name": "control_library_name", "type": "TypeString", - "description": "The control library version.", + "description": "The control library name.", "computed": true }, { - "name": "updated_on", + "name": "control_library_version", "type": "TypeString", - "description": "The date when the control library was updated.", + "description": "The control library version.", "computed": true }, { - "name": "hierarchy_enabled", - "type": "TypeBool", - "description": "The indication of whether hierarchy is enabled for the control library.", - "computed": true + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true } ], "ibm_scc_instance_settings": [ @@ -67936,9 +70147,43 @@ "computed": true } } + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true } ], "ibm_scc_latest_reports": [ + { + "name": "score", + "type": "TypeList", + "description": "The compliance score.", + "computed": true, + "elem": { + "passed": { + "name": "passed", + "type": "TypeInt", + "description": "The number of successful evaluations.", + "computed": true + }, + "percent": { + "name": "percent", + "type": "TypeInt", + "description": "The percentage of successful evaluations.", + "computed": true + }, + "total_count": { + "name": "total_count", + "type": "TypeInt", + "description": "The total number of evaluations.", + "computed": true + } + } + }, { "name": "reports", "type": "TypeList", @@ -68113,6 +70358,14 @@ } } }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "sort", "type": "TypeString", @@ -68212,70 +70465,125 @@ "computed": true } } + } + ], + "ibm_scc_profile": [ + { + "name": "profile_name", + "type": "TypeString", + "description": "The profile name.", + "computed": true }, { - "name": "score", + "name": "profile_version", + "type": "TypeString", + "description": "The version status of the profile.", + "computed": true + }, + { + "name": "latest", + "type": "TypeBool", + "description": "The latest version of the profile.", + "computed": true + }, + { + "name": "updated_on", + "type": "TypeString", + "description": "The date when the profile was updated.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "The user who updated the profile.", + "computed": true + }, + { + "name": "default_parameters", "type": "TypeList", - "description": "The compliance score.", + "description": "The default parameters of the profile.", "computed": true, "elem": { - "passed": { - "name": "passed", - "type": "TypeInt", - "description": "The number of successful evaluations.", + "assessment_id": { + "name": "assessment_id", + "type": "TypeString", + "description": "The implementation ID of the parameter.", "computed": true }, - "percent": { - "name": "percent", - "type": "TypeInt", - "description": "The percentage of successful evaluations.", + "assessment_type": { + "name": "assessment_type", + "type": "TypeString", + "description": "The type of the implementation.", "computed": true }, - "total_count": { - "name": "total_count", - "type": "TypeInt", - "description": "The total number of evaluations.", + "parameter_default_value": { + "name": "parameter_default_value", + "type": "TypeString", + "description": "The default value of the parameter.", + "computed": true + }, + "parameter_display_name": { + "name": "parameter_display_name", + "type": "TypeString", + "description": "The parameter display name.", + "computed": true + }, + "parameter_name": { + "name": "parameter_name", + "type": "TypeString", + "description": "The parameter name.", + "computed": true + }, + "parameter_type": { + "name": "parameter_type", + "type": "TypeString", + "description": "The parameter type.", "computed": true } } - } - ], - "ibm_scc_profile": [ - { - "name": "profile_id", - "type": "TypeString", - "description": "The profile ID.", - "required": true }, { - "name": "profile_description", + "name": "profile_type", "type": "TypeString", - "description": "The profile description.", + "description": "The profile type, such as custom or predefined.", "computed": true }, { - "name": "profile_version", + "name": "version_group_label", "type": "TypeString", - "description": "The version status of the profile.", + "description": "The version group label of the profile.", "computed": true }, { "name": "instance_id", "type": "TypeString", - "description": "The instance ID.", + "description": "The ID of the Security and Compliance Center instance.", "cloud_data_type": "resource_instance", - "computed": true + "immutable": true, + "required": true }, { - "name": "latest", + "name": "hierarchy_enabled", "type": "TypeBool", - "description": "The latest version of the profile.", + "description": "The indication of whether hierarchy is enabled for the profile.", "computed": true }, { - "name": "updated_on", + "name": "profile_id", "type": "TypeString", - "description": "The date when the profile was updated.", + "description": "The profile ID.", + "required": true + }, + { + "name": "controls_count", + "type": "TypeInt", + "description": "The number of controls for the profile.", + "computed": true + }, + { + "name": "control_parents_count", + "type": "TypeInt", + "description": "The number of parent controls for the profile.", "computed": true }, { @@ -68475,9 +70783,15 @@ } }, { - "name": "version_group_label", + "name": "profile_description", "type": "TypeString", - "description": "The version group label of the profile.", + "description": "The profile description.", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the profile.", "computed": true }, { @@ -68487,99 +70801,75 @@ "computed": true }, { - "name": "updated_by", + "name": "attachments_count", + "type": "TypeInt", + "description": "The number of attachments related to this profile.", + "computed": true + } + ], + "ibm_scc_profile_attachment": [ + { + "name": "attachment_item_id", "type": "TypeString", - "description": "The user who updated the profile.", + "description": "The ID of the attachment.", "computed": true }, { - "name": "default_parameters", - "type": "TypeList", - "description": "The default parameters of the profile.", - "computed": true, - "elem": { - "assessment_id": { - "name": "assessment_id", - "type": "TypeString", - "description": "The implementation ID of the parameter.", - "computed": true - }, - "assessment_type": { - "name": "assessment_type", - "type": "TypeString", - "description": "The type of the implementation.", - "computed": true - }, - "parameter_default_value": { - "name": "parameter_default_value", - "type": "TypeString", - "description": "The default value of the parameter.", - "computed": true - }, - "parameter_display_name": { - "name": "parameter_display_name", - "type": "TypeString", - "description": "The parameter display name.", - "computed": true - }, - "parameter_name": { - "name": "parameter_name", - "type": "TypeString", - "description": "The parameter name.", - "computed": true - }, - "parameter_type": { - "name": "parameter_type", - "type": "TypeString", - "description": "The parameter type.", - "computed": true - } - } + "name": "updated_by", + "type": "TypeString", + "description": "The user who updated the attachment.", + "computed": true }, { - "name": "profile_type", + "name": "next_scan_time", "type": "TypeString", - "description": "The profile type, such as custom or predefined.", + "description": "The start time of the next scan.", "computed": true }, { - "name": "created_by", + "name": "description", "type": "TypeString", - "description": "The user who created the profile.", + "description": "The description for the attachment.", "computed": true }, { - "name": "controls_count", - "type": "TypeInt", - "description": "The number of controls for the profile.", - "computed": true + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "control_parents_count", - "type": "TypeInt", - "description": "The number of parent controls for the profile.", + "name": "status", + "type": "TypeString", + "description": "The status of an attachment evaluation.", "computed": true }, { - "name": "profile_name", + "name": "attachment_id", "type": "TypeString", - "description": "The profile name.", - "computed": true + "description": "The attachment ID.", + "required": true }, { - "name": "hierarchy_enabled", - "type": "TypeBool", - "description": "The indication of whether hierarchy is enabled for the profile.", + "name": "profile_id", + "type": "TypeString", + "description": "The profile ID.", + "required": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the attachment.", "computed": true }, { - "name": "attachments_count", - "type": "TypeInt", - "description": "The number of attachments related to this profile.", + "name": "updated_on", + "type": "TypeString", + "description": "The date when the attachment was updated.", "computed": true - } - ], - "ibm_scc_profile_attachment": [ + }, { "name": "last_scan", "type": "TypeList", @@ -68607,16 +70897,44 @@ } }, { - "name": "status", + "name": "account_id", "type": "TypeString", - "description": "The status of an attachment evaluation.", + "description": "The account ID that is associated to the attachment.", "computed": true }, { - "name": "profile_id", - "type": "TypeString", - "description": "The profile ID.", - "required": true + "name": "scope", + "type": "TypeList", + "description": "The scope payload for the multi cloud feature.", + "computed": true, + "elem": { + "environment": { + "name": "environment", + "type": "TypeString", + "description": "The environment that relates to this scope.", + "computed": true + }, + "properties": { + "name": "properties", + "type": "TypeList", + "description": "The properties supported for scoping by this environment.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of the property.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The value of the property.", + "computed": true + } + } + } + } }, { "name": "created_on", @@ -68624,18 +70942,6 @@ "description": "The date when the attachment was created.", "computed": true }, - { - "name": "updated_on", - "type": "TypeString", - "description": "The date when the attachment was updated.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "The user who updated the attachment.", - "computed": true - }, { "name": "schedule", "type": "TypeString", @@ -68724,100 +71030,80 @@ } }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "The description for the attachment.", + "description": "The name of the attachment.", "computed": true - }, + } + ], + "ibm_scc_provider_type": [ { - "name": "attachment_id", + "name": "provider_type_id", "type": "TypeString", - "description": "The attachment ID.", + "description": "The provider type ID.", "required": true }, { - "name": "account_id", - "type": "TypeString", - "description": "The account ID that is associated to the attachment.", + "name": "instance_limit", + "type": "TypeInt", + "description": "The maximum number of instances that can be created for the provider type.", "computed": true }, { - "name": "scope", - "type": "TypeList", - "description": "The scope payload for the multi cloud feature.", - "computed": true, - "elem": { - "environment": { - "name": "environment", - "type": "TypeString", - "description": "The environment that relates to this scope.", - "computed": true - }, - "properties": { - "name": "properties", - "type": "TypeList", - "description": "The properties supported for scoping by this environment.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of the property.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The value of the property.", - "computed": true - } - } - } - } + "name": "id", + "type": "TypeString", + "description": "The unique identifier of the provider type.", + "computed": true }, { - "name": "next_scan_time", - "type": "TypeString", - "description": "The start time of the next scan.", + "name": "s2s_enabled", + "type": "TypeBool", + "description": "A boolean that indicates whether the provider type is s2s-enabled.", "computed": true }, { - "name": "name", + "name": "data_type", "type": "TypeString", - "description": "The name of the attachment.", + "description": "The format of the results that a provider supports.", "computed": true }, { - "name": "attachment_item_id", + "name": "attributes", + "type": "TypeMap", + "description": "The attributes that are required when you're creating an instance of a provider type. The attributes field can have multiple keys in its value. Each of those keys has a value object that includes the type, and display name as keys. For example, `{type:\"\", display_name:\"\"}`. **NOTE;** If the provider type is s2s-enabled, which means that if the `s2s_enabled` field is set to `true`, then a CRN field of type text is required in the attributes value object.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "type", "type": "TypeString", - "description": "The ID of the attachment.", + "description": "The type of the provider type.", "computed": true }, { - "name": "instance_id", + "name": "name", "type": "TypeString", - "description": "The instance ID of the account that is associated to the attachment.", - "cloud_data_type": "resource_instance", + "description": "The name of the provider type.", "computed": true }, { - "name": "created_by", + "name": "description", "type": "TypeString", - "description": "The user who created the attachment.", + "description": "The provider type description.", "computed": true - } - ], - "ibm_scc_provider_type": [ + }, { - "name": "id", + "name": "mode", "type": "TypeString", - "description": "The unique identifier of the provider type.", + "description": "The mode that is used to get results from provider (`PUSH` or `PULL`).", "computed": true }, { - "name": "type", + "name": "icon", "type": "TypeString", - "description": "The type of the provider type.", + "description": "The icon of a provider in .svg format that is encoded as a base64 string.", "computed": true }, { @@ -68840,45 +71126,6 @@ } } }, - { - "name": "attributes", - "type": "TypeMap", - "description": "The attributes that are required when you're creating an instance of a provider type. The attributes field can have multiple keys in its value. Each of those keys has a value object that includes the type, and display name as keys. For example, `{type:\"\", display_name:\"\"}`. **NOTE;** If the provider type is s2s-enabled, which means that if the `s2s_enabled` field is set to `true`, then a CRN field of type text is required in the attributes value object.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the provider type.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Time at which resource was updated.", - "computed": true - }, - { - "name": "provider_type_id", - "type": "TypeString", - "description": "The provider type ID.", - "required": true - }, - { - "name": "data_type", - "type": "TypeString", - "description": "The format of the results that a provider supports.", - "computed": true - }, - { - "name": "icon", - "type": "TypeString", - "description": "The icon of a provider in .svg format that is encoded as a base64 string.", - "computed": true - }, { "name": "created_at", "type": "TypeString", @@ -68886,27 +71133,9 @@ "computed": true }, { - "name": "description", - "type": "TypeString", - "description": "The provider type description.", - "computed": true - }, - { - "name": "s2s_enabled", - "type": "TypeBool", - "description": "A boolean that indicates whether the provider type is s2s-enabled.", - "computed": true - }, - { - "name": "instance_limit", - "type": "TypeInt", - "description": "The maximum number of instances that can be created for the provider type.", - "computed": true - }, - { - "name": "mode", + "name": "updated_at", "type": "TypeString", - "description": "The mode that is used to get results from provider (`PUSH` or `PULL`).", + "description": "Time at which resource was updated.", "computed": true } ], @@ -69013,44 +71242,60 @@ "computed": true } } + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true } ], "ibm_scc_provider_type_instance": [ { - "name": "updated_at", + "name": "provider_type_instance_item_id", "type": "TypeString", - "description": "Time at which resource was updated.", + "description": "The unique identifier of the provider type instance.", "computed": true }, { - "name": "provider_type_id", + "name": "type", "type": "TypeString", - "description": "The provider type ID.", - "required": true + "description": "The type of the provider type.", + "computed": true }, { - "name": "provider_type_instance_id", + "name": "name", "type": "TypeString", - "description": "The provider type instance ID.", - "required": true + "description": "The name of the provider type instance.", + "computed": true }, { - "name": "provider_type_instance_item_id", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier of the provider type instance.", + "description": "Time at which resource was created.", "computed": true }, { - "name": "type", + "name": "instance_id", "type": "TypeString", - "description": "The type of the provider type.", - "computed": true + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "name", + "name": "provider_type_id", "type": "TypeString", - "description": "The name of the provider type instance.", - "computed": true + "description": "The provider type ID.", + "required": true + }, + { + "name": "provider_type_instance_id", + "type": "TypeString", + "description": "The provider type instance ID.", + "required": true }, { "name": "attributes", @@ -69058,45 +71303,13 @@ "computed": true }, { - "name": "created_at", + "name": "updated_at", "type": "TypeString", - "description": "Time at which resource was created.", + "description": "Time at which resource was updated.", "computed": true } ], "ibm_scc_report": [ - { - "name": "type", - "type": "TypeString", - "description": "The type of the scan.", - "computed": true - }, - { - "name": "profile", - "type": "TypeList", - "description": "The profile information.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "The profile ID.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The profile name.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "The profile version.", - "computed": true - } - } - }, { "name": "report_id", "type": "TypeString", @@ -69115,41 +71328,36 @@ "description": "The date when the scan was run.", "computed": true }, - { - "name": "cos_object", - "type": "TypeString", - "description": "The Cloud Object Storage object that is associated with the report.", - "computed": true - }, { "name": "instance_id", "type": "TypeString", - "description": "Instance ID.", + "description": "The ID of the Security and Compliance Center instance.", "cloud_data_type": "resource_instance", - "computed": true + "immutable": true, + "required": true }, { - "name": "account", + "name": "profile", "type": "TypeList", - "description": "The account that is associated with a report.", + "description": "The profile information.", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "The account ID.", + "description": "The profile ID.", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The account name.", + "description": "The profile name.", "computed": true }, - "type": { - "name": "type", + "version": { + "name": "version", "type": "TypeString", - "description": "The account type.", + "description": "The profile version.", "computed": true } } @@ -69237,19 +71445,57 @@ "type": "TypeString", "description": "The group ID that is associated with the report. The group ID combines profile, scope, and attachment IDs.", "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of the scan.", + "computed": true + }, + { + "name": "cos_object", + "type": "TypeString", + "description": "The Cloud Object Storage object that is associated with the report.", + "computed": true + }, + { + "name": "account", + "type": "TypeList", + "description": "The account that is associated with a report.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The account ID.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The account name.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The account type.", + "computed": true + } + } } ], "ibm_scc_report_controls": [ { - "name": "control_category", + "name": "control_name", "type": "TypeString", - "description": "A control category value.", + "description": "The name of the control.", "optional": true }, { - "name": "status", + "name": "control_category", "type": "TypeString", - "description": "The compliance status value.", + "description": "A control category value.", "optional": true }, { @@ -69259,15 +71505,27 @@ "computed": true }, { - "name": "total_count", + "name": "user_evaluation_required_count", "type": "TypeInt", - "description": "The total number of checks.", + "description": "The number of checks that require a user evaluation.", "computed": true }, { - "name": "compliant_count", + "name": "report_id", + "type": "TypeString", + "description": "The ID of the scan that is associated with a report.", + "required": true + }, + { + "name": "sort", + "type": "TypeString", + "description": "This field sorts controls by using a valid sort field. To learn more, see [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).", + "optional": true + }, + { + "name": "total_count", "type": "TypeInt", - "description": "The number of compliant checks.", + "description": "The total number of checks.", "computed": true }, { @@ -69276,6 +71534,44 @@ "description": "The number of checks that are not compliant.", "computed": true }, + { + "name": "unable_to_perform_count", + "type": "TypeInt", + "description": "The number of checks that are unable to perform.", + "computed": true + }, + { + "name": "control_id", + "type": "TypeString", + "description": "The ID of the control.", + "optional": true + }, + { + "name": "control_description", + "type": "TypeString", + "description": "The description of the control.", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The compliance status value.", + "optional": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "compliant_count", + "type": "TypeInt", + "description": "The number of compliant checks.", + "computed": true + }, { "name": "controls", "type": "TypeList", @@ -69505,101 +71801,9 @@ "computed": true } } - }, - { - "name": "report_id", - "type": "TypeString", - "description": "The ID of the scan that is associated with a report.", - "required": true - }, - { - "name": "control_description", - "type": "TypeString", - "description": "The description of the control.", - "optional": true - }, - { - "name": "sort", - "type": "TypeString", - "description": "This field sorts controls by using a valid sort field. To learn more, see [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).", - "optional": true - }, - { - "name": "control_id", - "type": "TypeString", - "description": "The ID of the control.", - "optional": true - }, - { - "name": "control_name", - "type": "TypeString", - "description": "The name of the control.", - "optional": true - }, - { - "name": "unable_to_perform_count", - "type": "TypeInt", - "description": "The number of checks that are unable to perform.", - "computed": true - }, - { - "name": "user_evaluation_required_count", - "type": "TypeInt", - "description": "The number of checks that require a user evaluation.", - "computed": true } ], "ibm_scc_report_evaluations": [ - { - "name": "component_id", - "type": "TypeString", - "description": "The ID of component.", - "optional": true - }, - { - "name": "target_id", - "type": "TypeString", - "description": "The ID of the evaluation target.", - "optional": true - }, - { - "name": "target_name", - "type": "TypeString", - "description": "The name of the evaluation target.", - "optional": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The evaluation status value.", - "optional": true - }, - { - "name": "first", - "type": "TypeList", - "description": "The page reference.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for the first and next page.", - "computed": true - } - } - }, - { - "name": "report_id", - "type": "TypeString", - "description": "The ID of the scan that is associated with a report.", - "required": true - }, - { - "name": "assessment_id", - "type": "TypeString", - "description": "The ID of the assessment.", - "optional": true - }, { "name": "home_account_id", "type": "TypeString", @@ -69809,31 +72013,71 @@ } } } - } - ], - "ibm_scc_report_resources": [ + }, { - "name": "sort", + "name": "instance_id", "type": "TypeString", - "description": "This field sorts resources by using a valid sort field. To learn more, see [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "report_id", + "type": "TypeString", + "description": "The ID of the scan that is associated with a report.", + "required": true + }, + { + "name": "assessment_id", + "type": "TypeString", + "description": "The ID of the assessment.", "optional": true }, { - "name": "id", + "name": "status", "type": "TypeString", - "description": "The ID of the resource.", + "description": "The evaluation status value.", "optional": true }, { - "name": "account_id", + "name": "first", + "type": "TypeList", + "description": "The page reference.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for the first and next page.", + "computed": true + } + } + }, + { + "name": "component_id", "type": "TypeString", - "description": "The ID of the account owning a resource.", + "description": "The ID of component.", "optional": true }, { - "name": "status", + "name": "target_id", "type": "TypeString", - "description": "The compliance status value.", + "description": "The ID of the evaluation target.", + "optional": true + }, + { + "name": "target_name", + "type": "TypeString", + "description": "The name of the evaluation target.", + "optional": true + } + ], + "ibm_scc_report_resources": [ + { + "name": "sort", + "type": "TypeString", + "description": "This field sorts resources by using a valid sort field. To learn more, see [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).", "optional": true }, { @@ -69850,6 +72094,50 @@ } } }, + { + "name": "report_id", + "type": "TypeString", + "description": "The ID of the scan that is associated with a report.", + "required": true + }, + { + "name": "id", + "type": "TypeString", + "description": "The ID of the resource.", + "optional": true + }, + { + "name": "component_id", + "type": "TypeString", + "description": "The ID of component.", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The compliance status value.", + "optional": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource.", + "optional": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "The ID of the account owning a resource.", + "optional": true + }, { "name": "home_account_id", "type": "TypeString", @@ -69955,24 +72243,6 @@ "computed": true } } - }, - { - "name": "report_id", - "type": "TypeString", - "description": "The ID of the scan that is associated with a report.", - "required": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource.", - "optional": true - }, - { - "name": "component_id", - "type": "TypeString", - "description": "The ID of component.", - "optional": true } ], "ibm_scc_report_rule": [ @@ -69983,21 +72253,27 @@ "required": true }, { - "name": "description", + "name": "id", "type": "TypeString", - "description": "The rule description.", + "description": "The rule ID.", "computed": true }, { - "name": "created_on", + "name": "type", "type": "TypeString", - "description": "The date when the rule was created.", + "description": "The rule type.", "computed": true }, { - "name": "created_by", + "name": "version", "type": "TypeString", - "description": "The ID of the user who created the rule.", + "description": "The rule version.", + "computed": true + }, + { + "name": "created_on", + "type": "TypeString", + "description": "The date when the rule was created.", "computed": true }, { @@ -70010,33 +72286,35 @@ } }, { - "name": "report_id", + "name": "instance_id", "type": "TypeString", - "description": "The ID of the scan that is associated with a report.", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, "required": true }, { - "name": "id", + "name": "report_id", "type": "TypeString", - "description": "The rule ID.", - "computed": true + "description": "The ID of the scan that is associated with a report.", + "required": true }, { - "name": "type", + "name": "description", "type": "TypeString", - "description": "The rule type.", + "description": "The rule description.", "computed": true }, { - "name": "version", + "name": "account_id", "type": "TypeString", - "description": "The rule version.", + "description": "The rule account ID.", "computed": true }, { - "name": "account_id", + "name": "created_by", "type": "TypeString", - "description": "The rule account ID.", + "description": "The ID of the user who created the rule.", "computed": true }, { @@ -70053,32 +72331,6 @@ } ], "ibm_scc_report_summary": [ - { - "name": "account", - "type": "TypeList", - "description": "The account that is associated with a report.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "The account ID.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The account name.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The account type.", - "computed": true - } - } - }, { "name": "score", "type": "TypeList", @@ -70340,6 +72592,14 @@ } } }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "report_id", "type": "TypeString", @@ -70351,9 +72611,41 @@ "type": "TypeString", "description": "Instance ID.", "computed": true + }, + { + "name": "account", + "type": "TypeList", + "description": "The account that is associated with a report.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The account ID.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The account name.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The account type.", + "computed": true + } + } } ], "ibm_scc_report_tags": [ + { + "name": "report_id", + "type": "TypeString", + "description": "The ID of the scan that is associated with a report.", + "required": true + }, { "name": "tags", "type": "TypeList", @@ -70391,9 +72683,11 @@ } }, { - "name": "report_id", + "name": "instance_id", "type": "TypeString", - "description": "The ID of the scan that is associated with a report.", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, "required": true } ], @@ -70486,72 +72780,34 @@ "computed": true } } + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true } ], "ibm_scc_rule": [ { - "name": "rule_id", + "name": "created_by", "type": "TypeString", - "description": "The ID of the corresponding rule.", - "required": true + "description": "The user who created the rule.", + "computed": true }, { - "name": "updated_by", + "name": "version", "type": "TypeString", - "description": "The user who modified the rule.", + "description": "The version number of a rule.", "computed": true }, { - "name": "target", - "type": "TypeList", - "description": "The rule target.", - "computed": true, - "elem": { - "additional_target_attributes": { - "name": "additional_target_attributes", - "type": "TypeList", - "description": "The list of targets supported properties.", - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "The additional target attribute name.", - "computed": true - }, - "operator": { - "name": "operator", - "type": "TypeString", - "description": "The operator.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The value.", - "computed": true - } - } - }, - "resource_kind": { - "name": "resource_kind", - "type": "TypeString", - "description": "The target resource kind.", - "computed": true - }, - "service_display_name": { - "name": "service_display_name", - "type": "TypeString", - "description": "The display name of the target service.", - "computed": true - }, - "service_name": { - "name": "service_name", - "type": "TypeString", - "description": "The target service name.", - "computed": true - } - } + "name": "rule_id", + "type": "TypeString", + "description": "The ID of the corresponding rule.", + "required": true }, { "name": "labels", @@ -70562,18 +72818,6 @@ "type": "TypeString" } }, - { - "name": "updated_on", - "type": "TypeString", - "description": "The date when the rule was modified.", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The rule type (allowable values are `user_defined` or `system_defined`).", - "computed": true - }, { "name": "required_config", "type": "TypeList", @@ -70804,36 +73048,6 @@ "description": "The details of a rule's response.", "computed": true }, - { - "name": "version", - "type": "TypeString", - "description": "The version number of a rule.", - "computed": true - }, - { - "name": "created_on", - "type": "TypeString", - "description": "The date when the rule was created.", - "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The user who created the rule.", - "computed": true - }, - { - "name": "account_id", - "type": "TypeString", - "description": "The account ID.", - "computed": true - }, - { - "name": "id", - "type": "TypeString", - "description": "The rule ID.", - "computed": true - }, { "name": "import", "type": "TypeList", @@ -70873,129 +73087,131 @@ } } } - } - ], - "ibm_schematics_action": [ - { - "name": "name", - "type": "TypeString", - "description": "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", - "computed": true }, { - "name": "source", + "name": "target", "type": "TypeList", - "description": "Source of templates, playbooks, or controls.", + "description": "The rule target.", "computed": true, "elem": { - "catalog": { - "name": "catalog", + "additional_target_attributes": { + "name": "additional_target_attributes", "type": "TypeList", - "description": "Connection details to IBM Cloud Catalog source.", + "description": "The list of targets supported properties.", "computed": true, "elem": { - "catalog_name": { - "name": "catalog_name", - "type": "TypeString", - "description": "name of the private catalog.", - "computed": true - }, - "offering_id": { - "name": "offering_id", - "type": "TypeString", - "description": "Id of the offering the IBM Catalog.", - "computed": true - }, - "offering_kind": { - "name": "offering_kind", - "type": "TypeString", - "description": "Type of the offering, in the IBM Catalog.", - "computed": true - }, - "offering_name": { - "name": "offering_name", - "type": "TypeString", - "description": "Name of the offering in the IBM Catalog.", - "computed": true - }, - "offering_repo_url": { - "name": "offering_repo_url", + "name": { + "name": "name", "type": "TypeString", - "description": "Repo Url of the offering, in the IBM Catalog.", + "description": "The additional target attribute name.", "computed": true }, - "offering_version": { - "name": "offering_version", + "operator": { + "name": "operator", "type": "TypeString", - "description": "Version string of the offering in the IBM Catalog.", + "description": "The operator.", "computed": true }, - "offering_version_id": { - "name": "offering_version_id", + "value": { + "name": "value", "type": "TypeString", - "description": "Id of the offering version the IBM Catalog.", + "description": "The value.", "computed": true } } }, - "git": { - "name": "git", - "type": "TypeList", - "description": "Connection details to Git source.", - "computed": true, - "elem": { - "computed_git_repo_url": { - "name": "computed_git_repo_url", - "type": "TypeString", - "description": "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", - "computed": true - }, - "git_branch": { - "name": "git_branch", - "type": "TypeString", - "description": "Name of the branch, used to fetch the Git Repo.", - "computed": true - }, - "git_release": { - "name": "git_release", - "type": "TypeString", - "description": "Name of the release tag, used to fetch the Git Repo.", - "computed": true - }, - "git_repo_folder": { - "name": "git_repo_folder", - "type": "TypeString", - "description": "Name of the folder in the Git Repo, that contains the template.", - "computed": true - }, - "git_repo_url": { - "name": "git_repo_url", - "type": "TypeString", - "description": "URL to the GIT Repo that can be used to clone the template.", - "computed": true - }, - "git_token": { - "name": "git_token", - "type": "TypeString", - "description": "Personal Access Token to connect to Git URLs.", - "computed": true - } - } + "resource_kind": { + "name": "resource_kind", + "type": "TypeString", + "description": "The target resource kind.", + "computed": true }, - "source_type": { - "name": "source_type", + "service_display_name": { + "name": "service_display_name", "type": "TypeString", - "description": "Type of source for the Template.", + "description": "The display name of the target service.", + "computed": true + }, + "service_name": { + "name": "service_name", + "type": "TypeString", + "description": "The target service name.", "computed": true } } }, { - "name": "source_created_at", + "name": "updated_by", "type": "TypeString", - "description": "Action Playbook Source creation time.", + "description": "The user who modified the rule.", + "computed": true + }, + { + "name": "updated_on", + "type": "TypeString", + "description": "The date when the rule was modified.", + "computed": true + }, + { + "name": "id", + "type": "TypeString", + "description": "The rule ID.", + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "The account ID.", "computed": true }, + { + "name": "type", + "type": "TypeString", + "description": "The rule type (allowable values are `user_defined` or `system_defined`).", + "computed": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "created_on", + "type": "TypeString", + "description": "The date when the rule was created.", + "computed": true + } + ], + "ibm_schematics_action": [ + { + "name": "user_state", + "type": "TypeList", + "description": "User defined status of the Schematics object.", + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + "computed": true + } + } + }, { "name": "bastion", "type": "TypeList", @@ -71017,9 +73233,9 @@ } }, { - "name": "action_outputs", + "name": "action_inputs", "type": "TypeList", - "description": "Output variables for the Action.", + "description": "Input variables for the Action.", "computed": true, "elem": { "link": { @@ -71153,42 +73369,22 @@ } }, { - "name": "created_by", + "name": "id", "type": "TypeString", - "description": "E-mail address of the user who created an action.", + "description": "Action ID.", "computed": true }, { - "name": "sys_lock", - "type": "TypeList", - "description": "System lock status.", - "computed": true, - "elem": { - "sys_locked": { - "name": "sys_locked", - "type": "TypeBool", - "description": "Is the automation locked by a Schematic job ?.", - "computed": true - }, - "sys_locked_at": { - "name": "sys_locked_at", - "type": "TypeString", - "description": "When the User performed the job that lead to locking of the automation ?.", - "computed": true - }, - "sys_locked_by": { - "name": "sys_locked_by", - "type": "TypeString", - "description": "Name of the User who performed the job, that lead to the locking of the automation.", - "computed": true - } - } + "name": "source_created_by", + "type": "TypeString", + "description": "E-mail address of user who created the Action Playbook Source.", + "computed": true }, { - "name": "action_id", + "name": "updated_at", "type": "TypeString", - "description": "Action Id. Use GET /actions API to look up the Action Ids in your IBM Cloud account.", - "required": true + "description": "Action updation time.", + "computed": true }, { "name": "description", @@ -71197,71 +73393,225 @@ "computed": true }, { - "name": "command_parameter", + "name": "resource_group", "type": "TypeString", - "description": "Schematics job command parameter (playbook-name).", + "description": "Resource-group name for an action. By default, action is created in default resource group.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "inventory", + "name": "command_parameter", "type": "TypeString", - "description": "Target inventory record ID, used by the action or ansible playbook.", + "description": "Schematics job command parameter (playbook-name).", "computed": true }, { - "name": "source_type", - "type": "TypeString", - "description": "Type of source for the Template.", - "computed": true + "name": "bastion_credential", + "type": "TypeList", + "description": "User editable variable data \u0026 system generated reference to value.", + "computed": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } }, { - "name": "source_updated_by", + "name": "source_created_at", "type": "TypeString", - "description": "E-mail address of user who updated the action playbook source.", + "description": "Action Playbook Source creation time.", "computed": true }, { - "name": "updated_at", + "name": "source_updated_by", "type": "TypeString", - "description": "Action updation time.", + "description": "E-mail address of user who updated the action playbook source.", "computed": true }, { - "name": "tags", + "name": "playbook_names", "type": "TypeList", - "description": "Action tags.", - "cloud_data_type": "tags", + "description": "Playbook names retrieved from the respository.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "user_state", + "name": "sys_lock", "type": "TypeList", - "description": "User defined status of the Schematics object.", + "description": "System lock status.", "computed": true, "elem": { - "set_at": { - "name": "set_at", - "type": "TypeString", - "description": "When the User who set the state of the Object.", + "sys_locked": { + "name": "sys_locked", + "type": "TypeBool", + "description": "Is the automation locked by a Schematic job ?.", "computed": true }, - "set_by": { - "name": "set_by", + "sys_locked_at": { + "name": "sys_locked_at", "type": "TypeString", - "description": "Name of the User who set the state of the Object.", + "description": "When the User performed the job that lead to locking of the automation ?.", "computed": true }, - "state": { - "name": "state", + "sys_locked_by": { + "name": "sys_locked_by", "type": "TypeString", - "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + "description": "Name of the User who performed the job, that lead to the locking of the automation.", "computed": true } } }, + { + "name": "action_id", + "type": "TypeString", + "description": "Action Id. Use GET /actions API to look up the Action Ids in your IBM Cloud account.", + "required": true + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "cloud_data_type": "region", + "optional": true, + "computed": true + }, + { + "name": "tags", + "type": "TypeList", + "description": "Action tags.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "credentials", "type": "TypeList", @@ -71361,15 +73711,33 @@ "computed": true }, { - "name": "source_readme_url", + "name": "inventory", "type": "TypeString", - "description": "URL of the `README` file, for the source URL.", + "description": "Target inventory record ID, used by the action or ansible playbook.", "computed": true }, { - "name": "bastion_credential", + "name": "targets_ini", + "type": "TypeString", + "description": "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Action creation time.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", + "computed": true + }, + { + "name": "settings", "type": "TypeList", - "description": "User editable variable data \u0026 system generated reference to value.", + "description": "Environment variables for the Action.", "computed": true, "elem": { "link": { @@ -71503,9 +73871,147 @@ } }, { - "name": "settings", + "name": "created_by", + "type": "TypeString", + "description": "E-mail address of the user who created an action.", + "computed": true + }, + { + "name": "source_readme_url", + "type": "TypeString", + "description": "URL of the `README` file, for the source URL.", + "computed": true + }, + { + "name": "account", + "type": "TypeString", + "description": "Action account ID.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "E-mail address of the user who updated an action.", + "computed": true + }, + { + "name": "source", "type": "TypeList", - "description": "Environment variables for the Action.", + "description": "Source of templates, playbooks, or controls.", + "computed": true, + "elem": { + "catalog": { + "name": "catalog", + "type": "TypeList", + "description": "Connection details to IBM Cloud Catalog source.", + "computed": true, + "elem": { + "catalog_name": { + "name": "catalog_name", + "type": "TypeString", + "description": "name of the private catalog.", + "computed": true + }, + "offering_id": { + "name": "offering_id", + "type": "TypeString", + "description": "Id of the offering the IBM Catalog.", + "computed": true + }, + "offering_kind": { + "name": "offering_kind", + "type": "TypeString", + "description": "Type of the offering, in the IBM Catalog.", + "computed": true + }, + "offering_name": { + "name": "offering_name", + "type": "TypeString", + "description": "Name of the offering in the IBM Catalog.", + "computed": true + }, + "offering_repo_url": { + "name": "offering_repo_url", + "type": "TypeString", + "description": "Repo Url of the offering, in the IBM Catalog.", + "computed": true + }, + "offering_version": { + "name": "offering_version", + "type": "TypeString", + "description": "Version string of the offering in the IBM Catalog.", + "computed": true + }, + "offering_version_id": { + "name": "offering_version_id", + "type": "TypeString", + "description": "Id of the offering version the IBM Catalog.", + "computed": true + } + } + }, + "git": { + "name": "git", + "type": "TypeList", + "description": "Connection details to Git source.", + "computed": true, + "elem": { + "computed_git_repo_url": { + "name": "computed_git_repo_url", + "type": "TypeString", + "description": "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", + "computed": true + }, + "git_branch": { + "name": "git_branch", + "type": "TypeString", + "description": "Name of the branch, used to fetch the Git Repo.", + "computed": true + }, + "git_release": { + "name": "git_release", + "type": "TypeString", + "description": "Name of the release tag, used to fetch the Git Repo.", + "computed": true + }, + "git_repo_folder": { + "name": "git_repo_folder", + "type": "TypeString", + "description": "Name of the folder in the Git Repo, that contains the template.", + "computed": true + }, + "git_repo_url": { + "name": "git_repo_url", + "type": "TypeString", + "description": "URL to the GIT Repo that can be used to clone the template.", + "computed": true + }, + "git_token": { + "name": "git_token", + "type": "TypeString", + "description": "Personal Access Token to connect to Git URLs.", + "computed": true + } + } + }, + "source_type": { + "name": "source_type", + "type": "TypeString", + "description": "Type of source for the Template.", + "computed": true + } + } + }, + { + "name": "source_type", + "type": "TypeString", + "description": "Type of source for the Template.", + "computed": true + }, + { + "name": "action_outputs", + "type": "TypeList", + "description": "Output variables for the Action.", "computed": true, "elem": { "link": { @@ -71638,6 +74144,12 @@ } } }, + { + "name": "source_updated_at", + "type": "TypeString", + "description": "The action playbook updation time.", + "computed": true + }, { "name": "state", "type": "TypeList", @@ -71663,64 +74175,396 @@ "computed": true } } + } + ], + "ibm_schematics_agent": [ + { + "name": "resource_group", + "type": "TypeString", + "description": "The resource-group name for the agent. By default, agent will be registered in Default Resource Group.", + "cloud_data_type": "resource_group", + "computed": true }, { - "name": "location", + "name": "schematics_location", "type": "TypeString", "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "cloud_data_type": "region", - "optional": true, "computed": true }, { - "name": "action_inputs", + "name": "agent_infrastructure", "type": "TypeList", - "description": "Input variables for the Action.", + "description": "The infrastructure parameters used by the agent.", + "computed": true, + "elem": { + "cluster_id": { + "name": "cluster_id", + "type": "TypeString", + "description": "The cluster ID where agent services will be running.", + "computed": true + }, + "cluster_resource_group": { + "name": "cluster_resource_group", + "type": "TypeString", + "description": "The resource group of the cluster (is it required?).", + "computed": true + }, + "cos_bucket_name": { + "name": "cos_bucket_name", + "type": "TypeString", + "description": "The COS bucket name used to store the logs.", + "computed": true + }, + "cos_bucket_region": { + "name": "cos_bucket_region", + "type": "TypeString", + "description": "The COS bucket region.", + "computed": true + }, + "cos_instance_name": { + "name": "cos_instance_name", + "type": "TypeString", + "description": "The COS instance name to store the agent logs.", + "computed": true + }, + "infra_type": { + "name": "infra_type", + "type": "TypeString", + "description": "Type of target agent infrastructure.", + "computed": true + } + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The agent creation date-time.", + "computed": true + }, + { + "name": "system_state", + "type": "TypeList", + "description": "Computed state of the agent.", + "computed": true, + "elem": { + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Agent Status.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The agent status message.", + "computed": true + } + } + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the agent (must be unique, for an account).", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Agent description.", + "computed": true + }, + { + "name": "agent_crn", + "type": "TypeString", + "description": "The agent crn, obtained from the Schematics agent deployment configuration.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the agent registration.", + "computed": true + }, + { + "name": "agent_kpi", + "type": "TypeList", + "description": "Schematics Agent key performance indicators.", + "computed": true, + "elem": { + "application_indicators": { + "name": "application_indicators", + "type": "TypeList", + "description": "Agent application key performance indicators.", + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "availability_indicator": { + "name": "availability_indicator", + "type": "TypeString", + "description": "Overall availability indicator reported by the agent.", + "computed": true + }, + "infra_indicators": { + "name": "infra_indicators", + "type": "TypeList", + "description": "Agent infrastructure key performance indicators.", + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "lifecycle_indicator": { + "name": "lifecycle_indicator", + "type": "TypeString", + "description": "Overall lifecycle indicator reported by the agents.", + "computed": true + }, + "percent_usage_indicator": { + "name": "percent_usage_indicator", + "type": "TypeString", + "description": "Percentage usage of the agent resources.", + "computed": true + } + } + }, + { + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "required": true + }, + { + "name": "agent_location", + "type": "TypeString", + "description": "The location where agent is deployed in the user environment.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The agent registration updation time.", + "computed": true + }, + { + "name": "recent_prs_job", + "type": "TypeList", + "description": "Run a pre-requisite scanner for deploying agent.", + "computed": true, + "elem": { + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", + "computed": true + }, + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full pre-requisite scanner job logs.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the pre-requisite scanner job.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the pre-requisite scanner job, in a formatted log string.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent prs job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent prs job.", + "computed": true + } + } + }, + { + "name": "creation_by", + "type": "TypeString", + "description": "The email address of an user who created the agent.", + "computed": true + }, + { + "name": "recent_deploy_job", + "type": "TypeList", + "description": "Post-installations checks for Agent health.", + "computed": true, + "elem": { + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", + "computed": true + }, + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "is_redeployed": { + "name": "is_redeployed", + "type": "TypeBool", + "description": "True, when the same version of the agent was redeployed.", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full agent deployment job logs.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the agent deployment job.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the agent deployment job, in a formatted log string.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent deploy job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent deploy job.", + "computed": true + } + } + }, + { + "name": "tags", + "type": "TypeList", + "description": "Tags for the agent.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + { + "name": "agent_metadata", + "type": "TypeList", + "description": "The metadata of an agent.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the metadata.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeList", + "description": "Value of the metadata name.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + { + "name": "agent_inputs", + "type": "TypeList", + "description": "Additional input variables for the agent.", "computed": true, "elem": { "link": { "name": "link", "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", + "description": "The reference link to the variable value By default the expression points to `$self.value`.", "computed": true }, "metadata": { "name": "metadata", "type": "TypeList", - "description": "User editable metadata for the variables.", + "description": "An user editable metadata for the variables.", "computed": true, "elem": { "aliases": { "name": "aliases", "type": "TypeList", - "description": "List of aliases for the variable name.", + "description": "The list of aliases for the variable name.", "computed": true, "elem": { "type": "TypeString" } }, + "cloud_data_type": { + "name": "cloud_data_type", + "type": "TypeString", + "description": "Cloud data type of the variable. eg. resource_group_id, region, vpc_id.", + "computed": true + }, "default_value": { "name": "default_value", "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", + "description": "Default value for the variable only if the override value is not specified.", "computed": true }, "description": { "name": "description", "type": "TypeString", - "description": "Description of the meta data.", + "description": "The description of the meta data.", "computed": true }, "group_by": { "name": "group_by", "type": "TypeString", - "description": "Display name of the group this variable belongs to.", + "description": "The display name of the group this variable belongs to.", "computed": true }, "hidden": { "name": "hidden", "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", + "description": "If **true**, the variable is not displayed on UI or Command line.", "computed": true }, "immutable": { @@ -71729,40 +74573,46 @@ "description": "Is the variable readonly ?.", "computed": true }, + "link_status": { + "name": "link_status", + "type": "TypeString", + "description": "The status of the link.", + "computed": true + }, "matches": { "name": "matches", "type": "TypeString", - "description": "Regex for the variable value.", + "description": "The regex for the variable value.", "computed": true }, "max_length": { "name": "max_length", "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", + "description": "The maximum length of the variable value. Applicable for the string type.", "computed": true }, "max_value": { "name": "max_value", "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", + "description": "The maximum value of the variable. Applicable for the integer type.", "computed": true }, "min_length": { "name": "min_length", "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", + "description": "The minimum length of the variable value. Applicable for the string type.", "computed": true }, "min_value": { "name": "min_value", "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", + "description": "The minimum value of the variable. Applicable for the integer type.", "computed": true }, "options": { "name": "options", "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "description": "The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime.", "computed": true, "elem": { "type": "TypeString" @@ -71771,7 +74621,13 @@ "position": { "name": "position", "type": "TypeInt", - "description": "Relative position of this variable in a list.", + "description": "The relative position of this variable in a list.", + "computed": true + }, + "required": { + "name": "required", + "type": "TypeBool", + "description": "If the variable required?.", "computed": true }, "secure": { @@ -71783,7 +74639,7 @@ "source": { "name": "source", "type": "TypeString", - "description": "Source of this meta-data.", + "description": "The source of this meta-data.", "computed": true }, "type": { @@ -71797,678 +74653,1148 @@ "name": { "name": "name", "type": "TypeString", - "description": "Name of the variable.", + "description": "The name of the variable. For example, `name = \"inventory username\"`.", + "computed": true + }, + "use_default": { + "name": "use_default", + "type": "TypeBool", + "description": "True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used.", "computed": true }, "value": { "name": "value", "type": "TypeString", - "description": "Value for the variable or reference to the value.", + "description": "The value for the variable or reference to the value. For example, `value = \"\u003cprovide your ssh_key_value with \n\u003e\"`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls.", "computed": true } } }, { - "name": "account", + "name": "user_state", + "type": "TypeList", + "description": "User defined status of the agent.", + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + "computed": true + } + } + }, + { + "name": "id", "type": "TypeString", - "description": "Action account ID.", + "description": "The agent resource id.", "computed": true }, { - "name": "source_created_by", + "name": "recent_health_job", + "type": "TypeList", + "description": "Agent health check.", + "computed": true, + "elem": { + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", + "computed": true + }, + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full health-check job logs.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the health-check job.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the health-check job, in a formatted log string.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent health check job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent health check job.", + "computed": true + } + } + } + ], + "ibm_schematics_agent_deploy": [ + { + "name": "status_code", "type": "TypeString", - "description": "E-mail address of user who created the Action Playbook Source.", + "description": "Final result of the agent deployment job.", "computed": true }, { - "name": "targets_ini", + "name": "status_message", "type": "TypeString", - "description": "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", + "description": "The outcome of the agent deployment job, in a formatted log string.", "computed": true }, { - "name": "updated_by", + "name": "log_url", "type": "TypeString", - "description": "E-mail address of the user who updated an action.", + "description": "URL to the full agent deployment job logs.", "computed": true }, { - "name": "playbook_names", - "type": "TypeList", - "description": "Playbook names retrieved from the respository.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "required": true }, { - "name": "resource_group", + "name": "updated_by", "type": "TypeString", - "description": "Resource-group name for an action. By default, action is created in default resource group.", - "cloud_data_type": "resource_group", + "description": "Email address of user who ran the agent deploy job.", "computed": true }, { - "name": "id", + "name": "is_redeployed", + "type": "TypeBool", + "description": "True, when the same version of the agent was redeployed.", + "computed": true + }, + { + "name": "agent_version", "type": "TypeString", - "description": "Action ID.", + "description": "Agent version.", "computed": true }, { - "name": "source_updated_at", + "name": "job_id", "type": "TypeString", - "description": "The action playbook updation time.", + "description": "Job Id.", "computed": true }, { - "name": "created_at", + "name": "updated_at", "type": "TypeString", - "description": "Action creation time.", + "description": "The agent deploy job updation time.", "computed": true } ], - "ibm_schematics_inventory": [ + "ibm_schematics_agent_health": [ { - "name": "id", + "name": "status_message", "type": "TypeString", - "description": "Inventory id.", + "description": "The outcome of the health-check job, in a formatted log string.", "computed": true }, { - "name": "description", + "name": "log_url", "type": "TypeString", - "description": "The description of your Inventory. The description can be up to 2048 characters long in size.", + "description": "URL to the full health-check job logs.", "computed": true }, { - "name": "location", + "name": "agent_id", "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "cloud_data_type": "region", - "optional": true, - "computed": true + "description": "Agent ID to get the details of agent.", + "required": true }, { - "name": "resource_group", + "name": "job_id", "type": "TypeString", - "description": "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", - "cloud_data_type": "resource_group", + "description": "Job Id.", "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "Email address of user who created the Inventory.", + "description": "The agent health check job updation time.", "computed": true }, { "name": "updated_by", "type": "TypeString", - "description": "Email address of user who updated the Inventory.", + "description": "Email address of user who ran the agent health check job.", "computed": true }, { - "name": "resource_queries", - "type": "TypeList", - "description": "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true }, { - "name": "inventory_id", + "name": "status_code", "type": "TypeString", - "description": "Resource Inventory Id. Use `GET /v2/inventories` API to look up the Resource Inventory definition Ids in your IBM Cloud account.", - "required": true - }, + "description": "Final result of the health-check job.", + "computed": true + } + ], + "ibm_schematics_agent_prs": [ { - "name": "created_at", + "name": "job_id", "type": "TypeString", - "description": "Inventory creation time.", + "description": "Job Id.", "computed": true }, { "name": "updated_at", "type": "TypeString", - "description": "Inventory updation time.", + "description": "The agent prs job updation time.", "computed": true }, { - "name": "inventories_ini", + "name": "updated_by", "type": "TypeString", - "description": "Input inventory of host and host group for the playbook, in the .ini file format.", + "description": "Email address of user who ran the agent prs job.", "computed": true }, { - "name": "name", + "name": "agent_version", "type": "TypeString", - "description": "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + "description": "Agent version.", + "computed": true + }, + { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the pre-requisite scanner job.", + "computed": true + }, + { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the pre-requisite scanner job, in a formatted log string.", + "computed": true + }, + { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full pre-requisite scanner job logs.", "computed": true + }, + { + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "required": true } ], - "ibm_schematics_job": [ + "ibm_schematics_agents": [ { - "name": "submitted_by", + "name": "name", "type": "TypeString", - "description": "Email address of user who submitted the job.", + "description": "The name of the agent (must be unique, for an account).", + "optional": true + }, + { + "name": "total_count", + "type": "TypeInt", + "description": "The total number of records.", "computed": true }, { - "name": "end_at", - "type": "TypeString", - "description": "Job end time.", + "name": "limit", + "type": "TypeInt", + "description": "The number of records returned.", "computed": true }, { - "name": "data", + "name": "offset", + "type": "TypeInt", + "description": "The skipped number of records.", + "computed": true + }, + { + "name": "agents", "type": "TypeList", - "description": "Job data.", + "description": "The list of agents in the account.", "computed": true, "elem": { - "action_job_data": { - "name": "action_job_data", + "agent_crn": { + "name": "agent_crn", + "type": "TypeString", + "description": "The Agent crn, obtained from the Schematics Agent deployment configuration.", + "computed": true + }, + "agent_location": { + "name": "agent_location", + "type": "TypeString", + "description": "The location where agent is deployed in the user environment.", + "computed": true + }, + "connection_state": { + "name": "connection_state", "type": "TypeList", - "description": "Action Job data.", + "description": "Connection status of the agent.", "computed": true, "elem": { - "action_name": { - "name": "action_name", + "checked_at": { + "name": "checked_at", "type": "TypeString", - "description": "Flow name.", + "description": "When the connection state is modified.", "computed": true }, - "inputs": { - "name": "inputs", - "type": "TypeList", - "description": "Input variables data used by the Action Job.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } - }, - "inventory_record": { - "name": "inventory_record", + "state": { + "name": "state", + "type": "TypeString", + "description": "Agent Connection Status * `Connected` When Schematics is able to connect to the agent. * `Disconnected` When Schematics is able not connect to the agent.", + "computed": true + } + } + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Agent description.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The Agent registration id.", + "computed": true + }, + "location": { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of the agent (must be unique, for an account).", + "computed": true + }, + "profile_id": { + "name": "profile_id", + "type": "TypeString", + "description": "The IAM trusted profile id, used by the Agent instance.", + "computed": true + }, + "registered_at": { + "name": "registered_at", + "type": "TypeString", + "description": "The Agent registration date-time.", + "computed": true + }, + "registered_by": { + "name": "registered_by", + "type": "TypeString", + "description": "The email address of an user who registered the Agent.", + "computed": true + }, + "resource_group": { + "name": "resource_group", + "type": "TypeString", + "description": "The resource-group name for the agent. By default, Agent will be registered in Default Resource Group.", + "computed": true + }, + "system_state": { + "name": "system_state", + "type": "TypeList", + "description": "Computed state of the agent.", + "computed": true, + "elem": { + "message": { + "name": "message", + "type": "TypeString", + "description": "The Agent status message.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "Agent Status.", + "computed": true + } + } + }, + "tags": { + "name": "tags", + "type": "TypeList", + "description": "Tags for the agent.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The Agent registration updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the Agent registration.", + "computed": true + }, + "user_state": { + "name": "user_state", + "type": "TypeList", + "description": "User defined status of the agent.", + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + "computed": true + } + } + } + } + } + ], + "ibm_schematics_inventory": [ + { + "name": "id", + "type": "TypeString", + "description": "Inventory id.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of your Inventory. The description can be up to 2048 characters long in size.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Inventory creation time.", + "computed": true + }, + { + "name": "resource_queries", + "type": "TypeList", + "description": "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "inventory_id", + "type": "TypeString", + "description": "Resource Inventory Id. Use `GET /v2/inventories` API to look up the Resource Inventory definition Ids in your IBM Cloud account.", + "required": true + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "cloud_data_type": "region", + "optional": true, + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "Email address of user who created the Inventory.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Inventory updation time.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the Inventory.", + "computed": true + }, + { + "name": "inventories_ini", + "type": "TypeString", + "description": "Input inventory of host and host group for the playbook, in the .ini file format.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + "computed": true + } + ], + "ibm_schematics_job": [ + { + "name": "tags", + "type": "TypeList", + "description": "User defined tags, while running the job.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "id", + "type": "TypeString", + "description": "Job ID.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Job name, uniquely derived from the related Workspace or Action.", + "computed": true + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "cloud_data_type": "region", + "optional": true, + "computed": true + }, + { + "name": "submitted_by", + "type": "TypeString", + "description": "Email address of user who submitted the job.", + "computed": true + }, + { + "name": "log_store_url", + "type": "TypeString", + "description": "Job log store URL.", + "computed": true + }, + { + "name": "command_options", + "type": "TypeList", + "description": "Command line options for the command.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "duration", + "type": "TypeString", + "description": "Duration of job execution; example 40 sec.", + "computed": true + }, + { + "name": "bastion", + "type": "TypeList", + "description": "Describes a bastion resource.", + "computed": true, + "elem": { + "host": { + "name": "host", + "type": "TypeString", + "description": "Reference to the Inventory resource definition.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Bastion Name(Unique).", + "computed": true + } + } + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name derived from the related Workspace or Action.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", + "computed": true + }, + { + "name": "end_at", + "type": "TypeString", + "description": "Job end time.", + "computed": true + }, + { + "name": "log_summary", + "type": "TypeList", + "description": "Job log summary record.", + "computed": true, + "elem": { + "action_job": { + "name": "action_job", + "type": "TypeList", + "description": "Flow Job log summary.", + "computed": true, + "elem": { + "play_count": { + "name": "play_count", + "type": "TypeFloat", + "description": "number of plays in playbook.", + "computed": true + }, + "recap": { + "name": "recap", "type": "TypeList", - "description": "Complete inventory resource details with user inputs and system generated data.", + "description": "Recap records.", "computed": true, "elem": { - "created_at": { - "name": "created_at", - "type": "TypeString", - "description": "Inventory creation time.", - "computed": true - }, - "created_by": { - "name": "created_by", - "type": "TypeString", - "description": "Email address of user who created the Inventory.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "The description of your Inventory. The description can be up to 2048 characters long in size.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Inventory id.", - "computed": true - }, - "inventories_ini": { - "name": "inventories_ini", - "type": "TypeString", - "description": "Input inventory of host and host group for the playbook, in the .ini file format.", + "changed": { + "name": "changed", + "type": "TypeFloat", + "description": "Number of changed.", "computed": true }, - "location": { - "name": "location", - "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "failed": { + "name": "failed", + "type": "TypeFloat", + "description": "Number of failed.", "computed": true }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + "ok": { + "name": "ok", + "type": "TypeFloat", + "description": "Number of OK.", "computed": true }, - "resource_group": { - "name": "resource_group", - "type": "TypeString", - "description": "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", + "skipped": { + "name": "skipped", + "type": "TypeFloat", + "description": "Number of skipped.", "computed": true }, - "resource_queries": { - "name": "resource_queries", + "target": { + "name": "target", "type": "TypeList", - "description": "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", + "description": "List of target or host name.", "computed": true, "elem": { "type": "TypeString" } }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Inventory updation time.", - "computed": true - }, - "updated_by": { - "name": "updated_by", - "type": "TypeString", - "description": "Email address of user who updated the Inventory.", + "unreachable": { + "name": "unreachable", + "type": "TypeFloat", + "description": "Number of unreachable.", "computed": true } } }, - "materialized_inventory": { - "name": "materialized_inventory", - "type": "TypeString", - "description": "Materialized inventory details used by the Action Job, in .ini format.", + "target_count": { + "name": "target_count", + "type": "TypeFloat", + "description": "number of targets or hosts.", "computed": true }, - "outputs": { - "name": "outputs", + "task_count": { + "name": "task_count", + "type": "TypeFloat", + "description": "number of tasks in playbook.", + "computed": true + } + } + }, + "elapsed_time": { + "name": "elapsed_time", + "type": "TypeFloat", + "description": "Job log elapsed time (log_analyzed_till - log_start_at).", + "computed": true + }, + "flow_job": { + "name": "flow_job", + "type": "TypeList", + "description": "Flow Job log summary.", + "computed": true, + "elem": { + "workitems": { + "name": "workitems", "type": "TypeList", - "description": "Output variables data from the Action Job.", "computed": true, "elem": { - "link": { - "name": "link", + "job_id": { + "name": "job_id", "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", + "description": "workspace JOB ID.", "computed": true }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", + "log_url": { + "name": "log_url", "type": "TypeString", - "description": "Name of the variable.", + "description": "Log url for job.", "computed": true }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } - }, - "settings": { - "name": "settings", - "type": "TypeList", - "description": "Environment variables used by all the templates in the Action.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", + "resources_add": { + "name": "resources_add", + "type": "TypeFloat", + "description": "Number of resources add.", "computed": true }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } + "resources_destroy": { + "name": "resources_destroy", + "type": "TypeFloat", + "description": "Number of resources destroy.", + "computed": true }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", + "resources_modify": { + "name": "resources_modify", + "type": "TypeFloat", + "description": "Number of resources modify.", "computed": true }, - "value": { - "name": "value", + "workspace_id": { + "name": "workspace_id", "type": "TypeString", - "description": "Value for the variable or reference to the value.", + "description": "workspace ID.", "computed": true } } }, + "workitems_completed": { + "name": "workitems_completed", + "type": "TypeFloat", + "description": "Number of workitems completed successfully.", + "computed": true + }, + "workitems_failed": { + "name": "workitems_failed", + "type": "TypeFloat", + "description": "Number of workitems failed.", + "computed": true + }, + "workitems_pending": { + "name": "workitems_pending", + "type": "TypeFloat", + "description": "Number of workitems pending in the flow.", + "computed": true + } + } + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Workspace Id.", + "computed": true + }, + "job_type": { + "name": "job_type", + "type": "TypeString", + "description": "Type of Job.", + "computed": true + }, + "log_analyzed_till": { + "name": "log_analyzed_till", + "type": "TypeString", + "description": "Job log update timestamp.", + "computed": true + }, + "log_errors": { + "name": "log_errors", + "type": "TypeList", + "description": "Job log errors.", + "computed": true, + "elem": { + "error_code": { + "name": "error_code", + "type": "TypeString", + "description": "Error code in the Log.", + "computed": true + }, + "error_count": { + "name": "error_count", + "type": "TypeFloat", + "description": "Number of occurrence.", + "computed": true + }, + "error_msg": { + "name": "error_msg", + "type": "TypeString", + "description": "Summary error message in the log.", + "computed": true + } + } + }, + "log_start_at": { + "name": "log_start_at", + "type": "TypeString", + "description": "Job log start timestamp.", + "computed": true + }, + "repo_download_job": { + "name": "repo_download_job", + "type": "TypeList", + "description": "Repo download Job log summary.", + "computed": true, + "elem": { + "detected_filetype": { + "name": "detected_filetype", + "type": "TypeString", + "description": "Detected template or data file type.", + "computed": true + }, + "inputs_count": { + "name": "inputs_count", + "type": "TypeString", + "description": "Number of inputs detected.", + "computed": true + }, + "outputs_count": { + "name": "outputs_count", + "type": "TypeString", + "description": "Number of outputs detected.", + "computed": true + }, + "quarantined_file_count": { + "name": "quarantined_file_count", + "type": "TypeFloat", + "description": "Number of files quarantined.", + "computed": true + }, + "scanned_file_count": { + "name": "scanned_file_count", + "type": "TypeFloat", + "description": "Number of files scanned.", + "computed": true + } + } + }, + "system_job": { + "name": "system_job", + "type": "TypeList", + "description": "System Job log summary.", + "computed": true, + "elem": { + "failed": { + "name": "failed", + "type": "TypeFloat", + "description": "Number of failed.", + "computed": true + }, + "success": { + "name": "success", + "type": "TypeFloat", + "description": "Number of passed.", + "computed": true + }, + "target_count": { + "name": "target_count", + "type": "TypeFloat", + "description": "number of targets or hosts.", + "computed": true + } + } + }, + "workspace_job": { + "name": "workspace_job", + "type": "TypeList", + "description": "Workspace Job log summary.", + "computed": true, + "elem": { + "resources_add": { + "name": "resources_add", + "type": "TypeFloat", + "description": "Number of resources add.", + "computed": true + }, + "resources_destroy": { + "name": "resources_destroy", + "type": "TypeFloat", + "description": "Number of resources destroy.", + "computed": true + }, + "resources_modify": { + "name": "resources_modify", + "type": "TypeFloat", + "description": "Number of resources modify.", + "computed": true + } + } + } + } + }, + { + "name": "results_url", + "type": "TypeString", + "description": "Job results store URL.", + "computed": true + }, + { + "name": "command_name", + "type": "TypeString", + "description": "Schematics job command name.", + "computed": true + }, + { + "name": "state_store_url", + "type": "TypeString", + "description": "Job state store URL.", + "computed": true + }, + { + "name": "start_at", + "type": "TypeString", + "description": "Job start time.", + "computed": true + }, + { + "name": "command_parameter", + "type": "TypeString", + "description": "Schematics job command parameter (playbook-name).", + "computed": true + }, + { + "name": "job_env_settings", + "type": "TypeList", + "description": "Environment variables used by the Job while performing Action or Workspace.", + "computed": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } + }, + { + "name": "status", + "type": "TypeList", + "description": "Job Status.", + "computed": true, + "elem": { + "action_job_status": { + "name": "action_job_status", + "type": "TypeList", + "description": "Action Job Status.", + "computed": true, + "elem": { + "action_name": { + "name": "action_name", + "type": "TypeString", + "description": "Action name.", + "computed": true + }, + "bastion_status_code": { + "name": "bastion_status_code", + "type": "TypeString", + "description": "Status of Resources.", + "computed": true + }, + "bastion_status_message": { + "name": "bastion_status_message", + "type": "TypeString", + "description": "Bastion status message - to be displayed along with the bastion_status_code;.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Action Job status message - to be displayed along with the action_status_code.", + "computed": true + }, + "targets_status_code": { + "name": "targets_status_code", + "type": "TypeString", + "description": "Status of Resources.", + "computed": true + }, + "targets_status_message": { + "name": "targets_status_message", + "type": "TypeString", + "description": "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", + "computed": true + }, "updated_at": { "name": "updated_at", "type": "TypeString", @@ -72477,22 +75803,34 @@ } } }, - "flow_job_data": { - "name": "flow_job_data", + "flow_job_status": { + "name": "flow_job_status", "type": "TypeList", - "description": "Flow Job data.", + "description": "Environment Flow JOB Status.", "computed": true, "elem": { "flow_id": { "name": "flow_id", "type": "TypeString", - "description": "Flow ID.", + "description": "flow id.", "computed": true }, "flow_name": { "name": "flow_name", "type": "TypeString", - "description": "Flow Name.", + "description": "flow name.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Flow Job status message - to be displayed along with the status_code;.", "computed": true }, "updated_at": { @@ -72504,591 +75842,241 @@ "workitems": { "name": "workitems", "type": "TypeList", - "description": "Job data used by each workitem Job.", + "description": "Environment's individual workItem status details;.", "computed": true, "elem": { - "command_object_id": { - "name": "command_object_id", + "job_id": { + "name": "job_id", "type": "TypeString", - "description": "command object id.", + "description": "workspace job id.", "computed": true }, - "command_object_name": { - "name": "command_object_name", + "status_code": { + "name": "status_code", "type": "TypeString", - "description": "command object name.", + "description": "Status of Jobs.", "computed": true }, - "inputs": { - "name": "inputs", - "type": "TypeList", - "description": "Input variables data for the workItem used in FlowJob.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "workitem job status message;.", + "computed": true }, - "last_job": { - "name": "last_job", + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "workitem job status updation timestamp.", + "computed": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "TypeString", + "description": "Workspace id.", + "computed": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "workspace name.", + "computed": true + } + } + } + } + }, + "system_job_status": { + "name": "system_job_status", + "type": "TypeList", + "description": "System Job Status.", + "computed": true, + "elem": { + "schematics_resource_status": { + "name": "schematics_resource_status", + "type": "TypeList", + "description": "job staus for each schematics resource.", + "computed": true, + "elem": { + "schematics_resource_id": { + "name": "schematics_resource_id", + "type": "TypeString", + "description": "id for each resource which is targeted as a part of system job.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "system job status message.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + } + } + }, + "system_status_code": { + "name": "system_status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "system_status_message": { + "name": "system_status_message", + "type": "TypeString", + "description": "System job message.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + } + } + }, + "workspace_job_status": { + "name": "workspace_job_status", + "type": "TypeList", + "description": "Workspace Job Status.", + "computed": true, + "elem": { + "flow_status": { + "name": "flow_status", + "type": "TypeList", + "description": "Environment Flow JOB Status.", + "computed": true, + "elem": { + "flow_id": { + "name": "flow_id", + "type": "TypeString", + "description": "flow id.", + "computed": true + }, + "flow_name": { + "name": "flow_name", + "type": "TypeString", + "description": "flow name.", + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Flow Job status message - to be displayed along with the status_code;.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + }, + "workitems": { + "name": "workitems", "type": "TypeList", - "description": "Status of the last job executed by the workitem.", + "description": "Environment's individual workItem status details;.", "computed": true, "elem": { - "command_name": { - "name": "command_name", + "job_id": { + "name": "job_id", "type": "TypeString", - "description": "Schematics job command name.", + "description": "workspace job id.", "computed": true }, - "command_object": { - "name": "command_object", + "status_code": { + "name": "status_code", "type": "TypeString", - "description": "Name of the Schematics automation resource.", + "description": "Status of Jobs.", "computed": true }, - "command_object_id": { - "name": "command_object_id", + "status_message": { + "name": "status_message", "type": "TypeString", - "description": "Workitem command object id, maps to workspace_id or action_id.", + "description": "workitem job status message;.", "computed": true }, - "command_object_name": { - "name": "command_object_name", + "updated_at": { + "name": "updated_at", "type": "TypeString", - "description": "command object name (workspace_name/action_name).", + "description": "workitem job status updation timestamp.", "computed": true }, - "job_id": { - "name": "job_id", + "workspace_id": { + "name": "workspace_id", "type": "TypeString", - "description": "Workspace job id.", + "description": "Workspace id.", "computed": true }, - "job_status": { - "name": "job_status", + "workspace_name": { + "name": "workspace_name", "type": "TypeString", - "description": "Status of Jobs.", + "description": "workspace name.", "computed": true } } + } + } + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", + "computed": true + }, + "template_status": { + "name": "template_status", + "type": "TypeList", + "description": "Workspace Flow Template job status.", + "computed": true, + "elem": { + "flow_index": { + "name": "flow_index", + "type": "TypeInt", + "description": "Index of the template in the Flow.", + "computed": true }, - "layers": { - "name": "layers", + "status_code": { + "name": "status_code", "type": "TypeString", - "description": "layer name.", + "description": "Status of Jobs.", "computed": true }, - "outputs": { - "name": "outputs", - "type": "TypeList", - "description": "Output variables for the workItem.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } - }, - "settings": { - "name": "settings", - "type": "TypeList", - "description": "Environment variables for the workItem.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", + "computed": true }, - "source": { - "name": "source", - "type": "TypeList", - "description": "Source of templates, playbooks, or controls.", - "computed": true, - "elem": { - "catalog": { - "name": "catalog", - "type": "TypeList", - "description": "Connection details to IBM Cloud Catalog source.", - "computed": true, - "elem": { - "catalog_name": { - "name": "catalog_name", - "type": "TypeString", - "description": "name of the private catalog.", - "computed": true - }, - "offering_id": { - "name": "offering_id", - "type": "TypeString", - "description": "Id of the offering the IBM Catalog.", - "computed": true - }, - "offering_kind": { - "name": "offering_kind", - "type": "TypeString", - "description": "Type of the offering, in the IBM Catalog.", - "computed": true - }, - "offering_name": { - "name": "offering_name", - "type": "TypeString", - "description": "Name of the offering in the IBM Catalog.", - "computed": true - }, - "offering_repo_url": { - "name": "offering_repo_url", - "type": "TypeString", - "description": "Repo Url of the offering, in the IBM Catalog.", - "computed": true - }, - "offering_version": { - "name": "offering_version", - "type": "TypeString", - "description": "Version string of the offering in the IBM Catalog.", - "computed": true - }, - "offering_version_id": { - "name": "offering_version_id", - "type": "TypeString", - "description": "Id of the offering version the IBM Catalog.", - "computed": true - } - } - }, - "git": { - "name": "git", - "type": "TypeList", - "description": "Connection details to Git source.", - "computed": true, - "elem": { - "computed_git_repo_url": { - "name": "computed_git_repo_url", - "type": "TypeString", - "description": "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", - "computed": true - }, - "git_branch": { - "name": "git_branch", - "type": "TypeString", - "description": "Name of the branch, used to fetch the Git Repo.", - "computed": true - }, - "git_release": { - "name": "git_release", - "type": "TypeString", - "description": "Name of the release tag, used to fetch the Git Repo.", - "computed": true - }, - "git_repo_folder": { - "name": "git_repo_folder", - "type": "TypeString", - "description": "Name of the folder in the Git Repo, that contains the template.", - "computed": true - }, - "git_repo_url": { - "name": "git_repo_url", - "type": "TypeString", - "description": "URL to the GIT Repo that can be used to clone the template.", - "computed": true - }, - "git_token": { - "name": "git_token", - "type": "TypeString", - "description": "Personal Access Token to connect to Git URLs.", - "computed": true - } - } - }, - "source_type": { - "name": "source_type", - "type": "TypeString", - "description": "Type of source for the Template.", - "computed": true - } - } + "template_id": { + "name": "template_id", + "type": "TypeString", + "description": "Template Id.", + "computed": true }, - "source_type": { - "name": "source_type", + "template_name": { + "name": "template_name", "type": "TypeString", - "description": "Type of source for the Template.", + "description": "Template name.", "computed": true }, "updated_at": { @@ -73098,58 +76086,191 @@ "computed": true } } + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "Workspace name.", + "computed": true } } - }, - "job_type": { - "name": "job_type", + } + } + }, + { + "name": "command_object", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "computed": true + }, + { + "name": "command_object_id", + "type": "TypeString", + "description": "Job command object id (workspace-id, action-id).", + "computed": true + }, + { + "name": "job_inputs", + "type": "TypeList", + "description": "Job inputs used by Action or Workspace.", + "computed": true, + "elem": { + "link": { + "name": "link", "type": "TypeString", - "description": "Type of Job.", + "description": "Reference link to the variable value By default the expression will point to self.value.", "computed": true }, - "system_job_data": { - "name": "system_job_data", + "metadata": { + "name": "metadata", "type": "TypeList", - "description": "Controls Job data.", + "description": "User editable metadata for the variables.", "computed": true, "elem": { - "key_id": { - "name": "key_id", + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", "type": "TypeString", - "description": "Key ID for which key event is generated.", + "description": "Default value for the variable, if the override value is not specified.", "computed": true }, - "schematics_resource_id": { - "name": "schematics_resource_id", + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", "type": "TypeList", - "description": "List of the schematics resource id.", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", "computed": true, "elem": { "type": "TypeString" } }, - "updated_at": { - "name": "updated_at", + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", "computed": true } } }, - "workspace_job_data": { - "name": "workspace_job_data", - "type": "TypeList", - "description": "Workspace Job data.", - "computed": true, - "elem": { - "flow_id": { - "name": "flow_id", - "type": "TypeString", - "description": "Flow Id.", - "computed": true - }, - "flow_name": { - "name": "flow_name", + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } + }, + { + "name": "submitted_at", + "type": "TypeString", + "description": "Job submission time.", + "computed": true + }, + { + "name": "data", + "type": "TypeList", + "description": "Job data.", + "computed": true, + "elem": { + "action_job_data": { + "name": "action_job_data", + "type": "TypeList", + "description": "Action Job data.", + "computed": true, + "elem": { + "action_name": { + "name": "action_name", "type": "TypeString", "description": "Flow name.", "computed": true @@ -73157,7 +76278,7 @@ "inputs": { "name": "inputs", "type": "TypeList", - "description": "Input variables data used by the Workspace Job.", + "description": "Input variables data used by the Action Job.", "computed": true, "elem": { "link": { @@ -73290,10 +76411,93 @@ } } }, + "inventory_record": { + "name": "inventory_record", + "type": "TypeList", + "description": "Complete inventory resource details with user inputs and system generated data.", + "computed": true, + "elem": { + "created_at": { + "name": "created_at", + "type": "TypeString", + "description": "Inventory creation time.", + "computed": true + }, + "created_by": { + "name": "created_by", + "type": "TypeString", + "description": "Email address of user who created the Inventory.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "The description of your Inventory. The description can be up to 2048 characters long in size.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "Inventory id.", + "computed": true + }, + "inventories_ini": { + "name": "inventories_ini", + "type": "TypeString", + "description": "Input inventory of host and host group for the playbook, in the .ini file format.", + "computed": true + }, + "location": { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + "computed": true + }, + "resource_group": { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", + "computed": true + }, + "resource_queries": { + "name": "resource_queries", + "type": "TypeList", + "description": "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Inventory updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the Inventory.", + "computed": true + } + } + }, + "materialized_inventory": { + "name": "materialized_inventory", + "type": "TypeString", + "description": "Materialized inventory details used by the Action Job, in .ini format.", + "computed": true + }, "outputs": { "name": "outputs", "type": "TypeList", - "description": "Output variables data from the Workspace Job.", + "description": "Output variables data from the Action Job.", "computed": true, "elem": { "link": { @@ -73429,7 +76633,7 @@ "settings": { "name": "settings", "type": "TypeList", - "description": "Environment variables used by all the templates in the Workspace.", + "description": "Environment variables used by all the templates in the Action.", "computed": true, "elem": { "link": { @@ -73562,22 +76766,60 @@ } } }, - "template_data": { - "name": "template_data", + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + } + } + }, + "flow_job_data": { + "name": "flow_job_data", + "type": "TypeList", + "description": "Flow Job data.", + "computed": true, + "elem": { + "flow_id": { + "name": "flow_id", + "type": "TypeString", + "description": "Flow ID.", + "computed": true + }, + "flow_name": { + "name": "flow_name", + "type": "TypeString", + "description": "Flow Name.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + }, + "workitems": { + "name": "workitems", "type": "TypeList", - "description": "Input / output data of the Template in the Workspace Job.", + "description": "Job data used by each workitem Job.", "computed": true, "elem": { - "flow_index": { - "name": "flow_index", - "type": "TypeInt", - "description": "Index of the template in the Flow.", + "command_object_id": { + "name": "command_object_id", + "type": "TypeString", + "description": "command object id.", + "computed": true + }, + "command_object_name": { + "name": "command_object_name", + "type": "TypeString", + "description": "command object name.", "computed": true }, "inputs": { "name": "inputs", "type": "TypeList", - "description": "Job inputs used by the Templates.", + "description": "Input variables data for the workItem used in FlowJob.", "computed": true, "elem": { "link": { @@ -73710,10 +76952,60 @@ } } }, + "last_job": { + "name": "last_job", + "type": "TypeList", + "description": "Status of the last job executed by the workitem.", + "computed": true, + "elem": { + "command_name": { + "name": "command_name", + "type": "TypeString", + "description": "Schematics job command name.", + "computed": true + }, + "command_object": { + "name": "command_object", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "computed": true + }, + "command_object_id": { + "name": "command_object_id", + "type": "TypeString", + "description": "Workitem command object id, maps to workspace_id or action_id.", + "computed": true + }, + "command_object_name": { + "name": "command_object_name", + "type": "TypeString", + "description": "command object name (workspace_name/action_name).", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Workspace job id.", + "computed": true + }, + "job_status": { + "name": "job_status", + "type": "TypeString", + "description": "Status of Jobs.", + "computed": true + } + } + }, + "layers": { + "name": "layers", + "type": "TypeString", + "description": "layer name.", + "computed": true + }, "outputs": { "name": "outputs", "type": "TypeList", - "description": "Job output from the Templates.", + "description": "Output variables for the workItem.", "computed": true, "elem": { "link": { @@ -73849,7 +77141,7 @@ "settings": { "name": "settings", "type": "TypeList", - "description": "Environment variables used by the template.", + "description": "Environment variables for the workItem.", "computed": true, "elem": { "link": { @@ -73982,16 +77274,118 @@ } } }, - "template_id": { - "name": "template_id", - "type": "TypeString", - "description": "Template Id.", - "computed": true + "source": { + "name": "source", + "type": "TypeList", + "description": "Source of templates, playbooks, or controls.", + "computed": true, + "elem": { + "catalog": { + "name": "catalog", + "type": "TypeList", + "description": "Connection details to IBM Cloud Catalog source.", + "computed": true, + "elem": { + "catalog_name": { + "name": "catalog_name", + "type": "TypeString", + "description": "name of the private catalog.", + "computed": true + }, + "offering_id": { + "name": "offering_id", + "type": "TypeString", + "description": "Id of the offering the IBM Catalog.", + "computed": true + }, + "offering_kind": { + "name": "offering_kind", + "type": "TypeString", + "description": "Type of the offering, in the IBM Catalog.", + "computed": true + }, + "offering_name": { + "name": "offering_name", + "type": "TypeString", + "description": "Name of the offering in the IBM Catalog.", + "computed": true + }, + "offering_repo_url": { + "name": "offering_repo_url", + "type": "TypeString", + "description": "Repo Url of the offering, in the IBM Catalog.", + "computed": true + }, + "offering_version": { + "name": "offering_version", + "type": "TypeString", + "description": "Version string of the offering in the IBM Catalog.", + "computed": true + }, + "offering_version_id": { + "name": "offering_version_id", + "type": "TypeString", + "description": "Id of the offering version the IBM Catalog.", + "computed": true + } + } + }, + "git": { + "name": "git", + "type": "TypeList", + "description": "Connection details to Git source.", + "computed": true, + "elem": { + "computed_git_repo_url": { + "name": "computed_git_repo_url", + "type": "TypeString", + "description": "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", + "computed": true + }, + "git_branch": { + "name": "git_branch", + "type": "TypeString", + "description": "Name of the branch, used to fetch the Git Repo.", + "computed": true + }, + "git_release": { + "name": "git_release", + "type": "TypeString", + "description": "Name of the release tag, used to fetch the Git Repo.", + "computed": true + }, + "git_repo_folder": { + "name": "git_repo_folder", + "type": "TypeString", + "description": "Name of the folder in the Git Repo, that contains the template.", + "computed": true + }, + "git_repo_url": { + "name": "git_repo_url", + "type": "TypeString", + "description": "URL to the GIT Repo that can be used to clone the template.", + "computed": true + }, + "git_token": { + "name": "git_token", + "type": "TypeString", + "description": "Personal Access Token to connect to Git URLs.", + "computed": true + } + } + }, + "source_type": { + "name": "source_type", + "type": "TypeString", + "description": "Type of source for the Template.", + "computed": true + } + } }, - "template_name": { - "name": "template_name", + "source_type": { + "name": "source_type", "type": "TypeString", - "description": "Template name.", + "description": "Type of source for the Template.", "computed": true }, "updated_at": { @@ -74001,394 +77395,36 @@ "computed": true } } - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "computed": true - }, - "workspace_name": { - "name": "workspace_name", - "type": "TypeString", - "description": "Workspace name.", - "computed": true - } - } - } - } - }, - { - "name": "log_store_url", - "type": "TypeString", - "description": "Job log store URL.", - "computed": true - }, - { - "name": "command_name", - "type": "TypeString", - "description": "Schematics job command name.", - "computed": true - }, - { - "name": "command_parameter", - "type": "TypeString", - "description": "Schematics job command parameter (playbook-name).", - "computed": true - }, - { - "name": "command_options", - "type": "TypeList", - "description": "Command line options for the command.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "job_env_settings", - "type": "TypeList", - "description": "Environment variables used by the Job while performing Action or Workspace.", - "computed": true, - "elem": { - "link": { - "name": "link", - "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "computed": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true } } }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } - }, - { - "name": "start_at", - "type": "TypeString", - "description": "Job start time.", - "computed": true - }, - { - "name": "duration", - "type": "TypeString", - "description": "Duration of job execution; example 40 sec.", - "computed": true - }, - { - "name": "job_id", - "type": "TypeString", - "description": "Job Id. Use `GET /v2/jobs` API to look up the Job Ids in your IBM Cloud account.", - "required": true - }, - { - "name": "job_inputs", - "type": "TypeList", - "description": "Job inputs used by Action or Workspace.", - "computed": true, - "elem": { - "link": { - "name": "link", + "job_type": { + "name": "job_type", "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", + "description": "Type of Job.", "computed": true }, - "metadata": { - "name": "metadata", + "system_job_data": { + "name": "system_job_data", "type": "TypeList", - "description": "User editable metadata for the variables.", + "description": "Controls Job data.", "computed": true, "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "computed": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "computed": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "computed": true - }, - "matches": { - "name": "matches", + "key_id": { + "name": "key_id", "type": "TypeString", - "description": "Regex for the variable value.", - "computed": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "computed": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "computed": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "computed": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", + "description": "Key ID for which key event is generated.", "computed": true }, - "options": { - "name": "options", + "schematics_resource_id": { + "name": "schematics_resource_id", "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "description": "List of the schematics resource id.", "computed": true, "elem": { "type": "TypeString" } }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "computed": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "computed": true - } - } - }, - { - "name": "status", - "type": "TypeList", - "description": "Job Status.", - "computed": true, - "elem": { - "action_job_status": { - "name": "action_job_status", - "type": "TypeList", - "description": "Action Job Status.", - "computed": true, - "elem": { - "action_name": { - "name": "action_name", - "type": "TypeString", - "description": "Action name.", - "computed": true - }, - "bastion_status_code": { - "name": "bastion_status_code", - "type": "TypeString", - "description": "Status of Resources.", - "computed": true - }, - "bastion_status_message": { - "name": "bastion_status_message", - "type": "TypeString", - "description": "Bastion status message - to be displayed along with the bastion_status_code;.", - "computed": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Action Job status message - to be displayed along with the action_status_code.", - "computed": true - }, - "targets_status_code": { - "name": "targets_status_code", - "type": "TypeString", - "description": "Status of Resources.", - "computed": true - }, - "targets_status_message": { - "name": "targets_status_message", - "type": "TypeString", - "description": "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", - "computed": true - }, "updated_at": { "name": "updated_at", "type": "TypeString", @@ -74397,250 +77433,436 @@ } } }, - "flow_job_status": { - "name": "flow_job_status", + "workspace_job_data": { + "name": "workspace_job_data", "type": "TypeList", - "description": "Environment Flow JOB Status.", + "description": "Workspace Job data.", "computed": true, "elem": { "flow_id": { "name": "flow_id", "type": "TypeString", - "description": "flow id.", + "description": "Flow Id.", "computed": true }, "flow_name": { "name": "flow_name", "type": "TypeString", - "description": "flow name.", - "computed": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Flow Job status message - to be displayed along with the status_code;.", - "computed": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Flow name.", "computed": true }, - "workitems": { - "name": "workitems", + "inputs": { + "name": "inputs", "type": "TypeList", - "description": "Environment's individual workItem status details;.", + "description": "Input variables data used by the Workspace Job.", "computed": true, "elem": { - "job_id": { - "name": "job_id", - "type": "TypeString", - "description": "workspace job id.", - "computed": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "status_message": { - "name": "status_message", + "link": { + "name": "link", "type": "TypeString", - "description": "workitem job status message;.", + "description": "Reference link to the variable value By default the expression will point to self.value.", "computed": true }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "workitem job status updation timestamp.", - "computed": true + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } }, - "workspace_id": { - "name": "workspace_id", + "name": { + "name": "name", "type": "TypeString", - "description": "Workspace id.", + "description": "Name of the variable.", "computed": true }, - "workspace_name": { - "name": "workspace_name", + "value": { + "name": "value", "type": "TypeString", - "description": "workspace name.", + "description": "Value for the variable or reference to the value.", "computed": true } } - } - } - }, - "system_job_status": { - "name": "system_job_status", - "type": "TypeList", - "description": "System Job Status.", - "computed": true, - "elem": { - "schematics_resource_status": { - "name": "schematics_resource_status", + }, + "outputs": { + "name": "outputs", "type": "TypeList", - "description": "job staus for each schematics resource.", + "description": "Output variables data from the Workspace Job.", "computed": true, "elem": { - "schematics_resource_id": { - "name": "schematics_resource_id", + "link": { + "name": "link", "type": "TypeString", - "description": "id for each resource which is targeted as a part of system job.", + "description": "Reference link to the variable value By default the expression will point to self.value.", "computed": true }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } }, - "status_message": { - "name": "status_message", + "name": { + "name": "name", "type": "TypeString", - "description": "system job status message.", + "description": "Name of the variable.", "computed": true }, - "updated_at": { - "name": "updated_at", + "value": { + "name": "value", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Value for the variable or reference to the value.", "computed": true } } }, - "system_status_code": { - "name": "system_status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "system_status_message": { - "name": "system_status_message", - "type": "TypeString", - "description": "System job message.", - "computed": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "computed": true - } - } - }, - "workspace_job_status": { - "name": "workspace_job_status", - "type": "TypeList", - "description": "Workspace Job Status.", - "computed": true, - "elem": { - "flow_status": { - "name": "flow_status", + "settings": { + "name": "settings", "type": "TypeList", - "description": "Environment Flow JOB Status.", + "description": "Environment variables used by all the templates in the Workspace.", "computed": true, "elem": { - "flow_id": { - "name": "flow_id", - "type": "TypeString", - "description": "flow id.", - "computed": true - }, - "flow_name": { - "name": "flow_name", - "type": "TypeString", - "description": "flow name.", - "computed": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Flow Job status message - to be displayed along with the status_code;.", - "computed": true - }, - "updated_at": { - "name": "updated_at", + "link": { + "name": "link", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Reference link to the variable value By default the expression will point to self.value.", "computed": true }, - "workitems": { - "name": "workitems", + "metadata": { + "name": "metadata", "type": "TypeList", - "description": "Environment's individual workItem status details;.", + "description": "User editable metadata for the variables.", "computed": true, "elem": { - "job_id": { - "name": "job_id", + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", "type": "TypeString", - "description": "workspace job id.", + "description": "Default value for the variable, if the override value is not specified.", "computed": true }, - "status_code": { - "name": "status_code", + "description": { + "name": "description", "type": "TypeString", - "description": "Status of Jobs.", + "description": "Description of the meta data.", "computed": true }, - "status_message": { - "name": "status_message", + "group_by": { + "name": "group_by", "type": "TypeString", - "description": "workitem job status message;.", + "description": "Display name of the group this variable belongs to.", "computed": true }, - "updated_at": { - "name": "updated_at", + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", "type": "TypeString", - "description": "workitem job status updation timestamp.", + "description": "Regex for the variable value.", "computed": true }, - "workspace_id": { - "name": "workspace_id", + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", "type": "TypeString", - "description": "Workspace id.", + "description": "Source of this meta-data.", "computed": true }, - "workspace_name": { - "name": "workspace_name", + "type": { + "name": "type", "type": "TypeString", - "description": "workspace name.", + "description": "Type of the variable.", "computed": true } } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true } } }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", - "computed": true - }, - "template_status": { - "name": "template_status", + "template_data": { + "name": "template_data", "type": "TypeList", - "description": "Workspace Flow Template job status.", + "description": "Input / output data of the Template in the Workspace Job.", "computed": true, "elem": { "flow_index": { @@ -74649,17 +77871,413 @@ "description": "Index of the template in the Flow.", "computed": true }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "computed": true + "inputs": { + "name": "inputs", + "type": "TypeList", + "description": "Job inputs used by the Templates.", + "computed": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", - "computed": true + "outputs": { + "name": "outputs", + "type": "TypeList", + "description": "Job output from the Templates.", + "computed": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } + }, + "settings": { + "name": "settings", + "type": "TypeList", + "description": "Environment variables used by the template.", + "computed": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "computed": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "computed": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "computed": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "computed": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "computed": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "computed": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "computed": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "computed": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "computed": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "computed": true + } + } }, "template_id": { "name": "template_id", @@ -74698,446 +78316,460 @@ } }, { - "name": "location", + "name": "job_id", "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "cloud_data_type": "region", - "optional": true, - "computed": true - }, + "description": "Job Id. Use `GET /v2/jobs` API to look up the Job Ids in your IBM Cloud account.", + "required": true + } + ], + "ibm_schematics_output": [ { - "name": "resource_group", + "name": "workspace_id", "type": "TypeString", - "description": "Resource-group name derived from the related Workspace or Action.", - "cloud_data_type": "resource_group", - "computed": true + "description": "The ID of the workspace for which you want to retrieve output values. To find the workspace ID, use the `GET /workspaces` API.", + "required": true }, { - "name": "submitted_at", + "name": "location", "type": "TypeString", - "description": "Job submission time.", - "computed": true - }, - { - "name": "bastion", - "type": "TypeList", - "description": "Describes a bastion resource.", - "computed": true, - "elem": { - "host": { - "name": "host", - "type": "TypeString", - "description": "Reference to the Inventory resource definition.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Bastion Name(Unique).", - "computed": true - } - } + "description": "The Region of the workspace.", + "cloud_data_type": "region", + "optional": true }, { - "name": "name", + "name": "template_id", "type": "TypeString", - "description": "Job name, uniquely derived from the related Workspace or Action.", - "computed": true + "description": "The id of template", + "required": true }, { - "name": "command_object", - "type": "TypeString", - "description": "Name of the Schematics automation resource.", + "name": "output_values", + "type": "TypeMap", "computed": true }, { - "name": "tags", - "type": "TypeList", - "description": "User defined tags, while running the job.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "output_json", + "type": "TypeString", + "description": "The json output in string", + "optional": true }, { - "name": "id", + "name": "resource_controller_url", "type": "TypeString", - "description": "Job ID.", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this Workspace", "computed": true - }, + } + ], + "ibm_schematics_policies": [ { - "name": "log_summary", + "name": "policies", "type": "TypeList", - "description": "Job log summary record.", + "description": "The list of Schematics policies.", "computed": true, "elem": { - "action_job": { - "name": "action_job", - "type": "TypeList", - "description": "Flow Job log summary.", - "computed": true, - "elem": { - "play_count": { - "name": "play_count", - "type": "TypeFloat", - "description": "number of plays in playbook.", - "computed": true - }, - "recap": { - "name": "recap", - "type": "TypeList", - "description": "Recap records.", - "computed": true, - "elem": { - "changed": { - "name": "changed", - "type": "TypeFloat", - "description": "Number of changed.", - "computed": true - }, - "failed": { - "name": "failed", - "type": "TypeFloat", - "description": "Number of failed.", - "computed": true - }, - "ok": { - "name": "ok", - "type": "TypeFloat", - "description": "Number of OK.", - "computed": true - }, - "skipped": { - "name": "skipped", - "type": "TypeFloat", - "description": "Number of skipped.", - "computed": true - }, - "target": { - "name": "target", - "type": "TypeList", - "description": "List of target or host name.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "unreachable": { - "name": "unreachable", - "type": "TypeFloat", - "description": "Number of unreachable.", - "computed": true - } - } - }, - "target_count": { - "name": "target_count", - "type": "TypeFloat", - "description": "number of targets or hosts.", - "computed": true - }, - "task_count": { - "name": "task_count", - "type": "TypeFloat", - "description": "number of tasks in playbook.", - "computed": true - } - } + "account": { + "name": "account", + "type": "TypeString", + "description": "The Account id.", + "computed": true }, - "elapsed_time": { - "name": "elapsed_time", - "type": "TypeFloat", - "description": "Job log elapsed time (log_analyzed_till - log_start_at).", + "created_at": { + "name": "created_at", + "type": "TypeString", + "description": "The policy creation time.", "computed": true }, - "flow_job": { - "name": "flow_job", - "type": "TypeList", - "description": "Flow Job log summary.", - "computed": true, - "elem": { - "workitems": { - "name": "workitems", - "type": "TypeList", - "computed": true, - "elem": { - "job_id": { - "name": "job_id", - "type": "TypeString", - "description": "workspace JOB ID.", - "computed": true - }, - "log_url": { - "name": "log_url", - "type": "TypeString", - "description": "Log url for job.", - "computed": true - }, - "resources_add": { - "name": "resources_add", - "type": "TypeFloat", - "description": "Number of resources add.", - "computed": true - }, - "resources_destroy": { - "name": "resources_destroy", - "type": "TypeFloat", - "description": "Number of resources destroy.", - "computed": true - }, - "resources_modify": { - "name": "resources_modify", - "type": "TypeFloat", - "description": "Number of resources modify.", - "computed": true - }, - "workspace_id": { - "name": "workspace_id", - "type": "TypeString", - "description": "workspace ID.", - "computed": true - } - } - }, - "workitems_completed": { - "name": "workitems_completed", - "type": "TypeFloat", - "description": "Number of workitems completed successfully.", - "computed": true - }, - "workitems_failed": { - "name": "workitems_failed", - "type": "TypeFloat", - "description": "Number of workitems failed.", - "computed": true - }, - "workitems_pending": { - "name": "workitems_pending", - "type": "TypeFloat", - "description": "Number of workitems pending in the flow.", - "computed": true - } - } + "created_by": { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the Policy.", + "computed": true }, - "job_id": { - "name": "job_id", + "crn": { + "name": "crn", "type": "TypeString", - "description": "Workspace Id.", + "description": "The policy CRN.", "computed": true }, - "job_type": { - "name": "job_type", + "description": { + "name": "description", "type": "TypeString", - "description": "Type of Job.", + "description": "The description of Schematics customization policy.", "computed": true }, - "log_analyzed_till": { - "name": "log_analyzed_till", + "id": { + "name": "id", "type": "TypeString", - "description": "Job log update timestamp.", + "description": "The system generated Policy Id.", "computed": true }, - "log_errors": { - "name": "log_errors", - "type": "TypeList", - "description": "Job log errors.", - "computed": true, - "elem": { - "error_code": { - "name": "error_code", - "type": "TypeString", - "description": "Error code in the Log.", - "computed": true - }, - "error_count": { - "name": "error_count", - "type": "TypeFloat", - "description": "Number of occurrence.", - "computed": true - }, - "error_msg": { - "name": "error_msg", - "type": "TypeString", - "description": "Summary error message in the log.", - "computed": true - } - } + "location": { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "computed": true }, - "log_start_at": { - "name": "log_start_at", + "name": { + "name": "name", "type": "TypeString", - "description": "Job log start timestamp.", + "description": "The name of Schematics customization policy.", "computed": true }, - "repo_download_job": { - "name": "repo_download_job", + "policy_kind": { + "name": "policy_kind", + "type": "TypeString", + "description": "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + "computed": true + }, + "resource_group": { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name for the Policy. By default, Policy will be created in Default Resource Group.", + "computed": true + }, + "state": { + "name": "state", "type": "TypeList", - "description": "Repo download Job log summary.", + "description": "User defined status of the Schematics object.", "computed": true, "elem": { - "detected_filetype": { - "name": "detected_filetype", + "set_at": { + "name": "set_at", "type": "TypeString", - "description": "Detected template or data file type.", + "description": "When the User who set the state of the Object.", "computed": true }, - "inputs_count": { - "name": "inputs_count", + "set_by": { + "name": "set_by", "type": "TypeString", - "description": "Number of inputs detected.", + "description": "Name of the User who set the state of the Object.", "computed": true }, - "outputs_count": { - "name": "outputs_count", + "state": { + "name": "state", "type": "TypeString", - "description": "Number of outputs detected.", - "computed": true - }, - "quarantined_file_count": { - "name": "quarantined_file_count", - "type": "TypeFloat", - "description": "Number of files quarantined.", - "computed": true - }, - "scanned_file_count": { - "name": "scanned_file_count", - "type": "TypeFloat", - "description": "Number of files scanned.", + "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", "computed": true } } }, - "system_job": { - "name": "system_job", + "tags": { + "name": "tags", "type": "TypeList", - "description": "System Job log summary.", + "description": "Tags for the Schematics customization policy.", "computed": true, "elem": { - "failed": { - "name": "failed", - "type": "TypeFloat", - "description": "Number of failed.", - "computed": true - }, - "success": { - "name": "success", - "type": "TypeFloat", - "description": "Number of passed.", - "computed": true - }, - "target_count": { - "name": "target_count", - "type": "TypeFloat", - "description": "number of targets or hosts.", - "computed": true - } + "type": "TypeString" } }, - "workspace_job": { - "name": "workspace_job", + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The policy updation time.", + "computed": true + } + } + }, + { + "name": "policy_kind", + "type": "TypeString", + "description": "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + "optional": true + }, + { + "name": "total_count", + "type": "TypeInt", + "description": "The total number of policy records.", + "computed": true + }, + { + "name": "limit", + "type": "TypeInt", + "description": "The number of policy records returned.", + "computed": true + }, + { + "name": "offset", + "type": "TypeInt", + "description": "The skipped number of policy records.", + "computed": true + } + ], + "ibm_schematics_policy": [ + { + "name": "target", + "type": "TypeList", + "description": "The objects for the Schematics policy.", + "computed": true, + "elem": { + "selector_ids": { + "name": "selector_ids", "type": "TypeList", - "description": "Workspace Job log summary.", + "description": "Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", "computed": true, "elem": { - "resources_add": { - "name": "resources_add", - "type": "TypeFloat", - "description": "Number of resources add.", + "type": "TypeString" + } + }, + "selector_kind": { + "name": "selector_kind", + "type": "TypeString", + "description": "Types of schematics object selector.", + "computed": true + }, + "selector_scope": { + "name": "selector_scope", + "type": "TypeList", + "description": "Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + "computed": true, + "elem": { + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", "computed": true }, - "resources_destroy": { - "name": "resources_destroy", - "type": "TypeFloat", - "description": "Number of resources destroy.", - "computed": true + "locations": { + "name": "locations", + "type": "TypeList", + "description": "The location based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } }, - "resources_modify": { - "name": "resources_modify", - "type": "TypeFloat", - "description": "Number of resources modify.", - "computed": true + "resource_groups": { + "name": "resource_groups", + "type": "TypeList", + "description": "The resource group based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "tags": { + "name": "tags", + "type": "TypeList", + "description": "The tag based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } } } } } }, { - "name": "results_url", + "name": "created_at", "type": "TypeString", - "description": "Job results store URL.", + "description": "The policy creation time.", "computed": true }, { - "name": "command_object_id", + "name": "updated_at", "type": "TypeString", - "description": "Job command object id (workspace-id, action-id).", + "description": "The policy updation time.", "computed": true }, { "name": "description", "type": "TypeString", - "description": "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", + "description": "The description of Schematics customization policy.", "computed": true }, { - "name": "state_store_url", + "name": "kind", "type": "TypeString", - "description": "Job state store URL.", + "description": "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", "computed": true }, { - "name": "updated_at", + "name": "parameter", + "type": "TypeList", + "description": "The parameter to tune the Schematics policy.", + "computed": true, + "elem": { + "agent_assignment_policy_parameter": { + "name": "agent_assignment_policy_parameter", + "type": "TypeList", + "description": "Parameters for the `agent_assignment_policy`.", + "computed": true, + "elem": { + "selector_ids": { + "name": "selector_ids", + "type": "TypeList", + "description": "The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "selector_kind": { + "name": "selector_kind", + "type": "TypeString", + "description": "Types of schematics object selector.", + "computed": true + }, + "selector_scope": { + "name": "selector_scope", + "type": "TypeList", + "description": "The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + "computed": true, + "elem": { + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "computed": true + }, + "locations": { + "name": "locations", + "type": "TypeList", + "description": "The location based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "resource_groups": { + "name": "resource_groups", + "type": "TypeList", + "description": "The resource group based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "tags": { + "name": "tags", + "type": "TypeList", + "description": "The tag based selector.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + } + } + } + } + }, + { + "name": "account", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "The Account id.", "computed": true - } - ], - "ibm_schematics_output": [ + }, { - "name": "resource_controller_url", + "name": "location", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this Workspace", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "cloud_data_type": "region", "computed": true }, { - "name": "workspace_id", + "name": "id", "type": "TypeString", - "description": "The ID of the workspace for which you want to retrieve output values. To find the workspace ID, use the `GET /workspaces` API.", - "required": true + "description": "The system generated policy Id.", + "computed": true }, { - "name": "location", + "name": "crn", "type": "TypeString", - "description": "The Region of the workspace.", - "cloud_data_type": "region", - "optional": true + "description": "The policy CRN.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "template_id", + "name": "policy_id", "type": "TypeString", - "description": "The id of template", + "description": "ID to get the details of policy.", "required": true }, { - "name": "output_values", - "type": "TypeMap", + "name": "name", + "type": "TypeString", + "description": "Name of Schematics customization policy.", "computed": true }, { - "name": "output_json", + "name": "resource_group", "type": "TypeString", - "description": "The json output in string", - "optional": true + "description": "The resource group name for the policy. By default, Policy will be created in `default` Resource Group.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "tags", + "type": "TypeList", + "description": "Tags for the Schematics customization policy.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "state", + "type": "TypeList", + "description": "User defined status of the Schematics object.", + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + "computed": true + } + } + }, + { + "name": "scoped_resources", + "type": "TypeList", + "description": "List of scoped Schematics resources targeted by the policy.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Schematics resource Id.", + "computed": true + }, + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "computed": true + } + } + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the policy.", + "computed": true } ], "ibm_schematics_resource_query": [ { - "name": "location", + "name": "id", "type": "TypeString", - "description": "The Region of the workspace.", - "cloud_data_type": "region", - "optional": true + "description": "Resource Query id.", + "computed": true }, { "name": "created_at", @@ -75152,15 +78784,34 @@ "computed": true }, { - "name": "updated_by", + "name": "updated_at", "type": "TypeString", - "description": "Email address of user who updated the Resource query.", + "description": "Resource query updation time.", "computed": true }, { - "name": "updated_at", + "name": "location", "type": "TypeString", - "description": "Resource query updation time.", + "description": "The Region of the workspace.", + "cloud_data_type": "region", + "optional": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Resource type (cluster, vsi, icd, vpc).", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Resource query name.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the Resource query.", "computed": true }, { @@ -75215,27 +78866,22 @@ "type": "TypeString", "description": "Resource query Id. Use `GET /v2/resource_query` API to look up the Resource query definition Ids in your IBM Cloud account.", "required": true - }, + } + ], + "ibm_schematics_state": [ { - "name": "type", + "name": "workspace_id", "type": "TypeString", - "description": "Resource type (cluster, vsi, icd, vpc).", - "computed": true + "description": "The ID of the workspace for which you want to retrieve the Terraform statefile URL. To find the workspace ID, use the GET /v1/workspaces API.", + "required": true }, { - "name": "name", + "name": "location", "type": "TypeString", - "description": "Resource query name.", - "computed": true + "description": "The Region of the workspace.", + "cloud_data_type": "region", + "optional": true }, - { - "name": "id", - "type": "TypeString", - "description": "Resource Query id.", - "computed": true - } - ], - "ibm_schematics_state": [ { "name": "template_id", "type": "TypeString", @@ -75257,19 +78903,6 @@ "type": "TypeString", "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this workspace", "computed": true - }, - { - "name": "workspace_id", - "type": "TypeString", - "description": "The ID of the workspace for which you want to retrieve the Terraform statefile URL. To find the workspace ID, use the GET /v1/workspaces API.", - "required": true - }, - { - "name": "location", - "type": "TypeString", - "description": "The Region of the workspace.", - "cloud_data_type": "region", - "optional": true } ], "ibm_schematics_workspace": [ @@ -75279,156 +78912,12 @@ "description": "The ID of the workspace. To find the workspace ID, use the `GET /v1/workspaces` API.", "required": true }, - { - "name": "created_by", - "type": "TypeString", - "description": "The user ID that created the workspace.", - "computed": true - }, - { - "name": "runtime_data", - "type": "TypeList", - "description": "Information about the provisioning engine, state file, and runtime logs.", - "computed": true, - "elem": { - "engine_cmd": { - "name": "engine_cmd", - "type": "TypeString", - "description": "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", - "computed": true - }, - "engine_name": { - "name": "engine_name", - "type": "TypeString", - "description": "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", - "computed": true - }, - "engine_version": { - "name": "engine_version", - "type": "TypeString", - "description": "The version of the provisioning engine that was used.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", - "computed": true - }, - "log_store_url": { - "name": "log_store_url", - "type": "TypeString", - "description": "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", - "computed": true - }, - "output_values": { - "name": "output_values", - "type": "TypeList", - "description": "List of Output values.", - "computed": true, - "elem": { - "type": "TypeMap" - } - }, - "resources": { - "name": "resources", - "type": "TypeList", - "description": "List of resources.", - "computed": true, - "elem": { - "type": "TypeMap" - } - }, - "state_store_url": { - "name": "state_store_url", - "type": "TypeString", - "description": "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", - "computed": true - } - } - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the workspace. **Active**: After you successfully ran your infrastructure code by applying your Terraform execution plan, the state of your workspace changes to `Active`. **Connecting**: Schematics tries to connect to the template in your source repo. If successfully connected, the template is downloaded and metadata, such as input parameters, is extracted. After the template is downloaded, the state of the workspace changes to `Scanning`. **Draft**: The workspace is created without a reference to a GitHub or GitLab repository. **Failed**: If errors occur during the execution of your infrastructure code in IBM Cloud Schematics, your workspace status is set to `Failed`. **Inactive**: The Terraform template was scanned successfully and the workspace creation is complete. You can now start running Schematics plan and apply jobs to provision the IBM Cloud resources that you specified in your template. If you have an `Active` workspace and decide to remove all your resources, your workspace is set to `Inactive` after all your resources are removed. **In progress**: When you instruct IBM Cloud Schematics to run your infrastructure code by applying your Terraform execution plan, the status of our workspace changes to `In progress`. **Scanning**: The download of the Terraform template is complete and vulnerability scanning started. If the scan is successful, the workspace state changes to `Inactive`. If errors in your template are found, the state changes to `Template Error`. **Stopped**: The Schematics plan, apply, or destroy job was cancelled manually. **Template Error**: The Schematics template contains errors and cannot be processed.", - "computed": true - }, - { - "name": "tags", - "type": "TypeList", - "description": "A list of tags that are associated with the workspace.", - "cloud_data_type": "tags", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "template_ref", - "type": "TypeString", - "description": "Workspace template ref.", - "computed": true - }, - { - "name": "frozen_by", - "type": "TypeString", - "description": "The user ID that froze the workspace.", - "computed": true - }, - { - "name": "status_code", - "type": "TypeString", - "description": "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", - "computed": true - }, { "name": "description", "type": "TypeString", "description": "The description of the workspace.", "computed": true }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The timestamp when the workspace was last updated.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "The user ID that updated the workspace.", - "computed": true - }, - { - "name": "is_frozen", - "type": "TypeBool", - "computed": true, - "deprecated": "use frozen instead" - }, - { - "name": "is_locked", - "type": "TypeBool", - "description": "If set to true, the workspace is locked and disabled for changes.", - "computed": true, - "deprecated": "Use locked instead" - }, - { - "name": "applied_shareddata_ids", - "type": "TypeList", - "description": "List of applied shared dataset ID.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "location", - "type": "TypeString", - "description": "The IBM Cloud location where your workspace was provisioned.", - "cloud_data_type": "region", - "optional": true, - "computed": true - }, { "name": "shared_data", "type": "TypeList", @@ -75477,111 +78966,34 @@ } }, { - "name": "template_env_settings", - "type": "TypeList", - "description": "List of environment values.", - "computed": true, - "elem": { - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of the variable.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](/docs/schematics?topic=schematics-create-tf-config#declare-variable).", - "computed": true - } - } - }, - { - "name": "template_inputs", - "type": "TypeList", - "description": "Information about the input variables that your template uses.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "The description of your input variable.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name of the variable.", - "computed": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "`Terraform v0.11` supports `string`, `list`, `map` data type. For more information, about the syntax, see [Configuring input variables](https://www.terraform.io/docs/configuration-0-11/variables.html).\u003cbr\u003e `Terraform v0.12` additionally, supports `bool`, `number` and complex data types such as `list(type)`, `map(type)`,`object({attribute name=type,..})`, `set(type)`, `tuple([type])`. For more information, about the syntax to use the complex data type, see [Configuring variables](https://www.terraform.io/docs/configuration/variables.html#type-constraints).", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](https://cloud.ibm.com/docs/schematics?topic=schematics-create-tf-config#declare-variable).", - "computed": true - } - } - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the workspace.", - "computed": true - }, - { - "name": "template_git_url", - "type": "TypeString", - "description": "The source URL.", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this workspace", + "name": "template_git_has_uploadedgitrepotar", + "type": "TypeBool", + "description": "Has uploaded Git repository tar.", + "optional": true, "computed": true }, { - "name": "crn", + "name": "frozen_by", "type": "TypeString", - "description": "The workspace CRN.", - "cloud_data_type": "crn", + "description": "The user ID that froze the workspace.", "computed": true }, { - "name": "last_health_check_at", + "name": "resource_group", "type": "TypeString", - "description": "The timestamp when the last health check was performed by Schematics.", + "description": "The resource group the workspace was provisioned in.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "template_git_folder", - "type": "TypeString", - "description": "The subfolder in your GitHub or GitLab repository where your Terraform template is stored. If your template is stored in the root directory, `.` is returned.", - "computed": true + "name": "tags", + "type": "TypeList", + "description": "A list of tags that are associated with the workspace.", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "template_init_state_file", @@ -75589,19 +79001,6 @@ "description": "Init state file.", "computed": true }, - { - "name": "template_type", - "type": "TypeString", - "description": "The Terraform version that was used to run your Terraform code.", - "computed": true - }, - { - "name": "template_git_has_uploadedgitrepotar", - "type": "TypeBool", - "description": "Has uploaded Git repository tar.", - "optional": true, - "computed": true - }, { "name": "template_git_repo_url", "type": "TypeString", @@ -75609,58 +79008,37 @@ "computed": true }, { - "name": "frozen", - "type": "TypeBool", - "description": "If set to true, the workspace is frozen and changes to the workspace are disabled.", - "computed": true - }, - { - "name": "created_at", + "name": "status_msg", "type": "TypeString", - "description": "The timestamp when the workspace was created.", + "description": "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", "computed": true }, { - "name": "template_git_repo_sha_value", + "name": "resource_controller_url", "type": "TypeString", - "description": "The repository SHA value.", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this workspace", "computed": true }, { - "name": "locked", + "name": "frozen", "type": "TypeBool", - "description": "If set to true, the workspace is locked and disabled for changes.", - "computed": true - }, - { - "name": "template_uninstall_script_name", - "type": "TypeString", - "description": "Uninstall script name.", - "computed": true - }, - { - "name": "template_git_branch", - "type": "TypeString", - "description": "The repository branch.", - "computed": true - }, - { - "name": "template_git_release", - "type": "TypeString", - "description": "The repository release.", + "description": "If set to true, the workspace is frozen and changes to the workspace are disabled.", "computed": true }, { - "name": "locked_by", + "name": "status_code", "type": "TypeString", - "description": "The user ID that initiated a resource-related job, such as applying or destroying resources, that locked the workspace.", + "description": "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", "computed": true }, { - "name": "locked_time", - "type": "TypeString", - "description": "The timestamp when the workspace was locked.", - "computed": true + "name": "applied_shareddata_ids", + "type": "TypeList", + "description": "List of applied shared dataset ID.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "catalog_ref", @@ -75725,17 +79103,98 @@ } }, { - "name": "resource_group", - "type": "TypeString", - "description": "The resource group the workspace was provisioned in.", - "cloud_data_type": "resource_group", - "computed": true + "name": "runtime_data", + "type": "TypeList", + "description": "Information about the provisioning engine, state file, and runtime logs.", + "computed": true, + "elem": { + "engine_cmd": { + "name": "engine_cmd", + "type": "TypeString", + "description": "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", + "computed": true + }, + "engine_name": { + "name": "engine_name", + "type": "TypeString", + "description": "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", + "computed": true + }, + "engine_version": { + "name": "engine_version", + "type": "TypeString", + "description": "The version of the provisioning engine that was used.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", + "computed": true + }, + "log_store_url": { + "name": "log_store_url", + "type": "TypeString", + "description": "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", + "computed": true + }, + "output_values": { + "name": "output_values", + "type": "TypeList", + "description": "List of Output values.", + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "resources": { + "name": "resources", + "type": "TypeList", + "description": "List of resources.", + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "state_store_url": { + "name": "state_store_url", + "type": "TypeString", + "description": "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", + "computed": true + } + } }, { - "name": "template_values", - "type": "TypeString", - "description": "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", - "computed": true + "name": "template_env_settings", + "type": "TypeList", + "description": "List of environment values.", + "computed": true, + "elem": { + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of the variable.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](/docs/schematics?topic=schematics-create-tf-config#declare-variable).", + "computed": true + } + } }, { "name": "template_values_metadata", @@ -75873,90 +79332,225 @@ "computed": true }, { - "name": "frozen_at", + "name": "template_git_repo_sha_value", "type": "TypeString", - "description": "The timestamp when the workspace was frozen.", + "description": "The repository SHA value.", "computed": true }, { - "name": "status_msg", + "name": "template_git_url", "type": "TypeString", - "description": "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", + "description": "The source URL.", "computed": true - } - ], - "ibm_secrets_manager_secret": [ + }, { - "name": "type", + "name": "is_frozen", + "type": "TypeBool", + "computed": true, + "deprecated": "use frozen instead" + }, + { + "name": "frozen_at", "type": "TypeString", - "description": "The MIME type that represents the secret.", + "description": "The timestamp when the workspace was frozen.", "computed": true }, { - "name": "password", - "type": "TypeString", - "description": "The password to assign to this secret.", - "secure": true, + "name": "is_locked", + "type": "TypeBool", + "description": "If set to true, the workspace is locked and disabled for changes.", + "computed": true, + "deprecated": "Use locked instead" + }, + { + "name": "locked", + "type": "TypeBool", + "description": "If set to true, the workspace is locked and disabled for changes.", "computed": true }, { - "name": "access_groups", + "name": "template_inputs", "type": "TypeList", - "description": "The access groups that define the capabilities of the service ID and API key that are generated for an`iam_credentials` secret.**Tip:** To find the ID of an access group, go to **Manage \u003e Access (IAM) \u003e Access groups** in the IBM Cloud console. Select the access group to inspect, and click **Details** to view its ID.", + "description": "Information about the input variables that your template uses.", "computed": true, "elem": { - "type": "TypeString" + "description": { + "name": "description", + "type": "TypeString", + "description": "The description of your input variable.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of the variable.", + "computed": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "If set to `true`, the value of your input variable is protected and not returned in your API response.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "`Terraform v0.11` supports `string`, `list`, `map` data type. For more information, about the syntax, see [Configuring input variables](https://www.terraform.io/docs/configuration-0-11/variables.html).\u003cbr\u003e `Terraform v0.12` additionally, supports `bool`, `number` and complex data types such as `list(type)`, `map(type)`,`object({attribute name=type,..})`, `set(type)`, `tuple([type])`. For more information, about the syntax to use the complex data type, see [Configuring variables](https://www.terraform.io/docs/configuration/variables.html#type-constraints).", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](https://cloud.ibm.com/docs/schematics?topic=schematics-create-tf-config#declare-variable).", + "computed": true + } } }, { - "name": "api_key", + "name": "template_ref", "type": "TypeString", - "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically. If you want to continue to use the same API key for future read operations, see the `reuse_api_key` field.", - "secure": true, + "description": "Workspace template ref.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "The user ID that updated the workspace.", + "computed": true + }, + { + "name": "locked_by", + "type": "TypeString", + "description": "The user ID that initiated a resource-related job, such as applying or destroying resources, that locked the workspace.", "computed": true }, { "name": "name", "type": "TypeString", - "description": "A human-readable alias to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.", + "description": "The name of the workspace.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.", + "name": "template_git_folder", + "type": "TypeString", + "description": "The subfolder in your GitHub or GitLab repository where your Terraform template is stored. If your template is stored in the root directory, `.` is returned.", + "computed": true + }, + { + "name": "template_values", + "type": "TypeString", + "description": "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The timestamp when the workspace was last updated.", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user ID that created the workspace.", "computed": true }, { "name": "crn", "type": "TypeString", - "description": "The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource.", + "description": "The workspace CRN.", "cloud_data_type": "crn", "computed": true }, { - "name": "next_rotation_date", + "name": "location", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that can be auto-rotated and have an existing rotation policy.", + "description": "The IBM Cloud location where your workspace was provisioned.", + "cloud_data_type": "region", + "optional": true, "computed": true }, { - "name": "secret_type", + "name": "template_type", "type": "TypeString", - "description": "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", - "required": true, - "options": "arbitrary,iam_credentials,imported_cert,public_cert,private_cert,username_password,kv" + "description": "The Terraform version that was used to run your Terraform code.", + "computed": true }, { - "name": "secret_id", + "name": "template_uninstall_script_name", "type": "TypeString", - "description": "The v4 UUID that uniquely identifies the secret.", - "required": true + "description": "Uninstall script name.", + "computed": true }, { - "name": "expiration_date", + "name": "template_git_release", "type": "TypeString", - "description": "The date the secret material expires. The date format follows RFC 3339.You can set an expiration date on supported secret types at their creation. If you create a secret without specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the following secret types:- `arbitrary`- `username_password`.", + "description": "The repository release.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp when the workspace was created.", + "computed": true + }, + { + "name": "last_health_check_at", + "type": "TypeString", + "description": "The timestamp when the last health check was performed by Schematics.", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the workspace. **Active**: After you successfully ran your infrastructure code by applying your Terraform execution plan, the state of your workspace changes to `Active`. **Connecting**: Schematics tries to connect to the template in your source repo. If successfully connected, the template is downloaded and metadata, such as input parameters, is extracted. After the template is downloaded, the state of the workspace changes to `Scanning`. **Draft**: The workspace is created without a reference to a GitHub or GitLab repository. **Failed**: If errors occur during the execution of your infrastructure code in IBM Cloud Schematics, your workspace status is set to `Failed`. **Inactive**: The Terraform template was scanned successfully and the workspace creation is complete. You can now start running Schematics plan and apply jobs to provision the IBM Cloud resources that you specified in your template. If you have an `Active` workspace and decide to remove all your resources, your workspace is set to `Inactive` after all your resources are removed. **In progress**: When you instruct IBM Cloud Schematics to run your infrastructure code by applying your Terraform execution plan, the status of our workspace changes to `In progress`. **Scanning**: The download of the Terraform template is complete and vulnerability scanning started. If the scan is successful, the workspace state changes to `Inactive`. If errors in your template are found, the state changes to `Template Error`. **Stopped**: The Schematics plan, apply, or destroy job was cancelled manually. **Template Error**: The Schematics template contains errors and cannot be processed.", + "computed": true + }, + { + "name": "template_git_branch", + "type": "TypeString", + "description": "The repository branch.", + "computed": true + }, + { + "name": "locked_time", + "type": "TypeString", + "description": "The timestamp when the workspace was locked.", + "computed": true + } + ], + "ibm_secrets_manager_secret": [ + { + "name": "service_id", + "type": "TypeString", + "description": "The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the access groups that you assign for this secret.", + "computed": true + }, + { + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to filter for secrets in your instance.Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "creation_date", + "type": "TypeString", + "description": "The date the secret was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource.", + "cloud_data_type": "crn", "computed": true }, { @@ -75973,10 +79567,24 @@ "computed": true }, { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret.", - "computed": true + "name": "metadata", + "type": "TypeList", + "description": "The metadata that describes the resource array.", + "computed": true, + "elem": { + "collection_total": { + "name": "collection_total", + "type": "TypeInt", + "description": "The number of elements in the resource array.", + "computed": true + }, + "collection_type": { + "name": "collection_type", + "type": "TypeString", + "description": "The type of resources in the resource array.", + "computed": true + } + } }, { "name": "versions", @@ -76010,12 +79618,6 @@ } } }, - { - "name": "service_id", - "type": "TypeString", - "description": "The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the access groups that you assign for this secret.", - "computed": true - }, { "name": "secret_data", "type": "TypeMap", @@ -76024,22 +79626,17 @@ "computed": true }, { - "name": "instance_id", + "name": "secret_type", "type": "TypeString", - "description": "Secrets Manager instance GUID", - "cloud_data_type": "resource_instance", + "description": "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", "required": true, - "cloud_data_range": [ - "service:secrets-manager" - ] + "options": "arbitrary,iam_credentials,imported_cert,public_cert,private_cert,username_password,kv" }, { - "name": "endpoint_type", + "name": "next_rotation_date", "type": "TypeString", - "description": "Endpoint Type. 'public' or 'private'", - "default_value": "public", - "options": "public, private", - "optional": true + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that can be auto-rotated and have an existing rotation policy.", + "computed": true }, { "name": "created_by", @@ -76048,79 +79645,80 @@ "computed": true }, { - "name": "last_update_date", + "name": "password", "type": "TypeString", - "description": "Updates when the actual secret is modified. The date format follows RFC 3339.", + "description": "The password to assign to this secret.", + "secure": true, "computed": true }, { - "name": "ttl", + "name": "access_groups", + "type": "TypeList", + "description": "The access groups that define the capabilities of the service ID and API key that are generated for an`iam_credentials` secret.**Tip:** To find the ID of an access group, go to **Manage \u003e Access (IAM) \u003e Access groups** in the IBM Cloud console. Select the access group to inspect, and click **Details** to view its ID.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "username", "type": "TypeString", - "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.", + "description": "The username to assign to this secret.", + "secure": true, "computed": true }, { - "name": "secret_group_id", + "name": "api_key", "type": "TypeString", - "description": "The v4 UUID that uniquely identifies the secret group to assign to this secret.If you omit this parameter, your secret is assigned to the `default` secret group.", + "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically. If you want to continue to use the same API key for future read operations, see the `reuse_api_key` field.", + "secure": true, "computed": true }, { - "name": "state_description", + "name": "secret_id", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The v4 UUID that uniquely identifies the secret.", + "required": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.", "computed": true }, { - "name": "creation_date", + "name": "expiration_date", "type": "TypeString", - "description": "The date the secret was created. The date format follows RFC 3339.", + "description": "The date the secret material expires. The date format follows RFC 3339.You can set an expiration date on supported secret types at their creation. If you create a secret without specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the following secret types:- `arbitrary`- `username_password`.", "computed": true }, { - "name": "metadata", - "type": "TypeList", - "description": "The metadata that describes the resource array.", - "computed": true, - "elem": { - "collection_total": { - "name": "collection_total", - "type": "TypeInt", - "description": "The number of elements in the resource array.", - "computed": true - }, - "collection_type": { - "name": "collection_type", - "type": "TypeString", - "description": "The type of resources in the resource array.", - "computed": true - } - } + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret.", + "computed": true }, { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to filter for secrets in your instance.Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "last_update_date", + "type": "TypeString", + "description": "Updates when the actual secret is modified. The date format follows RFC 3339.", + "computed": true }, { - "name": "username", + "name": "ttl", "type": "TypeString", - "description": "The username to assign to this secret.", - "secure": true, + "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.", "computed": true - } - ], - "ibm_secrets_manager_secrets": [ + }, { - "name": "secret_type", + "name": "instance_id", "type": "TypeString", - "description": "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", - "options": "arbitrary, iam_credentials, username_password", - "optional": true + "description": "Secrets Manager instance GUID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:secrets-manager" + ] }, { "name": "endpoint_type", @@ -76130,6 +79728,26 @@ "options": "public, private", "optional": true }, + { + "name": "type", + "type": "TypeString", + "description": "The MIME type that represents the secret.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "A human-readable alias to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.", + "computed": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "The v4 UUID that uniquely identifies the secret group to assign to this secret.If you omit this parameter, your secret is assigned to the `default` secret group.", + "computed": true + } + ], + "ibm_secrets_manager_secrets": [ { "name": "metadata", "type": "TypeList", @@ -76354,6 +79972,21 @@ "cloud_data_range": [ "service:secrets-manager" ] + }, + { + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", + "options": "arbitrary, iam_credentials, username_password", + "optional": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "Endpoint Type. 'public' or 'private'", + "default_value": "public", + "options": "public, private", + "optional": true } ], "ibm_security_group": [ @@ -76379,6 +80012,18 @@ } ], "ibm_service_instance": [ + { + "name": "service_plan_guid", + "type": "TypeString", + "description": "The uniquie identifier of the service offering plan type", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Service instance name for example, speech_to_text", + "required": true + }, { "name": "space_guid", "type": "TypeString", @@ -76412,28 +80057,9 @@ "computed": true } } - }, - { - "name": "service_plan_guid", - "type": "TypeString", - "description": "The uniquie identifier of the service offering plan type", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Service instance name for example, speech_to_text", - "required": true } ], "ibm_service_key": [ - { - "name": "credentials", - "type": "TypeMap", - "description": "Credentials asociated with the key", - "secure": true, - "computed": true - }, { "name": "name", "type": "TypeString", @@ -76451,6 +80077,13 @@ "type": "TypeString", "description": "The guid of the space in which the service instance is present", "required": true + }, + { + "name": "credentials", + "type": "TypeMap", + "description": "Credentials asociated with the key", + "secure": true, + "computed": true } ], "ibm_service_plan": [ @@ -76469,74 +80102,81 @@ ], "ibm_sm_arbitrary_secret": [ { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "versions_total", + "name": "locks_total", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true }, { - "name": "created_by", + "name": "expiration_date", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "description", + "name": "payload", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The arbitrary secret's data payload.", + "secure": true, "computed": true }, { - "name": "secret_group_id", + "name": "instance_id", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "secret_type", + "name": "created_at", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "state_description", + "name": "created_by", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "payload", + "name": "crn", "type": "TypeString", - "description": "The arbitrary secret's data payload.", - "secure": true, + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "endpoint_type", + "name": "secret_group_name", "type": "TypeString", - "description": "public or private.", + "description": "The human-readable name of your secret group.", "optional": true }, { "name": "secret_id", "type": "TypeString", "description": "The ID of the secret.", - "required": true + "optional": true, + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "computed": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true }, { "name": "labels", @@ -76548,9 +80188,16 @@ } }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "name", + "type": "TypeString", + "description": "The human-readable name of your secret.", + "optional": true, + "computed": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { @@ -76560,73 +80207,66 @@ "computed": true }, { - "name": "expiration_date", - "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "crn", + "name": "region", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "name", + "name": "state_description", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, - { - "name": "region", + "name": "endpoint_type", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true + "description": "public or private.", + "optional": true }, { - "name": "created_at", + "name": "secret_type", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true } ], "ibm_sm_arbitrary_secret_metadata": [ { - "name": "instance_id", + "name": "secret_group_id", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "A v4 UUID identifier, or `default` secret group.", + "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "created_at", + "name": "crn", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { @@ -76638,6 +80278,18 @@ "type": "TypeString" } }, + { + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, + { + "name": "secret_id", + "type": "TypeString", + "description": "The ID of the secret.", + "required": true + }, { "name": "name", "type": "TypeString", @@ -76645,9 +80297,15 @@ "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { @@ -76657,33 +80315,40 @@ "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { - "name": "updated_at", + "name": "expiration_date", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "endpoint_type", + "name": "instance_id", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "region", + "name": "created_at", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "description", "type": "TypeString", @@ -76691,15 +80356,18 @@ "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "secret_group_id", + "name": "created_by", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -76709,40 +80377,42 @@ "computed": true }, { - "name": "versions_total", + "name": "state", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true + } + ], + "ibm_sm_configurations": [ + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "expiration_date", + "name": "region", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "secret_id", + "name": "endpoint_type", "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "description": "public or private.", + "optional": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "sort", + "type": "TypeString", + "description": "Sort a collection of secrets by the specified field in ascending order. To sort in descending order use the `-` character. Available values: id | created_at | updated_at | expiration_date | secret_type | name", + "optional": true }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true - } - ], - "ibm_sm_configurations": [ { "name": "search", "type": "TypeString", @@ -76870,38 +80540,15 @@ "computed": true } } - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, + } + ], + "ibm_sm_en_registration": [ { - "name": "region", + "name": "event_notifications_instance_crn", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "A CRN that uniquely identifies an IBM Cloud resource.", "computed": true }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "sort", - "type": "TypeString", - "description": "Sort a collection of secrets by the specified field in ascending order. To sort in descending order use the `-` character. Available values: id | created_at | updated_at | expiration_date | secret_type | name", - "optional": true - } - ], - "ibm_sm_en_registration": [ { "name": "instance_id", "type": "TypeString", @@ -76924,27 +80571,9 @@ "type": "TypeString", "description": "public or private.", "optional": true - }, - { - "name": "event_notifications_instance_crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "computed": true } ], "ibm_sm_iam_credentials_configuration": [ - { - "name": "name", - "type": "TypeString", - "description": "The name of the configuration.", - "required": true - }, - { - "name": "config_type", - "type": "TypeString", - "description": "The configuration type.", - "computed": true - }, { "name": "secret_type", "type": "TypeString", @@ -76952,9 +80581,9 @@ "computed": true }, { - "name": "created_by", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { @@ -76966,12 +80595,6 @@ "optional": true, "computed": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, { "name": "updated_at", "type": "TypeString", @@ -76998,13 +80621,17 @@ "type": "TypeString", "description": "public or private.", "optional": true - } - ], - "ibm_sm_iam_credentials_secret": [ + }, { - "name": "secret_type", + "name": "name", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The name of the configuration.", + "required": true + }, + { + "name": "config_type", + "type": "TypeString", + "description": "The configuration type.", "computed": true }, { @@ -77012,32 +80639,58 @@ "type": "TypeString", "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true + } + ], + "ibm_sm_iam_credentials_secret": [ + { + "name": "secret_group_name", + "type": "TypeString", + "description": "The human-readable name of your secret group.", + "optional": true }, { - "name": "labels", + "name": "access_groups", "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "description": "Access Groups that you can use for an `iam_credentials` secret.Up to 10 Access Groups can be used for each secret.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "api_key_id", + "name": "description", "type": "TypeString", - "description": "The ID of the API key that is generated for this secret.", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "state_description", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "api_key", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically.", + "secure": true, "computed": true }, { - "name": "reuse_api_key", - "type": "TypeBool", - "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. The value is always `true` for IAM credentials secrets managed by Terraform.", + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { @@ -77047,50 +80700,86 @@ "optional": true }, { - "name": "secret_id", + "name": "name", "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "description": "The human-readable name of your secret.", + "optional": true, + "computed": true }, { - "name": "versions_total", + "name": "locks_total", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "next_rotation_date", + "name": "created_at", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "region", + "name": "crn", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "updated_at", + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "secret_type", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "name", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "secret_id", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The ID of the secret.", + "optional": true, + "computed": true + }, + { + "name": "ttl", + "type": "TypeString", + "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", "computed": true }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "secret_group_id", "type": "TypeString", "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, { "name": "service_id", "type": "TypeString", @@ -77098,32 +80787,39 @@ "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "name": "service_id_is_static", + "type": "TypeBool", + "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", + "computed": true }, { - "name": "description", + "name": "reuse_api_key", + "type": "TypeBool", + "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. The value is always `true` for IAM credentials secrets managed by Terraform.", + "computed": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true + }, + { + "name": "updated_at", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "next_rotation_date", + "type": "TypeString", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "computed": true }, { - "name": "ttl", + "name": "created_by", "type": "TypeString", - "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -77159,82 +80855,23 @@ } }, { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "service_id_is_static", - "type": "TypeBool", - "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", - "computed": true - }, - { - "name": "api_key", - "type": "TypeString", - "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically.", - "secure": true, - "computed": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true - }, - { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true - }, - { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", - "computed": true - }, - { - "name": "access_groups", - "type": "TypeList", - "description": "Access Groups that you can use for an `iam_credentials` secret.Up to 10 Access Groups can be used for each secret.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "created_at", + "name": "api_key_id", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The ID of the API key that is generated for this secret.", "computed": true } ], "ibm_sm_iam_credentials_secret_metadata": [ { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true - }, - { - "name": "secret_type", + "name": "name", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The human-readable name of your secret.", "computed": true }, { - "name": "updated_at", + "name": "api_key_id", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The ID of the API key that is generated for this secret.", "computed": true }, { @@ -77244,36 +80881,15 @@ "computed": true }, { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true - }, - { - "name": "ttl", - "type": "TypeString", - "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", - "computed": true - }, - { - "name": "service_id", - "type": "TypeString", - "description": "The service ID under which the API key (see the `api_key` field) is created.If you omit this parameter, Secrets Manager generates a new service ID for your secret at its creation and adds it to the access groups that you assign.Optionally, you can use this field to provide your own service ID if you prefer to manage its access directly or retain the service ID after your secret expires, is rotated, or deleted. If you provide a service ID, do not include the `access_groups` parameter.", - "computed": true - }, - { - "name": "region", + "name": "updated_at", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "state", + "name": "versions_total", "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "description": "The number of versions of the secret.", "computed": true }, { @@ -77309,40 +80925,36 @@ } }, { - "name": "next_rotation_date", + "name": "created_by", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "endpoint_type", + "name": "created_at", "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "api_key_id", - "type": "TypeString", - "description": "The ID of the API key that is generated for this secret.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "reuse_api_key", - "type": "TypeBool", - "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. The value is always `true` for IAM credentials secrets managed by Terraform.", + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", "computed": true }, { @@ -77354,6 +80966,18 @@ "type": "TypeString" } }, + { + "name": "next_rotation_date", + "type": "TypeString", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "computed": true + }, + { + "name": "ttl", + "type": "TypeString", + "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", + "computed": true + }, { "name": "secret_id", "type": "TypeString", @@ -77361,30 +80985,22 @@ "required": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "description", + "name": "crn", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "name", + "name": "description", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "created_by", + "name": "service_id", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The service ID under which the API key (see the `api_key` field) is created.If you omit this parameter, Secrets Manager generates a new service ID for your secret at its creation and adds it to the access groups that you assign.Optionally, you can use this field to provide your own service ID if you prefer to manage its access directly or retain the service ID after your secret expires, is rotated, or deleted. If you provide a service ID, do not include the `access_groups` parameter.", "computed": true }, { @@ -77397,15 +81013,30 @@ } }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "reuse_api_key", + "type": "TypeBool", + "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. The value is always `true` for IAM credentials secrets managed by Terraform.", "computed": true }, { - "name": "service_id_is_static", - "type": "TypeBool", - "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { @@ -77415,59 +81046,89 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true + }, + { + "name": "service_id_is_static", + "type": "TypeBool", + "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", + "computed": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true } ], "ibm_sm_imported_certificate": [ { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "name": "private_key_included", + "type": "TypeBool", + "description": "Indicates whether the certificate was imported with an associated private key.", "computed": true }, { - "name": "key_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "intermediate", + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "secret_group_id", "type": "TypeString", - "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", - "secure": true, + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { - "name": "created_by", + "name": "intermediate_included", + "type": "TypeBool", + "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", + "computed": true + }, + { + "name": "key_algorithm", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", "computed": true }, { - "name": "created_at", + "name": "created_by", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "secret_type", + "name": "signing_algorithm", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", "computed": true }, { - "name": "state_description", + "name": "serial_number", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { - "name": "instance_id", + "name": "endpoint_type", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "public or private.", + "optional": true }, { "name": "description", @@ -77476,32 +81137,36 @@ "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "expiration_date", + "name": "name", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The human-readable name of your secret.", + "optional": true, "computed": true }, { - "name": "certificate", + "name": "secret_type", "type": "TypeString", - "description": "The PEM-encoded contents of your certificate.", - "secure": true, + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true }, { "name": "common_name", @@ -77510,34 +81175,37 @@ "computed": true }, { - "name": "private_key", + "name": "issuer", "type": "TypeString", - "description": "(Optional) The PEM-encoded private key to associate with the certificate.", - "secure": true, + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, { - "name": "region", + "name": "secret_id", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, + "description": "The ID of the secret.", "optional": true, "computed": true }, { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "locks_total", + "name": "secret_group_name", + "type": "TypeString", + "description": "The human-readable name of your secret group.", + "optional": true + }, + { + "name": "versions_total", "type": "TypeInt", - "description": "The number of locks of the secret.", + "description": "The number of versions of the secret.", "computed": true }, { @@ -77550,52 +81218,52 @@ } }, { - "name": "serial_number", + "name": "private_key", "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", - "computed": true - }, - { - "name": "private_key_included", - "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated private key.", + "description": "(Optional) The PEM-encoded private key to associate with the certificate.", + "secure": true, "computed": true }, { - "name": "secret_id", + "name": "region", "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "name", + "name": "created_at", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "signing_algorithm", + "name": "certificate", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "The PEM-encoded contents of your certificate.", + "secure": true, "computed": true }, { - "name": "issuer", + "name": "instance_id", "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "intermediate_included", - "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", + "name": "expiration_date", + "type": "TypeString", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { @@ -77619,35 +81287,42 @@ } }, { - "name": "endpoint_type", + "name": "intermediate", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", + "secure": true, + "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", "computed": true + } + ], + "ibm_sm_imported_certificate_metadata": [ + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true }, { - "name": "versions_total", + "name": "locks_total", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "secret_group_id", + "name": "secret_type", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true - } - ], - "ibm_sm_imported_certificate_metadata": [ + }, { - "name": "secret_type", + "name": "updated_at", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { @@ -77660,89 +81335,77 @@ } }, { - "name": "validity", - "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", - "computed": true, - "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - } - } + "name": "serial_number", + "type": "TypeString", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "computed": true }, { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "serial_number", + "name": "name", "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "description": "The human-readable name of your secret.", "computed": true }, { - "name": "issuer", + "name": "expiration_date", "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "name": "intermediate_included", + "type": "TypeBool", + "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", "computed": true }, { - "name": "created_at", + "name": "instance_id", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "secret_group_id", + "name": "description", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "state_description", + "name": "secret_group_id", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { - "name": "signing_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { @@ -77752,48 +81415,69 @@ "computed": true }, { - "name": "intermediate_included", + "name": "private_key_included", "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", + "description": "Indicates whether the certificate was imported with an associated private key.", "computed": true }, { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "private_key_included", - "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated private key.", + "name": "signing_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", "computed": true, "elem": { - "type": "TypeString" + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } } }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "secret_id", + "type": "TypeString", + "description": "The ID of the secret.", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "versions_total", + "name": "state", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { @@ -77803,28 +81487,48 @@ "computed": true }, { - "name": "name", + "name": "key_algorithm", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", "computed": true }, { - "name": "key_algorithm", + "name": "issuer", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + } + ], + "ibm_sm_kv_secret": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { "name": "secret_id", "type": "TypeString", "description": "The ID of the secret.", - "required": true + "optional": true, + "computed": true }, { - "name": "crn", + "name": "created_by", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { @@ -77834,33 +81538,45 @@ "computed": true }, { - "name": "expiration_date", - "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "instance_id", + "name": "secret_group_name", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - } - ], - "ibm_sm_kv_secret": [ + "description": "The human-readable name of your secret group.", + "optional": true + }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "state", + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "versions_total", "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "description": "The number of versions of the secret.", "computed": true }, + { + "name": "data", + "type": "TypeMap", + "description": "The payload data of a key-value secret.", + "secure": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "instance_id", "type": "TypeString", @@ -77888,17 +81604,9 @@ } }, { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true - }, - { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, + "description": "The human-readable name of your secret.", "optional": true, "computed": true }, @@ -77908,18 +81616,6 @@ "description": "public or private.", "optional": true }, - { - "name": "secret_id", - "type": "TypeString", - "description": "The ID of the secret.", - "required": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, { "name": "secret_group_id", "type": "TypeString", @@ -77927,55 +81623,18 @@ "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", - "computed": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The human-readable name of your secret.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "computed": true - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "updated_at", + "name": "region", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "data", - "type": "TypeMap", - "description": "The payload data of a key-value secret.", - "secure": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "created_by", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { @@ -77984,6 +81643,12 @@ "description": "A CRN that uniquely identifies an IBM Cloud resource.", "cloud_data_type": "crn", "computed": true + }, + { + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true } ], "ibm_sm_kv_secret_metadata": [ @@ -77994,11 +81659,17 @@ "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "name", + "type": "TypeString", + "description": "The human-readable name of your secret.", "computed": true }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, { "name": "instance_id", "type": "TypeString", @@ -78008,23 +81679,51 @@ "required": true }, { - "name": "created_at", + "name": "secret_id", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The ID of the secret.", + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "description", "type": "TypeString", "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "computed": true + }, { "name": "secret_type", "type": "TypeString", "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, { "name": "region", "type": "TypeString", @@ -78035,28 +81734,15 @@ "computed": true }, { - "name": "secret_id", - "type": "TypeString", - "description": "The ID of the secret.", - "required": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "secret_group_id", + "name": "created_at", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { @@ -78065,12 +81751,6 @@ "description": "The number of versions of the secret.", "computed": true }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, { "name": "created_by", "type": "TypeString", @@ -78078,20 +81758,14 @@ "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "name", - "type": "TypeString", - "description": "The human-readable name of your secret.", - "computed": true - }, { "name": "state_description", "type": "TypeString", @@ -78099,19 +81773,10 @@ "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true - }, - { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_sm_private_certificate": [ @@ -78121,12 +81786,6 @@ "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, - { - "name": "key_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", - "computed": true - }, { "name": "private_key", "type": "TypeString", @@ -78135,55 +81794,39 @@ "computed": true }, { - "name": "issuing_ca", + "name": "endpoint_type", "type": "TypeString", - "description": "The PEM-encoded certificate of the certificate authority that signed and issued this certificate.", - "secure": true, - "computed": true + "description": "public or private.", + "optional": true }, { - "name": "created_by", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "created_at", + "name": "state_description", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "expiration_date", + "name": "secret_type", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "serial_number", + "name": "key_algorithm", "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", "computed": true }, { @@ -78207,9 +81850,9 @@ } }, { - "name": "certificate", + "name": "issuing_ca", "type": "TypeString", - "description": "The PEM-encoded contents of your certificate.", + "description": "The PEM-encoded certificate of the certificate authority that signed and issued this certificate.", "secure": true, "computed": true }, @@ -78217,24 +81860,102 @@ "name": "secret_id", "type": "TypeString", "description": "The ID of the secret.", - "required": true + "optional": true, + "computed": true }, { - "name": "secret_type", + "name": "name", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The human-readable name of your secret.", + "optional": true, "computed": true }, { - "name": "name", + "name": "expiration_date", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "secret_group_id", + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, + { + "name": "secret_group_name", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The human-readable name of your secret group.", + "optional": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "signing_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "computed": true + }, + { + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "computed": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true + }, + { + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "computed": true + }, + { + "name": "serial_number", + "type": "TypeString", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "computed": true + }, + { + "name": "revocation_time_seconds", + "type": "TypeInt", + "description": "The timestamp of the certificate revocation.", + "computed": true + }, + { + "name": "certificate_template", + "type": "TypeString", + "description": "The name of the certificate template.", + "computed": true + }, + { + "name": "next_rotation_date", + "type": "TypeString", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", "computed": true }, { @@ -78270,9 +81991,24 @@ } }, { - "name": "revocation_time_seconds", + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true + }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "versions_total", "type": "TypeInt", - "description": "The timestamp of the certificate revocation.", + "description": "The number of versions of the secret.", "computed": true }, { @@ -78286,36 +82022,46 @@ } }, { - "name": "certificate_template", + "name": "instance_id", "type": "TypeString", - "description": "The name of the certificate template.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "revocation_time_rfc3339", + "name": "updated_at", "type": "TypeString", - "description": "The date and time that the certificate was revoked. The date format follows RFC 3339.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "endpoint_type", + "name": "certificate_authority", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The intermediate certificate authority that signed this certificate.", + "computed": true }, { - "name": "certificate_authority", + "name": "revocation_time_rfc3339", "type": "TypeString", - "description": "The intermediate certificate authority that signed this certificate.", + "description": "The date and time that the certificate was revoked. The date format follows RFC 3339.", "computed": true }, { - "name": "instance_id", + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "certificate", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "The PEM-encoded contents of your certificate.", + "secure": true, + "computed": true }, { "name": "region", @@ -78325,120 +82071,169 @@ "immutable": true, "optional": true, "computed": true + } + ], + "ibm_sm_private_certificate_configuration_intermediate_ca": [ + { + "name": "issuing_certificates_urls_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", + "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "private_key_format", + "type": "TypeString", + "description": "The format of the generated private key.", "computed": true }, { - "name": "state_description", + "name": "postal_code", + "type": "TypeList", + "description": "The postal code values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_id", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "crl_disable", + "type": "TypeBool", + "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", "computed": true }, { - "name": "updated_at", + "name": "key_type", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The type of private key to generate.", "computed": true }, { - "name": "signing_algorithm", + "name": "organization", + "type": "TypeList", + "description": "The Organization (O) values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "ip_sans", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", "computed": true }, { - "name": "next_rotation_date", + "name": "status", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", "computed": true }, { - "name": "crn", + "name": "endpoint_type", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "public or private.", + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the configuration.", + "required": true + }, + { + "name": "config_type", + "type": "TypeString", + "description": "Th configuration type.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", + "name": "signing_method", + "type": "TypeString", + "description": "The signing method to use with this certificate authority to generate private certificates.You can choose between internal or externally signed options. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-intermediate-certificate-authorities).", + "computed": true + }, + { + "name": "other_sans", + "type": "TypeList", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "description", + "name": "region", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "labels", + "name": "locality", "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "common_name", + "name": "serial_number", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", "computed": true - } - ], - "ibm_sm_private_certificate_configuration_intermediate_ca": [ + }, { - "name": "common_name", - "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "name": "max_ttl_seconds", + "type": "TypeInt", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", "computed": true }, { - "name": "private_key_format", + "name": "issuer", "type": "TypeString", - "description": "The format of the generated private key.", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, { - "name": "key_bits", - "type": "TypeInt", - "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "name": "format", + "type": "TypeString", + "description": "The format of the returned data.", "computed": true }, { - "name": "locality", + "name": "ou", "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "crl_expiry_seconds", - "type": "TypeInt", - "description": "The time until the certificate revocation list (CRL) expires, in seconds.", - "computed": true - }, - { - "name": "signing_method", - "type": "TypeString", - "description": "The signing method to use with this certificate authority to generate private certificates.You can choose between internal or externally signed options. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-intermediate-certificate-authorities).", - "computed": true + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "uri_sans", @@ -78447,30 +82242,33 @@ "computed": true }, { - "name": "serial_number", - "type": "TypeString", - "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", + "name": "key_bits", + "type": "TypeInt", + "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", "computed": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true + "name": "province", + "type": "TypeList", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true + "name": "street_address", + "type": "TypeList", + "description": "The street address values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "secret_type", + "name": "expiration_date", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { @@ -78531,111 +82329,89 @@ } }, { - "name": "organization", - "type": "TypeList", - "description": "The Organization (O) values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "crl_expiry_seconds", + "type": "TypeInt", + "description": "The time until the certificate revocation list (CRL) expires, in seconds.", + "computed": true }, { - "name": "crl_disable", + "name": "exclude_cn_from_sans", "type": "TypeBool", - "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", + "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", "computed": true }, { - "name": "other_sans", + "name": "country", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "format", + "name": "secret_type", "type": "TypeString", - "description": "The format of the returned data.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "ou", - "type": "TypeList", - "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "province", - "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, + "name": "crl_distribution_points_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", + "computed": true + } + ], + "ibm_sm_private_certificate_configuration_root_ca": [ { - "name": "status", + "name": "updated_at", "type": "TypeString", - "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "name", + "name": "region", "type": "TypeString", - "description": "The name of the configuration.", - "required": true + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "postal_code", + "name": "permitted_dns_domains", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "issuer", - "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", - "computed": true - }, - { - "name": "issuing_certificates_urls_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", - "computed": true - }, - { - "name": "key_type", - "type": "TypeString", - "description": "The type of private key to generate.", - "computed": true - }, - { - "name": "country", + "name": "street_address", "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "description": "The street address values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "expiration_date", + "name": "created_at", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "config_type", - "type": "TypeString", - "description": "Th configuration type.", + "name": "crl_disable", + "type": "TypeBool", + "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", + "computed": true + }, + { + "name": "crl_distribution_points_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", "computed": true }, { @@ -78654,87 +82430,29 @@ "computed": true }, { - "name": "exclude_cn_from_sans", - "type": "TypeBool", - "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", + "name": "ttl_seconds", + "type": "TypeInt", + "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", "computed": true }, { - "name": "street_address", + "name": "locality", "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, - { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", - "computed": true - }, - { - "name": "crl_distribution_points_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", - "computed": true - } - ], - "ibm_sm_private_certificate_configuration_root_ca": [ - { - "name": "ttl_seconds", - "type": "TypeInt", - "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", - "computed": true - }, - { - "name": "key_bits", - "type": "TypeInt", - "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", - "computed": true - }, - { - "name": "province", + "name": "postal_code", "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", + "description": "The postal code values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "crl_distribution_points_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", - "computed": true - }, { "name": "status", "type": "TypeString", @@ -78742,117 +82460,45 @@ "computed": true }, { - "name": "uri_sans", - "type": "TypeString", - "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "computed": true - }, - { - "name": "format", + "name": "endpoint_type", "type": "TypeString", - "description": "The format of the returned data.", - "computed": true - }, - { - "name": "max_path_length", - "type": "TypeInt", - "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", - "computed": true - }, - { - "name": "street_address", - "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } + "description": "public or private.", + "optional": true }, { - "name": "expiration_date", + "name": "secret_type", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "crl_disable", - "type": "TypeBool", - "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", - "computed": true - }, - { - "name": "exclude_cn_from_sans", - "type": "TypeBool", - "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "organization", - "type": "TypeList", - "description": "The Organization (O) values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "other_sans", - "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "private_key_format", + "name": "key_type", "type": "TypeString", - "description": "The format of the generated private key.", + "description": "The type of private key to generate.", "computed": true }, { - "name": "ou", + "name": "country", "type": "TypeList", - "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "locality", + "name": "province", "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "config_type", - "type": "TypeString", - "description": "The configuration type.", - "computed": true - }, - { - "name": "created_at", + "name": "serial_number", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "issuing_certificates_urls_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", + "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", "computed": true }, { @@ -78864,12 +82510,15 @@ "required": true }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The name of the configuration.", + "required": true + }, + { + "name": "config_type", + "type": "TypeString", + "description": "The configuration type.", "computed": true }, { @@ -78879,56 +82528,50 @@ "computed": true }, { - "name": "ip_sans", + "name": "uri_sans", "type": "TypeString", - "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", "computed": true }, { - "name": "country", + "name": "other_sans", "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "updated_at", + "name": "format", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The format of the returned data.", "computed": true }, { - "name": "key_type", - "type": "TypeString", - "description": "The type of private key to generate.", + "name": "exclude_cn_from_sans", + "type": "TypeBool", + "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", "computed": true }, { - "name": "permitted_dns_domains", + "name": "ou", "type": "TypeList", - "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", + "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "postal_code", + "name": "organization", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The Organization (O) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", - "computed": true - }, { "name": "data", "type": "TypeList", @@ -78988,43 +82631,55 @@ } }, { - "name": "name", + "name": "common_name", "type": "TypeString", - "description": "The name of the configuration.", - "required": true + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "computed": true }, { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "common_name", + "name": "private_key_format", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The format of the generated private key.", "computed": true - } - ], - "ibm_sm_private_certificate_configuration_template": [ + }, { - "name": "config_type", - "type": "TypeString", - "description": "Th configuration type.", + "name": "key_bits", + "type": "TypeInt", + "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", "computed": true }, { - "name": "ttl_seconds", + "name": "max_ttl_seconds", "type": "TypeInt", - "description": "The requested Time To Live, after which the certificate will be expired.", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", "computed": true }, { - "name": "allow_bare_domains", + "name": "issuing_certificates_urls_encoded", "type": "TypeBool", - "description": "Determines whether to allow clients to request private certificates that match the value of the actual domains on the final certificate.For example, if you specify `example.com` in the `allowed_domains` field, you grant clients the ability to request a certificate that contains the name `example.com` as one of the DNS values on the final certificate.**Important:** In some scenarios, allowing bare domains can be considered a security risk.", + "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", + "computed": true + }, + { + "name": "max_path_length", + "type": "TypeInt", + "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", "computed": true }, + { + "name": "expiration_date", + "type": "TypeString", + "description": "The date a secret is expired. The date format follows RFC 3339.", + "computed": true + } + ], + "ibm_sm_private_certificate_configuration_template": [ { "name": "use_csr_common_name", "type": "TypeBool", @@ -79032,18 +82687,24 @@ "computed": true }, { - "name": "use_csr_sans", - "type": "TypeBool", - "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the Subject Alternative Names(SANs) from a certificate signing request (CSR) instead of the SANs that are included in the data of the certificate.Does not include the common name in the CSR. To use the common name, include the `use_csr_common_name` property.", - "computed": true + "name": "ou", + "type": "TypeList", + "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "region", + "name": "serial_number", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", + "computed": true + }, + { + "name": "allow_localhost", + "type": "TypeBool", + "description": "Determines whether to allow `localhost` to be included as one of the requested common names.", "computed": true }, { @@ -79053,117 +82714,149 @@ "computed": true }, { - "name": "allow_subdomains", + "name": "allow_any_name", "type": "TypeBool", - "description": "Determines whether to allow clients to request private certificates with common names (CN) that are subdomains of the CNs that are allowed by the other certificate template options. This includes wildcard subdomains.For example, if `allowed_domains` has a value of `example.com` and `allow_subdomains`is set to `true`, then the following subdomains are allowed: `foo.example.com`, `bar.example.com`, `*.example.com`.**Note:** This field is redundant if you use the `allow_any_name` option.", + "description": "Determines whether to allow clients to request a private certificate that matches any common name.", "computed": true }, { - "name": "allowed_other_sans", + "name": "key_bits", + "type": "TypeInt", + "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "computed": true + }, + { + "name": "key_usage", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names (SANs) to allow for private certificates.The format for each element in the list is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`. To allow any value for an OID, use `*` as its value. Alternatively, specify a single `*` to allow any `other_sans` input.", + "description": "The allowed key usage constraint to define for private certificates.You can find valid values in the [Go x509 package documentation](https://pkg.go.dev/crypto/x509#KeyUsage). Omit the `KeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "email_protection_flag", + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "enforce_hostnames", "type": "TypeBool", - "description": "Determines whether private certificates are flagged for email protection use.", + "description": "Determines whether to enforce only valid host names for common names, DNS Subject Alternative Names, and the host section of email addresses.", "computed": true }, { - "name": "allowed_domains", + "name": "use_csr_sans", + "type": "TypeBool", + "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the Subject Alternative Names(SANs) from a certificate signing request (CSR) instead of the SANs that are included in the data of the certificate.Does not include the common name in the CSR. To use the common name, include the `use_csr_common_name` property.", + "computed": true + }, + { + "name": "locality", "type": "TypeList", - "description": "The domains to define for the certificate template. This property is used along with the `allow_bare_domains` and `allow_subdomains` options.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "allow_any_name", - "type": "TypeBool", - "description": "Determines whether to allow clients to request a private certificate that matches any common name.", - "computed": true - }, - { - "name": "ext_key_usage", + "name": "policy_identifiers", "type": "TypeList", - "description": "The allowed extended key usage constraint on private certificates.You can find valid values in the [Go x509 package documentation](https://golang.org/pkg/crypto/x509/#ExtKeyUsage). Omit the `ExtKeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", + "description": "A list of policy Object Identifiers (OIDs).", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "ou", + "name": "postal_code", "type": "TypeList", - "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "description": "The postal code values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "basic_constraints_valid_for_non_ca", - "type": "TypeBool", - "description": "Determines whether to mark the Basic Constraints extension of an issued private certificate as valid for non-CA certificates.", - "computed": true + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "created_by", + "name": "certificate_authority", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The name of the intermediate certificate authority.", "computed": true }, { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "name": "allow_bare_domains", + "type": "TypeBool", + "description": "Determines whether to allow clients to request private certificates that match the value of the actual domains on the final certificate.For example, if you specify `example.com` in the `allowed_domains` field, you grant clients the ability to request a certificate that contains the name `example.com` as one of the DNS values on the final certificate.**Important:** In some scenarios, allowing bare domains can be considered a security risk.", "computed": true }, { - "name": "key_type", - "type": "TypeString", - "description": "The type of private key to generate.", + "name": "allow_glob_domains", + "type": "TypeBool", + "description": "Determines whether to allow glob patterns, for example, `ftp*.example.com`, in the names that are specified in the `allowed_domains` field.If set to `true`, clients are allowed to request private certificates with names that match the glob patterns.", "computed": true }, { - "name": "country", + "name": "ext_key_usage_oids", "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "description": "A list of extended key usage Object Identifiers (OIDs).", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "street_address", + "name": "organization", "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "description": "The Organization (O) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "updated_at", + "name": "config_type", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "Th configuration type.", "computed": true }, { - "name": "certificate_authority", + "name": "created_by", "type": "TypeString", - "description": "The name of the intermediate certificate authority.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "allow_glob_domains", - "type": "TypeBool", - "description": "Determines whether to allow glob patterns, for example, `ftp*.example.com`, in the names that are specified in the `allowed_domains` field.If set to `true`, clients are allowed to request private certificates with names that match the glob patterns.", + "name": "ext_key_usage", + "type": "TypeList", + "description": "The allowed extended key usage constraint on private certificates.You can find valid values in the [Go x509 package documentation](https://golang.org/pkg/crypto/x509/#ExtKeyUsage). Omit the `ExtKeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "country", + "type": "TypeList", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { @@ -79173,51 +82866,70 @@ "computed": true }, { - "name": "code_signing_flag", + "name": "email_protection_flag", "type": "TypeBool", - "description": "Determines whether private certificates are flagged for code signing use.", + "description": "Determines whether private certificates are flagged for email protection use.", "computed": true }, { - "name": "ext_key_usage_oids", - "type": "TypeList", - "description": "A list of extended key usage Object Identifiers (OIDs).", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "key_type", + "type": "TypeString", + "description": "The type of private key to generate.", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the configuration.", + "required": true + }, + { + "name": "max_ttl_seconds", + "type": "TypeInt", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "computed": true }, { - "name": "province", - "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "ttl_seconds", + "type": "TypeInt", + "description": "The requested Time To Live, after which the certificate will be expired.", + "computed": true }, { - "name": "postal_code", + "name": "allowed_uri_sans", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The URI Subject Alternative Names to allow for private certificates.Values can contain glob patterns, for example `spiffe://hostname/_*`.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "name": "require_cn", + "type": "TypeBool", + "description": "Determines whether to require a common name to create a private certificate.By default, a common name is required to generate a certificate. To make the `common_name` field optional, set the `require_cn` option to `false`.", + "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the configuration.", - "required": true + "name": "basic_constraints_valid_for_non_ca", + "type": "TypeBool", + "description": "Determines whether to mark the Basic Constraints extension of an issued private certificate as valid for non-CA certificates.", + "computed": true + }, + { + "name": "not_before_duration_seconds", + "type": "TypeInt", + "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.", + "computed": true }, { "name": "secret_type", @@ -79226,122 +82938,154 @@ "computed": true }, { - "name": "allowed_secret_groups", + "name": "updated_at", "type": "TypeString", - "description": "Scopes the creation of private certificates to only the secret groups that you specify.This field can be supplied as a comma-delimited list of secret group IDs.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "allow_localhost", - "type": "TypeBool", - "description": "Determines whether to allow `localhost` to be included as one of the requested common names.", - "computed": true + "name": "allowed_domains", + "type": "TypeList", + "description": "The domains to define for the certificate template. This property is used along with the `allow_bare_domains` and `allow_subdomains` options.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "enforce_hostnames", + "name": "allow_ip_sans", "type": "TypeBool", - "description": "Determines whether to enforce only valid host names for common names, DNS Subject Alternative Names, and the host section of email addresses.", + "description": "Determines whether to allow clients to request a private certificate with IP Subject Alternative Names.", "computed": true }, { - "name": "allow_ip_sans", + "name": "server_flag", "type": "TypeBool", - "description": "Determines whether to allow clients to request a private certificate with IP Subject Alternative Names.", + "description": "Determines whether private certificates are flagged for server use.", "computed": true }, { - "name": "allowed_uri_sans", + "name": "street_address", "type": "TypeList", - "description": "The URI Subject Alternative Names to allow for private certificates.Values can contain glob patterns, for example `spiffe://hostname/_*`.", + "description": "The street address values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "organization", + "name": "allowed_secret_groups", + "type": "TypeString", + "description": "Scopes the creation of private certificates to only the secret groups that you specify.This field can be supplied as a comma-delimited list of secret group IDs.", + "computed": true + }, + { + "name": "allow_subdomains", + "type": "TypeBool", + "description": "Determines whether to allow clients to request private certificates with common names (CN) that are subdomains of the CNs that are allowed by the other certificate template options. This includes wildcard subdomains.For example, if `allowed_domains` has a value of `example.com` and `allow_subdomains`is set to `true`, then the following subdomains are allowed: `foo.example.com`, `bar.example.com`, `*.example.com`.**Note:** This field is redundant if you use the `allow_any_name` option.", + "computed": true + }, + { + "name": "allowed_other_sans", "type": "TypeList", - "description": "The Organization (O) values to define in the subject field of the resulting certificate.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names (SANs) to allow for private certificates.The format for each element in the list is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`. To allow any value for an OID, use `*` as its value. Alternatively, specify a single `*` to allow any `other_sans` input.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "require_cn", + "name": "code_signing_flag", "type": "TypeBool", - "description": "Determines whether to require a common name to create a private certificate.By default, a common name is required to generate a certificate. To make the `common_name` field optional, set the `require_cn` option to `false`.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "Determines whether private certificates are flagged for code signing use.", "computed": true }, { - "name": "locality", + "name": "province", "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", "computed": true, "elem": { "type": "TypeString" } + } + ], + "ibm_sm_private_certificate_metadata": [ + { + "name": "signing_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "computed": true }, { - "name": "not_before_duration_seconds", - "type": "TypeInt", - "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.", + "name": "key_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", "computed": true }, { - "name": "endpoint_type", + "name": "serial_number", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "computed": true }, { - "name": "server_flag", - "type": "TypeBool", - "description": "Determines whether private certificates are flagged for server use.", + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "key_bits", + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "locks_total", "type": "TypeInt", - "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "key_usage", - "type": "TypeList", - "description": "The allowed key usage constraint to define for private certificates.You can find valid values in the [Go x509 package documentation](https://pkg.go.dev/crypto/x509#KeyUsage). Omit the `KeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "computed": true }, { - "name": "serial_number", + "name": "issuer", "type": "TypeString", - "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, { - "name": "policy_identifiers", + "name": "validity", "type": "TypeList", - "description": "A list of policy Object Identifiers (OIDs).", + "description": "The date and time that the certificate validity period begins and ends.", "computed": true, "elem": { - "type": "TypeString" + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } } - } - ], - "ibm_sm_private_certificate_metadata": [ + }, { - "name": "description", + "name": "revocation_time_rfc3339", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The date and time that the certificate was revoked. The date format follows RFC 3339.", "computed": true }, { @@ -79354,46 +83098,50 @@ } }, { - "name": "state_description", + "name": "secret_type", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "issuer", + "name": "state_description", "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "revocation_time_seconds", - "type": "TypeInt", - "description": "The timestamp of the certificate revocation.", - "computed": true + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "endpoint_type", + "name": "updated_at", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true }, { - "name": "secret_group_id", + "name": "certificate_authority", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The intermediate certificate authority that signed this certificate.", "computed": true }, { - "name": "created_at", + "name": "instance_id", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "crn", + "name": "created_by", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -79406,47 +83154,45 @@ } }, { - "name": "expiration_date", - "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { - "name": "validity", - "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", - "computed": true, - "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - } - } + "name": "secret_id", + "type": "TypeString", + "description": "The ID of the secret.", + "required": true }, { - "name": "created_by", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "certificate_template", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The name of the certificate template.", "computed": true }, { - "name": "certificate_authority", + "name": "revocation_time_seconds", + "type": "TypeInt", + "description": "The timestamp of the certificate revocation.", + "computed": true + }, + { + "name": "next_rotation_date", "type": "TypeString", - "description": "The intermediate certificate authority that signed this certificate.", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", "computed": true }, { @@ -79482,48 +83228,48 @@ } }, { - "name": "signing_algorithm", + "name": "crn", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "next_rotation_date", + "name": "description", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", "computed": true }, { - "name": "name", + "name": "expiration_date", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "common_name", + "name": "name", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The human-readable name of your secret.", "computed": true }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + } + ], + "ibm_sm_public_certificate": [ { "name": "key_algorithm", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate.", + "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", "computed": true }, { @@ -79536,15 +83282,9 @@ "computed": true }, { - "name": "secret_id", + "name": "description", "type": "TypeString", - "description": "The ID of the secret.", - "required": true - }, - { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { @@ -79554,58 +83294,48 @@ "computed": true }, { - "name": "revocation_time_rfc3339", - "type": "TypeString", - "description": "The date and time that the certificate was revoked. The date format follows RFC 3339.", + "name": "bundle_certs", + "type": "TypeBool", + "description": "Indicates whether the issued certificate is bundled with intermediate certificates.", "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "secret_type", + "name": "private_key", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "(Optional) The PEM-encoded private key to associate with the certificate.", + "secure": true, "computed": true }, { - "name": "updated_at", + "name": "secret_id", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The ID of the secret.", + "optional": true, "computed": true }, { - "name": "certificate_template", + "name": "serial_number", "type": "TypeString", - "description": "The name of the certificate template.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - } - ], - "ibm_sm_public_certificate": [ - { - "name": "region", + "name": "secret_group_id", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { @@ -79615,9 +83345,9 @@ "computed": true }, { - "name": "ca", + "name": "common_name", "type": "TypeString", - "description": "The name of the certificate authority configuration.", + "description": "The Common Name (AKA CN) represents the server name protected by the SSL certificate.", "computed": true }, { @@ -79627,24 +83357,23 @@ "computed": true }, { - "name": "validity", - "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", - "computed": true, - "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - } - } + "name": "issuer", + "type": "TypeString", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "computed": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The human-readable name of your secret.", + "optional": true, + "computed": true }, { "name": "rotation", @@ -79666,6 +83395,13 @@ } } }, + { + "name": "intermediate", + "type": "TypeString", + "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", + "secure": true, + "computed": true + }, { "name": "created_by", "type": "TypeString", @@ -79673,13 +83409,16 @@ "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "signing_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "computed": true }, { "name": "alt_names", @@ -79691,9 +83430,9 @@ } }, { - "name": "signing_algorithm", + "name": "ca", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "The name of the certificate authority configuration.", "computed": true }, { @@ -79710,10 +83449,27 @@ "computed": true }, { - "name": "crn", + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, + { + "name": "secret_group_name", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "The human-readable name of your secret group.", + "optional": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", "computed": true }, { @@ -79805,22 +83561,24 @@ } }, { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "issuer", - "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", - "computed": true - }, - { - "name": "key_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", - "computed": true + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", + "computed": true, + "elem": { + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } + } }, { "name": "instance_id", @@ -79831,83 +83589,41 @@ "required": true }, { - "name": "secret_id", - "type": "TypeString", - "description": "The ID of the secret.", - "required": true - }, - { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "computed": true - }, - { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", - "computed": true - }, - { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true - }, - { - "name": "common_name", - "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name protected by the SSL certificate.", - "computed": true - }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", - "computed": true - }, - { - "name": "intermediate", - "type": "TypeString", - "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", - "secure": true, - "computed": true - }, - { - "name": "private_key", + "name": "endpoint_type", "type": "TypeString", - "description": "(Optional) The PEM-encoded private key to associate with the certificate.", - "secure": true, - "computed": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true + "description": "public or private.", + "optional": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_sm_public_certificate_configuration_ca_lets_encrypt": [ { "name": "name", "type": "TypeString", - "description": "The human-readable name of your secret.", - "computed": true + "description": "The name of the configuration.", + "required": true }, { - "name": "secret_group_id", + "name": "created_by", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -79916,23 +83632,6 @@ "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, - { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "bundle_certs", - "type": "TypeBool", - "description": "Indicates whether the issued certificate is bundled with intermediate certificates.", - "computed": true - } - ], - "ibm_sm_public_certificate_configuration_ca_lets_encrypt": [ { "name": "lets_encrypt_environment", "type": "TypeString", @@ -79947,15 +83646,9 @@ "computed": true }, { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "created_at", + "name": "lets_encrypt_preferred_chain", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "Prefer the chain with an issuer matching this Subject Common Name.", "computed": true }, { @@ -79964,12 +83657,6 @@ "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, - { - "name": "lets_encrypt_preferred_chain", - "type": "TypeString", - "description": "Prefer the chain with an issuer matching this Subject Common Name.", - "computed": true - }, { "name": "instance_id", "type": "TypeString", @@ -79992,31 +83679,13 @@ "type": "TypeString", "description": "public or private.", "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the configuration.", - "required": true } ], "ibm_sm_public_certificate_configuration_dns_cis": [ { - "name": "config_type", - "type": "TypeString", - "description": "The configuration type.", - "computed": true - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "created_by", + "name": "cloud_internet_services_apikey", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "An IBM Cloud API key that can to list domains in your Cloud Internet Services instance.To grant Secrets Manager the ability to view the Cloud Internet Services instance and all of its domains, the API key must be assigned the Reader service role on Internet Services (`internet-svcs`).If you need to manage specific domains, you can assign the Manager role. For production environments, it is recommended that you assign the Reader access role, and then use the[IAM Policy Management API](https://cloud.ibm.com/apidocs/iam-policy-management#create-policy) to control specific domains. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-specific-domains).", "computed": true }, { @@ -80026,12 +83695,13 @@ "computed": true }, { - "name": "instance_id", + "name": "region", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true + "optional": true, + "computed": true }, { "name": "endpoint_type", @@ -80046,38 +83716,33 @@ "required": true }, { - "name": "created_at", + "name": "config_type", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The configuration type.", "computed": true }, { - "name": "updated_at", + "name": "secret_type", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "cloud_internet_services_apikey", + "name": "created_by", "type": "TypeString", - "description": "An IBM Cloud API key that can to list domains in your Cloud Internet Services instance.To grant Secrets Manager the ability to view the Cloud Internet Services instance and all of its domains, the API key must be assigned the Reader service role on Internet Services (`internet-svcs`).If you need to manage specific domains, you can assign the Manager role. For production environments, it is recommended that you assign the Reader access role, and then use the[IAM Policy Management API](https://cloud.ibm.com/apidocs/iam-policy-management#create-policy) to control specific domains. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-specific-domains).", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "region", + "name": "created_at", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true - } - ], - "ibm_sm_public_certificate_configuration_dns_classic_infrastructure": [ + }, { - "name": "classic_infrastructure_password", + "name": "updated_at", "type": "TypeString", - "description": "Your classic infrastructure API key.For information about viewing and accessing your classic infrastructure API key, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { @@ -80087,11 +83752,13 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - }, + } + ], + "ibm_sm_public_certificate_configuration_dns_classic_infrastructure": [ { - "name": "created_at", + "name": "created_by", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -80100,18 +83767,6 @@ "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, - { - "name": "classic_infrastructure_username", - "type": "TypeString", - "description": "The username that is associated with your classic infrastructure account.In most cases, your classic infrastructure username is your `\u003caccount_id\u003e_\u003cemail_address\u003e`. For more information, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", - "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, { "name": "region", "type": "TypeString", @@ -80127,6 +83782,20 @@ "description": "public or private.", "optional": true }, + { + "name": "classic_infrastructure_password", + "type": "TypeString", + "description": "Your classic infrastructure API key.For information about viewing and accessing your classic infrastructure API key, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", + "computed": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "name", "type": "TypeString", @@ -80144,13 +83813,31 @@ "type": "TypeString", "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "classic_infrastructure_username", + "type": "TypeString", + "description": "The username that is associated with your classic infrastructure account.In most cases, your classic infrastructure username is your `\u003caccount_id\u003e_\u003cemail_address\u003e`. For more information, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", + "computed": true } ], "ibm_sm_public_certificate_metadata": [ { - "name": "state", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true + }, + { + "name": "versions_total", "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "description": "The number of versions of the secret.", "computed": true }, { @@ -80159,6 +83846,18 @@ "description": "Indicates whether the issued certificate is bundled with intermediate certificates.", "computed": true }, + { + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "computed": true + }, { "name": "dns", "type": "TypeString", @@ -80174,43 +83873,25 @@ "required": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true - }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true - }, - { - "name": "name", + "name": "ca", "type": "TypeString", - "description": "The human-readable name of your secret.", + "description": "The name of the certificate authority configuration.", "computed": true }, { - "name": "expiration_date", + "name": "region", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "endpoint_type", + "name": "secret_id", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The ID of the secret.", + "required": true }, { "name": "created_by", @@ -80219,95 +83900,48 @@ "computed": true }, { - "name": "secret_group_id", - "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "computed": true - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "rotation", - "type": "TypeList", - "description": "Determines whether Secrets Manager rotates your secrets automatically.", - "computed": true, - "elem": { - "auto_rotate": { - "name": "auto_rotate", - "type": "TypeBool", - "description": "Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your secret based on the defined interval.", - "computed": true - }, - "rotate_keys": { - "name": "rotate_keys", - "type": "TypeBool", - "description": "Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate.", - "computed": true - } - } - }, - { - "name": "created_at", + "name": "key_algorithm", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", "computed": true }, { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "name", + "type": "TypeString", + "description": "The human-readable name of your secret.", "computed": true }, { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "serial_number", + "name": "secret_type", "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "secret_id", - "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true }, { - "name": "description", + "name": "updated_at", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { @@ -80405,30 +84039,63 @@ } }, { - "name": "validity", + "name": "issuer", + "type": "TypeString", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "labels", "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", "computed": true, "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", + "type": "TypeString" + } + }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "rotation", + "type": "TypeList", + "description": "Determines whether Secrets Manager rotates your secrets automatically.", + "computed": true, + "elem": { + "auto_rotate": { + "name": "auto_rotate", + "type": "TypeBool", + "description": "Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your secret based on the defined interval.", "computed": true }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", + "rotate_keys": { + "name": "rotate_keys", + "type": "TypeBool", + "description": "Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate.", "computed": true } } }, { - "name": "crn", + "name": "endpoint_type", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "public or private.", + "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { @@ -80438,46 +84105,48 @@ "computed": true }, { - "name": "issuer", - "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", - "computed": true + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "key_algorithm", + "name": "expiration_date", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "ca", + "name": "serial_number", "type": "TypeString", - "description": "The name of the certificate authority configuration.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", + "computed": true, + "elem": { + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } + } } ], "ibm_sm_secret_group": [ - { - "name": "name", - "type": "TypeString", - "description": "The name of your secret group.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret group.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "computed": true - }, { "name": "created_at", "type": "TypeString", @@ -80518,17 +84187,21 @@ "type": "TypeString", "description": "The ID of the secret group.", "required": true - } - ], - "ibm_sm_secret_groups": [ + }, { - "name": "instance_id", + "name": "name", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "The name of your secret group.", + "computed": true }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret group.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "computed": true + } + ], + "ibm_sm_secret_groups": [ { "name": "region", "type": "TypeString", @@ -80587,21 +84260,17 @@ "type": "TypeInt", "description": "The total number of resources in a collection.", "computed": true - } - ], - "ibm_sm_secrets": [ - { - "name": "sort", - "type": "TypeString", - "description": "Sort a collection of secrets by the specified field in ascending order. To sort in descending order use the `-` character. Available values: id | created_at | updated_at | expiration_date | secret_type | name", - "optional": true }, { - "name": "search", + "name": "instance_id", "type": "TypeString", - "description": "Obtain a collection of secrets that contain the specified string in one or more of the fields: `id`, `name`, `description`,\n `labels`, `secret_type`.", - "optional": true - }, + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + } + ], + "ibm_sm_secrets": [ { "name": "groups", "type": "TypeString", @@ -81030,70 +84699,94 @@ "type": "TypeString", "description": "public or private.", "optional": true - } - ], - "ibm_sm_username_password_secret": [ + }, { - "name": "crn", + "name": "sort", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true + "description": "Sort a collection of secrets by the specified field in ascending order. To sort in descending order use the `-` character. Available values: id | created_at | updated_at | expiration_date | secret_type | name", + "optional": true }, { - "name": "description", + "name": "search", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "Obtain a collection of secrets that contain the specified string in one or more of the fields: `id`, `name`, `description`,\n `labels`, `secret_type`.", + "optional": true + } + ], + "ibm_sm_username_password_secret": [ + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { "name": "name", "type": "TypeString", "description": "The human-readable name of your secret.", + "optional": true, "computed": true }, { - "name": "secret_id", + "name": "secret_group_name", "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "description": "The human-readable name of your secret group.", + "optional": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { - "name": "secret_type", + "name": "endpoint_type", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true + "description": "public or private.", + "optional": true }, { - "name": "state_description", + "name": "instance_id", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "versions_total", + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "locks_total", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "instance_id", + "name": "state_description", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "A text representation of the secret state.", + "computed": true }, { - "name": "next_rotation_date", + "name": "expiration_date", "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { @@ -81103,9 +84796,10 @@ "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "secret_id", + "type": "TypeString", + "description": "The ID of the secret.", + "optional": true, "computed": true }, { @@ -81162,18 +84856,22 @@ } }, { - "name": "expiration_date", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "next_rotation_date", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", "computed": true }, { - "name": "region", + "name": "password", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The password that is assigned to the secret.", + "secure": true, "computed": true }, { @@ -81183,66 +84881,51 @@ "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, { - "name": "password", + "name": "description", "type": "TypeString", - "description": "The password that is assigned to the secret.", - "secure": true, + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "computed": true }, { - "name": "endpoint_type", + "name": "secret_type", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "computed": true } ], "ibm_sm_username_password_secret_metadata": [ { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "description", + "name": "expiration_date", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "secret_type", + "name": "next_rotation_date", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { @@ -81252,10 +84935,10 @@ "optional": true }, { - "name": "created_at", + "name": "secret_id", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true + "description": "The ID of the secret.", + "required": true }, { "name": "created_by", @@ -81263,12 +84946,6 @@ "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, - { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -81276,33 +84953,36 @@ "computed": true }, { - "name": "expiration_date", + "name": "secret_group_id", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "A v4 UUID identifier, or `default` secret group.", "computed": true }, { - "name": "next_rotation_date", - "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { - "name": "secret_id", + "name": "description", "type": "TypeString", - "description": "The ID of the secret.", - "required": true + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "computed": true }, { - "name": "secret_group_id", - "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "computed": true + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { @@ -81312,9 +84992,9 @@ "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { @@ -81349,21 +85029,18 @@ } } }, - { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "locks_total", "type": "TypeInt", "description": "The number of locks of the secret.", "computed": true }, + { + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, { "name": "instance_id", "type": "TypeString", @@ -81373,12 +85050,9 @@ "required": true }, { - "name": "region", + "name": "created_at", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { @@ -81387,9 +85061,42 @@ "description": "A CRN that uniquely identifies an IBM Cloud resource.", "cloud_data_type": "crn", "computed": true + }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true } ], "ibm_space": [ + { + "name": "auditors", + "type": "TypeSet", + "description": "The IBMID of the users who have auditor role in this space, ex - user@example.com", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "managers", + "type": "TypeSet", + "description": "The IBMID of the users who have manager role in this space, ex - user@example.com", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "developers", "type": "TypeSet", @@ -81417,55 +85124,25 @@ "type": "TypeString", "description": "The org this space belongs to", "required": true - }, - { - "name": "auditors", - "type": "TypeSet", - "description": "The IBMID of the users who have auditor role in this space, ex - user@example.com", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "managers", - "type": "TypeSet", - "description": "The IBMID of the users who have manager role in this space, ex - user@example.com", - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_tg_connection_prefix_filter": [ { - "name": "ge", - "type": "TypeInt", - "description": "IP Prefix GE", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The date and time that this prefix filter was last updated", - "computed": true - }, - { - "name": "filter_id", + "name": "connection_id", "type": "TypeString", - "description": "The Transit Gateway Connection Prefix Filter identifier", + "description": "The Transit Gateway Connection identifier", "required": true }, { - "name": "before", + "name": "action", "type": "TypeString", - "description": "Identifier of prefix filter that handles ordering", + "description": "Whether to permit or deny the prefix filter", "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this prefix filter was created", + "name": "ge", + "type": "TypeInt", + "description": "IP Prefix GE", "computed": true }, { @@ -81480,6 +85157,12 @@ "description": "IP Prefix", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time that this prefix filter was last updated", + "computed": true + }, { "name": "gateway", "type": "TypeString", @@ -81487,25 +85170,25 @@ "required": true }, { - "name": "connection_id", + "name": "filter_id", "type": "TypeString", - "description": "The Transit Gateway Connection identifier", + "description": "The Transit Gateway Connection Prefix Filter identifier", "required": true }, { - "name": "action", + "name": "before", "type": "TypeString", - "description": "Whether to permit or deny the prefix filter", + "description": "Identifier of prefix filter that handles ordering", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this prefix filter was created", "computed": true } ], "ibm_tg_connection_prefix_filters": [ - { - "name": "gateway", - "type": "TypeString", - "description": "The Transit Gateway identifier", - "required": true - }, { "name": "connection_id", "type": "TypeString", @@ -81566,20 +85249,59 @@ "computed": true } } + }, + { + "name": "gateway", + "type": "TypeString", + "description": "The Transit Gateway identifier", + "required": true } ], "ibm_tg_gateway": [ + { + "name": "crn", + "type": "TypeString", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "location", + "type": "TypeString", + "cloud_data_type": "region", + "computed": true + }, + { + "name": "global", + "type": "TypeBool", + "computed": true + }, { "name": "name", "type": "TypeString", "description": "The Transit Gateway identifier", "required": true }, + { + "name": "created_at", + "type": "TypeString", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "computed": true + }, { "name": "updated_at", "type": "TypeString", "computed": true }, + { + "name": "resource_group", + "type": "TypeString", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "connections", "type": "TypeList", @@ -81678,39 +85400,6 @@ "computed": true } } - }, - { - "name": "crn", - "type": "TypeString", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "location", - "type": "TypeString", - "cloud_data_type": "region", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "computed": true - }, - { - "name": "global", - "type": "TypeBool", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "cloud_data_type": "resource_group", - "computed": true } ], "ibm_tg_gateways": [ @@ -81769,24 +85458,6 @@ } ], "ibm_tg_location": [ - { - "name": "name", - "type": "TypeString", - "description": "Name of the Location.", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of the location, determining is this a multi-zone region, a single data center, or a point of presence.", - "computed": true - }, - { - "name": "billing_location", - "type": "TypeString", - "description": "The geographical location of this location, used for billing purposes.", - "computed": true - }, { "name": "local_connection_locations", "type": "TypeList", @@ -81812,6 +85483,24 @@ "computed": true } } + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the Location.", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of the location, determining is this a multi-zone region, a single data center, or a point of presence.", + "computed": true + }, + { + "name": "billing_location", + "type": "TypeString", + "description": "The geographical location of this location, used for billing purposes.", + "computed": true } ], "ibm_tg_locations": [ @@ -81843,59 +85532,6 @@ } ], "ibm_tg_route_report": [ - { - "name": "created_at", - "type": "TypeString", - "computed": true - }, - { - "name": "overlapping_routes", - "type": "TypeList", - "description": "Collection of transit gateway overlapping routes", - "computed": true, - "elem": { - "routes": { - "name": "routes", - "type": "TypeList", - "description": "Collection of transit gateway overlapping route's details", - "computed": true, - "elem": { - "connection_id": { - "name": "connection_id", - "type": "TypeString", - "computed": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "computed": true - } - } - } - } - }, - { - "name": "status", - "type": "TypeString", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "computed": true - }, - { - "name": "gateway", - "type": "TypeString", - "description": "The Transit Gateway identifier", - "required": true - }, - { - "name": "route_report", - "type": "TypeString", - "description": "The Transit Gateway Route Report identifier", - "required": true - }, { "name": "connections", "type": "TypeList", @@ -81959,6 +85595,59 @@ "computed": true } } + }, + { + "name": "created_at", + "type": "TypeString", + "computed": true + }, + { + "name": "overlapping_routes", + "type": "TypeList", + "description": "Collection of transit gateway overlapping routes", + "computed": true, + "elem": { + "routes": { + "name": "routes", + "type": "TypeList", + "description": "Collection of transit gateway overlapping route's details", + "computed": true, + "elem": { + "connection_id": { + "name": "connection_id", + "type": "TypeString", + "computed": true + }, + "prefix": { + "name": "prefix", + "type": "TypeString", + "computed": true + } + } + } + } + }, + { + "name": "status", + "type": "TypeString", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "computed": true + }, + { + "name": "gateway", + "type": "TypeString", + "description": "The Transit Gateway identifier", + "required": true + }, + { + "name": "route_report", + "type": "TypeString", + "description": "The Transit Gateway Route Report identifier", + "required": true } ], "ibm_tg_route_reports": [ @@ -82091,18 +85780,16 @@ "Resources": { "ibm_api_gateway_endpoint": [ { - "name": "type", + "name": "endpoint_id", "type": "TypeString", - "description": "Action type of Endpoint ALoowable values are share, unshare, manage, unmanage", - "default_value": "unshare", - "optional": true + "description": "Endpoint ID", + "computed": true }, { - "name": "managed", - "type": "TypeBool", - "description": "Managed indicates if endpoint is online or offline.", - "default_value": false, - "optional": true + "name": "base_path", + "type": "TypeString", + "description": "Base path of an endpoint", + "computed": true }, { "name": "open_api_doc_name", @@ -82126,15 +85813,16 @@ } }, { - "name": "shared", + "name": "managed", "type": "TypeBool", - "description": "The Shared status of an endpoint", - "computed": true + "description": "Managed indicates if endpoint is online or offline.", + "default_value": false, + "optional": true }, { - "name": "base_path", - "type": "TypeString", - "description": "Base path of an endpoint", + "name": "shared", + "type": "TypeBool", + "description": "The Shared status of an endpoint", "computed": true }, { @@ -82145,10 +85833,11 @@ "optional": true }, { - "name": "endpoint_id", + "name": "type", "type": "TypeString", - "description": "Endpoint ID", - "computed": true + "description": "Action type of Endpoint ALoowable values are share, unshare, manage, unmanage", + "default_value": "unshare", + "optional": true }, { "name": "service_instance_crn", @@ -82159,25 +85848,6 @@ } ], "ibm_api_gateway_endpoint_subscription": [ - { - "name": "client_id", - "type": "TypeString", - "description": "Subscription Id, API key that is used to create subscription", - "optional": true, - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Subscription type. Allowable values are external, internal", - "required": true - }, { "name": "client_secret", "type": "TypeString", @@ -82203,20 +85873,44 @@ "description": "Endpoint ID", "immutable": true, "required": true + }, + { + "name": "client_id", + "type": "TypeString", + "description": "Subscription Id, API key that is used to create subscription", + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Subscription type. Allowable values are external, internal", + "required": true } ], "ibm_app": [ { - "name": "name", + "name": "buildpack", "type": "TypeString", - "description": "The name for the app", - "required": true + "description": "Buildpack to build the app. 3 options: a) Blank means autodetection; b) A Git Url pointing to a buildpack; c) Name of an installed buildpack.", + "optional": true }, { - "name": "instances", + "name": "app_version", + "type": "TypeString", + "description": "Version of the application", + "optional": true + }, + { + "name": "health_check_timeout", "type": "TypeInt", - "description": "The number of instances", - "default_value": 1, + "description": "Timeout in seconds for health checking of an staged app when starting up.", "optional": true }, { @@ -82227,9 +85921,24 @@ "required": true }, { - "name": "buildpack", + "name": "service_instance_guid", + "type": "TypeSet", + "description": "Define the service instance guids that should be bound to this application.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "command", "type": "TypeString", - "description": "Buildpack to build the app. 3 options: a) Blank means autodetection; b) A Git Url pointing to a buildpack; c) Name of an installed buildpack.", + "description": "The initial command for the app", + "optional": true + }, + { + "name": "health_check_http_endpoint", + "type": "TypeString", + "description": "Endpoint called to determine if the app is healthy.", "optional": true }, { @@ -82240,36 +85949,46 @@ "optional": true }, { - "name": "memory", + "name": "disk_quota", "type": "TypeInt", - "description": "The amount of memory each instance should have. In megabytes.", + "description": "The maximum amount of disk available to an instance of an app. In megabytes.", "optional": true, "computed": true }, { - "name": "disk_quota", + "name": "wait_time_minutes", "type": "TypeInt", - "description": "The maximum amount of disk available to an instance of an app. In megabytes.", + "description": "Define timeout to wait for the app instances to start/update/restage etc.", + "default_value": 20, + "optional": true + }, + { + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", "optional": true, - "computed": true + "elem": { + "type": "TypeString" + } }, { - "name": "command", + "name": "name", "type": "TypeString", - "description": "The initial command for the app", - "optional": true + "description": "The name for the app", + "required": true }, { - "name": "wait_time_minutes", + "name": "memory", "type": "TypeInt", - "description": "Define timeout to wait for the app instances to start/update/restage etc.", - "default_value": 20, - "optional": true + "description": "The amount of memory each instance should have. In megabytes.", + "optional": true, + "computed": true }, { - "name": "health_check_timeout", + "name": "instances", "type": "TypeInt", - "description": "Timeout in seconds for health checking of an staged app when starting up.", + "description": "The number of instances", + "default_value": 1, "optional": true }, { @@ -82292,52 +86011,15 @@ "type": "TypeString", "description": "Define the path of the zip file of the application.", "required": true - }, - { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "service_instance_guid", - "type": "TypeSet", - "description": "Define the service instance guids that should be bound to this application.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "app_version", - "type": "TypeString", - "description": "Version of the application", - "optional": true - }, - { - "name": "health_check_http_endpoint", - "type": "TypeString", - "description": "Endpoint called to determine if the app is healthy.", - "optional": true } ], "ibm_app_config_collection": [ { - "name": "guid", + "name": "collection_id", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "immutable": true, + "description": "Collection Id.", "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "Collection description", - "optional": true - }, { "name": "tags", "type": "TypeString", @@ -82346,73 +86028,80 @@ "optional": true }, { - "name": "features_count", + "name": "created_time", "type": "TypeString", - "description": "Number of features associated with the collection.", + "description": "Creation time of the collection.", "computed": true }, { - "name": "properties_count", + "name": "updated_time", "type": "TypeString", - "description": "Number of properties associated with the collection.", + "description": "Last modified time of the collection data.", "computed": true }, { - "name": "name", + "name": "href", "type": "TypeString", - "description": "Collection name.", - "required": true + "description": "Collection URL.", + "computed": true }, { - "name": "collection_id", + "name": "properties_count", "type": "TypeString", - "description": "Collection Id.", + "description": "Number of properties associated with the collection.", + "computed": true + }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "immutable": true, "required": true }, { - "name": "created_time", + "name": "description", "type": "TypeString", - "description": "Creation time of the collection.", - "computed": true + "description": "Collection description", + "optional": true }, { - "name": "updated_time", + "name": "features_count", "type": "TypeString", - "description": "Last modified time of the collection data.", + "description": "Number of features associated with the collection.", "computed": true }, { - "name": "href", + "name": "name", "type": "TypeString", - "description": "Collection URL.", - "computed": true + "description": "Collection name.", + "required": true } ], "ibm_app_config_environment": [ { - "name": "description", + "name": "environment_id", "type": "TypeString", - "description": "Environment description", - "optional": true + "description": "Environment Id.", + "required": true }, { - "name": "color_code", + "name": "description", "type": "TypeString", - "description": "Color code to distinguish the environment.", + "description": "Environment description", "optional": true }, { - "name": "guid", + "name": "tags", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "immutable": true, - "required": true + "description": "Tags associated with the environment", + "cloud_data_type": "tags", + "optional": true }, { - "name": "environment_id", + "name": "color_code", "type": "TypeString", - "description": "Environment Id.", - "required": true + "description": "Color code to distinguish the environment.", + "optional": true }, { "name": "created_time", @@ -82420,6 +86109,13 @@ "description": "Creation time of the environment.", "computed": true }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "immutable": true, + "required": true + }, { "name": "updated_time", "type": "TypeString", @@ -82437,27 +86133,21 @@ "type": "TypeString", "description": "Environment name.", "required": true - }, - { - "name": "tags", - "type": "TypeString", - "description": "Tags associated with the environment", - "cloud_data_type": "tags", - "optional": true } ], "ibm_app_config_feature": [ { - "name": "feature_id", + "name": "environment_id", "type": "TypeString", - "description": "Feature id.", + "description": "Environment Id.", "required": true }, { - "name": "enabled_value", + "name": "tags", "type": "TypeString", - "description": "Value of the feature when it is enabled. The value can be BOOLEAN, STRING or a NUMERIC value as per the `type` attribute.", - "required": true + "description": "Tags associated with the feature.", + "cloud_data_type": "tags", + "optional": true }, { "name": "rollout_percentage", @@ -82466,79 +86156,35 @@ "optional": true }, { - "name": "disabled_value", + "name": "name", "type": "TypeString", - "description": "Value of the feature when it is disabled. The value can be BOOLEAN, STRING or a NUMERIC value as per the `type` attribute.", + "description": "Feature name.", "required": true }, { - "name": "tags", + "name": "type", "type": "TypeString", - "description": "Tags associated with the feature.", - "cloud_data_type": "tags", - "optional": true + "description": "Type of the feature (BOOLEAN, STRING, NUMERIC).", + "required": true, + "options": "BOOLEAN, NUMERIC, STRING" }, { - "name": "enabled", - "type": "TypeBool", - "description": "The state of the feature flag.", + "name": "created_time", + "type": "TypeString", + "description": "Creation time of the feature flag.", "computed": true }, { - "name": "href", + "name": "updated_time", "type": "TypeString", - "description": "Feature flag URL.", + "description": "Last modified time of the feature flag data.", "computed": true }, { - "name": "type", + "name": "feature_id", "type": "TypeString", - "description": "Type of the feature (BOOLEAN, STRING, NUMERIC).", - "required": true, - "options": "BOOLEAN, NUMERIC, STRING" - }, - { - "name": "segment_rules", - "type": "TypeList", - "description": "Specify the targeting rules that is used to set different feature flag values for different segments.", - "optional": true, - "elem": { - "order": { - "name": "order", - "type": "TypeInt", - "description": "Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.", - "required": true - }, - "rollout_percentage": { - "name": "rollout_percentage", - "type": "TypeInt", - "description": "Rollout percentage for the segment rule.", - "optional": true - }, - "rules": { - "name": "rules", - "type": "TypeList", - "description": "Rules array.", - "required": true, - "elem": { - "segments": { - "name": "segments", - "type": "TypeList", - "description": "List of segment ids that are used for targeting using the rule.", - "required": true, - "elem": { - "type": "TypeString" - } - } - } - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value to be used for evaluation for this rule. The value can be Boolean, String or a Numeric value as per the `type` attribute.", - "required": true - } - } + "description": "Feature id.", + "required": true }, { "name": "collections", @@ -82554,30 +86200,6 @@ } } }, - { - "name": "guid", - "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", - "required": true - }, - { - "name": "environment_id", - "type": "TypeString", - "description": "Environment Id.", - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Feature name.", - "required": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Feature description.", - "optional": true - }, { "name": "segment_exists", "type": "TypeBool", @@ -82585,23 +86207,15 @@ "computed": true }, { - "name": "created_time", - "type": "TypeString", - "description": "Creation time of the feature flag.", + "name": "enabled", + "type": "TypeBool", + "description": "The state of the feature flag.", "computed": true }, - { - "name": "updated_time", - "type": "TypeString", - "description": "Last modified time of the feature flag data.", - "computed": true - } - ], - "ibm_app_config_property": [ { "name": "segment_rules", "type": "TypeList", - "description": "Specify the targeting rules that is used to set different property values for different segments.", + "description": "Specify the targeting rules that is used to set different feature flag values for different segments.", "optional": true, "elem": { "order": { @@ -82610,6 +86224,12 @@ "description": "Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.", "required": true }, + "rollout_percentage": { + "name": "rollout_percentage", + "type": "TypeInt", + "description": "Rollout percentage for the segment rule.", + "optional": true + }, "rules": { "name": "rules", "type": "TypeList", @@ -82636,33 +86256,42 @@ } }, { - "name": "updated_time", + "name": "href", "type": "TypeString", - "description": "Last modified time of the property data.", + "description": "Feature flag URL.", "computed": true }, { - "name": "environment_id", + "name": "guid", "type": "TypeString", - "description": "Environment Id.", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", "required": true }, { - "name": "type", + "name": "enabled_value", "type": "TypeString", - "description": "Type of the Property (BOOLEAN, STRING, NUMERIC).", + "description": "Value of the feature when it is enabled. The value can be BOOLEAN, STRING or a NUMERIC value as per the `type` attribute.", "required": true }, { - "name": "property_id", + "name": "disabled_value", "type": "TypeString", - "description": "Property id.", + "description": "Value of the feature when it is disabled. The value can be BOOLEAN, STRING or a NUMERIC value as per the `type` attribute.", "required": true }, { - "name": "format", + "name": "description", "type": "TypeString", - "description": "Format of the feature (TEXT, JSON, YAML).", + "description": "Feature description.", + "optional": true + } + ], + "ibm_app_config_property": [ + { + "name": "tags", + "type": "TypeString", + "description": "Tags associated with the property.", + "cloud_data_type": "tags", "optional": true }, { @@ -82678,10 +86307,27 @@ "computed": true }, { - "name": "tags", + "name": "href", "type": "TypeString", - "description": "Tags associated with the property.", - "cloud_data_type": "tags", + "description": "Property URL.", + "computed": true + }, + { + "name": "environment_id", + "type": "TypeString", + "description": "Environment Id.", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Type of the Property (BOOLEAN, STRING, NUMERIC).", + "required": true + }, + { + "name": "format", + "type": "TypeString", + "description": "Format of the feature (TEXT, JSON, YAML).", "optional": true }, { @@ -82698,18 +86344,6 @@ } } }, - { - "name": "evaluation_time", - "type": "TypeString", - "description": "The last occurrence of the property value evaluation.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "Property URL.", - "computed": true - }, { "name": "guid", "type": "TypeString", @@ -82723,49 +86357,74 @@ "required": true }, { - "name": "value", + "name": "property_id", "type": "TypeString", - "description": "Value of the Property. The value can be Boolean, String or a Numeric value as per the `type` attribute.", + "description": "Property id.", "required": true }, { - "name": "description", - "type": "TypeString", - "description": "Property description.", - "optional": true - } - ], - "ibm_app_config_segment": [ - { - "name": "href", + "name": "updated_time", "type": "TypeString", - "description": "Segment URL.", + "description": "Last modified time of the property data.", "computed": true }, { - "name": "guid", + "name": "value", "type": "TypeString", - "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "description": "Value of the Property. The value can be Boolean, String or a Numeric value as per the `type` attribute.", "required": true }, { - "name": "name", + "name": "description", "type": "TypeString", - "description": "Segment name.", - "required": true + "description": "Property description.", + "optional": true }, { - "name": "segment_id", - "type": "TypeString", - "description": "Segment id.", - "required": true + "name": "segment_rules", + "type": "TypeList", + "description": "Specify the targeting rules that is used to set different property values for different segments.", + "optional": true, + "elem": { + "order": { + "name": "order", + "type": "TypeInt", + "description": "Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.", + "required": true + }, + "rules": { + "name": "rules", + "type": "TypeList", + "description": "Rules array.", + "required": true, + "elem": { + "segments": { + "name": "segments", + "type": "TypeList", + "description": "List of segment ids that are used for targeting using the rule.", + "required": true, + "elem": { + "type": "TypeString" + } + } + } + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value to be used for evaluation for this rule. The value can be Boolean, String or a Numeric value as per the `type` attribute.", + "required": true + } + } }, { - "name": "created_time", + "name": "evaluation_time", "type": "TypeString", - "description": "Creation time of the segment.", + "description": "The last occurrence of the property value evaluation.", "computed": true - }, + } + ], + "ibm_app_config_segment": [ { "name": "description", "type": "TypeString", @@ -82773,16 +86432,9 @@ "optional": true }, { - "name": "tags", - "type": "TypeString", - "description": "Tags associated with the segments.", - "cloud_data_type": "tags", - "optional": true - }, - { - "name": "updated_time", + "name": "href", "type": "TypeString", - "description": "Last modified time of the segment data.", + "description": "Segment URL.", "computed": true }, { @@ -82813,9 +86465,7 @@ } } } - } - ], - "ibm_app_config_snapshot": [ + }, { "name": "guid", "type": "TypeString", @@ -82823,21 +86473,42 @@ "required": true }, { - "name": "git_branch", + "name": "name", "type": "TypeString", - "description": "Branch name to which you need to write or update the configuration.", + "description": "Segment name.", "required": true }, { - "name": "href", + "name": "segment_id", "type": "TypeString", - "description": "Git config URL.", + "description": "Segment id.", + "required": true + }, + { + "name": "tags", + "type": "TypeString", + "description": "Tags associated with the segments.", + "cloud_data_type": "tags", + "optional": true + }, + { + "name": "created_time", + "type": "TypeString", + "description": "Creation time of the segment.", "computed": true }, { - "name": "git_config_id", + "name": "updated_time", "type": "TypeString", - "description": "Git config id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only", + "description": "Last modified time of the segment data.", + "computed": true + } + ], + "ibm_app_config_snapshot": [ + { + "name": "git_branch", + "type": "TypeString", + "description": "Branch name to which you need to write or update the configuration.", "required": true }, { @@ -82853,43 +86524,11 @@ "computed": true }, { - "name": "action", - "type": "TypeString", - "description": "action promote", - "optional": true - }, - { - "name": "updated_time", + "name": "href", "type": "TypeString", - "description": "Last modified time of the git config data.", + "description": "Git config URL.", "computed": true }, - { - "name": "collection_id", - "type": "TypeString", - "description": "Collection id.", - "required": true - }, - { - "name": "collection", - "type": "TypeList", - "description": "Collection object.", - "computed": true, - "elem": { - "collection_id": { - "name": "collection_id", - "type": "TypeString", - "description": "Collection id.", - "computed": true - }, - "collection_name": { - "name": "collection_name", - "type": "TypeString", - "description": "Collection name.", - "computed": true - } - } - }, { "name": "environment", "type": "TypeList", @@ -82916,6 +86555,18 @@ } } }, + { + "name": "guid", + "type": "TypeString", + "description": "GUID of the App Configuration service. Get it from the service instance credentials section of the dashboard.", + "required": true + }, + { + "name": "git_config_id", + "type": "TypeString", + "description": "Git config id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only", + "required": true + }, { "name": "git_config_name", "type": "TypeString", @@ -82935,11 +86586,49 @@ "secure": true, "required": true }, + { + "name": "updated_time", + "type": "TypeString", + "description": "Last modified time of the git config data.", + "computed": true + }, + { + "name": "collection_id", + "type": "TypeString", + "description": "Collection id.", + "required": true + }, + { + "name": "action", + "type": "TypeString", + "description": "action promote", + "optional": true + }, { "name": "environment_id", "type": "TypeString", "description": "Environment id.", "required": true + }, + { + "name": "collection", + "type": "TypeList", + "description": "Collection object.", + "computed": true, + "elem": { + "collection_id": { + "name": "collection_id", + "type": "TypeString", + "description": "Collection id.", + "computed": true + }, + "collection_name": { + "name": "collection_name", + "type": "TypeString", + "description": "Collection name.", + "computed": true + } + } } ], "ibm_app_domain_private": [ @@ -82968,6 +86657,15 @@ } ], "ibm_app_domain_shared": [ + { + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "name", "type": "TypeString", @@ -82981,24 +86679,9 @@ "description": "The guid of the router group.", "immutable": true, "optional": true - }, - { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } } ], "ibm_app_route": [ - { - "name": "path", - "type": "TypeString", - "description": "The path for a route as raw text.Paths must be between 2 and 128 characters.Paths must start with a forward slash '/'.Paths must not contain a '?'", - "optional": true - }, { "name": "tags", "type": "TypeSet", @@ -83033,44 +86716,37 @@ "type": "TypeInt", "description": "The port of the route. Supported for domains of TCP router groups only.", "optional": true + }, + { + "name": "path", + "type": "TypeString", + "description": "The path for a route as raw text.Paths must be between 2 and 128 characters.Paths must start with a forward slash '/'.Paths must not contain a '?'", + "optional": true } ], "ibm_appid_action_url": [ { - "name": "action", + "name": "tenant_id", "type": "TypeString", - "description": "The type of the action: `on_user_verified` - the URL of your custom user verified page, `on_reset_password` - the URL of your custom reset password page", + "description": "The AppID instance GUID", "immutable": true, "required": true }, { - "name": "url", + "name": "action", "type": "TypeString", - "description": "The action URL", + "description": "The type of the action: `on_user_verified` - the URL of your custom user verified page, `on_reset_password` - the URL of your custom reset password page", + "immutable": true, "required": true }, { - "name": "tenant_id", + "name": "url", "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, + "description": "The action URL", "required": true } ], "ibm_appid_apm": [ - { - "name": "tenant_id", - "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, - "required": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "`true` if APM is enabled", - "required": true - }, { "name": "prevent_password_with_username", "type": "TypeBool", @@ -83158,6 +86834,19 @@ } }, "max_items": 1 + }, + { + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "immutable": true, + "required": true + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "`true` if APM is enabled", + "required": true } ], "ibm_appid_application": [ @@ -83264,21 +86953,27 @@ } ], "ibm_appid_audit_status": [ + { + "name": "is_active", + "type": "TypeBool", + "description": "The auditing status of the tenant.", + "required": true + }, { "name": "tenant_id", "type": "TypeString", "description": "The AppID instance GUID", "immutable": true, "required": true - }, - { - "name": "is_active", - "type": "TypeBool", - "description": "The auditing status of the tenant.", - "required": true } ], "ibm_appid_cloud_directory_template": [ + { + "name": "html_body", + "type": "TypeString", + "description": "The HTML body of the email", + "optional": true + }, { "name": "base64_encoded_html_body", "type": "TypeString", @@ -83318,34 +87013,28 @@ "type": "TypeString", "description": "The subject of the email", "required": true - }, - { - "name": "html_body", - "type": "TypeString", - "description": "The HTML body of the email", - "optional": true } ], "ibm_appid_cloud_directory_user": [ { - "name": "tenant_id", + "name": "display_name", "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, - "required": true + "description": "Cloud Directory user display name", + "optional": true, + "computed": true }, { - "name": "locked_until", - "type": "TypeInt", - "description": "Integer (epoch time in milliseconds), determines till when the user account will be locked", + "name": "user_name", + "type": "TypeString", + "description": "Optional username", "optional": true }, { - "name": "display_name", + "name": "password", "type": "TypeString", - "description": "Cloud Directory user display name", - "optional": true, - "computed": true + "description": "User password", + "secure": true, + "required": true }, { "name": "email", @@ -83367,26 +87056,6 @@ } } }, - { - "name": "user_name", - "type": "TypeString", - "description": "Optional username", - "optional": true - }, - { - "name": "password", - "type": "TypeString", - "description": "User password", - "secure": true, - "required": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Accepted values `PENDING` or `CONFIRMED`", - "default_value": "PENDING", - "optional": true - }, { "name": "meta", "type": "TypeList", @@ -83408,18 +87077,16 @@ } }, { - "name": "active", - "type": "TypeBool", - "description": "Determines if the user account is active or not", - "default_value": true, - "optional": true + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "immutable": true, + "required": true }, { - "name": "create_profile", - "type": "TypeBool", - "description": "A boolean indication if a profile should be created for the Cloud Directory user", - "default_value": true, - "immutable": true, + "name": "locked_until", + "type": "TypeInt", + "description": "Integer (epoch time in milliseconds), determines till when the user account will be locked", "optional": true }, { @@ -83433,27 +87100,53 @@ "type": "TypeString", "description": "The user's identifier ('subject' in identity token)", "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Accepted values `PENDING` or `CONFIRMED`", + "default_value": "PENDING", + "optional": true + }, + { + "name": "active", + "type": "TypeBool", + "description": "Determines if the user account is active or not", + "default_value": true, + "optional": true + }, + { + "name": "create_profile", + "type": "TypeBool", + "description": "A boolean indication if a profile should be created for the Cloud Directory user", + "default_value": true, + "immutable": true, + "optional": true } ], "ibm_appid_idp_cloud_directory": [ + { + "name": "tenant_id", + "type": "TypeString", + "immutable": true, + "required": true + }, { "name": "is_active", "type": "TypeBool", "required": true }, { - "name": "identity_confirm_access_mode", - "type": "TypeString", - "default_value": "FULL", + "name": "signup_enabled", + "type": "TypeBool", + "default_value": true, "optional": true }, { - "name": "identity_confirm_methods", - "type": "TypeList", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "self_service_enabled", + "type": "TypeBool", + "default_value": true, + "optional": true }, { "name": "welcome_enabled", @@ -83474,26 +87167,22 @@ "optional": true }, { - "name": "identity_field", + "name": "identity_confirm_access_mode", "type": "TypeString", + "default_value": "FULL", "optional": true }, { - "name": "tenant_id", - "type": "TypeString", - "immutable": true, - "required": true - }, - { - "name": "self_service_enabled", - "type": "TypeBool", - "default_value": true, - "optional": true + "name": "identity_confirm_methods", + "type": "TypeList", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "signup_enabled", - "type": "TypeBool", - "default_value": true, + "name": "identity_field", + "type": "TypeString", "optional": true } ], @@ -83561,12 +87250,6 @@ } ], "ibm_appid_idp_google": [ - { - "name": "redirect_url", - "type": "TypeString", - "description": "Paste the URI into the Authorized redirect URIs field in the Google Developer Console", - "computed": true - }, { "name": "tenant_id", "type": "TypeString", @@ -83601,16 +87284,15 @@ } }, "max_items": 1 + }, + { + "name": "redirect_url", + "type": "TypeString", + "description": "Paste the URI into the Authorized redirect URIs field in the Google Developer Console", + "computed": true } ], "ibm_appid_idp_saml": [ - { - "name": "tenant_id", - "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, - "required": true - }, { "name": "is_active", "type": "TypeBool", @@ -83697,6 +87379,13 @@ } }, "max_items": 1 + }, + { + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "immutable": true, + "required": true } ], "ibm_appid_languages": [ @@ -83718,21 +87407,34 @@ } ], "ibm_appid_mfa": [ + { + "name": "tenant_id", + "type": "TypeString", + "description": "The AppID instance GUID", + "immutable": true, + "required": true + }, { "name": "is_active", "type": "TypeBool", "description": "`true` if MFA is active", "required": true - }, + } + ], + "ibm_appid_mfa_channel": [ { "name": "tenant_id", "type": "TypeString", "description": "The AppID instance GUID", "immutable": true, "required": true - } - ], - "ibm_appid_mfa_channel": [ + }, + { + "name": "active", + "type": "TypeString", + "description": "Allowed values: `email`, `sms`", + "required": true + }, { "name": "sms_config", "type": "TypeList", @@ -83761,22 +87463,15 @@ "required": true } } - }, + } + ], + "ibm_appid_password_regex": [ { - "name": "tenant_id", + "name": "regex", "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, + "description": "The escaped regex expression rule for acceptable password", "required": true }, - { - "name": "active", - "type": "TypeString", - "description": "Allowed values: `email`, `sms`", - "required": true - } - ], - "ibm_appid_password_regex": [ { "name": "tenant_id", "type": "TypeString", @@ -83795,12 +87490,6 @@ "type": "TypeString", "description": "Custom error message", "optional": true - }, - { - "name": "regex", - "type": "TypeString", - "description": "The escaped regex expression rule for acceptable password", - "required": true } ], "ibm_appid_redirect_urls": [ @@ -83822,6 +87511,19 @@ } ], "ibm_appid_role": [ + { + "name": "role_id", + "type": "TypeString", + "description": "Role ID", + "computed": true + }, + { + "name": "tenant_id", + "type": "TypeString", + "description": "The service `tenantId`", + "immutable": true, + "required": true + }, { "name": "name", "type": "TypeString", @@ -83854,19 +87556,6 @@ } } } - }, - { - "name": "role_id", - "type": "TypeString", - "description": "Role ID", - "computed": true - }, - { - "name": "tenant_id", - "type": "TypeString", - "description": "The service `tenantId`", - "immutable": true, - "required": true } ], "ibm_appid_theme_color": [ @@ -83903,6 +87592,29 @@ } ], "ibm_appid_token_config": [ + { + "name": "id_token_claim", + "type": "TypeSet", + "description": "A set of objects that are created when claims that are related to identity tokens are mapped", + "optional": true, + "elem": { + "destination_claim": { + "name": "destination_claim", + "type": "TypeString", + "optional": true + }, + "source": { + "name": "source", + "type": "TypeString", + "required": true + }, + "source_claim": { + "name": "source_claim", + "type": "TypeString", + "optional": true + } + } + }, { "name": "tenant_id", "type": "TypeString", @@ -83968,39 +87680,9 @@ "optional": true } } - }, - { - "name": "id_token_claim", - "type": "TypeSet", - "description": "A set of objects that are created when claims that are related to identity tokens are mapped", - "optional": true, - "elem": { - "destination_claim": { - "name": "destination_claim", - "type": "TypeString", - "optional": true - }, - "source": { - "name": "source", - "type": "TypeString", - "required": true - }, - "source_claim": { - "name": "source_claim", - "type": "TypeString", - "optional": true - } - } } ], "ibm_appid_user_roles": [ - { - "name": "tenant_id", - "type": "TypeString", - "description": "The AppID instance GUID", - "immutable": true, - "required": true - }, { "name": "subject", "type": "TypeString", @@ -84016,40 +87698,22 @@ "elem": { "type": "TypeString" } - } - ], - "ibm_atracker_route": [ - { - "name": "crn", - "type": "TypeString", - "description": "The crn of the route resource.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "version", - "type": "TypeInt", - "description": "The version of the route.", - "computed": true - }, - { - "name": "created", - "type": "TypeString", - "description": "The timestamp of the route creation time.", - "computed": true, - "deprecated": "use created_at instead" }, { - "name": "created_at", + "name": "tenant_id", "type": "TypeString", - "description": "The timestamp of the route creation time.", - "computed": true - }, + "description": "The AppID instance GUID", + "immutable": true, + "required": true + } + ], + "ibm_atracker_route": [ { - "name": "updated_at", + "name": "updated", "type": "TypeString", "description": "The timestamp of the route last updated time.", - "computed": true + "computed": true, + "deprecated": "use updated_at instead" }, { "name": "api_version", @@ -84057,6 +87721,15 @@ "description": "The API version of the route.", "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`.", + "required": true, + "min_length": 1, + "max_length": 1000, + "matches": "^[a-zA-Z0-9 -._:]+$" + }, { "name": "rules", "type": "TypeList", @@ -84083,6 +87756,32 @@ } } }, + { + "name": "crn", + "type": "TypeString", + "description": "The crn of the route resource.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "version", + "type": "TypeInt", + "description": "The version of the route.", + "computed": true + }, + { + "name": "created", + "type": "TypeString", + "description": "The timestamp of the route creation time.", + "computed": true, + "deprecated": "use created_at instead" + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp of the route creation time.", + "computed": true + }, { "name": "receive_global_events", "type": "TypeBool", @@ -84091,20 +87790,10 @@ "deprecated": "use rules.locations instead" }, { - "name": "updated", + "name": "updated_at", "type": "TypeString", "description": "The timestamp of the route last updated time.", - "computed": true, - "deprecated": "use updated_at instead" - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`.", - "required": true, - "min_length": 1, - "max_length": 1000, - "matches": "^[a-zA-Z0-9 -._:]+$" + "computed": true } ], "ibm_atracker_settings": [ @@ -84157,6 +87846,55 @@ } ], "ibm_atracker_target": [ + { + "name": "eventstreams_endpoint", + "type": "TypeList", + "description": "Property values for an Event Streams Endpoint in requests.", + "optional": true, + "elem": { + "api_key": { + "name": "api_key", + "type": "TypeString", + "description": "The user password (api key) for the message hub topic in the Event Streams instance.", + "secure": true, + "required": true + }, + "brokers": { + "name": "brokers", + "type": "TypeList", + "description": "List of broker endpoints.", + "required": true, + "elem": { + "type": "TypeString" + } + }, + "target_crn": { + "name": "target_crn", + "type": "TypeString", + "description": "The CRN of the Event Streams instance.", + "required": true + }, + "topic": { + "name": "topic", + "type": "TypeString", + "description": "The messsage hub topic defined in the Event Streams instance.", + "required": true + } + }, + "max_items": 1 + }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "The encryption key that is used to encrypt events before Activity Tracker services buffer them on storage. This credential is masked in the response.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp of the target creation time.", + "computed": true + }, { "name": "logdna_endpoint", "type": "TypeList", @@ -84179,13 +87917,6 @@ }, "max_items": 1 }, - { - "name": "crn", - "type": "TypeString", - "description": "The crn of the target resource.", - "cloud_data_type": "crn", - "computed": true - }, { "name": "encrypt_key", "type": "TypeString", @@ -84193,6 +87924,79 @@ "computed": true, "deprecated": "use encryption_key instead" }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The timestamp of the target last updated time.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`.", + "required": true, + "min_length": 1, + "max_length": 1000, + "matches": "^[a-zA-Z0-9 -._:]+$" + }, + { + "name": "target_type", + "type": "TypeString", + "description": "The type of the target. It can be cloud_object_storage, logdna or event_streams. Based on this type you must include cos_endpoint, logdna_endpoint or eventstreams_endpoint.", + "immutable": true, + "required": true, + "options": "cloud_object_storage, logdna, event_streams" + }, + { + "name": "cos_endpoint", + "type": "TypeList", + "description": "Property values for a Cloud Object Storage Endpoint.", + "optional": true, + "elem": { + "api_key": { + "name": "api_key", + "type": "TypeString", + "description": "The IAM API key that has writer access to the Cloud Object Storage instance. This credential is masked in the response. This is required if service_to_service is not enabled.", + "secure": true, + "optional": true + }, + "bucket": { + "name": "bucket", + "type": "TypeString", + "description": "The bucket name under the Cloud Object Storage instance.", + "required": true + }, + "endpoint": { + "name": "endpoint", + "type": "TypeString", + "description": "The host name of the Cloud Object Storage endpoint.", + "required": true + }, + "service_to_service_enabled": { + "name": "service_to_service_enabled", + "type": "TypeBool", + "description": "ATracker service is enabled to support service to service authentication. If service to service is enabled then set this flag is true and do not supply apikey.", + "optional": true + }, + "target_crn": { + "name": "target_crn", + "type": "TypeString", + "description": "The CRN of the Cloud Object Storage instance.", + "required": true + } + }, + "max_items": 1 + }, + { + "name": "region", + "type": "TypeString", + "description": "Include this optional field if you want to create a target in a different region other than the one you are connected.", + "immutable": true, + "min_length": 3, + "max_length": 1000, + "matches": "^[a-zA-Z0-9 -._:]+$", + "optional": true + }, { "name": "write_status", "type": "TypeList", @@ -84233,163 +88037,327 @@ "computed": true }, { - "name": "cos_endpoint", + "name": "crn", + "type": "TypeString", + "description": "The crn of the target resource.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "cos_write_status", "type": "TypeList", - "description": "Property values for a Cloud Object Storage Endpoint.", - "optional": true, + "description": "The status of the write attempt with the provided cos_endpoint parameters.", + "computed": true, "elem": { - "api_key": { - "name": "api_key", + "last_failure": { + "name": "last_failure", "type": "TypeString", - "description": "The IAM API key that has writer access to the Cloud Object Storage instance. This credential is masked in the response. This is required if service_to_service is not enabled.", - "secure": true, + "description": "The timestamp of the failure.", "optional": true }, - "bucket": { - "name": "bucket", + "reason_for_last_failure": { + "name": "reason_for_last_failure", "type": "TypeString", - "description": "The bucket name under the Cloud Object Storage instance.", - "required": true + "description": "Detailed description of the cause of the failure.", + "optional": true }, - "endpoint": { - "name": "endpoint", + "status": { + "name": "status", "type": "TypeString", - "description": "The host name of the Cloud Object Storage endpoint.", - "required": true - }, - "service_to_service_enabled": { - "name": "service_to_service_enabled", - "type": "TypeBool", - "description": "ATracker service is enabled to support service to service authentication. If service to service is enabled then set this flag is true and do not supply apikey.", + "description": "The status such as failed or success.", "optional": true + } + }, + "deprecated": "use write_status instead" + }, + { + "name": "created", + "type": "TypeString", + "description": "The timestamp of the target creation time.", + "computed": true, + "deprecated": "use created_at instead" + } + ], + "ibm_billing_report_snapshot": [ + { + "name": "versioning", + "type": "TypeString", + "description": "A new version of report is created or the existing report version is overwritten with every update.", + "default_value": "new", + "options": "new, overwrite", + "optional": true + }, + { + "name": "cos_bucket", + "type": "TypeString", + "description": "The name of the COS bucket to store the snapshot of the billing reports.", + "required": true + }, + { + "name": "compression", + "type": "TypeString", + "description": "Compression format of the snapshot report.", + "computed": true + }, + { + "name": "interval", + "type": "TypeString", + "description": "Frequency of taking the snapshot of the billing reports.", + "required": true, + "options": "daily" + }, + { + "name": "content_type", + "type": "TypeString", + "description": "Type of content stored in snapshot report.", + "computed": true + }, + { + "name": "cos_location", + "type": "TypeString", + "description": "Region of the COS instance.", + "required": true + }, + { + "name": "history", + "type": "TypeList", + "description": "List of previous versions of the snapshot configurations.", + "computed": true, + "elem": { + "account_id": { + "name": "account_id", + "type": "TypeString", + "description": "Account ID for which billing report snapshot is configured.", + "computed": true }, - "target_crn": { - "name": "target_crn", + "account_type": { + "name": "account_type", "type": "TypeString", - "description": "The CRN of the Cloud Object Storage instance.", - "required": true + "description": "Type of account. Possible values [enterprise, account].", + "computed": true + }, + "compression": { + "name": "compression", + "type": "TypeString", + "description": "Compression format of the snapshot report.", + "computed": true + }, + "content_type": { + "name": "content_type", + "type": "TypeString", + "description": "Type of content stored in snapshot report.", + "computed": true + }, + "cos_bucket": { + "name": "cos_bucket", + "type": "TypeString", + "description": "The name of the COS bucket to store the snapshot of the billing reports.", + "computed": true + }, + "cos_endpoint": { + "name": "cos_endpoint", + "type": "TypeString", + "description": "The endpoint of the COS instance.", + "computed": true + }, + "cos_location": { + "name": "cos_location", + "type": "TypeString", + "description": "Region of the COS instance.", + "computed": true + }, + "cos_reports_folder": { + "name": "cos_reports_folder", + "type": "TypeString", + "description": "The billing reports root folder to store the billing reports snapshots. Defaults to \"IBMCloud-Billing-Reports\".", + "computed": true + }, + "end_time": { + "name": "end_time", + "type": "TypeInt", + "description": "Timestamp in milliseconds when the snapshot configuration ends.", + "computed": true + }, + "interval": { + "name": "interval", + "type": "TypeString", + "description": "Frequency of taking the snapshot of the billing reports.", + "computed": true + }, + "report_types": { + "name": "report_types", + "type": "TypeList", + "description": "The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "start_time": { + "name": "start_time", + "type": "TypeInt", + "description": "Timestamp in milliseconds when the snapshot configuration was created.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Account that updated the billing snapshot configuration.", + "computed": true + }, + "versioning": { + "name": "versioning", + "type": "TypeString", + "description": "A new version of report is created or the existing report version is overwritten with every update.", + "computed": true } - }, - "max_items": 1 + } + }, + { + "name": "cos_endpoint", + "type": "TypeString", + "description": "The endpoint of the COS instance.", + "computed": true + }, + { + "name": "cos_reports_folder", + "type": "TypeString", + "description": "The billing reports root folder to store the billing reports snapshots. Defaults to \"IBMCloud-Billing-Reports\".", + "default_value": "IBMCloud-Billing-Reports", + "optional": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Status of the billing snapshot configuration. Possible values are [enabled, disabled].", + "computed": true + }, + { + "name": "account_type", + "type": "TypeString", + "description": "Type of account. Possible values are [enterprise, account].", + "computed": true + }, + { + "name": "created_at", + "type": "TypeInt", + "description": "Timestamp in milliseconds when the snapshot configuration was created.", + "computed": true + }, + { + "name": "last_updated_at", + "type": "TypeInt", + "description": "Timestamp in milliseconds when the snapshot configuration was last updated.", + "computed": true + }, + { + "name": "report_types", + "type": "TypeList", + "description": "The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].", + "optional": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_cbr_rule": [ + { + "name": "enforcement_mode", + "type": "TypeString", + "description": "The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced.", + "default_value": "enabled", + "options": "disabled, enabled, report", + "optional": true + }, + { + "name": "transaction_id", + "type": "TypeString", + "description": "The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over `Transaction-Id`.", + "min_length": 1, + "max_length": 1024, + "matches": "^[a-zA-Z0-9 ,\\-_]+$", + "optional": true }, { - "name": "target_type", + "name": "created_by_id", "type": "TypeString", - "description": "The type of the target. It can be cloud_object_storage, logdna or event_streams. Based on this type you must include cos_endpoint, logdna_endpoint or eventstreams_endpoint.", - "immutable": true, - "required": true, - "options": "cloud_object_storage, logdna, event_streams" + "description": "IAM ID of the user or service which created the resource.", + "computed": true }, { - "name": "eventstreams_endpoint", + "name": "description", + "type": "TypeString", + "description": "The description of the rule.", + "max_length": 300, + "matches": "^[\\x20-\\xFE]*$", + "optional": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The time the resource was created.", + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "computed": true + }, + { + "name": "operations", "type": "TypeList", - "description": "Property values for an Event Streams Endpoint in requests.", + "description": "The operations this rule applies to.", "optional": true, "elem": { - "api_key": { - "name": "api_key", - "type": "TypeString", - "description": "The user password (api key) for the message hub topic in the Event Streams instance.", - "secure": true, - "required": true - }, - "brokers": { - "name": "brokers", + "api_types": { + "name": "api_types", "type": "TypeList", - "description": "List of broker endpoints.", + "description": "The API types this rule applies to.", "required": true, "elem": { - "type": "TypeString" + "api_type_id": { + "name": "api_type_id", + "type": "TypeString", + "required": true + } } - }, - "target_crn": { - "name": "target_crn", - "type": "TypeString", - "description": "The CRN of the Event Streams instance.", - "required": true - }, - "topic": { - "name": "topic", - "type": "TypeString", - "description": "The messsage hub topic defined in the Event Streams instance.", - "required": true } }, "max_items": 1 }, { - "name": "name", + "name": "x_correlation_id", "type": "TypeString", - "description": "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`.", - "required": true, + "description": "The supplied or generated value of this header is logged for a request and repeated in a response header for the corresponding response. The same value is used for downstream requests and retries of those requests. If a value of this headers is not supplied in a request, the service generates a random (version 4) UUID.", "min_length": 1, - "max_length": 1000, - "matches": "^[a-zA-Z0-9 -._:]+$" + "max_length": 1024, + "matches": "^[a-zA-Z0-9 ,\\-_]+$", + "optional": true }, { - "name": "encryption_key", + "name": "href", "type": "TypeString", - "description": "The encryption key that is used to encrypt events before Activity Tracker services buffer them on storage. This credential is masked in the response.", + "description": "The href link to the resource.", "computed": true }, { - "name": "created_at", + "name": "last_modified_at", "type": "TypeString", - "description": "The timestamp of the target creation time.", + "description": "The last time the resource was modified.", "computed": true }, { - "name": "updated_at", + "name": "last_modified_by_id", "type": "TypeString", - "description": "The timestamp of the target last updated time.", + "description": "IAM ID of the user or service which modified the resource.", "computed": true }, - { - "name": "region", - "type": "TypeString", - "description": "Include this optional field if you want to create a target in a different region other than the one you are connected.", - "immutable": true, - "min_length": 3, - "max_length": 1000, - "matches": "^[a-zA-Z0-9 -._:]+$", - "optional": true - }, - { - "name": "created", - "type": "TypeString", - "description": "The timestamp of the target creation time.", - "computed": true, - "deprecated": "use created_at instead" - }, - { - "name": "cos_write_status", - "type": "TypeList", - "description": "The status of the write attempt with the provided cos_endpoint parameters.", - "computed": true, - "elem": { - "last_failure": { - "name": "last_failure", - "type": "TypeString", - "description": "The timestamp of the failure.", - "optional": true - }, - "reason_for_last_failure": { - "name": "reason_for_last_failure", - "type": "TypeString", - "description": "Detailed description of the cause of the failure.", - "optional": true - }, - "status": { - "name": "status", - "type": "TypeString", - "description": "The status such as failed or success.", - "optional": true - } - }, - "deprecated": "use write_status instead" - } - ], - "ibm_cbr_rule": [ { "name": "contexts", "type": "TypeList", @@ -84419,32 +88387,10 @@ } }, { - "name": "href", - "type": "TypeString", - "description": "The href link to the resource.", - "computed": true - }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "IAM ID of the user or service which created the resource.", - "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAM ID of the user or service which modified the resource.", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "computed": true - }, - { - "name": "created_at", + "name": "crn", "type": "TypeString", - "description": "The time the resource was created.", + "description": "The rule CRN.", + "cloud_data_type": "crn", "computed": true }, { @@ -84506,90 +88452,40 @@ } } } - }, - { - "name": "operations", - "type": "TypeList", - "description": "The operations this rule applies to.", - "optional": true, - "elem": { - "api_types": { - "name": "api_types", - "type": "TypeList", - "description": "The API types this rule applies to.", - "required": true, - "elem": { - "api_type_id": { - "name": "api_type_id", - "type": "TypeString", - "required": true - } - } - } - }, - "max_items": 1 - }, - { - "name": "x_correlation_id", - "type": "TypeString", - "description": "The supplied or generated value of this header is logged for a request and repeated in a response header for the corresponding response. The same value is used for downstream requests and retries of those requests. If a value of this headers is not supplied in a request, the service generates a random (version 4) UUID.", - "min_length": 1, - "max_length": 1024, - "matches": "^[a-zA-Z0-9 ,\\-_]+$", - "optional": true - }, - { - "name": "transaction_id", - "type": "TypeString", - "description": "The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over `Transaction-Id`.", - "min_length": 1, - "max_length": 1024, - "matches": "^[a-zA-Z0-9 ,\\-_]+$", - "optional": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The rule CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The description of the rule.", - "max_length": 300, - "matches": "^[\\x20-\\xFE]*$", - "optional": true - }, - { - "name": "enforcement_mode", - "type": "TypeString", - "description": "The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced.", - "default_value": "enabled", - "options": "disabled, enabled, report", - "optional": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "The last time the resource was modified.", - "computed": true } ], "ibm_cbr_zone": [ { - "name": "created_at", + "name": "created_by_id", "type": "TypeString", - "description": "The time the resource was created.", + "description": "IAM ID of the user or service which created the resource.", "computed": true }, { - "name": "last_modified_by_id", + "name": "version", "type": "TypeString", - "description": "IAM ID of the user or service which modified the resource.", "computed": true }, + { + "name": "excluded", + "type": "TypeList", + "description": "The list of excluded addresses in the zone. Only addresses of type `ipAddress`, `ipRange`, and `subnet` can be excluded.", + "optional": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of address.", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The IP address.", + "optional": true + } + } + }, { "name": "transaction_id", "type": "TypeString", @@ -84599,42 +88495,12 @@ "matches": "^[a-zA-Z0-9 ,\\-_]+$", "optional": true }, - { - "name": "crn", - "type": "TypeString", - "description": "The zone CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "address_count", - "type": "TypeInt", - "description": "The number of addresses in the zone.", - "computed": true - }, - { - "name": "excluded_count", - "type": "TypeInt", - "description": "The number of excluded addresses in the zone.", - "computed": true - }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "IAM ID of the user or service which created the resource.", - "computed": true - }, { "name": "last_modified_at", "type": "TypeString", "description": "The last time the resource was modified.", "computed": true }, - { - "name": "version", - "type": "TypeString", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -84661,32 +88527,6 @@ "matches": "^[\\x20-\\xFE]*$", "optional": true }, - { - "name": "excluded", - "type": "TypeList", - "description": "The list of excluded addresses in the zone. Only addresses of type `ipAddress`, `ipRange`, and `subnet` can be excluded.", - "optional": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "The type of address.", - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The IP address.", - "optional": true - } - } - }, - { - "name": "href", - "type": "TypeString", - "description": "The href link to the resource.", - "computed": true - }, { "name": "addresses", "type": "TypeList", @@ -84754,274 +88594,58 @@ "max_length": 1024, "matches": "^[a-zA-Z0-9 ,\\-_]+$", "optional": true - } - ], - "ibm_cd_tekton_pipeline": [ - { - "name": "enable_notifications", - "type": "TypeBool", - "description": "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", - "default_value": false, - "optional": true }, { - "name": "updated_at", + "name": "crn", "type": "TypeString", - "description": "Standard RFC 3339 Date Time String.", + "description": "The zone CRN.", + "cloud_data_type": "crn", "computed": true }, { "name": "href", "type": "TypeString", - "description": "API URL for interacting with the pipeline.", + "description": "The href link to the resource.", "computed": true }, { - "name": "next_build_number", + "name": "address_count", "type": "TypeInt", - "description": "The build number that will be used for the next pipeline run.", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "String.", - "computed": true - }, - { - "name": "toolchain", - "type": "TypeList", - "description": "Toolchain object containing references to the parent toolchain.", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for the toolchain that contains the Tekton pipeline.", - "required": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "UUID.", - "required": true - } - } - }, - { - "name": "definitions", - "type": "TypeList", - "description": "Definition list.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the definition.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The aggregated definition ID.", - "computed": true - }, - "source": { - "name": "source", - "type": "TypeList", - "description": "Source repository containing the Tekton pipeline definition.", - "required": true, - "elem": { - "properties": { - "name": "properties", - "type": "TypeList", - "description": "Properties of the source, which define the URL of the repository and a branch or tag.", - "required": true, - "elem": { - "branch": { - "name": "branch", - "type": "TypeString", - "description": "A branch from the repo, specify one of branch or tag only.", - "optional": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "The path to the definition's YAML files.", - "required": true - }, - "tag": { - "name": "tag", - "type": "TypeString", - "description": "A tag from the repo, specify one of branch or tag only.", - "optional": true - }, - "tool": { - "name": "tool", - "type": "TypeList", - "description": "Reference to the repository tool in the parent toolchain.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of the repository tool instance in the parent toolchain.", - "computed": true - } - } - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the definition repository.", - "immutable": true, - "required": true - } - }, - "max_items": 1, - "min_items": 1 - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The only supported source type is \"git\", indicating that the source is a git repository.", - "required": true - } - }, - "max_items": 1, - "min_items": 1 - } - } - }, - { - "name": "runs_url", - "type": "TypeString", - "description": "URL for this pipeline showing the list of pipeline runs.", + "description": "The number of addresses in the zone.", "computed": true }, { - "name": "build_number", + "name": "excluded_count", "type": "TypeInt", - "description": "The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs.", + "description": "The number of excluded addresses in the zone.", "computed": true }, { - "name": "enable_partial_cloning", - "type": "TypeBool", - "description": "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", - "default_value": false, - "optional": true - }, - { - "name": "pipeline_id", + "name": "created_at", "type": "TypeString", - "description": "String.", - "immutable": true, - "required": true + "description": "The time the resource was created.", + "computed": true }, { - "name": "status", + "name": "last_modified_by_id", "type": "TypeString", - "description": "Pipeline status.", + "description": "IAM ID of the user or service which modified the resource.", "computed": true - }, + } + ], + "ibm_cd_tekton_pipeline": [ { - "name": "properties", - "type": "TypeList", - "description": "Tekton pipeline's environment properties.", - "computed": true, - "elem": { - "enum": { - "name": "enum", - "type": "TypeList", - "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the property.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Property name.", - "immutable": true, - "required": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Property type.", - "immutable": true, - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Property value. Any string value is valid.", - "optional": true - } - } + "name": "enabled", + "type": "TypeBool", + "description": "Flag whether this pipeline is enabled.", + "computed": true }, { - "name": "created_at", + "name": "updated_at", "type": "TypeString", "description": "Standard RFC 3339 Date Time String.", "computed": true }, - { - "name": "worker", - "type": "TypeList", - "description": "Details of the worker used to run the pipeline.", - "optional": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of the worker.", - "required": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the worker. Computed based on the worker ID.", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the worker. Computed based on the worker ID.", - "computed": true - } - }, - "max_items": 1 - }, - { - "name": "resource_group", - "type": "TypeList", - "description": "The resource group in which the pipeline was created.", - "cloud_data_type": "resource_group", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "ID.", - "optional": true - } - } - }, { "name": "triggers", "type": "TypeList", @@ -85302,10 +88926,263 @@ } }, { - "name": "enabled", + "name": "status", + "type": "TypeString", + "description": "Pipeline status.", + "computed": true + }, + { + "name": "runs_url", + "type": "TypeString", + "description": "URL for this pipeline showing the list of pipeline runs.", + "computed": true + }, + { + "name": "pipeline_id", + "type": "TypeString", + "description": "String.", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "String.", + "computed": true + }, + { + "name": "enable_partial_cloning", "type": "TypeBool", - "description": "Flag whether this pipeline is enabled.", + "description": "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", + "default_value": false, + "optional": true + }, + { + "name": "resource_group", + "type": "TypeList", + "description": "The resource group in which the pipeline was created.", + "cloud_data_type": "resource_group", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "ID.", + "optional": true + } + } + }, + { + "name": "toolchain", + "type": "TypeList", + "description": "Toolchain object containing references to the parent toolchain.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for the toolchain that contains the Tekton pipeline.", + "required": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "UUID.", + "required": true + } + } + }, + { + "name": "build_number", + "type": "TypeInt", + "description": "The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs.", + "computed": true + }, + { + "name": "worker", + "type": "TypeList", + "description": "Details of the worker used to run the pipeline.", + "optional": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the worker.", + "required": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the worker. Computed based on the worker ID.", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the worker. Computed based on the worker ID.", + "computed": true + } + }, + "max_items": 1 + }, + { + "name": "next_build_number", + "type": "TypeInt", + "description": "The build number that will be used for the next pipeline run.", + "optional": true + }, + { + "name": "properties", + "type": "TypeList", + "description": "Tekton pipeline's environment properties.", + "computed": true, + "elem": { + "enum": { + "name": "enum", + "type": "TypeList", + "description": "Options for `single_select` property type. Only needed when using `single_select` property type.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the property.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Property name.", + "immutable": true, + "required": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Property type.", + "immutable": true, + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Property value. Any string value is valid.", + "optional": true + } + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Standard RFC 3339 Date Time String.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the pipeline.", "computed": true + }, + { + "name": "enable_notifications", + "type": "TypeBool", + "description": "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", + "default_value": false, + "optional": true + }, + { + "name": "definitions", + "type": "TypeList", + "description": "Definition list.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the definition.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The aggregated definition ID.", + "computed": true + }, + "source": { + "name": "source", + "type": "TypeList", + "description": "Source repository containing the Tekton pipeline definition.", + "required": true, + "elem": { + "properties": { + "name": "properties", + "type": "TypeList", + "description": "Properties of the source, which define the URL of the repository and a branch or tag.", + "required": true, + "elem": { + "branch": { + "name": "branch", + "type": "TypeString", + "description": "A branch from the repo, specify one of branch or tag only.", + "optional": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "The path to the definition's YAML files.", + "required": true + }, + "tag": { + "name": "tag", + "type": "TypeString", + "description": "A tag from the repo, specify one of branch or tag only.", + "optional": true + }, + "tool": { + "name": "tool", + "type": "TypeList", + "description": "Reference to the repository tool in the parent toolchain.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the repository tool instance in the parent toolchain.", + "computed": true + } + } + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the definition repository.", + "immutable": true, + "required": true + } + }, + "max_items": 1, + "min_items": 1 + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The only supported source type is \"git\", indicating that the source is a git repository.", + "required": true + } + }, + "max_items": 1, + "min_items": 1 + } + } } ], "ibm_cd_tekton_pipeline_definition": [ @@ -85398,6 +89275,16 @@ } ], "ibm_cd_tekton_pipeline_property": [ + { + "name": "name", + "type": "TypeString", + "description": "Property name.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 253, + "matches": "^[-0-9a-zA-Z_.]{1,253}$" + }, { "name": "value", "type": "TypeString", @@ -85446,19 +89333,16 @@ "min_length": 36, "max_length": 36, "matches": "^[-0-9a-z]+$" - }, - { - "name": "name", - "type": "TypeString", - "description": "Property name.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 253, - "matches": "^[-0-9a-zA-Z_.]{1,253}$" } ], "ibm_cd_tekton_pipeline_trigger": [ + { + "name": "type", + "type": "TypeString", + "description": "Trigger type.", + "required": true, + "options": "generic, manual, scm, timer" + }, { "name": "worker", "type": "TypeList", @@ -85492,6 +89376,68 @@ "description": "Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger.", "optional": true }, + { + "name": "properties", + "type": "TypeList", + "description": "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + "computed": true, + "elem": { + "enum": { + "name": "enum", + "type": "TypeList", + "description": "Options for `single_select` property type. Only needed for `single_select` property type.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the trigger property.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Property name.", + "immutable": true, + "required": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Property type.", + "immutable": true, + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Property value. Any string value is valid.", + "optional": true + } + } + }, + { + "name": "webhook_url", + "type": "TypeString", + "description": "Webhook URL that can be used to trigger pipeline runs.", + "computed": true + }, + { + "name": "favorite", + "type": "TypeBool", + "description": "Mark the trigger as a favorite.", + "default_value": false, + "optional": true + }, { "name": "source", "type": "TypeList", @@ -85563,109 +89509,13 @@ "max_items": 1 }, { - "name": "properties", - "type": "TypeList", - "description": "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", - "computed": true, - "elem": { - "enum": { - "name": "enum", - "type": "TypeList", - "description": "Options for `single_select` property type. Only needed for `single_select` property type.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the trigger property.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Property name.", - "immutable": true, - "required": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Property type.", - "immutable": true, - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Property value. Any string value is valid.", - "optional": true - } - } - }, - { - "name": "pipeline_id", - "type": "TypeString", - "description": "The Tekton pipeline ID.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[-0-9a-z]+$" - }, - { - "name": "tags", - "type": "TypeList", - "description": "Optional trigger tags array.", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "events", - "type": "TypeList", - "description": "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "href", - "type": "TypeString", - "description": "API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers.", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Trigger type.", - "required": true, - "options": "generic, manual, scm, timer" - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "Flag whether the trigger is enabled.", - "default_value": true, - "optional": true - }, - { - "name": "favorite", - "type": "TypeBool", - "description": "Mark the trigger as a favorite.", - "default_value": false, - "optional": true + "name": "events", + "type": "TypeList", + "description": "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { "name": "cron", @@ -85677,37 +89527,29 @@ "optional": true }, { - "name": "timezone", - "type": "TypeString", - "description": "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", - "min_length": 1, - "max_length": 253, - "matches": "^[-0-9a-zA-Z+_., \\/]{1,253}$", - "optional": true - }, - { - "name": "trigger_id", + "name": "href", "type": "TypeString", - "description": "The Trigger ID.", + "description": "API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Trigger name.", - "required": true, - "min_length": 1, - "max_length": 253, - "matches": "^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \\/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$" + "name": "tags", + "type": "TypeList", + "description": "Optional trigger tags array.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "event_listener", + "name": "timezone", "type": "TypeString", - "description": "Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline.", - "required": true, + "description": "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", "min_length": 1, "max_length": 253, - "matches": "^[-0-9a-zA-Z_.]{1,253}$" + "matches": "^[-0-9a-zA-Z+_., \\/]{1,253}$", + "optional": true }, { "name": "secret", @@ -85749,13 +89591,62 @@ "max_items": 1 }, { - "name": "webhook_url", + "name": "trigger_id", "type": "TypeString", - "description": "Webhook URL that can be used to trigger pipeline runs.", + "description": "The Trigger ID.", "computed": true + }, + { + "name": "pipeline_id", + "type": "TypeString", + "description": "The Tekton pipeline ID.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[-0-9a-z]+$" + }, + { + "name": "name", + "type": "TypeString", + "description": "Trigger name.", + "required": true, + "min_length": 1, + "max_length": 253, + "matches": "^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \\/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$" + }, + { + "name": "event_listener", + "type": "TypeString", + "description": "Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline.", + "required": true, + "min_length": 1, + "max_length": 253, + "matches": "^[-0-9a-zA-Z_.]{1,253}$" + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "Flag whether the trigger is enabled.", + "default_value": true, + "optional": true } ], "ibm_cd_tekton_pipeline_trigger_property": [ + { + "name": "path", + "type": "TypeString", + "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + "max_length": 4096, + "matches": "^[-0-9a-zA-Z_.]*$", + "optional": true + }, + { + "name": "href", + "type": "TypeString", + "description": "API URL for interacting with the trigger property.", + "computed": true + }, { "name": "pipeline_id", "type": "TypeString", @@ -85810,27 +89701,42 @@ "immutable": true, "required": true, "options": "appconfig, integration, secure, single_select, text" + } + ], + "ibm_cd_toolchain": [ + { + "name": "name", + "type": "TypeString", + "description": "Toolchain name.", + "required": true, + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$" }, { - "name": "path", + "name": "description", "type": "TypeString", - "description": "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", - "max_length": 4096, - "matches": "^[-0-9a-zA-Z_.]*$", + "description": "Describes the toolchain.", + "max_length": 500, + "matches": "^(.*?)$", "optional": true }, { - "name": "href", + "name": "crn", "type": "TypeString", - "description": "API URL for interacting with the trigger property.", + "description": "Toolchain CRN.", + "cloud_data_type": "crn", "computed": true - } - ], - "ibm_cd_toolchain": [ + }, { - "name": "created_by", + "name": "created_at", "type": "TypeString", - "description": "Identity that created the toolchain.", + "description": "Toolchain creation timestamp.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest toolchain update timestamp.", "computed": true }, { @@ -85845,12 +89751,14 @@ } }, { - "name": "description", + "name": "resource_group_id", "type": "TypeString", - "description": "Describes the toolchain.", - "max_length": 500, - "matches": "^(.*?)$", - "optional": true + "description": "Resource group where the toolchain is located.", + "immutable": true, + "required": true, + "min_length": 32, + "max_length": 32, + "matches": "^[0-9a-f]{32}$" }, { "name": "account_id", @@ -85878,44 +89786,43 @@ "computed": true }, { - "name": "updated_at", + "name": "created_by", "type": "TypeString", - "description": "Latest toolchain update timestamp.", + "description": "Identity that created the toolchain.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_appconfig": [ + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", "computed": true }, { - "name": "name", + "name": "tool_id", "type": "TypeString", - "description": "Toolchain name.", - "required": true, - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$" + "description": "Tool ID.", + "computed": true }, { - "name": "resource_group_id", + "name": "toolchain_id", "type": "TypeString", - "description": "Resource group where the toolchain is located.", + "description": "ID of the toolchain to bind the tool to.", "immutable": true, "required": true, - "min_length": 32, - "max_length": 32, - "matches": "^[0-9a-f]{32}$" + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "Toolchain CRN.", - "cloud_data_type": "crn", - "computed": true + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "Toolchain creation timestamp.", - "computed": true - } - ], - "ibm_cd_toolchain_tool_appconfig": [ { "name": "parameters", "type": "TypeList", @@ -85962,6 +89869,25 @@ "max_items": 1, "min_items": 1 }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -85994,13 +89920,9 @@ "optional": true } } - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_artifactory": [ { "name": "toolchain_id", "type": "TypeString", @@ -86011,14 +89933,6 @@ "max_length": 36, "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, { "name": "resource_group_id", "type": "TypeString", @@ -86026,12 +89940,6 @@ "cloud_data_type": "resource_group", "computed": true }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "updated_at", "type": "TypeString", @@ -86039,18 +89947,18 @@ "computed": true }, { - "name": "state", + "name": "tool_id", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_artifactory": [ + }, { - "name": "state", + "name": "name", "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true }, { "name": "parameters", @@ -86162,6 +90070,26 @@ } } }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_bitbucketgit": [ + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "updated_at", "type": "TypeString", @@ -86169,9 +90097,36 @@ "computed": true }, { - "name": "tool_id", + "name": "crn", "type": "TypeString", - "description": "Tool ID.", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", "computed": true }, { @@ -86192,21 +90147,6 @@ "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", "optional": true }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - } - ], - "ibm_cd_toolchain_tool_bitbucketgit": [ - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -86363,30 +90303,20 @@ "min_items": 1 }, { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, - { - "name": "state", + "name": "resource_group_id", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "updated_at", + "name": "tool_id", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Tool ID.", "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_custom": [ { "name": "toolchain_id", "type": "TypeString", @@ -86405,79 +90335,6 @@ "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", "optional": true }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - } - ], - "ibm_cd_toolchain_tool_custom": [ - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" - }, { "name": "parameters", "type": "TypeList", @@ -86536,12 +90393,32 @@ "max_items": 1, "min_items": 1 }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "toolchain_crn", "type": "TypeString", "description": "CRN of toolchain which the tool is bound to.", "computed": true }, + { + "name": "tool_id", + "type": "TypeString", + "description": "Tool ID.", + "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -86568,6 +90445,32 @@ } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_devopsinsights": [ + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "state", "type": "TypeString", @@ -86579,9 +90482,17 @@ "type": "TypeString", "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_devopsinsights": [ + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + }, { "name": "name", "type": "TypeString", @@ -86590,6 +90501,13 @@ "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", "optional": true }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "resource_group_id", "type": "TypeString", @@ -86597,6 +90515,12 @@ "cloud_data_type": "resource_group", "computed": true }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, { "name": "referent", "type": "TypeList", @@ -86616,25 +90540,9 @@ "optional": true } } - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_eventnotifications": [ { "name": "toolchain_id", "type": "TypeString", @@ -86646,26 +90554,39 @@ "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true }, { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } }, { - "name": "href", + "name": "tool_id", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_eventnotifications": [ + }, { "name": "parameters", "type": "TypeList", @@ -86688,6 +90609,13 @@ "max_items": 1, "min_items": 1 }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -86707,6 +90635,32 @@ "description": "URI representing the tool.", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_githubconsolidated": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, { "name": "toolchain_id", "type": "TypeString", @@ -86726,10 +90680,22 @@ "optional": true }, { - "name": "resource_group_id", + "name": "crn", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true }, { @@ -86752,35 +90718,11 @@ } } }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, { "name": "tool_id", "type": "TypeString", "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_githubconsolidated": [ - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, { "name": "parameters", @@ -86915,27 +90857,6 @@ "max_items": 1, "min_items": 1 }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, { "name": "initialization", "type": "TypeList", @@ -87031,92 +90952,89 @@ "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_gitlab": [ { - "name": "referent", + "name": "initialization", "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, + "required": true, "elem": { - "api_href": { - "name": "api_href", + "blind_connection": { + "name": "blind_connection", + "type": "TypeBool", + "description": "Setting this value to true means the server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. Certain functionality that requires API access to the git server will be disabled. Delivery pipeline will only work using a private worker that has network access to the git server.", + "default_value": false, + "immutable": true, + "optional": true + }, + "git_id": { + "name": "git_id", "type": "TypeString", - "description": "URI representing this resource through an API.", + "description": "Set this value to 'gitlab' for gitlab.com, or 'gitlabcustom' for a custom GitLab server.", + "immutable": true, "optional": true }, - "ui_href": { - "name": "ui_href", + "owner_id": { + "name": "owner_id", "type": "TypeString", - "description": "URI representing this resource through the UI.", + "description": "The GitLab user or group that owns the repository. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", + "immutable": true, + "optional": true + }, + "private_repo": { + "name": "private_repo", + "type": "TypeBool", + "description": "Set this value to 'true' to make the repository private when creating a new repository or when cloning or forking a repository. This parameter is not used when linking to an existing repository.", + "default_value": true, + "immutable": true, + "optional": true + }, + "repo_name": { + "name": "repo_name", + "type": "TypeString", + "description": "The name of the new GitLab repository to create. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", + "immutable": true, "optional": true + }, + "repo_url": { + "name": "repo_url", + "type": "TypeString", + "description": "The URL of the GitLab repository for this tool integration. This parameter is required when linking to an existing repository. The value will be computed when creating a new repository, cloning, or forking a repository.", + "immutable": true, + "optional": true + }, + "root_url": { + "name": "root_url", + "type": "TypeString", + "description": "The Root URL of the server. e.g. https://gitlab.example.com.", + "immutable": true, + "optional": true + }, + "source_repo_url": { + "name": "source_repo_url", + "type": "TypeString", + "description": "The URL of the repository that you are forking or cloning. This parameter is required when forking or cloning a repository. It is not used when creating a new repository or linking to an existing repository.", + "immutable": true, + "optional": true + }, + "title": { + "name": "title", + "type": "TypeString", + "description": "The title of the server. e.g. My GitLab Enterprise Server.", + "immutable": true, + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The operation that should be performed to initialize the new tool integration. Use 'new' or 'new_if_not_exists' to create a new git repository, 'clone' or 'clone_if_not_exists' to clone an existing repository into a new git repository, 'fork' or 'fork_if_not_exists' to fork an existing git repository, or 'link' to link to an existing git repository. If you attempt to apply a resource with type 'new', 'clone', or 'fork' when the target repo already exists, the attempt will fail. If you apply a resource with type 'new_if_not_exists`, 'clone_if_not_exists', or 'fork_if_not_exists' when the target repo already exists, the existing repo will be used as-is.", + "immutable": true, + "required": true } - } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - } - ], - "ibm_cd_toolchain_tool_gitlab": [ - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true + }, + "max_items": 1, + "min_items": 1 }, { "name": "referent", @@ -87138,6 +91056,12 @@ } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "state", "type": "TypeString", @@ -87282,94 +91206,12 @@ "min_items": 1 }, { - "name": "initialization", - "type": "TypeList", - "required": true, - "elem": { - "blind_connection": { - "name": "blind_connection", - "type": "TypeBool", - "description": "Setting this value to true means the server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. Certain functionality that requires API access to the git server will be disabled. Delivery pipeline will only work using a private worker that has network access to the git server.", - "default_value": false, - "immutable": true, - "optional": true - }, - "git_id": { - "name": "git_id", - "type": "TypeString", - "description": "Set this value to 'gitlab' for gitlab.com, or 'gitlabcustom' for a custom GitLab server.", - "immutable": true, - "optional": true - }, - "owner_id": { - "name": "owner_id", - "type": "TypeString", - "description": "The GitLab user or group that owns the repository. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", - "immutable": true, - "optional": true - }, - "private_repo": { - "name": "private_repo", - "type": "TypeBool", - "description": "Set this value to 'true' to make the repository private when creating a new repository or when cloning or forking a repository. This parameter is not used when linking to an existing repository.", - "default_value": true, - "immutable": true, - "optional": true - }, - "repo_name": { - "name": "repo_name", - "type": "TypeString", - "description": "The name of the new GitLab repository to create. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", - "immutable": true, - "optional": true - }, - "repo_url": { - "name": "repo_url", - "type": "TypeString", - "description": "The URL of the GitLab repository for this tool integration. This parameter is required when linking to an existing repository. The value will be computed when creating a new repository, cloning, or forking a repository.", - "immutable": true, - "optional": true - }, - "root_url": { - "name": "root_url", - "type": "TypeString", - "description": "The Root URL of the server. e.g. https://gitlab.example.com.", - "immutable": true, - "optional": true - }, - "source_repo_url": { - "name": "source_repo_url", - "type": "TypeString", - "description": "The URL of the repository that you are forking or cloning. This parameter is required when forking or cloning a repository. It is not used when creating a new repository or linking to an existing repository.", - "immutable": true, - "optional": true - }, - "title": { - "name": "title", - "type": "TypeString", - "description": "The title of the server. e.g. My GitLab Enterprise Server.", - "immutable": true, - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "The operation that should be performed to initialize the new tool integration. Use 'new' or 'new_if_not_exists' to create a new git repository, 'clone' or 'clone_if_not_exists' to clone an existing repository into a new git repository, 'fork' or 'fork_if_not_exists' to fork an existing git repository, or 'link' to link to an existing git repository. If you attempt to apply a resource with type 'new', 'clone', or 'fork' when the target repo already exists, the attempt will fail. If you apply a resource with type 'new_if_not_exists`, 'clone_if_not_exists', or 'fork_if_not_exists' when the target repo already exists, the existing repo will be used as-is.", - "immutable": true, - "required": true - } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "tool_id", + "name": "crn", "type": "TypeString", - "description": "Tool ID.", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true - } - ], - "ibm_cd_toolchain_tool_hashicorpvault": [ + }, { "name": "toolchain_crn", "type": "TypeString", @@ -87377,29 +91219,9 @@ "computed": true }, { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - }, - { - "name": "state", + "name": "href", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "URI representing the tool.", "computed": true }, { @@ -87409,90 +91231,12 @@ "computed": true }, { - "name": "parameters", - "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", - "required": true, - "elem": { - "authentication_method": { - "name": "authentication_method", - "type": "TypeString", - "description": "The authentication method for your HashiCorp Vault instance.", - "required": true - }, - "dashboard_url": { - "name": "dashboard_url", - "type": "TypeString", - "description": "The URL of the HashiCorp Vault server dashboard for this integration. In the graphical UI, this is the dashboard that the browser will navigate to when you click the HashiCorp Vault integration tile.", - "required": true - }, - "default_secret": { - "name": "default_secret", - "type": "TypeString", - "description": "A default secret name that will be selected or used if no list of secret names are returned from your HashiCorp Vault instance.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name used to identify this tool integration. Secret references include this name to identify the secrets store where the secrets reside. All secrets store tools integrated into a toolchain should have a unique name to allow secret resolution to function properly.", - "required": true - }, - "password": { - "name": "password", - "type": "TypeString", - "description": "The authentication password for your HashiCorp Vault instance when using the 'userpass' authentication method. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", - "secure": true, - "optional": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "The mount path where your secrets are stored in your HashiCorp Vault instance.", - "required": true - }, - "role_id": { - "name": "role_id", - "type": "TypeString", - "description": "The authentication role ID for your HashiCorp Vault instance when using the 'approle' authentication method. This parameter is ignored for other authentication methods. Note, 'role_id' should be treated as a secret and should not be shared in plaintext. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", - "secure": true, - "optional": true - }, - "secret_filter": { - "name": "secret_filter", - "type": "TypeString", - "description": "A regular expression to filter the list of secret names returned from your HashiCorp Vault instance.", - "optional": true - }, - "secret_id": { - "name": "secret_id", - "type": "TypeString", - "description": "The authentication secret ID for your HashiCorp Vault instance when using the 'approle' authentication method. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", - "secure": true, - "optional": true - }, - "server_url": { - "name": "server_url", - "type": "TypeString", - "description": "The server URL for your HashiCorp Vault instance.", - "required": true - }, - "token": { - "name": "token", - "type": "TypeString", - "description": "The authentication token for your HashiCorp Vault instance when using the 'github' and 'token' authentication methods. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", - "secure": true, - "optional": true - }, - "username": { - "name": "username", - "type": "TypeString", - "description": "The authentication username for your HashiCorp Vault instance when using the 'userpass' authentication method. This parameter is ignored for other authentication methods.", - "optional": true - } - }, - "max_items": 1, - "min_items": 1 + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true }, { "name": "resource_group_id", @@ -87500,12 +91244,13 @@ "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_hashicorpvault": [ { - "name": "crn", + "name": "href", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "URI representing the tool.", "computed": true }, { @@ -87514,6 +91259,12 @@ "description": "Latest tool update timestamp.", "computed": true }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, { "name": "toolchain_id", "type": "TypeString", @@ -87533,94 +91284,109 @@ "optional": true }, { - "name": "href", + "name": "resource_group_id", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", "computed": true - } - ], - "ibm_cd_toolchain_tool_hostedgit": [ + }, { - "name": "toolchain_id", + "name": "crn", "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "initialization", + "name": "parameters", "type": "TypeList", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", "required": true, "elem": { - "git_id": { - "name": "git_id", + "authentication_method": { + "name": "authentication_method", "type": "TypeString", - "description": "Set this value to 'hostedgit' to target Git Repos and Issue Tracking.", - "immutable": true, - "optional": true + "description": "The authentication method for your HashiCorp Vault instance.", + "required": true }, - "owner_id": { - "name": "owner_id", + "dashboard_url": { + "name": "dashboard_url", "type": "TypeString", - "description": "The GitLab user or group that owns the repository. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", - "immutable": true, + "description": "The URL of the HashiCorp Vault server dashboard for this integration. In the graphical UI, this is the dashboard that the browser will navigate to when you click the HashiCorp Vault integration tile.", + "required": true + }, + "default_secret": { + "name": "default_secret", + "type": "TypeString", + "description": "A default secret name that will be selected or used if no list of secret names are returned from your HashiCorp Vault instance.", "optional": true }, - "private_repo": { - "name": "private_repo", - "type": "TypeBool", - "description": "Set this value to 'true' to make the repository private when creating a new repository or when cloning or forking a repository. This parameter is not used when linking to an existing repository.", - "default_value": true, - "immutable": true, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name used to identify this tool integration. Secret references include this name to identify the secrets store where the secrets reside. All secrets store tools integrated into a toolchain should have a unique name to allow secret resolution to function properly.", + "required": true + }, + "password": { + "name": "password", + "type": "TypeString", + "description": "The authentication password for your HashiCorp Vault instance when using the 'userpass' authentication method. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", + "secure": true, "optional": true }, - "repo_name": { - "name": "repo_name", + "path": { + "name": "path", "type": "TypeString", - "description": "The name of the new GitLab repository to create. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", - "immutable": true, + "description": "The mount path where your secrets are stored in your HashiCorp Vault instance.", + "required": true + }, + "role_id": { + "name": "role_id", + "type": "TypeString", + "description": "The authentication role ID for your HashiCorp Vault instance when using the 'approle' authentication method. This parameter is ignored for other authentication methods. Note, 'role_id' should be treated as a secret and should not be shared in plaintext. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", + "secure": true, "optional": true }, - "repo_url": { - "name": "repo_url", + "secret_filter": { + "name": "secret_filter", "type": "TypeString", - "description": "The URL of the GitLab repository for this tool integration. This parameter is required when linking to an existing repository. The value will be computed when creating a new repository, cloning, or forking a repository.", - "immutable": true, + "description": "A regular expression to filter the list of secret names returned from your HashiCorp Vault instance.", "optional": true }, - "source_repo_url": { - "name": "source_repo_url", + "secret_id": { + "name": "secret_id", "type": "TypeString", - "description": "The URL of the repository that you are forking or cloning. This parameter is required when forking or cloning a repository. It is not used when creating a new repository or linking to an existing repository.", - "immutable": true, + "description": "The authentication secret ID for your HashiCorp Vault instance when using the 'approle' authentication method. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", + "secure": true, "optional": true }, - "type": { - "name": "type", + "server_url": { + "name": "server_url", "type": "TypeString", - "description": "The operation that should be performed to initialize the new tool integration. Use 'new' or 'new_if_not_exists' to create a new git repository, 'clone' or 'clone_if_not_exists' to clone an existing repository into a new git repository, 'fork' or 'fork_if_not_exists' to fork an existing git repository, or 'link' to link to an existing git repository. If you attempt to apply a resource with type 'new', 'clone', or 'fork' when the target repo already exists, the attempt will fail. If you apply a resource with type 'new_if_not_exists`, 'clone_if_not_exists', or 'fork_if_not_exists' when the target repo already exists, the existing repo will be used as-is.", - "immutable": true, + "description": "The server URL for your HashiCorp Vault instance.", "required": true + }, + "token": { + "name": "token", + "type": "TypeString", + "description": "The authentication token for your HashiCorp Vault instance when using the 'github' and 'token' authentication methods. This parameter is ignored for other authentication methods. You can use a toolchain secret reference for this parameter. For more information, see [Protecting your sensitive data in Continuous Delivery](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_data_security#cd_secure_credentials).", + "secure": true, + "optional": true + }, + "username": { + "name": "username", + "type": "TypeString", + "description": "The authentication username for your HashiCorp Vault instance when using the 'userpass' authentication method. This parameter is ignored for other authentication methods.", + "optional": true } }, "max_items": 1, "min_items": 1 }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "crn", + "name": "toolchain_crn", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -87644,25 +91410,13 @@ } }, { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "state", + "name": "tool_id", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Tool ID.", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, + } + ], + "ibm_cd_toolchain_tool_hostedgit": [ { "name": "parameters", "type": "TypeList", @@ -87772,6 +91526,20 @@ "max_items": 1, "min_items": 1 }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "toolchain_crn", "type": "TypeString", @@ -87779,9 +91547,9 @@ "computed": true }, { - "name": "href", + "name": "state", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Current configuration state of the tool.", "computed": true }, { @@ -87789,9 +91557,7 @@ "type": "TypeString", "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_jenkins": [ + }, { "name": "toolchain_id", "type": "TypeString", @@ -87803,10 +91569,76 @@ "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, { - "name": "crn", + "name": "name", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, + { + "name": "initialization", + "type": "TypeList", + "required": true, + "elem": { + "git_id": { + "name": "git_id", + "type": "TypeString", + "description": "Set this value to 'hostedgit' to target Git Repos and Issue Tracking.", + "immutable": true, + "optional": true + }, + "owner_id": { + "name": "owner_id", + "type": "TypeString", + "description": "The GitLab user or group that owns the repository. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", + "immutable": true, + "optional": true + }, + "private_repo": { + "name": "private_repo", + "type": "TypeBool", + "description": "Set this value to 'true' to make the repository private when creating a new repository or when cloning or forking a repository. This parameter is not used when linking to an existing repository.", + "default_value": true, + "immutable": true, + "optional": true + }, + "repo_name": { + "name": "repo_name", + "type": "TypeString", + "description": "The name of the new GitLab repository to create. This parameter is required when creating a new repository, cloning, or forking a repository. The value will be computed when linking to an existing repository.", + "immutable": true, + "optional": true + }, + "repo_url": { + "name": "repo_url", + "type": "TypeString", + "description": "The URL of the GitLab repository for this tool integration. This parameter is required when linking to an existing repository. The value will be computed when creating a new repository, cloning, or forking a repository.", + "immutable": true, + "optional": true + }, + "source_repo_url": { + "name": "source_repo_url", + "type": "TypeString", + "description": "The URL of the repository that you are forking or cloning. This parameter is required when forking or cloning a repository. It is not used when creating a new repository or linking to an existing repository.", + "immutable": true, + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The operation that should be performed to initialize the new tool integration. Use 'new' or 'new_if_not_exists' to create a new git repository, 'clone' or 'clone_if_not_exists' to clone an existing repository into a new git repository, 'fork' or 'fork_if_not_exists' to fork an existing git repository, or 'link' to link to an existing git repository. If you attempt to apply a resource with type 'new', 'clone', or 'fork' when the target repo already exists, the attempt will fail. If you apply a resource with type 'new_if_not_exists`, 'clone_if_not_exists', or 'fork_if_not_exists' when the target repo already exists, the existing repo will be used as-is.", + "immutable": true, + "required": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true }, { @@ -87834,15 +91666,9 @@ "type": "TypeString", "description": "Latest tool update timestamp.", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, + } + ], + "ibm_cd_toolchain_tool_jenkins": [ { "name": "parameters", "type": "TypeList", @@ -87893,9 +91719,10 @@ "computed": true }, { - "name": "toolchain_crn", + "name": "crn", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true }, { @@ -87915,9 +91742,31 @@ "type": "TypeString", "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_jira": [ + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", + "computed": true + }, { "name": "referent", "type": "TypeList", @@ -87943,19 +91792,9 @@ "type": "TypeString", "description": "Latest tool update timestamp.", "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_jira": [ { "name": "toolchain_id", "type": "TypeString", @@ -87966,27 +91805,6 @@ "max_length": 36, "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -88029,32 +91847,16 @@ "max_items": 1, "min_items": 1 }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, { "name": "toolchain_crn", "type": "TypeString", "description": "CRN of toolchain which the tool is bound to.", "computed": true - } - ], - "ibm_cd_toolchain_tool_keyprotect": [ - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true }, { - "name": "toolchain_crn", + "name": "href", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "URI representing the tool.", "computed": true }, { @@ -88090,14 +91892,10 @@ "computed": true }, { - "name": "toolchain_id", + "name": "tool_id", "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + "description": "Tool ID.", + "computed": true }, { "name": "name", @@ -88107,6 +91905,50 @@ "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", "optional": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + } + ], + "ibm_cd_toolchain_tool_keyprotect": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "Tool ID.", + "computed": true + }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + }, { "name": "parameters", "type": "TypeList", @@ -88155,9 +91997,44 @@ "computed": true }, { - "name": "tool_id", + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } + }, + { + "name": "name", "type": "TypeString", - "description": "Tool ID.", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", "computed": true } ], @@ -88240,10 +92117,9 @@ "min_items": 1 }, { - "name": "resource_group_id", + "name": "toolchain_crn", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -88279,50 +92155,50 @@ "computed": true }, { - "name": "crn", + "name": "tool_id", "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", + "description": "Tool ID.", "computed": true }, { - "name": "toolchain_crn", + "name": "resource_group_id", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "updated_at", + "name": "crn", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true }, { - "name": "tool_id", + "name": "updated_at", "type": "TypeString", - "description": "Tool ID.", + "description": "Latest tool update timestamp.", "computed": true } ], "ibm_cd_toolchain_tool_pagerduty": [ { - "name": "name", + "name": "resource_group_id", "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true }, { - "name": "updated_at", + "name": "toolchain_crn", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { - "name": "tool_id", + "name": "href", "type": "TypeString", - "description": "Tool ID.", + "description": "URI representing the tool.", "computed": true }, { @@ -88345,6 +92221,12 @@ } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + }, { "name": "state", "type": "TypeString", @@ -88361,6 +92243,14 @@ "max_length": 36, "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, { "name": "parameters", "type": "TypeList", @@ -88390,6 +92280,31 @@ "max_items": 1, "min_items": 1 }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "tool_id", + "type": "TypeString", + "description": "Tool ID.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_pipeline": [ + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + }, { "name": "resource_group_id", "type": "TypeString", @@ -88405,24 +92320,45 @@ "computed": true }, { - "name": "toolchain_crn", + "name": "href", "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", + "description": "URI representing the tool.", "computed": true }, { - "name": "href", + "name": "tool_id", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Tool ID.", "computed": true - } - ], - "ibm_cd_toolchain_tool_pipeline": [ + }, { - "name": "resource_group_id", + "name": "name", "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, + { + "name": "parameters", + "type": "TypeList", + "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", + "required": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "The name used for this tool integration.", + "optional": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "toolchain_crn", + "type": "TypeString", + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { @@ -88452,47 +92388,32 @@ "computed": true }, { - "name": "parameters", + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + } + ], + "ibm_cd_toolchain_tool_privateworker": [ + { + "name": "referent", "type": "TypeList", - "description": "Unique key-value pairs representing parameters to be used to create the tool. A list of parameters for each tool integration can be found in the \u003ca href=\"https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations\"\u003eConfiguring tool integrations page\u003c/a\u003e.", - "required": true, + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, "elem": { - "name": { - "name": "name", + "api_href": { + "name": "api_href", "type": "TypeString", - "description": "The name used for this tool integration.", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", "optional": true } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true + } }, { "name": "state", @@ -88500,12 +92421,6 @@ "description": "Current configuration state of the tool.", "computed": true }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, { "name": "toolchain_id", "type": "TypeString", @@ -88515,9 +92430,7 @@ "min_length": 36, "max_length": 36, "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" - } - ], - "ibm_cd_toolchain_tool_privateworker": [ + }, { "name": "parameters", "type": "TypeList", @@ -88561,26 +92474,22 @@ "computed": true }, { - "name": "tool_id", + "name": "href", "type": "TypeString", - "description": "Tool ID.", + "description": "URI representing the tool.", "computed": true }, { - "name": "state", + "name": "updated_at", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Latest tool update timestamp.", "computed": true }, { - "name": "toolchain_id", + "name": "tool_id", "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + "description": "Tool ID.", + "computed": true }, { "name": "name", @@ -88596,59 +92505,13 @@ "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true } ], "ibm_cd_toolchain_tool_saucelabs": [ { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "href", + "name": "updated_at", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Latest tool update timestamp.", "computed": true }, { @@ -88657,14 +92520,6 @@ "description": "Tool ID.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, { "name": "parameters", "type": "TypeList", @@ -88715,9 +92570,16 @@ } }, { - "name": "updated_at", + "name": "crn", "type": "TypeString", - "description": "Latest tool update timestamp.", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true }, { @@ -88735,18 +92597,14 @@ "min_length": 36, "max_length": 36, "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" - } - ], - "ibm_cd_toolchain_tool_secretsmanager": [ + }, { - "name": "toolchain_id", + "name": "name", "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true }, { "name": "resource_group_id", @@ -88754,6 +92612,15 @@ "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true + } + ], + "ibm_cd_toolchain_tool_secretsmanager": [ + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true }, { "name": "toolchain_crn", @@ -88761,6 +92628,38 @@ "description": "CRN of toolchain which the tool is bound to.", "computed": true }, + { + "name": "state", + "type": "TypeString", + "description": "Current configuration state of the tool.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", + "computed": true + }, + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } + }, { "name": "updated_at", "type": "TypeString", @@ -88774,10 +92673,14 @@ "computed": true }, { - "name": "state", + "name": "toolchain_id", "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, { "name": "name", @@ -88833,73 +92736,15 @@ "max_items": 1, "min_items": 1 }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "URI representing the tool.", - "computed": true - }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - } - ], - "ibm_cd_toolchain_tool_securitycompliance": [ - { - "name": "toolchain_id", - "type": "TypeString", - "description": "ID of the toolchain to bind the tool to.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the tool.", - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", - "optional": true - }, { "name": "resource_group_id", "type": "TypeString", "description": "Resource group where the tool is located.", "cloud_data_type": "resource_group", "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, + } + ], + "ibm_cd_toolchain_tool_securitycompliance": [ { "name": "toolchain_crn", "type": "TypeString", @@ -88907,37 +92752,27 @@ "computed": true }, { - "name": "href", + "name": "state", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Current configuration state of the tool.", "computed": true }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - }, { "name": "tool_id", "type": "TypeString", "description": "Tool ID.", "computed": true }, + { + "name": "toolchain_id", + "type": "TypeString", + "description": "ID of the toolchain to bind the tool to.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" + }, { "name": "parameters", "type": "TypeList", @@ -89032,6 +92867,33 @@ "max_items": 1, "min_items": 1 }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } + }, { "name": "updated_at", "type": "TypeString", @@ -89039,9 +92901,24 @@ "computed": true }, { - "name": "state", + "name": "name", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Name of the tool.", + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Tool CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "URI representing the tool.", "computed": true } ], @@ -89127,15 +93004,15 @@ "computed": true }, { - "name": "tool_id", + "name": "state", "type": "TypeString", - "description": "Tool ID.", + "description": "Current configuration state of the tool.", "computed": true }, { - "name": "state", + "name": "tool_id", "type": "TypeString", - "description": "Current configuration state of the tool.", + "description": "Tool ID.", "computed": true }, { @@ -89212,44 +93089,6 @@ "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9-._ ])+$", "optional": true }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Latest tool update timestamp.", - "computed": true - }, - { - "name": "tool_id", - "type": "TypeString", - "description": "Tool ID.", - "computed": true - }, - { - "name": "referent", - "type": "TypeList", - "description": "Information on URIs to access this resource through the UI or API.", - "computed": true, - "elem": { - "api_href": { - "name": "api_href", - "type": "TypeString", - "description": "URI representing this resource through an API.", - "optional": true - }, - "ui_href": { - "name": "ui_href", - "type": "TypeString", - "description": "URI representing this resource through the UI.", - "optional": true - } - } - }, - { - "name": "state", - "type": "TypeString", - "description": "Current configuration state of the tool.", - "computed": true - }, { "name": "parameters", "type": "TypeList", @@ -89293,75 +93132,71 @@ "min_items": 1 }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group where the tool is located.", - "cloud_data_type": "resource_group", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Tool CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "toolchain_crn", - "type": "TypeString", - "description": "CRN of toolchain which the tool is bound to.", - "computed": true + "name": "referent", + "type": "TypeList", + "description": "Information on URIs to access this resource through the UI or API.", + "computed": true, + "elem": { + "api_href": { + "name": "api_href", + "type": "TypeString", + "description": "URI representing this resource through an API.", + "optional": true + }, + "ui_href": { + "name": "ui_href", + "type": "TypeString", + "description": "URI representing this resource through the UI.", + "optional": true + } + } }, { - "name": "href", + "name": "tool_id", "type": "TypeString", - "description": "URI representing the tool.", + "description": "Tool ID.", "computed": true - } - ], - "ibm_cdn": [ - { - "name": "origin_address", - "type": "TypeString", - "description": "origin address info", - "required": true }, { - "name": "header", + "name": "state", "type": "TypeString", - "description": "Header info", - "optional": true, + "description": "Current configuration state of the tool.", "computed": true }, { - "name": "path", + "name": "resource_group_id", "type": "TypeString", - "description": "Path details", - "default_value": "/*", - "immutable": true, - "optional": true + "description": "Resource group where the tool is located.", + "cloud_data_type": "resource_group", + "computed": true }, { - "name": "status", + "name": "crn", "type": "TypeString", - "description": "Status info of the CDN instance", + "description": "Tool CRN.", + "cloud_data_type": "crn", "computed": true }, { - "name": "cname", + "name": "toolchain_crn", "type": "TypeString", - "description": "cname info", - "immutable": true, - "optional": true, + "description": "CRN of toolchain which the tool is bound to.", "computed": true }, { - "name": "cache_key_query_rule", + "name": "href", "type": "TypeString", - "description": "query rule info", - "default_value": "include-all", - "optional": true + "description": "URI representing the tool.", + "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Latest tool update timestamp.", + "computed": true + } + ], + "ibm_cdn": [ { "name": "vendor_name", "type": "TypeString", @@ -89371,17 +93206,31 @@ "optional": true }, { - "name": "origin_type", + "name": "protocol", "type": "TypeString", - "description": "Origin type info", - "default_value": "HOST_SERVER", + "description": "Protocol name", + "default_value": "HTTP", "immutable": true, "optional": true }, { - "name": "bucket_name", + "name": "respect_headers", + "type": "TypeBool", + "description": "respect headers info", + "default_value": true, + "optional": true + }, + { + "name": "file_extension", "type": "TypeString", - "description": "Bucket name", + "description": "File extension info", + "optional": true + }, + { + "name": "certificate_type", + "type": "TypeString", + "description": "Certificate type", + "immutable": true, "optional": true }, { @@ -89399,14 +93248,6 @@ "immutable": true, "required": true }, - { - "name": "protocol", - "type": "TypeString", - "description": "Protocol name", - "default_value": "HTTP", - "immutable": true, - "optional": true - }, { "name": "http_port", "type": "TypeInt", @@ -89422,40 +93263,86 @@ "optional": true }, { - "name": "respect_headers", - "type": "TypeBool", - "description": "respect headers info", - "default_value": true, + "name": "header", + "type": "TypeString", + "description": "Header info", + "optional": true, + "computed": true + }, + { + "name": "cache_key_query_rule", + "type": "TypeString", + "description": "query rule info", + "default_value": "include-all", "optional": true }, { - "name": "file_extension", + "name": "bucket_name", "type": "TypeString", - "description": "File extension info", + "description": "Bucket name", "optional": true }, { - "name": "certificate_type", + "name": "origin_type", "type": "TypeString", - "description": "Certificate type", + "description": "Origin type info", + "default_value": "HOST_SERVER", + "immutable": true, + "optional": true + }, + { + "name": "origin_address", + "type": "TypeString", + "description": "origin address info", + "required": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status info of the CDN instance", + "computed": true + }, + { + "name": "cname", + "type": "TypeString", + "description": "cname info", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "path", + "type": "TypeString", + "description": "Path details", + "default_value": "/*", "immutable": true, "optional": true } ], "ibm_cis": [ { - "name": "service", + "name": "plan", "type": "TypeString", - "description": "The name of the Cloud Internet Services offering", + "description": "The plan type of the service", + "required": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status of resource instance", "computed": true }, { - "name": "location", + "name": "resource_group_name", "type": "TypeString", - "description": "The location where the instance available", - "cloud_data_type": "region", - "immutable": true, - "required": true + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "service", + "type": "TypeString", + "description": "The name of the Cloud Internet Services offering", + "computed": true }, { "name": "resource_group_id", @@ -89467,15 +93354,16 @@ "computed": true }, { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true + "name": "parameters", + "type": "TypeMap", + "description": "Arbitrary parameters to pass. Must be a JSON object", + "immutable": true, + "optional": true }, { - "name": "resource_controller_url", + "name": "resource_status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The status of the resource", "computed": true }, { @@ -89485,17 +93373,12 @@ "required": true }, { - "name": "guid", + "name": "location", "type": "TypeString", - "description": "Unique identifier of resource instance", - "computed": true - }, - { - "name": "parameters", - "type": "TypeMap", - "description": "Arbitrary parameters to pass. Must be a JSON object", + "description": "The location where the instance available", + "cloud_data_type": "region", "immutable": true, - "optional": true + "required": true }, { "name": "tags", @@ -89510,41 +93393,63 @@ } }, { - "name": "resource_status", + "name": "resource_name", "type": "TypeString", - "description": "The status of the resource", + "description": "The name of the resource", "computed": true }, { - "name": "resource_group_name", + "name": "resource_crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The crn of the resource", "computed": true }, { - "name": "plan", - "type": "TypeString", - "description": "The plan type of the service", - "required": true - }, - { - "name": "status", + "name": "resource_controller_url", "type": "TypeString", - "description": "Status of resource instance", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { - "name": "resource_name", + "name": "guid", "type": "TypeString", - "description": "The name of the resource", + "description": "Unique identifier of resource instance", "computed": true } ], "ibm_cis_alert": [ { - "name": "name", + "name": "filters", "type": "TypeString", - "description": "Policy name", + "description": "Filters based on filter type", + "optional": true + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "policy_id", + "type": "TypeString", + "description": "Identifier of the Alert Policy", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Policy Description", + "optional": true + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "Is the alert policy active", "required": true }, { @@ -89578,17 +93483,19 @@ } }, { - "name": "filters", + "name": "name", "type": "TypeString", - "description": "Filters based on filter type", - "optional": true + "description": "Policy name", + "required": true }, { "name": "conditions", "type": "TypeString", "description": "Conditions based on filter type", "optional": true - }, + } + ], + "ibm_cis_bot_management": [ { "name": "cis_id", "type": "TypeString", @@ -89600,25 +93507,29 @@ ] }, { - "name": "policy_id", + "name": "domain_id", "type": "TypeString", - "description": "Identifier of the Alert Policy", + "description": "Associated CIS domain", + "required": true + }, + { + "name": "fight_mode", + "type": "TypeString", + "description": "Fight Mode", "computed": true }, { - "name": "description", + "name": "session_score", "type": "TypeString", - "description": "Policy Description", - "optional": true + "description": "Session Score", + "computed": true }, { - "name": "enabled", - "type": "TypeBool", - "description": "Is the alert policy active", - "required": true - } - ], - "ibm_cis_bot_management": [ + "name": "enable_js", + "type": "TypeString", + "description": "Enable JS", + "computed": true + }, { "name": "auth_id_logging", "type": "TypeString", @@ -89630,56 +93541,54 @@ "type": "TypeString", "description": "Use Latest Model", "computed": true - }, + } + ], + "ibm_cis_cache_settings": [ { - "name": "cis_id", + "name": "caching_level", "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "description": "Cache level setting", + "options": "basic, simplified, aggressive", + "optional": true, + "computed": true }, { - "name": "domain_id", + "name": "serve_stale_content", "type": "TypeString", - "description": "Associated CIS domain", - "required": true + "description": "Serve Stale Content", + "default_value": "on", + "options": "on, off", + "optional": true }, { - "name": "fight_mode", - "type": "TypeString", - "description": "Fight Mode", + "name": "browser_expiration", + "type": "TypeInt", + "description": "Browser Expiration setting", + "options": "0, 30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400,18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000,691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000", + "optional": true, "computed": true }, { - "name": "session_score", + "name": "development_mode", "type": "TypeString", - "description": "Session Score", + "description": "Development mode setting", + "options": "on, off", + "optional": true, "computed": true }, { - "name": "enable_js", - "type": "TypeString", - "description": "Enable JS", - "computed": true - } - ], - "ibm_cis_cache_settings": [ - { - "name": "purge_by_tags", + "name": "purge_by_urls", "type": "TypeList", - "description": "Purge by tags", + "description": "Purge by URLs", "optional": true, "elem": { "type": "TypeString" } }, { - "name": "purge_by_hosts", + "name": "purge_by_tags", "type": "TypeList", - "description": "Purge by hosts", + "description": "Purge by tags", "optional": true, "elem": { "type": "TypeString" @@ -89701,14 +93610,6 @@ "description": "Associated CIS domain", "required": true }, - { - "name": "serve_stale_content", - "type": "TypeString", - "description": "Serve Stale Content", - "default_value": "on", - "options": "on, off", - "optional": true - }, { "name": "query_string_sort", "type": "TypeString", @@ -89718,62 +93619,22 @@ "computed": true }, { - "name": "purge_by_urls", + "name": "purge_all", + "type": "TypeBool", + "description": "Purge all setting", + "optional": true + }, + { + "name": "purge_by_hosts", "type": "TypeList", - "description": "Purge by URLs", + "description": "Purge by hosts", "optional": true, "elem": { "type": "TypeString" } - }, - { - "name": "caching_level", - "type": "TypeString", - "description": "Cache level setting", - "options": "basic, simplified, aggressive", - "optional": true, - "computed": true - }, - { - "name": "browser_expiration", - "type": "TypeInt", - "description": "Browser Expiration setting", - "options": "0, 30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400,18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000,691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000", - "optional": true, - "computed": true - }, - { - "name": "development_mode", - "type": "TypeString", - "description": "Development mode setting", - "options": "on, off", - "optional": true, - "computed": true - }, - { - "name": "purge_all", - "type": "TypeBool", - "description": "Purge all setting", - "optional": true } ], "ibm_cis_certificate_order": [ - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS object id or CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, { "name": "certificate_id", "type": "TypeString", @@ -89802,9 +93663,43 @@ "type": "TypeString", "description": "certificate status", "computed": true + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS object id or CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "Associated CIS domain", + "required": true } ], "ibm_cis_certificate_upload": [ + { + "name": "domain_id", + "type": "TypeString", + "description": "Associated CIS domain", + "required": true + }, + { + "name": "custom_cert_id", + "type": "TypeString", + "computed": true + }, + { + "name": "certificate", + "type": "TypeString", + "description": "Certificate key", + "secure": true, + "required": true + }, { "name": "private_key", "type": "TypeString", @@ -89821,15 +93716,18 @@ "optional": true }, { - "name": "issuer", - "type": "TypeString", - "description": "certificate issuer", - "computed": true + "name": "hosts", + "type": "TypeList", + "description": "hosts which the certificate uploaded to", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "signature", + "name": "uploaded_on", "type": "TypeString", - "description": "certificate signature", + "description": "certificate uploaded date", "computed": true }, { @@ -89839,28 +93737,21 @@ "computed": true }, { - "name": "certificate", - "type": "TypeString", - "description": "Certificate key", - "secure": true, - "required": true - }, - { - "name": "expires_on", + "name": "signature", "type": "TypeString", - "description": "certificate expires date", + "description": "certificate signature", "computed": true }, { - "name": "uploaded_on", + "name": "modified_on", "type": "TypeString", - "description": "certificate uploaded date", + "description": "certificate modified date", "computed": true }, { - "name": "modified_on", + "name": "expires_on", "type": "TypeString", - "description": "certificate modified date", + "description": "certificate expires date", "computed": true }, { @@ -89873,32 +93764,18 @@ "service:internet-svcs" ] }, - { - "name": "domain_id", - "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, - { - "name": "custom_cert_id", - "type": "TypeString", - "computed": true - }, - { - "name": "hosts", - "type": "TypeList", - "description": "hosts which the certificate uploaded to", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "priority", "type": "TypeInt", "description": "Certificate priority", "optional": true, "computed": true + }, + { + "name": "issuer", + "type": "TypeString", + "description": "certificate issuer", + "computed": true } ], "ibm_cis_custom_page": [ @@ -89913,15 +93790,15 @@ ] }, { - "name": "created_on", + "name": "url", "type": "TypeString", - "description": "Custom page created date", - "computed": true + "description": "Custom page url", + "required": true }, { - "name": "modified_on", + "name": "description", "type": "TypeString", - "description": "Custom page modified date", + "description": "Free text", "computed": true }, { @@ -89939,6 +93816,18 @@ "description": "Custom page preview target", "computed": true }, + { + "name": "created_on", + "type": "TypeString", + "description": "Custom page created date", + "computed": true + }, + { + "name": "modified_on", + "type": "TypeString", + "description": "Custom page modified date", + "computed": true + }, { "name": "domain_id", "type": "TypeString", @@ -89953,39 +93842,14 @@ "required": true, "options": "basic_challenge, waf_challenge, waf_block, ratelimit_block,country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online" }, - { - "name": "url", - "type": "TypeString", - "description": "Custom page url", - "required": true - }, { "name": "state", "type": "TypeString", "description": "Custom page state", "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Free text", - "computed": true } ], "ibm_cis_dns_record": [ - { - "name": "domain_id", - "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, - { - "name": "ttl", - "type": "TypeInt", - "description": "TTL value", - "default_value": 1, - "optional": true - }, { "name": "cis_id", "type": "TypeString", @@ -90003,31 +93867,19 @@ "optional": true }, { - "name": "created_on", + "name": "modified_on", "type": "TypeString", "computed": true }, { - "name": "zone_name", - "type": "TypeString", - "description": "zone name", + "name": "proxiable", + "type": "TypeBool", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "DNS record name", - "optional": true - }, - { - "name": "content", + "name": "zone_name", "type": "TypeString", - "description": "DNS record content", - "optional": true - }, - { - "name": "proxiable", - "type": "TypeBool", + "description": "zone name", "computed": true }, { @@ -90037,8 +93889,10 @@ "required": true }, { - "name": "data", - "type": "TypeMap", + "name": "ttl", + "type": "TypeInt", + "description": "TTL value", + "default_value": 1, "optional": true }, { @@ -90049,7 +93903,12 @@ "optional": true }, { - "name": "modified_on", + "name": "data", + "type": "TypeMap", + "optional": true + }, + { + "name": "created_on", "type": "TypeString", "computed": true }, @@ -90057,28 +93916,27 @@ "name": "record_id", "type": "TypeString", "computed": true - } - ], - "ibm_cis_dns_records_import": [ + }, { - "name": "file", + "name": "domain_id", "type": "TypeString", - "description": "File to import", - "immutable": true, + "description": "Associated CIS domain", "required": true }, { - "name": "total_records_parsed", - "type": "TypeInt", - "description": "total records parsed", - "computed": true + "name": "name", + "type": "TypeString", + "description": "DNS record name", + "optional": true }, { - "name": "records_added", - "type": "TypeInt", - "description": "added records count", - "computed": true - }, + "name": "content", + "type": "TypeString", + "description": "DNS record content", + "optional": true + } + ], + "ibm_cis_dns_records_import": [ { "name": "cis_id", "type": "TypeString", @@ -90094,46 +93952,47 @@ "type": "TypeString", "description": "Associated CIS domain", "required": true - } - ], - "ibm_cis_domain": [ + }, { - "name": "paused", - "type": "TypeBool", + "name": "file", + "type": "TypeString", + "description": "File to import", + "immutable": true, + "required": true + }, + { + "name": "total_records_parsed", + "type": "TypeInt", + "description": "total records parsed", "computed": true }, + { + "name": "records_added", + "type": "TypeInt", + "description": "added records count", + "computed": true + } + ], + "ibm_cis_domain": [ { "name": "status", "type": "TypeString", "computed": true }, { - "name": "name_servers", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "verification_key", + "name": "domain_id", "type": "TypeString", "computed": true }, { - "name": "cname_suffix", + "name": "verification_key", "type": "TypeString", "computed": true }, { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "name": "paused", + "type": "TypeBool", + "computed": true }, { "name": "domain", @@ -90150,7 +94009,7 @@ "optional": true }, { - "name": "original_name_servers", + "name": "name_servers", "type": "TypeList", "computed": true, "elem": { @@ -90158,46 +94017,40 @@ } }, { - "name": "domain_id", - "type": "TypeString", - "computed": true - } - ], - "ibm_cis_domain_settings": [ - { - "name": "script_load_optimization", - "type": "TypeString", - "description": "script_load_optimization setting", - "options": "on, off", - "optional": true, - "computed": true + "name": "original_name_servers", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "ssl", + "name": "cname_suffix", "type": "TypeString", - "description": "SSL/TLS setting", - "optional": true, "computed": true }, { - "name": "cname_flattening", + "name": "cis_id", "type": "TypeString", - "description": "cname_flattening setting", - "optional": true, - "computed": true - }, + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + } + ], + "ibm_cis_domain_settings": [ { - "name": "ip_geolocation", + "name": "domain_id", "type": "TypeString", - "description": "ip_geolocation setting", - "options": "on, off", - "optional": true, - "computed": true + "description": "Associated CIS domain", + "required": true }, { - "name": "automatic_https_rewrites", + "name": "opportunistic_encryption", "type": "TypeString", - "description": "automatic_https_rewrites setting", + "description": "opportunistic_encryption setting", "options": "on, off", "optional": true, "computed": true @@ -90211,33 +94064,10 @@ "computed": true }, { - "name": "http2", - "type": "TypeString", - "description": "http2 setting", - "options": "on, off", - "optional": true, - "computed": true - }, - { - "name": "always_use_https", - "type": "TypeString", - "description": "always_use_https setting", - "options": "on, off", - "optional": true, - "computed": true - }, - { - "name": "pseudo_ipv4", - "type": "TypeString", - "description": "pseudo_ipv4 setting", - "optional": true, - "computed": true - }, - { - "name": "challenge_ttl", + "name": "max_upload", "type": "TypeInt", - "description": "Challenge TTL setting", - "options": "300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000", + "description": "Maximum upload", + "options": "100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500", "optional": true, "computed": true }, @@ -90270,6 +94100,22 @@ "max_items": 1, "min_items": 1 }, + { + "name": "automatic_https_rewrites", + "type": "TypeString", + "description": "automatic_https_rewrites setting", + "options": "on, off", + "optional": true, + "computed": true + }, + { + "name": "script_load_optimization", + "type": "TypeString", + "description": "script_load_optimization setting", + "options": "on, off", + "optional": true, + "computed": true + }, { "name": "mobile_redirect", "type": "TypeList", @@ -90301,60 +94147,129 @@ "min_items": 1 }, { - "name": "opportunistic_encryption", + "name": "image_size_optimization", "type": "TypeString", - "description": "opportunistic_encryption setting", - "options": "on, off", + "description": "image_size_optimization setting", "optional": true, "computed": true }, { - "name": "origin_error_page_pass_thru", + "name": "tls_client_auth", "type": "TypeString", - "description": "origin_error_page_pass_thru setting", + "description": "tls_client_auth setting", "options": "on, off", "optional": true, "computed": true }, { - "name": "server_side_exclude", + "name": "cipher", + "type": "TypeSet", + "description": "Cipher settings", + "options": "ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-ECDSA-CHACHA20-POLY1305, ECDHE-RSA-AES128-GCM-SHA256,ECDHE-RSA-CHACHA20-POLY1305, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES128-SHA, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES128-SHA, AES128-GCM-SHA256, AES128-SHA256, AES128-SHA, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES256-SHA, AES256-GCM-SHA384, AES256-SHA256, AES256-SHA, DES-CBC3-SHA, AEAD-AES128-GCM-SHA256, AEAD-AES256-GCM-SHA384, AEAD-CHACHA20-POLY1305-SHA256", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "security_header", + "type": "TypeList", + "description": "Security Header Setting", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "security header enabled/disabled", + "required": true + }, + "include_subdomains": { + "name": "include_subdomains", + "type": "TypeBool", + "description": "security header subdomain included or not", + "required": true + }, + "max_age": { + "name": "max_age", + "type": "TypeInt", + "description": "security header max age", + "required": true + }, + "nosniff": { + "name": "nosniff", + "type": "TypeBool", + "description": "security header no sniff", + "required": true + }, + "preload": { + "name": "preload", + "type": "TypeBool", + "description": "security header preload", + "default_value": false, + "optional": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "cis_id", "type": "TypeString", - "description": "server_side_exclude setting", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "waf", + "type": "TypeString", + "description": "WAF setting", "options": "on, off", "optional": true, "computed": true }, { - "name": "max_upload", - "type": "TypeInt", - "description": "Maximum upload", - "options": "100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500", - "optional": true, - "computed": true + "name": "certificate_status", + "type": "TypeString", + "description": "Certificate status", + "computed": true, + "deprecated": "This field is deprecated" }, { - "name": "ipv6", + "name": "ip_geolocation", "type": "TypeString", - "description": "ipv6 setting", + "description": "ip_geolocation setting", "options": "on, off", "optional": true, "computed": true }, { - "name": "image_size_optimization", + "name": "pseudo_ipv4", "type": "TypeString", - "description": "image_size_optimization setting", + "description": "pseudo_ipv4 setting", "optional": true, "computed": true }, { - "name": "response_buffering", + "name": "websockets", "type": "TypeString", - "description": "response_buffering setting", + "description": "websockets setting", "options": "on, off", "optional": true, "computed": true }, + { + "name": "dnssec", + "type": "TypeString", + "description": "DNS Sec setting", + "options": "active, disabled", + "optional": true, + "computed": true + }, { "name": "image_load_optimization", "type": "TypeString", @@ -90364,9 +94279,9 @@ "computed": true }, { - "name": "tls_client_auth", + "name": "origin_error_page_pass_thru", "type": "TypeString", - "description": "tls_client_auth setting", + "description": "origin_error_page_pass_thru setting", "options": "on, off", "optional": true, "computed": true @@ -90380,43 +94295,31 @@ "computed": true }, { - "name": "cipher", - "type": "TypeSet", - "description": "Cipher settings", - "options": "ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-ECDSA-CHACHA20-POLY1305, ECDHE-RSA-AES128-GCM-SHA256,ECDHE-RSA-CHACHA20-POLY1305, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES128-SHA, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES128-SHA, AES128-GCM-SHA256, AES128-SHA256, AES128-SHA, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES256-SHA, AES256-GCM-SHA384, AES256-SHA256, AES256-SHA, DES-CBC3-SHA, AEAD-AES128-GCM-SHA256, AEAD-AES256-GCM-SHA384, AEAD-CHACHA20-POLY1305-SHA256", + "name": "challenge_ttl", + "type": "TypeInt", + "description": "Challenge TTL setting", + "options": "300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "computed": true }, { - "name": "domain_id", + "name": "ssl", "type": "TypeString", - "description": "Associated CIS domain", - "required": true + "description": "SSL/TLS setting", + "optional": true, + "computed": true }, { - "name": "min_tls_version", + "name": "cname_flattening", "type": "TypeString", - "description": "Minimum version of TLS required", - "default_value": "1.1", - "optional": true + "description": "cname_flattening setting", + "optional": true, + "computed": true }, { - "name": "browser_check", + "name": "always_use_https", "type": "TypeString", - "description": "browser_check setting", + "description": "always_use_https setting", "options": "on, off", "optional": true, "computed": true @@ -90438,77 +94341,51 @@ "computed": true }, { - "name": "websockets", + "name": "response_buffering", "type": "TypeString", - "description": "websockets setting", + "description": "response_buffering setting", "options": "on, off", "optional": true, "computed": true }, { - "name": "security_header", - "type": "TypeList", - "description": "Security Header Setting", + "name": "server_side_exclude", + "type": "TypeString", + "description": "server_side_exclude setting", + "options": "on, off", "optional": true, - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "security header enabled/disabled", - "required": true - }, - "include_subdomains": { - "name": "include_subdomains", - "type": "TypeBool", - "description": "security header subdomain included or not", - "required": true - }, - "max_age": { - "name": "max_age", - "type": "TypeInt", - "description": "security header max age", - "required": true - }, - "nosniff": { - "name": "nosniff", - "type": "TypeBool", - "description": "security header no sniff", - "required": true - }, - "preload": { - "name": "preload", - "type": "TypeBool", - "description": "security header preload", - "default_value": false, - "optional": true - } - }, - "max_items": 1, - "min_items": 1 + "computed": true }, { - "name": "dnssec", + "name": "min_tls_version", "type": "TypeString", - "description": "DNS Sec setting", - "options": "active, disabled", + "description": "Minimum version of TLS required", + "default_value": "1.1", + "optional": true + }, + { + "name": "ipv6", + "type": "TypeString", + "description": "ipv6 setting", + "options": "on, off", "optional": true, "computed": true }, { - "name": "waf", + "name": "browser_check", "type": "TypeString", - "description": "WAF setting", + "description": "browser_check setting", "options": "on, off", "optional": true, "computed": true }, { - "name": "certificate_status", + "name": "http2", "type": "TypeString", - "description": "Certificate status", - "computed": true, - "deprecated": "This field is deprecated" + "description": "http2 setting", + "options": "on, off", + "optional": true, + "computed": true } ], "ibm_cis_edge_functions_action": [ @@ -90543,24 +94420,6 @@ } ], "ibm_cis_edge_functions_trigger": [ - { - "name": "pattern_url", - "type": "TypeString", - "description": "Edge function trigger pattern", - "required": true - }, - { - "name": "action_name", - "type": "TypeString", - "description": "Edge function trigger action name", - "optional": true - }, - { - "name": "request_limit_fail_open", - "type": "TypeBool", - "description": "Edge function trigger request limit fail open", - "computed": true - }, { "name": "cis_id", "type": "TypeString", @@ -90582,15 +94441,27 @@ "type": "TypeString", "description": "CIS Edge Functions trigger route ID", "computed": true - } - ], - "ibm_cis_filter": [ + }, { - "name": "expression", + "name": "pattern_url", "type": "TypeString", - "description": "Filter Expression", + "description": "Edge function trigger pattern", "required": true }, + { + "name": "action_name", + "type": "TypeString", + "description": "Edge function trigger action name", + "optional": true + }, + { + "name": "request_limit_fail_open", + "type": "TypeBool", + "description": "Edge function trigger request limit fail open", + "computed": true + } + ], + "ibm_cis_filter": [ { "name": "description", "type": "TypeString", @@ -90620,14 +94491,90 @@ "description": "Filter Paused", "optional": true }, - { - "name": "filter_id", - "type": "TypeString", - "description": "Filter ID", - "computed": true - } - ], - "ibm_cis_firewall": [ + { + "name": "filter_id", + "type": "TypeString", + "description": "Filter ID", + "computed": true + }, + { + "name": "expression", + "type": "TypeString", + "description": "Filter Expression", + "required": true + } + ], + "ibm_cis_firewall": [ + { + "name": "firewall_type", + "type": "TypeString", + "description": "Type of firewall.Allowable values are access-rules,ua-rules,lockdowns", + "immutable": true, + "required": true, + "options": "access_rules, ua_rules, lockdowns" + }, + { + "name": "lockdown", + "type": "TypeList", + "description": "Lockdown Data", + "optional": true, + "elem": { + "configurations": { + "name": "configurations", + "type": "TypeList", + "required": true, + "elem": { + "target": { + "name": "target", + "type": "TypeString", + "description": "Target type", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Target value", + "required": true + } + }, + "min_items": 1 + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "description", + "optional": true + }, + "lockdown_id": { + "name": "lockdown_id", + "type": "TypeString", + "description": "firewall identifier", + "computed": true + }, + "paused": { + "name": "paused", + "type": "TypeBool", + "description": "Firewall rule paused or enabled", + "optional": true + }, + "priority": { + "name": "priority", + "type": "TypeInt", + "description": "Firewall priority", + "optional": true + }, + "urls": { + "name": "urls", + "type": "TypeList", + "description": "URL in which firewall rule is applied", + "required": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 + }, { "name": "access_rule", "type": "TypeList", @@ -90749,79 +94696,22 @@ "description": "Associated CIS domain", "immutable": true, "required": true + } + ], + "ibm_cis_firewall_rule": [ + { + "name": "priority", + "type": "TypeInt", + "description": "Firewallrules Action", + "optional": true, + "computed": true }, { - "name": "firewall_type", + "name": "description", "type": "TypeString", - "description": "Type of firewall.Allowable values are access-rules,ua-rules,lockdowns", - "immutable": true, - "required": true, - "options": "access_rules, ua_rules, lockdowns" + "description": "Firewallrules Description", + "optional": true }, - { - "name": "lockdown", - "type": "TypeList", - "description": "Lockdown Data", - "optional": true, - "elem": { - "configurations": { - "name": "configurations", - "type": "TypeList", - "required": true, - "elem": { - "target": { - "name": "target", - "type": "TypeString", - "description": "Target type", - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Target value", - "required": true - } - }, - "min_items": 1 - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "description", - "optional": true - }, - "lockdown_id": { - "name": "lockdown_id", - "type": "TypeString", - "description": "firewall identifier", - "computed": true - }, - "paused": { - "name": "paused", - "type": "TypeBool", - "description": "Firewall rule paused or enabled", - "optional": true - }, - "priority": { - "name": "priority", - "type": "TypeInt", - "description": "Firewall priority", - "optional": true - }, - "urls": { - "name": "urls", - "type": "TypeList", - "description": "URL in which firewall rule is applied", - "required": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1 - } - ], - "ibm_cis_firewall_rule": [ { "name": "paused", "type": "TypeBool", @@ -90851,27 +94741,24 @@ "type": "TypeString", "description": "Firewallrules Action", "required": true - }, - { - "name": "priority", - "type": "TypeInt", - "description": "Firewallrules Action", - "optional": true, - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Firewallrules Description", - "optional": true } ], "ibm_cis_global_load_balancer": [ { - "name": "name", + "name": "modified_on", "type": "TypeString", - "description": "name", - "required": true + "description": "Load balancer modified date", + "computed": true + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] }, { "name": "fallback_pool_id", @@ -90879,6 +94766,13 @@ "description": "fallback pool ID", "required": true }, + { + "name": "ttl", + "type": "TypeInt", + "description": "TTL value", + "default_value": 60, + "optional": true + }, { "name": "enabled", "type": "TypeBool", @@ -90886,6 +94780,27 @@ "default_value": true, "optional": true }, + { + "name": "pop_pools", + "type": "TypeSet", + "optional": true, + "elem": { + "pool_ids": { + "name": "pool_ids", + "type": "TypeList", + "required": true, + "elem": { + "type": "TypeString" + } + }, + "pop": { + "name": "pop", + "type": "TypeString", + "description": "pop pools region", + "required": true + } + } + }, { "name": "glb_id", "type": "TypeString", @@ -90893,24 +94808,28 @@ "computed": true }, { - "name": "ttl", - "type": "TypeInt", - "description": "TTL value", - "default_value": 60, + "name": "name", + "type": "TypeString", + "description": "name", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Description for the load balancer instance", "optional": true }, { - "name": "session_affinity", + "name": "steering_policy", "type": "TypeString", - "description": "Session affinity info", - "default_value": "none", + "description": "Steering policy info", "optional": true }, { - "name": "domain_id", + "name": "created_on", "type": "TypeString", - "description": "Associated CIS domain", - "required": true + "description": "Load balancer creation date", + "computed": true }, { "name": "default_pool_ids", @@ -90929,54 +94848,12 @@ "optional": true }, { - "name": "created_on", - "type": "TypeString", - "description": "Load balancer creation date", - "computed": true - }, - { - "name": "modified_on", - "type": "TypeString", - "description": "Load balancer modified date", - "computed": true - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "steering_policy", + "name": "session_affinity", "type": "TypeString", - "description": "Steering policy info", + "description": "Session affinity info", + "default_value": "none", "optional": true }, - { - "name": "pop_pools", - "type": "TypeSet", - "optional": true, - "elem": { - "pool_ids": { - "name": "pool_ids", - "type": "TypeList", - "required": true, - "elem": { - "type": "TypeString" - } - }, - "pop": { - "name": "pop", - "type": "TypeString", - "description": "pop pools region", - "required": true - } - } - }, { "name": "region_pools", "type": "TypeSet", @@ -90998,13 +94875,37 @@ } }, { - "name": "description", + "name": "domain_id", "type": "TypeString", - "description": "Description for the load balancer instance", - "optional": true + "description": "Associated CIS domain", + "required": true } ], "ibm_cis_healthcheck": [ + { + "name": "retries", + "type": "TypeInt", + "description": "retries", + "default_value": 2, + "min_value": "1", + "max_value": "3", + "optional": true + }, + { + "name": "modified_on", + "type": "TypeString", + "computed": true + }, + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, { "name": "path", "type": "TypeString", @@ -91013,27 +94914,16 @@ "optional": true }, { - "name": "description", + "name": "expected_body", "type": "TypeString", - "description": "description", - "default_value": " ", + "description": "expected_body", "optional": true }, { - "name": "type", + "name": "description", "type": "TypeString", - "description": "type", - "default_value": "http", - "options": "http, https, tcp", - "optional": true - }, - { - "name": "timeout", - "type": "TypeInt", - "description": "timeout", - "default_value": 5, - "min_value": "1", - "max_value": "10", + "description": "description", + "default_value": " ", "optional": true }, { @@ -91044,44 +94934,35 @@ "optional": true }, { - "name": "port", - "type": "TypeInt", - "description": "port number", - "min_value": "1", - "max_value": "65535", - "optional": true, - "computed": true - }, - { - "name": "cis_id", + "name": "monitor_id", "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "description": "GLB Monitor/Health check id", + "computed": true }, { - "name": "expected_body", - "type": "TypeString", - "description": "expected_body", + "name": "interval", + "type": "TypeInt", + "description": "interval", + "default_value": 60, + "min_value": "5", + "max_value": "3600", "optional": true }, { - "name": "expected_codes", - "type": "TypeString", - "description": "expected_codes", + "name": "allow_insecure", + "type": "TypeBool", + "description": "allow_insecure", + "default_value": false, "optional": true }, { - "name": "retries", + "name": "port", "type": "TypeInt", - "description": "retries", - "default_value": 2, + "description": "port number", "min_value": "1", - "max_value": "3", - "optional": true + "max_value": "65535", + "optional": true, + "computed": true }, { "name": "headers", @@ -91104,10 +94985,12 @@ } }, { - "name": "monitor_id", + "name": "type", "type": "TypeString", - "description": "GLB Monitor/Health check id", - "computed": true + "description": "type", + "default_value": "http", + "options": "http, https, tcp", + "optional": true }, { "name": "method", @@ -91118,19 +95001,12 @@ "optional": true }, { - "name": "interval", + "name": "timeout", "type": "TypeInt", - "description": "interval", - "default_value": 60, - "min_value": "5", - "max_value": "3600", - "optional": true - }, - { - "name": "allow_insecure", - "type": "TypeBool", - "description": "allow_insecure", - "default_value": false, + "description": "timeout", + "default_value": 5, + "min_value": "1", + "max_value": "10", "optional": true }, { @@ -91139,53 +95015,43 @@ "computed": true }, { - "name": "modified_on", + "name": "expected_codes", "type": "TypeString", - "computed": true + "description": "expected_codes", + "optional": true } ], "ibm_cis_logpush_job": [ { - "name": "cis_id", - "type": "TypeString", - "description": "CIS instance crn", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "Associated CIS domain", - "required": true - }, - { - "name": "logdna", + "name": "dataset", "type": "TypeString", - "description": "Information to identify the LogDNA instance the data will be pushed.", - "secure": true, + "description": "Dataset to be pulled", "required": true }, - { - "name": "logpull_options", - "type": "TypeString", - "description": "Configuration string", - "optional": true - }, { "name": "frequency", "type": "TypeString", "description": "The frequency at which CIS sends batches of logs to your destination", "optional": true }, + { + "name": "job_id", + "type": "TypeInt", + "description": "Associated CIS domain", + "computed": true + }, { "name": "destination_conf", "type": "TypeString", "description": "Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.", "computed": true }, + { + "name": "domain_id", + "type": "TypeString", + "description": "Associated CIS domain", + "required": true + }, { "name": "name", "type": "TypeString", @@ -91199,19 +95065,57 @@ "optional": true }, { - "name": "dataset", + "name": "cis_id", "type": "TypeString", - "description": "Dataset to be pulled", + "description": "CIS instance crn", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "logdna", + "type": "TypeString", + "description": "Information to identify the LogDNA instance the data will be pushed.", + "secure": true, "required": true }, { - "name": "job_id", - "type": "TypeInt", - "description": "Associated CIS domain", - "computed": true + "name": "logpull_options", + "type": "TypeString", + "description": "Configuration string", + "optional": true } ], "ibm_cis_mtls": [ + { + "name": "associated_hostnames", + "type": "TypeList", + "description": "Host name list to be associated", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Certificate Updated At", + "computed": true + }, + { + "name": "expires_on", + "type": "TypeString", + "description": "Certificate Expires on", + "computed": true + }, + { + "name": "id", + "type": "TypeString", + "description": "Certificate ID", + "computed": true + }, { "name": "cis_id", "type": "TypeString", @@ -91252,33 +95156,6 @@ "type": "TypeString", "description": "Certificate Created At", "computed": true - }, - { - "name": "expires_on", - "type": "TypeString", - "description": "Certificate Expires on", - "computed": true - }, - { - "name": "associated_hostnames", - "type": "TypeList", - "description": "Host name list to be associated", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Certificate Updated At", - "computed": true - }, - { - "name": "id", - "type": "TypeString", - "description": "Certificate ID", - "computed": true } ], "ibm_cis_mtls_app": [ @@ -91293,49 +95170,23 @@ ] }, { - "name": "domain", - "type": "TypeString", - "description": "Associated host domain value", - "required": true - }, - { - "name": "common_rule_val", - "type": "TypeString", - "description": "Policy common rule value", - "optional": true - }, - { - "name": "policy_id", + "name": "app_id", "type": "TypeString", - "description": "Policy ID", + "description": "APP ID", "computed": true }, { - "name": "domain_id", + "name": "domain", "type": "TypeString", - "description": "Associated CIS domain", + "description": "Associated host domain value", "required": true }, - { - "name": "policy_name", - "type": "TypeString", - "description": "Policy Name", - "default_value": "mtls-policy", - "optional": true - }, { "name": "name", "type": "TypeString", "description": "App Name", "required": true }, - { - "name": "session_duration", - "type": "TypeString", - "description": "Duration for app validatidity", - "default_value": "24h", - "optional": true - }, { "name": "policy_decision", "type": "TypeString", @@ -91350,15 +95201,9 @@ "computed": true }, { - "name": "app_updated_at", - "type": "TypeString", - "description": "Certificate Updated At", - "computed": true - }, - { - "name": "pol_updated_at", + "name": "policy_id", "type": "TypeString", - "description": "Policy updated At", + "description": "Policy ID", "computed": true }, { @@ -91368,6 +95213,12 @@ "default_value": "CA root certificate", "optional": true }, + { + "name": "app_updated_at", + "type": "TypeString", + "description": "Certificate Updated At", + "computed": true + }, { "name": "pol_created_at", "type": "TypeString", @@ -91375,31 +95226,43 @@ "computed": true }, { - "name": "app_id", + "name": "pol_updated_at", "type": "TypeString", - "description": "APP ID", + "description": "Policy updated At", "computed": true - } - ], - "ibm_cis_origin_auth": [ + }, { - "name": "certificate", + "name": "domain_id", "type": "TypeString", - "description": "Certificate content which needs to be uploaded", - "secure": true, + "description": "Associated CIS domain", "required": true }, { - "name": "private_key", + "name": "session_duration", "type": "TypeString", - "description": "Private key content which needs to be uploaded", - "secure": true, - "required": true + "description": "Duration for app validatidity", + "default_value": "24h", + "optional": true }, { - "name": "status", + "name": "policy_name", "type": "TypeString", - "description": "Authentication status whether active or not", + "description": "Policy Name", + "default_value": "mtls-policy", + "optional": true + }, + { + "name": "common_rule_val", + "type": "TypeString", + "description": "Policy common rule value", + "optional": true + } + ], + "ibm_cis_origin_auth": [ + { + "name": "uploaded_on", + "type": "TypeString", + "description": "Certificate uploaded on", "computed": true }, { @@ -91409,10 +95272,11 @@ "required": true }, { - "name": "level", - "type": "TypeString", - "description": "Origin auth level zone or hostname", - "required": true + "name": "enabled", + "type": "TypeBool", + "description": "Enabel-disable origin auth for a zone or host", + "default_value": true, + "optional": true }, { "name": "hostname", @@ -91421,34 +95285,35 @@ "optional": true }, { - "name": "enabled", - "type": "TypeBool", - "description": "Enabel-disable origin auth for a zone or host", - "default_value": true, - "optional": true + "name": "certificate", + "type": "TypeString", + "description": "Certificate content which needs to be uploaded", + "secure": true, + "required": true }, { - "name": "cert_id", + "name": "private_key", "type": "TypeString", - "description": "Certificate ID which is uploaded", - "computed": true + "description": "Private key content which needs to be uploaded", + "secure": true, + "required": true }, { - "name": "expires_on", + "name": "status", "type": "TypeString", - "description": "Certificate expires on", + "description": "Authentication status whether active or not", "computed": true }, { - "name": "uploaded_on", + "name": "cert_id", "type": "TypeString", - "description": "Certificate uploaded on", + "description": "Certificate ID which is uploaded", "computed": true }, { - "name": "auth_id", + "name": "expires_on", "type": "TypeString", - "description": "Associated CIS auth pull job id", + "description": "Certificate expires on", "computed": true }, { @@ -91460,9 +95325,39 @@ "cloud_data_range": [ "service:internet-svcs" ] + }, + { + "name": "level", + "type": "TypeString", + "description": "Origin auth level zone or hostname", + "required": true + }, + { + "name": "auth_id", + "type": "TypeString", + "description": "Associated CIS auth pull job id", + "computed": true } ], "ibm_cis_origin_pool": [ + { + "name": "pool_id", + "type": "TypeString", + "computed": true + }, + { + "name": "minimum_origins", + "type": "TypeInt", + "description": "Minimum number of Origins", + "default_value": 1, + "optional": true + }, + { + "name": "healthy", + "type": "TypeBool", + "description": "Health status", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -91476,21 +95371,15 @@ "optional": true }, { - "name": "health", - "type": "TypeString", - "description": "Health info", - "computed": true - }, - { - "name": "healthy", + "name": "enabled", "type": "TypeBool", - "description": "Health status", - "computed": true + "description": "Boolean value set to true if cis origin pool needs to be enabled", + "required": true }, { - "name": "created_on", + "name": "health", "type": "TypeString", - "description": "Creation date info", + "description": "Health info", "computed": true }, { @@ -91499,15 +95388,6 @@ "description": "Modified date info", "computed": true }, - { - "name": "check_regions", - "type": "TypeSet", - "description": "List of regions", - "required": true, - "elem": { - "type": "TypeString" - } - }, { "name": "monitor", "type": "TypeString", @@ -91559,17 +95439,10 @@ } }, { - "name": "notification_email", + "name": "created_on", "type": "TypeString", - "description": "Email address configured to recieve the notifications", - "optional": true - }, - { - "name": "minimum_origins", - "type": "TypeInt", - "description": "Minimum number of Origins", - "default_value": 1, - "optional": true + "description": "Creation date info", + "computed": true }, { "name": "cis_id", @@ -91582,15 +95455,19 @@ ] }, { - "name": "pool_id", - "type": "TypeString", - "computed": true + "name": "check_regions", + "type": "TypeSet", + "description": "List of regions", + "required": true, + "elem": { + "type": "TypeString" + } }, { - "name": "enabled", - "type": "TypeBool", - "description": "Boolean value set to true if cis origin pool needs to be enabled", - "required": true + "name": "notification_email", + "type": "TypeString", + "description": "Email address configured to recieve the notifications", + "optional": true } ], "ibm_cis_page_rule": [ @@ -91600,11 +95477,6 @@ "description": "Id of the ibm_cis_page_rule", "computed": true }, - { - "name": "rule_id", - "type": "TypeString", - "computed": true - }, { "name": "priority", "type": "TypeInt", @@ -91720,39 +95592,20 @@ "type": "TypeString", "description": "Associated CIS domain", "required": true - } - ], - "ibm_cis_range_app": [ - { - "name": "edge_ips_type", - "type": "TypeString", - "description": "The type of edge IP configuration.", - "default_value": "dynamic", - "options": "dynamic", - "optional": true }, { - "name": "cis_id", + "name": "rule_id", "type": "TypeString", - "description": "CIS Intance CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, + "computed": true + } + ], + "ibm_cis_range_app": [ { - "name": "dns", + "name": "protocol", "type": "TypeString", - "description": "Name of the DNS record for this application", + "description": "Defines the protocol and port for this application", "required": true }, - { - "name": "origin_dns", - "type": "TypeString", - "description": "DNS record pointing to the origin for this Range application.", - "optional": true - }, { "name": "origin_port", "type": "TypeInt", @@ -91760,17 +95613,21 @@ "optional": true }, { - "name": "proxy_protocol", + "name": "traffic_type", "type": "TypeString", - "description": "Allows for the true client IP to be passed to the service.", - "options": "off, v1, v2, simple", + "description": "Configure how traffic is handled at the edge.", + "default_value": "direct", + "options": "direct, http, https", "optional": true }, { - "name": "ip_firewall", - "type": "TypeBool", - "description": "Enables the IP Firewall for this application. Only available for TCP applications.", - "optional": true + "name": "origin_direct", + "type": "TypeList", + "description": "IP address and port of the origin for this Range application.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { "name": "edge_ips_connectivity", @@ -91787,10 +95644,14 @@ "computed": true }, { - "name": "modified_on", + "name": "cis_id", "type": "TypeString", - "description": "modified on date", - "computed": true + "description": "CIS Intance CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] }, { "name": "app_id", @@ -91799,25 +95660,30 @@ "computed": true }, { - "name": "protocol", + "name": "dns", "type": "TypeString", - "description": "Defines the protocol and port for this application", + "description": "Name of the DNS record for this application", "required": true }, { - "name": "dns_type", + "name": "modified_on", "type": "TypeString", - "description": "Type of the DNS record for this application", + "description": "modified on date", + "computed": true + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "CIS Domain ID", "required": true }, { - "name": "origin_direct", - "type": "TypeList", - "description": "IP address and port of the origin for this Range application.", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "edge_ips_type", + "type": "TypeString", + "description": "The type of edge IP configuration.", + "default_value": "dynamic", + "options": "dynamic", + "optional": true }, { "name": "tls", @@ -91828,21 +95694,63 @@ "optional": true }, { - "name": "domain_id", + "name": "proxy_protocol", "type": "TypeString", - "description": "CIS Domain ID", + "description": "Allows for the true client IP to be passed to the service.", + "options": "off, v1, v2, simple", + "optional": true + }, + { + "name": "dns_type", + "type": "TypeString", + "description": "Type of the DNS record for this application", "required": true }, { - "name": "traffic_type", + "name": "origin_dns", "type": "TypeString", - "description": "Configure how traffic is handled at the edge.", - "default_value": "direct", - "options": "direct, http, https", + "description": "DNS record pointing to the origin for this Range application.", + "optional": true + }, + { + "name": "ip_firewall", + "type": "TypeBool", + "description": "Enables the IP Firewall for this application. Only available for TCP applications.", "optional": true } ], "ibm_cis_rate_limit": [ + { + "name": "cis_id", + "type": "TypeString", + "description": "CIS Intance CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "bypass", + "type": "TypeList", + "description": "Bypass URL", + "optional": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "bypass URL name", + "default_value": "url", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "bypass URL value", + "optional": true + } + } + }, { "name": "period", "type": "TypeInt", @@ -91851,6 +95759,40 @@ "min_value": "1", "max_value": "86400" }, + { + "name": "rule_id", + "type": "TypeString", + "description": "Rate Limit rule Id", + "computed": true + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "CIS Domain ID", + "required": true + }, + { + "name": "disabled", + "type": "TypeBool", + "description": "Whether this rate limiting rule is currently disabled.", + "default_value": false, + "optional": true + }, + { + "name": "description", + "type": "TypeString", + "description": "A note that you can use to describe the reason for a rate limiting rule.", + "max_length": 1024, + "optional": true + }, + { + "name": "threshold", + "type": "TypeInt", + "description": "Rate Limiting Threshold", + "required": true, + "min_value": "1", + "max_value": "1000000" + }, { "name": "correlate", "type": "TypeList", @@ -92007,71 +95949,6 @@ } }, "max_items": 1 - }, - { - "name": "domain_id", - "type": "TypeString", - "description": "CIS Domain ID", - "required": true - }, - { - "name": "disabled", - "type": "TypeBool", - "description": "Whether this rate limiting rule is currently disabled.", - "default_value": false, - "optional": true - }, - { - "name": "description", - "type": "TypeString", - "description": "A note that you can use to describe the reason for a rate limiting rule.", - "max_length": 1024, - "optional": true - }, - { - "name": "threshold", - "type": "TypeInt", - "description": "Rate Limiting Threshold", - "required": true, - "min_value": "1", - "max_value": "1000000" - }, - { - "name": "rule_id", - "type": "TypeString", - "description": "Rate Limit rule Id", - "computed": true - }, - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS Intance CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] - }, - { - "name": "bypass", - "type": "TypeList", - "description": "Bypass URL", - "optional": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "bypass URL name", - "default_value": "url", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "bypass URL value", - "optional": true - } - } } ], "ibm_cis_routing": [ @@ -92101,22 +95978,6 @@ } ], "ibm_cis_tls_settings": [ - { - "name": "tls_1_3", - "type": "TypeString", - "description": "TLS 1.3 setting", - "options": "on, off, zrt", - "optional": true, - "computed": true - }, - { - "name": "min_tls_version", - "type": "TypeString", - "description": "Minimum version of TLS required", - "default_value": "1.1", - "options": "1.1, 1.2, 1.3, 1.4", - "optional": true - }, { "name": "cis_id", "type": "TypeString", @@ -92139,38 +96000,37 @@ "description": "Universal SSL setting", "optional": true, "computed": true - } - ], - "ibm_cis_waf_group": [ - { - "name": "cis_id", - "type": "TypeString", - "description": "CIS Intance CRN", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] }, { - "name": "package_id", + "name": "tls_1_3", "type": "TypeString", - "description": "WAF Rule package id", - "required": true + "description": "TLS 1.3 setting", + "options": "on, off, zrt", + "optional": true, + "computed": true }, { - "name": "group_id", + "name": "min_tls_version", "type": "TypeString", - "description": "WAF Rule group id", - "immutable": true, - "required": true - }, + "description": "Minimum version of TLS required", + "default_value": "1.1", + "options": "1.1, 1.2, 1.3, 1.4", + "optional": true + } + ], + "ibm_cis_waf_group": [ { "name": "description", "type": "TypeString", "description": "WAF Rule group description", "computed": true }, + { + "name": "rules_count", + "type": "TypeInt", + "description": "WAF Rule group rules count", + "computed": true + }, { "name": "check_mode", "type": "TypeBool", @@ -92179,9 +96039,10 @@ "optional": true }, { - "name": "domain_id", + "name": "group_id", "type": "TypeString", - "description": "CIS Domain ID", + "description": "WAF Rule group id", + "immutable": true, "required": true }, { @@ -92197,33 +96058,36 @@ "description": "WAF Rule group name", "computed": true }, - { - "name": "rules_count", - "type": "TypeInt", - "description": "WAF Rule group rules count", - "computed": true - }, { "name": "modified_rules_count", "type": "TypeInt", "description": "WAF Rule group modified rules count", "computed": true - } - ], - "ibm_cis_waf_package": [ + }, { - "name": "action_mode", + "name": "cis_id", "type": "TypeString", - "description": "WAF pakcage action mode", + "description": "CIS Intance CRN", + "cloud_data_type": "resource_instance", "required": true, - "options": "simulate, block, challenge" + "cloud_data_range": [ + "service:internet-svcs" + ] }, { - "name": "description", + "name": "domain_id", "type": "TypeString", - "description": "WAF package description", - "computed": true + "description": "CIS Domain ID", + "required": true }, + { + "name": "package_id", + "type": "TypeString", + "description": "WAF Rule package id", + "required": true + } + ], + "ibm_cis_waf_package": [ { "name": "cis_id", "type": "TypeString", @@ -92265,23 +96129,27 @@ "description": "WAF pakcage sensitivity", "required": true, "options": "high, medium, low, off" - } - ], - "ibm_cis_waf_rule": [ + }, { - "name": "cis_id", + "name": "action_mode", "type": "TypeString", - "description": "CIS Intance CRN", - "cloud_data_type": "resource_instance", + "description": "WAF pakcage action mode", "required": true, - "cloud_data_range": [ - "service:internet-svcs" - ] + "options": "simulate, block, challenge" }, { - "name": "domain_id", + "name": "description", "type": "TypeString", - "description": "CIS Domain ID", + "description": "WAF package description", + "computed": true + } + ], + "ibm_cis_waf_rule": [ + { + "name": "package_id", + "type": "TypeString", + "description": "CIS WAF Rule package id", + "immutable": true, "required": true }, { @@ -92297,6 +96165,26 @@ "description": "CIS WAF Rule descriptions", "computed": true }, + { + "name": "group", + "type": "TypeList", + "description": "CIS WAF Rule group", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "waf rule group id", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "waf rule group name", + "computed": true + } + } + }, { "name": "allowed_modes", "type": "TypeString", @@ -92307,16 +96195,25 @@ } }, { - "name": "rule_id", + "name": "cis_id", "type": "TypeString", - "description": "CIS WAF Rule id", - "immutable": true, + "description": "CIS Intance CRN", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:internet-svcs" + ] + }, + { + "name": "domain_id", + "type": "TypeString", + "description": "CIS Domain ID", "required": true }, { - "name": "package_id", + "name": "rule_id", "type": "TypeString", - "description": "CIS WAF Rule package id", + "description": "CIS WAF Rule id", "immutable": true, "required": true }, @@ -92325,42 +96222,9 @@ "type": "TypeInt", "description": "CIS WAF Rule Priority", "computed": true - }, - { - "name": "group", - "type": "TypeList", - "description": "CIS WAF Rule group", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "waf rule group id", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "waf rule group name", - "computed": true - } - } } ], "ibm_cis_webhook": [ - { - "name": "type", - "type": "TypeString", - "description": "Webhook Type", - "computed": true - }, - { - "name": "secret", - "type": "TypeString", - "description": "API key needed to use the webhook", - "secure": true, - "optional": true - }, { "name": "cis_id", "type": "TypeString", @@ -92388,38 +96252,26 @@ "type": "TypeString", "description": "Webhook URL", "optional": true - } - ], - "ibm_cloud_shell_account_settings": [ - { - "name": "rev", - "type": "TypeString", - "description": "Unique revision number for the settings object.", - "optional": true, - "computed": true }, { - "name": "created_at", - "type": "TypeInt", - "description": "Creation timestamp in Unix epoch time.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeInt", - "description": "Timestamp of last update in Unix epoch time.", + "name": "type", + "type": "TypeString", + "description": "Webhook Type", "computed": true }, { - "name": "created_by", + "name": "secret", "type": "TypeString", - "description": "IAM ID of creator.", - "computed": true - }, + "description": "API key needed to use the webhook", + "secure": true, + "optional": true + } + ], + "ibm_cloud_shell_account_settings": [ { - "name": "type", + "name": "updated_by", "type": "TypeString", - "description": "Type of api response object.", + "description": "IAM ID of last updater.", "computed": true }, { @@ -92429,12 +96281,6 @@ "immutable": true, "required": true }, - { - "name": "default_enable_new_features", - "type": "TypeBool", - "description": "You can choose which Cloud Shell features are available in the account and whether any new features are enabled as they become available. The feature settings apply only to the enabled Cloud Shell locations.", - "optional": true - }, { "name": "default_enable_new_regions", "type": "TypeBool", @@ -92442,114 +96288,92 @@ "optional": true }, { - "name": "enabled", - "type": "TypeBool", - "description": "When enabled, Cloud Shell is available to all users in the account.", - "optional": true - }, - { - "name": "features", + "name": "regions", "type": "TypeList", - "description": "List of Cloud Shell features.", + "description": "List of Cloud Shell region settings.", "optional": true, "computed": true, "elem": { "enabled": { "name": "enabled", "type": "TypeBool", - "description": "State of the feature.", + "description": "State of the region.", "optional": true }, "key": { "name": "key", "type": "TypeString", - "description": "Name of the feature.", + "description": "Name of the region.", "optional": true } } }, { - "name": "regions", + "name": "features", "type": "TypeList", - "description": "List of Cloud Shell region settings.", + "description": "List of Cloud Shell features.", "optional": true, "computed": true, "elem": { "enabled": { "name": "enabled", "type": "TypeBool", - "description": "State of the region.", + "description": "State of the feature.", "optional": true }, "key": { "name": "key", "type": "TypeString", - "description": "Name of the region.", + "description": "Name of the feature.", "optional": true } } }, { - "name": "updated_by", - "type": "TypeString", - "description": "IAM ID of last updater.", - "computed": true - } - ], - "ibm_cloudant": [ - { - "name": "resource_plan_id", - "type": "TypeString", - "description": "The unique ID of the plan associated with the offering", + "name": "created_at", + "type": "TypeInt", + "description": "Creation timestamp in Unix epoch time.", "computed": true }, { - "name": "environment_crn", + "name": "created_by", "type": "TypeString", - "description": "CRN of the IBM Cloudant Dedicated Hardware plan instance", - "immutable": true, - "optional": true + "description": "IAM ID of creator.", + "computed": true }, { - "name": "account_id", + "name": "type", "type": "TypeString", - "description": "An alpha-numeric value identifying the account ID.", + "description": "Type of api response object.", "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when the instance was created.", + "name": "updated_at", + "type": "TypeInt", + "description": "Timestamp of last update in Unix epoch time.", "computed": true }, { - "name": "created_by", + "name": "rev", "type": "TypeString", - "description": "The subject who created the instance.", + "description": "Unique revision number for the settings object.", + "optional": true, "computed": true }, { - "name": "throughput", - "type": "TypeMap", - "description": "Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.", - "computed": true, - "elem": { - "type": "TypeInt" - } - }, - { - "name": "enable_cors", + "name": "default_enable_new_features", "type": "TypeBool", - "description": "Boolean value to turn CORS on and off.", - "default_value": true, + "description": "You can choose which Cloud Shell features are available in the account and whether any new features are enabled as they become available. The feature settings apply only to the enabled Cloud Shell locations.", "optional": true }, { - "name": "name", - "type": "TypeString", - "description": "A name for the resource instance", - "required": true - }, + "name": "enabled", + "type": "TypeBool", + "description": "When enabled, Cloud Shell is available to all users in the account.", + "optional": true + } + ], + "ibm_cloudant": [ { "name": "plan", "type": "TypeString", @@ -92557,57 +96381,68 @@ "required": true }, { - "name": "location", - "type": "TypeString", - "description": "The location where the instance available", - "cloud_data_type": "region", - "immutable": true, - "required": true + "name": "allow_cleanup", + "type": "TypeBool", + "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + "computed": true }, { - "name": "parameters", - "type": "TypeMap", - "description": "Arbitrary parameters to pass. Must be a JSON object", - "optional": true + "name": "locked", + "type": "TypeBool", + "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + "computed": true }, { - "name": "resource_aliases_url", + "name": "update_at", "type": "TypeString", - "description": "The relative path to the resource aliases for the instance.", + "description": "The date when the instance was last updated.", "computed": true }, { - "name": "resource_keys_url", + "name": "update_by", "type": "TypeString", - "description": "The relative path to the resource keys for the instance.", + "description": "The subject who updated the instance.", "computed": true }, { - "name": "update_at", - "type": "TypeString", - "description": "The date when the instance was last updated.", + "name": "extensions", + "type": "TypeMap", + "description": "The extended metadata as a map associated with the resource instance.", "computed": true }, { - "name": "resource_name", + "name": "throughput", + "type": "TypeMap", + "description": "Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes.", + "computed": true, + "elem": { + "type": "TypeInt" + } + }, + { + "name": "dashboard_url", "type": "TypeString", - "description": "The name of the resource", + "description": "Dashboard URL to access resource.", "computed": true }, { - "name": "capacity", - "type": "TypeInt", - "description": "A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.", - "default_value": 1, - "optional": true + "name": "scheduled_reclaim_at", + "type": "TypeString", + "description": "The date when the instance was scheduled for reclamation.", + "computed": true }, { - "name": "resource_group_id", + "name": "location", "type": "TypeString", - "description": "The resource group id", - "cloud_data_type": "resource_group", + "description": "The location where the instance available", + "cloud_data_type": "region", "immutable": true, - "optional": true, + "required": true + }, + { + "name": "guid", + "type": "TypeString", + "description": "Guid of resource instance", "computed": true }, { @@ -92629,21 +96464,15 @@ } }, { - "name": "allow_cleanup", - "type": "TypeBool", - "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", - "computed": true - }, - { - "name": "update_by", + "name": "resource_id", "type": "TypeString", - "description": "The subject who updated the instance.", + "description": "The unique ID of the offering", "computed": true }, { - "name": "restored_by", + "name": "resource_keys_url", "type": "TypeString", - "description": "The subject who restored the instance back from reclamation.", + "description": "The relative path to the resource keys for the instance.", "computed": true }, { @@ -92653,29 +96482,41 @@ "computed": true }, { - "name": "resource_group_name", + "name": "environment_crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "CRN of the IBM Cloudant Dedicated Hardware plan instance", + "immutable": true, + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "A name for the resource instance", + "required": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status of resource instance", "computed": true }, { - "name": "dashboard_url", + "name": "created_by", "type": "TypeString", - "description": "Dashboard URL to access resource.", + "description": "The subject who created the instance.", "computed": true }, { - "name": "scheduled_reclaim_at", + "name": "resource_status", "type": "TypeString", - "description": "The date when the instance was scheduled for reclamation.", + "description": "The status of the resource", "computed": true }, { - "name": "legacy_credentials", - "type": "TypeBool", - "description": "Use both legacy credentials and IAM for authentication", - "default_value": false, - "immutable": true, + "name": "capacity", + "type": "TypeInt", + "description": "A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity.", + "default_value": 1, "optional": true }, { @@ -92685,70 +96526,109 @@ "computed": true }, { - "name": "service_endpoints", + "name": "target_crn", "type": "TypeString", - "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", - "optional": true, + "description": "The full deployment CRN as defined in the global catalog", "computed": true }, { - "name": "sub_type", + "name": "type", "type": "TypeString", - "description": "The sub-type of instance, e.g. cfaas .", + "description": "The type of the instance, e.g. service_instance.", "computed": true }, { - "name": "deleted_at", - "type": "TypeString", - "description": "The date when the instance was deleted.", + "name": "last_operation", + "type": "TypeMap", + "description": "The status of the last operation requested on the instance", "computed": true }, { - "name": "scheduled_reclaim_by", + "name": "created_at", "type": "TypeString", - "description": "The subject who initiated the instance reclamation.", + "description": "The date when the instance was created.", "computed": true }, { - "name": "resource_status", + "name": "deleted_at", "type": "TypeString", - "description": "The status of the resource", + "description": "The date when the instance was deleted.", "computed": true }, { - "name": "extensions", - "type": "TypeMap", - "description": "The extended metadata as a map associated with the resource instance.", - "computed": true + "name": "legacy_credentials", + "type": "TypeBool", + "description": "Use both legacy credentials and IAM for authentication", + "default_value": false, + "immutable": true, + "optional": true }, { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", + "name": "include_data_events", + "type": "TypeBool", + "description": "Include data event types in events sent to IBM Cloud Activity Tracker with LogDNA for the IBM Cloudant instance. By default only emitted events are of \"management\" type.", + "default_value": false, + "optional": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "The resource group id", + "cloud_data_type": "resource_group", + "immutable": true, "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "status", + "name": "resource_aliases_url", "type": "TypeString", - "description": "Status of resource instance", + "description": "The relative path to the resource aliases for the instance.", "computed": true }, { - "name": "resource_id", + "name": "deleted_by", "type": "TypeString", - "description": "The unique ID of the offering", + "description": "The subject who deleted the instance.", "computed": true }, { - "name": "resource_bindings_url", + "name": "restored_by", "type": "TypeString", - "description": "The relative path to the resource bindings for the instance.", + "description": "The subject who restored the instance back from reclamation.", + "computed": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", "computed": true }, + { + "name": "cors_config", + "type": "TypeList", + "description": "Configuration for CORS.", + "optional": true, + "elem": { + "allow_credentials": { + "name": "allow_credentials", + "type": "TypeBool", + "description": "Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.", + "default_value": true, + "optional": true + }, + "origins": { + "name": "origins", + "type": "TypeList", + "description": "An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.", + "required": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1, + "min_items": 1 + }, { "name": "parameters_json", "type": "TypeString", @@ -92763,9 +96643,10 @@ "computed": true }, { - "name": "guid", + "name": "service_endpoints", "type": "TypeString", - "description": "Guid of resource instance", + "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", + "optional": true, "computed": true }, { @@ -92775,103 +96656,84 @@ "computed": true }, { - "name": "target_crn", + "name": "state", "type": "TypeString", - "description": "The full deployment CRN as defined in the global catalog", + "description": "The current state of the instance.", "computed": true }, { - "name": "state", + "name": "sub_type", "type": "TypeString", - "description": "The current state of the instance.", + "description": "The sub-type of instance, e.g. cfaas .", "computed": true }, { - "name": "type", + "name": "resource_bindings_url", "type": "TypeString", - "description": "The type of the instance, e.g. service_instance.", + "description": "The relative path to the resource bindings for the instance.", "computed": true }, { - "name": "locked", - "type": "TypeBool", - "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + "name": "restored_at", + "type": "TypeString", + "description": "The date when the instance under reclamation was restored.", "computed": true }, { - "name": "last_operation", + "name": "enable_cors", + "type": "TypeBool", + "description": "Boolean value to turn CORS on and off.", + "default_value": true, + "optional": true + }, + { + "name": "parameters", "type": "TypeMap", - "description": "The status of the last operation requested on the instance", - "computed": true + "description": "Arbitrary parameters to pass. Must be a JSON object", + "optional": true }, { - "name": "deleted_by", + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "account_id", "type": "TypeString", - "description": "The subject who deleted the instance.", + "description": "An alpha-numeric value identifying the account ID.", "computed": true }, { - "name": "restored_at", + "name": "resource_plan_id", "type": "TypeString", - "description": "The date when the instance under reclamation was restored.", + "description": "The unique ID of the plan associated with the offering", "computed": true }, { - "name": "resource_controller_url", + "name": "scheduled_reclaim_by", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The subject who initiated the instance reclamation.", "computed": true }, { - "name": "include_data_events", - "type": "TypeBool", - "description": "Include data event types in events sent to IBM Cloud Activity Tracker with LogDNA for the IBM Cloudant instance. By default only emitted events are of \"management\" type.", - "default_value": false, - "optional": true + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true }, { - "name": "cors_config", - "type": "TypeList", - "description": "Configuration for CORS.", - "optional": true, - "elem": { - "allow_credentials": { - "name": "allow_credentials", - "type": "TypeBool", - "description": "Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.", - "default_value": true, - "optional": true - }, - "origins": { - "name": "origins", - "type": "TypeList", - "description": "An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.", - "required": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1, - "min_items": 1 + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "computed": true } ], "ibm_cloudant_database": [ - { - "name": "db", - "type": "TypeString", - "description": "Path parameter to specify the database name.", - "immutable": true, - "required": true - }, - { - "name": "partitioned", - "type": "TypeBool", - "description": "Query parameter to specify whether to enable database partitions when creating a database.", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "shards", "type": "TypeInt", @@ -92886,98 +96748,24 @@ "description": "Cloudant Instance CRN.", "immutable": true, "required": true - } - ], - "ibm_cm_catalog": [ - { - "name": "catalog_filters", - "type": "TypeList", - "description": "Filters for account and catalog filters.", - "computed": true, - "elem": { - "category_filters": { - "name": "category_filters", - "type": "TypeMap", - "description": "Filter against offering properties.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "id_filters": { - "name": "id_filters", - "type": "TypeList", - "description": "Filter on offering ID's. There is an include filter and an exclule filter. Both can be set.", - "optional": true, - "elem": { - "exclude": { - "name": "exclude", - "type": "TypeList", - "description": "Offering filter terms.", - "optional": true, - "elem": { - "filter_terms": { - "name": "filter_terms", - "type": "TypeList", - "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", - "optional": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1 - }, - "include": { - "name": "include", - "type": "TypeList", - "description": "Offering filter terms.", - "optional": true, - "elem": { - "filter_terms": { - "name": "filter_terms", - "type": "TypeList", - "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", - "optional": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1 - } - }, - "max_items": 1 - }, - "include_all": { - "name": "include_all", - "type": "TypeBool", - "description": "-\u003e true - Include all of the public catalog when filtering. Further settings will specifically exclude some offerings. false - Exclude all of the public catalog when filtering. Further settings will specifically include some offerings.", - "optional": true - } - } - }, - { - "name": "metadata", - "type": "TypeMap", - "description": "Catalog specific metadata.", - "optional": true, - "elem": { - "type": "TypeString" - } }, { - "name": "rev", + "name": "db", "type": "TypeString", - "description": "Cloudant revision.", - "computed": true + "description": "Path parameter to specify the database name.", + "immutable": true, + "required": true }, { - "name": "short_description", - "type": "TypeString", - "description": "Description in the requested language.", - "optional": true - }, + "name": "partitioned", + "type": "TypeBool", + "description": "Query parameter to specify whether to enable database partitions when creating a database.", + "immutable": true, + "optional": true, + "computed": true + } + ], + "ibm_cm_catalog": [ { "name": "short_description_i18n", "type": "TypeMap", @@ -92988,38 +96776,29 @@ } }, { - "name": "catalog_banner_url", + "name": "catalog_icon_url", "type": "TypeString", - "description": "URL for a banner image for this catalog.", + "description": "URL for an icon associated with this catalog.", "optional": true }, { - "name": "tags", - "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "url", + "name": "crn", "type": "TypeString", - "description": "The url for this specific catalog.", + "description": "CRN associated with the catalog.", + "cloud_data_type": "crn", "computed": true }, { - "name": "created", + "name": "offerings_url", "type": "TypeString", - "description": "The date-time this catalog was created.", + "description": "URL path to offerings.", "computed": true }, { - "name": "label", + "name": "updated", "type": "TypeString", - "description": "Display Name in the requested language.", - "optional": true + "description": "The date-time this catalog was last updated.", + "computed": true }, { "name": "label_i18n", @@ -93031,76 +96810,186 @@ } }, { - "name": "features", + "name": "tags", "type": "TypeList", - "description": "List of features associated with this catalog.", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", "optional": true, "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Feature description.", - "optional": true + "type": "TypeString" + } + }, + { + "name": "owning_account", + "type": "TypeString", + "description": "Account that owns catalog.", + "computed": true + }, + { + "name": "syndication_settings", + "type": "TypeList", + "description": "Feature information.", + "computed": true, + "elem": { + "authorization": { + "name": "authorization", + "type": "TypeList", + "description": "Feature information.", + "optional": true, + "elem": { + "last_run": { + "name": "last_run", + "type": "TypeString", + "description": "Date and time last updated.", + "optional": true + }, + "token": { + "name": "token", + "type": "TypeString", + "description": "Array of syndicated namespaces.", + "optional": true + } + }, + "max_items": 1 }, - "description_i18n": { - "name": "description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "clusters": { + "name": "clusters", + "type": "TypeList", + "description": "Syndication clusters.", "optional": true, "elem": { - "type": "TypeString" + "all_namespaces": { + "name": "all_namespaces", + "type": "TypeBool", + "description": "Syndicated to all namespaces on cluster.", + "optional": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "Cluster ID.", + "optional": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Cluster name.", + "optional": true + }, + "namespaces": { + "name": "namespaces", + "type": "TypeList", + "description": "Syndicated namespaces.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Cluster region.", + "optional": true + }, + "resource_group_name": { + "name": "resource_group_name", + "type": "TypeString", + "description": "Resource group ID.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Syndication type.", + "optional": true + } } }, - "title": { - "name": "title", - "type": "TypeString", - "description": "Heading.", - "optional": true - }, - "title_i18n": { - "name": "title_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "history": { + "name": "history", + "type": "TypeList", + "description": "Feature information.", "optional": true, "elem": { - "type": "TypeString" - } + "clusters": { + "name": "clusters", + "type": "TypeList", + "description": "Array of syndicated namespaces.", + "optional": true, + "elem": { + "all_namespaces": { + "name": "all_namespaces", + "type": "TypeBool", + "description": "Syndicated to all namespaces on cluster.", + "optional": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "Cluster ID.", + "optional": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Cluster name.", + "optional": true + }, + "namespaces": { + "name": "namespaces", + "type": "TypeList", + "description": "Syndicated namespaces.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Cluster region.", + "optional": true + }, + "resource_group_name": { + "name": "resource_group_name", + "type": "TypeString", + "description": "Resource group ID.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Syndication type.", + "optional": true + } + } + }, + "last_run": { + "name": "last_run", + "type": "TypeString", + "description": "Date and time last syndicated.", + "optional": true + }, + "namespaces": { + "name": "namespaces", + "type": "TypeList", + "description": "Array of syndicated namespaces.", + "optional": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 + }, + "remove_related_components": { + "name": "remove_related_components", + "type": "TypeBool", + "description": "Remove related components.", + "optional": true } } }, - { - "name": "kind", - "type": "TypeString", - "description": "Kind of catalog. Supported kinds are offering and vpe.", - "optional": true - }, - { - "name": "disabled", - "type": "TypeBool", - "description": "Denotes whether a catalog is disabled.", - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "Resource group id the catalog is owned by.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "offerings_url", - "type": "TypeString", - "description": "URL path to offerings.", - "computed": true - }, - { - "name": "updated", - "type": "TypeString", - "description": "The date-time this catalog was last updated.", - "computed": true - }, { "name": "target_account_contexts", "type": "TypeList", @@ -93169,217 +97058,185 @@ } }, { - "name": "catalog_icon_url", + "name": "rev", "type": "TypeString", - "description": "URL for an icon associated with this catalog.", + "description": "Cloudant revision.", + "computed": true + }, + { + "name": "short_description", + "type": "TypeString", + "description": "Description in the requested language.", "optional": true }, { - "name": "owning_account", + "name": "catalog_banner_url", "type": "TypeString", - "description": "Account that owns catalog.", - "computed": true + "description": "URL for a banner image for this catalog.", + "optional": true }, { - "name": "syndication_settings", + "name": "features", "type": "TypeList", - "description": "Feature information.", - "computed": true, + "description": "List of features associated with this catalog.", + "optional": true, "elem": { - "authorization": { - "name": "authorization", - "type": "TypeList", - "description": "Feature information.", + "description": { + "name": "description", + "type": "TypeString", + "description": "Feature description.", + "optional": true + }, + "description_i18n": { + "name": "description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "optional": true, "elem": { - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last updated.", - "optional": true - }, - "token": { - "name": "token", - "type": "TypeString", - "description": "Array of syndicated namespaces.", - "optional": true - } - }, - "max_items": 1 + "type": "TypeString" + } }, - "clusters": { - "name": "clusters", - "type": "TypeList", - "description": "Syndication clusters.", + "title": { + "name": "title", + "type": "TypeString", + "description": "Heading.", + "optional": true + }, + "title_i18n": { + "name": "title_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "elem": { + "type": "TypeString" + } + } + } + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "Resource group id the catalog is owned by.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "catalog_filters", + "type": "TypeList", + "description": "Filters for account and catalog filters.", + "computed": true, + "elem": { + "category_filters": { + "name": "category_filters", + "type": "TypeMap", + "description": "Filter against offering properties.", "optional": true, "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "optional": true - }, - "namespaces": { - "name": "namespaces", - "type": "TypeList", - "description": "Syndicated namespaces.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "optional": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "optional": true - } + "type": "TypeString" } }, - "history": { - "name": "history", + "id_filters": { + "name": "id_filters", "type": "TypeList", - "description": "Feature information.", + "description": "Filter on offering ID's. There is an include filter and an exclule filter. Both can be set.", "optional": true, "elem": { - "clusters": { - "name": "clusters", + "exclude": { + "name": "exclude", "type": "TypeList", - "description": "Array of syndicated namespaces.", + "description": "Offering filter terms.", "optional": true, "elem": { - "all_namespaces": { - "name": "all_namespaces", - "type": "TypeBool", - "description": "Syndicated to all namespaces on cluster.", - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "Cluster ID.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Cluster name.", - "optional": true - }, - "namespaces": { - "name": "namespaces", + "filter_terms": { + "name": "filter_terms", "type": "TypeList", - "description": "Syndicated namespaces.", + "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", "optional": true, "elem": { "type": "TypeString" } - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Cluster region.", - "optional": true - }, - "resource_group_name": { - "name": "resource_group_name", - "type": "TypeString", - "description": "Resource group ID.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Syndication type.", - "optional": true } - } - }, - "last_run": { - "name": "last_run", - "type": "TypeString", - "description": "Date and time last syndicated.", - "optional": true + }, + "max_items": 1 }, - "namespaces": { - "name": "namespaces", + "include": { + "name": "include", "type": "TypeList", - "description": "Array of syndicated namespaces.", + "description": "Offering filter terms.", "optional": true, "elem": { - "type": "TypeString" - } + "filter_terms": { + "name": "filter_terms", + "type": "TypeList", + "description": "List of values to match against. If include is true, then if the offering has one of the values then the offering is included. If include is false, then if the offering has one of the values then the offering is excluded.", + "optional": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 } }, "max_items": 1 }, - "remove_related_components": { - "name": "remove_related_components", + "include_all": { + "name": "include_all", "type": "TypeBool", - "description": "Remove related components.", + "description": "-\u003e true - Include all of the public catalog when filtering. Further settings will specifically exclude some offerings. false - Exclude all of the public catalog when filtering. Further settings will specifically include some offerings.", "optional": true } } }, { - "name": "crn", + "name": "kind", "type": "TypeString", - "description": "CRN associated with the catalog.", - "cloud_data_type": "crn", - "computed": true - } - ], - "ibm_cm_object": [ + "description": "Kind of catalog. Supported kinds are offering and vpe.", + "optional": true + }, { - "name": "short_description_i18n", + "name": "metadata", "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "description": "Catalog specific metadata.", "optional": true, "elem": { "type": "TypeString" } }, { - "name": "kind", + "name": "url", "type": "TypeString", - "description": "Kind of object. Options are \"vpe\", \"preset_configuration\", or \"proxy_source\".", - "required": true + "description": "The url for this specific catalog.", + "computed": true }, { - "name": "parent_id", + "name": "created", "type": "TypeString", - "description": "The parent for this specific object.", + "description": "The date-time this catalog was created.", + "computed": true + }, + { + "name": "label", + "type": "TypeString", + "description": "Display Name in the requested language.", "optional": true }, { - "name": "updated", + "name": "disabled", + "type": "TypeBool", + "description": "Denotes whether a catalog is disabled.", + "optional": true + } + ], + "ibm_cm_object": [ + { + "name": "catalog_id", "type": "TypeString", - "description": "The date and time this catalog was last updated.", - "computed": true + "description": "Catalog identifier.", + "immutable": true, + "required": true }, { "name": "publish", @@ -93419,34 +97276,6 @@ } } }, - { - "name": "catalog_name", - "type": "TypeString", - "description": "The name of the catalog.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The programmatic name of this object.", - "required": true - }, - { - "name": "label", - "type": "TypeString", - "description": "Display name in the requested language.", - "optional": true - }, - { - "name": "tags", - "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "state", "type": "TypeList", @@ -93486,23 +97315,32 @@ } }, { - "name": "object_id", + "name": "catalog_name", "type": "TypeString", - "description": "The ID of the object.", + "description": "The name of the catalog.", "computed": true }, { - "name": "crn", + "name": "kind", "type": "TypeString", - "description": "The crn for this specific object.", - "cloud_data_type": "crn", - "computed": true + "description": "Kind of object. Options are \"vpe\", \"preset_configuration\", or \"proxy_source\".", + "required": true }, { - "name": "url", + "name": "parent_id", "type": "TypeString", - "description": "The url for this specific object.", - "computed": true + "description": "The parent for this specific object.", + "optional": true + }, + { + "name": "tags", + "type": "TypeList", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } }, { "name": "created", @@ -93517,24 +97355,44 @@ "optional": true }, { - "name": "data", - "type": "TypeString", - "description": "Stringified map of data values for this object.", + "name": "short_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "The programmatic name of this object.", + "required": true + }, + { + "name": "updated", + "type": "TypeString", + "description": "The date and time this catalog was last updated.", "computed": true }, { - "name": "rev", + "name": "object_id", "type": "TypeString", - "description": "Cloudant revision.", + "description": "The ID of the object.", "computed": true }, { - "name": "catalog_id", + "name": "crn", "type": "TypeString", - "description": "Catalog identifier.", - "immutable": true, - "required": true + "description": "The crn for this specific object.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "url", + "type": "TypeString", + "description": "The url for this specific object.", + "computed": true }, { "name": "label_i18n", @@ -93544,313 +97402,75 @@ "elem": { "type": "TypeString" } - } - ], - "ibm_cm_offering": [ + }, { - "name": "created", + "name": "label", "type": "TypeString", - "description": "The date and time this catalog was created.", - "computed": true + "description": "Display name in the requested language.", + "optional": true }, { - "name": "portal_approval_record", + "name": "data", "type": "TypeString", - "description": "The portal's approval record ID.", + "description": "Stringified map of data values for this object.", "optional": true, "computed": true }, { - "name": "metadata", - "type": "TypeMap", - "description": "Map of metadata values for this offering.", + "name": "rev", + "type": "TypeString", + "description": "Cloudant revision.", + "computed": true + } + ], + "ibm_cm_offering": [ + { + "name": "long_description", + "type": "TypeString", + "description": "Long description in the requested language.", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "support", - "type": "TypeList", - "description": "Offering Support information.", - "computed": true, - "elem": { - "locations": { - "name": "locations", - "type": "TypeList", - "description": "A list of country codes indicating where support is provided.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "process": { - "name": "process", - "type": "TypeString", - "description": "Support process as provided by an ISV.", - "computed": true - }, - "process_i18n": { - "name": "process_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "support_details": { - "name": "support_details", - "type": "TypeList", - "description": "A list of support options (e.g. email, phone, slack, other).", - "computed": true, - "elem": { - "availability": { - "name": "availability", - "type": "TypeList", - "description": "Times when support is available.", - "computed": true, - "elem": { - "always_available": { - "name": "always_available", - "type": "TypeBool", - "description": "Is this support always available.", - "computed": true - }, - "times": { - "name": "times", - "type": "TypeList", - "description": "A list of support times.", - "computed": true, - "elem": { - "day": { - "name": "day", - "type": "TypeInt", - "description": "The day of the week, represented as an integer.", - "computed": true - }, - "end_time": { - "name": "end_time", - "type": "TypeString", - "description": "HOURS:MINUTES:SECONDS using 24 hour time (e.g. 8:15:00).", - "computed": true - }, - "start_time": { - "name": "start_time", - "type": "TypeString", - "description": "HOURS:MINUTES:SECONDS using 24 hour time (e.g. 8:15:00).", - "computed": true - } - } - }, - "timezone": { - "name": "timezone", - "type": "TypeString", - "description": "Timezone (e.g. America/New_York).", - "computed": true - } - } - }, - "contact": { - "name": "contact", - "type": "TypeString", - "description": "Contact for the current support detail.", - "computed": true - }, - "response_wait_time": { - "name": "response_wait_time", - "type": "TypeList", - "description": "Time descriptor.", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "Valid values are hour or day.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "Amount of time to wait in unit 'type'.", - "computed": true - } - } - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the current support detail.", - "computed": true - } - } - }, - "support_escalation": { - "name": "support_escalation", - "type": "TypeList", - "description": "Support escalation policy.", - "computed": true, - "elem": { - "contact": { - "name": "contact", - "type": "TypeString", - "description": "Escalation contact.", - "computed": true - }, - "escalation_wait_time": { - "name": "escalation_wait_time", - "type": "TypeList", - "description": "Time descriptor.", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "Valid values are hour or day.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "Amount of time to wait in unit 'type'.", - "computed": true - } - } - }, - "response_wait_time": { - "name": "response_wait_time", - "type": "TypeList", - "description": "Time descriptor.", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "Valid values are hour or day.", - "computed": true - }, - "value": { - "name": "value", - "type": "TypeInt", - "description": "Amount of time to wait in unit 'type'.", - "computed": true - } - } - } - } - }, - "support_type": { - "name": "support_type", - "type": "TypeString", - "description": "Support type for this product.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL to be displayed in the Consumption UI for getting support on this offering.", - "computed": true - } - } + "name": "pc_managed", + "type": "TypeBool", + "description": "Offering is managed by Partner Center.", + "computed": true }, { - "name": "media", + "name": "share_with_access_list", "type": "TypeList", - "description": "A list of media items related to this offering.", + "description": "A list of account IDs to add to this offering's access list.", "optional": true, - "computed": true, "elem": { - "api_url": { - "name": "api_url", - "type": "TypeString", - "description": "CM API specific URL of the specified media item.", - "optional": true, - "computed": true - }, - "caption": { - "name": "caption", - "type": "TypeString", - "description": "Caption for this media item.", - "optional": true, - "computed": true - }, - "caption_i18n": { - "name": "caption_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "thumbnail_url": { - "name": "thumbnail_url", - "type": "TypeString", - "description": "Thumbnail URL for this media item.", - "optional": true, - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of this media item.", - "optional": true, - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the specified media item.", - "optional": true, - "computed": true - }, - "url_proxy": { - "name": "url_proxy", - "type": "TypeList", - "description": "Offering URL proxy information.", - "optional": true, - "computed": true, - "elem": { - "sha": { - "name": "sha", - "type": "TypeString", - "description": "SHA256 fingerprint of image.", - "optional": true, - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "URL of the specified media item being proxied.", - "optional": true, - "computed": true - } - }, - "max_items": 1 - } + "type": "TypeString" } }, { - "name": "product_kind", + "name": "crn", "type": "TypeString", - "description": "The product kind. Valid values are module, solution, or empty string.", + "description": "The crn for this specific offering.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "label", + "type": "TypeString", + "description": "Display Name in the requested language.", "optional": true, "computed": true }, { - "name": "offering_id", + "name": "offering_docs_url", "type": "TypeString", - "description": "Offering identifier. Provide this when an offering already exists and you wish to use it as a terraform resource.", - "immutable": true, - "optional": true + "description": "URL for an additional docs with this offering.", + "optional": true, + "computed": true }, { - "name": "tags", + "name": "keywords", "type": "TypeList", - "description": "List of tags associated with this catalog.", - "cloud_data_type": "tags", + "description": "List of keywords associated with offering, typically used to search for it.", "optional": true, "computed": true, "elem": { @@ -93864,144 +97484,56 @@ "optional": true }, { - "name": "pc_managed", + "name": "disclaimer", + "type": "TypeString", + "description": "A disclaimer for this offering.", + "optional": true, + "computed": true + }, + { + "name": "hidden", "type": "TypeBool", - "description": "Offering is managed by Partner Center.", + "description": "Determine if this offering should be displayed in the Consumption UI.", + "optional": true, "computed": true }, { - "name": "provider_info", + "name": "image_pull_keys", "type": "TypeList", - "description": "Information on the provider for this offering, or omitted if no provider information is given.", + "description": "Image pull keys for this offering.", "optional": true, "computed": true, "elem": { - "id": { - "name": "id", + "description": { + "name": "description", "type": "TypeString", - "description": "The id of this provider.", + "description": "Key description.", "optional": true, "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name of this provider.", + "description": "Key name.", "optional": true, "computed": true - } - }, - "max_items": 1 - }, - { - "name": "repo_info", - "type": "TypeList", - "description": "Repository info for offerings.", - "computed": true, - "elem": { - "token": { - "name": "token", - "type": "TypeString", - "description": "Token for private repos.", - "optional": true }, - "type": { - "name": "type", + "value": { + "name": "value", "type": "TypeString", - "description": "Public or enterprise GitHub.", - "optional": true - } - } - }, - { - "name": "offering_support_url", - "type": "TypeString", - "description": "[deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering.", - "optional": true, - "computed": true, - "deprecated": "This argument is deprecated" - }, - { - "name": "name", - "type": "TypeString", - "description": "The programmatic name of this offering.", - "optional": true, - "computed": true - }, - { - "name": "rating", - "type": "TypeList", - "description": "Repository info for offerings.", - "computed": true, - "elem": { - "four_star_count": { - "name": "four_star_count", - "type": "TypeInt", - "description": "Four start rating.", - "computed": true - }, - "one_star_count": { - "name": "one_star_count", - "type": "TypeInt", - "description": "One start rating.", - "computed": true - }, - "three_star_count": { - "name": "three_star_count", - "type": "TypeInt", - "description": "Three start rating.", - "computed": true - }, - "two_star_count": { - "name": "two_star_count", - "type": "TypeInt", - "description": "Two start rating.", + "description": "Key value.", + "optional": true, "computed": true } } }, { - "name": "short_description", + "name": "product_kind", "type": "TypeString", - "description": "Short description in the requested language.", + "description": "The product kind. Valid values are module, solution, or empty string.", "optional": true, "computed": true }, - { - "name": "short_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "deprecate_pending", - "type": "TypeList", - "description": "Deprecation information for an Offering.", - "computed": true, - "elem": { - "deprecate_date": { - "name": "deprecate_date", - "type": "TypeString", - "description": "Date of deprecation.", - "computed": true - }, - "deprecate_state": { - "name": "deprecate_state", - "type": "TypeString", - "description": "Deprecation state.", - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "computed": true - } - } - }, { "name": "badges", "type": "TypeList", @@ -94105,43 +97637,48 @@ } }, { - "name": "label", - "type": "TypeString", - "description": "Display Name in the requested language.", - "optional": true, - "computed": true - }, - { - "name": "updated", - "type": "TypeString", - "description": "The date and time this catalog was last updated.", - "computed": true - }, - { - "name": "long_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "name": "features", + "type": "TypeList", + "description": "list of features associated with this offering.", "optional": true, "computed": true, "elem": { - "type": "TypeString" + "description": { + "name": "description", + "type": "TypeString", + "description": "Feature description.", + "optional": true, + "computed": true + }, + "description_i18n": { + "name": "description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "title": { + "name": "title", + "type": "TypeString", + "description": "Heading.", + "optional": true, + "computed": true + }, + "title_i18n": { + "name": "title_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + } } }, - { - "name": "share_enabled", - "type": "TypeBool", - "description": "Denotes sharing including access list availability of an Offering is enabled.", - "optional": true, - "computed": true - }, - { - "name": "permit_request_ibm_public_publish", - "type": "TypeBool", - "description": "Is it permitted to request publishing to IBM or Public.", - "optional": true, - "computed": true, - "deprecated": "This argument is deprecated" - }, { "name": "ibm_publish_approved", "type": "TypeBool", @@ -94159,52 +97696,98 @@ "deprecated": "This argument is deprecated" }, { - "name": "disclaimer", + "name": "publish_public_crn", "type": "TypeString", - "description": "A disclaimer for this offering.", + "description": "The crn of the public catalog entry of this offering.", "optional": true, "computed": true }, { - "name": "crn", + "name": "portal_ui_url", "type": "TypeString", - "description": "The crn for this specific offering.", - "cloud_data_type": "crn", + "description": "The portal UI URL.", + "optional": true, "computed": true }, { - "name": "offering_icon_url", + "name": "rev", "type": "TypeString", - "description": "URL for an icon associated with this offering.", + "description": "Cloudant revision.", + "computed": true + }, + { + "name": "offering_identifier", + "type": "TypeString", + "description": "Computed Offering ID.", + "computed": true + }, + { + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog identifier.", + "immutable": true, + "required": true + }, + { + "name": "updated", + "type": "TypeString", + "description": "The date and time this catalog was last updated.", + "computed": true + }, + { + "name": "portal_approval_record", + "type": "TypeString", + "description": "The portal's approval record ID.", "optional": true, "computed": true }, { - "name": "keywords", + "name": "provider_info", "type": "TypeList", - "description": "List of keywords associated with offering, typically used to search for it.", + "description": "Information on the provider for this offering, or omitted if no provider information is given.", "optional": true, "computed": true, "elem": { - "type": "TypeString" - } + "id": { + "name": "id", + "type": "TypeString", + "description": "The id of this provider.", + "optional": true, + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of this provider.", + "optional": true, + "computed": true + } + }, + "max_items": 1 }, { - "name": "features", + "name": "media", "type": "TypeList", - "description": "list of features associated with this offering.", + "description": "A list of media items related to this offering.", "optional": true, "computed": true, "elem": { - "description": { - "name": "description", + "api_url": { + "name": "api_url", "type": "TypeString", - "description": "Feature description.", + "description": "CM API specific URL of the specified media item.", "optional": true, "computed": true }, - "description_i18n": { - "name": "description_i18n", + "caption": { + "name": "caption", + "type": "TypeString", + "description": "Caption for this media item.", + "optional": true, + "computed": true + }, + "caption_i18n": { + "name": "caption_i18n", "type": "TypeMap", "description": "A map of translated strings, by language code.", "optional": true, @@ -94213,25 +97796,153 @@ "type": "TypeString" } }, - "title": { - "name": "title", + "thumbnail_url": { + "name": "thumbnail_url", "type": "TypeString", - "description": "Heading.", + "description": "Thumbnail URL for this media item.", "optional": true, "computed": true }, - "title_i18n": { - "name": "title_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of this media item.", + "optional": true, + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item.", + "optional": true, + "computed": true + }, + "url_proxy": { + "name": "url_proxy", + "type": "TypeList", + "description": "Offering URL proxy information.", "optional": true, "computed": true, "elem": { - "type": "TypeString" - } + "sha": { + "name": "sha", + "type": "TypeString", + "description": "SHA256 fingerprint of image.", + "optional": true, + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "URL of the specified media item being proxied.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + } + } + }, + { + "name": "metadata", + "type": "TypeMap", + "description": "Map of metadata values for this offering.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "repo_info", + "type": "TypeList", + "description": "Repository info for offerings.", + "computed": true, + "elem": { + "token": { + "name": "token", + "type": "TypeString", + "description": "Token for private repos.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Public or enterprise GitHub.", + "optional": true } } }, + { + "name": "offering_id", + "type": "TypeString", + "description": "Offering identifier. Provide this when an offering already exists and you wish to use it as a terraform resource.", + "immutable": true, + "optional": true + }, + { + "name": "created", + "type": "TypeString", + "description": "The date and time this catalog was created.", + "computed": true + }, + { + "name": "short_description", + "type": "TypeString", + "description": "Short description in the requested language.", + "optional": true, + "computed": true + }, + { + "name": "long_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "share_with_ibm", + "type": "TypeBool", + "description": "Denotes IBM employee availability of an Offering - if share_enabled is true.", + "optional": true, + "computed": true + }, + { + "name": "label_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "The programmatic name of this offering.", + "optional": true, + "computed": true + }, + { + "name": "offering_support_url", + "type": "TypeString", + "description": "[deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering.", + "optional": true, + "computed": true, + "deprecated": "This argument is deprecated" + }, + { + "name": "permit_request_ibm_public_publish", + "type": "TypeBool", + "description": "Is it permitted to request publishing to IBM or Public.", + "optional": true, + "computed": true, + "deprecated": "This argument is deprecated" + }, { "name": "kinds", "type": "TypeList", @@ -96316,34 +100027,6 @@ } } }, - { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog identifier.", - "immutable": true, - "required": true - }, - { - "name": "share_with_access_list", - "type": "TypeList", - "description": "A list of account IDs to add to this offering's access list.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "offering_identifier", - "type": "TypeString", - "description": "Computed Offering ID.", - "computed": true - }, - { - "name": "publish_approved", - "type": "TypeBool", - "description": "Offering has been approved to publish to permitted to IBM or Public Catalog.", - "computed": true - }, { "name": "public_original_crn", "type": "TypeString", @@ -96352,130 +100035,324 @@ "computed": true }, { - "name": "portal_ui_url", + "name": "catalog_name", "type": "TypeString", - "description": "The portal UI URL.", - "optional": true, + "description": "The name of the catalog.", "computed": true }, { - "name": "image_pull_keys", + "name": "support", "type": "TypeList", - "description": "Image pull keys for this offering.", - "optional": true, + "description": "Offering Support information.", "computed": true, "elem": { - "description": { - "name": "description", + "locations": { + "name": "locations", + "type": "TypeList", + "description": "A list of country codes indicating where support is provided.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "process": { + "name": "process", "type": "TypeString", - "description": "Key description.", - "optional": true, + "description": "Support process as provided by an ISV.", "computed": true }, - "name": { - "name": "name", + "process_i18n": { + "name": "process_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "support_details": { + "name": "support_details", + "type": "TypeList", + "description": "A list of support options (e.g. email, phone, slack, other).", + "computed": true, + "elem": { + "availability": { + "name": "availability", + "type": "TypeList", + "description": "Times when support is available.", + "computed": true, + "elem": { + "always_available": { + "name": "always_available", + "type": "TypeBool", + "description": "Is this support always available.", + "computed": true + }, + "times": { + "name": "times", + "type": "TypeList", + "description": "A list of support times.", + "computed": true, + "elem": { + "day": { + "name": "day", + "type": "TypeInt", + "description": "The day of the week, represented as an integer.", + "computed": true + }, + "end_time": { + "name": "end_time", + "type": "TypeString", + "description": "HOURS:MINUTES:SECONDS using 24 hour time (e.g. 8:15:00).", + "computed": true + }, + "start_time": { + "name": "start_time", + "type": "TypeString", + "description": "HOURS:MINUTES:SECONDS using 24 hour time (e.g. 8:15:00).", + "computed": true + } + } + }, + "timezone": { + "name": "timezone", + "type": "TypeString", + "description": "Timezone (e.g. America/New_York).", + "computed": true + } + } + }, + "contact": { + "name": "contact", + "type": "TypeString", + "description": "Contact for the current support detail.", + "computed": true + }, + "response_wait_time": { + "name": "response_wait_time", + "type": "TypeList", + "description": "Time descriptor.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "Valid values are hour or day.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "Amount of time to wait in unit 'type'.", + "computed": true + } + } + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the current support detail.", + "computed": true + } + } + }, + "support_escalation": { + "name": "support_escalation", + "type": "TypeList", + "description": "Support escalation policy.", + "computed": true, + "elem": { + "contact": { + "name": "contact", + "type": "TypeString", + "description": "Escalation contact.", + "computed": true + }, + "escalation_wait_time": { + "name": "escalation_wait_time", + "type": "TypeList", + "description": "Time descriptor.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "Valid values are hour or day.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "Amount of time to wait in unit 'type'.", + "computed": true + } + } + }, + "response_wait_time": { + "name": "response_wait_time", + "type": "TypeList", + "description": "Time descriptor.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "Valid values are hour or day.", + "computed": true + }, + "value": { + "name": "value", + "type": "TypeInt", + "description": "Amount of time to wait in unit 'type'.", + "computed": true + } + } + } + } + }, + "support_type": { + "name": "support_type", "type": "TypeString", - "description": "Key name.", - "optional": true, + "description": "Support type for this product.", "computed": true }, - "value": { - "name": "value", + "url": { + "name": "url", "type": "TypeString", - "description": "Key value.", - "optional": true, + "description": "URL to be displayed in the Consumption UI for getting support on this offering.", "computed": true } } }, { - "name": "share_with_ibm", + "name": "share_enabled", "type": "TypeBool", - "description": "Denotes IBM employee availability of an Offering - if share_enabled is true.", + "description": "Denotes sharing including access list availability of an Offering is enabled.", "optional": true, "computed": true }, { - "name": "label_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "optional": true, + "name": "deprecate_pending", + "type": "TypeList", + "description": "Deprecation information for an Offering.", "computed": true, "elem": { - "type": "TypeString" + "deprecate_date": { + "name": "deprecate_date", + "type": "TypeString", + "description": "Date of deprecation.", + "computed": true + }, + "deprecate_state": { + "name": "deprecate_state", + "type": "TypeString", + "description": "Deprecation state.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "computed": true + } } }, { - "name": "offering_docs_url", + "name": "url", "type": "TypeString", - "description": "URL for an additional docs with this offering.", - "optional": true, + "description": "The url for this specific offering.", "computed": true }, { - "name": "long_description", + "name": "offering_icon_url", "type": "TypeString", - "description": "Long description in the requested language.", + "description": "URL for an icon associated with this offering.", "optional": true, "computed": true }, { - "name": "share_with_all", - "type": "TypeBool", - "description": "Denotes public availability of an Offering - if share_enabled is true.", + "name": "tags", + "type": "TypeList", + "description": "List of tags associated with this catalog.", + "cloud_data_type": "tags", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "publish_public_crn", - "type": "TypeString", - "description": "The crn of the public catalog entry of this offering.", + "name": "short_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", "optional": true, - "computed": true - }, - { - "name": "catalog_name", - "type": "TypeString", - "description": "The name of the catalog.", - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "hidden", + "name": "share_with_all", "type": "TypeBool", - "description": "Determine if this offering should be displayed in the Consumption UI.", + "description": "Denotes public availability of an Offering - if share_enabled is true.", "optional": true, "computed": true }, { - "name": "url", - "type": "TypeString", - "description": "The url for this specific offering.", - "computed": true + "name": "rating", + "type": "TypeList", + "description": "Repository info for offerings.", + "computed": true, + "elem": { + "four_star_count": { + "name": "four_star_count", + "type": "TypeInt", + "description": "Four start rating.", + "computed": true + }, + "one_star_count": { + "name": "one_star_count", + "type": "TypeInt", + "description": "One start rating.", + "computed": true + }, + "three_star_count": { + "name": "three_star_count", + "type": "TypeInt", + "description": "Three start rating.", + "computed": true + }, + "two_star_count": { + "name": "two_star_count", + "type": "TypeInt", + "description": "Two start rating.", + "computed": true + } + } }, { - "name": "rev", - "type": "TypeString", - "description": "Cloudant revision.", + "name": "publish_approved", + "type": "TypeBool", + "description": "Offering has been approved to publish to permitted to IBM or Public Catalog.", "computed": true } ], "ibm_cm_offering_instance": [ { - "name": "url", + "name": "offering_id", "type": "TypeString", - "description": "url reference to this object.", - "computed": true + "description": "Offering ID this instance was created from.", + "required": true }, { - "name": "label", + "name": "kind_format", "type": "TypeString", - "description": "the label for this instance.", + "description": "the format this instance has (helm, operator, ova...).", "required": true }, { - "name": "cluster_id", - "type": "TypeString", - "description": "Cluster ID.", + "name": "cluster_all_namespaces", + "type": "TypeBool", + "description": "designate to install into all namespaces.", "required": true }, { @@ -96485,29 +100362,38 @@ "computed": true }, { - "name": "offering_id", + "name": "channel", "type": "TypeString", - "description": "Offering ID this instance was created from.", - "required": true + "description": "channel to target for the operator subscription. Required for operator bundles", + "optional": true }, { - "name": "kind_format", + "name": "crn", "type": "TypeString", - "description": "the format this instance has (helm, operator, ova...).", - "required": true + "description": "platform CRN for this instance.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "cluster_all_namespaces", - "type": "TypeBool", - "description": "designate to install into all namespaces.", + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog ID this instance was created from.", "required": true }, { - "name": "resource_group_id", + "name": "version", "type": "TypeString", - "description": "id of the resource group", - "cloud_data_type": "resource_group", - "optional": true + "description": "The version this instance was installed from (not version id).", + "required": true + }, + { + "name": "cluster_namespaces", + "type": "TypeList", + "description": "List of target namespaces to install into.", + "required": true, + "elem": { + "type": "TypeString" + } }, { "name": "install_plan", @@ -96516,29 +100402,28 @@ "optional": true }, { - "name": "crn", + "name": "url", "type": "TypeString", - "description": "platform CRN for this instance.", - "cloud_data_type": "crn", + "description": "url reference to this object.", "computed": true }, { - "name": "version", + "name": "resource_group_id", "type": "TypeString", - "description": "The version this instance was installed from (not version id).", - "required": true + "description": "id of the resource group", + "cloud_data_type": "resource_group", + "optional": true }, { - "name": "wait_until_successful", - "type": "TypeBool", - "description": "Whether to wait until the offering instance successfully provisions, or to return when accepted", - "default_value": true, - "optional": true + "name": "label", + "type": "TypeString", + "description": "the label for this instance.", + "required": true }, { - "name": "catalog_id", + "name": "cluster_id", "type": "TypeString", - "description": "Catalog ID this instance was created from.", + "description": "Cluster ID.", "required": true }, { @@ -96548,22 +100433,29 @@ "required": true }, { - "name": "cluster_namespaces", - "type": "TypeList", - "description": "List of target namespaces to install into.", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "channel", - "type": "TypeString", - "description": "channel to target for the operator subscription. Required for operator bundles", + "name": "wait_until_successful", + "type": "TypeBool", + "description": "Whether to wait until the offering instance successfully provisions, or to return when accepted", + "default_value": true, "optional": true } ], "ibm_cm_validation": [ + { + "name": "version_locator", + "type": "TypeString", + "description": "Version locator - the version that will be validated.", + "immutable": true, + "required": true + }, + { + "name": "region", + "type": "TypeString", + "description": "Validation region.", + "cloud_data_type": "region", + "immutable": true, + "optional": true + }, { "name": "override_values", "type": "TypeMap", @@ -96574,6 +100466,33 @@ "type": "TypeString" } }, + { + "name": "environment_variables", + "type": "TypeList", + "description": "Environment variables to include in the schematics workspace.", + "immutable": true, + "optional": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the environment variable.", + "optional": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "If the environment variablel should be secure.", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value of the environment variable.", + "optional": true + } + } + }, { "name": "schematics", "type": "TypeList", @@ -96635,167 +100554,52 @@ "description": "Data and time of last validation request.", "computed": true }, - { - "name": "x_auth_refresh_token", - "type": "TypeString", - "description": "Authentication token used to submit validation job.", - "secure": true, - "optional": true, - "deprecated": "This argument is deprecated because it is now retrieved automatically." - }, - { - "name": "revalidate_if_validated", - "type": "TypeBool", - "description": "If the version should be revalidated if it is already validated.", - "immutable": true, - "optional": true - }, - { - "name": "mark_version_consumable", - "type": "TypeBool", - "description": "If the version should be marked as consumable or \"ready to share\".", - "optional": true - }, - { - "name": "version_locator", - "type": "TypeString", - "description": "Version locator - the version that will be validated.", - "immutable": true, - "required": true - }, - { - "name": "region", - "type": "TypeString", - "description": "Validation region.", - "cloud_data_type": "region", - "immutable": true, - "optional": true - }, - { - "name": "environment_variables", - "type": "TypeList", - "description": "Environment variables to include in the schematics workspace.", - "immutable": true, - "optional": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the environment variable.", - "optional": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "If the environment variablel should be secure.", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value of the environment variable.", - "optional": true - } - } - }, { "name": "state", "type": "TypeString", "description": "Current validation state - \u003cempty\u003e, in_progress, valid, invalid, expired.", "computed": true }, - { - "name": "last_operation", - "type": "TypeString", - "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", - "computed": true - }, { "name": "message", "type": "TypeString", "description": "Any message needing to be conveyed as part of the validation job.", "computed": true - } - ], - "ibm_cm_version": [ + }, { - "name": "product_kind", - "type": "TypeString", - "description": "Optional product kind for the software being onboarded. Valid values are software, module, or solution. Default value is software.", - "immutable": true, + "name": "mark_version_consumable", + "type": "TypeBool", + "description": "If the version should be marked as consumable or \"ready to share\".", "optional": true }, { - "name": "created", + "name": "last_operation", "type": "TypeString", - "description": "The date and time this version was created.", + "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", "computed": true }, { - "name": "offering_identifier", + "name": "x_auth_refresh_token", "type": "TypeString", - "description": "Offering ID, in the format of \u003caccount_id\u003e:o:\u003coffering_id\u003e.", - "computed": true + "description": "Authentication token used to submit validation job.", + "secure": true, + "optional": true, + "deprecated": "This argument is deprecated because it is now retrieved automatically." }, { - "name": "single_instance", + "name": "revalidate_if_validated", "type": "TypeBool", - "description": "Denotes if single instance can be deployed to a given cluster.", - "computed": true - }, - { - "name": "state", - "type": "TypeList", - "description": "Offering state.", - "computed": true, - "elem": { - "current": { - "name": "current", - "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", - "computed": true - }, - "current_entered": { - "name": "current_entered", - "type": "TypeString", - "description": "Date and time of current request.", - "computed": true - }, - "pending": { - "name": "pending", - "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", - "computed": true - }, - "pending_requested": { - "name": "pending_requested", - "type": "TypeString", - "description": "Date and time of pending request.", - "computed": true - }, - "previous": { - "name": "previous", - "type": "TypeString", - "description": "one of: new, validated, account-published, ibm-published, public-published.", - "computed": true - } - } - }, + "description": "If the version should be revalidated if it is already validated.", + "immutable": true, + "optional": true + } + ], + "ibm_cm_version": [ { - "name": "long_description", + "name": "terraform_version", "type": "TypeString", - "description": "Long description for version.", - "computed": true - }, - { - "name": "target_kinds", - "type": "TypeList", - "description": "Deployment target of the content being onboarded. Current valid values are iks, roks, vcenter, power-iaas, terraform, and vpc-x86. Required for virtual server image for VPC.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } + "description": "Provide a terraform version for this offering version to use.", + "optional": true }, { "name": "flavor", @@ -96834,187 +100638,348 @@ "max_items": 1 }, { - "name": "zipurl", + "name": "target_version", "type": "TypeString", - "description": "URL path to zip location. If not specified, must provide content in the body of this call.", + "description": "The semver value for this new version, if not found in the zip url package content.", "immutable": true, "optional": true }, { - "name": "repotype", - "type": "TypeString", - "description": "The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'.", + "name": "include_config", + "type": "TypeBool", + "description": "Add all possible configuration values to this version when importing.", "immutable": true, "optional": true }, { - "name": "version_locator", + "name": "tgz_url", "type": "TypeString", - "description": "A dotted value of `catalogID`.`versionID`.", + "description": "File used to on-board this version.", "computed": true }, { - "name": "import_sha", + "name": "sha", "type": "TypeString", "description": "SHA256 fingerprint of the image file. Required for virtual server image for VPC.", - "optional": true + "computed": true }, { - "name": "validation", + "name": "metadata", "type": "TypeList", - "description": "Validation response.", + "description": "Generic data to be included with content being onboarded. Required for virtual server image for VPC.", "computed": true, "elem": { - "last_operation": { - "name": "last_operation", + "end_deploy_time": { + "name": "end_deploy_time", "type": "TypeString", - "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", - "optional": true + "description": "The time validation ended.", + "computed": true }, - "message": { - "name": "message", + "est_deploy_time": { + "name": "est_deploy_time", + "type": "TypeFloat", + "description": "The estimated time validation takes.", + "computed": true + }, + "example_name": { + "name": "example_name", "type": "TypeString", - "description": "Any message needing to be conveyed as part of the validation job.", - "optional": true + "description": "Working directory of source files.", + "computed": true }, - "requested": { - "name": "requested", + "modules": { + "name": "modules", + "type": "TypeList", + "description": "Terraform modules.", + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the module.", + "computed": true + }, + "offering_reference": { + "name": "offering_reference", + "type": "TypeList", + "description": "Terraform modules.", + "computed": true, + "elem": { + "catalog_id": { + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog ID of the module reference.", + "computed": true + }, + "flavor": { + "name": "flavor", + "type": "TypeString", + "description": "Flavor of the module.", + "computed": true + }, + "flavors": { + "name": "flavors", + "type": "TypeList", + "description": "Flavors of the module.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the offering module.", + "computed": true + }, + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Kind of the offeringmodule.", + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeString", + "description": "Metadata of the module.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the offering module.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Version of the offering module.", + "computed": true + } + } + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of the module.", + "computed": true + } + } + }, + "source_url": { + "name": "source_url", "type": "TypeString", - "description": "Date and time of last validation was requested.", - "optional": true + "description": "Version source URL.", + "computed": true }, - "state": { - "name": "state", + "start_deploy_time": { + "name": "start_deploy_time", "type": "TypeString", - "description": "Current validation state - \u003cempty\u003e, in_progress, valid, invalid, expired.", - "optional": true + "description": "The time validation started.", + "computed": true }, - "target": { - "name": "target", - "type": "TypeMap", - "description": "Validation target information (e.g. cluster_id, region, namespace, etc). Values will vary by Content type.", - "optional": true, - "elem": { - "type": "TypeString" - } + "terraform_version": { + "name": "terraform_version", + "type": "TypeString", + "description": "Terraform version.", + "computed": true }, - "validated": { - "name": "validated", + "usage": { + "name": "usage", "type": "TypeString", - "description": "Date and time of last successful validation.", - "optional": true - } - } - }, - { - "name": "repo_url", - "type": "TypeString", - "description": "Content's repo URL.", - "computed": true - }, - { - "name": "deprecate", - "type": "TypeBool", - "description": "Deprecate this version.", - "optional": true - }, - { - "name": "working_directory", - "type": "TypeString", - "description": "Optional - The sub-folder within the specified tgz file that contains the software being onboarded.", - "immutable": true, - "optional": true - }, - { - "name": "is_vsi", - "type": "TypeBool", - "description": "Indicates that the current terraform template is used to install a virtual server image.", - "immutable": true, - "optional": true - }, - { - "name": "x_auth_token", - "type": "TypeString", - "description": "Authentication token used to access the specified zip file.", - "immutable": true, - "optional": true - }, - { - "name": "is_consumable", - "type": "TypeBool", - "description": "Is the version able to be shared.", - "computed": true - }, - { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog identifier.", - "immutable": true, - "required": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the software being onboarded. Required for virtual server image for VPC.", - "computed": true - }, - { - "name": "source_url", - "type": "TypeString", - "description": "Content's source URL (e.g git repo).", - "computed": true - }, - { - "name": "long_description_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "computed": true, - "elem": { - "type": "TypeString" + "description": "Usage text for the version.", + "computed": true + }, + "usage_template": { + "name": "usage_template", + "type": "TypeString", + "description": "Usage text for the version.", + "computed": true + }, + "validated_terraform_version": { + "name": "validated_terraform_version", + "type": "TypeString", + "description": "Validated terraform version.", + "computed": true + }, + "version_name": { + "name": "version_name", + "type": "TypeString", + "description": "Version name.", + "computed": true + }, + "vsi_vpc": { + "name": "vsi_vpc", + "type": "TypeList", + "description": "VSI VPC version information", + "computed": true, + "elem": { + "file": { + "name": "file", + "type": "TypeList", + "description": "Details for the stored image file. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "size": { + "name": "size", + "type": "TypeInt", + "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "images": { + "name": "images", + "type": "TypeList", + "description": "Image operating system. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", + "computed": true + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", + "computed": true + } + } + }, + "minimum_provisioned_size": { + "name": "minimum_provisioned_size", + "type": "TypeInt", + "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", + "computed": true + }, + "operating_system": { + "name": "operating_system", + "type": "TypeList", + "description": "Operating system included in this image. Required for virtual server image for VPC.", + "computed": true, + "elem": { + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "Operating system architecture. Required for virtual server image for VPC.", + "computed": true + }, + "dedicated_host_only": { + "name": "dedicated_host_only", + "type": "TypeBool", + "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", + "computed": true + }, + "display_name": { + "name": "display_name", + "type": "TypeString", + "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "family": { + "name": "family", + "type": "TypeString", + "description": "Software family for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "URL for this operating system. Required for virtual server image for VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Globally unique name for this operating system Required for virtual server image for VPC.", + "computed": true + }, + "vendor": { + "name": "vendor", + "type": "TypeString", + "description": "Vendor of the operating system. Required for virtual server image for VPC.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "Major release version of this operating system. Required for virtual server image for VPC.", + "computed": true + } + } + } + } + }, + "working_directory": { + "name": "working_directory", + "type": "TypeString", + "description": "Working directory of source files.", + "computed": true + } } }, { - "name": "deprecate_pending", + "name": "install", "type": "TypeList", - "description": "Deprecation information for a Version.", + "description": "Script information.", + "optional": true, "computed": true, "elem": { - "deprecate_date": { - "name": "deprecate_date", + "delete_script": { + "name": "delete_script", "type": "TypeString", - "description": "Date of deprecation.", + "description": "Optional script that if run will remove the installed version.", + "optional": true, "computed": true }, - "deprecate_state": { - "name": "deprecate_state", + "instructions": { + "name": "instructions", "type": "TypeString", - "description": "Deprecation state.", + "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", + "optional": true, "computed": true }, - "description": { - "name": "description", + "instructions_i18n": { + "name": "instructions_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "scope": { + "name": "scope", + "type": "TypeString", + "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", + "optional": true, + "computed": true + }, + "script": { + "name": "script", + "type": "TypeString", + "description": "Optional script that needs to be run post any pre-condition script.", + "optional": true, + "computed": true + }, + "script_permission": { + "name": "script_permission", "type": "TypeString", + "description": "Optional iam permissions that are required on the target cluster to run this script.", + "optional": true, "computed": true } - } - }, - { - "name": "label", - "type": "TypeString", - "description": "Display name of version. Required for virtual server image for VPC.", - "optional": true - }, - { - "name": "usage", - "type": "TypeString", - "description": "The usage text for this version.", - "optional": true - }, - { - "name": "kind_id", - "type": "TypeString", - "description": "Kind ID.", - "computed": true + }, + "max_items": 1 }, { "name": "entitlement", @@ -97058,116 +101023,67 @@ } }, { - "name": "tags", + "name": "licenses", "type": "TypeList", - "description": "Tags array.", - "cloud_data_type": "tags", + "description": "List of licenses the product was built with.", "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "install_kind", - "type": "TypeString", - "description": "Install type. Example: instance. Required for virtual server image for VPC.", - "immutable": true, - "optional": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "Version's CRN.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "target_version", - "type": "TypeString", - "description": "The semver value for this new version, if not found in the zip url package content.", - "immutable": true, - "optional": true - }, - { - "name": "tgz_url", - "type": "TypeString", - "description": "File used to on-board this version.", - "computed": true - }, - { - "name": "outputs", - "type": "TypeList", - "description": "List of output values for this version.", "computed": true, "elem": { "description": { "name": "description", "type": "TypeString", - "description": "Output description.", - "optional": true - }, - "key": { - "name": "key", - "type": "TypeString", - "description": "Output key.", - "optional": true - } - } - }, - { - "name": "install", - "type": "TypeList", - "description": "Script information.", - "optional": true, - "computed": true, - "elem": { - "delete_script": { - "name": "delete_script", - "type": "TypeString", - "description": "Optional script that if run will remove the installed version.", + "description": "License description.", "optional": true, "computed": true }, - "instructions": { - "name": "instructions", + "id": { + "name": "id", "type": "TypeString", - "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", + "description": "License ID.", "optional": true, "computed": true }, - "instructions_i18n": { - "name": "instructions_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "scope": { - "name": "scope", + "name": { + "name": "name", "type": "TypeString", - "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", + "description": "license name.", "optional": true, "computed": true }, - "script": { - "name": "script", + "type": { + "name": "type", "type": "TypeString", - "description": "Optional script that needs to be run post any pre-condition script.", + "description": "type of license e.g., Apache xxx.", "optional": true, "computed": true }, - "script_permission": { - "name": "script_permission", + "url": { + "name": "url", "type": "TypeString", - "description": "Optional iam permissions that are required on the target cluster to run this script.", + "description": "URL for the license text.", "optional": true, "computed": true } - }, - "max_items": 1 + } + }, + { + "name": "long_description", + "type": "TypeString", + "description": "Long description for version.", + "computed": true + }, + { + "name": "offering_identifier", + "type": "TypeString", + "description": "Offering ID, in the format of \u003caccount_id\u003e:o:\u003coffering_id\u003e.", + "computed": true + }, + { + "name": "product_kind", + "type": "TypeString", + "description": "Optional product kind for the software being onboarded. Valid values are software, module, or solution. Default value is software.", + "immutable": true, + "optional": true }, { "name": "import_metadata", @@ -97283,259 +101199,11 @@ "max_items": 1 }, { - "name": "rev", - "type": "TypeString", - "description": "Cloudant revision.", - "computed": true - }, - { - "name": "pre_install", - "type": "TypeList", - "description": "Optional pre-install instructions.", - "optional": true, - "elem": { - "delete_script": { - "name": "delete_script", - "type": "TypeString", - "description": "Optional script that if run will remove the installed version.", - "optional": true - }, - "instructions": { - "name": "instructions", - "type": "TypeString", - "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", - "optional": true - }, - "instructions_i18n": { - "name": "instructions_i18n", - "type": "TypeMap", - "description": "A map of translated strings, by language code.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "scope": { - "name": "scope", - "type": "TypeString", - "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", - "optional": true - }, - "script": { - "name": "script", - "type": "TypeString", - "description": "Optional script that needs to be run post any pre-condition script.", - "optional": true - }, - "script_permission": { - "name": "script_permission", - "type": "TypeString", - "description": "Optional iam permissions that are required on the target cluster to run this script.", - "optional": true - } - } - }, - { - "name": "image_pull_key_name", - "type": "TypeString", - "description": "ID of the image pull key to use from Offering.ImagePullKeys.", - "computed": true - }, - { - "name": "terraform_version", - "type": "TypeString", - "description": "Provide a terraform version for this offering version to use.", - "optional": true - }, - { - "name": "required_resources", - "type": "TypeList", - "description": "Resource requirments for installation.", - "computed": true, - "elem": { - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of requirement.", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "mem, disk, cores, and nodes can be parsed as an int. targetVersion will be a semver range value.", - "optional": true - } - } - }, - { - "name": "package_version", + "name": "updated", "type": "TypeString", - "description": "Version of the package used to create this version.", + "description": "The date and time this version was last updated.", "computed": true }, - { - "name": "configuration", - "type": "TypeList", - "description": "List of user solicited overrides.", - "optional": true, - "computed": true, - "elem": { - "custom_config": { - "name": "custom_config", - "type": "TypeList", - "description": "Render type.", - "optional": true, - "computed": true, - "elem": { - "associations": { - "name": "associations", - "type": "TypeList", - "description": "List of parameters that are associated with this configuration.", - "optional": true, - "computed": true, - "elem": { - "parameters": { - "name": "parameters", - "type": "TypeList", - "description": "Parameters for this association.", - "optional": true, - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of this parameter.", - "optional": true, - "computed": true - }, - "options_refresh": { - "name": "options_refresh", - "type": "TypeBool", - "description": "Refresh options.", - "optional": true, - "computed": true - } - } - } - }, - "max_items": 1 - }, - "config_constraints": { - "name": "config_constraints", - "type": "TypeMap", - "description": "Map of constraint parameters that will be passed to the custom widget.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "grouping": { - "name": "grouping", - "type": "TypeString", - "description": "Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment).", - "optional": true, - "computed": true - }, - "grouping_index": { - "name": "grouping_index", - "type": "TypeInt", - "description": "Determines the order that this configuration item shows in that particular grouping.", - "optional": true, - "computed": true - }, - "original_grouping": { - "name": "original_grouping", - "type": "TypeString", - "description": "Original grouping type for this configuration (3 types - Target, Resource, and Deployment).", - "optional": true, - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "ID of the widget type.", - "optional": true, - "computed": true - } - }, - "max_items": 1 - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "The default value as a JSON encoded string. To use a secret when the type is password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`.", - "optional": true, - "computed": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Key description.", - "optional": true, - "computed": true - }, - "display_name": { - "name": "display_name", - "type": "TypeString", - "description": "Display name for configuration type.", - "optional": true, - "computed": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "Hide values.", - "optional": true, - "computed": true - }, - "key": { - "name": "key", - "type": "TypeString", - "description": "Configuration key.", - "optional": true, - "computed": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of options of type.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeMap" - } - }, - "required": { - "name": "required", - "type": "TypeBool", - "description": "Is key required to install.", - "optional": true, - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Value type (string, boolean, int).", - "optional": true, - "computed": true - }, - "type_metadata": { - "name": "type_metadata", - "type": "TypeString", - "description": "The original type, as found in the source being onboarded.", - "optional": true, - "computed": true - }, - "value_constraint": { - "name": "value_constraint", - "type": "TypeString", - "description": "Constraint associated with value, e.g., for string type - regx:[a-z].", - "optional": true, - "computed": true - } - } - }, { "name": "deprecated", "type": "TypeBool", @@ -97543,35 +101211,35 @@ "computed": true }, { - "name": "version_id", + "name": "version_locator", "type": "TypeString", - "description": "Unique ID.", + "description": "A dotted value of `catalogID`.`versionID`.", "computed": true }, { - "name": "content", + "name": "format_kind", "type": "TypeString", - "description": "Byte array representing the content to be imported. Only supported for OVA images at this time.", + "description": "Format of content being onboarded. Example: vsi-image. Required for virtual server image for VPC.", "immutable": true, "optional": true }, { - "name": "format_kind", + "name": "repotype", "type": "TypeString", - "description": "Format of content being onboarded. Example: vsi-image. Required for virtual server image for VPC.", + "description": "The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'.", "immutable": true, "optional": true }, { - "name": "sha", - "type": "TypeString", - "description": "SHA256 fingerprint of the image file. Required for virtual server image for VPC.", + "name": "single_instance", + "type": "TypeBool", + "description": "Denotes if single instance can be deployed to a given cluster.", "computed": true }, { - "name": "updated", + "name": "package_version", "type": "TypeString", - "description": "The date and time this version was last updated.", + "description": "Version of the package used to create this version.", "computed": true }, { @@ -98268,473 +101936,645 @@ "max_items": 1 }, { - "name": "metadata", + "name": "content", + "type": "TypeString", + "description": "Byte array representing the content to be imported. Only supported for OVA images at this time.", + "immutable": true, + "optional": true + }, + { + "name": "deprecate", + "type": "TypeBool", + "description": "Deprecate this version.", + "optional": true + }, + { + "name": "usage", + "type": "TypeString", + "description": "The usage text for this version.", + "optional": true + }, + { + "name": "zipurl", + "type": "TypeString", + "description": "URL path to zip location. If not specified, must provide content in the body of this call.", + "immutable": true, + "optional": true + }, + { + "name": "image_manifest_url", + "type": "TypeString", + "description": "If set, denotes a url to a YAML file with list of container images used by this version.", + "computed": true + }, + { + "name": "is_vsi", + "type": "TypeBool", + "description": "Indicates that the current terraform template is used to install a virtual server image.", + "immutable": true, + "optional": true + }, + { + "name": "pre_install", "type": "TypeList", - "description": "Generic data to be included with content being onboarded. Required for virtual server image for VPC.", - "computed": true, + "description": "Optional pre-install instructions.", + "optional": true, "elem": { - "end_deploy_time": { - "name": "end_deploy_time", + "delete_script": { + "name": "delete_script", "type": "TypeString", - "description": "The time validation ended.", - "computed": true + "description": "Optional script that if run will remove the installed version.", + "optional": true }, - "est_deploy_time": { - "name": "est_deploy_time", - "type": "TypeFloat", - "description": "The estimated time validation takes.", - "computed": true + "instructions": { + "name": "instructions", + "type": "TypeString", + "description": "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.", + "optional": true }, - "example_name": { - "name": "example_name", + "instructions_i18n": { + "name": "instructions_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "scope": { + "name": "scope", "type": "TypeString", - "description": "Working directory of source files.", - "computed": true + "description": "Optional value indicating if this script is scoped to a namespace or the entire cluster.", + "optional": true }, - "modules": { - "name": "modules", + "script": { + "name": "script", + "type": "TypeString", + "description": "Optional script that needs to be run post any pre-condition script.", + "optional": true + }, + "script_permission": { + "name": "script_permission", + "type": "TypeString", + "description": "Optional iam permissions that are required on the target cluster to run this script.", + "optional": true + } + } + }, + { + "name": "tags", + "type": "TypeList", + "description": "Tags array.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "install_kind", + "type": "TypeString", + "description": "Install type. Example: instance. Required for virtual server image for VPC.", + "immutable": true, + "optional": true + }, + { + "name": "working_directory", + "type": "TypeString", + "description": "Optional - The sub-folder within the specified tgz file that contains the software being onboarded.", + "immutable": true, + "optional": true + }, + { + "name": "iam_permissions", + "type": "TypeList", + "description": "List of IAM permissions that are required to consume this version.", + "optional": true, + "elem": { + "resources": { + "name": "resources", "type": "TypeList", - "description": "Terraform modules.", - "computed": true, + "description": "Resources for this permission.", + "optional": true, "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Resource description.", + "optional": true + }, "name": { "name": "name", "type": "TypeString", - "description": "Name of the module.", - "computed": true + "description": "Resource name.", + "optional": true }, - "offering_reference": { - "name": "offering_reference", + "role_crns": { + "name": "role_crns", "type": "TypeList", - "description": "Terraform modules.", - "computed": true, + "description": "Role CRNs for this permission.", + "optional": true, "elem": { - "catalog_id": { - "name": "catalog_id", - "type": "TypeString", - "description": "Catalog ID of the module reference.", - "computed": true - }, - "flavor": { - "name": "flavor", - "type": "TypeString", - "description": "Flavor of the module.", - "computed": true - }, - "flavors": { - "name": "flavors", - "type": "TypeList", - "description": "Flavors of the module.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of the offering module.", - "computed": true - }, - "kind": { - "name": "kind", - "type": "TypeString", - "description": "Kind of the offeringmodule.", - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeString", - "description": "Metadata of the module.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the offering module.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Version of the offering module.", - "computed": true - } + "type": "TypeString" } - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of the module.", - "computed": true } } }, - "source_url": { - "name": "source_url", + "role_crns": { + "name": "role_crns", + "type": "TypeList", + "description": "Role CRNs for this permission.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "service_name": { + "name": "service_name", "type": "TypeString", - "description": "Version source URL.", - "computed": true + "description": "Service name.", + "optional": true + } + } + }, + { + "name": "import_sha", + "type": "TypeString", + "description": "SHA256 fingerprint of the image file. Required for virtual server image for VPC.", + "optional": true + }, + { + "name": "version_id", + "type": "TypeString", + "description": "Unique ID.", + "computed": true + }, + { + "name": "rev", + "type": "TypeString", + "description": "Cloudant revision.", + "computed": true + }, + { + "name": "created", + "type": "TypeString", + "description": "The date and time this version was created.", + "computed": true + }, + { + "name": "kind_id", + "type": "TypeString", + "description": "Kind ID.", + "computed": true + }, + { + "name": "validation", + "type": "TypeList", + "description": "Validation response.", + "computed": true, + "elem": { + "last_operation": { + "name": "last_operation", + "type": "TypeString", + "description": "Last operation (e.g. submit_deployment, generate_installer, install_offering.", + "optional": true }, - "start_deploy_time": { - "name": "start_deploy_time", + "message": { + "name": "message", "type": "TypeString", - "description": "The time validation started.", - "computed": true + "description": "Any message needing to be conveyed as part of the validation job.", + "optional": true }, - "terraform_version": { - "name": "terraform_version", + "requested": { + "name": "requested", "type": "TypeString", - "description": "Terraform version.", - "computed": true + "description": "Date and time of last validation was requested.", + "optional": true }, - "usage": { - "name": "usage", + "state": { + "name": "state", "type": "TypeString", - "description": "Usage text for the version.", - "computed": true + "description": "Current validation state - \u003cempty\u003e, in_progress, valid, invalid, expired.", + "optional": true }, - "usage_template": { - "name": "usage_template", + "target": { + "name": "target", + "type": "TypeMap", + "description": "Validation target information (e.g. cluster_id, region, namespace, etc). Values will vary by Content type.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "validated": { + "name": "validated", "type": "TypeString", - "description": "Usage text for the version.", + "description": "Date and time of last successful validation.", + "optional": true + } + } + }, + { + "name": "state", + "type": "TypeList", + "description": "Offering state.", + "computed": true, + "elem": { + "current": { + "name": "current", + "type": "TypeString", + "description": "one of: new, validated, account-published, ibm-published, public-published.", "computed": true }, - "validated_terraform_version": { - "name": "validated_terraform_version", + "current_entered": { + "name": "current_entered", "type": "TypeString", - "description": "Validated terraform version.", + "description": "Date and time of current request.", "computed": true }, - "version_name": { - "name": "version_name", + "pending": { + "name": "pending", "type": "TypeString", - "description": "Version name.", + "description": "one of: new, validated, account-published, ibm-published, public-published.", "computed": true }, - "vsi_vpc": { - "name": "vsi_vpc", - "type": "TypeList", - "description": "VSI VPC version information", - "computed": true, - "elem": { - "file": { - "name": "file", - "type": "TypeList", - "description": "Details for the stored image file. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "size": { - "name": "size", - "type": "TypeInt", - "description": "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.", - "computed": true - } - } - }, - "images": { - "name": "images", - "type": "TypeList", - "description": "Image operating system. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "Programmatic ID of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Programmatic name of virtual server image. Required for virtual server image for VPC.", - "computed": true - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "Region the virtual server image is available in. Required for virtual server image for VPC.", - "computed": true - } - } - }, - "minimum_provisioned_size": { - "name": "minimum_provisioned_size", - "type": "TypeInt", - "description": "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.", - "computed": true - }, - "operating_system": { - "name": "operating_system", - "type": "TypeList", - "description": "Operating system included in this image. Required for virtual server image for VPC.", - "computed": true, - "elem": { - "architecture": { - "name": "architecture", - "type": "TypeString", - "description": "Operating system architecture. Required for virtual server image for VPC.", - "computed": true - }, - "dedicated_host_only": { - "name": "dedicated_host_only", - "type": "TypeBool", - "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.", - "computed": true - }, - "display_name": { - "name": "display_name", - "type": "TypeString", - "description": "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "family": { - "name": "family", - "type": "TypeString", - "description": "Software family for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "URL for this operating system. Required for virtual server image for VPC.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Globally unique name for this operating system Required for virtual server image for VPC.", - "computed": true - }, - "vendor": { - "name": "vendor", - "type": "TypeString", - "description": "Vendor of the operating system. Required for virtual server image for VPC.", - "computed": true - }, - "version": { - "name": "version", - "type": "TypeString", - "description": "Major release version of this operating system. Required for virtual server image for VPC.", - "computed": true - } - } - } - } + "pending_requested": { + "name": "pending_requested", + "type": "TypeString", + "description": "Date and time of pending request.", + "computed": true }, - "working_directory": { - "name": "working_directory", + "previous": { + "name": "previous", "type": "TypeString", - "description": "Working directory of source files.", + "description": "one of: new, validated, account-published, ibm-published, public-published.", "computed": true } } }, { - "name": "iam_permissions", + "name": "catalog_id", + "type": "TypeString", + "description": "Catalog identifier.", + "immutable": true, + "required": true + }, + { + "name": "offering_id", + "type": "TypeString", + "description": "Offering identification.", + "immutable": true, + "required": true + }, + { + "name": "x_auth_token", + "type": "TypeString", + "description": "Authentication token used to access the specified zip file.", + "immutable": true, + "optional": true + }, + { + "name": "repo_url", + "type": "TypeString", + "description": "Content's repo URL.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of version. Required for virtual server image for VPC.", + "immutable": true, + "optional": true + }, + { + "name": "configuration", "type": "TypeList", - "description": "List of IAM permissions that are required to consume this version.", + "description": "List of user solicited overrides.", "optional": true, + "computed": true, "elem": { - "resources": { - "name": "resources", + "custom_config": { + "name": "custom_config", "type": "TypeList", - "description": "Resources for this permission.", + "description": "Render type.", "optional": true, + "computed": true, "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Resource description.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Resource name.", - "optional": true + "associations": { + "name": "associations", + "type": "TypeList", + "description": "List of parameters that are associated with this configuration.", + "optional": true, + "computed": true, + "elem": { + "parameters": { + "name": "parameters", + "type": "TypeList", + "description": "Parameters for this association.", + "optional": true, + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of this parameter.", + "optional": true, + "computed": true + }, + "options_refresh": { + "name": "options_refresh", + "type": "TypeBool", + "description": "Refresh options.", + "optional": true, + "computed": true + } + } + } + }, + "max_items": 1 }, - "role_crns": { - "name": "role_crns", - "type": "TypeList", - "description": "Role CRNs for this permission.", + "config_constraints": { + "name": "config_constraints", + "type": "TypeMap", + "description": "Map of constraint parameters that will be passed to the custom widget.", "optional": true, + "computed": true, "elem": { "type": "TypeString" } + }, + "grouping": { + "name": "grouping", + "type": "TypeString", + "description": "Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment).", + "optional": true, + "computed": true + }, + "grouping_index": { + "name": "grouping_index", + "type": "TypeInt", + "description": "Determines the order that this configuration item shows in that particular grouping.", + "optional": true, + "computed": true + }, + "original_grouping": { + "name": "original_grouping", + "type": "TypeString", + "description": "Original grouping type for this configuration (3 types - Target, Resource, and Deployment).", + "optional": true, + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "ID of the widget type.", + "optional": true, + "computed": true } - } + }, + "max_items": 1 }, - "role_crns": { - "name": "role_crns", - "type": "TypeList", - "description": "Role CRNs for this permission.", + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "The default value as a JSON encoded string. To use a secret when the type is password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`.", "optional": true, - "elem": { - "type": "TypeString" - } + "computed": true }, - "service_name": { - "name": "service_name", - "type": "TypeString", - "description": "Service name.", - "optional": true - } - } - }, - { - "name": "licenses", - "type": "TypeList", - "description": "List of licenses the product was built with.", - "optional": true, - "computed": true, - "elem": { "description": { "name": "description", "type": "TypeString", - "description": "License description.", + "description": "Key description.", "optional": true, "computed": true }, - "id": { - "name": "id", + "display_name": { + "name": "display_name", "type": "TypeString", - "description": "License ID.", + "description": "Display name for configuration type.", "optional": true, "computed": true }, - "name": { - "name": "name", + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "Hide values.", + "optional": true, + "computed": true + }, + "key": { + "name": "key", "type": "TypeString", - "description": "license name.", + "description": "Configuration key.", + "optional": true, + "computed": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of options of type.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeMap" + } + }, + "required": { + "name": "required", + "type": "TypeBool", + "description": "Is key required to install.", "optional": true, "computed": true }, "type": { "name": "type", "type": "TypeString", - "description": "type of license e.g., Apache xxx.", + "description": "Value type (string, boolean, int).", "optional": true, "computed": true }, - "url": { - "name": "url", + "type_metadata": { + "name": "type_metadata", "type": "TypeString", - "description": "URL for the license text.", + "description": "The original type, as found in the source being onboarded.", + "optional": true, + "computed": true + }, + "value_constraint": { + "name": "value_constraint", + "type": "TypeString", + "description": "Constraint associated with value, e.g., for string type - regx:[a-z].", "optional": true, "computed": true } } }, { - "name": "image_manifest_url", + "name": "image_pull_key_name", "type": "TypeString", - "description": "If set, denotes a url to a YAML file with list of container images used by this version.", + "description": "ID of the image pull key to use from Offering.ImagePullKeys.", "computed": true }, { - "name": "offering_id", - "type": "TypeString", - "description": "Offering identification.", - "immutable": true, - "required": true + "name": "deprecate_pending", + "type": "TypeList", + "description": "Deprecation information for a Version.", + "computed": true, + "elem": { + "deprecate_date": { + "name": "deprecate_date", + "type": "TypeString", + "description": "Date of deprecation.", + "computed": true + }, + "deprecate_state": { + "name": "deprecate_state", + "type": "TypeString", + "description": "Deprecation state.", + "computed": true + }, + "description": { + "name": "description", + "type": "TypeString", + "computed": true + } + } }, { - "name": "name", + "name": "is_consumable", + "type": "TypeBool", + "description": "Is the version able to be shared.", + "computed": true + }, + { + "name": "version", "type": "TypeString", - "description": "Name of version. Required for virtual server image for VPC.", - "immutable": true, - "optional": true + "description": "Semantic version of the software being onboarded. Required for virtual server image for VPC.", + "computed": true }, { - "name": "include_config", - "type": "TypeBool", - "description": "Add all possible configuration values to this version when importing.", - "immutable": true, - "optional": true - } - ], - "ibm_code_engine_app": [ + "name": "outputs", + "type": "TypeList", + "description": "List of output values for this version.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Output description.", + "optional": true + }, + "key": { + "name": "key", + "type": "TypeString", + "description": "Output key.", + "optional": true + } + } + }, { - "name": "project_id", - "type": "TypeString", - "description": "The ID of the project.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + "name": "required_resources", + "type": "TypeList", + "description": "Resource requirments for installation.", + "computed": true, + "elem": { + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of requirement.", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "mem, disk, cores, and nodes can be parsed as an int. targetVersion will be a semver range value.", + "optional": true + } + } }, { - "name": "image_port", - "type": "TypeInt", - "description": "Optional port the app listens on. While the app will always be exposed via port `443` for end users, this port is used to connect to the port that is exposed by the container image.", - "default_value": 8080, + "name": "label", + "type": "TypeString", + "description": "Display name of version. Required for virtual server image for VPC.", "optional": true }, { - "name": "run_commands", + "name": "target_kinds", "type": "TypeList", - "description": "Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", + "description": "Deployment target of the content being onboarded. Current valid values are iks, roks, vcenter, power-iaas, terraform, and vpc-x86. Required for virtual server image for VPC.", + "immutable": true, "optional": true, "elem": { "type": "TypeString" } }, { - "name": "run_volume_mounts", + "name": "crn", + "type": "TypeString", + "description": "Version's CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "long_description_i18n", + "type": "TypeMap", + "description": "A map of translated strings, by language code.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "source_url", + "type": "TypeString", + "description": "Content's source URL (e.g git repo).", + "computed": true + } + ], + "ibm_code_engine_app": [ + { + "name": "endpoint", + "type": "TypeString", + "description": "Optional URL to invoke app. Depending on visibility this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.", + "computed": true + }, + { + "name": "status_details", "type": "TypeList", - "description": "Optional mounts of config maps or a secrets.", - "optional": true, + "description": "The detailed status of the application.", + "computed": true, "elem": { - "mount_path": { - "name": "mount_path", - "type": "TypeString", - "description": "The path that should be mounted.", - "required": true - }, - "name": { - "name": "name", + "latest_created_revision": { + "name": "latest_created_revision", "type": "TypeString", - "description": "Optional name of the mount. If not set, it will be generated based on the `ref` and a random ID. In case the `ref` is longer than 58 characters, it will be cut off.", - "optional": true + "description": "Latest app revision that has been created.", + "computed": true }, - "reference": { - "name": "reference", + "latest_ready_revision": { + "name": "latest_ready_revision", "type": "TypeString", - "description": "The name of the referenced secret or config map.", - "required": true + "description": "Latest app revision that reached a ready state.", + "computed": true }, - "type": { - "name": "type", + "reason": { + "name": "reason", "type": "TypeString", - "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", - "required": true + "description": "Optional information to provide more context in case of a 'failed' or 'warning' status.", + "computed": true } } }, { - "name": "scale_concurrency_target", - "type": "TypeInt", - "description": "Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the `scale_concurrency` option, if not specified.", - "optional": true - }, - { - "name": "scale_cpu_limit", + "name": "etag", "type": "TypeString", - "description": "Optional number of CPU set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", - "default_value": "1", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", - "optional": true + "computed": true }, { - "name": "scale_ephemeral_storage_limit", + "name": "managed_domain_mappings", "type": "TypeString", - "description": "Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", - "default_value": "400M", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "description": "Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.", + "default_value": "local_public", + "options": "local, local_private, local_public", "optional": true }, { @@ -98745,9 +102585,9 @@ "optional": true }, { - "name": "app_id", + "name": "endpoint_internal", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "URL to app that is only visible within the project.", "computed": true }, { @@ -98765,6 +102605,49 @@ "type": "TypeString" } }, + { + "name": "scale_concurrency", + "type": "TypeInt", + "description": "Optional maximum number of requests that can be processed concurrently per instance.", + "default_value": 100, + "optional": true + }, + { + "name": "image_port", + "type": "TypeInt", + "description": "Optional port the app listens on. While the app will always be exposed via port `443` for end users, this port is used to connect to the port that is exposed by the container image.", + "default_value": 8080, + "optional": true + }, + { + "name": "app_id", + "type": "TypeString", + "description": "The identifier of the resource.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "When you provision a new app, a URL is created identifying the location of the instance.", + "computed": true + }, + { + "name": "project_id", + "type": "TypeString", + "description": "The ID of the project.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + }, + { + "name": "scale_max_instances", + "type": "TypeInt", + "description": "Optional maximum number of instances for this app. If you set this value to `0`, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See [Limits and quotas for Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-limits).", + "default_value": 10, + "optional": true + }, { "name": "run_service_account", "type": "TypeString", @@ -98775,11 +102658,33 @@ "optional": true }, { - "name": "created_at", + "name": "scale_concurrency_target", + "type": "TypeInt", + "description": "Optional threshold of concurrent requests per instance at which one or more additional instances are created. Use this value to scale up instances based on concurrent number of requests. This option defaults to the value of the `scale_concurrency` option, if not specified.", + "optional": true + }, + { + "name": "status", "type": "TypeString", - "description": "The timestamp when the resource was created.", + "description": "The current status of the app.", "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the app. Use a name that is unique within the project.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^[a-z]([-a-z0-9]*[a-z0-9])?$" + }, + { + "name": "run_as_user", + "type": "TypeInt", + "description": "Optional user ID (UID) to run the app (e.g., `1001`).", + "optional": true + }, { "name": "image_reference", "type": "TypeString", @@ -98790,113 +102695,90 @@ "matches": "^([a-z0-9][a-z0-9\\-_.]+[a-z0-9][\\/])?([a-z0-9][a-z0-9\\-_]+[a-z0-9][\\/])?[a-z0-9][a-z0-9\\-_.\\/]+[a-z0-9](:[\\w][\\w.\\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$" }, { - "name": "name", + "name": "entity_tag", "type": "TypeString", - "description": "The name of the app. Use a name that is unique within the project.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^[a-z]([-a-z0-9]*[a-z0-9])?$" + "description": "The version of the app instance, which is used to achieve optimistic locking.", + "computed": true }, { - "name": "managed_domain_mappings", + "name": "scale_memory_limit", "type": "TypeString", - "description": "Optional value controlling which of the system managed domain mappings will be setup for the application. Valid values are 'local_public', 'local_private' and 'local'. Visibility can only be 'local_private' if the project supports application private visibility.", - "default_value": "local_public", - "options": "local, local_private, local_public", + "description": "Optional amount of memory set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "default_value": "4G", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", "optional": true }, { - "name": "run_env_variables", + "name": "created_at", + "type": "TypeString", + "description": "The timestamp when the resource was created.", + "computed": true + }, + { + "name": "run_commands", "type": "TypeList", - "description": "Optional references to config maps, secrets or literal values that are exposed as environment variables within the running application.", + "description": "Optional commands for the app that are passed to start the container. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", "optional": true, "elem": { - "key": { - "name": "key", + "type": "TypeString" + } + }, + { + "name": "scale_cpu_limit", + "type": "TypeString", + "description": "Optional number of CPU set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", + "default_value": "1", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "optional": true + }, + { + "name": "run_volume_mounts", + "type": "TypeList", + "description": "Optional mounts of config maps or a secrets.", + "optional": true, + "elem": { + "mount_path": { + "name": "mount_path", "type": "TypeString", - "description": "The key to reference as environment variable.", - "optional": true + "description": "The path that should be mounted.", + "required": true }, "name": { "name": "name", "type": "TypeString", - "description": "The name of the environment variable.", - "optional": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "A prefix that can be added to all keys of a full secret or config map reference.", + "description": "Optional name of the mount. If not set, it will be generated based on the `ref` and a random ID. In case the `ref` is longer than 58 characters, it will be cut off.", "optional": true }, "reference": { "name": "reference", "type": "TypeString", - "description": "The name of the secret or config map.", - "optional": true + "description": "The name of the referenced secret or config map.", + "required": true }, "type": { "name": "type", "type": "TypeString", - "description": "Specify the type of the environment variable.", - "default_value": "literal", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "The literal value of the environment variable.", - "optional": true + "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", + "required": true } } }, { - "name": "scale_initial_instances", - "type": "TypeInt", - "description": "Optional initial number of instances that are created upon app creation or app update.", - "default_value": 1, - "optional": true - }, - { - "name": "endpoint", - "type": "TypeString", - "description": "Optional URL to invoke app. Depending on visibility this is accessible publicly or in the private network only. Empty in case 'managed_domain_mappings' is set to 'local'.", - "computed": true - }, - { - "name": "endpoint_internal", - "type": "TypeString", - "description": "URL to app that is only visible within the project.", - "computed": true - }, - { - "name": "entity_tag", - "type": "TypeString", - "description": "The version of the app instance, which is used to achieve optimistic locking.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "When you provision a new app, a URL is created identifying the location of the instance.", - "computed": true - }, - { - "name": "image_secret", + "name": "scale_ephemeral_storage_limit", "type": "TypeString", - "description": "Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.", - "min_length": 1, - "max_length": 253, - "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$", + "description": "Optional amount of ephemeral storage to set for the instance of the app. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "default_value": "400M", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", "optional": true }, { - "name": "scale_concurrency", + "name": "scale_initial_instances", "type": "TypeInt", - "description": "Optional maximum number of requests that can be processed concurrently per instance.", - "default_value": 100, + "description": "Optional initial number of instances that are created upon app creation or app update.", + "default_value": 1, "optional": true }, { @@ -98907,66 +102789,77 @@ "optional": true }, { - "name": "etag", - "type": "TypeString", - "computed": true - }, - { - "name": "run_as_user", - "type": "TypeInt", - "description": "Optional user ID (UID) to run the app (e.g., `1001`).", - "optional": true - }, - { - "name": "scale_max_instances", - "type": "TypeInt", - "description": "Optional maximum number of instances for this app. If you set this value to `0`, this property does not set a upper scaling limit. However, the app scaling is still limited by the project quota for instances. See [Limits and quotas for Code Engine](https://cloud.ibm.com/docs/codeengine?topic=codeengine-limits).", - "default_value": 10, - "optional": true - }, - { - "name": "scale_memory_limit", + "name": "image_secret", "type": "TypeString", - "description": "Optional amount of memory set for the instance of the app. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", - "default_value": "4G", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "description": "Optional name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the app will be created but cannot reach the ready status, until this property is provided, too.", + "min_length": 1, + "max_length": 253, + "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$", "optional": true }, { - "name": "status", - "type": "TypeString", - "description": "The current status of the app.", - "computed": true - }, - { - "name": "status_details", + "name": "run_env_variables", "type": "TypeList", - "description": "The detailed status of the application.", - "computed": true, + "description": "Optional references to config maps, secrets or literal values that are exposed as environment variables within the running application.", + "optional": true, "elem": { - "latest_created_revision": { - "name": "latest_created_revision", + "key": { + "name": "key", "type": "TypeString", - "description": "Latest app revision that has been created.", - "computed": true + "description": "The key to reference as environment variable.", + "optional": true }, - "latest_ready_revision": { - "name": "latest_ready_revision", + "name": { + "name": "name", "type": "TypeString", - "description": "Latest app revision that reached a ready state.", - "computed": true + "description": "The name of the environment variable.", + "optional": true }, - "reason": { - "name": "reason", + "prefix": { + "name": "prefix", "type": "TypeString", - "description": "Optional information to provide more context in case of a 'failed' or 'warning' status.", - "computed": true + "description": "A prefix that can be added to all keys of a full secret or config map reference.", + "optional": true + }, + "reference": { + "name": "reference", + "type": "TypeString", + "description": "The name of the secret or config map.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Specify the type of the environment variable.", + "default_value": "literal", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The literal value of the environment variable.", + "optional": true } } } ], "ibm_code_engine_binding": [ + { + "name": "secret_name", + "type": "TypeString", + "description": "The service access secret that is binding to a component.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 253, + "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$" + }, + { + "name": "href", + "type": "TypeString", + "description": "When you provision a new binding, a URL is created identifying the location of the instance.", + "computed": true + }, { "name": "resource_type", "type": "TypeString", @@ -99026,25 +102919,23 @@ "required": true, "max_length": 31, "matches": "^[A-Z]([_A-Z0-9]*[A-Z0-9])*$" - }, + } + ], + "ibm_code_engine_build": [ { - "name": "secret_name", + "name": "status", "type": "TypeString", - "description": "The service access secret that is binding to a component.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 253, - "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$" + "description": "The current status of the build.", + "computed": true }, { - "name": "href", + "name": "source_context_dir", "type": "TypeString", - "description": "When you provision a new binding, a URL is created identifying the location of the instance.", - "computed": true - } - ], - "ibm_code_engine_build": [ + "description": "Option directory in the repository that contains the buildpacks file or the Dockerfile.", + "max_length": 253, + "matches": "^(.*)+$", + "optional": true + }, { "name": "strategy_size", "type": "TypeString", @@ -99056,50 +102947,43 @@ "optional": true }, { - "name": "strategy_spec_file", + "name": "strategy_type", "type": "TypeString", - "description": "Optional path to the specification file that is used for build strategies for building an image.", - "default_value": "Dockerfile", + "description": "The strategy to use for building the image.", + "required": true, "min_length": 1, "max_length": 253, - "matches": "^[\\S]*$", - "optional": true + "matches": "[\\S]*" }, { - "name": "timeout", - "type": "TypeInt", - "description": "The maximum amount of time, in seconds, that can pass before the build must succeed or fail.", - "default_value": 600, - "min_value": "1", - "max_value": "3600", - "optional": true + "name": "href", + "type": "TypeString", + "description": "When you provision a new build, a URL is created identifying the location of the instance.", + "computed": true }, { - "name": "project_id", + "name": "etag", "type": "TypeString", - "description": "The ID of the project.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + "computed": true }, { - "name": "strategy_type", + "name": "name", "type": "TypeString", - "description": "The strategy to use for building the image.", + "description": "The name of the build. Use a name that is unique within the project.", + "immutable": true, "required": true, "min_length": 1, - "max_length": 253, - "matches": "[\\S]*" + "max_length": 63, + "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?$" }, { - "name": "source_context_dir", + "name": "output_image", "type": "TypeString", - "description": "Option directory in the repository that contains the buildpacks file or the Dockerfile.", - "max_length": 253, - "matches": "^(.*)+$", - "optional": true + "description": "The name of the image.", + "required": true, + "min_length": 1, + "max_length": 256, + "matches": "^([a-z0-9][a-z0-9\\-_.]+[a-z0-9][\\/])?([a-z0-9][a-z0-9\\-_]+[a-z0-9][\\/])?[a-z0-9][a-z0-9\\-_.\\/]+[a-z0-9](:[\\w][\\w.\\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$" }, { "name": "source_type", @@ -99119,27 +103003,48 @@ "optional": true }, { - "name": "created_at", + "name": "strategy_spec_file", "type": "TypeString", - "description": "The timestamp when the resource was created.", - "computed": true + "description": "Optional path to the specification file that is used for build strategies for building an image.", + "default_value": "Dockerfile", + "min_length": 1, + "max_length": 253, + "matches": "^[\\S]*$", + "optional": true }, { - "name": "href", + "name": "build_id", "type": "TypeString", - "description": "When you provision a new build, a URL is created identifying the location of the instance.", + "description": "The identifier of the resource.", "computed": true }, { - "name": "build_id", + "name": "resource_type", "type": "TypeString", - "description": "The identifier of the resource.", + "description": "The type of the build.", "computed": true }, { - "name": "etag", + "name": "status_details", + "type": "TypeList", + "description": "The detailed status of the build.", + "computed": true, + "elem": { + "reason": { + "name": "reason", + "type": "TypeString", + "description": "Optional information to provide more context in case of a 'failed' or 'warning' status.", + "computed": true + } + } + }, + { + "name": "source_revision", "type": "TypeString", - "computed": true + "description": "Commit, tag, or branch in the source repository to pull. This field is optional if the `source_type` is `git` and uses the HEAD of default branch if not specified. If the `source_type` value is `local`, this field must be omitted.", + "max_length": 253, + "matches": "^[\\S]*$", + "optional": true }, { "name": "source_secret", @@ -99151,49 +103056,35 @@ "optional": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the build. Use a name that is unique within the project.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?$" - }, - { - "name": "output_image", - "type": "TypeString", - "description": "The name of the image.", - "required": true, - "min_length": 1, - "max_length": 256, - "matches": "^([a-z0-9][a-z0-9\\-_.]+[a-z0-9][\\/])?([a-z0-9][a-z0-9\\-_]+[a-z0-9][\\/])?[a-z0-9][a-z0-9\\-_.\\/]+[a-z0-9](:[\\w][\\w.\\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$" + "name": "timeout", + "type": "TypeInt", + "description": "The maximum amount of time, in seconds, that can pass before the build must succeed or fail.", + "default_value": 600, + "min_value": "1", + "max_value": "3600", + "optional": true }, { - "name": "resource_type", + "name": "created_at", "type": "TypeString", - "description": "The type of the build.", + "description": "The timestamp when the resource was created.", "computed": true }, { - "name": "status", + "name": "entity_tag", "type": "TypeString", - "description": "The current status of the build.", + "description": "The version of the build instance, which is used to achieve optimistic locking.", "computed": true }, { - "name": "status_details", - "type": "TypeList", - "description": "The detailed status of the build.", - "computed": true, - "elem": { - "reason": { - "name": "reason", - "type": "TypeString", - "description": "Optional information to provide more context in case of a 'failed' or 'warning' status.", - "computed": true - } - } + "name": "project_id", + "type": "TypeString", + "description": "The ID of the project.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" }, { "name": "output_secret", @@ -99203,23 +103094,20 @@ "min_length": 1, "max_length": 253, "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$" - }, + } + ], + "ibm_code_engine_config_map": [ { - "name": "source_revision", + "name": "resource_type", "type": "TypeString", - "description": "Commit, tag, or branch in the source repository to pull. This field is optional if the `source_type` is `git` and uses the HEAD of default branch if not specified. If the `source_type` value is `local`, this field must be omitted.", - "max_length": 253, - "matches": "^[\\S]*$", - "optional": true + "description": "The type of the config map.", + "computed": true }, { - "name": "entity_tag", + "name": "etag", "type": "TypeString", - "description": "The version of the build instance, which is used to achieve optimistic locking.", "computed": true - } - ], - "ibm_code_engine_config_map": [ + }, { "name": "project_id", "type": "TypeString", @@ -99230,15 +103118,6 @@ "max_length": 36, "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" }, - { - "name": "data", - "type": "TypeMap", - "description": "The key-value pair for the config map. Values must be specified in `KEY=VALUE` format. Each `KEY` field must consist of alphanumeric characters, `-`, `_` or `.` and must not be exceed a max length of 253 characters. Each `VALUE` field can consists of any character and must not be exceed a max length of 1048576 characters.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "created_at", "type": "TypeString", @@ -99252,14 +103131,15 @@ "computed": true }, { - "name": "resource_type", + "name": "href", "type": "TypeString", - "description": "The type of the config map.", + "description": "When you provision a new config map, a URL is created identifying the location of the instance.", "computed": true }, { - "name": "etag", + "name": "config_map_id", "type": "TypeString", + "description": "The identifier of the resource.", "computed": true }, { @@ -99273,33 +103153,27 @@ "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$" }, { - "name": "href", - "type": "TypeString", - "description": "When you provision a new config map, a URL is created identifying the location of the instance.", - "computed": true - }, - { - "name": "config_map_id", - "type": "TypeString", - "description": "The identifier of the resource.", - "computed": true + "name": "data", + "type": "TypeMap", + "description": "The key-value pair for the config map. Values must be specified in `KEY=VALUE` format. Each `KEY` field must consist of alphanumeric characters, `-`, `_` or `.` and must not be exceed a max length of 253 characters. Each `VALUE` field can consists of any character and must not be exceed a max length of 1048576 characters.", + "optional": true, + "elem": { + "type": "TypeString" + } } ], "ibm_code_engine_job": [ { - "name": "resource_type", + "name": "href", "type": "TypeString", - "description": "The type of the job.", + "description": "When you provision a new job, a URL is created identifying the location of the instance.", "computed": true }, { - "name": "image_reference", + "name": "resource_type", "type": "TypeString", - "description": "The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY` and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the default is `latest`. If the image reference points to a registry that requires authentication, make sure to also specify the property `image_secret`.", - "required": true, - "min_length": 1, - "max_length": 256, - "matches": "^([a-z0-9][a-z0-9\\-_.]+[a-z0-9][\\/])?([a-z0-9][a-z0-9\\-_]+[a-z0-9][\\/])?[a-z0-9][a-z0-9\\-_.\\/]+[a-z0-9](:[\\w][\\w.\\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$" + "description": "The type of the job.", + "computed": true }, { "name": "run_as_user", @@ -99308,66 +103182,6 @@ "default_value": 0, "optional": true }, - { - "name": "run_mode", - "type": "TypeString", - "description": "The mode for runs of the job. Valid values are `task` and `daemon`. In `task` mode, the `max_execution_time` and `retry_limit` properties apply. In `daemon` mode, since there is no timeout and failed instances are restarted indefinitely, the `max_execution_time` and `retry_limit` properties are not allowed.", - "default_value": "task", - "options": "daemon, task", - "matches": "^(task|daemon)$", - "optional": true - }, - { - "name": "scale_array_spec", - "type": "TypeString", - "description": "Define a custom set of array indices as comma-separated list containing single values and hyphen-separated ranges like `5,12-14,23,27`. Each instance can pick up its array index via environment variable `JOB_INDEX`. The number of unique array indices specified here determines the number of job instances to run.", - "default_value": "0", - "min_length": 1, - "max_length": 253, - "matches": "^(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d)(?:-(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d))?(?:,(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d)(?:-(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d))?)*$", - "optional": true - }, - { - "name": "scale_max_execution_time", - "type": "TypeInt", - "description": "The maximum execution time in seconds for runs of the job. This property can only be specified if `run_mode` is `task`.", - "default_value": 7200, - "optional": true - }, - { - "name": "scale_memory_limit", - "type": "TypeString", - "description": "Optional amount of memory set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", - "default_value": "4G", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", - "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The timestamp when the resource was created.", - "computed": true - }, - { - "name": "image_secret", - "type": "TypeString", - "description": "The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.", - "min_length": 1, - "max_length": 253, - "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the job. Use a name that is unique within the project.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?$" - }, { "name": "run_env_variables", "type": "TypeList", @@ -99413,6 +103227,63 @@ } } }, + { + "name": "run_volume_mounts", + "type": "TypeList", + "description": "Optional mounts of config maps or a secrets.", + "optional": true, + "elem": { + "mount_path": { + "name": "mount_path", + "type": "TypeString", + "description": "The path that should be mounted.", + "required": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Optional name of the mount. If not set, it will be generated based on the `ref` and a random ID. In case the `ref` is longer than 58 characters, it will be cut off.", + "optional": true + }, + "reference": { + "name": "reference", + "type": "TypeString", + "description": "The name of the referenced secret or config map.", + "required": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", + "required": true + } + } + }, + { + "name": "scale_memory_limit", + "type": "TypeString", + "description": "Optional amount of memory set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo). The units for specifying memory are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "default_value": "4G", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "optional": true + }, + { + "name": "scale_ephemeral_storage_limit", + "type": "TypeString", + "description": "Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", + "default_value": "400M", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "optional": true + }, + { + "name": "scale_max_execution_time", + "type": "TypeInt", + "description": "The maximum execution time in seconds for runs of the job. This property can only be specified if `run_mode` is `task`.", + "default_value": 7200, + "optional": true + }, { "name": "scale_retry_limit", "type": "TypeInt", @@ -99421,26 +103292,29 @@ "optional": true }, { - "name": "entity_tag", + "name": "created_at", "type": "TypeString", - "description": "The version of the job instance, which is used to achieve optimistic locking.", + "description": "The timestamp when the resource was created.", "computed": true }, { - "name": "href", + "name": "name", "type": "TypeString", - "description": "When you provision a new job, a URL is created identifying the location of the instance.", - "computed": true + "description": "The name of the job. Use a name that is unique within the project.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?$" }, { - "name": "project_id", + "name": "image_secret", "type": "TypeString", - "description": "The ID of the project.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + "description": "The name of the image registry access secret. The image registry access secret is used to authenticate with a private registry when you download the container image. If the image reference points to a registry that requires authentication, the job / job runs will be created but submitted job runs will fail, until this property is provided, too. This property must not be set on a job run, which references a job template.", + "min_length": 1, + "max_length": 253, + "matches": "^[a-z0-9]([\\-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([\\-a-z0-9]*[a-z0-9])?)*$", + "optional": true }, { "name": "run_arguments", @@ -99452,13 +103326,37 @@ } }, { - "name": "run_commands", - "type": "TypeList", - "description": "Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "scale_cpu_limit", + "type": "TypeString", + "description": "Optional amount of CPU set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", + "default_value": "1", + "max_length": 10, + "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "optional": true + }, + { + "name": "etag", + "type": "TypeString", + "computed": true + }, + { + "name": "project_id", + "type": "TypeString", + "description": "The ID of the project.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + }, + { + "name": "image_reference", + "type": "TypeString", + "description": "The name of the image that is used for this job. The format is `REGISTRY/NAMESPACE/REPOSITORY:TAG` where `REGISTRY` and `TAG` are optional. If `REGISTRY` is not specified, the default is `docker.io`. If `TAG` is not specified, the default is `latest`. If the image reference points to a registry that requires authentication, make sure to also specify the property `image_secret`.", + "required": true, + "min_length": 1, + "max_length": 256, + "matches": "^([a-z0-9][a-z0-9\\-_.]+[a-z0-9][\\/])?([a-z0-9][a-z0-9\\-_]+[a-z0-9][\\/])?[a-z0-9][a-z0-9\\-_.\\/]+[a-z0-9](:[\\w][\\w.\\-]{0,127})?(@sha256:[a-fA-F0-9]{64})?$" }, { "name": "run_service_account", @@ -99470,74 +103368,47 @@ "optional": true }, { - "name": "run_volume_mounts", + "name": "job_id", + "type": "TypeString", + "description": "The identifier of the resource.", + "computed": true + }, + { + "name": "run_commands", "type": "TypeList", - "description": "Optional mounts of config maps or a secrets.", + "description": "Set commands for the job that are passed to start job run containers. If not specified an empty string array will be applied and the command specified by the container image, will be used to start the container.", "optional": true, "elem": { - "mount_path": { - "name": "mount_path", - "type": "TypeString", - "description": "The path that should be mounted.", - "required": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Optional name of the mount. If not set, it will be generated based on the `ref` and a random ID. In case the `ref` is longer than 58 characters, it will be cut off.", - "optional": true - }, - "reference": { - "name": "reference", - "type": "TypeString", - "description": "The name of the referenced secret or config map.", - "required": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Specify the type of the volume mount. Allowed types are: 'config_map', 'secret'.", - "required": true - } + "type": "TypeString" } }, { - "name": "scale_cpu_limit", + "name": "run_mode", "type": "TypeString", - "description": "Optional amount of CPU set for the instance of the job. For valid values see [Supported memory and CPU combinations](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo).", - "default_value": "1", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "description": "The mode for runs of the job. Valid values are `task` and `daemon`. In `task` mode, the `max_execution_time` and `retry_limit` properties apply. In `daemon` mode, since there is no timeout and failed instances are restarted indefinitely, the `max_execution_time` and `retry_limit` properties are not allowed.", + "default_value": "task", + "options": "daemon, task", + "matches": "^(task|daemon)$", "optional": true }, { - "name": "scale_ephemeral_storage_limit", + "name": "scale_array_spec", "type": "TypeString", - "description": "Optional amount of ephemeral storage to set for the instance of the job. The amount specified as ephemeral storage, must not exceed the amount of `scale_memory_limit`. The units for specifying ephemeral storage are Megabyte (M) or Gigabyte (G), whereas G and M are the shorthand expressions for GB and MB. For more information see [Units of measurement](https://cloud.ibm.com/docs/codeengine?topic=codeengine-mem-cpu-combo#unit-measurements).", - "default_value": "400M", - "max_length": 10, - "matches": "^([0-9.]+)([eEinumkKMGTPB]*)$", + "description": "Define a custom set of array indices as comma-separated list containing single values and hyphen-separated ranges like `5,12-14,23,27`. Each instance can pick up its array index via environment variable `JOB_INDEX`. The number of unique array indices specified here determines the number of job instances to run.", + "default_value": "0", + "min_length": 1, + "max_length": 253, + "matches": "^(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d)(?:-(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d))?(?:,(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d)(?:-(?:[1-9]\\d\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d\\d|[1-9]\\d\\d\\d\\d|[1-9]\\d\\d\\d|[1-9]\\d\\d|[1-9]?\\d))?)*$", "optional": true }, { - "name": "job_id", - "type": "TypeString", - "description": "The identifier of the resource.", - "computed": true - }, - { - "name": "etag", + "name": "entity_tag", "type": "TypeString", + "description": "The version of the job instance, which is used to achieve optimistic locking.", "computed": true } ], "ibm_code_engine_project": [ - { - "name": "created_at", - "type": "TypeString", - "description": "The timestamp when the project was created.", - "computed": true - }, { "name": "crn", "type": "TypeString", @@ -99559,14 +103430,14 @@ "computed": true }, { - "name": "name", + "name": "resource_group_id", "type": "TypeString", - "description": "The name of the project.", + "description": "Optional ID of the resource group for your project deployment. If this field is not defined, the default resource group of the account will be used.", "immutable": true, - "required": true, - "min_length": 1, - "max_length": 128, - "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9\\-._: ])+$" + "min_length": 32, + "max_length": 32, + "matches": "^[a-z0-9]*$", + "optional": true }, { "name": "project_id", @@ -99581,14 +103452,10 @@ "computed": true }, { - "name": "resource_group_id", + "name": "created_at", "type": "TypeString", - "description": "Optional ID of the resource group for your project deployment. If this field is not defined, the default resource group of the account will be used.", - "immutable": true, - "min_length": 32, - "max_length": 32, - "matches": "^[a-z0-9]*$", - "optional": true + "description": "The timestamp when the project was created.", + "computed": true }, { "name": "href", @@ -99601,9 +103468,29 @@ "type": "TypeString", "description": "The current state of the project. For example, if the project is created and ready to get used, it will return active.", "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the project.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 128, + "matches": "^([^\\x00-\\x7F]|[a-zA-Z0-9\\-._: ])+$" } ], "ibm_code_engine_secret": [ + { + "name": "project_id", + "type": "TypeString", + "description": "The ID of the project.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" + }, { "name": "format", "type": "TypeString", @@ -99620,9 +103507,9 @@ "computed": true }, { - "name": "href", + "name": "secret_id", "type": "TypeString", - "description": "When you provision a new secret, a URL is created identifying the location of the instance.", + "description": "The identifier of the resource.", "computed": true }, { @@ -99630,40 +103517,12 @@ "type": "TypeString", "computed": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "The timestamp when the resource was created.", - "computed": true - }, - { - "name": "id", - "type": "TypeString", - "description": "The identifier of the resource.", - "computed": true - }, { "name": "resource_type", "type": "TypeString", "description": "The type of the secret.", "computed": true }, - { - "name": "secret_id", - "type": "TypeString", - "description": "The identifier of the resource.", - "computed": true - }, - { - "name": "project_id", - "type": "TypeString", - "description": "The ID of the project.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$" - }, { "name": "name", "type": "TypeString", @@ -99758,6 +103617,24 @@ } }, "max_items": 1 + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp when the resource was created.", + "computed": true + }, + { + "name": "href", + "type": "TypeString", + "description": "When you provision a new secret, a URL is created identifying the location of the instance.", + "computed": true + }, + { + "name": "id", + "type": "TypeString", + "description": "The identifier of the resource.", + "computed": true } ], "ibm_compute_autoscale_group": [ @@ -99768,9 +103645,15 @@ "required": true }, { - "name": "maximum_member_count", + "name": "minimum_member_count", "type": "TypeInt", - "description": "Maximum member count", + "description": "Minimum member count", + "required": true + }, + { + "name": "termination_policy", + "type": "TypeString", + "description": "Termination policy", "required": true }, { @@ -99780,12 +103663,13 @@ "optional": true }, { - "name": "network_vlan_ids", + "name": "tags", "type": "TypeSet", - "description": "List of network VLAN ids", + "description": "List of tags", + "cloud_data_type": "tags", "optional": true, "elem": { - "type": "TypeInt" + "type": "TypeString" } }, { @@ -99796,9 +103680,9 @@ "required": true }, { - "name": "minimum_member_count", + "name": "maximum_member_count", "type": "TypeInt", - "description": "Minimum member count", + "description": "Maximum member count", "required": true }, { @@ -99807,12 +103691,6 @@ "description": "Cooldown value", "required": true }, - { - "name": "termination_policy", - "type": "TypeString", - "description": "Termination policy", - "required": true - }, { "name": "virtual_server_id", "type": "TypeInt", @@ -100191,13 +104069,12 @@ } }, { - "name": "tags", + "name": "network_vlan_ids", "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", + "description": "List of network VLAN ids", "optional": true, "elem": { - "type": "TypeString" + "type": "TypeInt" } } ], @@ -100304,6 +104181,26 @@ } ], "ibm_compute_bare_metal": [ + { + "name": "private_vlan_id", + "type": "TypeInt", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "secondary_ip_count", + "type": "TypeInt", + "description": "Secondary IP addresses count", + "immutable": true, + "optional": true + }, + { + "name": "global_identifier", + "type": "TypeString", + "description": "The unique global identifier of the bare metal server", + "computed": true + }, { "name": "tags", "type": "TypeSet", @@ -100314,17 +104211,33 @@ } }, { - "name": "software_guard_extensions", + "name": "private_network_only", "type": "TypeBool", + "description": "only private network configured if is true", "default_value": false, "immutable": true, "optional": true }, { - "name": "gpu_key_name", - "type": "TypeString", + "name": "public_bandwidth", + "type": "TypeInt", "immutable": true, - "optional": true + "optional": true, + "computed": true + }, + { + "name": "private_ipv4_address_id", + "type": "TypeInt", + "computed": true + }, + { + "name": "block_storage_ids", + "type": "TypeSet", + "optional": true, + "computed": true, + "elem": { + "type": "TypeInt" + } }, { "name": "storage_groups", @@ -100362,327 +104275,308 @@ } }, { - "name": "user_metadata", + "name": "public_subnet", "type": "TypeString", - "description": "User metadata info", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "image_template_id", - "type": "TypeInt", - "description": "OS image template ID", + "name": "package_key_name", + "type": "TypeString", "immutable": true, "optional": true }, { - "name": "disk_key_names", - "type": "TypeList", + "name": "gpu_key_name", + "type": "TypeString", "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } + "optional": true }, { - "name": "public_bandwidth", + "name": "memory", "type": "TypeInt", "immutable": true, "optional": true, "computed": true }, { - "name": "public_ipv4_address_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "ipv6_address", + "name": "private_ipv4_address", "type": "TypeString", "computed": true }, { - "name": "global_identifier", - "type": "TypeString", - "description": "The unique global identifier of the bare metal server", - "computed": true + "name": "ssh_key_ids", + "type": "TypeList", + "description": "SSH KEY IDS list", + "immutable": true, + "optional": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "domain", + "name": "os_reference_code", "type": "TypeString", - "description": "Domain name", + "description": "OS refernece code value", "immutable": true, - "required": true + "optional": true, + "computed": true }, { - "name": "private_network_only", - "type": "TypeBool", - "description": "only private network configured if is true", - "default_value": false, + "name": "datacenter", + "type": "TypeString", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "process_key_name", + "name": "ipv6_address", "type": "TypeString", - "immutable": true, - "optional": true + "computed": true }, { - "name": "gpu_secondary_key_name", + "name": "hostname", "type": "TypeString", + "description": "Host name", "immutable": true, "optional": true }, { - "name": "unbonded_network", + "name": "hourly_billing", "type": "TypeBool", - "default_value": false, + "description": "Enables hourly billing", + "default_value": true, "immutable": true, "optional": true }, { - "name": "restricted_network", + "name": "redundant_power_supply", "type": "TypeBool", - "default_value": false, "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "public_subnet", - "type": "TypeString", - "immutable": true, + "name": "file_storage_ids", + "type": "TypeSet", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "datacenter", + "name": "fixed_config_preset", "type": "TypeString", + "description": "Fixed config preset value", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "hourly_billing", + "name": "redundant_network", "type": "TypeBool", - "description": "Enables hourly billing", - "default_value": true, + "default_value": false, "immutable": true, "optional": true }, { - "name": "package_key_name", - "type": "TypeString", + "name": "restricted_network", + "type": "TypeBool", + "default_value": false, "immutable": true, "optional": true }, { - "name": "private_vlan_id", + "name": "quote_id", "type": "TypeInt", + "description": "Quote ID for Quote based provisioning", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "public_ipv4_address", - "type": "TypeString", - "computed": true + "name": "secondary_ip_addresses", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "os_key_name", - "type": "TypeString", + "name": "ipv6_enabled", + "type": "TypeBool", + "description": "Boolean value true if IPV6 ia enabled or false", + "default_value": false, "immutable": true, "optional": true }, { - "name": "memory", + "name": "ipv6_address_id", "type": "TypeInt", - "immutable": true, - "optional": true, "computed": true }, { - "name": "quote_id", + "name": "network_speed", "type": "TypeInt", - "description": "Quote ID for Quote based provisioning", + "description": "Network speed in MBPS", + "default_value": 100, "immutable": true, "optional": true }, { - "name": "private_ipv4_address_id", - "type": "TypeInt", - "computed": true + "name": "process_key_name", + "type": "TypeString", + "immutable": true, + "optional": true }, { - "name": "ipv6_enabled", - "type": "TypeBool", - "description": "Boolean value true if IPV6 ia enabled or false", - "default_value": false, + "name": "os_key_name", + "type": "TypeString", "immutable": true, "optional": true }, { - "name": "notes", + "name": "gpu_secondary_key_name", "type": "TypeString", - "description": "Optional notes info", + "immutable": true, "optional": true }, { - "name": "block_storage_ids", - "type": "TypeSet", + "name": "disk_key_names", + "type": "TypeList", + "immutable": true, "optional": true, - "computed": true, "elem": { - "type": "TypeInt" + "type": "TypeString" } }, { - "name": "post_install_script_uri", - "type": "TypeString", + "name": "unbonded_network", + "type": "TypeBool", + "default_value": false, "immutable": true, "optional": true }, { - "name": "network_speed", - "type": "TypeInt", - "description": "Network speed in MBPS", - "default_value": 100, + "name": "extended_hardware_testing", + "type": "TypeBool", + "default_value": false, "immutable": true, "optional": true }, { - "name": "public_vlan_id", - "type": "TypeInt", + "name": "private_subnet", + "type": "TypeString", "immutable": true, "optional": true, "computed": true }, { - "name": "private_ipv4_address", + "name": "notes", "type": "TypeString", - "computed": true + "description": "Optional notes info", + "optional": true }, { - "name": "hostname", + "name": "post_install_script_uri", "type": "TypeString", - "description": "Host name", "immutable": true, "optional": true }, { - "name": "file_storage_ids", - "type": "TypeSet", - "optional": true, - "computed": true, - "elem": { - "type": "TypeInt" - } - }, - { - "name": "fixed_config_preset", - "type": "TypeString", - "description": "Fixed config preset value", + "name": "image_template_id", + "type": "TypeInt", + "description": "OS image template ID", "immutable": true, "optional": true }, { - "name": "tcp_monitoring", + "name": "ipv6_static_enabled", "type": "TypeBool", - "description": "TCP monitoring enabled if set as true", + "description": "boolean value true if ipv6 static is enabled else false", "default_value": false, "immutable": true, "optional": true }, { - "name": "extended_hardware_testing", + "name": "software_guard_extensions", "type": "TypeBool", "default_value": false, "immutable": true, "optional": true }, { - "name": "secondary_ip_count", + "name": "public_vlan_id", "type": "TypeInt", - "description": "Secondary IP addresses count", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "ipv6_static_enabled", - "type": "TypeBool", - "description": "boolean value true if ipv6 static is enabled else false", - "default_value": false, - "immutable": true, - "optional": true + "name": "public_ipv4_address", + "type": "TypeString", + "computed": true }, { - "name": "ssh_key_ids", - "type": "TypeList", - "description": "SSH KEY IDS list", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeInt" - } + "name": "public_ipv4_address_id", + "type": "TypeInt", + "computed": true }, { - "name": "os_reference_code", + "name": "domain", "type": "TypeString", - "description": "OS refernece code value", + "description": "Domain name", "immutable": true, - "optional": true, - "computed": true + "required": true }, { - "name": "redundant_power_supply", - "type": "TypeBool", + "name": "user_metadata", + "type": "TypeString", + "description": "User metadata info", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "redundant_network", + "name": "tcp_monitoring", "type": "TypeBool", + "description": "TCP monitoring enabled if set as true", "default_value": false, "immutable": true, "optional": true - }, + } + ], + "ibm_compute_dedicated_host": [ { - "name": "private_subnet", - "type": "TypeString", - "immutable": true, - "optional": true, + "name": "cpu_count", + "type": "TypeInt", + "description": "The capacity that the dedicated host's CPU allocation is restricted to.", "computed": true }, { - "name": "secondary_ip_addresses", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "wait_time_minutes", + "type": "TypeInt", + "default_value": 90, + "optional": true }, { - "name": "ipv6_address_id", - "type": "TypeInt", - "computed": true - } - ], - "ibm_compute_dedicated_host": [ + "name": "hostname", + "type": "TypeString", + "description": "The host name of dedicatated host.", + "required": true + }, { - "name": "datacenter", + "name": "domain", "type": "TypeString", - "description": "The data center in which the dedicatated host is to be provisioned.", + "description": "The domain of dedicatated host.", "immutable": true, "required": true }, { - "name": "flavor", + "name": "datacenter", "type": "TypeString", - "description": "The flavor of the dedicatated host.", - "default_value": "56_CORES_X_242_RAM_X_1_4_TB", + "description": "The data center in which the dedicatated host is to be provisioned.", "immutable": true, - "optional": true + "required": true }, { "name": "hourly_billing", @@ -100700,28 +104594,17 @@ "required": true }, { - "name": "disk_capacity", - "type": "TypeInt", - "description": "The capacity that the dedicated host's disk allocation is restricted to.", - "computed": true - }, - { - "name": "hostname", - "type": "TypeString", - "description": "The host name of dedicatated host.", - "required": true - }, - { - "name": "domain", + "name": "flavor", "type": "TypeString", - "description": "The domain of dedicatated host.", + "description": "The flavor of the dedicatated host.", + "default_value": "56_CORES_X_242_RAM_X_1_4_TB", "immutable": true, - "required": true + "optional": true }, { - "name": "cpu_count", + "name": "disk_capacity", "type": "TypeInt", - "description": "The capacity that the dedicated host's CPU allocation is restricted to.", + "description": "The capacity that the dedicated host's disk allocation is restricted to.", "computed": true }, { @@ -100730,12 +104613,6 @@ "description": "The capacity that the dedicated host's memory allocation is restricted to.", "computed": true }, - { - "name": "wait_time_minutes", - "type": "TypeInt", - "default_value": 90, - "optional": true - }, { "name": "tags", "type": "TypeSet", @@ -100747,31 +104624,6 @@ } ], "ibm_compute_monitor": [ - { - "name": "guest_id", - "type": "TypeInt", - "description": "Guest ID", - "immutable": true, - "required": true - }, - { - "name": "ip_address", - "type": "TypeString", - "description": "IP Address", - "optional": true - }, - { - "name": "query_type_id", - "type": "TypeInt", - "description": "Query Type ID", - "required": true - }, - { - "name": "response_action_id", - "type": "TypeInt", - "description": "Response action ID", - "required": true - }, { "name": "wait_cycles", "type": "TypeInt", @@ -100797,6 +104649,31 @@ "elem": { "type": "TypeString" } + }, + { + "name": "guest_id", + "type": "TypeInt", + "description": "Guest ID", + "immutable": true, + "required": true + }, + { + "name": "ip_address", + "type": "TypeString", + "description": "IP Address", + "optional": true + }, + { + "name": "query_type_id", + "type": "TypeInt", + "description": "Query Type ID", + "required": true + }, + { + "name": "response_action_id", + "type": "TypeInt", + "description": "Response action ID", + "required": true } ], "ibm_compute_placement_group": [ @@ -100864,6 +104741,28 @@ } ], "ibm_compute_reserved_capacity": [ + { + "name": "flavor", + "type": "TypeString", + "description": "flavor of the reserved capacity", + "required": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "force_create", + "type": "TypeBool", + "description": "Force the creation of reserved capacity with same name", + "optional": true + }, { "name": "datacenter", "type": "TypeString", @@ -100889,31 +104788,19 @@ "type": "TypeInt", "description": "no of the instances", "required": true - }, - { - "name": "flavor", - "type": "TypeString", - "description": "flavor of the reserved capacity", - "required": true - }, + } + ], + "ibm_compute_ssh_key": [ { "name": "tags", "type": "TypeSet", - "description": "List of tags", + "description": "List of tags for the resource", "cloud_data_type": "tags", "optional": true, "elem": { "type": "TypeString" } }, - { - "name": "force_create", - "type": "TypeBool", - "description": "Force the creation of reserved capacity with same name", - "optional": true - } - ], - "ibm_compute_ssh_key": [ { "name": "label", "type": "TypeString", @@ -100938,26 +104825,9 @@ "type": "TypeString", "description": "Additional notes", "optional": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "List of tags for the resource", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } } ], "ibm_compute_ssl_certificate": [ - { - "name": "certificate", - "type": "TypeString", - "description": "SSL Certifcate", - "immutable": true, - "required": true - }, { "name": "intermediate_certificate", "type": "TypeString", @@ -100965,24 +104835,6 @@ "immutable": true, "optional": true }, - { - "name": "key_size", - "type": "TypeInt", - "description": "SSL key size", - "computed": true - }, - { - "name": "create_date", - "type": "TypeString", - "description": "certificate creation date", - "computed": true - }, - { - "name": "modify_date", - "type": "TypeString", - "description": "certificate modificatiob date", - "computed": true - }, { "name": "private_key", "type": "TypeString", @@ -101003,6 +104855,19 @@ "description": "Organization name", "computed": true }, + { + "name": "validity_end", + "type": "TypeString", + "description": "Validity ends before", + "computed": true + }, + { + "name": "certificate", + "type": "TypeString", + "description": "SSL Certifcate", + "immutable": true, + "required": true + }, { "name": "validity_begin", "type": "TypeString", @@ -101016,9 +104881,21 @@ "computed": true }, { - "name": "validity_end", + "name": "key_size", + "type": "TypeInt", + "description": "SSL key size", + "computed": true + }, + { + "name": "create_date", "type": "TypeString", - "description": "Validity ends before", + "description": "certificate creation date", + "computed": true + }, + { + "name": "modify_date", + "type": "TypeString", + "description": "certificate modificatiob date", "computed": true }, { @@ -101034,15 +104911,15 @@ ], "ibm_compute_user": [ { - "name": "last_name", + "name": "company_name", "type": "TypeString", - "description": "Last name of the user", + "description": "comapany name", "required": true }, { - "name": "country", + "name": "address1", "type": "TypeString", - "description": "Country name", + "description": "Address info of the user", "required": true }, { @@ -101052,30 +104929,6 @@ "default_value": "ACTIVE", "optional": true }, - { - "name": "first_name", - "type": "TypeString", - "description": "First name of the user", - "required": true - }, - { - "name": "company_name", - "type": "TypeString", - "description": "comapany name", - "required": true - }, - { - "name": "timezone", - "type": "TypeString", - "description": "time zone info", - "required": true - }, - { - "name": "ibm_id", - "type": "TypeString", - "description": "IBM ID of the user", - "computed": true - }, { "name": "permissions", "type": "TypeSet", @@ -101093,19 +104946,16 @@ "optional": true }, { - "name": "api_key", + "name": "ibm_id", "type": "TypeString", - "description": "API key for the user", - "secure": true, - "optional": true, + "description": "IBM ID of the user", "computed": true }, { - "name": "username", + "name": "first_name", "type": "TypeString", - "description": "user name", - "optional": true, - "computed": true + "description": "First name of the user", + "required": true }, { "name": "email", @@ -101113,12 +104963,6 @@ "description": "email address of the user", "required": true }, - { - "name": "address2", - "type": "TypeString", - "description": "Address info of the user", - "optional": true - }, { "name": "state", "type": "TypeString", @@ -101126,24 +104970,38 @@ "required": true }, { - "name": "password", + "name": "country", "type": "TypeString", - "description": "password for the user", - "secure": true, - "optional": true + "description": "Country name", + "required": true }, { - "name": "address1", + "name": "timezone", "type": "TypeString", - "description": "Address info of the user", + "description": "time zone info", "required": true }, + { + "name": "username", + "type": "TypeString", + "description": "user name", + "optional": true, + "computed": true + }, { "name": "city", "type": "TypeString", "description": "City name", "required": true }, + { + "name": "api_key", + "type": "TypeString", + "description": "API key for the user", + "secure": true, + "optional": true, + "computed": true + }, { "name": "tags", "type": "TypeSet", @@ -101153,25 +105011,28 @@ "elem": { "type": "TypeString" } - } - ], - "ibm_compute_vm_instance": [ + }, { - "name": "disks", - "type": "TypeList", - "optional": true, - "computed": true, - "elem": { - "type": "TypeInt" - } + "name": "last_name", + "type": "TypeString", + "description": "Last name of the user", + "required": true }, { - "name": "quote_id", - "type": "TypeInt", - "description": "Quote ID for Quote based provisioning", - "immutable": true, + "name": "address2", + "type": "TypeString", + "description": "Address info of the user", "optional": true }, + { + "name": "password", + "type": "TypeString", + "description": "password for the user", + "secure": true, + "optional": true + } + ], + "ibm_compute_vm_instance": [ { "name": "reserved_capacity_name", "type": "TypeString", @@ -101180,257 +105041,221 @@ "optional": true }, { - "name": "private_vlan_id", + "name": "dedicated_host_id", "type": "TypeInt", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "post_install_script_uri", - "type": "TypeString", - "immutable": true, - "optional": true + "name": "disks", + "type": "TypeList", + "optional": true, + "computed": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "public_bandwidth_unlimited", + "name": "ipv6_enabled", "type": "TypeBool", "default_value": false, "immutable": true, "optional": true }, { - "name": "public_vlan_id", - "type": "TypeInt", - "immutable": true, + "name": "file_storage_ids", + "type": "TypeSet", "optional": true, - "computed": true - }, - { - "name": "secondary_ip_addresses", - "type": "TypeList", "computed": true, "elem": { - "type": "TypeString" + "type": "TypeInt" } }, { - "name": "block_storage_ids", + "name": "bulk_vms", "type": "TypeSet", + "immutable": true, "optional": true, - "computed": true, "elem": { - "type": "TypeInt" - } + "domain": { + "name": "domain", + "type": "TypeString", + "immutable": true, + "required": true + }, + "hostname": { + "name": "hostname", + "type": "TypeString", + "immutable": true, + "required": true + } + }, + "min_items": 2 }, { - "name": "evault", - "type": "TypeInt", + "name": "private_security_group_ids", + "type": "TypeSet", "immutable": true, - "optional": true - }, - { - "name": "domain", - "type": "TypeString", - "optional": true + "optional": true, + "computed": true, + "elem": { + "type": "TypeInt" + }, + "max_items": 5 }, { - "name": "secondary_ip_count", + "name": "public_subnet_id", "type": "TypeInt", - "immutable": true, - "optional": true - }, - { - "name": "ipv4_address", - "type": "TypeString", "computed": true }, { - "name": "ip_address_id_private", + "name": "private_interface_id", "type": "TypeInt", "computed": true }, { - "name": "cores", - "type": "TypeInt", + "name": "block_storage_ids", + "type": "TypeSet", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "memory", - "type": "TypeInt", - "optional": true, - "computed": true + "name": "notes", + "type": "TypeString", + "optional": true }, { - "name": "public_ipv6_subnet", + "name": "resource_controller_url", "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "image_id", - "type": "TypeInt", - "immutable": true, - "optional": true - }, - { - "name": "hourly_billing", + "name": "transient", "type": "TypeBool", - "default_value": true, "immutable": true, "optional": true }, { - "name": "ipv6_static_enabled", - "type": "TypeBool", - "default_value": false, + "name": "user_metadata", + "type": "TypeString", "immutable": true, "optional": true }, { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", + "name": "private_vlan_id", + "type": "TypeInt", + "immutable": true, + "optional": true, "computed": true }, { - "name": "flavor_key_name", + "name": "datacenter", "type": "TypeString", - "description": "Flavor key name used to provision vm.", + "immutable": true, "optional": true, "computed": true }, { - "name": "user_metadata", + "name": "ipv4_address", "type": "TypeString", - "immutable": true, - "optional": true + "computed": true }, { - "name": "file_storage_ids", + "name": "ssh_key_ids", "type": "TypeSet", "optional": true, - "computed": true, "elem": { "type": "TypeInt" } }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "public_subnet", - "type": "TypeString", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "ip_address_id", + "name": "evault", "type": "TypeInt", - "computed": true - }, - { - "name": "placement_group_name", - "type": "TypeString", - "description": "The placement group name", "immutable": true, "optional": true }, { - "name": "ipv4_address_private", + "name": "hostname", "type": "TypeString", - "computed": true + "optional": true }, { - "name": "ipv6_address", + "name": "resource_name", "type": "TypeString", + "description": "The name of the resource", "computed": true }, { - "name": "notes", - "type": "TypeString", - "optional": true - }, - { - "name": "wait_time_minutes", + "name": "cores", "type": "TypeInt", - "default_value": 90, "optional": true, - "deprecated": "This field is deprecated. Use timeouts block instead" - }, - { - "name": "os_reference_code", - "type": "TypeString", - "immutable": true, - "optional": true + "computed": true }, { - "name": "datacenter_choice", - "type": "TypeList", - "description": "The user provided datacenter options", - "optional": true, - "elem": { - "type": "TypeMap" - } + "name": "private_subnet_id", + "type": "TypeInt", + "computed": true }, { - "name": "public_interface_id", + "name": "ipv6_address_id", "type": "TypeInt", "computed": true }, { - "name": "dedicated_host_name", - "type": "TypeString", + "name": "local_disk", + "type": "TypeBool", + "default_value": true, "immutable": true, "optional": true }, { - "name": "transient", - "type": "TypeBool", + "name": "image_id", + "type": "TypeInt", "immutable": true, "optional": true }, { - "name": "private_interface_id", + "name": "placement_group_id", "type": "TypeInt", + "description": "The placement group id", + "immutable": true, + "optional": true + }, + { + "name": "memory", + "type": "TypeInt", + "optional": true, "computed": true }, { - "name": "ipv6_enabled", + "name": "ip_address_id", + "type": "TypeInt", + "computed": true + }, + { + "name": "ipv6_static_enabled", "type": "TypeBool", "default_value": false, "immutable": true, "optional": true }, { - "name": "public_ipv6_subnet_id", - "type": "TypeInt", + "name": "flavor_key_name", + "type": "TypeString", + "description": "Flavor key name used to provision vm.", + "optional": true, "computed": true }, { - "name": "bulk_vms", - "type": "TypeSet", + "name": "private_network_only", + "type": "TypeBool", + "default_value": false, "immutable": true, - "optional": true, - "elem": { - "domain": { - "name": "domain", - "type": "TypeString", - "immutable": true, - "required": true - }, - "hostname": { - "name": "hostname", - "type": "TypeString", - "immutable": true, - "required": true - } - }, - "min_items": 2 + "optional": true }, { "name": "dedicated_acct_host_only", @@ -101439,7 +105264,7 @@ "optional": true }, { - "name": "private_security_group_ids", + "name": "public_security_group_ids", "type": "TypeSet", "immutable": true, "optional": true, @@ -101450,103 +105275,138 @@ "max_items": 5 }, { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true }, { - "name": "public_bandwidth_limited", - "type": "TypeInt", + "name": "hourly_billing", + "type": "TypeBool", + "default_value": true, "immutable": true, - "optional": true, + "optional": true + }, + { + "name": "public_interface_id", + "type": "TypeInt", "computed": true }, { - "name": "datacenter", + "name": "ipv4_address_private", "type": "TypeString", - "immutable": true, - "optional": true, "computed": true }, { - "name": "private_subnet", + "name": "domain", + "type": "TypeString", + "optional": true + }, + { + "name": "dedicated_host_name", "type": "TypeString", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "public_security_group_ids", - "type": "TypeSet", + "name": "reserved_capacity_id", + "type": "TypeInt", + "description": "The reserved group id", + "immutable": true, + "optional": true + }, + { + "name": "public_subnet", + "type": "TypeString", "immutable": true, "optional": true, + "computed": true + }, + { + "name": "secondary_ip_addresses", + "type": "TypeList", "computed": true, "elem": { - "type": "TypeInt" - }, - "max_items": 5 + "type": "TypeString" + } }, { - "name": "ssh_key_ids", + "name": "post_install_script_uri", + "type": "TypeString", + "immutable": true, + "optional": true + }, + { + "name": "tags", "type": "TypeSet", + "cloud_data_type": "tags", "optional": true, "elem": { - "type": "TypeInt" + "type": "TypeString" } }, { - "name": "reserved_instance_primary_disk", + "name": "public_bandwidth_limited", "type": "TypeInt", - "description": "The primary disk of reserved instance", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "public_subnet_id", - "type": "TypeInt", - "computed": true + "name": "datacenter_choice", + "type": "TypeList", + "description": "The user provided datacenter options", + "optional": true, + "elem": { + "type": "TypeMap" + } }, { - "name": "reserved_capacity_id", + "name": "secondary_ip_count", "type": "TypeInt", - "description": "The reserved group id", "immutable": true, "optional": true }, { - "name": "private_subnet_id", - "type": "TypeInt", + "name": "ipv6_address", + "type": "TypeString", "computed": true }, { - "name": "local_disk", - "type": "TypeBool", - "default_value": true, + "name": "public_vlan_id", + "type": "TypeInt", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true + "name": "wait_time_minutes", + "type": "TypeInt", + "default_value": 90, + "optional": true, + "deprecated": "This field is deprecated. Use timeouts block instead" }, { - "name": "hostname", + "name": "placement_group_name", "type": "TypeString", + "description": "The placement group name", + "immutable": true, "optional": true }, { - "name": "private_network_only", - "type": "TypeBool", - "default_value": false, + "name": "reserved_instance_primary_disk", + "type": "TypeInt", + "description": "The primary disk of reserved instance", "immutable": true, "optional": true }, + { + "name": "private_subnet", + "type": "TypeString", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "network_speed", "type": "TypeInt", @@ -101554,60 +105414,42 @@ "optional": true }, { - "name": "ipv6_address_id", + "name": "ip_address_id_private", "type": "TypeInt", "computed": true }, { - "name": "placement_group_id", - "type": "TypeInt", - "description": "The placement group id", - "immutable": true, - "optional": true + "name": "public_ipv6_subnet", + "type": "TypeString", + "computed": true }, { - "name": "dedicated_host_id", + "name": "public_ipv6_subnet_id", "type": "TypeInt", + "computed": true + }, + { + "name": "public_bandwidth_unlimited", + "type": "TypeBool", + "default_value": false, "immutable": true, "optional": true - } - ], - "ibm_container_addons": [ - { - "name": "cluster", - "type": "TypeString", - "description": "Cluster Name or ID", - "cloud_data_type": "cluster", - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] }, { - "name": "resource_group_id", + "name": "os_reference_code", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "manage_all_addons", - "type": "TypeBool", - "description": "To manage all add-ons installed in the cluster using terraform by importing it into the state file", - "default_value": true, "optional": true }, { - "name": "managed_addons", - "type": "TypeList", - "description": "Used to keep track of the add-on names", - "computed": true, - "elem": { - "type": "TypeString" - } - }, + "name": "quote_id", + "type": "TypeInt", + "description": "Quote ID for Quote based provisioning", + "immutable": true, + "optional": true + } + ], + "ibm_container_addons": [ { "name": "addons", "type": "TypeSet", @@ -101697,9 +105539,50 @@ "computed": true } } + }, + { + "name": "cluster", + "type": "TypeString", + "description": "Cluster Name or ID", + "cloud_data_type": "cluster", + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "manage_all_addons", + "type": "TypeBool", + "description": "To manage all add-ons installed in the cluster using terraform by importing it into the state file", + "default_value": true, + "optional": true + }, + { + "name": "managed_addons", + "type": "TypeList", + "description": "Used to keep track of the add-on names", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_container_alb": [ + { + "name": "zone", + "type": "TypeString", + "description": "ALB zone", + "computed": true + }, { "name": "alb_type", "type": "TypeString", @@ -101707,16 +105590,17 @@ "computed": true }, { - "name": "cluster", + "name": "user_ip", "type": "TypeString", - "description": "Cluster id", + "description": "IP assigned by the user", + "immutable": true, + "optional": true, "computed": true }, { - "name": "enable", + "name": "resize", "type": "TypeBool", - "description": "set to true if ALB needs to be enabled", - "optional": true, + "description": "Indicate whether resizing should be done", "computed": true }, { @@ -101740,10 +105624,11 @@ "computed": true }, { - "name": "resize", - "type": "TypeBool", - "description": "Indicate whether resizing should be done", - "computed": true + "name": "region", + "type": "TypeString", + "cloud_data_type": "region", + "optional": true, + "deprecated": "This field is deprecated" }, { "name": "alb_id", @@ -101753,23 +105638,15 @@ "required": true }, { - "name": "region", - "type": "TypeString", - "cloud_data_type": "region", - "optional": true, - "deprecated": "This field is deprecated" - }, - { - "name": "zone", + "name": "cluster", "type": "TypeString", - "description": "ALB zone", + "description": "Cluster id", "computed": true }, { - "name": "user_ip", - "type": "TypeString", - "description": "IP assigned by the user", - "immutable": true, + "name": "enable", + "type": "TypeBool", + "description": "set to true if ALB needs to be enabled", "optional": true, "computed": true } @@ -101786,14 +105663,6 @@ "resolved_to:id" ] }, - { - "name": "namespace", - "type": "TypeString", - "description": "Namespace of the secret", - "default_value": "ibm-cert-store", - "immutable": true, - "optional": true - }, { "name": "issuer_name", "type": "TypeString", @@ -101807,6 +105676,27 @@ "description": "Secret Status", "computed": true }, + { + "name": "cloud_cert_instance_id", + "type": "TypeString", + "description": "cloud cert instance ID", + "computed": true + }, + { + "name": "expires_on", + "type": "TypeString", + "description": "Certificate expaire on date", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "description": "region name", + "cloud_data_type": "region", + "optional": true, + "computed": true, + "deprecated": "This field is deprecated" + }, { "name": "cert_crn", "type": "TypeString", @@ -101820,6 +105710,14 @@ "immutable": true, "required": true }, + { + "name": "namespace", + "type": "TypeString", + "description": "Namespace of the secret", + "default_value": "ibm-cert-store", + "immutable": true, + "optional": true + }, { "name": "persistence", "type": "TypeBool", @@ -101831,30 +105729,27 @@ "type": "TypeString", "description": "Domain name", "computed": true - }, + } + ], + "ibm_container_alb_create": [ { - "name": "expires_on", + "name": "replicas", "type": "TypeString", - "description": "Certificate expaire on date", + "description": "number of instances", "computed": true }, { - "name": "cloud_cert_instance_id", - "type": "TypeString", - "description": "cloud cert instance ID", + "name": "resize", + "type": "TypeBool", + "description": "resize", "computed": true }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "region name", - "cloud_data_type": "region", - "optional": true, - "computed": true, - "deprecated": "This field is deprecated" - } - ], - "ibm_container_alb_create": [ + "description": "ALB name", + "computed": true + }, { "name": "ingress_image", "type": "TypeString", @@ -101863,34 +105758,34 @@ "optional": true }, { - "name": "name", + "name": "zone", "type": "TypeString", - "description": "ALB name", - "computed": true + "description": "The zone where you want to deploy the ALB.", + "immutable": true, + "required": true }, { - "name": "replicas", + "name": "cluster", "type": "TypeString", - "description": "number of instances", - "computed": true + "description": "The ID of the cluster that the ALB belongs to.", + "cloud_data_type": "cluster", + "immutable": true, + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "resize", - "type": "TypeBool", - "description": "resize", + "name": "alb_id", + "type": "TypeString", + "description": "The ID of the application load balancer (ALB).", "computed": true }, { - "name": "disable_deployment", + "name": "enable", "type": "TypeBool", - "description": "Set to true if ALB needs to be disabled", - "computed": true - }, - { - "name": "nlb_version", - "type": "TypeString", - "description": "The version of the network load balancer that you want to use for the ALB.", - "immutable": true, + "description": "If set to true, the ALB is enabled by default.", + "default_value": true, "optional": true }, { @@ -101900,9 +105795,9 @@ "required": true }, { - "name": "alb_id", - "type": "TypeString", - "description": "The ID of the application load balancer (ALB).", + "name": "disable_deployment", + "type": "TypeBool", + "description": "Set to true if ALB needs to be disabled", "computed": true }, { @@ -101912,16 +105807,10 @@ "computed": true }, { - "name": "enable", - "type": "TypeBool", - "description": "If set to true, the ALB is enabled by default.", - "default_value": true, - "optional": true - }, - { - "name": "ip", + "name": "nlb_version", "type": "TypeString", - "description": "The IP address that you want to assign to the ALB.", + "description": "The version of the network load balancer that you want to use for the ALB.", + "immutable": true, "optional": true }, { @@ -101931,22 +105820,10 @@ "required": true }, { - "name": "zone", - "type": "TypeString", - "description": "The zone where you want to deploy the ALB.", - "immutable": true, - "required": true - }, - { - "name": "cluster", + "name": "ip", "type": "TypeString", - "description": "The ID of the cluster that the ALB belongs to.", - "cloud_data_type": "cluster", - "immutable": true, - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "The IP address that you want to assign to the ALB.", + "optional": true } ], "ibm_container_api_key_reset": [ @@ -101976,47 +105853,42 @@ ], "ibm_container_bind_service": [ { - "name": "cluster_name_id", + "name": "region", "type": "TypeString", - "description": "Cluster name or ID", - "cloud_data_type": "cluster", - "immutable": true, - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "The cluster region", + "cloud_data_type": "region", + "optional": true, + "deprecated": "This field is deprecated" }, { - "name": "namespace_id", + "name": "service_instance_name", "type": "TypeString", - "description": "namespace ID", + "description": "serivice instance name", "immutable": true, - "required": true + "optional": true, + "computed": true }, { - "name": "org_guid", + "name": "service_instance_id", "type": "TypeString", - "description": "The bluemix organization guid this cluster belongs to", + "description": "Service instance ID", + "immutable": true, "optional": true, - "deprecated": "This field is deprecated" + "computed": true }, { - "name": "region", + "name": "namespace_id", "type": "TypeString", - "description": "The cluster region", - "cloud_data_type": "region", - "optional": true, - "deprecated": "This field is deprecated" + "description": "namespace ID", + "immutable": true, + "required": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags for the resource", - "cloud_data_type": "tags", + "name": "space_guid", + "type": "TypeString", + "description": "The bluemix space guid this cluster belongs to", "optional": true, - "elem": { - "type": "TypeString" - } + "deprecated": "This field is deprecated" }, { "name": "role", @@ -102034,25 +105906,30 @@ "optional": true }, { - "name": "service_instance_name", - "type": "TypeString", - "description": "serivice instance name", - "immutable": true, + "name": "tags", + "type": "TypeSet", + "description": "List of tags for the resource", + "cloud_data_type": "tags", "optional": true, - "computed": true + "elem": { + "type": "TypeString" + } }, { - "name": "service_instance_id", + "name": "cluster_name_id", "type": "TypeString", - "description": "Service instance ID", + "description": "Cluster name or ID", + "cloud_data_type": "cluster", "immutable": true, - "optional": true, - "computed": true + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "space_guid", + "name": "org_guid", "type": "TypeString", - "description": "The bluemix space guid this cluster belongs to", + "description": "The bluemix organization guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, @@ -102073,39 +105950,80 @@ ], "ibm_container_cluster": [ { - "name": "is_trusted", - "type": "TypeBool", + "name": "labels", + "type": "TypeMap", + "description": "list of labels to the default worker pool", "optional": true, - "deprecated": "This field is deprecated" + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "webhook", - "type": "TypeList", + "name": "kube_version", + "type": "TypeString", + "description": "Kubernetes version info", + "optional": true, + "computed": true + }, + { + "name": "entitlement", + "type": "TypeString", + "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", + "optional": true + }, + { + "name": "subnet_id", + "type": "TypeSet", + "description": "List of subnet IDs", "optional": true, "elem": { - "level": { - "name": "level", - "type": "TypeString", - "required": true - }, - "type": { - "name": "type", - "type": "TypeString", - "required": true - }, - "url": { - "name": "url", - "type": "TypeString", - "required": true - } + "type": "TypeString" } }, { - "name": "name", + "name": "resource_group_name", "type": "TypeString", - "description": "The cluster name", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The cluster region", + "cloud_data_type": "region", + "optional": true, + "computed": true, + "deprecated": "This field is deprecated" + }, + { + "name": "default_pool_size", + "type": "TypeInt", + "description": "The size of the default worker pool", + "default_value": 1, + "optional": true + }, + { + "name": "service_subnet", + "type": "TypeString", + "description": "Custom subnet CIDR to provide private IP addresses for services", "immutable": true, - "required": true + "optional": true, + "computed": true + }, + { + "name": "no_subnet", + "type": "TypeBool", + "description": "Boolean value set to true when subnet creation is not required.", + "default_value": false, + "immutable": true, + "optional": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", + "computed": true }, { "name": "datacenter", @@ -102115,10 +106033,10 @@ "required": true }, { - "name": "wait_till", + "name": "machine_type", "type": "TypeString", - "description": "wait_till can be configured for Master Ready, One worker Ready, Ingress Ready or Normal", - "default_value": "IngressReady", + "description": "Machine type", + "immutable": true, "optional": true }, { @@ -102127,15 +106045,17 @@ "computed": true }, { - "name": "force_delete_storage", - "type": "TypeBool", - "description": "Force the removal of a cluster and its persistent storage. Deleted data cannot be recovered", - "default_value": false, - "optional": true + "name": "space_guid", + "type": "TypeString", + "description": "The bluemix space guid this cluster belongs to", + "optional": true, + "deprecated": "This field is deprecated" }, { - "name": "public_service_endpoint_url", + "name": "crn", "type": "TypeString", + "description": "CRN of resource instance", + "cloud_data_type": "crn", "computed": true }, { @@ -102165,62 +106085,49 @@ } }, { - "name": "public_service_endpoint", - "type": "TypeBool", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "resource_name", + "name": "wait_till", "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "disk_encryption", - "type": "TypeBool", - "description": "disc encryption done, if set to true.", - "default_value": true, - "immutable": true, + "description": "wait_till can be configured for Master Ready, One worker Ready, Ingress Ready or Normal", + "default_value": "IngressReady", "optional": true }, { - "name": "resource_group_name", + "name": "ingress_hostname", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "entitlement", - "type": "TypeString", - "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", - "optional": true - }, - { - "name": "service_subnet", + "name": "private_service_endpoint_url", "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for services", - "immutable": true, - "optional": true, "computed": true }, { - "name": "ingress_hostname", - "type": "TypeString", - "computed": true + "name": "webhook", + "type": "TypeList", + "optional": true, + "elem": { + "level": { + "name": "level", + "type": "TypeString", + "required": true + }, + "type": { + "name": "type", + "type": "TypeString", + "required": true + }, + "url": { + "name": "url", + "type": "TypeString", + "required": true + } + } }, { - "name": "no_subnet", + "name": "private_service_endpoint", "type": "TypeBool", - "description": "Boolean value set to true when subnet creation is not required.", - "default_value": false, "immutable": true, - "optional": true - }, - { - "name": "private_service_endpoint_url", - "type": "TypeString", + "optional": true, "computed": true }, { @@ -102230,18 +106137,12 @@ "computed": true }, { - "name": "patch_version", - "type": "TypeString", - "description": "Kubernetes patch version", - "optional": true - }, - { - "name": "pod_subnet", - "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for pods", - "immutable": true, + "name": "worker_num", + "type": "TypeInt", + "description": "Number of worker nodes", + "default_value": 0, "optional": true, - "computed": true + "deprecated": "This field is deprecated" }, { "name": "account_guid", @@ -102251,10 +106152,9 @@ "deprecated": "This field is deprecated" }, { - "name": "wait_time_minutes", - "type": "TypeInt", - "optional": true, - "deprecated": "This field is deprecated" + "name": "public_service_endpoint_url", + "type": "TypeString", + "computed": true }, { "name": "kms_config", @@ -102285,12 +106185,46 @@ "max_items": 1 }, { - "name": "public_vlan_id", - "type": "TypeString", - "description": "Public VLAN ID", + "name": "image_security_enforcement", + "type": "TypeBool", + "description": "Set true to enable image security enforcement policies", + "default_value": false, + "optional": true + }, + { + "name": "disk_encryption", + "type": "TypeBool", + "description": "disc encryption done, if set to true.", + "default_value": true, "immutable": true, "optional": true }, + { + "name": "retry_patch_version", + "type": "TypeInt", + "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", + "optional": true + }, + { + "name": "hardware", + "type": "TypeString", + "description": "Hardware type", + "immutable": true, + "required": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags for the resource", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "worker_pools", "type": "TypeList", @@ -102361,68 +106295,12 @@ } }, { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "default_pool_size", - "type": "TypeInt", - "description": "The size of the default worker pool", - "default_value": 1, - "optional": true - }, - { - "name": "retry_patch_version", - "type": "TypeInt", - "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", - "optional": true - }, - { - "name": "machine_type", - "type": "TypeString", - "description": "Machine type", - "immutable": true, - "optional": true - }, - { - "name": "operating_system", - "type": "TypeString", - "description": "The operating system of the workers in the default worker pool.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "space_guid", - "type": "TypeString", - "description": "The bluemix space guid this cluster belongs to", - "optional": true, - "deprecated": "This field is deprecated" - }, - { - "name": "worker_num", - "type": "TypeInt", - "description": "Number of worker nodes", - "default_value": 0, - "optional": true, - "deprecated": "This field is deprecated" - }, - { - "name": "billing", + "name": "org_guid", "type": "TypeString", + "description": "The bluemix organization guid this cluster belongs to", "optional": true, "deprecated": "This field is deprecated" }, - { - "name": "gateway_enabled", - "type": "TypeBool", - "description": "Set true for gateway enabled clusters", - "default_value": false, - "optional": true - }, { "name": "wait_for_worker_update", "type": "TypeBool", @@ -102431,98 +106309,11 @@ "optional": true }, { - "name": "ingress_secret", - "type": "TypeString", - "secure": true, - "computed": true - }, - { - "name": "org_guid", - "type": "TypeString", - "description": "The bluemix organization guid this cluster belongs to", + "name": "wait_time_minutes", + "type": "TypeInt", "optional": true, "deprecated": "This field is deprecated" }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the resource", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "private_service_endpoint", - "type": "TypeBool", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true - }, - { - "name": "labels", - "type": "TypeMap", - "description": "list of labels to the default worker pool", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "hardware", - "type": "TypeString", - "description": "Hardware type", - "immutable": true, - "required": true - }, - { - "name": "private_vlan_id", - "type": "TypeString", - "description": "Private VLAN ID", - "immutable": true, - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "update_all_workers", - "type": "TypeBool", - "description": "Updates all the woker nodes if sets to true", - "default_value": false, - "optional": true - }, - { - "name": "subnet_id", - "type": "TypeSet", - "description": "List of subnet IDs", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "albs", "type": "TypeList", @@ -102576,13 +106367,32 @@ } }, { - "name": "region", + "name": "gateway_enabled", + "type": "TypeBool", + "description": "Set true for gateway enabled clusters", + "default_value": false, + "optional": true + }, + { + "name": "resource_status", "type": "TypeString", - "description": "The cluster region", - "cloud_data_type": "region", + "description": "The status of the resource", + "computed": true + }, + { + "name": "public_vlan_id", + "type": "TypeString", + "description": "Public VLAN ID", + "immutable": true, + "optional": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", "optional": true, - "computed": true, - "deprecated": "This field is deprecated" + "computed": true }, { "name": "taints", @@ -102611,27 +106421,88 @@ } }, { - "name": "kube_version", + "name": "update_all_workers", + "type": "TypeBool", + "description": "Updates all the woker nodes if sets to true", + "default_value": false, + "optional": true + }, + { + "name": "private_vlan_id", "type": "TypeString", - "description": "Kubernetes version info", + "description": "Private VLAN ID", + "immutable": true, + "optional": true + }, + { + "name": "public_service_endpoint", + "type": "TypeBool", + "immutable": true, "optional": true, "computed": true }, { - "name": "image_security_enforcement", + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "billing", + "type": "TypeString", + "optional": true, + "deprecated": "This field is deprecated" + }, + { + "name": "is_trusted", "type": "TypeBool", - "description": "Set true to enable image security enforcement policies", + "optional": true, + "deprecated": "This field is deprecated" + }, + { + "name": "force_delete_storage", + "type": "TypeBool", + "description": "Force the removal of a cluster and its persistent storage. Deleted data cannot be recovered", "default_value": false, "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The cluster name", + "immutable": true, + "required": true + }, + { + "name": "patch_version", + "type": "TypeString", + "description": "Kubernetes patch version", + "optional": true + }, + { + "name": "operating_system", + "type": "TypeString", + "description": "The operating system of the workers in the default worker pool.", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "pod_subnet", + "type": "TypeString", + "description": "Custom subnet CIDR to provide private IP addresses for pods", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "ingress_secret", + "type": "TypeString", + "secure": true, + "computed": true } ], "ibm_container_cluster_feature": [ - { - "name": "public_service_endpoint", - "type": "TypeBool", - "optional": true, - "computed": true - }, { "name": "private_service_endpoint", "type": "TypeBool", @@ -102680,37 +106551,15 @@ "cloud_data_range": [ "resolved_to:id" ] + }, + { + "name": "public_service_endpoint", + "type": "TypeBool", + "optional": true, + "computed": true } ], "ibm_container_dedicated_host": [ - { - "name": "workers", - "type": "TypeList", - "description": "The workers of the dedicated host", - "computed": true, - "elem": { - "cluster_id": { - "name": "cluster_id", - "type": "TypeString", - "computed": true - }, - "flavor": { - "name": "flavor", - "type": "TypeString", - "computed": true - }, - "worker_id": { - "name": "worker_id", - "type": "TypeString", - "computed": true - }, - "worker_pool_id": { - "name": "worker_pool_id", - "type": "TypeString", - "computed": true - } - } - }, { "name": "flavor", "type": "TypeString", @@ -102823,13 +106672,11 @@ } } } - } - ], - "ibm_container_dedicated_host_pool": [ + }, { - "name": "worker_pools", + "name": "workers", "type": "TypeList", - "description": "The worker pools of the dedicated host pool", + "description": "The workers of the dedicated host", "computed": true, "elem": { "cluster_id": { @@ -102837,42 +106684,25 @@ "type": "TypeString", "computed": true }, + "flavor": { + "name": "flavor", + "type": "TypeString", + "computed": true + }, + "worker_id": { + "name": "worker_id", + "type": "TypeString", + "computed": true + }, "worker_pool_id": { "name": "worker_pool_id", "type": "TypeString", "computed": true } } - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the dedicated host pool", - "immutable": true, - "required": true - }, - { - "name": "metro", - "type": "TypeString", - "description": "The metro to create the dedicated host pool in", - "immutable": true, - "required": true - }, - { - "name": "flavor_class", - "type": "TypeString", - "description": "The flavor class of the dedicated host pool", - "immutable": true, - "required": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true - }, + } + ], + "ibm_container_dedicated_host_pool": [ { "name": "host_count", "type": "TypeInt", @@ -102919,28 +106749,56 @@ "computed": true } } - } - ], - "ibm_container_ingress_instance": [ + }, { - "name": "secret_group_name", + "name": "worker_pools", + "type": "TypeList", + "description": "The worker pools of the dedicated host pool", + "computed": true, + "elem": { + "cluster_id": { + "name": "cluster_id", + "type": "TypeString", + "computed": true + }, + "worker_pool_id": { + "name": "worker_pool_id", + "type": "TypeString", + "computed": true + } + } + }, + { + "name": "name", "type": "TypeString", - "description": "Name of the secret group for the instance", - "computed": true + "description": "The name of the dedicated host pool", + "immutable": true, + "required": true }, { - "name": "instance_type", + "name": "metro", "type": "TypeString", - "description": "Instance type", - "computed": true + "description": "The metro to create the dedicated host pool in", + "immutable": true, + "required": true }, { - "name": "instance_crn", + "name": "flavor_class", "type": "TypeString", - "description": "Instance CRN id", + "description": "The flavor class of the dedicated host pool", "immutable": true, "required": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true + } + ], + "ibm_container_ingress_instance": [ { "name": "cluster", "type": "TypeString", @@ -102952,12 +106810,6 @@ "resolved_to:id" ] }, - { - "name": "instance_name", - "type": "TypeString", - "description": "Instance registration name", - "computed": true - }, { "name": "secret_group_id", "type": "TypeString", @@ -102972,12 +106824,37 @@ "default_value": false, "optional": true }, + { + "name": "instance_crn", + "type": "TypeString", + "description": "Instance CRN id", + "immutable": true, + "required": true + }, + { + "name": "instance_name", + "type": "TypeString", + "description": "Instance registration name", + "computed": true + }, + { + "name": "secret_group_name", + "type": "TypeString", + "description": "Name of the secret group for the instance", + "computed": true + }, { "name": "status", "type": "TypeString", "description": "Instance registration status", "computed": true }, + { + "name": "instance_type", + "type": "TypeString", + "description": "Instance type", + "computed": true + }, { "name": "user_managed", "type": "TypeBool", @@ -102987,9 +106864,33 @@ ], "ibm_container_ingress_secret_opaque": [ { - "name": "status", + "name": "secret_name", "type": "TypeString", - "description": "Status of the secret", + "description": "Secret name", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$" + }, + { + "name": "secret_namespace", + "type": "TypeString", + "description": "Secret namespace", + "immutable": true, + "required": true + }, + { + "name": "persistence", + "type": "TypeBool", + "description": "Persistence of secret", + "default_value": false, + "optional": true + }, + { + "name": "last_updated_timestamp", + "type": "TypeString", + "description": "Timestamp secret was last updated", "computed": true }, { @@ -103041,59 +106942,32 @@ "resolved_to:id" ] }, - { - "name": "secret_name", - "type": "TypeString", - "description": "Secret name", - "immutable": true, - "required": true - }, - { - "name": "secret_namespace", - "type": "TypeString", - "description": "Secret namespace", - "immutable": true, - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Opaque secret type", - "computed": true - }, - { - "name": "persistence", - "type": "TypeBool", - "description": "Persistence of secret", - "default_value": false, - "optional": true - }, { "name": "user_managed", "type": "TypeBool", "description": "If the secret was created by the user", "computed": true - } - ], - "ibm_container_ingress_secret_tls": [ + }, { - "name": "cert_crn", + "name": "status", "type": "TypeString", - "description": "Certificate CRN", - "required": true + "description": "Status of the secret", + "computed": true }, { - "name": "persistence", - "type": "TypeBool", - "description": "Persistence of secret", + "name": "update_secret", + "type": "TypeInt", + "description": "Updates secret from secrets manager if value is changed (increment each usage)", "optional": true }, { - "name": "domain_name", + "name": "type", "type": "TypeString", - "description": "Domain name", + "description": "Opaque secret type", "computed": true - }, + } + ], + "ibm_container_ingress_secret_tls": [ { "name": "expires_on", "type": "TypeString", @@ -103101,23 +106975,42 @@ "computed": true }, { - "name": "secret_namespace", + "name": "update_secret", + "type": "TypeInt", + "description": "Updates secret from secrets manager if value is changed (increment each usage)", + "optional": true + }, + { + "name": "cluster", "type": "TypeString", - "description": "Secret namespace", + "description": "Cluster ID or name", + "cloud_data_type": "cluster", "immutable": true, - "required": true + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] }, { "name": "secret_name", "type": "TypeString", "description": "Secret name", "immutable": true, + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$" + }, + { + "name": "cert_crn", + "type": "TypeString", + "description": "Certificate CRN", "required": true }, { - "name": "type", + "name": "domain_name", "type": "TypeString", - "description": "TLS secret type", + "description": "Domain name", "computed": true }, { @@ -103139,28 +107032,59 @@ "computed": true }, { - "name": "cluster", + "name": "secret_namespace", "type": "TypeString", - "description": "Cluster ID or name", - "cloud_data_type": "cluster", + "description": "Secret namespace", "immutable": true, - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "TLS secret type", + "computed": true + }, + { + "name": "persistence", + "type": "TypeBool", + "description": "Persistence of secret", + "optional": true } ], "ibm_container_nlb_dns": [ + { + "name": "nlb_ips", + "type": "TypeSet", + "required": true, + "elem": { + "type": "TypeString" + } + }, { "name": "nlb_dns_type", "type": "TypeString", "computed": true }, + { + "name": "nlb_monitor_state", + "type": "TypeString", + "computed": true + }, + { + "name": "nlb_ssl_secret_name", + "type": "TypeString", + "computed": true + }, { "name": "nlb_ssl_secret_status", "type": "TypeString", "computed": true }, + { + "name": "nlb_type", + "type": "TypeString", + "computed": true + }, { "name": "cluster", "type": "TypeString", @@ -103178,16 +107102,6 @@ "immutable": true, "required": true }, - { - "name": "nlb_ssl_secret_name", - "type": "TypeString", - "computed": true - }, - { - "name": "nlb_type", - "type": "TypeString", - "computed": true - }, { "name": "secret_namespace", "type": "TypeString", @@ -103199,28 +107113,9 @@ "description": "The ID of the resource group that the cluster is in. To check the resource group ID of the cluster, use the GET /v1/clusters/idOrName API. To list available resource group IDs, run ibmcloud resource groups.", "cloud_data_type": "resource_group", "optional": true - }, - { - "name": "nlb_ips", - "type": "TypeSet", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "nlb_monitor_state", - "type": "TypeString", - "computed": true } ], "ibm_container_storage_attachment": [ - { - "name": "volume_attachment_name", - "type": "TypeString", - "description": "Volume attachment name", - "computed": true - }, { "name": "resource_group_id", "type": "TypeString", @@ -103271,6 +107166,12 @@ "description": "worker node ID", "immutable": true, "required": true + }, + { + "name": "volume_attachment_name", + "type": "TypeString", + "description": "Volume attachment name", + "computed": true } ], "ibm_container_vpc_alb": [ @@ -103289,9 +107190,15 @@ "computed": true }, { - "name": "status", + "name": "load_balancer_hostname", "type": "TypeString", - "description": "Status of the ALB", + "description": "Load balancer host name", + "computed": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone info.", "computed": true }, { @@ -103301,13 +107208,6 @@ "cloud_data_type": "resource_group", "optional": true }, - { - "name": "alb_id", - "type": "TypeString", - "description": "ALB ID", - "immutable": true, - "required": true - }, { "name": "alb_type", "type": "TypeString", @@ -103326,12 +107226,6 @@ "description": "Enable the ALB instance in the cluster", "optional": true }, - { - "name": "load_balancer_hostname", - "type": "TypeString", - "description": "Load balancer host name", - "computed": true - }, { "name": "resize", "type": "TypeBool", @@ -103345,38 +107239,32 @@ "computed": true }, { - "name": "zone", + "name": "status", "type": "TypeString", - "description": "Zone info.", + "description": "Status of the ALB", "computed": true + }, + { + "name": "alb_id", + "type": "TypeString", + "description": "ALB ID", + "immutable": true, + "required": true } ], "ibm_container_vpc_alb_create": [ { - "name": "alb_type", + "name": "state", "type": "TypeString", - "description": "Type of the ALB", - "computed": true - }, - { - "name": "disable_deployment", - "type": "TypeBool", - "description": "Disable the ALB instance in the cluster", + "description": "ALB state", "computed": true }, { - "name": "name", + "name": "status", "type": "TypeString", - "description": "ALB name", + "description": "Status of the ALB", "computed": true }, - { - "name": "type", - "type": "TypeString", - "description": "The type of ALB that you want to create.", - "immutable": true, - "required": true - }, { "name": "cluster", "type": "TypeString", @@ -103396,23 +107284,36 @@ "optional": true }, { - "name": "enable", - "type": "TypeBool", - "description": "Enable the ALB instance in the cluster", - "optional": true + "name": "alb_type", + "type": "TypeString", + "description": "Type of the ALB", + "computed": true }, { - "name": "state", + "name": "name", "type": "TypeString", - "description": "ALB state", + "description": "ALB name", "computed": true }, { - "name": "status", + "name": "load_balancer_hostname", "type": "TypeString", - "description": "Status of the ALB", + "description": "Load balancer host name", + "computed": true + }, + { + "name": "resize", + "type": "TypeBool", + "description": "boolean value to resize the albs", "computed": true }, + { + "name": "type", + "type": "TypeString", + "description": "The type of ALB that you want to create.", + "immutable": true, + "required": true + }, { "name": "zone", "type": "TypeString", @@ -103420,6 +107321,12 @@ "immutable": true, "required": true }, + { + "name": "enable", + "type": "TypeBool", + "description": "Enable the ALB instance in the cluster", + "optional": true + }, { "name": "alb_id", "type": "TypeString", @@ -103428,68 +107335,64 @@ "computed": true }, { - "name": "load_balancer_hostname", - "type": "TypeString", - "description": "Load balancer host name", - "computed": true - }, - { - "name": "resize", + "name": "disable_deployment", "type": "TypeBool", - "description": "boolean value to resize the albs", + "description": "Disable the ALB instance in the cluster", "computed": true } ], "ibm_container_vpc_cluster": [ { - "name": "ingress_hostname", - "type": "TypeString", - "computed": true - }, - { - "name": "update_all_workers", - "type": "TypeBool", - "description": "Updates all the woker nodes if sets to true", - "default_value": false, - "optional": true + "name": "tags", + "type": "TypeSet", + "description": "List of tags for the resources", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "taints", - "type": "TypeSet", - "description": "WorkerPool Taints", + "name": "worker_labels", + "type": "TypeMap", + "description": "Labels for default worker pool", "optional": true, + "computed": true, "elem": { - "effect": { - "name": "effect", - "type": "TypeString", - "description": "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - "required": true - }, - "key": { - "name": "key", - "type": "TypeString", - "description": "Key for taint", - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for taint.", - "required": true - } + "type": "TypeString" } }, { - "name": "kms_instance_id", + "name": "patch_version", "type": "TypeString", - "description": "Instance ID for boot volume encryption", + "description": "Kubernetes patch version", "optional": true }, { - "name": "public_service_endpoint_url", + "name": "worker_count", + "type": "TypeInt", + "description": "Number of worker nodes in the cluster", + "default_value": 1, + "optional": true + }, + { + "name": "secondary_storage", "type": "TypeString", + "description": "The secondary storage option for the default worker pool.", + "immutable": true, + "optional": true, "computed": true }, + { + "name": "wait_till", + "type": "TypeString", + "description": "wait_till can be configured for Master Ready, One worker Ready or Ingress Ready or Normal", + "default_value": "IngressReady", + "optional": true + }, { "name": "crk", "type": "TypeString", @@ -103497,99 +107400,74 @@ "optional": true }, { - "name": "kms_account_id", + "name": "host_pool_id", "type": "TypeString", - "description": "Account ID of kms instance holder - if not provided, defaults to the account in use", + "description": "The ID of the cluster's associated host pool", + "immutable": true, "optional": true }, { - "name": "crn", + "name": "resource_name", "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", + "description": "The name of the resource", "computed": true }, { - "name": "host_pool_id", + "name": "kube_version", "type": "TypeString", - "description": "The ID of the cluster's associated host pool", - "immutable": true, - "optional": true + "description": "Kubernetes version", + "optional": true, + "computed": true }, { - "name": "kms_config", - "type": "TypeList", - "description": "Enables KMS on a given cluster", + "name": "operating_system", + "type": "TypeString", + "description": "The operating system of the workers in the default worker pool.", + "immutable": true, "optional": true, - "elem": { - "crk_id": { - "name": "crk_id", - "type": "TypeString", - "description": "ID of the customer root key.", - "required": true - }, - "instance_id": { - "name": "instance_id", - "type": "TypeString", - "description": "ID of the KMS instance to use to encrypt the cluster.", - "required": true - }, - "private_endpoint": { - "name": "private_endpoint", - "type": "TypeBool", - "description": "Specify this option to use the KMS public service endpoint.", - "default_value": false, - "optional": true - } - }, - "max_items": 1 + "computed": true }, { - "name": "zones", - "type": "TypeSet", - "description": "Zone info", - "required": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Zone for the worker pool in a multizone cluster", - "required": true - }, - "subnet_id": { - "name": "subnet_id", - "type": "TypeString", - "description": "The VPC subnet to assign the cluster", - "required": true - } - } + "name": "entitlement", + "type": "TypeString", + "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", + "optional": true }, { - "name": "retry_patch_version", - "type": "TypeInt", - "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", + "name": "cos_instance_crn", + "type": "TypeString", + "description": "A standard cloud object storage instance CRN to back up the internal registry in your OpenShift on VPC Gen 2 cluster", "optional": true }, { - "name": "worker_labels", - "type": "TypeMap", - "description": "Labels for default worker pool", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "force_delete_storage", + "type": "TypeBool", + "description": "Force the removal of a cluster and its persistent storage. Deleted data cannot be recovered", + "default_value": false, + "optional": true }, { - "name": "resource_status", + "name": "resource_controller_url", "type": "TypeString", - "description": "The status of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", "computed": true }, { - "name": "image_security_enforcement", + "name": "kms_instance_id", + "type": "TypeString", + "description": "Instance ID for boot volume encryption", + "optional": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "update_all_workers", "type": "TypeBool", - "description": "Set true to enable image security enforcement policies", + "description": "Updates all the woker nodes if sets to true", "default_value": false, "optional": true }, @@ -103601,23 +107479,10 @@ "required": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags for the resources", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "wait_till", - "type": "TypeString", - "description": "wait_till can be configured for Master Ready, One worker Ready or Ingress Ready or Normal", - "default_value": "IngressReady", + "name": "wait_for_worker_update", + "type": "TypeBool", + "description": "Wait for worker node to update during kube version update.", + "default_value": true, "optional": true }, { @@ -103630,56 +107495,24 @@ "computed": true }, { - "name": "patch_version", - "type": "TypeString", - "description": "Kubernetes patch version", + "name": "image_security_enforcement", + "type": "TypeBool", + "description": "Set true to enable image security enforcement policies", + "default_value": false, "optional": true }, { - "name": "cos_instance_crn", + "name": "name", "type": "TypeString", - "description": "A standard cloud object storage instance CRN to back up the internal registry in your OpenShift on VPC Gen 2 cluster", - "optional": true + "description": "The cluster name", + "immutable": true, + "required": true }, { "name": "state", "type": "TypeString", "computed": true }, - { - "name": "ingress_secret", - "type": "TypeString", - "secure": true, - "computed": true - }, - { - "name": "private_service_endpoint_url", - "type": "TypeString", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "kube_version", - "type": "TypeString", - "description": "Kubernetes version", - "optional": true, - "computed": true - }, - { - "name": "master_status", - "type": "TypeString", - "computed": true - }, - { - "name": "master_url", - "type": "TypeString", - "computed": true - }, { "name": "albs", "type": "TypeList", @@ -103728,15 +107561,8 @@ } }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true - }, - { - "name": "resource_group_name", + "name": "private_service_endpoint_url", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", "computed": true }, { @@ -103747,53 +107573,60 @@ "optional": true }, { - "name": "entitlement", - "type": "TypeString", - "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", - "optional": true + "name": "zones", + "type": "TypeSet", + "description": "Zone info", + "required": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Zone for the worker pool in a multizone cluster", + "required": true + }, + "subnet_id": { + "name": "subnet_id", + "type": "TypeString", + "description": "The VPC subnet to assign the cluster", + "required": true + } + } }, { - "name": "force_delete_storage", - "type": "TypeBool", - "description": "Force the removal of a cluster and its persistent storage. Deleted data cannot be recovered", - "default_value": false, + "name": "retry_patch_version", + "type": "TypeInt", + "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", "optional": true }, { - "name": "resource_crn", + "name": "pod_subnet", "type": "TypeString", - "description": "The crn of the resource", + "description": "Custom subnet CIDR to provide private IP addresses for pods", + "immutable": true, + "optional": true, "computed": true }, { - "name": "name", + "name": "master_url", "type": "TypeString", - "description": "The cluster name", - "immutable": true, - "required": true + "computed": true }, { - "name": "service_subnet", + "name": "crn", "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for services", - "immutable": true, - "optional": true, + "description": "CRN of resource instance", + "cloud_data_type": "crn", "computed": true }, { - "name": "pod_subnet", + "name": "ingress_hostname", "type": "TypeString", - "description": "Custom subnet CIDR to provide private IP addresses for pods", - "immutable": true, - "optional": true, "computed": true }, { - "name": "operating_system", + "name": "ingress_secret", "type": "TypeString", - "description": "The operating system of the workers in the default worker pool.", - "immutable": true, - "optional": true, + "secure": true, "computed": true }, { @@ -103804,40 +107637,109 @@ "required": true }, { - "name": "wait_for_worker_update", - "type": "TypeBool", - "description": "Wait for worker node to update during kube version update.", - "default_value": true, - "optional": true + "name": "service_subnet", + "type": "TypeString", + "description": "Custom subnet CIDR to provide private IP addresses for services", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "worker_count", - "type": "TypeInt", - "description": "Number of worker nodes in the cluster", - "default_value": 1, + "name": "kms_account_id", + "type": "TypeString", + "description": "Account ID of kms instance holder - if not provided, defaults to the account in use", "optional": true }, { - "name": "secondary_storage", + "name": "master_status", "type": "TypeString", - "description": "The secondary storage option for the default worker pool.", - "immutable": true, + "computed": true + }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, + { + "name": "kms_config", + "type": "TypeList", + "description": "Enables KMS on a given cluster", "optional": true, + "elem": { + "crk_id": { + "name": "crk_id", + "type": "TypeString", + "description": "ID of the customer root key.", + "required": true + }, + "instance_id": { + "name": "instance_id", + "type": "TypeString", + "description": "ID of the KMS instance to use to encrypt the cluster.", + "required": true + }, + "private_endpoint": { + "name": "private_endpoint", + "type": "TypeBool", + "description": "Specify this option to use the KMS public service endpoint.", + "default_value": false, + "optional": true + } + }, + "max_items": 1 + }, + { + "name": "public_service_endpoint_url", + "type": "TypeString", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true + }, + { + "name": "taints", + "type": "TypeSet", + "description": "WorkerPool Taints", + "optional": true, + "elem": { + "effect": { + "name": "effect", + "type": "TypeString", + "description": "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", + "required": true + }, + "key": { + "name": "key", + "type": "TypeString", + "description": "Key for taint", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for taint.", + "required": true + } + } } ], "ibm_container_vpc_worker": [ { - "name": "cluster_name", + "name": "replace_worker", "type": "TypeString", - "description": "Cluster name", + "description": "Worker name/id that needs to be replaced", "immutable": true, "required": true }, { - "name": "kube_config_path", - "type": "TypeString", - "description": "Path of downloaded cluster config", + "name": "check_ptx_status", + "type": "TypeBool", + "description": "Check portworx status after worker replace", + "default_value": false, "immutable": true, "optional": true }, @@ -103856,12 +107758,11 @@ "computed": true }, { - "name": "check_ptx_status", - "type": "TypeBool", - "description": "Check portworx status after worker replace", - "default_value": false, + "name": "cluster_name", + "type": "TypeString", + "description": "Cluster name", "immutable": true, - "optional": true + "required": true }, { "name": "sds", @@ -103871,19 +107772,19 @@ "optional": true }, { - "name": "sds_timeout", + "name": "kube_config_path", "type": "TypeString", - "description": "Timeout for checking sds deployment/status", - "default_value": "15m", + "description": "Path of downloaded cluster config", "immutable": true, "optional": true }, { - "name": "replace_worker", + "name": "sds_timeout", "type": "TypeString", - "description": "Worker name/id that needs to be replaced", + "description": "Timeout for checking sds deployment/status", + "default_value": "15m", "immutable": true, - "required": true + "optional": true }, { "name": "resource_group_id", @@ -103896,20 +107797,36 @@ ], "ibm_container_vpc_worker_pool": [ { - "name": "cluster", + "name": "entitlement", "type": "TypeString", - "description": "Cluster name", - "cloud_data_type": "cluster", + "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", + "optional": true + }, + { + "name": "operating_system", + "type": "TypeString", + "description": "The operating system of the workers in the worker pool.", "immutable": true, - "required": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "optional": true, + "computed": true }, { - "name": "flavor", + "name": "vpc_id", "type": "TypeString", - "description": "cluster node falvor", + "description": "The vpc id where the cluster is", + "immutable": true, + "required": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "Resource Controller URL", + "computed": true + }, + { + "name": "worker_pool_name", + "type": "TypeString", + "description": "worker pool name", "immutable": true, "required": true }, @@ -103923,6 +107840,64 @@ "type": "TypeString" } }, + { + "name": "secondary_storage", + "type": "TypeString", + "description": "The secondary storage option for the workers in the worker pool.", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "host_pool_id", + "type": "TypeString", + "description": "The ID of the dedicated host pool associated with the worker pool", + "immutable": true, + "optional": true + }, + { + "name": "kms_instance_id", + "type": "TypeString", + "description": "Instance ID for boot volume encryption", + "optional": true + }, + { + "name": "crk", + "type": "TypeString", + "description": "Root Key ID for boot volume encryption", + "optional": true + }, + { + "name": "kms_account_id", + "type": "TypeString", + "description": "Account ID of kms instance holder - if not provided, defaults to the account in use", + "optional": true + }, + { + "name": "cluster", + "type": "TypeString", + "description": "Cluster name", + "cloud_data_type": "cluster", + "immutable": true, + "required": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "worker_pool_id", + "type": "TypeString", + "computed": true + }, { "name": "taints", "type": "TypeSet", @@ -103949,58 +107924,24 @@ } } }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "kms_account_id", - "type": "TypeString", - "description": "Account ID of kms instance holder - if not provided, defaults to the account in use", - "optional": true - }, - { - "name": "autoscale_enabled", - "type": "TypeBool", - "description": "Autoscaling is enabled on the workerpool", - "computed": true - }, { "name": "worker_count", "type": "TypeInt", - "description": "The number of workers", - "required": true - }, - { - "name": "entitlement", - "type": "TypeString", - "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", - "optional": true - }, - { - "name": "secondary_storage", - "type": "TypeString", - "description": "The secondary storage option for the workers in the worker pool.", - "immutable": true, - "optional": true, - "computed": true + "description": "The number of workers", + "required": true }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "Resource Controller URL", + "name": "autoscale_enabled", + "type": "TypeBool", + "description": "Autoscaling is enabled on the workerpool", "computed": true }, { - "name": "crk", + "name": "flavor", "type": "TypeString", - "description": "Root Key ID for boot volume encryption", - "optional": true + "description": "cluster node falvor", + "immutable": true, + "required": true }, { "name": "zones", @@ -104021,46 +107962,6 @@ "required": true } } - }, - { - "name": "worker_pool_id", - "type": "TypeString", - "computed": true - }, - { - "name": "operating_system", - "type": "TypeString", - "description": "The operating system of the workers in the worker pool.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "kms_instance_id", - "type": "TypeString", - "description": "Instance ID for boot volume encryption", - "optional": true - }, - { - "name": "worker_pool_name", - "type": "TypeString", - "description": "worker pool name", - "immutable": true, - "required": true - }, - { - "name": "vpc_id", - "type": "TypeString", - "description": "The vpc id where the cluster is", - "immutable": true, - "required": true - }, - { - "name": "host_pool_id", - "type": "TypeString", - "description": "The ID of the dedicated host pool associated with the worker pool", - "immutable": true, - "optional": true } ], "ibm_container_worker_pool": [ @@ -104076,30 +107977,48 @@ ] }, { - "name": "worker_pool_name", + "name": "entitlement", "type": "TypeString", - "description": "worker pool name", - "immutable": true, - "required": true + "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", + "optional": true }, { - "name": "operating_system", + "name": "worker_pool_id", "type": "TypeString", - "description": "The operating system of the workers in the worker pool.", - "immutable": true, - "optional": true, "computed": true }, { - "name": "labels", - "type": "TypeMap", - "description": "list of labels to worker pool", + "name": "taints", + "type": "TypeSet", + "description": "WorkerPool Taints", "optional": true, - "computed": true, "elem": { - "type": "TypeString" + "effect": { + "name": "effect", + "type": "TypeString", + "description": "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", + "required": true + }, + "key": { + "name": "key", + "type": "TypeString", + "description": "Key for taint", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for taint.", + "required": true + } } }, + { + "name": "autoscale_enabled", + "type": "TypeBool", + "description": "Autoscaling is enabled on the workerpool", + "computed": true + }, { "name": "machine_type", "type": "TypeString", @@ -104108,27 +108027,27 @@ "required": true }, { - "name": "state", + "name": "hardware", "type": "TypeString", - "description": "worker pool state", - "computed": true + "description": "Hardware type", + "default_value": "shared", + "immutable": true, + "optional": true }, { - "name": "worker_pool_id", + "name": "state", "type": "TypeString", + "description": "worker pool state", "computed": true }, { - "name": "resource_controller_url", + "name": "region", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", - "computed": true - }, - { - "name": "autoscale_enabled", - "type": "TypeBool", - "description": "Autoscaling is enabled on the workerpool", - "computed": true + "description": "The worker pool region", + "cloud_data_type": "region", + "optional": true, + "computed": true, + "deprecated": "This field is deprecated" }, { "name": "size_per_zone", @@ -104137,18 +108056,12 @@ "required": true }, { - "name": "entitlement", - "type": "TypeString", - "description": "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", - "optional": true - }, - { - "name": "hardware", + "name": "operating_system", "type": "TypeString", - "description": "Hardware type", - "default_value": "shared", + "description": "The operating system of the workers in the worker pool.", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { "name": "disk_encryption", @@ -104158,6 +108071,27 @@ "immutable": true, "optional": true }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", + "computed": true + }, + { + "name": "worker_pool_name", + "type": "TypeString", + "description": "worker pool name", + "immutable": true, + "required": true + }, { "name": "zones", "type": "TypeList", @@ -104186,63 +108120,30 @@ } }, { - "name": "taints", - "type": "TypeSet", - "description": "WorkerPool Taints", + "name": "labels", + "type": "TypeMap", + "description": "list of labels to worker pool", "optional": true, + "computed": true, "elem": { - "effect": { - "name": "effect", - "type": "TypeString", - "description": "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - "required": true - }, - "key": { - "name": "key", - "type": "TypeString", - "description": "Key for taint", - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for taint.", - "required": true - } + "type": "TypeString" } - }, - { - "name": "region", - "type": "TypeString", - "description": "The worker pool region", - "cloud_data_type": "region", - "optional": true, - "computed": true, - "deprecated": "This field is deprecated" - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true } ], "ibm_container_worker_pool_zone_attachment": [ { - "name": "region", - "type": "TypeString", - "description": "The zone region", - "cloud_data_type": "region", - "optional": true, - "computed": true, - "deprecated": "This field is deprecated" + "name": "wait_till_albs", + "type": "TypeBool", + "description": "wait_till_albs can be configured to wait for albs during the worker pool zone attachment.", + "default_value": true, + "optional": true }, { - "name": "worker_count", - "type": "TypeInt", - "computed": true + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "immutable": true, + "required": true }, { "name": "cluster", @@ -104268,107 +108169,36 @@ "computed": true }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true + "name": "worker_count", + "type": "TypeInt", + "computed": true }, { - "name": "zone", + "name": "worker_pool", "type": "TypeString", - "description": "Zone name", + "description": "Workerpool name", "immutable": true, "required": true }, { - "name": "worker_pool", + "name": "resource_group_id", "type": "TypeString", - "description": "Workerpool name", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", "immutable": true, - "required": true + "optional": true }, { - "name": "wait_till_albs", - "type": "TypeBool", - "description": "wait_till_albs can be configured to wait for albs during the worker pool zone attachment.", - "default_value": true, - "optional": true + "name": "region", + "type": "TypeString", + "description": "The zone region", + "cloud_data_type": "region", + "optional": true, + "computed": true, + "deprecated": "This field is deprecated" } ], "ibm_cos_bucket": [ - { - "name": "activity_tracking", - "type": "TypeList", - "description": "Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events", - "optional": true, - "elem": { - "activity_tracker_crn": { - "name": "activity_tracker_crn", - "type": "TypeString", - "description": "The instance of Activity Tracker that will receive object event data", - "required": true - }, - "read_data_events": { - "name": "read_data_events", - "type": "TypeBool", - "description": "If set to true, all object read events will be sent to Activity Tracker.", - "default_value": false, - "optional": true - }, - "write_data_events": { - "name": "write_data_events", - "type": "TypeBool", - "description": "If set to true, all object write events will be sent to Activity Tracker.", - "default_value": false, - "optional": true - } - }, - "max_items": 1 - }, - { - "name": "noncurrent_version_expiration", - "type": "TypeList", - "description": "Enable configuration expire_rule to COS Bucket after a defined period of time", - "optional": true, - "elem": { - "enable": { - "name": "enable", - "type": "TypeBool", - "description": "Enable or disable an expire rule for a bucket", - "required": true - }, - "noncurrent_days": { - "name": "noncurrent_days", - "type": "TypeInt", - "description": "Specifies the number of days when the specific rule action takes effect.", - "optional": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "The rule applies to any objects with keys that match this prefix", - "optional": true, - "computed": true - }, - "rule_id": { - "name": "rule_id", - "type": "TypeString", - "description": "Unique identifier for the rule.Expire rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", - "optional": true, - "computed": true - } - }, - "max_items": 1 - }, - { - "name": "crn", - "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", - "computed": true - }, { "name": "kms_key_crn", "type": "TypeString", @@ -104384,63 +108214,12 @@ "options": "ams03,che01,hkg02,mel01,mex01,mil01,mon01,osl01,par01,sjc04,sao01,seo01,sng01,tor01", "optional": true }, - { - "name": "region_location", - "type": "TypeString", - "description": "Region Location info.", - "immutable": true, - "optional": true - }, - { - "name": "storage_class", - "type": "TypeString", - "description": "Storage class info", - "immutable": true, - "options": "standard,vault,cold,smart,flex,onerate_active", - "optional": true, - "computed": true - }, { "name": "s3_endpoint_public", "type": "TypeString", "description": "Public endpoint for the COS bucket", "computed": true }, - { - "name": "force_delete", - "type": "TypeBool", - "description": "COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.", - "default_value": true, - "optional": true - }, - { - "name": "object_lock", - "type": "TypeBool", - "description": "Enable objectlock for the bucket. When enabled, buckets within the container vault can have Object Lock Configuration applied to the bucket.", - "optional": true - }, - { - "name": "key_protect", - "type": "TypeString", - "description": "CRN of the key you want to use data at rest encryption", - "immutable": true, - "optional": true - }, - { - "name": "satellite_location_id", - "type": "TypeString", - "description": "Provide satellite location info.", - "immutable": true, - "optional": true - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private", - "default_value": "public", - "options": "public,private,direct", - "optional": true - }, { "name": "metrics_monitoring", "type": "TypeList", @@ -104506,11 +108285,55 @@ "max_items": 1 }, { - "name": "bucket_name", - "type": "TypeString", - "description": "COS Bucket name", + "name": "retention_rule", + "type": "TypeList", + "description": "A retention policy is enabled at the IBM Cloud Object Storage bucket level. Minimum, maximum and default retention period are defined by this policy and apply to all objects in the bucket.", "immutable": true, - "required": true + "optional": true, + "elem": { + "default": { + "name": "default", + "type": "TypeInt", + "description": "If an object is stored in the bucket without specifying a custom retention period.", + "required": true + }, + "maximum": { + "name": "maximum", + "type": "TypeInt", + "description": "Maximum duration of time an object can be kept unmodified in the bucket.", + "required": true + }, + "minimum": { + "name": "minimum", + "type": "TypeInt", + "description": "Minimum duration of time an object must be kept unmodified in the bucket", + "required": true + }, + "permanent": { + "name": "permanent", + "type": "TypeBool", + "description": "Enable or disable the permanent retention policy on the bucket", + "default_value": false, + "optional": true + } + }, + "max_items": 1 + }, + { + "name": "object_versioning", + "type": "TypeList", + "description": "Protect objects from accidental deletion or overwrites. Versioning allows you to keep multiple versions of an object protecting from unintentional data loss.", + "optional": true, + "elem": { + "enable": { + "name": "enable", + "type": "TypeBool", + "description": "Enable or suspend the versioning for objects in the bucket", + "default_value": false, + "optional": true + } + }, + "max_items": 1 }, { "name": "resource_instance_id", @@ -104525,10 +108348,27 @@ ] }, { - "name": "s3_endpoint_direct", + "name": "key_protect", "type": "TypeString", - "description": "Direct endpoint for the COS bucket", - "computed": true + "description": "CRN of the key you want to use data at rest encryption", + "immutable": true, + "optional": true + }, + { + "name": "satellite_location_id", + "type": "TypeString", + "description": "Provide satellite location info.", + "immutable": true, + "optional": true + }, + { + "name": "allowed_ip", + "type": "TypeList", + "description": "List of IPv4 or IPv6 addresses", + "optional": true, + "elem": { + "type": "TypeString" + } }, { "name": "archive_rule", @@ -104612,40 +108452,67 @@ "max_items": 1000 }, { - "name": "retention_rule", + "name": "noncurrent_version_expiration", "type": "TypeList", - "description": "A retention policy is enabled at the IBM Cloud Object Storage bucket level. Minimum, maximum and default retention period are defined by this policy and apply to all objects in the bucket.", - "immutable": true, + "description": "Enable configuration expire_rule to COS Bucket after a defined period of time", "optional": true, "elem": { - "default": { - "name": "default", - "type": "TypeInt", - "description": "If an object is stored in the bucket without specifying a custom retention period.", + "enable": { + "name": "enable", + "type": "TypeBool", + "description": "Enable or disable an expire rule for a bucket", "required": true }, - "maximum": { - "name": "maximum", + "noncurrent_days": { + "name": "noncurrent_days", "type": "TypeInt", - "description": "Maximum duration of time an object can be kept unmodified in the bucket.", - "required": true + "description": "Specifies the number of days when the specific rule action takes effect.", + "optional": true }, - "minimum": { - "name": "minimum", - "type": "TypeInt", - "description": "Minimum duration of time an object must be kept unmodified in the bucket", - "required": true + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "The rule applies to any objects with keys that match this prefix", + "optional": true, + "computed": true }, - "permanent": { - "name": "permanent", - "type": "TypeBool", - "description": "Enable or disable the permanent retention policy on the bucket", - "default_value": false, - "optional": true + "rule_id": { + "name": "rule_id", + "type": "TypeString", + "description": "Unique identifier for the rule.Expire rules allow you to set a specific time frame after which objects are deleted. Set Rule ID for cos bucket", + "optional": true, + "computed": true } }, "max_items": 1 }, + { + "name": "force_delete", + "type": "TypeBool", + "description": "COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.", + "default_value": true, + "optional": true + }, + { + "name": "object_lock", + "type": "TypeBool", + "description": "Enable objectlock for the bucket. When enabled, buckets within the container vault can have Object Lock Configuration applied to the bucket.", + "optional": true + }, + { + "name": "bucket_name", + "type": "TypeString", + "description": "COS Bucket name", + "immutable": true, + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN of resource instance", + "cloud_data_type": "crn", + "computed": true + }, { "name": "cross_region_location", "type": "TypeString", @@ -104654,6 +108521,14 @@ "options": "us,eu,ap", "optional": true }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private", + "default_value": "public", + "options": "public,private,direct", + "optional": true + }, { "name": "s3_endpoint_private", "type": "TypeString", @@ -104661,24 +108536,50 @@ "computed": true }, { - "name": "allowed_ip", - "type": "TypeList", - "description": "List of IPv4 or IPv6 addresses", + "name": "region_location", + "type": "TypeString", + "description": "Region Location info.", + "immutable": true, + "optional": true + }, + { + "name": "storage_class", + "type": "TypeString", + "description": "Storage class info", + "immutable": true, + "options": "standard,vault,cold,smart,flex,onerate_active", "optional": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "object_versioning", + "name": "s3_endpoint_direct", + "type": "TypeString", + "description": "Direct endpoint for the COS bucket", + "computed": true + }, + { + "name": "activity_tracking", "type": "TypeList", - "description": "Protect objects from accidental deletion or overwrites. Versioning allows you to keep multiple versions of an object protecting from unintentional data loss.", + "description": "Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events", "optional": true, "elem": { - "enable": { - "name": "enable", + "activity_tracker_crn": { + "name": "activity_tracker_crn", + "type": "TypeString", + "description": "The instance of Activity Tracker that will receive object event data", + "required": true + }, + "read_data_events": { + "name": "read_data_events", "type": "TypeBool", - "description": "Enable or suspend the versioning for objects in the bucket", + "description": "If set to true, all object read events will be sent to Activity Tracker.", + "default_value": false, + "optional": true + }, + "write_data_events": { + "name": "write_data_events", + "type": "TypeBool", + "description": "If set to true, all object write events will be sent to Activity Tracker.", "default_value": false, "optional": true } @@ -104694,43 +108595,48 @@ ], "ibm_cos_bucket_object": [ { - "name": "website_redirect", - "type": "TypeString", - "description": "Redirect a request to another object or an URL", - "optional": true + "name": "content_length", + "type": "TypeInt", + "description": "COS object content length", + "computed": true }, { - "name": "body", + "name": "object_sql_url", "type": "TypeString", - "description": "COS object body", + "description": "Access the object using an SQL Query instance.The reference url is used to perform queries against objects storing structured data.", "computed": true }, { - "name": "content", + "name": "object_lock_mode", "type": "TypeString", - "description": "COS object content", + "description": "Retention modes apply different levels of protection to the objects.", "optional": true }, { - "name": "content_type", + "name": "website_redirect", "type": "TypeString", - "description": "COS object content type", - "computed": true + "description": "Redirect a request to another object or an URL", + "optional": true }, { - "name": "etag", + "name": "body", "type": "TypeString", - "description": "COS object MD5 hexdigest", - "optional": true, + "description": "COS object body", "computed": true }, { - "name": "key", + "name": "bucket_crn", "type": "TypeString", - "description": "COS object key", + "description": "COS bucket CRN", "immutable": true, "required": true }, + { + "name": "content_file", + "type": "TypeString", + "description": "COS object content file path", + "optional": true + }, { "name": "last_modified", "type": "TypeString", @@ -104738,11 +108644,17 @@ "computed": true }, { - "name": "bucket_crn", + "name": "force_delete", + "type": "TypeBool", + "description": "COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.", + "default_value": true, + "optional": true + }, + { + "name": "object_lock_retain_until_date", "type": "TypeString", - "description": "COS bucket CRN", - "immutable": true, - "required": true + "description": "An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.", + "optional": true }, { "name": "bucket_location", @@ -104758,33 +108670,33 @@ "optional": true }, { - "name": "version_id", + "name": "etag", "type": "TypeString", + "description": "COS object MD5 hexdigest", + "optional": true, "computed": true }, { - "name": "force_delete", - "type": "TypeBool", - "description": "COS buckets need to be empty before they can be deleted. force_delete option empty the bucket and delete it.", - "default_value": true, - "optional": true + "name": "version_id", + "type": "TypeString", + "computed": true }, { - "name": "object_lock_retain_until_date", + "name": "object_lock_legal_hold_status", "type": "TypeString", - "description": "An object cannot be deleted when the current time is earlier than the retainUntilDate. After this date, the object can be deleted.", + "description": "An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.", "optional": true }, { - "name": "content_file", + "name": "content", "type": "TypeString", - "description": "COS object content file path", + "description": "COS object content", "optional": true }, { - "name": "content_length", - "type": "TypeInt", - "description": "COS object content length", + "name": "content_type", + "type": "TypeString", + "description": "COS object content type", "computed": true }, { @@ -104795,25 +108707,28 @@ "optional": true }, { - "name": "object_sql_url", + "name": "key", "type": "TypeString", - "description": "Access the object using an SQL Query instance.The reference url is used to perform queries against objects storing structured data.", - "computed": true - }, + "description": "COS object key", + "immutable": true, + "required": true + } + ], + "ibm_cos_bucket_object_lock_configuration": [ { - "name": "object_lock_legal_hold_status", + "name": "bucket_crn", "type": "TypeString", - "description": "An object lock configuration on the object, the valid states are ON/OFF. When ON prevents deletion of the object version.", - "optional": true + "description": "COS bucket CRN", + "immutable": true, + "required": true }, { - "name": "object_lock_mode", + "name": "bucket_location", "type": "TypeString", - "description": "Retention modes apply different levels of protection to the objects.", - "optional": true - } - ], - "ibm_cos_bucket_object_lock_configuration": [ + "description": "COS bucket location", + "immutable": true, + "required": true + }, { "name": "endpoint_type", "type": "TypeString", @@ -104870,20 +108785,6 @@ } }, "max_items": 1 - }, - { - "name": "bucket_crn", - "type": "TypeString", - "description": "COS bucket CRN", - "immutable": true, - "required": true - }, - { - "name": "bucket_location", - "type": "TypeString", - "description": "COS bucket location", - "immutable": true, - "required": true } ], "ibm_cos_bucket_replication_rule": [ @@ -105118,23 +109019,31 @@ ], "ibm_cr_namespace": [ { - "name": "created_date", + "name": "crn", "type": "TypeString", - "description": "When the namespace was created.", + "description": "If the namespace has been assigned to a resource group, this is the IBM Cloud CRN representing the namespace.", + "cloud_data_type": "crn", "computed": true }, { - "name": "crn", + "name": "resource_created_date", "type": "TypeString", - "description": "If the namespace has been assigned to a resource group, this is the IBM Cloud CRN representing the namespace.", - "cloud_data_type": "crn", + "description": "When the namespace was assigned to a resource group.", "computed": true }, { - "name": "updated_date", + "name": "created_on", + "type": "TypeString", + "description": "When the namespace was created.", + "computed": true, + "deprecated": "This field is deprecated" + }, + { + "name": "updated_on", "type": "TypeString", "description": "When the namespace was last updated.", - "computed": true + "computed": true, + "deprecated": "This field is deprecated" }, { "name": "name", @@ -105146,15 +109055,6 @@ "max_length": 30, "matches": "^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$" }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The ID of the resource group that the namespace will be created within.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "tags", "type": "TypeSet", @@ -105172,27 +109072,34 @@ "computed": true }, { - "name": "resource_created_date", + "name": "created_date", "type": "TypeString", - "description": "When the namespace was assigned to a resource group.", + "description": "When the namespace was created.", "computed": true }, { - "name": "created_on", + "name": "resource_group_id", "type": "TypeString", - "description": "When the namespace was created.", - "computed": true, - "deprecated": "This field is deprecated" + "description": "The ID of the resource group that the namespace will be created within.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "updated_on", + "name": "updated_date", "type": "TypeString", "description": "When the namespace was last updated.", - "computed": true, - "deprecated": "This field is deprecated" + "computed": true } ], "ibm_cr_retention_policy": [ + { + "name": "namespace", + "type": "TypeString", + "description": "The namespace to which the retention policy is attached.", + "required": true + }, { "name": "images_per_repo", "type": "TypeInt", @@ -105205,71 +109112,9 @@ "description": "Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed.", "default_value": false, "optional": true - }, - { - "name": "namespace", - "type": "TypeString", - "description": "The namespace to which the retention policy is attached.", - "required": true } ], "ibm_database": [ - { - "name": "version", - "type": "TypeString", - "description": "The database version to provision if specified", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "node_disk_allocation_mb", - "type": "TypeInt", - "description": "Disk allocation per node", - "optional": true, - "computed": true, - "deprecated": "use group instead" - }, - { - "name": "backup_encryption_key_crn", - "type": "TypeString", - "description": "The Backup Encryption Key CRN", - "immutable": true, - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Resource instance name for example, my Database instance", - "required": true - }, - { - "name": "plan_validation", - "type": "TypeBool", - "description": "For elasticsearch and postgres perform database parameter validation during the plan phase. Otherwise, database parameter validation happens in apply phase.", - "default_value": true, - "optional": true - }, - { - "name": "service_endpoints", - "type": "TypeString", - "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", - "default_value": "public", - "options": "public, private, public-and-private", - "optional": true - }, - { - "name": "tags", - "type": "TypeSet", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "point_in_time_recovery_deployment_id", "type": "TypeString", @@ -105277,283 +109122,106 @@ "optional": true }, { - "name": "connectionstrings", - "type": "TypeList", - "computed": true, + "name": "users", + "type": "TypeSet", + "optional": true, "elem": { - "bundlebase64": { - "name": "bundlebase64", - "type": "TypeString", - "description": "Cassandra base64 encoding", - "computed": true - }, - "bundlename": { - "name": "bundlename", - "type": "TypeString", - "description": "Cassandra Bundle Name", - "computed": true - }, - "certbase64": { - "name": "certbase64", - "type": "TypeString", - "description": "Certificate in base64 encoding", - "computed": true - }, - "certname": { - "name": "certname", - "type": "TypeString", - "description": "Certificate Name", - "computed": true - }, - "composed": { - "name": "composed", - "type": "TypeString", - "description": "Connection string", - "computed": true - }, - "database": { - "name": "database", - "type": "TypeString", - "description": "DB name", - "computed": true - }, - "hosts": { - "name": "hosts", - "type": "TypeList", - "optional": true, - "elem": { - "hostname": { - "name": "hostname", - "type": "TypeString", - "description": "DB host name", - "computed": true - }, - "port": { - "name": "port", - "type": "TypeString", - "description": "DB port", - "computed": true - } - } - }, "name": { "name": "name", "type": "TypeString", "description": "User name", - "computed": true + "required": true }, "password": { "name": "password", "type": "TypeString", - "description": "Password", - "computed": true - }, - "path": { - "name": "path", - "type": "TypeString", - "description": "DB path", - "computed": true + "description": "User password", + "secure": true, + "required": true }, - "queryoptions": { - "name": "queryoptions", + "role": { + "name": "role", "type": "TypeString", - "description": "DB query options", - "computed": true + "description": "User role. Only available for ops_manager user type.", + "optional": true }, - "scheme": { - "name": "scheme", + "type": { + "name": "type", "type": "TypeString", - "description": "DB scheme", - "computed": true + "description": "User type", + "default_value": "database", + "optional": true } - }, - "deprecated": "This field is deprecated, please use ibm_database_connection instead" + } }, { - "name": "auto_scaling", - "type": "TypeList", - "description": "ICD Auto Scaling", + "name": "group", + "type": "TypeSet", "optional": true, - "computed": true, "elem": { "cpu": { "name": "cpu", - "type": "TypeList", - "description": "CPU Auto Scaling", + "type": "TypeSet", "optional": true, - "computed": true, "elem": { - "rate_increase_percent": { - "name": "rate_increase_percent", - "type": "TypeInt", - "description": "Auto Scaling Rate: Increase Percent", - "optional": true, - "computed": true - }, - "rate_limit_count_per_member": { - "name": "rate_limit_count_per_member", - "type": "TypeInt", - "description": "Auto Scaling Rate: Limit count per number", - "optional": true, - "computed": true - }, - "rate_period_seconds": { - "name": "rate_period_seconds", + "allocation_count": { + "name": "allocation_count", "type": "TypeInt", - "description": "Auto Scaling Rate: Period Seconds", - "optional": true, - "computed": true - }, - "rate_units": { - "name": "rate_units", - "type": "TypeString", - "description": "Auto Scaling Rate: Units", - "optional": true, - "computed": true + "required": true } }, - "max_items": 1, - "deprecated": "This field is deprecated, auto scaling cpu is unsupported by IBM Cloud Databases" + "max_items": 1 }, "disk": { "name": "disk", - "type": "TypeList", - "description": "Disk Auto Scaling", + "type": "TypeSet", "optional": true, - "computed": true, "elem": { - "capacity_enabled": { - "name": "capacity_enabled", - "type": "TypeBool", - "description": "Auto Scaling Scalar: Capacity Enabled", - "optional": true, - "computed": true - }, - "free_space_less_than_percent": { - "name": "free_space_less_than_percent", - "type": "TypeInt", - "description": "Auto Scaling Scalar: Capacity Free Space Less Than Percent", - "optional": true, - "computed": true - }, - "io_above_percent": { - "name": "io_above_percent", - "type": "TypeInt", - "description": "Auto Scaling Scalar: IO Utilization Above Percent", - "optional": true, - "computed": true - }, - "io_enabled": { - "name": "io_enabled", - "type": "TypeBool", - "description": "Auto Scaling Scalar: IO Utilization Enabled", - "optional": true, - "computed": true - }, - "io_over_period": { - "name": "io_over_period", - "type": "TypeString", - "description": "Auto Scaling Scalar: IO Utilization Over Period", - "optional": true, - "computed": true - }, - "rate_increase_percent": { - "name": "rate_increase_percent", - "type": "TypeInt", - "description": "Auto Scaling Rate: Increase Percent", - "optional": true, - "computed": true - }, - "rate_limit_mb_per_member": { - "name": "rate_limit_mb_per_member", - "type": "TypeInt", - "description": "Auto Scaling Rate: Limit mb per member", - "optional": true, - "computed": true - }, - "rate_period_seconds": { - "name": "rate_period_seconds", + "allocation_mb": { + "name": "allocation_mb", "type": "TypeInt", - "description": "Auto Scaling Rate: Period Seconds", - "optional": true, - "computed": true - }, - "rate_units": { - "name": "rate_units", - "type": "TypeString", - "description": "Auto Scaling Rate: Units", - "optional": true, - "computed": true + "required": true + } + }, + "max_items": 1 + }, + "group_id": { + "name": "group_id", + "type": "TypeString", + "required": true + }, + "members": { + "name": "members", + "type": "TypeSet", + "optional": true, + "elem": { + "allocation_count": { + "name": "allocation_count", + "type": "TypeInt", + "required": true } }, "max_items": 1 }, "memory": { "name": "memory", - "type": "TypeList", - "description": "Memory Auto Scaling", + "type": "TypeSet", "optional": true, - "computed": true, "elem": { - "io_above_percent": { - "name": "io_above_percent", - "type": "TypeInt", - "description": "Auto Scaling Scalar: IO Utilization Above Percent", - "optional": true, - "computed": true - }, - "io_enabled": { - "name": "io_enabled", - "type": "TypeBool", - "description": "Auto Scaling Scalar: IO Utilization Enabled", - "optional": true, - "computed": true - }, - "io_over_period": { - "name": "io_over_period", - "type": "TypeString", - "description": "Auto Scaling Scalar: IO Utilization Over Period", - "optional": true, - "computed": true - }, - "rate_increase_percent": { - "name": "rate_increase_percent", - "type": "TypeInt", - "description": "Auto Scaling Rate: Increase Percent", - "optional": true, - "computed": true - }, - "rate_limit_mb_per_member": { - "name": "rate_limit_mb_per_member", - "type": "TypeInt", - "description": "Auto Scaling Rate: Limit mb per member", - "optional": true, - "computed": true - }, - "rate_period_seconds": { - "name": "rate_period_seconds", + "allocation_mb": { + "name": "allocation_mb", "type": "TypeInt", - "description": "Auto Scaling Rate: Period Seconds", - "optional": true, - "computed": true - }, - "rate_units": { - "name": "rate_units", - "type": "TypeString", - "description": "Auto Scaling Rate: Units", - "optional": true, - "computed": true + "required": true } }, "max_items": 1 } - }, - "max_items": 1 + } }, { - "name": "resource_name", + "name": "resource_crn", "type": "TypeString", - "description": "The name of the resource", + "description": "The crn of the resource", "computed": true }, { @@ -105562,61 +109230,6 @@ "description": "Unique identifier of resource instance", "computed": true }, - { - "name": "node_memory_allocation_mb", - "type": "TypeInt", - "description": "Memory allocation per node", - "optional": true, - "computed": true, - "deprecated": "use group instead" - }, - { - "name": "node_cpu_allocation_count", - "type": "TypeInt", - "description": "CPU allocation per node", - "optional": true, - "computed": true, - "deprecated": "use group instead" - }, - { - "name": "backup_id", - "type": "TypeString", - "description": "The CRN of backup source database", - "optional": true - }, - { - "name": "allowlist", - "type": "TypeSet", - "optional": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "Allowlist IP address in CIDR notation", - "optional": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Unique allow list description", - "optional": true - } - } - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - "computed": true - }, - { - "name": "members_disk_allocation_mb", - "type": "TypeInt", - "description": "Disk allocation required for cluster", - "optional": true, - "computed": true, - "deprecated": "use group instead" - }, { "name": "adminuser", "type": "TypeString", @@ -105624,16 +109237,16 @@ "computed": true }, { - "name": "adminpassword", + "name": "key_protect_instance", "type": "TypeString", - "description": "The admin user password for the instance", - "secure": true, + "description": "The CRN of Key protect instance", + "immutable": true, "optional": true }, { - "name": "configuration", + "name": "backup_id", "type": "TypeString", - "description": "The configuration in JSON format", + "description": "The CRN of backup source database", "optional": true }, { @@ -105642,20 +109255,6 @@ "description": "The CRN of leader database", "optional": true }, - { - "name": "key_protect_instance", - "type": "TypeString", - "description": "The CRN of Key protect instance", - "immutable": true, - "optional": true - }, - { - "name": "key_protect_key", - "type": "TypeString", - "description": "The CRN of Key protect key", - "immutable": true, - "optional": true - }, { "name": "groups", "type": "TypeList", @@ -105804,24 +109403,6 @@ } } }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The id of the resource group in which the Database instance is present", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true, - "cloud_data_range": [ - "resolved_to:id" - ] - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, { "name": "service", "type": "TypeString", @@ -105831,36 +109412,15 @@ "options": "databases-for-etcd, databases-for-postgresql, databases-for-redis, databases-for-elasticsearch, databases-for-mongodb, messages-for-rabbitmq, databases-for-mysql, databases-for-cassandra, databases-for-enterprisedb" }, { - "name": "users", + "name": "tags", "type": "TypeSet", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "optional": true, + "computed": true, "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "User name", - "required": true - }, - "password": { - "name": "password", - "type": "TypeString", - "description": "User password", - "secure": true, - "required": true - }, - "role": { - "name": "role", - "type": "TypeString", - "description": "User role. Only available for ops_manager user type.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "User type", - "default_value": "database", - "optional": true - } + "type": "TypeString" } }, { @@ -105877,20 +109437,29 @@ "computed": true }, { - "name": "members_memory_allocation_mb", - "type": "TypeInt", - "description": "Memory allocation required for cluster", - "optional": true, - "computed": true, - "deprecated": "use group instead" + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "computed": true }, { - "name": "members_cpu_allocation_count", - "type": "TypeInt", - "description": "CPU allocation required for cluster", + "name": "resource_group_id", + "type": "TypeString", + "description": "The id of the resource group in which the Database instance is present", + "cloud_data_type": "resource_group", + "immutable": true, "optional": true, "computed": true, - "deprecated": "use group instead" + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "adminpassword", + "type": "TypeString", + "description": "The admin user password for the instance", + "secure": true, + "optional": true }, { "name": "point_in_time_recovery_time", @@ -105924,135 +109493,190 @@ } }, { - "name": "plan", - "type": "TypeString", - "description": "The plan type of the Database instance", - "immutable": true, - "required": true, - "options": "standard, enterprise, enterprise-sharding" - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "node_count", - "type": "TypeInt", - "description": "Total number of nodes in the cluster", + "name": "auto_scaling", + "type": "TypeList", + "description": "ICD Auto Scaling", "optional": true, "computed": true, - "deprecated": "use group instead" - }, - { - "name": "group", - "type": "TypeSet", - "optional": true, "elem": { "cpu": { "name": "cpu", - "type": "TypeSet", + "type": "TypeList", + "description": "CPU Auto Scaling", "optional": true, + "computed": true, "elem": { - "allocation_count": { - "name": "allocation_count", + "rate_increase_percent": { + "name": "rate_increase_percent", "type": "TypeInt", - "required": true + "description": "Auto Scaling Rate: Increase Percent", + "optional": true, + "computed": true + }, + "rate_limit_count_per_member": { + "name": "rate_limit_count_per_member", + "type": "TypeInt", + "description": "Auto Scaling Rate: Limit count per number", + "optional": true, + "computed": true + }, + "rate_period_seconds": { + "name": "rate_period_seconds", + "type": "TypeInt", + "description": "Auto Scaling Rate: Period Seconds", + "optional": true, + "computed": true + }, + "rate_units": { + "name": "rate_units", + "type": "TypeString", + "description": "Auto Scaling Rate: Units", + "optional": true, + "computed": true } }, - "max_items": 1 + "max_items": 1, + "deprecated": "This field is deprecated, auto scaling cpu is unsupported by IBM Cloud Databases" }, "disk": { "name": "disk", - "type": "TypeSet", + "type": "TypeList", + "description": "Disk Auto Scaling", "optional": true, + "computed": true, "elem": { - "allocation_mb": { - "name": "allocation_mb", + "capacity_enabled": { + "name": "capacity_enabled", + "type": "TypeBool", + "description": "Auto Scaling Scalar: Capacity Enabled", + "optional": true, + "computed": true + }, + "free_space_less_than_percent": { + "name": "free_space_less_than_percent", "type": "TypeInt", - "required": true - } - }, - "max_items": 1 - }, - "group_id": { - "name": "group_id", - "type": "TypeString", - "required": true - }, - "members": { - "name": "members", - "type": "TypeSet", - "optional": true, - "elem": { - "allocation_count": { - "name": "allocation_count", + "description": "Auto Scaling Scalar: Capacity Free Space Less Than Percent", + "optional": true, + "computed": true + }, + "io_above_percent": { + "name": "io_above_percent", "type": "TypeInt", - "required": true + "description": "Auto Scaling Scalar: IO Utilization Above Percent", + "optional": true, + "computed": true + }, + "io_enabled": { + "name": "io_enabled", + "type": "TypeBool", + "description": "Auto Scaling Scalar: IO Utilization Enabled", + "optional": true, + "computed": true + }, + "io_over_period": { + "name": "io_over_period", + "type": "TypeString", + "description": "Auto Scaling Scalar: IO Utilization Over Period", + "optional": true, + "computed": true + }, + "rate_increase_percent": { + "name": "rate_increase_percent", + "type": "TypeInt", + "description": "Auto Scaling Rate: Increase Percent", + "optional": true, + "computed": true + }, + "rate_limit_mb_per_member": { + "name": "rate_limit_mb_per_member", + "type": "TypeInt", + "description": "Auto Scaling Rate: Limit mb per member", + "optional": true, + "computed": true + }, + "rate_period_seconds": { + "name": "rate_period_seconds", + "type": "TypeInt", + "description": "Auto Scaling Rate: Period Seconds", + "optional": true, + "computed": true + }, + "rate_units": { + "name": "rate_units", + "type": "TypeString", + "description": "Auto Scaling Rate: Units", + "optional": true, + "computed": true } }, "max_items": 1 }, "memory": { "name": "memory", - "type": "TypeSet", + "type": "TypeList", + "description": "Memory Auto Scaling", "optional": true, + "computed": true, "elem": { - "allocation_mb": { - "name": "allocation_mb", + "io_above_percent": { + "name": "io_above_percent", "type": "TypeInt", - "required": true + "description": "Auto Scaling Scalar: IO Utilization Above Percent", + "optional": true, + "computed": true + }, + "io_enabled": { + "name": "io_enabled", + "type": "TypeBool", + "description": "Auto Scaling Scalar: IO Utilization Enabled", + "optional": true, + "computed": true + }, + "io_over_period": { + "name": "io_over_period", + "type": "TypeString", + "description": "Auto Scaling Scalar: IO Utilization Over Period", + "optional": true, + "computed": true + }, + "rate_increase_percent": { + "name": "rate_increase_percent", + "type": "TypeInt", + "description": "Auto Scaling Rate: Increase Percent", + "optional": true, + "computed": true + }, + "rate_limit_mb_per_member": { + "name": "rate_limit_mb_per_member", + "type": "TypeInt", + "description": "Auto Scaling Rate: Limit mb per member", + "optional": true, + "computed": true + }, + "rate_period_seconds": { + "name": "rate_period_seconds", + "type": "TypeInt", + "description": "Auto Scaling Rate: Period Seconds", + "optional": true, + "computed": true + }, + "rate_units": { + "name": "rate_units", + "type": "TypeString", + "description": "Auto Scaling Rate: Units", + "optional": true, + "computed": true } }, "max_items": 1 } - } - }, - { - "name": "status", - "type": "TypeString", - "description": "The resource instance status", - "computed": true - } - ], - "ibm_dl_gateway": [ - { - "name": "carrier_name", - "type": "TypeString", - "description": "Carrier name", - "immutable": true, - "optional": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time resource was created", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN (Cloud Resource Name) of this gateway", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "location_display_name", - "type": "TypeString", - "description": "Gateway location long name", - "computed": true + }, + "max_items": 1 }, { - "name": "resource_crn", + "name": "resource_name", "type": "TypeString", - "description": "The crn of the resource", + "description": "The name of the resource", "computed": true }, { @@ -106062,101 +109686,181 @@ "computed": true }, { - "name": "bfd_interval", - "type": "TypeInt", - "description": "BFD Interval", - "min_value": "300", - "max_value": "255000", + "name": "configuration", + "type": "TypeString", + "description": "The configuration in JSON format", "optional": true }, { - "name": "name", + "name": "version", "type": "TypeString", - "description": "The unique user-defined name for this gateway", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$" - }, - { - "name": "provider_api_managed", - "type": "TypeBool", - "description": "Indicates whether gateway was created through a provider portal", + "description": "The database version to provision if specified", + "immutable": true, + "optional": true, "computed": true }, { - "name": "vlan", - "type": "TypeInt", - "description": "VLAN allocated for this gateway", - "computed": true + "name": "allowlist", + "type": "TypeSet", + "optional": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "Allowlist IP address in CIDR notation", + "optional": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Unique allow list description", + "optional": true + } + } }, { - "name": "resource_controller_url", + "name": "resource_status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The status of the resource", "computed": true }, { - "name": "resource_name", + "name": "name", "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "global", - "type": "TypeBool", - "description": "Gateways with global routing (true) can connect to networks outside their associated region", + "description": "Resource instance name for example, my Database instance", "required": true }, { - "name": "default_export_route_filter", + "name": "service_endpoints", "type": "TypeString", - "description": "The default directional route filter action that applies to routes that do not match any directional route filters", - "options": "permit, deny", - "optional": true, - "computed": true + "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", + "default_value": "public", + "options": "public, private, public-and-private", + "optional": true }, { - "name": "default_import_route_filter", + "name": "key_protect_key", "type": "TypeString", - "description": "The default directional route filter action that applies to routes that do not match any directional route filters", - "options": "permit, deny", - "optional": true, - "computed": true - }, - { - "name": "bfd_multiplier", - "type": "TypeInt", - "description": "BFD Multiplier", - "min_value": "1", - "max_value": "255", + "description": "The CRN of Key protect key", + "immutable": true, "optional": true }, { - "name": "operational_status", + "name": "backup_encryption_key_crn", "type": "TypeString", - "description": "Gateway operational status", - "computed": true + "description": "The Backup Encryption Key CRN", + "immutable": true, + "optional": true }, { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the direct link gateway", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, + "name": "connectionstrings", + "type": "TypeList", "computed": true, "elem": { - "type": "TypeString" - } + "bundlebase64": { + "name": "bundlebase64", + "type": "TypeString", + "description": "Cassandra base64 encoding", + "computed": true + }, + "bundlename": { + "name": "bundlename", + "type": "TypeString", + "description": "Cassandra Bundle Name", + "computed": true + }, + "certbase64": { + "name": "certbase64", + "type": "TypeString", + "description": "Certificate in base64 encoding", + "computed": true + }, + "certname": { + "name": "certname", + "type": "TypeString", + "description": "Certificate Name", + "computed": true + }, + "composed": { + "name": "composed", + "type": "TypeString", + "description": "Connection string", + "computed": true + }, + "database": { + "name": "database", + "type": "TypeString", + "description": "DB name", + "computed": true + }, + "hosts": { + "name": "hosts", + "type": "TypeList", + "optional": true, + "elem": { + "hostname": { + "name": "hostname", + "type": "TypeString", + "description": "DB host name", + "computed": true + }, + "port": { + "name": "port", + "type": "TypeString", + "description": "DB port", + "computed": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "User name", + "computed": true + }, + "password": { + "name": "password", + "type": "TypeString", + "description": "Password", + "computed": true + }, + "path": { + "name": "path", + "type": "TypeString", + "description": "DB path", + "computed": true + }, + "queryoptions": { + "name": "queryoptions", + "type": "TypeString", + "description": "DB query options", + "computed": true + }, + "scheme": { + "name": "scheme", + "type": "TypeString", + "description": "DB scheme", + "computed": true + } + }, + "deprecated": "This field is deprecated, please use ibm_database_connection instead" }, { - "name": "authentication_key", + "name": "plan", "type": "TypeString", - "description": "BGP MD5 authentication key", - "optional": true + "description": "The plan type of the Database instance", + "immutable": true, + "required": true, + "options": "standard, enterprise, enterprise-sharding, platinum" }, + { + "name": "status", + "type": "TypeString", + "description": "The resource instance status", + "computed": true + } + ], + "ibm_dl_gateway": [ { "name": "bgp_ibm_cidr", "type": "TypeString", @@ -106165,140 +109869,124 @@ "computed": true }, { - "name": "bgp_status", + "name": "resource_group", "type": "TypeString", - "description": "Gateway BGP status", + "description": "Gateway resource group", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true }, { - "name": "bgp_status_updated_at", + "name": "created_at", "type": "TypeString", - "description": "Date and time BGP status was updated", + "description": "The date and time resource was created", "computed": true }, { - "name": "change_request", + "name": "link_status_updated_at", "type": "TypeString", - "description": "Changes pending approval for provider managed Direct Link Connect gateways", + "description": "Date and time Link status was updated", "computed": true }, { - "name": "completion_notice_reject_reason", + "name": "authentication_key", "type": "TypeString", - "description": "Reason for completion notice rejection", - "computed": true + "description": "BGP MD5 authentication key", + "optional": true }, { - "name": "import_route_filters", + "name": "as_prepends", "type": "TypeList", - "description": "List Import Route Filters for a Direct Link gateway", + "description": "List of AS Prepend configuration information", "optional": true, "elem": { - "action": { - "name": "action", - "type": "TypeString", - "description": "Determines whether the routes that match the prefix-set will be permit or deny", - "required": true - }, - "before": { - "name": "before", - "type": "TypeString", - "description": "Identifier of the next route filter to be considered", - "optional": true, - "computed": true - }, "created_at": { "name": "created_at", "type": "TypeString", - "description": "The date and time of the export route filter was created", + "description": "The date and time AS Prepend was created", "computed": true }, - "ge": { - "name": "ge", - "type": "TypeInt", - "description": "The minimum matching length of the prefix-set", - "optional": true - }, - "im_filter_id": { - "name": "im_filter_id", + "id": { + "name": "id", "type": "TypeString", - "description": "Import route Filter identifier", + "description": "The unique identifier for this AS Prepend", + "optional": true, "computed": true }, - "le": { - "name": "le", + "length": { + "name": "length", "type": "TypeInt", - "description": "The maximum matching length of the prefix-set", - "optional": true + "description": "Number of times the ASN to appended to the AS Path", + "required": true + }, + "policy": { + "name": "policy", + "type": "TypeString", + "description": "Route type this AS Prepend applies to", + "required": true }, "prefix": { "name": "prefix", "type": "TypeString", - "description": "IP prefix representing an address and mask length of the prefix-set", - "required": true + "description": "Comma separated list of prefixes this AS Prepend applies to. Maximum of 10 prefixes. If not specified, this AS Prepend applies to all prefixes", + "optional": true, + "deprecated": "prefix will be deprecated and support will be removed. Use specific_prefixes instead" + }, + "specific_prefixes": { + "name": "specific_prefixes", + "type": "TypeList", + "description": "Array of prefixes this AS Prepend applies to", + "optional": true, + "elem": { + "type": "TypeString" + }, + "max_items": 10, + "min_items": 1 }, "updated_at": { "name": "updated_at", "type": "TypeString", - "description": "The date and time of the export route filter was last updated", + "description": "The date and time AS Prepend was updated", "computed": true } } }, { - "name": "connection_mode", - "type": "TypeString", - "description": "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", - "options": "direct, transit", - "optional": true, - "computed": true - }, - { - "name": "speed_mbps", + "name": "bgp_asn", "type": "TypeInt", - "description": "Gateway speed in megabits per second", + "description": "BGP ASN", "required": true }, { - "name": "type", - "type": "TypeString", - "description": "Gateway type", - "immutable": true, - "required": true, - "options": "dedicated, connect" - }, - { - "name": "link_status_updated_at", + "name": "resource_name", "type": "TypeString", - "description": "Date and time Link status was updated", + "description": "The name of the resource", "computed": true }, { - "name": "resource_status", + "name": "bfd_status", "type": "TypeString", - "description": "The status of the resource", + "description": "Gateway BFD status", + "optional": true, "computed": true }, { - "name": "port", - "type": "TypeString", - "description": "Gateway port", - "immutable": true, - "optional": true, - "computed": true + "name": "metered", + "type": "TypeBool", + "description": "Metered billing option", + "required": true }, { - "name": "cross_connect_router", + "name": "operational_status", "type": "TypeString", - "description": "Cross connect router", - "immutable": true, - "optional": true + "description": "Gateway operational status", + "computed": true }, { - "name": "bfd_status_updated_at", + "name": "resource_controller_url", "type": "TypeString", - "description": "Date and time BFD status was updated", - "optional": true, + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -106308,11 +109996,19 @@ "optional": true }, { - "name": "customer_name", + "name": "port", "type": "TypeString", - "description": "Customer name", + "description": "Gateway port", "immutable": true, - "optional": true + "optional": true, + "computed": true + }, + { + "name": "loa_reject_reason", + "type": "TypeString", + "description": "Loa reject reason", + "optional": true, + "computed": true }, { "name": "macsec_config", @@ -106397,10 +110093,186 @@ "max_items": 1 }, { - "name": "loa_reject_reason", + "name": "bgp_ibm_asn", + "type": "TypeInt", + "description": "IBM BGP ASN", + "computed": true + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags for the direct link gateway", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group_name", "type": "TypeString", - "description": "Loa reject reason", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "cross_connect_router", + "type": "TypeString", + "description": "Cross connect router", + "immutable": true, + "optional": true + }, + { + "name": "carrier_name", + "type": "TypeString", + "description": "Carrier name", + "immutable": true, + "optional": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Gateway type", + "immutable": true, + "required": true, + "options": "dedicated, connect" + }, + { + "name": "location_name", + "type": "TypeString", + "description": "Gateway location", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "customer_name", + "type": "TypeString", + "description": "Customer name", + "immutable": true, + "optional": true + }, + { + "name": "bgp_cer_cidr", + "type": "TypeString", + "description": "BGP customer edge router CIDR", + "optional": true, + "computed": true + }, + { + "name": "vlan", + "type": "TypeInt", + "description": "VLAN allocated for this gateway", + "computed": true + }, + { + "name": "location_display_name", + "type": "TypeString", + "description": "Gateway location long name", + "computed": true + }, + { + "name": "import_route_filters", + "type": "TypeList", + "description": "List Import Route Filters for a Direct Link gateway", "optional": true, + "elem": { + "action": { + "name": "action", + "type": "TypeString", + "description": "Determines whether the routes that match the prefix-set will be permit or deny", + "required": true + }, + "before": { + "name": "before", + "type": "TypeString", + "description": "Identifier of the next route filter to be considered", + "optional": true, + "computed": true + }, + "created_at": { + "name": "created_at", + "type": "TypeString", + "description": "The date and time of the export route filter was created", + "computed": true + }, + "ge": { + "name": "ge", + "type": "TypeInt", + "description": "The minimum matching length of the prefix-set", + "optional": true + }, + "im_filter_id": { + "name": "im_filter_id", + "type": "TypeString", + "description": "Import route Filter identifier", + "computed": true + }, + "le": { + "name": "le", + "type": "TypeInt", + "description": "The maximum matching length of the prefix-set", + "optional": true + }, + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "IP prefix representing an address and mask length of the prefix-set", + "required": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time of the export route filter was last updated", + "computed": true + } + } + }, + { + "name": "bfd_interval", + "type": "TypeInt", + "description": "BFD Interval", + "min_value": "300", + "max_value": "255000", + "optional": true + }, + { + "name": "bfd_status_updated_at", + "type": "TypeString", + "description": "Date and time BFD status was updated", + "optional": true, + "computed": true + }, + { + "name": "speed_mbps", + "type": "TypeInt", + "description": "Gateway speed in megabits per second", + "required": true + }, + { + "name": "provider_api_managed", + "type": "TypeBool", + "description": "Indicates whether gateway was created through a provider portal", + "computed": true + }, + { + "name": "bgp_status_updated_at", + "type": "TypeString", + "description": "Date and time BGP status was updated", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", "computed": true }, { @@ -106461,17 +110333,90 @@ } }, { - "name": "bfd_status", + "name": "default_import_route_filter", + "type": "TypeString", + "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "options": "permit, deny", + "optional": true, + "computed": true + }, + { + "name": "bfd_multiplier", + "type": "TypeInt", + "description": "BFD Multiplier", + "min_value": "1", + "max_value": "255", + "optional": true + }, + { + "name": "link_status", + "type": "TypeString", + "description": "Gateway link status", + "computed": true + }, + { + "name": "default_export_route_filter", + "type": "TypeString", + "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "options": "permit, deny", + "optional": true, + "computed": true + }, + { + "name": "global", + "type": "TypeBool", + "description": "Gateways with global routing (true) can connect to networks outside their associated region", + "required": true + }, + { + "name": "completion_notice_reject_reason", "type": "TypeString", - "description": "Gateway BFD status", + "description": "Reason for completion notice rejection", + "computed": true + }, + { + "name": "change_request", + "type": "TypeString", + "description": "Changes pending approval for provider managed Direct Link Connect gateways", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN (Cloud Resource Name) of this gateway", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "connection_mode", + "type": "TypeString", + "description": "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", + "options": "direct, transit", "optional": true, "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this gateway", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$" + }, + { + "name": "bgp_status", + "type": "TypeString", + "description": "Gateway BGP status", + "computed": true + } + ], + "ibm_dl_gateway_action": [ { "name": "bgp_asn", "type": "TypeInt", "description": "BGP ASN", - "required": true + "optional": true }, { "name": "location_name", @@ -106482,31 +110427,43 @@ "computed": true }, { - "name": "metered", - "type": "TypeBool", - "description": "Metered billing option", - "required": true + "name": "resource_group", + "type": "TypeString", + "description": "Gateway resource group", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "bgp_cer_cidr", + "name": "vlan", + "type": "TypeInt", + "description": "VLAN allocated for this gateway", + "computed": true + }, + { + "name": "location_display_name", "type": "TypeString", - "description": "BGP customer edge router CIDR", - "optional": true, + "description": "Gateway location long name", "computed": true }, { - "name": "resource_group", + "name": "bgp_ibm_cidr", "type": "TypeString", - "description": "Gateway resource group", - "cloud_data_type": "resource_group", - "immutable": true, + "description": "BGP IBM CIDR", "optional": true, "computed": true }, { - "name": "bgp_ibm_asn", - "type": "TypeInt", - "description": "IBM BGP ASN", + "name": "created_at", + "type": "TypeString", + "description": "The date and time resource was created", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", "computed": true }, { @@ -106567,117 +110524,20 @@ } }, { - "name": "link_status", - "type": "TypeString", - "description": "Gateway link status", - "computed": true - } - ], - "ibm_dl_gateway_action": [ - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true - }, - { - "name": "carrier_name", - "type": "TypeString", - "description": "Carrier name", - "immutable": true, - "optional": true - }, - { - "name": "bgp_cer_cidr", + "name": "connection_mode", "type": "TypeString", - "description": "BGP customer edge router CIDR", + "description": "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", + "options": "direct, transit", "optional": true, "computed": true }, { - "name": "resource_group", + "name": "customer_name", "type": "TypeString", - "description": "Gateway resource group", - "cloud_data_type": "resource_group", + "description": "Customer name", "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "bgp_ibm_cidr", - "type": "TypeString", - "description": "BGP IBM CIDR", - "optional": true, - "computed": true - }, - { - "name": "link_status_updated_at", - "type": "TypeString", - "description": "Date and time Link status was updated", - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the direct link gateway", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "default_export_route_filter", - "type": "TypeString", - "description": "The default directional route filter action that applies to routes that do not match any directional route filters", - "options": "permit, deny", - "optional": true - }, - { - "name": "bgp_base_cidr", - "type": "TypeString", - "description": "BGP base CIDR", "optional": true }, - { - "name": "type", - "type": "TypeString", - "description": "Gateway type", - "options": "dedicated, connect", - "optional": true, - "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this gateway", - "min_length": 1, - "max_length": 63, - "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$", - "optional": true, - "computed": true - }, { "name": "loa_reject_reason", "type": "TypeString", @@ -106685,12 +110545,6 @@ "optional": true, "computed": true }, - { - "name": "provider_api_managed", - "type": "TypeBool", - "description": "Indicates whether gateway was created through a provider portal", - "computed": true - }, { "name": "change_request", "type": "TypeString", @@ -106698,71 +110552,34 @@ "computed": true }, { - "name": "completion_notice_reject_reason", - "type": "TypeString", - "description": "Reason for completion notice rejection", - "computed": true - }, - { - "name": "gateway", - "type": "TypeString", - "description": "The Direct Link gateway identifier", - "required": true - }, - { - "name": "default_import_route_filter", - "type": "TypeString", - "description": "The default directional route filter action that applies to routes that do not match any directional route filters", - "options": "permit, deny", - "optional": true - }, - { - "name": "bfd_status", - "type": "TypeString", - "description": "Gateway BFD status", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time resource was created", - "computed": true - }, - { - "name": "link_status", - "type": "TypeString", - "description": "Gateway link status", - "computed": true - }, - { - "name": "cross_connect_router", - "type": "TypeString", - "description": "Cross connect router", - "immutable": true, + "name": "metered", + "type": "TypeBool", + "description": "Metered billing option", "optional": true }, { - "name": "bgp_ibm_asn", + "name": "speed_mbps", "type": "TypeInt", - "description": "IBM BGP ASN", - "computed": true + "description": "Gateway speed in megabits per second", + "optional": true }, { - "name": "location_display_name", + "name": "bgp_cer_cidr", "type": "TypeString", - "description": "Gateway location long name", + "description": "BGP customer edge router CIDR", + "optional": true, "computed": true }, { - "name": "resource_status", + "name": "gateway", "type": "TypeString", - "description": "The status of the resource", - "computed": true + "description": "The Direct Link gateway identifier", + "required": true }, { - "name": "import_route_filters", + "name": "export_route_filters", "type": "TypeList", - "description": "List Import Route Filters for a Direct Link gateway", + "description": "List Export Route Filters for a Direct Link gateway", "optional": true, "elem": { "action": { @@ -106783,18 +110600,18 @@ "description": "The date and time of the export route filter was created", "computed": true }, + "ex_filter_id": { + "name": "ex_filter_id", + "type": "TypeString", + "description": "Export route Filter identifier", + "computed": true + }, "ge": { "name": "ge", "type": "TypeInt", "description": "The minimum matching length of the prefix-set", "optional": true }, - "im_filter_id": { - "name": "im_filter_id", - "type": "TypeString", - "description": "Import route Filter identifier", - "computed": true - }, "le": { "name": "le", "type": "TypeInt", @@ -106816,74 +110633,67 @@ } }, { - "name": "as_prepends", - "type": "TypeList", - "description": "List of AS Prepend configuration information", - "optional": true, - "elem": { - "created_at": { - "name": "created_at", - "type": "TypeString", - "description": "The date and time AS Prepend was created", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this AS Prepend", - "optional": true, - "computed": true - }, - "length": { - "name": "length", - "type": "TypeInt", - "description": "Number of times the ASN to appended to the AS Path", - "required": true - }, - "policy": { - "name": "policy", - "type": "TypeString", - "description": "Route type this AS Prepend applies to", - "required": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "Comma separated list of prefixes this AS Prepend applies to. Maximum of 10 prefixes. If not specified, this AS Prepend applies to all prefixes", - "optional": true, - "deprecated": "prefix will be deprecated and support will be removed. Use specific_prefixes instead" - }, - "specific_prefixes": { - "name": "specific_prefixes", - "type": "TypeList", - "description": "Array of prefixes this AS Prepend applies to", - "optional": true, - "elem": { - "type": "TypeString" - }, - "max_items": 10, - "min_items": 1 - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "The date and time AS Prepend was updated", - "computed": true - } - } + "name": "bfd_interval", + "type": "TypeInt", + "description": "BFD Interval", + "min_value": "300", + "max_value": "255000", + "optional": true }, { - "name": "connection_mode", + "name": "bgp_base_cidr", "type": "TypeString", - "description": "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", - "options": "direct, transit", - "optional": true, + "description": "BGP base CIDR", + "optional": true + }, + { + "name": "cross_connect_router", + "type": "TypeString", + "description": "Cross connect router", + "immutable": true, + "optional": true + }, + { + "name": "bgp_status_updated_at", + "type": "TypeString", + "description": "Date and time BGP status was updated", "computed": true }, { - "name": "export_route_filters", + "name": "crn", + "type": "TypeString", + "description": "The CRN (Cloud Resource Name) of this gateway", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "link_status", + "type": "TypeString", + "description": "Gateway link status", + "computed": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "link_status_updated_at", + "type": "TypeString", + "description": "Date and time Link status was updated", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "import_route_filters", "type": "TypeList", - "description": "List Export Route Filters for a Direct Link gateway", + "description": "List Import Route Filters for a Direct Link gateway", "optional": true, "elem": { "action": { @@ -106904,18 +110714,18 @@ "description": "The date and time of the export route filter was created", "computed": true }, - "ex_filter_id": { - "name": "ex_filter_id", - "type": "TypeString", - "description": "Export route Filter identifier", - "computed": true - }, "ge": { "name": "ge", "type": "TypeInt", "description": "The minimum matching length of the prefix-set", "optional": true }, + "im_filter_id": { + "name": "im_filter_id", + "type": "TypeString", + "description": "Import route Filter identifier", + "computed": true + }, "le": { "name": "le", "type": "TypeInt", @@ -106937,40 +110747,51 @@ } }, { - "name": "customer_name", - "type": "TypeString", - "description": "Customer name", - "immutable": true, - "optional": true - }, - { - "name": "bgp_status_updated_at", + "name": "name", "type": "TypeString", - "description": "Date and time BGP status was updated", + "description": "The unique user-defined name for this gateway", + "min_length": 1, + "max_length": 63, + "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$", + "optional": true, "computed": true }, { - "name": "bgp_asn", - "type": "TypeInt", - "description": "BGP ASN", + "name": "carrier_name", + "type": "TypeString", + "description": "Carrier name", + "immutable": true, "optional": true }, { - "name": "speed_mbps", - "type": "TypeInt", - "description": "Gateway speed in megabits per second", - "optional": true + "name": "provider_api_managed", + "type": "TypeBool", + "description": "Indicates whether gateway was created through a provider portal", + "computed": true }, { - "name": "operational_status", + "name": "completion_notice_reject_reason", "type": "TypeString", - "description": "Gateway operational status", + "description": "Reason for completion notice rejection", "computed": true }, { - "name": "vlan", - "type": "TypeInt", - "description": "VLAN allocated for this gateway", + "name": "tags", + "type": "TypeSet", + "description": "Tags for the direct link gateway", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -106981,10 +110802,10 @@ "options": "permit, deny" }, { - "name": "authentication_key", + "name": "default_export_route_filter", "type": "TypeString", - "description": "BGP MD5 authentication key", - "secure": true, + "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "options": "permit, deny", "optional": true }, { @@ -106996,37 +110817,30 @@ "optional": true }, { - "name": "bgp_status", + "name": "bfd_status_updated_at", "type": "TypeString", - "description": "Gateway BGP status", + "description": "Date and time BFD status was updated", "computed": true }, { - "name": "bfd_interval", - "type": "TypeInt", - "description": "BFD Interval", - "min_value": "300", - "max_value": "255000", + "name": "global", + "type": "TypeBool", + "description": "Gateways with global routing (true) can connect to networks outside their associated region", "optional": true }, { - "name": "bfd_status_updated_at", + "name": "authentication_key", "type": "TypeString", - "description": "Date and time BFD status was updated", - "computed": true - }, - { - "name": "metered", - "type": "TypeBool", - "description": "Metered billing option", + "description": "BGP MD5 authentication key", + "secure": true, "optional": true }, { - "name": "crn", + "name": "default_import_route_filter", "type": "TypeString", - "description": "The CRN (Cloud Resource Name) of this gateway", - "cloud_data_type": "crn", - "computed": true + "description": "The default directional route filter action that applies to routes that do not match any directional route filters", + "options": "permit, deny", + "optional": true }, { "name": "port", @@ -107037,21 +110851,31 @@ "computed": true }, { - "name": "global", - "type": "TypeBool", - "description": "Gateways with global routing (true) can connect to networks outside their associated region", - "optional": true + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true }, { - "name": "location_name", + "name": "bfd_status", "type": "TypeString", - "description": "Gateway location", - "immutable": true, + "description": "Gateway BFD status", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Gateway type", + "options": "dedicated, connect", "optional": true, "computed": true - } - ], - "ibm_dl_provider_gateway": [ + }, + { + "name": "operational_status", + "type": "TypeString", + "description": "Gateway operational status", + "computed": true + }, { "name": "bgp_ibm_asn", "type": "TypeInt", @@ -107059,28 +110883,29 @@ "computed": true }, { - "name": "created_at", + "name": "bgp_status", "type": "TypeString", - "description": "The date and time resource was created", + "description": "Gateway BGP status", "computed": true - }, + } + ], + "ibm_dl_provider_gateway": [ { - "name": "provider_api_managed", - "type": "TypeBool", - "description": "Indicates whether gateway was created through a provider portal", + "name": "type", + "type": "TypeString", + "description": "Gateway type", "computed": true }, { - "name": "crn", + "name": "resource_crn", "type": "TypeString", - "description": "The CRN (Cloud Resource Name) of this gateway", - "cloud_data_type": "crn", + "description": "The crn of the resource", "computed": true }, { - "name": "resource_crn", + "name": "resource_status", "type": "TypeString", - "description": "The crn of the resource", + "description": "The status of the resource", "computed": true }, { @@ -107089,6 +110914,19 @@ "description": "BGP ASN", "required": true }, + { + "name": "bgp_ibm_asn", + "type": "TypeInt", + "description": "IBM BGP ASN", + "computed": true + }, + { + "name": "bgp_ibm_cidr", + "type": "TypeString", + "description": "BGP IBM CIDR", + "optional": true, + "computed": true + }, { "name": "bgp_status", "type": "TypeString", @@ -107096,32 +110934,16 @@ "computed": true }, { - "name": "customer_account_id", + "name": "port", "type": "TypeString", - "description": "Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will become available in the specified account.", + "description": "Gateway port", "immutable": true, - "required": true, - "min_length": 1, - "max_length": 32, - "matches": "^[0-9a-f]+$" - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the direct link gateway", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "required": true }, { - "name": "resource_controller_url", + "name": "created_at", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The date and time resource was created", "computed": true }, { @@ -107134,28 +110956,9 @@ "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$" }, { - "name": "speed_mbps", - "type": "TypeInt", - "description": "Gateway speed in megabits per second", - "required": true - }, - { - "name": "vlan", - "type": "TypeInt", - "description": "VLAN allocated for this gateway", - "optional": true, - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "name": "provider_api_managed", + "type": "TypeBool", + "description": "Indicates whether gateway was created through a provider portal", "computed": true }, { @@ -107166,18 +110969,17 @@ "computed": true }, { - "name": "bgp_ibm_cidr", + "name": "resource_controller_url", "type": "TypeString", - "description": "BGP IBM CIDR", - "optional": true, + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "port", - "type": "TypeString", - "description": "Gateway port", - "immutable": true, - "required": true + "name": "vlan", + "type": "TypeInt", + "description": "VLAN allocated for this gateway", + "optional": true, + "computed": true }, { "name": "operational_status", @@ -107186,123 +110988,55 @@ "computed": true }, { - "name": "type", - "type": "TypeString", - "description": "Gateway type", - "computed": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - } - ], - "ibm_dl_route_report": [ - { - "name": "route_report_id", + "name": "crn", "type": "TypeString", - "description": "Id of the route report", + "description": "The CRN (Cloud Resource Name) of this gateway", + "cloud_data_type": "crn", "computed": true }, { - "name": "virtual_connection_routes", - "type": "TypeList", - "description": "Virtual Connection Routes", + "name": "tags", + "type": "TypeSet", + "description": "Tags for the direct link gateway", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, "computed": true, "elem": { - "routes": { - "name": "routes", - "type": "TypeList", - "description": "Virtual connection routes", - "computed": true, - "elem": { - "active": { - "name": "active", - "type": "TypeBool", - "description": "Indicates whether the route is the preferred path of the prefix", - "computed": true - }, - "local_preference": { - "name": "local_preference", - "type": "TypeString", - "description": "The local preference of the route. This attribute can manipulate the chosen path on routes", - "computed": true - }, - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "Prefix for virtual connection routes", - "computed": true - } - } - }, - "virtual_connection_id": { - "name": "virtual_connection_id", - "type": "TypeString", - "description": "Virtual connection ID", - "computed": true - }, - "virtual_connection_name": { - "name": "virtual_connection_name", - "type": "TypeString", - "description": "Virtual connection name", - "computed": true - }, - "virtual_connection_type": { - "name": "virtual_connection_type", - "type": "TypeString", - "description": "Virtual connection type", - "computed": true - } + "type": "TypeString" } }, { - "name": "created_at", + "name": "resource_name", "type": "TypeString", - "description": "The date and time report was created", + "description": "The name of the resource", "computed": true }, { - "name": "updated_at", + "name": "resource_group_name", "type": "TypeString", - "description": "The date and time resource was created", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "overlapping_routes", - "type": "TypeList", - "description": "List of overlapping routes", - "computed": true, - "elem": { - "routes": { - "name": "routes", - "type": "TypeList", - "description": "overlapping routes", - "computed": true, - "elem": { - "prefix": { - "name": "prefix", - "type": "TypeString", - "description": "Prefix for overlapping routes", - "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of route", - "computed": true - }, - "virtual_connection_id": { - "name": "virtual_connection_id", - "type": "TypeString", - "description": "Virtual connection ID", - "computed": true - } - } - } - } + "name": "customer_account_id", + "type": "TypeString", + "description": "Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will become available in the specified account.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 32, + "matches": "^[0-9a-f]+$" }, + { + "name": "speed_mbps", + "type": "TypeInt", + "description": "Gateway speed in megabits per second", + "required": true + } + ], + "ibm_dl_route_report": [ { "name": "status", "type": "TypeString", @@ -107310,11 +111044,10 @@ "computed": true }, { - "name": "gateway", + "name": "created_at", "type": "TypeString", - "description": "The Direct Link gateway identifier", - "immutable": true, - "required": true + "description": "The date and time report was created", + "computed": true }, { "name": "advertised_routes", @@ -107375,9 +111108,136 @@ "computed": true } } + }, + { + "name": "overlapping_routes", + "type": "TypeList", + "description": "List of overlapping routes", + "computed": true, + "elem": { + "routes": { + "name": "routes", + "type": "TypeList", + "description": "overlapping routes", + "computed": true, + "elem": { + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "Prefix for overlapping routes", + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of route", + "computed": true + }, + "virtual_connection_id": { + "name": "virtual_connection_id", + "type": "TypeString", + "description": "Virtual connection ID", + "computed": true + } + } + } + } + }, + { + "name": "virtual_connection_routes", + "type": "TypeList", + "description": "Virtual Connection Routes", + "computed": true, + "elem": { + "routes": { + "name": "routes", + "type": "TypeList", + "description": "Virtual connection routes", + "computed": true, + "elem": { + "active": { + "name": "active", + "type": "TypeBool", + "description": "Indicates whether the route is the preferred path of the prefix", + "computed": true + }, + "local_preference": { + "name": "local_preference", + "type": "TypeString", + "description": "The local preference of the route. This attribute can manipulate the chosen path on routes", + "computed": true + }, + "prefix": { + "name": "prefix", + "type": "TypeString", + "description": "Prefix for virtual connection routes", + "computed": true + } + } + }, + "virtual_connection_id": { + "name": "virtual_connection_id", + "type": "TypeString", + "description": "Virtual connection ID", + "computed": true + }, + "virtual_connection_name": { + "name": "virtual_connection_name", + "type": "TypeString", + "description": "Virtual connection name", + "computed": true + }, + "virtual_connection_type": { + "name": "virtual_connection_type", + "type": "TypeString", + "description": "Virtual connection type", + "computed": true + } + } + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time resource was created", + "computed": true + }, + { + "name": "gateway", + "type": "TypeString", + "description": "The Direct Link gateway identifier", + "immutable": true, + "required": true + }, + { + "name": "route_report_id", + "type": "TypeString", + "description": "Id of the route report", + "computed": true } ], "ibm_dl_virtual_connection": [ + { + "name": "network_id", + "type": "TypeString", + "description": "Unique identifier of the target network. For type=vpc virtual connections this is the CRN of the target VPC. This field does not apply to type=classic connections.", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status of the virtual connection.Possible values: [pending,attached,approval_pending,rejected,expired,deleting,detached_by_network_pending,detached_by_network]", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of virtual connection.Allowable values (classic,vpc)", + "immutable": true, + "required": true, + "options": "classic, vpc" + }, { "name": "name", "type": "TypeString", @@ -107388,23 +111248,21 @@ "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$" }, { - "name": "network_id", + "name": "created_at", "type": "TypeString", - "description": "Unique identifier of the target network. For type=vpc virtual connections this is the CRN of the target VPC. This field does not apply to type=classic connections.", - "immutable": true, - "optional": true, + "description": "The date and time resource was created", "computed": true }, { - "name": "created_at", + "name": "network_account", "type": "TypeString", - "description": "The date and time resource was created", + "description": "For virtual connections across two different IBM Cloud Accounts network_account indicates the account that owns the target network.", "computed": true }, { - "name": "status", + "name": "virtual_connection_id", "type": "TypeString", - "description": "Status of the virtual connection.Possible values: [pending,attached,approval_pending,rejected,expired,deleting,detached_by_network_pending,detached_by_network]", + "description": "The Direct Gateway virtual connection identifier", "computed": true }, { @@ -107419,38 +111277,26 @@ "description": "The Direct Link gateway identifier", "immutable": true, "required": true - }, + } + ], + "ibm_dns_custom_resolver": [ { - "name": "type", + "name": "created_on", "type": "TypeString", - "description": "The type of virtual connection.Allowable values (classic,vpc)", - "immutable": true, - "required": true, - "options": "classic, vpc" + "description": "Time when a custom resolver is created", + "computed": true }, { - "name": "network_account", + "name": "modified_on", "type": "TypeString", - "description": "For virtual connections across two different IBM Cloud Accounts network_account indicates the account that owns the target network.", + "description": "The recent time when a custom resolver is modified", "computed": true }, { - "name": "virtual_connection_id", + "name": "custom_resolver_id", "type": "TypeString", - "description": "The Direct Gateway virtual connection identifier", + "description": "Identifier of the custom resolver", "computed": true - } - ], - "ibm_dns_custom_resolver": [ - { - "name": "instance_id", - "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] }, { "name": "name", @@ -107458,6 +111304,20 @@ "description": "Name of the custom resolver", "required": true }, + { + "name": "enabled", + "type": "TypeBool", + "description": "Whether the custom resolver is enabled", + "default_value": true, + "optional": true + }, + { + "name": "high_availability", + "type": "TypeBool", + "description": "Whether High Availability is enabled in custom resolver", + "default_value": true, + "optional": true + }, { "name": "health", "type": "TypeString", @@ -107545,67 +111405,23 @@ } }, { - "name": "created_on", - "type": "TypeString", - "description": "Time when a custom resolver is created", - "computed": true - }, - { - "name": "custom_resolver_id", + "name": "instance_id", "type": "TypeString", - "description": "Identifier of the custom resolver", - "computed": true + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] }, { "name": "description", "type": "TypeString", "description": "Descriptive text of the custom resolver.", "optional": true - }, - { - "name": "enabled", - "type": "TypeBool", - "description": "Whether the custom resolver is enabled", - "default_value": true, - "optional": true - }, - { - "name": "high_availability", - "type": "TypeBool", - "description": "Whether High Availability is enabled in custom resolver", - "default_value": true, - "optional": true - }, - { - "name": "modified_on", - "type": "TypeString", - "description": "The recent time when a custom resolver is modified", - "computed": true } ], "ibm_dns_custom_resolver_forwarding_rule": [ - { - "name": "match", - "type": "TypeString", - "description": "The matching zone or hostname.", - "optional": true, - "computed": true - }, - { - "name": "forward_to", - "type": "TypeList", - "description": "The upstream DNS servers will be forwarded to.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "rule_id", - "type": "TypeString", - "description": "the time when a forwarding rule ID is created, RFC3339 format.", - "computed": true - }, { "name": "instance_id", "type": "TypeString", @@ -107634,26 +111450,31 @@ "description": "Type of the forwarding rule.", "options": "hostname, zone, Default", "optional": true - } - ], - "ibm_dns_custom_resolver_location": [ + }, { - "name": "instance_id", + "name": "match", "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] + "description": "The matching zone or hostname.", + "optional": true, + "computed": true + }, + { + "name": "forward_to", + "type": "TypeList", + "description": "The upstream DNS servers will be forwarded to.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "resolver_id", + "name": "rule_id", "type": "TypeString", - "description": "Custom Resolver ID", - "required": true - }, + "description": "the time when a forwarding rule ID is created, RFC3339 format.", + "computed": true + } + ], + "ibm_dns_custom_resolver_location": [ { "name": "location_id", "type": "TypeString", @@ -107690,6 +111511,23 @@ "type": "TypeBool", "default_value": true, "optional": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + }, + { + "name": "resolver_id", + "type": "TypeString", + "description": "Custom Resolver ID", + "required": true } ], "ibm_dns_custom_resolver_secondary_zone": [ @@ -107703,21 +111541,15 @@ } }, { - "name": "enabled", - "type": "TypeBool", - "description": "Enable/Disable the secondary zone", - "required": true - }, - { - "name": "description", + "name": "created_on", "type": "TypeString", - "description": "Descriptive text of the secondary zone", - "optional": true + "description": "Secondary Zone Creation date", + "computed": true }, { - "name": "created_on", + "name": "modified_on", "type": "TypeString", - "description": "Secondary Zone Creation date", + "description": "Secondary Zone Modification date", "computed": true }, { @@ -107749,13 +111581,29 @@ "required": true }, { - "name": "modified_on", + "name": "enabled", + "type": "TypeBool", + "description": "Enable/Disable the secondary zone", + "required": true + }, + { + "name": "description", "type": "TypeString", - "description": "Secondary Zone Modification date", - "computed": true + "description": "Descriptive text of the secondary zone", + "optional": true } ], "ibm_dns_domain": [ + { + "name": "tags", + "type": "TypeSet", + "description": "tags associated with reosurce.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "name", "type": "TypeString", @@ -107780,28 +111628,9 @@ "type": "TypeString", "description": "DNS target info", "optional": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "tags associated with reosurce.", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } } ], "ibm_dns_domain_registration_nameservers": [ - { - "name": "original_name_servers", - "type": "TypeSet", - "description": "Save of name servers prior to update", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "dns_registration_id", "type": "TypeString", @@ -107816,20 +111645,34 @@ "elem": { "type": "TypeString" } + }, + { + "name": "original_name_servers", + "type": "TypeSet", + "description": "Save of name servers prior to update", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_dns_glb": [ { - "name": "name", + "name": "modified_on", "type": "TypeString", - "description": "Name of the load balancer", - "required": true + "description": "GLB Load Balancer Modification date", + "computed": true }, { - "name": "description", + "name": "instance_id", "type": "TypeString", - "description": "Descriptive text of the load balancer", - "optional": true + "description": "The GUID of the private DNS.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] }, { "name": "fallback_pool", @@ -107837,15 +111680,6 @@ "description": "The pool ID to use when all other pools are detected as unhealthy", "required": true }, - { - "name": "default_pools", - "type": "TypeList", - "description": "A list of pool IDs ordered by their failover priority", - "required": true, - "elem": { - "type": "TypeString" - } - }, { "name": "created_on", "type": "TypeString", @@ -107853,28 +111687,10 @@ "computed": true }, { - "name": "modified_on", - "type": "TypeString", - "description": "GLB Load Balancer Modification date", - "computed": true - }, - { - "name": "zone_id", - "type": "TypeString", - "description": "Zone Id", - "immutable": true, - "required": true - }, - { - "name": "instance_id", + "name": "description", "type": "TypeString", - "description": "The GUID of the private DNS.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] + "description": "Descriptive text of the load balancer", + "optional": true }, { "name": "enabled", @@ -107896,6 +111712,34 @@ "description": "Healthy state of the load balancer.", "computed": true }, + { + "name": "default_pools", + "type": "TypeList", + "description": "A list of pool IDs ordered by their failover priority", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "glb_id", + "type": "TypeString", + "description": "Load balancer Id", + "computed": true + }, + { + "name": "zone_id", + "type": "TypeString", + "description": "Zone Id", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the load balancer", + "required": true + }, { "name": "az_pools", "type": "TypeSet", @@ -107918,36 +111762,9 @@ } } } - }, - { - "name": "glb_id", - "type": "TypeString", - "description": "Load balancer Id", - "computed": true } ], "ibm_dns_glb_monitor": [ - { - "name": "name", - "type": "TypeString", - "description": "The unique identifier of a service instance.", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The protocol to use for the health check", - "default_value": "HTTP", - "options": "HTTP, HTTPS, TCP", - "optional": true - }, - { - "name": "timeout", - "type": "TypeInt", - "description": "The timeout (in seconds) before marking the health check as failed", - "default_value": 5, - "optional": true - }, { "name": "monitor_id", "type": "TypeString", @@ -107955,22 +111772,17 @@ "computed": true }, { - "name": "description", + "name": "path", "type": "TypeString", - "description": "Descriptive text of the load balancer monitor", - "optional": true - }, - { - "name": "retries", - "type": "TypeInt", - "description": "The number of retries to attempt in case of a timeout before marking the origin as unhealthy", - "default_value": 1, - "optional": true + "description": "The endpoint path to health check against", + "optional": true, + "computed": true }, { - "name": "allow_insecure", - "type": "TypeBool", - "description": "Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTPS monitors.", + "name": "expected_codes", + "type": "TypeString", + "description": "The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS", + "options": "200,201,202,203,204,205,206,207,208,226,2xx", "optional": true, "computed": true }, @@ -107981,22 +111793,12 @@ "computed": true }, { - "name": "instance_id", + "name": "type", "type": "TypeString", - "description": "Instance Id", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] - }, - { - "name": "port", - "type": "TypeInt", - "description": "Port number to connect to for the health check", - "optional": true, - "computed": true + "description": "The protocol to use for the health check", + "default_value": "HTTP", + "options": "HTTP, HTTPS, TCP", + "optional": true }, { "name": "method", @@ -108006,6 +111808,12 @@ "optional": true, "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The unique identifier of a service instance.", + "required": true + }, { "name": "interval", "type": "TypeInt", @@ -108013,13 +111821,6 @@ "default_value": 60, "optional": true }, - { - "name": "path", - "type": "TypeString", - "description": "The endpoint path to health check against", - "optional": true, - "computed": true - }, { "name": "headers", "type": "TypeSet", @@ -108044,10 +111845,9 @@ } }, { - "name": "expected_codes", - "type": "TypeString", - "description": "The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS", - "options": "200,201,202,203,204,205,206,207,208,226,2xx", + "name": "allow_insecure", + "type": "TypeBool", + "description": "Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTPS monitors.", "optional": true, "computed": true }, @@ -108057,14 +111857,6 @@ "description": "A case-insensitive sub-string to look for in the response body", "optional": true }, - { - "name": "created_on", - "type": "TypeString", - "description": "GLB Monitor creation date", - "computed": true - } - ], - "ibm_dns_glb_pool": [ { "name": "instance_id", "type": "TypeString", @@ -108079,33 +111871,56 @@ { "name": "description", "type": "TypeString", - "description": "Descriptive text of the load balancer pool", + "description": "Descriptive text of the load balancer monitor", "optional": true }, { - "name": "healthcheck_region", - "type": "TypeString", - "description": "Health check region of VSIs", - "optional": true + "name": "port", + "type": "TypeInt", + "description": "Port number to connect to for the health check", + "optional": true, + "computed": true }, { - "name": "modified_on", - "type": "TypeString", - "description": "The recent time when a load balancer pool is modified.", - "computed": true + "name": "retries", + "type": "TypeInt", + "description": "The number of retries to attempt in case of a timeout before marking the origin as unhealthy", + "default_value": 1, + "optional": true }, { - "name": "enabled", - "type": "TypeBool", - "description": "Whether the load balancer pool is enabled", + "name": "timeout", + "type": "TypeInt", + "description": "The timeout (in seconds) before marking the health check as failed", + "default_value": 5, "optional": true }, + { + "name": "created_on", + "type": "TypeString", + "description": "GLB Monitor creation date", + "computed": true + } + ], + "ibm_dns_glb_pool": [ { "name": "name", "type": "TypeString", "description": "The unique identifier of a service instance.", "required": true }, + { + "name": "description", + "type": "TypeString", + "description": "Descriptive text of the load balancer pool", + "optional": true + }, + { + "name": "enabled", + "type": "TypeBool", + "description": "Whether the load balancer pool is enabled", + "optional": true + }, { "name": "health", "type": "TypeString", @@ -108157,19 +111972,16 @@ } }, { - "name": "monitor", + "name": "healthcheck_region", "type": "TypeString", - "description": "The ID of the load balancer monitor to be associated to this pool", + "description": "Health check region of VSIs", "optional": true }, { - "name": "healthcheck_subnets", - "type": "TypeList", - "description": "Health check subnet crn of VSIs", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "pool_id", + "type": "TypeString", + "description": "Pool Id", + "computed": true }, { "name": "created_on", @@ -108178,10 +111990,21 @@ "computed": true }, { - "name": "pool_id", + "name": "instance_id", "type": "TypeString", - "description": "Pool Id", - "computed": true + "description": "Instance Id", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + }, + { + "name": "monitor", + "type": "TypeString", + "description": "The ID of the load balancer monitor to be associated to this pool", + "optional": true }, { "name": "healthy_origins_threshold", @@ -108194,14 +112017,45 @@ "type": "TypeString", "description": "The notification channel,It is a webhook url", "optional": true + }, + { + "name": "healthcheck_subnets", + "type": "TypeList", + "description": "Health check subnet crn of VSIs", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "modified_on", + "type": "TypeString", + "description": "The recent time when a load balancer pool is modified.", + "computed": true } ], "ibm_dns_linked_zone": [ { - "name": "linked_to", + "name": "instance_id", "type": "TypeString", - "description": "The zone that is linked to the DNS Linked zone", - "optional": true + "description": "The unique identifier of a DNS Linked zone.", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the DNS Linked zone.", + "required": true + }, + { + "name": "owner_instance_id", + "type": "TypeString", + "description": "The unique identifier of the owner DNS instance", + "required": true }, { "name": "state", @@ -108222,20 +112076,16 @@ "optional": true }, { - "name": "created_on", + "name": "modified_on", "type": "TypeString", - "description": "DNS Linked Zone Creation date", + "description": "DNS Linked Zone Modification date", "computed": true }, { - "name": "instance_id", + "name": "description", "type": "TypeString", - "description": "The unique identifier of a DNS Linked zone.", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] + "description": "Descriptive text of the DNS Linked zone", + "optional": true }, { "name": "owner_zone_id", @@ -108244,31 +112094,46 @@ "required": true }, { - "name": "owner_instance_id", + "name": "linked_to", "type": "TypeString", - "description": "The unique identifier of the owner DNS instance", - "required": true + "description": "The zone that is linked to the DNS Linked zone", + "optional": true }, { - "name": "modified_on", + "name": "created_on", "type": "TypeString", - "description": "DNS Linked Zone Modification date", + "description": "DNS Linked Zone Creation date", "computed": true + } + ], + "ibm_dns_permitted_network": [ + { + "name": "type", + "type": "TypeString", + "description": "Network Type", + "default_value": "vpc", + "immutable": true, + "optional": true }, { - "name": "name", + "name": "vpc_crn", "type": "TypeString", - "description": "The name of the DNS Linked zone.", + "description": "VPC CRN id", + "immutable": true, "required": true }, { - "name": "description", + "name": "created_on", "type": "TypeString", - "description": "Descriptive text of the DNS Linked zone", - "optional": true - } - ], - "ibm_dns_permitted_network": [ + "description": "Network creation date", + "computed": true + }, + { + "name": "modified_on", + "type": "TypeString", + "description": "Network Modification date", + "computed": true + }, { "name": "state", "type": "TypeString", @@ -108298,53 +112163,59 @@ "description": "Zone Id", "immutable": true, "required": true - }, + } + ], + "ibm_dns_record": [ { - "name": "type", + "name": "protocol", "type": "TypeString", - "description": "Network Type", - "default_value": "vpc", - "immutable": true, + "description": "protocol info", "optional": true }, { - "name": "vpc_crn", + "name": "data", "type": "TypeString", - "description": "VPC CRN id", - "immutable": true, + "description": "DNS record data", "required": true }, { - "name": "created_on", - "type": "TypeString", - "description": "Network creation date", - "computed": true + "name": "domain_id", + "type": "TypeInt", + "description": "Domain ID of dns record instance", + "immutable": true, + "required": true }, { - "name": "modified_on", - "type": "TypeString", - "description": "Network Modification date", + "name": "expire", + "type": "TypeInt", + "description": "DNS record expiry info", + "optional": true, "computed": true - } - ], - "ibm_dns_record": [ + }, { - "name": "data", + "name": "host", "type": "TypeString", - "description": "DNS record data", + "description": "Hostname", "required": true }, { - "name": "type", + "name": "mx_priority", + "type": "TypeInt", + "description": "Maximum priority", + "default_value": 0, + "optional": true + }, + { + "name": "responsible_person", "type": "TypeString", - "description": "DNS record type", - "immutable": true, - "required": true + "description": "Responsible person for DNS record", + "optional": true, + "computed": true }, { - "name": "port", - "type": "TypeInt", - "description": "port number", + "name": "service", + "type": "TypeString", + "description": "service info", "optional": true }, { @@ -108357,13 +112228,6 @@ "type": "TypeString" } }, - { - "name": "expire", - "type": "TypeInt", - "description": "DNS record expiry info", - "optional": true, - "computed": true - }, { "name": "refresh", "type": "TypeInt", @@ -108371,26 +112235,18 @@ "optional": true, "computed": true }, - { - "name": "retry", - "type": "TypeInt", - "description": "Retry count", - "optional": true, - "computed": true - }, - { - "name": "minimum_ttl", - "type": "TypeInt", - "description": "Minimun TTL configuration", - "optional": true, - "computed": true - }, { "name": "ttl", "type": "TypeInt", "description": "TTL configuration", "required": true }, + { + "name": "port", + "type": "TypeInt", + "description": "port number", + "optional": true + }, { "name": "priority", "type": "TypeInt", @@ -108406,57 +112262,33 @@ "optional": true }, { - "name": "domain_id", + "name": "retry", "type": "TypeInt", - "description": "Domain ID of dns record instance", - "immutable": true, - "required": true - }, - { - "name": "host", - "type": "TypeString", - "description": "Hostname", - "required": true + "description": "Retry count", + "optional": true, + "computed": true }, { - "name": "mx_priority", + "name": "minimum_ttl", "type": "TypeInt", - "description": "Maximum priority", - "default_value": 0, - "optional": true - }, - { - "name": "responsible_person", - "type": "TypeString", - "description": "Responsible person for DNS record", + "description": "Minimun TTL configuration", "optional": true, "computed": true }, { - "name": "service", - "type": "TypeString", - "description": "service info", - "optional": true - }, - { - "name": "protocol", + "name": "type", "type": "TypeString", - "description": "protocol info", - "optional": true + "description": "DNS record type", + "immutable": true, + "required": true } ], "ibm_dns_resource_record": [ { - "name": "port", - "type": "TypeInt", - "description": "DNS server Port", - "optional": true - }, - { - "name": "name", + "name": "resource_record_id", "type": "TypeString", - "description": "DNS record name", - "required": true + "description": "Resource record ID", + "computed": true }, { "name": "type", @@ -108466,11 +112298,11 @@ "required": true }, { - "name": "zone_id", - "type": "TypeString", - "description": "Zone ID", - "immutable": true, - "required": true + "name": "preference", + "type": "TypeInt", + "description": "DNS maximum preference", + "default_value": 0, + "optional": true }, { "name": "created_on", @@ -108479,53 +112311,53 @@ "computed": true }, { - "name": "resource_record_id", + "name": "protocol", "type": "TypeString", - "description": "Resource record ID", - "computed": true + "description": "Protocol", + "optional": true }, { - "name": "instance_id", + "name": "zone_id", "type": "TypeString", - "description": "Instance ID", - "cloud_data_type": "resource_instance", + "description": "Zone ID", "immutable": true, - "required": true, - "cloud_data_range": [ - "service:dns-svcs" - ] + "required": true }, { - "name": "preference", - "type": "TypeInt", - "description": "DNS maximum preference", - "default_value": 0, - "optional": true + "name": "name", + "type": "TypeString", + "description": "DNS record name", + "required": true }, { - "name": "priority", + "name": "ttl", "type": "TypeInt", - "description": "DNS server Priority", - "default_value": 0, + "description": "DNS record TTL", + "default_value": 900, "optional": true }, { - "name": "weight", + "name": "port", "type": "TypeInt", - "description": "DNS server weight", - "default_value": 0, + "description": "DNS server Port", "optional": true }, { - "name": "service", + "name": "instance_id", "type": "TypeString", - "description": "Service info", - "optional": true + "description": "Instance ID", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:dns-svcs" + ] }, { - "name": "protocol", - "type": "TypeString", - "description": "Protocol", + "name": "priority", + "type": "TypeInt", + "description": "DNS server Priority", + "default_value": 0, "optional": true }, { @@ -108541,14 +112373,27 @@ "required": true }, { - "name": "ttl", + "name": "weight", "type": "TypeInt", - "description": "DNS record TTL", - "default_value": 900, + "description": "DNS server weight", + "default_value": 0, + "optional": true + }, + { + "name": "service", + "type": "TypeString", + "description": "Service info", "optional": true } ], "ibm_dns_reverse_record": [ + { + "name": "ipaddress", + "type": "TypeString", + "description": "IP Address", + "immutable": true, + "required": true + }, { "name": "hostname", "type": "TypeString", @@ -108560,16 +112405,15 @@ "type": "TypeInt", "description": "TTL value", "optional": true - }, - { - "name": "ipaddress", - "type": "TypeString", - "description": "IP Address", - "immutable": true, - "required": true } ], "ibm_dns_secondary": [ + { + "name": "master_ip_address", + "type": "TypeString", + "description": "Master IP Address", + "required": true + }, { "name": "transfer_frequency", "type": "TypeInt", @@ -108604,21 +112448,9 @@ "elem": { "type": "TypeString" } - }, - { - "name": "master_ip_address", - "type": "TypeString", - "description": "Master IP Address", - "required": true } ], "ibm_dns_zone": [ - { - "name": "state", - "type": "TypeString", - "description": "Zone state", - "computed": true - }, { "name": "label", "type": "TypeString", @@ -108666,6 +112498,12 @@ "type": "TypeString", "description": "Zone description", "optional": true + }, + { + "name": "state", + "type": "TypeString", + "description": "Zone state", + "computed": true } ], "ibm_en_destination_android": [ @@ -108683,22 +112521,31 @@ "required": true }, { - "name": "type", + "name": "updated_at", "type": "TypeString", - "description": "The type of Destination push_android.", - "required": true + "description": "Last updated time.", + "computed": true }, { - "name": "destination_id", - "type": "TypeString", - "description": "Destination ID", + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true }, { - "name": "updated_at", + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "type", "type": "TypeString", - "description": "Last updated time.", - "computed": true + "description": "The type of Destination push_android.", + "required": true }, { "name": "description", @@ -108747,63 +112594,14 @@ }, "max_items": 1 }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - } - ], - "ibm_en_destination_ce": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The Destintion name.", - "required": true - }, { "name": "destination_id", "type": "TypeString", "description": "Destination ID", "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of Destination Webhook.", - "required": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true - }, + } + ], + "ibm_en_destination_ce": [ { "name": "config", "type": "TypeList", @@ -108862,6 +112660,46 @@ "type": "TypeInt", "description": "Number of subscriptions.", "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The Destintion name.", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination Webhook.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID", + "computed": true } ], "ibm_en_destination_cf": [ @@ -108873,10 +112711,10 @@ "required": true }, { - "name": "type", + "name": "description", "type": "TypeString", - "description": "The type of Destination ibmcf.", - "required": true + "description": "The Destination description.", + "optional": true }, { "name": "config", @@ -108908,19 +112746,16 @@ "max_items": 1 }, { - "name": "destination_id", + "name": "updated_at", "type": "TypeString", - "description": "Destination ID", + "description": "Last updated time.", "computed": true }, { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true }, { "name": "name", @@ -108929,25 +112764,34 @@ "required": true }, { - "name": "description", + "name": "type", "type": "TypeString", - "description": "The Destination description.", - "optional": true + "description": "The type of Destination ibmcf.", + "required": true }, { - "name": "updated_at", + "name": "destination_id", "type": "TypeString", - "description": "Last updated time.", + "description": "Destination ID", "computed": true }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_en_destination_chrome": [ { "name": "subscription_count", "type": "TypeInt", "description": "Number of subscriptions.", "computed": true - } - ], - "ibm_en_destination_chrome": [ + }, { "name": "subscription_names", "type": "TypeList", @@ -108957,12 +112801,6 @@ "type": "TypeString" } }, - { - "name": "name", - "type": "TypeString", - "description": "The Destintion name.", - "required": true - }, { "name": "type", "type": "TypeString", @@ -108970,10 +112808,10 @@ "required": true }, { - "name": "destination_id", + "name": "description", "type": "TypeString", - "description": "Destination ID", - "computed": true + "description": "The Destination description.", + "optional": true }, { "name": "updated_at", @@ -108982,9 +112820,9 @@ "computed": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID", "computed": true }, { @@ -108995,10 +112833,10 @@ "required": true }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "The Destination description.", - "optional": true + "description": "The Destintion name.", + "required": true }, { "name": "config", @@ -109039,15 +112877,22 @@ ], "ibm_en_destination_cos": [ { - "name": "destination_id", + "name": "instance_guid", "type": "TypeString", - "description": "Destination ID", - "computed": true + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true }, { - "name": "updated_at", + "name": "type", "type": "TypeString", - "description": "Last updated time.", + "description": "The type of Destination Webhook.", + "required": true + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", "computed": true }, { @@ -109060,16 +112905,9 @@ } }, { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "type", + "name": "name", "type": "TypeString", - "description": "The type of Destination Webhook.", + "description": "The Destintion name.", "required": true }, { @@ -109114,31 +112952,96 @@ "max_items": 1 }, { - "name": "name", + "name": "destination_id", "type": "TypeString", - "description": "The Destintion name.", - "required": true + "description": "Destination ID", + "computed": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", "computed": true } ], - "ibm_en_destination_firefox": [ + "ibm_en_destination_custom_email": [ { - "name": "destination_id", + "name": "name", "type": "TypeString", - "description": "Destination ID", + "description": "The Destintion name.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, + { + "name": "config", + "type": "TypeList", + "description": "Payload describing a destination configuration.", + "optional": true, + "elem": { + "params": { + "name": "params", + "type": "TypeList", + "optional": true, + "elem": { + "domain": { + "name": "domain", + "type": "TypeString", + "description": "Domain for the Custom Domain Email Destination", + "required": true + } + }, + "max_items": 1 + } + }, + "max_items": 1 + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", "computed": true }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, { "name": "type", "type": "TypeString", - "description": "The type of Destination type push_firefox.", + "description": "The type of Destination type smtp_custom.", "required": true }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID", + "computed": true + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + } + ], + "ibm_en_destination_firefox": [ { "name": "name", "type": "TypeString", @@ -109146,10 +113049,10 @@ "required": true }, { - "name": "description", + "name": "type", "type": "TypeString", - "description": "The Destination description.", - "optional": true + "description": "The type of Destination type push_firefox.", + "required": true }, { "name": "config", @@ -109180,6 +113083,54 @@ }, "max_items": 1 }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + } + ], + "ibm_en_destination_huawei": [ + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination push_huawei.", + "required": true + }, { "name": "updated_at", "type": "TypeString", @@ -109207,21 +113158,13 @@ "description": "Unique identifier for IBM Cloud Event Notifications instance.", "immutable": true, "required": true - } - ], - "ibm_en_destination_huawei": [ + }, { "name": "name", "type": "TypeString", "description": "The Destintion name.", "required": true }, - { - "name": "type", - "type": "TypeString", - "description": "The type of Destination push_huawei.", - "required": true - }, { "name": "description", "type": "TypeString", @@ -109263,34 +113206,6 @@ }, "max_items": 1 }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, { "name": "destination_id", "type": "TypeString", @@ -109311,12 +113226,6 @@ "description": "The type of Destination type push_ios.", "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true - }, { "name": "certificate", "type": "TypeString", @@ -109383,6 +113292,15 @@ }, "max_items": 1 }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "instance_guid", "type": "TypeString", @@ -109415,47 +113333,19 @@ "computed": true }, { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true } ], "ibm_en_destination_msteams": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of Destination msteams.", - "required": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, { "name": "name", "type": "TypeString", "description": "The Destintion name.", "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true - }, { "name": "config", "type": "TypeList", @@ -109491,6 +113381,31 @@ "description": "Last updated time.", "computed": true }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination msteams.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, { "name": "subscription_names", "type": "TypeList", @@ -109502,6 +113417,24 @@ } ], "ibm_en_destination_pagerduty": [ + { + "name": "name", + "type": "TypeString", + "description": "The Destintion name.", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination type push_chrome.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, { "name": "updated_at", "type": "TypeString", @@ -109524,17 +113457,12 @@ } }, { - "name": "name", + "name": "instance_guid", "type": "TypeString", - "description": "The Destintion name.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true - }, { "name": "config", "type": "TypeList", @@ -109565,19 +113493,6 @@ }, "max_items": 1 }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of Destination type push_chrome.", - "required": true - }, { "name": "destination_id", "type": "TypeString", @@ -109587,29 +113502,11 @@ ], "ibm_en_destination_safari": [ { - "name": "icon_128x128", - "type": "TypeString", - "description": "The Certificate File.", - "optional": true - }, - { - "name": "icon_32x32_content_type", - "type": "TypeString", - "description": "The Certificate File.", - "optional": true - }, - { - "name": "icon_32x32_2x_content_type", + "name": "description", "type": "TypeString", - "description": "The Certificate File.", + "description": "The Destination description.", "optional": true }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, { "name": "icon_16x16_2x", "type": "TypeString", @@ -109617,32 +113514,34 @@ "optional": true }, { - "name": "icon_32x32", + "name": "icon_32x32_2x_content_type", "type": "TypeString", "description": "The Certificate File.", "optional": true }, { - "name": "updated_at", + "name": "destination_id", "type": "TypeString", - "description": "Last updated time.", + "description": "Destination ID", "computed": true }, { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "icon_32x32_2x", + "name": "name", "type": "TypeString", - "description": "The Certificate File.", - "optional": true + "description": "The Destintion name.", + "required": true }, { - "name": "icon_16x16", + "name": "icon_128x128", "type": "TypeString", "description": "The Certificate File.", "optional": true @@ -109660,46 +113559,38 @@ "optional": true }, { - "name": "icon_128x128_content_type", + "name": "icon_16x16_2x_content_type", "type": "TypeString", "description": "The Certificate File.", "optional": true }, { - "name": "destination_id", + "name": "icon_128x128_2x_content_type", "type": "TypeString", - "description": "Destination ID", - "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } + "description": "The Certificate File.", + "optional": true }, { - "name": "name", + "name": "instance_guid", "type": "TypeString", - "description": "The Destintion name.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, "required": true }, { - "name": "type", + "name": "icon_16x16", "type": "TypeString", - "description": "The type of Destination type push_ios.", - "required": true + "description": "The Certificate File.", + "optional": true }, { - "name": "icon_16x16_2x_content_type", + "name": "icon_32x32_content_type", "type": "TypeString", "description": "The Certificate File.", "optional": true }, { - "name": "icon_128x128_2x_content_type", + "name": "icon_128x128_content_type", "type": "TypeString", "description": "The Certificate File.", "optional": true @@ -109765,16 +113656,40 @@ "max_items": 1 }, { - "name": "description", + "name": "updated_at", "type": "TypeString", - "description": "The Destination description.", - "optional": true + "description": "Last updated time.", + "computed": true }, { "name": "certificate", "type": "TypeString", "description": "The Certificate File.", "required": true + }, + { + "name": "icon_32x32", + "type": "TypeString", + "description": "The Certificate File.", + "optional": true + }, + { + "name": "icon_32x32_2x", + "type": "TypeString", + "description": "The Certificate File.", + "optional": true + }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination type push_ios.", + "required": true } ], "ibm_en_destination_slack": [ @@ -109790,29 +113705,6 @@ "description": "The Destination description.", "optional": true }, - { - "name": "config", - "type": "TypeList", - "description": "Payload describing a destination configuration.", - "optional": true, - "elem": { - "params": { - "name": "params", - "type": "TypeList", - "optional": true, - "elem": { - "url": { - "name": "url", - "type": "TypeString", - "description": "Slack webhook url.", - "required": true - } - }, - "max_items": 1 - } - }, - "max_items": 1 - }, { "name": "destination_id", "type": "TypeString", @@ -109841,6 +113733,29 @@ "description": "The type of Destination Webhook.", "required": true }, + { + "name": "config", + "type": "TypeList", + "description": "Payload describing a destination configuration.", + "optional": true, + "elem": { + "params": { + "name": "params", + "type": "TypeList", + "optional": true, + "elem": { + "url": { + "name": "url", + "type": "TypeString", + "description": "Slack webhook url.", + "required": true + } + }, + "max_items": 1 + } + }, + "max_items": 1 + }, { "name": "updated_at", "type": "TypeString", @@ -109856,18 +113771,11 @@ ], "ibm_en_destination_sn": [ { - "name": "instance_guid", + "name": "name", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, + "description": "The Destintion name.", "required": true }, - { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true - }, { "name": "config", "type": "TypeList", @@ -109931,6 +113839,12 @@ "description": "Last updated time.", "computed": true }, + { + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + }, { "name": "subscription_names", "type": "TypeList", @@ -109941,9 +113855,10 @@ } }, { - "name": "name", + "name": "instance_guid", "type": "TypeString", - "description": "The Destintion name.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, "required": true }, { @@ -109953,13 +113868,40 @@ "required": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true } ], "ibm_en_destination_webhook": [ + { + "name": "name", + "type": "TypeString", + "description": "The Destintion name.", + "required": true + }, + { + "name": "type", + "type": "TypeString", + "description": "The type of Destination Webhook.", + "required": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "subscription_names", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "instance_guid", "type": "TypeString", @@ -109967,6 +113909,12 @@ "immutable": true, "required": true }, + { + "name": "description", + "type": "TypeString", + "description": "The Destination description.", + "optional": true + }, { "name": "config", "type": "TypeList", @@ -110015,52 +113963,46 @@ "max_items": 1 }, { - "name": "updated_at", + "name": "destination_id", "type": "TypeString", - "description": "Last updated time.", + "description": "Destination ID", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The Destintion name.", - "required": true - }, + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true + } + ], + "ibm_en_ibmsource": [ { - "name": "type", + "name": "instance_guid", "type": "TypeString", - "description": "The type of Destination Webhook.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, "required": true }, { - "name": "description", - "type": "TypeString", - "description": "The Destination description.", - "optional": true + "name": "enabled", + "type": "TypeBool", + "description": "The enabled flag for source", + "required": true }, { - "name": "destination_id", + "name": "source_id", "type": "TypeString", "description": "Destination ID", - "computed": true + "required": true }, { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", "computed": true - }, - { - "name": "subscription_names", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "type": "TypeString" - } } ], - "ibm_en_ibmsource": [ + "ibm_en_integration": [ { "name": "updated_at", "type": "TypeString", @@ -110075,19 +114017,17 @@ "required": true }, { - "name": "enabled", - "type": "TypeBool", - "description": "The enabled flag for source", + "name": "integration_id", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "required": true }, { - "name": "source_id", + "name": "type", "type": "TypeString", - "description": "Destination ID", + "description": "The type of key integration kms/hs-crypto.", "required": true - } - ], - "ibm_en_integration": [ + }, { "name": "metadata", "type": "TypeList", @@ -110113,31 +114053,6 @@ } }, "max_items": 1 - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "integration_id", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "required": true - }, - { - "name": "type", - "type": "TypeString", - "description": "The type of key integration kms/hs-crypto.", - "required": true } ], "ibm_en_source": [ @@ -110187,24 +114102,6 @@ "immutable": true, "required": true }, - { - "name": "destination_type", - "type": "TypeString", - "description": "The type of Destination.", - "computed": true - }, - { - "name": "topic_name", - "type": "TypeString", - "description": "Name of the topic.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -110217,20 +114114,6 @@ "description": "Subscription description.", "optional": true }, - { - "name": "destination_id", - "type": "TypeString", - "description": "Destination ID.", - "immutable": true, - "required": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true - }, { "name": "subscription_id", "type": "TypeString", @@ -110242,9 +114125,7 @@ "type": "TypeString", "description": "The Destintion name.", "computed": true - } - ], - "ibm_en_subscription_ce": [ + }, { "name": "updated_at", "type": "TypeString", @@ -110252,10 +114133,18 @@ "computed": true }, { - "name": "description", + "name": "destination_id", "type": "TypeString", - "description": "Subscription description.", - "optional": true + "description": "Destination ID.", + "immutable": true, + "required": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "immutable": true, + "required": true }, { "name": "destination_type", @@ -110268,14 +114157,9 @@ "type": "TypeString", "description": "Name of the topic.", "computed": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true - }, + } + ], + "ibm_en_subscription_ce": [ { "name": "subscription_id", "type": "TypeString", @@ -110283,15 +114167,15 @@ "computed": true }, { - "name": "destination_name", + "name": "topic_name", "type": "TypeString", - "description": "The Destintion name.", + "description": "Name of the topic.", "computed": true }, { - "name": "instance_guid", + "name": "topic_id", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "description": "Topic ID.", "immutable": true, "required": true }, @@ -110301,15 +114185,6 @@ "description": "Subscription name.", "required": true }, - { - "name": "destination_id", - "type": "TypeString", - "description": "Destination ID.", - "immutable": true, - "required": true - } - ], - "ibm_en_subscription_cf": [ { "name": "description", "type": "TypeString", @@ -110324,12 +114199,32 @@ "required": true }, { - "name": "topic_id", + "name": "destination_type", "type": "TypeString", - "description": "Topic ID.", + "description": "The type of Destination.", + "computed": true + }, + { + "name": "destination_name", + "type": "TypeString", + "description": "The Destintion name.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "immutable": true, "required": true - }, + } + ], + "ibm_en_subscription_cf": [ { "name": "destination_name", "type": "TypeString", @@ -110350,9 +114245,10 @@ "required": true }, { - "name": "name", + "name": "destination_id", "type": "TypeString", - "description": "Subscription name.", + "description": "Destination ID.", + "immutable": true, "required": true }, { @@ -110372,38 +114268,38 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - } - ], - "ibm_en_subscription_chrome": [ + }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "Last updated time.", - "computed": true + "description": "Subscription name.", + "required": true }, { - "name": "instance_guid", + "name": "description", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true + "description": "Subscription description.", + "optional": true }, { - "name": "name", + "name": "topic_id", "type": "TypeString", - "description": "Subscription name.", + "description": "Topic ID.", + "immutable": true, "required": true - }, + } + ], + "ibm_en_subscription_chrome": [ { - "name": "destination_type", + "name": "subscription_id", "type": "TypeString", - "description": "The type of Destination.", + "description": "Subscription ID.", "computed": true }, { - "name": "destination_name", + "name": "destination_type", "type": "TypeString", - "description": "The Destintion name.", + "description": "The type of Destination.", "computed": true }, { @@ -110412,6 +114308,13 @@ "description": "Name of the topic.", "computed": true }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, { "name": "description", "type": "TypeString", @@ -110419,27 +114322,24 @@ "optional": true }, { - "name": "destination_id", + "name": "topic_id", "type": "TypeString", - "description": "Destination ID.", + "description": "Topic ID.", "immutable": true, "required": true }, { - "name": "topic_id", + "name": "destination_name", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true + "description": "The Destintion name.", + "computed": true }, { - "name": "subscription_id", + "name": "updated_at", "type": "TypeString", - "description": "Subscription ID.", + "description": "Last updated time.", "computed": true - } - ], - "ibm_en_subscription_cos": [ + }, { "name": "name", "type": "TypeString", @@ -110447,11 +114347,19 @@ "required": true }, { - "name": "topic_id", + "name": "destination_id", "type": "TypeString", - "description": "Topic ID.", + "description": "Destination ID.", "immutable": true, "required": true + } + ], + "ibm_en_subscription_cos": [ + { + "name": "destination_type", + "type": "TypeString", + "description": "The type of Destination.", + "computed": true }, { "name": "destination_name", @@ -110460,24 +114368,31 @@ "computed": true }, { - "name": "topic_name", + "name": "instance_guid", "type": "TypeString", - "description": "Name of the topic.", - "computed": true + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "Last updated time.", - "computed": true + "description": "Subscription name.", + "required": true }, { - "name": "instance_guid", + "name": "destination_id", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "description": "Destination ID.", "immutable": true, "required": true }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Subscription ID.", + "computed": true + }, { "name": "description", "type": "TypeString", @@ -110485,26 +114400,116 @@ "optional": true }, { - "name": "destination_id", + "name": "topic_id", "type": "TypeString", - "description": "Destination ID.", + "description": "Topic ID.", "immutable": true, "required": true }, { - "name": "subscription_id", + "name": "topic_name", "type": "TypeString", - "description": "Subscription ID.", + "description": "Name of the topic.", "computed": true }, { - "name": "destination_type", + "name": "updated_at", "type": "TypeString", - "description": "The type of Destination.", + "description": "Last updated time.", "computed": true } ], - "ibm_en_subscription_email": [ + "ibm_en_subscription_custom_email": [ + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "optional": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "immutable": true, + "required": true + }, + { + "name": "attributes", + "type": "TypeList", + "optional": true, + "elem": { + "add": { + "name": "add", + "type": "TypeList", + "description": "The Email address which should be added to smtp_ibm.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "add_notification_payload": { + "name": "add_notification_payload", + "type": "TypeBool", + "description": "Whether to add the notification payload to the email.", + "optional": true + }, + "from_email": { + "name": "from_email", + "type": "TypeString", + "description": "The email from where it is sourced", + "optional": true + }, + "from_name": { + "name": "from_name", + "type": "TypeString", + "description": "The name of email address from which email is sourced.", + "optional": true + }, + "invited": { + "name": "invited", + "type": "TypeList", + "description": "The Email address send the invite to in case of smtp_ibm.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "remove": { + "name": "remove", + "type": "TypeList", + "description": "The email id to be removed in case of smtp_ibm destination type.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "reply_to_mail": { + "name": "reply_to_mail", + "type": "TypeString", + "description": "The email address to reply to.", + "optional": true + }, + "reply_to_name": { + "name": "reply_to_name", + "type": "TypeString", + "description": "The name of the email address user to reply to.", + "optional": true + }, + "template_id_invitation": { + "name": "template_id_invitation", + "type": "TypeString", + "description": "The templete id for invitation", + "optional": true + }, + "template_id_notification": { + "name": "template_id_notification", + "type": "TypeString", + "description": "The templete id for notification", + "optional": true + } + }, + "max_items": 1 + }, { "name": "subscription_id", "type": "TypeString", @@ -110512,9 +114517,9 @@ "computed": true }, { - "name": "destination_type", + "name": "destination_name", "type": "TypeString", - "description": "The type of Destination.", + "description": "The Destintion name.", "computed": true }, { @@ -110523,18 +114528,71 @@ "description": "Name of the topic.", "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "required": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID.", + "immutable": true, + "required": true + }, + { + "name": "destination_type", + "type": "TypeString", + "description": "The type of Destination.", + "computed": true + }, { "name": "from", "type": "TypeString", "description": "From Email ID (it will be displayed only in case of smtp_ibm destination type).", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "instance_guid", "type": "TypeString", "description": "Unique identifier for IBM Cloud Event Notifications instance.", "immutable": true, "required": true + } + ], + "ibm_en_subscription_email": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "optional": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID.", + "immutable": true, + "required": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "immutable": true, + "required": true }, { "name": "attributes", @@ -110596,30 +114654,29 @@ "max_items": 1 }, { - "name": "destination_id", + "name": "destination_type", "type": "TypeString", - "description": "Destination ID.", - "immutable": true, - "required": true + "description": "The type of Destination.", + "computed": true }, { - "name": "topic_id", + "name": "topic_name", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true + "description": "Name of the topic.", + "computed": true }, { - "name": "destination_name", + "name": "from", "type": "TypeString", - "description": "The Destintion name.", + "description": "From Email ID (it will be displayed only in case of smtp_ibm destination type).", "computed": true }, { - "name": "updated_at", + "name": "instance_guid", "type": "TypeString", - "description": "Last updated time.", - "computed": true + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true }, { "name": "name", @@ -110628,10 +114685,16 @@ "required": true }, { - "name": "description", + "name": "subscription_id", "type": "TypeString", - "description": "Subscription description.", - "optional": true + "description": "Subscription ID.", + "computed": true + }, + { + "name": "destination_name", + "type": "TypeString", + "description": "The Destintion name.", + "computed": true } ], "ibm_en_subscription_firefox": [ @@ -110648,12 +114711,37 @@ "description": "Subscription name.", "required": true }, + { + "name": "destination_type", + "type": "TypeString", + "description": "The type of Destination.", + "computed": true + }, + { + "name": "topic_name", + "type": "TypeString", + "description": "Name of the topic.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, { "name": "description", "type": "TypeString", "description": "Subscription description.", "optional": true }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID.", + "immutable": true, + "required": true + }, { "name": "topic_id", "type": "TypeString", @@ -110672,34 +114760,74 @@ "type": "TypeString", "description": "The Destintion name.", "computed": true + } + ], + "ibm_en_subscription_huawei": [ + { + "name": "subscription_id", + "type": "TypeString", + "description": "Subscription ID.", + "computed": true }, { - "name": "updated_at", + "name": "destination_type", "type": "TypeString", - "description": "Last updated time.", + "description": "The type of Destination.", "computed": true }, { - "name": "destination_id", + "name": "destination_name", "type": "TypeString", - "description": "Destination ID.", + "description": "The Destintion name.", + "computed": true + }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "immutable": true, "required": true }, { - "name": "destination_type", + "name": "description", "type": "TypeString", - "description": "The type of Destination.", - "computed": true + "description": "Subscription description.", + "optional": true + }, + { + "name": "topic_id", + "type": "TypeString", + "description": "Topic ID.", + "immutable": true, + "required": true }, { "name": "topic_name", "type": "TypeString", "description": "Name of the topic.", "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "required": true + }, + { + "name": "destination_id", + "type": "TypeString", + "description": "Destination ID.", + "immutable": true, + "required": true } ], - "ibm_en_subscription_huawei": [ + "ibm_en_subscription_ios": [ { "name": "description", "type": "TypeString", @@ -110707,15 +114835,9 @@ "optional": true }, { - "name": "subscription_id", - "type": "TypeString", - "description": "Subscription ID.", - "computed": true - }, - { - "name": "topic_name", + "name": "destination_type", "type": "TypeString", - "description": "Name of the topic.", + "description": "The type of Destination.", "computed": true }, { @@ -110739,9 +114861,9 @@ "required": true }, { - "name": "destination_type", + "name": "subscription_id", "type": "TypeString", - "description": "The type of Destination.", + "description": "Subscription ID.", "computed": true }, { @@ -110750,6 +114872,12 @@ "description": "The Destintion name.", "computed": true }, + { + "name": "topic_name", + "type": "TypeString", + "description": "Name of the topic.", + "computed": true + }, { "name": "updated_at", "type": "TypeString", @@ -110764,37 +114892,17 @@ "required": true } ], - "ibm_en_subscription_ios": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "optional": true - }, - { - "name": "topic_id", - "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true - }, + "ibm_en_subscription_msteams": [ { - "name": "subscription_id", + "name": "destination_name", "type": "TypeString", - "description": "Subscription ID.", + "description": "The Destintion name.", "computed": true }, { - "name": "destination_name", + "name": "topic_name", "type": "TypeString", - "description": "The Destintion name.", + "description": "Name of the topic.", "computed": true }, { @@ -110804,9 +114912,17 @@ "computed": true }, { - "name": "name", + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, + { + "name": "topic_id", "type": "TypeString", - "description": "Subscription name.", + "description": "Topic ID.", + "immutable": true, "required": true }, { @@ -110817,26 +114933,31 @@ "required": true }, { - "name": "destination_type", + "name": "subscription_id", "type": "TypeString", - "description": "The type of Destination.", + "description": "Subscription ID.", "computed": true }, { - "name": "topic_name", + "name": "destination_type", "type": "TypeString", - "description": "Name of the topic.", + "description": "The type of Destination.", "computed": true - } - ], - "ibm_en_subscription_msteams": [ + }, { - "name": "destination_id", + "name": "name", "type": "TypeString", - "description": "Destination ID.", - "immutable": true, + "description": "Subscription name.", "required": true }, + { + "name": "description", + "type": "TypeString", + "description": "Subscription description.", + "optional": true + } + ], + "ibm_en_subscription_pagerduty": [ { "name": "topic_id", "type": "TypeString", @@ -110845,15 +114966,15 @@ "required": true }, { - "name": "destination_name", + "name": "subscription_id", "type": "TypeString", - "description": "The Destintion name.", + "description": "Subscription ID.", "computed": true }, { - "name": "topic_name", + "name": "destination_name", "type": "TypeString", - "description": "Name of the topic.", + "description": "The Destintion name.", "computed": true }, { @@ -110863,12 +114984,6 @@ "immutable": true, "required": true }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "required": true - }, { "name": "description", "type": "TypeString", @@ -110876,15 +114991,15 @@ "optional": true }, { - "name": "subscription_id", + "name": "destination_type", "type": "TypeString", - "description": "Subscription ID.", + "description": "The type of Destination.", "computed": true }, { - "name": "destination_type", + "name": "topic_name", "type": "TypeString", - "description": "The type of Destination.", + "description": "Name of the topic.", "computed": true }, { @@ -110892,15 +115007,6 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - } - ], - "ibm_en_subscription_pagerduty": [ - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true }, { "name": "name", @@ -110909,21 +115015,24 @@ "required": true }, { - "name": "destination_type", + "name": "destination_id", "type": "TypeString", - "description": "The type of Destination.", - "computed": true - }, + "description": "Destination ID.", + "immutable": true, + "required": true + } + ], + "ibm_en_subscription_safari": [ { - "name": "topic_name", + "name": "subscription_id", "type": "TypeString", - "description": "Name of the topic.", + "description": "Subscription ID.", "computed": true }, { - "name": "destination_name", + "name": "topic_name", "type": "TypeString", - "description": "The Destintion name.", + "description": "Name of the topic.", "computed": true }, { @@ -110933,33 +115042,24 @@ "computed": true }, { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "optional": true - }, - { - "name": "destination_id", + "name": "instance_guid", "type": "TypeString", - "description": "Destination ID.", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", "immutable": true, "required": true }, { - "name": "topic_id", + "name": "name", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, + "description": "Subscription name.", "required": true }, { - "name": "subscription_id", + "name": "description", "type": "TypeString", - "description": "Subscription ID.", - "computed": true - } - ], - "ibm_en_subscription_safari": [ + "description": "Subscription description.", + "optional": true + }, { "name": "destination_id", "type": "TypeString", @@ -110974,12 +115074,6 @@ "immutable": true, "required": true }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Subscription ID.", - "computed": true - }, { "name": "destination_type", "type": "TypeString", @@ -110991,19 +115085,9 @@ "type": "TypeString", "description": "The Destintion name.", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "required": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "optional": true - }, + } + ], + "ibm_en_subscription_slack": [ { "name": "updated_at", "type": "TypeString", @@ -111011,20 +115095,11 @@ "computed": true }, { - "name": "instance_guid", + "name": "name", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, + "description": "Subscription name.", "required": true }, - { - "name": "topic_name", - "type": "TypeString", - "description": "Name of the topic.", - "computed": true - } - ], - "ibm_en_subscription_slack": [ { "name": "description", "type": "TypeString", @@ -111032,16 +115107,18 @@ "optional": true }, { - "name": "subscription_id", + "name": "destination_id", "type": "TypeString", - "description": "Subscription ID.", - "computed": true + "description": "Destination ID.", + "immutable": true, + "required": true }, { - "name": "destination_type", + "name": "topic_id", "type": "TypeString", - "description": "The type of Destination.", - "computed": true + "description": "Topic ID.", + "immutable": true, + "required": true }, { "name": "attributes", @@ -111063,12 +115140,33 @@ "description": "The Destintion name.", "computed": true }, + { + "name": "instance_guid", + "type": "TypeString", + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true + }, + { + "name": "subscription_id", + "type": "TypeString", + "description": "Subscription ID.", + "computed": true + }, + { + "name": "destination_type", + "type": "TypeString", + "description": "The type of Destination.", + "computed": true + }, { "name": "topic_name", "type": "TypeString", "description": "Name of the topic.", "computed": true - }, + } + ], + "ibm_en_subscription_sms": [ { "name": "updated_at", "type": "TypeString", @@ -111089,38 +115187,35 @@ "required": true }, { - "name": "destination_id", + "name": "description", "type": "TypeString", - "description": "Destination ID.", - "immutable": true, - "required": true + "description": "Subscription description.", + "optional": true }, { - "name": "topic_id", + "name": "destination_id", "type": "TypeString", - "description": "Topic ID.", + "description": "Destination ID.", "immutable": true, "required": true - } - ], - "ibm_en_subscription_sms": [ + }, { - "name": "updated_at", + "name": "subscription_id", "type": "TypeString", - "description": "Last updated time.", + "description": "Subscription ID.", "computed": true }, { - "name": "instance_guid", + "name": "destination_name", "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true + "description": "The Destination name.", + "computed": true }, { - "name": "name", + "name": "topic_id", "type": "TypeString", - "description": "Subscription name.", + "description": "Topic ID.", + "immutable": true, "required": true }, { @@ -111158,12 +115253,6 @@ }, "max_items": 1 }, - { - "name": "subscription_id", - "type": "TypeString", - "description": "Subscription ID.", - "computed": true - }, { "name": "destination_type", "type": "TypeString", @@ -111175,13 +115264,9 @@ "type": "TypeString", "description": "Name of the topic.", "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "Subscription description.", - "optional": true - }, + } + ], + "ibm_en_subscription_sn": [ { "name": "destination_id", "type": "TypeString", @@ -111190,32 +115275,29 @@ "required": true }, { - "name": "topic_id", + "name": "subscription_id", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true + "description": "Subscription ID.", + "computed": true }, { - "name": "destination_name", + "name": "destination_type", "type": "TypeString", - "description": "The Destination name.", + "description": "The type of Destination.", "computed": true - } - ], - "ibm_en_subscription_sn": [ + }, { - "name": "topic_id", + "name": "destination_name", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true + "description": "The Destintion name.", + "computed": true }, { - "name": "subscription_id", + "name": "instance_guid", "type": "TypeString", - "description": "Subscription ID.", - "computed": true + "description": "Unique identifier for IBM Cloud Event Notifications instance.", + "immutable": true, + "required": true }, { "name": "name", @@ -111230,24 +115312,12 @@ "optional": true }, { - "name": "destination_id", + "name": "topic_id", "type": "TypeString", - "description": "Destination ID.", + "description": "Topic ID.", "immutable": true, "required": true }, - { - "name": "destination_type", - "type": "TypeString", - "description": "The type of Destination.", - "computed": true - }, - { - "name": "destination_name", - "type": "TypeString", - "description": "The Destintion name.", - "computed": true - }, { "name": "topic_name", "type": "TypeString", @@ -111259,13 +115329,6 @@ "type": "TypeString", "description": "Last updated time.", "computed": true - }, - { - "name": "instance_guid", - "type": "TypeString", - "description": "Unique identifier for IBM Cloud Event Notifications instance.", - "immutable": true, - "required": true } ], "ibm_en_subscription_webhook": [ @@ -111276,6 +115339,12 @@ "immutable": true, "required": true }, + { + "name": "name", + "type": "TypeString", + "description": "Subscription name.", + "required": true + }, { "name": "description", "type": "TypeString", @@ -111283,16 +115352,26 @@ "optional": true }, { - "name": "subscription_id", + "name": "destination_id", "type": "TypeString", - "description": "Subscription ID.", - "computed": true + "description": "Destination ID.", + "immutable": true, + "required": true }, { - "name": "destination_type", - "type": "TypeString", - "description": "The type of Destination.", - "computed": true + "name": "attributes", + "type": "TypeList", + "optional": true, + "elem": { + "signing_enabled": { + "name": "signing_enabled", + "type": "TypeBool", + "description": "Signing webhook attributes.", + "default_value": false, + "optional": true + } + }, + "max_items": 1 }, { "name": "topic_name", @@ -111307,39 +115386,23 @@ "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Subscription name.", - "required": true - }, - { - "name": "destination_id", + "name": "topic_id", "type": "TypeString", - "description": "Destination ID.", + "description": "Topic ID.", "immutable": true, "required": true }, { - "name": "topic_id", + "name": "subscription_id", "type": "TypeString", - "description": "Topic ID.", - "immutable": true, - "required": true + "description": "Subscription ID.", + "computed": true }, { - "name": "attributes", - "type": "TypeList", - "optional": true, - "elem": { - "signing_enabled": { - "name": "signing_enabled", - "type": "TypeBool", - "description": "Signing webhook attributes.", - "default_value": false, - "optional": true - } - }, - "max_items": 1 + "name": "destination_type", + "type": "TypeString", + "description": "The type of Destination.", + "computed": true }, { "name": "destination_name", @@ -111356,18 +115419,6 @@ "immutable": true, "required": true }, - { - "name": "source_count", - "type": "TypeInt", - "description": "Number of sources.", - "computed": true - }, - { - "name": "subscription_count", - "type": "TypeInt", - "description": "Number of subscriptions.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -111380,6 +115431,62 @@ "description": "Description of the topic.", "optional": true }, + { + "name": "source_count", + "type": "TypeInt", + "description": "Number of sources.", + "computed": true + }, + { + "name": "subscriptions", + "type": "TypeList", + "description": "List of subscriptions.", + "computed": true, + "elem": { + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the subscription.", + "optional": true + }, + "destination_id": { + "name": "destination_id", + "type": "TypeString", + "description": "ID of the destination.", + "computed": true + }, + "destination_type": { + "name": "destination_type", + "type": "TypeString", + "description": "The type of destination.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "ID of the subscription.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the subscription.", + "computed": true + }, + "topic_id": { + "name": "topic_id", + "type": "TypeString", + "description": "ID of the topic.", + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Last updated time of the subscription.", + "computed": true + } + } + }, { "name": "sources", "type": "TypeList", @@ -111435,88 +115542,43 @@ "computed": true }, { - "name": "subscriptions", - "type": "TypeList", - "description": "List of subscriptions.", - "computed": true, - "elem": { - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the subscription.", - "optional": true - }, - "destination_id": { - "name": "destination_id", - "type": "TypeString", - "description": "ID of the destination.", - "computed": true - }, - "destination_type": { - "name": "destination_type", - "type": "TypeString", - "description": "The type of destination.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "ID of the subscription.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the subscription.", - "computed": true - }, - "topic_id": { - "name": "topic_id", - "type": "TypeString", - "description": "ID of the topic.", - "computed": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Last updated time of the subscription.", - "computed": true - } - } + "name": "subscription_count", + "type": "TypeInt", + "description": "Number of subscriptions.", + "computed": true } ], "ibm_enterprise": [ { - "name": "enterprise_account_id", + "name": "crn", "type": "TypeString", - "description": "The enterprise account ID.", + "description": "The Cloud Resource Name (CRN) of the enterprise.", + "cloud_data_type": "crn", "computed": true }, { - "name": "crn", + "name": "primary_contact_email", "type": "TypeString", - "description": "The Cloud Resource Name (CRN) of the enterprise.", - "cloud_data_type": "crn", + "description": "The email of the primary contact of the enterprise.", "computed": true }, { - "name": "state", + "name": "created_at", "type": "TypeString", - "description": "The state of the enterprise.", + "description": "The time stamp at which the enterprise was created.", "computed": true }, { - "name": "created_by", + "name": "updated_by", "type": "TypeString", - "description": "The IAM ID of the user or service that created the enterprise.", + "description": "The IAM ID of the user or service that updated the enterprise.", "computed": true }, { - "name": "source_account_id", + "name": "domain", "type": "TypeString", - "description": "The ID of the account that is used to create the enterprise.", - "immutable": true, - "required": true + "description": "A domain or subdomain for the enterprise, such as `example.com` or `my.example.com`.", + "optional": true }, { "name": "name", @@ -111537,54 +115599,56 @@ "computed": true }, { - "name": "updated_at", + "name": "enterprise_account_id", "type": "TypeString", - "description": "The time stamp at which the enterprise was last updated.", + "description": "The enterprise account ID.", "computed": true }, { - "name": "updated_by", + "name": "state", "type": "TypeString", - "description": "The IAM ID of the user or service that updated the enterprise.", + "description": "The state of the enterprise.", "computed": true }, { - "name": "domain", + "name": "created_by", "type": "TypeString", - "description": "A domain or subdomain for the enterprise, such as `example.com` or `my.example.com`.", - "optional": true + "description": "The IAM ID of the user or service that created the enterprise.", + "computed": true }, { - "name": "primary_contact_email", + "name": "updated_at", "type": "TypeString", - "description": "The email of the primary contact of the enterprise.", + "description": "The time stamp at which the enterprise was last updated.", "computed": true }, { - "name": "created_at", + "name": "source_account_id", "type": "TypeString", - "description": "The time stamp at which the enterprise was created.", - "computed": true + "description": "The ID of the account that is used to create the enterprise.", + "immutable": true, + "required": true } ], "ibm_enterprise_account": [ { - "name": "enterprise_id", + "name": "crn", "type": "TypeString", - "description": "The enterprise ID that the account is a part of.", - "optional": true, + "description": "The Cloud Resource Name (CRN) of the account.", + "cloud_data_type": "crn", "computed": true }, { - "name": "state", + "name": "account_id", "type": "TypeString", - "description": "The state of the account.", + "description": "The source account id of account to be imported", + "optional": true, "computed": true }, { - "name": "created_at", + "name": "owner_email", "type": "TypeString", - "description": "The time stamp at which the account was created.", + "description": "The email address of the owner of the account.", "computed": true }, { @@ -111600,36 +115664,43 @@ "required": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the account. This field must have 3 - 60 characters.", - "immutable": true, + "name": "traits", + "type": "TypeSet", + "description": "The traits object can be used to set properties on child accounts of an enterprise. You can pass a field to opt-out of Multi-Factor Authentication setting or setup enterprise IAM settings when creating a child account in the enterprise. This is an optional field.", "optional": true, - "computed": true + "elem": { + "enterprise_iam_managed": { + "name": "enterprise_iam_managed", + "type": "TypeBool", + "description": "The Enterprise IAM settings property will be turned off for a newly created child account by default. You can enable this property by passing 'true' in this boolean field. This is an optional field.", + "optional": true + }, + "mfa": { + "name": "mfa", + "type": "TypeString", + "description": "By default MFA will be enabled on a child account. To opt out, pass the traits object with the mfa field set to empty string. This is an optional field.", + "optional": true + } + } }, { - "name": "enterprise_account_id", + "name": "state", "type": "TypeString", - "description": "The enterprise account ID.", - "optional": true, - "computed": true - }, - { - "name": "paid", - "type": "TypeBool", - "description": "The type of account - whether it is free or paid.", + "description": "The state of the account.", "computed": true }, { - "name": "owner_email", + "name": "owner_iam_id", "type": "TypeString", - "description": "The email address of the owner of the account.", + "description": "The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "account_id", + "name": "enterprise_account_id", "type": "TypeString", - "description": "The source account id of account to be imported", + "description": "The enterprise account ID.", "optional": true, "computed": true }, @@ -111640,44 +115711,28 @@ "computed": true }, { - "name": "is_enterprise_account", + "name": "paid", "type": "TypeBool", - "description": "The flag to indicate whether the account is an enterprise account or not.", + "description": "The type of account - whether it is free or paid.", "computed": true }, { - "name": "created_by", + "name": "created_at", "type": "TypeString", - "description": "The IAM ID of the user or service that created the account.", + "description": "The time stamp at which the account was created.", "computed": true }, { - "name": "owner_iam_id", + "name": "created_by", "type": "TypeString", - "description": "The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist.", - "immutable": true, - "optional": true, + "description": "The IAM ID of the user or service that created the account.", "computed": true }, { - "name": "traits", - "type": "TypeSet", - "description": "The traits object can be used to set properties on child accounts of an enterprise. You can pass a field to opt-out of Multi-Factor Authentication setting or setup enterprise IAM settings when creating a child account in the enterprise. This is an optional field.", - "optional": true, - "elem": { - "enterprise_iam_managed": { - "name": "enterprise_iam_managed", - "type": "TypeBool", - "description": "The Enterprise IAM settings property will be turned off for a newly created child account by default. You can enable this property by passing 'true' in this boolean field. This is an optional field.", - "optional": true - }, - "mfa": { - "name": "mfa", - "type": "TypeString", - "description": "By default MFA will be enabled on a child account. To opt out, pass the traits object with the mfa field set to empty string. This is an optional field.", - "optional": true - } - } + "name": "updated_at", + "type": "TypeString", + "description": "The time stamp at which the account was last updated.", + "computed": true }, { "name": "url", @@ -111686,37 +115741,44 @@ "computed": true }, { - "name": "crn", + "name": "enterprise_id", "type": "TypeString", - "description": "The Cloud Resource Name (CRN) of the account.", - "cloud_data_type": "crn", + "description": "The enterprise ID that the account is a part of.", + "optional": true, "computed": true }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "The time stamp at which the account was last updated.", + "description": "The name of the account. This field must have 3 - 60 characters.", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "is_enterprise_account", + "type": "TypeBool", + "description": "The flag to indicate whether the account is an enterprise account or not.", "computed": true } ], "ibm_enterprise_account_group": [ { - "name": "parent", + "name": "enterprise_account_id", "type": "TypeString", - "description": "The CRN of the parent under which the account group will be created. The parent can be an existing account group or the enterprise itself.", - "immutable": true, - "required": true + "description": "The enterprise account ID.", + "computed": true }, { - "name": "primary_contact_iam_id", + "name": "state", "type": "TypeString", - "description": "The IAM ID of the primary contact for this account group, such as `IBMid-0123ABC`. The IAM ID must already exist.", - "required": true + "description": "The state of the account group.", + "computed": true }, { - "name": "enterprise_account_id", + "name": "updated_by", "type": "TypeString", - "description": "The enterprise account ID.", + "description": "The IAM ID of the user or service that updated the account group.", "computed": true }, { @@ -111726,64 +115788,65 @@ "computed": true }, { - "name": "state", + "name": "created_by", "type": "TypeString", - "description": "The state of the account group.", + "description": "The IAM ID of the user or service that created the account group.", "computed": true }, { - "name": "primary_contact_email", + "name": "name", "type": "TypeString", - "description": "The email address of the primary contact of the account group.", - "computed": true + "description": "The name of the account group. This field must have 3 - 60 characters.", + "required": true }, { - "name": "crn", + "name": "url", "type": "TypeString", - "description": "The Cloud Resource Name (CRN) of the account group.", - "cloud_data_type": "crn", + "description": "The URL of the account group.", "computed": true }, { - "name": "enterprise_id", + "name": "enterprise_path", "type": "TypeString", - "description": "The enterprise ID that the account group is a part of.", + "description": "The path from the enterprise to this particular account group.", "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "The IAM ID of the user or service that created the account group.", + "description": "The time stamp at which the account group was last updated.", "computed": true }, { - "name": "updated_at", + "name": "parent", "type": "TypeString", - "description": "The time stamp at which the account group was last updated.", - "computed": true + "description": "The CRN of the parent under which the account group will be created. The parent can be an existing account group or the enterprise itself.", + "immutable": true, + "required": true }, { - "name": "name", + "name": "primary_contact_iam_id", "type": "TypeString", - "description": "The name of the account group. This field must have 3 - 60 characters.", + "description": "The IAM ID of the primary contact for this account group, such as `IBMid-0123ABC`. The IAM ID must already exist.", "required": true }, { - "name": "url", + "name": "crn", "type": "TypeString", - "description": "The URL of the account group.", + "description": "The Cloud Resource Name (CRN) of the account group.", + "cloud_data_type": "crn", "computed": true }, { - "name": "enterprise_path", + "name": "enterprise_id", "type": "TypeString", - "description": "The path from the enterprise to this particular account group.", + "description": "The enterprise ID that the account group is a part of.", "computed": true }, { - "name": "updated_by", + "name": "primary_contact_email", "type": "TypeString", - "description": "The IAM ID of the user or service that updated the account group.", + "description": "The email address of the primary contact of the account group.", "computed": true } ], @@ -111821,6 +115884,22 @@ } ], "ibm_event_streams_topic": [ + { + "name": "resource_instance_id", + "type": "TypeString", + "description": "The CRN of the Event Streams instance", + "cloud_data_type": "resource_instance", + "required": true, + "cloud_data_range": [ + "service:event-streams" + ] + }, + { + "name": "kafka_http_url", + "type": "TypeString", + "description": "API endpoint for interacting with Event Streams REST API", + "computed": true + }, { "name": "kafka_brokers_sasl", "type": "TypeList", @@ -111848,37 +115927,9 @@ "type": "TypeMap", "description": "The configuration parameters of a topic", "optional": true - }, - { - "name": "resource_instance_id", - "type": "TypeString", - "description": "The CRN of the Event Streams instance", - "cloud_data_type": "resource_instance", - "required": true, - "cloud_data_range": [ - "service:event-streams" - ] - }, - { - "name": "kafka_http_url", - "type": "TypeString", - "description": "API endpoint for interacting with Event Streams REST API", - "computed": true } ], "ibm_firewall": [ - { - "name": "primary_ip", - "type": "TypeString", - "description": "Primary IP address", - "computed": true - }, - { - "name": "username", - "type": "TypeString", - "description": "User name", - "computed": true - }, { "name": "password", "type": "TypeString", @@ -111924,16 +115975,21 @@ "description": "Location info", "cloud_data_type": "region", "computed": true + }, + { + "name": "primary_ip", + "type": "TypeString", + "description": "Primary IP address", + "computed": true + }, + { + "name": "username", + "type": "TypeString", + "description": "User name", + "computed": true } ], "ibm_firewall_policy": [ - { - "name": "firewall_id", - "type": "TypeInt", - "description": "Firewall ID", - "immutable": true, - "required": true - }, { "name": "rules", "type": "TypeList", @@ -111996,20 +116052,78 @@ "elem": { "type": "TypeString" } + }, + { + "name": "firewall_id", + "type": "TypeInt", + "description": "Firewall ID", + "immutable": true, + "required": true } ], "ibm_function_action": [ { - "name": "publish", - "type": "TypeBool", - "description": "Action visibilty.", - "optional": true + "name": "name", + "type": "TypeString", + "description": "Name of action.", + "immutable": true, + "required": true, + "matches": "^[^/*][a-zA-Z0-9/_@.-]" }, { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the item.", - "computed": true + "name": "exec", + "type": "TypeList", + "description": "Execution info", + "required": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "The code to execute.", + "optional": true, + "computed": true + }, + "code_path": { + "name": "code_path", + "type": "TypeString", + "description": "The file path of code to execute.", + "optional": true + }, + "components": { + "name": "components", + "type": "TypeList", + "description": "The List of fully qualified action.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "image": { + "name": "image", + "type": "TypeString", + "description": "Container image name when kind is 'blackbox'.", + "optional": true + }, + "init": { + "name": "init", + "type": "TypeString", + "description": "Optional zipfile reference.", + "optional": true + }, + "kind": { + "name": "kind", + "type": "TypeString", + "description": "The type of action. Possible values can be found here (https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-runtimes)", + "required": true + }, + "main": { + "name": "main", + "type": "TypeString", + "description": "The name of the action entry point (function or fully-qualified method name when applicable).", + "optional": true + } + }, + "max_items": 1 }, { "name": "user_defined_annotations", @@ -112031,6 +116145,17 @@ "description": "All annotations set on action by user and those set by the IBM Cloud Function backend/API.", "computed": true }, + { + "name": "parameters", + "type": "TypeString", + "description": "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", + "computed": true + }, + { + "name": "action_id", + "type": "TypeString", + "computed": true + }, { "name": "target_endpoint_url", "type": "TypeString", @@ -112038,12 +116163,11 @@ "computed": true }, { - "name": "name", + "name": "namespace", "type": "TypeString", - "description": "Name of action.", + "description": "IBM Cloud function namespace.", "immutable": true, - "required": true, - "matches": "^[^/*][a-zA-Z0-9/_@.-]" + "required": true }, { "name": "limits", @@ -112076,77 +116200,16 @@ "max_items": 1 }, { - "name": "parameters", - "type": "TypeString", - "description": "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", - "computed": true + "name": "publish", + "type": "TypeBool", + "description": "Action visibilty.", + "optional": true }, { - "name": "action_id", + "name": "version", "type": "TypeString", + "description": "Semantic version of the item.", "computed": true - }, - { - "name": "namespace", - "type": "TypeString", - "description": "IBM Cloud function namespace.", - "immutable": true, - "required": true - }, - { - "name": "exec", - "type": "TypeList", - "description": "Execution info", - "required": true, - "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "The code to execute.", - "optional": true, - "computed": true - }, - "code_path": { - "name": "code_path", - "type": "TypeString", - "description": "The file path of code to execute.", - "optional": true - }, - "components": { - "name": "components", - "type": "TypeList", - "description": "The List of fully qualified action.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "image": { - "name": "image", - "type": "TypeString", - "description": "Container image name when kind is 'blackbox'.", - "optional": true - }, - "init": { - "name": "init", - "type": "TypeString", - "description": "Optional zipfile reference.", - "optional": true - }, - "kind": { - "name": "kind", - "type": "TypeString", - "description": "The type of action. Possible values can be found here (https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-runtimes)", - "required": true - }, - "main": { - "name": "main", - "type": "TypeString", - "description": "The name of the action entry point (function or fully-qualified method name when applicable).", - "optional": true - } - }, - "max_items": 1 } ], "ibm_function_namespace": [ @@ -112178,14 +116241,6 @@ } ], "ibm_function_package": [ - { - "name": "name", - "type": "TypeString", - "description": "Name of package.", - "immutable": true, - "required": true, - "matches": "\\A([\\w]|[\\w][\\w@ .-]*[\\w@.-]+)\\z" - }, { "name": "bind_package_name", "type": "TypeString", @@ -112198,6 +116253,27 @@ "type": "TypeString", "computed": true }, + { + "name": "namespace", + "type": "TypeString", + "description": "IBM Cloud function namespace.", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of package.", + "immutable": true, + "required": true, + "matches": "\\A([\\w]|[\\w][\\w@ .-]*[\\w@.-]+)\\z" + }, + { + "name": "version", + "type": "TypeString", + "description": "Semantic version of the item.", + "computed": true + }, { "name": "annotations", "type": "TypeString", @@ -112210,13 +116286,6 @@ "description": "All parameters set on package by user and those set by the IBM Cloud Function backend/API.", "computed": true }, - { - "name": "namespace", - "type": "TypeString", - "description": "IBM Cloud function namespace.", - "immutable": true, - "required": true - }, { "name": "publish", "type": "TypeBool", @@ -112224,12 +116293,6 @@ "default_value": false, "optional": true }, - { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the item.", - "computed": true - }, { "name": "user_defined_annotations", "type": "TypeString", @@ -112246,6 +116309,17 @@ } ], "ibm_function_rule": [ + { + "name": "version", + "type": "TypeString", + "description": "Semantic version of the item.", + "computed": true + }, + { + "name": "rule_id", + "type": "TypeString", + "computed": true + }, { "name": "namespace", "type": "TypeString", @@ -112283,65 +116357,10 @@ "name": "publish", "type": "TypeBool", "description": "Rule visbility.", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the item.", - "computed": true - }, - { - "name": "rule_id", - "type": "TypeString", - "computed": true - } - ], - "ibm_function_trigger": [ - { - "name": "user_defined_parameters", - "type": "TypeString", - "description": "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the trigger.", - "default_value": "[]", - "optional": true - }, - { - "name": "annotations", - "type": "TypeString", - "description": "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", - "computed": true - }, - { - "name": "trigger_id", - "type": "TypeString", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Semantic version of the item.", - "computed": true - }, - { - "name": "user_defined_annotations", - "type": "TypeString", - "description": "Annotation values in KEY VALUE format.", - "default_value": "[]", - "optional": true - }, - { - "name": "parameters", - "type": "TypeString", - "description": "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", - "computed": true - }, - { - "name": "namespace", - "type": "TypeString", - "description": "IBM Cloud function namespace.", - "immutable": true, - "required": true - }, + "computed": true + } + ], + "ibm_function_trigger": [ { "name": "name", "type": "TypeString", @@ -112374,11 +116393,55 @@ }, "max_items": 1 }, + { + "name": "user_defined_parameters", + "type": "TypeString", + "description": "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the trigger.", + "default_value": "[]", + "optional": true + }, + { + "name": "trigger_id", + "type": "TypeString", + "computed": true + }, + { + "name": "namespace", + "type": "TypeString", + "description": "IBM Cloud function namespace.", + "immutable": true, + "required": true + }, { "name": "publish", "type": "TypeBool", "description": "Trigger visbility.", "computed": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Semantic version of the item.", + "computed": true + }, + { + "name": "user_defined_annotations", + "type": "TypeString", + "description": "Annotation values in KEY VALUE format.", + "default_value": "[]", + "optional": true + }, + { + "name": "annotations", + "type": "TypeString", + "description": "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", + "computed": true + }, + { + "name": "parameters", + "type": "TypeString", + "description": "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", + "computed": true } ], "ibm_hardware_firewall_shared": [ @@ -112412,15 +116475,15 @@ ], "ibm_hpcs": [ { - "name": "update_by", + "name": "dashboard_url", "type": "TypeString", - "description": "The subject who updated the instance.", + "description": "Dashboard URL to access resource.", "computed": true }, { - "name": "restored_by", + "name": "deleted_by", "type": "TypeString", - "description": "The subject who restored the instance back from reclamation.", + "description": "The subject who deleted the instance.", "computed": true }, { @@ -112429,6 +116492,92 @@ "description": "A name for the HPCS instance", "required": true }, + { + "name": "service", + "type": "TypeString", + "description": "The name of the service offering `hs-crypto`", + "default_value": "hs-crypto", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Status of HPCS instance", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "The current state of the instance.", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The subject who created the instance.", + "computed": true + }, + { + "name": "deleted_at", + "type": "TypeString", + "description": "The date when the instance was deleted.", + "computed": true + }, + { + "name": "restored_by", + "type": "TypeString", + "description": "The subject who restored the instance back from reclamation.", + "computed": true + }, + { + "name": "revocation_threshold", + "type": "TypeInt", + "description": "Revocation Threshold Value", + "required": true + }, + { + "name": "location", + "type": "TypeString", + "description": "The location where the HPCS instance available", + "cloud_data_type": "region", + "required": true + }, + { + "name": "units", + "type": "TypeInt", + "description": "The number of operational crypto units for your service instance", + "required": true + }, + { + "name": "restored_at", + "type": "TypeString", + "description": "The date when the instance under reclamation was restored.", + "computed": true + }, + { + "name": "resource_bindings_url", + "type": "TypeString", + "description": "The relative path to the resource bindings for the instance.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when the instance was created.", + "computed": true + }, + { + "name": "extensions", + "type": "TypeMap", + "description": "The extended metadata as a map associated with the HPCS instance.", + "computed": true + }, + { + "name": "failover_units", + "type": "TypeInt", + "description": "The number of failover crypto units for your service instance", + "optional": true + }, { "name": "tags", "type": "TypeSet", @@ -112442,16 +116591,41 @@ } }, { - "name": "crn", + "name": "guid", "type": "TypeString", - "description": "CRN of HPCS instance", - "cloud_data_type": "crn", + "description": "Guid of HPCS instance", "computed": true }, { - "name": "created_at", + "name": "resource_keys_url", "type": "TypeString", - "description": "The date when the instance was created.", + "description": "The relative path to the resource keys for the instance.", + "computed": true + }, + { + "name": "scheduled_reclaim_by", + "type": "TypeString", + "description": "The subject who initiated the instance reclamation.", + "computed": true + }, + { + "name": "signature_threshold", + "type": "TypeInt", + "description": "Signature Threshold Value", + "required": true + }, + { + "name": "service_endpoints", + "type": "TypeString", + "description": "Types of the service endpoints. Possible values are `public-and-private`, `private-only`.", + "optional": true, + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN of HPCS instance", + "cloud_data_type": "crn", "computed": true }, { @@ -112461,9 +116635,9 @@ "computed": true }, { - "name": "restored_at", + "name": "scheduled_reclaim_at", "type": "TypeString", - "description": "The date when the instance under reclamation was restored.", + "description": "The date when the instance was scheduled for reclamation.", "computed": true }, { @@ -112472,30 +116646,45 @@ "description": "URL of signing service", "optional": true }, + { + "name": "admins", + "type": "TypeSet", + "description": "Crypto Unit Administrators", + "required": true, + "elem": { + "key": { + "name": "key", + "type": "TypeString", + "description": "The administrator signature key", + "required": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Admin Name", + "required": true + }, + "token": { + "name": "token", + "type": "TypeString", + "description": "Credential giving access to the administrator signature key", + "secure": true, + "required": true + } + } + }, { "name": "plan", "type": "TypeString", "description": "The plan type of the HPCS Instance", "required": true }, - { - "name": "status", - "type": "TypeString", - "description": "Status of HPCS instance", - "computed": true - }, { "name": "resource_aliases_url", "type": "TypeString", "description": "The relative path to the resource aliases for the instance.", "computed": true }, - { - "name": "extensions", - "type": "TypeMap", - "description": "The extended metadata as a map associated with the HPCS instance.", - "computed": true - }, { "name": "hsm_info", "type": "TypeList", @@ -112571,186 +116760,72 @@ } }, { - "name": "created_by", - "type": "TypeString", - "description": "The subject who created the instance.", - "computed": true - }, - { - "name": "scheduled_reclaim_at", - "type": "TypeString", - "description": "The date when the instance was scheduled for reclamation.", - "computed": true - }, - { - "name": "admins", - "type": "TypeSet", - "description": "Crypto Unit Administrators", - "required": true, - "elem": { - "key": { - "name": "key", - "type": "TypeString", - "description": "The administrator signature key", - "required": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Admin Name", - "required": true - }, - "token": { - "name": "token", - "type": "TypeString", - "description": "Credential giving access to the administrator signature key", - "secure": true, - "required": true - } - } - }, - { - "name": "deleted_by", - "type": "TypeString", - "description": "The subject who deleted the instance.", - "computed": true - }, - { - "name": "revocation_threshold", - "type": "TypeInt", - "description": "Revocation Threshold Value", - "required": true - }, - { - "name": "location", - "type": "TypeString", - "description": "The location where the HPCS instance available", - "cloud_data_type": "region", - "required": true - }, - { - "name": "service", - "type": "TypeString", - "description": "The name of the service offering `hs-crypto`", - "default_value": "hs-crypto", - "optional": true - }, - { - "name": "service_endpoints", + "name": "resource_group_id", "type": "TypeString", - "description": "Types of the service endpoints. Possible values are `public-and-private`, `private-only`.", + "description": "The resource group id", + "cloud_data_type": "resource_group", "optional": true, "computed": true }, { - "name": "guid", + "name": "update_by", "type": "TypeString", - "description": "Guid of HPCS instance", + "description": "The subject who updated the instance.", "computed": true - }, + } + ], + "ibm_hpcs_key_template": [ { - "name": "dashboard_url", + "name": "created_by", "type": "TypeString", - "description": "Dashboard URL to access resource.", + "description": "ID of the user that created the key template.", "computed": true }, { - "name": "resource_bindings_url", + "name": "uko_vault", "type": "TypeString", - "description": "The relative path to the resource bindings for the instance.", - "computed": true - }, - { - "name": "units", - "type": "TypeInt", - "description": "The number of operational crypto units for your service instance", + "description": "The UUID of the Vault in which the update is to take place.", + "immutable": true, "required": true }, { - "name": "failover_units", - "type": "TypeInt", - "description": "The number of failover crypto units for your service instance", - "optional": true - }, - { - "name": "resource_group_id", - "type": "TypeString", - "description": "The resource group id", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - }, - { - "name": "deleted_at", - "type": "TypeString", - "description": "The date when the instance was deleted.", - "computed": true + "name": "vault", + "type": "TypeList", + "description": "ID of the Vault where the entity is to be created in.", + "required": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", + "required": true + } + }, + "max_items": 1, + "min_items": 1 }, { - "name": "state", + "name": "updated_at", "type": "TypeString", - "description": "The current state of the instance.", + "description": "Date and time when the key template was updated.", "computed": true }, { - "name": "resource_keys_url", + "name": "updated_by", "type": "TypeString", - "description": "The relative path to the resource keys for the instance.", + "description": "ID of the user that updated the key.", "computed": true }, { - "name": "scheduled_reclaim_by", + "name": "instance_id", "type": "TypeString", - "description": "The subject who initiated the instance reclamation.", - "computed": true - }, - { - "name": "signature_threshold", - "type": "TypeInt", - "description": "Signature Threshold Value", - "required": true - } - ], - "ibm_hpcs_key_template": [ - { - "name": "key", - "type": "TypeList", - "description": "Properties describing the properties of the managed key.", + "description": "The ID of the UKO instance this resource exists in.", + "cloud_data_type": "resource_instance", + "immutable": true, "required": true, - "elem": { - "activation_date": { - "name": "activation_date", - "type": "TypeString", - "description": "Key activation date can be provided as a period definition (e.g. PY1 means 1 year).", - "required": true - }, - "algorithm": { - "name": "algorithm", - "type": "TypeString", - "description": "The algorithm of the key.", - "required": true - }, - "expiration_date": { - "name": "expiration_date", - "type": "TypeString", - "description": "Key expiration date can be provided as a period definition (e.g. PY1 means 1 year).", - "required": true - }, - "size": { - "name": "size", - "type": "TypeString", - "description": "The size of the underlying cryptographic key or key pair. E.g. \"256\" for AES keys, or \"2048\" for RSA.", - "required": true - }, - "state": { - "name": "state", - "type": "TypeString", - "description": "The state that the key will be in after generation.", - "required": true - } - }, - "max_items": 1, - "min_items": 1 + "cloud_data_range": [ + "service:hs-crypto" + ] }, { "name": "keystores", @@ -112787,14 +116862,6 @@ } } }, - { - "name": "description", - "type": "TypeString", - "description": "Description of the key template.", - "max_length": 200, - "matches": "(.|\\\\n)*", - "optional": true - }, { "name": "version", "type": "TypeString", @@ -112802,53 +116869,71 @@ "computed": true }, { - "name": "updated_by", - "type": "TypeString", - "description": "ID of the user that updated the key.", - "computed": true - }, - { - "name": "instance_id", + "name": "region", "type": "TypeString", - "description": "The ID of the UKO instance this resource exists in.", - "cloud_data_type": "resource_instance", + "description": "The region of the UKO instance this resource exists in.", "immutable": true, "required": true, - "cloud_data_range": [ - "service:hs-crypto" - ] + "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" }, { - "name": "uko_vault", + "name": "description", "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "immutable": true, - "required": true + "description": "Description of the key template.", + "max_length": 200, + "matches": "(.|\\\\n)*", + "optional": true }, { - "name": "created_at", + "name": "href", "type": "TypeString", - "description": "Date and time when the key template was created.", + "description": "A URL that uniquely identifies your cloud resource.", "computed": true }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", + "description": "Name of the template, it will be referenced when creating managed keys.", "immutable": true, "required": true, - "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" + "min_length": 1, + "max_length": 30, + "matches": "^[A-Za-z][A-Za-z0-9-]*$" }, { - "name": "vault", + "name": "key", "type": "TypeList", - "description": "ID of the Vault where the entity is to be created in.", + "description": "Properties describing the properties of the managed key.", "required": true, "elem": { - "id": { - "name": "id", + "activation_date": { + "name": "activation_date", "type": "TypeString", - "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", + "description": "Key activation date can be provided as a period definition (e.g. PY1 means 1 year).", + "required": true + }, + "algorithm": { + "name": "algorithm", + "type": "TypeString", + "description": "The algorithm of the key.", + "required": true + }, + "expiration_date": { + "name": "expiration_date", + "type": "TypeString", + "description": "Key expiration date can be provided as a period definition (e.g. PY1 means 1 year).", + "required": true + }, + "size": { + "name": "size", + "type": "TypeString", + "description": "The size of the underlying cryptographic key or key pair. E.g. \"256\" for AES keys, or \"2048\" for RSA.", + "required": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "The state that the key will be in after generation.", "required": true } }, @@ -112856,75 +116941,51 @@ "min_items": 1 }, { - "name": "updated_at", - "type": "TypeString", - "description": "Date and time when the key template was updated.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the template, it will be referenced when creating managed keys.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 30, - "matches": "^[A-Za-z][A-Za-z0-9-]*$" - }, - { - "name": "created_by", - "type": "TypeString", - "description": "ID of the user that created the key template.", - "computed": true - }, - { - "name": "href", + "name": "created_at", "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", + "description": "Date and time when the key template was created.", "computed": true } ], "ibm_hpcs_keystore": [ { - "name": "azure_tenant", - "type": "TypeString", - "description": "Azure tenant that the Key Vault is associated with,.", - "optional": true - }, - { - "name": "etag", + "name": "region", "type": "TypeString", - "computed": true + "description": "The region of the UKO instance this resource exists in.", + "immutable": true, + "required": true, + "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" }, { - "name": "google_project_id", - "type": "TypeString", - "description": "The project id associated with this keystore.", + "name": "dry_run", + "type": "TypeBool", + "description": "Do not create a keystore, only verify if keystore created with given parameters can be communciated with successfully.", + "default_value": false, "optional": true }, { - "name": "google_key_ring", + "name": "ibm_variant", "type": "TypeString", - "description": "A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys.", + "description": "Possible IBM Cloud KMS variants.", "optional": true }, { - "name": "aws_access_key_id", + "name": "ibm_api_endpoint", "type": "TypeString", - "description": "The access key id used for connecting to this instance of AWS KMS.", - "secure": true, + "description": "API endpoint of the IBM Cloud keystore.", "optional": true }, { - "name": "azure_service_name", + "name": "ibm_api_key", "type": "TypeString", - "description": "Service name of the key vault instance from the Azure portal.", + "description": "The IBM Cloud API key to be used for connecting to this IBM Cloud keystore.", + "secure": true, "optional": true }, { - "name": "azure_resource_group", + "name": "ibm_instance_id", "type": "TypeString", - "description": "Resource group in Azure.", + "description": "The instance ID of the IBM Cloud keystore.", "optional": true }, { @@ -112953,12 +117014,6 @@ } } }, - { - "name": "created_by", - "type": "TypeString", - "description": "ID of the user that created the key.", - "computed": true - }, { "name": "updated_at", "type": "TypeString", @@ -112966,37 +117021,26 @@ "computed": true }, { - "name": "region", + "name": "created_by", "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", - "immutable": true, - "required": true, - "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" - }, - { - "name": "dry_run", - "type": "TypeBool", - "description": "Do not create a keystore, only verify if keystore created with given parameters can be communciated with successfully.", - "default_value": false, - "optional": true + "description": "ID of the user that created the key.", + "computed": true }, { - "name": "google_credentials", + "name": "etag", "type": "TypeString", - "description": "The value of the JSON key represented in the Base64 format.", - "secure": true, - "optional": true + "computed": true }, { - "name": "google_private_key_id", + "name": "google_location", "type": "TypeString", - "description": "The private key id associated with this keystore.", + "description": "Location represents the geographical region where a Cloud KMS resource is stored and can be accessed. A key's location impacts the performance of applications using the key.", "optional": true }, { - "name": "ibm_api_key", + "name": "azure_service_principal_password", "type": "TypeString", - "description": "The IBM Cloud API key to be used for connecting to this IBM Cloud keystore.", + "description": "Azure service principal password.", "secure": true, "optional": true }, @@ -113006,6 +117050,12 @@ "description": "Endpoint of the IAM service for this IBM Cloud keystore.", "optional": true }, + { + "name": "ibm_key_ring", + "type": "TypeString", + "description": "The key ring of an IBM Cloud KMS Keystore.", + "optional": true + }, { "name": "description", "type": "TypeString", @@ -113019,21 +117069,68 @@ "computed": true }, { - "name": "href", + "name": "instance_id", "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", + "description": "The ID of the UKO instance this resource exists in.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:hs-crypto" + ] + }, + { + "name": "uko_vault", + "type": "TypeString", + "description": "The UUID of the Vault in which the update is to take place.", + "immutable": true, + "required": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "ID of the user that last updated the key.", "computed": true }, { - "name": "azure_location", + "name": "google_project_id", "type": "TypeString", - "description": "Location of the Azure Key Vault.", + "description": "The project id associated with this keystore.", "optional": true }, { - "name": "azure_service_principal_client_id", + "name": "location", "type": "TypeString", - "description": "Azure service principal client ID.", + "description": "Geographic location of the keystore, if available.", + "cloud_data_type": "region", + "computed": true + }, + { + "name": "groups", + "type": "TypeList", + "description": "List of groups that this keystore belongs to.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "google_private_key_id", + "type": "TypeString", + "description": "The private key id associated with this keystore.", + "optional": true + }, + { + "name": "aws_region", + "type": "TypeString", + "description": "AWS Region.", + "optional": true + }, + { + "name": "aws_access_key_id", + "type": "TypeString", + "description": "The access key id used for connecting to this instance of AWS KMS.", + "secure": true, "optional": true }, { @@ -113043,62 +117140,71 @@ "optional": true }, { - "name": "ibm_key_ring", + "name": "google_key_ring", "type": "TypeString", - "description": "The key ring of an IBM Cloud KMS Keystore.", + "description": "A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys.", "optional": true }, { - "name": "name", + "name": "azure_service_name", "type": "TypeString", - "description": "Name of the target keystore. It can be changed in the future.", + "description": "Service name of the key vault instance from the Azure portal.", "optional": true }, { - "name": "azure_service_principal_password", + "name": "azure_location", "type": "TypeString", - "description": "Azure service principal password.", - "secure": true, + "description": "Location of the Azure Key Vault.", "optional": true }, { - "name": "ibm_variant", + "name": "azure_service_principal_client_id", "type": "TypeString", - "description": "Possible IBM Cloud KMS variants.", + "description": "Azure service principal client ID.", "optional": true }, { - "name": "ibm_instance_id", + "name": "azure_environment", "type": "TypeString", - "description": "The instance ID of the IBM Cloud keystore.", + "description": "Azure environment, usually 'Azure'.", "optional": true }, { - "name": "groups", - "type": "TypeList", - "description": "List of groups that this keystore belongs to.", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "name", + "type": "TypeString", + "description": "Name of the target keystore. It can be changed in the future.", + "optional": true }, { - "name": "uko_vault", + "name": "href", "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "immutable": true, - "required": true + "description": "A URL that uniquely identifies your cloud resource.", + "computed": true }, { - "name": "google_location", + "name": "google_credentials", "type": "TypeString", - "description": "Location represents the geographical region where a Cloud KMS resource is stored and can be accessed. A key's location impacts the performance of applications using the key.", + "description": "The value of the JSON key represented in the Base64 format.", + "secure": true, "optional": true }, { - "name": "azure_environment", + "name": "aws_secret_access_key", "type": "TypeString", - "description": "Azure environment, usually 'Azure'.", + "description": "The secret access key used for connecting to this instance of AWS KMS.", + "secure": true, + "optional": true + }, + { + "name": "azure_resource_group", + "type": "TypeString", + "description": "Resource group in Azure.", + "optional": true + }, + { + "name": "azure_tenant", + "type": "TypeString", + "description": "Azure tenant that the Key Vault is associated with,.", "optional": true }, { @@ -113106,7 +117212,9 @@ "type": "TypeString", "description": "Type of keystore.", "required": true - }, + } + ], + "ibm_hpcs_managed_key": [ { "name": "updated_by", "type": "TypeString", @@ -113114,44 +117222,64 @@ "computed": true }, { - "name": "instance_id", + "name": "href", "type": "TypeString", - "description": "The ID of the UKO instance this resource exists in.", - "cloud_data_type": "resource_instance", + "description": "A URL that uniquely identifies your cloud resource.", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the UKO instance this resource exists in.", "immutable": true, "required": true, - "cloud_data_range": [ - "service:hs-crypto" - ] + "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" }, { - "name": "aws_region", + "name": "uko_vault", "type": "TypeString", - "description": "AWS Region.", - "optional": true + "description": "The UUID of the Vault in which the update is to take place.", + "immutable": true, + "required": true }, { - "name": "aws_secret_access_key", + "name": "label", "type": "TypeString", - "description": "The secret access key used for connecting to this instance of AWS KMS.", - "secure": true, - "optional": true + "description": "The label of the key.", + "required": true, + "min_length": 1, + "max_length": 255, + "matches": "^[A-Za-z0-9._ \\/-]+$" }, { - "name": "ibm_api_endpoint", + "name": "state", "type": "TypeString", - "description": "API endpoint of the IBM Cloud keystore.", - "optional": true + "description": "The state of the key.", + "optional": true, + "computed": true }, { - "name": "location", + "name": "expiration_date", "type": "TypeString", - "description": "Geographic location of the keystore, if available.", - "cloud_data_type": "region", + "description": "Last day when the key is active.", "computed": true - } - ], - "ibm_hpcs_managed_key": [ + }, + { + "name": "vault", + "type": "TypeList", + "description": "ID of the Vault where the entity is to be created in.", + "required": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", + "required": true + } + }, + "max_items": 1, + "min_items": 1 + }, { "name": "tags", "type": "TypeList", @@ -113174,15 +117302,9 @@ } }, { - "name": "expiration_date", - "type": "TypeString", - "description": "Last day when the key is active.", - "computed": true - }, - { - "name": "referenced_keystores", + "name": "template", "type": "TypeList", - "description": "referenced keystores.", + "description": "Reference to a key template.", "computed": true, "elem": { "href": { @@ -113202,18 +117324,18 @@ "name": { "name": "name", "type": "TypeString", - "description": "Name of the target keystore.", + "description": "Name of the key template.", "optional": true, "computed": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of keystore.", - "required": true } } }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Date and time when the key was last updated.", + "computed": true + }, { "name": "etag", "type": "TypeString", @@ -113231,26 +117353,19 @@ ] }, { - "name": "vault", - "type": "TypeList", - "description": "ID of the Vault where the entity is to be created in.", - "required": true, - "elem": { - "id": { - "name": "id", - "type": "TypeString", - "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", - "required": true - } - }, - "max_items": 1, - "min_items": 1 + "name": "key_id", + "type": "TypeString", + "description": "The UUID of the key.", + "computed": true }, { - "name": "algorithm", + "name": "template_name", "type": "TypeString", - "description": "The algorithm of the key.", - "computed": true + "description": "Name of the key template to use when creating a key.", + "required": true, + "min_length": 1, + "max_length": 30, + "matches": "^[A-Za-z][A-Za-z0-9-]+$" }, { "name": "created_at", @@ -113259,9 +117374,44 @@ "computed": true }, { - "name": "updated_at", + "name": "referenced_keystores", + "type": "TypeList", + "description": "referenced keystores.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "A URL that uniquely identifies your cloud resource.", + "optional": true, + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", + "optional": true, + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the target keystore.", + "optional": true, + "computed": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of keystore.", + "required": true + } + } + }, + { + "name": "created_by", "type": "TypeString", - "description": "Date and time when the key was last updated.", + "description": "ID of the user that created the key.", "computed": true }, { @@ -113327,73 +117477,6 @@ } } }, - { - "name": "uko_vault", - "type": "TypeString", - "description": "The UUID of the Vault in which the update is to take place.", - "immutable": true, - "required": true - }, - { - "name": "template_name", - "type": "TypeString", - "description": "Name of the key template to use when creating a key.", - "required": true, - "min_length": 1, - "max_length": 30, - "matches": "^[A-Za-z][A-Za-z0-9-]+$" - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "ID of the user that last updated the key.", - "computed": true - }, - { - "name": "template", - "type": "TypeList", - "description": "Reference to a key template.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", - "optional": true, - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The v4 UUID used to uniquely identify the resource, as specified by RFC 4122.", - "optional": true, - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the key template.", - "optional": true, - "computed": true - } - } - }, - { - "name": "state", - "type": "TypeString", - "description": "The state of the key.", - "optional": true, - "computed": true - }, - { - "name": "label", - "type": "TypeString", - "description": "The label of the key.", - "required": true, - "min_length": 1, - "max_length": 255, - "matches": "^[A-Za-z0-9._ \\/-]+$" - }, { "name": "description", "type": "TypeString", @@ -113408,6 +117491,12 @@ "description": "The size of the underlying cryptographic key or key pair. E.g. \"256\" for AES keys, or \"2048\" for RSA.", "computed": true }, + { + "name": "algorithm", + "type": "TypeString", + "description": "The algorithm of the key.", + "computed": true + }, { "name": "verification_patterns", "type": "TypeList", @@ -113433,50 +117522,39 @@ "type": "TypeString", "description": "First day when the key is active.", "computed": true - }, + } + ], + "ibm_hpcs_vault": [ { - "name": "created_by", + "name": "etag", "type": "TypeString", - "description": "ID of the user that created the key.", "computed": true }, { - "name": "region", + "name": "instance_id", "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", + "description": "The ID of the UKO instance this resource exists in.", + "cloud_data_type": "resource_instance", "immutable": true, "required": true, - "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" + "cloud_data_range": [ + "service:hs-crypto" + ] }, { - "name": "key_id", + "name": "region", "type": "TypeString", - "description": "The UUID of the key.", - "computed": true + "description": "The region of the UKO instance this resource exists in.", + "immutable": true, + "required": true, + "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" }, - { - "name": "href", - "type": "TypeString", - "description": "A URL that uniquely identifies your cloud resource.", - "computed": true - } - ], - "ibm_hpcs_vault": [ { "name": "vault_id", "type": "TypeString", "description": "The ID of the vault.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "A human-readable name to assign to your vault. To protect your privacy, do not use personal data, such as your name or location.", - "required": true, - "min_length": 1, - "max_length": 100, - "matches": "^[A-Za-z0-9#@!$%'_-][A-Za-z0-9#@!$% '_-]*$" - }, { "name": "description", "type": "TypeString", @@ -113486,39 +117564,24 @@ "optional": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "Date and time when the vault was last updated.", - "computed": true - }, - { - "name": "etag", + "name": "created_at", "type": "TypeString", + "description": "Date and time when the vault was created.", "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the UKO instance this resource exists in.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:hs-crypto" - ] - }, - { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the UKO instance this resource exists in.", - "immutable": true, + "description": "A human-readable name to assign to your vault. To protect your privacy, do not use personal data, such as your name or location.", "required": true, - "options": "au-syd, in-che, jp-osa, jp-tok, kr-seo, eu-de, eu-gb, ca-tor, us-south, us-south-test, us-east, br-sao" + "min_length": 1, + "max_length": 100, + "matches": "^[A-Za-z0-9#@!$%'_-][A-Za-z0-9#@!$% '_-]*$" }, { - "name": "created_at", + "name": "updated_at", "type": "TypeString", - "description": "Date and time when the vault was created.", + "description": "Date and time when the vault was last updated.", "computed": true }, { @@ -113541,6 +117604,12 @@ } ], "ibm_iam_access_group": [ + { + "name": "name", + "type": "TypeString", + "description": "Name of the access group", + "required": true + }, { "name": "description", "type": "TypeString", @@ -113560,12 +117629,6 @@ "name": "version", "type": "TypeString", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the access group", - "required": true } ], "ibm_iam_access_group_account_settings": [ @@ -113643,18 +117706,6 @@ } ], "ibm_iam_access_group_members": [ - { - "name": "access_group_id", - "type": "TypeString", - "description": "Unique identifier of the access group", - "cloud_data_type": "iam", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:access_group", - "resolved_to:id" - ] - }, { "name": "ibm_ids", "type": "TypeSet", @@ -113695,19 +117746,11 @@ "computed": true } } - } - ], - "ibm_iam_access_group_policy": [ - { - "name": "pattern", - "type": "TypeString", - "description": "Pattern rule follows for time-based condition", - "optional": true }, { "name": "access_group_id", "type": "TypeString", - "description": "ID of access group", + "description": "Unique identifier of the access group", "cloud_data_type": "iam", "immutable": true, "required": true, @@ -113715,7 +117758,9 @@ "service:access_group", "resolved_to:id" ] - }, + } + ], + "ibm_iam_access_group_policy": [ { "name": "resources", "type": "TypeList", @@ -113779,13 +117824,6 @@ }, "max_items": 1 }, - { - "name": "account_management", - "type": "TypeBool", - "description": "Give access to all account management services", - "default_value": false, - "optional": true - }, { "name": "tags", "type": "TypeSet", @@ -113796,9 +117834,54 @@ } }, { - "name": "resource_tags", + "name": "transaction_id", + "type": "TypeString", + "description": "Set transactionID for debug", + "optional": true, + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "computed": true + }, + { + "name": "rule_operator", + "type": "TypeString", + "description": "Operator that multiple rule conditions are evaluated over", + "optional": true + }, + { + "name": "pattern", + "type": "TypeString", + "description": "Pattern rule follows for time-based condition", + "optional": true + }, + { + "name": "access_group_id", + "type": "TypeString", + "description": "ID of access group", + "cloud_data_type": "iam", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:access_group", + "resolved_to:id" + ] + }, + { + "name": "roles", + "type": "TypeList", + "description": "Role names of the policy definition", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_attributes", "type": "TypeSet", - "description": "Set access management tags.", + "description": "Set resource attributes.", "optional": true, "elem": { "name": { @@ -113823,24 +117906,16 @@ } }, { - "name": "rule_operator", - "type": "TypeString", - "description": "Operator that multiple rule conditions are evaluated over", + "name": "account_management", + "type": "TypeBool", + "description": "Give access to all account management services", + "default_value": false, "optional": true }, { - "name": "roles", - "type": "TypeList", - "description": "Role names of the policy definition", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_attributes", + "name": "resource_tags", "type": "TypeSet", - "description": "Set resource attributes.", + "description": "Set access management tags.", "optional": true, "elem": { "name": { @@ -113870,18 +117945,6 @@ "description": "Description of the Policy", "optional": true }, - { - "name": "transaction_id", - "type": "TypeString", - "description": "Set transactionID for debug", - "optional": true, - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "computed": true - }, { "name": "rule_conditions", "type": "TypeSet", @@ -113913,6 +117976,45 @@ } ], "ibm_iam_access_group_template": [ + { + "name": "created_by_id", + "type": "TypeString", + "description": "The ID of the user who created the access group template.", + "computed": true + }, + { + "name": "last_modified_at", + "type": "TypeString", + "description": "The date and time when the access group template was last modified.", + "computed": true + }, + { + "name": "template_id", + "type": "TypeString", + "description": "Template ID.", + "computed": true + }, + { + "name": "committed", + "type": "TypeBool", + "description": "A boolean indicating whether the access group template is committed. You must commit a template before you can assign it to child accounts.", + "optional": true, + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of the access group template.", + "max_length": 250, + "matches": "^[a-zA-Z0-9!@#$%^\u0026*()_+{}:;\"'\u003c\u003e,.?\\/|\\-\\s]+$", + "optional": true + }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "The ID of the user who last modified the access group template.", + "computed": true + }, { "name": "transaction_id", "type": "TypeString", @@ -113922,6 +118024,18 @@ "matches": "^[a-zA-Z0-9_-]+$", "optional": true }, + { + "name": "href", + "type": "TypeString", + "description": "The URL of the access group template resource.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time when the access group template was created.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -113931,12 +118045,6 @@ "max_length": 100, "matches": "^[a-zA-Z0-9!@#$%^\u0026*()_+{}:;\"'\u003c\u003e,.?\\/|\\-\\s]+$" }, - { - "name": "account_id", - "type": "TypeString", - "description": "The ID of the account to which the access group template is assigned.", - "computed": true - }, { "name": "group", "type": "TypeList", @@ -114130,57 +118238,6 @@ }, "max_items": 1 }, - { - "name": "version", - "type": "TypeString", - "description": "The version of the access group template.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL of the access group template resource.", - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time when the access group template was created.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "The date and time when the access group template was last modified.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The description of the access group template.", - "max_length": 250, - "matches": "^[a-zA-Z0-9!@#$%^\u0026*()_+{}:;\"'\u003c\u003e,.?\\/|\\-\\s]+$", - "optional": true - }, - { - "name": "committed", - "type": "TypeBool", - "description": "A boolean indicating whether the access group template is committed. You must commit a template before you can assign it to child accounts.", - "optional": true, - "computed": true - }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "The ID of the user who created the access group template.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "Template ID.", - "computed": true - }, { "name": "policy_template_references", "type": "TypeList", @@ -114203,38 +118260,19 @@ } }, { - "name": "last_modified_by_id", + "name": "version", "type": "TypeString", - "description": "The ID of the user who last modified the access group template.", + "description": "The version of the access group template.", "computed": true - } - ], - "ibm_iam_access_group_template_assignment": [ - { - "name": "template_id", - "type": "TypeString", - "description": "The ID of the template that the assignment is based on.", - "required": true, - "min_length": 1, - "max_length": 100, - "matches": "^[a-zA-Z0-9_-]+$" }, { - "name": "last_modified_at", + "name": "account_id", "type": "TypeString", - "description": "The date and time when the assignment was last updated.", + "description": "The ID of the account to which the access group template is assigned.", "computed": true - }, - { - "name": "target_type", - "type": "TypeString", - "description": "The type of the entity that the assignment applies to.", - "required": true, - "options": "Account, AccountGroup", - "min_length": 7, - "max_length": 12, - "matches": "^[a-zA-Z-]+$" - }, + } + ], + "ibm_iam_access_group_template_assignment": [ { "name": "account_id", "type": "TypeString", @@ -114248,13 +118286,9 @@ "computed": true }, { - "name": "target", + "name": "etag", "type": "TypeString", - "description": "The ID of the entity that the assignment applies to.", - "required": true, - "min_length": 1, - "max_length": 50, - "matches": "^[a-zA-Z0-9_-]+$" + "computed": true }, { "name": "created_by_id", @@ -114263,9 +118297,9 @@ "computed": true }, { - "name": "last_modified_by_id", + "name": "last_modified_at", "type": "TypeString", - "description": "The user or system that last updated the assignment.", + "description": "The date and time when the assignment was last updated.", "computed": true }, { @@ -114278,19 +118312,22 @@ "optional": true }, { - "name": "template_version", + "name": "template_id", "type": "TypeString", - "description": "The version of the template that the assignment is based on.", + "description": "The ID of the template that the assignment is based on.", "required": true, "min_length": 1, - "max_length": 2, - "matches": "^[0-9]+$" + "max_length": 100, + "matches": "^[a-zA-Z0-9_-]+$" }, { - "name": "operation", + "name": "target", "type": "TypeString", - "description": "The operation that the assignment applies to (e.g. 'assign', 'update', 'remove').", - "computed": true + "description": "The ID of the entity that the assignment applies to.", + "required": true, + "min_length": 1, + "max_length": 50, + "matches": "^[a-zA-Z0-9_-]+$" }, { "name": "href", @@ -114305,12 +118342,53 @@ "computed": true }, { - "name": "etag", + "name": "last_modified_by_id", + "type": "TypeString", + "description": "The user or system that last updated the assignment.", + "computed": true + }, + { + "name": "template_version", + "type": "TypeString", + "description": "The version of the template that the assignment is based on.", + "required": true, + "min_length": 1, + "max_length": 2, + "matches": "^[0-9]+$" + }, + { + "name": "target_type", + "type": "TypeString", + "description": "The type of the entity that the assignment applies to.", + "required": true, + "options": "Account, AccountGroup", + "min_length": 7, + "max_length": 12, + "matches": "^[a-zA-Z-]+$" + }, + { + "name": "operation", "type": "TypeString", + "description": "The operation that the assignment applies to (e.g. 'assign', 'update', 'remove').", "computed": true } ], "ibm_iam_access_group_template_version": [ + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time when the access group template was created.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the access group template.", + "min_length": 1, + "max_length": 100, + "matches": "^[a-zA-Z0-9!@#$%^\u0026*()_+{}:;\"'\u003c\u003e,.?\\/|\\-\\s]+$", + "optional": true + }, { "name": "policy_template_references", "type": "TypeList", @@ -114332,23 +118410,42 @@ } }, { - "name": "account_id", + "name": "created_by_id", "type": "TypeString", - "description": "The ID of the account to which the access group template is assigned.", + "description": "The ID of the user who created the access group template.", "computed": true }, { - "name": "created_at", + "name": "last_modified_at", "type": "TypeString", - "description": "The date and time when the access group template was created.", + "description": "The date and time when the access group template was last modified.", "computed": true }, { - "name": "created_by_id", + "name": "last_modified_by_id", "type": "TypeString", - "description": "The ID of the user who created the access group template.", + "description": "The ID of the user who last modified the access group template.", "computed": true }, + { + "name": "template_id", + "type": "TypeString", + "description": "ID of the template that you want to create a new version of.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 100, + "matches": "^[a-zA-Z0-9_-]+$" + }, + { + "name": "transaction_id", + "type": "TypeString", + "description": "An optional transaction id for the request.", + "min_length": 1, + "max_length": 50, + "matches": "^[a-zA-Z0-9_-]+$", + "optional": true + }, { "name": "description", "type": "TypeString", @@ -114553,20 +118650,11 @@ "max_items": 1 }, { - "name": "href", + "name": "account_id", "type": "TypeString", - "description": "The URL of the access group template resource.", + "description": "The ID of the account to which the access group template is assigned.", "computed": true }, - { - "name": "transaction_id", - "type": "TypeString", - "description": "An optional transaction id for the request.", - "min_length": 1, - "max_length": 50, - "matches": "^[a-zA-Z0-9_-]+$", - "optional": true - }, { "name": "version", "type": "TypeString", @@ -114581,56 +118669,32 @@ "computed": true }, { - "name": "last_modified_at", - "type": "TypeString", - "description": "The date and time when the access group template was last modified.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "ID of the template that you want to create a new version of.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 100, - "matches": "^[a-zA-Z0-9_-]+$" - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the access group template.", - "min_length": 1, - "max_length": 100, - "matches": "^[a-zA-Z0-9!@#$%^\u0026*()_+{}:;\"'\u003c\u003e,.?\\/|\\-\\s]+$", - "optional": true - }, - { - "name": "last_modified_by_id", + "name": "href", "type": "TypeString", - "description": "The ID of the user who last modified the access group template.", + "description": "The URL of the access group template resource.", "computed": true } ], "ibm_iam_account_settings": [ { - "name": "allowed_ip_addresses", + "name": "system_access_token_expiration_in_seconds", "type": "TypeString", - "description": "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", - "optional": true + "description": "Defines the access token expiration in seconds. Valid values: * Any whole number between '900' and '3600' * NOT_SET - To unset account setting and use service default.", + "optional": true, + "computed": true }, { - "name": "entity_tag", + "name": "restrict_create_service_id", "type": "TypeString", - "description": "Version of the account settings.", + "description": "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", + "options": "RESTRICTED, NOT_RESTRICTED, NOT_SET", "optional": true, "computed": true }, { - "name": "mfa", + "name": "session_expiration_in_seconds", "type": "TypeString", - "description": "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", - "options": "NONE, TOTP, TOTP4ALL, LEVEL1, LEVEL2, LEVEL3", + "description": "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", "optional": true, "computed": true }, @@ -114642,9 +118706,24 @@ "computed": true }, { - "name": "system_access_token_expiration_in_seconds", + "name": "include_history", + "type": "TypeBool", + "description": "Defines if the entity history is included in the response.", + "default_value": false, + "optional": true + }, + { + "name": "mfa", "type": "TypeString", - "description": "Defines the access token expiration in seconds. Valid values: * Any whole number between '900' and '3600' * NOT_SET - To unset account setting and use service default.", + "description": "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", + "options": "NONE, TOTP, TOTP4ALL, LEVEL1, LEVEL2, LEVEL3", + "optional": true, + "computed": true + }, + { + "name": "max_sessions_per_identity", + "type": "TypeString", + "description": "Defines the max allowed sessions per identity required by the account. Value values: * Any whole number greater than 0 * NOT_SET - To unset account setting and use service default.", "optional": true, "computed": true }, @@ -114657,10 +118736,9 @@ "computed": true }, { - "name": "if_match", + "name": "allowed_ip_addresses", "type": "TypeString", - "description": "Version of the account settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the account. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.", - "default_value": "*", + "description": "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", "optional": true }, { @@ -114691,10 +118769,17 @@ "computed": true }, { - "name": "include_history", - "type": "TypeBool", - "description": "Defines if the entity history is included in the response.", - "default_value": false, + "name": "entity_tag", + "type": "TypeString", + "description": "Version of the account settings.", + "optional": true, + "computed": true + }, + { + "name": "if_match", + "type": "TypeString", + "description": "Version of the account settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the account. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.", + "default_value": "*", "optional": true }, { @@ -114743,31 +118828,98 @@ "required": true } } + } + ], + "ibm_iam_account_settings_template": [ + { + "name": "account_id", + "type": "TypeString", + "description": "ID of the account where the template resides.", + "computed": true }, { - "name": "session_expiration_in_seconds", + "name": "version", + "type": "TypeInt", + "description": "Version of the the template.", + "computed": true + }, + { + "name": "history", + "type": "TypeList", + "description": "History of the Template.", + "computed": true, + "elem": { + "action": { + "name": "action", + "type": "TypeString", + "description": "Action of the history entry.", + "computed": true + }, + "iam_id": { + "name": "iam_id", + "type": "TypeString", + "description": "IAM ID of the identity which triggered the action.", + "computed": true + }, + "iam_id_account": { + "name": "iam_id_account", + "type": "TypeString", + "description": "Account of the identity which triggered the action.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "Message which summarizes the executed action.", + "computed": true + }, + "params": { + "name": "params", + "type": "TypeList", + "description": "Params of the history entry.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "timestamp": { + "name": "timestamp", + "type": "TypeString", + "description": "Timestamp when the action was triggered.", + "computed": true + } + } + }, + { + "name": "created_by_id", "type": "TypeString", - "description": "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", - "optional": true, + "description": "IAMid of the creator.", "computed": true }, { - "name": "restrict_create_service_id", + "name": "last_modified_at", "type": "TypeString", - "description": "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", - "options": "RESTRICTED, NOT_RESTRICTED, NOT_SET", - "optional": true, + "description": "Template last modified at.", "computed": true }, { - "name": "max_sessions_per_identity", + "name": "name", "type": "TypeString", - "description": "Defines the max allowed sessions per identity required by the account. Value values: * Any whole number greater than 0 * NOT_SET - To unset account setting and use service default.", - "optional": true, + "description": "The name of the trusted profile template. This is visible only in the enterprise account.", + "optional": true + }, + { + "name": "id", + "type": "TypeString", + "description": "ID of the the template resource.", "computed": true - } - ], - "ibm_iam_account_settings_template": [ + }, + { + "name": "entity_tag", + "type": "TypeString", + "description": "Entity tag for this templateId-version combination.", + "computed": true + }, { "name": "crn", "type": "TypeString", @@ -114776,10 +118928,10 @@ "computed": true }, { - "name": "description", + "name": "last_modified_by_id", "type": "TypeString", - "description": "The description of the trusted profile template. Describe the template for enterprise account users.", - "optional": true + "description": "IAMid of the identity that made the latest modification.", + "computed": true }, { "name": "account_settings", @@ -114864,94 +119016,10 @@ "max_items": 1 }, { - "name": "committed", - "type": "TypeBool", - "description": "Committed flag determines if the template is ready for assignment.", - "optional": true, - "computed": true - }, - { - "name": "entity_tag", - "type": "TypeString", - "description": "Entity tag for this templateId-version combination.", - "computed": true - }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "IAMid of the creator.", - "computed": true - }, - { - "name": "last_modified_at", - "type": "TypeString", - "description": "Template last modified at.", - "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAMid of the identity that made the latest modification.", - "computed": true - }, - { - "name": "account_id", + "name": "description", "type": "TypeString", - "description": "ID of the account where the template resides.", - "computed": true - }, - { - "name": "version", - "type": "TypeInt", - "description": "Version of the the template.", - "computed": true - }, - { - "name": "history", - "type": "TypeList", - "description": "History of the Template.", - "computed": true, - "elem": { - "action": { - "name": "action", - "type": "TypeString", - "description": "Action of the history entry.", - "computed": true - }, - "iam_id": { - "name": "iam_id", - "type": "TypeString", - "description": "IAM ID of the identity which triggered the action.", - "computed": true - }, - "iam_id_account": { - "name": "iam_id_account", - "type": "TypeString", - "description": "Account of the identity which triggered the action.", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "Message which summarizes the executed action.", - "computed": true - }, - "params": { - "name": "params", - "type": "TypeList", - "description": "Params of the history entry.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "timestamp": { - "name": "timestamp", - "type": "TypeString", - "description": "Timestamp when the action was triggered.", - "computed": true - } - } + "description": "The description of the trusted profile template. Describe the template for enterprise account users.", + "optional": true }, { "name": "template_id", @@ -114960,9 +119028,10 @@ "optional": true }, { - "name": "id", - "type": "TypeString", - "description": "ID of the the template resource.", + "name": "committed", + "type": "TypeBool", + "description": "Committed flag determines if the template is ready for assignment.", + "optional": true, "computed": true }, { @@ -114970,21 +119039,26 @@ "type": "TypeString", "description": "Template Created At.", "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name of the trusted profile template. This is visible only in the enterprise account.", - "optional": true } ], "ibm_iam_account_settings_template_assignment": [ { - "name": "target_type", + "name": "template_id", "type": "TypeString", - "description": "Assignment target type.", - "required": true, - "options": "Account, AccountGroup" + "description": "Template Id.", + "required": true + }, + { + "name": "target", + "type": "TypeString", + "description": "Assignment target.", + "required": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "Enterprise account Id.", + "computed": true }, { "name": "resources", @@ -115059,6 +119133,13 @@ } } }, + { + "name": "target_type", + "type": "TypeString", + "description": "Assignment target type.", + "required": true, + "options": "Account, AccountGroup" + }, { "name": "history", "type": "TypeList", @@ -115107,41 +119188,23 @@ } }, { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAMid of the identity that last modified the assignment.", - "computed": true - }, - { - "name": "account_id", - "type": "TypeString", - "description": "Enterprise account Id.", - "computed": true - }, - { - "name": "status", + "name": "created_by_id", "type": "TypeString", - "description": "Assignment status.", + "description": "IAMid of the identity that created the assignment.", "computed": true }, { - "name": "created_at", + "name": "last_modified_at", "type": "TypeString", - "description": "Assignment created at.", + "description": "Assignment modified at.", "computed": true }, { - "name": "created_by_id", + "name": "entity_tag", "type": "TypeString", - "description": "IAMid of the identity that created the assignment.", + "description": "Entity tag for this assignment record.", "computed": true }, - { - "name": "template_version", - "type": "TypeInt", - "description": "Template version.", - "required": true - }, { "name": "context", "type": "TypeList", @@ -115217,54 +119280,49 @@ } }, { - "name": "href", + "name": "status", "type": "TypeString", - "description": "Href.", + "description": "Assignment status.", "computed": true }, { - "name": "entity_tag", - "type": "TypeString", - "description": "Entity tag for this assignment record.", - "computed": true + "name": "template_version", + "type": "TypeInt", + "description": "Template version.", + "required": true }, { - "name": "template_id", + "name": "href", "type": "TypeString", - "description": "Template Id.", - "required": true + "description": "Href.", + "computed": true }, { - "name": "target", + "name": "created_at", "type": "TypeString", - "description": "Assignment target.", - "required": true + "description": "Assignment created at.", + "computed": true }, { - "name": "last_modified_at", + "name": "last_modified_by_id", "type": "TypeString", - "description": "Assignment modified at.", + "description": "IAMid of the identity that last modified the assignment.", "computed": true } ], "ibm_iam_api_key": [ { - "name": "apikey_id", + "name": "file", "type": "TypeString", - "description": "Unique identifier of this API Key.", - "computed": true - }, - { - "name": "locked", - "type": "TypeBool", - "description": "The API key cannot be changed if set to true.", - "computed": true + "description": "File where api key is to be stored", + "optional": true }, { - "name": "created_at", + "name": "entity_lock", "type": "TypeString", - "description": "If set contains a date time string of the creation date in ISO format.", - "computed": true + "description": "Indicates if the API key is locked for further write operations. False by default.", + "default_value": "false", + "optional": true }, { "name": "modified_at", @@ -115273,12 +119331,16 @@ "computed": true }, { - "name": "apikey", + "name": "name", "type": "TypeString", - "description": "You can optionally passthrough the API key value for this API key. If passed, NO validation of that apiKey value is done, i.e. the value can be non-URL safe. If omitted, the API key management will create an URL safe opaque API key value. The value of the API key is checked for uniqueness. Please ensure enough variations when passing in this value.", - "secure": true, - "optional": true, - "computed": true + "description": "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", + "optional": true }, { "name": "store_value", @@ -115287,97 +119349,96 @@ "optional": true }, { - "name": "created_by", + "name": "entity_tag", "type": "TypeString", - "description": "IAM ID of the user or service which created the API key.", + "description": "Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.", "computed": true }, { - "name": "account_id", + "name": "created_at", "type": "TypeString", - "description": "The account ID of the API key.", + "description": "If set contains a date time string of the creation date in ISO format.", "computed": true }, { - "name": "crn", + "name": "iam_id", "type": "TypeString", - "description": "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'.", - "cloud_data_type": "crn", + "description": "The iam_id that this API key authenticates.", "computed": true }, { - "name": "entity_lock", + "name": "account_id", "type": "TypeString", - "description": "Indicates if the API key is locked for further write operations. False by default.", - "default_value": "false", - "optional": true + "description": "The account ID of the API key.", + "computed": true }, { - "name": "iam_id", + "name": "apikey_id", "type": "TypeString", - "description": "The iam_id that this API key authenticates.", + "description": "Unique identifier of this API Key.", "computed": true }, { - "name": "description", - "type": "TypeString", - "description": "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", - "optional": true + "name": "locked", + "type": "TypeBool", + "description": "The API key cannot be changed if set to true.", + "computed": true }, { - "name": "entity_tag", + "name": "created_by", "type": "TypeString", - "description": "Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.", + "description": "IAM ID of the user or service which created the API key.", "computed": true }, { - "name": "name", + "name": "apikey", "type": "TypeString", - "description": "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", - "required": true + "description": "You can optionally passthrough the API key value for this API key. If passed, NO validation of that apiKey value is done, i.e. the value can be non-URL safe. If omitted, the API key management will create an URL safe opaque API key value. The value of the API key is checked for uniqueness. Please ensure enough variations when passing in this value.", + "secure": true, + "optional": true, + "computed": true }, { - "name": "file", + "name": "crn", "type": "TypeString", - "description": "File where api key is to be stored", - "optional": true + "description": "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'.", + "cloud_data_type": "crn", + "computed": true } ], "ibm_iam_authorization_policy": [ { - "name": "target_resource_type", + "name": "target_resource_group_id", "type": "TypeString", - "description": "Resource type of target service", + "description": "The target resource group Id", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true, + "cloud_data_range": [ + "resolved_to:id" + ] + }, + { + "name": "source_resource_type", + "type": "TypeString", + "description": "Resource type of source service", "immutable": true, "optional": true, "computed": true }, { - "name": "subject_attributes", - "type": "TypeSet", - "description": "Set subject attributes.", + "name": "source_service_account", + "type": "TypeString", + "description": "Account GUID of source service", "immutable": true, "optional": true, - "computed": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of attribute.", - "required": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value of attribute.", - "required": true - } - } + "computed": true }, { - "name": "resource_attributes", + "name": "subject_attributes", "type": "TypeSet", - "description": "Set resource attributes.", + "description": "Set subject attributes.", "immutable": true, "optional": true, "computed": true, @@ -115388,13 +119449,6 @@ "description": "Name of attribute.", "required": true }, - "operator": { - "name": "operator", - "type": "TypeString", - "description": "Operator of attribute.", - "default_value": "stringEquals", - "optional": true - }, "value": { "name": "value", "type": "TypeString", @@ -115411,17 +119465,17 @@ "computed": true }, { - "name": "source_service_name", + "name": "target_service_name", "type": "TypeString", - "description": "The source service name", + "description": "The target service name", "immutable": true, "optional": true, "computed": true }, { - "name": "source_resource_type", + "name": "target_resource_type", "type": "TypeString", - "description": "Resource type of source service", + "description": "Resource type of target service", "immutable": true, "optional": true, "computed": true @@ -115433,16 +119487,28 @@ "optional": true }, { - "name": "target_service_name", + "name": "roles", + "type": "TypeList", + "description": "Role names of the policy definition", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "source_resource_instance_id", "type": "TypeString", - "description": "The target service name", + "description": "The source resource instance Id", "immutable": true, "optional": true, "computed": true }, { - "name": "version", + "name": "target_resource_instance_id", "type": "TypeString", + "description": "The target resource instance Id", + "immutable": true, + "optional": true, "computed": true }, { @@ -115458,49 +119524,46 @@ ] }, { - "name": "source_resource_instance_id", - "type": "TypeString", - "description": "The source resource instance Id", + "name": "resource_attributes", + "type": "TypeSet", + "description": "Set resource attributes.", "immutable": true, "optional": true, - "computed": true + "computed": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of attribute.", + "required": true + }, + "operator": { + "name": "operator", + "type": "TypeString", + "description": "Operator of attribute.", + "default_value": "stringEquals", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value of attribute.", + "required": true + } + } }, { - "name": "target_resource_instance_id", + "name": "source_service_name", "type": "TypeString", - "description": "The target resource instance Id", + "description": "The source service name", "immutable": true, "optional": true, "computed": true }, { - "name": "source_service_account", + "name": "version", "type": "TypeString", - "description": "Account GUID of source service", - "immutable": true, - "optional": true, "computed": true - }, - { - "name": "roles", - "type": "TypeList", - "description": "Role names of the policy definition", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "target_resource_group_id", - "type": "TypeString", - "description": "The target resource group Id", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true, - "cloud_data_range": [ - "resolved_to:id" - ] } ], "ibm_iam_authorization_policy_detach": [ @@ -115514,31 +119577,22 @@ ], "ibm_iam_custom_role": [ { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "display_name", + "name": "name", "type": "TypeString", - "description": "Display Name of the Custom Role", + "description": "The name of the custom Role", + "immutable": true, "required": true, "min_length": 1, - "max_length": 50 + "max_length": 30, + "matches": "^[A-Z]{1}[A-Za-z0-9]{0,29}$" }, { - "name": "crn", + "name": "description", "type": "TypeString", - "description": "crn of the Custom Role", - "cloud_data_type": "crn", - "computed": true + "description": "The description of the role", + "min_length": 1, + "max_length": 250, + "optional": true }, { "name": "service", @@ -115556,6 +119610,18 @@ "type": "TypeString" } }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, { "name": "resource_controller_url", "type": "TypeString", @@ -115563,22 +119629,19 @@ "computed": true }, { - "name": "name", + "name": "display_name", "type": "TypeString", - "description": "The name of the custom Role", - "immutable": true, + "description": "Display Name of the Custom Role", "required": true, "min_length": 1, - "max_length": 30, - "matches": "^[A-Z]{1}[A-Za-z0-9]{0,29}$" + "max_length": 50 }, { - "name": "description", + "name": "crn", "type": "TypeString", - "description": "The description of the role", - "min_length": 1, - "max_length": 250, - "optional": true + "description": "crn of the Custom Role", + "cloud_data_type": "crn", + "computed": true } ], "ibm_iam_policy_template": [ @@ -115757,37 +119820,6 @@ } ], "ibm_iam_policy_template_version": [ - { - "name": "committed", - "type": "TypeBool", - "description": "Template version committed status.", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "optional": true, - "computed": true - }, - { - "name": "account_id", - "type": "TypeString", - "computed": true - }, - { - "name": "version", - "type": "TypeString", - "description": "Template Version.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "The policy template ID and Version.", - "required": true, - "min_length": 1, - "max_length": 51 - }, { "name": "policy", "type": "TypeList", @@ -115927,20 +119959,60 @@ "type": "TypeString", "description": "description of template purpose.", "optional": true + }, + { + "name": "committed", + "type": "TypeBool", + "description": "Template version committed status.", + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "optional": true, + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Template Version.", + "computed": true + }, + { + "name": "template_id", + "type": "TypeString", + "description": "The policy template ID and Version.", + "required": true, + "min_length": 1, + "max_length": 51 } ], "ibm_iam_service_api_key": [ { - "name": "created_at", + "name": "iam_service_id", "type": "TypeString", - "description": "The date and time Service API Key was created", - "computed": true + "description": "The service iam_id that this API key authenticates", + "cloud_data_type": "iam", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:service_id", + "resolved_to:id" + ] }, { - "name": "locked", - "type": "TypeBool", - "description": "The API key cannot be changed if set to true", - "optional": true + "name": "apikey", + "type": "TypeString", + "description": "API key value for this API key", + "secure": true, + "immutable": true, + "optional": true, + "computed": true }, { "name": "store_value", @@ -115948,6 +120020,12 @@ "description": "Boolean value deciding whether API key value is retrievable in the future", "optional": true }, + { + "name": "file", + "type": "TypeString", + "description": "File where api key is to be stored", + "optional": true + }, { "name": "crn", "type": "TypeString", @@ -115961,18 +120039,6 @@ "description": "Version of the API Key details object", "computed": true }, - { - "name": "created_by", - "type": "TypeString", - "description": "IAM ID of the service which created the API key", - "computed": true - }, - { - "name": "file", - "type": "TypeString", - "description": "File where api key is to be stored", - "optional": true - }, { "name": "modified_at", "type": "TypeString", @@ -115993,40 +120059,31 @@ "computed": true }, { - "name": "iam_service_id", + "name": "account_id", "type": "TypeString", - "description": "The service iam_id that this API key authenticates", - "cloud_data_type": "iam", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:service_id", - "resolved_to:id" - ] + "description": "The account ID of the API key", + "computed": true }, { - "name": "account_id", + "name": "locked", + "type": "TypeBool", + "description": "The API key cannot be changed if set to true", + "optional": true + }, + { + "name": "created_by", "type": "TypeString", - "description": "The account ID of the API key", + "description": "IAM ID of the service which created the API key", "computed": true }, { - "name": "apikey", + "name": "created_at", "type": "TypeString", - "description": "API key value for this API key", - "secure": true, - "immutable": true, - "optional": true, + "description": "The date and time Service API Key was created", "computed": true } ], "ibm_iam_service_id": [ - { - "name": "description", - "type": "TypeString", - "description": "Description of the serviceID", - "optional": true - }, { "name": "version", "type": "TypeString", @@ -116065,50 +120122,35 @@ "type": "TypeString", "description": "Name of the serviceID", "required": true - } - ], - "ibm_iam_service_policy": [ - { - "name": "rule_conditions", - "type": "TypeSet", - "description": "Rule conditions enforced by the policy", - "optional": true, - "elem": { - "key": { - "name": "key", - "type": "TypeString", - "description": "Key of the condition", - "required": true - }, - "operator": { - "name": "operator", - "type": "TypeString", - "description": "Operator of the condition", - "required": true - }, - "value": { - "name": "value", - "type": "TypeList", - "description": "Value of the condition", - "required": true, - "elem": { - "type": "TypeString" - } - } - } }, { - "name": "rule_operator", + "name": "description", "type": "TypeString", - "description": "Operator that multiple rule conditions are evaluated over", + "description": "Description of the serviceID", "optional": true - }, + } + ], + "ibm_iam_service_policy": [ { - "name": "iam_id", + "name": "iam_service_id", "type": "TypeString", - "description": "IAM ID of ServiceID", + "description": "UUID of ServiceID", + "cloud_data_type": "iam", "immutable": true, - "optional": true + "optional": true, + "cloud_data_range": [ + "service:service_id", + "resolved_to:id" + ] + }, + { + "name": "roles", + "type": "TypeList", + "description": "Role names of the policy definition", + "required": true, + "elem": { + "type": "TypeString" + } }, { "name": "resources", @@ -116174,23 +120216,9 @@ "max_items": 1 }, { - "name": "account_management", - "type": "TypeBool", - "description": "Give access to all account management services", - "default_value": false, - "optional": true - }, - { - "name": "transaction_id", - "type": "TypeString", - "description": "Set transactionID for debug", - "optional": true, - "computed": true - }, - { - "name": "resource_tags", + "name": "resource_attributes", "type": "TypeSet", - "description": "Set access management tags.", + "description": "Set resource attributes.", "optional": true, "elem": { "name": { @@ -116214,6 +120242,15 @@ } } }, + { + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "description", "type": "TypeString", @@ -116227,30 +120264,23 @@ "optional": true }, { - "name": "iam_service_id", + "name": "iam_id", "type": "TypeString", - "description": "UUID of ServiceID", - "cloud_data_type": "iam", + "description": "IAM ID of ServiceID", "immutable": true, - "optional": true, - "cloud_data_range": [ - "service:service_id", - "resolved_to:id" - ] + "optional": true }, { - "name": "roles", - "type": "TypeList", - "description": "Role names of the policy definition", - "required": true, - "elem": { - "type": "TypeString" - } + "name": "account_management", + "type": "TypeBool", + "description": "Give access to all account management services", + "default_value": false, + "optional": true }, { - "name": "resource_attributes", + "name": "resource_tags", "type": "TypeSet", - "description": "Set resource attributes.", + "description": "Set access management tags.", "optional": true, "elem": { "name": { @@ -116275,13 +120305,46 @@ } }, { - "name": "tags", + "name": "transaction_id", + "type": "TypeString", + "description": "Set transactionID for debug", + "optional": true, + "computed": true + }, + { + "name": "rule_conditions", "type": "TypeSet", - "cloud_data_type": "tags", + "description": "Rule conditions enforced by the policy", "optional": true, "elem": { - "type": "TypeString" + "key": { + "name": "key", + "type": "TypeString", + "description": "Key of the condition", + "required": true + }, + "operator": { + "name": "operator", + "type": "TypeString", + "description": "Operator of the condition", + "required": true + }, + "value": { + "name": "value", + "type": "TypeList", + "description": "Value of the condition", + "required": true, + "elem": { + "type": "TypeString" + } + } } + }, + { + "name": "rule_operator", + "type": "TypeString", + "description": "Operator that multiple rule conditions are evaluated over", + "optional": true } ], "ibm_iam_trusted_profile": [ @@ -116293,27 +120356,15 @@ "computed": true }, { - "name": "template_id", - "type": "TypeString", - "description": "Template id the profile was created from.", - "computed": true - }, - { - "name": "assignment_id", + "name": "created_at", "type": "TypeString", - "description": "Id of assignment that assigned the template.", + "description": "If set contains a date time string of the creation date in ISO format.", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.", - "required": true - }, - { - "name": "account_id", + "name": "iam_id", "type": "TypeString", - "description": "The account ID of the trusted profile.", + "description": "The iam_id of this trusted profile.", "computed": true }, { @@ -116370,21 +120421,15 @@ } }, { - "name": "description", - "type": "TypeString", - "description": "The optional description of the trusted profile. The 'description' property is only available if a description was provided during creation of trusted profile.", - "optional": true - }, - { - "name": "iam_id", + "name": "name", "type": "TypeString", - "description": "The iam_id of this trusted profile.", - "computed": true + "description": "Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.", + "required": true }, { - "name": "modified_at", + "name": "account_id", "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", + "description": "The account ID of the trusted profile.", "computed": true }, { @@ -116393,12 +120438,6 @@ "description": "Unique identifier of this trusted profile.", "computed": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "If set contains a date time string of the creation date in ISO format.", - "computed": true - }, { "name": "entity_tag", "type": "TypeString", @@ -116410,33 +120449,33 @@ "type": "TypeInt", "description": "IMS acount ID of the trusted profile.", "computed": true - } - ], - "ibm_iam_trusted_profile_claim_rule": [ + }, { - "name": "rule_id", + "name": "description", "type": "TypeString", - "description": "Unique identifier of this claim rule.", - "computed": true + "description": "The optional description of the trusted profile. The 'description' property is only available if a description was provided during creation of trusted profile.", + "optional": true }, { - "name": "type", + "name": "modified_at", "type": "TypeString", - "description": "Type of the calim rule, either 'Profile-SAML' or 'Profile-CR'.", - "required": true + "description": "If set contains a date time string of the last modification date in ISO format.", + "computed": true }, { - "name": "name", + "name": "template_id", "type": "TypeString", - "description": "Name of the claim rule to be created or updated.", - "optional": true + "description": "Template id the profile was created from.", + "computed": true }, { - "name": "realm_name", + "name": "assignment_id", "type": "TypeString", - "description": "The realm name of the Idp this claim rule applies to. This field is required only if the type is specified as 'Profile-SAML'.", - "optional": true - }, + "description": "Id of assignment that assigned the template.", + "computed": true + } + ], + "ibm_iam_trusted_profile_claim_rule": [ { "name": "cr_type", "type": "TypeString", @@ -116462,16 +120501,22 @@ "computed": true }, { - "name": "profile_id", + "name": "modified_at", "type": "TypeString", - "description": "ID of the trusted profile to create a claim rule.", - "cloud_data_type": "iam", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:trusted_profile", - "resolved_to:id" - ] + "description": "If set contains a date time string of the last modification date in ISO format.", + "computed": true + }, + { + "name": "rule_id", + "type": "TypeString", + "description": "Unique identifier of this claim rule.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name of the claim rule to be created or updated.", + "optional": true }, { "name": "conditions", @@ -116500,10 +120545,28 @@ } }, { - "name": "modified_at", + "name": "realm_name", + "type": "TypeString", + "description": "The realm name of the Idp this claim rule applies to. This field is required only if the type is specified as 'Profile-SAML'.", + "optional": true + }, + { + "name": "profile_id", + "type": "TypeString", + "description": "ID of the trusted profile to create a claim rule.", + "cloud_data_type": "iam", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:trusted_profile", + "resolved_to:id" + ] + }, + { + "name": "type", "type": "TypeString", - "description": "If set contains a date time string of the last modification date in ISO format.", - "computed": true + "description": "Type of the calim rule, either 'Profile-SAML' or 'Profile-CR'.", + "required": true } ], "ibm_iam_trusted_profile_identity": [ @@ -116637,55 +120700,6 @@ } ], "ibm_iam_trusted_profile_policy": [ - { - "name": "resource_attributes", - "type": "TypeSet", - "description": "Set resource attributes.", - "optional": true, - "elem": { - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of attribute.", - "required": true - }, - "operator": { - "name": "operator", - "type": "TypeString", - "description": "Operator of attribute.", - "default_value": "stringEquals", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value of attribute.", - "required": true - } - } - }, - { - "name": "account_management", - "type": "TypeBool", - "description": "Give access to all account management services", - "default_value": false, - "optional": true - }, - { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "description", - "type": "TypeString", - "description": "Description of the Policy", - "optional": true - }, { "name": "profile_id", "type": "TypeString", @@ -116698,22 +120712,6 @@ "resolved_to:id" ] }, - { - "name": "iam_id", - "type": "TypeString", - "description": "IAM ID of Trusted Profile", - "immutable": true, - "optional": true - }, - { - "name": "roles", - "type": "TypeList", - "description": "Role names of the policy definition", - "required": true, - "elem": { - "type": "TypeString" - } - }, { "name": "resources", "type": "TypeList", @@ -116777,6 +120775,40 @@ }, "max_items": 1 }, + { + "name": "resource_attributes", + "type": "TypeSet", + "description": "Set resource attributes.", + "optional": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of attribute.", + "required": true + }, + "operator": { + "name": "operator", + "type": "TypeString", + "description": "Operator of attribute.", + "default_value": "stringEquals", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value of attribute.", + "required": true + } + } + }, + { + "name": "transaction_id", + "type": "TypeString", + "description": "Set transactionID for debug", + "optional": true, + "computed": true + }, { "name": "rule_conditions", "type": "TypeSet", @@ -116807,17 +120839,43 @@ } }, { - "name": "rule_operator", + "name": "pattern", "type": "TypeString", - "description": "Operator that multiple rule conditions are evaluated over", + "description": "Pattern rule follows for time-based condition", "optional": true }, { - "name": "pattern", + "name": "iam_id", "type": "TypeString", - "description": "Pattern rule follows for time-based condition", + "description": "IAM ID of Trusted Profile", + "immutable": true, + "optional": true + }, + { + "name": "roles", + "type": "TypeList", + "description": "Role names of the policy definition", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "account_management", + "type": "TypeBool", + "description": "Give access to all account management services", + "default_value": false, "optional": true }, + { + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "resource_tags", "type": "TypeSet", @@ -116846,20 +120904,68 @@ } }, { - "name": "transaction_id", + "name": "description", "type": "TypeString", - "description": "Set transactionID for debug", - "optional": true, - "computed": true + "description": "Description of the Policy", + "optional": true + }, + { + "name": "rule_operator", + "type": "TypeString", + "description": "Operator that multiple rule conditions are evaluated over", + "optional": true } ], "ibm_iam_trusted_profile_template": [ + { + "name": "last_modified_at", + "type": "TypeString", + "description": "Timestamp of when the template was last modified.", + "computed": true + }, { "name": "description", "type": "TypeString", "description": "The description of the trusted profile template. Describe the template for enterprise account users.", "optional": true }, + { + "name": "template_id", + "type": "TypeString", + "description": "ID of the the template.", + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Cloud resource name.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "last_modified_by_id", + "type": "TypeString", + "description": "IAMid of the identity that made the latest modification.", + "computed": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "ID of the account where the template resides.", + "computed": true + }, + { + "name": "version", + "type": "TypeInt", + "description": "Version of the the template.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Timestamp of when the template was created.", + "computed": true + }, { "name": "policy_template_references", "type": "TypeList", @@ -116880,24 +120986,6 @@ } } }, - { - "name": "created_at", - "type": "TypeString", - "description": "Timestamp of when the template was created.", - "computed": true - }, - { - "name": "template_id", - "type": "TypeString", - "description": "ID of the the template.", - "optional": true - }, - { - "name": "id", - "type": "TypeString", - "description": "ID of the the template.", - "computed": true - }, { "name": "entity_tag", "type": "TypeString", @@ -116905,28 +120993,16 @@ "computed": true }, { - "name": "last_modified_at", - "type": "TypeString", - "description": "Timestamp of when the template was last modified.", - "computed": true - }, - { - "name": "account_id", + "name": "created_by_id", "type": "TypeString", - "description": "ID of the account where the template resides.", - "computed": true - }, - { - "name": "version", - "type": "TypeInt", - "description": "Version of the the template.", + "description": "IAMid of the creator.", "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "Cloud resource name.", - "cloud_data_type": "crn", + "name": "committed", + "type": "TypeBool", + "description": "Committed flag determines if the template is ready for assignment.", + "optional": true, "computed": true }, { @@ -116976,18 +121052,6 @@ } } }, - { - "name": "created_by_id", - "type": "TypeString", - "description": "IAMid of the creator.", - "computed": true - }, - { - "name": "last_modified_by_id", - "type": "TypeString", - "description": "IAMid of the identity that made the latest modification.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -117115,31 +121179,111 @@ "max_items": 1 }, { - "name": "committed", - "type": "TypeBool", - "description": "Committed flag determines if the template is ready for assignment.", - "optional": true, + "name": "id", + "type": "TypeString", + "description": "ID of the the template.", "computed": true } ], "ibm_iam_trusted_profile_template_assignment": [ { - "name": "created_at", + "name": "entity_tag", "type": "TypeString", - "description": "Assignment created at.", + "description": "Entity tag for this assignment record.", "computed": true }, { - "name": "created_by_id", + "name": "template_version", + "type": "TypeInt", + "description": "Template version.", + "required": true + }, + { + "name": "target_type", "type": "TypeString", - "description": "IAMid of the identity that created the assignment.", - "computed": true + "description": "Assignment target type.", + "required": true, + "options": "Account, AccountGroup" }, { - "name": "template_id", + "name": "context", + "type": "TypeList", + "description": "Context with key properties for problem determination.", + "computed": true, + "elem": { + "cluster_name": { + "name": "cluster_name", + "type": "TypeString", + "description": "The cluster name.", + "computed": true + }, + "elapsed_time": { + "name": "elapsed_time", + "type": "TypeString", + "description": "The elapsed time in msec.", + "computed": true + }, + "end_time": { + "name": "end_time", + "type": "TypeString", + "description": "The finish time of the request.", + "computed": true + }, + "host": { + "name": "host", + "type": "TypeString", + "description": "The host of the server instance processing the request.", + "computed": true + }, + "instance_id": { + "name": "instance_id", + "type": "TypeString", + "description": "The instance ID of the server instance processing the request.", + "computed": true + }, + "operation": { + "name": "operation", + "type": "TypeString", + "description": "The operation of the inbound REST request.", + "computed": true + }, + "start_time": { + "name": "start_time", + "type": "TypeString", + "description": "The start time of the request.", + "computed": true + }, + "thread_id": { + "name": "thread_id", + "type": "TypeString", + "description": "The thread ID of the server instance processing the request.", + "computed": true + }, + "transaction_id": { + "name": "transaction_id", + "type": "TypeString", + "description": "The transaction ID of the inbound REST request.", + "computed": true + }, + "url": { + "name": "url", + "type": "TypeString", + "description": "The URL of that cluster.", + "computed": true + }, + "user_agent": { + "name": "user_agent", + "type": "TypeString", + "description": "The user agent of the inbound REST request.", + "computed": true + } + } + }, + { + "name": "account_id", "type": "TypeString", - "description": "Template Id.", - "required": true + "description": "Enterprise account Id.", + "computed": true }, { "name": "status", @@ -117352,21 +121496,15 @@ } }, { - "name": "template_version", - "type": "TypeInt", - "description": "Template version.", - "required": true - }, - { - "name": "target", + "name": "href", "type": "TypeString", - "description": "Assignment target.", - "required": true + "description": "Href.", + "computed": true }, { - "name": "last_modified_at", + "name": "created_at", "type": "TypeString", - "description": "Assignment modified at.", + "description": "Assignment created at.", "computed": true }, { @@ -117376,106 +121514,40 @@ "computed": true }, { - "name": "account_id", + "name": "created_by_id", "type": "TypeString", - "description": "Enterprise account Id.", + "description": "IAMid of the identity that created the assignment.", "computed": true }, { - "name": "href", + "name": "last_modified_at", "type": "TypeString", - "description": "Href.", + "description": "Assignment modified at.", "computed": true }, { - "name": "entity_tag", + "name": "template_id", "type": "TypeString", - "description": "Entity tag for this assignment record.", - "computed": true + "description": "Template Id.", + "required": true }, { - "name": "target_type", + "name": "target", "type": "TypeString", - "description": "Assignment target type.", - "required": true, - "options": "Account, AccountGroup" - }, - { - "name": "context", - "type": "TypeList", - "description": "Context with key properties for problem determination.", - "computed": true, - "elem": { - "cluster_name": { - "name": "cluster_name", - "type": "TypeString", - "description": "The cluster name.", - "computed": true - }, - "elapsed_time": { - "name": "elapsed_time", - "type": "TypeString", - "description": "The elapsed time in msec.", - "computed": true - }, - "end_time": { - "name": "end_time", - "type": "TypeString", - "description": "The finish time of the request.", - "computed": true - }, - "host": { - "name": "host", - "type": "TypeString", - "description": "The host of the server instance processing the request.", - "computed": true - }, - "instance_id": { - "name": "instance_id", - "type": "TypeString", - "description": "The instance ID of the server instance processing the request.", - "computed": true - }, - "operation": { - "name": "operation", - "type": "TypeString", - "description": "The operation of the inbound REST request.", - "computed": true - }, - "start_time": { - "name": "start_time", - "type": "TypeString", - "description": "The start time of the request.", - "computed": true - }, - "thread_id": { - "name": "thread_id", - "type": "TypeString", - "description": "The thread ID of the server instance processing the request.", - "computed": true - }, - "transaction_id": { - "name": "transaction_id", - "type": "TypeString", - "description": "The transaction ID of the inbound REST request.", - "computed": true - }, - "url": { - "name": "url", - "type": "TypeString", - "description": "The URL of that cluster.", - "computed": true - }, - "user_agent": { - "name": "user_agent", - "type": "TypeString", - "description": "The user agent of the inbound REST request.", - "computed": true - } - } + "description": "Assignment target.", + "required": true } ], "ibm_iam_user_invite": [ + { + "name": "users", + "type": "TypeSet", + "description": "List of ibm id or email of user", + "required": true, + "elem": { + "type": "TypeString" + } + }, { "name": "access_groups", "type": "TypeList", @@ -117811,72 +121883,55 @@ } } } - }, - { - "name": "users", - "type": "TypeSet", - "description": "List of ibm id or email of user", - "required": true, - "elem": { - "type": "TypeString" - } } ], "ibm_iam_user_policy": [ { - "name": "rule_operator", - "type": "TypeString", - "description": "Operator that multiple rule conditions are evaluated over", + "name": "account_management", + "type": "TypeBool", + "description": "Give access to all account management services", + "default_value": false, "optional": true }, { - "name": "ibm_id", + "name": "description", "type": "TypeString", - "description": "The ibm id or email of user", - "immutable": true, - "required": true - }, - { - "name": "roles", - "type": "TypeList", - "description": "Role names of the policy definition", - "required": true, - "elem": { - "type": "TypeString" - } + "description": "Description of the Policy", + "optional": true }, { - "name": "resource_attributes", + "name": "rule_conditions", "type": "TypeSet", - "description": "Set resource attributes.", + "description": "Rule conditions enforced by the policy", "optional": true, "elem": { - "name": { - "name": "name", + "key": { + "name": "key", "type": "TypeString", - "description": "Name of attribute.", + "description": "Key of the condition", "required": true }, "operator": { "name": "operator", "type": "TypeString", - "description": "Operator of attribute.", - "default_value": "stringEquals", - "optional": true + "description": "Operator of the condition", + "required": true }, "value": { "name": "value", - "type": "TypeString", - "description": "Value of attribute.", - "required": true + "type": "TypeList", + "description": "Value of the condition", + "required": true, + "elem": { + "type": "TypeString" + } } } }, { - "name": "account_management", - "type": "TypeBool", - "description": "Give access to all account management services", - "default_value": false, + "name": "pattern", + "type": "TypeString", + "description": "Pattern rule follows for time-based condition", "optional": true }, { @@ -117916,17 +121971,34 @@ } }, { - "name": "description", + "name": "transaction_id", "type": "TypeString", - "description": "Description of the Policy", - "optional": true + "description": "Set transactionID for debug", + "optional": true, + "computed": true }, { - "name": "pattern", + "name": "rule_operator", "type": "TypeString", - "description": "Pattern rule follows for time-based condition", + "description": "Operator that multiple rule conditions are evaluated over", "optional": true }, + { + "name": "ibm_id", + "type": "TypeString", + "description": "The ibm id or email of user", + "immutable": true, + "required": true + }, + { + "name": "roles", + "type": "TypeList", + "description": "Role names of the policy definition", + "required": true, + "elem": { + "type": "TypeString" + } + }, { "name": "resources", "type": "TypeList", @@ -117991,43 +122063,41 @@ "max_items": 1 }, { - "name": "transaction_id", - "type": "TypeString", - "description": "Set transactionID for debug", - "optional": true, - "computed": true - }, - { - "name": "rule_conditions", + "name": "resource_attributes", "type": "TypeSet", - "description": "Rule conditions enforced by the policy", + "description": "Set resource attributes.", "optional": true, "elem": { - "key": { - "name": "key", + "name": { + "name": "name", "type": "TypeString", - "description": "Key of the condition", + "description": "Name of attribute.", "required": true }, "operator": { "name": "operator", "type": "TypeString", - "description": "Operator of the condition", - "required": true + "description": "Operator of attribute.", + "default_value": "stringEquals", + "optional": true }, "value": { "name": "value", - "type": "TypeList", - "description": "Value of the condition", - "required": true, - "elem": { - "type": "TypeString" - } + "type": "TypeString", + "description": "Value of attribute.", + "required": true } } } ], "ibm_iam_user_settings": [ + { + "name": "iam_id", + "type": "TypeString", + "description": "User's IAM ID or or email of user", + "immutable": true, + "required": true + }, { "name": "allowed_ip_addresses", "type": "TypeList", @@ -118036,35 +122106,9 @@ "elem": { "type": "TypeString" } - }, - { - "name": "iam_id", - "type": "TypeString", - "description": "User's IAM ID or or email of user", - "immutable": true, - "required": true } ], "ibm_ipsec_vpn": [ - { - "name": "datacenter", - "type": "TypeString", - "description": "Datacenter name", - "immutable": true, - "required": true - }, - { - "name": "preshared_key", - "type": "TypeString", - "description": "Preshared Key data", - "optional": true - }, - { - "name": "customer_peer_ip", - "type": "TypeString", - "description": "Customer Peer IP Address", - "optional": true - }, { "name": "internal_subnet_id", "type": "TypeInt", @@ -118072,10 +122116,28 @@ "optional": true }, { - "name": "remote_subnet_id", - "type": "TypeInt", - "description": "Remote subnet ID value", - "optional": true + "name": "remote_subnet", + "type": "TypeList", + "optional": true, + "elem": { + "account_id": { + "name": "account_id", + "type": "TypeInt", + "optional": true + }, + "remote_ip_adress": { + "name": "remote_ip_adress", + "type": "TypeString", + "required": true + }, + "remote_ip_cidr": { + "name": "remote_ip_cidr", + "type": "TypeString", + "required": true + } + }, + "max_items": 1, + "min_items": 1 }, { "name": "service_subnet_id", @@ -118084,14 +122146,11 @@ "optional": true }, { - "name": "internal_peer_ip_address", - "type": "TypeString", - "computed": true - }, - { - "name": "name", + "name": "datacenter", "type": "TypeString", - "computed": true + "description": "Datacenter name", + "immutable": true, + "required": true }, { "name": "phase_one", @@ -118184,67 +122243,51 @@ "min_items": 1 }, { - "name": "remote_subnet", - "type": "TypeList", - "optional": true, - "elem": { - "account_id": { - "name": "account_id", - "type": "TypeInt", - "optional": true - }, - "remote_ip_adress": { - "name": "remote_ip_adress", - "type": "TypeString", - "required": true - }, - "remote_ip_cidr": { - "name": "remote_ip_cidr", - "type": "TypeString", - "required": true - } - }, - "max_items": 1, - "min_items": 1 - } - ], - "ibm_is_backup_policy": [ + "name": "preshared_key", + "type": "TypeString", + "description": "Preshared Key data", + "optional": true + }, { - "name": "created_at", + "name": "customer_peer_ip", "type": "TypeString", - "description": "The date and time that the backup policy was created.", - "computed": true + "description": "Customer Peer IP Address", + "optional": true }, { - "name": "resource_type", + "name": "remote_subnet_id", + "type": "TypeInt", + "description": "Remote subnet ID value", + "optional": true + }, + { + "name": "internal_peer_ip_address", "type": "TypeString", - "description": "The resource type.", "computed": true }, + { + "name": "name", + "type": "TypeString", + "computed": true + } + ], + "ibm_is_backup_policy": [ { "name": "match_resource_types", "type": "TypeSet", "description": "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", - "min_length": 1, - "max_length": 128, - "matches": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$", "optional": true, "computed": true, "elem": { "type": "TypeString" - } + }, + "deprecated": "match_resource_types is being deprecated. Use match_resource_type instead" }, { - "name": "match_user_tags", - "type": "TypeSet", - "description": "The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will be subject to the backup policy.", - "required": true, - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "elem": { - "type": "TypeString" - } + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the backup policy was created.", + "computed": true }, { "name": "crn", @@ -118253,12 +122296,6 @@ "cloud_data_type": "crn", "computed": true }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this backup policy.", - "computed": true - }, { "name": "last_job_completed_at", "type": "TypeString", @@ -118272,18 +122309,40 @@ "computed": true }, { - "name": "version", - "type": "TypeString", - "computed": true + "name": "health_reasons", + "type": "TypeList", + "description": "The reasons for the current health_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } }, { - "name": "name", + "name": "match_resource_type", "type": "TypeString", - "description": "The user-defined name for this backup policy. Names must be unique within the region this backup policy resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "required": true, + "description": "A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy.", + "default_value": "volume", "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" + "max_length": 128, + "matches": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$", + "optional": true }, { "name": "resource_group", @@ -118293,38 +122352,36 @@ "immutable": true, "optional": true, "computed": true - } - ], - "ibm_is_backup_policy_plan": [ + }, { - "name": "copy_user_tags", - "type": "TypeBool", - "description": "Indicates whether to copy the source's user tags to the created backups (snapshots).", - "default_value": true, - "optional": true + "name": "version", + "type": "TypeString", + "computed": true }, { - "name": "clone_policy", + "name": "scope", "type": "TypeList", + "description": "The scope for this backup policy.", "optional": true, "computed": true, "elem": { - "max_snapshots": { - "name": "max_snapshots", - "type": "TypeInt", - "description": "The maximum number of recent snapshots (per source) that will keep clones.", - "optional": true, + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this enterprise.", + "optional": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this enterprise or account.", "computed": true }, - "zones": { - "name": "zones", - "type": "TypeSet", - "description": "The zone this backup policy plan will create snapshot clones in.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true } }, "max_items": 1 @@ -118332,80 +122389,32 @@ { "name": "name", "type": "TypeString", - "description": "The user-defined name for this backup policy plan. Names must be unique within the backup policy this plan resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "description": "The user-defined name for this backup policy. Names must be unique within the region this backup policy resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "required": true, "min_length": 1, "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", - "optional": true + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" }, { - "name": "created_at", + "name": "resource_type", "type": "TypeString", - "description": "The date and time that the backup policy plan was created.", + "description": "The resource type.", "computed": true }, { - "name": "backup_policy_id", - "type": "TypeString", - "description": "The backup policy identifier.", - "immutable": true, - "required": true - }, - { - "name": "backup_policy_plan_id", + "name": "health_state", "type": "TypeString", - "description": "The backup policy identifier.", - "computed": true - }, - { - "name": "active", - "type": "TypeBool", - "description": "Indicates whether the plan is active.", - "optional": true, + "description": "The health of this resource", "computed": true }, { - "name": "remote_region_policy", - "type": "TypeList", - "description": "Backup policy plan cross region rule.", - "optional": true, - "elem": { - "delete_over_count": { - "name": "delete_over_count", - "type": "TypeInt", - "description": "The maximum number of recent remote copies to keep in this region.", - "optional": true, - "computed": true - }, - "encryption_key": { - "name": "encryption_key", - "type": "TypeString", - "description": "The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", - "optional": true, - "computed": true - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "The globally unique name for this region.", - "required": true - } - } - }, - { - "name": "cron_spec", - "type": "TypeString", - "description": "The cron specification for the backup schedule.", - "required": true, - "min_length": 9, - "max_length": 63, - "matches": "^((((\\d+,)+\\d+|([\\d\\*]+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})$" - }, - { - "name": "attach_user_tags", + "name": "match_user_tags", "type": "TypeSet", - "description": "User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached.", - "optional": true, + "description": "The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will be subject to the backup policy.", + "required": true, + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "elem": { "type": "TypeString" } @@ -118413,13 +122422,22 @@ { "name": "href", "type": "TypeString", - "description": "The URL for this backup policy plan.", + "description": "The URL for this backup policy.", "computed": true + } + ], + "ibm_is_backup_policy_plan": [ + { + "name": "copy_user_tags", + "type": "TypeBool", + "description": "Indicates whether to copy the source's user tags to the created backups (snapshots).", + "default_value": true, + "optional": true }, { - "name": "lifecycle_state", + "name": "resource_type", "type": "TypeString", - "description": "The lifecycle state of this backup policy plan.", + "description": "The resource type.", "computed": true }, { @@ -118428,6 +122446,15 @@ "description": "Version of the BackupPolicyPlan.", "computed": true }, + { + "name": "cron_spec", + "type": "TypeString", + "description": "The cron specification for the backup schedule.", + "required": true, + "min_length": 9, + "max_length": 63, + "matches": "^((((\\d+,)+\\d+|([\\d\\*]+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})$" + }, { "name": "deletion_trigger", "type": "TypeList", @@ -118452,199 +122479,129 @@ "max_items": 1 }, { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } - ], - "ibm_is_bare_metal_server": [ - { - "name": "enable_secure_boot", - "type": "TypeBool", - "description": "Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to boot.", - "optional": true, - "computed": true - }, - { - "name": "action", - "type": "TypeString", - "description": "This restart/start/stops a bare metal server.", - "options": "start, restart, stop", - "optional": true - }, - { - "name": "crn", + "name": "lifecycle_state", "type": "TypeString", - "description": "The CRN for this bare metal server", - "cloud_data_type": "crn", + "description": "The lifecycle state of this backup policy plan.", "computed": true }, { - "name": "delete_type", - "type": "TypeString", - "description": "Enables stopping type of the bare metal server before deleting", - "default_value": "hard", - "optional": true - }, - { - "name": "keys", - "type": "TypeSet", - "description": "SSH key Ids for the bare metal server", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "name", - "type": "TypeString", - "description": "Bare metal server name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true - }, - { - "name": "trusted_platform_module", + "name": "clone_policy", "type": "TypeList", "optional": true, "computed": true, "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Indicates whether the trusted platform module is enabled.", - "computed": true - }, - "mode": { - "name": "mode", - "type": "TypeString", - "description": "The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's supported_trusted_platform_module_modes", + "max_snapshots": { + "name": "max_snapshots", + "type": "TypeInt", + "description": "The maximum number of recent snapshots (per source) that will keep clones.", "optional": true, "computed": true }, - "supported_modes": { - "name": "supported_modes", + "zones": { + "name": "zones", "type": "TypeSet", - "description": "The trusted platform module (TPM) mode:: disabled: No TPM functionality, tpm_2: TPM 2.0. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. Enum: [ disabled, tpm_2 ]", - "computed": true, - "elem": { - "type": "TypeString" - } - } - }, - "max_items": 1 - }, - { - "name": "vpc", - "type": "TypeString", - "description": "The VPC the bare metal server is to be a part of", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Bare metal server status", - "computed": true + "description": "The zone this backup policy plan will create snapshot clones in.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 }, { - "name": "zone", + "name": "name", "type": "TypeString", - "description": "Zone name", - "immutable": true, - "required": true + "description": "The user-defined name for this backup policy plan. Names must be unique within the backup policy this plan resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", + "optional": true }, { - "name": "resource_type", + "name": "href", "type": "TypeString", - "description": "Resource type name", + "description": "The URL for this backup policy plan.", "computed": true }, { - "name": "cpu", + "name": "remote_region_policy", "type": "TypeList", - "description": "The bare metal server CPU configuration", - "computed": true, + "description": "Backup policy plan cross region rule.", + "optional": true, "elem": { - "architecture": { - "name": "architecture", - "type": "TypeString", - "description": "The CPU architecture", - "computed": true - }, - "core_count": { - "name": "core_count", + "delete_over_count": { + "name": "delete_over_count", "type": "TypeInt", - "description": "The total number of cores", + "description": "The maximum number of recent remote copies to keep in this region.", + "optional": true, "computed": true }, - "socket_count": { - "name": "socket_count", - "type": "TypeInt", - "description": "The total number of CPU sockets", + "encryption_key": { + "name": "encryption_key", + "type": "TypeString", + "description": "The CRN of the [Key Protect Root Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource.", + "optional": true, "computed": true }, - "threads_per_core": { - "name": "threads_per_core", - "type": "TypeInt", - "description": "The total number of hardware threads per core", - "computed": true + "region": { + "name": "region", + "type": "TypeString", + "description": "The globally unique name for this region.", + "required": true } } }, { - "name": "href", + "name": "backup_policy_id", "type": "TypeString", - "description": "The URL for this bare metal server", + "description": "The backup policy identifier.", + "immutable": true, + "required": true + }, + { + "name": "backup_policy_plan_id", + "type": "TypeString", + "description": "The backup policy identifier.", "computed": true }, { - "name": "memory", - "type": "TypeInt", - "description": "The amount of memory, truncated to whole gibibytes", + "name": "active", + "type": "TypeBool", + "description": "Indicates whether the plan is active.", + "optional": true, "computed": true }, { - "name": "image", - "type": "TypeString", - "description": "image id", - "immutable": true, - "required": true + "name": "attach_user_tags", + "type": "TypeSet", + "description": "User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "profile", + "name": "created_at", "type": "TypeString", - "description": "profile name", - "immutable": true, - "required": true - }, + "description": "The date and time that the backup policy plan was created.", + "computed": true + } + ], + "ibm_is_bare_metal_server": [ { - "name": "user_data", + "name": "vpc", "type": "TypeString", - "description": "User data given for the bare metal server", + "description": "The VPC the bare metal server is to be a part of", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "description": "Tags for the Bare metal server", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "description": "List of access management tags", "optional": true, "computed": true, "elem": { @@ -118652,40 +122609,24 @@ } }, { - "name": "status_reasons", - "type": "TypeList", - "computed": true, - "elem": { - "code": { - "name": "code", - "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the status reason", - "computed": true - }, - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about this status reason", - "computed": true - } - } + "name": "enable_secure_boot", + "type": "TypeBool", + "description": "Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to boot.", + "optional": true, + "computed": true }, { - "name": "bandwidth", - "type": "TypeInt", - "description": "The total bandwidth (in megabits per second)", - "computed": true + "name": "action", + "type": "TypeString", + "description": "This restart/start/stops a bare metal server.", + "options": "start, restart, stop", + "optional": true }, { - "name": "boot_target", + "name": "crn", "type": "TypeString", - "description": "The unique identifier for this bare metal server disk", + "description": "The CRN for this bare metal server", + "cloud_data_type": "crn", "computed": true }, { @@ -118732,6 +122673,75 @@ } } }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this bare metal server", + "computed": true + }, + { + "name": "memory", + "type": "TypeInt", + "description": "The amount of memory, truncated to whole gibibytes", + "computed": true + }, + { + "name": "status_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason", + "computed": true + } + } + }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags for the Bare metal server", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "Resource type name", + "computed": true + }, + { + "name": "boot_target", + "type": "TypeString", + "description": "The unique identifier for this bare metal server disk", + "computed": true + }, + { + "name": "delete_type", + "type": "TypeString", + "description": "Enables stopping type of the bare metal server before deleting", + "default_value": "hard", + "optional": true + }, { "name": "primary_network_interface", "type": "TypeList", @@ -118999,6 +123009,27 @@ } } }, + { + "name": "profile", + "type": "TypeString", + "description": "profile name", + "immutable": true, + "required": true + }, + { + "name": "user_data", + "type": "TypeString", + "description": "User data given for the bare metal server", + "immutable": true, + "optional": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "immutable": true, + "required": true + }, { "name": "resource_group", "type": "TypeString", @@ -119007,16 +123038,109 @@ "immutable": true, "optional": true, "computed": true - } - ], - "ibm_is_bare_metal_server_action": [ + }, { - "name": "bare_metal_server", + "name": "name", "type": "TypeString", - "description": "Bare metal server identifier", + "description": "Bare metal server name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true + }, + { + "name": "trusted_platform_module", + "type": "TypeList", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Indicates whether the trusted platform module is enabled.", + "computed": true + }, + "mode": { + "name": "mode", + "type": "TypeString", + "description": "The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's supported_trusted_platform_module_modes", + "optional": true, + "computed": true + }, + "supported_modes": { + "name": "supported_modes", + "type": "TypeSet", + "description": "The trusted platform module (TPM) mode:: disabled: No TPM functionality, tpm_2: TPM 2.0. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. Enum: [ disabled, tpm_2 ]", + "computed": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 + }, + { + "name": "bandwidth", + "type": "TypeInt", + "description": "The total bandwidth (in megabits per second)", + "computed": true + }, + { + "name": "cpu", + "type": "TypeList", + "description": "The bare metal server CPU configuration", + "computed": true, + "elem": { + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "The CPU architecture", + "computed": true + }, + "core_count": { + "name": "core_count", + "type": "TypeInt", + "description": "The total number of cores", + "computed": true + }, + "socket_count": { + "name": "socket_count", + "type": "TypeInt", + "description": "The total number of CPU sockets", + "computed": true + }, + "threads_per_core": { + "name": "threads_per_core", + "type": "TypeInt", + "description": "The total number of hardware threads per core", + "computed": true + } + } + }, + { + "name": "keys", + "type": "TypeSet", + "description": "SSH key Ids for the bare metal server", + "required": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "image", + "type": "TypeString", + "description": "image id", "immutable": true, "required": true }, + { + "name": "status", + "type": "TypeString", + "description": "Bare metal server status", + "computed": true + } + ], + "ibm_is_bare_metal_server_action": [ { "name": "stop_type", "type": "TypeString", @@ -119061,9 +123185,22 @@ "computed": true } } + }, + { + "name": "bare_metal_server", + "type": "TypeString", + "description": "Bare metal server identifier", + "immutable": true, + "required": true } ], "ibm_is_bare_metal_server_disk": [ + { + "name": "bare_metal_server", + "type": "TypeString", + "description": "Bare metal server identifier", + "required": true + }, { "name": "disk", "type": "TypeString", @@ -119079,28 +123216,9 @@ "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", "optional": true, "computed": true - }, - { - "name": "bare_metal_server", - "type": "TypeString", - "description": "Bare metal server identifier", - "required": true } ], "ibm_is_bare_metal_server_network_interface": [ - { - "name": "bare_metal_server", - "type": "TypeString", - "description": "Bare metal server identifier", - "required": true - }, - { - "name": "allow_ip_spoofing", - "type": "TypeBool", - "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", - "optional": true, - "computed": true - }, { "name": "hard_stop", "type": "TypeBool", @@ -119109,44 +123227,39 @@ "optional": true }, { - "name": "security_groups", - "type": "TypeSet", - "description": "Collection of security groups ids", + "name": "mac_address", + "type": "TypeString", + "description": "The MAC address of the interface. If absent, the value is not known.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this network interface", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "allowed_vlans", - "type": "TypeSet", - "description": "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + "name": "port_speed", + "type": "TypeInt", + "description": "The network interface port speed in Mbps", + "computed": true + }, + { + "name": "vlan", + "type": "TypeInt", + "description": "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", "optional": true, - "computed": true, - "elem": { - "type": "TypeInt" - } + "computed": true }, { - "name": "floating_ips", - "type": "TypeList", - "description": "The floating IPs associated with this network interface.", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The globally unique IP address", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The globally unique IP identifier", - "computed": true - } - } + "name": "bare_metal_server", + "type": "TypeString", + "description": "Bare metal server identifier", + "required": true }, { "name": "href", @@ -119155,9 +123268,11 @@ "computed": true }, { - "name": "port_speed", - "type": "TypeInt", - "description": "The network interface port speed in Mbps", + "name": "interface_type", + "type": "TypeString", + "description": "The network interface type: [ pci, vlan, hipersocket ]", + "options": "pci, hipersocket, vlan", + "optional": true, "computed": true }, { @@ -119211,24 +123326,14 @@ "max_items": 1 }, { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type : [ subnet_reserved_ip ]", - "computed": true - }, - { - "name": "interface_type", - "type": "TypeString", - "description": "The network interface type: [ pci, vlan, hipersocket ]", - "options": "pci, hipersocket, vlan", + "name": "security_groups", + "type": "TypeSet", + "description": "Collection of security groups ids", "optional": true, - "computed": true - }, - { - "name": "mac_address", - "type": "TypeString", - "description": "The MAC address of the interface. If absent, the value is not known.", - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "status", @@ -119237,15 +123342,15 @@ "computed": true }, { - "name": "subnet", + "name": "type", "type": "TypeString", - "description": "The id of the associated subnet", - "required": true + "description": "The type of this bare metal server network interface : [ primary, secondary ]", + "computed": true }, { - "name": "vlan", - "type": "TypeInt", - "description": "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + "name": "allow_interface_to_float", + "type": "TypeBool", + "description": "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", "optional": true, "computed": true }, @@ -119256,72 +123361,63 @@ "computed": true }, { - "name": "enable_infrastructure_nat", + "name": "allow_ip_spoofing", "type": "TypeBool", - "description": "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", "optional": true, "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this network interface", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "name": "enable_infrastructure_nat", + "type": "TypeBool", + "description": "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", "optional": true, "computed": true }, { - "name": "type", - "type": "TypeString", - "description": "The type of this bare metal server network interface : [ primary, secondary ]", - "computed": true + "name": "floating_ips", + "type": "TypeList", + "description": "The floating IPs associated with this network interface.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The globally unique IP address", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The globally unique IP identifier", + "computed": true + } + } }, { - "name": "allow_interface_to_float", - "type": "TypeBool", - "description": "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", - "optional": true, - "computed": true - } - ], - "ibm_is_bare_metal_server_network_interface_allow_float": [ - { - "name": "mac_address", + "name": "resource_type", "type": "TypeString", - "description": "The MAC address of the interface. If absent, the value is not known.", + "description": "The resource type : [ subnet_reserved_ip ]", "computed": true }, { - "name": "name", + "name": "subnet", "type": "TypeString", - "description": "The user-defined name for this network interface", - "optional": true, - "computed": true - }, - { - "name": "port_speed", - "type": "TypeInt", - "description": "The network interface port speed in Mbps", - "computed": true + "description": "The id of the associated subnet", + "required": true }, { - "name": "security_groups", + "name": "allowed_vlans", "type": "TypeSet", - "description": "Collection of security groups ids", + "description": "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", "optional": true, "computed": true, "elem": { - "type": "TypeString" + "type": "TypeInt" } - }, - { - "name": "floating_bare_metal_server", - "type": "TypeString", - "description": "Bare metal server identifier of the server to which nic is floating to", - "computed": true - }, + } + ], + "ibm_is_bare_metal_server_network_interface_allow_float": [ { "name": "primary_ip", "type": "TypeList", @@ -119372,18 +123468,6 @@ }, "max_items": 1 }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the network interface : [ available, deleting, failed, pending ]", - "computed": true - }, - { - "name": "subnet", - "type": "TypeString", - "description": "The id of the associated subnet", - "required": true - }, { "name": "bare_metal_server", "type": "TypeString", @@ -119391,9 +123475,9 @@ "required": true }, { - "name": "network_interface", + "name": "floating_bare_metal_server", "type": "TypeString", - "description": "The bare metal server network interface identifier", + "description": "Bare metal server identifier of the server to which nic is floating to", "computed": true }, { @@ -119403,6 +123487,52 @@ "optional": true, "computed": true }, + { + "name": "floating_ips", + "type": "TypeList", + "description": "The floating IPs associated with this network interface.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The globally unique IP address", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The globally unique IP identifier", + "computed": true + } + } + }, + { + "name": "interface_type", + "type": "TypeString", + "description": "The network interface type: [ pci, vlan ]", + "computed": true + }, + { + "name": "allow_ip_spoofing", + "type": "TypeBool", + "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + "optional": true, + "computed": true + }, + { + "name": "mac_address", + "type": "TypeString", + "description": "The MAC address of the interface. If absent, the value is not known.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this network interface", + "optional": true, + "computed": true + }, { "name": "resource_type", "type": "TypeString", @@ -119415,6 +123545,22 @@ "description": "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", "computed": true }, + { + "name": "security_groups", + "type": "TypeSet", + "description": "Collection of security groups ids", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the network interface : [ available, deleting, failed, pending ]", + "computed": true + }, { "name": "vlan", "type": "TypeInt", @@ -119422,32 +123568,11 @@ "required": true }, { - "name": "allow_ip_spoofing", - "type": "TypeBool", - "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", - "optional": true, + "name": "network_interface", + "type": "TypeString", + "description": "The bare metal server network interface identifier", "computed": true }, - { - "name": "floating_ips", - "type": "TypeList", - "description": "The floating IPs associated with this network interface.", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The globally unique IP address", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The globally unique IP identifier", - "computed": true - } - } - }, { "name": "href", "type": "TypeString", @@ -119455,11 +123580,17 @@ "computed": true }, { - "name": "interface_type", - "type": "TypeString", - "description": "The network interface type: [ pci, vlan ]", + "name": "port_speed", + "type": "TypeInt", + "description": "The network interface port speed in Mbps", "computed": true }, + { + "name": "subnet", + "type": "TypeString", + "description": "The id of the associated subnet", + "required": true + }, { "name": "type", "type": "TypeString", @@ -119468,6 +123599,25 @@ } ], "ibm_is_bare_metal_server_network_interface_floating_ip": [ + { + "name": "name", + "type": "TypeString", + "description": "Name of the floating IP", + "computed": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Floating IP crn", + "cloud_data_type": "crn", + "computed": true + }, { "name": "bare_metal_server", "type": "TypeString", @@ -119492,18 +123642,6 @@ "description": "Floating IP address", "computed": true }, - { - "name": "target", - "type": "TypeString", - "description": "Target info", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the floating IP", - "computed": true - }, { "name": "status", "type": "TypeString", @@ -119511,47 +123649,30 @@ "computed": true }, { - "name": "zone", - "type": "TypeString", - "description": "Zone name", - "computed": true - }, - { - "name": "crn", + "name": "target", "type": "TypeString", - "description": "Floating IP crn", - "cloud_data_type": "crn", + "description": "Target info", "computed": true } ], "ibm_is_dedicated_host": [ { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true - }, - { - "name": "created_at", + "name": "profile", "type": "TypeString", - "description": "The date and time that the dedicated host was created.", - "computed": true + "description": "The Globally unique name of the dedicated host profile to use for this dedicated host.", + "immutable": true, + "required": true }, { - "name": "crn", + "name": "href", "type": "TypeString", - "description": "The CRN for this dedicated host.", - "cloud_data_type": "crn", + "description": "The URL for this dedicated host.", "computed": true }, { - "name": "socket_count", - "type": "TypeInt", - "description": "The total number of sockets for this host.", + "name": "provisionable", + "type": "TypeBool", + "description": "Indicates whether this dedicated host is available for instance creation.", "computed": true }, { @@ -119567,31 +123688,78 @@ "computed": true }, { - "name": "vcpu", + "name": "socket_count", + "type": "TypeInt", + "description": "The total number of sockets for this host.", + "computed": true + }, + { + "name": "state", + "type": "TypeString", + "description": "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", + "computed": true + }, + { + "name": "supported_instance_profiles", "type": "TypeList", - "description": "The total VCPU of the dedicated host.", + "description": "Array of instance profiles that can be used by instances placed on this dedicated host.", "computed": true, "elem": { - "architecture": { - "name": "architecture", + "href": { + "name": "href", "type": "TypeString", - "description": "The VCPU architecture.", + "description": "The URL for this virtual server instance profile.", "computed": true }, - "count": { - "name": "count", - "type": "TypeInt", - "description": "The number of VCPUs assigned.", + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this virtual server instance profile.", "computed": true } } }, { - "name": "host_group", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "instance_placement_enabled", + "type": "TypeBool", + "description": "If set to true, instances can be placed on this dedicated host.", + "default_value": true, + "optional": true + }, + { + "name": "name", "type": "TypeString", - "description": "The unique identifier of the dedicated host group for this dedicated host.", + "description": "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier for the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", + "cloud_data_type": "resource_group", "immutable": true, - "required": true + "optional": true, + "computed": true + }, + { + "name": "available_memory", + "type": "TypeInt", + "description": "The amount of memory in gibibytes that is currently available for instances.", + "computed": true }, { "name": "available_vcpu", @@ -119613,6 +123781,12 @@ } } }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the dedicated host was created.", + "computed": true + }, { "name": "disks", "type": "TypeList", @@ -119736,89 +123910,6 @@ } } }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the dedicated host resource.", - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "profile", - "type": "TypeString", - "description": "The Globally unique name of the dedicated host profile to use for this dedicated host.", - "immutable": true, - "required": true - }, - { - "name": "available_memory", - "type": "TypeInt", - "description": "The amount of memory in gibibytes that is currently available for instances.", - "computed": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this dedicated host.", - "computed": true - }, - { - "name": "zone", - "type": "TypeString", - "description": "The globally unique name of the zone this dedicated host resides in.", - "computed": true - }, - { - "name": "state", - "type": "TypeString", - "description": "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", - "computed": true - }, - { - "name": "supported_instance_profiles", - "type": "TypeList", - "description": "Array of instance profiles that can be used by instances placed on this dedicated host.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this virtual server instance profile.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this virtual server instance profile.", - "computed": true - } - } - }, - { - "name": "instance_placement_enabled", - "type": "TypeBool", - "description": "If set to true, instances can be placed on this dedicated host.", - "default_value": true, - "optional": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "The unique identifier for the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "instances", "type": "TypeList", @@ -119866,10 +123957,84 @@ } }, { - "name": "provisionable", - "type": "TypeBool", - "description": "Indicates whether this dedicated host is available for instance creation.", + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the dedicated host resource.", + "computed": true + }, + { + "name": "zone", + "type": "TypeString", + "description": "The globally unique name of the zone this dedicated host resides in.", + "computed": true + }, + { + "name": "numa", + "type": "TypeList", + "description": "The dedicated host NUMA configuration", + "computed": true, + "elem": { + "count": { + "name": "count", + "type": "TypeInt", + "description": "The total number of NUMA nodes for this dedicated host", + "computed": true + }, + "nodes": { + "name": "nodes", + "type": "TypeList", + "description": "The NUMA nodes for this dedicated host.", + "computed": true, + "elem": { + "available_vcpu": { + "name": "available_vcpu", + "type": "TypeInt", + "description": "The available VCPU for this NUMA node.", + "computed": true + }, + "vcpu": { + "name": "vcpu", + "type": "TypeInt", + "description": "The total VCPU capacity for this NUMA node.", + "computed": true + } + } + } + } + }, + { + "name": "host_group", + "type": "TypeString", + "description": "The unique identifier of the dedicated host group for this dedicated host.", + "immutable": true, + "required": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this dedicated host.", + "cloud_data_type": "crn", "computed": true + }, + { + "name": "vcpu", + "type": "TypeList", + "description": "The total VCPU of the dedicated host.", + "computed": true, + "elem": { + "architecture": { + "name": "architecture", + "type": "TypeString", + "description": "The VCPU architecture.", + "computed": true + }, + "count": { + "name": "count", + "type": "TypeInt", + "description": "The number of VCPUs assigned.", + "computed": true + } + } } ], "ibm_is_dedicated_host_disk_management": [ @@ -119903,19 +124068,23 @@ ], "ibm_is_dedicated_host_group": [ { - "name": "family", + "name": "name", "type": "TypeString", - "description": "The dedicated host profile family for hosts in this group.", - "immutable": true, - "required": true, - "options": "balanced, compute, memory" + "description": "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true }, { - "name": "zone", + "name": "resource_group", "type": "TypeString", - "description": "The globally unique name of the zone this dedicated host group will reside in.", + "description": "The unique identifier of the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", + "cloud_data_type": "resource_group", "immutable": true, - "required": true + "optional": true, + "computed": true }, { "name": "created_at", @@ -119983,15 +124152,37 @@ } }, { - "name": "href", + "name": "resource_type", "type": "TypeString", - "description": "The URL for this dedicated host group.", + "description": "The type of resource referenced.", "computed": true }, { - "name": "resource_type", + "name": "class", + "type": "TypeString", + "description": "The dedicated host profile class for hosts in this group.", + "immutable": true, + "required": true + }, + { + "name": "family", + "type": "TypeString", + "description": "The dedicated host profile family for hosts in this group.", + "immutable": true, + "required": true, + "options": "balanced, compute, memory" + }, + { + "name": "zone", + "type": "TypeString", + "description": "The globally unique name of the zone this dedicated host group will reside in.", + "immutable": true, + "required": true + }, + { + "name": "href", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The URL for this dedicated host group.", "computed": true }, { @@ -120013,52 +124204,39 @@ "computed": true } } + } + ], + "ibm_is_floating_ip": [ + { + "name": "crn", + "type": "TypeString", + "description": "The crn of the resource", + "cloud_data_type": "crn", + "computed": true }, { - "name": "class", + "name": "resource_status", "type": "TypeString", - "description": "The dedicated host profile class for hosts in this group.", - "immutable": true, - "required": true + "description": "The status of the resource", + "computed": true }, { "name": "name", "type": "TypeString", - "description": "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "description": "Name of the floating IP", + "required": true, "min_length": 1, "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { "name": "resource_group", "type": "TypeString", - "description": "The unique identifier of the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", + "description": "Resource group info", "cloud_data_type": "resource_group", "immutable": true, "optional": true, "computed": true - } - ], - "ibm_is_floating_ip": [ - { - "name": "zone", - "type": "TypeString", - "description": "Zone name", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } }, { "name": "resource_controller_url", @@ -120072,19 +124250,6 @@ "description": "The name of the resource", "computed": true }, - { - "name": "crn", - "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Floating IP status", - "computed": true - }, { "name": "resource_crn", "type": "TypeString", @@ -120092,20 +124257,11 @@ "computed": true }, { - "name": "resource_group_name", + "name": "address", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Floating IP address", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "Name of the floating IP", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, { "name": "tags", "type": "TypeSet", @@ -120120,15 +124276,11 @@ } }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "address", + "name": "zone", "type": "TypeString", - "description": "Floating IP address", + "description": "Zone name", + "immutable": true, + "optional": true, "computed": true }, { @@ -120229,16 +124381,15 @@ } }, { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group info", - "cloud_data_type": "resource_group", - "immutable": true, + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", "optional": true, - "computed": true - } - ], - "ibm_is_flow_log": [ + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "resource_group_name", "type": "TypeString", @@ -120246,43 +124397,31 @@ "computed": true }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "resource_crn", + "name": "status", "type": "TypeString", - "description": "The crn of the resource", + "description": "Floating IP status", "computed": true - }, + } + ], + "ibm_is_flow_log": [ { - "name": "name", + "name": "target", "type": "TypeString", - "description": "Flow Log Collector name", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "active", - "type": "TypeBool", - "description": "Indicates whether this collector is active", - "default_value": true, - "optional": true + "description": "The target id that the flow log collector is to collect flow logs", + "immutable": true, + "required": true }, { - "name": "vpc", + "name": "crn", "type": "TypeString", - "description": "The VPC this flow log collector is associated with", + "description": "The CRN for this flow log collector", + "cloud_data_type": "crn", "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "If set to true, this flow log collector will be automatically deleted when the target is deleted", + "name": "href", + "type": "TypeString", + "description": "The URL for this flow log collector", "computed": true }, { @@ -120296,11 +124435,19 @@ } }, { - "name": "target", + "name": "resource_status", "type": "TypeString", - "description": "The target id that the flow log collector is to collect flow logs", - "immutable": true, - "required": true + "description": "The status of the resource", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Flow Log Collector name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { "name": "resource_group", @@ -120312,22 +124459,21 @@ "computed": true }, { - "name": "crn", + "name": "created_at", "type": "TypeString", - "description": "The CRN for this flow log collector", - "cloud_data_type": "crn", + "description": "The date and time flow log was created", "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "The URL for this flow log collector", + "name": "auto_delete", + "type": "TypeBool", + "description": "If set to true, this flow log collector will be automatically deleted when the target is deleted", "computed": true }, { - "name": "created_at", + "name": "resource_name", "type": "TypeString", - "description": "The date and time flow log was created", + "description": "The name of the resource", "computed": true }, { @@ -120337,12 +124483,6 @@ "immutable": true, "required": true }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the flow log collector", - "computed": true - }, { "name": "tags", "type": "TypeSet", @@ -120357,53 +124497,50 @@ } }, { - "name": "resource_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The name of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - } - ], - "ibm_is_ike_policy": [ - { - "name": "resource_controller_url", + "name": "resource_crn", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The crn of the resource", "computed": true }, { - "name": "resource_name", + "name": "resource_group_name", "type": "TypeString", - "description": "The name of the resource", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "dh_group", - "type": "TypeInt", - "description": "IKE DH group", - "required": true, - "options": "2, 5, 14, 19, 15, 16, 17, 18, 20, 21, 22, 23, 24, 31" + "name": "active", + "type": "TypeBool", + "description": "Indicates whether this collector is active", + "default_value": true, + "optional": true }, { - "name": "resource_group", + "name": "lifecycle_state", "type": "TypeString", - "description": "IKE resource group ID", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, + "description": "The lifecycle state of the flow log collector", "computed": true }, { - "name": "ike_version", - "type": "TypeInt", - "description": "IKE version", - "options": "1, 2", - "optional": true + "name": "vpc", + "type": "TypeString", + "description": "The VPC this flow log collector is associated with", + "computed": true + } + ], + "ibm_is_ike_policy": [ + { + "name": "authentication_algorithm", + "type": "TypeString", + "description": "Authentication algorithm type", + "required": true, + "options": "md5, sha1, sha256, sha512, sha384" }, { "name": "negotiation_mode", @@ -120411,6 +124548,12 @@ "description": "IKE negotiation mode", "computed": true }, + { + "name": "href", + "type": "TypeString", + "description": "IKE href value", + "computed": true + }, { "name": "vpn_connections", "type": "TypeList", @@ -120433,6 +124576,12 @@ } } }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true + }, { "name": "resource_group_name", "type": "TypeString", @@ -120448,13 +124597,6 @@ "max_length": 63, "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, - { - "name": "authentication_algorithm", - "type": "TypeString", - "description": "Authentication algorithm type", - "required": true, - "options": "md5, sha1, sha256, sha512, sha384" - }, { "name": "encryption_algorithm", "type": "TypeString", @@ -120462,6 +124604,22 @@ "required": true, "options": "triple_des, aes128, aes192, aes256" }, + { + "name": "dh_group", + "type": "TypeInt", + "description": "IKE DH group", + "required": true, + "options": "2, 5, 14, 19, 15, 16, 17, 18, 20, 21, 22, 23, 24, 31" + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "IKE resource group ID", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "key_lifetime", "type": "TypeInt", @@ -120470,29 +124628,24 @@ "optional": true }, { - "name": "href", + "name": "ike_version", + "type": "TypeInt", + "description": "IKE version", + "options": "1, 2", + "optional": true + }, + { + "name": "resource_name", "type": "TypeString", - "description": "IKE href value", + "description": "The name of the resource", "computed": true } ], "ibm_is_image": [ { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the image was created", - "computed": true - }, - { - "name": "deprecate", - "type": "TypeBool", - "description": "Set to deprecate. You can set an image to `deprecated` as a warning to transition away from soon-to-be obsolete images. Deprecated images can be used to provision resources.", - "optional": true - }, - { - "name": "obsolescence_at", + "name": "href", "type": "TypeString", - "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "description": "Image Href value", "optional": true, "computed": true }, @@ -120505,38 +124658,39 @@ "computed": true }, { - "name": "source_volume", + "name": "encryption", "type": "TypeString", - "description": "Image volume id", - "immutable": true, - "optional": true + "description": "The type of encryption used on the image", + "computed": true }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "name": "size", + "type": "TypeInt", + "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", "computed": true }, { - "name": "resource_group_name", + "name": "source_volume", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true + "description": "Image volume id", + "immutable": true, + "optional": true }, { - "name": "name", + "name": "resource_crn", "type": "TypeString", - "description": "Image name", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + "description": "The crn of the resource", + "computed": true }, { - "name": "size", - "type": "TypeInt", - "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", - "computed": true + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "visibility", @@ -120551,29 +124705,28 @@ "computed": true }, { - "name": "resource_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The name of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_crn", + "name": "checksum", "type": "TypeString", - "description": "The crn of the resource", + "description": "The SHA256 checksum of this image", "computed": true }, { - "name": "resource_status", + "name": "resource_group_name", "type": "TypeString", - "description": "The status of the resource", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "Image Href value", - "optional": true, - "computed": true + "name": "obsolete", + "type": "TypeBool", + "description": "Set to obsolete. You can set an image to `obsolete` as a warning to transition away from soon-to-be deleted images. You can't use obsolete images to provision resources.", + "optional": true }, { "name": "deprecation_at", @@ -120583,11 +124736,19 @@ "computed": true }, { - "name": "status", + "name": "obsolescence_at", "type": "TypeString", - "description": "The status of this image", + "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "optional": true, "computed": true }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", + "immutable": true, + "optional": true + }, { "name": "resource_group", "type": "TypeString", @@ -120598,20 +124759,26 @@ "computed": true }, { - "name": "checksum", + "name": "crn", "type": "TypeString", - "description": "The SHA256 checksum of this image", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Image name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { "name": "encrypted_data_key", @@ -120621,10 +124788,15 @@ "optional": true }, { - "name": "encryption_key", + "name": "created_at", "type": "TypeString", - "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", - "immutable": true, + "description": "The date and time that the image was created", + "computed": true + }, + { + "name": "deprecate", + "type": "TypeBool", + "description": "Set to deprecate. You can set an image to `deprecated` as a warning to transition away from soon-to-be obsolete images. Deprecated images can be used to provision resources.", "optional": true }, { @@ -120641,59 +124813,59 @@ } }, { - "name": "encryption", + "name": "status", "type": "TypeString", - "description": "The type of encryption used on the image", + "description": "The status of this image", "computed": true }, { - "name": "crn", + "name": "resource_name", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The name of the resource", "computed": true - }, - { - "name": "obsolete", - "type": "TypeBool", - "description": "Set to obsolete. You can set an image to `obsolete` as a warning to transition away from soon-to-be deleted images. You can't use obsolete images to provision resources.", - "optional": true } ], "ibm_is_image_deprecate": [ { - "name": "crn", + "name": "encryption", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The type of encryption used on the image", "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "size", + "type": "TypeInt", + "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", + "computed": true }, { - "name": "image", + "name": "source_volume", "type": "TypeString", - "description": "Image identifier", - "immutable": true, - "required": true + "description": "Image volume id", + "computed": true }, { - "name": "operating_system", + "name": "created_at", "type": "TypeString", - "description": "Image Operating system", + "description": "The date and time that the image was created", "computed": true }, { - "name": "file", - "type": "TypeInt", - "description": "Details for the stored image file", + "name": "obsolescence_at", + "type": "TypeString", + "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "computed": true + }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", + "computed": true + }, + { + "name": "operating_system", + "type": "TypeString", + "description": "Image Operating system", "computed": true }, { @@ -120703,17 +124875,17 @@ "computed": true }, { - "name": "size", - "type": "TypeInt", - "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", + "name": "href", + "type": "TypeString", + "description": "Image Href value", "computed": true }, { - "name": "resource_group", + "name": "image", "type": "TypeString", - "description": "The resource group for this image", - "cloud_data_type": "resource_group", - "computed": true + "description": "Image identifier", + "immutable": true, + "required": true }, { "name": "encrypted_data_key", @@ -120722,16 +124894,16 @@ "computed": true }, { - "name": "obsolescence_at", + "name": "crn", "type": "TypeString", - "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "description": "Tags for the image", - "cloud_data_type": "tags", + "description": "List of access management tags", "computed": true, "elem": { "type": "TypeString" @@ -120744,55 +124916,67 @@ "computed": true }, { - "name": "encryption_key", - "type": "TypeString", - "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", + "name": "file", + "type": "TypeInt", + "description": "Details for the stored image file", "computed": true }, { - "name": "visibility", + "name": "checksum", "type": "TypeString", - "description": "Whether the image is publicly visible or private to the account", + "description": "The SHA256 checksum of this image", "computed": true }, { - "name": "source_volume", + "name": "resource_group", "type": "TypeString", - "description": "Image volume id", + "description": "The resource group for this image", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "href", + "name": "name", "type": "TypeString", - "description": "Image Href value", + "description": "Image name", "computed": true }, { - "name": "name", + "name": "tags", + "type": "TypeSet", + "description": "Tags for the image", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "visibility", "type": "TypeString", - "description": "Image name", + "description": "Whether the image is publicly visible or private to the account", "computed": true - }, + } + ], + "ibm_is_image_export_job": [ { - "name": "created_at", + "name": "started_at", "type": "TypeString", - "description": "The date and time that the image was created", + "description": "The date and time that the image export job started running.If absent, the export job has not yet started.", "computed": true }, { - "name": "encryption", + "name": "status", "type": "TypeString", - "description": "The type of encryption used on the image", + "description": "The status of this image export job:- `deleting`: Export job is being deleted- `failed`: Export job could not be completed successfully- `queued`: Export job is queued- `running`: Export job is in progress- `succeeded`: Export job was completed successfullyThe exported image object is automatically deleted for `failed` jobs.", "computed": true }, { - "name": "checksum", + "name": "image", "type": "TypeString", - "description": "The SHA256 checksum of this image", - "computed": true - } - ], - "ibm_is_image_export_job": [ + "description": "The image identifier.", + "immutable": true, + "required": true + }, { "name": "storage_bucket", "type": "TypeList", @@ -120821,13 +125005,14 @@ "min_items": 1 }, { - "name": "format", + "name": "name", "type": "TypeString", - "description": "The format to use for the exported image. If the image is encrypted, only `qcow2` is supported.", - "default_value": "qcow2", - "immutable": true, - "options": "qcow2, vhd", - "optional": true + "description": "The user-defined name for this image export job. Names must be unique within the image this export job resides in. If unspecified, the name will be a hyphenated list of randomly-selected words prefixed with the first 16 characters of the parent image name.The exported image object name in Cloud Object Storage (`storage_object.name` in the response) will be based on this name. The object name will be unique within the bucket.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", + "optional": true, + "computed": true }, { "name": "completed_at", @@ -120836,9 +125021,9 @@ "computed": true }, { - "name": "href", + "name": "created_at", "type": "TypeString", - "description": "The URL for this image export job.", + "description": "The date and time that the image export job was created.", "computed": true }, { @@ -120847,22 +125032,6 @@ "description": "The type of resource referenced.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this image export job. Names must be unique within the image this export job resides in. If unspecified, the name will be a hyphenated list of randomly-selected words prefixed with the first 16 characters of the parent image name.The exported image object name in Cloud Object Storage (`storage_object.name` in the response) will be based on this name. The object name will be unique within the bucket.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", - "optional": true, - "computed": true - }, - { - "name": "started_at", - "type": "TypeString", - "description": "The date and time that the image export job started running.If absent, the export job has not yet started.", - "computed": true - }, { "name": "status_reasons", "type": "TypeList", @@ -120904,9 +125073,18 @@ } }, { - "name": "created_at", + "name": "format", "type": "TypeString", - "description": "The date and time that the image export job was created.", + "description": "The format to use for the exported image. If the image is encrypted, only `qcow2` is supported.", + "default_value": "qcow2", + "immutable": true, + "options": "qcow2, vhd", + "optional": true + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this image export job.", "computed": true }, { @@ -120916,44 +125094,69 @@ "computed": true }, { - "name": "image_export_job", + "name": "storage_href", "type": "TypeString", - "description": "The unique identifier for this image export job.", + "description": "The Cloud Object Storage location of the exported image object. The object at this location may not exist until the job is started, and will be incomplete while the job is running.After the job completes, the exported image object is not managed by the IBM VPC service, and may be removed or replaced with a different object by any user or service with IAM authorization to the bucket.", "computed": true }, { - "name": "image", + "name": "image_export_job", "type": "TypeString", - "description": "The image identifier.", - "immutable": true, - "required": true + "description": "The unique identifier for this image export job.", + "computed": true + } + ], + "ibm_is_image_obsolete": [ + { + "name": "size", + "type": "TypeInt", + "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", + "computed": true }, { - "name": "status", + "name": "source_volume", "type": "TypeString", - "description": "The status of this image export job:- `deleting`: Export job is being deleted- `failed`: Export job could not be completed successfully- `queued`: Export job is queued- `running`: Export job is in progress- `succeeded`: Export job was completed successfullyThe exported image object is automatically deleted for `failed` jobs.", + "description": "Image volume id", "computed": true }, { - "name": "storage_href", + "name": "resource_group", "type": "TypeString", - "description": "The Cloud Object Storage location of the exported image object. The object at this location may not exist until the job is started, and will be incomplete while the job is running.After the job completes, the exported image object is not managed by the IBM VPC service, and may be removed or replaced with a different object by any user or service with IAM authorization to the bucket.", + "description": "The resource group for this image", + "cloud_data_type": "resource_group", "computed": true - } - ], - "ibm_is_image_obsolete": [ + }, { - "name": "encrypted_data_key", + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "href", "type": "TypeString", - "description": "A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image", + "description": "Image Href value", "computed": true }, { - "name": "obsolescence_at", + "name": "name", "type": "TypeString", - "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "description": "Image name", "computed": true }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags for the image", + "cloud_data_type": "tags", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "operating_system", "type": "TypeString", @@ -120961,27 +125164,29 @@ "computed": true }, { - "name": "file", - "type": "TypeInt", - "description": "Details for the stored image file", - "computed": true + "name": "image", + "type": "TypeString", + "description": "Image identifier", + "immutable": true, + "required": true }, { - "name": "created_at", + "name": "crn", "type": "TypeString", - "description": "The date and time that the image was created", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "encryption_key", + "name": "checksum", "type": "TypeString", - "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", + "description": "The SHA256 checksum of this image", "computed": true }, { - "name": "name", + "name": "deprecation_at", "type": "TypeString", - "description": "Image name", + "description": "The deprecation date and time (UTC) for this image. If absent, no deprecation date and time has been set.", "computed": true }, { @@ -120997,226 +125202,494 @@ "computed": true }, { - "name": "size", + "name": "visibility", + "type": "TypeString", + "description": "Whether the image is publicly visible or private to the account", + "computed": true + }, + { + "name": "file", "type": "TypeInt", - "description": "The minimum size (in gigabytes) of a volume onto which this image may be provisioned", + "description": "Details for the stored image file", "computed": true }, { - "name": "visibility", + "name": "encrypted_data_key", "type": "TypeString", - "description": "Whether the image is publicly visible or private to the account", + "description": "A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image", "computed": true }, { - "name": "href", + "name": "created_at", "type": "TypeString", - "description": "Image Href value", + "description": "The date and time that the image was created", "computed": true }, { - "name": "image", + "name": "obsolescence_at", "type": "TypeString", - "description": "Image identifier", + "description": "The obsolescence date and time (UTC) for this image. If absent, no obsolescence date and time has been set.", + "computed": true + }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "The CRN of the Key Protect Root Key or Hyper Protect Crypto Service Root Key for this resource", + "computed": true + } + ], + "ibm_is_instance": [ + { + "name": "instance_template", + "type": "TypeString", + "description": "Id of the instance template", "immutable": true, - "required": true + "optional": true }, { - "name": "deprecation_at", + "name": "profile", "type": "TypeString", - "description": "The deprecation date and time (UTC) for this image. If absent, no deprecation date and time has been set.", + "description": "Profile info", + "optional": true, "computed": true }, { "name": "tags", "type": "TypeSet", - "description": "Tags for the image", - "cloud_data_type": "tags", + "description": "list of tags for the instance", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, "computed": true, "elem": { "type": "TypeString" } }, { - "name": "source_volume", + "name": "wait_before_delete", + "type": "TypeBool", + "description": "Enables stopping of instance before deleting and waits till deletion is complete", + "default_value": true, + "optional": true + }, + { + "name": "force_recovery_time", + "type": "TypeInt", + "description": "Define timeout to force the instances to start/stop in minutes.", + "optional": true + }, + { + "name": "vpc", "type": "TypeString", - "description": "Image volume id", + "description": "VPC id", + "immutable": true, + "optional": true, "computed": true }, { - "name": "resource_group", + "name": "zone", "type": "TypeString", - "description": "The resource group for this image", - "cloud_data_type": "resource_group", + "description": "Zone name", + "immutable": true, + "optional": true, "computed": true }, { - "name": "crn", + "name": "dedicated_host", + "type": "TypeString", + "description": "Unique Identifier of the Dedicated Host where the instance will be placed", + "optional": true + }, + { + "name": "bandwidth", + "type": "TypeInt", + "description": "The total bandwidth (in megabits per second) shared across the instance's network interfaces and storage volumes", + "computed": true + }, + { + "name": "user_data", + "type": "TypeString", + "description": "User data given for the instance", + "immutable": true, + "optional": true + }, + { + "name": "resource_crn", "type": "TypeString", "description": "The crn of the resource", - "cloud_data_type": "crn", "computed": true }, { - "name": "checksum", + "name": "name", "type": "TypeString", - "description": "The SHA256 checksum of this image", + "description": "Instance name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + }, + { + "name": "default_trusted_profile_auto_link", + "type": "TypeBool", + "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", + "name": "total_volume_bandwidth", + "type": "TypeInt", + "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", + "min_value": "500", + "optional": true, + "computed": true + }, + { + "name": "boot_volume", + "type": "TypeList", + "optional": true, "computed": true, "elem": { - "type": "TypeString" - } - } - ], - "ibm_is_instance": [ + "auto_delete_volume": { + "name": "auto_delete_volume", + "type": "TypeBool", + "description": "Auto delete boot volume along with instance", + "default_value": true, + "optional": true + }, + "encryption": { + "name": "encryption", + "type": "TypeString", + "optional": true, + "computed": true + }, + "iops": { + "name": "iops", + "type": "TypeInt", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "optional": true, + "computed": true + }, + "profile": { + "name": "profile", + "type": "TypeString", + "computed": true + }, + "size": { + "name": "size", + "type": "TypeInt", + "optional": true, + "computed": true + }, + "snapshot": { + "name": "snapshot", + "type": "TypeString", + "immutable": true, + "optional": true, + "computed": true + }, + "tags": { + "name": "tags", + "type": "TypeSet", + "description": "UserTags for the volume instance", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "volume_id": { + "name": "volume_id", + "type": "TypeString", + "description": "The unique identifier for this volume", + "immutable": true, + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, { - "name": "tags", + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true + }, + { + "name": "placement_group", + "type": "TypeString", + "description": "Unique Identifier of the Placement Group for restricting the placement of the instance", + "immutable": true, + "optional": true + }, + { + "name": "keys", "type": "TypeSet", - "description": "list of tags for the instance", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "description": "SSH key Ids for the instance", "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "volumes", + "name": "force_action", + "type": "TypeBool", + "description": "If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action.", + "default_value": false, + "optional": true + }, + { + "name": "primary_network_interface", "type": "TypeList", - "description": "List of volumes", + "description": "Primary Network interface info", "optional": true, + "computed": true, "elem": { - "type": "TypeString" + "allow_ip_spoofing": { + "name": "allow_ip_spoofing", + "type": "TypeBool", + "description": "Indicates whether IP spoofing is allowed on this interface.", + "default_value": false, + "optional": true + }, + "id": { + "name": "id", + "type": "TypeString", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "optional": true, + "computed": true + }, + "port_speed": { + "name": "port_speed", + "type": "TypeInt", + "optional": true, + "computed": true, + "deprecated": "This field is deprected" + }, + "primary_ip": { + "name": "primary_ip", + "type": "TypeList", + "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", + "optional": true, + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address to reserve, which must not already be reserved on the subnet.", + "immutable": true, + "optional": true, + "computed": true + }, + "auto_delete": { + "name": "auto_delete", + "type": "TypeBool", + "description": "Indicates whether this reserved IP member will be automatically deleted when either target is deleted, or the reserved IP is unbound.", + "optional": true, + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this reserved IP", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", + "optional": true, + "computed": true + }, + "reserved_ip": { + "name": "reserved_ip", + "type": "TypeString", + "description": "Identifies a reserved IP by a unique property.", + "immutable": true, + "optional": true, + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", + "computed": true + } + }, + "max_items": 1 + }, + "primary_ipv4_address": { + "name": "primary_ipv4_address", + "type": "TypeString", + "immutable": true, + "optional": true, + "computed": true, + "deprecated": "primary_ipv4_address is deprecated and support will be removed. Use primary_ip instead" + }, + "security_groups": { + "name": "security_groups", + "type": "TypeSet", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "subnet": { + "name": "subnet", + "type": "TypeString", + "immutable": true, + "required": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "gpu", + "type": "TypeList", + "description": "The virtual server instance GPU configuration", + "computed": true, + "elem": { + "count": { + "name": "count", + "type": "TypeInt", + "description": "The number of GPUs assigned to the instance", + "computed": true + }, + "manufacturer": { + "name": "manufacturer", + "type": "TypeString", + "description": "The GPU manufacturer", + "computed": true + }, + "memory": { + "name": "memory", + "type": "TypeInt", + "description": "The overall amount of GPU memory in GiB (gibibytes)", + "computed": true + }, + "model": { + "name": "model", + "type": "TypeString", + "description": "The GPU model", + "computed": true + } } }, { - "name": "memory", - "type": "TypeInt", - "description": "Instance memory", - "computed": true - }, - { - "name": "availability_policy_host_failure", + "name": "resource_name", "type": "TypeString", - "description": "The availability policy to use for this virtual server instance", - "options": "restart, stop", - "optional": true, + "description": "The name of the resource", "computed": true }, { - "name": "default_trusted_profile_target", + "name": "crn", "type": "TypeString", - "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", - "immutable": true, - "optional": true - }, - { - "name": "total_network_bandwidth", - "type": "TypeInt", - "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces.", + "description": "Crn for this Instance", + "cloud_data_type": "crn", "computed": true }, { - "name": "user_data", - "type": "TypeString", - "description": "User data given for the instance", - "immutable": true, - "optional": true - }, - { - "name": "image", - "type": "TypeString", - "description": "image id", - "immutable": true, + "name": "access_tags", + "type": "TypeSet", + "description": "list of access tags for the instance", "optional": true, - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "instance status", - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "status_reasons", + "name": "volume_attachments", "type": "TypeList", - "description": "The reasons for the current status (if any).", "computed": true, "elem": { - "code": { - "name": "code", + "id": { + "name": "id", "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason", "computed": true }, - "message": { - "name": "message", + "name": { + "name": "name", "type": "TypeString", - "description": "An explanation of the status reason", "computed": true }, - "more_info": { - "name": "more_info", + "volume_crn": { + "name": "volume_crn", + "type": "TypeString", + "computed": true + }, + "volume_id": { + "name": "volume_id", + "type": "TypeString", + "computed": true + }, + "volume_name": { + "name": "volume_name", "type": "TypeString", - "description": "Link to documentation about this status reason", "computed": true } } }, { - "name": "lifecycle_reasons", + "name": "volumes", + "type": "TypeList", + "description": "List of volumes", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "vcpu", "type": "TypeList", - "description": "The reasons for the current lifecycle_state (if any).", "computed": true, "elem": { - "code": { - "name": "code", + "architecture": { + "name": "architecture", "type": "TypeString", - "description": "A snake case string succinctly identifying the reason for this lifecycle state.", "computed": true }, - "message": { - "name": "message", - "type": "TypeString", - "description": "An explanation of the reason for this lifecycle state.", + "count": { + "name": "count", + "type": "TypeInt", "computed": true }, - "more_info": { - "name": "more_info", + "manufacturer": { + "name": "manufacturer", "type": "TypeString", - "description": "Link to documentation about the reason for this lifecycle state.", + "description": "The VCPU manufacturer", "computed": true } } }, { - "name": "crn", - "type": "TypeString", - "description": "Crn for this Instance", - "cloud_data_type": "crn", + "name": "numa_count", + "type": "TypeInt", + "description": "The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`.", "computed": true }, { - "name": "total_volume_bandwidth", - "type": "TypeInt", - "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", - "min_value": "500", - "optional": true, + "name": "status", + "type": "TypeString", + "description": "instance status", "computed": true }, { - "name": "force_action", - "type": "TypeBool", - "description": "If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action.", - "default_value": false, - "optional": true + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the virtual server instance.", + "computed": true }, { "name": "resource_status", @@ -121327,152 +125800,22 @@ } }, { - "name": "network_interfaces", - "type": "TypeList", - "optional": true, - "computed": true, - "elem": { - "allow_ip_spoofing": { - "name": "allow_ip_spoofing", - "type": "TypeBool", - "description": "Indicates whether IP spoofing is allowed on this interface.", - "default_value": false, - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "optional": true, - "computed": true - }, - "primary_ip": { - "name": "primary_ip", - "type": "TypeList", - "description": "The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP.", - "optional": true, - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address to reserve, which must not already be reserved on the subnet.", - "immutable": true, - "optional": true, - "computed": true - }, - "auto_delete": { - "name": "auto_delete", - "type": "TypeBool", - "description": "Indicates whether this reserved IP member will be automatically deleted when either target is deleted, or the reserved IP is unbound.", - "optional": true, - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this reserved IP", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the subnet the reserved IP resides in.", - "optional": true, - "computed": true - }, - "reserved_ip": { - "name": "reserved_ip", - "type": "TypeString", - "description": "Identifies a reserved IP by a unique property.", - "optional": true, - "computed": true - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - } - }, - "max_items": 1 - }, - "primary_ipv4_address": { - "name": "primary_ipv4_address", - "type": "TypeString", - "immutable": true, - "optional": true, - "computed": true, - "deprecated": "primary_ipv4_address is deprecated and support will be removed. Use primary_ip instead" - }, - "security_groups": { - "name": "security_groups", - "type": "TypeSet", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "subnet": { - "name": "subnet", - "type": "TypeString", - "immutable": true, - "required": true - } - } - }, - { - "name": "resource_group", + "name": "default_trusted_profile_target", "type": "TypeString", - "description": "Instance resource group", - "cloud_data_type": "resource_group", + "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "metadata_service", - "type": "TypeList", - "description": "The metadata service configuration", - "optional": true, - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", - "optional": true, - "computed": true - }, - "protocol": { - "name": "protocol", - "type": "TypeString", - "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", - "optional": true, - "computed": true - }, - "response_hop_limit": { - "name": "response_hop_limit", - "type": "TypeInt", - "description": "The hop limit (IP time to live) for IP response packets from the metadata service", - "optional": true, - "computed": true - } - }, - "max_items": 1, - "min_items": 1 + "name": "dedicated_host_group", + "type": "TypeString", + "description": "Unique Identifier of the Dedicated Host Group where the instance will be placed", + "optional": true }, { - "name": "default_trusted_profile_auto_link", - "type": "TypeBool", - "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", - "immutable": true, - "optional": true, + "name": "total_network_bandwidth", + "type": "TypeInt", + "description": "The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces.", "computed": true }, { @@ -121483,97 +125826,83 @@ "optional": true }, { - "name": "volume_attachments", + "name": "auto_delete_volume", + "type": "TypeBool", + "description": "Auto delete volume along with instance", + "optional": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Instance resource group", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "status_reasons", "type": "TypeList", + "description": "The reasons for the current status (if any).", "computed": true, "elem": { - "id": { - "name": "id", - "type": "TypeString", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "computed": true - }, - "volume_crn": { - "name": "volume_crn", + "code": { + "name": "code", "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason", "computed": true }, - "volume_id": { - "name": "volume_id", + "message": { + "name": "message", "type": "TypeString", + "description": "An explanation of the status reason", "computed": true }, - "volume_name": { - "name": "volume_name", + "more_info": { + "name": "more_info", "type": "TypeString", + "description": "Link to documentation about this status reason", "computed": true } } }, { - "name": "auto_delete_volume", - "type": "TypeBool", - "description": "Auto delete volume along with instance", - "optional": true - }, - { - "name": "vcpu", + "name": "lifecycle_reasons", "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", "computed": true, "elem": { - "architecture": { - "name": "architecture", + "code": { + "name": "code", "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", "computed": true }, - "count": { - "name": "count", - "type": "TypeInt", + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", "computed": true }, - "manufacturer": { - "name": "manufacturer", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The VCPU manufacturer", + "description": "Link to documentation about the reason for this lifecycle state.", "computed": true } } }, { - "name": "instance_template", - "type": "TypeString", - "description": "Id of the instance template", - "immutable": true, - "optional": true - }, - { - "name": "placement_group", + "name": "availability_policy_host_failure", "type": "TypeString", - "description": "Unique Identifier of the Placement Group for restricting the placement of the instance", - "immutable": true, - "optional": true - }, - { - "name": "wait_before_delete", - "type": "TypeBool", - "description": "Enables stopping of instance before deleting and waits till deletion is complete", - "default_value": true, - "optional": true - }, - { - "name": "bandwidth", - "type": "TypeInt", - "description": "The total bandwidth (in megabits per second) shared across the instance's network interfaces and storage volumes", + "description": "The availability policy to use for this virtual server instance", + "options": "restart, stop", + "optional": true, "computed": true }, { - "name": "primary_network_interface", + "name": "network_interfaces", "type": "TypeList", - "description": "Primary Network interface info", "optional": true, "computed": true, "elem": { @@ -121595,13 +125924,6 @@ "optional": true, "computed": true }, - "port_speed": { - "name": "port_speed", - "type": "TypeInt", - "optional": true, - "computed": true, - "deprecated": "This field is deprected" - }, "primary_ip": { "name": "primary_ip", "type": "TypeList", @@ -121641,7 +125963,6 @@ "name": "reserved_ip", "type": "TypeString", "description": "Identifies a reserved IP by a unique property.", - "immutable": true, "optional": true, "computed": true }, @@ -121677,42 +125998,59 @@ "immutable": true, "required": true } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true + } }, { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", + "name": "memory", + "type": "TypeInt", + "description": "Instance memory", "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Instance name", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + "name": "metadata_service_enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", + "optional": true, + "computed": true, + "deprecated": "Use metadata_service instead" }, { - "name": "dedicated_host", - "type": "TypeString", - "description": "Unique Identifier of the Dedicated Host where the instance will be placed", - "optional": true + "name": "metadata_service", + "type": "TypeList", + "description": "The metadata service configuration", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", + "optional": true, + "computed": true + }, + "protocol": { + "name": "protocol", + "type": "TypeString", + "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", + "optional": true, + "computed": true + }, + "response_hop_limit": { + "name": "response_hop_limit", + "type": "TypeInt", + "description": "The hop limit (IP time to live) for IP response packets from the metadata service", + "optional": true, + "computed": true + } + }, + "max_items": 1, + "min_items": 1 }, { - "name": "dedicated_host_group", + "name": "resource_group_name", "type": "TypeString", - "description": "Unique Identifier of the Dedicated Host Group where the instance will be placed", - "optional": true + "description": "The resource group name in which resource is provisioned", + "computed": true }, { "name": "catalog_offering", @@ -121739,182 +126077,42 @@ "max_items": 1 }, { - "name": "gpu", - "type": "TypeList", - "description": "The virtual server instance GPU configuration", - "computed": true, - "elem": { - "count": { - "name": "count", - "type": "TypeInt", - "description": "The number of GPUs assigned to the instance", - "computed": true - }, - "manufacturer": { - "name": "manufacturer", - "type": "TypeString", - "description": "The GPU manufacturer", - "computed": true - }, - "memory": { - "name": "memory", - "type": "TypeInt", - "description": "The overall amount of GPU memory in GiB (gibibytes)", - "computed": true - }, - "model": { - "name": "model", - "type": "TypeString", - "description": "The GPU model", - "computed": true - } - } - }, - { - "name": "force_recovery_time", - "type": "TypeInt", - "description": "Define timeout to force the instances to start/stop in minutes.", - "optional": true - }, - { - "name": "zone", + "name": "image", "type": "TypeString", - "description": "Zone name", + "description": "image id", "immutable": true, "optional": true, "computed": true - }, + } + ], + "ibm_is_instance_action": [ { - "name": "profile", + "name": "instance", "type": "TypeString", - "description": "Profile info", - "optional": true, - "computed": true - }, - { - "name": "keys", - "type": "TypeSet", - "description": "SSH key Ids for the instance", - "optional": true, - "elem": { - "type": "TypeString" - } + "description": "Instance identifier", + "immutable": true, + "required": true }, { - "name": "lifecycle_state", + "name": "action", "type": "TypeString", - "description": "The lifecycle state of the virtual server instance.", - "computed": true + "description": "This restart/start/stops an instance.", + "required": true, + "options": "start, reboot, stop" }, { - "name": "metadata_service_enabled", + "name": "force_action", "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", - "optional": true, - "computed": true, - "deprecated": "Use metadata_service instead" - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true + "description": "If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action.", + "default_value": false, + "optional": true }, { - "name": "vpc", + "name": "status", "type": "TypeString", - "description": "VPC id", - "immutable": true, - "optional": true, + "description": "Instance status", "computed": true }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "list of access tags for the instance", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "boot_volume", - "type": "TypeList", - "optional": true, - "computed": true, - "elem": { - "auto_delete_volume": { - "name": "auto_delete_volume", - "type": "TypeBool", - "description": "Auto delete boot volume along with instance", - "default_value": true, - "optional": true - }, - "encryption": { - "name": "encryption", - "type": "TypeString", - "optional": true, - "computed": true - }, - "iops": { - "name": "iops", - "type": "TypeInt", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "optional": true, - "computed": true - }, - "profile": { - "name": "profile", - "type": "TypeString", - "computed": true - }, - "size": { - "name": "size", - "type": "TypeInt", - "optional": true, - "computed": true - }, - "snapshot": { - "name": "snapshot", - "type": "TypeString", - "immutable": true, - "optional": true, - "computed": true - }, - "tags": { - "name": "tags", - "type": "TypeSet", - "description": "UserTags for the volume instance", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - "volume_id": { - "name": "volume_id", - "type": "TypeString", - "description": "The unique identifier for this volume", - "immutable": true, - "optional": true, - "computed": true - } - }, - "max_items": 1 - } - ], - "ibm_is_instance_action": [ { "name": "status_reasons", "type": "TypeList", @@ -121939,33 +126137,6 @@ "computed": true } } - }, - { - "name": "instance", - "type": "TypeString", - "description": "Instance identifier", - "immutable": true, - "required": true - }, - { - "name": "action", - "type": "TypeString", - "description": "This restart/start/stops an instance.", - "required": true, - "options": "start, reboot, stop" - }, - { - "name": "force_action", - "type": "TypeBool", - "description": "If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action.", - "default_value": false, - "optional": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Instance status", - "computed": true } ], "ibm_is_instance_disk_management": [ @@ -121999,12 +126170,13 @@ ], "ibm_is_instance_group": [ { - "name": "resource_group", + "name": "name", "type": "TypeString", - "description": "Resource group ID", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true + "description": "The user-defined name for this instance group", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { "name": "load_balancer", @@ -122013,12 +126185,27 @@ "optional": true }, { - "name": "tags", + "name": "load_balancer_pool", + "type": "TypeString", + "description": "load balancer pool ID", + "optional": true + }, + { + "name": "vpc", + "type": "TypeString", + "description": "vpc instance", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Instance group status - deleting, healthy, scaling, unhealthy", + "computed": true + }, + { + "name": "access_tags", "type": "TypeSet", - "description": "List of tags for instance group", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "description": "List of access management tags", "optional": true, "computed": true, "elem": { @@ -122026,22 +126213,20 @@ } }, { - "name": "instance_count", - "type": "TypeInt", - "description": "The number of instances in the instance group", - "default_value": 0, - "min_value": "0", - "max_value": "1000", - "optional": true + "name": "resource_group", + "type": "TypeString", + "description": "Resource group ID", + "cloud_data_type": "resource_group", + "optional": true, + "computed": true }, { - "name": "subnets", - "type": "TypeList", - "description": "list of subnet IDs", - "required": true, - "elem": { - "type": "TypeString" - } + "name": "application_port", + "type": "TypeInt", + "description": "Used by the instance group when scaling up instances to supply the port for the load balancer pool member.", + "min_value": "1", + "max_value": "65535", + "optional": true }, { "name": "managers", @@ -122053,27 +126238,12 @@ } }, { - "name": "instances", - "type": "TypeInt", - "description": "number of instances in the intances group", - "computed": true - }, - { - "name": "vpc", - "type": "TypeString", - "description": "vpc instance", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Instance group status - deleting, healthy, scaling, unhealthy", - "computed": true - }, - { - "name": "access_tags", + "name": "tags", "type": "TypeSet", - "description": "List of access management tags", + "description": "List of tags for instance group", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "optional": true, "computed": true, "elem": { @@ -122081,13 +126251,13 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this instance group", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + "name": "instance_count", + "type": "TypeInt", + "description": "The number of instances in the instance group", + "default_value": 0, + "min_value": "0", + "max_value": "1000", + "optional": true }, { "name": "instance_template", @@ -122103,45 +126273,45 @@ "computed": true }, { - "name": "application_port", - "type": "TypeInt", - "description": "Used by the instance group when scaling up instances to supply the port for the load balancer pool member.", - "min_value": "1", - "max_value": "65535", - "optional": true + "name": "subnets", + "type": "TypeList", + "description": "list of subnet IDs", + "required": true, + "elem": { + "type": "TypeString" + } }, { - "name": "load_balancer_pool", - "type": "TypeString", - "description": "load balancer pool ID", - "optional": true + "name": "instances", + "type": "TypeInt", + "description": "number of instances in the intances group", + "computed": true } ], "ibm_is_instance_group_manager": [ { - "name": "enable_manager", - "type": "TypeBool", - "description": "enable instance group manager", - "default_value": true, - "optional": true + "name": "instance_group", + "type": "TypeString", + "description": "instance group ID", + "required": true }, { - "name": "manager_type", - "type": "TypeString", - "description": "The type of instance group manager.", - "default_value": "autoscale", - "immutable": true, - "options": "autoscale, scheduled", + "name": "aggregation_window", + "type": "TypeInt", + "description": "The time window in seconds to aggregate metrics prior to evaluation", + "default_value": 90, + "min_value": "90", + "max_value": "600", "optional": true }, { - "name": "policies", - "type": "TypeList", - "description": "list of Policies associated with instancegroup manager", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "min_membership_count", + "type": "TypeInt", + "description": "The minimum number of members in a managed instance group", + "default_value": 1, + "min_value": "1", + "max_value": "1000", + "optional": true }, { "name": "actions", @@ -122175,18 +126345,19 @@ "optional": true }, { - "name": "instance_group", - "type": "TypeString", - "description": "instance group ID", - "required": true + "name": "enable_manager", + "type": "TypeBool", + "description": "enable instance group manager", + "default_value": true, + "optional": true }, { - "name": "aggregation_window", - "type": "TypeInt", - "description": "The time window in seconds to aggregate metrics prior to evaluation", - "default_value": 90, - "min_value": "90", - "max_value": "600", + "name": "manager_type", + "type": "TypeString", + "description": "The type of instance group manager.", + "default_value": "autoscale", + "immutable": true, + "options": "autoscale, scheduled", "optional": true }, { @@ -122206,27 +126377,44 @@ "max_value": "1000", "optional": true }, - { - "name": "min_membership_count", - "type": "TypeInt", - "description": "The minimum number of members in a managed instance group", - "default_value": 1, - "min_value": "1", - "max_value": "1000", - "optional": true - }, { "name": "manager_id", "type": "TypeString", "description": "instance group manager ID", "computed": true + }, + { + "name": "policies", + "type": "TypeList", + "description": "list of Policies associated with instancegroup manager", + "computed": true, + "elem": { + "type": "TypeString" + } } ], "ibm_is_instance_group_manager_action": [ { - "name": "action_id", + "name": "name", "type": "TypeString", - "description": "Instance group manager action ID", + "description": "instance group manager action name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", + "optional": true + }, + { + "name": "max_membership_count", + "type": "TypeInt", + "description": "The maximum number of members in a managed instance group", + "min_value": "1", + "max_value": "1000", + "optional": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date and time that the instance group manager action was modified.", "computed": true }, { @@ -122241,12 +126429,12 @@ "computed": true }, { - "name": "name", + "name": "cron_spec", "type": "TypeString", - "description": "instance group manager action name", - "min_length": 1, + "description": "The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period.", + "min_length": 9, "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", + "matches": "^((((\\d+,)+\\d+|([\\d\\*]+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})$", "optional": true }, { @@ -122258,11 +126446,39 @@ "optional": true }, { - "name": "max_membership_count", - "type": "TypeInt", - "description": "The maximum number of members in a managed instance group", - "min_value": "1", - "max_value": "1000", + "name": "status", + "type": "TypeString", + "description": "The status of the instance group action- `active`: Action is ready to be run- `completed`: Action was completed successfully- `failed`: Action could not be completed successfully- `incompatible`: Action parameters are not compatible with the group or manager- `omitted`: Action was not applied because this action's manager was disabled.", + "computed": true + }, + { + "name": "action_type", + "type": "TypeString", + "description": "The type of action for the instance group.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the instance group manager action was modified.", + "computed": true + }, + { + "name": "action_id", + "type": "TypeString", + "description": "Instance group manager action ID", + "computed": true + }, + { + "name": "instance_group_manager", + "type": "TypeString", + "description": "Instance group manager ID of type scheduled", + "required": true + }, + { + "name": "run_at", + "type": "TypeString", + "description": "The date and time the scheduled action will run.", "optional": true }, { @@ -122280,31 +126496,16 @@ "description": "Instance group manager name of type autoscale.", "computed": true }, - { - "name": "next_run_at", - "type": "TypeString", - "description": "The date and time the scheduled action will next run. If empty the system is currently calculating the next run time.", - "computed": true - }, { "name": "auto_delete", "type": "TypeBool", "computed": true }, { - "name": "run_at", - "type": "TypeString", - "description": "The date and time the scheduled action will run.", - "optional": true - }, - { - "name": "cron_spec", + "name": "instance_group", "type": "TypeString", - "description": "The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period.", - "min_length": 9, - "max_length": 63, - "matches": "^((((\\d+,)+\\d+|([\\d\\*]+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})$", - "optional": true + "description": "instance group ID", + "required": true }, { "name": "target_manager", @@ -122319,17 +126520,13 @@ "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date and time that the instance group manager action was modified.", - "computed": true - }, - { - "name": "action_type", + "name": "next_run_at", "type": "TypeString", - "description": "The type of action for the instance group.", + "description": "The date and time the scheduled action will next run. If empty the system is currently calculating the next run time.", "computed": true - }, + } + ], + "ibm_is_instance_group_manager_policy": [ { "name": "instance_group", "type": "TypeString", @@ -122337,25 +126534,18 @@ "required": true }, { - "name": "status", + "name": "instance_group_manager", "type": "TypeString", - "description": "The status of the instance group action- `active`: Action is ready to be run- `completed`: Action was completed successfully- `failed`: Action could not be completed successfully- `incompatible`: Action parameters are not compatible with the group or manager- `omitted`: Action was not applied because this action's manager was disabled.", - "computed": true + "description": "Instance group manager ID", + "required": true }, { - "name": "created_at", + "name": "metric_type", "type": "TypeString", - "description": "The date and time that the instance group manager action was modified.", - "computed": true + "description": "The type of metric to be evaluated", + "required": true, + "options": "cpu,memory,network_in,network_out" }, - { - "name": "instance_group_manager", - "type": "TypeString", - "description": "Instance group manager ID of type scheduled", - "required": true - } - ], - "ibm_is_instance_group_manager_policy": [ { "name": "metric_value", "type": "TypeInt", @@ -122383,28 +126573,24 @@ "max_length": 63, "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", "optional": true - }, - { - "name": "instance_group", - "type": "TypeString", - "description": "instance group ID", - "required": true - }, - { - "name": "instance_group_manager", - "type": "TypeString", - "description": "Instance group manager ID", - "required": true - }, - { - "name": "metric_type", - "type": "TypeString", - "description": "The type of metric to be evaluated", - "required": true, - "options": "cpu,memory,network_in,network_out" } ], "ibm_is_instance_group_membership": [ + { + "name": "instance_group_membership", + "type": "TypeString", + "description": "The unique identifier for this instance group membership.", + "required": true, + "min_length": 1, + "max_length": 64, + "matches": "^[-0-9a-z_]+$" + }, + { + "name": "load_balancer_pool_member", + "type": "TypeString", + "description": "The unique identifier for this load balancer pool member.", + "computed": true + }, { "name": "instance_group", "type": "TypeString", @@ -122431,21 +126617,6 @@ "default_value": false, "optional": true }, - { - "name": "load_balancer_pool_member", - "type": "TypeString", - "description": "The unique identifier for this load balancer pool member.", - "computed": true - }, - { - "name": "instance_group_membership", - "type": "TypeString", - "description": "The unique identifier for this instance group membership.", - "required": true, - "min_length": 1, - "max_length": 64, - "matches": "^[-0-9a-z_]+$" - }, { "name": "delete_instance_on_membership_delete", "type": "TypeBool", @@ -122519,6 +126690,12 @@ "type": "TypeString" } }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the network interface.", + "computed": true + }, { "name": "created_at", "type": "TypeString", @@ -122531,44 +126708,6 @@ "description": "The ID of the floating IP to attach to this network interface", "optional": true }, - { - "name": "instance", - "type": "TypeString", - "description": "The unique identifier of the instance.", - "immutable": true, - "required": true - }, - { - "name": "primary_ipv4_address", - "type": "TypeString", - "description": "The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If unspecified, an available address on the subnet will be automatically selected.", - "immutable": true, - "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$", - "optional": true, - "computed": true, - "deprecated": "primary_ipv4_address is deprecated and support will be removed. Use primary_ip instead" - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this network interface.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this network interface. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "network_interface", - "type": "TypeString", - "description": "The globally unique ID of this network interface", - "computed": true - }, { "name": "floating_ips", "type": "TypeList", @@ -122622,16 +126761,17 @@ } }, { - "name": "status", + "name": "type", "type": "TypeString", - "description": "The status of the network interface.", + "description": "The type of this network interface as it relates to an instance.", "computed": true }, { - "name": "type", + "name": "instance", "type": "TypeString", - "description": "The type of this network interface as it relates to an instance.", - "computed": true + "description": "The unique identifier of the instance.", + "immutable": true, + "required": true }, { "name": "subnet", @@ -122640,13 +126780,6 @@ "immutable": true, "required": true }, - { - "name": "allow_ip_spoofing", - "type": "TypeBool", - "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", - "default_value": false, - "optional": true - }, { "name": "primary_ip", "type": "TypeList", @@ -122699,9 +126832,9 @@ "max_items": 1 }, { - "name": "port_speed", - "type": "TypeInt", - "description": "The network interface port speed in Mbps.", + "name": "href", + "type": "TypeString", + "description": "The URL for this network interface.", "computed": true }, { @@ -122709,29 +126842,47 @@ "type": "TypeString", "description": "The resource type.", "computed": true - } - ], - "ibm_is_instance_network_interface_floating_ip": [ + }, { - "name": "instance", + "name": "allow_ip_spoofing", + "type": "TypeBool", + "description": "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + "default_value": false, + "optional": true + }, + { + "name": "name", "type": "TypeString", - "description": "Instance identifier", - "immutable": true, - "required": true + "description": "The user-defined name for this network interface. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "network_interface", + "name": "primary_ipv4_address", "type": "TypeString", - "description": "Instance network interface identifier", + "description": "The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If unspecified, an available address on the subnet will be automatically selected.", "immutable": true, - "required": true + "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$", + "optional": true, + "computed": true, + "deprecated": "primary_ipv4_address is deprecated and support will be removed. Use primary_ip instead" }, { - "name": "floating_ip", + "name": "network_interface", "type": "TypeString", - "description": "The floating ip identifier of the network interface associated with the Instance", - "required": true + "description": "The globally unique ID of this network interface", + "computed": true }, + { + "name": "port_speed", + "type": "TypeInt", + "description": "The network interface port speed in Mbps.", + "computed": true + } + ], + "ibm_is_instance_network_interface_floating_ip": [ { "name": "address", "type": "TypeString", @@ -122739,9 +126890,10 @@ "computed": true }, { - "name": "name", + "name": "crn", "type": "TypeString", - "description": "Name of the floating IP", + "description": "Floating IP crn", + "cloud_data_type": "crn", "computed": true }, { @@ -122763,154 +126915,33 @@ "computed": true }, { - "name": "crn", - "type": "TypeString", - "description": "Floating IP crn", - "cloud_data_type": "crn", - "computed": true - } - ], - "ibm_is_instance_template": [ - { - "name": "default_trusted_profile_target", - "type": "TypeString", - "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", - "immutable": true, - "optional": true - }, - { - "name": "keys", - "type": "TypeSet", - "description": "SSH key Ids for the instance template", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "dedicated_host_group", - "type": "TypeString", - "description": "Unique Identifier of the Dedicated Host Group where the instance will be placed", - "immutable": true, - "optional": true - }, - { - "name": "placement_group", - "type": "TypeString", - "description": "Unique Identifier of the Placement Group for restricting the placement of the instance", - "immutable": true, - "optional": true - }, - { - "name": "resource_group", + "name": "instance", "type": "TypeString", - "description": "Instance template resource group", - "cloud_data_type": "resource_group", + "description": "Instance identifier", "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Instance Template name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true + "required": true }, { - "name": "vpc", + "name": "network_interface", "type": "TypeString", - "description": "VPC id", + "description": "Instance network interface identifier", "immutable": true, "required": true }, { - "name": "default_trusted_profile_auto_link", - "type": "TypeBool", - "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "placement_target", - "type": "TypeList", - "description": "The placement restrictions for the virtual server instance.", - "computed": true, - "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this placement target.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this placement target.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for this placement target.", - "computed": true - } - } - }, - { - "name": "user_data", + "name": "floating_ip", "type": "TypeString", - "description": "User data given for the instance", - "immutable": true, - "optional": true + "description": "The floating ip identifier of the network interface associated with the Instance", + "required": true }, { - "name": "availability_policy_host_failure", + "name": "name", "type": "TypeString", - "description": "The availability policy to use for this virtual server instance", - "immutable": true, - "options": "restart, stop", - "optional": true, + "description": "Name of the floating IP", "computed": true - }, - { - "name": "metadata_service", - "type": "TypeList", - "description": "The metadata service configuration", - "optional": true, - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", - "immutable": true, - "optional": true, - "computed": true - }, - "protocol": { - "name": "protocol", - "type": "TypeString", - "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", - "immutable": true, - "optional": true, - "computed": true - }, - "response_hop_limit": { - "name": "response_hop_limit", - "type": "TypeInt", - "description": "The hop limit (IP time to live) for IP response packets from the metadata service", - "immutable": true, - "optional": true, - "computed": true - } - }, - "max_items": 1, - "min_items": 1 - }, + } + ], + "ibm_is_instance_template": [ { "name": "dedicated_host", "type": "TypeString", @@ -122919,9 +126950,9 @@ "optional": true }, { - "name": "image", + "name": "placement_group", "type": "TypeString", - "description": "image name", + "description": "Unique Identifier of the Placement Group for restricting the placement of the instance", "immutable": true, "optional": true }, @@ -122950,10 +126981,9 @@ "max_items": 1 }, { - "name": "primary_network_interface", + "name": "network_interfaces", "type": "TypeList", - "description": "Primary Network interface info", - "required": true, + "optional": true, "elem": { "allow_ip_spoofing": { "name": "allow_ip_spoofing", @@ -123031,9 +127061,7 @@ "immutable": true, "required": true } - }, - "max_items": 1, - "min_items": 1 + } }, { "name": "crn", @@ -123042,6 +127070,20 @@ "cloud_data_type": "crn", "computed": true }, + { + "name": "vpc", + "type": "TypeString", + "description": "VPC id", + "immutable": true, + "required": true + }, + { + "name": "profile", + "type": "TypeString", + "description": "Profile info", + "immutable": true, + "required": true + }, { "name": "total_volume_bandwidth", "type": "TypeInt", @@ -123050,6 +127092,15 @@ "min_value": "500", "optional": true }, + { + "name": "keys", + "type": "TypeSet", + "description": "SSH key Ids for the instance template", + "required": true, + "elem": { + "type": "TypeString" + } + }, { "name": "volume_attachments", "type": "TypeList", @@ -123126,9 +127177,98 @@ } }, { - "name": "network_interfaces", + "name": "user_data", + "type": "TypeString", + "description": "User data given for the instance", + "immutable": true, + "optional": true + }, + { + "name": "boot_volume", "type": "TypeList", "optional": true, + "computed": true, + "elem": { + "delete_volume_on_instance_delete": { + "name": "delete_volume_on_instance_delete", + "type": "TypeBool", + "optional": true, + "computed": true + }, + "encryption": { + "name": "encryption", + "type": "TypeString", + "optional": true, + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "optional": true, + "computed": true + }, + "profile": { + "name": "profile", + "type": "TypeString", + "computed": true + }, + "size": { + "name": "size", + "type": "TypeInt", + "computed": true + }, + "tags": { + "name": "tags", + "type": "TypeSet", + "description": "UserTags for the volume instance", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + } + }, + "max_items": 1 + }, + { + "name": "availability_policy_host_failure", + "type": "TypeString", + "description": "The availability policy to use for this virtual server instance", + "immutable": true, + "options": "restart, stop", + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Instance Template name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true + }, + { + "name": "metadata_service_enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", + "immutable": true, + "optional": true, + "computed": true, + "deprecated": "Use metadata_service instead" + }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "immutable": true, + "required": true + }, + { + "name": "primary_network_interface", + "type": "TypeList", + "description": "Primary Network interface info", + "required": true, "elem": { "allow_ip_spoofing": { "name": "allow_ip_spoofing", @@ -123206,122 +127346,150 @@ "immutable": true, "required": true } - } + }, + "max_items": 1, + "min_items": 1 }, { - "name": "boot_volume", - "type": "TypeList", + "name": "resource_group", + "type": "TypeString", + "description": "Instance template resource group", + "cloud_data_type": "resource_group", + "immutable": true, "optional": true, + "computed": true + }, + { + "name": "placement_target", + "type": "TypeList", + "description": "The placement restrictions for the virtual server instance.", "computed": true, "elem": { - "delete_volume_on_instance_delete": { - "name": "delete_volume_on_instance_delete", - "type": "TypeBool", - "optional": true, + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this placement target.", "computed": true }, - "encryption": { - "name": "encryption", + "href": { + "name": "href", "type": "TypeString", - "optional": true, + "description": "The URL for this placement target.", "computed": true }, - "name": { - "name": "name", + "id": { + "name": "id", "type": "TypeString", + "description": "The unique identifier for this placement target.", + "computed": true + } + } + }, + { + "name": "metadata_service", + "type": "TypeList", + "description": "The metadata service configuration", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Indicates whether the metadata service endpoint will be available to the virtual server instance", + "immutable": true, "optional": true, "computed": true }, - "profile": { - "name": "profile", + "protocol": { + "name": "protocol", "type": "TypeString", + "description": "The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is enabled.", + "immutable": true, + "optional": true, "computed": true }, - "size": { - "name": "size", + "response_hop_limit": { + "name": "response_hop_limit", "type": "TypeInt", - "computed": true - }, - "tags": { - "name": "tags", - "type": "TypeSet", - "description": "UserTags for the volume instance", + "description": "The hop limit (IP time to live) for IP response packets from the metadata service", + "immutable": true, "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true } }, - "max_items": 1 + "max_items": 1, + "min_items": 1 }, { - "name": "metadata_service_enabled", + "name": "default_trusted_profile_auto_link", "type": "TypeBool", - "description": "Indicates whether the metadata service endpoint is available to the virtual server instance", + "description": "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", "immutable": true, "optional": true, - "computed": true, - "deprecated": "Use metadata_service instead" + "computed": true }, { - "name": "zone", + "name": "default_trusted_profile_target", "type": "TypeString", - "description": "Zone name", + "description": "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", "immutable": true, - "required": true + "optional": true }, { - "name": "profile", + "name": "dedicated_host_group", "type": "TypeString", - "description": "Profile info", + "description": "Unique Identifier of the Dedicated Host Group where the instance will be placed", "immutable": true, - "required": true + "optional": true + }, + { + "name": "image", + "type": "TypeString", + "description": "image name", + "immutable": true, + "optional": true } ], "ibm_is_instance_volume_attachment": [ { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this volume attachment.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "name": "iops", + "type": "TypeInt", + "description": "The maximum I/O operations per second (IOPS) for the volume.", "optional": true, "computed": true }, { - "name": "volume", + "name": "snapshot", "type": "TypeString", - "description": "Instance id", + "description": "The snapshot of the volume to be attached", "immutable": true, "optional": true, "computed": true }, { - "name": "status", + "name": "version", "type": "TypeString", - "description": "The status of this volume attachment, one of [ attached, attaching, deleting, detaching ]", "computed": true }, { - "name": "type", + "name": "instance", "type": "TypeString", - "description": "The type of volume attachment one of [ boot, data ]", - "computed": true + "description": "Instance id", + "immutable": true, + "required": true }, { - "name": "delete_volume_on_instance_delete", - "type": "TypeBool", - "description": "If set to true, when deleting the instance the volume will also be deleted.", - "optional": true, + "name": "volume_attachment_id", + "type": "TypeString", + "description": "The unique identifier for this volume attachment", "computed": true }, { - "name": "profile", - "type": "TypeString", - "description": "The globally unique name for the volume profile to use for this volume.", - "options": "general-purpose, 5iops-tier, 10iops-tier, custom", + "name": "capacity", + "type": "TypeInt", + "description": "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.", + "min_value": "10", + "max_value": "16000", "optional": true, "computed": true }, @@ -123334,29 +127502,45 @@ "computed": true }, { - "name": "volume_deleted", + "name": "volume_crn", "type": "TypeString", - "description": "Link to documentation about deleted resources", + "description": "The CRN for this volume", "computed": true }, { - "name": "volume_href", + "name": "device", "type": "TypeString", - "description": "The URL for this volume", + "description": "A unique identifier for the device which is exposed to the instance operating system", "computed": true }, { - "name": "device", + "name": "status", "type": "TypeString", - "description": "A unique identifier for the device which is exposed to the instance operating system", + "description": "The status of this volume attachment, one of [ attached, attaching, deleting, detaching ]", "computed": true }, { - "name": "delete_volume_on_attachment_delete", + "name": "type", + "type": "TypeString", + "description": "The type of volume attachment one of [ boot, data ]", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this volume attachment.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true + }, + { + "name": "delete_volume_on_instance_delete", "type": "TypeBool", - "description": "If set to true, when deleting the attachment, the volume will also be deleted. Default value for this true.", - "default_value": true, - "optional": true + "description": "If set to true, when deleting the instance the volume will also be deleted.", + "optional": true, + "computed": true }, { "name": "volume_name", @@ -123382,118 +127566,48 @@ } }, { - "name": "href", + "name": "volume_deleted", "type": "TypeString", - "description": "The URL for this volume attachment", + "description": "Link to documentation about deleted resources", "computed": true }, { - "name": "version", + "name": "href", "type": "TypeString", + "description": "The URL for this volume attachment", "computed": true }, { - "name": "instance", - "type": "TypeString", - "description": "Instance id", - "immutable": true, - "required": true + "name": "delete_volume_on_attachment_delete", + "type": "TypeBool", + "description": "If set to true, when deleting the attachment, the volume will also be deleted. Default value for this true.", + "default_value": true, + "optional": true }, { - "name": "volume_attachment_id", + "name": "volume", "type": "TypeString", - "description": "The unique identifier for this volume attachment", - "computed": true - }, - { - "name": "iops", - "type": "TypeInt", - "description": "The maximum I/O operations per second (IOPS) for the volume.", - "optional": true, - "computed": true - }, - { - "name": "capacity", - "type": "TypeInt", - "description": "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.", - "min_value": "10", - "max_value": "16000", + "description": "Instance id", + "immutable": true, "optional": true, "computed": true }, { - "name": "snapshot", + "name": "profile", "type": "TypeString", - "description": "The snapshot of the volume to be attached", - "immutable": true, + "description": "The globally unique name for the volume profile to use for this volume.", + "options": "general-purpose, 5iops-tier, 10iops-tier, custom", "optional": true, "computed": true }, { - "name": "volume_crn", + "name": "volume_href", "type": "TypeString", - "description": "The CRN for this volume", + "description": "The URL for this volume", "computed": true } ], "ibm_is_ipsec_policy": [ - { - "name": "encryption_algorithm", - "type": "TypeString", - "description": "Encryption algorithm", - "required": true, - "options": "triple_des, aes128, aes256, aes128gcm16, aes192gcm16, aes256gcm16" - }, - { - "name": "pfs", - "type": "TypeString", - "description": "PFS info", - "required": true, - "options": "disabled, group_2, group_5, group_14, group_19, group_15, group_16, group_17, group_18, group_20, group_21, group_22, group_23, group_24, group_31" - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group info", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "IPSEC name", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "key_lifetime", - "type": "TypeInt", - "description": "IPSEC key lifetime", - "default_value": 3600, - "optional": true - }, - { - "name": "encapsulation_mode", - "type": "TypeString", - "description": "IPSEC encapsulation mode", - "computed": true - }, - { - "name": "transform_protocol", - "type": "TypeString", - "description": "IPSEC transform protocol", - "computed": true - }, { "name": "vpn_connections", "type": "TypeList", @@ -123517,9 +127631,9 @@ } }, { - "name": "resource_controller_url", + "name": "resource_name", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The name of the resource", "computed": true }, { @@ -123529,10 +127643,11 @@ "computed": true }, { - "name": "resource_group_name", + "name": "encryption_algorithm", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", - "computed": true + "description": "Encryption algorithm", + "required": true, + "options": "triple_des, aes128, aes256, aes128gcm16, aes192gcm16, aes256gcm16" }, { "name": "authentication_algorithm", @@ -123540,31 +127655,40 @@ "description": "Authentication alorothm", "required": true, "options": "md5, sha1, sha256, sha512, sha384, disabled" - } - ], - "ibm_is_lb": [ + }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "pfs", + "type": "TypeString", + "description": "PFS info", + "required": true, + "options": "disabled, group_2, group_5, group_14, group_19, group_15, group_16, group_17, group_18, group_20, group_21, group_22, group_23, group_24, group_31" }, { - "name": "route_mode", - "type": "TypeBool", - "description": "Indicates whether route mode is enabled for this load balancer", - "default_value": false, + "name": "resource_group", + "type": "TypeString", + "description": "Resource group info", + "cloud_data_type": "resource_group", "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "key_lifetime", + "type": "TypeInt", + "description": "IPSEC key lifetime", + "default_value": 3600, "optional": true }, { - "name": "udp_supported", - "type": "TypeBool", - "description": "Indicates whether this load balancer supports UDP.", + "name": "encapsulation_mode", + "type": "TypeString", + "description": "IPSEC encapsulation mode", + "computed": true + }, + { + "name": "transform_protocol", + "type": "TypeString", + "description": "IPSEC transform protocol", "computed": true }, { @@ -123576,72 +127700,33 @@ { "name": "name", "type": "TypeString", - "description": "Load Balancer name", + "description": "IPSEC name", "required": true, "min_length": 1, "max_length": 63, "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "type", - "type": "TypeString", - "description": "Load Balancer type", - "default_value": "public", - "immutable": true, - "options": "public, private", - "optional": true - }, - { - "name": "dns", - "type": "TypeList", - "description": "The DNS configuration for this load balancer.", - "optional": true, - "elem": { - "instance_crn": { - "name": "instance_crn", - "type": "TypeString", - "description": "The CRN for this DNS instance", - "required": true - }, - "zone_id": { - "name": "zone_id", - "type": "TypeString", - "description": "The unique identifier of the DNS zone.", - "required": true - } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "status", - "type": "TypeString", - "computed": true - }, - { - "name": "crn", + "name": "resource_group_name", "type": "TypeString", - "description": "The CRN for this Load Balancer", - "cloud_data_type": "crn", + "description": "The resource group name in which resource is provisioned", "computed": true - }, + } + ], + "ibm_is_lb": [ { - "name": "operating_status", + "name": "profile", "type": "TypeString", + "description": "The profile to use for this load balancer.", + "immutable": true, + "options": "network-fixed", + "optional": true, "computed": true }, { - "name": "security_group_supported", - "type": "TypeBool", - "description": "Security Group Supported for this Load Balancer", - "computed": true - }, - { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "description": "List of access management tags", "optional": true, "computed": true, "elem": { @@ -123649,25 +127734,22 @@ } }, { - "name": "logging", + "name": "route_mode", "type": "TypeBool", - "description": "Logging of Load Balancer", + "description": "Indicates whether route mode is enabled for this load balancer", "default_value": false, + "immutable": true, "optional": true }, { - "name": "resource_group_name", + "name": "hostname", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "public_ips", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "status", + "type": "TypeString", + "computed": true }, { "name": "private_ips", @@ -123715,6 +127797,45 @@ } } }, + { + "name": "security_group_supported", + "type": "TypeBool", + "description": "Security Group Supported for this Load Balancer", + "computed": true + }, + { + "name": "type", + "type": "TypeString", + "description": "Load Balancer type", + "default_value": "public", + "immutable": true, + "options": "public, private", + "optional": true + }, + { + "name": "tags", + "type": "TypeSet", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "udp_supported", + "type": "TypeBool", + "description": "Indicates whether this load balancer supports UDP.", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, { "name": "security_groups", "type": "TypeSet", @@ -123734,8 +127855,9 @@ "computed": true }, { - "name": "hostname", + "name": "resource_controller_url", "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -123745,10 +127867,42 @@ "computed": true }, { - "name": "version", + "name": "dns", + "type": "TypeList", + "description": "The DNS configuration for this load balancer.", + "optional": true, + "elem": { + "instance_crn": { + "name": "instance_crn", + "type": "TypeString", + "description": "The CRN for this DNS instance", + "required": true + }, + "zone_id": { + "name": "zone_id", + "type": "TypeString", + "description": "The unique identifier of the DNS zone.", + "required": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "crn", "type": "TypeString", + "description": "The CRN for this Load Balancer", + "cloud_data_type": "crn", "computed": true }, + { + "name": "public_ips", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "subnets", "type": "TypeSet", @@ -123761,34 +127915,33 @@ "min_items": 1 }, { - "name": "profile", + "name": "version", "type": "TypeString", - "description": "The profile to use for this load balancer.", - "immutable": true, - "options": "network-fixed", - "optional": true, "computed": true - } - ], - "ibm_is_lb_listener": [ - { - "name": "https_redirect_listener", - "type": "TypeString", - "description": "ID of the listener that will be set as http redirect target", - "optional": true }, { - "name": "default_pool", + "name": "name", "type": "TypeString", - "description": "Loadbalancer default pool info", - "optional": true, - "computed": true + "description": "Load Balancer name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "listener_id", + "name": "operating_status", "type": "TypeString", "computed": true }, + { + "name": "logging", + "type": "TypeBool", + "description": "Logging of Load Balancer", + "default_value": false, + "optional": true + } + ], + "ibm_is_lb_listener": [ { "name": "lb", "type": "TypeString", @@ -123797,38 +127950,9 @@ "required": true }, { - "name": "idle_connection_timeout", - "type": "TypeInt", - "description": "idle connection timeout of listener", - "min_value": "50", - "max_value": "7200", - "optional": true, - "computed": true - }, - { - "name": "certificate_instance", + "name": "status", "type": "TypeString", - "description": "certificate instance for the Loadbalancer", - "optional": true - }, - { - "name": "accept_proxy_protocol", - "type": "TypeBool", - "description": "Listener will forward proxy protocol", - "optional": true, - "computed": true - }, - { - "name": "https_redirect_status_code", - "type": "TypeInt", - "description": "The HTTP status code to be returned in the redirect response", - "optional": true - }, - { - "name": "port", - "type": "TypeInt", - "description": "Loadbalancer listener port", - "optional": true, + "description": "Loadbalancer listener status", "computed": true }, { @@ -123838,18 +127962,6 @@ "optional": true, "computed": true }, - { - "name": "status", - "type": "TypeString", - "description": "Loadbalancer listener status", - "computed": true - }, - { - "name": "related_crn", - "type": "TypeString", - "description": "The crn of the LB resource", - "computed": true - }, { "name": "port_max", "type": "TypeInt", @@ -123858,71 +127970,48 @@ "computed": true }, { - "name": "protocol", - "type": "TypeString", - "description": "Loadbalancer protocol", - "required": true, - "options": "https, http, tcp, udp" - }, - { - "name": "https_redirect_uri", - "type": "TypeString", - "description": "Target URI where traffic will be redirected", - "optional": true - }, - { - "name": "connection_limit", - "type": "TypeInt", - "description": "Connection limit for Loadbalancer", - "optional": true - } - ], - "ibm_is_lb_listener_policy": [ - { - "name": "target_id", + "name": "certificate_instance", "type": "TypeString", - "description": "Listener Policy Target ID", - "optional": true - }, - { - "name": "target_http_status_code", - "type": "TypeInt", - "description": "Listener Policy target HTTPS Status code.", + "description": "certificate instance for the Loadbalancer", "optional": true }, { - "name": "target_https_redirect_status_code", + "name": "https_redirect_status_code", "type": "TypeInt", "description": "The HTTP status code to be returned in the redirect response", "optional": true }, { - "name": "target_https_redirect_uri", + "name": "default_pool", "type": "TypeString", - "description": "Target URI where traffic will be redirected", - "optional": true + "description": "Loadbalancer default pool info", + "optional": true, + "computed": true }, { - "name": "name", + "name": "protocol", "type": "TypeString", - "description": "Policy name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "description": "Loadbalancer protocol", + "required": true, + "options": "https, http, tcp, udp" + }, + { + "name": "accept_proxy_protocol", + "type": "TypeBool", + "description": "Listener will forward proxy protocol", "optional": true, "computed": true }, { - "name": "policy_id", + "name": "https_redirect_uri", "type": "TypeString", - "description": "Listener Policy ID", - "computed": true + "description": "Target URI where traffic will be redirected", + "optional": true }, { - "name": "target_url", + "name": "listener_id", "type": "TypeString", - "description": "Policy Target URL", - "optional": true + "computed": true }, { "name": "related_crn", @@ -123931,25 +128020,35 @@ "computed": true }, { - "name": "lb", - "type": "TypeString", - "description": "Load Balancer Listener Policy", - "immutable": true, - "required": true + "name": "idle_connection_timeout", + "type": "TypeInt", + "description": "idle connection timeout of listener", + "min_value": "50", + "max_value": "7200", + "optional": true, + "computed": true }, { - "name": "listener", + "name": "port", + "type": "TypeInt", + "description": "Loadbalancer listener port", + "optional": true, + "computed": true + }, + { + "name": "https_redirect_listener", "type": "TypeString", - "description": "Listener ID", - "immutable": true, - "required": true + "description": "ID of the listener that will be set as http redirect target", + "optional": true }, { - "name": "priority", + "name": "connection_limit", "type": "TypeInt", - "description": "Listener Policy Priority", - "required": true - }, + "description": "Connection limit for Loadbalancer", + "optional": true + } + ], + "ibm_is_lb_listener_policy": [ { "name": "provisioning_status", "type": "TypeString", @@ -123957,18 +128056,20 @@ "computed": true }, { - "name": "target_https_redirect_listener", + "name": "target_https_redirect_uri", "type": "TypeString", - "description": "ID of the listener that will be set as http redirect target", + "description": "Target URI where traffic will be redirected", "optional": true }, { - "name": "action", + "name": "name", "type": "TypeString", - "description": "Policy Action", - "immutable": true, - "required": true, - "options": "forward, redirect, reject, https_redirect" + "description": "Policy name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true }, { "name": "rules", @@ -124008,33 +128109,85 @@ "required": true } } - } - ], - "ibm_is_lb_listener_policy_rule": [ + }, { - "name": "value", + "name": "policy_id", "type": "TypeString", - "description": "policy rule value info", + "description": "Listener Policy ID", + "computed": true + }, + { + "name": "listener", + "type": "TypeString", + "description": "Listener ID", + "immutable": true, "required": true }, { - "name": "field", + "name": "action", + "type": "TypeString", + "description": "Policy Action", + "immutable": true, + "required": true, + "options": "forward, redirect, reject, https_redirect" + }, + { + "name": "priority", + "type": "TypeInt", + "description": "Listener Policy Priority", + "required": true + }, + { + "name": "target_url", "type": "TypeString", + "description": "Policy Target URL", "optional": true }, { - "name": "policy", + "name": "related_crn", "type": "TypeString", - "description": "Listener Policy ID", + "description": "The crn of the LB resource", + "computed": true + }, + { + "name": "lb", + "type": "TypeString", + "description": "Load Balancer Listener Policy", "immutable": true, "required": true }, { - "name": "condition", + "name": "target_https_redirect_listener", "type": "TypeString", - "description": "Condition info of the rule.", - "required": true, - "options": "contains, equals, matches_regex" + "description": "ID of the listener that will be set as http redirect target", + "optional": true + }, + { + "name": "target_http_status_code", + "type": "TypeInt", + "description": "Listener Policy target HTTPS Status code.", + "optional": true + }, + { + "name": "target_https_redirect_status_code", + "type": "TypeInt", + "description": "The HTTP status code to be returned in the redirect response", + "optional": true + }, + { + "name": "target_id", + "type": "TypeString", + "description": "Listener Policy Target ID", + "optional": true + } + ], + "ibm_is_lb_listener_policy_rule": [ + { + "name": "policy", + "type": "TypeString", + "description": "Listener Policy ID", + "immutable": true, + "required": true }, { "name": "type", @@ -124044,19 +128197,18 @@ "options": "header, hostname, path, body, query" }, { - "name": "rule", + "name": "field", "type": "TypeString", - "computed": true + "optional": true }, { - "name": "provisioning_status", + "name": "rule", "type": "TypeString", "computed": true }, { - "name": "related_crn", + "name": "provisioning_status", "type": "TypeString", - "description": "The crn of the LB resource", "computed": true }, { @@ -124072,6 +128224,25 @@ "description": "Listener ID.", "immutable": true, "required": true + }, + { + "name": "condition", + "type": "TypeString", + "description": "Condition info of the rule.", + "required": true, + "options": "contains, equals, matches_regex" + }, + { + "name": "value", + "type": "TypeString", + "description": "policy rule value info", + "required": true + }, + { + "name": "related_crn", + "type": "TypeString", + "description": "The crn of the LB resource", + "computed": true } ], "ibm_is_lb_pool": [ @@ -124097,29 +128268,37 @@ "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "session_persistence_type", + "name": "algorithm", "type": "TypeString", - "description": "Load Balancer Pool session persisence type.", - "options": "source_ip, app_cookie, http_cookie", - "optional": true + "description": "Load Balancer Pool algorithm", + "required": true, + "options": "round_robin, weighted_round_robin, least_connections" }, { - "name": "provisioning_status", + "name": "protocol", "type": "TypeString", - "description": "Status of the LB Pool", - "computed": true + "description": "Load Balancer Protocol", + "required": true, + "options": "http, tcp, https, udp" }, { - "name": "health_monitor_url", + "name": "health_timeout", + "type": "TypeInt", + "description": "Load Balancer health timeout interval", + "required": true + }, + { + "name": "proxy_protocol", "type": "TypeString", - "description": "Health monitor URL of LB Pool", + "description": "PROXY protocol setting for this pool", + "options": "disabled, v1, v2", "optional": true, "computed": true }, { - "name": "health_monitor_port", - "type": "TypeInt", - "description": "Health monitor Port the LB Pool", + "name": "health_monitor_url", + "type": "TypeString", + "description": "Health monitor URL of LB Pool", "optional": true, "computed": true }, @@ -124132,13 +128311,6 @@ "matches": "^[-A-Za-z0-9!#$%\u0026'*+.^_`~|]+$", "optional": true }, - { - "name": "health_type", - "type": "TypeString", - "description": "Load Balancer health type", - "required": true, - "options": "http, tcp, https, udp" - }, { "name": "lb", "type": "TypeString", @@ -124147,53 +128319,58 @@ "required": true }, { - "name": "algorithm", + "name": "health_delay", + "type": "TypeInt", + "description": "Load Blancer health delay time period", + "required": true + }, + { + "name": "health_type", "type": "TypeString", - "description": "Load Balancer Pool algorithm", + "description": "Load Balancer health type", "required": true, - "options": "round_robin, weighted_round_robin, least_connections" + "options": "http, tcp, https, udp" }, { - "name": "health_timeout", + "name": "health_retries", "type": "TypeInt", - "description": "Load Balancer health timeout interval", + "description": "Load Balancer health retry count", "required": true }, { - "name": "session_persistence_http_cookie_name", - "type": "TypeString", - "description": "Load Balancer Pool session persisence http cookie name.", - "computed": true - }, - { - "name": "proxy_protocol", - "type": "TypeString", - "description": "PROXY protocol setting for this pool", - "options": "disabled, v1, v2", + "name": "health_monitor_port", + "type": "TypeInt", + "description": "Health monitor Port the LB Pool", "optional": true, "computed": true }, { - "name": "protocol", + "name": "session_persistence_type", "type": "TypeString", - "description": "Load Balancer Protocol", - "required": true, - "options": "http, tcp, https, udp" + "description": "Load Balancer Pool session persisence type.", + "options": "source_ip, app_cookie, http_cookie", + "optional": true }, { - "name": "health_delay", - "type": "TypeInt", - "description": "Load Blancer health delay time period", - "required": true + "name": "session_persistence_http_cookie_name", + "type": "TypeString", + "description": "Load Balancer Pool session persisence http cookie name.", + "computed": true }, { - "name": "health_retries", - "type": "TypeInt", - "description": "Load Balancer health retry count", - "required": true + "name": "provisioning_status", + "type": "TypeString", + "description": "Status of the LB Pool", + "computed": true } ], "ibm_is_lb_pool_member": [ + { + "name": "related_crn", + "type": "TypeString", + "description": "The crn of the LB resource", + "computed": true + }, { "name": "pool", "type": "TypeString", @@ -124202,25 +128379,22 @@ "required": true }, { - "name": "lb", - "type": "TypeString", - "description": "Load balancer ID", - "immutable": true, + "name": "port", + "type": "TypeInt", + "description": "Load Balancer Pool port", "required": true }, { - "name": "target_id", + "name": "target_address", "type": "TypeString", - "description": "Load balancer pool member target id", + "description": "Load balancer pool member target address", "optional": true, "computed": true }, { - "name": "weight", - "type": "TypeInt", - "description": "Load balcner pool member weight", - "min_value": "0", - "max_value": "100", + "name": "target_id", + "type": "TypeString", + "description": "Load balancer pool member target id", "optional": true, "computed": true }, @@ -124231,21 +128405,18 @@ "computed": true }, { - "name": "related_crn", + "name": "lb", "type": "TypeString", - "description": "The crn of the LB resource", - "computed": true - }, - { - "name": "port", - "type": "TypeInt", - "description": "Load Balancer Pool port", + "description": "Load balancer ID", + "immutable": true, "required": true }, { - "name": "target_address", - "type": "TypeString", - "description": "Load balancer pool member target address", + "name": "weight", + "type": "TypeInt", + "description": "Load balcner pool member weight", + "min_value": "0", + "max_value": "100", "optional": true, "computed": true }, @@ -124263,41 +128434,6 @@ } ], "ibm_is_network_acl": [ - { - "name": "vpc", - "type": "TypeString", - "description": "Network ACL VPC name", - "immutable": true, - "optional": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group ID for the network ACL", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, { "name": "resource_crn", "type": "TypeString", @@ -124441,6 +128577,42 @@ } } }, + { + "name": "vpc", + "type": "TypeString", + "description": "Network ACL VPC name", + "immutable": true, + "optional": true + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The crn of the resource", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -124451,6 +128623,15 @@ "optional": true, "computed": true }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource group ID for the network ACL", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "tags", "type": "TypeSet", @@ -124463,71 +128644,67 @@ "elem": { "type": "TypeString" } - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } } ], "ibm_is_network_acl_rule": [ { - "name": "protocol", - "type": "TypeString", - "description": "The protocol of the rule.", - "computed": true - }, - { - "name": "source", - "type": "TypeString", - "description": "The source CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", - "required": true - }, - { - "name": "icmp", + "name": "tcp", "type": "TypeList", "immutable": true, "optional": true, "elem": { - "code": { - "name": "code", + "port_max": { + "name": "port_max", "type": "TypeInt", - "description": "The ICMP traffic code to allow. Valid values from 0 to 255.", + "description": "The highest port in the range of ports to be matched", + "default_value": 65535, "optional": true }, - "type": { - "name": "type", + "port_min": { + "name": "port_min", "type": "TypeInt", - "description": "The ICMP traffic type to allow. Valid values from 0 to 254.", + "description": "The lowest port in the range of ports to be matched", + "default_value": 1, + "optional": true + }, + "source_port_max": { + "name": "source_port_max", + "type": "TypeInt", + "description": "The highest port in the range of ports to be matched", + "default_value": 65535, + "optional": true + }, + "source_port_min": { + "name": "source_port_min", + "type": "TypeInt", + "description": "The lowest port in the range of ports to be matched", + "default_value": 1, "optional": true } }, "max_items": 1 }, { - "name": "rule_id", + "name": "source", "type": "TypeString", - "description": "The network acl rule id.", - "computed": true + "description": "The source CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", + "required": true }, { - "name": "before", + "name": "destination", "type": "TypeString", - "description": "The rule that this rule is immediately before. If absent, this is the last rule.", - "optional": true, - "computed": true + "description": "The destination CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", + "required": true }, { - "name": "action", + "name": "network_acl", "type": "TypeString", - "description": "Whether to allow or deny matching traffic", + "description": "Network ACL id", + "immutable": true, "required": true, - "options": "allow, deny" + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { "name": "href", @@ -124536,13 +128713,11 @@ "computed": true }, { - "name": "name", + "name": "action", "type": "TypeString", - "description": "The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true + "description": "Whether to allow or deny matching traffic", + "required": true, + "options": "allow, deny" }, { "name": "ip_version", @@ -124558,42 +128733,47 @@ "options": "inbound, outbound" }, { - "name": "tcp", + "name": "icmp", "type": "TypeList", "immutable": true, "optional": true, "elem": { - "port_max": { - "name": "port_max", - "type": "TypeInt", - "description": "The highest port in the range of ports to be matched", - "default_value": 65535, - "optional": true - }, - "port_min": { - "name": "port_min", - "type": "TypeInt", - "description": "The lowest port in the range of ports to be matched", - "default_value": 1, - "optional": true - }, - "source_port_max": { - "name": "source_port_max", + "code": { + "name": "code", "type": "TypeInt", - "description": "The highest port in the range of ports to be matched", - "default_value": 65535, + "description": "The ICMP traffic code to allow. Valid values from 0 to 255.", "optional": true }, - "source_port_min": { - "name": "source_port_min", + "type": { + "name": "type", "type": "TypeInt", - "description": "The lowest port in the range of ports to be matched", - "default_value": 1, + "description": "The ICMP traffic type to allow. Valid values from 0 to 254.", "optional": true } }, "max_items": 1 }, + { + "name": "rule_id", + "type": "TypeString", + "description": "The network acl rule id.", + "computed": true + }, + { + "name": "protocol", + "type": "TypeString", + "description": "The protocol of the rule.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true + }, { "name": "udp", "type": "TypeList", @@ -124632,20 +128812,11 @@ "max_items": 1 }, { - "name": "network_acl", - "type": "TypeString", - "description": "Network ACL id", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "destination", + "name": "before", "type": "TypeString", - "description": "The destination CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", - "required": true + "description": "The rule that this rule is immediately before. If absent, this is the last rule.", + "optional": true, + "computed": true } ], "ibm_is_placement_group": [ @@ -124659,17 +128830,10 @@ "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "min_length": 1, - "max_length": 128, - "matches": "^([ ]*[A-Za-z0-9:_.-]+[ ]*)+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the placement group was created.", + "computed": true }, { "name": "crn", @@ -124679,15 +128843,9 @@ "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "The URL for this placement group.", - "computed": true - }, - { - "name": "resource_type", + "name": "lifecycle_state", "type": "TypeString", - "description": "The resource type.", + "description": "The lifecycle state of the placement group.", "computed": true }, { @@ -124721,35 +128879,12 @@ } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the placement group was created.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the placement group.", - "computed": true - } - ], - "ibm_is_public_gateway": [ - { - "name": "resource_group", - "type": "TypeString", - "description": "Public gateway resource group info", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "tags", + "name": "access_tags", "type": "TypeSet", - "description": "Service tags for the public gateway instance", + "description": "List of access management tags", "min_length": 1, "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "matches": "^([ ]*[A-Za-z0-9:_.-]+[ ]*)+$", "optional": true, "computed": true, "elem": { @@ -124757,11 +128892,19 @@ } }, { - "name": "resource_group_name", + "name": "href", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The URL for this placement group.", "computed": true }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + ], + "ibm_is_public_gateway": [ { "name": "name", "type": "TypeString", @@ -124771,6 +128914,30 @@ "max_length": 63, "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, + { + "name": "status", + "type": "TypeString", + "description": "Public gateway instance status", + "computed": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, { "name": "floating_ip", "type": "TypeMap", @@ -124778,23 +128945,25 @@ "computed": true }, { - "name": "zone", + "name": "resource_group", "type": "TypeString", - "description": "Public gateway zone info", + "description": "Public gateway resource group info", + "cloud_data_type": "resource_group", "immutable": true, - "required": true + "optional": true, + "computed": true }, { - "name": "crn", + "name": "zone", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", - "computed": true + "description": "Public gateway zone info", + "immutable": true, + "required": true }, { - "name": "resource_status", + "name": "resource_controller_url", "type": "TypeString", - "description": "The status of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -124805,21 +128974,25 @@ "required": true }, { - "name": "resource_controller_url", + "name": "crn", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "status", + "name": "resource_status", "type": "TypeString", - "description": "Public gateway instance status", + "description": "The status of the resource", "computed": true }, { - "name": "access_tags", + "name": "tags", "type": "TypeSet", - "description": "List of access management tags", + "description": "Service tags for the public gateway instance", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "optional": true, "computed": true, "elem": { @@ -124827,25 +129000,46 @@ } }, { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_is_security_group": [ { "name": "resource_crn", "type": "TypeString", "description": "The crn of the resource", "computed": true - } - ], - "ibm_is_security_group": [ + }, { - "name": "resource_group_name", + "name": "name", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Security group name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, "computed": true }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "rules", "type": "TypeList", @@ -124897,6 +129091,15 @@ } } }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource Group ID", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "resource_name", "type": "TypeString", @@ -124904,17 +129107,17 @@ "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "vpc", + "type": "TypeString", + "description": "Security group's resource group id", + "immutable": true, + "required": true }, { "name": "access_tags", @@ -124933,53 +129136,20 @@ "cloud_data_type": "crn", "computed": true }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource Group ID", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "resource_controller_url", "type": "TypeString", "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true - }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Security group name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true - }, - { - "name": "vpc", - "type": "TypeString", - "description": "Security group's resource group id", - "immutable": true, - "required": true } ], "ibm_is_security_group_rule": [ { - "name": "ip_version", + "name": "direction", "type": "TypeString", - "description": "IP version: ipv4", - "default_value": "ipv4", - "options": "ipv4", - "optional": true + "description": "Direction of traffic to enforce, either inbound or outbound", + "required": true, + "options": "inbound, outbound" }, { "name": "remote", @@ -124989,32 +129159,28 @@ "computed": true }, { - "name": "icmp", + "name": "tcp", "type": "TypeList", - "description": "protocol=icmp", + "description": "protocol=tcp", "immutable": true, "optional": true, "elem": { - "code": { - "name": "code", + "port_max": { + "name": "port_max", "type": "TypeInt", + "default_value": 65535, "optional": true }, - "type": { - "name": "type", + "port_min": { + "name": "port_min", "type": "TypeInt", + "default_value": 1, "optional": true } }, "max_items": 1, "min_items": 1 }, - { - "name": "related_crn", - "type": "TypeString", - "description": "The crn of the Security Group", - "computed": true - }, { "name": "protocol", "type": "TypeString", @@ -125035,29 +129201,28 @@ "computed": true }, { - "name": "direction", + "name": "ip_version", "type": "TypeString", - "description": "Direction of traffic to enforce, either inbound or outbound", - "required": true, - "options": "inbound, outbound" + "description": "IP version: ipv4", + "default_value": "ipv4", + "options": "ipv4", + "optional": true }, { - "name": "tcp", + "name": "icmp", "type": "TypeList", - "description": "protocol=tcp", + "description": "protocol=icmp", "immutable": true, "optional": true, "elem": { - "port_max": { - "name": "port_max", + "code": { + "name": "code", "type": "TypeInt", - "default_value": 65535, "optional": true }, - "port_min": { - "name": "port_min", + "type": { + "name": "type", "type": "TypeInt", - "default_value": 1, "optional": true } }, @@ -125086,15 +129251,15 @@ }, "max_items": 1, "min_items": 1 - } - ], - "ibm_is_security_group_target": [ + }, { - "name": "name", + "name": "related_crn", "type": "TypeString", - "description": "Security group target name", + "description": "The crn of the Security Group", "computed": true - }, + } + ], + "ibm_is_security_group_target": [ { "name": "crn", "type": "TypeString", @@ -125127,29 +129292,15 @@ "min_length": 1, "max_length": 64, "matches": "^[-0-9a-z_]+$" + }, + { + "name": "name", + "type": "TypeString", + "description": "Security group target name", + "computed": true } ], "ibm_is_share": [ - { - "name": "zone", - "type": "TypeString", - "description": "The globally unique name of the zone this file share will reside in.", - "immutable": true, - "required": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "User Tags for the file share", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "access_tags", "type": "TypeSet", @@ -125168,40 +129319,32 @@ "computed": true }, { - "name": "replication_cron_spec", - "type": "TypeString", - "description": "The cron specification for the file share replication schedule.Replication of a share can be scheduled to occur at most once per hour.", - "optional": true, - "computed": true - }, - { - "name": "replication_role", - "type": "TypeString", - "description": "The replication role of the file share.* `none`: This share is not participating in replication.* `replica`: This share is a replication target.* `source`: This share is a replication source.", - "computed": true - }, - { - "name": "replication_status", + "name": "href", "type": "TypeString", - "description": "The replication status of the file share.* `initializing`: This share is initializing replication.* `active`: This share is actively participating in replication.* `failover_pending`: This share is performing a replication failover.* `split_pending`: This share is performing a replication split.* `none`: This share is not participating in replication.* `degraded`: This share's replication sync is degraded.* `sync_pending`: This share is performing a replication sync.", + "description": "The URL for this share.", "computed": true }, { - "name": "last_sync_at", + "name": "encryption_key", "type": "TypeString", - "description": "The date and time that the file share was last synchronized to its replica.This property will be present when the `replication_role` is `source`.", + "description": "The CRN of the key to use for encrypting this file share.If no encryption key is provided, the share will not be encrypted.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "encryption", - "type": "TypeString", - "description": "The type of encryption used for this file share.", + "name": "iops", + "type": "TypeInt", + "description": "The maximum input/output operation performance bandwidth per second for the file share.", + "min_value": "100", + "max_value": "96000", + "optional": true, "computed": true }, { - "name": "resource_type", + "name": "replication_role", "type": "TypeString", - "description": "The type of resource referenced.", + "description": "The replication role of the file share.* `none`: This share is not participating in replication.* `replica`: This share is a replication target.* `source`: This share is a replication source.", "computed": true }, { @@ -125211,51 +129354,11 @@ "computed": true }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the file share is created.", - "computed": true - }, - { - "name": "initial_owner", - "type": "TypeList", - "description": "The owner assigned to the file share at creation.", - "immutable": true, - "optional": true, - "elem": { - "gid": { - "name": "gid", - "type": "TypeInt", - "description": "The initial group identifier for the file share.", - "immutable": true, - "optional": true - }, - "uid": { - "name": "uid", - "type": "TypeInt", - "description": "The initial user identifier for the file share.", - "immutable": true, - "optional": true - } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "name", - "type": "TypeString", - "description": "The unique user-defined name for this file share. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" - }, - { - "name": "source_share", + "name": "zone", "type": "TypeString", - "description": "The ID of the source file share for this replica file share. The specified file share must not already have a replica, and must not be a replica.", + "description": "The globally unique name of the zone this file share will reside in.", "immutable": true, - "optional": true + "required": true }, { "name": "replication_status_reasons", @@ -125283,6 +129386,36 @@ } } }, + { + "name": "last_sync_at", + "type": "TypeString", + "description": "The date and time that the file share was last synchronized to its replica.This property will be present when the `replication_role` is `source`.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the file share is created.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier of the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "size", + "type": "TypeInt", + "description": "The size of the file share rounded up to the next gigabyte.", + "min_value": "10", + "max_value": "32000", + "optional": true, + "computed": true + }, { "name": "mount_targets", "type": "TypeList", @@ -125442,14 +129575,39 @@ } }, { - "name": "iops", - "type": "TypeInt", - "description": "The maximum input/output operation performance bandwidth per second for the file share.", - "min_value": "100", - "max_value": "96000", + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this file share. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" + }, + { + "name": "replication_cron_spec", + "type": "TypeString", + "description": "The cron specification for the file share replication schedule.Replication of a share can be scheduled to occur at most once per hour.", "optional": true, "computed": true }, + { + "name": "encryption", + "type": "TypeString", + "description": "The type of encryption used for this file share.", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The type of resource referenced.", + "computed": true + }, + { + "name": "profile", + "type": "TypeString", + "description": "The globally unique name for this share profile.", + "required": true + }, { "name": "replica_share", "type": "TypeList", @@ -125718,6 +129876,12 @@ }, "max_items": 1 }, + { + "name": "replication_status", + "type": "TypeString", + "description": "The replication status of the file share.* `initializing`: This share is initializing replication.* `active`: This share is actively participating in replication.* `failover_pending`: This share is performing a replication failover.* `split_pending`: This share is performing a replication split.* `none`: This share is not participating in replication.* `degraded`: This share's replication sync is degraded.* `sync_pending`: This share is performing a replication sync.", + "computed": true + }, { "name": "latest_job", "type": "TypeList", @@ -125765,21 +129929,42 @@ } }, { - "name": "encryption_key", - "type": "TypeString", - "description": "The CRN of the key to use for encrypting this file share.If no encryption key is provided, the share will not be encrypted.", - "immutable": true, + "name": "tags", + "type": "TypeSet", + "description": "User Tags for the file share", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "resource_group", - "type": "TypeString", - "description": "The unique identifier of the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", - "cloud_data_type": "resource_group", + "name": "initial_owner", + "type": "TypeList", + "description": "The owner assigned to the file share at creation.", "immutable": true, "optional": true, - "computed": true + "elem": { + "gid": { + "name": "gid", + "type": "TypeInt", + "description": "The initial group identifier for the file share.", + "immutable": true, + "optional": true + }, + "uid": { + "name": "uid", + "type": "TypeInt", + "description": "The initial user identifier for the file share.", + "immutable": true, + "optional": true + } + }, + "max_items": 1, + "min_items": 1 }, { "name": "access_control_mode", @@ -125789,46 +129974,53 @@ "computed": true }, { - "name": "size", - "type": "TypeInt", - "description": "The size of the file share rounded up to the next gigabyte.", - "min_value": "10", - "max_value": "32000", - "optional": true, - "computed": true - }, + "name": "source_share", + "type": "TypeString", + "description": "The ID of the source file share for this replica file share. The specified file share must not already have a replica, and must not be a replica.", + "immutable": true, + "optional": true + } + ], + "ibm_is_share_mount_target": [ { - "name": "href", + "name": "resource_type", "type": "TypeString", - "description": "The URL for this share.", + "description": "The type of resource referenced.", "computed": true }, { - "name": "profile", + "name": "share", "type": "TypeString", - "description": "The globally unique name for this share profile.", + "description": "The file share identifier.", + "immutable": true, "required": true - } - ], - "ibm_is_share_mount_target": [ + }, { - "name": "mount_path", + "name": "name", "type": "TypeString", - "description": "The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future.", + "description": "The user-defined name for this share target. Names must be unique within the share the share target resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" + }, + { + "name": "access_control_mode", + "type": "TypeString", + "description": "The access control mode for the share", "computed": true }, { - "name": "transit_encryption", + "name": "vpc", "type": "TypeString", - "description": "The transit encryption mode.", - "immutable": true, + "description": "The unique identifier of the VPC in which instances can mount the file share using this share target.This property will be removed in a future release.The `subnet` property should be used instead.", "optional": true, "computed": true }, { - "name": "created_at", + "name": "mount_target", "type": "TypeString", - "description": "The date and time that the share target was created.", + "description": "The unique identifier of this target", "computed": true }, { @@ -125837,6 +130029,14 @@ "description": "The URL for this share target.", "computed": true }, + { + "name": "transit_encryption", + "type": "TypeString", + "description": "The transit encryption mode.", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "virtual_network_interface", "type": "TypeList", @@ -125954,16 +130154,9 @@ "min_items": 1 }, { - "name": "vpc", - "type": "TypeString", - "description": "The unique identifier of the VPC in which instances can mount the file share using this share target.This property will be removed in a future release.The `subnet` property should be used instead.", - "optional": true, - "computed": true - }, - { - "name": "mount_target", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier of this target", + "description": "The date and time that the share target was created.", "computed": true }, { @@ -125973,35 +130166,21 @@ "computed": true }, { - "name": "resource_type", - "type": "TypeString", - "description": "The type of resource referenced.", - "computed": true - }, - { - "name": "share", - "type": "TypeString", - "description": "The file share identifier.", - "immutable": true, - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this share target. Names must be unique within the share the share target resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$" - }, - { - "name": "access_control_mode", + "name": "mount_path", "type": "TypeString", - "description": "The access control mode for the share", + "description": "The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future.", "computed": true } ], "ibm_is_share_replica_operations": [ + { + "name": "timeout", + "type": "TypeInt", + "description": "The failover timeout in seconds", + "min_value": "300", + "max_value": "3600", + "optional": true + }, { "name": "split_share", "type": "TypeBool", @@ -126025,14 +130204,6 @@ "immutable": true, "options": "fail, split", "optional": true - }, - { - "name": "timeout", - "type": "TypeInt", - "description": "The failover timeout in seconds", - "min_value": "300", - "max_value": "3600", - "optional": true } ], "ibm_is_snapshot": [ @@ -126043,6 +130214,85 @@ "immutable": true, "optional": true }, + { + "name": "copies", + "type": "TypeList", + "description": "The copies of this snapshot in other regions.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for the copied snapshot.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for the copied snapshot.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for the copied snapshot.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for the copied snapshot. The name is unique across all snapshots in the copied snapshot's native region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "crn", + "type": "TypeString", + "description": "The crn of the resource", + "cloud_data_type": "crn", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -126059,28 +130309,8 @@ "optional": true, "computed": true, "elem": { - "type": "TypeString" - } - }, - { - "name": "source_volume", - "type": "TypeString", - "description": "Snapshot source volume", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "operating_system", - "type": "TypeString", - "description": "The globally unique name for the operating system included in this image", - "computed": true - }, - { - "name": "bootable", - "type": "TypeBool", - "description": "Indicates if a boot volume attachment can be created with a volume created from this snapshot", - "computed": true + "type": "TypeString" + } }, { "name": "backup_policy_plan", @@ -126201,39 +130431,19 @@ } }, { - "name": "encryption", - "type": "TypeString", - "description": "Encryption type of the snapshot", - "computed": true - }, - { - "name": "encryption_key", + "name": "source_volume", "type": "TypeString", - "description": "A reference to the root key used to wrap the data encryption key for the source volume.", + "description": "Snapshot source volume", + "immutable": true, "optional": true, "computed": true }, { - "name": "resource_type", + "name": "lifecycle_state", "type": "TypeString", - "description": "The resource type of the snapshot", - "computed": true - }, - { - "name": "size", - "type": "TypeInt", - "description": "The size of the snapshot", + "description": "Snapshot lifecycle state", "computed": true }, - { - "name": "clones", - "type": "TypeSet", - "description": "Zones for creating the snapshot clone", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "minimum_capacity", "type": "TypeInt", @@ -126241,14 +130451,10 @@ "computed": true }, { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "resource_type", + "type": "TypeString", + "description": "The resource type of the snapshot", + "computed": true }, { "name": "name", @@ -126261,75 +130467,31 @@ "computed": true }, { - "name": "copies", - "type": "TypeList", - "description": "The copies of this snapshot in other regions.", - "computed": true, + "name": "source_image", + "type": "TypeString", + "description": "If present, the image id from which the data on this volume was most directly provisioned.", + "computed": true + }, + { + "name": "encryption_key", + "type": "TypeString", + "description": "A reference to the root key used to wrap the data encryption key for the source volume.", + "optional": true, + "computed": true + }, + { + "name": "size", + "type": "TypeInt", + "description": "The size of the snapshot", + "computed": true + }, + { + "name": "clones", + "type": "TypeSet", + "description": "Zones for creating the snapshot clone", + "optional": true, "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for the copied snapshot.", - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted, and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for the copied snapshot.", - "computed": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The unique identifier for the copied snapshot.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The name for the copied snapshot. The name is unique across all snapshots in the copied snapshot's native region.", - "computed": true - }, - "remote": { - "name": "remote", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource is remote to this region,and identifies the native region.", - "computed": true, - "elem": { - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this region.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this region.", - "computed": true - } - } - }, - "resource_type": { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type.", - "computed": true - } + "type": "TypeString" } }, { @@ -126342,56 +130504,39 @@ "computed": true }, { - "name": "source_image", + "name": "operating_system", "type": "TypeString", - "description": "If present, the image id from which the data on this volume was most directly provisioned.", + "description": "The globally unique name for the operating system included in this image", "computed": true }, { - "name": "lifecycle_state", - "type": "TypeString", - "description": "Snapshot lifecycle state", + "name": "bootable", + "type": "TypeBool", + "description": "Indicates if a boot volume attachment can be created with a volume created from this snapshot", "computed": true }, { - "name": "crn", + "name": "encryption", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "Encryption type of the snapshot", "computed": true - } - ], - "ibm_is_ssh_key": [ + }, { "name": "access_tags", "type": "TypeSet", - "description": "List of access management tags for SSH key", + "description": "List of access management tags", "optional": true, "computed": true, "elem": { "type": "TypeString" } - }, - { - "name": "name", - "type": "TypeString", - "description": "SSH Key name", - "required": true, - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, + } + ], + "ibm_is_ssh_key": [ { - "name": "public_key", + "name": "resource_controller_url", "type": "TypeString", - "description": "SSH Public key data", - "immutable": true, - "required": true - }, - { - "name": "length", - "type": "TypeInt", - "description": "SSH key Length", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -126400,25 +130545,22 @@ "description": "The name of the resource", "computed": true }, - { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", - "computed": true - }, { "name": "resource_group_name", "type": "TypeString", "description": "The resource group name in which resource is provisioned", "computed": true }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags for SSH key", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "type", "type": "TypeString", @@ -126427,9 +130569,18 @@ "computed": true }, { - "name": "fingerprint", + "name": "length", + "type": "TypeInt", + "description": "SSH key Length", + "computed": true + }, + { + "name": "resource_group", "type": "TypeString", - "description": "SSH key Fingerprint info", + "description": "Resource group ID", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true }, { @@ -126446,68 +130597,74 @@ } }, { - "name": "resource_group", + "name": "resource_crn", "type": "TypeString", - "description": "Resource group ID", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, + "description": "The crn of the resource", "computed": true }, { - "name": "resource_controller_url", + "name": "crn", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The crn of the resource", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "SSH Key name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + }, + { + "name": "public_key", + "type": "TypeString", + "description": "SSH Public key data", + "immutable": true, + "required": true + }, + { + "name": "fingerprint", + "type": "TypeString", + "description": "SSH key Fingerprint info", "computed": true } ], "ibm_is_subnet": [ { - "name": "ipv4_cidr_block", + "name": "crn", "type": "TypeString", - "description": "IPV4 subnet - CIDR block", - "immutable": true, - "optional": true, + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_controller_url", + "name": "network_acl", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The network ACL for this subnet", + "optional": true, "computed": true }, { - "name": "resource_group_name", + "name": "status", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The status of the subnet", "computed": true }, { - "name": "ip_version", + "name": "ipv4_cidr_block", "type": "TypeString", - "description": "The IP version(s) to support for this subnet.", - "default_value": "ipv4", + "description": "IPV4 subnet - CIDR block", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "public_gateway", - "type": "TypeString", - "description": "Public Gateway of the subnet", - "optional": true, + "name": "available_ipv4_address_count", + "type": "TypeInt", + "description": "The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the provider.", "computed": true }, { @@ -126519,13 +130676,17 @@ "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "Subnet name", - "required": true, + "name": "tags", + "type": "TypeSet", + "description": "List of tags", "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "access_tags", @@ -126541,12 +130702,19 @@ } }, { - "name": "network_acl", + "name": "resource_controller_url", "type": "TypeString", - "description": "The network ACL for this subnet", - "optional": true, + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, + { + "name": "ip_version", + "type": "TypeString", + "description": "The IP version(s) to support for this subnet.", + "default_value": "ipv4", + "immutable": true, + "optional": true + }, { "name": "resource_name", "type": "TypeString", @@ -126554,64 +130722,67 @@ "computed": true }, { - "name": "resource_crn", + "name": "vpc", "type": "TypeString", - "description": "The crn of the resource", - "computed": true + "description": "VPC instance ID", + "immutable": true, + "required": true }, { - "name": "available_ipv4_address_count", - "type": "TypeInt", - "description": "The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the provider.", + "name": "resource_group", + "type": "TypeString", + "description": "The resource group for this subnet", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true }, { - "name": "crn", + "name": "routing_table", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "routing table id that is associated with the subnet", + "optional": true, "computed": true }, { - "name": "status", + "name": "resource_status", "type": "TypeString", - "description": "The status of the subnet", + "description": "The status of the resource", "computed": true }, { - "name": "vpc", + "name": "resource_group_name", "type": "TypeString", - "description": "VPC instance ID", - "immutable": true, - "required": true + "description": "The resource group name in which resource is provisioned", + "computed": true }, { - "name": "zone", + "name": "name", "type": "TypeString", - "description": "Subnet zone info", - "immutable": true, - "required": true + "description": "Subnet name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "resource_group", + "name": "public_gateway", "type": "TypeString", - "description": "The resource group for this subnet", - "cloud_data_type": "resource_group", - "immutable": true, + "description": "Public Gateway of the subnet", "optional": true, "computed": true }, { - "name": "routing_table", + "name": "zone", "type": "TypeString", - "description": "routing table id that is associated with the subnet", - "optional": true, - "computed": true + "description": "Subnet zone info", + "immutable": true, + "required": true }, { - "name": "resource_status", + "name": "resource_crn", "type": "TypeString", - "description": "The status of the resource", + "description": "The crn of the resource", "computed": true } ], @@ -126788,8 +130959,9 @@ ], "ibm_is_subnet_public_gateway_attachment": [ { - "name": "floating_ip", - "type": "TypeMap", + "name": "name", + "type": "TypeString", + "description": "Name of the Public gateway instance", "computed": true }, { @@ -126806,15 +130978,10 @@ "computed": true }, { - "name": "vpc", - "type": "TypeString", - "description": "Public gateway VPC info", - "computed": true - }, - { - "name": "resource_type", + "name": "crn", "type": "TypeString", - "description": "The name of the resource", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { @@ -126824,16 +130991,21 @@ "computed": true }, { - "name": "name", + "name": "public_gateway", "type": "TypeString", - "description": "Name of the Public gateway instance", + "description": "The unique identifier of public gateway", + "required": true + }, + { + "name": "floating_ip", + "type": "TypeMap", "computed": true }, { - "name": "public_gateway", + "name": "vpc", "type": "TypeString", - "description": "The unique identifier of public gateway", - "required": true + "description": "Public gateway VPC info", + "computed": true }, { "name": "zone", @@ -126842,10 +131014,9 @@ "computed": true }, { - "name": "crn", + "name": "resource_type", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The name of the resource", "computed": true }, { @@ -126858,50 +131029,55 @@ ], "ibm_is_subnet_reserved_ip": [ { - "name": "subnet", + "name": "target", "type": "TypeString", - "description": "The subnet identifier.", - "immutable": true, - "required": true + "description": "The unique identifier for target.", + "optional": true, + "computed": true }, { - "name": "auto_delete", - "type": "TypeBool", - "description": "If set to true, this reserved IP will be automatically deleted", + "name": "target_crn", + "type": "TypeString", + "description": "The crn for target.", "optional": true, "computed": true }, { - "name": "target", + "name": "created_at", "type": "TypeString", - "description": "The unique identifier for target.", - "optional": true, + "description": "The date and time that the reserved IP was created.", "computed": true }, { - "name": "lifecycle_state", + "name": "href", "type": "TypeString", - "description": "The lifecycle state of the reserved IP", + "description": "The URL for this reserved IP.", "computed": true }, { - "name": "address", + "name": "resource_type", "type": "TypeString", - "description": "The address for this reserved IP.", - "immutable": true, - "optional": true, + "description": "The resource type.", "computed": true }, { - "name": "reserved_ip", + "name": "owner", "type": "TypeString", - "description": "The unique identifier of the reserved IP.", + "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", "computed": true }, { - "name": "href", + "name": "subnet", "type": "TypeString", - "description": "The URL for this reserved IP.", + "description": "The subnet identifier.", + "immutable": true, + "required": true + }, + { + "name": "auto_delete", + "type": "TypeBool", + "description": "If set to true, this reserved IP will be automatically deleted", + "optional": true, "computed": true }, { @@ -126915,58 +131091,52 @@ "computed": true }, { - "name": "target_crn", - "type": "TypeString", - "description": "The crn for target.", - "optional": true, - "computed": true - }, - { - "name": "created_at", + "name": "lifecycle_state", "type": "TypeString", - "description": "The date and time that the reserved IP was created.", + "description": "The lifecycle state of the reserved IP", "computed": true }, { - "name": "owner", + "name": "address", "type": "TypeString", - "description": "The owner of a reserved IP, defining whether it is managed by the user or the provider.", + "description": "The address for this reserved IP.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "resource_type", + "name": "reserved_ip", "type": "TypeString", - "description": "The resource type.", + "description": "The unique identifier of the reserved IP.", "computed": true } ], "ibm_is_subnet_routing_table_attachment": [ { - "name": "routes", + "name": "route_vpc_zone_ingress", + "type": "TypeBool", + "description": "If true, this routing table will be used to route traffic that originates from subnets in other zones in this VPC.", + "computed": true + }, + { + "name": "subnets", "type": "TypeList", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "route ID", + "description": "Subnet ID", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "route name", + "description": "Subnet name", "computed": true } } }, - { - "name": "subnet", - "type": "TypeString", - "description": "The subnet identifier", - "immutable": true, - "required": true - }, { "name": "routing_table", "type": "TypeString", @@ -126974,9 +131144,15 @@ "required": true }, { - "name": "route_direct_link_ingress", + "name": "is_default", "type": "TypeBool", - "description": "If true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", + "description": "Indicates whether this is the default routing table for this VPC", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type", "computed": true }, { @@ -126986,34 +131162,41 @@ "computed": true }, { - "name": "route_vpc_zone_ingress", + "name": "route_transit_gateway_ingress", "type": "TypeBool", - "description": "If true, this routing table will be used to route traffic that originates from subnets in other zones in this VPC.", + "description": "If true, this routing table will be used to route traffic that originates from Transit Gateway to this VPC.", "computed": true }, { - "name": "subnets", + "name": "routes", "type": "TypeList", "computed": true, "elem": { "id": { "name": "id", "type": "TypeString", - "description": "Subnet ID", + "description": "route ID", "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Subnet name", + "description": "route name", "computed": true } } }, { - "name": "is_default", + "name": "subnet", + "type": "TypeString", + "description": "The subnet identifier", + "immutable": true, + "required": true + }, + { + "name": "route_direct_link_ingress", "type": "TypeBool", - "description": "Indicates whether this is the default routing table for this VPC", + "description": "If true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", "computed": true }, { @@ -127021,34 +131204,9 @@ "type": "TypeString", "description": "he lifecycle state of the routing table [ deleting, failed, pending, stable, suspended, updating, waiting ]", "computed": true - }, - { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - }, - { - "name": "route_transit_gateway_ingress", - "type": "TypeBool", - "description": "If true, this routing table will be used to route traffic that originates from Transit Gateway to this VPC.", - "computed": true } ], "ibm_is_virtual_endpoint_gateway": [ - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this Endpoint gateway", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "health_state", - "type": "TypeString", - "description": "Endpoint gateway health state", - "computed": true - }, { "name": "tags", "type": "TypeSet", @@ -127073,34 +131231,11 @@ "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "resource_type", - "type": "TypeString", - "description": "Endpoint gateway resource type", - "options": "provider_cloud_service, provider_infrastructure_service", - "computed": true - }, - { - "name": "vpc", - "type": "TypeString", - "description": "The VPC id", - "immutable": true, - "required": true - }, - { - "name": "created_at", + "name": "health_state", "type": "TypeString", - "description": "Endpoint gateway created date and time", + "description": "Endpoint gateway health state", "computed": true }, - { - "name": "service_endpoints", - "type": "TypeList", - "description": "The fully qualified domain names for the target service. A fully qualified domain name for the target service", - "computed": true, - "elem": { - "type": "TypeString" - } - }, { "name": "ips", "type": "TypeList", @@ -127143,9 +131278,16 @@ } }, { - "name": "access_tags", + "name": "crn", + "type": "TypeString", + "description": "The CRN for this Endpoint gateway", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "security_groups", "type": "TypeSet", - "description": "List of access management tags", + "description": "Endpoint gateway securitygroups list", "optional": true, "computed": true, "elem": { @@ -127153,30 +131295,27 @@ } }, { - "name": "resource_group", - "type": "TypeString", - "description": "The resource group id", - "cloud_data_type": "resource_group", - "immutable": true, + "name": "allow_dns_resolution_binding", + "type": "TypeBool", + "description": "Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.", "optional": true, "computed": true }, { - "name": "lifecycle_state", - "type": "TypeString", - "description": "Endpoint gateway lifecycle state", - "computed": true - }, - { - "name": "security_groups", - "type": "TypeSet", - "description": "Endpoint gateway securitygroups list", - "optional": true, + "name": "service_endpoints", + "type": "TypeList", + "description": "The fully qualified domain names for the target service. A fully qualified domain name for the target service", "computed": true, "elem": { "type": "TypeString" } }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "Endpoint gateway lifecycle state", + "computed": true + }, { "name": "target", "type": "TypeList", @@ -127206,9 +131345,60 @@ }, "max_items": 1, "min_items": 1 + }, + { + "name": "vpc", + "type": "TypeString", + "description": "The VPC id", + "immutable": true, + "required": true + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "Endpoint gateway resource type", + "options": "provider_cloud_service, provider_infrastructure_service", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The resource group id", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Endpoint gateway created date and time", + "computed": true } ], "ibm_is_virtual_endpoint_gateway_ip": [ + { + "name": "name", + "type": "TypeString", + "description": "Endpoint gateway IP name", + "computed": true + }, + { + "name": "resource_type", + "type": "TypeString", + "description": "Endpoint gateway IP resource type", + "computed": true + }, { "name": "created_at", "type": "TypeString", @@ -127266,53 +131456,90 @@ "description": "Endpoint gateway IP id", "immutable": true, "required": true - }, + } + ], + "ibm_is_volume": [ { - "name": "name", + "name": "status", "type": "TypeString", - "description": "Endpoint gateway IP name", + "description": "Volume status", "computed": true }, { - "name": "resource_type", + "name": "resource_controller_url", "type": "TypeString", - "description": "Endpoint gateway IP resource type", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true - } - ], - "ibm_is_volume": [ - { - "name": "profile", - "type": "TypeString", - "description": "Volume profile name", - "required": true, - "options": "general-purpose, 5iops-tier, 10iops-tier, custom" }, { - "name": "status_reasons", + "name": "operating_system", "type": "TypeList", + "description": "The operating system associated with this volume. If absent, this volume was notcreated from an image, or the image did not include an operating system.", "computed": true, "elem": { - "code": { - "name": "code", + "architecture": { + "name": "architecture", "type": "TypeString", - "description": "A snake case string succinctly identifying the status reason", + "description": "The operating system architecture.", "computed": true }, - "message": { - "name": "message", + "dedicated_host_only": { + "name": "dedicated_host_only", + "type": "TypeBool", + "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups.", + "computed": true + }, + "display_name": { + "name": "display_name", "type": "TypeString", - "description": "An explanation of the status reason", + "description": "A unique, display-friendly name for the operating system.", "computed": true }, - "more_info": { - "name": "more_info", + "family": { + "name": "family", "type": "TypeString", - "description": "Link to documentation about this status reason", + "description": "The software family for this operating system.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this operating system.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this operating system.", + "computed": true + }, + "vendor": { + "name": "vendor", + "type": "TypeString", + "description": "The vendor of the operating system.", + "computed": true + }, + "version": { + "name": "version", + "type": "TypeString", + "description": "The major release version of this operating system.", "computed": true } } }, + { + "name": "zone", + "type": "TypeString", + "description": "Zone name", + "immutable": true, + "required": true + }, + { + "name": "encryption_type", + "type": "TypeString", + "description": "Volume encryption type info", + "computed": true + }, { "name": "health_reasons", "type": "TypeList", @@ -127344,6 +131571,80 @@ "description": "The health of this resource.", "computed": true }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "Access management tags for the volume instance", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "source_snapshot", + "type": "TypeString", + "description": "The unique identifier for this snapshot", + "immutable": true, + "min_length": 1, + "max_length": 64, + "matches": "^[-0-9a-z_]+$", + "optional": true, + "computed": true + }, + { + "name": "iops", + "type": "TypeInt", + "description": "IOPS value for the Volume", + "min_value": "100", + "max_value": "48000", + "optional": true, + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN value for the volume instance", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "status_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason", + "computed": true + } + } + }, { "name": "tags", "type": "TypeSet", @@ -127364,9 +131665,9 @@ "computed": true }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", + "name": "bandwidth", + "type": "TypeInt", + "description": "The maximum bandwidth (in megabits per second) for the volume", "computed": true }, { @@ -127379,22 +131680,20 @@ "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "source_snapshot", + "name": "resource_group", "type": "TypeString", - "description": "The unique identifier for this snapshot", + "description": "Resource group name", + "cloud_data_type": "resource_group", "immutable": true, - "min_length": 1, - "max_length": 64, - "matches": "^[-0-9a-z_]+$", "optional": true, "computed": true }, { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group name", - "cloud_data_type": "resource_group", - "immutable": true, + "name": "capacity", + "type": "TypeInt", + "description": "Volume capacity value", + "min_value": "10", + "max_value": "16000", "optional": true, "computed": true }, @@ -127405,36 +131704,71 @@ "optional": true }, { - "name": "resource_controller_url", + "name": "resource_status", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The status of the resource", "computed": true }, { - "name": "encryption_type", + "name": "profile", "type": "TypeString", - "description": "Volume encryption type info", - "computed": true + "description": "Volume profile name", + "required": true, + "options": "general-purpose, 5iops-tier, 10iops-tier, custom" }, { - "name": "iops", - "type": "TypeInt", - "description": "IOPS value for the Volume", - "min_value": "100", - "max_value": "48000", + "name": "encryption_key", + "type": "TypeString", + "description": "Volume encryption key info", + "immutable": true, + "optional": true + } + ], + "ibm_is_vpc": [ + { + "name": "id", + "type": "TypeString", + "description": "Id of the ibm_is_vpc", + "cloud_data_type": "is", + "computed": true, + "cloud_data_range": [ + "service:vpc", + "resolved_to:id" + ] + }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "status", + "name": "address_prefix_management", "type": "TypeString", - "description": "Volume status", - "computed": true + "description": "Address Prefix management value", + "default_value": "auto", + "immutable": true, + "options": "auto, manual", + "optional": true + }, + { + "name": "no_sg_acl_rules", + "type": "TypeBool", + "description": "Delete all rules attached with default security group and default acl", + "default_value": false, + "optional": true }, { "name": "access_tags", "type": "TypeSet", - "description": "Access management tags for the volume instance", + "description": "List of access management tags", "optional": true, "computed": true, "elem": { @@ -127442,160 +131776,224 @@ } }, { - "name": "resource_crn", + "name": "resource_group", "type": "TypeString", - "description": "The crn of the resource", + "description": "Resource group info", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true }, { - "name": "resource_group_name", + "name": "status", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "VPC status", "computed": true }, { - "name": "bandwidth", - "type": "TypeInt", - "description": "The maximum bandwidth (in megabits per second) for the volume", + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "zone", + "name": "resource_name", "type": "TypeString", - "description": "Zone name", - "immutable": true, - "required": true + "description": "The name of the resource", + "computed": true + }, + { + "name": "default_network_acl_name", + "type": "TypeString", + "description": "Default Network ACL name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true + }, + { + "name": "default_security_group_name", + "type": "TypeString", + "description": "Default security group name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", + "computed": true + }, + { + "name": "dns", + "type": "TypeList", + "description": "The DNS configuration for this VPC.", + "optional": true, + "computed": true, + "elem": { + "enable_hub": { + "name": "enable_hub", + "type": "TypeBool", + "description": "Indicates whether this VPC is enabled as a DNS name resolution hub.", + "optional": true, + "computed": true + }, + "resolution_binding_count": { + "name": "resolution_binding_count", + "type": "TypeInt", + "description": "The number of DNS resolution bindings for this VPC.", + "computed": true + }, + "resolver": { + "name": "resolver", + "type": "TypeList", + "description": "The DNS resolver configuration for the VPC.", + "optional": true, + "computed": true, + "elem": { + "configuration": { + "name": "configuration", + "type": "TypeString", + "description": "The configuration of the system DNS resolver for this VPC.- `custom_resolver`: A custom DNS resolver is configured for this VPC.- `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when the VPC has either or both of the following: - at least one endpoint gateway residing in it - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it- `default`: The provider default DNS resolvers are configured for this VPC. This system DNS resolver configuration is used when the VPC has: - no custom DNS resolver configured for it, and - no endpoint gateways residing in it, and - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it.", + "computed": true + }, + "manual_servers": { + "name": "manual_servers", + "type": "TypeSet", + "description": "The manually specified DNS servers for this VPC.", + "optional": true, + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "optional": true, + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "The name of the zone. If present, DHCP configuration for this zone will have this DNS server listed first.", + "optional": true, + "computed": true + } + } + }, + "servers": { + "name": "servers", + "type": "TypeList", + "description": "The DNS servers for this VPC. The servers are populated:- by the system when `dns.resolver.type` is `system`- using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated`- using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + "computed": true + }, + "zone_affinity": { + "name": "zone_affinity", + "type": "TypeString", + "description": "Zone name, if present, DHCP configuration for this zone will have this DNS server listed first.", + "computed": true + } + } + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "The type of the DNS resolver used for the VPC.- `delegated`: DNS server addresses are provided by the DNS resolver of the VPC specified in `dns.resolver.vpc`.- `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.- `system`: DNS server addresses are provided by the system.", + "optional": true, + "computed": true + }, + "vpc_crn": { + "name": "vpc_crn", + "type": "TypeString", + "description": "The VPC crn whose DNS resolver provides the DNS server addresses for this VPC.The VPC may be remote and therefore may not be directly retrievable.", + "optional": true + }, + "vpc_id": { + "name": "vpc_id", + "type": "TypeString", + "description": "The VPC id whose DNS resolver provides the DNS server addresses for this VPC.The VPC may be remote and therefore may not be directly retrievable.", + "optional": true + }, + "vpc_name": { + "name": "vpc_name", + "type": "TypeString", + "description": "The VPC name whose DNS resolver provides the DNS server addresses for this VPC.The VPC may be remote and therefore may not be directly retrievable.", + "computed": true + }, + "vpc_remote_account_id": { + "name": "vpc_remote_account_id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "vpc_remote_region": { + "name": "vpc_remote_region", + "type": "TypeString", + "description": "Region name. If present, this property indicates that the referenced resource is remote to this region, and identifies the native region.", + "computed": true + } + }, + "max_items": 1 + } + }, + "max_items": 1 }, { - "name": "encryption_key", + "name": "default_network_acl_crn", "type": "TypeString", - "description": "Volume encryption key info", - "immutable": true, - "optional": true - }, - { - "name": "capacity", - "type": "TypeInt", - "description": "Volume capacity value", - "min_value": "10", - "max_value": "16000", - "optional": true, + "description": "Default Network ACL CRN", "computed": true }, { - "name": "crn", + "name": "resource_crn", "type": "TypeString", - "description": "CRN value for the volume instance", - "cloud_data_type": "crn", + "description": "The crn of the resource", "computed": true }, { - "name": "operating_system", + "name": "cse_source_addresses", "type": "TypeList", - "description": "The operating system associated with this volume. If absent, this volume was notcreated from an image, or the image did not include an operating system.", "computed": true, "elem": { - "architecture": { - "name": "architecture", - "type": "TypeString", - "description": "The operating system architecture.", - "computed": true - }, - "dedicated_host_only": { - "name": "dedicated_host_only", - "type": "TypeBool", - "description": "Images with this operating system can only be used on dedicated hosts or dedicated host groups.", - "computed": true - }, - "display_name": { - "name": "display_name", - "type": "TypeString", - "description": "A unique, display-friendly name for the operating system.", - "computed": true - }, - "family": { - "name": "family", - "type": "TypeString", - "description": "The software family for this operating system.", - "computed": true - }, - "href": { - "name": "href", - "type": "TypeString", - "description": "The URL for this operating system.", - "computed": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "The globally unique name for this operating system.", - "computed": true - }, - "vendor": { - "name": "vendor", + "address": { + "name": "address", "type": "TypeString", - "description": "The vendor of the operating system.", + "description": "Cloud service endpoint IP Address", "computed": true }, - "version": { - "name": "version", + "zone_name": { + "name": "zone_name", "type": "TypeString", - "description": "The major release version of this operating system.", + "description": "Location info of CSE Address", "computed": true } } - } - ], - "ibm_is_vpc": [ - { - "name": "id", - "type": "TypeString", - "description": "Id of the ibm_is_vpc", - "cloud_data_type": "is", - "computed": true, - "cloud_data_range": [ - "service:vpc", - "resolved_to:id" - ] - }, - { - "name": "default_security_group_crn", - "type": "TypeString", - "description": "Default security group CRN", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource group info", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true }, { - "name": "default_security_group", - "type": "TypeString", - "description": "Security group associated with VPC", - "computed": true - }, - { - "name": "crn", + "name": "health_state", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The health of this resource.- `ok`: No abnormal behavior detected- `degraded`: Experiencing compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", "computed": true }, { - "name": "resource_crn", + "name": "default_security_group_crn", "type": "TypeString", - "description": "The crn of the resource", + "description": "Default security group CRN", "computed": true }, { - "name": "default_network_acl", + "name": "resource_status", "type": "TypeString", - "description": "Default network ACL ID", + "description": "The status of the resource", "computed": true }, { @@ -127605,16 +132003,19 @@ "computed": true }, { - "name": "no_sg_acl_rules", - "type": "TypeBool", - "description": "Delete all rules attached with default security group and default acl", - "default_value": false, - "optional": true + "name": "default_security_group", + "type": "TypeString", + "description": "Security group associated with VPC", + "computed": true }, { - "name": "resource_status", + "name": "default_routing_table_name", "type": "TypeString", - "description": "The status of the resource", + "description": "Default routing table name", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, "computed": true }, { @@ -127694,75 +132095,42 @@ } }, { - "name": "status", - "type": "TypeString", - "description": "VPC status", - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true - }, - { - "name": "resource_group_name", + "name": "default_network_acl", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Default network ACL ID", "computed": true }, { - "name": "cse_source_addresses", + "name": "health_reasons", "type": "TypeList", + "description": "The reasons for the current `health_state` (if any).The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered.", "computed": true, "elem": { - "address": { - "name": "address", + "code": { + "name": "code", "type": "TypeString", - "description": "Cloud service endpoint IP Address", + "description": "A snake case string succinctly identifying the reason for this health state.", "computed": true }, - "zone_name": { - "name": "zone_name", + "message": { + "name": "message", "type": "TypeString", - "description": "Location info of CSE Address", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", "computed": true } } }, { - "name": "address_prefix_management", - "type": "TypeString", - "description": "Address Prefix management value", - "default_value": "auto", - "immutable": true, - "options": "auto, manual", - "optional": true - }, - { - "name": "default_network_acl_name", - "type": "TypeString", - "description": "Default Network ACL name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true - }, - { - "name": "default_network_acl_crn", + "name": "crn", "type": "TypeString", - "description": "Default Network ACL CRN", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { @@ -127808,35 +132176,6 @@ } } }, - { - "name": "default_security_group_name", - "type": "TypeString", - "description": "Default security group name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true - }, - { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, { "name": "classic_access", "type": "TypeBool", @@ -127853,16 +132192,6 @@ "min_length": 1, "max_length": 63, "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "default_routing_table_name", - "type": "TypeString", - "description": "Default routing table name", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true } ], "ibm_is_vpc_address_prefix": [ @@ -127919,39 +132248,224 @@ "required": true } ], - "ibm_is_vpc_routing_table": [ + "ibm_is_vpc_dns_resolution_binding": [ { "name": "resource_type", "type": "TypeString", - "description": "Routing table Resource Type", + "description": "The resource type.", "computed": true }, { - "name": "subnets", + "name": "vpc", "type": "TypeList", - "computed": true, + "description": "The VPC bound to for DNS resolution.The VPC may be remote and therefore may not be directly retrievable.", + "immutable": true, + "required": true, "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "optional": true, + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "optional": true, + "computed": true + }, "id": { "name": "id", "type": "TypeString", - "description": "Subnet ID", + "description": "The unique identifier for this VPC.", + "optional": true, "computed": true }, "name": { "name": "name", "type": "TypeString", - "description": "Subnet name", + "description": "The name for this VPC. The name is unique across all VPCs in the region.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", "computed": true } - } + }, + "max_items": 1, + "min_items": 1 }, { - "name": "vpc", + "name": "vpc_id", "type": "TypeString", "description": "The VPC identifier.", - "immutable": true, "required": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the DNS resolution binding was created.", + "computed": true + }, + { + "name": "endpoint_gateways", + "type": "TypeList", + "description": "The endpoint gateways in the bound to VPC that are allowed to participate in this DNS resolution binding.The endpoint gateways may be remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this endpoint gateway.", + "computed": true + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this endpoint gateway.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this endpoint gateway.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC.", + "computed": true + }, + "remote": { + "name": "remote", + "type": "TypeList", + "description": "If present, this property indicates that the resource associated with this referenceis remote and therefore may not be directly retrievable.", + "computed": true, + "elem": { + "account": { + "name": "account", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisaccount, and identifies the owning account.", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this account.", + "computed": true + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + "region": { + "name": "region", + "type": "TypeList", + "description": "If present, this property indicates that the referenced resource is remote to thisregion, and identifies the native region.", + "computed": true, + "elem": { + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this region.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The globally unique name for this region.", + "computed": true + } + } + } + } + }, + "resource_type": { + "name": "resource_type", + "type": "TypeString", + "description": "The resource type.", + "computed": true + } + } + }, + { + "name": "href", + "type": "TypeString", + "description": "The URL for this DNS resolution binding.", + "computed": true + }, + { + "name": "lifecycle_state", + "type": "TypeString", + "description": "The lifecycle state of the DNS resolution binding.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC.", + "optional": true, + "computed": true + } + ], + "ibm_is_vpc_routing_table": [ { "name": "accept_routes_from_resource_type", "type": "TypeSet", @@ -127963,9 +132477,51 @@ } }, { - "name": "route_internet_ingress", + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this routing table.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Routing table Created At", + "computed": true + }, + { + "name": "subnets", + "type": "TypeList", + "computed": true, + "elem": { + "id": { + "name": "id", + "type": "TypeString", + "description": "Subnet ID", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Subnet name", + "computed": true + } + } + }, + { + "name": "vpc", + "type": "TypeString", + "description": "The VPC identifier.", + "immutable": true, + "required": true + }, + { + "name": "route_direct_link_ingress", "type": "TypeBool", - "description": "If set to true, this routing table will be used to route traffic that originates from the internet. For this to succeed, the VPC must not already have a routing table with this property set to true.", + "description": "If set to true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", "default_value": false, "optional": true }, @@ -127976,16 +132532,6 @@ "default_value": false, "optional": true }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this routing table.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true, - "computed": true - }, { "name": "route_vpc_zone_ingress", "type": "TypeBool", @@ -127994,9 +132540,9 @@ "optional": true }, { - "name": "routing_table", + "name": "resource_type", "type": "TypeString", - "description": "The routing table identifier.", + "description": "Routing table Resource Type", "computed": true }, { @@ -128012,37 +132558,46 @@ "computed": true }, { - "name": "href", - "type": "TypeString", - "description": "Routing table Href", - "computed": true + "name": "route_internet_ingress", + "type": "TypeBool", + "description": "If set to true, this routing table will be used to route traffic that originates from the internet. For this to succeed, the VPC must not already have a routing table with this property set to true.", + "default_value": false, + "optional": true }, { - "name": "created_at", + "name": "routing_table", "type": "TypeString", - "description": "Routing table Created At", + "description": "The routing table identifier.", "computed": true }, { - "name": "route_direct_link_ingress", - "type": "TypeBool", - "description": "If set to true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", - "default_value": false, - "optional": true + "name": "href", + "type": "TypeString", + "description": "Routing table Href", + "computed": true } ], "ibm_is_vpc_routing_table_route": [ { - "name": "vpc", + "name": "name", "type": "TypeString", - "description": "The VPC identifier.", - "immutable": true, - "required": true + "description": "The user-defined name for this route.", + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "optional": true, + "computed": true }, { - "name": "href", + "name": "route_id", "type": "TypeString", - "description": "Routing table route Href", + "description": "The routing table route identifier.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Routing table route Created At", "computed": true }, { @@ -128060,19 +132615,17 @@ "required": true }, { - "name": "priority", - "type": "TypeInt", - "description": "The route's priority. Smaller values have higher priority.", - "min_value": "0", - "max_value": "4", - "optional": true, - "computed": true + "name": "next_hop", + "type": "TypeString", + "description": "If action is deliver, the next hop that packets will be delivered to. For other action values, its address will be 0.0.0.0.", + "required": true }, { - "name": "origin", + "name": "vpc", "type": "TypeString", - "description": "The origin of this route.", - "computed": true + "description": "The VPC identifier.", + "immutable": true, + "required": true }, { "name": "action", @@ -128084,25 +132637,24 @@ "optional": true }, { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this route.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", + "name": "priority", + "type": "TypeInt", + "description": "The route's priority. Smaller values have higher priority.", + "min_value": "0", + "max_value": "4", "optional": true, "computed": true }, { - "name": "route_id", + "name": "lifecycle_state", "type": "TypeString", - "description": "The routing table route identifier.", + "description": "Routing table route Lifecycle State", "computed": true }, { - "name": "created_at", + "name": "origin", "type": "TypeString", - "description": "Routing table route Created At", + "description": "The origin of this route.", "computed": true }, { @@ -128113,10 +132665,10 @@ "required": true }, { - "name": "next_hop", + "name": "href", "type": "TypeString", - "description": "If action is deliver, the next hop that packets will be delivered to. For other action values, its address will be 0.0.0.0.", - "required": true + "description": "Routing table route Href", + "computed": true }, { "name": "creator", @@ -128169,15 +132721,27 @@ "computed": true } } + } + ], + "ibm_is_vpn_gateway": [ + { + "name": "private_ip_address2", + "type": "TypeString", + "description": "The Second Private IP address assigned to the VPN gateway member.", + "computed": true + }, + { + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true }, { "name": "lifecycle_state", "type": "TypeString", - "description": "Routing table route Lifecycle State", + "description": "The lifecycle state of the VPN route.", "computed": true - } - ], - "ibm_is_vpn_gateway": [ + }, { "name": "subnet", "type": "TypeString", @@ -128186,61 +132750,108 @@ "required": true }, { - "name": "resource_status", + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + { + "name": "private_ip_address", "type": "TypeString", - "description": "The status of the resource", + "description": "The Private IP address assigned to the VPN gateway member.", "computed": true }, { - "name": "resource_group_name", + "name": "crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "private_ip_address2", + "name": "resource_group_name", "type": "TypeString", - "description": "The Second Private IP address assigned to the VPN gateway member.", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "resource_crn", + "name": "created_at", "type": "TypeString", - "description": "The crn of the resource", + "description": "Created Time of the VPN Gateway", "computed": true }, { - "name": "members", + "name": "lifecycle_reasons", "type": "TypeList", - "description": "Collection of VPN gateway members", + "description": "The reasons for the current lifecycle_state (if any).", "computed": true, "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The public IP address assigned to the VPN gateway member", - "computed": true - }, - "private_address": { - "name": "private_address", + "code": { + "name": "code", "type": "TypeString", - "description": "The private IP address assigned to the VPN gateway member", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", "computed": true }, - "role": { - "name": "role", + "message": { + "name": "message", "type": "TypeString", - "description": "The high availability role assigned to the VPN gateway member", + "description": "An explanation of the reason for this lifecycle state.", "computed": true }, - "status": { - "name": "status", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The status of the VPN gateway member", + "description": "Link to documentation about the reason for this lifecycle state.", "computed": true } } }, + { + "name": "mode", + "type": "TypeString", + "description": "mode in VPN gateway(route/policy)", + "default_value": "route", + "immutable": true, + "options": "route,policy", + "optional": true + }, + { + "name": "public_ip_address2", + "type": "TypeString", + "description": "The second public IP address assigned to the VPN gateway member.", + "computed": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true + }, { "name": "vpc", "type": "TypeList", @@ -128287,6 +132898,79 @@ } } }, + { + "name": "tags", + "type": "TypeSet", + "description": "VPN Gateway tags list", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "members", + "type": "TypeList", + "description": "Collection of VPN gateway members", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The public IP address assigned to the VPN gateway member", + "computed": true + }, + "private_address": { + "name": "private_address", + "type": "TypeString", + "description": "The private IP address assigned to the VPN gateway member", + "computed": true + }, + "role": { + "name": "role", + "type": "TypeString", + "description": "The high availability role assigned to the VPN gateway member", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN gateway member", + "computed": true + } + } + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN gateway", + "computed": true + }, + { + "name": "health_state", + "type": "TypeString", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, + { + "name": "public_ip_address", + "type": "TypeString", + "description": "The public IP address assigned to the VPN gateway member.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -128297,254 +132981,356 @@ "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" }, { - "name": "public_ip_address", + "name": "resource_group", "type": "TypeString", - "description": "The public IP address assigned to the VPN gateway member.", + "description": "The resource group for this VPN gateway", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true }, { - "name": "public_ip_address2", + "name": "resource_status", "type": "TypeString", - "description": "The second public IP address assigned to the VPN gateway member.", + "description": "The status of the resource", "computed": true + } + ], + "ibm_is_vpn_gateway_connection": [ + { + "name": "interval", + "type": "TypeInt", + "description": "Interval for dead peer detection interval", + "default_value": 2, + "min_value": "1", + "max_value": "86399", + "optional": true }, { - "name": "resource_controller_url", + "name": "ipsec_policy", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "IP security policy for vpn gateway connection", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "VPN gateway connection status", "computed": true }, { - "name": "resource_name", + "name": "tunnels", + "type": "TypeList", + "description": "The VPN tunnel configuration for this VPN gateway connection (in static route mode)", + "computed": true, + "elem": { + "address": { + "name": "address", + "type": "TypeString", + "description": "The IP address of the VPN gateway member in which the tunnel resides", + "computed": true + }, + "status": { + "name": "status", + "type": "TypeString", + "description": "The status of the VPN Tunnel", + "computed": true + } + } + }, + { + "name": "admin_state_up", + "type": "TypeBool", + "description": "VPN gateway connection admin state", + "default_value": false, + "optional": true + }, + { + "name": "action", "type": "TypeString", - "description": "The name of the resource", + "description": "Action detection for dead peer detection action", + "default_value": "restart", + "options": "restart, clear, hold, none", + "optional": true + }, + { + "name": "status_reasons", + "type": "TypeList", + "description": "The reasons for the current status (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the status reason.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the status reason.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about this status reason.", + "computed": true + } + } + }, + { + "name": "authentication_mode", + "type": "TypeString", + "description": "The authentication mode", "computed": true }, { - "name": "crn", + "name": "resource_type", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The resource type", "computed": true }, { - "name": "status", + "name": "mode", "type": "TypeString", - "description": "The status of the VPN gateway", + "description": "The mode of the VPN gateway", "computed": true }, { - "name": "tags", + "name": "peer_cidrs", "type": "TypeSet", - "description": "VPN Gateway tags list", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "description": "VPN gateway connection peer CIDRs", + "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "access_tags", + "name": "timeout", + "type": "TypeInt", + "description": "Timeout for dead peer detection", + "default_value": 10, + "min_value": "2", + "max_value": "86399", + "optional": true + }, + { + "name": "local_cidrs", "type": "TypeSet", - "description": "List of access management tags", + "description": "VPN gateway connection local CIDRs", + "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "mode", + "name": "vpn_gateway", "type": "TypeString", - "description": "mode in VPN gateway(route/policy)", - "default_value": "route", + "description": "VPN Gateway info", "immutable": true, - "options": "route,policy", + "required": true + }, + { + "name": "peer_address", + "type": "TypeString", + "description": "VPN gateway connection peer address", + "required": true + }, + { + "name": "ike_policy", + "type": "TypeString", + "description": "VPN gateway connection IKE Policy", "optional": true }, { - "name": "resource_group", + "name": "gateway_connection", "type": "TypeString", - "description": "The resource group for this VPN gateway", - "cloud_data_type": "resource_group", - "immutable": true, + "description": "The unique identifier for this VPN gateway connection", + "computed": true + }, + { + "name": "related_crn", + "type": "TypeString", + "description": "The crn of the VPN Gateway resource", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that this VPN gateway connection was created", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "VPN Gateway connection name", + "required": true, + "min_length": 1, + "max_length": 63, + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" + }, + { + "name": "preshared_key", + "type": "TypeString", + "description": "vpn gateway", + "required": true + } + ], + "ibm_is_vpn_server": [ + { + "name": "vpc", + "type": "TypeList", + "description": "The VPC this VPN server resides in.", + "computed": true, + "elem": { + "crn": { + "name": "crn", + "type": "TypeString", + "description": "The CRN for this VPC.", + "computed": true + }, + "deleted": { + "name": "deleted", + "type": "TypeList", + "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + "computed": true, + "elem": { + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about deleted resources.", + "computed": true + } + } + }, + "href": { + "name": "href", + "type": "TypeString", + "description": "The URL for this VPC.", + "computed": true + }, + "id": { + "name": "id", + "type": "TypeString", + "description": "The unique identifier for this VPC.", + "computed": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The unique user-defined name for this VPC.", + "computed": true + } + } + }, + { + "name": "access_tags", + "type": "TypeSet", + "description": "List of access management tags", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "private_ip_address", + "name": "client_ip_pool", "type": "TypeString", - "description": "The Private IP address assigned to the VPN gateway member.", - "computed": true + "description": "The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address prefixes in the VPC or any of the following reserved address ranges: - `127.0.0.0/8` (IPv4 loopback addresses) - `161.26.0.0/16` (IBM services) - `166.8.0.0/14` (Cloud Service Endpoints) - `169.254.0.0/16` (IPv4 link-local addresses) - `224.0.0.0/4` (IPv4 multicast addresses)The prefix length of the client IP address pool's CIDR must be between`/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses that are required to enable the maximum number of concurrent connections is recommended.", + "required": true, + "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(3[0-2]|[1-2][0-9]|[0-9]))$" }, { - "name": "created_at", + "name": "hostname", "type": "TypeString", - "description": "Created Time of the VPN Gateway", + "description": "Fully qualified domain name assigned to this VPN server.", "computed": true - } - ], - "ibm_is_vpn_gateway_connection": [ - { - "name": "ike_policy", - "type": "TypeString", - "description": "VPN gateway connection IKE Policy", - "optional": true }, { - "name": "related_crn", + "name": "resource_type", "type": "TypeString", - "description": "The crn of the VPN Gateway resource", - "computed": true - }, - { - "name": "interval", - "type": "TypeInt", - "description": "Interval for dead peer detection interval", - "default_value": 2, - "min_value": "1", - "max_value": "86399", + "description": "The type of resource referenced.", + "default_value": "vpn_server", "optional": true }, { - "name": "timeout", - "type": "TypeInt", - "description": "Timeout for dead peer detection", - "default_value": 10, - "min_value": "2", - "max_value": "86399", - "optional": true + "name": "client_auto_delete", + "type": "TypeBool", + "description": "If set to `true`, disconnected VPN clients will be automatically deleted after the `client_auto_delete_timeout` time has passed.", + "computed": true }, { - "name": "action", - "type": "TypeString", - "description": "Action detection for dead peer detection action", - "default_value": "restart", - "options": "restart, clear, hold, none", + "name": "enable_split_tunneling", + "type": "TypeBool", + "description": "Indicates whether the split tunneling is enabled on this VPN server.", + "default_value": false, "optional": true }, { - "name": "resource_type", - "type": "TypeString", - "description": "The resource type", - "computed": true - }, - { - "name": "created_at", + "name": "lifecycle_state", "type": "TypeString", - "description": "The date and time that this VPN gateway connection was created", + "description": "The lifecycle state of the VPN server.", "computed": true }, { - "name": "admin_state_up", - "type": "TypeBool", - "description": "VPN gateway connection admin state", - "default_value": false, + "name": "port", + "type": "TypeInt", + "description": "The port number to use for this VPN server.", + "default_value": 443, + "min_value": "1", + "max_value": "65535", "optional": true }, { - "name": "local_cidrs", - "type": "TypeSet", - "description": "VPN gateway connection local CIDRs", + "name": "resource_group", + "type": "TypeString", + "description": "The unique identifier for this resource group. The resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", + "cloud_data_type": "resource_group", "immutable": true, "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "preshared_key", - "type": "TypeString", - "description": "vpn gateway", - "required": true + "computed": true }, { - "name": "peer_cidrs", + "name": "subnets", "type": "TypeSet", - "description": "VPN gateway connection peer CIDRs", - "immutable": true, - "optional": true, + "description": "The unique identifier for this subnet. The subnets to provision this VPN server in. Use subnets in different zones for high availability.", + "required": true, "elem": { "type": "TypeString" - } - }, - { - "name": "gateway_connection", - "type": "TypeString", - "description": "The unique identifier for this VPN gateway connection", - "computed": true - }, - { - "name": "mode", - "type": "TypeString", - "description": "The mode of the VPN gateway", - "computed": true - }, - { - "name": "vpn_gateway", - "type": "TypeString", - "description": "VPN Gateway info", - "immutable": true, - "required": true + }, + "max_items": 2, + "min_items": 1 }, { - "name": "peer_address", + "name": "certificate_crn", "type": "TypeString", - "description": "VPN gateway connection peer address", + "description": "The crn of certificate instance for this VPN server.", "required": true }, { - "name": "status", + "name": "created_at", "type": "TypeString", - "description": "VPN gateway connection status", + "description": "The date and time that the VPN server was created.", "computed": true }, { - "name": "authentication_mode", + "name": "vpn_server", "type": "TypeString", - "description": "The authentication mode", + "description": "The unique identifier for this VPN server.", "computed": true }, - { - "name": "tunnels", - "type": "TypeList", - "description": "The VPN tunnel configuration for this VPN gateway connection (in static route mode)", - "computed": true, - "elem": { - "address": { - "name": "address", - "type": "TypeString", - "description": "The IP address of the VPN gateway member in which the tunnel resides", - "computed": true - }, - "status": { - "name": "status", - "type": "TypeString", - "description": "The status of the VPN Tunnel", - "computed": true - } - } - }, { "name": "name", "type": "TypeString", - "description": "VPN Gateway connection name", - "required": true, + "description": "The user-defined name for this VPN server. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the VPC this VPN server is serving.", "min_length": 1, "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$" - }, - { - "name": "ipsec_policy", - "type": "TypeString", - "description": "IP security policy for vpn gateway connection", + "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", "optional": true - } - ], - "ibm_is_vpn_server": [ + }, { "name": "protocol", "type": "TypeString", @@ -128554,15 +133340,10 @@ "optional": true }, { - "name": "subnets", - "type": "TypeSet", - "description": "The unique identifier for this subnet. The subnets to provision this VPN server in. Use subnets in different zones for high availability.", - "required": true, - "elem": { - "type": "TypeString" - }, - "max_items": 2, - "min_items": 1 + "name": "href", + "type": "TypeString", + "description": "The URL for this VPN server.", + "computed": true }, { "name": "client_authentication", @@ -128591,31 +133372,6 @@ }, "max_items": 2 }, - { - "name": "client_auto_delete", - "type": "TypeBool", - "description": "If set to `true`, disconnected VPN clients will be automatically deleted after the `client_auto_delete_timeout` time has passed.", - "computed": true - }, - { - "name": "client_auto_delete_timeout", - "type": "TypeInt", - "description": "Hours after which disconnected VPN clients will be automatically deleted. If `0`, disconnected VPN clients will be deleted immediately.", - "computed": true - }, - { - "name": "enable_split_tunneling", - "type": "TypeBool", - "description": "Indicates whether the split tunneling is enabled on this VPN server.", - "default_value": false, - "optional": true - }, - { - "name": "href", - "type": "TypeString", - "description": "The URL for this VPN server.", - "computed": true - }, { "name": "client_idle_timeout", "type": "TypeInt", @@ -128626,119 +133382,60 @@ "optional": true }, { - "name": "health_state", - "type": "TypeString", - "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the VPN server.", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "The unique identifier for this resource group. The resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "access_tags", - "type": "TypeSet", - "description": "List of access management tags", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "vpc", + "name": "health_reasons", "type": "TypeList", - "description": "The VPC this VPN server resides in.", "computed": true, "elem": { - "crn": { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this VPC.", - "computed": true - }, - "deleted": { - "name": "deleted", - "type": "TypeList", - "description": "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", - "computed": true, - "elem": { - "more_info": { - "name": "more_info", - "type": "TypeString", - "description": "Link to documentation about deleted resources.", - "computed": true - } - } - }, - "href": { - "name": "href", + "code": { + "name": "code", "type": "TypeString", - "description": "The URL for this VPC.", + "description": "A snake case string succinctly identifying the reason for this health state.", "computed": true }, - "id": { - "name": "id", + "message": { + "name": "message", "type": "TypeString", - "description": "The unique identifier for this VPC.", + "description": "An explanation of the reason for this health state.", "computed": true }, - "name": { - "name": "name", + "more_info": { + "name": "more_info", "type": "TypeString", - "description": "The unique user-defined name for this VPC.", + "description": "Link to documentation about the reason for this health state.", "computed": true } } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the VPN server was created.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "The CRN for this VPN server.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "hostname", + "name": "health_state", "type": "TypeString", - "description": "Fully qualified domain name assigned to this VPN server.", + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", "computed": true }, { - "name": "port", - "type": "TypeInt", - "description": "The port number to use for this VPN server.", - "default_value": 443, - "min_value": "1", - "max_value": "65535", - "optional": true - }, - { - "name": "security_groups", - "type": "TypeSet", - "description": "The unique identifier for this security group. The security groups to use for this VPN server. If unspecified, the VPC's default security group is used.", - "immutable": true, - "optional": true, + "name": "lifecycle_reasons", + "type": "TypeList", + "description": "The reasons for the current lifecycle_state (if any).", "computed": true, "elem": { - "type": "TypeString" + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } } }, { @@ -128794,17 +133491,21 @@ } }, { - "name": "resource_type", - "type": "TypeString", - "description": "The type of resource referenced.", - "default_value": "vpn_server", - "optional": true + "name": "security_groups", + "type": "TypeSet", + "description": "The unique identifier for this security group. The security groups to use for this VPN server. If unspecified, the VPC's default security group is used.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "certificate_crn", - "type": "TypeString", - "description": "The crn of certificate instance for this VPN server.", - "required": true + "name": "client_auto_delete_timeout", + "type": "TypeInt", + "description": "Hours after which disconnected VPN clients will be automatically deleted. If `0`, disconnected VPN clients will be deleted immediately.", + "computed": true }, { "name": "client_dns_server_ips", @@ -128816,29 +133517,26 @@ } }, { - "name": "client_ip_pool", + "name": "crn", "type": "TypeString", - "description": "The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address prefixes in the VPC or any of the following reserved address ranges: - `127.0.0.0/8` (IPv4 loopback addresses) - `161.26.0.0/16` (IBM services) - `166.8.0.0/14` (Cloud Service Endpoints) - `169.254.0.0/16` (IPv4 link-local addresses) - `224.0.0.0/4` (IPv4 multicast addresses)The prefix length of the client IP address pool's CIDR must be between`/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses that are required to enable the maximum number of concurrent connections is recommended.", - "required": true, - "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(3[0-2]|[1-2][0-9]|[0-9]))$" - }, + "description": "The CRN for this VPN server.", + "cloud_data_type": "crn", + "computed": true + } + ], + "ibm_is_vpn_server_client": [ { - "name": "vpn_server", - "type": "TypeString", - "description": "The unique identifier for this VPN server.", + "name": "status_code", + "type": "TypeInt", + "description": "status code of the result.", "computed": true }, { - "name": "name", + "name": "description", "type": "TypeString", - "description": "The user-defined name for this VPN server. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the VPC this VPN server is serving.", - "min_length": 1, - "max_length": 63, - "matches": "^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", - "optional": true - } - ], - "ibm_is_vpn_server_client": [ + "description": "description of the result.", + "computed": true + }, { "name": "vpn_server", "type": "TypeString", @@ -128859,21 +133557,17 @@ "description": "The delete to use for this VPN client to be deleted or not, when false, client is disconneted and when set to true client is deleted.", "default_value": false, "optional": true - }, - { - "name": "status_code", - "type": "TypeInt", - "description": "status code of the result.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "description of the result.", - "computed": true } ], "ibm_is_vpn_server_route": [ + { + "name": "destination", + "type": "TypeString", + "description": "The destination to use for this VPN route in the VPN server. Must be unique within the VPN server. If an incoming packet does not match any destination, it will be dropped.", + "immutable": true, + "required": true, + "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(3[0-2]|[1-2][0-9]|[0-9]))$" + }, { "name": "action", "type": "TypeString", @@ -128883,18 +133577,6 @@ "options": "deliver, drop, translate", "optional": true }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that the VPN route was created.", - "computed": true - }, - { - "name": "lifecycle_state", - "type": "TypeString", - "description": "The lifecycle state of the VPN route.", - "computed": true - }, { "name": "name", "type": "TypeString", @@ -128905,6 +133587,12 @@ "optional": true, "computed": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date and time that the VPN route was created.", + "computed": true + }, { "name": "href", "type": "TypeString", @@ -128931,32 +133619,90 @@ "computed": true }, { - "name": "destination", + "name": "health_state", "type": "TypeString", - "description": "The destination to use for this VPN route in the VPN server. Must be unique within the VPN server. If an incoming packet does not match any destination, it will be dropped.", - "immutable": true, - "required": true, - "matches": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(3[0-2]|[1-2][0-9]|[0-9]))$" - } - ], - "ibm_kms_instance_policies": [ + "description": "The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state.", + "computed": true + }, { - "name": "instance_id", + "name": "health_reasons", + "type": "TypeList", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this health state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this health state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this health state.", + "computed": true + } + } + }, + { + "name": "lifecycle_state", "type": "TypeString", - "description": "Key protect or hpcs instance GUID or CRN", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:kms|hs-crypto" - ] + "description": "The lifecycle state of the VPN route.", + "computed": true }, { - "name": "dual_auth_delete", + "name": "lifecycle_reasons", "type": "TypeList", - "description": "Data associated with the dual authorization delete policy for instance", + "description": "The reasons for the current lifecycle_state (if any).", + "computed": true, + "elem": { + "code": { + "name": "code", + "type": "TypeString", + "description": "A snake case string succinctly identifying the reason for this lifecycle state.", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "description": "An explanation of the reason for this lifecycle state.", + "computed": true + }, + "more_info": { + "name": "more_info", + "type": "TypeString", + "description": "Link to documentation about the reason for this lifecycle state.", + "computed": true + } + } + } + ], + "ibm_kms_instance_policies": [ + { + "name": "key_create_import_access", + "type": "TypeList", + "description": "Data associated with the key create import access policy for the instance", "optional": true, "elem": { + "create_root_key": { + "name": "create_root_key", + "type": "TypeBool", + "description": "If set to true, Key Protect allows you or any authorized users to create root keys in the instance.", + "default_value": true, + "optional": true + }, + "create_standard_key": { + "name": "create_standard_key", + "type": "TypeBool", + "description": "If set to true, Key Protect allows you or any authorized users to create standard keys in the instance.", + "default_value": true, + "optional": true + }, "created_by": { "name": "created_by", "type": "TypeString", @@ -128972,9 +133718,30 @@ "enabled": { "name": "enabled", "type": "TypeBool", - "description": "If set to true, Key Protect enables a dual authorization policy for the instance.", + "description": "If set to true, Key Protect enables a KCIA policy for the instance.", "required": true }, + "enforce_token": { + "name": "enforce_token", + "type": "TypeBool", + "description": "If set to true, the service prevents you or any authorized users from importing key material into the specified service instance without using an import token.", + "default_value": false, + "optional": true + }, + "import_root_key": { + "name": "import_root_key", + "type": "TypeBool", + "description": "If set to true, Key Protect allows you or any authorized users to import root keys into the instance.", + "default_value": true, + "optional": true + }, + "import_standard_key": { + "name": "import_standard_key", + "type": "TypeBool", + "description": "If set to true, Key Protect allows you or any authorized users to import standard keys into the instance.", + "default_value": true, + "optional": true + }, "last_updated": { "name": "last_updated", "type": "TypeString", @@ -128991,9 +133758,9 @@ "max_items": 1 }, { - "name": "rotation", + "name": "metrics", "type": "TypeList", - "description": "Data associated with the rotation policy for instance", + "description": "Data associated with the metric policy for instance", "optional": true, "elem": { "created_by": { @@ -129011,15 +133778,9 @@ "enabled": { "name": "enabled", "type": "TypeBool", - "description": "If set to true, Key Protect enables a rotation policy for the instance.", + "description": "If set to true, Key Protect enables a metrics policy on the instance.", "required": true }, - "interval_month": { - "name": "interval_month", - "type": "TypeInt", - "description": "Specifies the rotation time interval in months for the instance.", - "optional": true - }, "last_updated": { "name": "last_updated", "type": "TypeString", @@ -129036,25 +133797,22 @@ "max_items": 1 }, { - "name": "key_create_import_access", + "name": "instance_id", + "type": "TypeString", + "description": "Key protect or hpcs instance GUID or CRN", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:kms|hs-crypto" + ] + }, + { + "name": "dual_auth_delete", "type": "TypeList", - "description": "Data associated with the key create import access policy for the instance", + "description": "Data associated with the dual authorization delete policy for instance", "optional": true, "elem": { - "create_root_key": { - "name": "create_root_key", - "type": "TypeBool", - "description": "If set to true, Key Protect allows you or any authorized users to create root keys in the instance.", - "default_value": true, - "optional": true - }, - "create_standard_key": { - "name": "create_standard_key", - "type": "TypeBool", - "description": "If set to true, Key Protect allows you or any authorized users to create standard keys in the instance.", - "default_value": true, - "optional": true - }, "created_by": { "name": "created_by", "type": "TypeString", @@ -129070,30 +133828,9 @@ "enabled": { "name": "enabled", "type": "TypeBool", - "description": "If set to true, Key Protect enables a KCIA policy for the instance.", + "description": "If set to true, Key Protect enables a dual authorization policy for the instance.", "required": true }, - "enforce_token": { - "name": "enforce_token", - "type": "TypeBool", - "description": "If set to true, the service prevents you or any authorized users from importing key material into the specified service instance without using an import token.", - "default_value": false, - "optional": true - }, - "import_root_key": { - "name": "import_root_key", - "type": "TypeBool", - "description": "If set to true, Key Protect allows you or any authorized users to import root keys into the instance.", - "default_value": true, - "optional": true - }, - "import_standard_key": { - "name": "import_standard_key", - "type": "TypeBool", - "description": "If set to true, Key Protect allows you or any authorized users to import standard keys into the instance.", - "default_value": true, - "optional": true - }, "last_updated": { "name": "last_updated", "type": "TypeString", @@ -129110,9 +133847,9 @@ "max_items": 1 }, { - "name": "metrics", + "name": "rotation", "type": "TypeList", - "description": "Data associated with the metric policy for instance", + "description": "Data associated with the rotation policy for instance", "optional": true, "elem": { "created_by": { @@ -129130,9 +133867,15 @@ "enabled": { "name": "enabled", "type": "TypeBool", - "description": "If set to true, Key Protect enables a metrics policy on the instance.", + "description": "If set to true, Key Protect enables a rotation policy for the instance.", "required": true }, + "interval_month": { + "name": "interval_month", + "type": "TypeInt", + "description": "Specifies the rotation time interval in months for the instance.", + "optional": true + }, "last_updated": { "name": "last_updated", "type": "TypeString", @@ -129150,6 +133893,12 @@ } ], "ibm_kms_key": [ + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, { "name": "instance_id", "type": "TypeString", @@ -129162,19 +133911,16 @@ ] }, { - "name": "endpoint_type", + "name": "key_id", "type": "TypeString", - "description": "public or private", - "optional": true, + "description": "Key ID", "computed": true }, { - "name": "standard_key", - "type": "TypeBool", - "description": "Standard key type", - "default_value": false, - "immutable": true, - "optional": true + "name": "type", + "type": "TypeString", + "description": "type of service hs-crypto or kms", + "computed": true }, { "name": "iv_value", @@ -129184,25 +133930,19 @@ "optional": true }, { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - "computed": true + "name": "force_delete", + "type": "TypeBool", + "description": "set to true to force delete the key", + "default_value": false, + "optional": true }, { - "name": "description", + "name": "expiration_date", "type": "TypeString", - "description": "description of the key", + "description": "The date the key material expires. The date format follows RFC 3339. You can set an expiration date on any key on its creation. A key moves into the Deactivated state within one hour past its expiration date, if one is assigned. If you create a key without specifying an expiration date, the key does not expire", "immutable": true, "optional": true }, - { - "name": "crn", - "type": "TypeString", - "description": "Crn of the key", - "cloud_data_type": "crn", - "computed": true - }, { "name": "instance_crn", "type": "TypeString", @@ -129210,29 +133950,28 @@ "computed": true }, { - "name": "resource_status", + "name": "endpoint_type", "type": "TypeString", - "description": "The status of the resource", + "description": "public or private", + "optional": true, "computed": true }, { - "name": "resource_group_name", + "name": "resource_name", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The name of the resource", "computed": true }, { - "name": "key_ring_id", + "name": "resource_crn", "type": "TypeString", - "description": "Key Ring for the Key", - "default_value": "default", - "immutable": true, - "optional": true + "description": "The crn of the resource", + "computed": true }, { - "name": "key_id", + "name": "resource_group_name", "type": "TypeString", - "description": "Key ID", + "description": "The resource group name in which resource is provisioned", "computed": true }, { @@ -129243,16 +133982,11 @@ "required": true }, { - "name": "resource_crn", - "type": "TypeString", - "description": "The crn of the resource", - "computed": true - }, - { - "name": "type", + "name": "description", "type": "TypeString", - "description": "type of service hs-crypto or kms", - "computed": true + "description": "description of the key", + "immutable": true, + "optional": true }, { "name": "payload", @@ -129263,30 +133997,39 @@ "computed": true }, { - "name": "encrypted_nonce", + "name": "crn", "type": "TypeString", - "description": "Only for imported root key", + "description": "Crn of the key", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "key_ring_id", + "type": "TypeString", + "description": "Key Ring for the Key", + "default_value": "default", "immutable": true, "optional": true }, { - "name": "force_delete", + "name": "standard_key", "type": "TypeBool", - "description": "set to true to force delete the key", + "description": "Standard key type", "default_value": false, + "immutable": true, "optional": true }, { - "name": "expiration_date", + "name": "encrypted_nonce", "type": "TypeString", - "description": "The date the key material expires. The date format follows RFC 3339. You can set an expiration date on any key on its creation. A key moves into the Deactivated state within one hour past its expiration date, if one is assigned. If you create a key without specifying an expiration date, the key does not expire", + "description": "Only for imported root key", "immutable": true, "optional": true }, { - "name": "resource_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The name of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true } ], @@ -129345,14 +134088,32 @@ ] }, { - "name": "key_id", + "name": "alias", "type": "TypeString", - "description": "Key ID", "optional": true }, { - "name": "alias", + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", + "computed": true + }, + { + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "computed": true + }, + { + "name": "key_id", "type": "TypeString", + "description": "Key ID", "optional": true }, { @@ -129471,40 +134232,14 @@ } } }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, { "name": "resource_crn", "type": "TypeString", "description": "The crn of the resource", "computed": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "resource_controller_url", - "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - "computed": true } ], "ibm_kms_key_rings": [ - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "instance_id", "type": "TypeString", @@ -129532,19 +134267,37 @@ "description": "set to true to force delete this key ring. This allows key ring deletion as long as all keys inside have key state equals to 5 (destroyed). Keys are moved to the default key ring.", "default_value": false, "optional": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private", + "immutable": true, + "optional": true, + "computed": true } ], "ibm_kms_key_with_policy_overrides": [ { - "name": "instance_id", - "type": "TypeString", - "description": "Key protect or HPCS instance GUID or CRN", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true, - "cloud_data_range": [ - "service:kms|hs-crypto" - ] + "name": "rotation", + "type": "TypeList", + "description": "Data associated with the key rotation policy", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "If set to true, Key Protect enables a rotation policy on a single key.", + "required": true + }, + "interval_month": { + "name": "interval_month", + "type": "TypeInt", + "description": "Specifies the key rotation time interval in months, with a minimum of 1, and a maximum of 12", + "required": true + } + } }, { "name": "description", @@ -129554,58 +134307,39 @@ "optional": true }, { - "name": "key_id", - "type": "TypeString", - "description": "Key ID", - "computed": true - }, - { - "name": "payload", + "name": "type", "type": "TypeString", - "secure": true, - "immutable": true, - "optional": true, + "description": "Type of service hs-crypto or kms", "computed": true }, { - "name": "iv_value", - "type": "TypeString", - "description": "Only for imported root key", + "name": "standard_key", + "type": "TypeBool", + "description": "Standard key type", + "default_value": false, "immutable": true, "optional": true }, { - "name": "instance_crn", - "type": "TypeString", - "description": "Key protect or HPCS instance CRN", - "computed": true - }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true + "name": "force_delete", + "type": "TypeBool", + "description": "set to true to force delete the key", + "default_value": false, + "optional": true }, { - "name": "resource_controller_url", + "name": "crn", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "Crn of the key", + "cloud_data_type": "crn", "computed": true }, { - "name": "type", + "name": "instance_crn", "type": "TypeString", - "description": "Type of service hs-crypto or kms", + "description": "Key protect or HPCS instance CRN", "computed": true }, - { - "name": "standard_key", - "type": "TypeBool", - "description": "Standard key type", - "default_value": false, - "immutable": true, - "optional": true - }, { "name": "expiration_date", "type": "TypeString", @@ -129614,23 +134348,30 @@ "optional": true }, { - "name": "key_ring_id", - "type": "TypeString", - "description": "Key Ring for the Key", - "default_value": "default", - "immutable": true, - "optional": true + "name": "dual_auth_delete", + "type": "TypeList", + "description": "Data associated with the dual authorization delete policy.", + "optional": true, + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "If set to true, Key Protect enables a dual authorization policy on a single key.", + "required": true + } + } }, { - "name": "resource_crn", + "name": "resource_name", "type": "TypeString", - "description": "The crn of the resource", + "description": "The name of the resource", "computed": true }, { - "name": "resource_status", + "name": "resource_controller_url", "type": "TypeString", - "description": "The status of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { @@ -129656,54 +134397,56 @@ "optional": true }, { - "name": "force_delete", - "type": "TypeBool", - "description": "set to true to force delete the key", - "default_value": false, + "name": "iv_value", + "type": "TypeString", + "description": "Only for imported root key", + "immutable": true, "optional": true }, { - "name": "crn", + "name": "resource_status", "type": "TypeString", - "description": "Crn of the key", - "cloud_data_type": "crn", + "description": "The status of the resource", "computed": true }, { - "name": "rotation", - "type": "TypeList", - "description": "Data associated with the key rotation policy", - "optional": true, - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "If set to true, Key Protect enables a rotation policy on a single key.", - "required": true - }, - "interval_month": { - "name": "interval_month", - "type": "TypeInt", - "description": "Specifies the key rotation time interval in months, with a minimum of 1, and a maximum of 12", - "required": true - } - } + "name": "instance_id", + "type": "TypeString", + "description": "Key protect or HPCS instance GUID or CRN", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true, + "cloud_data_range": [ + "service:kms|hs-crypto" + ] }, { - "name": "dual_auth_delete", - "type": "TypeList", - "description": "Data associated with the dual authorization delete policy.", + "name": "key_ring_id", + "type": "TypeString", + "description": "Key Ring for the Key", + "default_value": "default", + "immutable": true, + "optional": true + }, + { + "name": "key_id", + "type": "TypeString", + "description": "Key ID", + "computed": true + }, + { + "name": "payload", + "type": "TypeString", + "secure": true, + "immutable": true, "optional": true, - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "If set to true, Key Protect enables a dual authorization policy on a single key.", - "required": true - } - } + "computed": true + }, + { + "name": "resource_crn", + "type": "TypeString", + "description": "The crn of the resource", + "computed": true }, { "name": "resource_group_name", @@ -129714,99 +134457,114 @@ ], "ibm_kp_key": [ { - "name": "key_protect_id", + "name": "iv_value", "type": "TypeString", - "description": "Key protect instance ID", + "description": "Only for imported root key", "immutable": true, - "required": true - }, - { - "name": "force_delete", - "type": "TypeBool", - "description": "set to true to force delete the key", - "default_value": false, "optional": true }, { - "name": "resource_status", + "name": "crn", "type": "TypeString", - "description": "The status of the resource", + "description": "Crn of the key", + "cloud_data_type": "crn", "computed": true }, { - "name": "resource_controller_url", + "name": "resource_name", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The name of the resource", "computed": true }, { - "name": "payload", + "name": "resource_group_name", "type": "TypeString", - "optional": true, + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "resource_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The name of the resource", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { - "name": "resource_crn", + "name": "key_id", "type": "TypeString", - "description": "The crn of the resource", + "description": "Key ID", "computed": true }, { - "name": "key_id", + "name": "force_delete", + "type": "TypeBool", + "description": "set to true to force delete the key", + "default_value": false, + "optional": true + }, + { + "name": "standard_key", + "type": "TypeBool", + "description": "Standard key type", + "default_value": false, + "immutable": true, + "optional": true + }, + { + "name": "resource_status", "type": "TypeString", - "description": "Key ID", + "description": "The status of the resource", "computed": true }, { - "name": "key_name", + "name": "key_protect_id", "type": "TypeString", - "description": "Key name", + "description": "Key protect instance ID", "immutable": true, "required": true }, { - "name": "encrypted_nonce", + "name": "payload", "type": "TypeString", - "description": "Only for imported root key", - "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "iv_value", + "name": "encrypted_nonce", "type": "TypeString", "description": "Only for imported root key", "immutable": true, "optional": true }, { - "name": "resource_group_name", + "name": "resource_crn", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The crn of the resource", "computed": true }, { - "name": "standard_key", - "type": "TypeBool", - "description": "Standard key type", - "default_value": false, + "name": "key_name", + "type": "TypeString", + "description": "Key name", "immutable": true, - "optional": true + "required": true + } + ], + "ibm_lb": [ + { + "name": "tags", + "type": "TypeSet", + "description": "Tags associated with resource", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "crn", + "name": "hostname", "type": "TypeString", - "description": "Crn of the key", - "cloud_data_type": "crn", "computed": true - } - ], - "ibm_lb": [ + }, { "name": "ssl_offload", "type": "TypeBool", @@ -129815,9 +134573,11 @@ "optional": true }, { - "name": "hostname", + "name": "datacenter", "type": "TypeString", - "computed": true + "description": "Datacenter name info", + "immutable": true, + "required": true }, { "name": "ha_enabled", @@ -129834,8 +134594,8 @@ "optional": true }, { - "name": "ssl_enabled", - "type": "TypeBool", + "name": "ip_address", + "type": "TypeString", "computed": true }, { @@ -129852,41 +134612,18 @@ "optional": true }, { - "name": "tags", - "type": "TypeSet", - "description": "Tags associated with resource", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "ssl_enabled", + "type": "TypeBool", + "computed": true }, { "name": "connections", "type": "TypeInt", "description": "Connections value", "required": true - }, - { - "name": "datacenter", - "type": "TypeString", - "description": "Datacenter name info", - "immutable": true, - "required": true - }, - { - "name": "ip_address", - "type": "TypeString", - "computed": true } ], "ibm_lb_service": [ - { - "name": "weight", - "type": "TypeInt", - "description": "Weight value", - "required": true - }, { "name": "tags", "type": "TypeSet", @@ -129928,39 +134665,37 @@ "type": "TypeString", "description": "health check type", "required": true + }, + { + "name": "weight", + "type": "TypeInt", + "description": "Weight value", + "required": true } ], "ibm_lb_service_group": [ - { - "name": "service_group_id", - "type": "TypeInt", - "description": "Service group ID", - "computed": true - }, { "name": "allocation", "type": "TypeInt", "description": "Allocation type", "required": true }, - { - "name": "port", - "type": "TypeInt", - "description": "Port number", - "required": true - }, - { - "name": "routing_method", - "type": "TypeString", - "description": "Routing method", - "required": true - }, { "name": "timeout", "type": "TypeInt", "description": "Timeout value", "optional": true }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "virtual_server_id", "type": "TypeInt", @@ -129974,6 +134709,18 @@ "immutable": true, "required": true }, + { + "name": "port", + "type": "TypeInt", + "description": "Port number", + "required": true + }, + { + "name": "routing_method", + "type": "TypeString", + "description": "Routing method", + "required": true + }, { "name": "routing_type", "type": "TypeString", @@ -129981,24 +134728,13 @@ "required": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "service_group_id", + "type": "TypeInt", + "description": "Service group ID", + "computed": true } ], "ibm_lb_vpx": [ - { - "name": "ip_count", - "type": "TypeInt", - "description": "IP address count", - "immutable": true, - "required": true - }, { "name": "public_subnet", "type": "TypeString", @@ -130007,6 +134743,15 @@ "optional": true, "computed": true }, + { + "name": "vip_pool", + "type": "TypeList", + "description": "List of VIP ids", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "datacenter", "type": "TypeString", @@ -130014,6 +134759,12 @@ "immutable": true, "required": true }, + { + "name": "type", + "type": "TypeString", + "description": "Type of the VPX", + "computed": true + }, { "name": "speed", "type": "TypeInt", @@ -130022,23 +134773,38 @@ "required": true }, { - "name": "private_subnet", + "name": "ip_count", + "type": "TypeInt", + "description": "IP address count", + "immutable": true, + "required": true + }, + { + "name": "name", "type": "TypeString", - "description": "Private subnet", + "description": "Name", + "computed": true + }, + { + "name": "private_vlan_id", + "type": "TypeInt", + "description": "Private VLAN id", "immutable": true, "optional": true, "computed": true }, { - "name": "name", + "name": "private_subnet", "type": "TypeString", - "description": "Name", + "description": "Private subnet", + "immutable": true, + "optional": true, "computed": true }, { - "name": "type", + "name": "management_ip_address", "type": "TypeString", - "description": "Type of the VPX", + "description": "management IP address", "computed": true }, { @@ -130051,13 +134817,6 @@ "type": "TypeString" } }, - { - "name": "version", - "type": "TypeString", - "description": "version info", - "immutable": true, - "required": true - }, { "name": "public_vlan_id", "type": "TypeInt", @@ -130066,21 +134825,6 @@ "optional": true, "computed": true }, - { - "name": "vip_pool", - "type": "TypeList", - "description": "List of VIP ids", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "management_ip_address", - "type": "TypeString", - "description": "management IP address", - "computed": true - }, { "name": "plan", "type": "TypeString", @@ -130089,12 +134833,11 @@ "required": true }, { - "name": "private_vlan_id", - "type": "TypeInt", - "description": "Private VLAN id", + "name": "version", + "type": "TypeString", + "description": "version info", "immutable": true, - "optional": true, - "computed": true + "required": true } ], "ibm_lb_vpx_ha": [ @@ -130132,9 +134875,17 @@ ], "ibm_lb_vpx_service": [ { - "name": "connection_limit", + "name": "vip_id", + "type": "TypeString", + "description": "VIP id", + "immutable": true, + "required": true + }, + { + "name": "destination_port", "type": "TypeInt", - "description": "Number of connections limit", + "description": "Destination Port number", + "immutable": true, "required": true }, { @@ -130143,13 +134894,6 @@ "description": "Health check info", "required": true }, - { - "name": "usip", - "type": "TypeString", - "description": "usip info", - "default_value": "NO", - "optional": true - }, { "name": "name", "type": "TypeString", @@ -130165,18 +134909,24 @@ "required": true }, { - "name": "destination_port", + "name": "weight", "type": "TypeInt", - "description": "Destination Port number", - "immutable": true, + "description": "Weight value", "required": true }, { - "name": "weight", + "name": "connection_limit", "type": "TypeInt", - "description": "Weight value", + "description": "Number of connections limit", "required": true }, + { + "name": "usip", + "type": "TypeString", + "description": "usip info", + "default_value": "NO", + "optional": true + }, { "name": "tags", "type": "TypeSet", @@ -130186,30 +134936,9 @@ "elem": { "type": "TypeString" } - }, - { - "name": "vip_id", - "type": "TypeString", - "description": "VIP id", - "immutable": true, - "required": true } ], "ibm_lb_vpx_vip": [ - { - "name": "persistence", - "type": "TypeString", - "description": "Persistance value", - "optional": true, - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "Name", - "immutable": true, - "required": true - }, { "name": "source_port", "type": "TypeInt", @@ -130224,19 +134953,6 @@ "immutable": true, "required": true }, - { - "name": "security_certificate_id", - "type": "TypeInt", - "description": "security certificate ID", - "immutable": true, - "optional": true - }, - { - "name": "load_balancing_method", - "type": "TypeString", - "description": "Load balancing method", - "required": true - }, { "name": "virtual_ip_address", "type": "TypeString", @@ -130259,78 +134975,58 @@ "description": "NAD controller ID", "immutable": true, "required": true + }, + { + "name": "load_balancing_method", + "type": "TypeString", + "description": "Load balancing method", + "required": true + }, + { + "name": "persistence", + "type": "TypeString", + "description": "Persistance value", + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Name", + "immutable": true, + "required": true + }, + { + "name": "security_certificate_id", + "type": "TypeInt", + "description": "security certificate ID", + "immutable": true, + "optional": true } ], "ibm_lbaas": [ { - "name": "use_system_public_ip_pool", - "type": "TypeBool", - "description": "\"in public loadbalancer - Public IP address allocation done by system public IP pool or public subnet.\"", - "optional": true, + "name": "datacenter", + "type": "TypeString", "computed": true }, { - "name": "protocols", - "type": "TypeSet", - "description": "Protocols to be assigned to this load balancer.", - "optional": true, + "name": "subnets", + "type": "TypeList", + "description": "The subnet where this Load Balancer will be provisioned.", + "immutable": true, + "required": true, "elem": { - "backend_port": { - "name": "backend_port", - "type": "TypeInt", - "description": "Backend Protocol port number. Should be in range (1, 65535)", - "required": true - }, - "backend_protocol": { - "name": "backend_protocol", - "type": "TypeString", - "description": "Backend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", - "required": true - }, - "frontend_port": { - "name": "frontend_port", - "type": "TypeInt", - "description": "Frontend Protocol port number. Should be in range (1, 65535)", - "required": true - }, - "frontend_protocol": { - "name": "frontend_protocol", - "type": "TypeString", - "description": "Frontend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", - "required": true - }, - "load_balancing_method": { - "name": "load_balancing_method", - "type": "TypeString", - "description": "Load balancing algorithm: 'round_robin', 'weighted_round_robin', 'least_connection'", - "default_value": "round_robin", - "optional": true - }, - "max_conn": { - "name": "max_conn", - "type": "TypeInt", - "description": "No. of connections the listener can accept. Should be between 1-64000", - "optional": true - }, - "protocol_id": { - "name": "protocol_id", - "type": "TypeString", - "description": "The UUID of a load balancer protocol", - "computed": true - }, - "session_stickiness": { - "name": "session_stickiness", - "type": "TypeString", - "description": "Session stickness. Valid values is SOURCE_IP and HTTP_COOKIE", - "optional": true - }, - "tls_certificate_id": { - "name": "tls_certificate_id", - "type": "TypeInt", - "description": "This references to SSL/TLS certificate for a protocol", - "optional": true - } - } + "type": "TypeInt" + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "vip", + "type": "TypeString", + "description": "The virtual ip address of this load balancer", + "computed": true }, { "name": "wait_time_minutes", @@ -130338,6 +135034,25 @@ "default_value": 90, "optional": true }, + { + "name": "description", + "type": "TypeString", + "description": "Description of a load balancer.", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The operation status 'ONLINE' or 'OFFLINE' of a load balancer.", + "computed": true + }, + { + "name": "use_system_public_ip_pool", + "type": "TypeBool", + "description": "\"in public loadbalancer - Public IP address allocation done by system public IP pool or public subnet.\"", + "optional": true, + "computed": true + }, { "name": "health_monitors", "type": "TypeList", @@ -130381,17 +135096,11 @@ } }, { - "name": "type", + "name": "name", "type": "TypeString", - "description": "Specifies if a load balancer is public or private", - "default_value": "PUBLIC", + "description": "The load balancer's name.", "immutable": true, - "optional": true - }, - { - "name": "datacenter", - "type": "TypeString", - "computed": true + "required": true }, { "name": "ssl_ciphers", @@ -130403,76 +135112,96 @@ } }, { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "subnets", - "type": "TypeList", - "description": "The subnet where this Load Balancer will be provisioned.", - "immutable": true, - "required": true, - "elem": { - "type": "TypeInt" - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "status", - "type": "TypeString", - "description": "The operation status 'ONLINE' or 'OFFLINE' of a load balancer.", - "computed": true - }, - { - "name": "vip", + "name": "resource_controller_url", "type": "TypeString", - "description": "The virtual ip address of this load balancer", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { - "name": "resource_name", + "name": "resource_status", "type": "TypeString", - "description": "The name of the resource", + "description": "The status of the resource", "computed": true }, { - "name": "name", + "name": "type", "type": "TypeString", - "description": "The load balancer's name.", + "description": "Specifies if a load balancer is public or private", + "default_value": "PUBLIC", "immutable": true, - "required": true + "optional": true }, { - "name": "description", - "type": "TypeString", - "description": "Description of a load balancer.", - "optional": true + "name": "protocols", + "type": "TypeSet", + "description": "Protocols to be assigned to this load balancer.", + "optional": true, + "elem": { + "backend_port": { + "name": "backend_port", + "type": "TypeInt", + "description": "Backend Protocol port number. Should be in range (1, 65535)", + "required": true + }, + "backend_protocol": { + "name": "backend_protocol", + "type": "TypeString", + "description": "Backend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", + "required": true + }, + "frontend_port": { + "name": "frontend_port", + "type": "TypeInt", + "description": "Frontend Protocol port number. Should be in range (1, 65535)", + "required": true + }, + "frontend_protocol": { + "name": "frontend_protocol", + "type": "TypeString", + "description": "Frontend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", + "required": true + }, + "load_balancing_method": { + "name": "load_balancing_method", + "type": "TypeString", + "description": "Load balancing algorithm: 'round_robin', 'weighted_round_robin', 'least_connection'", + "default_value": "round_robin", + "optional": true + }, + "max_conn": { + "name": "max_conn", + "type": "TypeInt", + "description": "No. of connections the listener can accept. Should be between 1-64000", + "optional": true + }, + "protocol_id": { + "name": "protocol_id", + "type": "TypeString", + "description": "The UUID of a load balancer protocol", + "computed": true + }, + "session_stickiness": { + "name": "session_stickiness", + "type": "TypeString", + "description": "Session stickness. Valid values is SOURCE_IP and HTTP_COOKIE", + "optional": true + }, + "tls_certificate_id": { + "name": "tls_certificate_id", + "type": "TypeInt", + "description": "This references to SSL/TLS certificate for a protocol", + "optional": true + } + } }, { - "name": "resource_controller_url", + "name": "resource_name", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The name of the resource", "computed": true } ], "ibm_lbaas_health_monitor": [ - { - "name": "monitor_id", - "type": "TypeString", - "description": "Monitor ID", - "immutable": true, - "required": true - }, - { - "name": "lbaas_id", - "type": "TypeString", - "description": "LBAAS id", - "immutable": true, - "required": true - }, { "name": "protocol", "type": "TypeString", @@ -130512,6 +135241,20 @@ "description": "URL Path", "default_value": "/", "optional": true + }, + { + "name": "monitor_id", + "type": "TypeString", + "description": "Monitor ID", + "immutable": true, + "required": true + }, + { + "name": "lbaas_id", + "type": "TypeString", + "description": "LBAAS id", + "immutable": true, + "required": true } ], "ibm_lbaas_server_instance_attachment": [ @@ -130550,6 +135293,18 @@ "description": "Id of the ibm_metrics_router_route", "computed": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp of the route creation time.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The timestamp of the route last updated time.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -130623,18 +135378,6 @@ "description": "The crn of the route resource.", "cloud_data_type": "crn", "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The timestamp of the route creation time.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The timestamp of the route last updated time.", - "computed": true } ], "ibm_metrics_router_settings": [ @@ -130644,31 +135387,6 @@ "description": "Id of the ibm_metrics_router_settings", "computed": true }, - { - "name": "primary_metadata_region", - "type": "TypeString", - "description": "To store all your meta data in a single region.", - "min_length": 3, - "max_length": 256, - "matches": "^[a-zA-Z0-9 \\-_]+$", - "optional": true, - "computed": true - }, - { - "name": "backup_metadata_region", - "type": "TypeString", - "description": "To backup all your meta data in a different region.", - "min_length": 3, - "max_length": 256, - "matches": "^[a-zA-Z0-9 \\-_]+$", - "optional": true - }, - { - "name": "private_api_endpoint_only", - "type": "TypeBool", - "description": "If you set this true then you cannot access api through public network.", - "optional": true - }, { "name": "default_targets", "type": "TypeList", @@ -130691,28 +135409,34 @@ "elem": { "type": "TypeString" } - } - ], - "ibm_metrics_router_target": [ + }, { - "name": "destination_crn", + "name": "primary_metadata_region", "type": "TypeString", - "description": "The CRN of a destination service instance or resource.", - "required": true, + "description": "To store all your meta data in a single region.", "min_length": 3, - "max_length": 1000, - "matches": "^[a-zA-Z0-9 \\-._:\\/]+$" + "max_length": 256, + "matches": "^[a-zA-Z0-9 \\-_]+$", + "optional": true, + "computed": true }, { - "name": "region", + "name": "backup_metadata_region", "type": "TypeString", - "description": "Include this optional field if you want to create a target in a different region other than the one you are connected.", - "immutable": true, + "description": "To backup all your meta data in a different region.", "min_length": 3, - "max_length": 1000, - "matches": "^[a-zA-Z0-9 \\-._:]+$", + "max_length": 256, + "matches": "^[a-zA-Z0-9 \\-_]+$", "optional": true }, + { + "name": "private_api_endpoint_only", + "type": "TypeBool", + "description": "If you set this true then you cannot access api through public network.", + "optional": true + } + ], + "ibm_metrics_router_target": [ { "name": "crn", "type": "TypeString", @@ -130746,9 +135470,41 @@ "min_length": 1, "max_length": 1000, "matches": "^[a-zA-Z0-9 \\-._:]+$" + }, + { + "name": "destination_crn", + "type": "TypeString", + "description": "The CRN of a destination service instance or resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring\u0026interface=ui#target-monitoring-ui) for details.", + "required": true, + "min_length": 3, + "max_length": 1000, + "matches": "^[a-zA-Z0-9 \\-._:\\/]+$" + }, + { + "name": "region", + "type": "TypeString", + "description": "Include this optional field if you want to create a target in a different region other than the one you are connected.", + "immutable": true, + "min_length": 3, + "max_length": 1000, + "matches": "^[a-zA-Z0-9 \\-._:]+$", + "optional": true } ], "ibm_multi_vlan_firewall": [ + { + "name": "private_vlan_id", + "type": "TypeInt", + "description": "Private VLAN id", + "computed": true + }, + { + "name": "firewall_type", + "type": "TypeString", + "description": "Firewall type", + "immutable": true, + "required": true + }, { "name": "addon_configuration", "type": "TypeList", @@ -130758,13 +135514,6 @@ "type": "TypeString" } }, - { - "name": "name", - "type": "TypeString", - "description": "name", - "immutable": true, - "required": true - }, { "name": "public_vlan_id", "type": "TypeInt", @@ -130772,15 +135521,16 @@ "computed": true }, { - "name": "private_vlan_id", - "type": "TypeInt", - "description": "Private VLAN id", - "computed": true + "name": "pod", + "type": "TypeString", + "description": "POD name", + "immutable": true, + "required": true }, { - "name": "firewall_type", + "name": "name", "type": "TypeString", - "description": "Firewall type", + "description": "name", "immutable": true, "required": true }, @@ -130790,47 +135540,120 @@ "description": "Public IP Address", "computed": true }, + { + "name": "public_ipv6", + "type": "TypeString", + "description": "Public IPV6 IP", + "computed": true + }, { "name": "private_ip", "type": "TypeString", "description": "Private IP Address", "computed": true }, + { + "name": "username", + "type": "TypeString", + "description": "User name", + "computed": true + }, + { + "name": "password", + "type": "TypeString", + "description": "Password", + "secure": true, + "computed": true + }, { "name": "datacenter", "type": "TypeString", "description": "Datacenter name", "immutable": true, "required": true + } + ], + "ibm_network_gateway": [ + { + "name": "public_ip_address_id", + "type": "TypeInt", + "computed": true }, { - "name": "pod", + "name": "public_ipv6_address_id", + "type": "TypeInt", + "computed": true + }, + { + "name": "public_vlan_id", + "type": "TypeInt", + "computed": true + }, + { + "name": "associated_vlans", + "type": "TypeList", + "description": "The VLAN instances associated with this Network Gateway", + "computed": true, + "elem": { + "bypass": { + "name": "bypass", + "type": "TypeBool", + "description": "Indicates if the VLAN is in bypass or routed modes", + "computed": true + }, + "network_vlan_id": { + "name": "network_vlan_id", + "type": "TypeInt", + "description": "The Identifier of the VLAN which is associated", + "computed": true + }, + "vlan_id": { + "name": "vlan_id", + "type": "TypeInt", + "computed": true + } + } + }, + { + "name": "private_ipv4_address", "type": "TypeString", - "description": "POD name", + "computed": true + }, + { + "name": "ssh_key_ids", + "type": "TypeList", "immutable": true, - "required": true + "optional": true, + "elem": { + "type": "TypeInt" + } }, { - "name": "public_ipv6", + "name": "post_install_script_uri", "type": "TypeString", - "description": "Public IPV6 IP", + "immutable": true, + "optional": true + }, + { + "name": "private_ip_address_id", + "type": "TypeInt", "computed": true }, { - "name": "username", + "name": "public_ipv4_address", "type": "TypeString", - "description": "User name", "computed": true }, { - "name": "password", + "name": "private_vlan_id", + "type": "TypeInt", + "computed": true + }, + { + "name": "status", "type": "TypeString", - "description": "Password", - "secure": true, "computed": true - } - ], - "ibm_network_gateway": [ + }, { "name": "members", "type": "TypeSet", @@ -131057,89 +135880,16 @@ "type": "TypeString", "description": "The name of the gateway", "required": true - }, - { - "name": "post_install_script_uri", - "type": "TypeString", - "immutable": true, - "optional": true - }, - { - "name": "private_ip_address_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "private_ipv4_address", - "type": "TypeString", - "computed": true - }, - { - "name": "public_vlan_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "computed": true - }, - { - "name": "ssh_key_ids", - "type": "TypeList", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeInt" - } - }, - { - "name": "public_ipv4_address", - "type": "TypeString", - "computed": true - }, - { - "name": "private_vlan_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "public_ip_address_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "public_ipv6_address_id", - "type": "TypeInt", - "computed": true - }, - { - "name": "associated_vlans", - "type": "TypeList", - "description": "The VLAN instances associated with this Network Gateway", - "computed": true, - "elem": { - "bypass": { - "name": "bypass", - "type": "TypeBool", - "description": "Indicates if the VLAN is in bypass or routed modes", - "computed": true - }, - "network_vlan_id": { - "name": "network_vlan_id", - "type": "TypeInt", - "description": "The Identifier of the VLAN which is associated", - "computed": true - }, - "vlan_id": { - "name": "vlan_id", - "type": "TypeInt", - "computed": true - } - } } ], "ibm_network_gateway_vlan_association": [ + { + "name": "bypass", + "type": "TypeBool", + "description": "Indicates if the VLAN should be in bypass or routed modes", + "default_value": true, + "optional": true + }, { "name": "gateway_id", "type": "TypeInt", @@ -131153,13 +135903,6 @@ "description": "The Identifier of the VLAN to be associated", "immutable": true, "required": true - }, - { - "name": "bypass", - "type": "TypeBool", - "description": "Indicates if the VLAN should be in bypass or routed modes", - "default_value": true, - "optional": true } ], "ibm_network_interface_sg_attachment": [ @@ -131218,30 +135961,9 @@ ], "ibm_network_vlan": [ { - "name": "type", - "type": "TypeString", - "description": "VLAN type", - "immutable": true, - "required": true - }, - { - "name": "name", - "type": "TypeString", - "description": "VLAN name", - "optional": true - }, - { - "name": "router_hostname", - "type": "TypeString", - "description": "router host name", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "vlan_number", + "name": "child_resource_count", "type": "TypeInt", - "description": "VLAN number", + "description": "Child resource count", "computed": true }, { @@ -131276,6 +135998,22 @@ } } }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true + }, { "name": "datacenter", "type": "TypeString", @@ -131283,6 +136021,19 @@ "immutable": true, "required": true }, + { + "name": "type", + "type": "TypeString", + "description": "VLAN type", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "VLAN name", + "optional": true + }, { "name": "softlayer_managed", "type": "TypeBool", @@ -131290,31 +136041,23 @@ "computed": true }, { - "name": "child_resource_count", - "type": "TypeInt", - "description": "Child resource count", + "name": "resource_name", + "type": "TypeString", + "description": "The name of the resource", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_controller_url", + "name": "router_hostname", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "router host name", + "immutable": true, + "optional": true, "computed": true }, { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", + "name": "vlan_number", + "type": "TypeInt", + "description": "VLAN number", "computed": true } ], @@ -131328,11 +136071,10 @@ ], "ibm_ob_logging": [ { - "name": "instance_id", + "name": "namespace", "type": "TypeString", - "description": "ID of the LogDNA service instance to latch", - "cloud_data_type": "resource_instance", - "required": true + "description": "Namespace", + "computed": true }, { "name": "logdna_ingestion_key", @@ -131341,6 +136083,19 @@ "optional": true, "computed": true }, + { + "name": "crn", + "type": "TypeString", + "description": "CRN", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "discovered_agent", + "type": "TypeBool", + "description": "Discovered agent", + "computed": true + }, { "name": "daemonset_name", "type": "TypeString", @@ -131360,10 +136115,9 @@ "computed": true }, { - "name": "crn", + "name": "agent_namespace", "type": "TypeString", - "description": "CRN", - "cloud_data_type": "crn", + "description": "Agent Namespace", "computed": true }, { @@ -131374,22 +136128,11 @@ "required": true }, { - "name": "agent_namespace", - "type": "TypeString", - "description": "Agent Namespace", - "computed": true - }, - { - "name": "discovered_agent", - "type": "TypeBool", - "description": "Discovered agent", - "computed": true - }, - { - "name": "namespace", + "name": "instance_id", "type": "TypeString", - "description": "Namespace", - "computed": true + "description": "ID of the LogDNA service instance to latch", + "cloud_data_type": "resource_instance", + "required": true }, { "name": "private_endpoint", @@ -131401,21 +136144,34 @@ ], "ibm_ob_monitoring": [ { - "name": "daemonset_name", + "name": "private_endpoint", + "type": "TypeBool", + "description": "Add this option to connect to your Sysdig service instance through the private service endpoint", + "optional": true, + "computed": true + }, + { + "name": "agent_key", "type": "TypeString", - "description": "Daemon Set Name", + "description": "Agent key name", "computed": true }, { - "name": "instance_name", + "name": "agent_namespace", "type": "TypeString", - "description": "Sysdig instance Name", + "description": "Agent Namespace", + "computed": true + }, + { + "name": "discovered_agent", + "type": "TypeBool", + "description": "Discovered agent", "computed": true }, { - "name": "agent_key", + "name": "namespace", "type": "TypeString", - "description": "Agent key name", + "description": "Namespace", "computed": true }, { @@ -131426,10 +136182,11 @@ "computed": true }, { - "name": "namespace", + "name": "cluster", "type": "TypeString", - "description": "Namespace", - "computed": true + "description": "Name or ID of the cluster to be used.", + "immutable": true, + "required": true }, { "name": "instance_id", @@ -131446,29 +136203,15 @@ "computed": true }, { - "name": "private_endpoint", - "type": "TypeBool", - "description": "Add this option to connect to your Sysdig service instance through the private service endpoint", - "optional": true, - "computed": true - }, - { - "name": "cluster", - "type": "TypeString", - "description": "Name or ID of the cluster to be used.", - "immutable": true, - "required": true - }, - { - "name": "agent_namespace", + "name": "daemonset_name", "type": "TypeString", - "description": "Agent Namespace", + "description": "Daemon Set Name", "computed": true }, { - "name": "discovered_agent", - "type": "TypeBool", - "description": "Discovered agent", + "name": "instance_name", + "type": "TypeString", + "description": "Sysdig instance Name", "computed": true } ], @@ -131494,24 +136237,6 @@ } ], "ibm_org": [ - { - "name": "auditors", - "type": "TypeSet", - "description": "The IBMID of the users who will have auditor role in this org, ex - user@example.com", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "users", - "type": "TypeSet", - "description": "The IBMID of the users who will have user role in this org, ex - user@example.com", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "tags", "type": "TypeSet", @@ -131551,26 +136276,27 @@ "elem": { "type": "TypeString" } - } - ], - "ibm_pi_capture": [ - { - "name": "pi_instance_name", - "type": "TypeString", - "description": "Instance Name of the Power VM", - "immutable": true, - "required": true }, { - "name": "pi_capture_volume_ids", + "name": "auditors", "type": "TypeSet", - "description": "List of Data volume IDs", - "immutable": true, + "description": "The IBMID of the users who will have auditor role in this org, ex - user@example.com", "optional": true, "elem": { "type": "TypeString" } }, + { + "name": "users", + "type": "TypeSet", + "description": "The IBMID of the users who will have user role in this org, ex - user@example.com", + "optional": true, + "elem": { + "type": "TypeString" + } + } + ], + "ibm_pi_capture": [ { "name": "pi_capture_cloud_storage_access_key", "type": "TypeString", @@ -131595,16 +136321,15 @@ "optional": true }, { - "name": "pi_cloud_instance_id", + "name": "image_id", "type": "TypeString", - "description": "Cloud Instance ID - This is the service_instance_id.", - "immutable": true, - "required": true + "description": "Image ID of Capture Instance", + "computed": true }, { - "name": "pi_capture_name", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Name of the capture to create. Note : this must be unique", + "description": "Cloud Instance ID - This is the service_instance_id.", "immutable": true, "required": true }, @@ -131623,13 +136348,52 @@ "optional": true }, { - "name": "image_id", + "name": "pi_instance_name", "type": "TypeString", - "description": "Image ID of Capture Instance", - "computed": true + "description": "Instance Name of the Power VM", + "immutable": true, + "required": true + }, + { + "name": "pi_capture_name", + "type": "TypeString", + "description": "Name of the capture to create. Note : this must be unique", + "immutable": true, + "required": true + }, + { + "name": "pi_capture_volume_ids", + "type": "TypeSet", + "description": "List of Data volume IDs", + "immutable": true, + "optional": true, + "elem": { + "type": "TypeString" + } } ], "ibm_pi_cloud_connection": [ + { + "name": "port", + "type": "TypeString", + "description": "Port", + "computed": true + }, + { + "name": "pi_cloud_connection_gre_destination_address", + "type": "TypeString", + "description": "GRE destination IP address", + "optional": true + }, + { + "name": "pi_cloud_connection_vpc_crns", + "type": "TypeSet", + "description": "Set of VPCs to attach to this cloud connection", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "cloud_connection_id", "type": "TypeString", @@ -131637,21 +136401,40 @@ "computed": true }, { - "name": "port", + "name": "gre_source_address", "type": "TypeString", - "description": "Port", + "description": "GRE auto-assigned source IP address", "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "connection_mode", "type": "TypeString", - "description": "PI cloud instance ID", + "description": "Type of service the gateway is attached to", + "computed": true + }, + { + "name": "pi_cloud_connection_name", + "type": "TypeString", + "description": "Name of the cloud connection", "required": true }, { - "name": "pi_cloud_connection_gre_destination_address", + "name": "pi_cloud_connection_speed", + "type": "TypeInt", + "description": "Speed of the cloud connection (speed in megabits per second)", + "required": true + }, + { + "name": "pi_cloud_connection_classic_enabled", + "type": "TypeBool", + "description": "Enable classic endpoint destination", + "default_value": false, + "optional": true + }, + { + "name": "pi_cloud_connection_gre_cidr", "type": "TypeString", - "description": "GRE destination IP address", + "description": "GRE network in CIDR notation", "optional": true }, { @@ -131662,30 +136445,25 @@ "optional": true }, { - "name": "pi_cloud_connection_name", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Name of the cloud connection", + "description": "PI cloud instance ID", "required": true }, { - "name": "pi_cloud_connection_metered", + "name": "pi_cloud_connection_global_routing", "type": "TypeBool", - "description": "Enable metered for this cloud connection", + "description": "Enable global routing for this cloud connection", "default_value": false, "optional": true }, { - "name": "pi_cloud_connection_gre_cidr", - "type": "TypeString", - "description": "GRE network in CIDR notation", + "name": "pi_cloud_connection_metered", + "type": "TypeBool", + "description": "Enable metered for this cloud connection", + "default_value": false, "optional": true }, - { - "name": "status", - "type": "TypeString", - "description": "Link status", - "computed": true - }, { "name": "ibm_ip_address", "type": "TypeString", @@ -131698,24 +136476,6 @@ "description": "User IP address", "computed": true }, - { - "name": "gre_source_address", - "type": "TypeString", - "description": "GRE auto-assigned source IP address", - "computed": true - }, - { - "name": "connection_mode", - "type": "TypeString", - "description": "Type of service the gateway is attached to", - "computed": true - }, - { - "name": "pi_cloud_connection_speed", - "type": "TypeInt", - "description": "Speed of the cloud connection (speed in megabits per second)", - "required": true - }, { "name": "pi_cloud_connection_networks", "type": "TypeSet", @@ -131734,27 +136494,10 @@ "optional": true }, { - "name": "pi_cloud_connection_global_routing", - "type": "TypeBool", - "description": "Enable global routing for this cloud connection", - "default_value": false, - "optional": true - }, - { - "name": "pi_cloud_connection_classic_enabled", - "type": "TypeBool", - "description": "Enable classic endpoint destination", - "default_value": false, - "optional": true - }, - { - "name": "pi_cloud_connection_vpc_crns", - "type": "TypeSet", - "description": "Set of VPCs to attach to this cloud connection", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "status", + "type": "TypeString", + "description": "Link status", + "computed": true } ], "ibm_pi_cloud_connection_network_attach": [ @@ -131802,9 +136545,9 @@ ], "ibm_pi_dhcp": [ { - "name": "pi_dhcp_name", + "name": "pi_dns_server", "type": "TypeString", - "description": "Optional name of DHCP Service (will be prefixed by DHCP identifier)", + "description": "Optional DNS Server for DHCP service", "immutable": true, "optional": true }, @@ -131843,15 +136586,9 @@ "computed": true }, { - "name": "network_id", - "type": "TypeString", - "description": "The ID of the DHCP Server private network", - "computed": true - }, - { - "name": "network_name", + "name": "status", "type": "TypeString", - "description": "The name of the DHCP Server private network", + "description": "The status of the DHCP Server", "computed": true }, { @@ -131861,6 +136598,13 @@ "immutable": true, "required": true }, + { + "name": "pi_cidr", + "type": "TypeString", + "description": "Optional cidr for DHCP private network", + "immutable": true, + "optional": true + }, { "name": "pi_cloud_connection_id", "type": "TypeString", @@ -131869,9 +136613,9 @@ "optional": true }, { - "name": "pi_dns_server", + "name": "pi_dhcp_name", "type": "TypeString", - "description": "Optional DNS Server for DHCP service", + "description": "Optional name of DHCP Service (will be prefixed by DHCP identifier)", "immutable": true, "optional": true }, @@ -131882,32 +136626,30 @@ "computed": true }, { - "name": "status", + "name": "network_id", "type": "TypeString", - "description": "The status of the DHCP Server", + "description": "The ID of the DHCP Server private network", "computed": true }, { - "name": "pi_cidr", + "name": "network_name", "type": "TypeString", - "description": "Optional cidr for DHCP private network", - "immutable": true, - "optional": true + "description": "The name of the DHCP Server private network", + "computed": true } ], "ibm_pi_ike_policy": [ { - "name": "pi_policy_preshared_key", + "name": "pi_policy_encryption", "type": "TypeString", - "description": "Preshared key used in this IKE Policy (length of preshared key must be even)", + "description": "Encryption of the IKE Policy", "required": true }, { - "name": "pi_policy_authentication", - "type": "TypeString", - "description": "Authentication for the IKE Policy", - "default_value": "none", - "optional": true + "name": "pi_policy_version", + "type": "TypeInt", + "description": "Version of the IKE Policy", + "required": true }, { "name": "pi_policy_dh_group", @@ -131915,12 +136657,6 @@ "description": "DH group of the IKE Policy", "required": true }, - { - "name": "pi_policy_encryption", - "type": "TypeString", - "description": "Encryption of the IKE Policy", - "required": true - }, { "name": "pi_policy_key_lifetime", "type": "TypeInt", @@ -131928,11 +136664,24 @@ "required": true }, { - "name": "pi_policy_version", - "type": "TypeInt", - "description": "Version of the IKE Policy", + "name": "pi_policy_preshared_key", + "type": "TypeString", + "description": "Preshared key used in this IKE Policy (length of preshared key must be even)", "required": true }, + { + "name": "pi_policy_authentication", + "type": "TypeString", + "description": "Authentication for the IKE Policy", + "default_value": "none", + "optional": true + }, + { + "name": "policy_id", + "type": "TypeString", + "description": "IKE Policy ID", + "computed": true + }, { "name": "pi_cloud_instance_id", "type": "TypeString", @@ -131944,19 +136693,20 @@ "type": "TypeString", "description": "Name of the IKE Policy", "required": true - }, - { - "name": "policy_id", - "type": "TypeString", - "description": "IKE Policy ID", - "computed": true } ], "ibm_pi_image": [ { - "name": "pi_affinity_instance", + "name": "pi_image_id", "type": "TypeString", - "description": "PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and pi_affinity_volume is not provided", + "description": "Instance image id", + "immutable": true, + "optional": true + }, + { + "name": "pi_affinity_policy", + "type": "TypeString", + "description": "Affinity policy for image; ignored if pi_image_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", "immutable": true, "optional": true }, @@ -131971,19 +136721,22 @@ } }, { - "name": "pi_anti_affinity_instances", - "type": "TypeList", - "description": "List of pvmInstances to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", + "name": "image_id", + "type": "TypeString", + "description": "Image ID", + "computed": true + }, + { + "name": "pi_image_name", + "type": "TypeString", + "description": "Image name", "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } + "required": true }, { - "name": "pi_image_storage_type", + "name": "pi_image_bucket_file_name", "type": "TypeString", - "description": "Type of storage", + "description": "Cloud Object Storage image filename", "immutable": true, "optional": true }, @@ -132002,25 +136755,11 @@ "optional": true }, { - "name": "image_id", - "type": "TypeString", - "description": "Image ID", - "computed": true - }, - { - "name": "pi_image_access_key", - "type": "TypeString", - "description": "Cloud Object Storage access key; required for buckets with private access", - "secure": true, - "immutable": true, - "optional": true - }, - { - "name": "pi_image_bucket_file_name", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Cloud Object Storage image filename", + "description": "PI cloud instance ID", "immutable": true, - "optional": true + "required": true }, { "name": "pi_image_bucket_access", @@ -132031,64 +136770,61 @@ "optional": true }, { - "name": "pi_image_id", + "name": "pi_image_secret_key", "type": "TypeString", - "description": "Instance image id", + "description": "Cloud Object Storage secret key; required for buckets with private access", + "secure": true, "immutable": true, "optional": true }, { - "name": "pi_image_bucket_name", + "name": "pi_image_bucket_region", "type": "TypeString", - "description": "Cloud Object Storage bucket name; bucket-name[/optional/folder]", + "description": "Cloud Object Storage region", "immutable": true, "optional": true }, { - "name": "pi_image_secret_key", + "name": "pi_affinity_instance", "type": "TypeString", - "description": "Cloud Object Storage secret key; required for buckets with private access", - "secure": true, + "description": "PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and pi_affinity_volume is not provided", "immutable": true, "optional": true }, { - "name": "pi_image_bucket_region", - "type": "TypeString", - "description": "Cloud Object Storage region", + "name": "pi_anti_affinity_instances", + "type": "TypeList", + "description": "List of pvmInstances to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", "immutable": true, - "optional": true + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "pi_affinity_policy", + "name": "pi_image_bucket_name", "type": "TypeString", - "description": "Affinity policy for image; ignored if pi_image_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", + "description": "Cloud Object Storage bucket name; bucket-name[/optional/folder]", "immutable": true, "optional": true }, { - "name": "pi_cloud_instance_id", + "name": "pi_image_access_key", "type": "TypeString", - "description": "PI cloud instance ID", + "description": "Cloud Object Storage access key; required for buckets with private access", + "secure": true, "immutable": true, - "required": true + "optional": true }, { - "name": "pi_image_name", + "name": "pi_image_storage_type", "type": "TypeString", - "description": "Image name", + "description": "Type of storage", "immutable": true, - "required": true + "optional": true } ], "ibm_pi_image_export": [ - { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "description": "PI cloud instance ID", - "immutable": true, - "required": true - }, { "name": "pi_image_id", "type": "TypeString", @@ -132125,102 +136861,52 @@ "description": "Cloud Object Storage region", "immutable": true, "required": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "PI cloud instance ID", + "immutable": true, + "required": true } ], "ibm_pi_instance": [ { - "name": "pi_replication_scheme", + "name": "pi_placement_group_id", "type": "TypeString", - "description": "Replication scheme", - "default_value": "suffix", + "description": "Placement group ID", "optional": true }, { - "name": "os_type", + "name": "pi_shared_processor_pool", "type": "TypeString", - "description": "OS Type", - "computed": true + "description": "Shared Processor Pool the instance is deployed on", + "immutable": true, + "optional": true }, { - "name": "pi_license_repository_capacity", + "name": "max_virtual_cores", "type": "TypeInt", - "description": "The VTL license repository capacity TB value", - "optional": true, - "computed": true - }, - { - "name": "min_memory", - "type": "TypeFloat", - "description": "Minimum memory", + "description": "Maximum Virtual Cores Assigned to the PVMInstance", "computed": true }, { - "name": "pi_affinity_policy", - "type": "TypeString", - "description": "Affinity policy for pvm instance being created; ignored if pi_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", - "optional": true - }, - { - "name": "pi_affinity_volume", + "name": "pi_user_data", "type": "TypeString", - "description": "Volume (ID or Name) to base storage affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", + "description": "Base64 encoded data to be passed in for invoking a cloud init script", "optional": true }, { - "name": "pi_anti_affinity_volumes", - "type": "TypeList", - "description": "List of volumes to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_instances is not provided", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "health_status", - "type": "TypeString", - "description": "PI Instance health status", - "computed": true - }, - { - "name": "pi_proc_type", - "type": "TypeString", - "description": "Instance processor type", - "optional": true, - "computed": true - }, - { - "name": "pi_virtual_cores_assigned", - "type": "TypeInt", - "description": "Virtual Cores Assigned to the PVMInstance", - "optional": true, - "computed": true - }, - { - "name": "min_processors", - "type": "TypeFloat", - "description": "Minimum number of the CPUs", - "computed": true - }, - { - "name": "pi_volume_ids", - "type": "TypeSet", - "description": "List of PI volumes", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "pi_storage_pool", + "name": "pi_storage_type", "type": "TypeString", - "description": "Storage Pool for server deployment; if provided then pi_affinity_policy and pi_storage_type will be ignored", + "description": "Storage type for server deployment", "optional": true, "computed": true }, { - "name": "pi_storage_connection", + "name": "pi_affinity_instance", "type": "TypeString", - "description": "Storage Connectivity Group for server deployment", + "description": "PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and pi_affinity_volume is not provided", "optional": true }, { @@ -132263,24 +136949,34 @@ } }, { - "name": "pi_progress", - "type": "TypeFloat", - "description": "Progress of the operation", + "name": "pi_proc_type", + "type": "TypeString", + "description": "Instance processor type", + "optional": true, "computed": true }, { - "name": "pi_user_data", + "name": "pi_replication_policy", "type": "TypeString", - "description": "Base64 encoded data to be passed in for invoking a cloud init script", + "description": "Replication policy for the PI Instance", + "default_value": "none", "optional": true }, { - "name": "pi_storage_type", + "name": "operating_system", "type": "TypeString", - "description": "Storage type for server deployment", - "optional": true, + "description": "Operating System", "computed": true }, + { + "name": "pi_anti_affinity_instances", + "type": "TypeList", + "description": "List of pvmInstances to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "pi_storage_pool_affinity", "type": "TypeBool", @@ -132289,37 +136985,46 @@ "optional": true }, { - "name": "pi_memory", - "type": "TypeFloat", - "description": "Memory size", - "optional": true, + "name": "pin_policy", + "type": "TypeString", + "description": "PIN Policy of the Instance", "computed": true }, { - "name": "pi_sys_type", + "name": "pi_instance_name", "type": "TypeString", - "description": "PI Instance system type", - "optional": true, - "computed": true + "description": "PI Instance name", + "required": true }, { - "name": "pi_cloud_instance_id", + "name": "pi_replication_scheme", "type": "TypeString", - "description": "This is the Power Instance id that is assigned to the account", - "immutable": true, - "required": true + "description": "Replication scheme", + "default_value": "suffix", + "optional": true }, { - "name": "pi_migratable", - "type": "TypeBool", - "description": "set to true to enable migration of the PI instance", + "name": "pi_volume_ids", + "type": "TypeSet", + "description": "List of PI volumes", "optional": true, - "computed": true + "elem": { + "type": "TypeString" + } }, { - "name": "pi_key_pair_name", + "name": "pi_anti_affinity_volumes", + "type": "TypeList", + "description": "List of volumes to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_instances is not provided", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "pi_storage_connection", "type": "TypeString", - "description": "SSH key name", + "description": "Storage Connectivity Group for server deployment", "optional": true }, { @@ -132330,75 +137035,95 @@ "computed": true }, { - "name": "pi_pin_policy", + "name": "pi_sap_deployment_type", "type": "TypeString", - "description": "Pin Policy of the instance", - "default_value": "none", + "description": "Custom SAP Deployment Type Information", "optional": true }, { - "name": "max_virtual_cores", - "type": "TypeInt", - "description": "Maximum Virtual Cores Assigned to the PVMInstance", + "name": "pi_progress", + "type": "TypeFloat", + "description": "Progress of the operation", "computed": true }, { - "name": "pi_sap_profile_id", + "name": "pi_pin_policy", "type": "TypeString", - "description": "SAP Profile ID for the amount of cores and memory", + "description": "Pin Policy of the instance", + "default_value": "none", "optional": true }, { - "name": "pi_sap_deployment_type", + "name": "pi_health_status", "type": "TypeString", - "description": "Custom SAP Deployment Type Information", + "description": "Allow the user to set the status of the lpar so that they can connect to it faster", + "default_value": "OK", "optional": true }, { - "name": "operating_system", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Operating System", + "description": "This is the Power Instance id that is assigned to the account", + "immutable": true, + "required": true + }, + { + "name": "pi_migratable", + "type": "TypeBool", + "description": "set to true to enable migration of the PI instance", + "optional": true, "computed": true }, { - "name": "status", - "type": "TypeString", - "description": "PI instance status", + "name": "min_processors", + "type": "TypeFloat", + "description": "Minimum number of the CPUs", "computed": true }, { - "name": "pi_shared_processor_pool", + "name": "pi_sap_profile_id", "type": "TypeString", - "description": "Shared Processor Pool the instance is deployed on", - "immutable": true, + "description": "SAP Profile ID for the amount of cores and memory", "optional": true }, { - "name": "pin_policy", - "type": "TypeString", - "description": "PIN Policy of the Instance", + "name": "min_virtual_cores", + "type": "TypeInt", + "description": "Minimum Virtual Cores Assigned to the PVMInstance", "computed": true }, { - "name": "pi_image_id", + "name": "status", "type": "TypeString", - "description": "PI instance image id", - "required": true + "description": "PI instance status", + "computed": true }, { - "name": "pi_processors", + "name": "pi_memory", "type": "TypeFloat", - "description": "Processors count", + "description": "Memory size", "optional": true, "computed": true }, { - "name": "pi_health_status", + "name": "pi_deployment_type", "type": "TypeString", - "description": "Allow the user to set the status of the lpar so that they can connect to it faster", - "default_value": "OK", + "description": "Custom Deployment Type Information", + "optional": true + }, + { + "name": "pi_replicants", + "type": "TypeInt", + "description": "PI Instance replicas count", + "default_value": 1, "optional": true }, + { + "name": "os_type", + "type": "TypeString", + "description": "OS Type", + "computed": true + }, { "name": "max_processors", "type": "TypeFloat", @@ -132406,50 +137131,74 @@ "computed": true }, { - "name": "max_memory", - "type": "TypeFloat", - "description": "Maximum memory size", + "name": "pi_storage_pool", + "type": "TypeString", + "description": "Storage Pool for server deployment; if provided then pi_affinity_policy and pi_storage_type will be ignored", + "optional": true, "computed": true }, { - "name": "pi_affinity_instance", + "name": "pi_affinity_policy", "type": "TypeString", - "description": "PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and pi_affinity_volume is not provided", + "description": "Affinity policy for pvm instance being created; ignored if pi_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", "optional": true }, { - "name": "min_virtual_cores", - "type": "TypeInt", - "description": "Minimum Virtual Cores Assigned to the PVMInstance", + "name": "pi_key_pair_name", + "type": "TypeString", + "description": "SSH key name", + "optional": true + }, + { + "name": "pi_sys_type", + "type": "TypeString", + "description": "PI Instance system type", + "optional": true, "computed": true }, { - "name": "pi_replicants", + "name": "pi_virtual_cores_assigned", "type": "TypeInt", - "description": "PI Instance replicas count", - "default_value": 1, - "optional": true + "description": "Virtual Cores Assigned to the PVMInstance", + "optional": true, + "computed": true }, { - "name": "pi_replication_policy", + "name": "min_memory", + "type": "TypeFloat", + "description": "Minimum memory", + "computed": true + }, + { + "name": "max_memory", + "type": "TypeFloat", + "description": "Maximum memory size", + "computed": true + }, + { + "name": "health_status", "type": "TypeString", - "description": "Replication policy for the PI Instance", - "default_value": "none", - "optional": true + "description": "PI Instance health status", + "computed": true }, { - "name": "pi_anti_affinity_instances", - "type": "TypeList", - "description": "List of pvmInstances to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", + "name": "pi_processors", + "type": "TypeFloat", + "description": "Processors count", "optional": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "pi_placement_group_id", + "name": "pi_license_repository_capacity", + "type": "TypeInt", + "description": "The VTL license repository capacity TB value", + "optional": true, + "computed": true + }, + { + "name": "pi_affinity_volume", "type": "TypeString", - "description": "Placement group ID", + "description": "Volume (ID or Name) to base storage affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", "optional": true }, { @@ -132459,32 +137208,13 @@ "computed": true }, { - "name": "pi_instance_name", + "name": "pi_image_id", "type": "TypeString", - "description": "PI Instance name", + "description": "PI instance image id", "required": true - }, - { - "name": "pi_deployment_type", - "type": "TypeString", - "description": "Custom Deployment Type Information", - "optional": true } ], "ibm_pi_instance_action": [ - { - "name": "pi_health_status", - "type": "TypeString", - "description": "Set the health status of the PVM instance to connect it faster", - "default_value": "OK", - "optional": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the PVM instance", - "computed": true - }, { "name": "progress", "type": "TypeFloat", @@ -132514,33 +137244,22 @@ "type": "TypeString", "description": "PVM instance action type", "required": true - } - ], - "ibm_pi_ipsec_policy": [ - { - "name": "pi_policy_name", - "type": "TypeString", - "description": "Name of the IPSec Policy", - "required": true - }, - { - "name": "pi_policy_dh_group", - "type": "TypeInt", - "description": "DH group of the IPSec Policy", - "required": true }, { - "name": "pi_policy_encryption", + "name": "pi_health_status", "type": "TypeString", - "description": "Encryption of the IPSec Policy", - "required": true + "description": "Set the health status of the PVM instance to connect it faster", + "default_value": "OK", + "optional": true }, { - "name": "pi_policy_key_lifetime", - "type": "TypeInt", - "description": "Policy key lifetime", - "required": true - }, + "name": "status", + "type": "TypeString", + "description": "The status of the PVM instance", + "computed": true + } + ], + "ibm_pi_ipsec_policy": [ { "name": "pi_policy_pfs", "type": "TypeBool", @@ -132565,27 +137284,33 @@ "type": "TypeString", "description": "PI cloud instance ID", "required": true - } - ], - "ibm_pi_key": [ + }, { - "name": "key_id", + "name": "pi_policy_name", "type": "TypeString", - "computed": true, - "deprecated": "User defined name for the SSH key (deprecated - replaced by name)" + "description": "Name of the IPSec Policy", + "required": true }, { - "name": "name", - "type": "TypeString", - "description": "User defined name for the SSH key", - "computed": true + "name": "pi_policy_dh_group", + "type": "TypeInt", + "description": "DH group of the IPSec Policy", + "required": true }, { - "name": "ssh_key", + "name": "pi_policy_encryption", "type": "TypeString", - "description": "SSH RSA key", - "computed": true + "description": "Encryption of the IPSec Policy", + "required": true }, + { + "name": "pi_policy_key_lifetime", + "type": "TypeInt", + "description": "Policy key lifetime", + "required": true + } + ], + "ibm_pi_key": [ { "name": "pi_cloud_instance_id", "type": "TypeString", @@ -132609,41 +137334,27 @@ "type": "TypeString", "description": "Date of SSH Key creation", "computed": true - } - ], - "ibm_pi_network": [ - { - "name": "vlan_id", - "type": "TypeFloat", - "description": "VLAN Id value", - "computed": true }, { - "name": "pi_network_name", + "name": "key_id", "type": "TypeString", - "description": "PI network name", - "required": true + "computed": true, + "deprecated": "User defined name for the SSH key (deprecated - replaced by name)" }, { - "name": "pi_gateway", + "name": "name", "type": "TypeString", - "description": "PI network gateway", - "optional": true, - "computed": true - }, - { - "name": "pi_network_jumbo", - "type": "TypeBool", - "description": "PI network enable MTU Jumbo option", - "optional": true, + "description": "User defined name for the SSH key", "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "ssh_key", "type": "TypeString", - "description": "PI cloud instance ID", - "required": true - }, + "description": "SSH RSA key", + "computed": true + } + ], + "ibm_pi_network": [ { "name": "network_id", "type": "TypeString", @@ -132651,9 +137362,9 @@ "computed": true }, { - "name": "pi_network_type", + "name": "pi_network_name", "type": "TypeString", - "description": "PI network type", + "description": "PI network name", "required": true }, { @@ -132667,12 +137378,18 @@ } }, { - "name": "pi_cidr", + "name": "pi_gateway", "type": "TypeString", - "description": "PI network CIDR", + "description": "PI network gateway", "optional": true, "computed": true }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "PI cloud instance ID", + "required": true + }, { "name": "pi_ipaddress_range", "type": "TypeList", @@ -132693,19 +137410,35 @@ "required": true } } - } - ], - "ibm_pi_network_port": [ + }, { - "name": "pi_network_name", + "name": "vlan_id", + "type": "TypeFloat", + "description": "VLAN Id value", + "computed": true + }, + { + "name": "pi_network_type", "type": "TypeString", + "description": "PI network type", "required": true }, { - "name": "pi_cloud_instance_id", + "name": "pi_cidr", "type": "TypeString", - "required": true + "description": "PI network CIDR", + "optional": true, + "computed": true }, + { + "name": "pi_network_jumbo", + "type": "TypeBool", + "description": "PI network enable MTU Jumbo option", + "optional": true, + "computed": true + } + ], + "ibm_pi_network_port": [ { "name": "pi_network_port_description", "type": "TypeString", @@ -132737,11 +137470,21 @@ "name": "public_ip", "type": "TypeString", "computed": true + }, + { + "name": "pi_network_name", + "type": "TypeString", + "required": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "required": true } ], "ibm_pi_network_port_attach": [ { - "name": "network_port_id", + "name": "public_ip", "type": "TypeString", "computed": true }, @@ -132752,57 +137495,72 @@ "required": true }, { - "name": "pi_network_port_description", + "name": "pi_instance_id", "type": "TypeString", - "description": "A human readable description for this network Port", - "default_value": "Port Created via Terraform", + "description": "Instance id to attach the network port to", "immutable": true, - "optional": true + "required": true }, { - "name": "pi_network_port_ipaddress", + "name": "pi_network_name", "type": "TypeString", + "description": "Network Name - This is the subnet name in the Cloud instance", "immutable": true, - "optional": true, - "computed": true + "required": true }, { - "name": "macaddress", + "name": "port_id", "type": "TypeString", - "computed": true + "computed": true, + "deprecated": "port_id attribute is deprecated, use network_port_id instead." }, { - "name": "public_ip", + "name": "network_port_id", "type": "TypeString", "computed": true }, { - "name": "pi_instance_id", + "name": "status", "type": "TypeString", - "description": "Instance id to attach the network port to", - "immutable": true, - "required": true + "computed": true }, { - "name": "pi_network_name", + "name": "pi_network_port_description", "type": "TypeString", - "description": "Network Name - This is the subnet name in the Cloud instance", + "description": "A human readable description for this network Port", + "default_value": "Port Created via Terraform", "immutable": true, - "required": true + "optional": true }, { - "name": "port_id", + "name": "pi_network_port_ipaddress", "type": "TypeString", - "computed": true, - "deprecated": "port_id attribute is deprecated, use network_port_id instead." + "immutable": true, + "optional": true, + "computed": true }, { - "name": "status", + "name": "macaddress", "type": "TypeString", "computed": true } ], "ibm_pi_placement_group": [ + { + "name": "members", + "type": "TypeSet", + "description": "Server IDs that are the placement group members", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "placement_group_id", + "type": "TypeString", + "description": "PI placement group ID", + "computed": true + }, { "name": "pi_placement_group_name", "type": "TypeString", @@ -132820,40 +137578,25 @@ "type": "TypeString", "description": "PI cloud instance ID", "required": true - }, - { - "name": "members", - "type": "TypeSet", - "description": "Server IDs that are the placement group members", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "placement_group_id", - "type": "TypeString", - "description": "PI placement group ID", - "computed": true } ], "ibm_pi_shared_processor_pool": [ { - "name": "pi_shared_processor_pool_reserved_cores", - "type": "TypeInt", - "description": "The amount of reserved cores for the shared processor pool", + "name": "pi_shared_processor_pool_name", + "type": "TypeString", + "description": "Name of the shared processor pool", "required": true }, { - "name": "pi_shared_processor_pool_placement_group_id", - "type": "TypeString", - "description": "Placement group the shared processor pool is created in", - "optional": true + "name": "allocated_cores", + "type": "TypeFloat", + "description": "Shared processor pool allocated cores", + "computed": true }, { - "name": "available_cores", + "name": "host_id", "type": "TypeInt", - "description": "Shared processor pool available cores", + "description": "The host ID where the shared processor pool resides", "computed": true }, { @@ -132878,27 +137621,39 @@ } }, { - "name": "pi_shared_processor_pool_name", + "name": "pi_shared_processor_pool_host_group", "type": "TypeString", - "description": "Name of the shared processor pool", + "description": "Host group of the shared processor pool", "required": true }, { - "name": "pi_shared_processor_pool_host_group", + "name": "pi_shared_processor_pool_reserved_cores", + "type": "TypeInt", + "description": "The amount of reserved cores for the shared processor pool", + "required": true + }, + { + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Host group of the shared processor pool", + "description": "PI cloud instance ID", "required": true }, { - "name": "allocated_cores", - "type": "TypeFloat", - "description": "Shared processor pool allocated cores", + "name": "pi_shared_processor_pool_placement_group_id", + "type": "TypeString", + "description": "Placement group the shared processor pool is created in", + "optional": true + }, + { + "name": "shared_processor_pool_id", + "type": "TypeString", + "description": "Shared processor pool ID", "computed": true }, { - "name": "host_id", + "name": "available_cores", "type": "TypeInt", - "description": "The host ID where the shared processor pool resides", + "description": "Shared processor pool available cores", "computed": true }, { @@ -132956,21 +137711,21 @@ "computed": true } } - }, + } + ], + "ibm_pi_snapshot": [ { - "name": "pi_cloud_instance_id", + "name": "pi_instance_name", "type": "TypeString", - "description": "PI cloud instance ID", + "description": "Instance name / id of the pvm", "required": true }, { - "name": "shared_processor_pool_id", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Shared processor pool ID", - "computed": true - } - ], - "ibm_pi_snapshot": [ + "description": "Cloud Instance ID - This is the service_instance_id.", + "required": true + }, { "name": "pi_snap_shot_id", "type": "TypeString", @@ -132978,12 +137733,6 @@ "computed": true, "deprecated": "This field is deprecated, use snapshot_id instead" }, - { - "name": "snapshot_id", - "type": "TypeString", - "description": "ID of the PVM instance snapshot", - "computed": true - }, { "name": "last_update_date", "type": "TypeString", @@ -132995,15 +137744,9 @@ "computed": true }, { - "name": "pi_instance_name", - "type": "TypeString", - "description": "Instance name / id of the pvm", - "required": true - }, - { - "name": "pi_cloud_instance_id", + "name": "pi_snap_shot_name", "type": "TypeString", - "description": "Cloud Instance ID - This is the service_instance_id.", + "description": "Unique name of the snapshot", "required": true }, { @@ -133020,20 +137763,20 @@ "deprecated": "This field is deprecated, use pi_description instead" }, { - "name": "status", + "name": "snapshot_id", "type": "TypeString", + "description": "ID of the PVM instance snapshot", "computed": true }, { - "name": "creation_date", + "name": "status", "type": "TypeString", "computed": true }, { - "name": "pi_snap_shot_name", + "name": "creation_date", "type": "TypeString", - "description": "Unique name of the snapshot", - "required": true + "computed": true }, { "name": "pi_volume_ids", @@ -133085,44 +137828,33 @@ ], "ibm_pi_volume": [ { - "name": "pi_anti_affinity_instances", - "type": "TypeList", - "description": "List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "consistency_group_name", + "name": "master_volume_name", "type": "TypeString", - "description": "Consistency Group Name if volume is a part of volume group", + "description": "Indicates master volume name", "computed": true }, { - "name": "auxiliary_volume_name", + "name": "pi_affinity_instance", "type": "TypeString", - "description": "Indicates auxiliary volume name", - "computed": true + "description": "PVM Instance (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_volume is not provided", + "optional": true }, { - "name": "pi_volume_pool", + "name": "volume_id", "type": "TypeString", - "description": "Volume pool where the volume will be created; if provided then pi_volume_type and pi_affinity_policy values will be ignored", - "optional": true, + "description": "Volume ID", "computed": true }, { - "name": "pi_affinity_instance", + "name": "volume_status", "type": "TypeString", - "description": "PVM Instance (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_volume is not provided", - "optional": true + "description": "Volume status", + "computed": true }, { - "name": "pi_replication_enabled", - "type": "TypeBool", - "description": "Indicates if the volume should be replication enabled or not", - "optional": true, + "name": "consistency_group_name", + "type": "TypeString", + "description": "Consistency Group Name if volume is a part of volume group", "computed": true }, { @@ -133132,9 +137864,9 @@ "computed": true }, { - "name": "replication_status", + "name": "mirroring_state", "type": "TypeString", - "description": "Replication status of a volume", + "description": "Mirroring state for replication enabled volume", "computed": true }, { @@ -133144,33 +137876,22 @@ "computed": true }, { - "name": "master_volume_name", + "name": "pi_volume_type", "type": "TypeString", - "description": "Indicates master volume name", + "description": "Type of Disk, required if pi_affinity_policy and pi_volume_pool not provided, otherwise ignored", + "optional": true, "computed": true }, { - "name": "pi_volume_shareable", - "type": "TypeBool", - "description": "Flag to indicate if the volume can be shared across multiple instances?", - "optional": true - }, - { - "name": "pi_affinity_policy", - "type": "TypeString", - "description": "Affinity policy for data volume being created; ignored if pi_volume_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", - "optional": true - }, - { - "name": "volume_id", + "name": "group_id", "type": "TypeString", - "description": "Volume ID", + "description": "Volume Group ID", "computed": true }, { - "name": "volume_status", + "name": "replication_status", "type": "TypeString", - "description": "Volume status", + "description": "Replication status of a volume", "computed": true }, { @@ -133180,22 +137901,35 @@ "computed": true }, { - "name": "group_id", + "name": "pi_volume_name", "type": "TypeString", - "description": "Volume Group ID", - "computed": true + "description": "Volume Name to create", + "required": true }, { - "name": "mirroring_state", + "name": "pi_volume_size", + "type": "TypeFloat", + "description": "Size of the volume in GB", + "required": true + }, + { + "name": "pi_volume_pool", "type": "TypeString", - "description": "Mirroring state for replication enabled volume", + "description": "Volume pool where the volume will be created; if provided then pi_volume_type and pi_affinity_policy values will be ignored", + "optional": true, "computed": true }, { - "name": "pi_volume_name", + "name": "pi_affinity_policy", "type": "TypeString", - "description": "Volume Name to create", - "required": true + "description": "Affinity policy for data volume being created; ignored if pi_volume_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", + "optional": true + }, + { + "name": "pi_affinity_volume", + "type": "TypeString", + "description": "Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", + "optional": true }, { "name": "pi_anti_affinity_volumes", @@ -133207,22 +137941,37 @@ } }, { - "name": "pi_volume_type", - "type": "TypeString", - "description": "Type of Disk, required if pi_affinity_policy and pi_volume_pool not provided, otherwise ignored", - "optional": true, + "name": "delete_on_termination", + "type": "TypeBool", + "description": "Should the volume be deleted during termination", "computed": true }, { - "name": "pi_affinity_volume", + "name": "pi_cloud_instance_id", "type": "TypeString", - "description": "Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", + "description": "Cloud Instance ID - This is the service_instance_id.", + "required": true + }, + { + "name": "pi_volume_shareable", + "type": "TypeBool", + "description": "Flag to indicate if the volume can be shared across multiple instances?", "optional": true }, { - "name": "delete_on_termination", + "name": "pi_anti_affinity_instances", + "type": "TypeList", + "description": "List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "pi_replication_enabled", "type": "TypeBool", - "description": "Should the volume be deleted during termination", + "description": "Indicates if the volume should be replication enabled or not", + "optional": true, "computed": true }, { @@ -133232,16 +137981,10 @@ "computed": true }, { - "name": "pi_cloud_instance_id", + "name": "auxiliary_volume_name", "type": "TypeString", - "description": "Cloud Instance ID - This is the service_instance_id.", - "required": true - }, - { - "name": "pi_volume_size", - "type": "TypeFloat", - "description": "Size of the volume in GB", - "required": true + "description": "Indicates auxiliary volume name", + "computed": true } ], "ibm_pi_volume_attach": [ @@ -133286,9 +138029,34 @@ "computed": true }, { - "name": "replication_status", + "name": "status_description_errors", + "type": "TypeSet", + "computed": true, + "elem": { + "key": { + "name": "key", + "type": "TypeString", + "computed": true + }, + "message": { + "name": "message", + "type": "TypeString", + "computed": true + }, + "volume_ids": { + "name": "volume_ids", + "type": "TypeList", + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + }, + { + "name": "consistency_group_name", "type": "TypeString", - "description": "Volume Group Replication Status", + "description": "Consistency Group Name if volume is a part of volume group", "computed": true }, { @@ -133319,34 +138087,9 @@ "computed": true }, { - "name": "status_description_errors", - "type": "TypeSet", - "computed": true, - "elem": { - "key": { - "name": "key", - "type": "TypeString", - "computed": true - }, - "message": { - "name": "message", - "type": "TypeString", - "computed": true - }, - "volume_ids": { - "name": "volume_ids", - "type": "TypeList", - "computed": true, - "elem": { - "type": "TypeString" - } - } - } - }, - { - "name": "consistency_group_name", + "name": "replication_status", "type": "TypeString", - "description": "Consistency Group Name if volume is a part of volume group", + "description": "Volume Group Replication Status", "computed": true } ], @@ -133439,33 +138182,20 @@ ], "ibm_pi_volume_onboarding": [ { - "name": "status", - "type": "TypeString", - "description": "Indicates the status of volume onboarding operation", + "name": "progress", + "type": "TypeFloat", + "description": "Indicates the progress of volume onboarding operation", "computed": true }, { - "name": "pi_cloud_instance_id", - "type": "TypeString", - "description": "Cloud Instance ID - This is the service_instance_id.", - "immutable": true, - "required": true - }, - { - "name": "input_volumes", + "name": "results_onboarded_volumes", "type": "TypeList", - "description": "List of volumes requested to be onboarded", + "description": "List of volumes which are onboarded successfully", "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "progress", - "type": "TypeFloat", - "description": "Indicates the progress of volume onboarding operation", - "computed": true - }, { "name": "results_volume_onboarding_failures", "type": "TypeList", @@ -133489,14 +138219,39 @@ } }, { - "name": "results_onboarded_volumes", + "name": "status", + "type": "TypeString", + "description": "Indicates the status of volume onboarding operation", + "computed": true + }, + { + "name": "pi_cloud_instance_id", + "type": "TypeString", + "description": "Cloud Instance ID - This is the service_instance_id.", + "immutable": true, + "required": true + }, + { + "name": "input_volumes", "type": "TypeList", - "description": "List of volumes which are onboarded successfully", + "description": "List of volumes requested to be onboarded", "computed": true, "elem": { "type": "TypeString" } }, + { + "name": "create_time", + "type": "TypeString", + "description": "Indicates the create-time of volume onboarding operation", + "computed": true + }, + { + "name": "onboarding_id", + "type": "TypeString", + "description": "Indicates the volume onboarding operation id", + "computed": true + }, { "name": "pi_onboarding_volumes", "type": "TypeList", @@ -133538,37 +138293,13 @@ "description": "Description of the volume onboarding operation", "optional": true, "computed": true - }, - { - "name": "create_time", - "type": "TypeString", - "description": "Indicates the create-time of volume onboarding operation", - "computed": true - }, - { - "name": "onboarding_id", - "type": "TypeString", - "description": "Indicates the volume onboarding operation id", - "computed": true } ], "ibm_pi_vpn_connection": [ { - "name": "connection_id", - "type": "TypeString", - "description": "VPN connection ID", - "computed": true - }, - { - "name": "local_gateway_address", - "type": "TypeString", - "description": "Local Gateway address, only in 'route' mode", - "computed": true - }, - { - "name": "gateway_address", - "type": "TypeString", - "description": "Public IP address of the VPN Gateway (vSRX) attached to this VPN Connection", + "name": "dead_peer_detections", + "type": "TypeMap", + "description": "Dead Peer Detection", "computed": true }, { @@ -133583,6 +138314,12 @@ "description": "Unique identifier of IPSec Policy selected for this VPN Connection", "required": true }, + { + "name": "pi_vpn_connection_mode", + "type": "TypeString", + "description": "Mode used by this VPN Connection, either 'policy' or 'route'", + "required": true + }, { "name": "pi_networks", "type": "TypeSet", @@ -133602,15 +138339,15 @@ } }, { - "name": "connection_status", + "name": "local_gateway_address", "type": "TypeString", - "description": "Status of the VPN connection", + "description": "Local Gateway address, only in 'route' mode", "computed": true }, { - "name": "dead_peer_detections", - "type": "TypeMap", - "description": "Dead Peer Detection", + "name": "connection_status", + "type": "TypeString", + "description": "Status of the VPN connection", "computed": true }, { @@ -133626,26 +138363,25 @@ "required": true }, { - "name": "pi_vpn_connection_mode", + "name": "pi_peer_gateway_address", "type": "TypeString", - "description": "Mode used by this VPN Connection, either 'policy' or 'route'", + "description": "Peer Gateway address", "required": true }, { - "name": "pi_peer_gateway_address", + "name": "connection_id", "type": "TypeString", - "description": "Peer Gateway address", - "required": true + "description": "VPN connection ID", + "computed": true + }, + { + "name": "gateway_address", + "type": "TypeString", + "description": "Public IP address of the VPN Gateway (vSRX) attached to this VPN Connection", + "computed": true } ], "ibm_pn_application_chrome": [ - { - "name": "guid", - "type": "TypeString", - "description": "Unique guid of the push notification instance.", - "immutable": true, - "required": true - }, { "name": "server_key", "type": "TypeString", @@ -133657,9 +138393,34 @@ "type": "TypeString", "description": "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", "required": true + }, + { + "name": "guid", + "type": "TypeString", + "description": "Unique guid of the push notification instance.", + "immutable": true, + "required": true } ], "ibm_project_instance": [ + { + "name": "name", + "type": "TypeString", + "description": "The project name.", + "immutable": true, + "required": true, + "min_length": 1, + "max_length": 64, + "matches": "^(?!\\s)(?!.*\\s$)[^'\"\u003c\u003e{}\\x00-\\x1F]+$" + }, + { + "name": "description", + "type": "TypeString", + "description": "A project's descriptive text.", + "max_length": 1024, + "matches": "^$|^(?!\\s).*\\S$", + "optional": true + }, { "name": "configs", "type": "TypeList", @@ -133845,39 +138606,9 @@ "computed": true } } - }, - { - "name": "name", - "type": "TypeString", - "description": "The project name.", - "immutable": true, - "required": true, - "min_length": 1, - "max_length": 64, - "matches": "^(?!\\s)(?!.*\\s$)[^'\"\u003c\u003e{}\\x00-\\x1F]+$" - }, - { - "name": "description", - "type": "TypeString", - "description": "A project's descriptive text.", - "max_length": 1024, - "matches": "^$|^(?!\\s).*\\S$", - "optional": true } ], "ibm_resource_group": [ - { - "name": "name", - "type": "TypeString", - "description": "The name of the resource group", - "required": true - }, - { - "name": "default", - "type": "TypeBool", - "description": "Specifies whether its default resource group or not", - "computed": true - }, { "name": "created_at", "type": "TypeString", @@ -133885,15 +138616,15 @@ "computed": true }, { - "name": "teams_url", + "name": "payment_methods_url", "type": "TypeString", - "description": "The URL to access the team details that associated with the resource group.", + "description": "The URL to access the payment methods details that associated with the resource group.", "computed": true }, { - "name": "payment_methods_url", + "name": "quota_url", "type": "TypeString", - "description": "The URL to access the payment methods details that associated with the resource group.", + "description": "The URL to access the quota details that associated with the resource group.", "computed": true }, { @@ -133917,6 +138648,12 @@ "description": "State of the resource group", "computed": true }, + { + "name": "default", + "type": "TypeBool", + "description": "Specifies whether its default resource group or not", + "computed": true + }, { "name": "tags", "type": "TypeSet", @@ -133940,65 +138677,59 @@ "computed": true }, { - "name": "quota_url", + "name": "teams_url", "type": "TypeString", - "description": "The URL to access the quota details that associated with the resource group.", + "description": "The URL to access the team details that associated with the resource group.", "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the resource group", + "required": true } ], "ibm_resource_instance": [ { - "name": "resource_group_id", + "name": "parameters_json", "type": "TypeString", - "description": "The resource group id", - "cloud_data_type": "resource_group", - "immutable": true, - "optional": true, - "computed": true, - "cloud_data_range": [ - "resolved_to:id" - ] + "description": "Arbitrary parameters to pass in Json string format", + "optional": true }, { - "name": "guid", + "name": "resource_group_crn", "type": "TypeString", - "description": "Guid of resource instance", + "description": "The long ID (full CRN) of the resource group", "computed": true }, { - "name": "account_id", - "type": "TypeString", - "description": "An alpha-numeric value identifying the account ID.", + "name": "allow_cleanup", + "type": "TypeBool", + "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", "computed": true }, { - "name": "state", + "name": "resource_name", "type": "TypeString", - "description": "The current state of the instance.", + "description": "The name of the resource", "computed": true }, { - "name": "resource_crn", + "name": "state", "type": "TypeString", - "description": "The crn of the resource", + "description": "The current state of the instance.", "computed": true }, { - "name": "parameters", - "type": "TypeMap", - "description": "Arbitrary parameters to pass. Must be a JSON object", - "optional": true - }, - { - "name": "resource_plan_id", + "name": "resource_aliases_url", "type": "TypeString", - "description": "The unique ID of the plan associated with the offering", + "description": "The relative path to the resource aliases for the instance.", "computed": true }, { - "name": "last_operation", - "type": "TypeMap", - "description": "The status of the last operation requested on the instance", + "name": "resource_keys_url", + "type": "TypeString", + "description": "The relative path to the resource keys for the instance.", "computed": true }, { @@ -134008,45 +138739,34 @@ "computed": true }, { - "name": "resource_name", + "name": "service", "type": "TypeString", - "description": "The name of the resource", - "computed": true + "description": "The name of the service offering like cloud-object-storage, kms etc", + "immutable": true, + "required": true }, { - "name": "parameters_json", + "name": "plan", "type": "TypeString", - "description": "Arbitrary parameters to pass in Json string format", - "optional": true + "description": "The plan type of the service", + "required": true }, { - "name": "status", + "name": "resource_group_id", "type": "TypeString", - "description": "Status of resource instance", - "computed": true - }, - { - "name": "plan_history", - "type": "TypeList", - "description": "The plan history of the instance.", + "description": "The resource group id", + "cloud_data_type": "resource_group", + "immutable": true, + "optional": true, "computed": true, - "elem": { - "resource_plan_id": { - "name": "resource_plan_id", - "type": "TypeString", - "computed": true - }, - "start_date": { - "name": "start_date", - "type": "TypeString", - "computed": true - } - } + "cloud_data_range": [ + "resolved_to:id" + ] }, { - "name": "resource_controller_url", + "name": "resource_plan_id", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + "description": "The unique ID of the plan associated with the offering", "computed": true }, { @@ -134056,33 +138776,40 @@ "computed": true }, { - "name": "created_by", + "name": "deleted_at", "type": "TypeString", - "description": "The subject who created the instance.", + "description": "The date when the instance was deleted.", "computed": true }, { - "name": "scheduled_reclaim_at", + "name": "scheduled_reclaim_by", "type": "TypeString", - "description": "The date when the instance was scheduled for reclamation.", + "description": "The subject who initiated the instance reclamation.", "computed": true }, { - "name": "restored_at", + "name": "restored_by", "type": "TypeString", - "description": "The date when the instance under reclamation was restored.", + "description": "The subject who restored the instance back from reclamation.", "computed": true }, { - "name": "resource_group_name", + "name": "parameters", + "type": "TypeMap", + "description": "Arbitrary parameters to pass. Must be a JSON object", + "optional": true + }, + { + "name": "service_endpoints", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", + "optional": true, "computed": true }, { - "name": "locked", - "type": "TypeBool", - "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + "name": "type", + "type": "TypeString", + "description": "The type of the instance, e.g. service_instance.", "computed": true }, { @@ -134092,86 +138819,82 @@ "computed": true }, { - "name": "deleted_by", + "name": "resource_bindings_url", "type": "TypeString", - "description": "The subject who deleted the instance.", + "description": "The relative path to the resource bindings for the instance.", "computed": true }, { - "name": "service", - "type": "TypeString", - "description": "The name of the service offering like cloud-object-storage, kms etc", - "immutable": true, - "required": true - }, - { - "name": "dashboard_url", + "name": "created_by", "type": "TypeString", - "description": "Dashboard URL to access resource.", + "description": "The subject who created the instance.", "computed": true }, { - "name": "resource_group_crn", + "name": "resource_controller_url", "type": "TypeString", - "description": "The long ID (full CRN) of the resource group", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", "computed": true }, { - "name": "target_crn", + "name": "name", "type": "TypeString", - "description": "The full deployment CRN as defined in the global catalog", - "computed": true + "description": "A name for the resource instance", + "required": true }, { - "name": "sub_type", - "type": "TypeString", - "description": "The sub-type of instance, e.g. cfaas .", - "computed": true + "name": "tags", + "type": "TypeSet", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "plan", + "name": "resource_id", "type": "TypeString", - "description": "The plan type of the service", - "required": true + "description": "The unique ID of the offering", + "computed": true }, { - "name": "service_endpoints", - "type": "TypeString", - "description": "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", - "optional": true, + "name": "locked", + "type": "TypeBool", + "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", "computed": true }, { - "name": "type", + "name": "status", "type": "TypeString", - "description": "The type of the instance, e.g. service_instance.", + "description": "Status of resource instance", "computed": true }, { - "name": "allow_cleanup", - "type": "TypeBool", - "description": "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + "name": "dashboard_url", + "type": "TypeString", + "description": "Dashboard URL to access resource.", "computed": true }, { - "name": "deleted_at", + "name": "restored_at", "type": "TypeString", - "description": "The date when the instance was deleted.", + "description": "The date when the instance under reclamation was restored.", "computed": true }, { - "name": "name", + "name": "resource_crn", "type": "TypeString", - "description": "A name for the resource instance", - "required": true + "description": "The crn of the resource", + "computed": true }, { - "name": "location", + "name": "scheduled_reclaim_at", "type": "TypeString", - "description": "The location where the instance available", - "cloud_data_type": "region", - "immutable": true, - "required": true + "description": "The date when the instance was scheduled for reclamation.", + "computed": true }, { "name": "crn", @@ -134181,105 +138904,134 @@ "computed": true }, { - "name": "resource_keys_url", + "name": "account_id", "type": "TypeString", - "description": "The relative path to the resource keys for the instance.", + "description": "An alpha-numeric value identifying the account ID.", "computed": true }, { - "name": "update_by", + "name": "sub_type", "type": "TypeString", - "description": "The subject who updated the instance.", + "description": "The sub-type of instance, e.g. cfaas .", "computed": true }, { - "name": "restored_by", + "name": "last_operation", + "type": "TypeMap", + "description": "The status of the last operation requested on the instance", + "computed": true + }, + { + "name": "resource_group_name", "type": "TypeString", - "description": "The subject who restored the instance back from reclamation.", + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "resource_status", + "name": "guid", "type": "TypeString", - "description": "The status of the resource", + "description": "Guid of resource instance", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, + "name": "plan_history", + "type": "TypeList", + "description": "The plan history of the instance.", "computed": true, "elem": { - "type": "TypeString" + "resource_plan_id": { + "name": "resource_plan_id", + "type": "TypeString", + "computed": true + }, + "start_date": { + "name": "start_date", + "type": "TypeString", + "computed": true + } } }, { - "name": "resource_id", + "name": "update_by", "type": "TypeString", - "description": "The unique ID of the offering", + "description": "The subject who updated the instance.", "computed": true }, { - "name": "resource_aliases_url", + "name": "resource_status", "type": "TypeString", - "description": "The relative path to the resource aliases for the instance.", + "description": "The status of the resource", "computed": true }, { - "name": "resource_bindings_url", + "name": "location", "type": "TypeString", - "description": "The relative path to the resource bindings for the instance.", + "description": "The location where the instance available", + "cloud_data_type": "region", + "immutable": true, + "required": true + }, + { + "name": "target_crn", + "type": "TypeString", + "description": "The full deployment CRN as defined in the global catalog", "computed": true }, { - "name": "scheduled_reclaim_by", + "name": "deleted_by", "type": "TypeString", - "description": "The subject who initiated the instance reclamation.", + "description": "The subject who deleted the instance.", "computed": true } ], "ibm_resource_key": [ { - "name": "resource_instance_id", + "name": "parameters", + "type": "TypeMap", + "description": "Arbitrary parameters to pass. Must be a JSON object", + "optional": true + }, + { + "name": "credentials", + "type": "TypeMap", + "description": "Credentials asociated with the key", + "secure": true, + "computed": true + }, + { + "name": "source_crn", "type": "TypeString", - "description": "The id of the resource instance for which to create resource key", - "cloud_data_type": "resource_instance", - "immutable": true, - "optional": true, - "cloud_data_range": [ - "service:%s" - ] + "description": "The CRN of resource instance or alias associated to the key.", + "computed": true }, { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "created_at", + "type": "TypeString", + "description": "The date when the key was created.", + "computed": true }, { - "name": "crn", + "name": "resource_group_id", "type": "TypeString", - "description": "crn of resource key", - "cloud_data_type": "crn", + "description": "The short ID of the resource group.", + "cloud_data_type": "resource_group", "computed": true }, { - "name": "name", + "name": "resource_instance_id", "type": "TypeString", - "description": "The name of the resource key", + "description": "The id of the resource instance for which to create resource key", + "cloud_data_type": "resource_instance", "immutable": true, - "required": true + "optional": true, + "cloud_data_range": [ + "service:%s" + ] }, { - "name": "role", + "name": "resource_alias_id", "type": "TypeString", - "description": "Name of the user role.Valid roles are Writer, Reader, Manager, Administrator, Operator, Viewer, Editor and Custom Roles.", + "description": "The id of the resource alias for which to create resource key", "immutable": true, "optional": true }, @@ -134291,53 +139043,59 @@ "computed": true }, { - "name": "status", + "name": "crn", "type": "TypeString", - "description": "Status of resource key", + "description": "crn of resource key", + "cloud_data_type": "crn", "computed": true }, { - "name": "resource_group_id", + "name": "deleted_at", "type": "TypeString", - "description": "The short ID of the resource group.", - "cloud_data_type": "resource_group", + "description": "The date when the key was deleted.", "computed": true }, { - "name": "source_crn", + "name": "updated_by", "type": "TypeString", - "description": "The CRN of resource instance or alias associated to the key.", + "description": "The subject who updated the key.", "computed": true }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "The date when the key was last updated.", + "description": "The name of the resource key", + "immutable": true, + "required": true + }, + { + "name": "account_id", + "type": "TypeString", + "description": "An alpha-numeric value identifying the account ID.", "computed": true }, { - "name": "deleted_at", + "name": "resource_instance_url", "type": "TypeString", - "description": "The date when the key was deleted.", + "description": "The relative path to the resource.", "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "The subject who created the key.", + "description": "The date when the key was last updated.", "computed": true }, { - "name": "updated_by", + "name": "url", "type": "TypeString", - "description": "The subject who updated the key.", + "description": "When you created a new key, a relative URL path is created identifying the location of the key.", "computed": true }, { - "name": "credentials", - "type": "TypeMap", - "description": "Credentials asociated with the key", - "secure": true, + "name": "state", + "type": "TypeString", + "description": "The state of the key.", "computed": true }, { @@ -134347,52 +139105,37 @@ "computed": true }, { - "name": "resource_alias_id", - "type": "TypeString", - "description": "The id of the resource alias for which to create resource key", - "immutable": true, - "optional": true - }, - { - "name": "parameters", - "type": "TypeMap", - "description": "Arbitrary parameters to pass. Must be a JSON object", - "optional": true - }, - { - "name": "guid", - "type": "TypeString", - "description": "When you create a new key, a globally unique identifier (GUID) is assigned.", - "computed": true - }, - { - "name": "url", + "name": "created_by", "type": "TypeString", - "description": "When you created a new key, a relative URL path is created identifying the location of the key.", + "description": "The subject who created the key.", "computed": true }, { - "name": "account_id", + "name": "role", "type": "TypeString", - "description": "An alpha-numeric value identifying the account ID.", - "computed": true + "description": "Name of the user role.Valid roles are Writer, Reader, Manager, Administrator, Operator, Viewer, Editor and Custom Roles.", + "immutable": true, + "optional": true }, { - "name": "state", + "name": "status", "type": "TypeString", - "description": "The state of the key.", + "description": "Status of resource key", "computed": true }, { - "name": "resource_instance_url", - "type": "TypeString", - "description": "The relative path to the resource.", - "computed": true + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "created_at", + "name": "guid", "type": "TypeString", - "description": "The date when the key was created.", + "description": "When you create a new key, a globally unique identifier (GUID) is assigned.", "computed": true }, { @@ -134448,78 +139191,37 @@ ], "ibm_satellite_cluster": [ { - "name": "wait_for_worker_update", - "type": "TypeBool", - "description": "Wait for worker node to update during kube version update.", - "default_value": true, - "optional": true - }, - { - "name": "patch_version", - "type": "TypeString", - "description": "Kubernetes patch version", - "optional": true - }, - { - "name": "pod_subnet", + "name": "kube_version", "type": "TypeString", - "description": "User provided value for the pod subnet", + "description": "The OpenShift Container Platform version", "optional": true, "computed": true }, { - "name": "private_service_endpoint_url", + "name": "master_status", "type": "TypeString", "computed": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags for the resources", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", + "name": "enable_config_admin", + "type": "TypeBool", + "description": "Grant cluster admin access to Satellite Config to manage Kubernetes resources.", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "location", - "type": "TypeString", - "description": "The name or ID of the Satellite location", - "cloud_data_type": "region", - "required": true - }, - { - "name": "ingress_secret", - "type": "TypeString", - "secure": true, "computed": true }, { - "name": "host_labels", - "type": "TypeSet", - "description": "Labels that describe a Satellite host for default workerpool", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "private_service_endpoint_enabled", + "type": "TypeBool", + "computed": true }, { - "name": "worker_count", - "type": "TypeInt", - "description": "The number of worker nodes per zone in the default worker pool. Required when '--host-label' is specified. (default: 0)", - "optional": true, + "name": "public_service_endpoint_url", + "type": "TypeString", "computed": true }, { - "name": "enable_config_admin", + "name": "public_service_endpoint_enabled", "type": "TypeBool", - "description": "Grant cluster admin access to Satellite Config to manage Kubernetes resources.", - "optional": true, "computed": true }, { @@ -134533,12 +139235,20 @@ } }, { - "name": "crn", + "name": "private_service_endpoint_url", "type": "TypeString", - "description": "CRN of resource instance", - "cloud_data_type": "crn", "computed": true }, + { + "name": "host_labels", + "type": "TypeSet", + "description": "Labels that describe a Satellite host for default workerpool", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "name", "type": "TypeString", @@ -134547,23 +139257,22 @@ "required": true }, { - "name": "infrastructure_topology", + "name": "operating_system", "type": "TypeString", - "description": "String value for single node cluster option. Available options: single-replica, highly-available (default: highly-available)", - "immutable": true, + "description": "Operating system of the default worker pool. Options are REDHAT_7_64, REDHAT_8_64, or RHCOS.", "optional": true, "computed": true }, { - "name": "kube_version", + "name": "master_url", "type": "TypeString", - "description": "The OpenShift Container Platform version", - "optional": true, "computed": true }, { - "name": "master_status", - "type": "TypeString", + "name": "worker_count", + "type": "TypeInt", + "description": "The number of worker nodes per zone in the default worker pool. Required when '--host-label' is specified. (default: 0)", + "optional": true, "computed": true }, { @@ -134582,24 +139291,34 @@ } }, { - "name": "public_service_endpoint_url", + "name": "ingress_secret", "type": "TypeString", + "secure": true, "computed": true }, { - "name": "ingress_hostname", + "name": "patch_version", "type": "TypeString", - "computed": true + "description": "Kubernetes patch version", + "optional": true }, { - "name": "state", + "name": "retry_patch_version", + "type": "TypeInt", + "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", + "optional": true + }, + { + "name": "pod_subnet", "type": "TypeString", - "description": "The lifecycle state of the cluster.", + "description": "User provided value for the pod subnet", + "optional": true, "computed": true }, { - "name": "private_service_endpoint_enabled", - "type": "TypeBool", + "name": "resource_group_name", + "type": "TypeString", + "description": "The resource group name in which resource is provisioned", "computed": true }, { @@ -134610,9 +139329,31 @@ "optional": true }, { - "name": "master_url", + "name": "tags", + "type": "TypeSet", + "description": "List of tags for the resources", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "location", "type": "TypeString", - "computed": true + "description": "The name or ID of the Satellite location", + "cloud_data_type": "region", + "required": true + }, + { + "name": "wait_for_worker_update", + "type": "TypeBool", + "description": "Wait for worker node to update during kube version update.", + "default_value": true, + "optional": true }, { "name": "service_subnet", @@ -134622,27 +139363,25 @@ "computed": true }, { - "name": "resource_group_name", + "name": "resource_group_id", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, { - "name": "public_service_endpoint_enabled", - "type": "TypeBool", + "name": "ingress_hostname", + "type": "TypeString", "computed": true }, { - "name": "pull_secret", + "name": "infrastructure_topology", "type": "TypeString", - "description": "The RedHat pull secret to create the OpenShift cluster", - "optional": true - }, - { - "name": "retry_patch_version", - "type": "TypeInt", - "description": "Argument which helps to retry the patch version updates on worker nodes. Increment the value to retry the patch updates if the previous apply fails", - "optional": true + "description": "String value for single node cluster option. Available options: single-replica, highly-available (default: highly-available)", + "immutable": true, + "optional": true, + "computed": true }, { "name": "crn_token", @@ -134652,59 +139391,33 @@ "optional": true }, { - "name": "operating_system", + "name": "state", "type": "TypeString", - "description": "Operating system of the default worker pool. Options are REDHAT_7_64, REDHAT_8_64, or RHCOS.", - "optional": true, + "description": "The lifecycle state of the cluster.", "computed": true }, { - "name": "resource_group_id", + "name": "pull_secret", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true, - "computed": true - } - ], - "ibm_satellite_cluster_worker_pool": [ - { - "name": "host_labels", - "type": "TypeSet", - "description": "Labels that describe a Satellite host", - "immutable": true, - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "description": "The RedHat pull secret to create the OpenShift cluster", + "optional": true }, { - "name": "resource_group_id", + "name": "crn", "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", - "optional": true, + "description": "CRN of resource instance", + "cloud_data_type": "crn", "computed": true - }, + } + ], + "ibm_satellite_cluster_worker_pool": [ { - "name": "flavor", - "type": "TypeString", - "description": "The flavor defines the amount of virtual CPU, memory, and disk space that is set up in each worker node", + "name": "worker_count", + "type": "TypeInt", + "description": "Specify the desired number of workers per zone in this worker pool", "optional": true, "computed": true }, - { - "name": "disk_encryption", - "type": "TypeBool", - "description": "Disk encryption for worker node", - "optional": true - }, - { - "name": "entitlement", - "type": "TypeString", - "optional": true - }, { "name": "zones", "type": "TypeSet", @@ -134720,13 +139433,6 @@ } } }, - { - "name": "worker_count", - "type": "TypeInt", - "description": "Specify the desired number of workers per zone in this worker pool", - "optional": true, - "computed": true - }, { "name": "worker_pool_labels", "type": "TypeMap", @@ -134738,10 +139444,15 @@ } }, { - "name": "name", - "type": "TypeString", - "description": "The name for the worker pool", - "required": true + "name": "host_labels", + "type": "TypeSet", + "description": "Labels that describe a Satellite host", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "cluster", @@ -134751,17 +139462,49 @@ "required": true }, { - "name": "isolation", + "name": "flavor", "type": "TypeString", + "description": "The flavor defines the amount of virtual CPU, memory, and disk space that is set up in each worker node", "optional": true, "computed": true }, + { + "name": "disk_encryption", + "type": "TypeBool", + "description": "Disk encryption for worker node", + "optional": true + }, { "name": "operating_system", "type": "TypeString", "description": "Operating system of the worker pool. Options are REDHAT_7_64, REDHAT_8_64, or RHCOS.", "optional": true, "computed": true + }, + { + "name": "resource_group_id", + "type": "TypeString", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", + "optional": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The name for the worker pool", + "required": true + }, + { + "name": "isolation", + "type": "TypeString", + "optional": true, + "computed": true + }, + { + "name": "entitlement", + "type": "TypeString", + "optional": true } ], "ibm_satellite_cluster_worker_pool_zone_attachment": [ @@ -134814,29 +139557,46 @@ ], "ibm_satellite_endpoint": [ { - "name": "timeout", - "type": "TypeInt", - "description": "The inactivity timeout in the Endpoint side.", - "min_value": "1", - "max_value": "180", - "optional": true - }, - { - "name": "service_name", + "name": "created_by", "type": "TypeString", - "description": "The service name of the endpoint.", - "computed": true + "description": "The service or person who created the endpoint. Must be 1000 characters or fewer.", + "optional": true }, { - "name": "client_host", - "type": "TypeString", - "description": "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", - "computed": true + "name": "sources", + "type": "TypeList", + "computed": true, + "elem": { + "enabled": { + "name": "enabled", + "type": "TypeBool", + "description": "Whether the source is enabled for the endpoint.", + "optional": true + }, + "last_change": { + "name": "last_change", + "type": "TypeString", + "description": "The last time modify the Endpoint configurations.", + "optional": true + }, + "pending": { + "name": "pending", + "type": "TypeBool", + "description": "Whether the source has been enabled on this endpoint.", + "optional": true + }, + "source_id": { + "name": "source_id", + "type": "TypeString", + "description": "The Source ID.", + "optional": true + } + } }, { - "name": "created_at", + "name": "endpoint_id", "type": "TypeString", - "description": "The time when the Endpoint is created.", + "description": "The Endpoint ID.", "computed": true }, { @@ -134847,34 +139607,55 @@ "required": true }, { - "name": "reject_unauth", - "type": "TypeBool", - "description": "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", - "default_value": false, + "name": "display_name", + "type": "TypeString", + "description": "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", + "required": true + }, + { + "name": "sni", + "type": "TypeString", + "description": "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", "optional": true }, { - "name": "endpoint_id", + "name": "timeout", + "type": "TypeInt", + "description": "The inactivity timeout in the Endpoint side.", + "min_value": "1", + "max_value": "180", + "optional": true + }, + { + "name": "client_protocol", "type": "TypeString", - "description": "The Endpoint ID.", - "computed": true + "description": "The protocol in the client application side.", + "required": true, + "options": "http, http-tunnel, https, tcp, tls, udp" }, { - "name": "server_port", + "name": "connector_port", "type": "TypeInt", - "description": "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", - "required": true + "description": "The connector port.", + "computed": true }, { - "name": "server_host", + "name": "crn", "type": "TypeString", - "description": "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", - "required": true + "description": "Service instance associated with this location.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "client_mutual_auth", + "name": "client_port", + "type": "TypeInt", + "description": "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", + "computed": true + }, + { + "name": "reject_unauth", "type": "TypeBool", - "description": "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", + "description": "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", "default_value": false, "optional": true }, @@ -134999,53 +139780,15 @@ "max_items": 1 }, { - "name": "sources", - "type": "TypeList", - "computed": true, - "elem": { - "enabled": { - "name": "enabled", - "type": "TypeBool", - "description": "Whether the source is enabled for the endpoint.", - "optional": true - }, - "last_change": { - "name": "last_change", - "type": "TypeString", - "description": "The last time modify the Endpoint configurations.", - "optional": true - }, - "pending": { - "name": "pending", - "type": "TypeBool", - "description": "Whether the source has been enabled on this endpoint.", - "optional": true - }, - "source_id": { - "name": "source_id", - "type": "TypeString", - "description": "The Source ID.", - "optional": true - } - } - }, - { - "name": "connector_port", - "type": "TypeInt", - "description": "The connector port.", - "computed": true - }, - { - "name": "crn", + "name": "service_name", "type": "TypeString", - "description": "Service instance associated with this location.", - "cloud_data_type": "crn", + "description": "The service name of the endpoint.", "computed": true }, { - "name": "status", + "name": "client_host", "type": "TypeString", - "description": "Whether the Endpoint is active or not.", + "description": "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", "computed": true }, { @@ -135056,55 +139799,30 @@ "options": "cloud, location" }, { - "name": "sni", - "type": "TypeString", - "description": "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", - "optional": true - }, - { - "name": "client_protocol", - "type": "TypeString", - "description": "The protocol in the client application side.", - "required": true, - "options": "http, http-tunnel, https, tcp, tls, udp" - }, - { - "name": "server_protocol", + "name": "server_host", "type": "TypeString", - "description": "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", - "options": "tcp, tls, udp", - "optional": true + "description": "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", + "required": true }, { - "name": "server_mutual_auth", + "name": "client_mutual_auth", "type": "TypeBool", - "description": "Whether enable mutual auth in the server application side, when client_protocol is 'tls', this field is required.", + "description": "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", "default_value": false, - "optional": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The service or person who created the endpoint. Must be 1000 characters or fewer.", - "optional": true - }, - { - "name": "client_port", - "type": "TypeInt", - "description": "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", - "computed": true + "optional": true }, { - "name": "last_change", - "type": "TypeString", - "description": "The last time modify the Endpoint configurations.", - "computed": true + "name": "server_mutual_auth", + "type": "TypeBool", + "description": "Whether enable mutual auth in the server application side, when client_protocol is 'tls', this field is required.", + "default_value": false, + "optional": true }, { - "name": "display_name", + "name": "created_at", "type": "TypeString", - "description": "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", - "required": true + "description": "The time when the Endpoint is created.", + "computed": true }, { "name": "performance", @@ -135169,9 +139887,40 @@ "optional": true } } + }, + { + "name": "server_port", + "type": "TypeInt", + "description": "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", + "required": true + }, + { + "name": "server_protocol", + "type": "TypeString", + "description": "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", + "options": "tcp, tls, udp", + "optional": true + }, + { + "name": "status", + "type": "TypeString", + "description": "Whether the Endpoint is active or not.", + "computed": true + }, + { + "name": "last_change", + "type": "TypeString", + "description": "The last time modify the Endpoint configurations.", + "computed": true } ], "ibm_satellite_host": [ + { + "name": "host_id", + "type": "TypeString", + "description": "The specific host ID to assign to a Satellite location or cluster", + "required": true + }, { "name": "labels", "type": "TypeSet", @@ -135189,19 +139938,6 @@ "optional": true, "computed": true }, - { - "name": "host_id", - "type": "TypeString", - "description": "The specific host ID to assign to a Satellite location or cluster", - "required": true - }, - { - "name": "zone", - "type": "TypeString", - "description": "The zone within the cluster to assign the host to", - "optional": true, - "computed": true - }, { "name": "host_provider", "type": "TypeString", @@ -135222,21 +139958,44 @@ "optional": true }, { - "name": "location", + "name": "cluster", "type": "TypeString", - "description": "The name or ID of the Satellite location", - "cloud_data_type": "region", - "required": true + "description": "The name or ID of a Satellite location or cluster to assign the host to", + "optional": true, + "computed": true }, { - "name": "cluster", + "name": "zone", "type": "TypeString", - "description": "The name or ID of a Satellite location or cluster to assign the host to", + "description": "The zone within the cluster to assign the host to", "optional": true, "computed": true + }, + { + "name": "location", + "type": "TypeString", + "description": "The name or ID of the Satellite location", + "cloud_data_type": "region", + "required": true } ], "ibm_satellite_link": [ + { + "name": "crn", + "type": "TypeString", + "description": "CRN of the Location.", + "cloud_data_type": "crn", + "immutable": true, + "required": true + }, + { + "name": "location", + "type": "TypeString", + "description": "Location ID.", + "cloud_data_type": "region", + "immutable": true, + "required": true + }, { "name": "ws_endpoint", "type": "TypeString", @@ -135250,6 +140009,12 @@ "description": "Description of the location.", "computed": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "Timestamp of creation of location.", + "computed": true + }, { "name": "satellite_link_host", "type": "TypeString", @@ -135257,9 +140022,15 @@ "computed": true }, { - "name": "created_at", + "name": "status", "type": "TypeString", - "description": "Timestamp of creation of location.", + "description": "Enabled/Disabled.", + "computed": true + }, + { + "name": "last_change", + "type": "TypeString", + "description": "Timestamp of latest modification of location.", "computed": true }, { @@ -135337,115 +140108,52 @@ "optional": true } } - }, - { - "name": "crn", - "type": "TypeString", - "description": "CRN of the Location.", - "cloud_data_type": "crn", - "immutable": true, - "required": true - }, - { - "name": "location", - "type": "TypeString", - "description": "Location ID.", - "cloud_data_type": "region", - "immutable": true, - "required": true - }, - { - "name": "status", - "type": "TypeString", - "description": "Enabled/Disabled.", - "computed": true - }, - { - "name": "last_change", - "type": "TypeString", - "description": "Timestamp of latest modification of location.", - "computed": true } ], "ibm_satellite_location": [ { - "name": "coreos_enabled", - "type": "TypeBool", - "description": "Enable Red Hat CoreOS features within the Satellite location", - "optional": true, - "computed": true - }, - { - "name": "logging_account_id", + "name": "resource_group_id", "type": "TypeString", - "description": "The account ID for IBM Log Analysis with LogDNA log forwarding", - "optional": true - }, - { - "name": "zones", - "type": "TypeSet", - "description": "The names of at least three high availability zones to use for the location", + "description": "ID of the resource group.", + "cloud_data_type": "resource_group", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "resource_group_name", - "type": "TypeString", - "description": "Name of the resource group", "computed": true }, { - "name": "host_available_count", - "type": "TypeInt", - "description": "The available number of hosts that can be assigned to a cluster resource in the Satellite location.", - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "ingress_secret", + "name": "crn", "type": "TypeString", - "secure": true, + "description": "Location CRN", + "cloud_data_type": "crn", "computed": true }, { - "name": "managed_from", + "name": "location", "type": "TypeString", - "description": "The IBM Cloud metro from which the Satellite location is managed", + "description": "A unique name for the new Satellite location", + "cloud_data_type": "region", "required": true }, { - "name": "tags", - "type": "TypeSet", - "description": "List of tags associated with resource instance", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, + "name": "host_attached_count", + "type": "TypeInt", + "description": "The total number of hosts that are attached to the Satellite location.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "crn", + "name": "description", "type": "TypeString", - "description": "Location CRN", - "cloud_data_type": "crn", - "computed": true + "description": "A description of the new Satellite location", + "optional": true }, { - "name": "host_attached_count", - "type": "TypeInt", - "description": "The total number of hosts that are attached to the Satellite location.", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "coreos_enabled", + "type": "TypeBool", + "description": "Enable Red Hat CoreOS features within the Satellite location", + "optional": true, + "computed": true }, { "name": "cos_config", @@ -135472,24 +140180,36 @@ "max_items": 1 }, { - "name": "resource_group_id", - "type": "TypeString", - "description": "ID of the resource group.", - "cloud_data_type": "resource_group", + "name": "zones", + "type": "TypeSet", + "description": "The names of at least three high availability zones to use for the location", "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group_name", + "type": "TypeString", + "description": "Name of the resource group", "computed": true }, { - "name": "location", + "name": "ingress_hostname", "type": "TypeString", - "description": "A unique name for the new Satellite location", - "cloud_data_type": "region", + "computed": true + }, + { + "name": "managed_from", + "type": "TypeString", + "description": "The IBM Cloud metro from which the Satellite location is managed", "required": true }, { - "name": "description", + "name": "logging_account_id", "type": "TypeString", - "description": "A description of the new Satellite location", + "description": "The account ID for IBM Log Analysis with LogDNA log forwarding", "optional": true }, { @@ -135513,6 +140233,28 @@ }, "max_items": 1 }, + { + "name": "tags", + "type": "TypeSet", + "description": "List of tags associated with resource instance", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "host_available_count", + "type": "TypeInt", + "description": "The available number of hosts that can be assigned to a cluster resource in the Satellite location.", + "computed": true, + "elem": { + "type": "TypeString" + } + }, { "name": "created_on", "type": "TypeString", @@ -135520,8 +140262,9 @@ "computed": true }, { - "name": "ingress_hostname", + "name": "ingress_secret", "type": "TypeString", + "secure": true, "computed": true } ], @@ -135545,43 +140288,40 @@ ], "ibm_satellite_storage_assignment": [ { - "name": "groups", - "type": "TypeList", - "description": "One or more cluster groups on which you want to apply the configuration. Note that at least one cluster group is required.", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "assignment_name", + "type": "TypeString", + "description": "Name of the Assignment.", + "required": true }, { - "name": "sat_cluster", + "name": "owner", "type": "TypeString", - "description": "ID of the Satellite cluster that you applied the configuration to.", + "description": "The Owner of the Assignment.", "computed": true }, { - "name": "config", + "name": "cluster", "type": "TypeString", - "description": "Storage Configuration Name or ID.", - "required": true + "description": "ID of the Satellite cluster or Service Cluster that you want to apply the configuration to.", + "optional": true }, { - "name": "assignment_type", + "name": "config_uuid", "type": "TypeString", - "description": "The Type of Assignment.", + "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", "computed": true }, { - "name": "created", + "name": "assignment_type", "type": "TypeString", - "description": "The Time of Creation of the Assignment.", + "description": "The Type of Assignment.", "computed": true }, { - "name": "assignment_name", - "type": "TypeString", - "description": "Name of the Assignment.", - "required": true + "name": "rollout_success_count", + "type": "TypeInt", + "description": "The Rollout Success Count of the Assignment.", + "computed": true }, { "name": "is_assignment_upgrade_available", @@ -135590,27 +140330,27 @@ "computed": true }, { - "name": "controller", + "name": "config", "type": "TypeString", - "description": "The Name or ID of the Satellite Location.", - "optional": true + "description": "Storage Configuration Name or ID.", + "required": true }, { - "name": "config_version_uuid", + "name": "config_version", "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration Version.", + "description": "The Storage Configuration Version.", "computed": true }, { - "name": "svc_cluster", + "name": "created", "type": "TypeString", - "description": "ID of the Service Cluster that you applied the configuration to.", + "description": "The Time of Creation of the Assignment.", "computed": true }, { - "name": "rollout_success_count", + "name": "rollout_error_count", "type": "TypeInt", - "description": "The Rollout Success Count of the Assignment.", + "description": "The Rollout Error Count of the Assignment.", "computed": true }, { @@ -135621,40 +140361,43 @@ "optional": true }, { - "name": "cluster", + "name": "uuid", "type": "TypeString", - "description": "ID of the Satellite cluster or Service Cluster that you want to apply the configuration to.", - "optional": true + "description": "The Universally Unique IDentifier (UUID) of the Assignment.", + "immutable": true, + "computed": true }, { - "name": "owner", + "name": "svc_cluster", "type": "TypeString", - "description": "The Owner of the Assignment.", + "description": "ID of the Service Cluster that you applied the configuration to.", "computed": true }, { - "name": "config_uuid", + "name": "config_version_uuid", "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", + "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration Version.", "computed": true }, { - "name": "config_version", + "name": "controller", "type": "TypeString", - "description": "The Storage Configuration Version.", - "computed": true + "description": "The Name or ID of the Satellite Location.", + "optional": true }, { - "name": "rollout_error_count", - "type": "TypeInt", - "description": "The Rollout Error Count of the Assignment.", - "computed": true + "name": "groups", + "type": "TypeList", + "description": "One or more cluster groups on which you want to apply the configuration. Note that at least one cluster group is required.", + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "uuid", + "name": "sat_cluster", "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Assignment.", - "immutable": true, + "description": "ID of the Satellite cluster that you applied the configuration to.", "computed": true } ], @@ -135665,6 +140408,15 @@ "description": "The Storage Template Version.", "required": true }, + { + "name": "user_config_parameters", + "type": "TypeMap", + "description": "User Config Parameters to pass as a Map of string key-value.", + "required": true, + "elem": { + "type": "TypeString" + } + }, { "name": "user_secret_parameters", "type": "TypeMap", @@ -135675,6 +140427,19 @@ "type": "TypeString" } }, + { + "name": "location", + "type": "TypeString", + "description": "Location ID.", + "cloud_data_type": "region", + "required": true + }, + { + "name": "config_version", + "type": "TypeString", + "description": "Version of the Storage Configuration.", + "computed": true + }, { "name": "storage_class_parameters", "type": "TypeList", @@ -135688,18 +140453,25 @@ } }, { - "name": "delete_assignments", + "name": "uuid", + "type": "TypeString", + "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", + "immutable": true, + "computed": true + }, + { + "name": "update_assignments", "type": "TypeBool", - "description": "Set to delete all assignments during a configuration destroy.", + "description": "Set to update all assignments during a configuration update.", "default_value": false, "optional": true }, { - "name": "location", - "type": "TypeString", - "description": "Location ID.", - "cloud_data_type": "region", - "required": true + "name": "delete_assignments", + "type": "TypeBool", + "description": "Set to delete all assignments during a configuration destroy.", + "default_value": false, + "optional": true }, { "name": "config_name", @@ -135708,56 +140480,23 @@ "immutable": true, "required": true }, - { - "name": "config_version", - "type": "TypeString", - "description": "Version of the Storage Configuration.", - "computed": true - }, - { - "name": "update_assignments", - "type": "TypeBool", - "description": "Set to update all assignments during a configuration update.", - "default_value": false, - "optional": true - }, { "name": "storage_template_name", "type": "TypeString", "description": "The Storage Template Name.", "required": true - }, - { - "name": "user_config_parameters", - "type": "TypeMap", - "description": "User Config Parameters to pass as a Map of string key-value.", - "required": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "uuid", - "type": "TypeString", - "description": "The Universally Unique IDentifier (UUID) of the Storage Configuration.", - "immutable": true, - "computed": true } ], "ibm_scc_account_settings": [], "ibm_scc_control_library": [ { - "name": "created_on", - "type": "TypeString", - "description": "The date when the control library was created.", - "computed": true - }, - { - "name": "control_library_type", + "name": "control_library_description", "type": "TypeString", - "description": "The control library type.", + "description": "The control library description.", "required": true, - "options": "custom, predefined" + "min_length": 2, + "max_length": 256, + "matches": "[A-Za-z0-9]+" }, { "name": "control_library_version", @@ -135768,33 +140507,6 @@ "matches": "^[a-zA-Z0-9_\\-.]*$", "optional": true }, - { - "name": "controls_count", - "type": "TypeInt", - "description": "The number of controls.", - "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The user who created the control library.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "The user who updated the control library.", - "computed": true - }, - { - "name": "control_library_name", - "type": "TypeString", - "description": "The control library name.", - "required": true, - "min_length": 2, - "max_length": 64, - "matches": "^[a-zA-Z0-9_\\s\\-]*$" - }, { "name": "latest", "type": "TypeBool", @@ -136002,22 +140714,44 @@ "computed": true }, { - "name": "control_library_description", + "name": "control_library_id", "type": "TypeString", - "description": "The control library description.", + "description": "The control library ID.", + "computed": true + }, + { + "name": "control_library_name", + "type": "TypeString", + "description": "The control library name.", "required": true, "min_length": 2, - "max_length": 256, - "matches": "[A-Za-z0-9]+" + "max_length": 64, + "matches": "^[a-zA-Z0-9_\\s\\-]*$" }, { - "name": "version_group_label", + "name": "control_library_type", "type": "TypeString", - "description": "The version group label.", - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", - "optional": true + "description": "The control library type.", + "required": true, + "options": "custom, predefined" + }, + { + "name": "controls_count", + "type": "TypeInt", + "description": "The number of controls.", + "computed": true + }, + { + "name": "created_on", + "type": "TypeString", + "description": "The date when the control library was created.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "The user who updated the control library.", + "computed": true }, { "name": "hierarchy_enabled", @@ -136026,51 +140760,53 @@ "computed": true }, { - "name": "account_id", + "name": "instance_id", "type": "TypeString", - "description": "The account ID.", - "computed": true + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "updated_on", + "name": "version_group_label", "type": "TypeString", - "description": "The date when the control library was updated.", - "computed": true - } - ], - "ibm_scc_profile": [ + "description": "The version group label.", + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", + "optional": true + }, { - "name": "profile_version", + "name": "account_id", "type": "TypeString", - "description": "The version status of the profile.", + "description": "The account ID.", "computed": true }, { "name": "created_by", "type": "TypeString", - "description": "The user who created the profile.", + "description": "The user who created the control library.", "computed": true }, { - "name": "attachments_count", - "type": "TypeInt", - "description": "The number of attachments related to this profile.", + "name": "updated_on", + "type": "TypeString", + "description": "The date when the control library was updated.", "computed": true - }, + } + ], + "ibm_scc_profile": [ { - "name": "updated_on", + "name": "version_group_label", "type": "TypeString", - "description": "The date when the profile was updated.", + "description": "The version group label of the profile.", "computed": true }, { - "name": "profile_name", + "name": "created_on", "type": "TypeString", - "description": "The profile name.", - "required": true, - "min_length": 2, - "max_length": 64, - "matches": "^[a-zA-Z0-9_\\s\\-]*$" + "description": "The date when the profile was created.", + "computed": true }, { "name": "controls", @@ -136114,13 +140850,13 @@ "name": "control_id", "type": "TypeString", "description": "The unique ID of the control inside the control library.", - "optional": true + "required": true }, "control_library_id": { "name": "control_library_id", "type": "TypeString", "description": "The ID of the control library that contains the profile.", - "optional": true + "required": true }, "control_library_version": { "name": "control_library_version", @@ -136268,6 +141004,57 @@ } } }, + { + "name": "profile_version", + "type": "TypeString", + "description": "The version status of the profile.", + "optional": true, + "computed": true + }, + { + "name": "latest", + "type": "TypeBool", + "description": "The latest version of the profile.", + "computed": true + }, + { + "name": "profile_name", + "type": "TypeString", + "description": "The profile name.", + "required": true, + "min_length": 2, + "max_length": 64, + "matches": "^[a-zA-Z0-9_\\s\\-]*$" + }, + { + "name": "profile_description", + "type": "TypeString", + "description": "The profile description.", + "required": true, + "min_length": 2, + "max_length": 256, + "matches": "^[a-zA-Z0-9_,'\"\\s\\-\\[\\]]+$" + }, + { + "name": "updated_on", + "type": "TypeString", + "description": "The date when the profile was updated.", + "computed": true + }, + { + "name": "attachments_count", + "type": "TypeInt", + "description": "The number of attachments related to this profile.", + "computed": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "default_parameters", "type": "TypeList", @@ -136313,9 +141100,15 @@ } }, { - "name": "created_on", + "name": "hierarchy_enabled", + "type": "TypeBool", + "description": "The indication of whether hierarchy is enabled for the profile.", + "computed": true + }, + { + "name": "created_by", "type": "TypeString", - "description": "The date when the profile was created.", + "description": "The user who created the profile.", "computed": true }, { @@ -136324,6 +141117,12 @@ "description": "The user who updated the profile.", "computed": true }, + { + "name": "controls_count", + "type": "TypeInt", + "description": "The number of controls for the profile.", + "computed": true + }, { "name": "control_parents_count", "type": "TypeInt", @@ -136331,58 +141130,28 @@ "computed": true }, { - "name": "profile_description", + "name": "profile_id", "type": "TypeString", - "description": "The profile description.", - "required": true, - "min_length": 2, - "max_length": 256, - "matches": "^[a-zA-Z0-9_,'\"\\s\\-\\[\\]]+$" + "description": "The profile name.", + "computed": true }, { "name": "profile_type", "type": "TypeString", "description": "The profile type, such as custom or predefined.", "required": true - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "The instance ID.", - "cloud_data_type": "resource_instance", - "computed": true - }, - { - "name": "hierarchy_enabled", - "type": "TypeBool", - "description": "The indication of whether hierarchy is enabled for the profile.", - "computed": true - }, - { - "name": "version_group_label", - "type": "TypeString", - "description": "The version group label of the profile.", - "computed": true - }, - { - "name": "latest", - "type": "TypeBool", - "description": "The latest version of the profile.", - "computed": true - }, - { - "name": "controls_count", - "type": "TypeInt", - "description": "The number of controls for the profile.", - "computed": true } ], "ibm_scc_profile_attachment": [ { - "name": "account_id", + "name": "profile_id", "type": "TypeString", - "description": "The account ID that is associated to the attachment.", - "computed": true + "description": "The ID of the profile that is specified in the attachment.", + "immutable": true, + "required": true, + "min_length": 36, + "max_length": 36, + "matches": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, { "name": "scope", @@ -136419,73 +141188,11 @@ } }, { - "name": "attachment_parameters", - "type": "TypeList", - "description": "The profile parameters for the attachment.", - "optional": true, - "elem": { - "assessment_id": { - "name": "assessment_id", - "type": "TypeString", - "description": "The implementation ID of the parameter.", - "optional": true - }, - "assessment_type": { - "name": "assessment_type", - "type": "TypeString", - "description": "The type of the implementation.", - "optional": true - }, - "parameter_display_name": { - "name": "parameter_display_name", - "type": "TypeString", - "description": "The parameter display name.", - "optional": true - }, - "parameter_name": { - "name": "parameter_name", - "type": "TypeString", - "description": "The parameter name.", - "optional": true - }, - "parameter_type": { - "name": "parameter_type", - "type": "TypeString", - "description": "The parameter type.", - "optional": true - }, - "parameter_value": { - "name": "parameter_value", - "type": "TypeString", - "description": "The value of the parameter.", - "optional": true - } - } - }, - { - "name": "attachment_id", - "type": "TypeString", - "description": "The ID of the attachment.", - "computed": true - }, - { - "name": "updated_by", + "name": "created_on", "type": "TypeString", - "description": "The user who updated the attachment.", + "description": "The date when the attachment was created.", "computed": true }, - { - "name": "status", - "type": "TypeString", - "description": "The status of an attachment evaluation.", - "required": true - }, - { - "name": "schedule", - "type": "TypeString", - "description": "The schedule of an attachment evaluation.", - "required": true - }, { "name": "notifications", "type": "TypeList", @@ -136525,6 +141232,50 @@ } } }, + { + "name": "name", + "type": "TypeString", + "description": "The name of the attachment.", + "required": true + }, + { + "name": "attachment_id", + "type": "TypeString", + "description": "The ID of the attachment.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "The user who updated the attachment.", + "computed": true + }, + { + "name": "status", + "type": "TypeString", + "description": "The status of an attachment evaluation.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description for the attachment.", + "optional": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "updated_on", + "type": "TypeString", + "description": "The date when the attachment was updated.", + "computed": true + }, { "name": "last_scan", "type": "TypeList", @@ -136552,57 +141303,78 @@ } }, { - "name": "description", - "type": "TypeString", - "description": "The description for the attachment.", - "optional": true - }, - { - "name": "profile_id", - "type": "TypeString", - "description": "The ID of the profile that is specified in the attachment.", - "immutable": true, - "required": true, - "min_length": 36, - "max_length": 36, - "matches": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - }, - { - "name": "instance_id", + "name": "next_scan_time", "type": "TypeString", - "description": "The instance ID of the account that is associated to the attachment.", - "cloud_data_type": "resource_instance", + "description": "The start time of the next scan.", "computed": true }, { - "name": "created_by", + "name": "profile_attachment_id", "type": "TypeString", - "description": "The user who created the attachment.", + "description": "The profile attachment ID.", "computed": true }, { - "name": "next_scan_time", + "name": "account_id", "type": "TypeString", - "description": "The start time of the next scan.", + "description": "The account ID that is associated to the attachment.", "computed": true }, { - "name": "created_on", + "name": "created_by", "type": "TypeString", - "description": "The date when the attachment was created.", + "description": "The user who created the attachment.", "computed": true }, { - "name": "updated_on", + "name": "schedule", "type": "TypeString", - "description": "The date when the attachment was updated.", - "computed": true + "description": "The schedule of an attachment evaluation.", + "required": true }, { - "name": "name", - "type": "TypeString", - "description": "The name of the attachment.", - "required": true + "name": "attachment_parameters", + "type": "TypeList", + "description": "The profile parameters for the attachment.", + "optional": true, + "elem": { + "assessment_id": { + "name": "assessment_id", + "type": "TypeString", + "description": "The implementation ID of the parameter.", + "optional": true + }, + "assessment_type": { + "name": "assessment_type", + "type": "TypeString", + "description": "The type of the implementation.", + "optional": true + }, + "parameter_display_name": { + "name": "parameter_display_name", + "type": "TypeString", + "description": "The parameter display name.", + "optional": true + }, + "parameter_name": { + "name": "parameter_name", + "type": "TypeString", + "description": "The parameter name.", + "optional": true + }, + "parameter_type": { + "name": "parameter_type", + "type": "TypeString", + "description": "The parameter type.", + "optional": true + }, + "parameter_value": { + "name": "parameter_value", + "type": "TypeString", + "description": "The value of the parameter.", + "optional": true + } + } } ], "ibm_scc_provider_type_instance": [ @@ -136630,6 +141402,14 @@ "description": "The unique identifier of the provider type instance.", "computed": true }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "provider_type_id", "type": "TypeString", @@ -136656,6 +141436,85 @@ } ], "ibm_scc_rule": [ + { + "name": "account_id", + "type": "TypeString", + "description": "The account ID.", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the rule.", + "computed": true + }, + { + "name": "version", + "type": "TypeString", + "description": "The version number of a rule.", + "min_length": 5, + "max_length": 10, + "matches": "^[0-9][0-9.]*$", + "optional": true + }, + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Security and Compliance Center instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "modified_by", + "type": "TypeString", + "description": "The unique identifier for the user or application that last modified the resource.", + "computed": true, + "deprecated": "use updated_by" + }, + { + "name": "enforcement_actions", + "type": "TypeList", + "description": "The actions that the service must run on your behalf when a request to create or modify the target resource does not comply with your conditions.", + "optional": true, + "elem": { + "action": { + "name": "action", + "type": "TypeString", + "description": "To block a request from completing, use `disallow`.", + "required": true + } + }, + "max_items": 1, + "deprecated": "enforcement_actions is now deprecated" + }, + { + "name": "labels", + "type": "TypeList", + "description": "The list of labels.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "type", + "type": "TypeString", + "description": "The rule type (allowable values are `user_defined` or `system_defined`).", + "computed": true + }, + { + "name": "updated_on", + "type": "TypeString", + "description": "The date when the rule was modified.", + "computed": true + }, + { + "name": "created_on", + "type": "TypeString", + "description": "The date when the rule was created.", + "computed": true + }, { "name": "import", "type": "TypeList", @@ -136698,34 +141557,18 @@ "max_items": 1 }, { - "name": "updated_on", - "type": "TypeString", - "description": "The date when the rule was modified.", - "computed": true - }, - { - "name": "version", + "name": "modification_date", "type": "TypeString", - "description": "The version number of a rule.", - "min_length": 5, - "max_length": 10, - "matches": "^[0-9][0-9.]*$", - "optional": true + "description": "The date the resource was last modified.", + "computed": true, + "deprecated": "use updated_on instead" }, { - "name": "created_by", + "name": "rule_id", "type": "TypeString", - "description": "The user who created the rule.", + "description": "The rule ID.", "computed": true }, - { - "name": "description", - "type": "TypeString", - "description": "The details of a rule's response.", - "required": true, - "max_length": 512, - "matches": "[A-Za-z0-9]+" - }, { "name": "target", "type": "TypeList", @@ -136772,75 +141615,26 @@ }, "service_name": { "name": "service_name", - "type": "TypeString", - "description": "The target service name.", - "required": true - } - }, - "max_items": 1, - "min_items": 1 - }, - { - "name": "name", - "type": "TypeString", - "description": "A human-readable alias to assign to your rule.", - "optional": true, - "deprecated": "name is now deprecated" - }, - { - "name": "enforcement_actions", - "type": "TypeList", - "description": "The actions that the service must run on your behalf when a request to create or modify the target resource does not comply with your conditions.", - "optional": true, - "elem": { - "action": { - "name": "action", - "type": "TypeString", - "description": "To block a request from completing, use `disallow`.", - "required": true - } - }, - "max_items": 1, - "deprecated": "enforcement_actions is now deprecated" - }, - { - "name": "account_id", - "type": "TypeString", - "description": "The account ID.", - "computed": true + "type": "TypeString", + "description": "The target service name.", + "required": true + } + }, + "max_items": 1, + "min_items": 1 }, { - "name": "created_on", + "name": "updated_by", "type": "TypeString", - "description": "The date when the rule was created.", + "description": "The user who modified the rule.", "computed": true }, { - "name": "etag", + "name": "name", "type": "TypeString", - "description": "The etag of the rule.", - "computed": true - }, - { - "name": "labels", - "type": "TypeList", - "description": "The list of labels.", + "description": "A human-readable alias to assign to your rule.", "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "type", - "type": "TypeString", - "description": "The rule type (allowable values are `user_defined` or `system_defined`).", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "The user who modified the rule.", - "computed": true + "deprecated": "name is now deprecated" }, { "name": "rule_type", @@ -136850,25 +141644,10 @@ "deprecated": "use type instead" }, { - "name": "creation_date", - "type": "TypeString", - "description": "The date the resource was created.", - "computed": true, - "deprecated": "use created_on instead" - }, - { - "name": "modification_date", - "type": "TypeString", - "description": "The date the resource was last modified.", - "computed": true, - "deprecated": "use updated_on instead" - }, - { - "name": "modified_by", + "name": "etag", "type": "TypeString", - "description": "The unique identifier for the user or application that last modified the resource.", - "computed": true, - "deprecated": "use updated_by" + "description": "The etag of the rule.", + "computed": true }, { "name": "required_config", @@ -137095,6 +141874,21 @@ }, "max_items": 1, "min_items": 1 + }, + { + "name": "creation_date", + "type": "TypeString", + "description": "The date the resource was created.", + "computed": true, + "deprecated": "use created_on instead" + }, + { + "name": "description", + "type": "TypeString", + "description": "The details of a rule's response.", + "required": true, + "max_length": 512, + "matches": "[A-Za-z0-9]+" } ], "ibm_scc_rule_attachment": [], @@ -137102,33 +141896,24 @@ "ibm_scc_template_attachment": [], "ibm_schematics_action": [ { - "name": "user_state", - "type": "TypeList", - "description": "User defined status of the Schematics object.", - "optional": true, - "computed": true, - "elem": { - "set_at": { - "name": "set_at", - "type": "TypeString", - "description": "When the User who set the state of the Object.", - "optional": true, - "computed": true - }, - "set_by": { - "name": "set_by", - "type": "TypeString", - "description": "Name of the User who set the state of the Object.", - "optional": true, - "computed": true - }, - "state": { - "name": "state", - "type": "TypeString", - "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", - "optional": true - } - } + "name": "description", + "type": "TypeString", + "description": "Action description.", + "optional": true + }, + { + "name": "source_type", + "type": "TypeString", + "description": "Type of source for the Template.", + "options": "cos_bucket, external_scm, git_hub, git_hub_enterprise, git_lab, ibm_cloud_catalog, ibm_git_lab, local", + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "Action Cloud Resource Name.", + "cloud_data_type": "crn", + "computed": true }, { "name": "credentials", @@ -137269,49 +142054,9 @@ "max_items": 1 }, { - "name": "sys_lock", - "type": "TypeList", - "description": "System lock status.", - "optional": true, - "computed": true, - "elem": { - "sys_locked": { - "name": "sys_locked", - "type": "TypeBool", - "description": "Is the automation locked by a Schematic job ?.", - "optional": true - }, - "sys_locked_at": { - "name": "sys_locked_at", - "type": "TypeString", - "description": "When the User performed the job that lead to locking of the automation ?.", - "optional": true - }, - "sys_locked_by": { - "name": "sys_locked_by", - "type": "TypeString", - "description": "Name of the User who performed the job, that lead to the locking of the automation.", - "optional": true - } - } - }, - { - "name": "source_updated_by", - "type": "TypeString", - "description": "E-mail address of user who updated the action playbook source.", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource-group name for an action. By default, action is created in default resource group.", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "settings", + "name": "action_outputs", "type": "TypeList", - "description": "Environment variables for the Action.", + "description": "Output variables for the Action.", "optional": true, "elem": { "link": { @@ -137446,29 +142191,92 @@ } }, { - "name": "x_github_token", + "name": "created_by", "type": "TypeString", - "description": "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", - "optional": true + "description": "E-mail address of the user who created an action.", + "computed": true }, { - "name": "crn", + "name": "location", "type": "TypeString", - "description": "Action Cloud Resource Name.", - "cloud_data_type": "crn", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "options": "eu-de, eu-gb, us-east, us-south", + "optional": true, "computed": true }, { - "name": "source_type", + "name": "tags", + "type": "TypeList", + "description": "Action tags.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "sys_lock", + "type": "TypeList", + "description": "System lock status.", + "computed": true, + "elem": { + "sys_locked": { + "name": "sys_locked", + "type": "TypeBool", + "description": "Is the automation locked by a Schematic job ?.", + "optional": true + }, + "sys_locked_at": { + "name": "sys_locked_at", + "type": "TypeString", + "description": "When the User performed the job that lead to locking of the automation ?.", + "optional": true + }, + "sys_locked_by": { + "name": "sys_locked_by", + "type": "TypeString", + "description": "Name of the User who performed the job, that lead to the locking of the automation.", + "optional": true + } + } + }, + { + "name": "source_created_at", "type": "TypeString", - "description": "Type of source for the Template.", - "options": "cos_bucket, external_scm, git_hub, git_hub_enterprise, git_lab, ibm_cloud_catalog, ibm_git_lab, local", + "description": "Action Playbook Source creation time.", + "computed": true + }, + { + "name": "account", + "type": "TypeString", + "description": "Action account ID.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "Action creation time.", + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", + "required": true, + "min_length": 1, + "max_length": 65 + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name for an action. By default, action is created in default resource group.", + "cloud_data_type": "resource_group", "optional": true }, { - "name": "action_inputs", + "name": "settings", "type": "TypeList", - "description": "Input variables for the Action.", + "description": "Environment variables for the Action.", "optional": true, "elem": { "link": { @@ -137603,180 +142411,113 @@ } }, { - "name": "action_outputs", + "name": "bastion", "type": "TypeList", - "description": "Output variables for the Action.", + "description": "Describes a bastion resource.", "optional": true, "elem": { - "link": { - "name": "link", + "host": { + "name": "host", "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", - "optional": true, - "computed": true - }, - "metadata": { - "name": "metadata", - "type": "TypeList", - "description": "User editable metadata for the variables.", - "optional": true, - "elem": { - "aliases": { - "name": "aliases", - "type": "TypeList", - "description": "List of aliases for the variable name.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "optional": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "optional": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "optional": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "optional": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "optional": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "optional": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "optional": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "optional": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "optional": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "optional": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "optional": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "optional": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "optional": true - } - } + "description": "Reference to the Inventory resource definition.", + "optional": true }, "name": { "name": "name", "type": "TypeString", - "description": "Name of the variable.", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", + "description": "Bastion Name(Unique).", "optional": true } - } + }, + "max_items": 1 }, { - "name": "created_by", + "name": "source_updated_by", "type": "TypeString", - "description": "E-mail address of the user who created an action.", + "description": "E-mail address of user who updated the action playbook source.", "computed": true }, { - "name": "playbook_names", + "name": "user_state", "type": "TypeList", - "description": "Playbook names retrieved from the respository.", + "description": "User defined status of the Schematics object.", + "optional": true, "computed": true, "elem": { - "type": "TypeString" + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "optional": true, + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "optional": true, + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + "optional": true + } } }, { - "name": "description", + "name": "command_parameter", "type": "TypeString", - "description": "Action description.", + "description": "Schematics job command parameter (playbook-name).", "optional": true }, { - "name": "source_updated_at", + "name": "inventory", "type": "TypeString", - "description": "The action playbook updation time.", - "computed": true + "description": "Target inventory record ID, used by the action or ansible playbook.", + "optional": true }, { - "name": "created_at", + "name": "state", + "type": "TypeList", + "description": "Computed state of the Action.", + "computed": true, + "elem": { + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of automation (workspace or action).", + "optional": true + }, + "status_job_id": { + "name": "status_job_id", + "type": "TypeString", + "description": "Job id reference for this status.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Automation status message - to be displayed along with the status_code.", + "optional": true + } + } + }, + { + "name": "source_created_by", "type": "TypeString", - "description": "Action creation time.", + "description": "E-mail address of user who created the Action Playbook Source.", "computed": true }, { - "name": "command_parameter", - "type": "TypeString", - "description": "Schematics job command parameter (playbook-name).", - "optional": true + "name": "playbook_names", + "type": "TypeList", + "description": "Playbook names retrieved from the respository.", + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "source", @@ -137887,27 +142628,6 @@ } } }, - { - "name": "bastion", - "type": "TypeList", - "description": "Describes a bastion resource.", - "optional": true, - "elem": { - "host": { - "name": "host", - "type": "TypeString", - "description": "Reference to the Inventory resource definition.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Bastion Name(Unique).", - "optional": true - } - }, - "max_items": 1 - }, { "name": "bastion_credential", "type": "TypeList", @@ -137975,644 +142695,81 @@ "max_length": { "name": "max_length", "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "optional": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "optional": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "optional": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "optional": true - }, - "options": { - "name": "options", - "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "optional": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "optional": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "optional": true - } - } - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Name of the variable.", - "optional": true - }, - "value": { - "name": "value", - "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "optional": true - } - }, - "max_items": 1 - }, - { - "name": "state", - "type": "TypeList", - "description": "Computed state of the Action.", - "computed": true, - "elem": { - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of automation (workspace or action).", - "optional": true - }, - "status_job_id": { - "name": "status_job_id", - "type": "TypeString", - "description": "Job id reference for this status.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Automation status message - to be displayed along with the status_code.", - "optional": true - } - } - }, - { - "name": "tags", - "type": "TypeList", - "description": "Action tags.", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "location", - "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "options": "eu-de, eu-gb, us-east, us-south", - "optional": true, - "computed": true - }, - { - "name": "source_created_at", - "type": "TypeString", - "description": "Action Playbook Source creation time.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Action updation time.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", - "required": true, - "min_length": 1, - "max_length": 65 - }, - { - "name": "inventory", - "type": "TypeString", - "description": "Target inventory record ID, used by the action or ansible playbook.", - "optional": true - }, - { - "name": "targets_ini", - "type": "TypeString", - "description": "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", - "optional": true - }, - { - "name": "account", - "type": "TypeString", - "description": "Action account ID.", - "computed": true - }, - { - "name": "source_created_by", - "type": "TypeString", - "description": "E-mail address of user who created the Action Playbook Source.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "E-mail address of the user who updated an action.", - "computed": true - }, - { - "name": "source_readme_url", - "type": "TypeString", - "description": "URL of the `README` file, for the source URL.", - "optional": true - } - ], - "ibm_schematics_inventory": [ - { - "name": "inventories_ini", - "type": "TypeString", - "description": "Input inventory of host and host group for the playbook, in the `.ini` file format.", - "optional": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "Email address of user who created the Inventory.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "Email address of user who updated the Inventory.", - "computed": true - }, - { - "name": "resource_group", - "type": "TypeString", - "description": "Resource-group name for the Inventory definition. By default, Inventory definition will be created in Default Resource Group.", - "cloud_data_type": "resource_group", - "optional": true - }, - { - "name": "resource_queries", - "type": "TypeList", - "description": "Input resource query definitions that is used to dynamically generate the inventory of host and host group for the playbook.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "created_at", - "type": "TypeString", - "description": "Inventory creation time.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Inventory updation time.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The unique name of your Inventory definition. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", - "min_length": 3, - "max_length": 64, - "optional": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The description of your Inventory definition. The description can be up to 2048 characters long in size.", - "optional": true - }, - { - "name": "location", - "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "options": "eu-de, eu-gb, us-east, us-south", - "optional": true, - "computed": true - } - ], - "ibm_schematics_job": [ - { - "name": "command_object_id", - "type": "TypeString", - "description": "Job command object id (workspace-id, action-id).", - "required": true - }, - { - "name": "status", - "type": "TypeList", - "description": "Job Status.", - "computed": true, - "elem": { - "action_job_status": { - "name": "action_job_status", - "type": "TypeList", - "description": "Action Job Status.", - "optional": true, - "elem": { - "action_name": { - "name": "action_name", - "type": "TypeString", - "description": "Action name.", - "optional": true - }, - "bastion_status_code": { - "name": "bastion_status_code", - "type": "TypeString", - "description": "Status of Resources.", - "optional": true - }, - "bastion_status_message": { - "name": "bastion_status_message", - "type": "TypeString", - "description": "Bastion status message - to be displayed along with the bastion_status_code;.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Action Job status message - to be displayed along with the action_status_code.", - "optional": true - }, - "targets_status_code": { - "name": "targets_status_code", - "type": "TypeString", - "description": "Status of Resources.", - "optional": true - }, - "targets_status_message": { - "name": "targets_status_message", - "type": "TypeString", - "description": "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - } - } - }, - "flow_job_status": { - "name": "flow_job_status", - "type": "TypeList", - "description": "Environment Flow JOB Status.", - "optional": true, - "elem": { - "flow_id": { - "name": "flow_id", - "type": "TypeString", - "description": "flow id.", - "optional": true - }, - "flow_name": { - "name": "flow_name", - "type": "TypeString", - "description": "flow name.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Flow Job status message - to be displayed along with the status_code;.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - }, - "workitems": { - "name": "workitems", - "type": "TypeList", - "description": "Environment's individual workItem status details;.", - "optional": true, - "elem": { - "job_id": { - "name": "job_id", - "type": "TypeString", - "description": "workspace job id.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "workitem job status message;.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "workitem job status updation timestamp.", - "optional": true - }, - "workspace_id": { - "name": "workspace_id", - "type": "TypeString", - "description": "Workspace id.", - "optional": true - }, - "workspace_name": { - "name": "workspace_name", - "type": "TypeString", - "description": "workspace name.", - "optional": true - } - } - } - }, - "max_items": 1 - }, - "system_job_status": { - "name": "system_job_status", - "type": "TypeList", - "description": "System Job Status.", - "optional": true, - "elem": { - "schematics_resource_status": { - "name": "schematics_resource_status", - "type": "TypeList", - "description": "job staus for each schematics resource.", - "optional": true, - "elem": { - "schematics_resource_id": { - "name": "schematics_resource_id", - "type": "TypeString", - "description": "id for each resource which is targeted as a part of system job.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "system job status message.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - } - } - }, - "system_status_code": { - "name": "system_status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "system_status_message": { - "name": "system_status_message", - "type": "TypeString", - "description": "System job message.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - } - }, - "max_items": 1 - }, - "workspace_job_status": { - "name": "workspace_job_status", - "type": "TypeList", - "description": "Workspace Job Status.", - "optional": true, - "elem": { - "flow_status": { - "name": "flow_status", - "type": "TypeList", - "description": "Environment Flow JOB Status.", - "optional": true, - "elem": { - "flow_id": { - "name": "flow_id", - "type": "TypeString", - "description": "flow id.", - "optional": true - }, - "flow_name": { - "name": "flow_name", - "type": "TypeString", - "description": "flow name.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Flow Job status message - to be displayed along with the status_code;.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - }, - "workitems": { - "name": "workitems", - "type": "TypeList", - "description": "Environment's individual workItem status details;.", - "optional": true, - "elem": { - "job_id": { - "name": "job_id", - "type": "TypeString", - "description": "workspace job id.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "workitem job status message;.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "workitem job status updation timestamp.", - "optional": true - }, - "workspace_id": { - "name": "workspace_id", - "type": "TypeString", - "description": "Workspace id.", - "optional": true - }, - "workspace_name": { - "name": "workspace_name", - "type": "TypeString", - "description": "workspace name.", - "optional": true - } - } - } - }, - "max_items": 1 + "description": "Maximum length of the variable value. Applicable for string type.", + "optional": true }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", "optional": true }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", "optional": true }, - "template_status": { - "name": "template_status", + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "optional": true + }, + "options": { + "name": "options", "type": "TypeList", - "description": "Workspace Flow Template job status.", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", "optional": true, "elem": { - "flow_index": { - "name": "flow_index", - "type": "TypeInt", - "description": "Index of the template in the Flow.", - "optional": true - }, - "status_code": { - "name": "status_code", - "type": "TypeString", - "description": "Status of Jobs.", - "optional": true - }, - "status_message": { - "name": "status_message", - "type": "TypeString", - "description": "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", - "optional": true - }, - "template_id": { - "name": "template_id", - "type": "TypeString", - "description": "Template Id.", - "optional": true - }, - "template_name": { - "name": "template_name", - "type": "TypeString", - "description": "Template name.", - "optional": true - }, - "updated_at": { - "name": "updated_at", - "type": "TypeString", - "description": "Job status updation timestamp.", - "optional": true - } + "type": "TypeString" } }, - "updated_at": { - "name": "updated_at", + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "optional": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "optional": true + }, + "source": { + "name": "source", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Source of this meta-data.", "optional": true }, - "workspace_name": { - "name": "workspace_name", + "type": { + "name": "type", "type": "TypeString", - "description": "Workspace name.", + "description": "Type of the variable.", "optional": true } - }, - "max_items": 1 + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "optional": true } - } - }, - { - "name": "duration", - "type": "TypeString", - "description": "Duration of job execution; example 40 sec.", - "computed": true - }, - { - "name": "results_url", - "type": "TypeString", - "description": "Job results store URL.", - "computed": true - }, - { - "name": "command_name", - "type": "TypeString", - "description": "Schematics job command name.", - "required": true, - "options": "ansible_playbook_check, ansible_playbook_run, create_action, create_cart, create_environment, create_workspace, delete_action, delete_environment, delete_workspace, environment_init, environment_install, environment_uninstall, patch_action, patch_workspace, put_action, put_environment, put_workspace, repository_process, system_key_delete, system_key_disable, system_key_enable, system_key_restore, system_key_rotate, workspace_apply, workspace_destroy, workspace_plan, workspace_refresh" + }, + "max_items": 1 }, { - "name": "job_inputs", + "name": "action_inputs", "type": "TypeList", - "description": "Job inputs used by Action or Workspace.", + "description": "Input variables for the Action.", "optional": true, "elem": { "link": { @@ -138728,7 +142885,7 @@ "name": "type", "type": "TypeString", "description": "Type of the variable.", - "required": true + "optional": true } } }, @@ -138736,386 +142893,902 @@ "name": "name", "type": "TypeString", "description": "Name of the variable.", - "required": true + "optional": true }, "value": { "name": "value", "type": "TypeString", "description": "Value for the variable or reference to the value.", - "required": true + "optional": true } } }, { - "name": "log_summary", + "name": "source_updated_at", + "type": "TypeString", + "description": "The action playbook updation time.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Action updation time.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "E-mail address of the user who updated an action.", + "computed": true + }, + { + "name": "source_readme_url", + "type": "TypeString", + "description": "URL of the `README` file, for the source URL.", + "optional": true + }, + { + "name": "targets_ini", + "type": "TypeString", + "description": "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", + "optional": true + }, + { + "name": "x_github_token", + "type": "TypeString", + "description": "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", + "optional": true + } + ], + "ibm_schematics_agent": [ + { + "name": "name", + "type": "TypeString", + "description": "The name of the agent (must be unique, for an account).", + "required": true + }, + { + "name": "version", + "type": "TypeString", + "description": "Agent version.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "Agent description.", + "optional": true + }, + { + "name": "tags", "type": "TypeList", - "description": "Job log summary record.", + "description": "Tags for the agent.", + "cloud_data_type": "tags", "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The agent creation date-time.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the agent registration.", + "computed": true + }, + { + "name": "recent_prs_job", + "type": "TypeList", + "description": "Run a pre-requisite scanner for deploying agent.", "computed": true, "elem": { - "action_job": { - "name": "action_job", - "type": "TypeList", - "description": "Flow Job log summary.", + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", "optional": true, - "elem": { - "play_count": { - "name": "play_count", - "type": "TypeFloat", - "description": "number of plays in playbook.", - "optional": true, - "computed": true - }, - "recap": { - "name": "recap", - "type": "TypeList", - "description": "Recap records.", - "optional": true, - "elem": { - "changed": { - "name": "changed", - "type": "TypeFloat", - "description": "Number of changed.", - "optional": true - }, - "failed": { - "name": "failed", - "type": "TypeFloat", - "description": "Number of failed.", - "optional": true - }, - "ok": { - "name": "ok", - "type": "TypeFloat", - "description": "Number of OK.", - "optional": true - }, - "skipped": { - "name": "skipped", - "type": "TypeFloat", - "description": "Number of skipped.", - "optional": true - }, - "target": { - "name": "target", - "type": "TypeList", - "description": "List of target or host name.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - "unreachable": { - "name": "unreachable", - "type": "TypeFloat", - "description": "Number of unreachable.", - "optional": true - } - } - }, - "target_count": { - "name": "target_count", - "type": "TypeFloat", - "description": "number of targets or hosts.", - "optional": true, - "computed": true - }, - "task_count": { - "name": "task_count", - "type": "TypeFloat", - "description": "number of tasks in playbook.", - "optional": true, - "computed": true - } - } + "computed": true }, - "elapsed_time": { - "name": "elapsed_time", - "type": "TypeFloat", - "description": "Job log elapsed time (log_analyzed_till - log_start_at).", + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", "optional": true, "computed": true }, - "flow_job": { - "name": "flow_job", + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full pre-requisite scanner job logs.", + "optional": true, + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the pre-requisite scanner job.", + "optional": true, + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the pre-requisite scanner job, in a formatted log string.", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent prs job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent prs job.", + "computed": true + } + } + }, + { + "name": "agent_inputs", + "type": "TypeList", + "description": "Additional input variables for the agent.", + "optional": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "The reference link to the variable value By default the expression points to `$self.value`.", + "computed": true + }, + "metadata": { + "name": "metadata", "type": "TypeList", - "description": "Flow Job log summary.", + "description": "An user editable metadata for the variables.", "optional": true, "elem": { - "workitems": { - "name": "workitems", + "aliases": { + "name": "aliases", "type": "TypeList", + "description": "The list of aliases for the variable name.", "optional": true, "elem": { - "job_id": { - "name": "job_id", - "type": "TypeString", - "description": "workspace JOB ID.", - "optional": true - }, - "log_url": { - "name": "log_url", - "type": "TypeString", - "description": "Log url for job.", - "optional": true - }, - "resources_add": { - "name": "resources_add", - "type": "TypeFloat", - "description": "Number of resources add.", - "optional": true, - "computed": true - }, - "resources_destroy": { - "name": "resources_destroy", - "type": "TypeFloat", - "description": "Number of resources destroy.", - "optional": true, - "computed": true - }, - "resources_modify": { - "name": "resources_modify", - "type": "TypeFloat", - "description": "Number of resources modify.", - "optional": true, - "computed": true - }, - "workspace_id": { - "name": "workspace_id", - "type": "TypeString", - "description": "workspace ID.", - "optional": true - } + "type": "TypeString" } }, - "workitems_completed": { - "name": "workitems_completed", - "type": "TypeFloat", - "description": "Number of workitems completed successfully.", - "optional": true, - "computed": true + "cloud_data_type": { + "name": "cloud_data_type", + "type": "TypeString", + "description": "Cloud data type of the variable. eg. resource_group_id, region, vpc_id.", + "optional": true }, - "workitems_failed": { - "name": "workitems_failed", - "type": "TypeFloat", - "description": "Number of workitems failed.", - "optional": true, - "computed": true + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable only if the override value is not specified.", + "optional": true }, - "workitems_pending": { - "name": "workitems_pending", - "type": "TypeFloat", - "description": "Number of workitems pending in the flow.", + "description": { + "name": "description", + "type": "TypeString", + "description": "The description of the meta data.", + "optional": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "The display name of the group this variable belongs to.", + "optional": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If **true**, the variable is not displayed on UI or Command line.", + "optional": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "optional": true + }, + "link_status": { + "name": "link_status", + "type": "TypeString", + "description": "The status of the link.", + "optional": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "The regex for the variable value.", + "optional": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "The maximum length of the variable value. Applicable for the string type.", + "optional": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "The maximum value of the variable. Applicable for the integer type.", + "optional": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "The minimum length of the variable value. Applicable for the string type.", + "optional": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "The minimum value of the variable. Applicable for the integer type.", + "optional": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime.", "optional": true, - "computed": true + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "The relative position of this variable in a list.", + "optional": true + }, + "required": { + "name": "required", + "type": "TypeBool", + "description": "If the variable required?.", + "optional": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "optional": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "The source of this meta-data.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "optional": true } }, "max_items": 1 }, + "name": { + "name": "name", + "type": "TypeString", + "description": "The name of the variable. For example, `name = \"inventory username\"`.", + "optional": true + }, + "use_default": { + "name": "use_default", + "type": "TypeBool", + "description": "True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used.", + "optional": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "The value for the variable or reference to the value. For example, `value = \"\u003cprovide your ssh_key_value with \n\u003e\"`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls.", + "optional": true + } + } + }, + { + "name": "system_state", + "type": "TypeList", + "description": "Computed state of the agent.", + "computed": true, + "elem": { + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Agent Status.", + "optional": true, + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The agent status message.", + "optional": true, + "computed": true + } + } + }, + { + "name": "recent_deploy_job", + "type": "TypeList", + "description": "Post-installations checks for Agent health.", + "computed": true, + "elem": { + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", + "optional": true, + "computed": true + }, + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "is_redeployed": { + "name": "is_redeployed", + "type": "TypeBool", + "description": "True, when the same version of the agent was redeployed.", + "optional": true, + "computed": true + }, "job_id": { "name": "job_id", "type": "TypeString", - "description": "Workspace Id.", + "description": "Job Id.", "optional": true, "computed": true }, - "job_type": { - "name": "job_type", + "log_url": { + "name": "log_url", "type": "TypeString", - "description": "Type of Job.", - "optional": true + "description": "URL to the full agent deployment job logs.", + "optional": true, + "computed": true }, - "log_analyzed_till": { - "name": "log_analyzed_till", + "status_code": { + "name": "status_code", "type": "TypeString", - "description": "Job log update timestamp.", + "description": "Final result of the agent deployment job.", "optional": true, "computed": true }, - "log_errors": { - "name": "log_errors", + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the agent deployment job, in a formatted log string.", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent deploy job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent deploy job.", + "computed": true + } + } + }, + { + "name": "recent_health_job", + "type": "TypeList", + "description": "Agent health check.", + "computed": true, + "elem": { + "agent_id": { + "name": "agent_id", + "type": "TypeString", + "description": "Id of the agent.", + "optional": true, + "computed": true + }, + "agent_version": { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "optional": true, + "computed": true + }, + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full health-check job logs.", + "optional": true, + "computed": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the health-check job.", + "optional": true, + "computed": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the health-check job, in a formatted log string.", + "optional": true, + "computed": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "The agent health check job updation time.", + "computed": true + }, + "updated_by": { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent health check job.", + "computed": true + } + } + }, + { + "name": "schematics_location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "required": true + }, + { + "name": "agent_infrastructure", + "type": "TypeList", + "description": "The infrastructure parameters used by the agent.", + "required": true, + "elem": { + "cluster_id": { + "name": "cluster_id", + "type": "TypeString", + "description": "The cluster ID where agent services will be running.", + "optional": true + }, + "cluster_resource_group": { + "name": "cluster_resource_group", + "type": "TypeString", + "description": "The resource group of the cluster (is it required?).", + "optional": true + }, + "cos_bucket_name": { + "name": "cos_bucket_name", + "type": "TypeString", + "description": "The COS bucket name used to store the logs.", + "optional": true + }, + "cos_bucket_region": { + "name": "cos_bucket_region", + "type": "TypeString", + "description": "The COS bucket region.", + "optional": true + }, + "cos_instance_name": { + "name": "cos_instance_name", + "type": "TypeString", + "description": "The COS instance name to store the agent logs.", + "optional": true + }, + "infra_type": { + "name": "infra_type", + "type": "TypeString", + "description": "Type of target agent infrastructure.", + "optional": true + } + }, + "max_items": 1, + "min_items": 1 + }, + { + "name": "user_state", + "type": "TypeList", + "description": "User defined status of the agent.", + "optional": true, + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, + { + "name": "agent_kpi", + "type": "TypeList", + "description": "Schematics Agent key performance indicators.", + "optional": true, + "computed": true, + "elem": { + "application_indicators": { + "name": "application_indicators", "type": "TypeList", - "description": "Job log errors.", + "description": "Agent application key performance indicators.", "optional": true, "computed": true, "elem": { - "error_code": { - "name": "error_code", - "type": "TypeString", - "description": "Error code in the Log.", - "optional": true - }, - "error_count": { - "name": "error_count", - "type": "TypeFloat", - "description": "Number of occurrence.", - "optional": true - }, - "error_msg": { - "name": "error_msg", - "type": "TypeString", - "description": "Summary error message in the log.", - "optional": true - } + "type": "TypeMap" } }, - "log_start_at": { - "name": "log_start_at", + "availability_indicator": { + "name": "availability_indicator", "type": "TypeString", - "description": "Job log start timestamp.", + "description": "Overall availability indicator reported by the agent.", "optional": true, "computed": true }, - "repo_download_job": { - "name": "repo_download_job", + "infra_indicators": { + "name": "infra_indicators", "type": "TypeList", - "description": "Repo download Job log summary.", + "description": "Agent infrastructure key performance indicators.", "optional": true, + "computed": true, "elem": { - "detected_filetype": { - "name": "detected_filetype", - "type": "TypeString", - "description": "Detected template or data file type.", - "optional": true, - "computed": true - }, - "inputs_count": { - "name": "inputs_count", - "type": "TypeString", - "description": "Number of inputs detected.", - "optional": true, - "computed": true - }, - "outputs_count": { - "name": "outputs_count", - "type": "TypeString", - "description": "Number of outputs detected.", - "optional": true, - "computed": true - }, - "quarantined_file_count": { - "name": "quarantined_file_count", - "type": "TypeFloat", - "description": "Number of files quarantined.", - "optional": true, - "computed": true - }, - "scanned_file_count": { - "name": "scanned_file_count", - "type": "TypeFloat", - "description": "Number of files scanned.", - "optional": true, - "computed": true - } + "type": "TypeMap" } }, - "system_job": { - "name": "system_job", - "type": "TypeList", - "description": "System Job log summary.", + "lifecycle_indicator": { + "name": "lifecycle_indicator", + "type": "TypeString", + "description": "Overall lifecycle indicator reported by the agents.", "optional": true, - "elem": { - "failed": { - "name": "failed", - "type": "TypeFloat", - "description": "Number of failed.", - "optional": true - }, - "success": { - "name": "success", - "type": "TypeFloat", - "description": "Number of passed.", - "optional": true - }, - "target_count": { - "name": "target_count", - "type": "TypeFloat", - "description": "number of targets or hosts.", - "optional": true, - "computed": true - } - }, - "max_items": 1 + "computed": true }, - "workspace_job": { - "name": "workspace_job", + "percent_usage_indicator": { + "name": "percent_usage_indicator", + "type": "TypeString", + "description": "Percentage usage of the agent resources.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, + { + "name": "creation_by", + "type": "TypeString", + "description": "The email address of an user who created the agent.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The agent registration updation time.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The resource-group name for the agent. By default, agent will be registered in Default Resource Group.", + "cloud_data_type": "resource_group", + "required": true + }, + { + "name": "agent_location", + "type": "TypeString", + "description": "The location where agent is deployed in the user environment.", + "required": true + }, + { + "name": "agent_metadata", + "type": "TypeList", + "description": "The metadata of an agent.", + "optional": true, + "elem": { + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the metadata.", + "optional": true + }, + "value": { + "name": "value", "type": "TypeList", - "description": "Workspace Job log summary.", + "description": "Value of the metadata name.", "optional": true, "elem": { - "resources_add": { - "name": "resources_add", - "type": "TypeFloat", - "description": "Number of resources add.", - "optional": true, - "computed": true - }, - "resources_destroy": { - "name": "resources_destroy", - "type": "TypeFloat", - "description": "Number of resources destroy.", - "optional": true, - "computed": true - }, - "resources_modify": { - "name": "resources_modify", - "type": "TypeFloat", - "description": "Number of resources modify.", - "optional": true, - "computed": true - } - }, - "max_items": 1 + "type": "TypeString" + } } } }, { - "name": "description", + "name": "agent_crn", "type": "TypeString", - "description": "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", + "description": "The agent crn, obtained from the Schematics agent deployment configuration.", + "computed": true + } + ], + "ibm_schematics_agent_deploy": [ + { + "name": "updated_at", + "type": "TypeString", + "description": "The agent deploy job updation time.", "computed": true }, { - "name": "start_at", + "name": "updated_by", "type": "TypeString", - "description": "Job start time.", + "description": "Email address of user who ran the agent deploy job.", "computed": true }, { - "name": "state_store_url", + "name": "is_redeployed", + "type": "TypeBool", + "description": "True, when the same version of the agent was redeployed.", + "computed": true + }, + { + "name": "status_message", "type": "TypeString", - "description": "Job state store URL.", + "description": "The outcome of the agent deployment job, in a formatted log string.", + "computed": true + }, + { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full agent deployment job logs.", + "computed": true + }, + { + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "immutable": true, + "required": true + }, + { + "name": "force", + "type": "TypeBool", + "description": "Equivalent to -force options in the command line, default is false.", + "optional": true + }, + { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the agent deployment job.", + "computed": true + } + ], + "ibm_schematics_agent_health": [ + { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the health-check job, in a formatted log string.", + "computed": true + }, + { + "name": "force", + "type": "TypeBool", + "description": "Equivalent to -force options in the command line, default is false.", + "optional": true + }, + { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent health check job.", + "computed": true + }, + { + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", "computed": true }, + { + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "immutable": true, + "required": true + }, { "name": "updated_at", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "The agent health check job updation time.", "computed": true }, { - "name": "command_parameter", + "name": "status_code", "type": "TypeString", - "description": "Schematics job command parameter (playbook-name).", + "description": "Final result of the health-check job.", + "computed": true + }, + { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full health-check job logs.", + "computed": true + } + ], + "ibm_schematics_agent_prs": [ + { + "name": "force", + "type": "TypeBool", + "description": "Equivalent to -force options in the command line, default is false.", "optional": true }, { - "name": "command_options", + "name": "agent_version", + "type": "TypeString", + "description": "Agent version.", + "computed": true + }, + { + "name": "status_code", + "type": "TypeString", + "description": "Final result of the pre-requisite scanner job.", + "computed": true + }, + { + "name": "log_url", + "type": "TypeString", + "description": "URL to the full pre-requisite scanner job logs.", + "computed": true + }, + { + "name": "agent_id", + "type": "TypeString", + "description": "Agent ID to get the details of agent.", + "immutable": true, + "required": true + }, + { + "name": "job_id", + "type": "TypeString", + "description": "Job Id.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The agent prs job updation time.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who ran the agent prs job.", + "computed": true + }, + { + "name": "status_message", + "type": "TypeString", + "description": "The outcome of the pre-requisite scanner job, in a formatted log string.", + "computed": true + } + ], + "ibm_schematics_inventory": [ + { + "name": "name", + "type": "TypeString", + "description": "The unique name of your Inventory definition. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + "min_length": 3, + "max_length": 64, + "optional": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of your Inventory definition. The description can be up to 2048 characters long in size.", + "optional": true + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "options": "eu-de, eu-gb, us-east, us-south", + "optional": true, + "computed": true + }, + { + "name": "inventories_ini", + "type": "TypeString", + "description": "Input inventory of host and host group for the playbook, in the `.ini` file format.", + "optional": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Inventory updation time.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name for the Inventory definition. By default, Inventory definition will be created in Default Resource Group.", + "cloud_data_type": "resource_group", + "optional": true + }, + { + "name": "resource_queries", "type": "TypeList", - "description": "Command line options for the command.", + "description": "Input resource query definitions that is used to dynamically generate the inventory of host and host group for the playbook.", "optional": true, "elem": { "type": "TypeString" } }, { - "name": "location", + "name": "created_at", "type": "TypeString", - "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - "options": "eu-de, eu-gb, us-east, us-south", - "optional": true, + "description": "Inventory creation time.", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "Email address of user who created the Inventory.", "computed": true }, + { + "name": "updated_by", + "type": "TypeString", + "description": "Email address of user who updated the Inventory.", + "computed": true + } + ], + "ibm_schematics_job": [ { "name": "data", "type": "TypeList", @@ -141190,17 +145863,1096 @@ } } }, - "updated_at": { - "name": "updated_at", + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "Workspace name.", + "optional": true + } + }, + "max_items": 1 + } + } + }, + { + "name": "submitted_at", + "type": "TypeString", + "description": "Job submission time.", + "computed": true + }, + { + "name": "start_at", + "type": "TypeString", + "description": "Job start time.", + "computed": true + }, + { + "name": "results_url", + "type": "TypeString", + "description": "Job results store URL.", + "computed": true + }, + { + "name": "command_options", + "type": "TypeList", + "description": "Command line options for the command.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "job_inputs", + "type": "TypeList", + "description": "Job inputs used by Action or Workspace.", + "optional": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "optional": true, + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "optional": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "optional": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "optional": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "optional": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "optional": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "optional": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "optional": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "optional": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "optional": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "optional": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "optional": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "optional": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "optional": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "required": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "required": true + } + } + }, + { + "name": "tags", + "type": "TypeList", + "description": "User defined tags, while running the job.", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "options": "eu-de, eu-gb, us-east, us-south", + "optional": true, + "computed": true + }, + { + "name": "bastion", + "type": "TypeList", + "description": "Describes a bastion resource.", + "optional": true, + "elem": { + "host": { + "name": "host", + "type": "TypeString", + "description": "Reference to the Inventory resource definition.", + "optional": true + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Bastion Name(Unique).", + "optional": true + } + }, + "max_items": 1 + }, + { + "name": "duration", + "type": "TypeString", + "description": "Duration of job execution; example 40 sec.", + "computed": true + }, + { + "name": "state_store_url", + "type": "TypeString", + "description": "Job state store URL.", + "computed": true + }, + { + "name": "command_name", + "type": "TypeString", + "description": "Schematics job command name.", + "required": true, + "options": "ansible_playbook_check, ansible_playbook_run, create_action, create_cart, create_environment, create_workspace, delete_action, delete_environment, delete_workspace, environment_init, environment_install, environment_uninstall, patch_action, patch_workspace, put_action, put_environment, put_workspace, repository_process, system_key_delete, system_key_disable, system_key_enable, system_key_restore, system_key_rotate, workspace_apply, workspace_destroy, workspace_plan, workspace_refresh" + }, + { + "name": "command_parameter", + "type": "TypeString", + "description": "Schematics job command parameter (playbook-name).", + "optional": true + }, + { + "name": "status", + "type": "TypeList", + "description": "Job Status.", + "computed": true, + "elem": { + "action_job_status": { + "name": "action_job_status", + "type": "TypeList", + "description": "Action Job Status.", + "optional": true, + "elem": { + "action_name": { + "name": "action_name", + "type": "TypeString", + "description": "Action name.", + "optional": true + }, + "bastion_status_code": { + "name": "bastion_status_code", + "type": "TypeString", + "description": "Status of Resources.", + "optional": true + }, + "bastion_status_message": { + "name": "bastion_status_message", + "type": "TypeString", + "description": "Bastion status message - to be displayed along with the bastion_status_code;.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Action Job status message - to be displayed along with the action_status_code.", + "optional": true + }, + "targets_status_code": { + "name": "targets_status_code", + "type": "TypeString", + "description": "Status of Resources.", + "optional": true + }, + "targets_status_message": { + "name": "targets_status_message", + "type": "TypeString", + "description": "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + } + } + }, + "flow_job_status": { + "name": "flow_job_status", + "type": "TypeList", + "description": "Environment Flow JOB Status.", + "optional": true, + "elem": { + "flow_id": { + "name": "flow_id", + "type": "TypeString", + "description": "flow id.", + "optional": true + }, + "flow_name": { + "name": "flow_name", + "type": "TypeString", + "description": "flow name.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Flow Job status message - to be displayed along with the status_code;.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + }, + "workitems": { + "name": "workitems", + "type": "TypeList", + "description": "Environment's individual workItem status details;.", + "optional": true, + "elem": { + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "workspace job id.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "workitem job status message;.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "workitem job status updation timestamp.", + "optional": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "TypeString", + "description": "Workspace id.", + "optional": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "workspace name.", + "optional": true + } + } + } + }, + "max_items": 1 + }, + "system_job_status": { + "name": "system_job_status", + "type": "TypeList", + "description": "System Job Status.", + "optional": true, + "elem": { + "schematics_resource_status": { + "name": "schematics_resource_status", + "type": "TypeList", + "description": "job staus for each schematics resource.", + "optional": true, + "elem": { + "schematics_resource_id": { + "name": "schematics_resource_id", + "type": "TypeString", + "description": "id for each resource which is targeted as a part of system job.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "system job status message.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + } + } + }, + "system_status_code": { + "name": "system_status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "system_status_message": { + "name": "system_status_message", + "type": "TypeString", + "description": "System job message.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + } + }, + "max_items": 1 + }, + "workspace_job_status": { + "name": "workspace_job_status", + "type": "TypeList", + "description": "Workspace Job Status.", + "optional": true, + "elem": { + "flow_status": { + "name": "flow_status", + "type": "TypeList", + "description": "Environment Flow JOB Status.", + "optional": true, + "elem": { + "flow_id": { + "name": "flow_id", + "type": "TypeString", + "description": "flow id.", + "optional": true + }, + "flow_name": { + "name": "flow_name", + "type": "TypeString", + "description": "flow name.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Flow Job status message - to be displayed along with the status_code;.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + }, + "workitems": { + "name": "workitems", + "type": "TypeList", + "description": "Environment's individual workItem status details;.", + "optional": true, + "elem": { + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "workspace job id.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "workitem job status message;.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "workitem job status updation timestamp.", + "optional": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "TypeString", + "description": "Workspace id.", + "optional": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "workspace name.", + "optional": true + } + } + } + }, + "max_items": 1 + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", + "optional": true + }, + "template_status": { + "name": "template_status", + "type": "TypeList", + "description": "Workspace Flow Template job status.", + "optional": true, + "elem": { + "flow_index": { + "name": "flow_index", + "type": "TypeInt", + "description": "Index of the template in the Flow.", + "optional": true + }, + "status_code": { + "name": "status_code", + "type": "TypeString", + "description": "Status of Jobs.", + "optional": true + }, + "status_message": { + "name": "status_message", + "type": "TypeString", + "description": "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", + "optional": true + }, + "template_id": { + "name": "template_id", + "type": "TypeString", + "description": "Template Id.", + "optional": true + }, + "template_name": { + "name": "template_name", + "type": "TypeString", + "description": "Template name.", + "optional": true + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + } + } + }, + "updated_at": { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "optional": true + }, + "workspace_name": { + "name": "workspace_name", + "type": "TypeString", + "description": "Workspace name.", + "optional": true + } + }, + "max_items": 1 + } + } + }, + { + "name": "name", + "type": "TypeString", + "description": "Job name, uniquely derived from the related Workspace or Action.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "Resource-group name derived from the related Workspace or Action.", + "cloud_data_type": "resource_group", + "computed": true + }, + { + "name": "submitted_by", + "type": "TypeString", + "description": "Email address of user who submitted the job.", + "computed": true + }, + { + "name": "command_object_id", + "type": "TypeString", + "description": "Job command object id (workspace-id, action-id).", + "required": true + }, + { + "name": "job_env_settings", + "type": "TypeList", + "description": "Environment variables used by the Job while performing Action or Workspace.", + "optional": true, + "elem": { + "link": { + "name": "link", + "type": "TypeString", + "description": "Reference link to the variable value By default the expression will point to self.value.", + "optional": true, + "computed": true + }, + "metadata": { + "name": "metadata", + "type": "TypeList", + "description": "User editable metadata for the variables.", + "optional": true, + "elem": { + "aliases": { + "name": "aliases", + "type": "TypeList", + "description": "List of aliases for the variable name.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "default_value": { + "name": "default_value", + "type": "TypeString", + "description": "Default value for the variable, if the override value is not specified.", + "optional": true + }, + "description": { + "name": "description", + "type": "TypeString", + "description": "Description of the meta data.", + "optional": true + }, + "group_by": { + "name": "group_by", + "type": "TypeString", + "description": "Display name of the group this variable belongs to.", + "optional": true + }, + "hidden": { + "name": "hidden", + "type": "TypeBool", + "description": "If true, the variable will not be displayed on UI or CLI.", + "optional": true + }, + "immutable": { + "name": "immutable", + "type": "TypeBool", + "description": "Is the variable readonly ?.", + "optional": true + }, + "matches": { + "name": "matches", + "type": "TypeString", + "description": "Regex for the variable value.", + "optional": true + }, + "max_length": { + "name": "max_length", + "type": "TypeInt", + "description": "Maximum length of the variable value. Applicable for string type.", + "optional": true + }, + "max_value": { + "name": "max_value", + "type": "TypeInt", + "description": "Maximum value of the variable. Applicable for integer type.", + "optional": true + }, + "min_length": { + "name": "min_length", + "type": "TypeInt", + "description": "Minimum length of the variable value. Applicable for string type.", + "optional": true + }, + "min_value": { + "name": "min_value", + "type": "TypeInt", + "description": "Minimum value of the variable. Applicable for integer type.", + "optional": true + }, + "options": { + "name": "options", + "type": "TypeList", + "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "position": { + "name": "position", + "type": "TypeInt", + "description": "Relative position of this variable in a list.", + "optional": true + }, + "secure": { + "name": "secure", + "type": "TypeBool", + "description": "Is the variable secure or sensitive ?.", + "optional": true + }, + "source": { + "name": "source", + "type": "TypeString", + "description": "Source of this meta-data.", + "optional": true + }, + "type": { + "name": "type", + "type": "TypeString", + "description": "Type of the variable.", + "required": true + } + } + }, + "name": { + "name": "name", + "type": "TypeString", + "description": "Name of the variable.", + "required": true + }, + "value": { + "name": "value", + "type": "TypeString", + "description": "Value for the variable or reference to the value.", + "required": true + } + } + }, + { + "name": "log_summary", + "type": "TypeList", + "description": "Job log summary record.", + "optional": true, + "computed": true, + "elem": { + "action_job": { + "name": "action_job", + "type": "TypeList", + "description": "Flow Job log summary.", + "optional": true, + "elem": { + "play_count": { + "name": "play_count", + "type": "TypeFloat", + "description": "number of plays in playbook.", + "optional": true, + "computed": true + }, + "recap": { + "name": "recap", + "type": "TypeList", + "description": "Recap records.", + "optional": true, + "elem": { + "changed": { + "name": "changed", + "type": "TypeFloat", + "description": "Number of changed.", + "optional": true + }, + "failed": { + "name": "failed", + "type": "TypeFloat", + "description": "Number of failed.", + "optional": true + }, + "ok": { + "name": "ok", + "type": "TypeFloat", + "description": "Number of OK.", + "optional": true + }, + "skipped": { + "name": "skipped", + "type": "TypeFloat", + "description": "Number of skipped.", + "optional": true + }, + "target": { + "name": "target", + "type": "TypeList", + "description": "List of target or host name.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + "unreachable": { + "name": "unreachable", + "type": "TypeFloat", + "description": "Number of unreachable.", + "optional": true + } + } + }, + "target_count": { + "name": "target_count", + "type": "TypeFloat", + "description": "number of targets or hosts.", + "optional": true, + "computed": true + }, + "task_count": { + "name": "task_count", + "type": "TypeFloat", + "description": "number of tasks in playbook.", + "optional": true, + "computed": true + } + } + }, + "elapsed_time": { + "name": "elapsed_time", + "type": "TypeFloat", + "description": "Job log elapsed time (log_analyzed_till - log_start_at).", + "optional": true, + "computed": true + }, + "flow_job": { + "name": "flow_job", + "type": "TypeList", + "description": "Flow Job log summary.", + "optional": true, + "elem": { + "workitems": { + "name": "workitems", + "type": "TypeList", + "optional": true, + "elem": { + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "workspace JOB ID.", + "optional": true + }, + "log_url": { + "name": "log_url", + "type": "TypeString", + "description": "Log url for job.", + "optional": true + }, + "resources_add": { + "name": "resources_add", + "type": "TypeFloat", + "description": "Number of resources add.", + "optional": true, + "computed": true + }, + "resources_destroy": { + "name": "resources_destroy", + "type": "TypeFloat", + "description": "Number of resources destroy.", + "optional": true, + "computed": true + }, + "resources_modify": { + "name": "resources_modify", + "type": "TypeFloat", + "description": "Number of resources modify.", + "optional": true, + "computed": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "TypeString", + "description": "workspace ID.", + "optional": true + } + } + }, + "workitems_completed": { + "name": "workitems_completed", + "type": "TypeFloat", + "description": "Number of workitems completed successfully.", + "optional": true, + "computed": true + }, + "workitems_failed": { + "name": "workitems_failed", + "type": "TypeFloat", + "description": "Number of workitems failed.", + "optional": true, + "computed": true + }, + "workitems_pending": { + "name": "workitems_pending", + "type": "TypeFloat", + "description": "Number of workitems pending in the flow.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, + "job_id": { + "name": "job_id", + "type": "TypeString", + "description": "Workspace Id.", + "optional": true, + "computed": true + }, + "job_type": { + "name": "job_type", + "type": "TypeString", + "description": "Type of Job.", + "optional": true + }, + "log_analyzed_till": { + "name": "log_analyzed_till", + "type": "TypeString", + "description": "Job log update timestamp.", + "optional": true, + "computed": true + }, + "log_errors": { + "name": "log_errors", + "type": "TypeList", + "description": "Job log errors.", + "optional": true, + "computed": true, + "elem": { + "error_code": { + "name": "error_code", "type": "TypeString", - "description": "Job status updation timestamp.", + "description": "Error code in the Log.", "optional": true }, - "workspace_name": { - "name": "workspace_name", + "error_count": { + "name": "error_count", + "type": "TypeFloat", + "description": "Number of occurrence.", + "optional": true + }, + "error_msg": { + "name": "error_msg", "type": "TypeString", - "description": "Workspace name.", + "description": "Summary error message in the log.", + "optional": true + } + } + }, + "log_start_at": { + "name": "log_start_at", + "type": "TypeString", + "description": "Job log start timestamp.", + "optional": true, + "computed": true + }, + "repo_download_job": { + "name": "repo_download_job", + "type": "TypeList", + "description": "Repo download Job log summary.", + "optional": true, + "elem": { + "detected_filetype": { + "name": "detected_filetype", + "type": "TypeString", + "description": "Detected template or data file type.", + "optional": true, + "computed": true + }, + "inputs_count": { + "name": "inputs_count", + "type": "TypeString", + "description": "Number of inputs detected.", + "optional": true, + "computed": true + }, + "outputs_count": { + "name": "outputs_count", + "type": "TypeString", + "description": "Number of outputs detected.", + "optional": true, + "computed": true + }, + "quarantined_file_count": { + "name": "quarantined_file_count", + "type": "TypeFloat", + "description": "Number of files quarantined.", + "optional": true, + "computed": true + }, + "scanned_file_count": { + "name": "scanned_file_count", + "type": "TypeFloat", + "description": "Number of files scanned.", + "optional": true, + "computed": true + } + } + }, + "system_job": { + "name": "system_job", + "type": "TypeList", + "description": "System Job log summary.", + "optional": true, + "elem": { + "failed": { + "name": "failed", + "type": "TypeFloat", + "description": "Number of failed.", + "optional": true + }, + "success": { + "name": "success", + "type": "TypeFloat", + "description": "Number of passed.", "optional": true + }, + "target_count": { + "name": "target_count", + "type": "TypeFloat", + "description": "number of targets or hosts.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, + "workspace_job": { + "name": "workspace_job", + "type": "TypeList", + "description": "Workspace Job log summary.", + "optional": true, + "elem": { + "resources_add": { + "name": "resources_add", + "type": "TypeFloat", + "description": "Number of resources add.", + "optional": true, + "computed": true + }, + "resources_destroy": { + "name": "resources_destroy", + "type": "TypeFloat", + "description": "Number of resources destroy.", + "optional": true, + "computed": true + }, + "resources_modify": { + "name": "resources_modify", + "type": "TypeFloat", + "description": "Number of resources modify.", + "optional": true, + "computed": true } }, "max_items": 1 @@ -141208,16 +146960,15 @@ } }, { - "name": "name", + "name": "description", "type": "TypeString", - "description": "Job name, uniquely derived from the related Workspace or Action.", + "description": "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", "computed": true }, { - "name": "resource_group", + "name": "end_at", "type": "TypeString", - "description": "Resource-group name derived from the related Workspace or Action.", - "cloud_data_type": "resource_group", + "description": "Job end time.", "computed": true }, { @@ -141226,154 +146977,207 @@ "description": "Job log store URL.", "computed": true }, + { + "name": "updated_at", + "type": "TypeString", + "description": "Job status updation timestamp.", + "computed": true + }, { "name": "command_object", "type": "TypeString", "description": "Name of the Schematics automation resource.", "required": true, "options": "action, environment, system, workspace" + } + ], + "ibm_schematics_policy": [ + { + "name": "name", + "type": "TypeString", + "description": "Name of Schematics customization policy.", + "required": true }, { - "name": "job_env_settings", + "name": "crn", + "type": "TypeString", + "description": "The policy CRN.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user who created the policy.", + "computed": true + }, + { + "name": "location", + "type": "TypeString", + "description": "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + "cloud_data_type": "region", + "optional": true, + "computed": true + }, + { + "name": "kind", + "type": "TypeString", + "description": "Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution.", + "options": "agent_assignment_policy", + "optional": true + }, + { + "name": "target", "type": "TypeList", - "description": "Environment variables used by the Job while performing Action or Workspace.", + "description": "The objects for the Schematics policy.", "optional": true, + "computed": true, "elem": { - "link": { - "name": "link", + "selector_ids": { + "name": "selector_ids", + "type": "TypeList", + "description": "Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "selector_kind": { + "name": "selector_kind", "type": "TypeString", - "description": "Reference link to the variable value By default the expression will point to self.value.", + "description": "Types of schematics object selector.", "optional": true, "computed": true }, - "metadata": { - "name": "metadata", + "selector_scope": { + "name": "selector_scope", "type": "TypeList", - "description": "User editable metadata for the variables.", + "description": "Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy.", "optional": true, + "computed": true, "elem": { - "aliases": { - "name": "aliases", + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "optional": true, + "computed": true + }, + "locations": { + "name": "locations", "type": "TypeList", - "description": "List of aliases for the variable name.", + "description": "The location based selector.", "optional": true, + "computed": true, "elem": { "type": "TypeString" } }, - "default_value": { - "name": "default_value", - "type": "TypeString", - "description": "Default value for the variable, if the override value is not specified.", - "optional": true - }, - "description": { - "name": "description", - "type": "TypeString", - "description": "Description of the meta data.", - "optional": true - }, - "group_by": { - "name": "group_by", - "type": "TypeString", - "description": "Display name of the group this variable belongs to.", - "optional": true - }, - "hidden": { - "name": "hidden", - "type": "TypeBool", - "description": "If true, the variable will not be displayed on UI or CLI.", - "optional": true - }, - "immutable": { - "name": "immutable", - "type": "TypeBool", - "description": "Is the variable readonly ?.", - "optional": true - }, - "matches": { - "name": "matches", - "type": "TypeString", - "description": "Regex for the variable value.", - "optional": true - }, - "max_length": { - "name": "max_length", - "type": "TypeInt", - "description": "Maximum length of the variable value. Applicable for string type.", - "optional": true - }, - "max_value": { - "name": "max_value", - "type": "TypeInt", - "description": "Maximum value of the variable. Applicable for integer type.", - "optional": true - }, - "min_length": { - "name": "min_length", - "type": "TypeInt", - "description": "Minimum length of the variable value. Applicable for string type.", - "optional": true - }, - "min_value": { - "name": "min_value", - "type": "TypeInt", - "description": "Minimum value of the variable. Applicable for integer type.", - "optional": true - }, - "options": { - "name": "options", + "resource_groups": { + "name": "resource_groups", "type": "TypeList", - "description": "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", + "description": "The resource group based selector.", "optional": true, + "computed": true, "elem": { "type": "TypeString" } }, - "position": { - "name": "position", - "type": "TypeInt", - "description": "Relative position of this variable in a list.", - "optional": true - }, - "secure": { - "name": "secure", - "type": "TypeBool", - "description": "Is the variable secure or sensitive ?.", - "optional": true - }, - "source": { - "name": "source", - "type": "TypeString", - "description": "Source of this meta-data.", - "optional": true - }, - "type": { - "name": "type", - "type": "TypeString", - "description": "Type of the variable.", - "required": true + "tags": { + "name": "tags", + "type": "TypeList", + "description": "The tag based selector.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } } } - }, - "name": { - "name": "name", + } + }, + "max_items": 1 + }, + { + "name": "scoped_resources", + "type": "TypeList", + "description": "List of scoped Schematics resources targeted by the policy.", + "optional": true, + "elem": { + "id": { + "name": "id", "type": "TypeString", - "description": "Name of the variable.", - "required": true + "description": "Schematics resource Id.", + "optional": true }, - "value": { - "name": "value", + "kind": { + "name": "kind", "type": "TypeString", - "description": "Value for the variable or reference to the value.", - "required": true + "description": "Name of the Schematics automation resource.", + "optional": true } } }, + { + "name": "account", + "type": "TypeString", + "description": "The Account id.", + "computed": true + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The resource group name for the policy. By default, Policy will be created in `default` Resource Group.", + "cloud_data_type": "resource_group", + "optional": true, + "computed": true + }, + { + "name": "state", + "type": "TypeList", + "description": "User defined status of the Schematics object.", + "optional": true, + "computed": true, + "elem": { + "set_at": { + "name": "set_at", + "type": "TypeString", + "description": "When the User who set the state of the Object.", + "computed": true + }, + "set_by": { + "name": "set_by", + "type": "TypeString", + "description": "Name of the User who set the state of the Object.", + "computed": true + }, + "state": { + "name": "state", + "type": "TypeString", + "description": "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", + "optional": true, + "computed": true + } + }, + "max_items": 1 + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The policy updation time.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "The description of Schematics customization policy.", + "optional": true + }, { "name": "tags", "type": "TypeList", - "description": "User defined tags, while running the job.", + "description": "Tags for the Schematics customization policy.", "cloud_data_type": "tags", "optional": true, "elem": { @@ -141381,46 +147185,114 @@ } }, { - "name": "bastion", + "name": "parameter", "type": "TypeList", - "description": "Describes a bastion resource.", + "description": "The parameter to tune the Schematics policy.", "optional": true, + "computed": true, "elem": { - "host": { - "name": "host", - "type": "TypeString", - "description": "Reference to the Inventory resource definition.", - "optional": true - }, - "name": { - "name": "name", - "type": "TypeString", - "description": "Bastion Name(Unique).", - "optional": true + "agent_assignment_policy_parameter": { + "name": "agent_assignment_policy_parameter", + "type": "TypeList", + "description": "Parameters for the `agent_assignment_policy`.", + "optional": true, + "computed": true, + "elem": { + "selector_ids": { + "name": "selector_ids", + "type": "TypeList", + "description": "The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "selector_kind": { + "name": "selector_kind", + "type": "TypeString", + "description": "Types of schematics object selector.", + "optional": true, + "computed": true + }, + "selector_scope": { + "name": "selector_scope", + "type": "TypeList", + "description": "The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy.", + "optional": true, + "computed": true, + "elem": { + "kind": { + "name": "kind", + "type": "TypeString", + "description": "Name of the Schematics automation resource.", + "optional": true, + "computed": true + }, + "locations": { + "name": "locations", + "type": "TypeList", + "description": "The location based selector.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "resource_groups": { + "name": "resource_groups", + "type": "TypeList", + "description": "The resource group based selector.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + "tags": { + "name": "tags", + "type": "TypeList", + "description": "The tag based selector.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + } + } + } + }, + "max_items": 1 } }, "max_items": 1 }, { - "name": "submitted_at", + "name": "created_at", "type": "TypeString", - "description": "Job submission time.", + "description": "The policy creation time.", + "computed": true + } + ], + "ibm_schematics_resource_query": [ + { + "name": "created_by", + "type": "TypeString", + "description": "Email address of user who created the Resource query.", "computed": true }, { - "name": "submitted_by", + "name": "updated_at", "type": "TypeString", - "description": "Email address of user who submitted the job.", + "description": "Resource query updation time.", "computed": true }, { - "name": "end_at", + "name": "updated_by", "type": "TypeString", - "description": "Job end time.", + "description": "Email address of user who updated the Resource query.", "computed": true - } - ], - "ibm_schematics_resource_query": [ + }, { "name": "type", "type": "TypeString", @@ -141494,111 +147366,146 @@ "type": "TypeString", "description": "Resource query creation time.", "computed": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "Email address of user who created the Resource query.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "Resource query updation time.", - "computed": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "Email address of user who updated the Resource query.", - "computed": true } ], "ibm_schematics_workspace": [ { - "name": "location", + "name": "x_github_token", "type": "TypeString", - "description": "The location where you want to create your Schematics workspace and run the Schematics jobs. The location that you enter must match the API endpoint that you use. For example, if you use the Frankfurt API endpoint, you must specify `eu-de` as your location. If you use an API endpoint for a geography and you do not specify a location, Schematics determines the location based on availability.", - "cloud_data_type": "region", - "optional": true, - "computed": true + "description": "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", + "optional": true }, { - "name": "shared_data", + "name": "runtime_data", "type": "TypeList", - "description": "Information about the Target used by the templates originating from the IBM Cloud catalog offerings. This information is not relevant for workspace created using your own Terraform template.", - "optional": true, + "description": "Information about the provisioning engine, state file, and runtime logs.", + "computed": true, "elem": { - "cluster_created_on": { - "name": "cluster_created_on", + "engine_cmd": { + "name": "engine_cmd", "type": "TypeString", - "description": "Cluster created on.", + "description": "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", "optional": true }, - "cluster_id": { - "name": "cluster_id", + "engine_name": { + "name": "engine_name", "type": "TypeString", - "description": "The ID of the cluster where you want to provision the resources of all IBM Cloud catalog templates that are included in the catalog offering.", + "description": "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", "optional": true }, - "cluster_name": { - "name": "cluster_name", + "engine_version": { + "name": "engine_version", "type": "TypeString", - "description": "The cluster name.", + "description": "The version of the provisioning engine that was used.", "optional": true }, - "cluster_type": { - "name": "cluster_type", + "id": { + "name": "id", "type": "TypeString", - "description": "The cluster type.", + "description": "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", "optional": true }, - "entitlement_keys": { - "name": "entitlement_keys", + "log_store_url": { + "name": "log_store_url", + "type": "TypeString", + "description": "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", + "optional": true + }, + "output_values": { + "name": "output_values", "type": "TypeList", - "description": "The entitlement key that you want to use to install IBM Cloud entitled software.", + "description": "List of Output values.", "optional": true, "elem": { "type": "TypeMap" } }, - "namespace": { - "name": "namespace", - "type": "TypeString", - "description": "The Kubernetes namespace or OpenShift project where the resources of all IBM Cloud catalog templates that are included in the catalog offering are deployed into.", - "optional": true - }, - "region": { - "name": "region", - "type": "TypeString", - "description": "The IBM Cloud region that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", - "optional": true - }, - "resource_group_id": { - "name": "resource_group_id", - "type": "TypeString", - "description": "The ID of the resource group that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", - "optional": true - }, - "worker_count": { - "name": "worker_count", - "type": "TypeInt", - "description": "The cluster worker count.", - "optional": true + "resources": { + "name": "resources", + "type": "TypeList", + "description": "List of resources.", + "optional": true, + "elem": { + "type": "TypeMap" + } }, - "worker_machine_type": { - "name": "worker_machine_type", + "state_store_url": { + "name": "state_store_url", "type": "TypeString", - "description": "The cluster worker type.", + "description": "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", "optional": true } - }, - "max_items": 1 + } }, { - "name": "template_git_folder", + "name": "template_init_state_file", "type": "TypeString", - "description": "The subfolder in your GitHub or GitLab repository where your Terraform template is stored.", + "description": "The content of an existing Terraform statefile that you want to import in to your workspace. To get the content of a Terraform statefile for a specific Terraform template in an existing workspace, run `ibmcloud schematics state pull --id \u003cworkspace_id\u003e --template \u003ctemplate_id\u003e`.", + "optional": true + }, + { + "name": "template_git_repo_sha_value", + "type": "TypeString", + "description": "The repository SHA value.", + "optional": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The timestamp when the workspace was last updated.", + "computed": true + }, + { + "name": "updated_by", + "type": "TypeString", + "description": "The user ID that updated the workspace.", + "computed": true + }, + { + "name": "template_git_release", + "type": "TypeString", + "description": "The repository release.", + "optional": true + }, + { + "name": "locked", + "type": "TypeBool", + "description": "If set to true, the workspace is locked and disabled for changes.", + "optional": true, + "computed": true + }, + { + "name": "template_values", + "type": "TypeString", + "description": "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", + "optional": true + }, + { + "name": "template_git_url", + "type": "TypeString", + "description": "The source URL.", + "optional": true + }, + { + "name": "last_health_check_at", + "type": "TypeString", + "description": "The timestamp when the last health check was performed by Schematics.", + "computed": true + }, + { + "name": "applied_shareddata_ids", + "type": "TypeList", + "description": "List of applied shared dataset ID.", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_group", + "type": "TypeString", + "description": "The ID of the resource group where you want to provision the workspace.", + "cloud_data_type": "resource_group", "optional": true }, { @@ -141614,10 +147521,53 @@ "optional": true }, { - "name": "crn", + "name": "frozen_at", "type": "TypeString", - "description": "The workspace CRN.", - "cloud_data_type": "crn", + "description": "The timestamp when the workspace was frozen.", + "optional": true + }, + { + "name": "status_code", + "type": "TypeString", + "description": "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", + "computed": true + }, + { + "name": "template_git_folder", + "type": "TypeString", + "description": "The subfolder in your GitHub or GitLab repository where your Terraform template is stored.", + "optional": true + }, + { + "name": "template_uninstall_script_name", + "type": "TypeString", + "description": "Uninstall script name.", + "optional": true + }, + { + "name": "frozen_by", + "type": "TypeString", + "description": "The user ID that froze the workspace.", + "optional": true + }, + { + "name": "locked_by", + "type": "TypeString", + "description": "The user ID that initiated a resource-related action, such as applying or destroying resources, that locked the workspace.", + "optional": true, + "computed": true + }, + { + "name": "locked_time", + "type": "TypeString", + "description": "The timestamp when the workspace was locked.", + "optional": true, + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The timestamp when the workspace was created.", "computed": true }, { @@ -141684,13 +147634,88 @@ "max_items": 1 }, { - "name": "name", + "name": "template_ref", "type": "TypeString", - "description": "The name of your workspace. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. When you create a workspace for your own Terraform template, consider including the microservice component that you set up with your Terraform template and the IBM Cloud environment where you want to deploy your resources in your name.", - "required": true, - "min_length": 1, - "max_length": 128, - "matches": "^[a-zA-Z0-9][a-zA-Z0-9-_ ]*$" + "description": "Workspace template ref.", + "optional": true + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The user ID that created the workspace.", + "computed": true + }, + { + "name": "shared_data", + "type": "TypeList", + "description": "Information about the Target used by the templates originating from the IBM Cloud catalog offerings. This information is not relevant for workspace created using your own Terraform template.", + "optional": true, + "elem": { + "cluster_created_on": { + "name": "cluster_created_on", + "type": "TypeString", + "description": "Cluster created on.", + "optional": true + }, + "cluster_id": { + "name": "cluster_id", + "type": "TypeString", + "description": "The ID of the cluster where you want to provision the resources of all IBM Cloud catalog templates that are included in the catalog offering.", + "optional": true + }, + "cluster_name": { + "name": "cluster_name", + "type": "TypeString", + "description": "The cluster name.", + "optional": true + }, + "cluster_type": { + "name": "cluster_type", + "type": "TypeString", + "description": "The cluster type.", + "optional": true + }, + "entitlement_keys": { + "name": "entitlement_keys", + "type": "TypeList", + "description": "The entitlement key that you want to use to install IBM Cloud entitled software.", + "optional": true, + "elem": { + "type": "TypeMap" + } + }, + "namespace": { + "name": "namespace", + "type": "TypeString", + "description": "The Kubernetes namespace or OpenShift project where the resources of all IBM Cloud catalog templates that are included in the catalog offering are deployed into.", + "optional": true + }, + "region": { + "name": "region", + "type": "TypeString", + "description": "The IBM Cloud region that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", + "optional": true + }, + "resource_group_id": { + "name": "resource_group_id", + "type": "TypeString", + "description": "The ID of the resource group that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", + "optional": true + }, + "worker_count": { + "name": "worker_count", + "type": "TypeInt", + "description": "The cluster worker count.", + "optional": true + }, + "worker_machine_type": { + "name": "worker_machine_type", + "type": "TypeString", + "description": "The cluster worker type.", + "optional": true + } + }, + "max_items": 1 }, { "name": "tags", @@ -141702,37 +147727,6 @@ "type": "TypeString" } }, - { - "name": "template_init_state_file", - "type": "TypeString", - "description": "The content of an existing Terraform statefile that you want to import in to your workspace. To get the content of a Terraform statefile for a specific Terraform template in an existing workspace, run `ibmcloud schematics state pull --id \u003cworkspace_id\u003e --template \u003ctemplate_id\u003e`.", - "optional": true - }, - { - "name": "frozen_at", - "type": "TypeString", - "description": "The timestamp when the workspace was frozen.", - "optional": true - }, - { - "name": "updated_by", - "type": "TypeString", - "description": "The user ID that updated the workspace.", - "computed": true - }, - { - "name": "status_msg", - "type": "TypeString", - "description": "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", - "computed": true - }, - { - "name": "description", - "type": "TypeString", - "description": "The description of the workspace.", - "max_length": 2048, - "optional": true - }, { "name": "template_values_metadata", "type": "TypeList", @@ -141862,102 +147856,6 @@ } } }, - { - "name": "locked_by", - "type": "TypeString", - "description": "The user ID that initiated a resource-related action, such as applying or destroying resources, that locked the workspace.", - "optional": true, - "computed": true - }, - { - "name": "last_health_check_at", - "type": "TypeString", - "description": "The timestamp when the last health check was performed by Schematics.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The timestamp when the workspace was last updated.", - "computed": true - }, - { - "name": "template_type", - "type": "TypeString", - "description": "The Terraform version that you want to use to run your Terraform code. Enter `terraform_v0.12` to use Terraform version 0.12, and `terraform_v0.11` to use Terraform version 0.11. The Terraform config files are run with Terraform version 0.11. This is a required variable. Make sure that your Terraform config files are compatible with the Terraform version that you select.", - "required": true, - "matches": "^terraform_v(?:0\\.11|0\\.12|0\\.13|0\\.14|0\\.15|1\\.0|1\\.1|1\\.2|1\\.3|1\\.4)(?:\\.\\d+)?$" - }, - { - "name": "locked", - "type": "TypeBool", - "description": "If set to true, the workspace is locked and disabled for changes.", - "optional": true, - "computed": true - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The timestamp when the workspace was created.", - "computed": true - }, - { - "name": "template_git_release", - "type": "TypeString", - "description": "The repository release.", - "optional": true - }, - { - "name": "template_git_url", - "type": "TypeString", - "description": "The source URL.", - "optional": true - }, - { - "name": "frozen", - "type": "TypeBool", - "description": "If set to true, the workspace is frozen and changes to the workspace are disabled.", - "optional": true - }, - { - "name": "status_code", - "type": "TypeString", - "description": "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", - "computed": true - }, - { - "name": "template_uninstall_script_name", - "type": "TypeString", - "description": "Uninstall script name.", - "optional": true - }, - { - "name": "frozen_by", - "type": "TypeString", - "description": "The user ID that froze the workspace.", - "optional": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The user ID that created the workspace.", - "computed": true - }, - { - "name": "applied_shareddata_ids", - "type": "TypeList", - "description": "List of applied shared dataset ID.", - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "template_values", - "type": "TypeString", - "description": "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", - "optional": true - }, { "name": "template_inputs", "type": "TypeList", @@ -142003,12 +147901,25 @@ } }, { - "name": "locked_time", - "type": "TypeString", - "description": "The timestamp when the workspace was locked.", + "name": "template_git_has_uploadedgitrepotar", + "type": "TypeBool", + "description": "Has uploaded git repo tar", "optional": true, "computed": true }, + { + "name": "frozen", + "type": "TypeBool", + "description": "If set to true, the workspace is frozen and changes to the workspace are disabled.", + "optional": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "The workspace CRN.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "status", "type": "TypeString", @@ -142016,79 +147927,26 @@ "computed": true }, { - "name": "x_github_token", + "name": "name", "type": "TypeString", - "description": "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", - "optional": true + "description": "The name of your workspace. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. When you create a workspace for your own Terraform template, consider including the microservice component that you set up with your Terraform template and the IBM Cloud environment where you want to deploy your resources in your name.", + "required": true, + "min_length": 1, + "max_length": 128, + "matches": "^[a-zA-Z0-9][a-zA-Z0-9-_ ]*$" }, { - "name": "runtime_data", - "type": "TypeList", - "description": "Information about the provisioning engine, state file, and runtime logs.", - "computed": true, - "elem": { - "engine_cmd": { - "name": "engine_cmd", - "type": "TypeString", - "description": "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", - "optional": true - }, - "engine_name": { - "name": "engine_name", - "type": "TypeString", - "description": "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", - "optional": true - }, - "engine_version": { - "name": "engine_version", - "type": "TypeString", - "description": "The version of the provisioning engine that was used.", - "optional": true - }, - "id": { - "name": "id", - "type": "TypeString", - "description": "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", - "optional": true - }, - "log_store_url": { - "name": "log_store_url", - "type": "TypeString", - "description": "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", - "optional": true - }, - "output_values": { - "name": "output_values", - "type": "TypeList", - "description": "List of Output values.", - "optional": true, - "elem": { - "type": "TypeMap" - } - }, - "resources": { - "name": "resources", - "type": "TypeList", - "description": "List of resources.", - "optional": true, - "elem": { - "type": "TypeMap" - } - }, - "state_store_url": { - "name": "state_store_url", - "type": "TypeString", - "description": "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", - "optional": true - } - } + "name": "template_type", + "type": "TypeString", + "description": "The Terraform version that you want to use to run your Terraform code. Enter `terraform_v0.12` to use Terraform version 0.12, and `terraform_v0.11` to use Terraform version 0.11. The Terraform config files are run with Terraform version 0.11. This is a required variable. Make sure that your Terraform config files are compatible with the Terraform version that you select.", + "required": true, + "matches": "^terraform_v(?:0\\.11|0\\.12|0\\.13|0\\.14|0\\.15|1\\.0|1\\.1|1\\.2|1\\.3|1\\.4|1\\.5)(?:\\.\\d+)?$" }, { - "name": "resource_group", + "name": "status_msg", "type": "TypeString", - "description": "The ID of the resource group where you want to provision the workspace.", - "cloud_data_type": "resource_group", - "optional": true + "description": "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", + "computed": true }, { "name": "template_env_settings", @@ -142100,40 +147958,49 @@ } }, { - "name": "template_ref", + "name": "description", "type": "TypeString", - "description": "Workspace template ref.", + "description": "The description of the workspace.", + "max_length": 2048, "optional": true }, { - "name": "template_git_repo_sha_value", + "name": "location", "type": "TypeString", - "description": "The repository SHA value.", - "optional": true - }, - { - "name": "template_git_has_uploadedgitrepotar", - "type": "TypeBool", - "description": "Has uploaded git repo tar", + "description": "The location where you want to create your Schematics workspace and run the Schematics jobs. The location that you enter must match the API endpoint that you use. For example, if you use the Frankfurt API endpoint, you must specify `eu-de` as your location. If you use an API endpoint for a geography and you do not specify a location, Schematics determines the location based on availability.", + "cloud_data_type": "region", "optional": true, "computed": true } ], "ibm_security_group": [ - { - "name": "name", - "type": "TypeString", - "description": "Security group name", - "required": true - }, { "name": "description", "type": "TypeString", "description": "Security group description", "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "Security group name", + "required": true } ], "ibm_security_group_rule": [ + { + "name": "ether_type", + "type": "TypeString", + "description": "IP version IPv4 or IPv6", + "default_value": "IPv4", + "optional": true + }, + { + "name": "port_range_min", + "type": "TypeInt", + "description": "Port number minimum range", + "optional": true + }, { "name": "port_range_max", "type": "TypeInt", @@ -142170,22 +148037,30 @@ "type": "TypeString", "description": "Direction of rule: ingress or egress", "required": true - }, + } + ], + "ibm_service_instance": [ { - "name": "ether_type", - "type": "TypeString", - "description": "IP version IPv4 or IPv6", - "default_value": "IPv4", + "name": "parameters", + "type": "TypeMap", + "description": "Arbitrary parameters to pass along to the service broker. Must be a JSON object", "optional": true }, { - "name": "port_range_min", - "type": "TypeInt", - "description": "Port number minimum range", - "optional": true - } - ], - "ibm_service_instance": [ + "name": "tags", + "type": "TypeSet", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "dashboard_url", + "type": "TypeString", + "description": "Dashboard URL to access resource.", + "computed": true + }, { "name": "name", "type": "TypeString", @@ -142193,9 +148068,9 @@ "required": true }, { - "name": "space_guid", + "name": "service", "type": "TypeString", - "description": "The guid of the space in which the instance will be created", + "description": "The name of the service offering like speech_to_text, text_to_speech etc", "immutable": true, "required": true }, @@ -142221,10 +148096,10 @@ } }, { - "name": "parameters", - "type": "TypeMap", - "description": "Arbitrary parameters to pass along to the service broker. Must be a JSON object", - "optional": true + "name": "service_plan_guid", + "type": "TypeString", + "description": "The uniquie identifier of the service offering plan type", + "computed": true }, { "name": "plan", @@ -142232,15 +148107,6 @@ "description": "The plan type of the service", "required": true }, - { - "name": "tags", - "type": "TypeSet", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "wait_time_minutes", "type": "TypeInt", @@ -142249,15 +148115,9 @@ "optional": true }, { - "name": "dashboard_url", - "type": "TypeString", - "description": "Dashboard URL to access resource.", - "computed": true - }, - { - "name": "service", + "name": "space_guid", "type": "TypeString", - "description": "The name of the service offering like speech_to_text, text_to_speech etc", + "description": "The guid of the space in which the instance will be created", "immutable": true, "required": true }, @@ -142267,12 +148127,6 @@ "description": "The service broker-provided credentials to use this service.", "secure": true, "computed": true - }, - { - "name": "service_plan_guid", - "type": "TypeString", - "description": "The uniquie identifier of the service offering plan type", - "computed": true } ], "ibm_service_key": [ @@ -142316,60 +148170,32 @@ ], "ibm_sm_arbitrary_secret": [ { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "secret_id", + "name": "secret_type", "type": "TypeString", - "description": "A v4 UUID identifier.", - "computed": true - }, - { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, - { - "name": "created_by", + "name": "description", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "optional": true }, { - "name": "state_description", + "name": "expiration_date", "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true + "description": "The date a secret is expired. The date format follows RFC 3339.", + "optional": true }, { - "name": "secret_group_id", - "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, + "name": "version_custom_metadata", + "type": "TypeMap", + "description": "The secret version metadata that a user can customize.", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "crn", @@ -142379,43 +148205,37 @@ "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date that a resource was recently modified. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "region", + "name": "secret_id", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "A v4 UUID identifier.", "computed": true }, { - "name": "secret_type", + "name": "updated_at", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The date that a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "payload", + "name": "name", "type": "TypeString", - "description": "The arbitrary secret data payload.", - "secure": true, + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", "required": true }, { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "optional": true + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "version_custom_metadata", - "type": "TypeMap", - "description": "The secret version metadata that a user can customize.", + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", "optional": true, "computed": true, "elem": { @@ -142435,51 +148255,75 @@ "computed": true }, { - "name": "state", + "name": "locks_total", "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "endpoint_type", + "name": "instance_id", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { - "name": "name", + "name": "payload", "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "description": "The arbitrary secret data payload.", + "secure": true, "required": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true }, { - "name": "expiration_date", + "name": "state_description", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", "optional": true - } - ], - "ibm_sm_en_registration": [ + }, { - "name": "event_notifications_instance_crn", + "name": "secret_group_id", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "description": "A v4 UUID identifier, or `default` secret group.", "immutable": true, - "required": true, - "min_length": 9, - "max_length": 512, - "matches": "^crn:v[0-9](:([A-Za-z0-9-._~!$\u0026'()*+,;=@\\/]|%[0-9A-Z]{2})*){8}$" + "optional": true, + "computed": true + }, + { + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true + } + ], + "ibm_sm_en_registration": [ { "name": "event_notifications_source_name", "type": "TypeString", @@ -142521,20 +148365,26 @@ "type": "TypeString", "description": "public or private.", "optional": true + }, + { + "name": "event_notifications_instance_crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "immutable": true, + "required": true, + "min_length": 9, + "max_length": 512, + "matches": "^crn:v[0-9](:([A-Za-z0-9-._~!$\u0026'()*+,;=@\\/]|%[0-9A-Z]{2})*){8}$" } ], "ibm_sm_iam_credentials_configuration": [ { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "updated_at", + "name": "instance_id", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", - "computed": true + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true }, { "name": "region", @@ -142546,70 +148396,74 @@ "computed": true }, { - "name": "endpoint_type", + "name": "api_key", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "An IBM Cloud API key that can create and manage service IDs. The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform role on the IAM Identity Service. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).", + "secure": true, + "required": true }, { - "name": "created_at", + "name": "created_by", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "instance_id", + "name": "secret_type", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "computed": true }, { - "name": "name", + "name": "created_at", "type": "TypeString", - "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", - "immutable": true, - "required": true + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true }, { - "name": "config_type", + "name": "updated_at", "type": "TypeString", - "description": "The configuration type.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "api_key", + "name": "endpoint_type", "type": "TypeString", - "description": "An IBM Cloud API key that can create and manage service IDs. The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform role on the IAM Identity Service. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).", - "secure": true, + "description": "public or private.", + "optional": true + }, + { + "name": "name", + "type": "TypeString", + "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", + "immutable": true, "required": true }, { - "name": "created_by", + "name": "config_type", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The configuration type.", "computed": true } ], "ibm_sm_iam_credentials_secret": [ { - "name": "secret_group_id", + "name": "api_key_id", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, - "optional": true, + "description": "The ID of the API key that is generated for this secret.", "computed": true }, { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "computed": true }, { "name": "ttl", @@ -142617,6 +148471,19 @@ "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value is an integer that specifies the number of seconds .Minimum duration is 1 minute. Maximum is 90 days.", "required": true }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true + }, { "name": "downloaded", "type": "TypeBool", @@ -142624,9 +148491,23 @@ "computed": true }, { - "name": "api_key_id", + "name": "updated_at", "type": "TypeString", - "description": "The ID of the API key that is generated for this secret.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "optional": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "immutable": true, + "optional": true, "computed": true }, { @@ -142650,73 +148531,71 @@ } }, { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true + "name": "version_custom_metadata", + "type": "TypeMap", + "description": "The secret version metadata that a user can customize.", + "immutable": true, + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { - "name": "service_id_is_static", - "type": "TypeBool", - "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", + "name": "service_id", + "type": "TypeString", + "description": "The service ID under which the API key (see the `api_key` field) is created.If you omit this parameter, Secrets Manager generates a new service ID for your secret at its creation and adds it to the access groups that you assign.Optionally, you can use this field to provide your own service ID if you prefer to manage its access directly or retain the service ID after your secret expires, is rotated, or deleted. If you provide a service ID, do not include the `access_groups` parameter.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "description", + "name": "secret_id", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "optional": true + "description": "A v4 UUID identifier.", + "computed": true }, { - "name": "version_custom_metadata", - "type": "TypeMap", - "description": "The secret version metadata that a user can customize.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true }, { - "name": "created_at", + "name": "api_key", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically.", + "secure": true, "computed": true }, { - "name": "secret_id", + "name": "created_by", "type": "TypeString", - "description": "A v4 UUID identifier.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "versions_total", + "name": "locks_total", "type": "TypeInt", - "description": "The number of versions of the secret.", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true }, { - "name": "reuse_api_key", + "name": "service_id_is_static", "type": "TypeBool", - "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. Must be set to `true` for IAM credentials secrets managed with Terraform.", - "default_value": true, - "optional": true + "description": "Indicates whether an `iam_credentials` secret was created with a static service ID.If it is set to `true`, the service ID for the secret was provided by the user at secret creation. If it is set to `false`, the service ID was generated by Secrets Manager.", + "computed": true }, { "name": "instance_id", @@ -142765,27 +148644,9 @@ "max_items": 1 }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", - "required": true - }, - { - "name": "state", + "name": "versions_total", "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", - "computed": true - }, - { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The number of versions of the secret.", "computed": true }, { @@ -142795,105 +148656,101 @@ "computed": true }, { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, - { - "name": "service_id", + "name": "region", "type": "TypeString", - "description": "The service ID under which the API key (see the `api_key` field) is created.If you omit this parameter, Secrets Manager generates a new service ID for your secret at its creation and adds it to the access groups that you assign.Optionally, you can use this field to provide your own service ID if you prefer to manage its access directly or retain the service ID after your secret expires, is rotated, or deleted. If you provide a service ID, do not include the `access_groups` parameter.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, "optional": true, "computed": true }, { - "name": "api_key", - "type": "TypeString", - "description": "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically.", - "secure": true, - "computed": true + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true + "name": "reuse_api_key", + "type": "TypeBool", + "description": "Determines whether to use the same service ID and API key for future read operations on an`iam_credentials` secret. Must be set to `true` for IAM credentials secrets managed with Terraform.", + "default_value": true, + "optional": true } ], "ibm_sm_imported_certificate": [ { - "name": "serial_number", + "name": "signing_algorithm", "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", "computed": true }, { - "name": "description", + "name": "name", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true + }, + { + "name": "intermediate", + "type": "TypeString", + "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", + "secure": true, "optional": true }, { - "name": "crn", + "name": "state_description", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "secret_id", + "type": "TypeString", + "description": "A v4 UUID identifier.", "computed": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "immutable": true, + "optional": true, "computed": true }, { - "name": "validity", - "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", + "name": "version_custom_metadata", + "type": "TypeMap", + "description": "The secret version metadata that a user can customize.", + "optional": true, "computed": true, "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - } + "type": "TypeString" } }, { - "name": "labels", + "name": "alt_names", "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "optional": true, + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", "computed": true, "elem": { "type": "TypeString" } }, { - "name": "version_custom_metadata", - "type": "TypeMap", - "description": "The secret version metadata that a user can customize.", + "name": "expiration_date", + "type": "TypeString", + "description": "The date a secret is expired. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", "optional": true, "computed": true, "elem": { @@ -142901,46 +148758,27 @@ } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "signing_algorithm", + "name": "secret_type", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "intermediate", - "type": "TypeString", - "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", - "secure": true, - "optional": true - }, - { - "name": "intermediate_included", + "name": "downloaded", "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", - "computed": true - }, - { - "name": "issuer", - "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", "computed": true }, { - "name": "updated_at", + "name": "serial_number", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { @@ -142961,21 +148799,10 @@ "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", - "required": true - }, - { - "name": "secret_id", - "type": "TypeString", - "description": "A v4 UUID identifier.", - "computed": true - }, - { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "optional": true, "computed": true, "elem": { "type": "TypeString" @@ -142988,13 +148815,37 @@ "computed": true }, { - "name": "secret_group_id", - "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, - "optional": true, + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, + { + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", + "computed": true, + "elem": { + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } + } + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "optional": true + }, { "name": "private_key", "type": "TypeString", @@ -143003,50 +148854,46 @@ "optional": true }, { - "name": "endpoint_type", + "name": "created_at", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true }, { - "name": "common_name", - "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "name": "intermediate_included", + "type": "TypeBool", + "description": "Indicates whether the certificate was imported with an associated intermediate certificate.", "computed": true }, { - "name": "expiration_date", + "name": "issuer", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "name": "private_key_included", + "type": "TypeBool", + "description": "Indicates whether the certificate was imported with an associated private key.", "computed": true }, { - "name": "state_description", + "name": "created_by", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "private_key_included", - "type": "TypeBool", - "description": "Indicates whether the certificate was imported with an associated private key.", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true }, { "name": "certificate", @@ -143056,19 +148903,32 @@ "required": true }, { - "name": "created_by", + "name": "common_name", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true } ], "ibm_sm_kv_secret": [ + { + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, { "name": "region", "type": "TypeString", @@ -143079,28 +148939,28 @@ "computed": true }, { - "name": "description", + "name": "endpoint_type", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "public or private.", "optional": true }, { - "name": "secret_group_id", + "name": "secret_type", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, - "optional": true, + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "data", - "type": "TypeMap", - "description": "The payload data of a key-value secret.", - "secure": true, - "required": true, - "elem": { - "type": "TypeString" - } + "name": "name", + "type": "TypeString", + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "optional": true }, { "name": "crn", @@ -143110,28 +148970,36 @@ "computed": true }, { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "secret_id", - "type": "TypeString", - "description": "A v4 UUID identifier.", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { - "name": "endpoint_type", + "name": "updated_at", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true }, { - "name": "name", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "secret_group_id", "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", - "required": true + "description": "A v4 UUID identifier, or `default` secret group.", + "immutable": true, + "optional": true, + "computed": true }, { "name": "labels", @@ -143143,6 +149011,12 @@ "type": "TypeString" } }, + { + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true + }, { "name": "created_at", "type": "TypeString", @@ -143150,16 +149024,20 @@ "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "secret_id", + "type": "TypeString", + "description": "A v4 UUID identifier.", "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", - "computed": true + "name": "data", + "type": "TypeMap", + "description": "The payload data of a key-value secret.", + "secure": true, + "required": true, + "elem": { + "type": "TypeString" + } }, { "name": "custom_metadata", @@ -143182,34 +149060,41 @@ } }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", "computed": true }, { - "name": "secret_type", + "name": "instance_id", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true - }, + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + } + ], + "ibm_sm_private_certificate": [ { - "name": "created_by", + "name": "uri_sans", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true + "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "immutable": true, + "optional": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", - "computed": true + "name": "private_key_format", + "type": "TypeString", + "description": "The format of the generated private key.", + "default_value": "der", + "optional": true }, { - "name": "state_description", - "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true + "name": "exclude_cn_from_sans", + "type": "TypeBool", + "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", + "immutable": true, + "optional": true }, { "name": "instance_id", @@ -143218,15 +149103,12 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - } - ], - "ibm_sm_private_certificate": [ + }, { - "name": "private_key", + "name": "endpoint_type", "type": "TypeString", - "description": "(Optional) The PEM-encoded private key to associate with the certificate.", - "secure": true, - "computed": true + "description": "public or private.", + "optional": true }, { "name": "secret_type", @@ -143235,138 +149117,143 @@ "computed": true }, { - "name": "uri_sans", + "name": "description", "type": "TypeString", - "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "immutable": true, + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "optional": true }, { - "name": "other_sans", + "name": "alt_names", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", "immutable": true, "optional": true, + "computed": true, "elem": { "type": "TypeString" } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", "computed": true }, { - "name": "validity", + "name": "ca_chain", "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", + "description": "The chain of certificate authorities that are associated with the certificate.", + "secure": true, "computed": true, "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", - "computed": true - } + "type": "TypeString" } }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true + }, + { + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "secret_id", + "type": "TypeString", + "description": "A v4 UUID identifier.", "computed": true }, { - "name": "name", + "name": "certificate_template", "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "description": "The name of the certificate template.", + "immutable": true, "required": true }, { - "name": "ip_sans", + "name": "crn", "type": "TypeString", - "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "immutable": true, - "optional": true + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "private_key_format", + "name": "state", + "type": "TypeInt", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "computed": true + }, + { + "name": "created_at", "type": "TypeString", - "description": "The format of the generated private key.", - "default_value": "der", - "optional": true + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true }, { - "name": "issuer", + "name": "issuing_ca", "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "description": "The PEM-encoded certificate of the certificate authority that signed and issued this certificate.", + "secure": true, "computed": true }, { - "name": "secret_id", + "name": "state_description", + "type": "TypeString", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "expiration_date", "type": "TypeString", - "description": "A v4 UUID identifier.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true }, { - "name": "revocation_time_seconds", - "type": "TypeInt", - "description": "The timestamp of the certificate revocation.", - "computed": true + "name": "key_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", + "default_value": "RSA2048", + "immutable": true, + "optional": true }, { - "name": "secret_group_id", + "name": "ip_sans", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", + "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { - "name": "certificate_template", + "name": "ttl", "type": "TypeString", - "description": "The name of the certificate template.", + "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", "immutable": true, - "required": true + "optional": true }, { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "name": "version_custom_metadata", + "type": "TypeMap", + "description": "The secret version metadata that a user can customize.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "exclude_cn_from_sans", - "type": "TypeBool", - "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", - "immutable": true, - "optional": true - }, { "name": "locks_total", "type": "TypeInt", @@ -143374,41 +149261,53 @@ "computed": true }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", - "computed": true - }, - { - "name": "key_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", - "default_value": "RSA2048", - "immutable": true, - "optional": true + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", + "computed": true, + "elem": { + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } + } }, { - "name": "description", + "name": "private_key", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "optional": true + "description": "(Optional) The PEM-encoded private key to associate with the certificate.", + "secure": true, + "computed": true }, { - "name": "labels", + "name": "other_sans", "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "csr", + "name": "created_by", "type": "TypeString", - "description": "The certificate signing request.", - "immutable": true, - "optional": true + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true + }, + { + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "computed": true }, { "name": "format", @@ -143418,29 +149317,25 @@ "optional": true }, { - "name": "version_custom_metadata", + "name": "custom_metadata", "type": "TypeMap", - "description": "The secret version metadata that a user can customize.", - "immutable": true, + "description": "The secret metadata that a user can customize.", "optional": true, + "computed": true, "elem": { "type": "TypeString" } }, { - "name": "ca_chain", - "type": "TypeList", - "description": "The chain of certificate authorities that are associated with the certificate.", - "secure": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "signing_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "computed": true }, { - "name": "expiration_date", + "name": "certificate_authority", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", + "description": "The intermediate certificate authority that signed this certificate.", "computed": true }, { @@ -143450,42 +149345,54 @@ "computed": true }, { - "name": "ttl", + "name": "secret_group_id", "type": "TypeString", - "description": "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.Minimum duration is 1 minute. Maximum is 90 days.", + "description": "A v4 UUID identifier, or `default` secret group.", "immutable": true, - "optional": true + "optional": true, + "computed": true }, { - "name": "created_by", + "name": "common_name", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "immutable": true, + "required": true }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", - "computed": true + "name": "csr", + "type": "TypeString", + "description": "The certificate signing request.", + "immutable": true, + "optional": true }, { - "name": "updated_at", + "name": "serial_number", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { - "name": "signing_algorithm", + "name": "revocation_time_seconds", + "type": "TypeInt", + "description": "The timestamp of the certificate revocation.", + "computed": true + }, + { + "name": "certificate", "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", + "description": "The PEM-encoded contents of your certificate.", + "secure": true, "computed": true }, { - "name": "common_name", + "name": "region", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true + "optional": true, + "computed": true }, { "name": "rotation", @@ -143519,72 +149426,41 @@ "max_items": 1 }, { - "name": "certificate", + "name": "issuer", "type": "TypeString", - "description": "The PEM-encoded contents of your certificate.", - "secure": true, + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "computed": true }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, { "name": "revocation_time_rfc3339", "type": "TypeString", "description": "The date and time that the certificate was revoked. The date format follows RFC 3339.", "computed": true - }, - { - "name": "issuing_ca", - "type": "TypeString", - "description": "The PEM-encoded certificate of the certificate authority that signed and issued this certificate.", - "secure": true, - "computed": true - }, + } + ], + "ibm_sm_private_certificate_configuration_action_set_signed": [ { - "name": "instance_id", + "name": "region", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true - }, - { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", + "optional": true, "computed": true }, { - "name": "state_description", + "name": "endpoint_type", "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true + "description": "public or private.", + "optional": true }, { - "name": "certificate_authority", + "name": "name", "type": "TypeString", - "description": "The intermediate certificate authority that signed this certificate.", - "computed": true + "description": "The name that uniquely identifies a configuration", + "immutable": true, + "required": true }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", - "computed": true - } - ], - "ibm_sm_private_certificate_configuration_action_set_signed": [ { "name": "certificate", "type": "TypeString", @@ -143600,45 +149476,13 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - }, - { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name that uniquely identifies a configuration", - "immutable": true, - "required": true } ], "ibm_sm_private_certificate_configuration_action_sign_csr": [ { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "other_sans", + "name": "country", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "elem": { @@ -143646,9 +149490,9 @@ } }, { - "name": "permitted_dns_domains", + "name": "locality", "type": "TypeList", - "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "elem": { @@ -143656,9 +149500,9 @@ } }, { - "name": "organization", + "name": "street_address", "type": "TypeList", - "description": "The Organization (O) values to define in the subject field of the resulting certificate.", + "description": "The street address values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "elem": { @@ -143666,9 +149510,9 @@ } }, { - "name": "street_address", + "name": "postal_code", "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "description": "The postal code values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "elem": { @@ -143676,10 +149520,9 @@ } }, { - "name": "region", + "name": "serial_number", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", + "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", "immutable": true, "optional": true, "computed": true @@ -143692,12 +149535,20 @@ "optional": true }, { - "name": "ip_sans", + "name": "uri_sans", "type": "TypeString", - "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", "immutable": true, "optional": true }, + { + "name": "ttl", + "type": "TypeString", + "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", + "immutable": true, + "optional": true, + "computed": true + }, { "name": "exclude_cn_from_sans", "type": "TypeBool", @@ -143713,16 +149564,6 @@ "immutable": true, "optional": true }, - { - "name": "country", - "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "data", "type": "TypeList", @@ -143762,27 +149603,6 @@ } } }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "uri_sans", - "type": "TypeString", - "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "immutable": true, - "optional": true - }, - { - "name": "ttl", - "type": "TypeString", - "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", - "immutable": true, - "optional": true, - "computed": true - }, { "name": "format", "type": "TypeString", @@ -143791,47 +149611,6 @@ "optional": true, "computed": true }, - { - "name": "max_path_length", - "type": "TypeInt", - "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "locality", - "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The serial number to assign to the generated certificate. To assign a random serial number, you can omit this field.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "name", - "type": "TypeString", - "description": "The name that uniquely identifies a configuration", - "immutable": true, - "required": true - }, - { - "name": "csr", - "type": "TypeString", - "description": "The certificate signing request.", - "secure": true, - "immutable": true, - "required": true - }, { "name": "ou", "type": "TypeList", @@ -143843,19 +149622,9 @@ } }, { - "name": "province", - "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "postal_code", + "name": "organization", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The Organization (O) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "elem": { @@ -143869,76 +149638,68 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - } - ], - "ibm_sm_private_certificate_configuration_intermediate_ca": [ + }, { - "name": "config_type", + "name": "region", "type": "TypeString", - "description": "The configuration type.", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { - "name": "other_sans", + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "province", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, - { - "name": "format", - "type": "TypeString", - "description": "The format of the returned data.", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "use_csr_values", - "type": "TypeBool", - "description": "Determines whether to use values from a certificate signing request (CSR) to complete a `private_cert_configuration_action_sign_csr` action.", - "immutable": true, - "optional": true - }, { "name": "name", "type": "TypeString", - "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", + "description": "The name that uniquely identifies a configuration", "immutable": true, "required": true }, { - "name": "common_name", + "name": "csr", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The certificate signing request.", + "secure": true, "immutable": true, "required": true }, { - "name": "ou", + "name": "alt_names", "type": "TypeList", - "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "expiration_date", + "name": "ip_sans", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", - "computed": true + "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "immutable": true, + "optional": true }, { - "name": "permitted_dns_domains", + "name": "other_sans", "type": "TypeList", - "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", "immutable": true, "optional": true, "elem": { @@ -143946,67 +149707,53 @@ } }, { - "name": "street_address", - "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "name": "max_path_length", + "type": "TypeInt", + "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", "immutable": true, "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "postal_code", + "name": "permitted_dns_domains", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } - }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", - "computed": true - }, + } + ], + "ibm_sm_private_certificate_configuration_intermediate_ca": [ { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true + "name": "crl_distribution_points_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", + "default_value": false, + "optional": true }, { - "name": "max_ttl", + "name": "private_key_format", "type": "TypeString", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", - "required": true - }, - { - "name": "crl_disable", - "type": "TypeBool", - "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", - "default_value": false, + "description": "The format of the generated private key.", + "default_value": "der", + "immutable": true, "optional": true }, { - "name": "key_bits", - "type": "TypeInt", - "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "name": "signing_method", + "type": "TypeString", + "description": "The signing method to use with this certificate authority to generate private certificates.You can choose between internal or externally signed options. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-intermediate-certificate-authorities).", "immutable": true, - "optional": true, - "computed": true + "required": true }, { - "name": "province", + "name": "permitted_dns_domains", "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", + "description": "The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA certificate.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } @@ -144018,33 +149765,12 @@ "optional": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "crl_expiry_seconds", - "type": "TypeInt", - "description": "The time until the certificate revocation list (CRL) expires.The value can be supplied as a string representation of a duration in hours, such as `48h`. The default is 72 hours. In the API response, this value is returned in seconds (integer).**Note:** The CRL is rotated automatically before it expires.", - "computed": true - }, - { - "name": "ip_sans", + "name": "issuer", "type": "TypeString", - "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", "immutable": true, "optional": true }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", - "computed": true - }, { "name": "data", "type": "TypeList", @@ -144104,10 +149830,45 @@ } }, { - "name": "ttl", + "name": "max_ttl_seconds", + "type": "TypeInt", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", + "computed": true + }, + { + "name": "crl_expiry", "type": "TypeString", - "description": "Specifies the requested Time To Live (after which the certificate will be expired). The value can be provided provided as a string duration with time suffix (e.g. '24h') or the number of seconds as string (e.g. '86400').", - "optional": true + "description": "The time until the certificate revocation list (CRL) expires.The value can be supplied as a string representation of a duration in hours, such as `48h`. The default is 72 hours. In the API response, this value is returned in seconds (integer).**Note:** The CRL is rotated automatically before it expires.", + "optional": true, + "computed": true + }, + { + "name": "ou", + "type": "TypeList", + "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "postal_code", + "type": "TypeList", + "description": "The postal code values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "serial_number", + "type": "TypeString", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "computed": true }, { "name": "key_type", @@ -144118,31 +149879,40 @@ "computed": true }, { - "name": "signing_method", + "name": "province", + "type": "TypeList", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", "type": "TypeString", - "description": "The signing method to use with this certificate authority to generate private certificates.You can choose between internal or externally signed options. For more information, see the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-intermediate-certificate-authorities).", + "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", "immutable": true, "required": true }, { - "name": "uri_sans", + "name": "max_ttl", "type": "TypeString", - "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "immutable": true, - "optional": true + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", + "required": true }, { - "name": "exclude_cn_from_sans", + "name": "issuing_certificates_urls_encoded", "type": "TypeBool", - "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", + "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", "default_value": false, - "immutable": true, "optional": true }, { - "name": "organization", + "name": "other_sans", "type": "TypeList", - "description": "The Organization (O) values to define in the subject field of the resulting certificate.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", "immutable": true, "optional": true, "computed": true, @@ -144151,39 +149921,49 @@ } }, { - "name": "locality", - "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "name": "format", + "type": "TypeString", + "description": "The format of the returned data.", "immutable": true, "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "crl_expiry", - "type": "TypeString", + "name": "crl_expiry_seconds", + "type": "TypeInt", "description": "The time until the certificate revocation list (CRL) expires.The value can be supplied as a string representation of a duration in hours, such as `48h`. The default is 72 hours. In the API response, this value is returned in seconds (integer).**Note:** The CRL is rotated automatically before it expires.", - "optional": true, "computed": true }, { - "name": "alt_names", + "name": "street_address", "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "description": "The street address values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, + "computed": true, "elem": { "type": "TypeString" } }, + { + "name": "ttl", + "type": "TypeString", + "description": "Specifies the requested Time To Live (after which the certificate will be expired). The value can be provided provided as a string duration with time suffix (e.g. '24h') or the number of seconds as string (e.g. '86400').", + "optional": true + }, + { + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "immutable": true, + "required": true + }, { "name": "instance_id", "type": "TypeString", @@ -144192,6 +149972,45 @@ "immutable": true, "required": true }, + { + "name": "organization", + "type": "TypeList", + "description": "The Organization (O) values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "country", + "type": "TypeList", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "locality", + "type": "TypeList", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "expiration_date", + "type": "TypeString", + "description": "The date a secret is expired. The date format follows RFC 3339.", + "computed": true + }, { "name": "max_path_length", "type": "TypeInt", @@ -144200,59 +150019,122 @@ "optional": true }, { - "name": "crl_distribution_points_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", - "default_value": false, - "optional": true + "name": "key_bits", + "type": "TypeInt", + "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "immutable": true, + "optional": true, + "computed": true }, { - "name": "issuing_certificates_urls_encoded", + "name": "exclude_cn_from_sans", "type": "TypeBool", - "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", + "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", "default_value": false, + "immutable": true, "optional": true }, { - "name": "private_key_format", + "name": "status", "type": "TypeString", - "description": "The format of the generated private key.", - "default_value": "der", - "immutable": true, + "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", + "computed": true + }, + { + "name": "config_type", + "type": "TypeString", + "description": "The configuration type.", + "computed": true + }, + { + "name": "crl_disable", + "type": "TypeBool", + "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", + "default_value": false, "optional": true }, { - "name": "country", + "name": "alt_names", "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", "immutable": true, "optional": true, - "computed": true, "elem": { "type": "TypeString" } }, { - "name": "issuer", + "name": "ip_sans", "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "immutable": true, + "optional": true + }, + { + "name": "uri_sans", + "type": "TypeString", + "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "immutable": true, + "optional": true + }, + { + "name": "use_csr_values", + "type": "TypeBool", + "description": "Determines whether to use values from a certificate signing request (CSR) to complete a `private_cert_configuration_action_sign_csr` action.", "immutable": true, "optional": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true } ], "ibm_sm_private_certificate_configuration_root_ca": [ { - "name": "max_ttl", - "type": "TypeString", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", - "required": true + "name": "crl_disable", + "type": "TypeBool", + "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", + "default_value": false, + "optional": true }, { - "name": "common_name", + "name": "crl_distribution_points_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", + "default_value": false, + "optional": true + }, + { + "name": "ttl_seconds", + "type": "TypeInt", + "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", + "computed": true + }, + { + "name": "private_key_format", "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "description": "The format of the generated private key.", + "default_value": "der", "immutable": true, - "required": true + "optional": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "issuing_certificates_urls_encoded", + "type": "TypeBool", + "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", + "default_value": false, + "optional": true }, { "name": "permitted_dns_domains", @@ -144266,9 +150148,9 @@ } }, { - "name": "locality", + "name": "country", "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "computed": true, @@ -144288,36 +150170,41 @@ } }, { - "name": "name", + "name": "config_type", "type": "TypeString", - "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", - "immutable": true, - "required": true + "description": "The configuration type.", + "computed": true }, { - "name": "issuing_certificates_urls_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the URL of the issuing certificate in the certificates that are issued by this certificate authority.", - "default_value": false, + "name": "ip_sans", + "type": "TypeString", + "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "immutable": true, "optional": true }, { - "name": "ttl", + "name": "format", "type": "TypeString", - "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", + "description": "The format of the returned data.", + "immutable": true, "optional": true, "computed": true }, { - "name": "province", - "type": "TypeList", - "description": "The Province (ST) values to define in the subject field of the resulting certificate.", + "name": "max_path_length", + "type": "TypeInt", + "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", "immutable": true, "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true + }, + { + "name": "exclude_cn_from_sans", + "type": "TypeBool", + "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", + "default_value": false, + "immutable": true, + "optional": true }, { "name": "secret_type", @@ -144326,25 +150213,31 @@ "computed": true }, { - "name": "region", + "name": "updated_at", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "uri_sans", + "name": "status", "type": "TypeString", - "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", + "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", + "computed": true + }, + { + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", "immutable": true, - "optional": true + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "other_sans", + "name": "locality", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "computed": true, @@ -144353,46 +150246,65 @@ } }, { - "name": "ttl_seconds", + "name": "crl_expiry_seconds", "type": "TypeInt", - "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", + "description": "The time until the certificate revocation list (CRL) expires, in seconds.", "computed": true }, { - "name": "private_key_format", + "name": "region", "type": "TypeString", - "description": "The format of the generated private key.", - "default_value": "der", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "uri_sans", + "type": "TypeString", + "description": "The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", "immutable": true, "optional": true }, { - "name": "max_path_length", + "name": "key_bits", "type": "TypeInt", - "description": "The maximum path length to encode in the generated certificate. `-1` means no limit.If the signing certificate has a maximum path length set, the path length is set to one less than that of the signing certificate. A limit of `0` means a literal path length of zero.", + "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", "immutable": true, "optional": true, "computed": true }, { - "name": "exclude_cn_from_sans", - "type": "TypeBool", - "description": "Controls whether the common name is excluded from Subject Alternative Names (SANs).If the common name set to `true`, it is not included in DNS or Email SANs if they apply. This field can be useful if the common name is a human-readable identifier, instead of a hostname or an email address.", - "default_value": false, - "immutable": true, - "optional": true + "name": "serial_number", + "type": "TypeString", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "computed": true }, { - "name": "crl_expiry_seconds", - "type": "TypeInt", - "description": "The time until the certificate revocation list (CRL) expires, in seconds.", + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "endpoint_type", + "name": "expiration_date", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The date a secret is expired. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "max_ttl", + "type": "TypeString", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", + "required": true + }, + { + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "immutable": true, + "required": true }, { "name": "key_type", @@ -144403,12 +150315,30 @@ "computed": true }, { - "name": "key_bits", - "type": "TypeInt", - "description": "The number of bits to use to generate the private key.Allowable values for RSA keys are: `2048` and `4096`. Allowable values for EC keys are: `224`, `256`, `384`, and `521`. The default for RSA keys is `2048`. The default for EC keys is `256`.", + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "name", + "type": "TypeString", + "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", + "immutable": true, + "required": true + }, + { + "name": "other_sans", + "type": "TypeList", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA certificate.The alternative names must match the values that are specified in the `allowed_other_sans` field in the associated certificate template. The format is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`.", "immutable": true, "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "ou", @@ -144421,6 +150351,23 @@ "type": "TypeString" } }, + { + "name": "street_address", + "type": "TypeList", + "description": "The street address values to define in the subject field of the resulting certificate.", + "immutable": true, + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "max_ttl_seconds", + "type": "TypeInt", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "computed": true + }, { "name": "data", "type": "TypeList", @@ -144476,89 +150423,20 @@ "type": "TypeString", "description": "The type of private key to generate.", "computed": true - } - } - }, - { - "name": "config_type", - "type": "TypeString", - "description": "The configuration type.", - "computed": true - }, - { - "name": "crl_distribution_points_encoded", - "type": "TypeBool", - "description": "Determines whether to encode the certificate revocation list (CRL) distribution points in the certificates that are issued by this certificate authority.", - "default_value": false, - "optional": true - }, - { - "name": "country", - "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", - "immutable": true, - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "status", - "type": "TypeString", - "description": "The status of the certificate authority. The status of a root certificate authority is either `configured` or `expired`. For intermediate certificate authorities, possible statuses include `signing_required`,`signed_certificate_required`, `certificate_template_required`, `configured`, `expired` or `revoked`.", - "computed": true - }, - { - "name": "expiration_date", - "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, - { - "name": "crl_disable", - "type": "TypeBool", - "description": "Disables or enables certificate revocation list (CRL) building.If CRL building is disabled, a signed but zero-length CRL is returned when downloading the CRL. If CRL building is enabled, it will rebuild the CRL.", - "default_value": false, - "optional": true - }, - { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", - "computed": true - }, - { - "name": "updated_at", - "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", - "computed": true + } + } }, { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "name": "crl_expiry", + "type": "TypeString", + "description": "The time until the certificate revocation list (CRL) expires.The value can be supplied as a string representation of a duration in hours, such as `48h`. The default is 72 hours. In the API response, this value is returned in seconds (integer).**Note:** The CRL is rotated automatically before it expires.", + "optional": true, "computed": true }, { - "name": "format", + "name": "ttl", "type": "TypeString", - "description": "The format of the returned data.", - "immutable": true, + "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", "optional": true, "computed": true }, @@ -144574,9 +150452,9 @@ } }, { - "name": "street_address", + "name": "province", "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "description": "The Province (ST) values to define in the subject field of the resulting certificate.", "immutable": true, "optional": true, "computed": true, @@ -144589,71 +150467,20 @@ "type": "TypeString", "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true - }, - { - "name": "crl_expiry", - "type": "TypeString", - "description": "The time until the certificate revocation list (CRL) expires.The value can be supplied as a string representation of a duration in hours, such as `48h`. The default is 72 hours. In the API response, this value is returned in seconds (integer).**Note:** The CRL is rotated automatically before it expires.", - "optional": true, - "computed": true - }, - { - "name": "alt_names", - "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "immutable": true, - "optional": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "ip_sans", - "type": "TypeString", - "description": "The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.", - "immutable": true, - "optional": true } ], "ibm_sm_private_certificate_configuration_template": [ { - "name": "serial_number", + "name": "created_by", "type": "TypeString", - "description": "Unused field.", - "optional": true, - "computed": true, - "deprecated": "This field is deprecated." - }, - { - "name": "client_flag", - "type": "TypeBool", - "description": "Determines whether private certificates are flagged for client use.", - "optional": true, - "computed": true - }, - { - "name": "email_protection_flag", - "type": "TypeBool", - "description": "Determines whether private certificates are flagged for email protection use.", - "optional": true, + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { - "name": "instance_id", - "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", - "immutable": true, - "required": true - }, - { - "name": "region", + "name": "endpoint_type", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true + "description": "public or private.", + "optional": true }, { "name": "province", @@ -144666,33 +150493,36 @@ } }, { - "name": "allow_localhost", + "name": "certificate_authority", + "type": "TypeString", + "description": "The name of the intermediate certificate authority.", + "required": true + }, + { + "name": "allow_bare_domains", "type": "TypeBool", - "description": "Determines whether to allow `localhost` to be included as one of the requested common names.", + "description": "Determines whether to allow clients to request private certificates that match the value of the actual domains on the final certificate.For example, if you specify `example.com` in the `allowed_domains` field, you grant clients the ability to request a certificate that contains the name `example.com` as one of the DNS values on the final certificate.**Important:** In some scenarios, allowing bare domains can be considered a security risk.", "optional": true, "computed": true }, { - "name": "allowed_domains", - "type": "TypeList", - "description": "The domains to define for the certificate template. This property is used along with the `allow_bare_domains` and `allow_subdomains` options.", + "name": "allow_glob_domains", + "type": "TypeBool", + "description": "Determines whether to allow glob patterns, for example, `ftp*.example.com`, in the names that are specified in the `allowed_domains` field.If set to `true`, clients are allowed to request private certificates with names that match the glob patterns.", "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "allow_bare_domains", + "name": "client_flag", "type": "TypeBool", - "description": "Determines whether to allow clients to request private certificates that match the value of the actual domains on the final certificate.For example, if you specify `example.com` in the `allowed_domains` field, you grant clients the ability to request a certificate that contains the name `example.com` as one of the DNS values on the final certificate.**Important:** In some scenarios, allowing bare domains can be considered a security risk.", + "description": "Determines whether private certificates are flagged for client use.", "optional": true, "computed": true }, { - "name": "ou", + "name": "policy_identifiers", "type": "TypeList", - "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", + "description": "A list of policy Object Identifiers (OIDs).", "optional": true, "computed": true, "elem": { @@ -144700,58 +150530,42 @@ } }, { - "name": "allow_ip_sans", + "name": "allow_subdomains", "type": "TypeBool", - "description": "Determines whether to allow clients to request a private certificate with IP Subject Alternative Names.", + "description": "Determines whether to allow clients to request private certificates with common names (CN) that are subdomains of the CNs that are allowed by the other certificate template options. This includes wildcard subdomains.For example, if `allowed_domains` has a value of `example.com` and `allow_subdomains`is set to `true`, then the following subdomains are allowed: `foo.example.com`, `bar.example.com`, `*.example.com`.**Note:** This field is redundant if you use the `allow_any_name` option.", "optional": true, "computed": true }, { - "name": "not_before_duration", - "type": "TypeString", - "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.The value can be supplied as a string representation of a duration, such as `30s`. In the API response, this value is returned in seconds (integer).", - "optional": true - }, - { - "name": "use_csr_sans", + "name": "code_signing_flag", "type": "TypeBool", - "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the Subject Alternative Names(SANs) from a certificate signing request (CSR) instead of the SANs that are included in the data of the certificate.Does not include the common name in the CSR. To use the common name, include the `use_csr_common_name` property.", + "description": "Determines whether private certificates are flagged for code signing use.", "optional": true, "computed": true }, { - "name": "updated_at", + "name": "config_type", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "description": "The configuration type.", "computed": true }, { - "name": "max_ttl", + "name": "ttl", "type": "TypeString", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", + "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", "optional": true }, { - "name": "country", - "type": "TypeList", - "description": "The Country (C) values to define in the subject field of the resulting certificate.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "allowed_secret_groups", + "name": "key_type", "type": "TypeString", - "description": "Scopes the creation of private certificates to only the secret groups that you specify.This field can be supplied as a comma-delimited list of secret group IDs.", + "description": "The type of private key to generate.", "optional": true, "computed": true }, { - "name": "allowed_other_sans", + "name": "locality", "type": "TypeList", - "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names (SANs) to allow for private certificates.The format for each element in the list is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`. To allow any value for an OID, use `*` as its value. Alternatively, specify a single `*` to allow any `other_sans` input.", + "description": "The Locality (L) values to define in the subject field of the resulting certificate.", "optional": true, "computed": true, "elem": { @@ -144759,9 +150573,9 @@ } }, { - "name": "ext_key_usage", + "name": "street_address", "type": "TypeList", - "description": "The allowed extended key usage constraint on private certificates.You can find valid values in the [Go x509 package documentation](https://golang.org/pkg/crypto/x509/#ExtKeyUsage). Omit the `ExtKeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", + "description": "The street address values to define in the subject field of the resulting certificate.", "optional": true, "computed": true, "elem": { @@ -144769,46 +150583,24 @@ } }, { - "name": "use_csr_common_name", - "type": "TypeBool", - "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the common name (CN) from a certificate signing request (CSR) instead of the CN that's included in the data of the certificate.Does not include any requested Subject Alternative Names (SANs) in the CSR. To use the alternative names, include the `use_csr_sans` property.", + "name": "allowed_secret_groups", + "type": "TypeString", + "description": "Scopes the creation of private certificates to only the secret groups that you specify.This field can be supplied as a comma-delimited list of secret group IDs.", "optional": true, "computed": true }, { - "name": "not_before_duration_seconds", - "type": "TypeInt", - "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.", - "computed": true - }, - { - "name": "endpoint_type", + "name": "not_before_duration", "type": "TypeString", - "description": "public or private.", + "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.The value can be supplied as a string representation of a duration, such as `30s`. In the API response, this value is returned in seconds (integer).", "optional": true }, { - "name": "policy_identifiers", - "type": "TypeList", - "description": "A list of policy Object Identifiers (OIDs).", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - }, - { - "name": "secret_type", - "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "name": "max_ttl_seconds", + "type": "TypeInt", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", "computed": true }, - { - "name": "ttl", - "type": "TypeString", - "description": "The requested time-to-live (TTL) for certificates that are created by this CA. This field's value cannot be longer than the `max_ttl` limit.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).", - "optional": true - }, { "name": "key_bits", "type": "TypeInt", @@ -144817,30 +150609,33 @@ "computed": true }, { - "name": "allow_subdomains", - "type": "TypeBool", - "description": "Determines whether to allow clients to request private certificates with common names (CN) that are subdomains of the CNs that are allowed by the other certificate template options. This includes wildcard subdomains.For example, if `allowed_domains` has a value of `example.com` and `allow_subdomains`is set to `true`, then the following subdomains are allowed: `foo.example.com`, `bar.example.com`, `*.example.com`.**Note:** This field is redundant if you use the `allow_any_name` option.", + "name": "postal_code", + "type": "TypeList", + "description": "The postal code values to define in the subject field of the resulting certificate.", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "allow_any_name", + "name": "allow_ip_sans", "type": "TypeBool", - "description": "Determines whether to allow clients to request a private certificate that matches any common name.", + "description": "Determines whether to allow clients to request a private certificate with IP Subject Alternative Names.", "optional": true, "computed": true }, { - "name": "code_signing_flag", + "name": "require_cn", "type": "TypeBool", - "description": "Determines whether private certificates are flagged for code signing use.", + "description": "Determines whether to require a common name to create a private certificate.By default, a common name is required to generate a certificate. To make the `common_name` field optional, set the `require_cn` option to `false`.", "optional": true, "computed": true }, { - "name": "ext_key_usage_oids", + "name": "allowed_domains", "type": "TypeList", - "description": "A list of extended key usage Object Identifiers (OIDs).", + "description": "The domains to define for the certificate template. This property is used along with the `allow_bare_domains` and `allow_subdomains` options.", "optional": true, "computed": true, "elem": { @@ -144848,28 +150643,28 @@ } }, { - "name": "created_at", + "name": "secret_type", "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { - "name": "config_type", + "name": "created_at", "type": "TypeString", - "description": "The configuration type.", + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "key_type", - "type": "TypeString", - "description": "The type of private key to generate.", + "name": "allow_wildcard_certificates", + "type": "TypeBool", + "description": "Determines whether the issuance of certificates with RFC 6125 wildcards in the CN field.When set to false, this field prevents wildcards from being issued even if they can be allowed by an option `allow_glob_domains`.", "optional": true, "computed": true }, { - "name": "locality", + "name": "allowed_uri_sans", "type": "TypeList", - "description": "The Locality (L) values to define in the subject field of the resulting certificate.", + "description": "The URI Subject Alternative Names to allow for private certificates.Values can contain glob patterns, for example `spiffe://hostname/_*`.", "optional": true, "computed": true, "elem": { @@ -144877,9 +150672,9 @@ } }, { - "name": "street_address", + "name": "allowed_other_sans", "type": "TypeList", - "description": "The street address values to define in the subject field of the resulting certificate.", + "description": "The custom Object Identifier (OID) or UTF8-string Subject Alternative Names (SANs) to allow for private certificates.The format for each element in the list is the same as OpenSSL: `\u003coid\u003e:\u003ctype\u003e:\u003cvalue\u003e` where the current valid type is `UTF8`. To allow any value for an OID, use `*` as its value. Alternatively, specify a single `*` to allow any `other_sans` input.", "optional": true, "computed": true, "elem": { @@ -144887,63 +150682,42 @@ } }, { - "name": "require_cn", - "type": "TypeBool", - "description": "Determines whether to require a common name to create a private certificate.By default, a common name is required to generate a certificate. To make the `common_name` field optional, set the `require_cn` option to `false`.", - "optional": true, - "computed": true - }, - { - "name": "basic_constraints_valid_for_non_ca", - "type": "TypeBool", - "description": "Determines whether to mark the Basic Constraints extension of an issued private certificate as valid for non-CA certificates.", - "optional": true, - "computed": true - }, - { - "name": "certificate_authority", - "type": "TypeString", - "description": "The name of the intermediate certificate authority.", - "required": true - }, - { - "name": "allow_glob_domains", - "type": "TypeBool", - "description": "Determines whether to allow glob patterns, for example, `ftp*.example.com`, in the names that are specified in the `allowed_domains` field.If set to `true`, clients are allowed to request private certificates with names that match the glob patterns.", - "optional": true, - "computed": true - }, - { - "name": "allow_wildcard_certificates", - "type": "TypeBool", - "description": "Determines whether the issuance of certificates with RFC 6125 wildcards in the CN field.When set to false, this field prevents wildcards from being issued even if they can be allowed by an option `allow_glob_domains`.", + "name": "ext_key_usage_oids", + "type": "TypeList", + "description": "A list of extended key usage Object Identifiers (OIDs).", "optional": true, - "computed": true + "computed": true, + "elem": { + "type": "TypeString" + } }, { - "name": "enforce_hostnames", + "name": "use_csr_common_name", "type": "TypeBool", - "description": "Determines whether to enforce only valid host names for common names, DNS Subject Alternative Names, and the host section of email addresses.", + "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the common name (CN) from a certificate signing request (CSR) instead of the CN that's included in the data of the certificate.Does not include any requested Subject Alternative Names (SANs) in the CSR. To use the alternative names, include the `use_csr_sans` property.", "optional": true, "computed": true }, { - "name": "server_flag", + "name": "basic_constraints_valid_for_non_ca", "type": "TypeBool", - "description": "Determines whether private certificates are flagged for server use.", + "description": "Determines whether to mark the Basic Constraints extension of an issued private certificate as valid for non-CA certificates.", "optional": true, "computed": true }, { - "name": "created_by", + "name": "updated_at", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, { - "name": "max_ttl_seconds", - "type": "TypeInt", - "description": "The maximum time-to-live (TTL) for certificates that are created by this CA in seconds.", + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, "computed": true }, { @@ -144952,13 +150726,6 @@ "description": "The requested Time To Live, after which the certificate will be expired.", "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", - "immutable": true, - "required": true - }, { "name": "organization", "type": "TypeList", @@ -144970,9 +150737,9 @@ } }, { - "name": "postal_code", + "name": "country", "type": "TypeList", - "description": "The postal code values to define in the subject field of the resulting certificate.", + "description": "The Country (C) values to define in the subject field of the resulting certificate.", "optional": true, "computed": true, "elem": { @@ -144980,104 +150747,65 @@ } }, { - "name": "allowed_domains_template", - "type": "TypeBool", - "description": "Determines whether to allow the domains that are supplied in the `allowed_domains` field to contain access control list (ACL) templates.", - "optional": true, - "computed": true - }, - { - "name": "allowed_uri_sans", - "type": "TypeList", - "description": "The URI Subject Alternative Names to allow for private certificates.Values can contain glob patterns, for example `spiffe://hostname/_*`.", + "name": "serial_number", + "type": "TypeString", + "description": "Unused field.", "optional": true, "computed": true, - "elem": { - "type": "TypeString" - } + "deprecated": "This field is deprecated." }, { - "name": "key_usage", - "type": "TypeList", - "description": "The allowed key usage constraint to define for private certificates.You can find valid values in the [Go x509 package documentation](https://pkg.go.dev/crypto/x509#KeyUsage). Omit the `KeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } - } - ], - "ibm_sm_public_certificate": [ - { - "name": "version_custom_metadata", - "type": "TypeMap", - "description": "The secret version metadata that a user can customize.", - "immutable": true, + "name": "allow_any_name", + "type": "TypeBool", + "description": "Determines whether to allow clients to request a private certificate that matches any common name.", "optional": true, - "elem": { - "type": "TypeString" - } + "computed": true }, { - "name": "locks_total", - "type": "TypeInt", - "description": "The number of locks of the secret.", + "name": "server_flag", + "type": "TypeBool", + "description": "Determines whether private certificates are flagged for server use.", + "optional": true, "computed": true }, { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, + "name": "use_csr_sans", + "type": "TypeBool", + "description": "When used with the `private_cert_configuration_action_sign_csr` action, this field determines whether to use the Subject Alternative Names(SANs) from a certificate signing request (CSR) instead of the SANs that are included in the data of the certificate.Does not include the common name in the CSR. To use the common name, include the `use_csr_common_name` property.", "optional": true, "computed": true }, { - "name": "description", + "name": "max_ttl", "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "description": "The maximum time-to-live (TTL) for certificates that are created by this CA.The value can be supplied as a string representation of a duration in hours, for example '8760h'. In the API response, this value is returned in seconds (integer).Minimum value is one hour (`1h`). Maximum value is 100 years (`876000h`).", "optional": true }, { - "name": "certificate", - "type": "TypeString", - "description": "The PEM-encoded contents of your certificate.", - "secure": true, - "computed": true - }, - { - "name": "private_key", - "type": "TypeString", - "description": "(Optional) The PEM-encoded private key to associate with the certificate.", - "secure": true, + "name": "allow_localhost", + "type": "TypeBool", + "description": "Determines whether to allow `localhost` to be included as one of the requested common names.", + "optional": true, "computed": true }, { - "name": "serial_number", - "type": "TypeString", - "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", + "name": "allowed_domains_template", + "type": "TypeBool", + "description": "Determines whether to allow the domains that are supplied in the `allowed_domains` field to contain access control list (ACL) templates.", + "optional": true, "computed": true }, { - "name": "name", - "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", - "required": true - }, - { - "name": "secret_group_id", - "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, + "name": "email_protection_flag", + "type": "TypeBool", + "description": "Determines whether private certificates are flagged for email protection use.", "optional": true, "computed": true }, { - "name": "alt_names", + "name": "ext_key_usage", "type": "TypeList", - "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", - "immutable": true, + "description": "The allowed extended key usage constraint on private certificates.You can find valid values in the [Go x509 package documentation](https://golang.org/pkg/crypto/x509/#ExtKeyUsage). Omit the `ExtKeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", "optional": true, "computed": true, "elem": { @@ -145085,21 +150813,22 @@ } }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", + "name": "not_before_duration_seconds", + "type": "TypeInt", + "description": "The duration in seconds by which to backdate the `not_before` property of an issued private certificate.", "computed": true }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "The date when a resource was recently modified. The date format follows RFC 3339.", - "computed": true + "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", + "immutable": true, + "required": true }, { - "name": "labels", + "name": "ou", "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "description": "The Organizational Unit (OU) values to define in the subject field of the resulting certificate.", "optional": true, "computed": true, "elem": { @@ -145107,36 +150836,21 @@ } }, { - "name": "common_name", - "type": "TypeString", - "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", - "immutable": true, - "required": true - }, - { - "name": "signing_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", - "computed": true - }, - { - "name": "expiration_date", - "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "issuer", - "type": "TypeString", - "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "name": "enforce_hostnames", + "type": "TypeBool", + "description": "Determines whether to enforce only valid host names for common names, DNS Subject Alternative Names, and the host section of email addresses.", + "optional": true, "computed": true }, { - "name": "intermediate", - "type": "TypeString", - "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", - "secure": true, - "computed": true + "name": "key_usage", + "type": "TypeList", + "description": "The allowed key usage constraint to define for private certificates.You can find valid values in the [Go x509 package documentation](https://pkg.go.dev/crypto/x509#KeyUsage). Omit the `KeyUsage` part of the value. Values are not case-sensitive. To specify no key usage constraints, set this field to an empty list.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } }, { "name": "instance_id", @@ -145145,45 +150859,29 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - }, - { - "name": "key_algorithm", - "type": "TypeString", - "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", - "default_value": "RSA2048", - "immutable": true, - "optional": true - }, + } + ], + "ibm_sm_public_certificate": [ { - "name": "dns", - "type": "TypeString", - "description": "The name of the DNS provider configuration.", + "name": "version_custom_metadata", + "type": "TypeMap", + "description": "The secret version metadata that a user can customize.", "immutable": true, - "required": true - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true + "optional": true, + "elem": { + "type": "TypeString" + } }, { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", + "name": "downloaded", + "type": "TypeBool", + "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", "computed": true }, { - "name": "secret_type", + "name": "signing_algorithm", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate.", "computed": true }, { @@ -145275,37 +150973,121 @@ } }, { - "name": "secret_id", + "name": "serial_number", "type": "TypeString", - "description": "A v4 UUID identifier.", + "description": "The unique serial number that was assigned to a certificate by the issuing certificate authority.", "computed": true }, { - "name": "validity", + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "custom_metadata", + "type": "TypeMap", + "description": "The secret metadata that a user can customize.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "secret_group_id", + "type": "TypeString", + "description": "A v4 UUID identifier, or `default` secret group.", + "immutable": true, + "optional": true, + "computed": true + }, + { + "name": "common_name", + "type": "TypeString", + "description": "The Common Name (AKA CN) represents the server name that is protected by the SSL certificate.", + "immutable": true, + "required": true + }, + { + "name": "dns", + "type": "TypeString", + "description": "The name of the DNS provider configuration.", + "immutable": true, + "required": true + }, + { + "name": "rotation", "type": "TypeList", - "description": "The date and time that the certificate validity period begins and ends.", + "description": "Determines whether Secrets Manager rotates your secrets automatically.", + "optional": true, "computed": true, "elem": { - "not_after": { - "name": "not_after", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", + "auto_rotate": { + "name": "auto_rotate", + "type": "TypeBool", + "description": "Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your certificate 31 days before it expires.", + "optional": true, "computed": true }, - "not_before": { - "name": "not_before", - "type": "TypeString", - "description": "The date-time format follows RFC 3339.", + "rotate_keys": { + "name": "rotate_keys", + "type": "TypeBool", + "description": "Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate.", + "optional": true, "computed": true } - } + }, + "max_items": 1 }, { - "name": "endpoint_type", + "name": "state_description", "type": "TypeString", - "description": "public or private.", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "private_key", + "type": "TypeString", + "description": "(Optional) The PEM-encoded private key to associate with the certificate.", + "secure": true, + "computed": true + }, + { + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", "optional": true }, + { + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true + }, + { + "name": "issuer", + "type": "TypeString", + "description": "The distinguished name that identifies the entity that signed and issued the certificate.", + "computed": true + }, { "name": "ca", "type": "TypeString", @@ -145313,6 +151095,74 @@ "immutable": true, "required": true }, + { + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true + }, + { + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "key_algorithm", + "type": "TypeString", + "description": "The identifier for the cryptographic algorithm to be used to generate the public key that is associated with the certificate.The algorithm that you select determines the encryption algorithm (`RSA` or `ECDSA`) and key size to be used to generate keys and sign certificates. For longer living certificates, it is recommended to use longer keys to provide more encryption protection. Allowed values: RSA2048, RSA4096, EC256, EC384.", + "default_value": "RSA2048", + "immutable": true, + "optional": true + }, + { + "name": "secret_id", + "type": "TypeString", + "description": "A v4 UUID identifier.", + "computed": true + }, + { + "name": "updated_at", + "type": "TypeString", + "description": "The date when a resource was recently modified. The date format follows RFC 3339.", + "computed": true + }, + { + "name": "certificate", + "type": "TypeString", + "description": "The PEM-encoded contents of your certificate.", + "secure": true, + "computed": true + }, + { + "name": "intermediate", + "type": "TypeString", + "description": "(Optional) The PEM-encoded intermediate certificate to associate with the root certificate.", + "secure": true, + "computed": true + }, + { + "name": "name", + "type": "TypeString", + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true + }, { "name": "bundle_certs", "type": "TypeBool", @@ -145322,9 +151172,36 @@ "optional": true }, { - "name": "custom_metadata", - "type": "TypeMap", - "description": "The secret metadata that a user can customize.", + "name": "validity", + "type": "TypeList", + "description": "The date and time that the certificate validity period begins and ends.", + "computed": true, + "elem": { + "not_after": { + "name": "not_after", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + }, + "not_before": { + "name": "not_before", + "type": "TypeString", + "description": "The date-time format follows RFC 3339.", + "computed": true + } + } + }, + { + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "computed": true + }, + { + "name": "alt_names", + "type": "TypeList", + "description": "With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate.", + "immutable": true, "optional": true, "computed": true, "elem": { @@ -145404,35 +151281,12 @@ "max_items": 1 }, { - "name": "downloaded", - "type": "TypeBool", - "description": "Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.", + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", "computed": true }, - { - "name": "rotation", - "type": "TypeList", - "description": "Determines whether Secrets Manager rotates your secrets automatically.", - "optional": true, - "computed": true, - "elem": { - "auto_rotate": { - "name": "auto_rotate", - "type": "TypeBool", - "description": "Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your certificate 31 days before it expires.", - "optional": true, - "computed": true - }, - "rotate_keys": { - "name": "rotate_keys", - "type": "TypeBool", - "description": "Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate.", - "optional": true, - "computed": true - } - }, - "max_items": 1 - }, { "name": "state", "type": "TypeInt", @@ -145440,28 +151294,13 @@ "computed": true }, { - "name": "state_description", + "name": "expiration_date", "type": "TypeString", - "description": "A text representation of the secret state.", + "description": "The date a secret is expired. The date format follows RFC 3339.", "computed": true } ], "ibm_sm_public_certificate_action_validate_manual_dns": [ - { - "name": "region", - "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", - "immutable": true, - "optional": true, - "computed": true - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, { "name": "secret_id", "type": "TypeString", @@ -145476,17 +151315,24 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - } - ], - "ibm_sm_public_certificate_configuration_ca_lets_encrypt": [ + }, { - "name": "instance_id", + "name": "region", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true + "optional": true, + "computed": true }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + } + ], + "ibm_sm_public_certificate_configuration_ca_lets_encrypt": [ { "name": "region", "type": "TypeString", @@ -145533,43 +151379,17 @@ "type": "TypeString", "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true - } - ], - "ibm_sm_public_certificate_configuration_dns_cis": [ - { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true }, { - "name": "name", + "name": "instance_id", "type": "TypeString", - "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", "immutable": true, "required": true - }, - { - "name": "config_type", - "type": "TypeString", - "description": "The configuration type.", - "computed": true - }, - { - "name": "cloud_internet_services_crn", - "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "required": true, - "min_length": 9, - "max_length": 512, - "matches": "^crn:v[0-9](:([A-Za-z0-9-._~!$\u0026'()*+,;=@\\/]|%[0-9A-Z]{2})*){8}$" - }, - { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, + } + ], + "ibm_sm_public_certificate_configuration_dns_cis": [ { "name": "region", "type": "TypeString", @@ -145595,9 +151415,9 @@ "optional": true }, { - "name": "secret_type", + "name": "created_by", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "description": "The unique identifier that is associated with the entity that created the secret.", "computed": true }, { @@ -145606,6 +151426,18 @@ "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, + { + "name": "secret_type", + "type": "TypeString", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", + "computed": true + }, + { + "name": "created_at", + "type": "TypeString", + "description": "The date when a resource was created. The date format follows RFC 3339.", + "computed": true + }, { "name": "instance_id", "type": "TypeString", @@ -145613,34 +151445,44 @@ "cloud_data_type": "resource_instance", "immutable": true, "required": true - } - ], - "ibm_sm_public_certificate_configuration_dns_classic_infrastructure": [ + }, { - "name": "region", + "name": "name", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", + "description": "A human-readable unique name to assign to your configuration.To protect your privacy, do not use personal data, such as your name or location, as an name for your secret.", "immutable": true, - "optional": true, - "computed": true + "required": true }, { - "name": "endpoint_type", + "name": "config_type", "type": "TypeString", - "description": "public or private.", - "optional": true + "description": "The configuration type.", + "computed": true }, { - "name": "secret_type", + "name": "cloud_internet_services_crn", "type": "TypeString", - "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", - "computed": true + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "required": true, + "min_length": 9, + "max_length": 512, + "matches": "^crn:v[0-9](:([A-Za-z0-9-._~!$\u0026'()*+,;=@\\/]|%[0-9A-Z]{2})*){8}$" + } + ], + "ibm_sm_public_certificate_configuration_dns_classic_infrastructure": [ + { + "name": "classic_infrastructure_username", + "type": "TypeString", + "description": "The username that is associated with your classic infrastructure account.In most cases, your classic infrastructure username is your `\u003caccount_id\u003e_\u003cemail_address\u003e`. For more information, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", + "required": true, + "min_length": 2, + "max_length": 128, + "matches": "(.*?)" }, { - "name": "created_by", + "name": "secret_type", "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", + "description": "The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.", "computed": true }, { @@ -145649,15 +151491,6 @@ "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, - { - "name": "classic_infrastructure_password", - "type": "TypeString", - "description": "Your classic infrastructure API key.For information about viewing and accessing your classic infrastructure API key, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", - "required": true, - "min_length": 2, - "max_length": 128, - "matches": "(.*?)" - }, { "name": "updated_at", "type": "TypeString", @@ -145665,12 +151498,13 @@ "computed": true }, { - "name": "instance_id", + "name": "region", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true + "optional": true, + "computed": true }, { "name": "name", @@ -145686,16 +151520,44 @@ "computed": true }, { - "name": "classic_infrastructure_username", + "name": "instance_id", "type": "TypeString", - "description": "The username that is associated with your classic infrastructure account.In most cases, your classic infrastructure username is your `\u003caccount_id\u003e_\u003cemail_address\u003e`. For more information, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, + { + "name": "endpoint_type", + "type": "TypeString", + "description": "public or private.", + "optional": true + }, + { + "name": "classic_infrastructure_password", + "type": "TypeString", + "description": "Your classic infrastructure API key.For information about viewing and accessing your classic infrastructure API key, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).", "required": true, "min_length": 2, "max_length": 128, "matches": "(.*?)" + }, + { + "name": "created_by", + "type": "TypeString", + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true } ], "ibm_sm_secret_group": [ + { + "name": "instance_id", + "type": "TypeString", + "description": "The ID of the Secrets Manager instance.", + "cloud_data_type": "resource_instance", + "immutable": true, + "required": true + }, { "name": "region", "type": "TypeString", @@ -145745,21 +151607,41 @@ "type": "TypeString", "description": "The date that a resource was recently modified. The date format follows RFC 3339.", "computed": true + } + ], + "ibm_sm_username_password_secret": [ + { + "name": "crn", + "type": "TypeString", + "description": "A CRN that uniquely identifies an IBM Cloud resource.", + "cloud_data_type": "crn", + "computed": true }, { - "name": "instance_id", + "name": "state_description", "type": "TypeString", - "description": "The ID of the Secrets Manager instance.", - "cloud_data_type": "resource_instance", + "description": "A text representation of the secret state.", + "computed": true + }, + { + "name": "versions_total", + "type": "TypeInt", + "description": "The number of versions of the secret.", + "computed": true + }, + { + "name": "region", + "type": "TypeString", + "description": "The region of the Secrets Manager instance.", + "cloud_data_type": "region", "immutable": true, - "required": true - } - ], - "ibm_sm_username_password_secret": [ + "optional": true, + "computed": true + }, { - "name": "secret_id", + "name": "next_rotation_date", "type": "TypeString", - "description": "A v4 UUID identifier.", + "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", "computed": true }, { @@ -145793,17 +151675,12 @@ "max_items": 1 }, { - "name": "created_at", - "type": "TypeString", - "description": "The date when a resource was created. The date format follows RFC 3339.", - "computed": true - }, - { - "name": "crn", + "name": "password", "type": "TypeString", - "description": "A CRN that uniquely identifies an IBM Cloud resource.", - "cloud_data_type": "crn", - "computed": true + "description": "The password that is assigned to the secret.", + "secure": true, + "immutable": true, + "required": true }, { "name": "downloaded", @@ -145812,76 +151689,61 @@ "computed": true }, { - "name": "locks_total", + "name": "state", "type": "TypeInt", - "description": "The number of locks of the secret.", + "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", "computed": true }, { - "name": "name", + "name": "created_by", "type": "TypeString", - "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", - "required": true - }, - { - "name": "labels", - "type": "TypeList", - "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "description": "The unique identifier that is associated with the entity that created the secret.", + "computed": true }, { - "name": "secret_group_id", + "name": "created_at", "type": "TypeString", - "description": "A v4 UUID identifier, or `default` secret group.", - "immutable": true, - "optional": true, + "description": "The date when a resource was created. The date format follows RFC 3339.", "computed": true }, { - "name": "username", - "type": "TypeString", - "description": "The username that is assigned to the secret.", - "immutable": true, - "required": true + "name": "locks_total", + "type": "TypeInt", + "description": "The number of locks of the secret.", + "computed": true }, { - "name": "password", + "name": "endpoint_type", "type": "TypeString", - "description": "The password that is assigned to the secret.", - "secure": true, - "immutable": true, - "required": true + "description": "public or private.", + "optional": true }, { - "name": "state", - "type": "TypeInt", - "description": "The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values.", - "computed": true + "name": "description", + "type": "TypeString", + "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", + "optional": true }, { - "name": "state_description", + "name": "expiration_date", "type": "TypeString", - "description": "A text representation of the secret state.", - "computed": true + "description": "The date a secret is expired. The date format follows RFC 3339.", + "optional": true }, { - "name": "region", + "name": "secret_group_id", "type": "TypeString", - "description": "The region of the Secrets Manager instance.", - "cloud_data_type": "region", + "description": "A v4 UUID identifier, or `default` secret group.", "immutable": true, "optional": true, "computed": true }, { - "name": "expiration_date", + "name": "username", "type": "TypeString", - "description": "The date a secret is expired. The date format follows RFC 3339.", - "optional": true + "description": "The username that is assigned to the secret.", + "immutable": true, + "required": true }, { "name": "secret_type", @@ -145899,42 +151761,12 @@ "type": "TypeString" } }, - { - "name": "created_by", - "type": "TypeString", - "description": "The unique identifier that is associated with the entity that created the secret.", - "computed": true - }, - { - "name": "next_rotation_date", - "type": "TypeString", - "description": "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.", - "computed": true - }, - { - "name": "endpoint_type", - "type": "TypeString", - "description": "public or private.", - "optional": true - }, - { - "name": "description", - "type": "TypeString", - "description": "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.", - "optional": true - }, { "name": "updated_at", "type": "TypeString", "description": "The date when a resource was recently modified. The date format follows RFC 3339.", "computed": true }, - { - "name": "versions_total", - "type": "TypeInt", - "description": "The number of versions of the secret.", - "computed": true - }, { "name": "instance_id", "type": "TypeString", @@ -145952,6 +151784,28 @@ "elem": { "type": "TypeString" } + }, + { + "name": "labels", + "type": "TypeList", + "description": "Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "name", + "type": "TypeString", + "description": "A human-readable name to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as a name for your secret.", + "required": true + }, + { + "name": "secret_id", + "type": "TypeString", + "description": "A v4 UUID identifier.", + "computed": true } ], "ibm_space": [ @@ -146014,121 +151868,64 @@ ], "ibm_ssl_certificate": [ { - "name": "order_approver_email_address", - "type": "TypeString", - "description": "Email address of the approver", - "required": true - }, - { - "name": "billing_contact_same_as_technical_flag", - "type": "TypeBool", - "description": "billing contact", - "default_value": false, - "optional": true - }, - { - "name": "administrative_address_same_as_organization_flag", - "type": "TypeBool", - "description": "administrative address same as organization flag", - "default_value": false, - "optional": true - }, - { - "name": "server_count", - "type": "TypeInt", - "description": "Server count", - "required": true - }, - { - "name": "renewal_flag", - "type": "TypeBool", - "description": "Renewal flag", - "default_value": true, - "optional": true - }, - { - "name": "billing_address_same_as_organization_flag", - "type": "TypeBool", - "description": "billing address same as organization flag", - "default_value": false, - "optional": true - }, - { - "name": "technical_contact", + "name": "organization_information", "type": "TypeSet", - "description": "Technical contact info", + "description": "Organization information", "required": true, "elem": { - "tech_address": { - "name": "tech_address", + "org_address": { + "name": "org_address", "type": "TypeSet", - "optional": true, + "description": "Organization address", + "required": true, "elem": { - "tech_address_line1": { - "name": "tech_address_line1", + "org_address_line1": { + "name": "org_address_line1", "type": "TypeString", - "optional": true + "required": true }, - "tech_address_line2": { - "name": "tech_address_line2", + "org_address_line2": { + "name": "org_address_line2", "type": "TypeString", "optional": true }, - "tech_city": { - "name": "tech_city", + "org_city": { + "name": "org_city", "type": "TypeString", - "optional": true + "required": true }, - "tech_country_code": { - "name": "tech_country_code", + "org_country_code": { + "name": "org_country_code", "type": "TypeString", - "optional": true + "required": true }, - "tech_postal_code": { - "name": "tech_postal_code", + "org_postal_code": { + "name": "org_postal_code", "type": "TypeString", - "optional": true + "required": true }, - "tech_state": { - "name": "tech_state", + "org_state": { + "name": "org_state", "type": "TypeString", - "optional": true + "required": true } } }, - "tech_email_address": { - "name": "tech_email_address", - "type": "TypeString", - "required": true - }, - "tech_fax_number": { - "name": "tech_fax_number", + "org_fax_number": { + "name": "org_fax_number", "type": "TypeString", "optional": true }, - "tech_first_name": { - "name": "tech_first_name", - "type": "TypeString", - "required": true - }, - "tech_last_name": { - "name": "tech_last_name", - "type": "TypeString", - "required": true - }, - "tech_organization_name": { - "name": "tech_organization_name", - "type": "TypeString", - "required": true - }, - "tech_phone_number": { - "name": "tech_phone_number", + "org_organization_name": { + "name": "org_organization_name", "type": "TypeString", + "description": "Organization name", "required": true }, - "tech_title": { - "name": "tech_title", + "org_phone_number": { + "name": "org_phone_number", "type": "TypeString", + "description": "Organization phone number", "required": true } }, @@ -146216,9 +152013,15 @@ "max_items": 1 }, { - "name": "validity_months", + "name": "server_count", "type": "TypeInt", - "description": "vslidity of the ssl certificate in month", + "description": "Server count", + "required": true + }, + { + "name": "ssl_type", + "type": "TypeString", + "description": "ssl type", "required": true }, { @@ -146228,82 +152031,107 @@ "required": true }, { - "name": "organization_information", + "name": "renewal_flag", + "type": "TypeBool", + "description": "Renewal flag", + "default_value": true, + "optional": true + }, + { + "name": "billing_address_same_as_organization_flag", + "type": "TypeBool", + "description": "billing address same as organization flag", + "default_value": false, + "optional": true + }, + { + "name": "administrative_contact_same_as_technical_flag", + "type": "TypeBool", + "description": "Administrative contact same as technical flag", + "default_value": false, + "optional": true + }, + { + "name": "technical_contact", "type": "TypeSet", - "description": "Organization information", + "description": "Technical contact info", "required": true, "elem": { - "org_address": { - "name": "org_address", + "tech_address": { + "name": "tech_address", "type": "TypeSet", - "description": "Organization address", - "required": true, + "optional": true, "elem": { - "org_address_line1": { - "name": "org_address_line1", + "tech_address_line1": { + "name": "tech_address_line1", "type": "TypeString", - "required": true + "optional": true }, - "org_address_line2": { - "name": "org_address_line2", + "tech_address_line2": { + "name": "tech_address_line2", "type": "TypeString", "optional": true }, - "org_city": { - "name": "org_city", + "tech_city": { + "name": "tech_city", "type": "TypeString", - "required": true + "optional": true }, - "org_country_code": { - "name": "org_country_code", + "tech_country_code": { + "name": "tech_country_code", "type": "TypeString", - "required": true + "optional": true }, - "org_postal_code": { - "name": "org_postal_code", + "tech_postal_code": { + "name": "tech_postal_code", "type": "TypeString", - "required": true + "optional": true }, - "org_state": { - "name": "org_state", + "tech_state": { + "name": "tech_state", "type": "TypeString", - "required": true + "optional": true } } }, - "org_fax_number": { - "name": "org_fax_number", + "tech_email_address": { + "name": "tech_email_address", + "type": "TypeString", + "required": true + }, + "tech_fax_number": { + "name": "tech_fax_number", "type": "TypeString", "optional": true }, - "org_organization_name": { - "name": "org_organization_name", + "tech_first_name": { + "name": "tech_first_name", "type": "TypeString", - "description": "Organization name", "required": true }, - "org_phone_number": { - "name": "org_phone_number", + "tech_last_name": { + "name": "tech_last_name", + "type": "TypeString", + "required": true + }, + "tech_organization_name": { + "name": "tech_organization_name", + "type": "TypeString", + "required": true + }, + "tech_phone_number": { + "name": "tech_phone_number", + "type": "TypeString", + "required": true + }, + "tech_title": { + "name": "tech_title", "type": "TypeString", - "description": "Organization phone number", "required": true } }, "max_items": 1 }, - { - "name": "server_type", - "type": "TypeString", - "description": "server type", - "required": true - }, - { - "name": "technical_contact_same_as_org_address_flag", - "type": "TypeBool", - "description": "Technical contact same as org address flag", - "default_value": false, - "optional": true - }, { "name": "billing_contact", "type": "TypeSet", @@ -146385,68 +152213,56 @@ "max_items": 1 }, { - "name": "ssl_type", + "name": "administrative_address_same_as_organization_flag", + "type": "TypeBool", + "description": "administrative address same as organization flag", + "default_value": false, + "optional": true + }, + { + "name": "server_type", "type": "TypeString", - "description": "ssl type", + "description": "server type", "required": true }, { - "name": "administrative_contact_same_as_technical_flag", + "name": "validity_months", + "type": "TypeInt", + "description": "vslidity of the ssl certificate in month", + "required": true + }, + { + "name": "order_approver_email_address", + "type": "TypeString", + "description": "Email address of the approver", + "required": true + }, + { + "name": "technical_contact_same_as_org_address_flag", "type": "TypeBool", - "description": "Administrative contact same as technical flag", + "description": "Technical contact same as org address flag", + "default_value": false, + "optional": true + }, + { + "name": "billing_contact_same_as_technical_flag", + "type": "TypeBool", + "description": "billing contact", "default_value": false, "optional": true } ], "ibm_storage_block": [ { - "name": "snapshot_capacity", - "type": "TypeInt", - "description": "Snapshot capacity in GB", - "immutable": true, - "optional": true - }, - { - "name": "allowed_hardware_ids", + "name": "allowed_virtual_guest_ids", "type": "TypeSet", - "description": "List of allowe hardware IDs", + "description": "List of allowed virtual guest IDs", "optional": true, "computed": true, "elem": { "type": "TypeInt" } }, - { - "name": "resource_name", - "type": "TypeString", - "description": "The name of the resource", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Storage block type", - "immutable": true, - "required": true - }, - { - "name": "capacity", - "type": "TypeInt", - "description": "Storage block size", - "required": true - }, - { - "name": "volumename", - "type": "TypeString", - "description": "Volume name", - "computed": true - }, - { - "name": "hostname", - "type": "TypeString", - "description": "Hostname", - "computed": true - }, { "name": "allowed_hardware_info", "type": "TypeSet", @@ -146476,28 +152292,49 @@ "deprecated": "Please use 'allowed_host_info' instead" }, { - "name": "target_address", - "type": "TypeList", - "description": "List of target Addresses", - "computed": true, - "elem": { - "type": "TypeString" - } + "name": "type", + "type": "TypeString", + "description": "Storage block type", + "immutable": true, + "required": true }, { - "name": "allowed_ip_addresses", - "type": "TypeSet", - "description": "Allowed IP addresses", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "datacenter", + "type": "TypeString", + "description": "Datacenter name", + "immutable": true, + "required": true }, { - "name": "tags", + "name": "lunid", + "type": "TypeString", + "description": "LUN Id", + "computed": true + }, + { + "name": "snapshot_capacity", + "type": "TypeInt", + "description": "Snapshot capacity in GB", + "immutable": true, + "optional": true + }, + { + "name": "os_format_type", + "type": "TypeString", + "description": "OS formatr type", + "immutable": true, + "required": true + }, + { + "name": "iops", + "type": "TypeFloat", + "description": "IOPS value required", + "required": true + }, + { + "name": "allowed_ip_addresses", "type": "TypeSet", - "description": "List of tags associated with the resource", - "cloud_data_type": "tags", + "description": "Allowed IP addresses", "optional": true, "elem": { "type": "TypeString" @@ -146512,14 +152349,35 @@ "optional": true }, { - "name": "resource_controller_url", + "name": "target_address", + "type": "TypeList", + "description": "List of target Addresses", + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "resource_name", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "description": "The name of the resource", "computed": true }, { - "name": "allowed_host_info", - "type": "TypeList", + "name": "capacity", + "type": "TypeInt", + "description": "Storage block size", + "required": true + }, + { + "name": "notes", + "type": "TypeString", + "description": "Additional note info", + "optional": true + }, + { + "name": "allowed_virtual_guest_info", + "type": "TypeSet", "computed": true, "elem": { "host_iqn": { @@ -146542,38 +152400,13 @@ "type": "TypeString", "computed": true } - } - }, - { - "name": "datacenter", - "type": "TypeString", - "description": "Datacenter name", - "immutable": true, - "required": true - }, - { - "name": "iops", - "type": "TypeFloat", - "description": "IOPS value required", - "required": true - }, - { - "name": "lunid", - "type": "TypeString", - "description": "LUN Id", - "computed": true - }, - { - "name": "os_format_type", - "type": "TypeString", - "description": "OS formatr type", - "immutable": true, - "required": true + }, + "deprecated": "Please use 'allowed_host_info' instead" }, { - "name": "allowed_virtual_guest_ids", + "name": "allowed_hardware_ids", "type": "TypeSet", - "description": "List of allowed virtual guest IDs", + "description": "List of allowe hardware IDs", "optional": true, "computed": true, "elem": { @@ -146581,14 +152414,30 @@ } }, { - "name": "notes", + "name": "tags", + "type": "TypeSet", + "description": "List of tags associated with the resource", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "volumename", "type": "TypeString", - "description": "Additional note info", - "optional": true + "description": "Volume name", + "computed": true }, { - "name": "allowed_virtual_guest_info", - "type": "TypeSet", + "name": "hostname", + "type": "TypeString", + "description": "Hostname", + "computed": true + }, + { + "name": "allowed_host_info", + "type": "TypeList", "computed": true, "elem": { "host_iqn": { @@ -146611,25 +152460,16 @@ "type": "TypeString", "computed": true } - }, - "deprecated": "Please use 'allowed_host_info' instead" + } + }, + { + "name": "resource_controller_url", + "type": "TypeString", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + "computed": true } ], "ibm_storage_evault": [ - { - "name": "virtual_instance_id", - "type": "TypeInt", - "description": "Virtual instance ID", - "immutable": true, - "optional": true - }, - { - "name": "hardware_instance_id", - "type": "TypeInt", - "description": "Hardware instance ID", - "immutable": true, - "optional": true - }, { "name": "username", "type": "TypeString", @@ -146671,32 +152511,46 @@ "type": "TypeInt", "description": "Capacity", "required": true + }, + { + "name": "virtual_instance_id", + "type": "TypeInt", + "description": "Virtual instance ID", + "immutable": true, + "optional": true + }, + { + "name": "hardware_instance_id", + "type": "TypeInt", + "description": "Hardware instance ID", + "immutable": true, + "optional": true } ], "ibm_storage_file": [ { - "name": "allowed_subnets", + "name": "volumename", + "type": "TypeString", + "description": "Storage volume name", + "computed": true + }, + { + "name": "allowed_virtual_guest_ids", "type": "TypeSet", - "description": "Allowed network subnets", + "description": "Virtual guest ID", "optional": true, + "computed": true, "elem": { - "type": "TypeString" + "type": "TypeInt" } }, { - "name": "iops", - "type": "TypeFloat", - "description": "iops rate", - "required": true - }, - { - "name": "allowed_hardware_ids", + "name": "allowed_subnets", "type": "TypeSet", - "description": "Hardaware ID", + "description": "Allowed network subnets", "optional": true, - "computed": true, "elem": { - "type": "TypeInt" + "type": "TypeString" } }, { @@ -146706,19 +152560,22 @@ "computed": true }, { - "name": "allowed_ip_addresses", - "type": "TypeSet", - "description": "Allowed range of IP addresses", - "optional": true, - "elem": { - "type": "TypeString" - } + "name": "resource_status", + "type": "TypeString", + "description": "The status of the resource", + "computed": true }, { - "name": "notes", + "name": "capacity", + "type": "TypeInt", + "description": "Storage capacity", + "required": true + }, + { + "name": "hostname", "type": "TypeString", - "description": "Notes", - "optional": true + "description": "Hostname", + "computed": true }, { "name": "mountpoint", @@ -146726,12 +152583,29 @@ "description": "Storage mount point", "computed": true }, + { + "name": "tags", + "type": "TypeSet", + "description": "Tags set for the storage volume", + "cloud_data_type": "tags", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "resource_controller_url", "type": "TypeString", "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, + { + "name": "type", + "type": "TypeString", + "description": "Storage type", + "immutable": true, + "required": true + }, { "name": "datacenter", "type": "TypeString", @@ -146740,27 +152614,43 @@ "required": true }, { - "name": "capacity", + "name": "snapshot_capacity", "type": "TypeInt", - "description": "Storage capacity", - "required": true + "description": "Snapshot capacity", + "immutable": true, + "optional": true }, { - "name": "hostname", + "name": "notes", "type": "TypeString", - "description": "Hostname", - "computed": true + "description": "Notes", + "optional": true }, { - "name": "allowed_virtual_guest_ids", + "name": "iops", + "type": "TypeFloat", + "description": "iops rate", + "required": true + }, + { + "name": "allowed_hardware_ids", "type": "TypeSet", - "description": "Virtual guest ID", + "description": "Hardaware ID", "optional": true, "computed": true, "elem": { "type": "TypeInt" } }, + { + "name": "allowed_ip_addresses", + "type": "TypeSet", + "description": "Allowed range of IP addresses", + "optional": true, + "elem": { + "type": "TypeString" + } + }, { "name": "snapshot_schedule", "type": "TypeSet", @@ -146804,16 +152694,6 @@ }, "max_items": 3 }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags set for the storage volume", - "cloud_data_type": "tags", - "optional": true, - "elem": { - "type": "TypeString" - } - }, { "name": "hourly_billing", "type": "TypeBool", @@ -146821,51 +152701,9 @@ "default_value": false, "immutable": true, "optional": true - }, - { - "name": "resource_status", - "type": "TypeString", - "description": "The status of the resource", - "computed": true - }, - { - "name": "type", - "type": "TypeString", - "description": "Storage type", - "immutable": true, - "required": true - }, - { - "name": "volumename", - "type": "TypeString", - "description": "Storage volume name", - "computed": true - }, - { - "name": "snapshot_capacity", - "type": "TypeInt", - "description": "Snapshot capacity", - "immutable": true, - "optional": true } ], "ibm_subnet": [ - { - "name": "private", - "type": "TypeBool", - "description": "private subnet", - "default_value": false, - "immutable": true, - "optional": true - }, - { - "name": "ip_version", - "type": "TypeInt", - "description": "ip version", - "default_value": 4, - "immutable": true, - "optional": true - }, { "name": "capacity", "type": "TypeInt", @@ -146874,12 +152712,11 @@ "required": true }, { - "name": "vlan_id", - "type": "TypeInt", - "description": "VLAN ID for the subnet", + "name": "endpoint_ip", + "type": "TypeString", + "description": "endpoint IP", "immutable": true, - "optional": true, - "computed": true + "optional": true }, { "name": "tags", @@ -146892,16 +152729,18 @@ } }, { - "name": "type", - "type": "TypeString", - "description": "subnet type", + "name": "private", + "type": "TypeBool", + "description": "private subnet", + "default_value": false, "immutable": true, - "required": true + "optional": true }, { - "name": "endpoint_ip", - "type": "TypeString", - "description": "endpoint IP", + "name": "ip_version", + "type": "TypeInt", + "description": "ip version", + "default_value": 4, "immutable": true, "optional": true }, @@ -146916,44 +152755,38 @@ "type": "TypeString", "description": "Notes", "optional": true - } - ], - "ibm_tg_connection": [ + }, { - "name": "remote_gateway_ip", + "name": "type", "type": "TypeString", - "description": "The remote gateway IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", + "description": "subnet type", "immutable": true, - "optional": true, - "computed": true + "required": true }, { - "name": "request_status", - "type": "TypeString", - "description": "Only visible for cross account connections, this field represents the status of the request to connect the given network between accounts.Possible values: [pending,approved,rejected,expired,detached]", + "name": "vlan_id", + "type": "TypeInt", + "description": "VLAN ID for the subnet", + "immutable": true, + "optional": true, "computed": true - }, + } + ], + "ibm_tg_connection": [ { - "name": "related_crn", + "name": "updated_at", "type": "TypeString", - "description": "The crn of the transit gateway", + "description": "The date and time that this connection was last updated", "computed": true }, { - "name": "connection_id", + "name": "local_gateway_ip", "type": "TypeString", - "description": "The Transit Gateway Connection identifier", + "description": "The local gateway IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", + "immutable": true, + "optional": true, "computed": true }, - { - "name": "name", - "type": "TypeString", - "description": "The user-defined name for this transit gateway. If unspecified, the name will be the network name (the name of the VPC in the case of network type 'vpc', and the word Classic, in the case of network type 'classic').", - "min_length": 1, - "max_length": 63, - "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$", - "optional": true - }, { "name": "local_tunnel_ip", "type": "TypeString", @@ -146971,33 +152804,54 @@ "computed": true }, { - "name": "gateway", + "name": "remote_gateway_ip", "type": "TypeString", - "description": "The Transit Gateway identifier", + "description": "The remote gateway IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", "immutable": true, - "required": true + "optional": true, + "computed": true }, { - "name": "network_account_id", + "name": "base_connection_id", "type": "TypeString", - "description": "The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type 'unbound_gre_tunnel' when the associated_network_type is 'classic' and the GRE tunnel is in a different account than the gateway.", + "description": "The ID of a network_type 'classic' connection a tunnel is configured over. This field only applies to network type 'gre_tunnel' connections.", "immutable": true, "optional": true, "computed": true }, { - "name": "base_network_type", + "name": "status", "type": "TypeString", - "description": "The type of network the unbound gre tunnel is targeting. This field is required for network type 'unbound_gre_tunnel'.", - "optional": true, + "description": "What is the current configuration state of this connection. Possible values: [attached,failed,pending,deleting,detaching,detached]", "computed": true }, { - "name": "status", + "name": "request_status", "type": "TypeString", - "description": "What is the current configuration state of this connection. Possible values: [attached,failed,pending,deleting,detaching,detached]", + "description": "Only visible for cross account connections, this field represents the status of the request to connect the given network between accounts.Possible values: [pending,approved,rejected,expired,detached]", + "computed": true + }, + { + "name": "related_crn", + "type": "TypeString", + "description": "The crn of the transit gateway", + "computed": true + }, + { + "name": "connection_id", + "type": "TypeString", + "description": "The Transit Gateway Connection identifier", "computed": true }, + { + "name": "name", + "type": "TypeString", + "description": "The user-defined name for this transit gateway. If unspecified, the name will be the network name (the name of the VPC in the case of network type 'vpc', and the word Classic, in the case of network type 'classic').", + "min_length": 1, + "max_length": 63, + "matches": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$", + "optional": true + }, { "name": "network_id", "type": "TypeString", @@ -147007,53 +152861,53 @@ "computed": true }, { - "name": "remote_tunnel_ip", + "name": "network_account_id", "type": "TypeString", - "description": "The remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", + "description": "The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type 'unbound_gre_tunnel' when the associated_network_type is 'classic' and the GRE tunnel is in a different account than the gateway.", "immutable": true, "optional": true, "computed": true }, { - "name": "created_at", + "name": "network_type", "type": "TypeString", - "description": "The date and time that this connection was created", - "computed": true + "description": "Defines what type of network is connected via this connection. Allowable values (classic,directlink,vpc,gre_tunnel,unbound_gre_tunnel,power_virtual_server)", + "immutable": true, + "required": true, + "options": "classic, directlink, vpc, gre_tunnel, unbound_gre_tunnel, power_virtual_server" }, { - "name": "zone", + "name": "remote_tunnel_ip", "type": "TypeString", - "description": "Location of GRE tunnel. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", + "description": "The remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", "immutable": true, "optional": true, "computed": true }, { - "name": "updated_at", + "name": "created_at", "type": "TypeString", - "description": "The date and time that this connection was last updated", + "description": "The date and time that this connection was created", "computed": true }, { - "name": "network_type", + "name": "gateway", "type": "TypeString", - "description": "Defines what type of network is connected via this connection. Allowable values (classic,directlink,vpc,gre_tunnel,unbound_gre_tunnel,power_virtual_server)", + "description": "The Transit Gateway identifier", "immutable": true, - "required": true, - "options": "classic, directlink, vpc, gre_tunnel, unbound_gre_tunnel, power_virtual_server" + "required": true }, { - "name": "base_connection_id", + "name": "base_network_type", "type": "TypeString", - "description": "The ID of a network_type 'classic' connection a tunnel is configured over. This field only applies to network type 'gre_tunnel' connections.", - "immutable": true, + "description": "The type of network the unbound gre tunnel is targeting. This field is required for network type 'unbound_gre_tunnel'.", "optional": true, "computed": true }, { - "name": "local_gateway_ip", + "name": "zone", "type": "TypeString", - "description": "The local gateway IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", + "description": "Location of GRE tunnel. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections.", "immutable": true, "optional": true, "computed": true @@ -147085,17 +152939,11 @@ ], "ibm_tg_connection_prefix_filter": [ { - "name": "filter_id", + "name": "created_at", "type": "TypeString", - "description": "The Transit Gateway Connection Prefix Filter identifier", + "description": "The date and time that this prefix filter was created", "computed": true }, - { - "name": "before", - "type": "TypeString", - "description": "Identifier of prefix filter that handles ordering", - "optional": true - }, { "name": "ge", "type": "TypeInt", @@ -147108,6 +152956,24 @@ "description": "IP Prefix", "required": true }, + { + "name": "connection_id", + "type": "TypeString", + "description": "The Transit Gateway Connection identifier", + "required": true + }, + { + "name": "filter_id", + "type": "TypeString", + "description": "The Transit Gateway Connection Prefix Filter identifier", + "computed": true + }, + { + "name": "before", + "type": "TypeString", + "description": "Identifier of prefix filter that handles ordering", + "optional": true + }, { "name": "updated_at", "type": "TypeString", @@ -147121,12 +152987,6 @@ "immutable": true, "required": true }, - { - "name": "connection_id", - "type": "TypeString", - "description": "The Transit Gateway Connection identifier", - "required": true - }, { "name": "action", "type": "TypeString", @@ -147134,12 +152994,6 @@ "required": true, "options": "permit, deny" }, - { - "name": "created_at", - "type": "TypeString", - "description": "The date and time that this prefix filter was created", - "computed": true - }, { "name": "le", "type": "TypeInt", @@ -147149,64 +153003,49 @@ ], "ibm_tg_gateway": [ { - "name": "location", + "name": "status", "type": "TypeString", - "description": "Location of Transit Gateway Services", - "cloud_data_type": "region", - "immutable": true, - "required": true + "description": "The Status of the resource", + "computed": true }, { - "name": "name", + "name": "resource_status", "type": "TypeString", - "description": "Name Transit Gateway Services", - "required": true, - "options": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$}", - "min_length": 1, - "max_length": 63 - }, - { - "name": "tags", - "type": "TypeSet", - "description": "Tags for the transit gateway instance", - "min_length": 1, - "max_length": 128, - "matches": "^[A-Za-z0-9:_ .-]+$", - "optional": true, - "computed": true, - "elem": { - "type": "TypeString" - } + "description": "The status of the resource", + "computed": true }, { - "name": "resource_group", + "name": "resource_group_name", "type": "TypeString", - "cloud_data_type": "resource_group", - "optional": true, + "description": "The resource group name in which resource is provisioned", "computed": true }, { - "name": "updated_at", + "name": "name", "type": "TypeString", - "description": "The updation time of the resource", - "computed": true + "description": "Name Transit Gateway Services", + "required": true, + "options": "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$}", + "min_length": 1, + "max_length": 63 }, { - "name": "resource_crn", + "name": "crn", "type": "TypeString", "description": "The crn of the resource", + "cloud_data_type": "crn", "computed": true }, { - "name": "resource_status", + "name": "updated_at", "type": "TypeString", - "description": "The status of the resource", + "description": "The updation time of the resource", "computed": true }, { - "name": "resource_group_name", + "name": "resource_controller_url", "type": "TypeString", - "description": "The resource group name in which resource is provisioned", + "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", "computed": true }, { @@ -147217,43 +153056,53 @@ "optional": true }, { - "name": "crn", + "name": "tags", + "type": "TypeSet", + "description": "Tags for the transit gateway instance", + "min_length": 1, + "max_length": 128, + "matches": "^[A-Za-z0-9:_ .-]+$", + "optional": true, + "computed": true, + "elem": { + "type": "TypeString" + } + }, + { + "name": "created_at", "type": "TypeString", - "description": "The crn of the resource", - "cloud_data_type": "crn", + "description": "The creation time of the resource", "computed": true }, { - "name": "status", + "name": "resource_name", "type": "TypeString", - "description": "The Status of the resource", + "description": "The name of the resource", "computed": true }, { - "name": "resource_controller_url", + "name": "location", "type": "TypeString", - "description": "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - "computed": true + "description": "Location of Transit Gateway Services", + "cloud_data_type": "region", + "immutable": true, + "required": true }, { - "name": "created_at", + "name": "resource_group", "type": "TypeString", - "description": "The creation time of the resource", + "cloud_data_type": "resource_group", + "optional": true, "computed": true }, { - "name": "resource_name", + "name": "resource_crn", "type": "TypeString", - "description": "The name of the resource", + "description": "The crn of the resource", "computed": true } ], "ibm_tg_route_report": [ - { - "name": "status", - "type": "TypeString", - "computed": true - }, { "name": "updated_at", "type": "TypeString", @@ -147366,8 +153215,13 @@ } } } + }, + { + "name": "status", + "type": "TypeString", + "computed": true } ] }, - "Version": "1.58.0-beta0" + "Version": "1.59.0" } \ No newline at end of file diff --git a/version/version.go b/version/version.go index d370f1b90a..df2bae8a6f 100644 --- a/version/version.go +++ b/version/version.go @@ -5,7 +5,7 @@ import ( ) // Version is the current provider main version -const Version = "1.58.0-beta0" +const Version = "1.59.0" // GitCommit is the git commit that was compiled. This will be filled in by the compiler. var GitCommit string diff --git a/website/allowed-subcategories.txt b/website/allowed-subcategories.txt index 21cbcd0eca..1e97423139 100644 --- a/website/allowed-subcategories.txt +++ b/website/allowed-subcategories.txt @@ -36,4 +36,5 @@ Schematics Secrets Manager Security and Compliance Center Transit Gateway +Usage Reports VPC infrastructure diff --git a/website/docs/d/atracker_routes.html.markdown b/website/docs/d/atracker_routes.html.markdown index 8d871d9580..a451160ec4 100644 --- a/website/docs/d/atracker_routes.html.markdown +++ b/website/docs/d/atracker_routes.html.markdown @@ -8,7 +8,7 @@ subcategory: "Activity Tracker" # ibm_atracker_routes -Provides a read-only data source for atracker_routes. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +Provides a read-only data source to retrieve information about atracker_routes. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage diff --git a/website/docs/d/atracker_targets.html.markdown b/website/docs/d/atracker_targets.html.markdown index 7c63ee8d0d..2ff868251b 100644 --- a/website/docs/d/atracker_targets.html.markdown +++ b/website/docs/d/atracker_targets.html.markdown @@ -8,7 +8,7 @@ subcategory: "Activity Tracker" # ibm_atracker_targets -Provides a read-only data source for atracker_targets. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +Provides a read-only data source to retrieve information about atracker_targets. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example usage diff --git a/website/docs/d/billing_snapshot_list.html.markdown b/website/docs/d/billing_snapshot_list.html.markdown new file mode 100644 index 0000000000..4c7f384141 --- /dev/null +++ b/website/docs/d/billing_snapshot_list.html.markdown @@ -0,0 +1,70 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_billing_snapshot_list" +description: |- + Get information about billing_snapshot_list +subcategory: "Usage Reports" +--- + +# ibm_billing_snapshot_list + +Provides a read-only data source to retrieve information about a billing_snapshot_list. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_billing_snapshot_list" "billing_snapshot_list" { + date_from = 1675209600000 + date_to = 1675987200000 + month = "2023-02" +} +``` + +## Argument Reference + +You can specify the following arguments for this data source. + +* `date_from` - (Optional, Integer) Timestamp in milliseconds for which billing report snapshot is requested. +* `date_to` - (Optional, Integer) Timestamp in milliseconds for which billing report snapshot is requested. +* `month` - (Required, String) The month for which billing report snapshot is requested. Format is yyyy-mm. + +## Attribute Reference + +After your data source is created, you can read values from the following attributes. + +* `id` - The unique identifier of the billing_snapshot_list. +* `count` - (Integer) Number of total snapshots. +* `snapshots` - (List) +Nested schema for **snapshots**: + * `account_id` - (String) Account ID for which billing report snapshot is configured. + * `account_type` - (String) Type of account. Possible values are [enterprise, account]. + * Constraints: Allowable values are: `account`, `enterprise`. + * `billing_period` - (List) Period of billing in snapshot. + Nested schema for **billing_period**: + * `end` - (String) Date and time of end of billing in the respective snapshot. + * `start` - (String) Date and time of start of billing in the respective snapshot. + * `bucket` - (String) The name of the COS bucket to store the snapshot of the billing reports. + * `charset` - (String) Character encoding used. + * `compression` - (String) Compression format of the snapshot report. + * `content_type` - (String) Type of content stored in snapshot report. + * `created_on` - (String) Date and time of creation of snapshot. + * `expected_processed_at` - (Integer) Timestamp of snapshot processed. + * `files` - (List) List of location of reports. + Nested schema for **files**: + * `account_id` - (String) Account ID for which billing report is captured. + * `location` - (String) Absolute path of the billing report in the COS instance. + * `report_types` - (String) The type of billing report stored. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]. + * Constraints: Allowable values are: `account_summary`, `enterprise_summary`, `account_resource_instance_usage`. + * `month` - (String) Month of captured snapshot. + * Constraints: The value must match regular expression `/^\\d{4}\\-(0?[1-9]|1[012])$/`. + * `processed_at` - (Integer) Timestamp at which snapshot is captured. + * `report_types` - (List) List of report types configured for the snapshot. + Nested schema for **report_types**: + * `type` - (String) The type of billing report of the snapshot. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]. + * Constraints: Allowable values are: `account_summary`, `enterprise_summary`, `account_resource_instance_usage`. + * `version` - (String) Version of the snapshot. + * `snapshot_id` - (String) Id of the snapshot captured. + * `state` - (String) Status of the billing snapshot configuration. Possible values are [enabled, disabled]. + * Constraints: Allowable values are: `enabled`, `disabled`. + * `version` - (String) Version of the snapshot. + diff --git a/website/docs/d/en_destination_custom_email.html.markdown b/website/docs/d/en_destination_custom_email.html.markdown new file mode 100644 index 0000000000..355ff086ea --- /dev/null +++ b/website/docs/d/en_destination_custom_email.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: 'Event Notifications' +layout: 'ibm' +page_title: 'IBM : ibm_en_destination_custom_email' +description: |- + Get information about a Custom Email destination +--- + +# ibm_en_destination_custom_email + +Provides a read-only data source for Custom Email destination. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example usage + +```terraform +data "ibm_en_destination_custom_email" "custom_domain_email_en_destination" { + instance_guid = ibm_resource_instance.en_terraform_test_resource.guid + destination_id = ibm_en_destination_custom_email.destination1.destination_id +} +``` + +## Argument reference + +Review the argument reference that you can specify for your data source. + +- `instance_guid` - (Required, Forces new resource, String) Unique identifier for IBM Cloud Event Notifications instance. + +- `destination_id` - (Required, String) Unique identifier for Destination. + +## Attribute reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +- `id` - The unique identifier of the `custom_domain_email_en_destination`. + +- `name` - (String) Destination name. + +- `description` - (String) Destination description. + +- `subscription_count` - (Integer) Number of subscriptions. + +- `subscription_names` - (List) List of subscriptions. + +- `type` - (String) Destination type smtp_custom. + +- `config` - (List) Payload describing a destination configuration. + Nested scheme for **config**: + + - `params` - (List) + + Nested scheme for **params**: + + - `domain` - (String) The Custom Domain. + +- `updated_at` - (String) Last updated time. diff --git a/website/docs/d/en_sources.html copy.markdown b/website/docs/d/en_sources.html.markdown similarity index 100% rename from website/docs/d/en_sources.html copy.markdown rename to website/docs/d/en_sources.html.markdown diff --git a/website/docs/d/en_subscription_custom_email.html.markdown b/website/docs/d/en_subscription_custom_email.html.markdown new file mode 100644 index 0000000000..b02429c7b4 --- /dev/null +++ b/website/docs/d/en_subscription_custom_email.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: 'Event Notifications' +layout: 'ibm' +page_title: 'IBM : ibm_en_subscription_custom_email' +description: |- + Get information about a Custom Email subscription +--- + +# ibm_en_subscription_custom_email + +Provides a read-only data source for Custom Email subscription. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example usage + +```terraform +data "ibm_en_subscription_custom_email" "custom_domain_email_subscription" { + instance_guid = ibm_resource_instance.en_terraform_test_resource.guid + subscription_id = ibm_en_subscription_custom_email.subscriptioncustomemail.subscription_id +} +``` + +## Argument reference + +Review the argument reference that you can specify for your data source. + +- `instance_guid` - (Required, Forces new resource, String) Unique identifier for IBM Cloud Event Notifications instance. + +- `subscription_id` - (Required, String) Unique identifier for Subscription. + +## Attribute reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +- `id` - The unique identifier of the email_subscription. + +- `name` - (String) Subscription name. + +- `description` - (String) Subscription description. + +- `destination_id` - (String) The destination ID. + +- `topic_id` - (String) Topic ID. + +- `attributes` - (Required, List) + + - `add_notification_payload` - (Boolean) Whether to add the notification payload to the email. + + - `reply_to_name` - (String) The Email User Name to reply to. + + - `reply_to_mail` - (String) The email address to reply to. + + - `from_name` - (String) The name of email address from which email is sourced. + + - `from_email` - (String) The email from where it is sourced. + + - `template_id_notification` - (String) The templete id for notification. + + - `template_id_invitation` - (String) The templete id for invitation. + + - `susbscribed`- (Map) The Email address who have subscribed for topic. + + - `unsubscribed`- (List) The Email address which has opted for unsusbscribtion from that topic. + + - `invited`- (List) The Email address for invitation. + +- `updated_at` - (String) Last updated time. diff --git a/website/docs/d/en_subscription_email.html.markdown b/website/docs/d/en_subscription_email.html.markdown index ff167e3b6e..6bfe727c44 100644 --- a/website/docs/d/en_subscription_email.html.markdown +++ b/website/docs/d/en_subscription_email.html.markdown @@ -41,9 +41,9 @@ In addition to all argument references listed, you can access the following attr - `topic_id` - (String) Topic ID. -- `add_notification_payload` - (Boolean) Whether to add the notification payload to the email. +- `attributes` - (Required, List) -- `additional_properties` - (Required, List) + - `add_notification_payload` - (Boolean) Whether to add the notification payload to the email. - `reply_to_name` - (String) The Email User Name to reply to. diff --git a/website/docs/d/is_backup_policies.html.markdown b/website/docs/d/is_backup_policies.html.markdown index 3b21acabf4..3e36540ebe 100644 --- a/website/docs/d/is_backup_policies.html.markdown +++ b/website/docs/d/is_backup_policies.html.markdown @@ -45,6 +45,13 @@ In addition to all argument reference list, you can access the following attribu Nested `backup_policies` blocks have the following structure: - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. + - `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. + - `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `id` - (String) The unique identifier for this backup policy. - `last_job_completed_at` - (String) he date and time that the most recent job for this backup policy completed. @@ -63,11 +70,17 @@ In addition to all argument reference list, you can access the following attribu - `id` - (String) The unique identifier for this backup policy plan. - `name` - (String) The unique user-defined name for this backup policy plan. - `resource_type` - (String) The type of resource referenced. - - `resource_group` - (List) The resource group object, for this backup policy. + - `resource_group` - (List) The resource group object, for this backup policy. Nested `resource_group` blocks have the following structure: - `href` - (String) The URL for this resource group. - `id` - (String) The unique identifier for this resource group. - `name` - (String) The user-defined name for this resource group. + - `scope` - (List) If present, the scope for this backup policy. + + Nested `scope` blocks have the following structure: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise or account. + - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_backup_policy.html.markdown b/website/docs/d/is_backup_policy.html.markdown index c6e2a1119b..6513f31bfa 100644 --- a/website/docs/d/is_backup_policy.html.markdown +++ b/website/docs/d/is_backup_policy.html.markdown @@ -42,6 +42,13 @@ In addition to all argument reference list, you can access the following attribu - `id` - The unique identifier of the BackupPolicy. - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `last_job_completed_at` - (String) he date and time that the most recent job for this backup policy completed. - `lifecycle_state` - (String) The lifecycle state of the backup policy. @@ -66,4 +73,11 @@ In addition to all argument reference list, you can access the following attribu - `id` - (String) The unique identifier for this resource group. - `name` - (String) The user-defined name for this resource group. - `resource_type` - (String) The type of resource referenced. +- `scope` - (List) If present, the scope for this backup policy. + + Nested `scope` blocks have the following structure: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise or account. + - `resource_type` - (String) The resource type. + diff --git a/website/docs/d/is_bare_metal_servers.markdown b/website/docs/d/is_bare_metal_servers.markdown index 58cf01fdaf..f94867efd5 100644 --- a/website/docs/d/is_bare_metal_servers.markdown +++ b/website/docs/d/is_bare_metal_servers.markdown @@ -36,9 +36,6 @@ Review the argument references that you can specify for your data source. - `vpc_name` (Optional, String) The name of the vpc this bare metal server is in - `vpc_crn` (Optional, String) The CRN of the vpc this bare metal server is in - `name` - (Optional, String) The name of the dedicated host group -- `network_interfaces_subnet` - (Optional, String) The ID of the subnet of the bare metal server network interfaces -- `network_interfaces_subnet_crn` - (Optional, String) The CRN of the subnet of the bare metal server network interfaces -- `network_interfaces_subnet_name` - (Optional, String) The name of the subnet of the bare metal server network interfaces ## Attribute Reference diff --git a/website/docs/d/is_dedicated_host.html.markdown b/website/docs/d/is_dedicated_host.html.markdown index b6a1750efa..106e8bca13 100644 --- a/website/docs/d/is_dedicated_host.html.markdown +++ b/website/docs/d/is_dedicated_host.html.markdown @@ -94,6 +94,15 @@ In addition to all argument reference list, you can access the following attribu - `lifecycle_state` - (String) The lifecycle state of the dedicated host resource. - `memory` - (String) The total amount of memory in `GB`` for this host. - `name` - (String) The unique user defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. +- `numa` - The dedicated host NUMA configuration. + + Nested scheme for `numa`: + - `count` - (Integer) The total number of NUMA nodes for this dedicated host. + - `nodes` - (List) The NUMA nodes for this dedicated host. + + Nested scheme for `nodes`: + - `available_vcpu` - (Integer) The available VCPU for this NUMA node. + - `vcpu` - (Integer) The total VCPU capacity for this NUMA node. - `profile` - (List) The profile this dedicated host uses. Nested scheme for `profile`: diff --git a/website/docs/d/is_dedicated_host_profile.html.markdown b/website/docs/d/is_dedicated_host_profile.html.markdown index c6303b20f0..d59aa5ad9c 100644 --- a/website/docs/d/is_dedicated_host_profile.html.markdown +++ b/website/docs/d/is_dedicated_host_profile.html.markdown @@ -57,6 +57,7 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `size`: - `type` - (String) The type for this profile field. - `value` - (String) The size of the disk in GB (gigabytes). + - `status` - (String) The status of the dedicated host profile. Values coule be, `previous`: This dedicated host profile is an older revision, but remains provisionable and usable. `current`: This profile is the latest revision. - `supported_instance_interface_types` - (List) Nested `supported_instance_interface_types` blocks have the following structure: Nested scheme for `supported_instance_interface_types`: diff --git a/website/docs/d/is_dedicated_host_profiles.html.markdown b/website/docs/d/is_dedicated_host_profiles.html.markdown index d058e79684..33e9106932 100644 --- a/website/docs/d/is_dedicated_host_profiles.html.markdown +++ b/website/docs/d/is_dedicated_host_profiles.html.markdown @@ -86,6 +86,7 @@ Review the argument references that you can specify for your data source. Nested scheme for `supported_instance_profiles`: - `href` - (String) The URL for this virtual server instance profile. - `name` - (String) The global unique name for this virtual server instance profile. + - `status` - (String) The status of the dedicated host profile. Values coule be, `previous`: This dedicated host profile is an older revision, but remains provisionable and usable. `current`: This profile is the latest revision. - `vcpu_architecture` - (List) Nested `vcpu_architecture` blocks have the following structure: Nested scheme for `vcpu_architecture`: diff --git a/website/docs/d/is_dedicated_hosts.html.markdown b/website/docs/d/is_dedicated_hosts.html.markdown index dc6cfbb8ae..03032ac7a1 100644 --- a/website/docs/d/is_dedicated_hosts.html.markdown +++ b/website/docs/d/is_dedicated_hosts.html.markdown @@ -94,6 +94,15 @@ In addition to all argument reference list, you can access the following attribu - `lifecycle_state` - (String) The lifecycle state of the dedicated host resource. - `memory` - (String) The total amount of memory in GB for this host. - `name` - (String) The unique user defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. + - `numa` - The dedicated host NUMA configuration. + + Nested scheme for `numa`: + - `count` - (Integer) The total number of NUMA nodes for this dedicated host. + - `nodes` - (List) The NUMA nodes for this dedicated host. + + Nested scheme for `nodes`: + - `available_vcpu` - (Integer) The available VCPU for this NUMA node. + - `vcpu` - (Integer) The total VCPU capacity for this NUMA node. - `profile` - (List) The profile this dedicated host uses. Nested scheme for `profile`: diff --git a/website/docs/d/is_flow_log.html.markdown b/website/docs/d/is_flow_log.html.markdown index 19e58e5bd8..21c3342f07 100644 --- a/website/docs/d/is_flow_log.html.markdown +++ b/website/docs/d/is_flow_log.html.markdown @@ -33,8 +33,8 @@ data "ibm_is_flow_log" "example" { Review the argument reference that you can specify for your data source. -- `identifier` - (Optional, String) The ID of the subnet, This is required when `name` is not specified. -- `name` - (Optional, String) The name of the subnet, This is required when `identifier` is not specified. +- `identifier` - (Optional, String) The ID of the flow log collector, This is required when `name` is not specified. +- `name` - (Optional, String) The name of the flow log collector, This is required when `identifier` is not specified. ## Attribute reference diff --git a/website/docs/d/is_instance.html.markdown b/website/docs/d/is_instance.html.markdown index eef79787eb..c330914f9a 100644 --- a/website/docs/d/is_instance.html.markdown +++ b/website/docs/d/is_instance.html.markdown @@ -172,6 +172,7 @@ In addition to all argument reference list, you can access the following attribu - `primary_ipv4_address` - (String) The IPv4 address range that the subnet uses. Same as `primary_ip.0.address` - `subnet` - (String) The ID of the subnet that is used in the more network interface. - `security_groups` (List)A list of security groups that were created for the interface. +- `numa_count` - (Integer) The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`. - `password` - (String) The password that you can use to access your instance. - `placement_target`- (List) The placement restrictions for the virtual server instance. diff --git a/website/docs/d/is_instance_profile.html.markdown b/website/docs/d/is_instance_profile.html.markdown index 3350195366..e34bb233cd 100644 --- a/website/docs/d/is_instance_profile.html.markdown +++ b/website/docs/d/is_instance_profile.html.markdown @@ -89,6 +89,7 @@ In addition to the argument reference list, you can access the following attribu - `default` - (String) The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - `type` - (String) The type for this profile field. - `values` - (String) The supported disk interfaces used for attaching the disk. +- `status` - (String) The status of the instance profile. Values coule be, `previous`: This instance profile is an older revision, but remains provisionable and usable. `current`: This profile is the latest revision. - `family` - (String) The family of the virtual server instance profile. - `gpu_count` - (List) Nested `gpu_count` blocks have the following structure: Nested scheme for `gpu_count`: @@ -133,6 +134,7 @@ In addition to the argument reference list, you can access the following attribu - `max` - (Integer) The maximum number of vNICs supported by an instance using this profile. - `min` - (Integer) The minimum number of vNICs supported by an instance using this profile. - `type` - (String) The type for this profile field, Ex: range or dependent. +- `numa_count` - (Integer) The number of NUMA nodes for the Instance Profile. - `port_speed` - (List) Nested `port_speed` blocks have the following structure: Nested scheme for `port_speed`: diff --git a/website/docs/d/is_instance_profiles.html.markdown b/website/docs/d/is_instance_profiles.html.markdown index 2b0a8ba980..e59d5a0a45 100644 --- a/website/docs/d/is_instance_profiles.html.markdown +++ b/website/docs/d/is_instance_profiles.html.markdown @@ -80,6 +80,7 @@ You can access the following attribute references after your data source is crea - `default` - (String) The disk interface used for attaching the disk. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally, halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - `type` - (String) The type for this profile field. - `values` - (String) The supported disk interfaces used for attaching the disk. + - `status` - (String) The status of the instance profile. Values coule be, `previous`: This instance profile is an older revision, but remains provisionable and usable. `current`: This profile is the latest revision. - `gpu_count` - (List) Nested `gpu_count` blocks have the following structure: Nested scheme for `gpu_count`: @@ -134,7 +135,7 @@ You can access the following attribute references after your data source is crea - `max` - (Integer) The maximum number of vNICs supported by an instance using this profile. - `min` - (Integer) The minimum number of vNICs supported by an instance using this profile. - `type` - (String) The type for this profile field, Ex: range or dependent. - + - `numa_count` - (Integer) The number of NUMA nodes for the Instance Profile. - `port_speed` - (List) Nested `port_speed` blocks have the following structure: Nested scheme for `port_speed`: diff --git a/website/docs/d/is_instances.html.markdown b/website/docs/d/is_instances.html.markdown index 94a14a428d..42a5e07edb 100644 --- a/website/docs/d/is_instances.html.markdown +++ b/website/docs/d/is_instances.html.markdown @@ -128,6 +128,7 @@ In addition to all argument reference list, you can access the following attribu - `primary_ipv4_address` - (String) The IPv4 address range that the subnet uses. Same as `primary_ip.0.address` - `subnet` - (String) The ID of the subnet that is used in the more network interface. - `security_groups` (List)A list of security groups that were created for the interface. + - `numa_count` - (Integer) The number of NUMA nodes this virtual server instance is provisioned on. This property may be absent if the instance's `status` is not `running`. - `placement_target`- (List) The placement restrictions for the virtual server instance. Nested scheme for `placement_target`: diff --git a/website/docs/d/is_share_mount_target.html.markdown b/website/docs/d/is_share_mount_target.html.markdown index b9c4e1a5b4..2b67534486 100644 --- a/website/docs/d/is_share_mount_target.html.markdown +++ b/website/docs/d/is_share_mount_target.html.markdown @@ -47,19 +47,39 @@ The following arguments are supported: The following attributes are exported: -- `created_at` - The date and time that the share target was created. -- `href` - The URL for this share target. -- `lifecycle_state` - The lifecycle state of the mount target. -- `mount_path` - The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future. +- `access_control_mode` - (String) The access control mode for the share. +- `created_at` - (String) The date and time that the share target was created. +- `href` - (String) The URL for this share target. +- `lifecycle_state` - (String) The lifecycle state of the mount target. +- `mount_path` - (String) The mount path for the share. The server component of the mount path may be either an IP address or a fully qualified domain name. + + This property will be absent if the lifecycle_state of the mount target is 'pending', failed, or deleting. + + -> **If the share's access_control_mode is:** + • security_group: The IP address used in the mount path is the primary_ip address of the virtual network interface for this share mount target.
+ • vpc: The fully-qualified domain name used in the mount path is an address that resolves to the share mount target.
- `name` - The user-defined name for this share target. -- `resource_type` - The type of resource referenced. +- `resource_type` - (String) The type of resource referenced. - `transit_encryption` - (String) The transit encryption mode for this share target. -- `vpc` - The VPC to which this share target is allowing to mount the file share. Nested `vpc` blocks have the following structure: - - `crn` - The CRN for this VPC. - - `deleted` - If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: - - `more_info` - Link to documentation about deleted resources. - - `href` - The URL for this VPC. - - `id` - The unique identifier for this VPC. - - `name` - The unique user-defined name for this VPC. - - `resource_type` - The resource type. - +- `vpc` - (List) The VPC to which this share target is allowing to mount the file share. Nested `vpc` blocks have the following structure: + - `crn` - (String) The CRN for this VPC. + - `deleted` - (String) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this VPC. + - `id` - (String) The unique identifier for this VPC. + - `name` - (String) The unique user-defined name for this VPC. + - `resource_type` - (String) The resource type. +- `subnet` - (List) The subnet of the virtual network interface for the share mount target. Nested `subnet` blocks have the following structure: + - `crn` - (String) The CRN for this subnet. + - `deleted` - (String) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this subnet. + - `id` - (String) The unique identifier for this subnet. + - `name` - (String) The unique user-defined name for this subnet. + - `resource_type` - (String) The resource type. +- `virtual_network_interface` - (List) The virtual network interface for this file share mount target.. Nested `virtual_network_interface` blocks have the following structure: + - `crn` - (String) The CRN for this virtual network interface. + - `href` - (String) The URL for this virtual network interface. + - `id` - (String) The unique identifier for this virtual network interface. + - `name` - (String) The unique user-defined name for this virtual network interface. + - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_share_mount_targets.html.markdown b/website/docs/d/is_share_mount_targets.html.markdown index 830530bae3..17d59f25f4 100644 --- a/website/docs/d/is_share_mount_targets.html.markdown +++ b/website/docs/d/is_share_mount_targets.html.markdown @@ -40,20 +40,41 @@ The following attributes are exported: - `id` - The unique identifier of the ShareTargetCollection. - `mount_targets` - Collection of share targets. Nested `targets` blocks have the following structure: - - `created_at` - The date and time that the share target was created. - - `href` - The URL for this share target. - - `id` - The unique identifier for this share target. - - `lifecycle_state` - The lifecycle state of the mount target. - - `mount_path` - The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future. - - `name` - The user-defined name for this share target. - - `resource_type` - The type of resource referenced. + - `access_control_mode` - (String) The access control mode for the share. + - `created_at` - (String) The date and time that the share target was created. + - `href` - (String) The URL for this share target. + - `id` - (String) The unique identifier for this share target. + - `lifecycle_state` - (String) The lifecycle state of the mount target. + - `mount_path` - (String) The mount path for the share. The server component of the mount path may be either an IP address or a fully qualified domain name. + + This property will be absent if the lifecycle_state of the mount target is 'pending', failed, or deleting. + + -> **If the share's access_control_mode is:** + • security_group: The IP address used in the mount path is the primary_ip address of the virtual network interface for this share mount target.
+ • vpc: The fully-qualified domain name used in the mount path is an address that resolves to the share mount target.
+ - `name` - (String) The user-defined name for this share target. + - `resource_type` - (String) The type of resource referenced. - `transit_encryption` - (String) The transit encryption mode for this share target. - `vpc` - The VPC to which this share target is allowing to mount the file share. Nested `vpc` blocks have the following structure: - - `crn` - The CRN for this VPC. - - `deleted` - If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: - - `more_info` - Link to documentation about deleted resources. - - `href` - The URL for this VPC. - - `id` - The unique identifier for this VPC. - - `name` - The unique user-defined name for this VPC. - - `resource_type` - The resource type. + - `crn` - (String) The CRN for this VPC. + - `deleted` - (String) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this VPC. + - `id` - (String) The unique identifier for this VPC. + - `name` - (String) The unique user-defined name for this VPC. + - `resource_type` - (String) The resource type. + - `subnet` - (List) The subnet of the virtual network interface for the share mount target. Nested `subnet` blocks have the following structure: + - `crn` - (String) The CRN for this subnet. + - `deleted` - (String) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this subnet. + - `id` - (String) The unique identifier for this subnet. + - `name` - (String) The unique user-defined name for this subnet. + - `resource_type` - (String) The resource type. + - `virtual_network_interface` - (List) The virtual network interface for this file share mount target.. Nested `virtual_network_interface` blocks have the following structure: + - `crn` - (String) The CRN for this virtual network interface. + - `href` - (String) The URL for this virtual network interface. + - `id` - (String) The unique identifier for this virtual network interface. + - `name` - (String) The unique user-defined name for this virtual network interface. + - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_vpn_gateway.html.markdown b/website/docs/d/is_vpn_gateway.html.markdown index 262f89b01c..da67f40b90 100644 --- a/website/docs/d/is_vpn_gateway.html.markdown +++ b/website/docs/d/is_vpn_gateway.html.markdown @@ -80,7 +80,27 @@ In addition to all argument references listed, you can access the following attr - `resource_type` - (String) The resource type. - `status` - (String) The status of the VPN gateway. - +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. +- `lifecycle_state` - (String) The lifecycle state of the VPN gateway. - `subnet` - (List) Nested scheme for **subnet**: - `crn` - (String) The CRN for this subnet. diff --git a/website/docs/d/is_vpn_gateway_connection.html.markdown b/website/docs/d/is_vpn_gateway_connection.html.markdown index 7f62d376dd..afcd61392d 100644 --- a/website/docs/d/is_vpn_gateway_connection.html.markdown +++ b/website/docs/d/is_vpn_gateway_connection.html.markdown @@ -99,6 +99,13 @@ In addition to all argument references listed, you can access the following attr - `status` - (String) The status of a VPN gateway connection. +- `status_reasons` - (List) Array of reasons for the current status (if any). + + Nested `status_reasons`: + - `code` - (String) The status reason code. + - `message` - (String) An explanation of the status reason. + - `more_info` - (String) Link to documentation about this status reason + - `tunnels` - (List) The VPN tunnel configuration for this VPN gateway connection (in static route mode). Nested scheme for **tunnels**: - `public_ip_address` - (String) The IP address of the VPN gateway member in which the tunnel resides. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered. diff --git a/website/docs/d/is_vpn_gateway_connections.html.markdown b/website/docs/d/is_vpn_gateway_connections.html.markdown index 8fb46c0861..28e1187ca3 100644 --- a/website/docs/d/is_vpn_gateway_connections.html.markdown +++ b/website/docs/d/is_vpn_gateway_connections.html.markdown @@ -59,3 +59,9 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `tunnels`: - `address` - (String) The IP address of the VPN gateway member in which the tunnel resides. - `status` - (String) The status of the VPN tunnel. +- `status_reasons` - (List) Array of reasons for the current status (if any). + + Nested `status_reasons`: + - `code` - (String) The status reason code. + - `message` - (String) An explanation of the status reason. + - `more_info` - (String) Link to documentation about this status reason. diff --git a/website/docs/d/is_vpn_gateways.html.markdown b/website/docs/d/is_vpn_gateways.html.markdown index 81e9a34fae..8c7a66df30 100644 --- a/website/docs/d/is_vpn_gateways.html.markdown +++ b/website/docs/d/is_vpn_gateways.html.markdown @@ -46,32 +46,53 @@ In addition to all argument reference list, you can access the following attribu - `created_at`- (Timestamp) The date and time the VPN gateway was created. - `id` - (String) The ID of the VPN gateway. - `name`- (String) The VPN gateway instance name. - - `members` - (List) Collection of VPN gateway members. - - Nested scheme for `members`: - - `address` - (String) The public IP address assigned to the VPN gateway member. - - `role`- (String) The high availability role assigned to the VPN gateway member. - - `private_ip` - (List) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. - Nested scheme for `private_ip`: - - `address` - (String) The IP address. If the address has not yet been selected, the value will be 0.0.0.0. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered. - - `href`- (String) The URL for this reserved IP - - `name`- (String) The user-defined or system-provided name for this reserved IP - - `reserved_ip`- (String) The unique identifier for this reserved IP - - `resource_type`- (String) The resource type. - - `private_address` - (String) The private IP address assigned to the VPN gateway member. Same as `private_ip.0.address` + - `members` - (List) Collection of VPN gateway members. + + Nested scheme for `members`: + - `address` - (String) The public IP address assigned to the VPN gateway member.
+ - `role`- (String) The high availability role assigned to the VPN gateway member.
+ - `private_ip` - (List) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. + + Nested scheme for `private_ip`: + - `address` - (String) The IP address. If the address has not yet been selected, the value will be 0.0.0.0. This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered. + - `private_address` - (String) The private IP address assigned to the VPN gateway member. Same as `private_ip.0.address`.
- `status` - (String) The status of the VPN gateway member. + + - `resource_type` - (String) The resource type, supported value is `vpn_gateway`. - `status` - (String) The status of the VPN gateway, supported values are **available**, **deleting**, **failed**, **pending**. + - `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. + - `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. +
**Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. + - `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. + - `lifecycle_state` - (String) The lifecycle state of the VPN gateway. - `subnet` - (String) The VPN gateway subnet information. - `tags`- (Optional, Array of Strings) A list of tags associated with the instance. - `vpc` - (String) The VPC this VPN server resides in. - `Nested scheme for `vpc`: - - `crn` - (String) The CRN for this VPC. - - `deleted` - (List) If present, this property indicates the referenced resource has been deleted and provides some supplementary information. - Nested scheme for **deleted**: - - `more_info` - (String) Link to documentation about deleted resources. - - `href` - (String) - The URL for this VPC - - `id` - (String) - The unique identifier for this VPC. - - `name` - (String) - The unique user-defined name for this VPC. + + Nested scheme for `vpc`: + - `crn` - (String) The CRN for this VPC. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted and provides some supplementary information. + Nested scheme for **deleted**: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) - The URL for this VPC + - `id` - (String) - The unique identifier for this VPC. + - `name` - (String) - The unique user-defined name for this VPC. - `resource_group` - (String) The resource group ID. - `mode` - (String) The VPN gateway mode, supported values are `policy` and `route`. \ No newline at end of file diff --git a/website/docs/d/is_vpn_server.html.markdown b/website/docs/d/is_vpn_server.html.markdown index 4cfc60971e..3d89b38063 100644 --- a/website/docs/d/is_vpn_server.html.markdown +++ b/website/docs/d/is_vpn_server.html.markdown @@ -64,12 +64,32 @@ In addition to all argument references listed, you can access the following attr - `enable_split_tunneling` - (Boolean) Indicates whether the split tunneling is enabled on this VPN server. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. + - `health_state` - (String) The health of this resource. + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `hostname` - (String) Fully qualified domain name assigned to this VPN server. - `href` - (String) The URL for this VPN server. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. + - `lifecycle_state` - (String) The lifecycle state of the VPN server. - `name` - (String) The unique user-defined name for this VPN server. diff --git a/website/docs/d/is_vpn_server_route.html.markdown b/website/docs/d/is_vpn_server_route.html.markdown index 869c323399..a5ad95bb2e 100644 --- a/website/docs/d/is_vpn_server_route.html.markdown +++ b/website/docs/d/is_vpn_server_route.html.markdown @@ -37,8 +37,28 @@ In addition to all argument references listed, you can access the following attr - `action` - (String) The action to perform with a packet matching the VPN route:- `translate`: translate the source IP address to one of the private IP addresses of the VPN server.- `deliver`: deliver the packet into the VPC.- `drop`: drop the packet The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the unexpected property value was encountered. - `created_at` - (String) The date and time that the VPN route was created. - `destination` - (String) The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will be dropped. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `href` - (String) The URL for this VPN route. - `lifecycle_state` - (String) The lifecycle state of the VPN route. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. - `name` - (String) The user-defined name for this VPN route. - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_vpn_server_routes.html.markdown b/website/docs/d/is_vpn_server_routes.html.markdown index bf188d17bd..8b5934bb7f 100644 --- a/website/docs/d/is_vpn_server_routes.html.markdown +++ b/website/docs/d/is_vpn_server_routes.html.markdown @@ -34,8 +34,28 @@ In addition to all argument references listed, you can access the following attr - `action` - (String) The action to perform with a packet matching the VPN route:- `translate`: translate the source IP address to one of the private IP addresses of the VPN server.- `deliver`: deliver the packet into the VPC.- `drop`: drop the packet The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the unexpected property value was encountered. - `created_at` - (String) The date and time that the VPN route was created. - `destination` - (String) The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will be dropped. + - `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. + - `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. +
**Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `href` - (String) The URL for this VPN route. - `id` - (String) The unique identifier for this VPN route. + - `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. - `lifecycle_state` - (String) The lifecycle state of the VPN route. - `name` - (String) The user-defined name for this VPN route. - `resource_type` - (String) The resource type. diff --git a/website/docs/d/is_vpn_servers.html.markdown b/website/docs/d/is_vpn_servers.html.markdown index bf1a0c3aeb..bed5c09caf 100644 --- a/website/docs/d/is_vpn_servers.html.markdown +++ b/website/docs/d/is_vpn_servers.html.markdown @@ -46,10 +46,28 @@ In addition to all argument references listed, you can access the following attr - `created_at` - (String) The date and time that the VPN server was created. - `crn` - (String) The CRN for this VPN server. - `enable_split_tunneling` - (Boolean) Indicates whether the split tunneling is enabled on this VPN server. + - `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. - `health_state` - (String) The health of this resource. - - `hostname` - (String) Fully qualified domain name assigned to this VPN server. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. +
**Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `hostname` - (String) Fully qualified domain name assigned to this VPN server. - `href` - (String) The URL for this VPN server. - `id` - (String) The unique identifier for this VPN server. + - `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. - `lifecycle_state` - (String) The lifecycle state of the VPN server. - `name` - (String) The unique user-defined name for this VPN server. - `port` - (Integer) The port number used by this VPN server. diff --git a/website/docs/d/metrics_router_targets.html.markdown b/website/docs/d/metrics_router_targets.html.markdown index 476553d35b..c5f5451b4f 100644 --- a/website/docs/d/metrics_router_targets.html.markdown +++ b/website/docs/d/metrics_router_targets.html.markdown @@ -34,7 +34,7 @@ In addition to all argument references listed, you can access the following attr Nested scheme for **targets**: * `created_at` - (String) The timestamp of the target creation time. * `crn` - (String) The crn of the target resource. - * `destination_crn` - (String) The CRN of the destination service instance or resource. + * `destination_crn` - (String) The CRN of the destination service instance or resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring&interface=ui#target-monitoring-ui) for details. * Constraints: The maximum length is `1000` characters. The minimum length is `3` characters. The value must match regular expression `/^[a-zA-Z0-9 \\-._:\/]+$/`. * `id` - (String) The UUID of the target resource. * `name` - (String) The name of the target resource. diff --git a/website/docs/d/pi_datacenter.html.markdown b/website/docs/d/pi_datacenter.html.markdown new file mode 100644 index 0000000000..36cdd88493 --- /dev/null +++ b/website/docs/d/pi_datacenter.html.markdown @@ -0,0 +1,64 @@ +--- + +subcategory: "Power Systems" +layout: "ibm" +page_title: "IBM: pi_datacenter" +description: |- + Manages a Datacenter in the Power Virtual Server cloud. +--- + +# ibm_pi_datacenter + +Retrieve information about a Power Systems Datacenter. + +## Example usage + +```terraform +data "ibm_pi_datacenter" "datacenter" { + pi_datacenter_zone= "dal12" +} +``` + +## Notes + +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` + +Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` + +## Argument reference + +Review the argument references that you can specify for your data source. + +- `pi_datacenter_zone` - (Optional, String) Datacenter zone you want to retrieve. If no value is supplied, the `zone` configured within the IBM provider will be utilized. + +## Attribute reference + +In addition to all argument reference list, you can access the following attribute references after your data source is created. + +- `pi_datacenter_capabilities` - (Map) Datacenter Capabilities. + + Nested schema for `pi_datacenter_capabilities`: + - `cloud-connections` - (Bool) Cloud-connections capability. + - `disaster-recovery-site` - (Bool) Disaster recovery site. + - `power-edge-router` - (Bool) Power edge router capability. + - `vpn-connections`- (Bool) VPN-connections capability. + - `sysdig-enabled`- (Bool) Sysdig-enabled capability. + +- `pi_datacenter_location` - (Map) Datacenter location. + + Nested schema for `pi_datacenter_location`: + - `region` - (String) The Datacenter location region zone. + - `type` - (String) The Datacenter location region type. + - `url`- (String) The Datacenter location region url. +- `pi_datacenter_status` - (String) The Datacenter status, `ACTIVE`,`MAINTENANCE` or `DOWN`. +- `pi_datacenter_type` - (String) The Datacenter type, `Public Cloud` or `Private Cloud`. diff --git a/website/docs/d/pi_datacenters.html.markdown b/website/docs/d/pi_datacenters.html.markdown new file mode 100644 index 0000000000..3d56abeca3 --- /dev/null +++ b/website/docs/d/pi_datacenters.html.markdown @@ -0,0 +1,61 @@ +--- + +subcategory: "Power Systems" +layout: "ibm" +page_title: "IBM: pi_datacenters" +description: |- + Manages Datacenters in the Power Virtual Server cloud. +--- + +# ibm_pi_datacenters + +Retrieve information about Power Systems Datacenters. + +## Example usage + +The following example retrieves information about Power Systems Datacenters. + +```terraform +data "ibm_pi_datacenters" "datacenters" {} +``` + +## Notes + +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` + +Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` + +## Attribute reference + +In addition to all argument reference list, you can access the following attribute references after your data source is created. + +- `datacenters` - List of Datacenters + + Nested schema for `datacenters` + - `pi_datacenter_capabilities` - (Map) Datacenter Capabilities. + + Nested schema for `pi_datacenter_capabilities`; are (Bool) `true` or `false`: + - `cloud-connections` - (Bool) Cloud-connections capability. + - `disaster-recovery-site` - (Bool) Disaster recovery site. + - `power-edge-router` - (Bool) Power edge router capability. + - `vpn-connections`- (Bool) VPN-connections capability. + - `sysdig-enabled`- (Bool) Sysdig-enabled capability. + + - `pi_datacenter_location` - (Map) Datacenter location. + + Nested schema for `pi_datacenter_location`: + - `region` - (String) The Datacenter location region zone. + - `type` - (String) The Datacenter location region type. + - `url`- (String) The Datacenter location region url. + - `pi_datacenter_status` - (String) The Datacenter status, `ACTIVE`,`MAINTENANCE` or `DOWN`. + - `pi_datacenter_type` - (String) The Datacenter type, `Public Cloud` or `Private Cloud`. diff --git a/website/docs/d/pi_storage_pool_capacity.markdown b/website/docs/d/pi_storage_pool_capacity.markdown index 41bc24aa53..a38e01eb79 100644 --- a/website/docs/d/pi_storage_pool_capacity.markdown +++ b/website/docs/d/pi_storage_pool_capacity.markdown @@ -47,3 +47,4 @@ In addition to all argument reference list, you can access the following attribu - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). - `storage_type` - (String) Storage type of the storage pool. - `total_capacity` - (Integer) Total pool capacity (GB). +- `replication_enabled` - (Boolean) Replication status of the storage pool. diff --git a/website/docs/d/pi_storage_pools_capacity.markdown b/website/docs/d/pi_storage_pools_capacity.markdown index f5955bbc2a..f85cecb0d3 100644 --- a/website/docs/d/pi_storage_pools_capacity.markdown +++ b/website/docs/d/pi_storage_pools_capacity.markdown @@ -56,3 +56,4 @@ In addition to all argument reference list, you can access the following attribu - `pool_name` - (String) The pool name. - `storage_type` - (String) Storage type of the storage pool. - `total_capacity` - (Integer) Total pool capacity (GB). + - `replication_enabled` - (Boolean) Replication status of the storage pool. diff --git a/website/docs/d/pi_workspace.html.markdown b/website/docs/d/pi_workspace.html.markdown new file mode 100644 index 0000000000..e82301e99b --- /dev/null +++ b/website/docs/d/pi_workspace.html.markdown @@ -0,0 +1,71 @@ +--- + +subcategory: "Power Systems" +layout: "ibm" +page_title: "IBM: pi_workspace" +description: |- + Manages a workspace in the Power Virtual Server cloud. +--- + +# ibm_pi_workspace + +Retrieve information about your Power Systems account workspace. + +## Example usage + +```terraform +data "ibm_pi_workspace" "workspace" { + pi_cloud_instance_id = "99fba9c9-66f9-99bc-9999-aca999ee9d9b" +} +``` + +## Notes + +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` + +Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` + +## Argument reference + +Review the argument references that you can specify for your data source. + +- `pi_cloud_instance_id` - (Required, String) Cloud Instance ID of a PCloud Instance under your account. + +## Attribute reference + +In addition to all argument reference list, you can access the following attribute references after your data source is created. + +- `id - (String) Workspace ID. +- `pi_workspace_capabilities` - (Map) Workspace Capabilities. + + Nested schema for `pi_workspace_capabilities`: + - `cloud-connections` - (Bool) Cloud-connections capability. + - `custom-virtual-cores`- (Bool) Custom virtual cores capability. + - `power-edge-router` - (Bool) Power edge router capability. + - `transit-gateway-connection` - (Bool) Transit gateway connection capability. + - `vpn-connections`- (Bool) VPN-connections capability. + +- `pi_workspace_details` - (Map) Workspace information. + + Nested schema for `pi_workspace_details`: + - `creation_date` - (String) Workspace creation date. + - `crn` - (String) Workspace crn. +- `pi_workspace_location` - (Map) Workspace location. + + Nested schema for `Workspace location`: + - `region` - (String) The Workspace location region zone. + - `type` - (String) The Workspace location region type. + - `url`- (String) The Workspace location region url. +- `pi_workspace_name` - (String) The Workspace name. +- `pi_workspace_status` - (String) The Workspace status, `ACTIVE` or `FAILED`. +- `pi_workspace_type` - (String) The Workspace type, `Public Cloud` or `Private Cloud`. diff --git a/website/docs/d/pi_workspaces.html.markdown b/website/docs/d/pi_workspaces.html.markdown new file mode 100644 index 0000000000..75acc3baba --- /dev/null +++ b/website/docs/d/pi_workspaces.html.markdown @@ -0,0 +1,73 @@ +--- + +subcategory: "Power Systems" +layout: "ibm" +page_title: "IBM: pi_workspaces" +description: |- + Manages workspaces in the Power Virtual Server cloud. +--- + +# ibm_pi_workspaces + +Retrieve information about Power Systems workspaces. + +## Example usage + +```terraform +data "ibm_pi_workspaces" "workspaces" { + pi_cloud_instance_id = "99fba9c9-66f9-99bc-9999-aca999ee9d9b" +} +``` + +## Notes + +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` + +Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` + +## Argument reference + +Review the argument references that you can specify for your data source. + +- `pi_cloud_instance_id` - (Required, String) Cloud Instance ID of a PCloud Instance. + +## Attribute reference + +In addition to all argument reference list, you can access the following attribute references after your data source is created. + +- `workspaces` - List of all Workspaces. + Nested schema for `workspaces` + - `pi_workspace_capabilities` - (Map) Workspace Capabilities. + + Nested schema for `pi_workspace_capabilities`; are (Bool) `true` or `false`: + - `cloud-connections` - (Bool) Cloud-connections capability. + - `custom-virtual-cores`- (Bool) Custom virtual cores capability. + - `power-edge-router` - (Bool) Power edge router capability. + - `transit-gateway-connection` - (Bool) Transit gateway connection capability. + - `vpn-connections`- (Bool) VPN-connections capability. + + - `pi_workspace_details` - (Map) Workspace information. + + Nested schema for `pi_workspace_details`: + - `creation_date` - (String) Workspace creation date. + - `crn` - (String) Workspace crn. + - `pi_workspace_id` - (String) Workspace ID. + - `pi_workspace_location` - (Map) Workspace location. + + Nested schema for `Workspace location`: + - `region` - (String) The Workspace location region zone. + - `type` - (String) The Workspace location region type. + - `url`- (String) The Workspace location region url. + - `pi_workspace_name` - (String) The Workspace name. + - `pi_workspace_status` - (String) The Workspace status, `ACTIVE` or `FAILED`. + - `pi_workspace_type` - (String) The Workspace type, `Public Cloud` or `Private Cloud`. diff --git a/website/docs/d/scc_control_library.html.markdown b/website/docs/d/scc_control_library.html.markdown index 20db99ed77..fb1273466a 100644 --- a/website/docs/d/scc_control_library.html.markdown +++ b/website/docs/d/scc_control_library.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a scc_control_library from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_instance_settings.html.markdown b/website/docs/d/scc_instance_settings.html.markdown index 4c2d84e148..ce53c59171 100644 --- a/website/docs/d/scc_instance_settings.html.markdown +++ b/website/docs/d/scc_instance_settings.html.markdown @@ -10,6 +10,7 @@ subcategory: "Security and Compliance Center" Provides a read-only data source to retrieve information about scc_instance_settings. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_latest_reports.html.markdown b/website/docs/d/scc_latest_reports.html.markdown index 8fc6676f60..2d62fb41f9 100644 --- a/website/docs/d/scc_latest_reports.html.markdown +++ b/website/docs/d/scc_latest_reports.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about the latest reports from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_profile.html.markdown b/website/docs/d/scc_profile.html.markdown index 521f2f2316..73983c2183 100644 --- a/website/docs/d/scc_profile.html.markdown +++ b/website/docs/d/scc_profile.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a profile from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_profile_attachment.html.markdown b/website/docs/d/scc_profile_attachment.html.markdown index ae30e2d3fb..15b0f39023 100644 --- a/website/docs/d/scc_profile_attachment.html.markdown +++ b/website/docs/d/scc_profile_attachment.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a profile attachment from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_provider_type.html.markdown b/website/docs/d/scc_provider_type.html.markdown index cc2c8d4d4f..55b13ba210 100644 --- a/website/docs/d/scc_provider_type.html.markdown +++ b/website/docs/d/scc_provider_type.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a provider type from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_provider_type_collection.html.markdown b/website/docs/d/scc_provider_type_collection.html.markdown index 96d9c51e2e..96dece472f 100644 --- a/website/docs/d/scc_provider_type_collection.html.markdown +++ b/website/docs/d/scc_provider_type_collection.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a provider type collection from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_provider_type_instance.html.markdown b/website/docs/d/scc_provider_type_instance.html.markdown index 6f5dc1b7b8..044c336c67 100644 --- a/website/docs/d/scc_provider_type_instance.html.markdown +++ b/website/docs/d/scc_provider_type_instance.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a provider type instance from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report.html.markdown b/website/docs/d/scc_report.html.markdown index 576c99daea..15aa7fedd9 100644 --- a/website/docs/d/scc_report.html.markdown +++ b/website/docs/d/scc_report.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a report from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_controls.html.markdown b/website/docs/d/scc_report_controls.html.markdown index e36ab1805b..8bf2a1df6f 100644 --- a/website/docs/d/scc_report_controls.html.markdown +++ b/website/docs/d/scc_report_controls.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about report controls from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_evaluations.html.markdown b/website/docs/d/scc_report_evaluations.html.markdown index e67c25a800..8050494e04 100644 --- a/website/docs/d/scc_report_evaluations.html.markdown +++ b/website/docs/d/scc_report_evaluations.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about report evaluations from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_resources.html.markdown b/website/docs/d/scc_report_resources.html.markdown index 340cf9d7f5..4cd1cc270b 100644 --- a/website/docs/d/scc_report_resources.html.markdown +++ b/website/docs/d/scc_report_resources.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about report resources from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_rule.html.markdown b/website/docs/d/scc_report_rule.html.markdown index f579ad4380..aee94a5909 100644 --- a/website/docs/d/scc_report_rule.html.markdown +++ b/website/docs/d/scc_report_rule.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a report rule from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_summary.html.markdown b/website/docs/d/scc_report_summary.html.markdown index f48e4615ba..1c2348268d 100644 --- a/website/docs/d/scc_report_summary.html.markdown +++ b/website/docs/d/scc_report_summary.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a report summary from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_tags.html.markdown b/website/docs/d/scc_report_tags.html.markdown index dbc8b0e175..9c10d98e13 100644 --- a/website/docs/d/scc_report_tags.html.markdown +++ b/website/docs/d/scc_report_tags.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about report tags from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_report_violation_drift.html.markdown b/website/docs/d/scc_report_violation_drift.html.markdown index d6738d4404..14e0d30466 100644 --- a/website/docs/d/scc_report_violation_drift.html.markdown +++ b/website/docs/d/scc_report_violation_drift.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a report violation drift from a read-only data source. Then, yo can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/scc_rule.html.markdown b/website/docs/d/scc_rule.html.markdown index f9728bb5b3..5e697578fa 100644 --- a/website/docs/d/scc_rule.html.markdown +++ b/website/docs/d/scc_rule.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Retrieve information about a rule from a read-only data source. Then, you can reference the fields of the data source in other resources within the same configuration by using interpolation syntax. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/d/schematics_agent.html.markdown b/website/docs/d/schematics_agent.html.markdown new file mode 100644 index 0000000000..442d89280f --- /dev/null +++ b/website/docs/d/schematics_agent.html.markdown @@ -0,0 +1,165 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent" +description: |- + Get information about schematics_agent +subcategory: "Schematics" +--- + +# ibm_schematics_agent + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_agent. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_agent" "schematics_agent" { + agent_id = "agent_id" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_agent. +* `agent_crn` - (String) The agent crn, obtained from the Schematics agent deployment configuration. + +* `agent_infrastructure` - (List) The infrastructure parameters used by the agent. +Nested scheme for **agent_infrastructure**: + * `cluster_id` - (String) The cluster ID where agent services will be running. + * `cluster_resource_group` - (String) The resource group of the cluster (is it required?). + * `cos_bucket_name` - (String) The COS bucket name used to store the logs. + * `cos_bucket_region` - (String) The COS bucket region. + * `cos_instance_name` - (String) The COS instance name to store the agent logs. + * `infra_type` - (String) Type of target agent infrastructure. + * Constraints: Allowable values are: `ibm_kubernetes`, `ibm_openshift`, `ibm_satellite`. + +* `agent_inputs` - (List) Additional input variables for the agent. +Nested scheme for **agent_inputs**: + * `link` - (String) The reference link to the variable value By default the expression points to `$self.value`. + * `metadata` - (List) An user editable metadata for the variables. + Nested scheme for **metadata**: + * `aliases` - (List) The list of aliases for the variable name. + * `cloud_data_type` - (String) Cloud data type of the variable. eg. resource_group_id, region, vpc_id. + * `default_value` - (String) Default value for the variable only if the override value is not specified. + * `description` - (String) The description of the meta data. + * `group_by` - (String) The display name of the group this variable belongs to. + * `hidden` - (Boolean) If **true**, the variable is not displayed on UI or Command line. + * `immutable` - (Boolean) Is the variable readonly ?. + * `link_status` - (String) The status of the link. + * Constraints: Allowable values are: `normal`, `broken`. + * `matches` - (String) The regex for the variable value. + * `max_length` - (Integer) The maximum length of the variable value. Applicable for the string type. + * `max_value` - (Integer) The maximum value of the variable. Applicable for the integer type. + * `min_length` - (Integer) The minimum length of the variable value. Applicable for the string type. + * `min_value` - (Integer) The minimum value of the variable. Applicable for the integer type. + * `options` - (List) The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime. + * `position` - (Integer) The relative position of this variable in a list. + * `required` - (Boolean) If the variable required?. + * `secure` - (Boolean) Is the variable secure or sensitive ?. + * `source` - (String) The source of this meta-data. + * `type` - (String) Type of the variable. + * Constraints: Allowable values are: `boolean`, `string`, `integer`, `date`, `array`, `list`, `map`, `complex`, `link`. + * `name` - (String) The name of the variable. For example, `name = "inventory username"`. + * `use_default` - (Boolean) True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used. + * `value` - (String) The value for the variable or reference to the value. For example, `value = ""`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls. + +* `agent_kpi` - (List) Schematics Agent key performance indicators. +Nested scheme for **agent_kpi**: + * `application_indicators` - (List) Agent application key performance indicators. + * `availability_indicator` - (String) Overall availability indicator reported by the agent. + * Constraints: Allowable values are: `available`, `unavailable`, `error`. + * `infra_indicators` - (List) Agent infrastructure key performance indicators. + * `lifecycle_indicator` - (String) Overall lifecycle indicator reported by the agents. + * Constraints: Allowable values are: `consistent`, `inconsistent`, `obselete`. + * `percent_usage_indicator` - (String) Percentage usage of the agent resources. + +* `agent_location` - (String) The location where agent is deployed in the user environment. + +* `agent_metadata` - (List) The metadata of an agent. +Nested scheme for **agent_metadata**: + * `name` - (String) Name of the metadata. + * `value` - (List) Value of the metadata name. + +* `created_at` - (String) The agent creation date-time. + +* `creation_by` - (String) The email address of an user who created the agent. + +* `description` - (String) Agent description. + +* `id` - (String) The agent resource id. + +* `name` - (String) The name of the agent (must be unique, for an account). + +* `recent_deploy_job` - (List) Post-installations checks for Agent health. +Nested scheme for **recent_deploy_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `is_redeployed` - (Boolean) True, when the same version of the agent was redeployed. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full agent deployment job logs. + * `status_code` - (String) Final result of the agent deployment job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the agent deployment job, in a formatted log string. + * `updated_at` - (String) The agent deploy job updation time. + * `updated_by` - (String) Email address of user who ran the agent deploy job. + +* `recent_health_job` - (List) Agent health check. +Nested scheme for **recent_health_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full health-check job logs. + * `status_code` - (String) Final result of the health-check job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the health-check job, in a formatted log string. + * `updated_at` - (String) The agent health check job updation time. + * `updated_by` - (String) Email address of user who ran the agent health check job. + +* `recent_prs_job` - (List) Run a pre-requisite scanner for deploying agent. +Nested scheme for **recent_prs_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full pre-requisite scanner job logs. + * `status_code` - (String) Final result of the pre-requisite scanner job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the pre-requisite scanner job, in a formatted log string. + * `updated_at` - (String) The agent prs job updation time. + * `updated_by` - (String) Email address of user who ran the agent prs job. + +* `resource_group` - (String) The resource-group name for the agent. By default, agent will be registered in Default Resource Group. + +* `schematics_location` - (String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + +* `system_state` - (List) Computed state of the agent. +Nested scheme for **system_state**: + * `status_code` - (String) Agent Status. + * Constraints: Allowable values are: `error`, `normal`, `in_progress`, `pending`, `draft`. + * `status_message` - (String) The agent status message. + +* `tags` - (List) Tags for the agent. + +* `updated_at` - (String) The agent registration updation time. + +* `updated_by` - (String) Email address of user who updated the agent registration. + +* `user_state` - (List) User defined status of the agent. +Nested scheme for **user_state**: + * `set_at` - (String) When the User who set the state of the Object. + * `set_by` - (String) Name of the User who set the state of the Object. + * `state` - (String) User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user. + * Constraints: Allowable values are: `enable`, `disable`. + +* `version` - (String) Agent version. + diff --git a/website/docs/d/schematics_agent_deploy.html.markdown b/website/docs/d/schematics_agent_deploy.html.markdown new file mode 100644 index 0000000000..0384799adf --- /dev/null +++ b/website/docs/d/schematics_agent_deploy.html.markdown @@ -0,0 +1,50 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_deploy" +description: |- + Get information about schematics_agent_deploy +subcategory: "Schematics" +--- + +# ibm_schematics_agent_deploy + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_agent_deploy. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_agent_deploy" "schematics_agent_deploy" { + agent_id = ibm_schematics_agent_deploy.schematics_agent_deploy.agent_id +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_agent_deploy. +* `agent_version` - (String) Agent version. + +* `is_redeployed` - (Boolean) True, when the same version of the agent was redeployed. + +* `job_id` - (String) Job Id. + +* `log_url` - (String) URL to the full agent deployment job logs. + +* `status_code` - (String) Final result of the agent deployment job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + +* `status_message` - (String) The outcome of the agent deployment job, in a formatted log string. + +* `updated_at` - (String) The agent deploy job updation time. + +* `updated_by` - (String) Email address of user who ran the agent deploy job. + diff --git a/website/docs/d/schematics_agent_health.html.markdown b/website/docs/d/schematics_agent_health.html.markdown new file mode 100644 index 0000000000..0ff0fd2d2d --- /dev/null +++ b/website/docs/d/schematics_agent_health.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_health" +description: |- + Get information about schematics_agent_health +subcategory: "Schematics" +--- + +# ibm_schematics_agent_health + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_agent_health. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_agent_health" "schematics_agent_health" { + agent_id = ibm_schematics_agent_health.schematics_agent_health.agent_id +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_agent_health. +* `agent_version` - (String) Agent version. + +* `job_id` - (String) Job Id. + +* `log_url` - (String) URL to the full health-check job logs. + +* `status_code` - (String) Final result of the health-check job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + +* `status_message` - (String) The outcome of the health-check job, in a formatted log string. + +* `updated_at` - (String) The agent health check job updation time. + +* `updated_by` - (String) Email address of user who ran the agent health check job. + diff --git a/website/docs/d/schematics_agent_prs.html.markdown b/website/docs/d/schematics_agent_prs.html.markdown new file mode 100644 index 0000000000..aefc4c929a --- /dev/null +++ b/website/docs/d/schematics_agent_prs.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_prs" +description: |- + Get information about schematics_agent_prs +subcategory: "Schematics" +--- + +# ibm_schematics_agent_prs + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_agent_prs. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_agent_prs" "schematics_agent_prs" { + agent_id = ibm_schematics_agent_prs.schematics_agent_prs.agent_id +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_agent_prs. +* `agent_version` - (String) Agent version. + +* `job_id` - (String) Job Id. + +* `log_url` - (String) URL to the full pre-requisite scanner job logs. + +* `status_code` - (String) Final result of the pre-requisite scanner job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + +* `status_message` - (String) The outcome of the pre-requisite scanner job, in a formatted log string. + +* `updated_at` - (String) The agent prs job updation time. + +* `updated_by` - (String) Email address of user who ran the agent prs job. + diff --git a/website/docs/d/schematics_agents.html.markdown b/website/docs/d/schematics_agents.html.markdown new file mode 100644 index 0000000000..08f7532d09 --- /dev/null +++ b/website/docs/d/schematics_agents.html.markdown @@ -0,0 +1,72 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agents" +description: |- + Get information about schematics_agents +subcategory: "Schematics" +--- + +# ibm_schematics_agents + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_agents. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_agents" "schematics_agents" { + name = "MyDevAgent" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `name` - (Optional, String) The name of the agent (must be unique, for an account). + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_agents. +* `agents` - (List) The list of agents in the account. +Nested scheme for **agents**: + * `agent_crn` - (String) The Agent crn, obtained from the Schematics Agent deployment configuration. + * `agent_location` - (String) The location where agent is deployed in the user environment. + * `connection_state` - (List) Connection status of the agent. + Nested scheme for **connection_state**: + * `checked_at` - (String) When the connection state is modified. + * `state` - (String) Agent Connection Status * `Connected` When Schematics is able to connect to the agent. * `Disconnected` When Schematics is able not connect to the agent. + * Constraints: Allowable values are: `Connected`, `Disconnected`. + * `description` - (String) Agent description. + * `id` - (String) The Agent registration id. + * `location` - (String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `name` - (String) The name of the agent (must be unique, for an account). + * `profile_id` - (String) The IAM trusted profile id, used by the Agent instance. + * `registered_at` - (String) The Agent registration date-time. + * `registered_by` - (String) The email address of an user who registered the Agent. + * `resource_group` - (String) The resource-group name for the agent. By default, Agent will be registered in Default Resource Group. + * `system_state` - (List) Computed state of the agent. + Nested scheme for **system_state**: + * `message` - (String) The Agent status message. + * `state` - (String) Agent Status. + * Constraints: Allowable values are: `error`, `normal`, `in_progress`, `pending`, `draft`. + * `tags` - (List) Tags for the agent. + * `updated_at` - (String) The Agent registration updation time. + * `updated_by` - (String) Email address of user who updated the Agent registration. + * `user_state` - (List) User defined status of the agent. + Nested scheme for **user_state**: + * `set_at` - (String) When the User who set the state of the Object. + * `set_by` - (String) Name of the User who set the state of the Object. + * `state` - (String) User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user. + * Constraints: Allowable values are: `enable`, `disable`. + +* `limit` - (Integer) The number of records returned. + +* `offset` - (Integer) The skipped number of records. + +* `total_count` - (Integer) The total number of records. + diff --git a/website/docs/d/schematics_policies.html.markdown b/website/docs/d/schematics_policies.html.markdown new file mode 100644 index 0000000000..dbb58395e6 --- /dev/null +++ b/website/docs/d/schematics_policies.html.markdown @@ -0,0 +1,62 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_policies" +description: |- + Get information about schematics_policies +subcategory: "Schematics" +--- + +# ibm_schematics_policies + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_policies. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_policies" "schematics_policies" { +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `policy_kind` - (Optional, String) Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. + * Constraints: Allowable values are: `agent_assignment_policy`. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_policies. +* `limit` - (Integer) The number of policy records returned. + +* `offset` - (Integer) The skipped number of policy records. + +* `policies` - (List) The list of Schematics policies. +Nested scheme for **policies**: + * `account` - (String) The Account id. + * `created_at` - (String) The policy creation time. + * `created_by` - (String) The user who created the Policy. + * `crn` - (String) The policy CRN. + * `description` - (String) The description of Schematics customization policy. + * `id` - (String) The system generated Policy Id. + * `location` - (String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `name` - (String) The name of Schematics customization policy. + * `policy_kind` - (String) Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. + * Constraints: Allowable values are: `agent_assignment_policy`. + * `resource_group` - (String) Resource-group name for the Policy. By default, Policy will be created in Default Resource Group. + * `state` - (List) User defined status of the Schematics object. + Nested scheme for **state**: + * `set_at` - (String) When the User who set the state of the Object. + * `set_by` - (String) Name of the User who set the state of the Object. + * `state` - (String) User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution. + * Constraints: Allowable values are: `draft`, `live`, `locked`, `disable`. + * `tags` - (List) Tags for the Schematics customization policy. + * `updated_at` - (String) The policy updation time. + +* `total_count` - (Integer) The total number of policy records. + diff --git a/website/docs/d/schematics_policy.html.markdown b/website/docs/d/schematics_policy.html.markdown new file mode 100644 index 0000000000..70fead3f22 --- /dev/null +++ b/website/docs/d/schematics_policy.html.markdown @@ -0,0 +1,102 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_policy" +description: |- + Get information about schematics_policy +subcategory: "Schematics" +--- + +# ibm_schematics_policy + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a read-only data source for schematics_policy. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. + +## Example Usage + +```hcl +data "ibm_schematics_policy" "schematics_policy" { + policy_id = "policy_id" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your data source. + +* `policy_id` - (Required, Forces new resource, String) ID to get the details of policy. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your data source is created. + +* `id` - The unique identifier of the schematics_policy. +* `account` - (String) The Account id. + +* `created_at` - (String) The policy creation time. + +* `created_by` - (String) The user who created the policy. + +* `crn` - (String) The policy CRN. + +* `description` - (String) The description of Schematics customization policy. + +* `id` - (String) The system generated policy Id. + +* `kind` - (String) Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. + * Constraints: Allowable values are: `agent_assignment_policy`. + +* `location` - (String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + +* `name` - (String) Name of Schematics customization policy. + +* `parameter` - (List) The parameter to tune the Schematics policy. +Nested scheme for **parameter**: + * `agent_assignment_policy_parameter` - (List) Parameters for the `agent_assignment_policy`. + Nested scheme for **agent_assignment_policy_parameter**: + * `selector_ids` - (List) The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy. + * `selector_kind` - (String) Types of schematics object selector. + * Constraints: Allowable values are: `ids`, `scoped`. + * `selector_scope` - (List) The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy. + Nested scheme for **selector_scope**: + * `kind` - (String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. + * `locations` - (List) The location based selector. + * Constraints: Allowable list items are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `resource_groups` - (List) The resource group based selector. + * `tags` - (List) The tag based selector. + +* `resource_group` - (String) The resource group name for the policy. By default, Policy will be created in `default` Resource Group. + +* `scoped_resources` - (List) List of scoped Schematics resources targeted by the policy. +Nested scheme for **scoped_resources**: + * `id` - (String) Schematics resource Id. + * `kind` - (String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. + +* `state` - (List) User defined status of the Schematics object. +Nested scheme for **state**: + * `set_at` - (String) When the User who set the state of the Object. + * `set_by` - (String) Name of the User who set the state of the Object. + * `state` - (String) User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution. + * Constraints: Allowable values are: `draft`, `live`, `locked`, `disable`. + +* `tags` - (List) Tags for the Schematics customization policy. + +* `target` - (List) The objects for the Schematics policy. +Nested scheme for **target**: + * `selector_ids` - (List) Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy. + * `selector_kind` - (String) Types of schematics object selector. + * Constraints: Allowable values are: `ids`, `scoped`. + * `selector_scope` - (List) Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy. + Nested scheme for **selector_scope**: + * `kind` - (String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. + * `locations` - (List) The location based selector. + * Constraints: Allowable list items are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `resource_groups` - (List) The resource group based selector. + * `tags` - (List) The tag based selector. + +* `updated_at` - (String) The policy updation time. + diff --git a/website/docs/d/sm_arbitrary_secret.html.markdown b/website/docs/d/sm_arbitrary_secret.html.markdown index 7b6cc94657..80c207e8d8 100644 --- a/website/docs/d/sm_arbitrary_secret.html.markdown +++ b/website/docs/d/sm_arbitrary_secret.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_arbitrary_secret Provides a read-only data source for an arbitrary secret. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_arbitrary_secret" "arbitrary_secret" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_arbitrary_secret" "arbitrary_secret" { } ``` +By secret name and group name +```hcl +data "ibm_sm_arbitrary_secret" "arbitrary_secret" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,12 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. +* `secret_id` - (Optional, String) The ID of the secret. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. ## Attribute Reference diff --git a/website/docs/d/sm_iam_credentials_secret.html.markdown b/website/docs/d/sm_iam_credentials_secret.html.markdown index bc14cbad5a..8355a081f0 100644 --- a/website/docs/d/sm_iam_credentials_secret.html.markdown +++ b/website/docs/d/sm_iam_credentials_secret.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_iam_credentials_secret Provides a read-only data source for an IAM credentials secret. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_iam_credentials_secret" "iam_secret" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,17 @@ data "ibm_sm_iam_credentials_secret" "iam_secret" { } ``` + +By secret name and group name +```hcl +data "ibm_sm_iam_credentials_secret" "iam_secret" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +41,12 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. - * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `secret_id` - (Optional, String) The ID of the secret. + * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. ## Attribute Reference diff --git a/website/docs/d/sm_imported_certificate.html.markdown b/website/docs/d/sm_imported_certificate.html.markdown index 3abbd36db5..4b6e1209fd 100644 --- a/website/docs/d/sm_imported_certificate.html.markdown +++ b/website/docs/d/sm_imported_certificate.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_imported_certificate Provides a read-only data source for an imported certificate. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_imported_certificate" "imported_certificate" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_imported_certificate" "imported_certificate" { } ``` +By secret name and group name +```hcl +data "ibm_sm_imported_certificate" "imported_certificate" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,13 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. +* `secret_id` - (Optional, String) The ID of the secret. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. + ## Attribute Reference diff --git a/website/docs/d/sm_kv_secret.html.markdown b/website/docs/d/sm_kv_secret.html.markdown index 1247e7143f..bc5ff3474d 100644 --- a/website/docs/d/sm_kv_secret.html.markdown +++ b/website/docs/d/sm_kv_secret.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_kv_secret Provides a read-only data source for a KV secret. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_kv_secret" "kv_secret" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_kv_secret" "kv_secret" { } ``` +By secret name and group name +```hcl +data "ibm_sm_kv_secret" "kv_secret" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,13 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. +* `secret_id` - (Optional, String) The ID of the secret. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. + ## Attribute Reference diff --git a/website/docs/d/sm_private_certificate.html.markdown b/website/docs/d/sm_private_certificate.html.markdown index 7e880d82b7..22bc586770 100644 --- a/website/docs/d/sm_private_certificate.html.markdown +++ b/website/docs/d/sm_private_certificate.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_private_certificate Provides a read-only data source for a private certificate. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_private_certificate" "private_certificate" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_private_certificate" "private_certificate" { } ``` +By secret name and group name +```hcl +data "ibm_sm_private_certificate" "private_certificate" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,13 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. - * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `secret_id` - (Optional, String) The ID of the secret. + * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. + ## Attribute Reference @@ -37,100 +54,100 @@ In addition to all argument references listed, you can access the following attr * `id` - The unique identifier of the data source. * `alt_names` - (List) With the Subject Alternative Name field, you can specify additional host names to be protected by a single SSL certificate. - * Constraints: The list items must match regular expression `/^(.*?)$/`. The maximum length is `99` items. The minimum length is `0` items. + * Constraints: The list items must match regular expression `/^(.*?)$/`. The maximum length is `99` items. The minimum length is `0` items. * `ca_chain` - (List) The chain of certificate authorities that are associated with the certificate. - * Constraints: The list items must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. The maximum length is `16` items. The minimum length is `1` item. + * Constraints: The list items must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. The maximum length is `16` items. The minimum length is `1` item. * `certificate` - (String) The PEM-encoded contents of your certificate. - * Constraints: The maximum length is `100000` characters. The minimum length is `50` characters. The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. + * Constraints: The maximum length is `100000` characters. The minimum length is `50` characters. The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. * `certificate_authority` - (String) The intermediate certificate authority that signed this certificate. * `certificate_template` - (String) The name of the certificate template. - * Constraints: The maximum length is `128` characters. The minimum length is `2` characters. The value must match regular expression `/^[A-Za-z0-9][A-Za-z0-9]*(?:_?-?\\.?[A-Za-z0-9]+)*$/`. + * Constraints: The maximum length is `128` characters. The minimum length is `2` characters. The value must match regular expression `/^[A-Za-z0-9][A-Za-z0-9]*(?:_?-?\\.?[A-Za-z0-9]+)*$/`. * `common_name` - (String) The Common Name (AKA CN) represents the server name that is protected by the SSL certificate. - * Constraints: The maximum length is `128` characters. The minimum length is `4` characters. The value must match regular expression `/(.*?)/`. + * Constraints: The maximum length is `128` characters. The minimum length is `4` characters. The value must match regular expression `/(.*?)/`. * `created_at` - (String) The date when a resource was created. The date format follows RFC 3339. * `created_by` - (String) The unique identifier that is associated with the entity that created the secret. - * Constraints: The maximum length is `128` characters. The minimum length is `4` characters. + * Constraints: The maximum length is `128` characters. The minimum length is `4` characters. * `crn` - (String) A CRN that uniquely identifies an IBM Cloud resource. - * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. + * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. * `custom_metadata` - (Map) The secret metadata that a user can customize. * `description` - (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group. - * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/(.*?)/`. + * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/(.*?)/`. * `downloaded` - (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API. * `expiration_date` - (String) The date a secret is expired. The date format follows RFC 3339. * `issuer` - (String) The distinguished name that identifies the entity that signed and issued the certificate. - * Constraints: The maximum length is `128` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. + * Constraints: The maximum length is `128` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. * `issuing_ca` - (String) The PEM-encoded certificate of the certificate authority that signed and issued this certificate. - * Constraints: The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. + * Constraints: The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. * `key_algorithm` - (String) The identifier for the cryptographic algorithm used to generate the public key that is associated with the certificate. - * Constraints: The maximum length is `10` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. + * Constraints: The maximum length is `10` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. * `labels` - (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created. - * Constraints: The list items must match regular expression `/(.*?)/`. The maximum length is `30` items. The minimum length is `0` items. + * Constraints: The list items must match regular expression `/(.*?)/`. The maximum length is `30` items. The minimum length is `0` items. * `locks_total` - (Integer) The number of locks of the secret. - * Constraints: The maximum value is `1000`. The minimum value is `0`. + * Constraints: The maximum value is `1000`. The minimum value is `0`. * `name` - (String) The human-readable name of your secret. - * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. * `next_rotation_date` - (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy. * `private_key` - (String) (Optional) The PEM-encoded private key to associate with the certificate. - * Constraints: The maximum length is `100000` characters. The minimum length is `50` characters. The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. + * Constraints: The maximum length is `100000` characters. The minimum length is `50` characters. The value must match regular expression `/^(-{5}BEGIN.+?-{5}[\\s\\S]+-{5}END.+?-{5})$/`. * `revocation_time_rfc3339` - (String) The date and time that the certificate was revoked. The date format follows RFC 3339. * `revocation_time_seconds` - (Integer) The timestamp of the certificate revocation. * `rotation` - (List) Determines whether Secrets Manager rotates your secrets automatically. -Nested scheme for **rotation**: - * `auto_rotate` - (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your secret based on the defined interval. - * `interval` - (Integer) The length of the secret rotation time interval. - * Constraints: The minimum value is `1`. - * `rotate_keys` - (Boolean) Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate. - * `unit` - (String) The units for the secret rotation time interval. - * Constraints: Allowable values are: `day`, `month`. + Nested scheme for **rotation**: + * `auto_rotate` - (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is `false`. If `auto_rotate` is set to `true` the service rotates your secret based on the defined interval. + * `interval` - (Integer) The length of the secret rotation time interval. + * Constraints: The minimum value is `1`. + * `rotate_keys` - (Boolean) Determines whether Secrets Manager rotates the private key for your public certificate automatically.Default is `false`. If it is set to `true`, the service generates and stores a new private key for your rotated certificate. + * `unit` - (String) The units for the secret rotation time interval. + * Constraints: Allowable values are: `day`, `month`. * `secret_group_id` - (String) A v4 UUID identifier, or `default` secret group. - * Constraints: The maximum length is `36` characters. The minimum length is `7` characters. The value must match regular expression `/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/`. + * Constraints: The maximum length is `36` characters. The minimum length is `7` characters. The value must match regular expression `/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/`. * `secret_type` - (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials. - * Constraints: Allowable values are: `arbitrary`, `imported_cert`, `public_cert`, `iam_credentials`, `kv`, `username_password`, `private_cert`. + * Constraints: Allowable values are: `arbitrary`, `imported_cert`, `public_cert`, `iam_credentials`, `kv`, `username_password`, `private_cert`. * `serial_number` - (String) The unique serial number that was assigned to a certificate by the issuing certificate authority. - * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/[^a-fA-F0-9]/`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/[^a-fA-F0-9]/`. * `signing_algorithm` - (String) The identifier for the cryptographic algorithm that was used by the issuing certificate authority to sign a certificate. - * Constraints: The maximum length is `64` characters. The minimum length is `4` characters. + * Constraints: The maximum length is `64` characters. The minimum length is `4` characters. * `state` - (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the `Pre-activation = 0`, `Active = 1`, `Suspended = 2`, `Deactivated = 3`, and `Destroyed = 5` values. - * Constraints: Allowable values are: `0`, `1`, `2`, `3`, `5`. + * Constraints: Allowable values are: `0`, `1`, `2`, `3`, `5`. * `state_description` - (String) A text representation of the secret state. - * Constraints: Allowable values are: `pre_activation`, `active`, `suspended`, `deactivated`, `destroyed`. + * Constraints: Allowable values are: `pre_activation`, `active`, `suspended`, `deactivated`, `destroyed`. * `updated_at` - (String) The date when a resource was recently modified. The date format follows RFC 3339. * `validity` - (List) The date and time that the certificate validity period begins and ends. -Nested scheme for **validity**: - * `not_after` - (String) The date-time format follows RFC 3339. - * `not_before` - (String) The date-time format follows RFC 3339. + Nested scheme for **validity**: + * `not_after` - (String) The date-time format follows RFC 3339. + * `not_before` - (String) The date-time format follows RFC 3339. * `versions_total` - (Integer) The number of versions of the secret. - * Constraints: The maximum value is `50`. The minimum value is `0`. + * Constraints: The maximum value is `50`. The minimum value is `0`. diff --git a/website/docs/d/sm_public_certificate.html.markdown b/website/docs/d/sm_public_certificate.html.markdown index c9e43b159f..c997a1775c 100644 --- a/website/docs/d/sm_public_certificate.html.markdown +++ b/website/docs/d/sm_public_certificate.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_public_certificate Provides a read-only data source for a public certificate. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_public_certificate" "public_certificate" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_public_certificate" "public_certificate" { } ``` +By secret name and group name +```hcl +data "ibm_sm_public_certificate" "public_certificate" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,12 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. - * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `secret_id` - (Optional, String) The ID of the secret. + * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. ## Attribute Reference diff --git a/website/docs/d/sm_username_password_secret.html.markdown b/website/docs/d/sm_username_password_secret.html.markdown index 8d60873762..c18a55df9c 100644 --- a/website/docs/d/sm_username_password_secret.html.markdown +++ b/website/docs/d/sm_username_password_secret.html.markdown @@ -9,9 +9,11 @@ subcategory: "Secrets Manager" # ibm_sm_username_password_secret Provides a read-only data source for UsernamePasswordSecret. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. +The data source can be defined by providing the secret ID or the secret and secret group names. ## Example Usage +By secret id ```hcl data "ibm_sm_username_password_secret" "username_password_secret" { instance_id = ibm_resource_instance.sm_instance.guid @@ -20,6 +22,16 @@ data "ibm_sm_username_password_secret" "username_password_secret" { } ``` +By secret name and group name +```hcl +data "ibm_sm_username_password_secret" "username_password_secret" { + instance_id = ibm_resource_instance.sm_instance.guid + region = "us-south" + name = "secret-name" + secret_group_name = "group-name" +} +``` + ## Argument Reference Review the argument reference that you can specify for your data source. @@ -28,8 +40,12 @@ Review the argument reference that you can specify for your data source. * `region` - (Optional, Forces new resource, String) The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration. * `endpoint_type` - (Optional, String) - The endpoint type. If not provided the endpoint type is determined by the `visibility` argument provided in the provider configuration. * Constraints: Allowable values are: `private`, `public`. -* `secret_id` - (Required, String) The ID of the secret. - * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `secret_id` - (Optional, String) The ID of the secret. + * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/`. +* `name` - (Optional, String) The human-readable name of your secret. To be used in combination with `secret_group_name`. + * Constraints: The maximum length is `256` characters. The minimum length is `2` characters. The value must match regular expression `^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$`. +* `secret_group_name` - (Optional, String) The name of your existing secret group. To be used in combination with `name`. + * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/(.*?)/`. ## Attribute Reference diff --git a/website/docs/r/billing_report_snapshot.html.markdown b/website/docs/r/billing_report_snapshot.html.markdown new file mode 100644 index 0000000000..4151c7748d --- /dev/null +++ b/website/docs/r/billing_report_snapshot.html.markdown @@ -0,0 +1,113 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_billing_report_snapshot" +description: |- + Manages billing_report_snapshot. +subcategory: "Usage Reports" +--- + +# ibm_billing_report_snapshot + +Create, update, and delete billing_report_snapshots with this resource. + +## Example Usage + +```hcl +resource "ibm_billing_report_snapshot" "billing_report_snapshot_instance" { + cos_bucket = "bucket_name" + cos_location = "us-south" + cos_reports_folder = "IBMCloud-Billing-Reports" + interval = "daily" + versioning = "new" +} +``` + +## Example usage with service-to-service authorization + +```hcl +resource "ibm_iam_authorization_policy" "policy" { + source_service_name = "billing" + target_service_name = "cloud-object-storage" + target_resource_instance_id = "cos_instance_id" + roles = ["Object Writer", "Content Reader"] +} + +resource "ibm_billing_report_snapshot" "billing_report_snapshot_instance" { + cos_bucket = "bucket_name" + cos_location = "us-south" + cos_reports_folder = "IBMCloud-Billing-Reports" + interval = "daily" + versioning = "new" + report_types = ["account_summary", "account_resource_instance_usage"] + depends_on = [ ibm_iam_authorization_policy.policy ] +} +``` +If service-to-service authorization already exists in the specific COS bucket, the resource `policy` can be omitted and the `depends_on` flag can also be removed from resource `billing_report_snapshot_instance`. For more information, about IAM service authorizations, see [using authorizations to grant access between services](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy). + +## Argument Reference + +You can specify the following arguments for this resource. + +* `cos_bucket` - (Required, String) The name of the COS bucket to store the snapshot of the billing reports. +* `cos_location` - (Required, String) Region of the COS instance. +* `cos_reports_folder` - (Optional, String) The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports". + * Constraints: The default value is `IBMCloud-Billing-Reports`. +* `interval` - (Required, String) Frequency of taking the snapshot of the billing reports. + * Constraints: Allowable values are: `daily`. +* `report_types` - (Optional, List) The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]. + * Constraints: Allowable list items are: `account_summary`, `enterprise_summary`, `account_resource_instance_usage`. +* `versioning` - (Optional, String) A new version of report is created or the existing report version is overwritten with every update. + * Constraints: The default value is `new`. Allowable values are: `new`, `overwrite`. + +## Attribute Reference + +After your resource is created, you can read values from the listed arguments and the following attributes. + +* `id` - The unique identifier of the billing_report_snapshot. +* `account_type` - (String) Type of account. Possible values are [enterprise, account]. + * Constraints: Allowable values are: `account`, `enterprise`. +* `compression` - (String) Compression format of the snapshot report. +* `content_type` - (String) Type of content stored in snapshot report. +* `cos_endpoint` - (String) The endpoint of the COS instance. +* `created_at` - (Integer) Timestamp in milliseconds when the snapshot configuration was created. +* `history` - (List) List of previous versions of the snapshot configurations. +Nested schema for **history**: + * `account_id` - (String) Account ID for which billing report snapshot is configured. + * `account_type` - (String) Type of account. Possible values [enterprise, account]. + * Constraints: Allowable values are: `account`, `enterprise`. + * `compression` - (String) Compression format of the snapshot report. + * `content_type` - (String) Type of content stored in snapshot report. + * `cos_bucket` - (String) The name of the COS bucket to store the snapshot of the billing reports. + * `cos_endpoint` - (String) The endpoint of the COS instance. + * `cos_location` - (String) Region of the COS instance. + * `cos_reports_folder` - (String) The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports". + * Constraints: The default value is `IBMCloud-Billing-Reports`. + * `end_time` - (Integer) Timestamp in milliseconds when the snapshot configuration ends. + * `interval` - (String) Frequency of taking the snapshot of the billing reports. + * Constraints: Allowable values are: `daily`. + * `report_types` - (List) The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage]. + * Constraints: Allowable list items are: `account_summary`, `enterprise_summary`, `account_resource_instance_usage`. + * `start_time` - (Integer) Timestamp in milliseconds when the snapshot configuration was created. + * `state` - (String) Status of the billing snapshot configuration. Possible values are [enabled, disabled]. + * Constraints: Allowable values are: `enabled`, `disabled`. + * `updated_by` - (String) Account that updated the billing snapshot configuration. + * `versioning` - (String) A new version of report is created or the existing report version is overwritten with every update. + * Constraints: The default value is `new`. Allowable values are: `new`, `overwrite`. +* `last_updated_at` - (Integer) Timestamp in milliseconds when the snapshot configuration was last updated. +* `state` - (String) Status of the billing snapshot configuration. Possible values are [enabled, disabled]. + * Constraints: Allowable values are: `enabled`, `disabled`. + + +## Import + +You can import the `ibm_billing_report_snapshot` resource by using `account_id`. Account ID for which billing report snapshot is configured. + +# Syntax +``` +$ terraform import ibm_billing_report_snapshot.billing_report_snapshot +``` + +# Example +``` +$ terraform import ibm_billing_report_snapshot.billing_report_snapshot abc +``` diff --git a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown index 166de62a72..123e19dc6e 100644 --- a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown @@ -15,13 +15,12 @@ Create, update, and delete cd_tekton_pipeline_triggers with this resource. ```hcl resource "ibm_cd_tekton_pipeline_trigger" "cd_tekton_pipeline_trigger_instance" { event_listener = "pr-listener" - events = ["push", "pull_request" ] max_concurrent_runs = 3 name = "Manual Trigger" pipeline_id = "94619026-912b-4d92-8f51-6c74f0692d90" type = "manual" worker { - id = "public" + id = "public" } } ``` diff --git a/website/docs/r/container_ingress_secret_opaque.html.markdown b/website/docs/r/container_ingress_secret_opaque.html.markdown index cd963413b9..3dac4048f5 100644 --- a/website/docs/r/container_ingress_secret_opaque.html.markdown +++ b/website/docs/r/container_ingress_secret_opaque.html.markdown @@ -34,7 +34,9 @@ Review the argument references that you can specify for your resource. - `secret_name` - (Required, String) The name of the kubernetes secret. - `secret_namespace` - (Required, String) The namespace of the kubernetes secret. - `persistence` - (Bool) Persist the secret data in your cluster. If the secret is later deleted from the command line or OpenShift web console, the secret is automatically re-created in your cluster. - `fields` - (Required, List) List of fields of the opaque secret. +- `update_secret` - (Optional, Integer) This argument is used to force update from upstream secrets manager instance that stores secret. Increment the value to force an update to your Ingress secret for changes made to the upstream secrets manager secret. +- `fields` - (Required, List) List of fields of the opaque secret. + Nested scheme for `fields`: - `crn` - (Required, String) Secrets manager secret crn - `field_name` - (String) Field name @@ -47,7 +49,8 @@ In addition to all argument reference list, you can access the following attribu - `status` - (String) The Status of the secret. - `user_managed` - (Bool) Indicates whether the secret was created by a user. - `persistence` - (Bool) Persist the secret data in your cluster. If the secret is later deleted from the command line or OpenShift web console, the secret is automatically re-created in your cluster. - `fields` - (List) List of fields of the opaque secret. +- `fields` - (List) List of fields of the opaque secret. + Nested scheme for `fields`: - `crn` - (String) Secrets manager secret crn - `field_name` - (String) Requested field name diff --git a/website/docs/r/container_ingress_secret_tls.html.markdown b/website/docs/r/container_ingress_secret_tls.html.markdown index cd6d587ddf..ccd53ba987 100644 --- a/website/docs/r/container_ingress_secret_tls.html.markdown +++ b/website/docs/r/container_ingress_secret_tls.html.markdown @@ -27,6 +27,7 @@ Review the argument references that you can specify for your resource. - `secret_name` - (Required, String) The name of the kubernetes secret. - `secret_namespace` - (Required, string) The namespace of the kubernetes secret. - `cert_crn` - (Required, string) The Secrets Manager crn for a secret of type certificate. +- `update_secret` - (Optional, Integer) This argument is used to force update from upstream secrets manager instance that stores secret. Increment the value to force an update to your Ingress secret for changes made to the upstream secrets manager secret. ## Attribute reference In addition to all argument reference list, you can access the following attribute reference after your resource is created. diff --git a/website/docs/r/cos_bucket_website_configuration.html.markdown b/website/docs/r/cos_bucket_website_configuration.html.markdown index 64c6071a18..7fb031f5da 100644 --- a/website/docs/r/cos_bucket_website_configuration.html.markdown +++ b/website/docs/r/cos_bucket_website_configuration.html.markdown @@ -40,6 +40,11 @@ resource "ibm_cos_bucket" "cos_bucket_website_configuration" { storage_class = var.standard_storage_class } + +data "ibm_iam_access_group" "public_access_group" { + access_group_name = "Public Access" +} + # Give public access to above mentioned bucket resource "ibm_iam_access_group_policy" "policy" { @@ -50,8 +55,8 @@ resource "ibm_iam_access_group_policy" "policy" { resources { service = "cloud-object-storage" resource_type = "bucket" - resource_instance_id = "COS instance guid" - resource = data.ibm_cos_bucket.cos_bucket_website_configuration.bucket_name + resource_instance_id = "COS instance guid" # eg : 94xxxxxx-3xxx-4xxx-8xxx-7xxxxxxxxx7 + resource = ibm_cos_bucket.cos_bucket_website_configuration.bucket_name } } diff --git a/website/docs/r/database.html.markdown b/website/docs/r/database.html.markdown index 11a0e93bd8..00645a693f 100644 --- a/website/docs/r/database.html.markdown +++ b/website/docs/r/database.html.markdown @@ -67,45 +67,6 @@ output "ICD Etcd database connection string" { ``` -### **Deprecated** Sample database instance by using `node_` attributes -Please Note this has been deprecated: Please use the `group` attribute instead -An example to configure and deploy database by using `node_` attributes instead of `memory_`. - -```terraform -data "ibm_resource_group" "group" { - name = "" -} - -resource "ibm_database" "" { - name = "" - plan = "standard" - location = "eu-gb" - service = "databases-for-etcd" - resource_group_id = data.ibm_resource_group.group.id - tags = ["tag1", "tag2"] - - adminpassword = "password12" - node_count = 3 - node_memory_allocation_mb = 1024 - node_disk_allocation_mb = 20480 - users { - name = "user123" - password = "password12" - type = "database" - } - - allowlist { - address = "172.168.1.1/32" - description = "desc" - } -} - -output "ICD Etcd database connection string" { - value = "http://${ibm_database.test_acc.ibm_database_connection.icd_conn}" -} - -``` - ### Sample database instance by using `group` attributes An example to configure and deploy database by using `group` attributes. @@ -499,6 +460,51 @@ resource "ibm_database" "es" { } } ``` +### Sample Elasticsearch Platinum instance + +```terraform +data "ibm_resource_group" "test_acc" { + is_default = true +} + +resource "ibm_database" "es" { + resource_group_id = data.ibm_resource_group.test_acc.id + name = "es-platinum" + service = "databases-for-elasticsearch" + plan = "platinum" + location = "eu-gb" + adminpassword = "password12" + group { + group_id = "member" + members { + allocation_count = 3 + } + memory { + allocation_mb = 1024 + } + disk { + allocation_mb = 5120 + } + cpu { + allocation_count = 3 + } + } + users { + name = "user123" + password = "password12" + } + allowlist { + address = "172.168.1.2/32" + description = "desc1" + } + + timeouts { + create = "120m" + update = "120m" + delete = "15m" + } +} +``` ### Updating configuration for postgres database ```terraform @@ -661,18 +667,8 @@ Review the argument reference that you can specify for your resource. - Nested scheme for `cpu`: - `allocation_count` - (Optional, Integer) Allocated dedicated CPU per-member. -- `members_memory_allocation_mb` **Deprecated** - (Optional, Integer) The amount of memory in megabytes for the database, split across all members. If not specified, the default setting of the database service is used, which can vary by database type. -- `members_disk_allocation_mb` **Deprecated** - (Optional, Integer) The amount of disk space for the database, split across all members. If not specified, the default setting of the database service is used, which can vary by database type. -- `members_cpu_allocation_count` **Deprecated** - (Optional, Integer) Enables and allocates the number of specified dedicated cores to your deployment. -- `node_count` **Deprecated** - (Optional, Integer) The total number of nodes in the cluster. If not specified defaults to the database minimum node count. These vary by database type. See the documentation related to each database for the defaults. https://cloud.ibm.com/docs/databases-for-postgresql?topic=cloud-databases-provisioning#provisioning-parameters -- `node_cpu_allocation_count` **Deprecated** - (Optional, Integer) Enables and allocates the number of specified dedicated cores to your deployment per node. -- `node_disk_allocation_mb` **Deprecated** - (Optional, Integer) The disk size of the database per node. As above. -- `node_memory_allocation_mb` **Deprecated** - (Optional,Integer) The memory size for the database per node. If not specified defaults to the database default. These vary by database type. See the documentation related to each database for the defaults. https://cloud.ibm.com/docs/databases-for-postgresql?topic=cloud-databases-provisioning#provisioning-parameters - - ~> **Note:** `members_memory_allocation_mb`, `members_disk_allocation_mb`, `members_cpu_allocation_count` conflicts with `node_count`,`node_cpu_allocation_count`, `node_disk_allocation_mb`, `node_memory_allocation_mb`. `group` conflicts with `node_` and `members_` arguments. Either members, node, or group arguments have to be provided. - `name` - (Required, String) A descriptive name that is used to identify the database instance. The name must not include spaces. -- `plan` - (Required, Forces new resource, String) The name of the service plan that you choose for your instance. All databases use `standard`. `enterprise` is supported only for elasticsearch (`databases-for-elasticsearch`), cassandra (`databases-for-cassandra`), and mongodb(`databases-for-mongodb`) -* `plan_validation` - (Optional, bool) Enable or disable validating the database parameters for elasticsearch and postgres (more coming soon) during the plan phase. If not specified defaults to true. +- `plan` - (Required, Forces new resource, String) The name of the service plan that you choose for your instance. All databases use `standard`. `enterprise` is supported only for elasticsearch (`databases-for-elasticsearch`), cassandra (`databases-for-cassandra`), and mongodb(`databases-for-mongodb`). `platinum` is supported for elasticsearch (`databases-for-elasticsearch`). - `point_in_time_recovery_deployment_id` - (Optional, String) The ID of the source deployment that you want to recover back to. - `point_in_time_recovery_time` - (Optional, String) The timestamp in UTC format that you want to restore to. To retrieve the timestamp, run the `ibmcloud cdb postgresql earliest-pitr-timestamp ` command. To restore to the latest available time, use a blank string `""` as the timestamp. For more information, see [Point-in-time Recovery](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-pitr). - `remote_leader_id` - (Optional, String) A CRN of the leader database to make the replica(read-only) deployment. The leader database is created by a database deployment with the same service ID. A read-only replica is set up to replicate all of your data from the leader deployment to the replica deployment by using asynchronous replication. For more information, see [Configuring Read-only Replicas](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-read-only-replicas). diff --git a/website/docs/r/en_destination_custom_email.html.markdown b/website/docs/r/en_destination_custom_email.html.markdown new file mode 100644 index 0000000000..5f5b9cc1b6 --- /dev/null +++ b/website/docs/r/en_destination_custom_email.html.markdown @@ -0,0 +1,95 @@ +--- +subcategory: 'Event Notifications' +layout: 'ibm' +page_title: 'IBM : ibm_en_destination_custom_email' +description: |- + Manages Event Notification Custom Email destinations. +--- + +# ibm_en_destination_custom_email + +Create, update, or delete a Custom Email destination by using IBM Cloud™ Event Notifications. + +## Example usage + +```terraform +resource "ibm_en_destination_custom_email" "custom_domain_en_destination" { + instance_guid = ibm_resource_instance.en_terraform_test_resource.guid + name = "Custom Email EN Destination" + type = "smtp_custom" + description = "Destination Custom Email for event notification" + config { + params { + domain = "mailx.com" + } + } +} +``` + +Process To do the Custom Domain Configuration and Verification. + +- Select the configure overflow menu for the destination you want to verify. + +- Create Sender Policy Framework (SPF), which is used to authenticate the sender of an email. SPF specifies the mail servers that are allowed to send email for your domain. + - Open your DNS hosting provider for the domain name configured + - Create a new TXT record with your domain name registerer with the name and value provided in the configure screen for SPF + +- Create DomainKeys Identified Mail (DKIM), which allows an organization to take responsibility for transmitting a message by signing it. DKIM allows the receiver to check the email that claimed to have come from a specific domain, is authorized by the owner of that domain. + - Open your DNS hosting provider for the domain name configured + - Create a new TXT record with your domain name registerer with the name and value provided in the configure screen for DKIM + +- Save the TXT records + +- In the destination verify screen, click on Verify buttons for both SPF and DKIM. + +## Argument reference + +Review the argument reference that you can specify for your resource. + +- `instance_guid` - (Required, Forces new resource, String) Unique identifier for IBM Cloud Event Notifications instance. + +- `name` - (Required, String) The Destintion name. + +- `description` - (Optional, String) The Destination description. + +- `type` - (Required, String) smtp_custom. + +- `config` - (Optional, List) Payload describing a destination configuration. + + Nested scheme for **config**: + + - `params` - (Required, List) + + Nested scheme for **params**: + + - `domain` - (Required, String) The Custom Domain. +## Attribute reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +- `id` - (String) The unique identifier of the `custom_domain_en_destination`. +- `destination_id` - (String) The unique identifier of the created destination. +- `subscription_count` - (Integer) Number of subscriptions. + - Constraints: The minimum value is `0`. +- `subscription_names` - (List) List of subscriptions. +- `updated_at` - (String) Last updated time. + +## Import + +You can import the `ibm_en_destination_custom_email` resource by using `id`. + +The `id` property can be formed from `instance_guid`, and `destination_id` in the following format: + +``` +/ +``` + +- `instance_guid`: A string. Unique identifier for IBM Cloud Event Notifications instance. + +- `destination_id`: A string. Unique identifier for Destination. + +**Example** + +``` +$ terraform import ibm_en_destination_custom_email.custom_domain_email_en_destination / +``` diff --git a/website/docs/r/en_destination_huawei.html.markdown b/website/docs/r/en_destination_huawei.html.markdown index c287d34c6a..e1772d4068 100644 --- a/website/docs/r/en_destination_huawei.html.markdown +++ b/website/docs/r/en_destination_huawei.html.markdown @@ -21,7 +21,7 @@ resource "ibm_en_destination_huawei" "huawei_en_destination" { config { params { client_id = "5237288990" - client_secret = "36228ghutwervhudokmksiegfevssavdvywvwww" + client_secret = "36228ghutwervhudokmksiegfevssavdvywvwww" // pragma: allowlist secret pre_prod = false } } diff --git a/website/docs/r/en_subscription_custom_email.html.markdown b/website/docs/r/en_subscription_custom_email.html.markdown new file mode 100644 index 0000000000..dfdb597921 --- /dev/null +++ b/website/docs/r/en_subscription_custom_email.html.markdown @@ -0,0 +1,111 @@ +--- +subcategory: 'Event Notifications' +layout: 'ibm' +page_title: 'IBM : ibm_en_subscription_custom_email' +description: |- + Manages Event Notifications Custom Email subscription. +--- + +# ibm_en_subscription_custom_email + +Create, update, or delete a Custom Email subscription by using IBM Cloud™ Event Notifications. + +## Example usage for Custom Email Subscription Creation + +```terraform +resource "ibm_en_subscription_custom_email" "custom_domain_email_subscription" { + instance_guid = ibm_resource_instance.en_terraform_test_resource.guid + name = "Custom Domain Email Subscription" + description = "Subscription for Certificate expiration alert" + destination_id = ibm_resource_instance.ibm_en_subscription_custom_email.destination_id + topic_id = ibm_en_topic.topic1.topic_id + attributes { + add_notification_payload = true + reply_to_mail = "en@ibm.com" + reply_to_name = "EYS ORG" + from_name="ABC ORG" + from_mail="Testuser@mailx.com" + invited = ["test@gmail.com"] + } +} +``` + +## Example usage for Email Subscription Updation + +```terraform +resource "ibm_en_subscription_custom_email" "custom_domain_email_subscription" { + instance_guid = ibm_resource_instance.en_terraform_test_resource.guid + name = "Custom Domain Email Subscription" + description = "Subscription for Certificate expiration alert" + destination_id = ibm_resource_instance.ibm_en_subscription_custom_email.destination_id + topic_id = ibm_en_topic.topic1.topic_id + attributes { + add_notification_payload = true + reply_to_mail = "en@ibm.com" + reply_to_name = "EYS ORG" + from_name = "ABC ORG" + from_mail = "Testuser@mailx.com" + add = ["productionuser@ibm.com"] + remove = ["testuser@gamil.com"] + } +} +``` + +## Argument reference + +Review the argument reference that you can specify for your resource. + +- `instance_guid` - (Required, Forces new resource, String) Unique identifier for IBM Cloud Event Notifications instance. + +- `name` - (Requires, String) Subscription name. + +- `description` - (Optional, String) Subscription description. + +- `destination_id` - (Requires, String) Destination ID. + +- `topic_id` - (Required, String) Topic ID. + +- `attributes` - (Optional, List) Subscription attributes. + Nested scheme for **attributes**: + + - `reply_to_name` - (String) The Email User Name to reply to. + + - `reply_to_mail` - (String) The email address to reply to. + + - `from_name` - (Optional, String) The user name from which email is addressed. + + - `from_name` - (Optional, String) The email address user from which email is addressed(Should belong to the custom domain). + + - `invited`- (List) The Email address to send the email to. + + - `add`- (List) The Email address to add in case of updating the list of email addressses + + - `reomve`- (List) The Email address list to be provided in case of removing the email addresses from subscription + +## Attribute reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +- `id` - (String) The unique identifier of the `custom_domain_email_subscription`. + +- `subscription_id` - (String) The unique identifier of the created subscription. + +- `updated_at` - (String) Last updated time. + +## Import + +You can import the `ibm_en_subscription_custom_email` resource by using `id`. +The `id` property can be formed from `instance_guid`, and `subscription_id` in the following format: + +``` +/ +``` + +- `instance_guid`: A string. Unique identifier for IBM Cloud Event Notifications instance. +- `subscription_id`: A string. Unique identifier for Subscription. + +**Example** + +``` +$ terraform import ibm_en_subscription_custom_email.custom_domain_email_en_subscription / +``` diff --git a/website/docs/r/iam_service_policy.html.markdown b/website/docs/r/iam_service_policy.html.markdown index ffc75c3863..dc9b0ec664 100644 --- a/website/docs/r/iam_service_policy.html.markdown +++ b/website/docs/r/iam_service_policy.html.markdown @@ -266,6 +266,7 @@ resource "ibm_iam_service_policy" "policy" { value = "IAM" } } +``` ## Argument reference Review the argument references that you can specify for your resource. diff --git a/website/docs/r/is_backup_policy.html.markdown b/website/docs/r/is_backup_policy.html.markdown index a6b1a5d179..2f079c364b 100644 --- a/website/docs/r/is_backup_policy.html.markdown +++ b/website/docs/r/is_backup_policy.html.markdown @@ -31,17 +31,36 @@ resource "ibm_is_backup_policy" "example" { } ``` +## Example Usage (enterprise baas) + +```terraform +resource "ibm_is_backup_policy" "ent-baas-example1" { + match_user_tags = ["tag1"] + name = "example-backup-policy" + scope { + crn = "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63" + } +} +``` + ## Argument Reference Review the argument reference that you can specify for your resource. - `match_resource_types` - (Optional, List) A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy. The default value is `["volume"]`. + +~> **Note** + `match_resource_types` is deprecated. Please use `match_resource_type` instead. +- `match_resource_type` - (Optional, String) The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag will be subject to the backup policy. The default value is `["volume"]`. - `match_user_tags` - (Required, List) The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will be subject to the backup policy. - `name` - (Required, String) The user-defined name for this backup policy. Names must be unique within the region this backup policy resides in. - `resource_group` - (Optional, List) The resource group id, to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. Nested scheme for `resource_group`: - `id` - (Optional, String) The unique identifier for this resource group. +- `scope` - (Optional, List) If present, the scope for this backup policy. + Nested `scope` blocks have the following structure: + - `crn` - (Required, String) The CRN for this enterprise. ## Attribute Reference @@ -50,10 +69,22 @@ In addition to all argument references listed, you can access the following attr - `id` - The unique identifier of the BackupPolicy. - `created_at` - (String) The date and time that the backup policy was created. - `crn` - (String) The CRN for this backup policy. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. - `href` - (String) The URL for this backup policy. - `last_job_completed_at` - (String) The date and time that the most recent job for this backup policy completed. - `lifecycle_state` - (String) The lifecycle state of the backup policy. - `resource_type` - (String) The resource type. +- `scope` - Scope of this backup policy + Nested `scope`: + - `crn` - (String) The CRN for this enterprise. + - `id` - (String) The unique identifier for this enterprise. + - `resource_type` - (String) The resource type. - `version` - Version of the BackupPolicy. ## Import diff --git a/website/docs/r/is_dedicated_host.html.markdown b/website/docs/r/is_dedicated_host.html.markdown index 206adc44c7..68a637ba6a 100644 --- a/website/docs/r/is_dedicated_host.html.markdown +++ b/website/docs/r/is_dedicated_host.html.markdown @@ -108,6 +108,15 @@ In addition to all argument reference list, you can access the following attribu - `lifecycle_state`- (String) The lifecycle state of the dedicated host resource. - `memory`- (String) The total amount of memory in `GB` for this host. - `name`- (String) The unique user defined name for this dedicated host. +- `numa` - The NUMA configuration for this dedicated host. + + Nested scheme for `numa`: + - `count` - (Integer) The total number of NUMA nodes for this dedicated host. + - `nodes` - (List) The NUMA nodes for this dedicated host. + + Nested scheme for `nodes`: + - `available_vcpu` - (Integer) The available VCPU for this NUMA node. + - `vcpu` - (Integer) The total VCPU capacity for this NUMA node. - `profile`- (String) The profile this dedicated host uses. - `provisionable`- (String) Indicates whether this dedicated host is available for instance creation. - `resource_group`- (String) The unique identifier of the resource group for this dedicated host. diff --git a/website/docs/r/is_instance.html.markdown b/website/docs/r/is_instance.html.markdown index af7159f19d..6720a5d1ca 100644 --- a/website/docs/r/is_instance.html.markdown +++ b/website/docs/r/is_instance.html.markdown @@ -522,9 +522,7 @@ Review the argument references that you can specify for your resource. When the `profile` is changed, the VSI is restarted. The new profile must: 1. Have matching instance disk support. Any disks associated with the current profile will be deleted, and any disks associated with the requested profile will be created. 2. Be compatible with any placement_target(`dedicated_host`, `dedicated_host_group`, `placement_group`) constraints. For example, if the instance is placed on a dedicated host, the requested profile family must be the same as the dedicated host family. - - ~> **NOTE** - Changing a `profile` without disk to a `profile` with disk or vise versa will result in recreating(forcenew) the resource. + - `resource_group` - (Optional, Forces new resource, String) The ID of the resource group where you want to create the instance. - `instance_template` - (Optional, String) ID of the instance template to create the instance from. To create an instance template, use `ibm_is_instance_template` resource. @@ -577,6 +575,7 @@ In addition to all argument reference list, you can access the following attribu - `resource_type` - (String) The resource type. - `id` - (String) The ID of the instance. - `memory`- (Integer) The amount of memory that is allocated to the instance in gigabytes. +- `numa_count` - (Integer) The number of NUMA nodes this instance is provisioned on. This property may be absent if the instance's status is not running. - `network_interfaces`- (List of Strings) A list of more network interfaces that are attached to the instance. Nested scheme for `network_interfaces`: diff --git a/website/docs/r/is_lb.html.markdown b/website/docs/r/is_lb.html.markdown index 1fe27a0a86..5d24ffe531 100644 --- a/website/docs/r/is_lb.html.markdown +++ b/website/docs/r/is_lb.html.markdown @@ -90,7 +90,7 @@ Review the argument references that you can specify for your resource. - `route_mode` - (Optional, Forces new resource, Bool) Indicates whether route mode is enabled for this load balancer. ~> **NOTE:** Currently, `route_mode` enabled is supported only by private network load balancers. -- `security_groups` (Optional, List) A list of security groups to use for this load balancer. This option is supported only for application load balancers. +- `security_groups` (Optional, List) A list of security groups to use for this load balancer. This option is supported for both application and network load balancers. - `subnets` - (Required, List) List of the subnets IDs to connect to the load balancer. ~> **NOTE:** diff --git a/website/docs/r/is_share_mount_target.html.markdown b/website/docs/r/is_share_mount_target.html.markdown index 2d432673d9..15039a137a 100644 --- a/website/docs/r/is_share_mount_target.html.markdown +++ b/website/docs/r/is_share_mount_target.html.markdown @@ -126,14 +126,20 @@ The following arguments are supported: The following attributes are exported: - -- `mount_target` - The unique identifier of the share target -- `created_at` - The date and time that the share target was created. -- `href` - The URL for this share target. -- `id` - The unique identifier of the ShareTarget. The id is composed of \/\ -- `lifecycle_state` - The lifecycle state of the mount target. -- `mount_path` - The mount path for the share.The IP addresses used in the mount path are currently within the IBM services IP range, but are expected to change to be within one of the VPC's subnets in the future. -- `resource_type` - The type of resource referenced. +- `access_control_mode` - (String) The access control mode for the share. +- `mount_target` - (String) The unique identifier of the share target +- `created_at` - (String) The date and time that the share target was created. +- `href` - (String) The URL for this share target. +- `id` - (String) The unique identifier of the ShareTarget. The id is composed of \/\ +- `lifecycle_state` - (String) The lifecycle state of the mount target. +- `mount_path` - (String) The mount path for the share. The server component of the mount path may be either an IP address or a fully qualified domain name. + + This property will be absent if the lifecycle_state of the mount target is 'pending', failed, or deleting. + + -> **If the share's access_control_mode is:** + • security_group: The IP address used in the mount path is the primary_ip address of the virtual network interface for this share mount target.
+ • vpc: The fully-qualified domain name used in the mount path is an address that resolves to the share mount target.
+- `resource_type` - (String) The type of resource referenced. - `transit_encryption` - (String) The transit encryption mode for this share target. ## Import diff --git a/website/docs/r/is_vpc.html.markdown b/website/docs/r/is_vpc.html.markdown index 916bba9832..0249e5778b 100644 --- a/website/docs/r/is_vpc.html.markdown +++ b/website/docs/r/is_vpc.html.markdown @@ -129,7 +129,7 @@ Review the argument references that you can specify for your resource. While using `zone_affinity`, if fewer DNS servers are specified than the number of zones, then default servers will be created and terraform would show change. Its advised to provide `address` for all `zone_affinity`. - - `type` - (Optional, String) The type of the DNS resolver to use. + - `type` - (Optional, String) The type of the DNS resolver to use. To update the resolver type, specify the `type` explicitly. ~> **Note:** `delegated`: DNS server addresses will be provided by the resolver for the VPC specified in dns.resolver.vpc. Requires dns.enable_hub to be false.
diff --git a/website/docs/r/is_vpn_gateway.html.markdown b/website/docs/r/is_vpn_gateway.html.markdown index 9b35a490fe..e5b632a5a9 100644 --- a/website/docs/r/is_vpn_gateway.html.markdown +++ b/website/docs/r/is_vpn_gateway.html.markdown @@ -80,6 +80,27 @@ In addition to all argument reference list, you can access the following attribu - `private_ip_address` - (String) The Private IP address assigned to this VPN gateway member. - `private_ip_address2` - (String) The Second Private IP address assigned to this VPN gateway. - `status` - (String) The status of the VPN gateway. Supported values are **available**, **deleting**, **failed**, or **pending**. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. +- `lifecycle_state` - (String) The lifecycle state of the VPN gateway. - `vpc` - (String) The VPC this VPN server resides in. Nested scheme for `vpc`: - `crn` - (String) The CRN for this VPC. diff --git a/website/docs/r/is_vpn_gateway_connection.html.markdown b/website/docs/r/is_vpn_gateway_connection.html.markdown index c75011a477..dc50846d40 100644 --- a/website/docs/r/is_vpn_gateway_connection.html.markdown +++ b/website/docs/r/is_vpn_gateway_connection.html.markdown @@ -114,6 +114,12 @@ In addition to all argument reference list, you can access the following attribu - `mode` - (String) The mode of the `VPN gateway` either **policy** or **route**. - `resource_type` - (String) The resource type (vpn_gateway_connection). - `status` - (String) The status of a VPN gateway connection either `down` or `up`. +- `status_reasons` - (List) Array of reasons for the current status (if any). + + Nested `status_reasons`: + - `code` - (String) The status reason code. + - `message` - (String) An explanation of the status reason. + - `more_info` - (String) Link to documentation about this status reason - `tunnels` - (List) The VPN tunnel configuration for the VPN gateway connection (in static route mode). Nested scheme for `tunnels` diff --git a/website/docs/r/is_vpn_server.html.markdown b/website/docs/r/is_vpn_server.html.markdown index 61cc5febdc..53ece5d697 100644 --- a/website/docs/r/is_vpn_server.html.markdown +++ b/website/docs/r/is_vpn_server.html.markdown @@ -89,9 +89,28 @@ In addition to all argument references listed, you can access the following attr - `client_auto_delete_timeout` - (Integer) Hours after which disconnected VPN clients will be automatically deleted. If `0`, disconnected VPN clients will be deleted immediately. - `created_at` - (String) The date and time that the VPN server was created. - `crn` - (String) The CRN for this VPN server. -- `health_state` - (String) The health of this resource.- `ok`: Healthy- `degraded`: Suffering from compromised performance, capacity, or connectivity- `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated- `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `hostname` - (String) Fully qualified domain name assigned to this VPN server. - `href` - (String) The URL for this VPN server. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. - `lifecycle_state` - (String) The lifecycle state of the VPN server. - `private_ips` - (List) The reserved IPs bound to this VPN server. diff --git a/website/docs/r/is_vpn_server_route.html.markdown b/website/docs/r/is_vpn_server_route.html.markdown index 0313eef860..700a506cfc 100644 --- a/website/docs/r/is_vpn_server_route.html.markdown +++ b/website/docs/r/is_vpn_server_route.html.markdown @@ -43,7 +43,27 @@ In addition to all argument references listed, you can access the following attr - `vpn_route` - The identifier of the VPNServerRoute. - `created_at` - (String) The date and time that the VPN route was created. - `href` - (String) The URL for this VPN route. +- `health_reasons` - (List) The reasons for the current health_state (if any). + + Nested scheme for `health_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this health state. + - `message` - (String) An explanation of the reason for this health state. + - `more_info` - (String) Link to documentation about the reason for this health state. +- `health_state` - (String) The health of this resource. + + -> **Supported health_state values:** +
• `ok`: Healthy +
• `degraded`: Suffering from compromised performance, capacity, or connectivity +
• `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +
• `inapplicable`: The health state does not apply because of the current lifecycle state. + **Note:** A resource with a lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this state. - `lifecycle_state` - (String) The lifecycle state of the VPN route. +- `lifecycle_reasons` - (List) The reasons for the current lifecycle_reasons (if any). + + Nested scheme for `lifecycle_reasons`: + - `code` - (String) A snake case string succinctly identifying the reason for this lifecycle reason. + - `message` - (String) An explanation of the reason for this lifecycle reason. + - `more_info` - (String) Link to documentation about the reason for this lifecycle reason. - `resource_type` - (String) The resource type. ## Import diff --git a/website/docs/r/kms_key.html.markdown b/website/docs/r/kms_key.html.markdown index bb063fcdb4..d04445aee7 100644 --- a/website/docs/r/kms_key.html.markdown +++ b/website/docs/r/kms_key.html.markdown @@ -107,7 +107,8 @@ Review the argument references that you can specify for your resource. - `key_name` - (Required, Forces new resource, String) The name of the key. - `key_ring_id` - (Optional, Forces new resource, String) The ID of the key ring where you want to add your Key Protect key. The default value is `default`. - `payload` - (Optional, Forces new resource, String) The base64 encoded key that you want to store and manage in the service. To import an existing key, provide a 256-bit key. To generate a new key, omit this parameter. -- `standard_key`- (Optional, Bool) Set flag **true** for standard key, and **false** for root key. Default value is **false**.Yes. +- `standard_key`- (Optional, Bool) Set flag **true** for standard key, and **false** for root key. Default value is **false**. +- `description`- (Optional, Forces new resource, String) An optional description that can be added to the key during creation. - `policies` - (Optional, List) Set policies for a key, for an automatic rotation policy or a dual authorization policy to protect against the accidental deletion of keys. Policies follow the following structure. (This attribute is deprecated) Nested scheme for `policies`: diff --git a/website/docs/r/kms_key_rings.html.markdown b/website/docs/r/kms_key_rings.html.markdown index a7cb8ccb9a..c4e080bbf9 100644 --- a/website/docs/r/kms_key_rings.html.markdown +++ b/website/docs/r/kms_key_rings.html.markdown @@ -23,6 +23,7 @@ resource "ibm_resource_instance" "kms_instance" { resource "ibm_kms_key_rings" "key_ring" { instance_id = ibm_resource_instance.kms_instance.guid key_ring_id = "key-ring-id" + force_delete = true } resource "ibm_kms_key" "key" { instance_id = ibm_resource_instance.kp_instance.guid @@ -35,7 +36,7 @@ resource "ibm_kms_key" "key" { Sample example of deleting a key ring where all keys inside have key state equals to 5 (destroyed). Keys are moved to the default key ring. -``` +```terraform resource "ibm_kms_key_rings" "key_ring" { instance_id = ibm_resource_instance.kms_instance.guid key_ring_id = "key-ring-id" @@ -49,6 +50,7 @@ Review the argument references that you can specify for your resource. - `endpoint_type` - (Optional, Forces new resource, String) The type of the public endpoint, or private endpoint to be used for creating keys. - `instance_id` - (Required, Forces new resource, String) The hs-crypto or key protect instance GUID. - `key_ring_id` - (Required, Forces new resource, String) The ID that identifies the key ring. Each ID is unique within the given instance and is not reserved across the key protect service. **Constraints** `2 ≤ length ≤ 100`. Value must match regular expression of `^[a-zA-Z0-9-]*$`. +- `force_delete` - (Optional, Bool) If set to **true**, allows force deletion of a key ring. Terraform users are recommended to have this set to **true**. All keys in the key ring are required to be deleted (in state **5**) before this action can be performed. If the key ring to be deleted contains keys, they will be moved to the **default** key ring which requires the **kms.secrets.patch** IAM action. ## Attribute reference In addition to all argument reference list, you can access the following attribute reference after your resource is created. diff --git a/website/docs/r/scc_control_library.html.markdown b/website/docs/r/scc_control_library.html.markdown index 201b87552b..98ef982637 100644 --- a/website/docs/r/scc_control_library.html.markdown +++ b/website/docs/r/scc_control_library.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Create, update, and delete control libraries by using this resource. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/r/scc_profile.html.markdown b/website/docs/r/scc_profile.html.markdown index b0360fe701..9f1d94cc57 100644 --- a/website/docs/r/scc_profile.html.markdown +++ b/website/docs/r/scc_profile.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Create, update, and delete profiles with this resource. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/r/scc_profile_attachment.html.markdown b/website/docs/r/scc_profile_attachment.html.markdown index 064429b657..d821939540 100644 --- a/website/docs/r/scc_profile_attachment.html.markdown +++ b/website/docs/r/scc_profile_attachment.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Create, update, and delete profile attachments with this resource. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage @@ -58,9 +58,11 @@ Nested schema for **scope**: * `properties` - (List) The properties supported for scoping by this environment. * Constraints: The maximum length is `8` items. The minimum length is `0` items. Nested schema for **properties**: - * `name` - (String) The name of the property. + -> NOTE: Defining the `scope_type` value must be either `account`, `account.resource_group`, `enterprise`, `enterprise.account` and `enterprise.account_group`." + -> NOTE: Defining the `scope_id` value will be the id of the `scope_type`(ex. `enterprise.account_group` will be the ID of the account_group within an enterprise) + * `name` - (Required, String) The name of the property. * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/[A-Za-z0-9]+/`. - * `value` - (String) The value of the property. + * `value` - (Required, String) The value of the property. * Constraints: The maximum length is `64` characters. The minimum length is `2` characters. The value must match regular expression `/[A-Za-z0-9]+/`. * `notifications` - (List) The request payload of the attachment notifications. Nested schema for **notifications**: diff --git a/website/docs/r/scc_provider_type_instance.html.markdown b/website/docs/r/scc_provider_type_instance.html.markdown index 2a75e888d7..f67260edc4 100644 --- a/website/docs/r/scc_provider_type_instance.html.markdown +++ b/website/docs/r/scc_provider_type_instance.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Create, update, and delete provider type instances with this resource. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/r/scc_rule.html.markdown b/website/docs/r/scc_rule.html.markdown index 322fa63013..1fbe9fbbf4 100644 --- a/website/docs/r/scc_rule.html.markdown +++ b/website/docs/r/scc_rule.html.markdown @@ -10,7 +10,7 @@ subcategory: "Security and Compliance Center" Create, update, and delete rules with this resource. -~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.ibm.com`). +~> NOTE: if you specify the `region` in the provider, that region will become the default URL. Else, exporting the environmental variable IBMCLOUD_SCC_API_ENDPOINT will override any URL(ex. `export IBMCLOUD_SCC_API_ENDPOINT=https://us-south.compliance.cloud.ibm.com`). ## Example Usage diff --git a/website/docs/r/schematics_action.html.markdown b/website/docs/r/schematics_action.html.markdown index d9969b1d1f..6809609755 100644 --- a/website/docs/r/schematics_action.html.markdown +++ b/website/docs/r/schematics_action.html.markdown @@ -180,17 +180,6 @@ Nested scheme for **source**: * `source_readme_url` - (Optional, String) URL of the `README` file, for the source URL. * `source_type` - (Optional, String) Type of source for the Template. * Constraints: Allowable values are: local, git_hub, git_hub_enterprise, git_lab, ibm_git_lab, ibm_cloud_catalog, external_scm, cos_bucket -* `state` - (Optional, List) Computed state of the Action. -Nested scheme for **state**: - * `status_code` - (Optional, String) Status of automation (workspace or action). - * Constraints: Allowable values are: normal, pending, disabled, critical - * `status_job_id` - (Optional, String) Job id reference for this status. - * `status_message` - (Optional, String) Automation status message - to be displayed along with the status_code. -* `sys_lock` - (Optional, List) System lock status. -Nested scheme for **sys_lock**: - * `sys_locked` - (Optional, Boolean) Is the automation locked by a Schematic job ?. - * `sys_locked_by` - (Optional, String) Name of the User who performed the job, that lead to the locking of the automation. - * `sys_locked_at` - (Optional, String) When the User performed the job that lead to locking of the automation ?. * `tags` - (Optional, List) Action tags. * `targets_ini` - (Optional, String) Inventory of host and host group for the playbook in `INI` file format. For example, `"targets_ini": "[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps). * `user_state` - (Optional, List) User defined status of the Schematics object. @@ -215,6 +204,17 @@ In addition to all argument references listed, you can access the following attr * `source_created_by` - (String) E-mail address of user who created the Action Playbook Source. * `source_updated_at` - (String) The action playbook updation time. * `source_updated_by` - (String) E-mail address of user who updated the action playbook source. +* `state` - (List) Computed state of the Action. +Nested scheme for **state**: + * `status_code` - (String) Status of automation (workspace or action). + * Constraints: Allowable values are: normal, pending, disabled, critical + * `status_job_id` - (String) Job id reference for this status. + * `status_message` - (String) Automation status message - to be displayed along with the status_code. +* `sys_lock` - (List) System lock status. +Nested scheme for **sys_lock**: + * `sys_locked` - (Boolean) Is the automation locked by a Schematic job ?. + * `sys_locked_by` - (String) Name of the User who performed the job, that lead to the locking of the automation. + * `sys_locked_at` - (String) When the User performed the job that lead to locking of the automation ?. * `updated_at` - (String) Action updation time. * `updated_by` - (String) E-mail address of the user who updated an action. diff --git a/website/docs/r/schematics_agent.html.markdown b/website/docs/r/schematics_agent.html.markdown new file mode 100644 index 0000000000..af12fb8c26 --- /dev/null +++ b/website/docs/r/schematics_agent.html.markdown @@ -0,0 +1,206 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent" +description: |- + Manages schematics_agent. +subcategory: "Schematics" +--- + +# ibm_schematics_agent + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a resource for schematics_agent. This allows schematics_agent to be created, updated and deleted. + +## Example Usage + +```hcl +resource "ibm_schematics_agent" "schematics_agent_instance" { + agent_infrastructure { + infra_type = "ibm_kubernetes" + cluster_id = "cluster_id" + cluster_resource_group = "cluster_resource_group" + cos_instance_name = "cos_instance_name" + cos_bucket_name = "cos_bucket_name" + cos_bucket_region = "cos_bucket_region" + } + agent_inputs { + name = "name" + value = "value" + use_default = true + metadata { + type = "boolean" + aliases = [ "aliases" ] + description = "description" + cloud_data_type = "cloud_data_type" + default_value = "default_value" + link_status = "normal" + secure = true + immutable = true + hidden = true + required = true + options = [ "options" ] + min_value = 1 + max_value = 1 + min_length = 1 + max_length = 1 + matches = "matches" + position = 1 + group_by = "group_by" + source = "source" + } + link = "link" + } + agent_kpi { + availability_indicator = "available" + lifecycle_indicator = "consistent" + percent_usage_indicator = "percent_usage_indicator" + application_indicators = [ null ] + infra_indicators = [ null ] + } + agent_location = "us-south" + agent_metadata { + name = "purpose" + value = ["git", "terraform", "ansible"] + } + description = "Create Agent" + name = "MyDevAgent" + resource_group = "Default" + schematics_location = "us-south" + user_state { + state = "enable" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + version = "v1.0.0" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your resource. + +* `agent_infrastructure` - (Required, List) The infrastructure parameters used by the agent. +Nested scheme for **agent_infrastructure**: + * `cluster_id` - (Optional, String) The cluster ID where agent services will be running. + * `cluster_resource_group` - (Optional, String) The resource group of the cluster (is it required?). + * `cos_bucket_name` - (Optional, String) The COS bucket name used to store the logs. + * `cos_bucket_region` - (Optional, String) The COS bucket region. + * `cos_instance_name` - (Optional, String) The COS instance name to store the agent logs. + * `infra_type` - (Optional, String) Type of target agent infrastructure. + * Constraints: Allowable values are: `ibm_kubernetes`, `ibm_openshift`, `ibm_satellite`. +* `agent_inputs` - (Optional, List) Additional input variables for the agent. +Nested scheme for **agent_inputs**: + * `link` - (Computed, String) The reference link to the variable value By default the expression points to `$self.value`. + * `metadata` - (Optional, List) An user editable metadata for the variables. + Nested scheme for **metadata**: + * `aliases` - (Optional, List) The list of aliases for the variable name. + * `cloud_data_type` - (Optional, String) Cloud data type of the variable. eg. resource_group_id, region, vpc_id. + * `default_value` - (Optional, String) Default value for the variable only if the override value is not specified. + * `description` - (Optional, String) The description of the meta data. + * `group_by` - (Optional, String) The display name of the group this variable belongs to. + * `hidden` - (Optional, Boolean) If **true**, the variable is not displayed on UI or Command line. + * `immutable` - (Optional, Boolean) Is the variable readonly ?. + * `link_status` - (Optional, String) The status of the link. + * Constraints: Allowable values are: `normal`, `broken`. + * `matches` - (Optional, String) The regex for the variable value. + * `max_length` - (Optional, Integer) The maximum length of the variable value. Applicable for the string type. + * `max_value` - (Optional, Integer) The maximum value of the variable. Applicable for the integer type. + * `min_length` - (Optional, Integer) The minimum length of the variable value. Applicable for the string type. + * `min_value` - (Optional, Integer) The minimum value of the variable. Applicable for the integer type. + * `options` - (Optional, List) The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime. + * `position` - (Optional, Integer) The relative position of this variable in a list. + * `required` - (Optional, Boolean) If the variable required?. + * `secure` - (Optional, Boolean) Is the variable secure or sensitive ?. + * `source` - (Optional, String) The source of this meta-data. + * `type` - (Optional, String) Type of the variable. + * Constraints: Allowable values are: `boolean`, `string`, `integer`, `date`, `array`, `list`, `map`, `complex`, `link`. + * `name` - (Optional, String) The name of the variable. For example, `name = "inventory username"`. + * `use_default` - (Optional, Boolean) True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used. + * `value` - (Optional, String) The value for the variable or reference to the value. For example, `value = ""`. **Note** The SSH key should contain `\n` at the end of the key details in case of command line or API calls. +* `agent_kpi` - (Optional, List) Schematics Agent key performance indicators. +Nested scheme for **agent_kpi**: + * `application_indicators` - (Optional, List) Agent application key performance indicators. + * `availability_indicator` - (Optional, String) Overall availability indicator reported by the agent. + * Constraints: Allowable values are: `available`, `unavailable`, `error`. + * `infra_indicators` - (Optional, List) Agent infrastructure key performance indicators. + * `lifecycle_indicator` - (Optional, String) Overall lifecycle indicator reported by the agents. + * Constraints: Allowable values are: `consistent`, `inconsistent`, `obselete`. + * `percent_usage_indicator` - (Optional, String) Percentage usage of the agent resources. +* `agent_location` - (Required, String) The location where agent is deployed in the user environment. +* `agent_metadata` - (Optional, List) The metadata of an agent. +Nested scheme for **agent_metadata**: + * `name` - (Optional, String) Name of the metadata. + * `value` - (Optional, List) Value of the metadata name. +* `description` - (Optional, String) Agent description. +* `name` - (Required, String) The name of the agent (must be unique, for an account). +* `resource_group` - (Required, String) The resource-group name for the agent. By default, agent will be registered in Default Resource Group. +* `schematics_location` - (Required, String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. +* `tags` - (Optional, List) Tags for the agent. +* `user_state` - (Optional, List) User defined status of the agent. +Nested scheme for **user_state**: + * `set_at` - (Computed, String) When the User who set the state of the Object. + * `set_by` - (Computed, String) Name of the User who set the state of the Object. + * `state` - (Optional, String) User-defined states * `enable` Agent is enabled by the user. * `disable` Agent is disbaled by the user. + * Constraints: Allowable values are: `enable`, `disable`. +* `version` - (Required, String) Agent version. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +* `id` - The unique identifier of the schematics_agent. +* `agent_crn` - (String) The agent crn, obtained from the Schematics agent deployment configuration. +* `created_at` - (String) The agent creation date-time. +* `creation_by` - (String) The email address of an user who created the agent. +* `recent_deploy_job` - (List) Post-installations checks for Agent health. +Nested scheme for **recent_deploy_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `is_redeployed` - (Boolean) True, when the same version of the agent was redeployed. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full agent deployment job logs. + * `status_code` - (String) Final result of the agent deployment job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the agent deployment job, in a formatted log string. + * `updated_at` - (String) The agent deploy job updation time. + * `updated_by` - (String) Email address of user who ran the agent deploy job. +* `recent_health_job` - (List) Agent health check. +Nested scheme for **recent_health_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full health-check job logs. + * `status_code` - (String) Final result of the health-check job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the health-check job, in a formatted log string. + * `updated_at` - (String) The agent health check job updation time. + * `updated_by` - (String) Email address of user who ran the agent health check job. +* `recent_prs_job` - (List) Run a pre-requisite scanner for deploying agent. +Nested scheme for **recent_prs_job**: + * `agent_id` - (String) Id of the agent. + * `agent_version` - (String) Agent version. + * `job_id` - (String) Job Id. + * `log_url` - (String) URL to the full pre-requisite scanner job logs. + * `status_code` - (String) Final result of the pre-requisite scanner job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. + * `status_message` - (String) The outcome of the pre-requisite scanner job, in a formatted log string. + * `updated_at` - (String) The agent prs job updation time. + * `updated_by` - (String) Email address of user who ran the agent prs job. +* `system_state` - (List) Computed state of the agent. +Nested scheme for **system_state**: + * `status_code` - (String) Agent Status. + * Constraints: Allowable values are: `error`, `normal`, `in_progress`, `pending`, `draft`. + * `status_message` - (String) The agent status message. +* `updated_at` - (String) The agent registration updation time. +* `updated_by` - (String) Email address of user who updated the agent registration. + +## Import + +You can import the `ibm_schematics_agent` resource by using `id`. The agent resource id. + +# Syntax +``` +$ terraform import ibm_schematics_agent.schematics_agent +``` diff --git a/website/docs/r/schematics_agent_deploy.html.markdown b/website/docs/r/schematics_agent_deploy.html.markdown new file mode 100644 index 0000000000..0089f2b684 --- /dev/null +++ b/website/docs/r/schematics_agent_deploy.html.markdown @@ -0,0 +1,59 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_deploy" +description: |- + Manages schematics_agent_deploy. +subcategory: "Schematics" +--- + +# ibm_schematics_agent_deploy + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a resource for schematics_agent_deploy. This allows schematics_agent_deploy to be created, updated and deleted. + +## Example Usage + +```hcl +resource "ibm_schematics_agent_deploy" "schematics_agent_deploy_instance" { + agent_id = "agent_id" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your resource. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. +* `force` - (Optional, Boolean) Equivalent to -force options in the command line, default is false. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +* `id` - The unique identifier of the schematics_agent_deploy. +* `agent_version` - (String) Agent version. +* `is_redeployed` - (Boolean) True, when the same version of the agent was redeployed. +* `job_id` - (String) Job Id. +* `log_url` - (String) URL to the full agent deployment job logs. +* `status_code` - (String) Final result of the agent deployment job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. +* `status_message` - (String) The outcome of the agent deployment job, in a formatted log string. +* `updated_at` - (String) The agent deploy job updation time. +* `updated_by` - (String) Email address of user who ran the agent deploy job. + +## Import + +You can import the `ibm_schematics_agent_deploy` resource by using `agent_id`. +The `agent_id` property can be formed from `agent_id`, and `agent_id` in the following format: + +``` +/ +``` +* `agent_id`: A string. Agent ID to get the details of agent. +* `agent_id`: A string. Agent ID to get the details of agent. + +# Syntax +``` +$ terraform import ibm_schematics_agent_deploy.schematics_agent_deploy / +``` diff --git a/website/docs/r/schematics_agent_health.html.markdown b/website/docs/r/schematics_agent_health.html.markdown new file mode 100644 index 0000000000..82ecf4f647 --- /dev/null +++ b/website/docs/r/schematics_agent_health.html.markdown @@ -0,0 +1,58 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_health" +description: |- + Manages schematics_agent_health. +subcategory: "Schematics" +--- + +# ibm_schematics_agent_health + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a resource for schematics_agent_health. This allows schematics_agent_health to be created, updated and deleted. + +## Example Usage + +```hcl +resource "ibm_schematics_agent_health" "schematics_agent_health_instance" { + agent_id = "agent_id" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your resource. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. +* `force` - (Optional, Boolean) Equivalent to -force options in the command line, default is false. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +* `id` - The unique identifier of the schematics_agent_health. +* `agent_version` - (String) Agent version. +* `job_id` - (String) Job Id. +* `log_url` - (String) URL to the full health-check job logs. +* `status_code` - (String) Final result of the health-check job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. +* `status_message` - (String) The outcome of the health-check job, in a formatted log string. +* `updated_at` - (String) The agent health check job updation time. +* `updated_by` - (String) Email address of user who ran the agent health check job. + +## Import + +You can import the `ibm_schematics_agent_health` resource by using `agent_id`. +The `agent_id` property can be formed from `agent_id`, and `agent_id` in the following format: + +``` +/ +``` +* `agent_id`: A string. Agent ID to get the details of agent. +* `agent_id`: A string. Agent ID to get the details of agent. + +# Syntax +``` +$ terraform import ibm_schematics_agent_health.schematics_agent_health / +``` diff --git a/website/docs/r/schematics_agent_prs.html.markdown b/website/docs/r/schematics_agent_prs.html.markdown new file mode 100644 index 0000000000..00d3dce5f7 --- /dev/null +++ b/website/docs/r/schematics_agent_prs.html.markdown @@ -0,0 +1,58 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_agent_prs" +description: |- + Manages schematics_agent_prs. +subcategory: "Schematics" +--- + +# ibm_schematics_agent_prs + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a resource for schematics_agent_prs. This allows schematics_agent_prs to be created, updated and deleted. + +## Example Usage + +```hcl +resource "ibm_schematics_agent_prs" "schematics_agent_prs_instance" { + agent_id = "agent_id" +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your resource. + +* `agent_id` - (Required, Forces new resource, String) Agent ID to get the details of agent. +* `force` - (Optional, Boolean) Equivalent to -force options in the command line, default is false. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +* `id` - The unique identifier of the schematics_agent_prs. +* `agent_version` - (String) Agent version. +* `job_id` - (String) Job Id. +* `log_url` - (String) URL to the full pre-requisite scanner job logs. +* `status_code` - (String) Final result of the pre-requisite scanner job. + * Constraints: Allowable values are: `pending`, `in-progress`, `success`, `failed`. +* `status_message` - (String) The outcome of the pre-requisite scanner job, in a formatted log string. +* `updated_at` - (String) The agent prs job updation time. +* `updated_by` - (String) Email address of user who ran the agent prs job. + +## Import + +You can import the `ibm_schematics_agent_prs` resource by using `agent_id`. +The `agent_id` property can be formed from `agent_id`, and `agent_id` in the following format: + +``` +/ +``` +* `agent_id`: A string. Agent ID to get the details of agent. +* `agent_id`: A string. Agent ID to get the details of agent. + +# Syntax +``` +$ terraform import ibm_schematics_agent_prs.schematics_agent_prs / +``` diff --git a/website/docs/r/schematics_policy.html.markdown b/website/docs/r/schematics_policy.html.markdown new file mode 100644 index 0000000000..b1618ba389 --- /dev/null +++ b/website/docs/r/schematics_policy.html.markdown @@ -0,0 +1,126 @@ +--- +layout: "ibm" +page_title: "IBM : ibm_schematics_policy" +description: |- + Manages schematics_policy. +subcategory: "Schematics" +--- + +# ibm_schematics_policy + +~> **Beta:** This resource is in Beta, and is subject to change. + +Provides a resource for schematics_policy. This allows schematics_policy to be created, updated and deleted. + +## Example Usage + +```hcl +resource "ibm_schematics_policy" "schematics_policy_instance" { + description = "Policy for job execution of secured workspaces on agent1" + name = "Agent1-DevWS" + parameter { + agent_assignment_policy_parameter { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } + } + resource_group = "Default" + scoped_resources { + kind = "workspace" + id = "id" + } + state { + state = "draft" + set_by = "set_by" + set_at = "2021-01-31T09:44:12Z" + } + target { + selector_kind = "ids" + selector_ids = [ "selector_ids" ] + selector_scope { + kind = "workspace" + tags = [ "tags" ] + resource_groups = [ "resource_groups" ] + locations = [ "us-south" ] + } + } +} +``` + +## Argument Reference + +Review the argument reference that you can specify for your resource. + +* `name` - (Required, String) Name of Schematics customization policy. +* `description` - (Optional, String) The description of Schematics customization policy. +* `kind` - (Optional, String) Policy kind or categories for managing and deriving policy decision * `agent_assignment_policy` Agent assignment policy for job execution. + * Constraints: Allowable values are: `agent_assignment_policy`. +* `location` - (Optional, String) List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. + * Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`. +* `parameter` - (Optional, List) The parameter to tune the Schematics policy. +Nested scheme for **parameter**: + * `agent_assignment_policy_parameter` - (Optional, List) Parameters for the `agent_assignment_policy`. + Nested scheme for **agent_assignment_policy_parameter**: + * `selector_ids` - (Optional, List) The static selectors of schematics object ids (workspace, action or blueprint) for the Schematics policy. + * `selector_kind` - (Optional, String) Types of schematics object selector. + * Constraints: Allowable values are: `ids`, `scoped`. + * `selector_scope` - (Optional, List) The selectors to dynamically list of schematics object ids (workspace, action or blueprint) for the Schematics policy. + Nested scheme for **selector_scope**: + * `kind` - (Optional, String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. + * `locations` - (Optional, List) The location based selector. + * Constraints: Allowable list items are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `resource_groups` - (Optional, List) The resource group based selector. + * `tags` - (Optional, List) The tag based selector. +* `resource_group` - (Optional, String) The resource group name for the policy. By default, Policy will be created in `default` Resource Group. +* `scoped_resources` - (Optional, List) List of scoped Schematics resources targeted by the policy. +Nested scheme for **scoped_resources**: + * `id` - (Optional, String) Schematics resource Id. + * `kind` - (Optional, String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. +* `state` - (Optional, List) User defined status of the Schematics object. +Nested scheme for **state**: + * `set_at` - (Computed, String) When the User who set the state of the Object. + * `set_by` - (Computed, String) Name of the User who set the state of the Object. + * `state` - (Optional, String) User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution. + * Constraints: Allowable values are: `draft`, `live`, `locked`, `disable`. +* `tags` - (Optional, List) Tags for the Schematics customization policy. +* `target` - (Optional, List) The objects for the Schematics policy. +Nested scheme for **target**: + * `selector_ids` - (Optional, List) Static selectors of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy. + * `selector_kind` - (Optional, String) Types of schematics object selector. + * Constraints: Allowable values are: `ids`, `scoped`. + * `selector_scope` - (Optional, List) Selectors to dynamically list of schematics object ids (agent, workspace, action or blueprint) for the Schematics policy. + Nested scheme for **selector_scope**: + * `kind` - (Optional, String) Name of the Schematics automation resource. + * Constraints: Allowable values are: `workspace`, `action`, `system`, `environment`, `blueprint`. + * `locations` - (Optional, List) The location based selector. + * Constraints: Allowable list items are: `us-south`, `us-east`, `eu-gb`, `eu-de`. + * `resource_groups` - (Optional, List) The resource group based selector. + * `tags` - (Optional, List) The tag based selector. + +## Attribute Reference + +In addition to all argument references listed, you can access the following attribute references after your resource is created. + +* `id` - The unique identifier of the schematics_policy. +* `account` - (String) The Account id. +* `created_at` - (String) The policy creation time. +* `created_by` - (String) The user who created the policy. +* `crn` - (String) The policy CRN. +* `updated_at` - (String) The policy updation time. + +## Import + +You can import the `ibm_schematics_policy` resource by using `id`. The system generated policy Id. + +# Syntax +``` +$ terraform import ibm_schematics_policy.schematics_policy +``` diff --git a/website/docs/r/sm_imported_certificate.html.markdown b/website/docs/r/sm_imported_certificate.html.markdown index 786d43a488..8ae2e0e158 100644 --- a/website/docs/r/sm_imported_certificate.html.markdown +++ b/website/docs/r/sm_imported_certificate.html.markdown @@ -21,7 +21,7 @@ resource "ibm_sm_imported_certificate" "sm_imported_certificate" { description = "Extended description for this secret." labels = ["my-label"] secret_group_id = ibm_sm_secret_group.sm_secret_group.secret_group_id - certificate: "-----BEGIN CERTIFICATE-----\nMIIE3jCCBGSgAwIBAgIUZfTbf3adn87l5J2Q2Aw+6Vk/qhowCgYIKoZIzj0EAwIw\n-----END CERTIFICATE-----" + certificate = "-----BEGIN CERTIFICATE-----\nMIIE3jCCBGSgAwIBAgIUZfTbf3adn87l5J2Q2Aw+6Vk/qhowCgYIKoZIzj0EAwIw\n-----END CERTIFICATE-----" } ``` diff --git a/website/docs/r/trusted_profile_template.html.markdown b/website/docs/r/trusted_profile_template.html.markdown index c46e543e85..da47c9a24a 100644 --- a/website/docs/r/trusted_profile_template.html.markdown +++ b/website/docs/r/trusted_profile_template.html.markdown @@ -2,7 +2,7 @@ layout: "ibm" page_title: "IBM : ibm_trusted_profile_template" description: |- - Manages IAM trusted profile templates + Manages IAM trusted profile templates subcategory: "Identity & Access Management (IAM)" --- From 8aa695baa6dd9506f3cb5da3a1d7d52777f87ceb Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:20:55 +0530 Subject: [PATCH 05/17] remove changes came as part of merge --- .secrets.baseline | 10 ---------- .../resource_ibm_code_engine_domain_mapping_test.go | 5 +++-- .../database/resource_ibm_database_cassandra_test.go | 1 + ...esource_ibm_database_elasticsearch_platinum_test.go | 1 + 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index c4663ef7bd..c90644602f 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -2131,16 +2131,6 @@ "verified_result": null } ], - "ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go": [ - { - "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", - "is_secret": false, - "is_verified": false, - "line_number": 779, - "type": "Secret Keyword", - "verified_result": null - } - ], "ibm/service/database/resource_ibm_database_elasticsearch_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", diff --git a/ibm/service/codeengine/resource_ibm_code_engine_domain_mapping_test.go b/ibm/service/codeengine/resource_ibm_code_engine_domain_mapping_test.go index 3ee8f9aeb4..0ffde1ca1c 100644 --- a/ibm/service/codeengine/resource_ibm_code_engine_domain_mapping_test.go +++ b/ibm/service/codeengine/resource_ibm_code_engine_domain_mapping_test.go @@ -6,9 +6,10 @@ package codeengine_test import ( "encoding/base64" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "testing" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -213,7 +214,7 @@ func testAccCheckIbmCodeEngineDomainMappingDestroy(s *terraform.State) error { func decodeBase64EnvVar(base64Text string, envVar string) string { decodedText, err := base64.StdEncoding.DecodeString(base64Text) if err != nil { - fmt.Errorf("Error decoding environment variable %s: %s", envVar, err) + _ = fmt.Errorf("Error decoding environment variable %s: %s", envVar, err) return "" } return string(decodedText) diff --git a/ibm/service/database/resource_ibm_database_cassandra_test.go b/ibm/service/database/resource_ibm_database_cassandra_test.go index fdd636a322..a5374a4eb6 100644 --- a/ibm/service/database/resource_ibm_database_cassandra_test.go +++ b/ibm/service/database/resource_ibm_database_cassandra_test.go @@ -454,6 +454,7 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeFullyspecified(databaseResource disk { allocation_mb = 20480 } + cpu { allocation_count = 6 } diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go index d04813044b..9ce5136205 100644 --- a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go +++ b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go @@ -354,6 +354,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumBasic(databaseResourceG adminpassword = "password12" group { group_id = "member" + memory { allocation_mb = 1024 } From af58f1a679602520c6b73b43ab31123a73e575c2 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:31:31 +0530 Subject: [PATCH 06/17] remove changes came as part of merge --- ibm/service/database/resource_ibm_database_cassandra_test.go | 2 +- .../resource_ibm_database_elasticsearch_platinum_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibm/service/database/resource_ibm_database_cassandra_test.go b/ibm/service/database/resource_ibm_database_cassandra_test.go index a5374a4eb6..831d52752b 100644 --- a/ibm/service/database/resource_ibm_database_cassandra_test.go +++ b/ibm/service/database/resource_ibm_database_cassandra_test.go @@ -454,7 +454,7 @@ func testAccCheckIBMDatabaseInstanceCassandraNodeFullyspecified(databaseResource disk { allocation_mb = 20480 } - + cpu { allocation_count = 6 } diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go index 9ce5136205..bf68998ac2 100644 --- a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go +++ b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go @@ -354,7 +354,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumBasic(databaseResourceG adminpassword = "password12" group { group_id = "member" - + memory { allocation_mb = 1024 } From c7b69cd0fa2a55632bf10c22ce49628eb943c3ea Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:32:14 +0530 Subject: [PATCH 07/17] remove changes came as part of merge --- .../resource_ibm_database_elasticsearch_platinum_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go index bf68998ac2..e1cefb491d 100644 --- a/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go +++ b/ibm/service/database/resource_ibm_database_elasticsearch_platinum_test.go @@ -354,7 +354,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchPlatinumBasic(databaseResourceG adminpassword = "password12" group { group_id = "member" - + memory { allocation_mb = 1024 } From be8cd2344027f1764474f00aa4ce944d4b57844a Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:12:09 +0530 Subject: [PATCH 08/17] add development maturity to sdk, minor fixes while testing --- common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 24 +++++++++++ .../vpc/data_source_ibm_is_instance.go | 6 ++- .../data_source_ibm_is_instance_template.go | 2 +- .../data_source_ibm_is_instance_templates.go | 2 +- .../vpc/data_source_ibm_is_instances.go | 6 ++- ibm/service/vpc/resource_ibm_is_instance.go | 8 ++-- .../vpc/resource_ibm_is_instance_template.go | 2 +- .../vpc/resource_ibm_is_reservation.go | 41 ++++++++++++------- 8 files changed, 67 insertions(+), 24 deletions(-) diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index 6103f37ef5..279241562a 100644 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -5047,6 +5047,8 @@ func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInst builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5110,6 +5112,8 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5230,6 +5234,8 @@ func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanc builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { @@ -5356,6 +5362,8 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5465,6 +5473,8 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5590,6 +5600,8 @@ func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -5654,6 +5666,8 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -8959,6 +8973,8 @@ func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReserv builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { @@ -9051,6 +9067,8 @@ func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReserv builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9114,6 +9132,8 @@ func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationO builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9178,6 +9198,8 @@ func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReserv builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9247,6 +9269,8 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) if err != nil { diff --git a/ibm/service/vpc/data_source_ibm_is_instance.go b/ibm/service/vpc/data_source_ibm_is_instance.go index 8504c301fd..7b35878899 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance.go +++ b/ibm/service/vpc/data_source_ibm_is_instance.go @@ -1232,7 +1232,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy if instance.ReservationAffinity.Pool != nil { poolList := make([]map[string]interface{}, 0) for _, pool := range instance.ReservationAffinity.Pool { @@ -1257,6 +1257,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er d.Set(isReservationAffinity, reservationAffinity) } if instance.Reservation != nil { + resList := make([]map[string]interface{}, 0) res := map[string]interface{}{} res[isReservationId] = *instance.Reservation.ID @@ -1270,7 +1271,8 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er deletedList = append(deletedList, deletedMap) res[isReservationDeleted] = deletedList } - d.Set(isInstanceReservation, res) + resList = append(resList, res) + d.Set(isInstanceReservation, resList) } return nil diff --git a/ibm/service/vpc/data_source_ibm_is_instance_template.go b/ibm/service/vpc/data_source_ibm_is_instance_template.go index 3625e6135b..740cb7fd2b 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_template.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_template.go @@ -525,7 +525,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy if instance.ReservationAffinity.Pool != nil { pool := instance.ReservationAffinity.Pool[0] res := "" diff --git a/ibm/service/vpc/data_source_ibm_is_instance_templates.go b/ibm/service/vpc/data_source_ibm_is_instance_templates.go index ed40d4dd75..d01f1fa348 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_templates.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_templates.go @@ -747,7 +747,7 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy if instance.ReservationAffinity.Pool != nil { pool := instance.ReservationAffinity.Pool[0] res := "" diff --git a/ibm/service/vpc/data_source_ibm_is_instances.go b/ibm/service/vpc/data_source_ibm_is_instances.go index 5d2049b148..777aaf06a3 100644 --- a/ibm/service/vpc/data_source_ibm_is_instances.go +++ b/ibm/service/vpc/data_source_ibm_is_instances.go @@ -1207,7 +1207,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy if instance.ReservationAffinity.Pool != nil { poolList := make([]map[string]interface{}, 0) for _, pool := range instance.ReservationAffinity.Pool { @@ -1232,6 +1232,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { l[isReservationAffinity] = reservationAffinity } if instance.Reservation != nil { + resList := make([]map[string]interface{}, 0) res := map[string]interface{}{} res[isReservationId] = *instance.Reservation.ID @@ -1245,7 +1246,8 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { deletedList = append(deletedList, deletedMap) res[isReservationDeleted] = deletedList } - l[isInstanceReservation] = res + resList = append(resList, res) + l[isInstanceReservation] = resList } instancesInfo = append(instancesInfo, l) diff --git a/ibm/service/vpc/resource_ibm_is_instance.go b/ibm/service/vpc/resource_ibm_is_instance.go index 94de2f6c6e..c1b8efa3f6 100644 --- a/ibm/service/vpc/resource_ibm_is_instance.go +++ b/ibm/service/vpc/resource_ibm_is_instance.go @@ -3485,8 +3485,8 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy - if instance.ReservationAffinity.Pool != nil { + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy + if instance.ReservationAffinity.Pool != nil && len(instance.ReservationAffinity.Pool) > 0 { poolList := make([]map[string]interface{}, 0) for _, pool := range instance.ReservationAffinity.Pool { res := map[string]interface{}{} @@ -3510,6 +3510,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isReservationAffinity, reservationAffinity) } if instance.Reservation != nil { + resList := make([]map[string]interface{}, 0) res := map[string]interface{}{} res[isReservationId] = *instance.Reservation.ID @@ -3523,7 +3524,8 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { deletedList = append(deletedList, deletedMap) res[isReservationDeleted] = deletedList } - d.Set(isInstanceReservation, res) + resList = append(resList, res) + d.Set(isInstanceReservation, resList) } if instance.NetworkInterfaces != nil { diff --git a/ibm/service/vpc/resource_ibm_is_instance_template.go b/ibm/service/vpc/resource_ibm_is_instance_template.go index 33cbf5c134..e2186cb362 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_template.go +++ b/ibm/service/vpc/resource_ibm_is_instance_template.go @@ -1637,7 +1637,7 @@ func instanceTemplateGet(d *schema.ResourceData, meta interface{}, ID string) er reservationAffinity := []map[string]interface{}{} reservationAffinityMap := map[string]interface{}{} - reservationAffinityMap[isReservationAffinityPolicy] = instance.ReservationAffinity.Policy + reservationAffinityMap[isReservationAffinityPolicyResp] = instance.ReservationAffinity.Policy if instance.ReservationAffinity.Pool != nil { pool := instance.ReservationAffinity.Pool[0] res := "" diff --git a/ibm/service/vpc/resource_ibm_is_reservation.go b/ibm/service/vpc/resource_ibm_is_reservation.go index 24475e3ba8..c658b4cea0 100644 --- a/ibm/service/vpc/resource_ibm_is_reservation.go +++ b/ibm/service/vpc/resource_ibm_is_reservation.go @@ -337,10 +337,10 @@ func resourceIBMISReservationCreate(d *schema.ResourceData, meta interface{}) er resCommittedUse := d.Get(isReservationCommittedUse + ".0").(map[string]interface{}) reservationCommittedUsePrototype := &vpcv1.ReservationCommittedUsePrototype{} - if resCommittedUse[isReservationComittedUseTerm] != nil { + if resCommittedUse[isReservationComittedUseTerm] != nil && resCommittedUse[isReservationComittedUseTerm].(string) != "" { reservationCommittedUsePrototype.Term = core.StringPtr(resCommittedUse[isReservationComittedUseTerm].(string)) } - if resCommittedUse[isReservationComittedUseExpirationPolicy] != nil { + if resCommittedUse[isReservationComittedUseExpirationPolicy] != nil && resCommittedUse[isReservationComittedUseExpirationPolicy].(string) != "" { reservationCommittedUsePrototype.ExpirationPolicy = core.StringPtr(resCommittedUse[isReservationComittedUseExpirationPolicy].(string)) } createReservationOptions.CommittedUse = reservationCommittedUsePrototype @@ -350,26 +350,31 @@ func resourceIBMISReservationCreate(d *schema.ResourceData, meta interface{}) er resProfile := d.Get(isReservationProfile + ".0").(map[string]interface{}) reservationProfilePrototype := &vpcv1.ReservationProfilePrototype{} - if resProfile[isReservationProfileName] != nil { + if resProfile[isReservationProfileName] != nil && resProfile[isReservationProfileName].(string) != "" { reservationProfilePrototype.Name = core.StringPtr(resProfile[isReservationProfileName].(string)) } - if resProfile[isReservationProfileResourceType] != nil { + if resProfile[isReservationProfileResourceType] != nil && resProfile[isReservationProfileResourceType].(string) != "" { reservationProfilePrototype.ResourceType = core.StringPtr(resProfile[isReservationProfileResourceType].(string)) } createReservationOptions.Profile = reservationProfilePrototype } - if _, ok := d.GetOk(isReservationZone); ok { - zone := core.StringPtr(d.Get(isReservationZone).(string)) - createReservationOptions.Zone = &vpcv1.ZoneIdentity{Name: zone} + if zone, ok := d.GetOk(isReservationZone); ok { + if zone.(string) != "" { + createReservationOptions.Zone = &vpcv1.ZoneIdentity{Name: core.StringPtr(zone.(string))} + } } if name, ok := d.GetOk(isReservationName); ok { - createReservationOptions.Name = core.StringPtr(name.(string)) + if name.(string) != "" { + createReservationOptions.Name = core.StringPtr(name.(string)) + } } if affPol, ok := d.GetOk(isReservationAffinityPolicy); ok { - createReservationOptions.AffinityPolicy = core.StringPtr(affPol.(string)) + if affPol.(string) != "" { + createReservationOptions.AffinityPolicy = core.StringPtr(affPol.(string)) + } } sess, err := vpcClient(meta) @@ -566,8 +571,10 @@ func resourceIBMISReservationUpdate(d *schema.ResourceData, meta interface{}) er reservationPatchModel := &vpcv1.ReservationPatch{} if d.HasChange(isReservationName) { name = d.Get(isReservationName).(string) - reservationPatchModel.Name = &name - hasChanged = true + if name != "" { + reservationPatchModel.Name = &name + hasChanged = true + } } if d.HasChange(isReservationCapacity) { capacityIntf := d.Get(isReservationCapacity) @@ -586,7 +593,9 @@ func resourceIBMISReservationUpdate(d *schema.ResourceData, meta interface{}) er cuPatch := &vpcv1.ReservationCommittedUsePatch{} if d.HasChange(isReservationCommittedUse + ".0." + isReservationComittedUseExpirationPolicy) { if expPolIntf, ok := committedUseMap[isReservationComittedUseExpirationPolicy]; ok { - cuPatch.ExpirationPolicy = core.StringPtr(string(expPolIntf.(string))) + if expPolIntf.(string) != "" { + cuPatch.ExpirationPolicy = core.StringPtr(string(expPolIntf.(string))) + } } } if d.HasChange(isReservationCommittedUse + ".0." + isReservationComittedUseTerm) { @@ -602,12 +611,16 @@ func resourceIBMISReservationUpdate(d *schema.ResourceData, meta interface{}) er profPatch := &vpcv1.ReservationProfilePatch{} if d.HasChange(isReservationProfile + ".0." + isReservationProfileName) { if profNameIntf, ok := profileMap[isReservationProfileName]; ok { - profPatch.Name = core.StringPtr(string(profNameIntf.(string))) + if profNameIntf.(string) != "" { + profPatch.Name = core.StringPtr(string(profNameIntf.(string))) + } } } if d.HasChange(isReservationProfile + ".0." + isReservationProfileResourceType) { if resTypeIntf, ok := profileMap[isReservationProfileResourceType]; ok { - profPatch.ResourceType = core.StringPtr(string(resTypeIntf.(string))) + if resTypeIntf.(string) != "" { + profPatch.ResourceType = core.StringPtr(string(resTypeIntf.(string))) + } } } reservationPatchModel.Profile = profPatch From 2e2223ef4e5e0caec2352003c7768765922dbf1c Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:41:51 +0530 Subject: [PATCH 09/17] acceptance test --- ibm/acctest/acctest.go | 7 ++ .../vpc/resource_ibm_is_instance_template.go | 16 +++- .../resource_ibm_is_instance_template_test.go | 79 +++++++++++++++++++ .../vpc/resource_ibm_is_instance_test.go | 50 ++++++------ 4 files changed, 121 insertions(+), 31 deletions(-) diff --git a/ibm/acctest/acctest.go b/ibm/acctest/acctest.go index 5e411830a7..3a4f84d52b 100644 --- a/ibm/acctest/acctest.go +++ b/ibm/acctest/acctest.go @@ -214,6 +214,7 @@ var ISDelegegatedVPC string var ( IsImageName string IsImage string + IsImage2 string IsImageEncryptedDataKey string IsImageEncryptionKey string IsWinImage string @@ -693,6 +694,12 @@ func init() { fmt.Println("[INFO] Set the environment variable IS_IMAGE for testing ibm_is_instance, ibm_is_floating_ip else it is set to default value 'r006-907911a7-0ffe-467e-8821-3cc9a0d82a39'") } + IsImage2 = os.Getenv("IS_IMAGE2") + if IsImage2 == "" { + IsImage2 = "r134-f47cc24c-e020-4db5-ad96-1e5be8b5853b" // for next gen infrastructure ibm-centos-7-9-minimal-amd64-10 image + fmt.Println("[INFO] Set the environment variable IS_IMAGE2 for testing ibm_is_instance, ibm_is_floating_ip else it is set to default value 'r134-f47cc24c-e020-4db5-ad96-1e5be8b5853b'") + } + IsWinImage = os.Getenv("IS_WIN_IMAGE") if IsWinImage == "" { // IsWinImage = "a7a0626c-f97e-4180-afbe-0331ec62f32a" // classic windows machine: ibm-windows-server-2012-full-standard-amd64-1 diff --git a/ibm/service/vpc/resource_ibm_is_instance_template.go b/ibm/service/vpc/resource_ibm_is_instance_template.go index e2186cb362..f3146aaefe 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_template.go +++ b/ibm/service/vpc/resource_ibm_is_instance_template.go @@ -593,11 +593,21 @@ func ResourceIBMISInstanceTemplate() *schema.Resource { Computed: true, Description: "The reservation affinity policy to use for this virtual server instance.", }, - isReservationAffinityPool: { - Type: schema.TypeString, + isReservationAffinityPool: &schema.Schema{ + Type: schema.TypeList, Optional: true, Computed: true, - Description: "The ID of the reservation associated with this template.", + Description: "The pool of reservations available for use by this virtual server instance.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isReservationId: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The unique identifier for this reservation.", + }, + }, + }, }, }, }, diff --git a/ibm/service/vpc/resource_ibm_is_instance_template_test.go b/ibm/service/vpc/resource_ibm_is_instance_template_test.go index 31af702aa8..22da1775d4 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_template_test.go +++ b/ibm/service/vpc/resource_ibm_is_instance_template_test.go @@ -77,6 +77,40 @@ func TestAccIBMISInstanceTemplate_catalog_basic(t *testing.T) { }, }) } + +func TestAccIBMISInstanceTemplate_Reservation(t *testing.T) { + randInt := acctest.RandIntRange(10, 100) + + publicKey := strings.TrimSpace(` + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVtuCfWKVGKaRmaRG6JQZY8YdxnDgGzVOK93IrV9R5Hl0JP1oiLLWlZQS2reAKb8lBqyDVEREpaoRUDjqDqXG8J/kR42FKN51su914pjSBc86wJ02VtT1Wm1zRbSg67kT+g8/T1jCgB5XBODqbcICHVP8Z1lXkgbiHLwlUrbz6OZkGJHo/M/kD1Eme8lctceIYNz/Ilm7ewMXZA4fsidpto9AjyarrJLufrOBl4MRVcZTDSJ7rLP982aHpu9pi5eJAjOZc7Og7n4ns3NFppiCwgVMCVUQbN5GBlWhZ1OsT84ZiTf+Zy8ew+Yg5T7Il8HuC7loWnz+esQPf0s3xhC/kTsGgZreIDoh/rxJfD67wKXetNSh5RH/n5BqjaOuXPFeNXmMhKlhj9nJ8scayx/wsvOGuocEIkbyJSLj3sLUU403OafgatEdnJOwbqg6rUNNF5RIjpJpL7eEWlKIi1j9LyhmPJ+fEO7TmOES82VpCMHpLbe4gf/MhhJ/Xy8DKh9s= root@ffd8363b1226 + `) + vpcName := fmt.Sprintf("tf-testvpc%d", randInt) + subnetName := fmt.Sprintf("tf-testsubnet%d", randInt) + templateName := fmt.Sprintf("tf-testtemplate%d", randInt) + sshKeyName := fmt.Sprintf("tf-testsshkey%d", randInt) + resource.Test(t, resource.TestCase{ + PreCheck: func() { acc.TestAccPreCheck(t) }, + Providers: acc.TestAccProviders, + CheckDestroy: testAccCheckIBMISInstanceTemplateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckIBMISInstanceTemplateReservationConfig(vpcName, subnetName, sshKeyName, publicKey, templateName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "ibm_is_instance_template.instancetemplate1", "name", templateName), + resource.TestCheckResourceAttrSet( + "ibm_is_instance_template.instancetemplate1", "profile"), + resource.TestCheckResourceAttr( + "ibm_is_instance.testacc_instance", "reservation_affinity.0.policy", "manual"), + resource.TestCheckResourceAttrSet( + "ibm_is_instance.testacc_instance", "reservation_affinity.0.pool"), + resource.TestCheckNoResourceAttr( + "ibm_is_instance_template.instancetemplate1", "image"), + ), + }, + }, + }) +} func TestAccIBMISInstanceTemplate_Reserved_IP_basic(t *testing.T) { randInt := acctest.RandIntRange(10, 100) @@ -332,6 +366,51 @@ func testAccCheckIBMISInstanceTemplateCatalogConfig(vpcName, subnetName, sshKeyN `, vpcName, subnetName, sshKeyName, publicKey, templateName) +} + +func testAccCheckIBMISInstanceTemplateReservationConfig(vpcName, subnetName, sshKeyName, publicKey, templateName string) string { + return fmt.Sprintf(` + resource "ibm_is_vpc" "vpc2" { + name = "%s" + } + + resource "ibm_is_subnet" "subnet2" { + name = "%s" + vpc = ibm_is_vpc.vpc2.id + zone = "us-south-2" + ipv4_cidr_block = "10.240.64.0/28" + } + + resource "ibm_is_ssh_key" "sshkey" { + name = "%s" + public_key = "%s" + } + + data "ibm_is_images" "is_images" { + catalog_managed = true + } + + resource "ibm_is_instance_template" "instancetemplate1" { + name = "%s" + profile = "bx2-2x8" + + primary_network_interface { + subnet = ibm_is_subnet.subnet2.id + } + reservation_affinity { + policy = "manual" + pool { + id = "0735-b4a78f50-33bd-44f9-a3ff-4c33f444459d" + } + } + vpc = ibm_is_vpc.vpc2.id + zone = "us-south-2" + keys = [ibm_is_ssh_key.sshkey.id] + } + + + `, vpcName, subnetName, sshKeyName, publicKey, templateName) + } func testAccCheckIBMISInstanceTemplateRipConfig(vpcName, subnetName, sshKeyName, publicKey, templateName string) string { return fmt.Sprintf(` diff --git a/ibm/service/vpc/resource_ibm_is_instance_test.go b/ibm/service/vpc/resource_ibm_is_instance_test.go index fcaccd41dc..5507f6cea2 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_test.go +++ b/ibm/service/vpc/resource_ibm_is_instance_test.go @@ -856,9 +856,12 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE func TestAccIBMISInstance_Reservation(t *testing.T) { var instance string vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100)) - name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100)) + name := fmt.Sprintf("tf-instance-%d", acctest.RandIntRange(10, 100)) subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100)) - reservationname := fmt.Sprintf("tf-reservation-%d", acctest.RandIntRange(10, 100)) + publicKey := strings.TrimSpace(` +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR +`) + sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100)) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -866,13 +869,13 @@ func TestAccIBMISInstance_Reservation(t *testing.T) { CheckDestroy: testAccCheckIBMISInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, reservationname), + Config: testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, publicKey, sshname), Check: resource.ComposeTestCheckFunc( testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance), resource.TestCheckResourceAttr( "ibm_is_instance.testacc_instance", "name", name), resource.TestCheckResourceAttr( - "ibm_is_instance.testacc_instance", "zone", acc.ISZoneName), + "ibm_is_instance.testacc_instance", "zone", acc.ISZoneName3), resource.TestCheckResourceAttr( "ibm_is_instance.testacc_instance", "reservation_affinity.0.policy", "manual"), resource.TestCheckResourceAttrSet( @@ -1668,37 +1671,27 @@ func testAccCheckIBMISInstancePlacement(vpcname, subnetname, sshname, publicKey, name = "%s" } - `, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, publicKey, volName, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.DedicatedHostGroupID, acc.ISZoneName, acc.DedicatedHostName) + `, vpcname, subnetname, acc.ISZoneName3, acc.ISCIDR, sshname, publicKey, volName, acc.ISZoneName3, name, acc.IsImage, acc.InstanceProfileName, acc.DedicatedHostGroupID, acc.ISZoneName, acc.DedicatedHostName) } -func testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, reservationid string) string { +func testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, publickey, sshname string) string { return fmt.Sprintf(` resource "ibm_is_vpc" "testacc_vpc" { name = "%s" - } - - resource "ibm_is_subnet" "testacc_subnet" { + } + resource "ibm_is_ssh_key" "testacc_keyres" { + name = "%s" + public_key = "%s" + } + + resource "ibm_is_subnet" "testacc_subnet" { name = "%s" vpc = ibm_is_vpc.testacc_vpc.id zone = "%s" - ipv4_cidr_block = "%s" - } - - resource "ibm_is_reservation" "testacc_reservation" { - capacity { - total = 10 - } - committed_use { - term = "one_year" - } - profile { - name = "ba2-2x8" - resource_type = "instance_profile" - } - zone = "%s" + total_ipv4_address_count = 16 } - resource "ibm_is_instance" "testacc_instance" { + resource "ibm_is_instance" "testacc_instance" { name = "%s" image = "%s" profile = "%s" @@ -1710,12 +1703,13 @@ func testAccCheckIBMISInstanceReservation(vpcname, subnetname, name, reservation reservation_affinity { policy = "manual" pool { - id = ibm_is_reservation.testacc_reservation.id + id = "0735-b4a78f50-33bd-44f9-a3ff-4c33f444459d" } } - } + keys = [ibm_is_ssh_key.testacc_keyres.id] + } - `, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, acc.ISZoneName, name, acc.IsImage, acc.InstanceProfileName, acc.ISZoneName) + `, vpcname, sshname, publickey, subnetname, acc.ISZoneName3, name, acc.IsImage2, acc.InstanceProfileName, acc.ISZoneName3) } func testAccCheckIBMISInstanceByVolume(vpcname, subnetname, sshname, publicKey, volName, name, name1, sname string) string { From e58508a1314b953a3ada49c7b886be3020d091a1 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:39:55 +0530 Subject: [PATCH 10/17] doc update, instance profile changes --- common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 4 + .../data_source_ibm_is_instance_profile.go | 49 ++++++++ ...ata_source_ibm_is_instance_profile_test.go | 3 + .../data_source_ibm_is_instance_profiles.go | 26 ++++ ...ta_source_ibm_is_instance_profiles_test.go | 3 + website/docs/d/is_instance.html.markdown | 50 ++++++++ .../docs/d/is_instance_profile.html.markdown | 4 + .../docs/d/is_instance_profiles.html.markdown | 4 + .../docs/d/is_instance_template.html.markdown | 7 ++ .../d/is_instance_templates.html.markdown | 7 ++ website/docs/d/is_instances.html.markdown | 26 ++++ website/docs/r/is_instance.html.markdown | 118 +++++++++++++++++- .../docs/r/is_instance_template.html.markdown | 9 ++ 13 files changed, 309 insertions(+), 1 deletion(-) diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index 279241562a..3798912015 100644 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -4929,6 +4929,8 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) if err != nil { @@ -4992,6 +4994,8 @@ func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstance builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-20") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) if err != nil { diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profile.go b/ibm/service/vpc/data_source_ibm_is_instance_profile.go index 2eee0d374a..c8a4a5547e 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profile.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profile.go @@ -238,6 +238,28 @@ func DataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, + "reservation_terms": { + Type: schema.TypeList, + Computed: true, + Description: "The type for this profile field", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field.", + }, + "values": { + Type: schema.TypeList, + Computed: true, + Description: "The supported committed use terms for a reservation using this profile", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, "total_volume_bandwidth": { Type: schema.TypeList, Computed: true, @@ -694,6 +716,12 @@ func instanceProfileGet(d *schema.ResourceData, meta interface{}, name string) e return err } } + if profile.ReservationTerms != nil { + err = d.Set("reservation_terms", dataSourceInstanceProfileFlattenReservationTerms(*profile.ReservationTerms)) + if err != nil { + return err + } + } if profile.TotalVolumeBandwidth != nil { err = d.Set("total_volume_bandwidth", dataSourceInstanceProfileFlattenTotalVolumeBandwidth(*profile.TotalVolumeBandwidth.(*vpcv1.InstanceProfileVolumeBandwidth))) if err != nil { @@ -873,6 +901,27 @@ func dataSourceInstanceProfileGPUModelToMap(bandwidthItem vpcv1.InstanceProfileG return gpuModelMap } +func dataSourceInstanceProfileFlattenReservationTerms(result vpcv1.InstanceProfileReservationTerms) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceInstanceProfileReservationTermsToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceInstanceProfileReservationTermsToMap(resTermItem vpcv1.InstanceProfileReservationTerms) map[string]interface{} { + resTermMap := map[string]interface{}{} + + if resTermItem.Type != nil { + resTermMap["type"] = resTermItem.Type + } + if resTermItem.Values != nil { + resTermMap["values"] = resTermItem.Values + } + + return resTermMap +} + func dataSourceInstanceProfileFlattenGPUMemory(result vpcv1.InstanceProfileGpuMemory) (finalList []map[string]interface{}) { finalList = []map[string]interface{}{} finalMap := dataSourceInstanceProfileGPUMemoryToMap(result) diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profile_test.go b/ibm/service/vpc/data_source_ibm_is_instance_profile_test.go index 21fa13546e..e8983ae910 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profile_test.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profile_test.go @@ -36,6 +36,9 @@ func TestAccIBMISInstanceProfileDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_manufacturer.0.type"), resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_manufacturer.0.value"), resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "network_interface_count.0.type"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.0.type"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.0.values"), ), }, }, diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profiles.go b/ibm/service/vpc/data_source_ibm_is_instance_profiles.go index 83b7788780..fc263a265f 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profiles.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profiles.go @@ -239,6 +239,28 @@ func DataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, + "reservation_terms": { + Type: schema.TypeList, + Computed: true, + Description: "The type for this profile field", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field.", + }, + "values": { + Type: schema.TypeList, + Computed: true, + Description: "The supported committed use terms for a reservation using this profile", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, "total_volume_bandwidth": { Type: schema.TypeList, Computed: true, @@ -689,6 +711,10 @@ func instanceProfilesList(d *schema.ResourceData, meta interface{}) error { l["gpu_model"] = dataSourceInstanceProfileFlattenGPUModel(*profile.GpuModel) } + if profile.ReservationTerms != nil { + l["reservation_terms"] = dataSourceInstanceProfileFlattenReservationTerms(*profile.ReservationTerms) + } + if profile.TotalVolumeBandwidth != nil { l["total_volume_bandwidth"] = dataSourceInstanceProfileFlattenTotalVolumeBandwidth(*profile.TotalVolumeBandwidth.(*vpcv1.InstanceProfileVolumeBandwidth)) } diff --git a/ibm/service/vpc/data_source_ibm_is_instance_profiles_test.go b/ibm/service/vpc/data_source_ibm_is_instance_profiles_test.go index 5984669fbb..f8de66bc58 100644 --- a/ibm/service/vpc/data_source_ibm_is_instance_profiles_test.go +++ b/ibm/service/vpc/data_source_ibm_is_instance_profiles_test.go @@ -37,6 +37,9 @@ func TestAccIBMISInstanceProfilesDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.#"), resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.0.type"), resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.0.value"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.0.type"), + resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.0.values"), ), }, }, diff --git a/website/docs/d/is_instance.html.markdown b/website/docs/d/is_instance.html.markdown index c330914f9a..8f350c064b 100644 --- a/website/docs/d/is_instance.html.markdown +++ b/website/docs/d/is_instance.html.markdown @@ -48,6 +48,21 @@ resource "ibm_is_image" "example" { } +resource "ibm_is_reservation" "example" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" +} + resource "ibm_is_instance" "example" { name = "example-instance" image = ibm_is_image.example.id @@ -63,6 +78,13 @@ resource "ibm_is_instance" "example" { subnet = ibm_is_subnet.example.id } + reservation_affinity { + policy = "manual" + pool { + id = ibm_is_reservation.example.id + } + } + vpc = ibm_is_vpc.example.id zone = "us-south-1" keys = [ibm_is_ssh_key.example.id] @@ -200,6 +222,34 @@ In addition to all argument reference list, you can access the following attribu - `primary_ipv4_address` - (String) The IPv4 address range that the subnet uses. Same as `primary_ip.0.address` - `subnet` - (String) The ID of the subnet that is used in the primary network interface. - `security_groups` (List)A list of security groups that were created for the interface. +- `reservation`- (List) The reservation used by this virtual server instance. + + Nested scheme for `reservation`: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. +- `reservation_affinity`- (List) The instance reservation affinity. + + Nested scheme for `reservation_affinity`: + - `policy` - (String) The reservation affinity policy to use for this virtual server instance. + - `pool` - (List) The pool of reservations available for use by this virtual server instance. + + Nested `pool` blocks have the following structure: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. - `resource_controller_url` - (String) The URL of the IBM Cloud dashboard that you can use to see details for your instance. - `resource_group` - (String) The resource group id, where the instance was created. - `status` - (String) The status of the instance. diff --git a/website/docs/d/is_instance_profile.html.markdown b/website/docs/d/is_instance_profile.html.markdown index e34bb233cd..0cc3afd26f 100644 --- a/website/docs/d/is_instance_profile.html.markdown +++ b/website/docs/d/is_instance_profile.html.markdown @@ -117,6 +117,10 @@ In addition to the argument reference list, you can access the following attribu Nested scheme for `gpu_model`: - `type` - (String) The type for this profile field. - `values` - (String) The permitted values for this profile field. +- `reservation_terms` - (List) Nested `reservation_terms` blocks have the following structure: + Nested scheme for `reservation_terms`: + - `type` - (String) The type for this profile field. + - `values` - (String) The supported committed use terms for a reservation using this profile. - `href` - (String) The URL for this virtual server instance profile. - `memory` - (List) Nested `memory` blocks have the following structure: diff --git a/website/docs/d/is_instance_profiles.html.markdown b/website/docs/d/is_instance_profiles.html.markdown index e59d5a0a45..1b505a8ca0 100644 --- a/website/docs/d/is_instance_profiles.html.markdown +++ b/website/docs/d/is_instance_profiles.html.markdown @@ -108,6 +108,10 @@ You can access the following attribute references after your data source is crea Nested scheme for `gpu_model`: - `type` - (String) The type for this profile field. - `values` - (String) The permitted values for this profile field. + - `reservation_terms` - (List) Nested `reservation_terms` blocks have the following structure: + Nested scheme for `reservation_terms`: + - `type` - (String) The type for this profile field. + - `values` - (String) The supported committed use terms for a reservation using this profile. - `total_volume_bandwidth` Nested `total_volume_bandwidth` blocks have the following structure: Nested scheme for `total_volume_bandwidth`: - `type` - The type for this profile field. diff --git a/website/docs/d/is_instance_template.html.markdown b/website/docs/d/is_instance_template.html.markdown index dbe863c3b2..c5b9b93629 100644 --- a/website/docs/d/is_instance_template.html.markdown +++ b/website/docs/d/is_instance_template.html.markdown @@ -104,6 +104,13 @@ You can access the following attribute references after your data source is crea - `primary_ipv4_address` - (String) The IPv4 address assigned to the primary network interface. - `subnet` - (String) The VPC subnet to assign to the interface. - `security_groups` - (String) List of security groups of the subnet. +- `reservation_affinity` - (Optional, List) The reservation affinity for the instance + Nested scheme for `reservation_affinity`: + - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. + ->**policy** +
• disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use + - `pool` - (string) The unique identifier for this reservation - `resource_group` - (String) The resource group ID. - `total_volume_bandwidth` - (Integer) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes - `user_data` - (String) The user data provided for the instance. diff --git a/website/docs/d/is_instance_templates.html.markdown b/website/docs/d/is_instance_templates.html.markdown index 84aaf636ab..984270b606 100644 --- a/website/docs/d/is_instance_templates.html.markdown +++ b/website/docs/d/is_instance_templates.html.markdown @@ -91,6 +91,13 @@ You can access the following attribute references after your data source is crea - `primary_ipv4_address` - (String) The IPv4 address assigned to the primary network interface. - `subnet` - (String) The VPC subnet to assign to the interface. - `security_groups` - (String) List of security groups of the subnet. + - `reservation_affinity` - (Optional, List) The reservation affinity for the instance + Nested scheme for `reservation_affinity`: + - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. + ->**policy** +
• disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use + - `pool` - (string) The unique identifier for this reservation - `resource_group` - (String) The resource group ID. - `total_volume_bandwidth` - (Integer) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes - `user_data` - (String) The user data provided for the instance. diff --git a/website/docs/d/is_instances.html.markdown b/website/docs/d/is_instances.html.markdown index 42a5e07edb..82d876922b 100644 --- a/website/docs/d/is_instances.html.markdown +++ b/website/docs/d/is_instances.html.markdown @@ -156,6 +156,32 @@ In addition to all argument reference list, you can access the following attribu - `resource_type`- (String) The resource type. - `primary_ipv4_address` - (String) The IPv4 address range that the subnet uses. Same as `primary_ip.0.address` - `resource_group` - (String) The name of the resource group where the instance was created. + - `reservation`- (List) The reservation used by this virtual server instance. + Nested scheme for `reservation`: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. + - `reservation_affinity`- (List) The instance reservation affinity. + Nested scheme for `reservation_affinity`: + - `policy` - (String) The reservation affinity policy to use for this virtual server instance. + - `pool` - (List) The pool of reservations available for use by this virtual server instance. + + Nested `pool` blocks have the following structure: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. - `status` - (String) The status of the instance. - `status_reasons` - (List) Array of reasons for the current status. diff --git a/website/docs/r/is_instance.html.markdown b/website/docs/r/is_instance.html.markdown index 6720a5d1ca..ef016c4066 100644 --- a/website/docs/r/is_instance.html.markdown +++ b/website/docs/r/is_instance.html.markdown @@ -127,6 +127,86 @@ resource "ibm_is_instance" "example1" { ``` +### Sample for creating an instance in a VPC with reservation + +```terraform +resource "ibm_is_vpc" "example" { + name = "example-vpc" +} + +resource "ibm_is_subnet" "example" { + name = "example-subnet" + vpc = ibm_is_vpc.example.id + zone = "us-south-1" + ipv4_cidr_block = "10.240.0.0/24" +} + +resource "ibm_is_ssh_key" "example" { + name = "example-ssh" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR" +} + +resource "ibm_is_reservation" "example" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "ba2-2x8" + resource_type = "instance_profile" + } + zone = "us-east-3" + name = "reservation-name" +} + +resource "ibm_is_instance" "example" { + name = "example-instance" + image = ibm_is_image.example.id + profile = "bx2-2x8" + metadata_service_enabled = false + + boot_volume { + encryption = "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179" + } + + primary_network_interface { + subnet = ibm_is_subnet.example.id + primary_ipv4_address = "10.240.0.6" // will be deprecated. Use primary_ip.[0].address + allow_ip_spoofing = true + } + reservation_affinity { + policy = "manual" + pool { + id = ibm_is_reservation.example.id + } + } + + network_interfaces { + name = "eth1" + subnet = ibm_is_subnet.example.id + allow_ip_spoofing = false + } + + vpc = ibm_is_vpc.example.id + zone = "us-south-1" + keys = [ibm_is_ssh_key.example.id] + + //User can configure timeouts + timeouts { + create = "15m" + update = "15m" + delete = "15m" + } +} +// primary_ipv4_address deprecation +output "primary_ipv4_address" { + # value = ibm_is_instance.example.primary_network_interface.0.primary_ipv4_address // will be deprecated in future + value = ibm_is_instance.example.primary_network_interface.0.primary_ip.0.address // use this instead +} + +``` ### Sample for creating an instance with custom security group rules. The following example shows how you can create a virtual server instance with custom security group rules. Note that the security group, security group rules, and the virtual server instance must be created in a specific order to meet the dependencies of the individual resources. To force the creation in a specific order, you use the [`depends_on` parameter](https://www.terraform.io/docs/configuration/resources.html). If you do not provide this parameter, all resources are created at the same time which might lead to resource dependency errors during the provisioning of your virtual server, such as `The security group to attach to is not available`. @@ -523,6 +603,15 @@ Review the argument references that you can specify for your resource. 1. Have matching instance disk support. Any disks associated with the current profile will be deleted, and any disks associated with the requested profile will be created. 2. Be compatible with any placement_target(`dedicated_host`, `dedicated_host_group`, `placement_group`) constraints. For example, if the instance is placed on a dedicated host, the requested profile family must be the same as the dedicated host family. +- `reservation_affinity` - (Optional, List) The reservation affinity for the instance + Nested scheme for `reservation_affinity`: + - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. + ->**policy** +
• disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use + - `pool` - (Optional, String) The pool of reservations available for use by this virtual server instance. Specified reservations must have a status of active, and have the same profile and zone as this virtual server instance. The pool must be empty if policy is disabled, and must not be empty if policy is manual. + Nested scheme for `pool`: + - `id` - The unique identifier for this reservation - `resource_group` - (Optional, Forces new resource, String) The ID of the resource group where you want to create the instance. - `instance_template` - (Optional, String) ID of the instance template to create the instance from. To create an instance template, use `ibm_is_instance_template` resource. @@ -614,7 +703,34 @@ In addition to all argument reference list, you can access the following attribu # value = ibm_is_instance.example.primary_network_interface.0.primary_ipv4_address // will be deprecated in future value = ibm_is_instance.example.primary_network_interface.0.primary_ip.0.address // use this instead } - ``` +- `reservation`- (List) The reservation used by this virtual server instance. + + Nested scheme for `reservation`: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. +- `reservation_affinity`- (List) The instance reservation affinity. + + Nested scheme for `reservation_affinity`: + - `policy` - (String) The reservation affinity policy to use for this virtual server instance. + - `pool` - (List) The pool of reservations available for use by this virtual server instance. + + Nested `pool` blocks have the following structure: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. ``` - `status` - (String) The status of the instance. - `status_reasons` - (List) Array of reasons for the current status. diff --git a/website/docs/r/is_instance_template.html.markdown b/website/docs/r/is_instance_template.html.markdown index dddc1244d4..2548d8a304 100644 --- a/website/docs/r/is_instance_template.html.markdown +++ b/website/docs/r/is_instance_template.html.markdown @@ -269,6 +269,15 @@ Review the argument references that you can specify for your resource. - `primary_ipv4_address` - (Optional, String) The IPv4 address assigned to the network interface. - `security_groups` - (Optional, List) List of security groups of the subnet. - `subnet` - (Required, Forces new resource, String) The VPC subnet to assign to the interface. +- `reservation_affinity` - (Optional, List) The reservation affinity for the instance + Nested scheme for `reservation_affinity`: + - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. + ->**policy** +
• disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use + - `pool` - (Optional, String) The pool of reservations available for use by this virtual server instance. Specified reservations must have a status of active, and have the same profile and zone as this virtual server instance. The pool must be empty if policy is disabled, and must not be empty if policy is manual. + Nested scheme for `pool`: + - `id` - The unique identifier for this reservation - `resource_group` - (Optional, Forces new resource, String) The resource group ID. - `total_volume_bandwidth` - (Optional, int) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes - `volume_attachments` - (Optional, Force new resource, List) A nested block describes the storage volume configuration for the template. From 69381298e43eee8cea5ab248d50d23c8165105e1 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:37:00 +0530 Subject: [PATCH 11/17] address review comments --- common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 30 ++++++++++--------- .../vpc/data_source_ibm_is_reservation.go | 3 +- .../data_source_ibm_is_reservation_test.go | 6 ++-- .../vpc/data_source_ibm_is_reservations.go | 8 ++--- ibm/service/vpc/resource_ibm_is_instance.go | 28 +++++++++-------- .../vpc/resource_ibm_is_reservation_test.go | 4 +-- website/docs/d/is_instance.html.markdown | 22 +++++++------- .../docs/d/is_instance_template.html.markdown | 5 ++-- .../d/is_instance_templates.html.markdown | 7 +++-- website/docs/d/is_instances.html.markdown | 23 +++++++------- website/docs/d/is_reservation.html.markdown | 2 +- website/docs/d/is_reservations.html.markdown | 2 +- website/docs/r/is_instance.html.markdown | 26 ++-------------- .../docs/r/is_instance_template.html.markdown | 5 ++-- website/docs/r/is_reservation.html.markdown | 2 +- .../r/is_reservation_activate.html.markdown | 2 +- 16 files changed, 83 insertions(+), 92 deletions(-) diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index 3798912015..ba95ad6a9e 100644 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -4930,7 +4930,7 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) if err != nil { @@ -4995,7 +4995,7 @@ func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstance builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) if err != nil { @@ -5052,7 +5052,7 @@ func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInst builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5117,7 +5117,7 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5239,7 +5239,7 @@ func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanc builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { @@ -5367,7 +5367,7 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5478,7 +5478,7 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5605,7 +5605,7 @@ func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -5671,7 +5671,7 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -8902,6 +8902,8 @@ func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservati builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) + builder.AddQuery("maturity", "development") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { @@ -8978,7 +8980,7 @@ func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReserv builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { @@ -9072,7 +9074,7 @@ func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReserv builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9137,7 +9139,7 @@ func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationO builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9203,7 +9205,7 @@ func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReserv builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9274,7 +9276,7 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-20") + builder.AddQuery("version", "2023-11-21") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) if err != nil { diff --git a/ibm/service/vpc/data_source_ibm_is_reservation.go b/ibm/service/vpc/data_source_ibm_is_reservation.go index d943c688d7..4cfb7d5cc7 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservation.go +++ b/ibm/service/vpc/data_source_ibm_is_reservation.go @@ -236,7 +236,8 @@ func dataSourceIBMIsReservationRead(context context.Context, d *schema.ResourceD } reservation = reservationInfo - } else if v, ok := d.GetOk("name"); ok { + } + if v, ok := d.GetOk("name"); ok { name := v.(string) start := "" diff --git a/ibm/service/vpc/data_source_ibm_is_reservation_test.go b/ibm/service/vpc/data_source_ibm_is_reservation_test.go index d51926cc28..f8f7f13f6c 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservation_test.go +++ b/ibm/service/vpc/data_source_ibm_is_reservation_test.go @@ -46,13 +46,13 @@ func testDSCheckIBMISReservationConfig() string { term = "one_year" } profile { - name = "ba2-2x8" + name = "cx2-2x4" resource_type = "instance_profile" } - zone = "us-east-3" + zone = "us-south-1" name = "reservation-name" } data "ibm_is_reservation" "ds_res" { - name = ibm_is_reservation.res.id + identifier = ibm_is_reservation.res.id }`) } diff --git a/ibm/service/vpc/data_source_ibm_is_reservations.go b/ibm/service/vpc/data_source_ibm_is_reservations.go index 9a285461dc..930e8d156e 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservations.go +++ b/ibm/service/vpc/data_source_ibm_is_reservations.go @@ -242,7 +242,7 @@ func dataSourceIBMIsReservationsRead(context context.Context, d *schema.Resource resourceGroupId := d.Get("resource_group").(string) start := "" - matchReservations := []vpcv1.Reservation{} + reservations := []vpcv1.Reservation{} var name string if v, ok := d.GetOk("name"); ok { @@ -272,7 +272,7 @@ func dataSourceIBMIsReservationsRead(context context.Context, d *schema.Resource break } start = flex.GetNext(reservationCollection.Next) - matchReservations = append(matchReservations, reservationCollection.Reservations...) + reservations = append(reservations, reservationCollection.Reservations...) if start == "" { break } @@ -280,8 +280,8 @@ func dataSourceIBMIsReservationsRead(context context.Context, d *schema.Resource d.SetId(dataSourceIBMIsReservationsID(d)) - if matchReservations != nil { - err = d.Set("reservations", dataSourceReservationCollectionFlattenReservations(matchReservations)) + if reservations != nil { + err = d.Set("reservations", dataSourceReservationCollectionFlattenReservations(reservations)) if err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting reservations %s", err)) } diff --git a/ibm/service/vpc/resource_ibm_is_instance.go b/ibm/service/vpc/resource_ibm_is_instance.go index c1b8efa3f6..81fad6f258 100644 --- a/ibm/service/vpc/resource_ibm_is_instance.go +++ b/ibm/service/vpc/resource_ibm_is_instance.go @@ -3779,22 +3779,26 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { var resAffinityPatch = &vpcv1.InstanceReservationAffinityPatch{} policy, ok := resAff["policy"] policyStr := policy.(string) + idStr := "" if policyStr != "" && ok { resAffinityPatch.Policy = &policyStr } - poolIntf, okPool := resAff[isReservationAffinityPool] - if okPool { - pool := poolIntf.([]interface{})[0].(map[string]interface{}) - id, okId := pool["id"] - if okId { - idStr, ok := id.(string) - if idStr != "" && ok { - var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) - resAffPool[0] = &vpcv1.ReservationIdentity{ - ID: &idStr, + if d.HasChange(resPool) { + poolIntf, okPool := resAff[isReservationAffinityPool] + if okPool { + pool := poolIntf.([]interface{})[0].(map[string]interface{}) + id, okId := pool["id"] + if okId { + idStr, ok = id.(string) + if idStr != "" && ok { + var resAffPool = make([]vpcv1.ReservationIdentityIntf, 1) + resAffPool[0] = &vpcv1.ReservationIdentity{ + ID: &idStr, + } + resAffinityPatch.Pool = resAffPool } - resAffinityPatch.Pool = resAffPool } + } } @@ -3806,7 +3810,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("[ERROR] Error calling asPatch with reservation affinity: %s", err) } //Detaching the reservation from the reserved instance - if policyStr == "disabled" { + if policyStr == "disabled" && idStr == "" { resAffMap := mpatch["reservation_affinity"].(map[string]interface{}) resAffMap["pool"] = nil mpatch["reservation_affinity"] = resAffMap diff --git a/ibm/service/vpc/resource_ibm_is_reservation_test.go b/ibm/service/vpc/resource_ibm_is_reservation_test.go index 2cc8a45d8d..28a53efddb 100644 --- a/ibm/service/vpc/resource_ibm_is_reservation_test.go +++ b/ibm/service/vpc/resource_ibm_is_reservation_test.go @@ -20,7 +20,7 @@ import ( func TestAccIBMISReservation_basic(t *testing.T) { var reservation string name := fmt.Sprintf("tfres-name-%d", acctest.RandIntRange(10, 100)) - zone := "us-east-3" + zone := "us-south-1" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -102,7 +102,7 @@ func testAccCheckIBMISReservationConfig(name, zone string) string { term = "one_year" } profile { - name = "ba2-2x8" + name = "cx2-2x4" resource_type = "instance_profile" } name = "%s" diff --git a/website/docs/d/is_instance.html.markdown b/website/docs/d/is_instance.html.markdown index 8f350c064b..781a9635df 100644 --- a/website/docs/d/is_instance.html.markdown +++ b/website/docs/d/is_instance.html.markdown @@ -238,18 +238,18 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `reservation_affinity`: - `policy` - (String) The reservation affinity policy to use for this virtual server instance. - - `pool` - (List) The pool of reservations available for use by this virtual server instance. + - `pool` - (List) The pool of reservations available for use by this virtual server instance. - Nested `pool` blocks have the following structure: - - `crn` - (String) The CRN for this reservation. - - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. - - Nested `deleted` blocks have the following structure: - - `more_info` - (String) Link to documentation about deleted resources. - - `href` - (String) The URL for this reservation. - - `id` - (String) The unique identifier for this reservation. - - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. - - `resource_type` - (string) The resource type. + Nested `pool` blocks have the following structure: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + + Nested `deleted` blocks have the following structure: + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. - `resource_controller_url` - (String) The URL of the IBM Cloud dashboard that you can use to see details for your instance. - `resource_group` - (String) The resource group id, where the instance was created. - `status` - (String) The status of the instance. diff --git a/website/docs/d/is_instance_template.html.markdown b/website/docs/d/is_instance_template.html.markdown index c5b9b93629..9cf02bafaa 100644 --- a/website/docs/d/is_instance_template.html.markdown +++ b/website/docs/d/is_instance_template.html.markdown @@ -107,9 +107,10 @@ You can access the following attribute references after your data source is crea - `reservation_affinity` - (Optional, List) The reservation affinity for the instance Nested scheme for `reservation_affinity`: - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. + ->**policy** -
• disabled: Reservations will not be used -
• manual: Reservations in pool will be available for use + • disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use - `pool` - (string) The unique identifier for this reservation - `resource_group` - (String) The resource group ID. - `total_volume_bandwidth` - (Integer) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes diff --git a/website/docs/d/is_instance_templates.html.markdown b/website/docs/d/is_instance_templates.html.markdown index 984270b606..dbed846fdd 100644 --- a/website/docs/d/is_instance_templates.html.markdown +++ b/website/docs/d/is_instance_templates.html.markdown @@ -94,9 +94,10 @@ You can access the following attribute references after your data source is crea - `reservation_affinity` - (Optional, List) The reservation affinity for the instance Nested scheme for `reservation_affinity`: - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. - ->**policy** -
• disabled: Reservations will not be used -
• manual: Reservations in pool will be available for use + + ->**policy** + • disabled: Reservations will not be used +
• manual: Reservations in pool will be available for use - `pool` - (string) The unique identifier for this reservation - `resource_group` - (String) The resource group ID. - `total_volume_bandwidth` - (Integer) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes diff --git a/website/docs/d/is_instances.html.markdown b/website/docs/d/is_instances.html.markdown index 82d876922b..928c42d04b 100644 --- a/website/docs/d/is_instances.html.markdown +++ b/website/docs/d/is_instances.html.markdown @@ -168,20 +168,21 @@ In addition to all argument reference list, you can access the following attribu - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. - `resource_type` - (string) The resource type. - `reservation_affinity`- (List) The instance reservation affinity. - Nested scheme for `reservation_affinity`: - - `policy` - (String) The reservation affinity policy to use for this virtual server instance. - - `pool` - (List) The pool of reservations available for use by this virtual server instance. - Nested `pool` blocks have the following structure: - - `crn` - (String) The CRN for this reservation. - - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + Nested scheme for `reservation_affinity`: + - `policy` - (String) The reservation affinity policy to use for this virtual server instance. + - `pool` - (List) The pool of reservations available for use by this virtual server instance. + + Nested `pool` blocks have the following structure: + - `crn` - (String) The CRN for this reservation. + - `deleted` - (List) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. Nested `deleted` blocks have the following structure: - - `more_info` - (String) Link to documentation about deleted resources. - - `href` - (String) The URL for this reservation. - - `id` - (String) The unique identifier for this reservation. - - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. - - `resource_type` - (string) The resource type. + - `more_info` - (String) Link to documentation about deleted resources. + - `href` - (String) The URL for this reservation. + - `id` - (String) The unique identifier for this reservation. + - `name` - (string) The name for this reservation. The name is unique across all reservations in the region. + - `resource_type` - (string) The resource type. - `status` - (String) The status of the instance. - `status_reasons` - (List) Array of reasons for the current status. diff --git a/website/docs/d/is_reservation.html.markdown b/website/docs/d/is_reservation.html.markdown index 387f4a903d..a1d4fc6fcf 100644 --- a/website/docs/d/is_reservation.html.markdown +++ b/website/docs/d/is_reservation.html.markdown @@ -16,7 +16,7 @@ VPC infrastructure services are a regional specific based endpoint, by default t ```terraform provider "ibm" { - region = "eu-gb" + region = "us-south" } ``` diff --git a/website/docs/d/is_reservations.html.markdown b/website/docs/d/is_reservations.html.markdown index 6ed2bf458d..fd26f9572b 100644 --- a/website/docs/d/is_reservations.html.markdown +++ b/website/docs/d/is_reservations.html.markdown @@ -16,7 +16,7 @@ VPC infrastructure services are a regional specific based endpoint, by default t ```terraform provider "ibm" { - region = "eu-gb" + region = "us-south" } ``` diff --git a/website/docs/r/is_instance.html.markdown b/website/docs/r/is_instance.html.markdown index ef016c4066..2d1332c150 100644 --- a/website/docs/r/is_instance.html.markdown +++ b/website/docs/r/is_instance.html.markdown @@ -130,22 +130,6 @@ resource "ibm_is_instance" "example1" { ### Sample for creating an instance in a VPC with reservation ```terraform -resource "ibm_is_vpc" "example" { - name = "example-vpc" -} - -resource "ibm_is_subnet" "example" { - name = "example-subnet" - vpc = ibm_is_vpc.example.id - zone = "us-south-1" - ipv4_cidr_block = "10.240.0.0/24" -} - -resource "ibm_is_ssh_key" "example" { - name = "example-ssh" - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR" -} - resource "ibm_is_reservation" "example" { capacity { total = 5 @@ -200,11 +184,6 @@ resource "ibm_is_instance" "example" { delete = "15m" } } -// primary_ipv4_address deprecation -output "primary_ipv4_address" { - # value = ibm_is_instance.example.primary_network_interface.0.primary_ipv4_address // will be deprecated in future - value = ibm_is_instance.example.primary_network_interface.0.primary_ip.0.address // use this instead -} ``` ### Sample for creating an instance with custom security group rules. @@ -606,8 +585,9 @@ Review the argument references that you can specify for your resource. - `reservation_affinity` - (Optional, List) The reservation affinity for the instance Nested scheme for `reservation_affinity`: - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. - ->**policy** -
• disabled: Reservations will not be used + + ->**policy** + • disabled: Reservations will not be used
• manual: Reservations in pool will be available for use - `pool` - (Optional, String) The pool of reservations available for use by this virtual server instance. Specified reservations must have a status of active, and have the same profile and zone as this virtual server instance. The pool must be empty if policy is disabled, and must not be empty if policy is manual. Nested scheme for `pool`: diff --git a/website/docs/r/is_instance_template.html.markdown b/website/docs/r/is_instance_template.html.markdown index 2548d8a304..ac161974c1 100644 --- a/website/docs/r/is_instance_template.html.markdown +++ b/website/docs/r/is_instance_template.html.markdown @@ -272,8 +272,9 @@ Review the argument references that you can specify for your resource. - `reservation_affinity` - (Optional, List) The reservation affinity for the instance Nested scheme for `reservation_affinity`: - `policy` - (Optional, String) The reservation affinity policy to use for this virtual server instance. - ->**policy** -
• disabled: Reservations will not be used + + ->**policy** + • disabled: Reservations will not be used
• manual: Reservations in pool will be available for use - `pool` - (Optional, String) The pool of reservations available for use by this virtual server instance. Specified reservations must have a status of active, and have the same profile and zone as this virtual server instance. The pool must be empty if policy is disabled, and must not be empty if policy is manual. Nested scheme for `pool`: diff --git a/website/docs/r/is_reservation.html.markdown b/website/docs/r/is_reservation.html.markdown index 4644dc0303..48ad9114ff 100644 --- a/website/docs/r/is_reservation.html.markdown +++ b/website/docs/r/is_reservation.html.markdown @@ -17,7 +17,7 @@ VPC infrastructure services are a regional specific based endpoint, by default t ```terraform provider "ibm" { - region = "eu-gb" + region = "us-south" } ``` diff --git a/website/docs/r/is_reservation_activate.html.markdown b/website/docs/r/is_reservation_activate.html.markdown index 551e17cbf1..723b6097ad 100644 --- a/website/docs/r/is_reservation_activate.html.markdown +++ b/website/docs/r/is_reservation_activate.html.markdown @@ -18,7 +18,7 @@ VPC infrastructure services are a regional specific based endpoint, by default t ```terraform provider "ibm" { - region = "eu-gb" + region = "us-south" } ``` From bf212860e737712aa5010cd841ef3759cb60e68f Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:40:32 +0530 Subject: [PATCH 12/17] add additional data source test case --- .../data_source_ibm_is_reservation_test.go | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/ibm/service/vpc/data_source_ibm_is_reservation_test.go b/ibm/service/vpc/data_source_ibm_is_reservation_test.go index f8f7f13f6c..b91644ee1b 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservation_test.go +++ b/ibm/service/vpc/data_source_ibm_is_reservation_test.go @@ -18,7 +18,7 @@ func TestAccIBMISReservationDatasource_basic(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ { - Config: testDSCheckIBMISReservationConfig(), + Config: testDSCheckIBMISReservationConfigById(), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "id"), resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "created_at"), @@ -32,11 +32,26 @@ func TestAccIBMISReservationDatasource_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "zone"), ), }, + { + Config: testDSCheckIBMISReservationConfigByName(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "name"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "created_at"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "crn"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "href"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "lifecycle_state"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "name"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "profile.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_group.#"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_type"), + resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "zone"), + ), + }, }, }) } -func testDSCheckIBMISReservationConfig() string { +func testDSCheckIBMISReservationConfigById() string { return fmt.Sprintf(` resource "ibm_is_reservation" "res" { capacity { @@ -56,3 +71,24 @@ func testDSCheckIBMISReservationConfig() string { identifier = ibm_is_reservation.res.id }`) } + +func testDSCheckIBMISReservationConfigByName() string { + return fmt.Sprintf(` + resource "ibm_is_reservation" "res" { + capacity { + total = 5 + } + committed_use { + term = "one_year" + } + profile { + name = "cx2-2x4" + resource_type = "instance_profile" + } + zone = "us-south-1" + name = "reservation-name" + } + data "ibm_is_reservation" "ds_res" { + name = ibm_is_reservation.res.name + }`) +} From f5abe85966dd2256bbaa5907e59cbd04c4a7ea32 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:52:07 +0530 Subject: [PATCH 13/17] address review comments, add mvp example for instance with reservation --- website/docs/r/is_instance.html.markdown | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/website/docs/r/is_instance.html.markdown b/website/docs/r/is_instance.html.markdown index 2d1332c150..68496acc2c 100644 --- a/website/docs/r/is_instance.html.markdown +++ b/website/docs/r/is_instance.html.markdown @@ -150,15 +150,8 @@ resource "ibm_is_instance" "example" { image = ibm_is_image.example.id profile = "bx2-2x8" metadata_service_enabled = false - - boot_volume { - encryption = "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179" - } - primary_network_interface { subnet = ibm_is_subnet.example.id - primary_ipv4_address = "10.240.0.6" // will be deprecated. Use primary_ip.[0].address - allow_ip_spoofing = true } reservation_affinity { policy = "manual" @@ -166,13 +159,6 @@ resource "ibm_is_instance" "example" { id = ibm_is_reservation.example.id } } - - network_interfaces { - name = "eth1" - subnet = ibm_is_subnet.example.id - allow_ip_spoofing = false - } - vpc = ibm_is_vpc.example.id zone = "us-south-1" keys = [ibm_is_ssh_key.example.id] From 8092e9ff5cf804c20c7d1478060050669f748fb6 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:56:39 +0530 Subject: [PATCH 14/17] update sdk maturity to beta, update docs with links --- common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 60 +++++++++---------- website/docs/d/is_reservation.html.markdown | 7 ++- website/docs/d/is_reservations.html.markdown | 7 ++- website/docs/r/is_reservation.html.markdown | 5 ++ .../r/is_reservation_activate.html.markdown | 5 ++ 5 files changed, 52 insertions(+), 32 deletions(-) diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index ba95ad6a9e..0d89b5b7a2 100644 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -4929,8 +4929,8 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) if err != nil { @@ -4994,8 +4994,8 @@ func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstance builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) if err != nil { @@ -5051,8 +5051,8 @@ func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInst builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5116,8 +5116,8 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { @@ -5238,8 +5238,8 @@ func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanc builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { @@ -5366,8 +5366,8 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5477,8 +5477,8 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { @@ -5604,8 +5604,8 @@ func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -5670,8 +5670,8 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { @@ -8902,8 +8902,8 @@ func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservati builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { @@ -8979,8 +8979,8 @@ func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReserv builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { @@ -9073,8 +9073,8 @@ func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReserv builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9138,8 +9138,8 @@ func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationO builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9204,8 +9204,8 @@ func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReserv builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { @@ -9275,8 +9275,8 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "development") - builder.AddQuery("version", "2023-11-21") + builder.AddQuery("maturity", "beta") + builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) if err != nil { diff --git a/website/docs/d/is_reservation.html.markdown b/website/docs/d/is_reservation.html.markdown index a1d4fc6fcf..07ba007714 100644 --- a/website/docs/d/is_reservation.html.markdown +++ b/website/docs/d/is_reservation.html.markdown @@ -156,4 +156,9 @@ In addition to all argument reference list, you can access the following attribu
• cannot_renew_unsupported_profile_term - `message` - (String) An explanation of the status reason. - `more_info` - (string) Link to documentation about this status reason -- `zone` - (String) The globally unique name for this zone. \ No newline at end of file +- `zone` - (String) The globally unique name for this zone. + +## References + +* [IBM Cloud Terraform Docs](https://cloud.ibm.com/docs/vpc?topic=vpc-provisioning-reserved-capacity-vpc&interface=ui +https://cloud.ibm.com/docs/vpc?topic=vpc-about-reserved-virtual-servers-vpc) \ No newline at end of file diff --git a/website/docs/d/is_reservations.html.markdown b/website/docs/d/is_reservations.html.markdown index fd26f9572b..9486d7b4f0 100644 --- a/website/docs/d/is_reservations.html.markdown +++ b/website/docs/d/is_reservations.html.markdown @@ -148,4 +148,9 @@ Nested scheme for `reservations`:
• cannot_renew_unsupported_profile_term - `message` - (String) An explanation of the status reason. - `more_info` - (string) Link to documentation about this status reason - - `zone` - (String) The globally unique name for this zone. \ No newline at end of file + - `zone` - (String) The globally unique name for this zone. + +## References + +* [IBM Cloud Terraform Docs](https://cloud.ibm.com/docs/vpc?topic=vpc-provisioning-reserved-capacity-vpc&interface=ui +https://cloud.ibm.com/docs/vpc?topic=vpc-about-reserved-virtual-servers-vpc) \ No newline at end of file diff --git a/website/docs/r/is_reservation.html.markdown b/website/docs/r/is_reservation.html.markdown index 48ad9114ff..3d397b0ed6 100644 --- a/website/docs/r/is_reservation.html.markdown +++ b/website/docs/r/is_reservation.html.markdown @@ -170,3 +170,8 @@ $ terraform import ibm_is_reservation.example ``` $ terraform import ibm_is_reservation.example d7bec597-4726-451f-8a63-e62e6f12122c ``` + +## References + +* [IBM Cloud Terraform Docs](https://cloud.ibm.com/docs/vpc?topic=vpc-provisioning-reserved-capacity-vpc&interface=ui +https://cloud.ibm.com/docs/vpc?topic=vpc-about-reserved-virtual-servers-vpc) \ No newline at end of file diff --git a/website/docs/r/is_reservation_activate.html.markdown b/website/docs/r/is_reservation_activate.html.markdown index 723b6097ad..db87a485f9 100644 --- a/website/docs/r/is_reservation_activate.html.markdown +++ b/website/docs/r/is_reservation_activate.html.markdown @@ -150,3 +150,8 @@ $ terraform import ibm_is_reservation_activate.example_activation Date: Tue, 23 Jan 2024 17:59:39 +0530 Subject: [PATCH 15/17] fix compile issues --- common/github.com/vpc-go-sdk/go.mod | 2 +- common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 134040 +++++++++------- go.sum | 2 + 3 files changed, 74013 insertions(+), 60031 deletions(-) diff --git a/common/github.com/vpc-go-sdk/go.mod b/common/github.com/vpc-go-sdk/go.mod index 2bbba01169..08e5a48e29 100644 --- a/common/github.com/vpc-go-sdk/go.mod +++ b/common/github.com/vpc-go-sdk/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/IBM/go-sdk-core/v5 v5.10.2 - github.com/IBM/vpc-go-sdk v0.31.0 + github.com/IBM/vpc-go-sdk v0.47.0 github.com/go-openapi/strfmt v0.21.3 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.20.0 diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go index 0d89b5b7a2..de8c5eeb1c 100644 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.78.0-67aec9b7-20230818-174940 + * IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -38,7 +38,7 @@ import ( // VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual // server instances, along with subnets, volumes, load balancers, and more. // -// API Version: 2023-10-10 +// API Version: 2023-12-05 type VpcV1 struct { Service *core.BaseService @@ -46,8 +46,8 @@ type VpcV1 struct { // `2`. generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` - // and `2023-11-17`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` + // and `2024-01-23`. Version *string } @@ -63,8 +63,8 @@ type VpcV1Options struct { URL string Authenticator core.Authenticator - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-10-10` - // and `2023-11-17`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` + // and `2024-01-23`. Version *string } @@ -184,22 +184,21 @@ func (vpc *VpcV1) DisableRetries() { vpc.Service.DisableRetries() } -// ListVpcs : List all VPCs -// This request lists all VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical -// isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC -// can contain resources in multiple zones in a region. -func (vpc *VpcV1) ListVpcs(listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { - return vpc.ListVpcsWithContext(context.Background(), listVpcsOptions) +// CreateVPC : Create a VPC +// This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a +// retrieved VPC, and contains the information necessary to create the new VPC. +func (vpc *VpcV1) CreateVPC(createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + return vpc.CreateVPCWithContext(context.Background(), createVPCOptions) } -// ListVpcsWithContext is an alternate form of the ListVpcs method which supports a Context parameter -func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVpcsOptions, "listVpcsOptions") +// CreateVPCWithContext is an alternate form of the CreateVPC method which supports a Context parameter +func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(createVPCOptions, "createVPCOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs`, nil) @@ -207,29 +206,39 @@ func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *List return } - for headerName, headerValue := range listVpcsOptions.Headers { + for headerName, headerValue := range createVPCOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVpcs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPC") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVpcsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVpcsOptions.Start)) + + body := make(map[string]interface{}) + if createVPCOptions.AddressPrefixManagement != nil { + body["address_prefix_management"] = createVPCOptions.AddressPrefixManagement } - if listVpcsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVpcsOptions.Limit)) + if createVPCOptions.ClassicAccess != nil { + body["classic_access"] = createVPCOptions.ClassicAccess } - if listVpcsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVpcsOptions.ResourceGroupID)) + if createVPCOptions.Dns != nil { + body["dns"] = createVPCOptions.Dns } - if listVpcsOptions.ClassicAccess != nil { - builder.AddQuery("classic_access", fmt.Sprint(*listVpcsOptions.ClassicAccess)) + if createVPCOptions.Name != nil { + body["name"] = createVPCOptions.Name + } + if createVPCOptions.ResourceGroup != nil { + body["resource_group"] = createVPCOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -243,7 +252,7 @@ func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *List return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPCCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) if err != nil { return } @@ -253,33 +262,41 @@ func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *List return } -// CreateVPC : Create a VPC -// This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a -// retrieved VPC, and contains the information necessary to create the new VPC. -func (vpc *VpcV1) CreateVPC(createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.CreateVPCWithContext(context.Background(), createVPCOptions) +// CreateVPCAddressPrefix : Create an address prefix for a VPC +// This request creates a new prefix from a prefix prototype object. The prototype object is structured in the same way +// as a retrieved prefix, and contains the information necessary to create the new prefix. +func (vpc *VpcV1) CreateVPCAddressPrefix(createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + return vpc.CreateVPCAddressPrefixWithContext(context.Background(), createVPCAddressPrefixOptions) } -// CreateVPCWithContext is an alternate form of the CreateVPC method which supports a Context parameter -func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(createVPCOptions, "createVPCOptions") +// CreateVPCAddressPrefixWithContext is an alternate form of the CreateVPCAddressPrefix method which supports a Context parameter +func (vpc *VpcV1) CreateVPCAddressPrefixWithContext(ctx context.Context, createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "vpc_id": *createVPCAddressPrefixOptions.VPCID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPCOptions.Headers { + for headerName, headerValue := range createVPCAddressPrefixOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPC") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCAddressPrefix") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -290,20 +307,17 @@ func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *Cr builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createVPCOptions.AddressPrefixManagement != nil { - body["address_prefix_management"] = createVPCOptions.AddressPrefixManagement - } - if createVPCOptions.ClassicAccess != nil { - body["classic_access"] = createVPCOptions.ClassicAccess + if createVPCAddressPrefixOptions.CIDR != nil { + body["cidr"] = createVPCAddressPrefixOptions.CIDR } - if createVPCOptions.Dns != nil { - body["dns"] = createVPCOptions.Dns + if createVPCAddressPrefixOptions.Zone != nil { + body["zone"] = createVPCAddressPrefixOptions.Zone } - if createVPCOptions.Name != nil { - body["name"] = createVPCOptions.Name + if createVPCAddressPrefixOptions.IsDefault != nil { + body["is_default"] = createVPCAddressPrefixOptions.IsDefault } - if createVPCOptions.ResourceGroup != nil { - body["resource_group"] = createVPCOptions.ResourceGroup + if createVPCAddressPrefixOptions.Name != nil { + body["name"] = createVPCAddressPrefixOptions.Name } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -321,7 +335,7 @@ func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *Cr return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) if err != nil { return } @@ -331,110 +345,164 @@ func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *Cr return } -// DeleteVPC : Delete a VPC -// This request deletes a VPC. This operation cannot be reversed. +// CreateVPCDnsResolutionBinding : Create a DNS resolution binding +// This request creates a new DNS resolution binding from a DNS resolution binding prototype object. The prototype +// object is structured in the same way as a retrieved DNS resolution binding, and contains the information necessary to +// create the new DNS resolution binding. // -// For this request to succeed: -// - Instances, subnets, public gateways, and endpoint gateways must not reside in this VPC -// - The VPC must not be providing DNS resolution for any other VPCs -// - If `dns.enable_hub` is `true`, `dns.resolution_binding_count` must be zero +// For this request to succeed, `dns.enable_hub` must be `false` for the VPC specified by the identifier in the URL, and +// the VPC must not already have a DNS resolution binding. // -// All security groups and network ACLs associated with the VPC are automatically deleted. All flow log collectors with -// `auto_delete` set to `true` targeting the VPC or any resource in the VPC are automatically deleted. -func (vpc *VpcV1) DeleteVPC(deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCWithContext(context.Background(), deleteVPCOptions) +// See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-hub-spoke-model) for more information. +func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + return vpc.CreateVPCDnsResolutionBindingWithContext(context.Background(), createVPCDnsResolutionBindingOptions) } -// DeleteVPCWithContext is an alternate form of the DeleteVPC method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCWithContext(ctx context.Context, deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCOptions, "deleteVPCOptions cannot be nil") +// CreateVPCDnsResolutionBindingWithContext is an alternate form of the CreateVPCDnsResolutionBinding method which supports a Context parameter +func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCOptions, "deleteVPCOptions") + err = core.ValidateStruct(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteVPCOptions.ID, + "vpc_id": *createVPCDnsResolutionBindingOptions.VPCID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPCOptions.Headers { + for headerName, headerValue := range createVPCDnsResolutionBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPC") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCDnsResolutionBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - if deleteVPCOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCOptions.IfMatch)) - } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createVPCDnsResolutionBindingOptions.VPC != nil { + body["vpc"] = createVPCDnsResolutionBindingOptions.VPC + } + if createVPCDnsResolutionBindingOptions.Name != nil { + body["name"] = createVPCDnsResolutionBindingOptions.Name + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) + if err != nil { + return + } + response.Result = result + } return } -// GetVPC : Retrieve a VPC -// This request retrieves a single VPC specified by the identifier in the URL. -func (vpc *VpcV1) GetVPC(getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.GetVPCWithContext(context.Background(), getVPCOptions) +// CreateVPCRoute : Create a route in a VPC's default routing table +// This request creates a new route in the VPC's default routing table. The route prototype object is structured in the +// same way as a retrieved route, and contains the information necessary to create the new route. The request will fail +// if the new route will cause a loop. +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { + return vpc.CreateVPCRouteWithContext(context.Background(), createVPCRouteOptions) } -// GetVPCWithContext is an alternate form of the GetVPC method which supports a Context parameter -func (vpc *VpcV1) GetVPCWithContext(ctx context.Context, getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCOptions, "getVPCOptions cannot be nil") +// CreateVPCRouteWithContext is an alternate form of the CreateVPCRoute method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: CreateVPCRoute") + err = core.ValidateNotNil(createVPCRouteOptions, "createVPCRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCOptions, "getVPCOptions") + err = core.ValidateStruct(createVPCRouteOptions, "createVPCRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPCOptions.ID, + "vpc_id": *createVPCRouteOptions.VPCID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCOptions.Headers { + for headerName, headerValue := range createVPCRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPC") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createVPCRouteOptions.Destination != nil { + body["destination"] = createVPCRouteOptions.Destination + } + if createVPCRouteOptions.Zone != nil { + body["zone"] = createVPCRouteOptions.Zone + } + if createVPCRouteOptions.Action != nil { + body["action"] = createVPCRouteOptions.Action + } + if createVPCRouteOptions.Advertise != nil { + body["advertise"] = createVPCRouteOptions.Advertise + } + if createVPCRouteOptions.Name != nil { + body["name"] = createVPCRouteOptions.Name + } + if createVPCRouteOptions.NextHop != nil { + body["next_hop"] = createVPCRouteOptions.NextHop + } + if createVPCRouteOptions.Priority != nil { + body["priority"] = createVPCRouteOptions.Priority + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -446,7 +514,7 @@ func (vpc *VpcV1) GetVPCWithContext(ctx context.Context, getVPCOptions *GetVPCOp return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCreateVPCRouteResponse) if err != nil { return } @@ -456,54 +524,76 @@ func (vpc *VpcV1) GetVPCWithContext(ctx context.Context, getVPCOptions *GetVPCOp return } -// UpdateVPC : Update a VPC -// This request updates a VPC with the information provided in a VPC patch object. The patch object is structured in the -// same way as a retrieved VPC and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateVPC(updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCWithContext(context.Background(), updateVPCOptions) +// CreateVPCRoutingTable : Create a routing table for a VPC +// This request creates a routing table from a routing table prototype object. The prototype object is structured in the +// same way as a retrieved routing table, and contains the information necessary to create the new routing table. +func (vpc *VpcV1) CreateVPCRoutingTable(createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + return vpc.CreateVPCRoutingTableWithContext(context.Background(), createVPCRoutingTableOptions) } -// UpdateVPCWithContext is an alternate form of the UpdateVPC method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCWithContext(ctx context.Context, updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCOptions, "updateVPCOptions cannot be nil") +// CreateVPCRoutingTableWithContext is an alternate form of the CreateVPCRoutingTable method which supports a Context parameter +func (vpc *VpcV1) CreateVPCRoutingTableWithContext(ctx context.Context, createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPCRoutingTableOptions, "createVPCRoutingTableOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCOptions, "updateVPCOptions") + err = core.ValidateStruct(createVPCRoutingTableOptions, "createVPCRoutingTableOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVPCOptions.ID, + "vpc_id": *createVPCRoutingTableOptions.VPCID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPCOptions.Headers { + for headerName, headerValue := range createVPCRoutingTableOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPC") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTable") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPCOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPCOptions.IfMatch)) - } + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPCOptions.VPCPatch) + body := make(map[string]interface{}) + if createVPCRoutingTableOptions.AcceptRoutesFrom != nil { + body["accept_routes_from"] = createVPCRoutingTableOptions.AcceptRoutesFrom + } + if createVPCRoutingTableOptions.AdvertiseRoutesTo != nil { + body["advertise_routes_to"] = createVPCRoutingTableOptions.AdvertiseRoutesTo + } + if createVPCRoutingTableOptions.Name != nil { + body["name"] = createVPCRoutingTableOptions.Name + } + if createVPCRoutingTableOptions.RouteDirectLinkIngress != nil { + body["route_direct_link_ingress"] = createVPCRoutingTableOptions.RouteDirectLinkIngress + } + if createVPCRoutingTableOptions.RouteInternetIngress != nil { + body["route_internet_ingress"] = createVPCRoutingTableOptions.RouteInternetIngress + } + if createVPCRoutingTableOptions.RouteTransitGatewayIngress != nil { + body["route_transit_gateway_ingress"] = createVPCRoutingTableOptions.RouteTransitGatewayIngress + } + if createVPCRoutingTableOptions.RouteVPCZoneIngress != nil { + body["route_vpc_zone_ingress"] = createVPCRoutingTableOptions.RouteVPCZoneIngress + } + if createVPCRoutingTableOptions.Routes != nil { + body["routes"] = createVPCRoutingTableOptions.Routes + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -519,7 +609,7 @@ func (vpc *VpcV1) UpdateVPCWithContext(ctx context.Context, updateVPCOptions *Up return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) if err != nil { return } @@ -529,49 +619,78 @@ func (vpc *VpcV1) UpdateVPCWithContext(ctx context.Context, updateVPCOptions *Up return } -// GetVPCDefaultNetworkACL : Retrieve a VPC's default network ACL -// This request retrieves the default network ACL for the VPC specified by the identifier in the URL. The default -// network ACL is applied to any new subnets in the VPC which do not specify a network ACL. -func (vpc *VpcV1) GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultNetworkACLWithContext(context.Background(), getVPCDefaultNetworkACLOptions) +// CreateVPCRoutingTableRoute : Create a route in a VPC routing table +// This request creates a new VPC route from a VPC route prototype object. The prototype object is structured in the +// same way as a retrieved VPC route and contains the information necessary to create the route. +func (vpc *VpcV1) CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + return vpc.CreateVPCRoutingTableRouteWithContext(context.Background(), createVPCRoutingTableRouteOptions) } -// GetVPCDefaultNetworkACLWithContext is an alternate form of the GetVPCDefaultNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultNetworkACLWithContext(ctx context.Context, getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions cannot be nil") +// CreateVPCRoutingTableRouteWithContext is an alternate form of the CreateVPCRoutingTableRoute method which supports a Context parameter +func (vpc *VpcV1) CreateVPCRoutingTableRouteWithContext(ctx context.Context, createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions") + err = core.ValidateStruct(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPCDefaultNetworkACLOptions.ID, + "vpc_id": *createVPCRoutingTableRouteOptions.VPCID, + "routing_table_id": *createVPCRoutingTableRouteOptions.RoutingTableID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_network_acl`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCDefaultNetworkACLOptions.Headers { + for headerName, headerValue := range createVPCRoutingTableRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTableRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createVPCRoutingTableRouteOptions.Destination != nil { + body["destination"] = createVPCRoutingTableRouteOptions.Destination + } + if createVPCRoutingTableRouteOptions.Zone != nil { + body["zone"] = createVPCRoutingTableRouteOptions.Zone + } + if createVPCRoutingTableRouteOptions.Action != nil { + body["action"] = createVPCRoutingTableRouteOptions.Action + } + if createVPCRoutingTableRouteOptions.Advertise != nil { + body["advertise"] = createVPCRoutingTableRouteOptions.Advertise + } + if createVPCRoutingTableRouteOptions.Name != nil { + body["name"] = createVPCRoutingTableRouteOptions.Name + } + if createVPCRoutingTableRouteOptions.NextHop != nil { + body["next_hop"] = createVPCRoutingTableRouteOptions.NextHop + } + if createVPCRoutingTableRouteOptions.Priority != nil { + body["priority"] = createVPCRoutingTableRouteOptions.Priority + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -583,7 +702,7 @@ func (vpc *VpcV1) GetVPCDefaultNetworkACLWithContext(ctx context.Context, getVPC return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) if err != nil { return } @@ -593,46 +712,54 @@ func (vpc *VpcV1) GetVPCDefaultNetworkACLWithContext(ctx context.Context, getVPC return } -// GetVPCDefaultRoutingTable : Retrieve a VPC's default routing table -// This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default -// routing table is associated with any subnets in the VPC which have not been explicitly associated with another -// routing table. -func (vpc *VpcV1) GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultRoutingTableWithContext(context.Background(), getVPCDefaultRoutingTableOptions) +// DeleteVPC : Delete a VPC +// This request deletes a VPC. This operation cannot be reversed. +// +// For this request to succeed: +// - Instances, subnets, public gateways, and endpoint gateways must not reside in this VPC +// - The VPC must not be providing DNS resolution for any other VPCs +// - If `dns.enable_hub` is `true`, `dns.resolution_binding_count` must be zero +// +// All security groups and network ACLs associated with the VPC are automatically deleted. All flow log collectors with +// `auto_delete` set to `true` targeting the VPC or any resource in the VPC are automatically deleted. +func (vpc *VpcV1) DeleteVPC(deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPCWithContext(context.Background(), deleteVPCOptions) } -// GetVPCDefaultRoutingTableWithContext is an alternate form of the GetVPCDefaultRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultRoutingTableWithContext(ctx context.Context, getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions cannot be nil") +// DeleteVPCWithContext is an alternate form of the DeleteVPC method which supports a Context parameter +func (vpc *VpcV1) DeleteVPCWithContext(ctx context.Context, deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPCOptions, "deleteVPCOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions") + err = core.ValidateStruct(deleteVPCOptions, "deleteVPCOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPCDefaultRoutingTableOptions.ID, + "id": *deleteVPCOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_routing_table`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCDefaultRoutingTableOptions.Headers { + for headerName, headerValue := range deleteVPCOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPC") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") + if deleteVPCOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -642,61 +769,50 @@ func (vpc *VpcV1) GetVPCDefaultRoutingTableWithContext(ctx context.Context, getV return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultRoutingTable) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// GetVPCDefaultSecurityGroup : Retrieve a VPC's default security group -// This request retrieves the default security group for the VPC specified by the identifier in the URL. Resources -// created in this VPC that allow a security group to be optionally specified will use this security group by default. -func (vpc *VpcV1) GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultSecurityGroupWithContext(context.Background(), getVPCDefaultSecurityGroupOptions) +// DeleteVPCAddressPrefix : Delete an address prefix +// This request deletes a prefix. This operation cannot be reversed. The request will fail if any subnets use addresses +// from this prefix. +func (vpc *VpcV1) DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPCAddressPrefixWithContext(context.Background(), deleteVPCAddressPrefixOptions) } -// GetVPCDefaultSecurityGroupWithContext is an alternate form of the GetVPCDefaultSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultSecurityGroupWithContext(ctx context.Context, getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions cannot be nil") +// DeleteVPCAddressPrefixWithContext is an alternate form of the DeleteVPCAddressPrefix method which supports a Context parameter +func (vpc *VpcV1) DeleteVPCAddressPrefixWithContext(ctx context.Context, deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions") + err = core.ValidateStruct(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPCDefaultSecurityGroupOptions.ID, + "vpc_id": *deleteVPCAddressPrefixOptions.VPCID, + "id": *deleteVPCAddressPrefixOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_security_group`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCDefaultSecurityGroupOptions.Headers { + for headerName, headerValue := range deleteVPCAddressPrefixOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCAddressPrefix") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -706,56 +822,49 @@ func (vpc *VpcV1) GetVPCDefaultSecurityGroupWithContext(ctx context.Context, get return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultSecurityGroup) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListVPCAddressPrefixes : List all address prefixes for a VPC -// This request lists all address pool prefixes for a VPC. -func (vpc *VpcV1) ListVPCAddressPrefixes(listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCAddressPrefixesWithContext(context.Background(), listVPCAddressPrefixesOptions) +// DeleteVPCDnsResolutionBinding : Delete a DNS resolution binding +// This request deletes a DNS resolution binding. This operation cannot be reversed. +// +// For this request to succeed, the VPC specified by the identifier in the URL must not have +// `dns.resolver.type` set to `delegated`. +func (vpc *VpcV1) DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + return vpc.DeleteVPCDnsResolutionBindingWithContext(context.Background(), deleteVPCDnsResolutionBindingOptions) } -// ListVPCAddressPrefixesWithContext is an alternate form of the ListVPCAddressPrefixes method which supports a Context parameter -func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions cannot be nil") +// DeleteVPCDnsResolutionBindingWithContext is an alternate form of the DeleteVPCDnsResolutionBinding method which supports a Context parameter +func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions") + err = core.ValidateStruct(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *listVPCAddressPrefixesOptions.VPCID, + "vpc_id": *deleteVPCDnsResolutionBindingOptions.VPCID, + "id": *deleteVPCDnsResolutionBindingOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPCAddressPrefixesOptions.Headers { + for headerName, headerValue := range deleteVPCDnsResolutionBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCAddressPrefixes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCDnsResolutionBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -763,12 +872,6 @@ func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPC builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCAddressPrefixesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCAddressPrefixesOptions.Start)) - } - if listVPCAddressPrefixesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCAddressPrefixesOptions.Limit)) - } request, err := builder.Build() if err != nil { @@ -781,7 +884,7 @@ func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPC return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefixCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) if err != nil { return } @@ -791,125 +894,154 @@ func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPC return } -// CreateVPCAddressPrefix : Create an address prefix for a VPC -// This request creates a new prefix from a prefix prototype object. The prototype object is structured in the same way -// as a retrieved prefix, and contains the information necessary to create the new prefix. -func (vpc *VpcV1) CreateVPCAddressPrefix(createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.CreateVPCAddressPrefixWithContext(context.Background(), createVPCAddressPrefixOptions) +// DeleteVPCRoute : Delete a VPC route +// This request deletes a route. This operation cannot be reversed. +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) DeleteVPCRoute(deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPCRouteWithContext(context.Background(), deleteVPCRouteOptions) } -// CreateVPCAddressPrefixWithContext is an alternate form of the CreateVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) CreateVPCAddressPrefixWithContext(ctx context.Context, createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions cannot be nil") +// DeleteVPCRouteWithContext is an alternate form of the DeleteVPCRoute method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) DeleteVPCRouteWithContext(ctx context.Context, deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: DeleteVPCRoute") + err = core.ValidateNotNil(deleteVPCRouteOptions, "deleteVPCRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions") + err = core.ValidateStruct(deleteVPCRouteOptions, "deleteVPCRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *createVPCAddressPrefixOptions.VPCID, + "vpc_id": *deleteVPCRouteOptions.VPCID, + "id": *deleteVPCRouteOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPCAddressPrefixOptions.Headers { + for headerName, headerValue := range deleteVPCRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCAddressPrefix") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createVPCAddressPrefixOptions.CIDR != nil { - body["cidr"] = createVPCAddressPrefixOptions.CIDR - } - if createVPCAddressPrefixOptions.Zone != nil { - body["zone"] = createVPCAddressPrefixOptions.Zone - } - if createVPCAddressPrefixOptions.IsDefault != nil { - body["is_default"] = createVPCAddressPrefixOptions.IsDefault + request, err := builder.Build() + if err != nil { + return } - if createVPCAddressPrefixOptions.Name != nil { - body["name"] = createVPCAddressPrefixOptions.Name + + response, err = vpc.Service.Request(request, nil) + + return +} + +// DeleteVPCRoutingTable : Delete a VPC routing table +// This request deletes a routing table. A routing table cannot be deleted if it is associated with any subnets in the +// VPC. Additionally, a VPC's default routing table cannot be deleted. This operation cannot be reversed. +func (vpc *VpcV1) DeleteVPCRoutingTable(deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPCRoutingTableWithContext(context.Background(), deleteVPCRoutingTableOptions) +} + +// DeleteVPCRoutingTableWithContext is an alternate form of the DeleteVPCRoutingTable method which supports a Context parameter +func (vpc *VpcV1) DeleteVPCRoutingTableWithContext(ctx context.Context, deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions cannot be nil") + if err != nil { + return } - _, err = builder.SetBodyContentJSON(body) + err = core.ValidateStruct(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions") if err != nil { return } - request, err := builder.Build() + pathParamsMap := map[string]string{ + "vpc_id": *deleteVPCRoutingTableOptions.VPCID, + "id": *deleteVPCRoutingTableOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) + for headerName, headerValue := range deleteVPCRoutingTableOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTable") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + if deleteVPCRoutingTableOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCRoutingTableOptions.IfMatch)) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() if err != nil { return } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) - if err != nil { - return - } - response.Result = result - } + + response, err = vpc.Service.Request(request, nil) return } -// DeleteVPCAddressPrefix : Delete an address prefix -// This request deletes a prefix. This operation cannot be reversed. The request will fail if any subnets use addresses -// from this prefix. -func (vpc *VpcV1) DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCAddressPrefixWithContext(context.Background(), deleteVPCAddressPrefixOptions) +// DeleteVPCRoutingTableRoute : Delete a VPC routing table route +// This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are +// allowed to be deleted. +func (vpc *VpcV1) DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPCRoutingTableRouteWithContext(context.Background(), deleteVPCRoutingTableRouteOptions) } -// DeleteVPCAddressPrefixWithContext is an alternate form of the DeleteVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCAddressPrefixWithContext(ctx context.Context, deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions cannot be nil") +// DeleteVPCRoutingTableRouteWithContext is an alternate form of the DeleteVPCRoutingTableRoute method which supports a Context parameter +func (vpc *VpcV1) DeleteVPCRoutingTableRouteWithContext(ctx context.Context, deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions") + err = core.ValidateStruct(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCAddressPrefixOptions.VPCID, - "id": *deleteVPCAddressPrefixOptions.ID, + "vpc_id": *deleteVPCRoutingTableRouteOptions.VPCID, + "routing_table_id": *deleteVPCRoutingTableRouteOptions.RoutingTableID, + "id": *deleteVPCRoutingTableRouteOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPCAddressPrefixOptions.Headers { + for headerName, headerValue := range deleteVPCRoutingTableRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCAddressPrefix") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTableRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -927,41 +1059,40 @@ func (vpc *VpcV1) DeleteVPCAddressPrefixWithContext(ctx context.Context, deleteV return } -// GetVPCAddressPrefix : Retrieve an address prefix -// This request retrieves a single prefix specified by the identifier in the URL. -func (vpc *VpcV1) GetVPCAddressPrefix(getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.GetVPCAddressPrefixWithContext(context.Background(), getVPCAddressPrefixOptions) +// GetVPC : Retrieve a VPC +// This request retrieves a single VPC specified by the identifier in the URL. +func (vpc *VpcV1) GetVPC(getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + return vpc.GetVPCWithContext(context.Background(), getVPCOptions) } -// GetVPCAddressPrefixWithContext is an alternate form of the GetVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) GetVPCAddressPrefixWithContext(ctx context.Context, getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions cannot be nil") +// GetVPCWithContext is an alternate form of the GetVPC method which supports a Context parameter +func (vpc *VpcV1) GetVPCWithContext(ctx context.Context, getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCOptions, "getVPCOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions") + err = core.ValidateStruct(getVPCOptions, "getVPCOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *getVPCAddressPrefixOptions.VPCID, - "id": *getVPCAddressPrefixOptions.ID, + "id": *getVPCOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCAddressPrefixOptions.Headers { + for headerName, headerValue := range getVPCOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCAddressPrefix") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPC") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -981,7 +1112,7 @@ func (vpc *VpcV1) GetVPCAddressPrefixWithContext(ctx context.Context, getVPCAddr return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) if err != nil { return } @@ -991,30 +1122,29 @@ func (vpc *VpcV1) GetVPCAddressPrefixWithContext(ctx context.Context, getVPCAddr return } -// UpdateVPCAddressPrefix : Update an address prefix -// This request updates a prefix with the information in a provided prefix patch. The prefix patch object is structured -// in the same way as a retrieved prefix and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPCAddressPrefix(updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCAddressPrefixWithContext(context.Background(), updateVPCAddressPrefixOptions) +// GetVPCAddressPrefix : Retrieve an address prefix +// This request retrieves a single prefix specified by the identifier in the URL. +func (vpc *VpcV1) GetVPCAddressPrefix(getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + return vpc.GetVPCAddressPrefixWithContext(context.Background(), getVPCAddressPrefixOptions) } -// UpdateVPCAddressPrefixWithContext is an alternate form of the UpdateVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions cannot be nil") +// GetVPCAddressPrefixWithContext is an alternate form of the GetVPCAddressPrefix method which supports a Context parameter +func (vpc *VpcV1) GetVPCAddressPrefixWithContext(ctx context.Context, getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions") + err = core.ValidateStruct(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *updateVPCAddressPrefixOptions.VPCID, - "id": *updateVPCAddressPrefixOptions.ID, + "vpc_id": *getVPCAddressPrefixOptions.VPCID, + "id": *getVPCAddressPrefixOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) @@ -1022,25 +1152,19 @@ func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateV return } - for headerName, headerValue := range updateVPCAddressPrefixOptions.Headers { + for headerName, headerValue := range getVPCAddressPrefixOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCAddressPrefix") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCAddressPrefix") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPCAddressPrefixOptions.AddressPrefixPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -1062,55 +1186,41 @@ func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateV return } -// ListVPCDnsResolutionBindings : List all DNS resolution bindings for a VPC -// This request lists all DNS resolution bindings for a VPC. A DNS resolution binding represents an association with -// another VPC for centralizing DNS name resolution. -// -// If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there is -// one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using -// `allow_dns_resolution_binding`) the hub VPC to centralize resolution of their DNS names. -// -// If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub -// VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using -// `allow_dns_resolution_binding`) its hub VPC to centralize resolution of their DNS names. -// -// To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC -// by setting `dns.resolver.type` to `delegate`. -// -// The bindings will be sorted by their `created_at` property values, with newest bindings first. Bindings with -// identical `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCDnsResolutionBindingsWithContext(context.Background(), listVPCDnsResolutionBindingsOptions) +// GetVPCDefaultNetworkACL : Retrieve a VPC's default network ACL +// This request retrieves the default network ACL for the VPC specified by the identifier in the URL. The default +// network ACL is applied to any new subnets in the VPC which do not specify a network ACL. +func (vpc *VpcV1) GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { + return vpc.GetVPCDefaultNetworkACLWithContext(context.Background(), getVPCDefaultNetworkACLOptions) } -// ListVPCDnsResolutionBindingsWithContext is an alternate form of the ListVPCDnsResolutionBindings method which supports a Context parameter -func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions cannot be nil") +// GetVPCDefaultNetworkACLWithContext is an alternate form of the GetVPCDefaultNetworkACL method which supports a Context parameter +func (vpc *VpcV1) GetVPCDefaultNetworkACLWithContext(ctx context.Context, getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions") + err = core.ValidateStruct(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *listVPCDnsResolutionBindingsOptions.VPCID, + "id": *getVPCDefaultNetworkACLOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_network_acl`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPCDnsResolutionBindingsOptions.Headers { + for headerName, headerValue := range getVPCDefaultNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCDnsResolutionBindings") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -1118,27 +1228,6 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCDnsResolutionBindingsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Sort)) - } - if listVPCDnsResolutionBindingsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Start)) - } - if listVPCDnsResolutionBindingsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Limit)) - } - if listVPCDnsResolutionBindingsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Name)) - } - if listVPCDnsResolutionBindingsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCCRN)) - } - if listVPCDnsResolutionBindingsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCName)) - } - if listVPCDnsResolutionBindingsOptions.AccountID != nil { - builder.AddQuery("account.id", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.AccountID)) - } request, err := builder.Build() if err != nil { @@ -1151,7 +1240,7 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBindingCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultNetworkACL) if err != nil { return } @@ -1161,68 +1250,50 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l return } -// CreateVPCDnsResolutionBinding : Create a DNS resolution binding -// This request creates a new DNS resolution binding from a DNS resolution binding prototype object. The prototype -// object is structured in the same way as a retrieved DNS resolution binding, and contains the information necessary to -// create the new DNS resolution binding. -// -// For this request to succeed, `dns.enable_hub` must be `false` for the VPC specified by the identifier in the URL, and -// the VPC must not already have a DNS resolution binding. -// -// See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-hub-spoke-model) for more information. -func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.CreateVPCDnsResolutionBindingWithContext(context.Background(), createVPCDnsResolutionBindingOptions) +// GetVPCDefaultRoutingTable : Retrieve a VPC's default routing table +// This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default +// routing table is associated with any subnets in the VPC which have not been explicitly associated with another +// routing table. +func (vpc *VpcV1) GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { + return vpc.GetVPCDefaultRoutingTableWithContext(context.Background(), getVPCDefaultRoutingTableOptions) } -// CreateVPCDnsResolutionBindingWithContext is an alternate form of the CreateVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions cannot be nil") +// GetVPCDefaultRoutingTableWithContext is an alternate form of the GetVPCDefaultRoutingTable method which supports a Context parameter +func (vpc *VpcV1) GetVPCDefaultRoutingTableWithContext(ctx context.Context, getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions") + err = core.ValidateStruct(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *createVPCDnsResolutionBindingOptions.VPCID, + "id": *getVPCDefaultRoutingTableOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_routing_table`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPCDnsResolutionBindingOptions.Headers { + for headerName, headerValue := range getVPCDefaultRoutingTableOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCDnsResolutionBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultRoutingTable") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createVPCDnsResolutionBindingOptions.VPC != nil { - body["vpc"] = createVPCDnsResolutionBindingOptions.VPC - } - if createVPCDnsResolutionBindingOptions.Name != nil { - body["name"] = createVPCDnsResolutionBindingOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -1234,7 +1305,7 @@ func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultRoutingTable) if err != nil { return } @@ -1244,44 +1315,41 @@ func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, return } -// DeleteVPCDnsResolutionBinding : Delete a DNS resolution binding -// This request deletes a DNS resolution binding. This operation cannot be reversed. -// -// For this request to succeed, the VPC specified by the identifier in the URL must not have -// `dns.resolver.type` set to `delegated`. -func (vpc *VpcV1) DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.DeleteVPCDnsResolutionBindingWithContext(context.Background(), deleteVPCDnsResolutionBindingOptions) +// GetVPCDefaultSecurityGroup : Retrieve a VPC's default security group +// This request retrieves the default security group for the VPC specified by the identifier in the URL. Resources +// created in this VPC that allow a security group to be optionally specified will use this security group by default. +func (vpc *VpcV1) GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { + return vpc.GetVPCDefaultSecurityGroupWithContext(context.Background(), getVPCDefaultSecurityGroupOptions) } -// DeleteVPCDnsResolutionBindingWithContext is an alternate form of the DeleteVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions cannot be nil") +// GetVPCDefaultSecurityGroupWithContext is an alternate form of the GetVPCDefaultSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) GetVPCDefaultSecurityGroupWithContext(ctx context.Context, getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions") + err = core.ValidateStruct(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCDnsResolutionBindingOptions.VPCID, - "id": *deleteVPCDnsResolutionBindingOptions.ID, + "id": *getVPCDefaultSecurityGroupOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_security_group`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPCDnsResolutionBindingOptions.Headers { + for headerName, headerValue := range getVPCDefaultSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCDnsResolutionBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -1301,7 +1369,7 @@ func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultSecurityGroup) if err != nil { return } @@ -1375,57 +1443,52 @@ func (vpc *VpcV1) GetVPCDnsResolutionBindingWithContext(ctx context.Context, get return } -// UpdateVPCDnsResolutionBinding : Update a DNS resolution binding -// This request updates a DNS resolution binding with the information in a provided DNS resolution binding patch. The -// DNS resolution binding patch object is structured in the same way as a retrieved DNS resolution binding and contains -// only the information to be updated. -func (vpc *VpcV1) UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCDnsResolutionBindingWithContext(context.Background(), updateVPCDnsResolutionBindingOptions) +// GetVPCRoute : Retrieve a VPC route +// This request retrieves a single route specified by the identifier in the URL. +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { + return vpc.GetVPCRouteWithContext(context.Background(), getVPCRouteOptions) } -// UpdateVPCDnsResolutionBindingWithContext is an alternate form of the UpdateVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCDnsResolutionBindingWithContext(ctx context.Context, updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions cannot be nil") +// GetVPCRouteWithContext is an alternate form of the GetVPCRoute method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: GetVPCRoute") + err = core.ValidateNotNil(getVPCRouteOptions, "getVPCRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions") + err = core.ValidateStruct(getVPCRouteOptions, "getVPCRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *updateVPCDnsResolutionBindingOptions.VPCID, - "id": *updateVPCDnsResolutionBindingOptions.ID, + "vpc_id": *getVPCRouteOptions.VPCID, + "id": *getVPCRouteOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPCDnsResolutionBindingOptions.Headers { + for headerName, headerValue := range getVPCRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCDnsResolutionBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPCDnsResolutionBindingOptions.VpcdnsResolutionBindingPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -1437,7 +1500,7 @@ func (vpc *VpcV1) UpdateVPCDnsResolutionBindingWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetVPCRouteResponse) if err != nil { return } @@ -1447,45 +1510,41 @@ func (vpc *VpcV1) UpdateVPCDnsResolutionBindingWithContext(ctx context.Context, return } -// ListVPCRoutes : List all routes in a VPC's default routing table -// This request lists all routes in the VPC's default routing table. Each route is zone-specific and directs any packets -// matching its destination CIDR block to a `next_hop` IP address. The most specific route matching a packet's -// destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) ListVPCRoutes(listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { - return vpc.ListVPCRoutesWithContext(context.Background(), listVPCRoutesOptions) +// GetVPCRoutingTable : Retrieve a VPC routing table +// This request retrieves a single routing table specified by the identifier in the URL. +func (vpc *VpcV1) GetVPCRoutingTable(getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + return vpc.GetVPCRoutingTableWithContext(context.Background(), getVPCRoutingTableOptions) } -// ListVPCRoutesWithContext is an alternate form of the ListVPCRoutes method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: ListVPCRoutes") - err = core.ValidateNotNil(listVPCRoutesOptions, "listVPCRoutesOptions cannot be nil") +// GetVPCRoutingTableWithContext is an alternate form of the GetVPCRoutingTable method which supports a Context parameter +func (vpc *VpcV1) GetVPCRoutingTableWithContext(ctx context.Context, getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCRoutingTableOptions, "getVPCRoutingTableOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPCRoutesOptions, "listVPCRoutesOptions") + err = core.ValidateStruct(getVPCRoutingTableOptions, "getVPCRoutingTableOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *listVPCRoutesOptions.VPCID, + "vpc_id": *getVPCRoutingTableOptions.VPCID, + "id": *getVPCRoutingTableOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPCRoutesOptions.Headers { + for headerName, headerValue := range getVPCRoutingTableOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTable") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -1493,15 +1552,6 @@ func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCRoutesOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listVPCRoutesOptions.ZoneName)) - } - if listVPCRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCRoutesOptions.Start)) - } - if listVPCRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCRoutesOptions.Limit)) - } request, err := builder.Build() if err != nil { @@ -1514,7 +1564,7 @@ func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollectionVPCContext) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) if err != nil { return } @@ -1524,78 +1574,50 @@ func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOpt return } -// CreateVPCRoute : Create a route in a VPC's default routing table -// This request creates a new route in the VPC's default routing table. The route prototype object is structured in the -// same way as a retrieved route, and contains the information necessary to create the new route. The request will fail -// if the new route will cause a loop. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRouteWithContext(context.Background(), createVPCRouteOptions) +// GetVPCRoutingTableRoute : Retrieve a VPC routing table route +// This request retrieves a single VPC route specified by the identifier in the URL path. +func (vpc *VpcV1) GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + return vpc.GetVPCRoutingTableRouteWithContext(context.Background(), getVPCRoutingTableRouteOptions) } -// CreateVPCRouteWithContext is an alternate form of the CreateVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: CreateVPCRoute") - err = core.ValidateNotNil(createVPCRouteOptions, "createVPCRouteOptions cannot be nil") +// GetVPCRoutingTableRouteWithContext is an alternate form of the GetVPCRoutingTableRoute method which supports a Context parameter +func (vpc *VpcV1) GetVPCRoutingTableRouteWithContext(ctx context.Context, getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPCRouteOptions, "createVPCRouteOptions") + err = core.ValidateStruct(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *createVPCRouteOptions.VPCID, + "vpc_id": *getVPCRoutingTableRouteOptions.VPCID, + "routing_table_id": *getVPCRoutingTableRouteOptions.RoutingTableID, + "id": *getVPCRoutingTableRouteOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPCRouteOptions.Headers { + for headerName, headerValue := range getVPCRoutingTableRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTableRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createVPCRouteOptions.Destination != nil { - body["destination"] = createVPCRouteOptions.Destination - } - if createVPCRouteOptions.Zone != nil { - body["zone"] = createVPCRouteOptions.Zone - } - if createVPCRouteOptions.Action != nil { - body["action"] = createVPCRouteOptions.Action - } - if createVPCRouteOptions.Name != nil { - body["name"] = createVPCRouteOptions.Name - } - if createVPCRouteOptions.NextHop != nil { - body["next_hop"] = createVPCRouteOptions.NextHop - } - if createVPCRouteOptions.Priority != nil { - body["priority"] = createVPCRouteOptions.Priority - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -1607,7 +1629,7 @@ func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCreateVPCRouteResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) if err != nil { return } @@ -1617,99 +1639,124 @@ func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteO return } -// DeleteVPCRoute : Delete a VPC route -// This request deletes a route. This operation cannot be reversed. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) DeleteVPCRoute(deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRouteWithContext(context.Background(), deleteVPCRouteOptions) +// ListVPCAddressPrefixes : List all address prefixes for a VPC +// This request lists all address pool prefixes for a VPC. +func (vpc *VpcV1) ListVPCAddressPrefixes(listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPCAddressPrefixesWithContext(context.Background(), listVPCAddressPrefixesOptions) } -// DeleteVPCRouteWithContext is an alternate form of the DeleteVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) DeleteVPCRouteWithContext(ctx context.Context, deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: DeleteVPCRoute") - err = core.ValidateNotNil(deleteVPCRouteOptions, "deleteVPCRouteOptions cannot be nil") +// ListVPCAddressPrefixesWithContext is an alternate form of the ListVPCAddressPrefixes method which supports a Context parameter +func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCRouteOptions, "deleteVPCRouteOptions") + err = core.ValidateStruct(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRouteOptions.VPCID, - "id": *deleteVPCRouteOptions.ID, + "vpc_id": *listVPCAddressPrefixesOptions.VPCID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPCRouteOptions.Headers { + for headerName, headerValue := range listVPCAddressPrefixesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCAddressPrefixes") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPCAddressPrefixesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPCAddressPrefixesOptions.Start)) + } + if listVPCAddressPrefixesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPCAddressPrefixesOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefixCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetVPCRoute : Retrieve a VPC route -// This request retrieves a single route specified by the identifier in the URL. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.GetVPCRouteWithContext(context.Background(), getVPCRouteOptions) -} - -// GetVPCRouteWithContext is an alternate form of the GetVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: GetVPCRoute") - err = core.ValidateNotNil(getVPCRouteOptions, "getVPCRouteOptions cannot be nil") - if err != nil { - return +// ListVPCDnsResolutionBindings : List all DNS resolution bindings for a VPC +// This request lists all DNS resolution bindings for a VPC. A DNS resolution binding represents an association with +// another VPC for centralizing DNS name resolution. +// +// If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there is +// one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using +// `allow_dns_resolution_binding`) the hub VPC to centralize resolution of their DNS names. +// +// If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub +// VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using +// `allow_dns_resolution_binding`) its hub VPC to centralize resolution of their DNS names. +// +// To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC +// by setting `dns.resolver.type` to `delegate`. +// +// The bindings will be sorted by their `created_at` property values, with newest bindings first. Bindings with +// identical `created_at` property values will in turn be sorted by ascending `name` property values. +func (vpc *VpcV1) ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPCDnsResolutionBindingsWithContext(context.Background(), listVPCDnsResolutionBindingsOptions) +} + +// ListVPCDnsResolutionBindingsWithContext is an alternate form of the ListVPCDnsResolutionBindings method which supports a Context parameter +func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions cannot be nil") + if err != nil { + return } - err = core.ValidateStruct(getVPCRouteOptions, "getVPCRouteOptions") + err = core.ValidateStruct(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *getVPCRouteOptions.VPCID, - "id": *getVPCRouteOptions.ID, + "vpc_id": *listVPCDnsResolutionBindingsOptions.VPCID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCRouteOptions.Headers { + for headerName, headerValue := range listVPCDnsResolutionBindingsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCDnsResolutionBindings") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -1717,6 +1764,27 @@ func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPCDnsResolutionBindingsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Sort)) + } + if listVPCDnsResolutionBindingsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Start)) + } + if listVPCDnsResolutionBindingsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Limit)) + } + if listVPCDnsResolutionBindingsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Name)) + } + if listVPCDnsResolutionBindingsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCCRN)) + } + if listVPCDnsResolutionBindingsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCName)) + } + if listVPCDnsResolutionBindingsOptions.AccountID != nil { + builder.AddQuery("account.id", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.AccountID)) + } request, err := builder.Build() if err != nil { @@ -1729,7 +1797,7 @@ func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetVPCRouteResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBindingCollection) if err != nil { return } @@ -1739,59 +1807,136 @@ func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions return } -// UpdateVPCRoute : Update a VPC route -// This request updates a route with the information in a provided route patch. The route patch object is structured in -// the same way as a retrieved route and contains only the information to be updated. +// ListVPCRoutes : List all routes in a VPC's default routing table +// This request lists all routes in the VPC's default routing table. Each route is zone-specific and directs any packets +// matching its destination CIDR block to a `next_hop` IP address. The most specific route matching a packet's +// destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRouteWithContext(context.Background(), updateVPCRouteOptions) +func (vpc *VpcV1) ListVPCRoutes(listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { + return vpc.ListVPCRoutesWithContext(context.Background(), listVPCRoutesOptions) } -// UpdateVPCRouteWithContext is an alternate form of the UpdateVPCRoute method which supports a Context parameter +// ListVPCRoutesWithContext is an alternate form of the ListVPCRoutes method which supports a Context parameter // Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: UpdateVPCRoute") - err = core.ValidateNotNil(updateVPCRouteOptions, "updateVPCRouteOptions cannot be nil") +func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: ListVPCRoutes") + err = core.ValidateNotNil(listVPCRoutesOptions, "listVPCRoutesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCRouteOptions, "updateVPCRouteOptions") + err = core.ValidateStruct(listVPCRoutesOptions, "listVPCRoutesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRouteOptions.VPCID, - "id": *updateVPCRouteOptions.ID, + "vpc_id": *listVPCRoutesOptions.VPCID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPCRouteOptions.Headers { + for headerName, headerValue := range listVPCRoutesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutes") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPCRoutesOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listVPCRoutesOptions.ZoneName)) + } + if listVPCRoutesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPCRoutesOptions.Start)) + } + if listVPCRoutesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPCRoutesOptions.Limit)) + } - _, err = builder.SetBodyContentJSON(updateVPCRouteOptions.RoutePatch) + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollectionVPCContext) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListVPCRoutingTableRoutes : List all routes in a VPC routing table +// This request lists all routes in a VPC routing table. If subnets are associated with this routing table, delivery of +// packets sent on a subnet is performed according to the action of the most specific matching route in the table +// (provided the subnet and route are in the same zone). If multiple equally-specific routes exist, the route with the +// highest priority will be used. If two matching routes have the same destination and priority, traffic will be +// distributed between them. If no routes match, delivery will be controlled by the system's built-in routes. +func (vpc *VpcV1) ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPCRoutingTableRoutesWithContext(context.Background(), listVPCRoutingTableRoutesOptions) +} + +// ListVPCRoutingTableRoutesWithContext is an alternate form of the ListVPCRoutingTableRoutes method which supports a Context parameter +func (vpc *VpcV1) ListVPCRoutingTableRoutesWithContext(ctx context.Context, listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "vpc_id": *listVPCRoutingTableRoutesOptions.VPCID, + "routing_table_id": *listVPCRoutingTableRoutesOptions.RoutingTableID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) if err != nil { return } + for headerName, headerValue := range listVPCRoutingTableRoutesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutingTableRoutes") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPCRoutingTableRoutesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Start)) + } + if listVPCRoutingTableRoutesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Limit)) + } + request, err := builder.Build() if err != nil { return @@ -1803,7 +1948,7 @@ func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalUpdateVPCRouteResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollection) if err != nil { return } @@ -1888,75 +2033,52 @@ func (vpc *VpcV1) ListVPCRoutingTablesWithContext(ctx context.Context, listVPCRo return } -// CreateVPCRoutingTable : Create a routing table for a VPC -// This request creates a routing table from a routing table prototype object. The prototype object is structured in the -// same way as a retrieved routing table, and contains the information necessary to create the new routing table. -func (vpc *VpcV1) CreateVPCRoutingTable(createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRoutingTableWithContext(context.Background(), createVPCRoutingTableOptions) +// ListVpcs : List all VPCs +// This request lists all VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical +// isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC +// can contain resources in multiple zones in a region. +func (vpc *VpcV1) ListVpcs(listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { + return vpc.ListVpcsWithContext(context.Background(), listVpcsOptions) } -// CreateVPCRoutingTableWithContext is an alternate form of the CreateVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) CreateVPCRoutingTableWithContext(ctx context.Context, createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCRoutingTableOptions, "createVPCRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCRoutingTableOptions, "createVPCRoutingTableOptions") +// ListVpcsWithContext is an alternate form of the ListVpcs method which supports a Context parameter +func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVpcsOptions, "listVpcsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpc_id": *createVPCRoutingTableOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs`, nil) if err != nil { return } - for headerName, headerValue := range createVPCRoutingTableOptions.Headers { + for headerName, headerValue := range listVpcsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVpcs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCRoutingTableOptions.AcceptRoutesFrom != nil { - body["accept_routes_from"] = createVPCRoutingTableOptions.AcceptRoutesFrom - } - if createVPCRoutingTableOptions.Name != nil { - body["name"] = createVPCRoutingTableOptions.Name - } - if createVPCRoutingTableOptions.RouteDirectLinkIngress != nil { - body["route_direct_link_ingress"] = createVPCRoutingTableOptions.RouteDirectLinkIngress - } - if createVPCRoutingTableOptions.RouteInternetIngress != nil { - body["route_internet_ingress"] = createVPCRoutingTableOptions.RouteInternetIngress - } - if createVPCRoutingTableOptions.RouteTransitGatewayIngress != nil { - body["route_transit_gateway_ingress"] = createVPCRoutingTableOptions.RouteTransitGatewayIngress + if listVpcsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVpcsOptions.Start)) } - if createVPCRoutingTableOptions.RouteVPCZoneIngress != nil { - body["route_vpc_zone_ingress"] = createVPCRoutingTableOptions.RouteVPCZoneIngress + if listVpcsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVpcsOptions.Limit)) } - if createVPCRoutingTableOptions.Routes != nil { - body["routes"] = createVPCRoutingTableOptions.Routes + if listVpcsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listVpcsOptions.ResourceGroupID)) } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listVpcsOptions.ClassicAccess != nil { + builder.AddQuery("classic_access", fmt.Sprint(*listVpcsOptions.ClassicAccess)) } request, err := builder.Build() @@ -1970,7 +2092,7 @@ func (vpc *VpcV1) CreateVPCRoutingTableWithContext(ctx context.Context, createVP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPCCollection) if err != nil { return } @@ -1980,105 +2102,129 @@ func (vpc *VpcV1) CreateVPCRoutingTableWithContext(ctx context.Context, createVP return } -// DeleteVPCRoutingTable : Delete a VPC routing table -// This request deletes a routing table. A routing table cannot be deleted if it is associated with any subnets in the -// VPC. Additionally, a VPC's default routing table cannot be deleted. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPCRoutingTable(deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRoutingTableWithContext(context.Background(), deleteVPCRoutingTableOptions) +// UpdateVPC : Update a VPC +// This request updates a VPC with the information provided in a VPC patch object. The patch object is structured in the +// same way as a retrieved VPC and needs to contain only the information to be updated. +func (vpc *VpcV1) UpdateVPC(updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCWithContext(context.Background(), updateVPCOptions) } -// DeleteVPCRoutingTableWithContext is an alternate form of the DeleteVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCRoutingTableWithContext(ctx context.Context, deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions cannot be nil") +// UpdateVPCWithContext is an alternate form of the UpdateVPC method which supports a Context parameter +func (vpc *VpcV1) UpdateVPCWithContext(ctx context.Context, updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPCOptions, "updateVPCOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions") + err = core.ValidateStruct(updateVPCOptions, "updateVPCOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRoutingTableOptions.VPCID, - "id": *deleteVPCRoutingTableOptions.ID, + "id": *updateVPCOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPCRoutingTableOptions.Headers { + for headerName, headerValue := range updateVPCOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPC") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - if deleteVPCRoutingTableOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCRoutingTableOptions.IfMatch)) + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVPCOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVPCOptions.IfMatch)) } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateVPCOptions.VPCPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) + if err != nil { + return + } + response.Result = result + } return } -// GetVPCRoutingTable : Retrieve a VPC routing table -// This request retrieves a single routing table specified by the identifier in the URL. -func (vpc *VpcV1) GetVPCRoutingTable(getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetVPCRoutingTableWithContext(context.Background(), getVPCRoutingTableOptions) +// UpdateVPCAddressPrefix : Update an address prefix +// This request updates a prefix with the information in a provided prefix patch. The prefix patch object is structured +// in the same way as a retrieved prefix and contains only the information to be updated. +func (vpc *VpcV1) UpdateVPCAddressPrefix(updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCAddressPrefixWithContext(context.Background(), updateVPCAddressPrefixOptions) } -// GetVPCRoutingTableWithContext is an alternate form of the GetVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetVPCRoutingTableWithContext(ctx context.Context, getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCRoutingTableOptions, "getVPCRoutingTableOptions cannot be nil") +// UpdateVPCAddressPrefixWithContext is an alternate form of the UpdateVPCAddressPrefix method which supports a Context parameter +func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPCRoutingTableOptions, "getVPCRoutingTableOptions") + err = core.ValidateStruct(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *getVPCRoutingTableOptions.VPCID, - "id": *getVPCRoutingTableOptions.ID, + "vpc_id": *updateVPCAddressPrefixOptions.VPCID, + "id": *updateVPCAddressPrefixOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPCRoutingTableOptions.Headers { + for headerName, headerValue := range updateVPCAddressPrefixOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCAddressPrefix") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateVPCAddressPrefixOptions.AddressPrefixPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -2090,7 +2236,7 @@ func (vpc *VpcV1) GetVPCRoutingTableWithContext(ctx context.Context, getVPCRouti return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) if err != nil { return } @@ -2100,55 +2246,53 @@ func (vpc *VpcV1) GetVPCRoutingTableWithContext(ctx context.Context, getVPCRouti return } -// UpdateVPCRoutingTable : Update a VPC routing table -// This request updates a routing table with the information in a provided routing table patch. The patch object is -// structured in the same way as a retrieved table and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPCRoutingTable(updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRoutingTableWithContext(context.Background(), updateVPCRoutingTableOptions) +// UpdateVPCDnsResolutionBinding : Update a DNS resolution binding +// This request updates a DNS resolution binding with the information in a provided DNS resolution binding patch. The +// DNS resolution binding patch object is structured in the same way as a retrieved DNS resolution binding and contains +// only the information to be updated. +func (vpc *VpcV1) UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCDnsResolutionBindingWithContext(context.Background(), updateVPCDnsResolutionBindingOptions) } -// UpdateVPCRoutingTableWithContext is an alternate form of the UpdateVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCRoutingTableWithContext(ctx context.Context, updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions cannot be nil") +// UpdateVPCDnsResolutionBindingWithContext is an alternate form of the UpdateVPCDnsResolutionBinding method which supports a Context parameter +func (vpc *VpcV1) UpdateVPCDnsResolutionBindingWithContext(ctx context.Context, updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions") + err = core.ValidateStruct(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRoutingTableOptions.VPCID, - "id": *updateVPCRoutingTableOptions.ID, + "vpc_id": *updateVPCDnsResolutionBindingOptions.VPCID, + "id": *updateVPCDnsResolutionBindingOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPCRoutingTableOptions.Headers { + for headerName, headerValue := range updateVPCDnsResolutionBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCDnsResolutionBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPCRoutingTableOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPCRoutingTableOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPCRoutingTableOptions.RoutingTablePatch) + _, err = builder.SetBodyContentJSON(updateVPCDnsResolutionBindingOptions.VpcdnsResolutionBindingPatch) if err != nil { return } @@ -2164,7 +2308,7 @@ func (vpc *VpcV1) UpdateVPCRoutingTableWithContext(ctx context.Context, updateVP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) if err != nil { return } @@ -2174,57 +2318,57 @@ func (vpc *VpcV1) UpdateVPCRoutingTableWithContext(ctx context.Context, updateVP return } -// ListVPCRoutingTableRoutes : List all routes in a VPC routing table -// This request lists all routes in a VPC routing table. If subnets are associated with this routing table, delivery of -// packets sent on a subnet is performed according to the action of the most specific matching route in the table -// (provided the subnet and route are in the same zone). If multiple equally-specific routes exist, the route with the -// highest priority will be used. If two matching routes have the same destination and priority, traffic will be -// distributed between them. If no routes match, delivery will be controlled by the system's built-in routes. -func (vpc *VpcV1) ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCRoutingTableRoutesWithContext(context.Background(), listVPCRoutingTableRoutesOptions) +// UpdateVPCRoute : Update a VPC route +// This request updates a route with the information in a provided route patch. The route patch object is structured in +// the same way as a retrieved route and contains only the information to be updated. +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCRouteWithContext(context.Background(), updateVPCRouteOptions) } -// ListVPCRoutingTableRoutesWithContext is an alternate form of the ListVPCRoutingTableRoutes method which supports a Context parameter -func (vpc *VpcV1) ListVPCRoutingTableRoutesWithContext(ctx context.Context, listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions cannot be nil") +// UpdateVPCRouteWithContext is an alternate form of the UpdateVPCRoute method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. +func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: UpdateVPCRoute") + err = core.ValidateNotNil(updateVPCRouteOptions, "updateVPCRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions") + err = core.ValidateStruct(updateVPCRouteOptions, "updateVPCRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *listVPCRoutingTableRoutesOptions.VPCID, - "routing_table_id": *listVPCRoutingTableRoutesOptions.RoutingTableID, + "vpc_id": *updateVPCRouteOptions.VPCID, + "id": *updateVPCRouteOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPCRoutingTableRoutesOptions.Headers { + for headerName, headerValue := range updateVPCRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutingTableRoutes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCRoutingTableRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Start)) - } - if listVPCRoutingTableRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateVPCRouteOptions.RoutePatch) + if err != nil { + return } request, err := builder.Build() @@ -2238,7 +2382,7 @@ func (vpc *VpcV1) ListVPCRoutingTableRoutesWithContext(ctx context.Context, list return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalUpdateVPCRouteResponse) if err != nil { return } @@ -2248,71 +2392,55 @@ func (vpc *VpcV1) ListVPCRoutingTableRoutesWithContext(ctx context.Context, list return } -// CreateVPCRoutingTableRoute : Create a route in a VPC routing table -// This request creates a new VPC route from a VPC route prototype object. The prototype object is structured in the -// same way as a retrieved VPC route and contains the information necessary to create the route. -func (vpc *VpcV1) CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRoutingTableRouteWithContext(context.Background(), createVPCRoutingTableRouteOptions) +// UpdateVPCRoutingTable : Update a VPC routing table +// This request updates a routing table with the information in a provided routing table patch. The patch object is +// structured in the same way as a retrieved table and contains only the information to be updated. +func (vpc *VpcV1) UpdateVPCRoutingTable(updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCRoutingTableWithContext(context.Background(), updateVPCRoutingTableOptions) } -// CreateVPCRoutingTableRouteWithContext is an alternate form of the CreateVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) CreateVPCRoutingTableRouteWithContext(ctx context.Context, createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions cannot be nil") +// UpdateVPCRoutingTableWithContext is an alternate form of the UpdateVPCRoutingTable method which supports a Context parameter +func (vpc *VpcV1) UpdateVPCRoutingTableWithContext(ctx context.Context, updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions") + err = core.ValidateStruct(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *createVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *createVPCRoutingTableRouteOptions.RoutingTableID, + "vpc_id": *updateVPCRoutingTableOptions.VPCID, + "id": *updateVPCRoutingTableOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPCRoutingTableRouteOptions.Headers { + for headerName, headerValue := range updateVPCRoutingTableOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTableRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTable") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVPCRoutingTableOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVPCRoutingTableOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createVPCRoutingTableRouteOptions.Destination != nil { - body["destination"] = createVPCRoutingTableRouteOptions.Destination - } - if createVPCRoutingTableRouteOptions.Zone != nil { - body["zone"] = createVPCRoutingTableRouteOptions.Zone - } - if createVPCRoutingTableRouteOptions.Action != nil { - body["action"] = createVPCRoutingTableRouteOptions.Action - } - if createVPCRoutingTableRouteOptions.Name != nil { - body["name"] = createVPCRoutingTableRouteOptions.Name - } - if createVPCRoutingTableRouteOptions.NextHop != nil { - body["next_hop"] = createVPCRoutingTableRouteOptions.NextHop - } - if createVPCRoutingTableRouteOptions.Priority != nil { - body["priority"] = createVPCRoutingTableRouteOptions.Priority - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateVPCRoutingTableOptions.RoutingTablePatch) if err != nil { return } @@ -2328,7 +2456,7 @@ func (vpc *VpcV1) CreateVPCRoutingTableRouteWithContext(ctx context.Context, cre return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) if err != nil { return } @@ -2338,31 +2466,32 @@ func (vpc *VpcV1) CreateVPCRoutingTableRouteWithContext(ctx context.Context, cre return } -// DeleteVPCRoutingTableRoute : Delete a VPC routing table route -// This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are -// allowed to be deleted. -func (vpc *VpcV1) DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRoutingTableRouteWithContext(context.Background(), deleteVPCRoutingTableRouteOptions) +// UpdateVPCRoutingTableRoute : Update a VPC routing table route +// This request updates a VPC route with the information provided in a route patch object. The patch object is +// structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only VPC +// routes with an `origin` of `user` are allowed to be updated. +func (vpc *VpcV1) UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + return vpc.UpdateVPCRoutingTableRouteWithContext(context.Background(), updateVPCRoutingTableRouteOptions) } -// DeleteVPCRoutingTableRouteWithContext is an alternate form of the DeleteVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCRoutingTableRouteWithContext(ctx context.Context, deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions cannot be nil") +// UpdateVPCRoutingTableRouteWithContext is an alternate form of the UpdateVPCRoutingTableRoute method which supports a Context parameter +func (vpc *VpcV1) UpdateVPCRoutingTableRouteWithContext(ctx context.Context, updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions") + err = core.ValidateStruct(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *deleteVPCRoutingTableRouteOptions.RoutingTableID, - "id": *deleteVPCRoutingTableRouteOptions.ID, + "vpc_id": *updateVPCRoutingTableRouteOptions.VPCID, + "routing_table_id": *updateVPCRoutingTableRouteOptions.RoutingTableID, + "id": *updateVPCRoutingTableRouteOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) @@ -2370,71 +2499,24 @@ func (vpc *VpcV1) DeleteVPCRoutingTableRouteWithContext(ctx context.Context, del return } - for headerName, headerValue := range deleteVPCRoutingTableRouteOptions.Headers { + for headerName, headerValue := range updateVPCRoutingTableRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTableRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTableRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetVPCRoutingTableRoute : Retrieve a VPC routing table route -// This request retrieves a single VPC route specified by the identifier in the URL path. -func (vpc *VpcV1) GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.GetVPCRoutingTableRouteWithContext(context.Background(), getVPCRoutingTableRouteOptions) -} - -// GetVPCRoutingTableRouteWithContext is an alternate form of the GetVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) GetVPCRoutingTableRouteWithContext(ctx context.Context, getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *getVPCRoutingTableRouteOptions.RoutingTableID, - "id": *getVPCRoutingTableRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCRoutingTableRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTableRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateVPCRoutingTableRouteOptions.RoutePatch) + if err != nil { + return + } request, err := builder.Build() if err != nil { @@ -2457,54 +2539,48 @@ func (vpc *VpcV1) GetVPCRoutingTableRouteWithContext(ctx context.Context, getVPC return } -// UpdateVPCRoutingTableRoute : Update a VPC routing table route -// This request updates a VPC route with the information provided in a route patch object. The patch object is -// structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only VPC -// routes with an `origin` of `user` are allowed to be updated. -func (vpc *VpcV1) UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRoutingTableRouteWithContext(context.Background(), updateVPCRoutingTableRouteOptions) +// CreateSubnet : Create a subnet +// This request creates a new subnet from a subnet prototype object. The prototype object is structured in the same way +// as a retrieved subnet, and contains the information necessary to create the new subnet. For this request to succeed, +// the prototype's CIDR block must not overlap with an existing subnet in the VPC. +func (vpc *VpcV1) CreateSubnet(createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { + return vpc.CreateSubnetWithContext(context.Background(), createSubnetOptions) } -// UpdateVPCRoutingTableRouteWithContext is an alternate form of the UpdateVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCRoutingTableRouteWithContext(ctx context.Context, updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions cannot be nil") +// CreateSubnetWithContext is an alternate form of the CreateSubnet method which supports a Context parameter +func (vpc *VpcV1) CreateSubnetWithContext(ctx context.Context, createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSubnetOptions, "createSubnetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions") + err = core.ValidateStruct(createSubnetOptions, "createSubnetOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *updateVPCRoutingTableRouteOptions.RoutingTableID, - "id": *updateVPCRoutingTableRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) if err != nil { return } - for headerName, headerValue := range updateVPCRoutingTableRouteOptions.Headers { + for headerName, headerValue := range createSubnetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTableRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnet") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPCRoutingTableRouteOptions.RoutePatch) + _, err = builder.SetBodyContentJSON(createSubnetOptions.SubnetPrototype) if err != nil { return } @@ -2520,7 +2596,7 @@ func (vpc *VpcV1) UpdateVPCRoutingTableRouteWithContext(ctx context.Context, upd return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) if err != nil { return } @@ -2530,66 +2606,66 @@ func (vpc *VpcV1) UpdateVPCRoutingTableRouteWithContext(ctx context.Context, upd return } -// ListSubnets : List all subnets -// This request lists all subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block -// notation. Each subnet is within a particular zone and cannot span multiple zones or regions. -func (vpc *VpcV1) ListSubnets(listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { - return vpc.ListSubnetsWithContext(context.Background(), listSubnetsOptions) +// CreateSubnetReservedIP : Reserve an IP in a subnet +// This request reserves an IP address in a subnet. If the provided prototype object includes an `address`, the address +// must not already be reserved. +func (vpc *VpcV1) CreateSubnetReservedIP(createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.CreateSubnetReservedIPWithContext(context.Background(), createSubnetReservedIPOptions) } -// ListSubnetsWithContext is an alternate form of the ListSubnets method which supports a Context parameter -func (vpc *VpcV1) ListSubnetsWithContext(ctx context.Context, listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSubnetsOptions, "listSubnetsOptions") +// CreateSubnetReservedIPWithContext is an alternate form of the CreateSubnetReservedIP method which supports a Context parameter +func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSubnetReservedIPOptions, "createSubnetReservedIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createSubnetReservedIPOptions, "createSubnetReservedIPOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "subnet_id": *createSubnetReservedIPOptions.SubnetID, + } + + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSubnetsOptions.Headers { + for headerName, headerValue := range createSubnetReservedIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnets") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnetReservedIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSubnetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSubnetsOptions.Start)) - } - if listSubnetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSubnetsOptions.Limit)) - } - if listSubnetsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSubnetsOptions.ResourceGroupID)) - } - if listSubnetsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listSubnetsOptions.ZoneName)) - } - if listSubnetsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listSubnetsOptions.VPCID)) + + body := make(map[string]interface{}) + if createSubnetReservedIPOptions.Address != nil { + body["address"] = createSubnetReservedIPOptions.Address } - if listSubnetsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listSubnetsOptions.VPCCRN)) + if createSubnetReservedIPOptions.AutoDelete != nil { + body["auto_delete"] = createSubnetReservedIPOptions.AutoDelete } - if listSubnetsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listSubnetsOptions.VPCName)) + if createSubnetReservedIPOptions.Name != nil { + body["name"] = createSubnetReservedIPOptions.Name } - if listSubnetsOptions.RoutingTableID != nil { - builder.AddQuery("routing_table.id", fmt.Sprint(*listSubnetsOptions.RoutingTableID)) + if createSubnetReservedIPOptions.Target != nil { + body["target"] = createSubnetReservedIPOptions.Target } - if listSubnetsOptions.RoutingTableName != nil { - builder.AddQuery("routing_table.name", fmt.Sprint(*listSubnetsOptions.RoutingTableName)) + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -2603,7 +2679,7 @@ func (vpc *VpcV1) ListSubnetsWithContext(ctx context.Context, listSubnetsOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnetCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) if err != nil { return } @@ -2613,111 +2689,100 @@ func (vpc *VpcV1) ListSubnetsWithContext(ctx context.Context, listSubnetsOptions return } -// CreateSubnet : Create a subnet -// This request creates a new subnet from a subnet prototype object. The prototype object is structured in the same way -// as a retrieved subnet, and contains the information necessary to create the new subnet. For this request to succeed, -// the prototype's CIDR block must not overlap with an existing subnet in the VPC. -func (vpc *VpcV1) CreateSubnet(createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - return vpc.CreateSubnetWithContext(context.Background(), createSubnetOptions) +// DeleteSubnet : Delete a subnet +// This request deletes a subnet. This operation cannot be reversed. For this request to succeed, the subnet must not be +// referenced by any bare metal server network interfaces, instance network interfaces, virtual network interfaces, VPN +// gateways, or load balancers. A delete operation automatically detaches the subnet from any network ACLs, public +// gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to `true` targeting the subnet or any +// resource in the subnet are automatically deleted. +func (vpc *VpcV1) DeleteSubnet(deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSubnetWithContext(context.Background(), deleteSubnetOptions) } -// CreateSubnetWithContext is an alternate form of the CreateSubnet method which supports a Context parameter -func (vpc *VpcV1) CreateSubnetWithContext(ctx context.Context, createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSubnetOptions, "createSubnetOptions cannot be nil") +// DeleteSubnetWithContext is an alternate form of the DeleteSubnet method which supports a Context parameter +func (vpc *VpcV1) DeleteSubnetWithContext(ctx context.Context, deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSubnetOptions, "deleteSubnetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSubnetOptions, "createSubnetOptions") + err = core.ValidateStruct(deleteSubnetOptions, "deleteSubnetOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *deleteSubnetOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSubnetOptions.Headers { + for headerName, headerValue := range deleteSubnetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnet") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnet") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createSubnetOptions.SubnetPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteSubnet : Delete a subnet -// This request deletes a subnet. This operation cannot be reversed. For this request to succeed, the subnet must not be -// referenced by any bare metal server network interfaces, instance network interfaces, VPN gateways, or load balancers. -// A delete operation automatically detaches the subnet from any network ACLs, public gateways, or endpoint gateways. -// All flow log collectors with `auto_delete` set to `true` targeting the subnet or any resource in the subnet are -// automatically deleted. -func (vpc *VpcV1) DeleteSubnet(deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSubnetWithContext(context.Background(), deleteSubnetOptions) +// DeleteSubnetReservedIP : Delete a reserved IP +// This request releases a reserved IP. This operation cannot be reversed. +// +// For this request to succeed, the reserved IP must not be required by another resource, such as a bare metal server +// network interface, instance network interface or virtual network interface for which it is the primary IP. A +// provider-owned reserved IP is not allowed to be deleted. +func (vpc *VpcV1) DeleteSubnetReservedIP(deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSubnetReservedIPWithContext(context.Background(), deleteSubnetReservedIPOptions) } -// DeleteSubnetWithContext is an alternate form of the DeleteSubnet method which supports a Context parameter -func (vpc *VpcV1) DeleteSubnetWithContext(ctx context.Context, deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSubnetOptions, "deleteSubnetOptions cannot be nil") +// DeleteSubnetReservedIPWithContext is an alternate form of the DeleteSubnetReservedIP method which supports a Context parameter +func (vpc *VpcV1) DeleteSubnetReservedIPWithContext(ctx context.Context, deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSubnetOptions, "deleteSubnetOptions") + err = core.ValidateStruct(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteSubnetOptions.ID, + "subnet_id": *deleteSubnetReservedIPOptions.SubnetID, + "id": *deleteSubnetReservedIPOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSubnetOptions.Headers { + for headerName, headerValue := range deleteSubnetReservedIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnet") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnetReservedIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -2798,55 +2863,48 @@ func (vpc *VpcV1) GetSubnetWithContext(ctx context.Context, getSubnetOptions *Ge return } -// UpdateSubnet : Update a subnet -// This request updates a subnet with the information in a provided subnet patch. The subnet patch object is structured -// in the same way as a retrieved subnet and contains only the information to be updated. -func (vpc *VpcV1) UpdateSubnet(updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - return vpc.UpdateSubnetWithContext(context.Background(), updateSubnetOptions) +// GetSubnetNetworkACL : Retrieve a subnet's attached network ACL +// This request retrieves the network ACL attached to the subnet specified by the identifier in the URL. +func (vpc *VpcV1) GetSubnetNetworkACL(getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.GetSubnetNetworkACLWithContext(context.Background(), getSubnetNetworkACLOptions) } -// UpdateSubnetWithContext is an alternate form of the UpdateSubnet method which supports a Context parameter -func (vpc *VpcV1) UpdateSubnetWithContext(ctx context.Context, updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSubnetOptions, "updateSubnetOptions cannot be nil") +// GetSubnetNetworkACLWithContext is an alternate form of the GetSubnetNetworkACL method which supports a Context parameter +func (vpc *VpcV1) GetSubnetNetworkACLWithContext(ctx context.Context, getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSubnetOptions, "updateSubnetOptions") + err = core.ValidateStruct(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateSubnetOptions.ID, + "id": *getSubnetNetworkACLOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateSubnetOptions.Headers { + for headerName, headerValue := range getSubnetNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSubnet") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSubnetOptions.SubnetPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -2858,7 +2916,7 @@ func (vpc *VpcV1) UpdateSubnetWithContext(ctx context.Context, updateSubnetOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -2868,40 +2926,40 @@ func (vpc *VpcV1) UpdateSubnetWithContext(ctx context.Context, updateSubnetOptio return } -// GetSubnetNetworkACL : Retrieve a subnet's attached network ACL -// This request retrieves the network ACL attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetNetworkACL(getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetSubnetNetworkACLWithContext(context.Background(), getSubnetNetworkACLOptions) +// GetSubnetPublicGateway : Retrieve a subnet's attached public gateway +// This request retrieves the public gateway attached to the subnet specified by the identifier in the URL. +func (vpc *VpcV1) GetSubnetPublicGateway(getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.GetSubnetPublicGatewayWithContext(context.Background(), getSubnetPublicGatewayOptions) } -// GetSubnetNetworkACLWithContext is an alternate form of the GetSubnetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetSubnetNetworkACLWithContext(ctx context.Context, getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions cannot be nil") +// GetSubnetPublicGatewayWithContext is an alternate form of the GetSubnetPublicGateway method which supports a Context parameter +func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions") + err = core.ValidateStruct(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSubnetNetworkACLOptions.ID, + "id": *getSubnetPublicGatewayOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSubnetNetworkACLOptions.Headers { + for headerName, headerValue := range getSubnetPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetPublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -2921,7 +2979,7 @@ func (vpc *VpcV1) GetSubnetNetworkACLWithContext(ctx context.Context, getSubnetN return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -2931,54 +2989,49 @@ func (vpc *VpcV1) GetSubnetNetworkACLWithContext(ctx context.Context, getSubnetN return } -// ReplaceSubnetNetworkACL : Replace the network ACL for a subnet -// This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. -func (vpc *VpcV1) ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.ReplaceSubnetNetworkACLWithContext(context.Background(), replaceSubnetNetworkACLOptions) +// GetSubnetReservedIP : Retrieve a reserved IP +// This request retrieves a single reserved IP specified by the identifier in the URL. +func (vpc *VpcV1) GetSubnetReservedIP(getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.GetSubnetReservedIPWithContext(context.Background(), getSubnetReservedIPOptions) } -// ReplaceSubnetNetworkACLWithContext is an alternate form of the ReplaceSubnetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) ReplaceSubnetNetworkACLWithContext(ctx context.Context, replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions cannot be nil") +// GetSubnetReservedIPWithContext is an alternate form of the GetSubnetReservedIP method which supports a Context parameter +func (vpc *VpcV1) GetSubnetReservedIPWithContext(ctx context.Context, getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSubnetReservedIPOptions, "getSubnetReservedIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions") + err = core.ValidateStruct(getSubnetReservedIPOptions, "getSubnetReservedIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *replaceSubnetNetworkACLOptions.ID, + "subnet_id": *getSubnetReservedIPOptions.SubnetID, + "id": *getSubnetReservedIPOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range replaceSubnetNetworkACLOptions.Headers { + for headerName, headerValue := range getSubnetReservedIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceSubnetNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetReservedIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(replaceSubnetNetworkACLOptions.NetworkACLIdentity) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -2990,7 +3043,7 @@ func (vpc *VpcV1) ReplaceSubnetNetworkACLWithContext(ctx context.Context, replac return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) if err != nil { return } @@ -3000,43 +3053,44 @@ func (vpc *VpcV1) ReplaceSubnetNetworkACLWithContext(ctx context.Context, replac return } -// UnsetSubnetPublicGateway : Detach a public gateway from a subnet -// This request detaches the public gateway from the subnet specified by the subnet identifier in the URL. -func (vpc *VpcV1) UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.UnsetSubnetPublicGatewayWithContext(context.Background(), unsetSubnetPublicGatewayOptions) +// GetSubnetRoutingTable : Retrieve a subnet's attached routing table +// This request retrieves the routing table attached to the subnet specified by the identifier in the URL. +func (vpc *VpcV1) GetSubnetRoutingTable(getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + return vpc.GetSubnetRoutingTableWithContext(context.Background(), getSubnetRoutingTableOptions) } -// UnsetSubnetPublicGatewayWithContext is an alternate form of the UnsetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) UnsetSubnetPublicGatewayWithContext(ctx context.Context, unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions cannot be nil") +// GetSubnetRoutingTableWithContext is an alternate form of the GetSubnetRoutingTable method which supports a Context parameter +func (vpc *VpcV1) GetSubnetRoutingTableWithContext(ctx context.Context, getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions") + err = core.ValidateStruct(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *unsetSubnetPublicGatewayOptions.ID, + "id": *getSubnetRoutingTableOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/routing_table`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range unsetSubnetPublicGatewayOptions.Headers { + for headerName, headerValue := range getSubnetRoutingTableOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UnsetSubnetPublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetRoutingTable") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -3046,45 +3100,57 @@ func (vpc *VpcV1) UnsetSubnetPublicGatewayWithContext(ctx context.Context, unset return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) + if err != nil { + return + } + response.Result = result + } return } -// GetSubnetPublicGateway : Retrieve a subnet's attached public gateway -// This request retrieves the public gateway attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetPublicGateway(getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.GetSubnetPublicGatewayWithContext(context.Background(), getSubnetPublicGatewayOptions) +// ListSubnetReservedIps : List all reserved IPs in a subnet +// This request lists all reserved IPs in a subnet. A reserved IP resource will exist for every address in the subnet +// which is not available for use. +func (vpc *VpcV1) ListSubnetReservedIps(listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { + return vpc.ListSubnetReservedIpsWithContext(context.Background(), listSubnetReservedIpsOptions) } -// GetSubnetPublicGatewayWithContext is an alternate form of the GetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions cannot be nil") +// ListSubnetReservedIpsWithContext is an alternate form of the ListSubnetReservedIps method which supports a Context parameter +func (vpc *VpcV1) ListSubnetReservedIpsWithContext(ctx context.Context, listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions") + err = core.ValidateStruct(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSubnetPublicGatewayOptions.ID, + "subnet_id": *listSubnetReservedIpsOptions.SubnetID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSubnetPublicGatewayOptions.Headers { + for headerName, headerValue := range listSubnetReservedIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetPublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnetReservedIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -3092,6 +3158,27 @@ func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubn builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSubnetReservedIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSubnetReservedIpsOptions.Start)) + } + if listSubnetReservedIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSubnetReservedIpsOptions.Limit)) + } + if listSubnetReservedIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listSubnetReservedIpsOptions.Sort)) + } + if listSubnetReservedIpsOptions.TargetID != nil { + builder.AddQuery("target.id", fmt.Sprint(*listSubnetReservedIpsOptions.TargetID)) + } + if listSubnetReservedIpsOptions.TargetCRN != nil { + builder.AddQuery("target.crn", fmt.Sprint(*listSubnetReservedIpsOptions.TargetCRN)) + } + if listSubnetReservedIpsOptions.TargetName != nil { + builder.AddQuery("target.name", fmt.Sprint(*listSubnetReservedIpsOptions.TargetName)) + } + if listSubnetReservedIpsOptions.TargetResourceType != nil { + builder.AddQuery("target.resource_type", fmt.Sprint(*listSubnetReservedIpsOptions.TargetResourceType)) + } request, err := builder.Build() if err != nil { @@ -3104,7 +3191,7 @@ func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubn return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollection) if err != nil { return } @@ -3114,53 +3201,66 @@ func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubn return } -// SetSubnetPublicGateway : Attach a public gateway to a subnet -// This request attaches the public gateway, specified in the request body, to the subnet specified by the subnet -// identifier in the URL. The public gateway must have the same VPC and zone as the subnet. -func (vpc *VpcV1) SetSubnetPublicGateway(setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.SetSubnetPublicGatewayWithContext(context.Background(), setSubnetPublicGatewayOptions) +// ListSubnets : List all subnets +// This request lists all subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block +// notation. Each subnet is within a particular zone and cannot span multiple zones or regions. +func (vpc *VpcV1) ListSubnets(listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { + return vpc.ListSubnetsWithContext(context.Background(), listSubnetsOptions) } -// SetSubnetPublicGatewayWithContext is an alternate form of the SetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) SetSubnetPublicGatewayWithContext(ctx context.Context, setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions") +// ListSubnetsWithContext is an alternate form of the ListSubnets method which supports a Context parameter +func (vpc *VpcV1) ListSubnetsWithContext(ctx context.Context, listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSubnetsOptions, "listSubnetsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *setSubnetPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) if err != nil { return } - for headerName, headerValue := range setSubnetPublicGatewayOptions.Headers { + for headerName, headerValue := range listSubnetsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "SetSubnetPublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnets") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(setSubnetPublicGatewayOptions.PublicGatewayIdentity) - if err != nil { - return + if listSubnetsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSubnetsOptions.Start)) + } + if listSubnetsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSubnetsOptions.Limit)) + } + if listSubnetsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSubnetsOptions.ResourceGroupID)) + } + if listSubnetsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listSubnetsOptions.ZoneName)) + } + if listSubnetsOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listSubnetsOptions.VPCID)) + } + if listSubnetsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listSubnetsOptions.VPCCRN)) + } + if listSubnetsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listSubnetsOptions.VPCName)) + } + if listSubnetsOptions.RoutingTableID != nil { + builder.AddQuery("routing_table.id", fmt.Sprint(*listSubnetsOptions.RoutingTableID)) + } + if listSubnetsOptions.RoutingTableName != nil { + builder.AddQuery("routing_table.name", fmt.Sprint(*listSubnetsOptions.RoutingTableName)) } request, err := builder.Build() @@ -3174,7 +3274,7 @@ func (vpc *VpcV1) SetSubnetPublicGatewayWithContext(ctx context.Context, setSubn return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnetCollection) if err != nil { return } @@ -3184,60 +3284,66 @@ func (vpc *VpcV1) SetSubnetPublicGatewayWithContext(ctx context.Context, setSubn return } -// GetSubnetRoutingTable : Retrieve a subnet's attached routing table -// This request retrieves the routing table attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetRoutingTable(getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetSubnetRoutingTableWithContext(context.Background(), getSubnetRoutingTableOptions) +// ReplaceSubnetNetworkACL : Replace the network ACL for a subnet +// This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. +func (vpc *VpcV1) ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.ReplaceSubnetNetworkACLWithContext(context.Background(), replaceSubnetNetworkACLOptions) } -// GetSubnetRoutingTableWithContext is an alternate form of the GetSubnetRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetSubnetRoutingTableWithContext(ctx context.Context, getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions cannot be nil") +// ReplaceSubnetNetworkACLWithContext is an alternate form of the ReplaceSubnetNetworkACL method which supports a Context parameter +func (vpc *VpcV1) ReplaceSubnetNetworkACLWithContext(ctx context.Context, replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions") + err = core.ValidateStruct(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSubnetRoutingTableOptions.ID, + "id": *replaceSubnetNetworkACLOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/routing_table`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSubnetRoutingTableOptions.Headers { + for headerName, headerValue := range replaceSubnetNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetRoutingTable") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceSubnetNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() + _, err = builder.SetBodyContentJSON(replaceSubnetNetworkACLOptions.NetworkACLIdentity) if err != nil { return } - var rawResponse map[string]json.RawMessage + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -3251,7 +3357,7 @@ func (vpc *VpcV1) GetSubnetRoutingTableWithContext(ctx context.Context, getSubne // This request replaces the existing routing table for a subnet with the routing table specified in the request body. // // For this request to succeed, the routing table `route_direct_link_ingress`, -// `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. +// `route_internet_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. func (vpc *VpcV1) ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { return vpc.ReplaceSubnetRoutingTableWithContext(context.Background(), replaceSubnetRoutingTableOptions) } @@ -3319,114 +3425,41 @@ func (vpc *VpcV1) ReplaceSubnetRoutingTableWithContext(ctx context.Context, repl return } -// ListSubnetReservedIps : List all reserved IPs in a subnet -// This request lists all reserved IPs in a subnet. A reserved IP resource will exist for every address in the subnet -// which is not available for use. -func (vpc *VpcV1) ListSubnetReservedIps(listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { - return vpc.ListSubnetReservedIpsWithContext(context.Background(), listSubnetReservedIpsOptions) -} - -// ListSubnetReservedIpsWithContext is an alternate form of the ListSubnetReservedIps method which supports a Context parameter -func (vpc *VpcV1) ListSubnetReservedIpsWithContext(ctx context.Context, listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *listSubnetReservedIpsOptions.SubnetID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listSubnetReservedIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnetReservedIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSubnetReservedIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSubnetReservedIpsOptions.Start)) - } - if listSubnetReservedIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSubnetReservedIpsOptions.Limit)) - } - if listSubnetReservedIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSubnetReservedIpsOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSubnetReservedIP : Reserve an IP in a subnet -// This request reserves an IP address in a subnet. If the provided prototype object includes an `address`, the address -// must not already be reserved. -func (vpc *VpcV1) CreateSubnetReservedIP(createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.CreateSubnetReservedIPWithContext(context.Background(), createSubnetReservedIPOptions) +// SetSubnetPublicGateway : Attach a public gateway to a subnet +// This request attaches the public gateway, specified in the request body, to the subnet specified by the subnet +// identifier in the URL. The public gateway must have the same VPC and zone as the subnet. +func (vpc *VpcV1) SetSubnetPublicGateway(setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.SetSubnetPublicGatewayWithContext(context.Background(), setSubnetPublicGatewayOptions) } -// CreateSubnetReservedIPWithContext is an alternate form of the CreateSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSubnetReservedIPOptions, "createSubnetReservedIPOptions cannot be nil") +// SetSubnetPublicGatewayWithContext is an alternate form of the SetSubnetPublicGateway method which supports a Context parameter +func (vpc *VpcV1) SetSubnetPublicGatewayWithContext(ctx context.Context, setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSubnetReservedIPOptions, "createSubnetReservedIPOptions") + err = core.ValidateStruct(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "subnet_id": *createSubnetReservedIPOptions.SubnetID, + "id": *setSubnetPublicGatewayOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSubnetReservedIPOptions.Headers { + for headerName, headerValue := range setSubnetPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnetReservedIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "SetSubnetPublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -3436,20 +3469,7 @@ func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createS builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createSubnetReservedIPOptions.Address != nil { - body["address"] = createSubnetReservedIPOptions.Address - } - if createSubnetReservedIPOptions.AutoDelete != nil { - body["auto_delete"] = createSubnetReservedIPOptions.AutoDelete - } - if createSubnetReservedIPOptions.Name != nil { - body["name"] = createSubnetReservedIPOptions.Name - } - if createSubnetReservedIPOptions.Target != nil { - body["target"] = createSubnetReservedIPOptions.Target - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(setSubnetPublicGatewayOptions.PublicGatewayIdentity) if err != nil { return } @@ -3465,7 +3485,7 @@ func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createS return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -3475,45 +3495,40 @@ func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createS return } -// DeleteSubnetReservedIP : Delete a reserved IP -// This request releases a reserved IP. This operation cannot be reversed. -// -// For this request to succeed, the reserved IP must not be required by another resource, such as a bare metal server -// network interface or instance network interface for which it is the primary IP. A provider-owned reserved IP is not -// allowed to be deleted. -func (vpc *VpcV1) DeleteSubnetReservedIP(deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSubnetReservedIPWithContext(context.Background(), deleteSubnetReservedIPOptions) +// UnsetSubnetPublicGateway : Detach a public gateway from a subnet +// This request detaches the public gateway from the subnet specified by the subnet identifier in the URL. +func (vpc *VpcV1) UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.UnsetSubnetPublicGatewayWithContext(context.Background(), unsetSubnetPublicGatewayOptions) } -// DeleteSubnetReservedIPWithContext is an alternate form of the DeleteSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) DeleteSubnetReservedIPWithContext(ctx context.Context, deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions cannot be nil") +// UnsetSubnetPublicGatewayWithContext is an alternate form of the UnsetSubnetPublicGateway method which supports a Context parameter +func (vpc *VpcV1) UnsetSubnetPublicGatewayWithContext(ctx context.Context, unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions") + err = core.ValidateStruct(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "subnet_id": *deleteSubnetReservedIPOptions.SubnetID, - "id": *deleteSubnetReservedIPOptions.ID, + "id": *unsetSubnetPublicGatewayOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSubnetReservedIPOptions.Headers { + for headerName, headerValue := range unsetSubnetPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnetReservedIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UnsetSubnetPublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -3531,49 +3546,55 @@ func (vpc *VpcV1) DeleteSubnetReservedIPWithContext(ctx context.Context, deleteS return } -// GetSubnetReservedIP : Retrieve a reserved IP -// This request retrieves a single reserved IP specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetReservedIP(getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetSubnetReservedIPWithContext(context.Background(), getSubnetReservedIPOptions) +// UpdateSubnet : Update a subnet +// This request updates a subnet with the information in a provided subnet patch. The subnet patch object is structured +// in the same way as a retrieved subnet and contains only the information to be updated. +func (vpc *VpcV1) UpdateSubnet(updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { + return vpc.UpdateSubnetWithContext(context.Background(), updateSubnetOptions) } -// GetSubnetReservedIPWithContext is an alternate form of the GetSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) GetSubnetReservedIPWithContext(ctx context.Context, getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetReservedIPOptions, "getSubnetReservedIPOptions cannot be nil") +// UpdateSubnetWithContext is an alternate form of the UpdateSubnet method which supports a Context parameter +func (vpc *VpcV1) UpdateSubnetWithContext(ctx context.Context, updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSubnetOptions, "updateSubnetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSubnetReservedIPOptions, "getSubnetReservedIPOptions") + err = core.ValidateStruct(updateSubnetOptions, "updateSubnetOptions") if err != nil { return } pathParamsMap := map[string]string{ - "subnet_id": *getSubnetReservedIPOptions.SubnetID, - "id": *getSubnetReservedIPOptions.ID, + "id": *updateSubnetOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSubnetReservedIPOptions.Headers { + for headerName, headerValue := range updateSubnetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetReservedIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSubnet") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateSubnetOptions.SubnetPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -3585,7 +3606,7 @@ func (vpc *VpcV1) GetSubnetReservedIPWithContext(ctx context.Context, getSubnetR return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) if err != nil { return } @@ -3668,21 +3689,27 @@ func (vpc *VpcV1) UpdateSubnetReservedIPWithContext(ctx context.Context, updateS return } -// ListImages : List all images -// This request lists all images available in the region. An image provides source data for a volume. Images are either -// system-provided, or created from another source, such as importing from Cloud Object Storage. -func (vpc *VpcV1) ListImages(listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { - return vpc.ListImagesWithContext(context.Background(), listImagesOptions) +// CreateImage : Create an image +// This request creates a new image from an image prototype object. The prototype object is structured in the same way +// as a retrieved image, and contains the information necessary to create the new image. If an image is being imported, +// a URL to the image file on object storage must be specified. If an image is being created from an existing volume, +// that volume must be specified. +func (vpc *VpcV1) CreateImage(createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { + return vpc.CreateImageWithContext(context.Background(), createImageOptions) } -// ListImagesWithContext is an alternate form of the ListImages method which supports a Context parameter -func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listImagesOptions, "listImagesOptions") +// CreateImageWithContext is an alternate form of the CreateImage method which supports a Context parameter +func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createImageOptions, "createImageOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createImageOptions, "createImageOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images`, nil) @@ -3690,35 +3717,23 @@ func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions * return } - for headerName, headerValue := range listImagesOptions.Headers { + for headerName, headerValue := range createImageOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImages") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImage") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listImagesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listImagesOptions.Start)) - } - if listImagesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listImagesOptions.Limit)) - } - if listImagesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listImagesOptions.ResourceGroupID)) - } - if listImagesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listImagesOptions.Name)) - } - if listImagesOptions.Status != nil { - builder.AddQuery("status", strings.Join(listImagesOptions.Status, ",")) - } - if listImagesOptions.Visibility != nil { - builder.AddQuery("visibility", fmt.Sprint(*listImagesOptions.Visibility)) + + _, err = builder.SetBodyContentJSON(createImageOptions.ImagePrototype) + if err != nil { + return } request, err := builder.Build() @@ -3732,7 +3747,7 @@ func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions * return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) if err != nil { return } @@ -3742,39 +3757,43 @@ func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions * return } -// CreateImage : Create an image -// This request creates a new image from an image prototype object. The prototype object is structured in the same way -// as a retrieved image, and contains the information necessary to create the new image. If an image is being imported, -// a URL to the image file on object storage must be specified. If an image is being created from an existing volume, -// that volume must be specified. -func (vpc *VpcV1) CreateImage(createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.CreateImageWithContext(context.Background(), createImageOptions) +// CreateImageExportJob : Create an image export job +// This request creates and queues a new export job for the image specified in the URL using the image export job +// prototype object. The image must be owned by the account and be in the `available`, `deprecated`, `obsolete`, or +// `unusable` state. The prototype object is structured in the same way as a retrieved image export job, and contains +// the information necessary to create and queue the new image export job. +func (vpc *VpcV1) CreateImageExportJob(createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + return vpc.CreateImageExportJobWithContext(context.Background(), createImageExportJobOptions) } -// CreateImageWithContext is an alternate form of the CreateImage method which supports a Context parameter -func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createImageOptions, "createImageOptions cannot be nil") +// CreateImageExportJobWithContext is an alternate form of the CreateImageExportJob method which supports a Context parameter +func (vpc *VpcV1) CreateImageExportJobWithContext(ctx context.Context, createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createImageExportJobOptions, "createImageExportJobOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createImageOptions, "createImageOptions") + err = core.ValidateStruct(createImageExportJobOptions, "createImageExportJobOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "image_id": *createImageExportJobOptions.ImageID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createImageOptions.Headers { + for headerName, headerValue := range createImageExportJobOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImage") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImageExportJob") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -3784,7 +3803,17 @@ func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createImageOptions.ImagePrototype) + body := make(map[string]interface{}) + if createImageExportJobOptions.StorageBucket != nil { + body["storage_bucket"] = createImageExportJobOptions.StorageBucket + } + if createImageExportJobOptions.Format != nil { + body["format"] = createImageExportJobOptions.Format + } + if createImageExportJobOptions.Name != nil { + body["name"] = createImageExportJobOptions.Name + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -3800,7 +3829,7 @@ func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) if err != nil { return } @@ -3865,136 +3894,56 @@ func (vpc *VpcV1) DeleteImageWithContext(ctx context.Context, deleteImageOptions return } -// GetImage : Retrieve an image -// This request retrieves a single image specified by the identifier in the URL. -func (vpc *VpcV1) GetImage(getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.GetImageWithContext(context.Background(), getImageOptions) -} - -// GetImageWithContext is an alternate form of the GetImage method which supports a Context parameter -func (vpc *VpcV1) GetImageWithContext(ctx context.Context, getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getImageOptions, "getImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getImageOptions, "getImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateImage : Update an image -// This request updates an image with the information in a provided image patch. The image patch object is structured in -// the same way as a retrieved image and contains only the information to be updated. A system-provided image is not -// allowed to be updated. An image with a `status` of `deleting` cannot be updated. -func (vpc *VpcV1) UpdateImage(updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.UpdateImageWithContext(context.Background(), updateImageOptions) +// DeleteImageExportJob : Delete an image export job +// This request deletes an image export job. This operation cannot be reversed. If the job has not completed, the job +// will be canceled, and the incomplete exported image object deleted. If the job has completed, the exported image +// object will not be deleted. +func (vpc *VpcV1) DeleteImageExportJob(deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteImageExportJobWithContext(context.Background(), deleteImageExportJobOptions) } -// UpdateImageWithContext is an alternate form of the UpdateImage method which supports a Context parameter -func (vpc *VpcV1) UpdateImageWithContext(ctx context.Context, updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateImageOptions, "updateImageOptions cannot be nil") +// DeleteImageExportJobWithContext is an alternate form of the DeleteImageExportJob method which supports a Context parameter +func (vpc *VpcV1) DeleteImageExportJobWithContext(ctx context.Context, deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteImageExportJobOptions, "deleteImageExportJobOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateImageOptions, "updateImageOptions") + err = core.ValidateStruct(deleteImageExportJobOptions, "deleteImageExportJobOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateImageOptions.ID, + "image_id": *deleteImageExportJobOptions.ImageID, + "id": *deleteImageExportJobOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateImageOptions.Headers { + for headerName, headerValue := range deleteImageExportJobOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImage") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteImageExportJob") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateImageOptions.ImagePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } @@ -4061,52 +4010,44 @@ func (vpc *VpcV1) DeprecateImageWithContext(ctx context.Context, deprecateImageO return } -// ObsoleteImage : Obsolete an image -// This request obsoletes an image, resulting in its `status` becoming `obsolete` and -// `obsolescence_at` being set to the current date and time. -// -// The image must: -// - have a `status` of `available` or `deprecated` -// - have `catalog_offering.managed` set to `false` -// - not have `deprecation_at` set in the future -// - not have `obsolescence_at` set -// -// A system-provided image is not allowed to be obsoleted. -func (vpc *VpcV1) ObsoleteImage(obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { - return vpc.ObsoleteImageWithContext(context.Background(), obsoleteImageOptions) +// GetImage : Retrieve an image +// This request retrieves a single image specified by the identifier in the URL. +func (vpc *VpcV1) GetImage(getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { + return vpc.GetImageWithContext(context.Background(), getImageOptions) } -// ObsoleteImageWithContext is an alternate form of the ObsoleteImage method which supports a Context parameter -func (vpc *VpcV1) ObsoleteImageWithContext(ctx context.Context, obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(obsoleteImageOptions, "obsoleteImageOptions cannot be nil") +// GetImageWithContext is an alternate form of the GetImage method which supports a Context parameter +func (vpc *VpcV1) GetImageWithContext(ctx context.Context, getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getImageOptions, "getImageOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(obsoleteImageOptions, "obsoleteImageOptions") + err = core.ValidateStruct(getImageOptions, "getImageOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *obsoleteImageOptions.ID, + "id": *getImageOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}/obsolete`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range obsoleteImageOptions.Headers { + for headerName, headerValue := range getImageOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ObsoleteImage") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImage") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -4116,50 +4057,57 @@ func (vpc *VpcV1) ObsoleteImageWithContext(ctx context.Context, obsoleteImageOpt return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) + if err != nil { + return + } + response.Result = result + } return } -// ListImageExportJobs : List all image export jobs -// This request lists all export jobs for an image. Each job tracks the exporting of the image to another location, such -// as a bucket within cloud object storage. -// -// The jobs will be sorted by their `created_at` property values, with newest jobs first. Jobs with identical -// `created_at` property values will in turn be sorted by ascending -// `name` property values. -func (vpc *VpcV1) ListImageExportJobs(listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListImageExportJobsWithContext(context.Background(), listImageExportJobsOptions) +// GetImageExportJob : Retrieve an image export job +// This request retrieves a single image export job specified by the identifier in the URL. +func (vpc *VpcV1) GetImageExportJob(getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + return vpc.GetImageExportJobWithContext(context.Background(), getImageExportJobOptions) } -// ListImageExportJobsWithContext is an alternate form of the ListImageExportJobs method which supports a Context parameter -func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listImageExportJobsOptions, "listImageExportJobsOptions cannot be nil") +// GetImageExportJobWithContext is an alternate form of the GetImageExportJob method which supports a Context parameter +func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getImageExportJobOptions, "getImageExportJobOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listImageExportJobsOptions, "listImageExportJobsOptions") + err = core.ValidateStruct(getImageExportJobOptions, "getImageExportJobOptions") if err != nil { return } pathParamsMap := map[string]string{ - "image_id": *listImageExportJobsOptions.ImageID, + "image_id": *getImageExportJobOptions.ImageID, + "id": *getImageExportJobOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listImageExportJobsOptions.Headers { + for headerName, headerValue := range getImageExportJobOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImageExportJobs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImageExportJob") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -4167,9 +4115,6 @@ func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageE builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listImageExportJobsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listImageExportJobsOptions.Name)) - } request, err := builder.Build() if err != nil { @@ -4182,7 +4127,7 @@ func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageE return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJobUnpaginatedCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) if err != nil { return } @@ -4192,67 +4137,48 @@ func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageE return } -// CreateImageExportJob : Create an image export job -// This request creates and queues a new export job for the image specified in the URL using the image export job -// prototype object. The image must be owned by the account and be in the `available`, `deprecated`, `obsolete`, or -// `unusable` state. The prototype object is structured in the same way as a retrieved image export job, and contains -// the information necessary to create and queue the new image export job. -func (vpc *VpcV1) CreateImageExportJob(createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.CreateImageExportJobWithContext(context.Background(), createImageExportJobOptions) +// GetOperatingSystem : Retrieve an operating system +// This request retrieves a single operating system specified by the name in the URL. +func (vpc *VpcV1) GetOperatingSystem(getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { + return vpc.GetOperatingSystemWithContext(context.Background(), getOperatingSystemOptions) } -// CreateImageExportJobWithContext is an alternate form of the CreateImageExportJob method which supports a Context parameter -func (vpc *VpcV1) CreateImageExportJobWithContext(ctx context.Context, createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createImageExportJobOptions, "createImageExportJobOptions cannot be nil") +// GetOperatingSystemWithContext is an alternate form of the GetOperatingSystem method which supports a Context parameter +func (vpc *VpcV1) GetOperatingSystemWithContext(ctx context.Context, getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getOperatingSystemOptions, "getOperatingSystemOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createImageExportJobOptions, "createImageExportJobOptions") + err = core.ValidateStruct(getOperatingSystemOptions, "getOperatingSystemOptions") if err != nil { return } pathParamsMap := map[string]string{ - "image_id": *createImageExportJobOptions.ImageID, + "name": *getOperatingSystemOptions.Name, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createImageExportJobOptions.Headers { + for headerName, headerValue := range getOperatingSystemOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImageExportJob") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetOperatingSystem") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createImageExportJobOptions.StorageBucket != nil { - body["storage_bucket"] = createImageExportJobOptions.StorageBucket - } - if createImageExportJobOptions.Format != nil { - body["format"] = createImageExportJobOptions.Format - } - if createImageExportJobOptions.Name != nil { - body["name"] = createImageExportJobOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -4264,7 +4190,7 @@ func (vpc *VpcV1) CreateImageExportJobWithContext(ctx context.Context, createIma return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystem) if err != nil { return } @@ -4274,95 +4200,104 @@ func (vpc *VpcV1) CreateImageExportJobWithContext(ctx context.Context, createIma return } -// DeleteImageExportJob : Delete an image export job -// This request deletes an image export job. This operation cannot be reversed. If the job has not completed, the job -// will be canceled, and the incomplete exported image object deleted. If the job has completed, the exported image -// object will not be deleted. -func (vpc *VpcV1) DeleteImageExportJob(deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteImageExportJobWithContext(context.Background(), deleteImageExportJobOptions) +// ListImageExportJobs : List all image export jobs +// This request lists all export jobs for an image. Each job tracks the exporting of the image to another location, such +// as a bucket within cloud object storage. +// +// The jobs will be sorted by their `created_at` property values, with newest jobs first. Jobs with identical +// `created_at` property values will in turn be sorted by ascending +// `name` property values. +func (vpc *VpcV1) ListImageExportJobs(listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { + return vpc.ListImageExportJobsWithContext(context.Background(), listImageExportJobsOptions) } -// DeleteImageExportJobWithContext is an alternate form of the DeleteImageExportJob method which supports a Context parameter -func (vpc *VpcV1) DeleteImageExportJobWithContext(ctx context.Context, deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteImageExportJobOptions, "deleteImageExportJobOptions cannot be nil") +// ListImageExportJobsWithContext is an alternate form of the ListImageExportJobs method which supports a Context parameter +func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listImageExportJobsOptions, "listImageExportJobsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteImageExportJobOptions, "deleteImageExportJobOptions") + err = core.ValidateStruct(listImageExportJobsOptions, "listImageExportJobsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "image_id": *deleteImageExportJobOptions.ImageID, - "id": *deleteImageExportJobOptions.ID, + "image_id": *listImageExportJobsOptions.ImageID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteImageExportJobOptions.Headers { + for headerName, headerValue := range listImageExportJobsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteImageExportJob") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImageExportJobs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listImageExportJobsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listImageExportJobsOptions.Name)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJobUnpaginatedCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetImageExportJob : Retrieve an image export job -// This request retrieves a single image export job specified by the identifier in the URL. -func (vpc *VpcV1) GetImageExportJob(getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.GetImageExportJobWithContext(context.Background(), getImageExportJobOptions) +// ListImages : List all images +// This request lists all images available in the region. An image provides source data for a volume. Images are either +// system-provided, or created from another source, such as importing from Cloud Object Storage. +func (vpc *VpcV1) ListImages(listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { + return vpc.ListImagesWithContext(context.Background(), listImagesOptions) } -// GetImageExportJobWithContext is an alternate form of the GetImageExportJob method which supports a Context parameter -func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getImageExportJobOptions, "getImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getImageExportJobOptions, "getImageExportJobOptions") +// ListImagesWithContext is an alternate form of the ListImages method which supports a Context parameter +func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listImagesOptions, "listImagesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "image_id": *getImageExportJobOptions.ImageID, - "id": *getImageExportJobOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images`, nil) if err != nil { return } - for headerName, headerValue := range getImageExportJobOptions.Headers { + for headerName, headerValue := range listImagesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImageExportJob") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImages") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -4370,6 +4305,24 @@ func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExpo builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listImagesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listImagesOptions.Start)) + } + if listImagesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listImagesOptions.Limit)) + } + if listImagesOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listImagesOptions.ResourceGroupID)) + } + if listImagesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listImagesOptions.Name)) + } + if listImagesOptions.Status != nil { + builder.AddQuery("status", strings.Join(listImagesOptions.Status, ",")) + } + if listImagesOptions.Visibility != nil { + builder.AddQuery("visibility", fmt.Sprint(*listImagesOptions.Visibility)) + } request, err := builder.Build() if err != nil { @@ -4382,7 +4335,7 @@ func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExpo return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageCollection) if err != nil { return } @@ -4392,55 +4345,44 @@ func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExpo return } -// UpdateImageExportJob : Update an image export job -// This request updates an image export job with the information in a provided image export job patch. The image export -// job patch object is structured in the same way as a retrieved image export job and contains only the information to -// be updated. -func (vpc *VpcV1) UpdateImageExportJob(updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.UpdateImageExportJobWithContext(context.Background(), updateImageExportJobOptions) +// ListOperatingSystems : List all operating systems +// This request lists all operating systems in the region. +func (vpc *VpcV1) ListOperatingSystems(listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { + return vpc.ListOperatingSystemsWithContext(context.Background(), listOperatingSystemsOptions) } -// UpdateImageExportJobWithContext is an alternate form of the UpdateImageExportJob method which supports a Context parameter -func (vpc *VpcV1) UpdateImageExportJobWithContext(ctx context.Context, updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateImageExportJobOptions, "updateImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateImageExportJobOptions, "updateImageExportJobOptions") +// ListOperatingSystemsWithContext is an alternate form of the ListOperatingSystems method which supports a Context parameter +func (vpc *VpcV1) ListOperatingSystemsWithContext(ctx context.Context, listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listOperatingSystemsOptions, "listOperatingSystemsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "image_id": *updateImageExportJobOptions.ImageID, - "id": *updateImageExportJobOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems`, nil) if err != nil { return } - for headerName, headerValue := range updateImageExportJobOptions.Headers { + for headerName, headerValue := range listOperatingSystemsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImageExportJob") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListOperatingSystems") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateImageExportJobOptions.ImageExportJobPatch) - if err != nil { - return + if listOperatingSystemsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listOperatingSystemsOptions.Start)) + } + if listOperatingSystemsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listOperatingSystemsOptions.Limit)) } request, err := builder.Build() @@ -4454,7 +4396,7 @@ func (vpc *VpcV1) UpdateImageExportJobWithContext(ctx context.Context, updateIma return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystemCollection) if err != nil { return } @@ -4464,109 +4406,116 @@ func (vpc *VpcV1) UpdateImageExportJobWithContext(ctx context.Context, updateIma return } -// ListOperatingSystems : List all operating systems -// This request lists all operating systems in the region. -func (vpc *VpcV1) ListOperatingSystems(listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { - return vpc.ListOperatingSystemsWithContext(context.Background(), listOperatingSystemsOptions) +// ObsoleteImage : Obsolete an image +// This request obsoletes an image, resulting in its `status` becoming `obsolete` and +// `obsolescence_at` being set to the current date and time. +// +// The image must: +// - have a `status` of `available` or `deprecated` +// - have `catalog_offering.managed` set to `false` +// - not have `deprecation_at` set in the future +// - not have `obsolescence_at` set +// +// A system-provided image is not allowed to be obsoleted. +func (vpc *VpcV1) ObsoleteImage(obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { + return vpc.ObsoleteImageWithContext(context.Background(), obsoleteImageOptions) } -// ListOperatingSystemsWithContext is an alternate form of the ListOperatingSystems method which supports a Context parameter -func (vpc *VpcV1) ListOperatingSystemsWithContext(ctx context.Context, listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listOperatingSystemsOptions, "listOperatingSystemsOptions") +// ObsoleteImageWithContext is an alternate form of the ObsoleteImage method which supports a Context parameter +func (vpc *VpcV1) ObsoleteImageWithContext(ctx context.Context, obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(obsoleteImageOptions, "obsoleteImageOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(obsoleteImageOptions, "obsoleteImageOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *obsoleteImageOptions.ID, + } + + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}/obsolete`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listOperatingSystemsOptions.Headers { + for headerName, headerValue := range obsoleteImageOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListOperatingSystems") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ObsoleteImage") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listOperatingSystemsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listOperatingSystemsOptions.Start)) - } - if listOperatingSystemsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listOperatingSystemsOptions.Limit)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystemCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// GetOperatingSystem : Retrieve an operating system -// This request retrieves a single operating system specified by the name in the URL. -func (vpc *VpcV1) GetOperatingSystem(getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { - return vpc.GetOperatingSystemWithContext(context.Background(), getOperatingSystemOptions) +// UpdateImage : Update an image +// This request updates an image with the information in a provided image patch. The image patch object is structured in +// the same way as a retrieved image and contains only the information to be updated. A system-provided image is not +// allowed to be updated. An image with a `status` of `deleting` cannot be updated. +func (vpc *VpcV1) UpdateImage(updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { + return vpc.UpdateImageWithContext(context.Background(), updateImageOptions) } -// GetOperatingSystemWithContext is an alternate form of the GetOperatingSystem method which supports a Context parameter -func (vpc *VpcV1) GetOperatingSystemWithContext(ctx context.Context, getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getOperatingSystemOptions, "getOperatingSystemOptions cannot be nil") +// UpdateImageWithContext is an alternate form of the UpdateImage method which supports a Context parameter +func (vpc *VpcV1) UpdateImageWithContext(ctx context.Context, updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateImageOptions, "updateImageOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getOperatingSystemOptions, "getOperatingSystemOptions") + err = core.ValidateStruct(updateImageOptions, "updateImageOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getOperatingSystemOptions.Name, + "id": *updateImageOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getOperatingSystemOptions.Headers { + for headerName, headerValue := range updateImageOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetOperatingSystem") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImage") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateImageOptions.ImagePatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -4578,7 +4527,7 @@ func (vpc *VpcV1) GetOperatingSystemWithContext(ctx context.Context, getOperatin return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystem) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) if err != nil { return } @@ -4588,45 +4537,55 @@ func (vpc *VpcV1) GetOperatingSystemWithContext(ctx context.Context, getOperatin return } -// ListKeys : List all keys -// This request lists all keys in the region. A key contains a public SSH key which may be installed on instances when -// they are created. Private keys are not stored. -func (vpc *VpcV1) ListKeys(listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { - return vpc.ListKeysWithContext(context.Background(), listKeysOptions) +// UpdateImageExportJob : Update an image export job +// This request updates an image export job with the information in a provided image export job patch. The image export +// job patch object is structured in the same way as a retrieved image export job and contains only the information to +// be updated. +func (vpc *VpcV1) UpdateImageExportJob(updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + return vpc.UpdateImageExportJobWithContext(context.Background(), updateImageExportJobOptions) } -// ListKeysWithContext is an alternate form of the ListKeys method which supports a Context parameter -func (vpc *VpcV1) ListKeysWithContext(ctx context.Context, listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listKeysOptions, "listKeysOptions") +// UpdateImageExportJobWithContext is an alternate form of the UpdateImageExportJob method which supports a Context parameter +func (vpc *VpcV1) UpdateImageExportJobWithContext(ctx context.Context, updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateImageExportJobOptions, "updateImageExportJobOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateImageExportJobOptions, "updateImageExportJobOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "image_id": *updateImageExportJobOptions.ImageID, + "id": *updateImageExportJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listKeysOptions.Headers { + for headerName, headerValue := range updateImageExportJobOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListKeys") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImageExportJob") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listKeysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listKeysOptions.Start)) - } - if listKeysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listKeysOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateImageExportJobOptions.ImageExportJobPatch) + if err != nil { + return } request, err := builder.Build() @@ -4640,7 +4599,7 @@ func (vpc *VpcV1) ListKeysWithContext(ctx context.Context, listKeysOptions *List return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKeyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) if err != nil { return } @@ -4844,52 +4803,45 @@ func (vpc *VpcV1) GetKeyWithContext(ctx context.Context, getKeyOptions *GetKeyOp return } -// UpdateKey : Update a key -// This request updates a key's name. -func (vpc *VpcV1) UpdateKey(updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - return vpc.UpdateKeyWithContext(context.Background(), updateKeyOptions) +// ListKeys : List all keys +// This request lists all keys in the region. A key contains a public SSH key which may be installed on instances when +// they are created. Private keys are not stored. +func (vpc *VpcV1) ListKeys(listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { + return vpc.ListKeysWithContext(context.Background(), listKeysOptions) } -// UpdateKeyWithContext is an alternate form of the UpdateKey method which supports a Context parameter -func (vpc *VpcV1) UpdateKeyWithContext(ctx context.Context, updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateKeyOptions, "updateKeyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateKeyOptions, "updateKeyOptions") +// ListKeysWithContext is an alternate form of the ListKeys method which supports a Context parameter +func (vpc *VpcV1) ListKeysWithContext(ctx context.Context, listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listKeysOptions, "listKeysOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateKeyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys`, nil) if err != nil { return } - for headerName, headerValue := range updateKeyOptions.Headers { + for headerName, headerValue := range listKeysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateKey") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListKeys") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateKeyOptions.KeyPatch) - if err != nil { - return + if listKeysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listKeysOptions.Start)) + } + if listKeysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listKeysOptions.Limit)) } request, err := builder.Build() @@ -4903,7 +4855,7 @@ func (vpc *VpcV1) UpdateKeyWithContext(ctx context.Context, updateKeyOptions *Up return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKey) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKeyCollection) if err != nil { return } @@ -4913,43 +4865,54 @@ func (vpc *VpcV1) UpdateKeyWithContext(ctx context.Context, updateKeyOptions *Up return } -// ListInstanceProfiles : List all instance profiles -// This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the -// region. An instance profile specifies the performance characteristics and pricing model for an instance. -func (vpc *VpcV1) ListInstanceProfiles(listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceProfilesWithContext(context.Background(), listInstanceProfilesOptions) +// UpdateKey : Update a key +// This request updates a key's name. +func (vpc *VpcV1) UpdateKey(updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { + return vpc.UpdateKeyWithContext(context.Background(), updateKeyOptions) } -// ListInstanceProfilesWithContext is an alternate form of the ListInstanceProfiles method which supports a Context parameter -func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceProfilesOptions, "listInstanceProfilesOptions") +// UpdateKeyWithContext is an alternate form of the UpdateKey method which supports a Context parameter +func (vpc *VpcV1) UpdateKeyWithContext(ctx context.Context, updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateKeyOptions, "updateKeyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateKeyOptions, "updateKeyOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *updateKeyOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceProfilesOptions.Headers { + for headerName, headerValue := range updateKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateKeyOptions.KeyPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -4961,7 +4924,7 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKey) if err != nil { return } @@ -4971,42 +4934,49 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta return } -// GetInstanceProfile : Retrieve an instance profile -// This request retrieves a single instance profile specified by the name in the URL. -func (vpc *VpcV1) GetInstanceProfile(getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { - return vpc.GetInstanceProfileWithContext(context.Background(), getInstanceProfileOptions) +// AddInstanceNetworkInterfaceFloatingIP : Associate a floating IP with an instance network interface +// This request associates the specified floating IP with the specified instance network interface, replacing any +// existing association. +// +// The existing floating IP must: +// - not be required by another resource, such as a public gateway +// - be in the same `zone` as the instance +// +// A request body is not required, and if provided, is ignored. +func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.AddInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), addInstanceNetworkInterfaceFloatingIPOptions) } -// GetInstanceProfileWithContext is an alternate form of the GetInstanceProfile method which supports a Context parameter -func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceProfileOptions, "getInstanceProfileOptions cannot be nil") +// AddInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the AddInstanceNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceProfileOptions, "getInstanceProfileOptions") + err = core.ValidateStruct(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getInstanceProfileOptions.Name, + "instance_id": *addInstanceNetworkInterfaceFloatingIPOptions.InstanceID, + "network_interface_id": *addInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *addInstanceNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceProfileOptions.Headers { + for headerName, headerValue := range addInstanceNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddInstanceNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -5026,7 +4996,7 @@ func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstance return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -5036,42 +5006,52 @@ func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstance return } -// ListInstanceTemplates : List all instance templates -// This request lists all instance templates in the region. -func (vpc *VpcV1) ListInstanceTemplates(listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceTemplatesWithContext(context.Background(), listInstanceTemplatesOptions) +// CreateInstance : Create an instance +// This request provisions a new instance from an instance prototype object. The prototype object is structured in the +// same way as a retrieved instance, and contains the information necessary to provision the new instance. The instance +// is automatically started. +func (vpc *VpcV1) CreateInstance(createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceWithContext(context.Background(), createInstanceOptions) } -// ListInstanceTemplatesWithContext is an alternate form of the ListInstanceTemplates method which supports a Context parameter -func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceTemplatesOptions, "listInstanceTemplatesOptions") +// CreateInstanceWithContext is an alternate form of the CreateInstance method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceOptions, "createInstanceOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createInstanceOptions, "createInstanceOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { return } - for headerName, headerValue := range listInstanceTemplatesOptions.Headers { + for headerName, headerValue := range createInstanceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceTemplates") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstance") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createInstanceOptions.InstancePrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -5083,7 +5063,7 @@ func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInst return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplateCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) if err != nil { return } @@ -5093,42 +5073,41 @@ func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInst return } -// CreateInstanceTemplate : Create an instance template -// This request creates a new instance template. The prototype object is structured in the same way as a retrieved -// instance template, and contains the information necessary to provision a new instance from the template. -// -// If a `source_template` is specified in the prototype object, its contents are copied into the new template prior to -// copying any other properties provided in the prototype object. -func (vpc *VpcV1) CreateInstanceTemplate(createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceTemplateWithContext(context.Background(), createInstanceTemplateOptions) +// CreateInstanceAction : Create an instance action +// This request creates a new action which will be queued up to run as soon as any pending or running actions have +// completed. +func (vpc *VpcV1) CreateInstanceAction(createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceActionWithContext(context.Background(), createInstanceActionOptions) } -// CreateInstanceTemplateWithContext is an alternate form of the CreateInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceTemplateOptions, "createInstanceTemplateOptions cannot be nil") +// CreateInstanceActionWithContext is an alternate form of the CreateInstanceAction method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceActionWithContext(ctx context.Context, createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceActionOptions, "createInstanceActionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceTemplateOptions, "createInstanceTemplateOptions") + err = core.ValidateStruct(createInstanceActionOptions, "createInstanceActionOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "instance_id": *createInstanceActionOptions.InstanceID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/actions`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceTemplateOptions.Headers { + for headerName, headerValue := range createInstanceActionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceTemplate") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceAction") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -5138,7 +5117,14 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createInstanceTemplateOptions.InstanceTemplatePrototype) + body := make(map[string]interface{}) + if createInstanceActionOptions.Type != nil { + body["type"] = createInstanceActionOptions.Type + } + if createInstanceActionOptions.Force != nil { + body["force"] = createInstanceActionOptions.Force + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -5154,7 +5140,7 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceAction) if err != nil { return } @@ -5164,101 +5150,142 @@ func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createI return } -// DeleteInstanceTemplate : Delete an instance template -// This request deletes the instance template. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceTemplate(deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceTemplateWithContext(context.Background(), deleteInstanceTemplateOptions) +// CreateInstanceConsoleAccessToken : Create a console access token for an instance +// This request creates a new single-use console access token for an instance. All console configuration is provided at +// token create time, and the token is subsequently used in the `access_token` query parameter for the WebSocket +// request. The access token is only valid for a short period of time, and a maximum of one token is valid for a given +// instance at a time. +func (vpc *VpcV1) CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceConsoleAccessTokenWithContext(context.Background(), createInstanceConsoleAccessTokenOptions) } -// DeleteInstanceTemplateWithContext is an alternate form of the DeleteInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceTemplateWithContext(ctx context.Context, deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions cannot be nil") +// CreateInstanceConsoleAccessTokenWithContext is an alternate form of the CreateInstanceConsoleAccessToken method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceConsoleAccessTokenWithContext(ctx context.Context, createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions") + err = core.ValidateStruct(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteInstanceTemplateOptions.ID, + "instance_id": *createInstanceConsoleAccessTokenOptions.InstanceID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/console_access_token`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceTemplateOptions.Headers { + for headerName, headerValue := range createInstanceConsoleAccessTokenOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceTemplate") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceConsoleAccessToken") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createInstanceConsoleAccessTokenOptions.ConsoleType != nil { + body["console_type"] = createInstanceConsoleAccessTokenOptions.ConsoleType + } + if createInstanceConsoleAccessTokenOptions.Force != nil { + body["force"] = createInstanceConsoleAccessTokenOptions.Force + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceConsoleAccessToken) + if err != nil { + return + } + response.Result = result + } return } -// GetInstanceTemplate : Retrieve an instance template -// This request retrieves a single instance template specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceTemplate(getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceTemplateWithContext(context.Background(), getInstanceTemplateOptions) +// CreateInstanceNetworkAttachment : Create a network attachment on an instance +// This request creates a new instance network attachment from an instance network attachment prototype object. The +// prototype object is structured in the same way as a retrieved instance network attachment, and contains the +// information necessary to create the new instance network attachment. +func (vpc *VpcV1) CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceNetworkAttachmentWithContext(context.Background(), createInstanceNetworkAttachmentOptions) } -// GetInstanceTemplateWithContext is an alternate form of the GetInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceTemplateOptions, "getInstanceTemplateOptions cannot be nil") +// CreateInstanceNetworkAttachmentWithContext is an alternate form of the CreateInstanceNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceNetworkAttachmentWithContext(ctx context.Context, createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceNetworkAttachmentOptions, "createInstanceNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceTemplateOptions, "getInstanceTemplateOptions") + err = core.ValidateStruct(createInstanceNetworkAttachmentOptions, "createInstanceNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getInstanceTemplateOptions.ID, + "instance_id": *createInstanceNetworkAttachmentOptions.InstanceID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceTemplateOptions.Headers { + for headerName, headerValue := range createInstanceNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceTemplate") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createInstanceNetworkAttachmentOptions.VirtualNetworkInterface != nil { + body["virtual_network_interface"] = createInstanceNetworkAttachmentOptions.VirtualNetworkInterface + } + if createInstanceNetworkAttachmentOptions.Name != nil { + body["name"] = createInstanceNetworkAttachmentOptions.Name + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -5270,7 +5297,7 @@ func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanc return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) if err != nil { return } @@ -5280,52 +5307,73 @@ func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanc return } -// UpdateInstanceTemplate : Update an instance template -// This request updates an instance template with the information provided in the instance template patch. The instance -// template patch object is structured in the same way as a retrieved instance template and contains only the -// information to be updated. -func (vpc *VpcV1) UpdateInstanceTemplate(updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceTemplateWithContext(context.Background(), updateInstanceTemplateOptions) +// CreateInstanceNetworkInterface : Create a network interface on an instance +// This request creates a new instance network interface from an instance network interface prototype object. The +// prototype object is structured in the same way as a retrieved instance network interface, and contains the +// information necessary to create the new instance network interface. Any subnet in the instance's VPC may be +// specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. +// +// If this instance has network attachments, each network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. +func (vpc *VpcV1) CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceNetworkInterfaceWithContext(context.Background(), createInstanceNetworkInterfaceOptions) } -// UpdateInstanceTemplateWithContext is an alternate form of the UpdateInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceTemplateWithContext(ctx context.Context, updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceTemplateOptions, "updateInstanceTemplateOptions cannot be nil") +// CreateInstanceNetworkInterfaceWithContext is an alternate form of the CreateInstanceNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceTemplateOptions, "updateInstanceTemplateOptions") + err = core.ValidateStruct(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateInstanceTemplateOptions.ID, + "instance_id": *createInstanceNetworkInterfaceOptions.InstanceID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceTemplateOptions.Headers { + for headerName, headerValue := range createInstanceNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceTemplate") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceTemplateOptions.InstanceTemplatePatch) + body := make(map[string]interface{}) + if createInstanceNetworkInterfaceOptions.Subnet != nil { + body["subnet"] = createInstanceNetworkInterfaceOptions.Subnet + } + if createInstanceNetworkInterfaceOptions.AllowIPSpoofing != nil { + body["allow_ip_spoofing"] = createInstanceNetworkInterfaceOptions.AllowIPSpoofing + } + if createInstanceNetworkInterfaceOptions.Name != nil { + body["name"] = createInstanceNetworkInterfaceOptions.Name + } + if createInstanceNetworkInterfaceOptions.PrimaryIP != nil { + body["primary_ip"] = createInstanceNetworkInterfaceOptions.PrimaryIP + } + if createInstanceNetworkInterfaceOptions.SecurityGroups != nil { + body["security_groups"] = createInstanceNetworkInterfaceOptions.SecurityGroups + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -5341,7 +5389,7 @@ func (vpc *VpcV1) UpdateInstanceTemplateWithContext(ctx context.Context, updateI return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) if err != nil { return } @@ -5351,88 +5399,52 @@ func (vpc *VpcV1) UpdateInstanceTemplateWithContext(ctx context.Context, updateI return } -// ListInstances : List all instances -// This request lists all instances in the region. -func (vpc *VpcV1) ListInstances(listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstancesWithContext(context.Background(), listInstancesOptions) +// CreateInstanceTemplate : Create an instance template +// This request creates a new instance template. The prototype object is structured in the same way as a retrieved +// instance template, and contains the information necessary to provision a new instance from the template. +// +// If a `source_template` is specified in the prototype object, its contents are copied into the new template prior to +// copying any other properties provided in the prototype object. +func (vpc *VpcV1) CreateInstanceTemplate(createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceTemplateWithContext(context.Background(), createInstanceTemplateOptions) } -// ListInstancesWithContext is an alternate form of the ListInstances method which supports a Context parameter -func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstancesOptions, "listInstancesOptions") +// CreateInstanceTemplateWithContext is an alternate form of the CreateInstanceTemplate method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceTemplateOptions, "createInstanceTemplateOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createInstanceTemplateOptions, "createInstanceTemplateOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) if err != nil { return } - for headerName, headerValue := range listInstancesOptions.Headers { + for headerName, headerValue := range createInstanceTemplateOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstances") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceTemplate") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstancesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstancesOptions.Start)) - } - if listInstancesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstancesOptions.Limit)) - } - if listInstancesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listInstancesOptions.ResourceGroupID)) - } - if listInstancesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listInstancesOptions.Name)) - } - if listInstancesOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listInstancesOptions.VPCID)) - } - if listInstancesOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listInstancesOptions.VPCCRN)) - } - if listInstancesOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listInstancesOptions.VPCName)) - } - if listInstancesOptions.DedicatedHostID != nil { - builder.AddQuery("dedicated_host.id", fmt.Sprint(*listInstancesOptions.DedicatedHostID)) - } - if listInstancesOptions.DedicatedHostCRN != nil { - builder.AddQuery("dedicated_host.crn", fmt.Sprint(*listInstancesOptions.DedicatedHostCRN)) - } - if listInstancesOptions.DedicatedHostName != nil { - builder.AddQuery("dedicated_host.name", fmt.Sprint(*listInstancesOptions.DedicatedHostName)) - } - if listInstancesOptions.PlacementGroupID != nil { - builder.AddQuery("placement_group.id", fmt.Sprint(*listInstancesOptions.PlacementGroupID)) - } - if listInstancesOptions.PlacementGroupCRN != nil { - builder.AddQuery("placement_group.crn", fmt.Sprint(*listInstancesOptions.PlacementGroupCRN)) - } - if listInstancesOptions.PlacementGroupName != nil { - builder.AddQuery("placement_group.name", fmt.Sprint(*listInstancesOptions.PlacementGroupName)) - } - if listInstancesOptions.ReservationID != nil { - builder.AddQuery("reservation.id", fmt.Sprint(*listInstancesOptions.ReservationID)) - } - if listInstancesOptions.ReservationCRN != nil { - builder.AddQuery("reservation.crn", fmt.Sprint(*listInstancesOptions.ReservationCRN)) - } - if listInstancesOptions.ReservationName != nil { - builder.AddQuery("reservation.name", fmt.Sprint(*listInstancesOptions.ReservationName)) + + _, err = builder.SetBodyContentJSON(createInstanceTemplateOptions.InstanceTemplatePrototype) + if err != nil { + return } request, err := builder.Build() @@ -5446,7 +5458,7 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) if err != nil { return } @@ -5456,40 +5468,43 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt return } -// CreateInstance : Create an instance -// This request provisions a new instance from an instance prototype object. The prototype object is structured in the -// same way as a retrieved instance, and contains the information necessary to provision the new instance. The instance -// is automatically started. -func (vpc *VpcV1) CreateInstance(createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceWithContext(context.Background(), createInstanceOptions) +// CreateInstanceVolumeAttachment : Create a volume attachment on an instance +// This request creates a new volume attachment from a volume attachment prototype object, connecting a volume to an +// instance. For this request to succeed, the specified volume must not be busy. The prototype object is structured in +// the same way as a retrieved volume attachment, and contains the information necessary to create the new volume +// attachment. +func (vpc *VpcV1) CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceVolumeAttachmentWithContext(context.Background(), createInstanceVolumeAttachmentOptions) } -// CreateInstanceWithContext is an alternate form of the CreateInstance method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceOptions, "createInstanceOptions cannot be nil") +// CreateInstanceVolumeAttachmentWithContext is an alternate form of the CreateInstanceVolumeAttachment method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceVolumeAttachmentWithContext(ctx context.Context, createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceOptions, "createInstanceOptions") + err = core.ValidateStruct(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "instance_id": *createInstanceVolumeAttachmentOptions.InstanceID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceOptions.Headers { + for headerName, headerValue := range createInstanceVolumeAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstance") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceVolumeAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -5499,7 +5514,17 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createInstanceOptions.InstancePrototype) + body := make(map[string]interface{}) + if createInstanceVolumeAttachmentOptions.Volume != nil { + body["volume"] = createInstanceVolumeAttachmentOptions.Volume + } + if createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete != nil { + body["delete_volume_on_instance_delete"] = createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete + } + if createInstanceVolumeAttachmentOptions.Name != nil { + body["name"] = createInstanceVolumeAttachmentOptions.Name + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -5515,7 +5540,7 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) if err != nil { return } @@ -5527,8 +5552,10 @@ func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceO // DeleteInstance : Delete an instance // This request deletes an instance. This operation cannot be reversed. Any floating IPs associated with instance -// network interfaces are implicitly disassociated. All flow log collectors with `auto_delete` set to `true` targeting -// the instance and/or the instance network interfaces are automatically deleted. +// network interfaces are implicitly disassociated. All virtual network interfaces with `auto_delete` set to `true` +// targeting instance network attachments on the instance are automatically deleted. All flow log collectors with +// `auto_delete` set to `true` targeting the instance, the instance network attachments, the instance network +// interfaces, or the automatically deleted virtual network interfaces are automatically deleted. func (vpc *VpcV1) DeleteInstance(deleteInstanceOptions *DeleteInstanceOptions) (response *core.DetailedResponse, err error) { return vpc.DeleteInstanceWithContext(context.Background(), deleteInstanceOptions) } @@ -5581,46 +5608,47 @@ func (vpc *VpcV1) DeleteInstanceWithContext(ctx context.Context, deleteInstanceO return } -// GetInstance : Retrieve an instance -// This request retrieves a single instance specified by the identifier in the URL. -func (vpc *VpcV1) GetInstance(getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.GetInstanceWithContext(context.Background(), getInstanceOptions) +// DeleteInstanceNetworkAttachment : Delete an instance network attachment +// This request deletes an instance network attachment. This operation cannot be reversed. Any floating IPs associated +// with the instance network attachment are implicitly disassociated. All flow log collectors with `auto_delete` set to +// `true` targeting the instance network attachment are automatically deleted. The primary instance network attachment +// is not allowed to be deleted. +func (vpc *VpcV1) DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptions *DeleteInstanceNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceNetworkAttachmentWithContext(context.Background(), deleteInstanceNetworkAttachmentOptions) } -// GetInstanceWithContext is an alternate form of the GetInstance method which supports a Context parameter -func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceOptions, "getInstanceOptions cannot be nil") +// DeleteInstanceNetworkAttachmentWithContext is an alternate form of the DeleteInstanceNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceNetworkAttachmentWithContext(ctx context.Context, deleteInstanceNetworkAttachmentOptions *DeleteInstanceNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceNetworkAttachmentOptions, "deleteInstanceNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceOptions, "getInstanceOptions") + err = core.ValidateStruct(deleteInstanceNetworkAttachmentOptions, "deleteInstanceNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getInstanceOptions.ID, + "instance_id": *deleteInstanceNetworkAttachmentOptions.InstanceID, + "id": *deleteInstanceNetworkAttachmentOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceOptions.Headers { + for headerName, headerValue := range deleteInstanceNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstance") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -5630,136 +5658,107 @@ func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateInstance : Update an instance -// This request updates an instance with the information in a provided instance patch. The instance patch object is -// structured in the same way as a retrieved instance and contains only the information to be updated. -func (vpc *VpcV1) UpdateInstance(updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceWithContext(context.Background(), updateInstanceOptions) +// DeleteInstanceNetworkInterface : Delete an instance network interface +// This request deletes an instance network interface. This operation cannot be reversed. Any floating IPs associated +// with the instance network interface are implicitly disassociated. All flow log collectors with `auto_delete` set to +// `true` targeting the instance network interface are automatically deleted. The primary instance network interface is +// not allowed to be deleted. +// +// If this instance has network attachments, this network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be deleted. +func (vpc *VpcV1) DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceNetworkInterfaceWithContext(context.Background(), deleteInstanceNetworkInterfaceOptions) } -// UpdateInstanceWithContext is an alternate form of the UpdateInstance method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceOptions, "updateInstanceOptions cannot be nil") +// DeleteInstanceNetworkInterfaceWithContext is an alternate form of the DeleteInstanceNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceNetworkInterfaceWithContext(ctx context.Context, deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceOptions, "updateInstanceOptions") + err = core.ValidateStruct(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateInstanceOptions.ID, + "instance_id": *deleteInstanceNetworkInterfaceOptions.InstanceID, + "id": *deleteInstanceNetworkInterfaceOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceOptions.Headers { + for headerName, headerValue := range deleteInstanceNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstance") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateInstanceOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceOptions.InstancePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// GetInstanceInitialization : Retrieve initialization configuration for an instance -// This request retrieves configuration used to initialize the instance, such as SSH keys and the Windows administrator -// password. These can subsequently be changed on the instance and therefore may not be current. -func (vpc *VpcV1) GetInstanceInitialization(getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { - return vpc.GetInstanceInitializationWithContext(context.Background(), getInstanceInitializationOptions) +// DeleteInstanceTemplate : Delete an instance template +// This request deletes the instance template. This operation cannot be reversed. +func (vpc *VpcV1) DeleteInstanceTemplate(deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceTemplateWithContext(context.Background(), deleteInstanceTemplateOptions) } -// GetInstanceInitializationWithContext is an alternate form of the GetInstanceInitialization method which supports a Context parameter -func (vpc *VpcV1) GetInstanceInitializationWithContext(ctx context.Context, getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceInitializationOptions, "getInstanceInitializationOptions cannot be nil") +// DeleteInstanceTemplateWithContext is an alternate form of the DeleteInstanceTemplate method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceTemplateWithContext(ctx context.Context, deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceInitializationOptions, "getInstanceInitializationOptions") + err = core.ValidateStruct(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getInstanceInitializationOptions.ID, + "id": *deleteInstanceTemplateOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}/initialization`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceInitializationOptions.Headers { + for headerName, headerValue := range deleteInstanceTemplateOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceInitialization") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceTemplate") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -5769,157 +5768,106 @@ func (vpc *VpcV1) GetInstanceInitializationWithContext(ctx context.Context, getI return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceInitialization) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateInstanceAction : Create an instance action -// This request creates a new action which will be queued up to run as soon as any pending or running actions have -// completed. -func (vpc *VpcV1) CreateInstanceAction(createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceActionWithContext(context.Background(), createInstanceActionOptions) +// DeleteInstanceVolumeAttachment : Delete a volume attachment +// This request deletes a volume attachment. This operation cannot be reversed, but a new volume attachment may +// subsequently be created for the volume. For this request to succeed, the volume must not be busy. +func (vpc *VpcV1) DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceVolumeAttachmentWithContext(context.Background(), deleteInstanceVolumeAttachmentOptions) } -// CreateInstanceActionWithContext is an alternate form of the CreateInstanceAction method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceActionWithContext(ctx context.Context, createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceActionOptions, "createInstanceActionOptions cannot be nil") +// DeleteInstanceVolumeAttachmentWithContext is an alternate form of the DeleteInstanceVolumeAttachment method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceVolumeAttachmentWithContext(ctx context.Context, deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceActionOptions, "createInstanceActionOptions") + err = core.ValidateStruct(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *createInstanceActionOptions.InstanceID, + "instance_id": *deleteInstanceVolumeAttachmentOptions.InstanceID, + "id": *deleteInstanceVolumeAttachmentOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/actions`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceActionOptions.Headers { + for headerName, headerValue := range deleteInstanceVolumeAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceAction") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceVolumeAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createInstanceActionOptions.Type != nil { - body["type"] = createInstanceActionOptions.Type - } - if createInstanceActionOptions.Force != nil { - body["force"] = createInstanceActionOptions.Force - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceAction) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateInstanceConsoleAccessToken : Create a console access token for an instance -// This request creates a new single-use console access token for an instance. All console configuration is provided at -// token create time, and the token is subsequently used in the `access_token` query parameter for the WebSocket -// request. The access token is only valid for a short period of time, and a maximum of one token is valid for a given -// instance at a time. -func (vpc *VpcV1) CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceConsoleAccessTokenWithContext(context.Background(), createInstanceConsoleAccessTokenOptions) +// GetInstance : Retrieve an instance +// This request retrieves a single instance specified by the identifier in the URL. +func (vpc *VpcV1) GetInstance(getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + return vpc.GetInstanceWithContext(context.Background(), getInstanceOptions) } -// CreateInstanceConsoleAccessTokenWithContext is an alternate form of the CreateInstanceConsoleAccessToken method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceConsoleAccessTokenWithContext(ctx context.Context, createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions cannot be nil") +// GetInstanceWithContext is an alternate form of the GetInstance method which supports a Context parameter +func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceOptions, "getInstanceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions") + err = core.ValidateStruct(getInstanceOptions, "getInstanceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *createInstanceConsoleAccessTokenOptions.InstanceID, + "id": *getInstanceOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/console_access_token`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceConsoleAccessTokenOptions.Headers { + for headerName, headerValue := range getInstanceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceConsoleAccessToken") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstance") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createInstanceConsoleAccessTokenOptions.ConsoleType != nil { - body["console_type"] = createInstanceConsoleAccessTokenOptions.ConsoleType - } - if createInstanceConsoleAccessTokenOptions.Force != nil { - body["force"] = createInstanceConsoleAccessTokenOptions.Force - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -5931,7 +5879,7 @@ func (vpc *VpcV1) CreateInstanceConsoleAccessTokenWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceConsoleAccessToken) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) if err != nil { return } @@ -5941,42 +5889,41 @@ func (vpc *VpcV1) CreateInstanceConsoleAccessTokenWithContext(ctx context.Contex return } -// ListInstanceDisks : List all disks on an instance -// This request lists all disks on an instance. A disk is a block device that is locally attached to the instance's -// physical host and is also referred to as instance storage. By default, the listed disks are sorted by their -// `created_at` property values, with the newest disk first. -func (vpc *VpcV1) ListInstanceDisks(listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceDisksWithContext(context.Background(), listInstanceDisksOptions) +// GetInstanceDisk : Retrieve an instance disk +// This request retrieves a single instance disk specified by the identifier in the URL. +func (vpc *VpcV1) GetInstanceDisk(getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { + return vpc.GetInstanceDiskWithContext(context.Background(), getInstanceDiskOptions) } -// ListInstanceDisksWithContext is an alternate form of the ListInstanceDisks method which supports a Context parameter -func (vpc *VpcV1) ListInstanceDisksWithContext(ctx context.Context, listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceDisksOptions, "listInstanceDisksOptions cannot be nil") +// GetInstanceDiskWithContext is an alternate form of the GetInstanceDisk method which supports a Context parameter +func (vpc *VpcV1) GetInstanceDiskWithContext(ctx context.Context, getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceDiskOptions, "getInstanceDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceDisksOptions, "listInstanceDisksOptions") + err = core.ValidateStruct(getInstanceDiskOptions, "getInstanceDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *listInstanceDisksOptions.InstanceID, + "instance_id": *getInstanceDiskOptions.InstanceID, + "id": *getInstanceDiskOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceDisksOptions.Headers { + for headerName, headerValue := range getInstanceDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceDisks") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -5996,7 +5943,7 @@ func (vpc *VpcV1) ListInstanceDisksWithContext(ctx context.Context, listInstance return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDiskCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) if err != nil { return } @@ -6006,41 +5953,41 @@ func (vpc *VpcV1) ListInstanceDisksWithContext(ctx context.Context, listInstance return } -// GetInstanceDisk : Retrieve an instance disk -// This request retrieves a single instance disk specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceDisk(getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - return vpc.GetInstanceDiskWithContext(context.Background(), getInstanceDiskOptions) +// GetInstanceInitialization : Retrieve initialization configuration for an instance +// This request retrieves configuration used to initialize the instance, such as SSH keys and the Windows administrator +// password. These can subsequently be changed on the instance and therefore may not be current. +func (vpc *VpcV1) GetInstanceInitialization(getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { + return vpc.GetInstanceInitializationWithContext(context.Background(), getInstanceInitializationOptions) } -// GetInstanceDiskWithContext is an alternate form of the GetInstanceDisk method which supports a Context parameter -func (vpc *VpcV1) GetInstanceDiskWithContext(ctx context.Context, getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceDiskOptions, "getInstanceDiskOptions cannot be nil") +// GetInstanceInitializationWithContext is an alternate form of the GetInstanceInitialization method which supports a Context parameter +func (vpc *VpcV1) GetInstanceInitializationWithContext(ctx context.Context, getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceInitializationOptions, "getInstanceInitializationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceDiskOptions, "getInstanceDiskOptions") + err = core.ValidateStruct(getInstanceInitializationOptions, "getInstanceInitializationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getInstanceDiskOptions.InstanceID, - "id": *getInstanceDiskOptions.ID, + "id": *getInstanceInitializationOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}/initialization`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceDiskOptions.Headers { + for headerName, headerValue := range getInstanceInitializationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceDisk") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceInitialization") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6060,7 +6007,7 @@ func (vpc *VpcV1) GetInstanceDiskWithContext(ctx context.Context, getInstanceDis return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceInitialization) if err != nil { return } @@ -6070,55 +6017,49 @@ func (vpc *VpcV1) GetInstanceDiskWithContext(ctx context.Context, getInstanceDis return } -// UpdateInstanceDisk : Update an instance disk -// This request updates the instance disk with the information in a provided patch. -func (vpc *VpcV1) UpdateInstanceDisk(updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceDiskWithContext(context.Background(), updateInstanceDiskOptions) +// GetInstanceNetworkAttachment : Retrieve an instance network attachment +// This request retrieves a single instance network attachment specified by the identifier in the URL. +func (vpc *VpcV1) GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + return vpc.GetInstanceNetworkAttachmentWithContext(context.Background(), getInstanceNetworkAttachmentOptions) } -// UpdateInstanceDiskWithContext is an alternate form of the UpdateInstanceDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceDiskWithContext(ctx context.Context, updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceDiskOptions, "updateInstanceDiskOptions cannot be nil") +// GetInstanceNetworkAttachmentWithContext is an alternate form of the GetInstanceNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) GetInstanceNetworkAttachmentWithContext(ctx context.Context, getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceNetworkAttachmentOptions, "getInstanceNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceDiskOptions, "updateInstanceDiskOptions") + err = core.ValidateStruct(getInstanceNetworkAttachmentOptions, "getInstanceNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *updateInstanceDiskOptions.InstanceID, - "id": *updateInstanceDiskOptions.ID, + "instance_id": *getInstanceNetworkAttachmentOptions.InstanceID, + "id": *getInstanceNetworkAttachmentOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceDiskOptions.Headers { + for headerName, headerValue := range getInstanceNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceDisk") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceDiskOptions.InstanceDiskPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -6130,7 +6071,7 @@ func (vpc *VpcV1) UpdateInstanceDiskWithContext(ctx context.Context, updateInsta return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) if err != nil { return } @@ -6140,43 +6081,45 @@ func (vpc *VpcV1) UpdateInstanceDiskWithContext(ctx context.Context, updateInsta return } -// ListInstanceNetworkInterfaces : List all network interfaces on an instance -// This request lists all network interfaces on an instance. An instance network interface is an abstract representation -// of a network device and attaches an instance to a single subnet. Each network interface on an instance can attach to -// any subnet in the zone, including subnets that are already attached to the instance. Multiple network interfaces on -// the instance may also attach to the same subnet. -func (vpc *VpcV1) ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkInterfacesWithContext(context.Background(), listInstanceNetworkInterfacesOptions) +// GetInstanceNetworkInterface : Retrieve an instance network interface +// This request retrieves a single instance network interface specified by the identifier in the URL. +// +// If this instance has network attachments, the retrieved network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface. +func (vpc *VpcV1) GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + return vpc.GetInstanceNetworkInterfaceWithContext(context.Background(), getInstanceNetworkInterfaceOptions) } -// ListInstanceNetworkInterfacesWithContext is an alternate form of the ListInstanceNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions cannot be nil") +// GetInstanceNetworkInterfaceWithContext is an alternate form of the GetInstanceNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions") + err = core.ValidateStruct(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkInterfacesOptions.InstanceID, + "instance_id": *getInstanceNetworkInterfaceOptions.InstanceID, + "id": *getInstanceNetworkInterfaceOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceNetworkInterfacesOptions.Headers { + for headerName, headerValue := range getInstanceNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaces") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6196,7 +6139,7 @@ func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterfaceUnpaginatedCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) if err != nil { return } @@ -6206,73 +6149,51 @@ func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, return } -// CreateInstanceNetworkInterface : Create a network interface on an instance -// This request creates a new instance network interface from an instance network interface prototype object. The -// prototype object is structured in the same way as a retrieved instance network interface, and contains the -// information necessary to create the new instance network interface. Any subnet in the instance's VPC may be -// specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. -func (vpc *VpcV1) CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceNetworkInterfaceWithContext(context.Background(), createInstanceNetworkInterfaceOptions) +// GetInstanceNetworkInterfaceFloatingIP : Retrieve associated floating IP +// This request retrieves a specified floating IP address if it is associated with the instance network interface and +// instance specified in the URL. +func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.GetInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), getInstanceNetworkInterfaceFloatingIPOptions) } -// CreateInstanceNetworkInterfaceWithContext is an alternate form of the CreateInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions cannot be nil") +// GetInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the GetInstanceNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions") + err = core.ValidateStruct(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *createInstanceNetworkInterfaceOptions.InstanceID, + "instance_id": *getInstanceNetworkInterfaceFloatingIPOptions.InstanceID, + "network_interface_id": *getInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *getInstanceNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getInstanceNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createInstanceNetworkInterfaceOptions.Subnet != nil { - body["subnet"] = createInstanceNetworkInterfaceOptions.Subnet - } - if createInstanceNetworkInterfaceOptions.AllowIPSpoofing != nil { - body["allow_ip_spoofing"] = createInstanceNetworkInterfaceOptions.AllowIPSpoofing - } - if createInstanceNetworkInterfaceOptions.Name != nil { - body["name"] = createInstanceNetworkInterfaceOptions.Name - } - if createInstanceNetworkInterfaceOptions.PrimaryIP != nil { - body["primary_ip"] = createInstanceNetworkInterfaceOptions.PrimaryIP - } - if createInstanceNetworkInterfaceOptions.SecurityGroups != nil { - body["security_groups"] = createInstanceNetworkInterfaceOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -6284,7 +6205,7 @@ func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -6294,47 +6215,46 @@ func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, return } -// DeleteInstanceNetworkInterface : Delete an instance network interface -// This request deletes an instance network interface. This operation cannot be reversed. Any floating IPs associated -// with the instance network interface are implicitly disassociated. All flow log collectors with `auto_delete` set to -// `true` targeting the instance network interface are automatically deleted. The primary instance network interface is -// not allowed to be deleted. -func (vpc *VpcV1) DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceNetworkInterfaceWithContext(context.Background(), deleteInstanceNetworkInterfaceOptions) +// GetInstanceNetworkInterfaceIP : Retrieve the primary reserved IP +// This request retrieves the primary reserved IP for an instance network interface. +func (vpc *VpcV1) GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.GetInstanceNetworkInterfaceIPWithContext(context.Background(), getInstanceNetworkInterfaceIPOptions) } -// DeleteInstanceNetworkInterfaceWithContext is an alternate form of the DeleteInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceNetworkInterfaceWithContext(ctx context.Context, deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions cannot be nil") +// GetInstanceNetworkInterfaceIPWithContext is an alternate form of the GetInstanceNetworkInterfaceIP method which supports a Context parameter +func (vpc *VpcV1) GetInstanceNetworkInterfaceIPWithContext(ctx context.Context, getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions") + err = core.ValidateStruct(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *deleteInstanceNetworkInterfaceOptions.InstanceID, - "id": *deleteInstanceNetworkInterfaceOptions.ID, + "instance_id": *getInstanceNetworkInterfaceIPOptions.InstanceID, + "network_interface_id": *getInstanceNetworkInterfaceIPOptions.NetworkInterfaceID, + "id": *getInstanceNetworkInterfaceIPOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getInstanceNetworkInterfaceIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -6344,46 +6264,56 @@ func (vpc *VpcV1) DeleteInstanceNetworkInterfaceWithContext(ctx context.Context, return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + if err != nil { + return + } + response.Result = result + } return } -// GetInstanceNetworkInterface : Retrieve an instance network interface -// This request retrieves a single instance network interface specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceWithContext(context.Background(), getInstanceNetworkInterfaceOptions) +// GetInstanceProfile : Retrieve an instance profile +// This request retrieves a single instance profile specified by the name in the URL. +func (vpc *VpcV1) GetInstanceProfile(getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { + return vpc.GetInstanceProfileWithContext(context.Background(), getInstanceProfileOptions) } -// GetInstanceNetworkInterfaceWithContext is an alternate form of the GetInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions cannot be nil") +// GetInstanceProfileWithContext is an alternate form of the GetInstanceProfile method which supports a Context parameter +func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceProfileOptions, "getInstanceProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions") + err = core.ValidateStruct(getInstanceProfileOptions, "getInstanceProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceOptions.InstanceID, - "id": *getInstanceNetworkInterfaceOptions.ID, + "name": *getInstanceProfileOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getInstanceProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6403,7 +6333,7 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, ge return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfile) if err != nil { return } @@ -6413,57 +6343,48 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, ge return } -// UpdateInstanceNetworkInterface : Update an instance network interface -// This request updates an instance network interface with the information provided in an instance network interface -// patch object. The instance network interface patch object is structured in the same way as a retrieved instance -// network interface and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceNetworkInterfaceWithContext(context.Background(), updateInstanceNetworkInterfaceOptions) +// GetInstanceTemplate : Retrieve an instance template +// This request retrieves a single instance template specified by the identifier in the URL. +func (vpc *VpcV1) GetInstanceTemplate(getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + return vpc.GetInstanceTemplateWithContext(context.Background(), getInstanceTemplateOptions) } -// UpdateInstanceNetworkInterfaceWithContext is an alternate form of the UpdateInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceNetworkInterfaceWithContext(ctx context.Context, updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions cannot be nil") +// GetInstanceTemplateWithContext is an alternate form of the GetInstanceTemplate method which supports a Context parameter +func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceTemplateOptions, "getInstanceTemplateOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions") + err = core.ValidateStruct(getInstanceTemplateOptions, "getInstanceTemplateOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *updateInstanceNetworkInterfaceOptions.InstanceID, - "id": *updateInstanceNetworkInterfaceOptions.ID, + "id": *getInstanceTemplateOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getInstanceTemplateOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceTemplate") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceNetworkInterfaceOptions.NetworkInterfacePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -6475,7 +6396,7 @@ func (vpc *VpcV1) UpdateInstanceNetworkInterfaceWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) if err != nil { return } @@ -6485,41 +6406,41 @@ func (vpc *VpcV1) UpdateInstanceNetworkInterfaceWithContext(ctx context.Context, return } -// ListInstanceNetworkInterfaceFloatingIps : List all floating IPs associated with an instance network interface -// This request lists all floating IPs associated with an instance network interface. -func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkInterfaceFloatingIpsWithContext(context.Background(), listInstanceNetworkInterfaceFloatingIpsOptions) +// GetInstanceVolumeAttachment : Retrieve a volume attachment +// This request retrieves a single volume attachment specified by the identifier in the URL. +func (vpc *VpcV1) GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + return vpc.GetInstanceVolumeAttachmentWithContext(context.Background(), getInstanceVolumeAttachmentOptions) } -// ListInstanceNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListInstanceNetworkInterfaceFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions cannot be nil") +// GetInstanceVolumeAttachmentWithContext is an alternate form of the GetInstanceVolumeAttachment method which supports a Context parameter +func (vpc *VpcV1) GetInstanceVolumeAttachmentWithContext(ctx context.Context, getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions") + err = core.ValidateStruct(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkInterfaceFloatingIpsOptions.InstanceID, - "network_interface_id": *listInstanceNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, + "instance_id": *getInstanceVolumeAttachmentOptions.InstanceID, + "id": *getInstanceVolumeAttachmentOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceNetworkInterfaceFloatingIpsOptions.Headers { + for headerName, headerValue := range getInstanceVolumeAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaceFloatingIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceVolumeAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6539,7 +6460,7 @@ func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx context return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) if err != nil { return } @@ -6549,45 +6470,46 @@ func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx context return } -// RemoveInstanceNetworkInterfaceFloatingIP : Disassociate a floating IP from an instance network interface -// This request disassociates the specified floating IP from the specified instance network interface. -func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), removeInstanceNetworkInterfaceFloatingIPOptions) +// ListInstanceDisks : List all disks on an instance +// This request lists all disks on an instance. A disk is a block device that is locally attached to the instance's +// physical host and is also referred to as instance storage. By default, the listed disks are sorted by their +// `created_at` property values, with the newest disk first. +func (vpc *VpcV1) ListInstanceDisks(listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceDisksWithContext(context.Background(), listInstanceDisksOptions) } -// RemoveInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions cannot be nil") +// ListInstanceDisksWithContext is an alternate form of the ListInstanceDisks method which supports a Context parameter +func (vpc *VpcV1) ListInstanceDisksWithContext(ctx context.Context, listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceDisksOptions, "listInstanceDisksOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(listInstanceDisksOptions, "listInstanceDisksOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *removeInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *removeInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *removeInstanceNetworkInterfaceFloatingIPOptions.ID, + "instance_id": *listInstanceDisksOptions.InstanceID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeInstanceNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range listInstanceDisksOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveInstanceNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceDisks") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -6597,48 +6519,61 @@ func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIPWithContext(ctx contex return } - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetInstanceNetworkInterfaceFloatingIP : Retrieve associated floating IP -// This request retrieves a specified floating IP address if it is associated with the instance network interface and -// instance specified in the URL. -func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), getInstanceNetworkInterfaceFloatingIPOptions) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDiskCollection) + if err != nil { + return + } + response.Result = result + } + + return } -// GetInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the GetInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions cannot be nil") +// ListInstanceNetworkAttachments : List all network attachments on an instance +// This request lists all network attachments on an instance. A network attachment represents a device on the instance +// to which a virtual network interface is attached. +// +// The network attachments will be sorted by their `created_at` property values, with newest network attachments first. +// Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` property +// values. +func (vpc *VpcV1) ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions) (result *InstanceNetworkAttachmentCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceNetworkAttachmentsWithContext(context.Background(), listInstanceNetworkAttachmentsOptions) +} + +// ListInstanceNetworkAttachmentsWithContext is an alternate form of the ListInstanceNetworkAttachments method which supports a Context parameter +func (vpc *VpcV1) ListInstanceNetworkAttachmentsWithContext(ctx context.Context, listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions) (result *InstanceNetworkAttachmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceNetworkAttachmentsOptions, "listInstanceNetworkAttachmentsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(listInstanceNetworkAttachmentsOptions, "listInstanceNetworkAttachmentsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *getInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *getInstanceNetworkInterfaceFloatingIPOptions.ID, + "instance_id": *listInstanceNetworkAttachmentsOptions.InstanceID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range listInstanceNetworkAttachmentsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkAttachments") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6658,7 +6593,7 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIPWithContext(ctx context.C return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachmentCollection) if err != nil { return } @@ -6668,44 +6603,41 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIPWithContext(ctx context.C return } -// AddInstanceNetworkInterfaceFloatingIP : Associate a floating IP with an instance network interface -// This request associates the specified floating IP with the specified instance network interface, replacing any -// existing association. For this request to succeed, the existing floating IP must not be required by another resource, -// such as a public gateway. A request body is not required, and if provided, is ignored. -func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.AddInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), addInstanceNetworkInterfaceFloatingIPOptions) +// ListInstanceNetworkInterfaceFloatingIps : List all floating IPs associated with an instance network interface +// This request lists all floating IPs associated with an instance network interface. +func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceNetworkInterfaceFloatingIpsWithContext(context.Background(), listInstanceNetworkInterfaceFloatingIpsOptions) } -// AddInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the AddInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions cannot be nil") +// ListInstanceNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListInstanceNetworkInterfaceFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *addInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *addInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *addInstanceNetworkInterfaceFloatingIPOptions.ID, + "instance_id": *listInstanceNetworkInterfaceFloatingIpsOptions.InstanceID, + "network_interface_id": *listInstanceNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addInstanceNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range listInstanceNetworkInterfaceFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddInstanceNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaceFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6725,7 +6657,7 @@ func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIPWithContext(ctx context.C return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) if err != nil { return } @@ -6805,42 +6737,47 @@ func (vpc *VpcV1) ListInstanceNetworkInterfaceIpsWithContext(ctx context.Context return } -// GetInstanceNetworkInterfaceIP : Retrieve the primary reserved IP -// This request retrieves the primary reserved IP for an instance network interface. -func (vpc *VpcV1) GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceIPWithContext(context.Background(), getInstanceNetworkInterfaceIPOptions) +// ListInstanceNetworkInterfaces : List all network interfaces on an instance +// This request lists all network interfaces on an instance. An instance network interface is an abstract representation +// of a network device and attaches an instance to a single subnet. Each network interface on an instance can attach to +// any subnet in the zone, including subnets that are already attached to the instance. Multiple network interfaces on +// the instance may also attach to the same subnet. +// +// If this instance has network attachments, each returned network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. +func (vpc *VpcV1) ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceNetworkInterfacesWithContext(context.Background(), listInstanceNetworkInterfacesOptions) } -// GetInstanceNetworkInterfaceIPWithContext is an alternate form of the GetInstanceNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceIPWithContext(ctx context.Context, getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions cannot be nil") +// ListInstanceNetworkInterfacesWithContext is an alternate form of the ListInstanceNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions") + err = core.ValidateStruct(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceIPOptions.InstanceID, - "network_interface_id": *getInstanceNetworkInterfaceIPOptions.NetworkInterfaceID, - "id": *getInstanceNetworkInterfaceIPOptions.ID, + "instance_id": *listInstanceNetworkInterfacesOptions.InstanceID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceNetworkInterfaceIPOptions.Headers { + for headerName, headerValue := range listInstanceNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -6860,7 +6797,118 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceIPWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterfaceUnpaginatedCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListInstanceProfiles : List all instance profiles +// This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the +// region. An instance profile specifies the performance characteristics and pricing model for an instance. +func (vpc *VpcV1) ListInstanceProfiles(listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceProfilesWithContext(context.Background(), listInstanceProfilesOptions) +} + +// ListInstanceProfilesWithContext is an alternate form of the ListInstanceProfiles method which supports a Context parameter +func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listInstanceProfilesOptions, "listInstanceProfilesOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listInstanceProfilesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceProfiles") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfileCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListInstanceTemplates : List all instance templates +// This request lists all instance templates in the region. +func (vpc *VpcV1) ListInstanceTemplates(listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceTemplatesWithContext(context.Background(), listInstanceTemplatesOptions) +} + +// ListInstanceTemplatesWithContext is an alternate form of the ListInstanceTemplates method which supports a Context parameter +func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listInstanceTemplatesOptions, "listInstanceTemplatesOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listInstanceTemplatesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceTemplates") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplateCollection) if err != nil { return } @@ -6935,65 +6983,86 @@ func (vpc *VpcV1) ListInstanceVolumeAttachmentsWithContext(ctx context.Context, return } -// CreateInstanceVolumeAttachment : Create a volume attachment on an instance -// This request creates a new volume attachment from a volume attachment prototype object, connecting a volume to an -// instance. For this request to succeed, the specified volume must not be busy. The prototype object is structured in -// the same way as a retrieved volume attachment, and contains the information necessary to create the new volume -// attachment. -func (vpc *VpcV1) CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceVolumeAttachmentWithContext(context.Background(), createInstanceVolumeAttachmentOptions) +// ListInstances : List all instances +// This request lists all instances in the region. +func (vpc *VpcV1) ListInstances(listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstancesWithContext(context.Background(), listInstancesOptions) } -// CreateInstanceVolumeAttachmentWithContext is an alternate form of the CreateInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceVolumeAttachmentWithContext(ctx context.Context, createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions") +// ListInstancesWithContext is an alternate form of the ListInstances method which supports a Context parameter +func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listInstancesOptions, "listInstancesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "instance_id": *createInstanceVolumeAttachmentOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) if err != nil { return } - for headerName, headerValue := range createInstanceVolumeAttachmentOptions.Headers { + for headerName, headerValue := range listInstancesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceVolumeAttachment") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstances") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceVolumeAttachmentOptions.Volume != nil { - body["volume"] = createInstanceVolumeAttachmentOptions.Volume + if listInstancesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstancesOptions.Start)) } - if createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete != nil { - body["delete_volume_on_instance_delete"] = createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete + if listInstancesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstancesOptions.Limit)) } - if createInstanceVolumeAttachmentOptions.Name != nil { - body["name"] = createInstanceVolumeAttachmentOptions.Name + if listInstancesOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listInstancesOptions.ResourceGroupID)) } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listInstancesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listInstancesOptions.Name)) + } + if listInstancesOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listInstancesOptions.VPCID)) + } + if listInstancesOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listInstancesOptions.VPCCRN)) + } + if listInstancesOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listInstancesOptions.VPCName)) + } + if listInstancesOptions.DedicatedHostID != nil { + builder.AddQuery("dedicated_host.id", fmt.Sprint(*listInstancesOptions.DedicatedHostID)) + } + if listInstancesOptions.DedicatedHostCRN != nil { + builder.AddQuery("dedicated_host.crn", fmt.Sprint(*listInstancesOptions.DedicatedHostCRN)) + } + if listInstancesOptions.DedicatedHostName != nil { + builder.AddQuery("dedicated_host.name", fmt.Sprint(*listInstancesOptions.DedicatedHostName)) + } + if listInstancesOptions.PlacementGroupID != nil { + builder.AddQuery("placement_group.id", fmt.Sprint(*listInstancesOptions.PlacementGroupID)) + } + if listInstancesOptions.PlacementGroupCRN != nil { + builder.AddQuery("placement_group.crn", fmt.Sprint(*listInstancesOptions.PlacementGroupCRN)) + } + if listInstancesOptions.PlacementGroupName != nil { + builder.AddQuery("placement_group.name", fmt.Sprint(*listInstancesOptions.PlacementGroupName)) + } + if listInstancesOptions.ReservationID != nil { + builder.AddQuery("reservation.id", fmt.Sprint(*listInstancesOptions.ReservationID)) + } + if listInstancesOptions.ReservationCRN != nil { + builder.AddQuery("reservation.crn", fmt.Sprint(*listInstancesOptions.ReservationCRN)) + } + if listInstancesOptions.ReservationName != nil { + builder.AddQuery("reservation.name", fmt.Sprint(*listInstancesOptions.ReservationName)) } request, err := builder.Build() @@ -7007,7 +7076,7 @@ func (vpc *VpcV1) CreateInstanceVolumeAttachmentWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceCollection) if err != nil { return } @@ -7017,42 +7086,42 @@ func (vpc *VpcV1) CreateInstanceVolumeAttachmentWithContext(ctx context.Context, return } -// DeleteInstanceVolumeAttachment : Delete a volume attachment -// This request deletes a volume attachment. This operation cannot be reversed, but a new volume attachment may -// subsequently be created for the volume. For this request to succeed, the volume must not be busy. -func (vpc *VpcV1) DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceVolumeAttachmentWithContext(context.Background(), deleteInstanceVolumeAttachmentOptions) +// RemoveInstanceNetworkInterfaceFloatingIP : Disassociate a floating IP from an instance network interface +// This request disassociates the specified floating IP from the specified instance network interface. +func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), removeInstanceNetworkInterfaceFloatingIPOptions) } -// DeleteInstanceVolumeAttachmentWithContext is an alternate form of the DeleteInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceVolumeAttachmentWithContext(ctx context.Context, deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions cannot be nil") +// RemoveInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveInstanceNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions") + err = core.ValidateStruct(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *deleteInstanceVolumeAttachmentOptions.InstanceID, - "id": *deleteInstanceVolumeAttachmentOptions.ID, + "instance_id": *removeInstanceNetworkInterfaceFloatingIPOptions.InstanceID, + "network_interface_id": *removeInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *removeInstanceNetworkInterfaceFloatingIPOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceVolumeAttachmentOptions.Headers { + for headerName, headerValue := range removeInstanceNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceVolumeAttachment") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveInstanceNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -7070,49 +7139,58 @@ func (vpc *VpcV1) DeleteInstanceVolumeAttachmentWithContext(ctx context.Context, return } -// GetInstanceVolumeAttachment : Retrieve a volume attachment -// This request retrieves a single volume attachment specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.GetInstanceVolumeAttachmentWithContext(context.Background(), getInstanceVolumeAttachmentOptions) +// UpdateInstance : Update an instance +// This request updates an instance with the information in a provided instance patch. The instance patch object is +// structured in the same way as a retrieved instance and contains only the information to be updated. +func (vpc *VpcV1) UpdateInstance(updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceWithContext(context.Background(), updateInstanceOptions) } -// GetInstanceVolumeAttachmentWithContext is an alternate form of the GetInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) GetInstanceVolumeAttachmentWithContext(ctx context.Context, getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions cannot be nil") +// UpdateInstanceWithContext is an alternate form of the UpdateInstance method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceOptions, "updateInstanceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions") + err = core.ValidateStruct(updateInstanceOptions, "updateInstanceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getInstanceVolumeAttachmentOptions.InstanceID, - "id": *getInstanceVolumeAttachmentOptions.ID, + "id": *updateInstanceOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceVolumeAttachmentOptions.Headers { + for headerName, headerValue := range updateInstanceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceVolumeAttachment") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstance") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateInstanceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateInstanceOptions.InstancePatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -7124,7 +7202,7 @@ func (vpc *VpcV1) GetInstanceVolumeAttachmentWithContext(ctx context.Context, ge return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) if err != nil { return } @@ -7134,43 +7212,41 @@ func (vpc *VpcV1) GetInstanceVolumeAttachmentWithContext(ctx context.Context, ge return } -// UpdateInstanceVolumeAttachment : Update a volume attachment -// This request updates a volume attachment with the information provided in a volume attachment patch object. The -// volume attachment patch object is structured in the same way as a retrieved volume attachment and needs to contain -// only the information to be updated. -func (vpc *VpcV1) UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceVolumeAttachmentWithContext(context.Background(), updateInstanceVolumeAttachmentOptions) +// UpdateInstanceDisk : Update an instance disk +// This request updates the instance disk with the information in a provided patch. +func (vpc *VpcV1) UpdateInstanceDisk(updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceDiskWithContext(context.Background(), updateInstanceDiskOptions) } -// UpdateInstanceVolumeAttachmentWithContext is an alternate form of the UpdateInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions cannot be nil") +// UpdateInstanceDiskWithContext is an alternate form of the UpdateInstanceDisk method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceDiskWithContext(ctx context.Context, updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceDiskOptions, "updateInstanceDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions") + err = core.ValidateStruct(updateInstanceDiskOptions, "updateInstanceDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *updateInstanceVolumeAttachmentOptions.InstanceID, - "id": *updateInstanceVolumeAttachmentOptions.ID, + "instance_id": *updateInstanceDiskOptions.InstanceID, + "id": *updateInstanceDiskOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceVolumeAttachmentOptions.Headers { + for headerName, headerValue := range updateInstanceDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceVolumeAttachment") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -7180,7 +7256,7 @@ func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceVolumeAttachmentOptions.VolumeAttachmentPatch) + _, err = builder.SetBodyContentJSON(updateInstanceDiskOptions.InstanceDiskPatch) if err != nil { return } @@ -7196,7 +7272,7 @@ func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) if err != nil { return } @@ -7206,44 +7282,55 @@ func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, return } -// ListInstanceGroups : List all instance groups -// This request lists all instance groups in the region. -func (vpc *VpcV1) ListInstanceGroups(listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupsWithContext(context.Background(), listInstanceGroupsOptions) +// UpdateInstanceNetworkAttachment : Update an instance network attachment +// This request updates an instance network attachment with the information provided in an instance network interface +// patch object. The instance network attachment patch object is structured in the same way as a retrieved instance +// network attachment and needs to contain only the information to be updated. +func (vpc *VpcV1) UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceNetworkAttachmentWithContext(context.Background(), updateInstanceNetworkAttachmentOptions) } -// ListInstanceGroupsWithContext is an alternate form of the ListInstanceGroups method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupsWithContext(ctx context.Context, listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceGroupsOptions, "listInstanceGroupsOptions") +// UpdateInstanceNetworkAttachmentWithContext is an alternate form of the UpdateInstanceNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceNetworkAttachmentWithContext(ctx context.Context, updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceNetworkAttachmentOptions, "updateInstanceNetworkAttachmentOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateInstanceNetworkAttachmentOptions, "updateInstanceNetworkAttachmentOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "instance_id": *updateInstanceNetworkAttachmentOptions.InstanceID, + "id": *updateInstanceNetworkAttachmentOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceGroupsOptions.Headers { + for headerName, headerValue := range updateInstanceNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroups") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupsOptions.Start)) - } - if listInstanceGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupsOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateInstanceNetworkAttachmentOptions.InstanceNetworkAttachmentPatch) + if err != nil { + return } request, err := builder.Build() @@ -7257,7 +7344,7 @@ func (vpc *VpcV1) ListInstanceGroupsWithContext(ctx context.Context, listInstanc return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) if err != nil { return } @@ -7267,71 +7354,57 @@ func (vpc *VpcV1) ListInstanceGroupsWithContext(ctx context.Context, listInstanc return } -// CreateInstanceGroup : Create an instance group -// This request creates a new instance group. -func (vpc *VpcV1) CreateInstanceGroup(createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupWithContext(context.Background(), createInstanceGroupOptions) +// UpdateInstanceNetworkInterface : Update an instance network interface +// This request updates an instance network interface with the information provided in an instance network interface +// patch object. The instance network interface patch object is structured in the same way as a retrieved instance +// network interface and needs to contain only the information to be updated. +// +// If this instance has network attachments, this network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be updated. +func (vpc *VpcV1) UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceNetworkInterfaceWithContext(context.Background(), updateInstanceNetworkInterfaceOptions) } -// CreateInstanceGroupWithContext is an alternate form of the CreateInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupWithContext(ctx context.Context, createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupOptions, "createInstanceGroupOptions cannot be nil") +// UpdateInstanceNetworkInterfaceWithContext is an alternate form of the UpdateInstanceNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceNetworkInterfaceWithContext(ctx context.Context, updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceGroupOptions, "createInstanceGroupOptions") + err = core.ValidateStruct(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "instance_id": *updateInstanceNetworkInterfaceOptions.InstanceID, + "id": *updateInstanceNetworkInterfaceOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceGroupOptions.Headers { + for headerName, headerValue := range updateInstanceNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createInstanceGroupOptions.InstanceTemplate != nil { - body["instance_template"] = createInstanceGroupOptions.InstanceTemplate - } - if createInstanceGroupOptions.Subnets != nil { - body["subnets"] = createInstanceGroupOptions.Subnets - } - if createInstanceGroupOptions.ApplicationPort != nil { - body["application_port"] = createInstanceGroupOptions.ApplicationPort - } - if createInstanceGroupOptions.LoadBalancer != nil { - body["load_balancer"] = createInstanceGroupOptions.LoadBalancer - } - if createInstanceGroupOptions.LoadBalancerPool != nil { - body["load_balancer_pool"] = createInstanceGroupOptions.LoadBalancerPool - } - if createInstanceGroupOptions.MembershipCount != nil { - body["membership_count"] = createInstanceGroupOptions.MembershipCount - } - if createInstanceGroupOptions.Name != nil { - body["name"] = createInstanceGroupOptions.Name - } - if createInstanceGroupOptions.ResourceGroup != nil { - body["resource_group"] = createInstanceGroupOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateInstanceNetworkInterfaceOptions.NetworkInterfacePatch) if err != nil { return } @@ -7347,7 +7420,7 @@ func (vpc *VpcV1) CreateInstanceGroupWithContext(ctx context.Context, createInst return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) if err != nil { return } @@ -7357,100 +7430,56 @@ func (vpc *VpcV1) CreateInstanceGroupWithContext(ctx context.Context, createInst return } -// DeleteInstanceGroup : Delete an instance group -// This request deletes an instance group. This operation cannot be reversed. Any instances associated with the group -// will be deleted. -func (vpc *VpcV1) DeleteInstanceGroup(deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupWithContext(context.Background(), deleteInstanceGroupOptions) +// UpdateInstanceTemplate : Update an instance template +// This request updates an instance template with the information provided in the instance template patch. The instance +// template patch object is structured in the same way as a retrieved instance template and contains only the +// information to be updated. +func (vpc *VpcV1) UpdateInstanceTemplate(updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceTemplateWithContext(context.Background(), updateInstanceTemplateOptions) } -// DeleteInstanceGroupWithContext is an alternate form of the DeleteInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupWithContext(ctx context.Context, deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupOptions, "deleteInstanceGroupOptions cannot be nil") +// UpdateInstanceTemplateWithContext is an alternate form of the UpdateInstanceTemplate method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceTemplateWithContext(ctx context.Context, updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceTemplateOptions, "updateInstanceTemplateOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupOptions, "deleteInstanceGroupOptions") + err = core.ValidateStruct(updateInstanceTemplateOptions, "updateInstanceTemplateOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteInstanceGroupOptions.ID, + "id": *updateInstanceTemplateOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupOptions.Headers { + for headerName, headerValue := range updateInstanceTemplateOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceTemplate") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetInstanceGroup : Retrieve an instance group -// This request retrieves a single instance group specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroup(getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupWithContext(context.Background(), getInstanceGroupOptions) -} - -// GetInstanceGroupWithContext is an alternate form of the GetInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupWithContext(ctx context.Context, getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupOptions, "getInstanceGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupOptions, "getInstanceGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getInstanceGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) + _, err = builder.SetBodyContentJSON(updateInstanceTemplateOptions.InstanceTemplatePatch) if err != nil { return } - for headerName, headerValue := range getInstanceGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() if err != nil { return @@ -7462,7 +7491,7 @@ func (vpc *VpcV1) GetInstanceGroupWithContext(ctx context.Context, getInstanceGr return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) if err != nil { return } @@ -7472,41 +7501,43 @@ func (vpc *VpcV1) GetInstanceGroupWithContext(ctx context.Context, getInstanceGr return } -// UpdateInstanceGroup : Update an instance group -// This request updates an instance group with the information provided instance group patch. The instance group patch -// object is structured in the same way as a retrieved instance group and contains only the information to be updated. -func (vpc *VpcV1) UpdateInstanceGroup(updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupWithContext(context.Background(), updateInstanceGroupOptions) +// UpdateInstanceVolumeAttachment : Update a volume attachment +// This request updates a volume attachment with the information provided in a volume attachment patch object. The +// volume attachment patch object is structured in the same way as a retrieved volume attachment and needs to contain +// only the information to be updated. +func (vpc *VpcV1) UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceVolumeAttachmentWithContext(context.Background(), updateInstanceVolumeAttachmentOptions) } -// UpdateInstanceGroupWithContext is an alternate form of the UpdateInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupOptions, "updateInstanceGroupOptions cannot be nil") +// UpdateInstanceVolumeAttachmentWithContext is an alternate form of the UpdateInstanceVolumeAttachment method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceGroupOptions, "updateInstanceGroupOptions") + err = core.ValidateStruct(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateInstanceGroupOptions.ID, + "instance_id": *updateInstanceVolumeAttachmentOptions.InstanceID, + "id": *updateInstanceVolumeAttachmentOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceGroupOptions.Headers { + for headerName, headerValue := range updateInstanceVolumeAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceVolumeAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -7516,7 +7547,7 @@ func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInst builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceGroupOptions.InstanceGroupPatch) + _, err = builder.SetBodyContentJSON(updateInstanceVolumeAttachmentOptions.VolumeAttachmentPatch) if err != nil { return } @@ -7532,7 +7563,7 @@ func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInst return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) if err != nil { return } @@ -7542,103 +7573,73 @@ func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInst return } -// DeleteInstanceGroupLoadBalancer : Delete an instance group load balancer -// This request unbinds the instance group from the load balancer pool, and deletes the load balancer pool members. -func (vpc *VpcV1) DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupLoadBalancerWithContext(context.Background(), deleteInstanceGroupLoadBalancerOptions) +// CreateInstanceGroup : Create an instance group +// This request creates a new instance group. +func (vpc *VpcV1) CreateInstanceGroup(createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceGroupWithContext(context.Background(), createInstanceGroupOptions) } -// DeleteInstanceGroupLoadBalancerWithContext is an alternate form of the DeleteInstanceGroupLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupLoadBalancerWithContext(ctx context.Context, deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions cannot be nil") +// CreateInstanceGroupWithContext is an alternate form of the CreateInstanceGroup method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceGroupWithContext(ctx context.Context, createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceGroupOptions, "createInstanceGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions") + err = core.ValidateStruct(createInstanceGroupOptions, "createInstanceGroupOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupLoadBalancerOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/load_balancer`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupLoadBalancerOptions.Headers { + for headerName, headerValue := range createInstanceGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return + body := make(map[string]interface{}) + if createInstanceGroupOptions.InstanceTemplate != nil { + body["instance_template"] = createInstanceGroupOptions.InstanceTemplate } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// ListInstanceGroupManagers : List all managers for an instance group -// This request lists all managers for an instance group. -func (vpc *VpcV1) ListInstanceGroupManagers(listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagersWithContext(context.Background(), listInstanceGroupManagersOptions) -} - -// ListInstanceGroupManagersWithContext is an alternate form of the ListInstanceGroupManagers method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagersWithContext(ctx context.Context, listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions cannot be nil") - if err != nil { - return + if createInstanceGroupOptions.Subnets != nil { + body["subnets"] = createInstanceGroupOptions.Subnets } - err = core.ValidateStruct(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions") - if err != nil { - return + if createInstanceGroupOptions.ApplicationPort != nil { + body["application_port"] = createInstanceGroupOptions.ApplicationPort } - - pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagersOptions.InstanceGroupID, + if createInstanceGroupOptions.LoadBalancer != nil { + body["load_balancer"] = createInstanceGroupOptions.LoadBalancer } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers`, pathParamsMap) - if err != nil { - return + if createInstanceGroupOptions.LoadBalancerPool != nil { + body["load_balancer_pool"] = createInstanceGroupOptions.LoadBalancerPool } - - for headerName, headerValue := range listInstanceGroupManagersOptions.Headers { - builder.AddHeader(headerName, headerValue) + if createInstanceGroupOptions.MembershipCount != nil { + body["membership_count"] = createInstanceGroupOptions.MembershipCount } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) + if createInstanceGroupOptions.Name != nil { + body["name"] = createInstanceGroupOptions.Name } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagersOptions.Start)) + if createInstanceGroupOptions.ResourceGroup != nil { + body["resource_group"] = createInstanceGroupOptions.ResourceGroup } - if listInstanceGroupManagersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagersOptions.Limit)) + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -7652,7 +7653,7 @@ func (vpc *VpcV1) ListInstanceGroupManagersWithContext(ctx context.Context, list return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) if err != nil { return } @@ -7731,101 +7732,125 @@ func (vpc *VpcV1) CreateInstanceGroupManagerWithContext(ctx context.Context, cre return } -// DeleteInstanceGroupManager : Delete an instance group manager -// This request deletes an instance group manager. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceGroupManager(deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupManagerWithContext(context.Background(), deleteInstanceGroupManagerOptions) +// CreateInstanceGroupManagerAction : Create an instance group manager action +// This request creates a new instance group manager action. +func (vpc *VpcV1) CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceGroupManagerActionWithContext(context.Background(), createInstanceGroupManagerActionOptions) } -// DeleteInstanceGroupManagerWithContext is an alternate form of the DeleteInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupManagerWithContext(ctx context.Context, deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions cannot be nil") +// CreateInstanceGroupManagerActionWithContext is an alternate form of the CreateInstanceGroupManagerAction method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceGroupManagerActionWithContext(ctx context.Context, createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions") + err = core.ValidateStruct(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupManagerOptions.InstanceGroupID, - "id": *deleteInstanceGroupManagerOptions.ID, + "instance_group_id": *createInstanceGroupManagerActionOptions.InstanceGroupID, + "instance_group_manager_id": *createInstanceGroupManagerActionOptions.InstanceGroupManagerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupManagerOptions.Headers { + for headerName, headerValue := range createInstanceGroupManagerActionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManager") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerAction") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createInstanceGroupManagerActionOptions.InstanceGroupManagerActionPrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) + if err != nil { + return + } + response.Result = result + } return } -// GetInstanceGroupManager : Retrieve an instance group manager -// This request retrieves a single instance group manager specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupManager(getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupManagerWithContext(context.Background(), getInstanceGroupManagerOptions) +// CreateInstanceGroupManagerPolicy : Create a policy for an instance group manager +// This request creates a new instance group manager policy. +func (vpc *VpcV1) CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { + return vpc.CreateInstanceGroupManagerPolicyWithContext(context.Background(), createInstanceGroupManagerPolicyOptions) } -// GetInstanceGroupManagerWithContext is an alternate form of the GetInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupManagerWithContext(ctx context.Context, getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions cannot be nil") +// CreateInstanceGroupManagerPolicyWithContext is an alternate form of the CreateInstanceGroupManagerPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateInstanceGroupManagerPolicyWithContext(ctx context.Context, createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions") + err = core.ValidateStruct(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupManagerOptions.InstanceGroupID, - "id": *getInstanceGroupManagerOptions.ID, + "instance_group_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupID, + "instance_group_manager_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceGroupManagerOptions.Headers { + for headerName, headerValue := range createInstanceGroupManagerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManager") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -7837,7 +7862,7 @@ func (vpc *VpcV1) GetInstanceGroupManagerWithContext(ctx context.Context, getIns return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) if err != nil { return } @@ -7847,212 +7872,157 @@ func (vpc *VpcV1) GetInstanceGroupManagerWithContext(ctx context.Context, getIns return } -// UpdateInstanceGroupManager : Update an instance group manager -// This request updates an instance group manager with the information provided instance group manager patch. -func (vpc *VpcV1) UpdateInstanceGroupManager(updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerWithContext(context.Background(), updateInstanceGroupManagerOptions) +// DeleteInstanceGroup : Delete an instance group +// This request deletes an instance group. This operation cannot be reversed. Any instances associated with the group +// will be deleted. +func (vpc *VpcV1) DeleteInstanceGroup(deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupWithContext(context.Background(), deleteInstanceGroupOptions) } -// UpdateInstanceGroupManagerWithContext is an alternate form of the UpdateInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerWithContext(ctx context.Context, updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions cannot be nil") +// DeleteInstanceGroupWithContext is an alternate form of the DeleteInstanceGroup method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupWithContext(ctx context.Context, deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupOptions, "deleteInstanceGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions") + err = core.ValidateStruct(deleteInstanceGroupOptions, "deleteInstanceGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerOptions.InstanceGroupID, - "id": *updateInstanceGroupManagerOptions.ID, + "id": *deleteInstanceGroupOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceGroupManagerOptions.Headers { + for headerName, headerValue := range deleteInstanceGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManager") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerOptions.InstanceGroupManagerPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListInstanceGroupManagerActions : List all actions for an instance group manager -// This request lists all instance group actions for an instance group manager. -func (vpc *VpcV1) ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagerActionsWithContext(context.Background(), listInstanceGroupManagerActionsOptions) +// DeleteInstanceGroupLoadBalancer : Delete an instance group load balancer +// This request unbinds the instance group from the load balancer pool, and deletes the load balancer pool members. +func (vpc *VpcV1) DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupLoadBalancerWithContext(context.Background(), deleteInstanceGroupLoadBalancerOptions) } -// ListInstanceGroupManagerActionsWithContext is an alternate form of the ListInstanceGroupManagerActions method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagerActionsWithContext(ctx context.Context, listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions cannot be nil") +// DeleteInstanceGroupLoadBalancerWithContext is an alternate form of the DeleteInstanceGroupLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupLoadBalancerWithContext(ctx context.Context, deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions") + err = core.ValidateStruct(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagerActionsOptions.InstanceGroupID, - "instance_group_manager_id": *listInstanceGroupManagerActionsOptions.InstanceGroupManagerID, + "instance_group_id": *deleteInstanceGroupLoadBalancerOptions.InstanceGroupID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/load_balancer`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceGroupManagerActionsOptions.Headers { + for headerName, headerValue := range deleteInstanceGroupLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerActions") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagerActionsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Start)) - } - if listInstanceGroupManagerActionsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Limit)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerActionsCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateInstanceGroupManagerAction : Create an instance group manager action -// This request creates a new instance group manager action. -func (vpc *VpcV1) CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupManagerActionWithContext(context.Background(), createInstanceGroupManagerActionOptions) +// DeleteInstanceGroupManager : Delete an instance group manager +// This request deletes an instance group manager. This operation cannot be reversed. +func (vpc *VpcV1) DeleteInstanceGroupManager(deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupManagerWithContext(context.Background(), deleteInstanceGroupManagerOptions) } -// CreateInstanceGroupManagerActionWithContext is an alternate form of the CreateInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupManagerActionWithContext(ctx context.Context, createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions cannot be nil") +// DeleteInstanceGroupManagerWithContext is an alternate form of the DeleteInstanceGroupManager method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupManagerWithContext(ctx context.Context, deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions") + err = core.ValidateStruct(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *createInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *createInstanceGroupManagerActionOptions.InstanceGroupManagerID, + "instance_group_id": *deleteInstanceGroupManagerOptions.InstanceGroupID, + "id": *deleteInstanceGroupManagerOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceGroupManagerActionOptions.Headers { + for headerName, headerValue := range deleteInstanceGroupManagerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerAction") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManager") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createInstanceGroupManagerActionOptions.InstanceGroupManagerActionPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } @@ -8110,46 +8080,45 @@ func (vpc *VpcV1) DeleteInstanceGroupManagerActionWithContext(ctx context.Contex return } -// GetInstanceGroupManagerAction : Retrieve specified instance group manager action -// This request retrieves a single instance group manager action specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupManagerActionWithContext(context.Background(), getInstanceGroupManagerActionOptions) +// DeleteInstanceGroupManagerPolicy : Delete an instance group manager policy +// This request deletes an instance group manager policy. This operation cannot be reversed. +func (vpc *VpcV1) DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupManagerPolicyWithContext(context.Background(), deleteInstanceGroupManagerPolicyOptions) } -// GetInstanceGroupManagerActionWithContext is an alternate form of the GetInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupManagerActionWithContext(ctx context.Context, getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions cannot be nil") +// DeleteInstanceGroupManagerPolicyWithContext is an alternate form of the DeleteInstanceGroupManagerPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupManagerPolicyWithContext(ctx context.Context, deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions") + err = core.ValidateStruct(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *getInstanceGroupManagerActionOptions.InstanceGroupManagerID, - "id": *getInstanceGroupManagerActionOptions.ID, + "instance_group_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupID, + "instance_group_manager_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, + "id": *deleteInstanceGroupManagerPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceGroupManagerActionOptions.Headers { + for headerName, headerValue := range deleteInstanceGroupManagerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManagerAction") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManagerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -8159,128 +8128,150 @@ func (vpc *VpcV1) GetInstanceGroupManagerActionWithContext(ctx context.Context, return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateInstanceGroupManagerAction : Update specified instance group manager action -// This request updates an instance group manager action. -func (vpc *VpcV1) UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerActionWithContext(context.Background(), updateInstanceGroupManagerActionOptions) +// DeleteInstanceGroupMembership : Delete an instance group membership +// This request deletes a memberships of an instance group. This operation cannot be reversed. reversed. If the +// membership has `delete_instance_on_membership_delete` set to `true`, the instance will also be deleted. +func (vpc *VpcV1) DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupMembershipWithContext(context.Background(), deleteInstanceGroupMembershipOptions) } -// UpdateInstanceGroupManagerActionWithContext is an alternate form of the UpdateInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerActionWithContext(ctx context.Context, updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions cannot be nil") +// DeleteInstanceGroupMembershipWithContext is an alternate form of the DeleteInstanceGroupMembership method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupMembershipWithContext(ctx context.Context, deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions") + err = core.ValidateStruct(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *updateInstanceGroupManagerActionOptions.InstanceGroupManagerID, - "id": *updateInstanceGroupManagerActionOptions.ID, + "instance_group_id": *deleteInstanceGroupMembershipOptions.InstanceGroupID, + "id": *deleteInstanceGroupMembershipOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceGroupManagerActionOptions.Headers { + for headerName, headerValue := range deleteInstanceGroupMembershipOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerAction") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMembership") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerActionOptions.InstanceGroupManagerActionPatch) + request, err := builder.Build() if err != nil { return } - request, err := builder.Build() + response, err = vpc.Service.Request(request, nil) + + return +} + +// DeleteInstanceGroupMemberships : Delete all memberships from an instance group +// This request deletes all memberships of an instance group. This operation cannot be reversed. reversed. Any +// memberships that have `delete_instance_on_membership_delete` set to `true` will also have their instances deleted. +func (vpc *VpcV1) DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteInstanceGroupMembershipsWithContext(context.Background(), deleteInstanceGroupMembershipsOptions) +} + +// DeleteInstanceGroupMembershipsWithContext is an alternate form of the DeleteInstanceGroupMemberships method which supports a Context parameter +func (vpc *VpcV1) DeleteInstanceGroupMembershipsWithContext(ctx context.Context, deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions cannot be nil") if err != nil { return } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) + err = core.ValidateStruct(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions") if err != nil { return } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result + + pathParamsMap := map[string]string{ + "instance_group_id": *deleteInstanceGroupMembershipsOptions.InstanceGroupID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteInstanceGroupMembershipsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMemberships") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return } + response, err = vpc.Service.Request(request, nil) + return } -// ListInstanceGroupManagerPolicies : List all policies for an instance group manager -// This request lists all policies for an instance group manager. -func (vpc *VpcV1) ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagerPoliciesWithContext(context.Background(), listInstanceGroupManagerPoliciesOptions) +// GetInstanceGroup : Retrieve an instance group +// This request retrieves a single instance group specified by identifier in the URL. +func (vpc *VpcV1) GetInstanceGroup(getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + return vpc.GetInstanceGroupWithContext(context.Background(), getInstanceGroupOptions) } -// ListInstanceGroupManagerPoliciesWithContext is an alternate form of the ListInstanceGroupManagerPolicies method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Context, listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions cannot be nil") +// GetInstanceGroupWithContext is an alternate form of the GetInstanceGroup method which supports a Context parameter +func (vpc *VpcV1) GetInstanceGroupWithContext(ctx context.Context, getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceGroupOptions, "getInstanceGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions") + err = core.ValidateStruct(getInstanceGroupOptions, "getInstanceGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupID, - "instance_group_manager_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupManagerID, + "id": *getInstanceGroupOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceGroupManagerPoliciesOptions.Headers { + for headerName, headerValue := range getInstanceGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerPolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -8288,12 +8279,6 @@ func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Contex builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagerPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Start)) - } - if listInstanceGroupManagerPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Limit)) - } request, err := builder.Build() if err != nil { @@ -8306,7 +8291,7 @@ func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) if err != nil { return } @@ -8316,55 +8301,49 @@ func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Contex return } -// CreateInstanceGroupManagerPolicy : Create a policy for an instance group manager -// This request creates a new instance group manager policy. -func (vpc *VpcV1) CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupManagerPolicyWithContext(context.Background(), createInstanceGroupManagerPolicyOptions) +// GetInstanceGroupManager : Retrieve an instance group manager +// This request retrieves a single instance group manager specified by identifier in the URL. +func (vpc *VpcV1) GetInstanceGroupManager(getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { + return vpc.GetInstanceGroupManagerWithContext(context.Background(), getInstanceGroupManagerOptions) } -// CreateInstanceGroupManagerPolicyWithContext is an alternate form of the CreateInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupManagerPolicyWithContext(ctx context.Context, createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions cannot be nil") +// GetInstanceGroupManagerWithContext is an alternate form of the GetInstanceGroupManager method which supports a Context parameter +func (vpc *VpcV1) GetInstanceGroupManagerWithContext(ctx context.Context, getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions") + err = core.ValidateStruct(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, + "instance_group_id": *getInstanceGroupManagerOptions.InstanceGroupID, + "id": *getInstanceGroupManagerOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createInstanceGroupManagerPolicyOptions.Headers { + for headerName, headerValue := range getInstanceGroupManagerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManager") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -8376,7 +8355,7 @@ func (vpc *VpcV1) CreateInstanceGroupManagerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) if err != nil { return } @@ -8386,45 +8365,46 @@ func (vpc *VpcV1) CreateInstanceGroupManagerPolicyWithContext(ctx context.Contex return } -// DeleteInstanceGroupManagerPolicy : Delete an instance group manager policy -// This request deletes an instance group manager policy. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupManagerPolicyWithContext(context.Background(), deleteInstanceGroupManagerPolicyOptions) +// GetInstanceGroupManagerAction : Retrieve specified instance group manager action +// This request retrieves a single instance group manager action specified by identifier in the URL. +func (vpc *VpcV1) GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + return vpc.GetInstanceGroupManagerActionWithContext(context.Background(), getInstanceGroupManagerActionOptions) } -// DeleteInstanceGroupManagerPolicyWithContext is an alternate form of the DeleteInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupManagerPolicyWithContext(ctx context.Context, deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions cannot be nil") +// GetInstanceGroupManagerActionWithContext is an alternate form of the GetInstanceGroupManagerAction method which supports a Context parameter +func (vpc *VpcV1) GetInstanceGroupManagerActionWithContext(ctx context.Context, getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions") + err = core.ValidateStruct(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - "id": *deleteInstanceGroupManagerPolicyOptions.ID, + "instance_group_id": *getInstanceGroupManagerActionOptions.InstanceGroupID, + "instance_group_manager_id": *getInstanceGroupManagerActionOptions.InstanceGroupManagerID, + "id": *getInstanceGroupManagerActionOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupManagerPolicyOptions.Headers { + for headerName, headerValue := range getInstanceGroupManagerActionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManagerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManagerAction") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -8434,7 +8414,18 @@ func (vpc *VpcV1) DeleteInstanceGroupManagerPolicyWithContext(ctx context.Contex return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) + if err != nil { + return + } + response.Result = result + } return } @@ -8504,56 +8495,49 @@ func (vpc *VpcV1) GetInstanceGroupManagerPolicyWithContext(ctx context.Context, return } -// UpdateInstanceGroupManagerPolicy : Update an instance group manager policy -// This request updates an instance group manager policy. -func (vpc *VpcV1) UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerPolicyWithContext(context.Background(), updateInstanceGroupManagerPolicyOptions) +// GetInstanceGroupMembership : Retrieve an instance group membership +// This request retrieves a single instance group membership specified by identifier in the URL. +func (vpc *VpcV1) GetInstanceGroupMembership(getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { + return vpc.GetInstanceGroupMembershipWithContext(context.Background(), getInstanceGroupMembershipOptions) } -// UpdateInstanceGroupManagerPolicyWithContext is an alternate form of the UpdateInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerPolicyWithContext(ctx context.Context, updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions cannot be nil") +// GetInstanceGroupMembershipWithContext is an alternate form of the GetInstanceGroupMembership method which supports a Context parameter +func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions") + err = core.ValidateStruct(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - "id": *updateInstanceGroupManagerPolicyOptions.ID, + "instance_group_id": *getInstanceGroupMembershipOptions.InstanceGroupID, + "id": *getInstanceGroupMembershipOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateInstanceGroupManagerPolicyOptions.Headers { + for headerName, headerValue := range getInstanceGroupMembershipOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupMembership") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -8565,7 +8549,7 @@ func (vpc *VpcV1) UpdateInstanceGroupManagerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) if err != nil { return } @@ -8575,92 +8559,111 @@ func (vpc *VpcV1) UpdateInstanceGroupManagerPolicyWithContext(ctx context.Contex return } -// DeleteInstanceGroupMemberships : Delete all memberships from an instance group -// This request deletes all memberships of an instance group. This operation cannot be reversed. reversed. Any -// memberships that have `delete_instance_on_membership_delete` set to `true` will also have their instances deleted. -func (vpc *VpcV1) DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupMembershipsWithContext(context.Background(), deleteInstanceGroupMembershipsOptions) +// ListInstanceGroupManagerActions : List all actions for an instance group manager +// This request lists all instance group actions for an instance group manager. +func (vpc *VpcV1) ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceGroupManagerActionsWithContext(context.Background(), listInstanceGroupManagerActionsOptions) } -// DeleteInstanceGroupMembershipsWithContext is an alternate form of the DeleteInstanceGroupMemberships method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupMembershipsWithContext(ctx context.Context, deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions cannot be nil") +// ListInstanceGroupManagerActionsWithContext is an alternate form of the ListInstanceGroupManagerActions method which supports a Context parameter +func (vpc *VpcV1) ListInstanceGroupManagerActionsWithContext(ctx context.Context, listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions") + err = core.ValidateStruct(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupMembershipsOptions.InstanceGroupID, + "instance_group_id": *listInstanceGroupManagerActionsOptions.InstanceGroupID, + "instance_group_manager_id": *listInstanceGroupManagerActionsOptions.InstanceGroupManagerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupMembershipsOptions.Headers { + for headerName, headerValue := range listInstanceGroupManagerActionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMemberships") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerActions") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listInstanceGroupManagerActionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Start)) + } + if listInstanceGroupManagerActionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerActionsCollection) + if err != nil { + return + } + response.Result = result + } return } -// ListInstanceGroupMemberships : List all memberships for an instance group -// This request lists all instance group memberships for an instance group. -func (vpc *VpcV1) ListInstanceGroupMemberships(listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupMembershipsWithContext(context.Background(), listInstanceGroupMembershipsOptions) +// ListInstanceGroupManagerPolicies : List all policies for an instance group manager +// This request lists all policies for an instance group manager. +func (vpc *VpcV1) ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceGroupManagerPoliciesWithContext(context.Background(), listInstanceGroupManagerPoliciesOptions) } -// ListInstanceGroupMembershipsWithContext is an alternate form of the ListInstanceGroupMemberships method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions cannot be nil") +// ListInstanceGroupManagerPoliciesWithContext is an alternate form of the ListInstanceGroupManagerPolicies method which supports a Context parameter +func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Context, listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions") + err = core.ValidateStruct(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupMembershipsOptions.InstanceGroupID, + "instance_group_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupID, + "instance_group_manager_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupManagerID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listInstanceGroupMembershipsOptions.Headers { + for headerName, headerValue := range listInstanceGroupManagerPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupMemberships") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -8668,11 +8671,11 @@ func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, l builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupMembershipsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupMembershipsOptions.Start)) + if listInstanceGroupManagerPoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Start)) } - if listInstanceGroupMembershipsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupMembershipsOptions.Limit)) + if listInstanceGroupManagerPoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Limit)) } request, err := builder.Build() @@ -8686,7 +8689,7 @@ func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, l return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembershipCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicyCollection) if err != nil { return } @@ -8696,94 +8699,109 @@ func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, l return } -// DeleteInstanceGroupMembership : Delete an instance group membership -// This request deletes a memberships of an instance group. This operation cannot be reversed. reversed. If the -// membership has `delete_instance_on_membership_delete` set to `true`, the instance will also be deleted. -func (vpc *VpcV1) DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupMembershipWithContext(context.Background(), deleteInstanceGroupMembershipOptions) +// ListInstanceGroupManagers : List all managers for an instance group +// This request lists all managers for an instance group. +func (vpc *VpcV1) ListInstanceGroupManagers(listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceGroupManagersWithContext(context.Background(), listInstanceGroupManagersOptions) } -// DeleteInstanceGroupMembershipWithContext is an alternate form of the DeleteInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupMembershipWithContext(ctx context.Context, deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions cannot be nil") +// ListInstanceGroupManagersWithContext is an alternate form of the ListInstanceGroupManagers method which supports a Context parameter +func (vpc *VpcV1) ListInstanceGroupManagersWithContext(ctx context.Context, listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions") + err = core.ValidateStruct(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupMembershipOptions.InstanceGroupID, - "id": *deleteInstanceGroupMembershipOptions.ID, + "instance_group_id": *listInstanceGroupManagersOptions.InstanceGroupID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteInstanceGroupMembershipOptions.Headers { + for headerName, headerValue := range listInstanceGroupManagersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMembership") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listInstanceGroupManagersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagersOptions.Start)) + } + if listInstanceGroupManagersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagersOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetInstanceGroupMembership : Retrieve an instance group membership -// This request retrieves a single instance group membership specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupMembership(getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupMembershipWithContext(context.Background(), getInstanceGroupMembershipOptions) +// ListInstanceGroupMemberships : List all memberships for an instance group +// This request lists all instance group memberships for an instance group. +func (vpc *VpcV1) ListInstanceGroupMemberships(listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceGroupMembershipsWithContext(context.Background(), listInstanceGroupMembershipsOptions) } -// GetInstanceGroupMembershipWithContext is an alternate form of the GetInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions cannot be nil") +// ListInstanceGroupMembershipsWithContext is an alternate form of the ListInstanceGroupMemberships method which supports a Context parameter +func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions") + err = core.ValidateStruct(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupMembershipOptions.InstanceGroupID, - "id": *getInstanceGroupMembershipOptions.ID, + "instance_group_id": *listInstanceGroupMembershipsOptions.InstanceGroupID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getInstanceGroupMembershipOptions.Headers { + for headerName, headerValue := range listInstanceGroupMembershipsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupMembership") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupMemberships") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -8791,6 +8809,12 @@ func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, get builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listInstanceGroupMembershipsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceGroupMembershipsOptions.Start)) + } + if listInstanceGroupMembershipsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupMembershipsOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -8803,7 +8827,7 @@ func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, get return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembershipCollection) if err != nil { return } @@ -8813,53 +8837,44 @@ func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, get return } -// UpdateInstanceGroupMembership : Update an instance group membership -// This request updates an instance group membership with the information provided instance group membership patch. -func (vpc *VpcV1) UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupMembershipWithContext(context.Background(), updateInstanceGroupMembershipOptions) +// ListInstanceGroups : List all instance groups +// This request lists all instance groups in the region. +func (vpc *VpcV1) ListInstanceGroups(listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListInstanceGroupsWithContext(context.Background(), listInstanceGroupsOptions) } -// UpdateInstanceGroupMembershipWithContext is an alternate form of the UpdateInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions") +// ListInstanceGroupsWithContext is an alternate form of the ListInstanceGroups method which supports a Context parameter +func (vpc *VpcV1) ListInstanceGroupsWithContext(ctx context.Context, listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listInstanceGroupsOptions, "listInstanceGroupsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupMembershipOptions.InstanceGroupID, - "id": *updateInstanceGroupMembershipOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) if err != nil { return } - for headerName, headerValue := range updateInstanceGroupMembershipOptions.Headers { + for headerName, headerValue := range listInstanceGroupsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupMembership") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroups") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupMembershipOptions.InstanceGroupMembershipPatch) - if err != nil { - return + if listInstanceGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceGroupsOptions.Start)) + } + if listInstanceGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupsOptions.Limit)) } request, err := builder.Build() @@ -8873,7 +8888,7 @@ func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupCollection) if err != nil { return } @@ -8883,59 +8898,53 @@ func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, return } -// ListReservations : List all reservations -// This request lists all reservations in the region. A reservation provides reserved capacity for a specified profile -// in a specified zone. A reservation can also include a long-term committed use discount. -// -// The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations -// with identical `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListReservations(listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { - return vpc.ListReservationsWithContext(context.Background(), listReservationsOptions) +// UpdateInstanceGroup : Update an instance group +// This request updates an instance group with the information provided instance group patch. The instance group patch +// object is structured in the same way as a retrieved instance group and contains only the information to be updated. +func (vpc *VpcV1) UpdateInstanceGroup(updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceGroupWithContext(context.Background(), updateInstanceGroupOptions) } -// ListReservationsWithContext is an alternate form of the ListReservations method which supports a Context parameter -func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listReservationsOptions, "listReservationsOptions") +// UpdateInstanceGroupWithContext is an alternate form of the UpdateInstanceGroup method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceGroupOptions, "updateInstanceGroupOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateInstanceGroupOptions, "updateInstanceGroupOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *updateInstanceGroupOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listReservationsOptions.Headers { + for headerName, headerValue := range updateInstanceGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListReservations") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listReservationsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listReservationsOptions.Start)) - } - if listReservationsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listReservationsOptions.Limit)) - } - if listReservationsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listReservationsOptions.Name)) - } - if listReservationsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listReservationsOptions.ResourceGroupID)) - } - if listReservationsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listReservationsOptions.ZoneName)) + + _, err = builder.SetBodyContentJSON(updateInstanceGroupOptions.InstanceGroupPatch) + if err != nil { + return } request, err := builder.Build() @@ -8949,7 +8958,7 @@ func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservati return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservationCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) if err != nil { return } @@ -8959,71 +8968,51 @@ func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservati return } -// CreateReservation : Create a reservation -// This request creates a new reservation from a reservation prototype object. The prototype object is structured in the -// same way as a retrieved reservation, and contains the information necessary to create the new reservation. -func (vpc *VpcV1) CreateReservation(createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.CreateReservationWithContext(context.Background(), createReservationOptions) +// UpdateInstanceGroupManager : Update an instance group manager +// This request updates an instance group manager with the information provided instance group manager patch. +func (vpc *VpcV1) UpdateInstanceGroupManager(updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceGroupManagerWithContext(context.Background(), updateInstanceGroupManagerOptions) } -// CreateReservationWithContext is an alternate form of the CreateReservation method which supports a Context parameter -func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createReservationOptions, "createReservationOptions cannot be nil") +// UpdateInstanceGroupManagerWithContext is an alternate form of the UpdateInstanceGroupManager method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceGroupManagerWithContext(ctx context.Context, updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createReservationOptions, "createReservationOptions") + err = core.ValidateStruct(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "instance_group_id": *updateInstanceGroupManagerOptions.InstanceGroupID, + "id": *updateInstanceGroupManagerOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createReservationOptions.Headers { + for headerName, headerValue := range updateInstanceGroupManagerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateReservation") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManager") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createReservationOptions.Capacity != nil { - body["capacity"] = createReservationOptions.Capacity - } - if createReservationOptions.CommittedUse != nil { - body["committed_use"] = createReservationOptions.CommittedUse - } - if createReservationOptions.Profile != nil { - body["profile"] = createReservationOptions.Profile - } - if createReservationOptions.Zone != nil { - body["zone"] = createReservationOptions.Zone - } - if createReservationOptions.AffinityPolicy != nil { - body["affinity_policy"] = createReservationOptions.AffinityPolicy - } - if createReservationOptions.Name != nil { - body["name"] = createReservationOptions.Name - } - if createReservationOptions.ResourceGroup != nil { - body["resource_group"] = createReservationOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerOptions.InstanceGroupManagerPatch) if err != nil { return } @@ -9039,7 +9028,7 @@ func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReserv return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) if err != nil { return } @@ -9049,51 +9038,56 @@ func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReserv return } -// DeleteReservation : Delete a reservation -// This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are -// not allowed to be deleted. -func (vpc *VpcV1) DeleteReservation(deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.DeleteReservationWithContext(context.Background(), deleteReservationOptions) -} - -// DeleteReservationWithContext is an alternate form of the DeleteReservation method which supports a Context parameter -func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteReservationOptions, "deleteReservationOptions cannot be nil") +// UpdateInstanceGroupManagerAction : Update specified instance group manager action +// This request updates an instance group manager action. +func (vpc *VpcV1) UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceGroupManagerActionWithContext(context.Background(), updateInstanceGroupManagerActionOptions) +} + +// UpdateInstanceGroupManagerActionWithContext is an alternate form of the UpdateInstanceGroupManagerAction method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceGroupManagerActionWithContext(ctx context.Context, updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteReservationOptions, "deleteReservationOptions") + err = core.ValidateStruct(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteReservationOptions.ID, + "instance_group_id": *updateInstanceGroupManagerActionOptions.InstanceGroupID, + "instance_group_manager_id": *updateInstanceGroupManagerActionOptions.InstanceGroupManagerID, + "id": *updateInstanceGroupManagerActionOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteReservationOptions.Headers { + for headerName, headerValue := range updateInstanceGroupManagerActionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteReservation") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerAction") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerActionOptions.InstanceGroupManagerActionPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -9105,7 +9099,7 @@ func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReserv return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) if err != nil { return } @@ -9115,50 +9109,56 @@ func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReserv return } -// GetReservation : Retrieve a reservation -// This request retrieves a single reservation specified by identifier in the URL. -func (vpc *VpcV1) GetReservation(getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.GetReservationWithContext(context.Background(), getReservationOptions) +// UpdateInstanceGroupManagerPolicy : Update an instance group manager policy +// This request updates an instance group manager policy. +func (vpc *VpcV1) UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceGroupManagerPolicyWithContext(context.Background(), updateInstanceGroupManagerPolicyOptions) } -// GetReservationWithContext is an alternate form of the GetReservation method which supports a Context parameter -func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getReservationOptions, "getReservationOptions cannot be nil") +// UpdateInstanceGroupManagerPolicyWithContext is an alternate form of the UpdateInstanceGroupManagerPolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceGroupManagerPolicyWithContext(ctx context.Context, updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getReservationOptions, "getReservationOptions") + err = core.ValidateStruct(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getReservationOptions.ID, + "instance_group_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupID, + "instance_group_manager_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, + "id": *updateInstanceGroupManagerPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getReservationOptions.Headers { + for headerName, headerValue := range updateInstanceGroupManagerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetReservation") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -9170,7 +9170,7 @@ func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) if err != nil { return } @@ -9180,43 +9180,41 @@ func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationO return } -// UpdateReservation : Update a reservation -// This request updates a reservation with the information provided in a reservation patch object. The patch object is -// structured in the same way as a retrieved reservation and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateReservation(updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.UpdateReservationWithContext(context.Background(), updateReservationOptions) +// UpdateInstanceGroupMembership : Update an instance group membership +// This request updates an instance group membership with the information provided instance group membership patch. +func (vpc *VpcV1) UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { + return vpc.UpdateInstanceGroupMembershipWithContext(context.Background(), updateInstanceGroupMembershipOptions) } -// UpdateReservationWithContext is an alternate form of the UpdateReservation method which supports a Context parameter -func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateReservationOptions, "updateReservationOptions cannot be nil") +// UpdateInstanceGroupMembershipWithContext is an alternate form of the UpdateInstanceGroupMembership method which supports a Context parameter +func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateReservationOptions, "updateReservationOptions") + err = core.ValidateStruct(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateReservationOptions.ID, + "instance_group_id": *updateInstanceGroupMembershipOptions.InstanceGroupID, + "id": *updateInstanceGroupMembershipOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateReservationOptions.Headers { + for headerName, headerValue := range updateInstanceGroupMembershipOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateReservation") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupMembership") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9226,7 +9224,7 @@ func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReserv builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateReservationOptions.ReservationPatch) + _, err = builder.SetBodyContentJSON(updateInstanceGroupMembershipOptions.InstanceGroupMembershipPatch) if err != nil { return } @@ -9242,7 +9240,7 @@ func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReserv return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) if err != nil { return } @@ -9275,8 +9273,6 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) - builder.AddQuery("maturity", "beta") - builder.AddQuery("version", "2023-11-29") builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) if err != nil { @@ -9305,54 +9301,71 @@ func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateRe return } -// ListDedicatedHostGroups : List all dedicated host groups -// This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for -// placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. -func (vpc *VpcV1) ListDedicatedHostGroups(listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostGroupsWithContext(context.Background(), listDedicatedHostGroupsOptions) +// CreateReservation : Create a reservation +// This request creates a new reservation from a reservation prototype object. The prototype object is structured in the +// same way as a retrieved reservation, and contains the information necessary to create the new reservation. +func (vpc *VpcV1) CreateReservation(createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.CreateReservationWithContext(context.Background(), createReservationOptions) } -// ListDedicatedHostGroupsWithContext is an alternate form of the ListDedicatedHostGroups method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostGroupsWithContext(ctx context.Context, listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostGroupsOptions, "listDedicatedHostGroupsOptions") +// CreateReservationWithContext is an alternate form of the CreateReservation method which supports a Context parameter +func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createReservationOptions, "createReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createReservationOptions, "createReservationOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { return } - for headerName, headerValue := range listDedicatedHostGroupsOptions.Headers { + for headerName, headerValue := range createReservationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostGroups") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateReservation") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostGroupsOptions.Start)) + + body := make(map[string]interface{}) + if createReservationOptions.Capacity != nil { + body["capacity"] = createReservationOptions.Capacity } - if listDedicatedHostGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostGroupsOptions.Limit)) + if createReservationOptions.CommittedUse != nil { + body["committed_use"] = createReservationOptions.CommittedUse } - if listDedicatedHostGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostGroupsOptions.ResourceGroupID)) + if createReservationOptions.Profile != nil { + body["profile"] = createReservationOptions.Profile } - if listDedicatedHostGroupsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostGroupsOptions.ZoneName)) + if createReservationOptions.Zone != nil { + body["zone"] = createReservationOptions.Zone } - if listDedicatedHostGroupsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listDedicatedHostGroupsOptions.Name)) + if createReservationOptions.AffinityPolicy != nil { + body["affinity_policy"] = createReservationOptions.AffinityPolicy + } + if createReservationOptions.Name != nil { + body["name"] = createReservationOptions.Name + } + if createReservationOptions.ResourceGroup != nil { + body["resource_group"] = createReservationOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -9366,7 +9379,7 @@ func (vpc *VpcV1) ListDedicatedHostGroupsWithContext(ctx context.Context, listDe return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroupCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) if err != nil { return } @@ -9376,66 +9389,49 @@ func (vpc *VpcV1) ListDedicatedHostGroupsWithContext(ctx context.Context, listDe return } -// CreateDedicatedHostGroup : Create a dedicated host group -// This request creates a new dedicated host group. -func (vpc *VpcV1) CreateDedicatedHostGroup(createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.CreateDedicatedHostGroupWithContext(context.Background(), createDedicatedHostGroupOptions) +// DeleteReservation : Delete a reservation +// This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are +// not allowed to be deleted. +func (vpc *VpcV1) DeleteReservation(deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.DeleteReservationWithContext(context.Background(), deleteReservationOptions) } -// CreateDedicatedHostGroupWithContext is an alternate form of the CreateDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) CreateDedicatedHostGroupWithContext(ctx context.Context, createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions cannot be nil") +// DeleteReservationWithContext is an alternate form of the DeleteReservation method which supports a Context parameter +func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteReservationOptions, "deleteReservationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions") + err = core.ValidateStruct(deleteReservationOptions, "deleteReservationOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *deleteReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createDedicatedHostGroupOptions.Headers { + for headerName, headerValue := range deleteReservationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHostGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteReservation") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createDedicatedHostGroupOptions.Class != nil { - body["class"] = createDedicatedHostGroupOptions.Class - } - if createDedicatedHostGroupOptions.Family != nil { - body["family"] = createDedicatedHostGroupOptions.Family - } - if createDedicatedHostGroupOptions.Zone != nil { - body["zone"] = createDedicatedHostGroupOptions.Zone - } - if createDedicatedHostGroupOptions.Name != nil { - body["name"] = createDedicatedHostGroupOptions.Name - } - if createDedicatedHostGroupOptions.ResourceGroup != nil { - body["resource_group"] = createDedicatedHostGroupOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -9447,7 +9443,7 @@ func (vpc *VpcV1) CreateDedicatedHostGroupWithContext(ctx context.Context, creat return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) if err != nil { return } @@ -9457,43 +9453,44 @@ func (vpc *VpcV1) CreateDedicatedHostGroupWithContext(ctx context.Context, creat return } -// DeleteDedicatedHostGroup : Delete a dedicated host group -// This request deletes a dedicated host group. -func (vpc *VpcV1) DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteDedicatedHostGroupWithContext(context.Background(), deleteDedicatedHostGroupOptions) +// GetReservation : Retrieve a reservation +// This request retrieves a single reservation specified by identifier in the URL. +func (vpc *VpcV1) GetReservation(getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.GetReservationWithContext(context.Background(), getReservationOptions) } -// DeleteDedicatedHostGroupWithContext is an alternate form of the DeleteDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteDedicatedHostGroupWithContext(ctx context.Context, deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions cannot be nil") +// GetReservationWithContext is an alternate form of the GetReservation method which supports a Context parameter +func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getReservationOptions, "getReservationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions") + err = core.ValidateStruct(getReservationOptions, "getReservationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteDedicatedHostGroupOptions.ID, + "id": *getReservationOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteDedicatedHostGroupOptions.Headers { + for headerName, headerValue := range getReservationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHostGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetReservation") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -9503,45 +9500,52 @@ func (vpc *VpcV1) DeleteDedicatedHostGroupWithContext(ctx context.Context, delet return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } return } -// GetDedicatedHostGroup : Retrieve a dedicated host group -// This request retrieves a single dedicated host group specified by the identifier in the URL. -func (vpc *VpcV1) GetDedicatedHostGroup(getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostGroupWithContext(context.Background(), getDedicatedHostGroupOptions) +// ListReservations : List all reservations +// This request lists all reservations in the region. A reservation provides reserved capacity for a specified profile +// in a specified zone. A reservation can also include a long-term committed use discount. +// +// The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations +// with identical `created_at` property values will in turn be sorted by ascending `name` property values. +func (vpc *VpcV1) ListReservations(listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + return vpc.ListReservationsWithContext(context.Background(), listReservationsOptions) } -// GetDedicatedHostGroupWithContext is an alternate form of the GetDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions") +// ListReservationsWithContext is an alternate form of the ListReservations method which supports a Context parameter +func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listReservationsOptions, "listReservationsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *getDedicatedHostGroupOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) if err != nil { return } - for headerName, headerValue := range getDedicatedHostGroupOptions.Headers { + for headerName, headerValue := range listReservationsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListReservations") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9549,6 +9553,21 @@ func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedic builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listReservationsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listReservationsOptions.Start)) + } + if listReservationsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listReservationsOptions.Limit)) + } + if listReservationsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listReservationsOptions.Name)) + } + if listReservationsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listReservationsOptions.ResourceGroupID)) + } + if listReservationsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listReservationsOptions.ZoneName)) + } request, err := builder.Build() if err != nil { @@ -9561,7 +9580,7 @@ func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservationCollection) if err != nil { return } @@ -9571,42 +9590,41 @@ func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedic return } -// UpdateDedicatedHostGroup : Update a dedicated host group -// This request updates a dedicated host group with the information in a provided dedicated host group patch. The -// dedicated host group patch object is structured in the same way as a retrieved dedicated host group and contains only -// the information to be updated. -func (vpc *VpcV1) UpdateDedicatedHostGroup(updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostGroupWithContext(context.Background(), updateDedicatedHostGroupOptions) +// UpdateReservation : Update a reservation +// This request updates a reservation with the information provided in a reservation patch object. The patch object is +// structured in the same way as a retrieved reservation and needs to contain only the information to be updated. +func (vpc *VpcV1) UpdateReservation(updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.UpdateReservationWithContext(context.Background(), updateReservationOptions) } -// UpdateDedicatedHostGroupWithContext is an alternate form of the UpdateDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions cannot be nil") +// UpdateReservationWithContext is an alternate form of the UpdateReservation method which supports a Context parameter +func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateReservationOptions, "updateReservationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions") + err = core.ValidateStruct(updateReservationOptions, "updateReservationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateDedicatedHostGroupOptions.ID, + "id": *updateReservationOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateDedicatedHostGroupOptions.Headers { + for headerName, headerValue := range updateReservationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateReservation") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9616,7 +9634,7 @@ func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updat builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateDedicatedHostGroupOptions.DedicatedHostGroupPatch) + _, err = builder.SetBodyContentJSON(updateReservationOptions.ReservationPatch) if err != nil { return } @@ -9632,7 +9650,7 @@ func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updat return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) if err != nil { return } @@ -9642,45 +9660,48 @@ func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updat return } -// ListDedicatedHostProfiles : List all dedicated host profiles -// This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in -// the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. -func (vpc *VpcV1) ListDedicatedHostProfiles(listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostProfilesWithContext(context.Background(), listDedicatedHostProfilesOptions) +// CreateDedicatedHost : Create a dedicated host +// This request creates a new dedicated host. +func (vpc *VpcV1) CreateDedicatedHost(createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + return vpc.CreateDedicatedHostWithContext(context.Background(), createDedicatedHostOptions) } -// ListDedicatedHostProfilesWithContext is an alternate form of the ListDedicatedHostProfiles method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostProfilesWithContext(ctx context.Context, listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostProfilesOptions, "listDedicatedHostProfilesOptions") +// CreateDedicatedHostWithContext is an alternate form of the CreateDedicatedHost method which supports a Context parameter +func (vpc *VpcV1) CreateDedicatedHostWithContext(ctx context.Context, createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createDedicatedHostOptions, "createDedicatedHostOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createDedicatedHostOptions, "createDedicatedHostOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) if err != nil { return } - for headerName, headerValue := range listDedicatedHostProfilesOptions.Headers { + for headerName, headerValue := range createDedicatedHostOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHost") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostProfilesOptions.Start)) - } - if listDedicatedHostProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostProfilesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(createDedicatedHostOptions.DedicatedHostPrototype) + if err != nil { + return } request, err := builder.Build() @@ -9694,7 +9715,7 @@ func (vpc *VpcV1) ListDedicatedHostProfilesWithContext(ctx context.Context, list return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) if err != nil { return } @@ -9704,48 +9725,66 @@ func (vpc *VpcV1) ListDedicatedHostProfilesWithContext(ctx context.Context, list return } -// GetDedicatedHostProfile : Retrieve a dedicated host profile -// This request retrieves a single dedicated host profile specified by the name in the URL. -func (vpc *VpcV1) GetDedicatedHostProfile(getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostProfileWithContext(context.Background(), getDedicatedHostProfileOptions) +// CreateDedicatedHostGroup : Create a dedicated host group +// This request creates a new dedicated host group. +func (vpc *VpcV1) CreateDedicatedHostGroup(createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + return vpc.CreateDedicatedHostGroupWithContext(context.Background(), createDedicatedHostGroupOptions) } -// GetDedicatedHostProfileWithContext is an alternate form of the GetDedicatedHostProfile method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostProfileWithContext(ctx context.Context, getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions cannot be nil") +// CreateDedicatedHostGroupWithContext is an alternate form of the CreateDedicatedHostGroup method which supports a Context parameter +func (vpc *VpcV1) CreateDedicatedHostGroupWithContext(ctx context.Context, createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions") + err = core.ValidateStruct(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "name": *getDedicatedHostProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) if err != nil { return } - for headerName, headerValue := range getDedicatedHostProfileOptions.Headers { + for headerName, headerValue := range createDedicatedHostGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHostGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createDedicatedHostGroupOptions.Class != nil { + body["class"] = createDedicatedHostGroupOptions.Class + } + if createDedicatedHostGroupOptions.Family != nil { + body["family"] = createDedicatedHostGroupOptions.Family + } + if createDedicatedHostGroupOptions.Zone != nil { + body["zone"] = createDedicatedHostGroupOptions.Zone + } + if createDedicatedHostGroupOptions.Name != nil { + body["name"] = createDedicatedHostGroupOptions.Name + } + if createDedicatedHostGroupOptions.ResourceGroup != nil { + body["resource_group"] = createDedicatedHostGroupOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -9757,7 +9796,7 @@ func (vpc *VpcV1) GetDedicatedHostProfileWithContext(ctx context.Context, getDed return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) if err != nil { return } @@ -9767,180 +9806,142 @@ func (vpc *VpcV1) GetDedicatedHostProfileWithContext(ctx context.Context, getDed return } -// ListDedicatedHosts : List all dedicated hosts -// This request lists all dedicated hosts in the region. -func (vpc *VpcV1) ListDedicatedHosts(listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostsWithContext(context.Background(), listDedicatedHostsOptions) +// DeleteDedicatedHost : Delete a dedicated host +// This request deletes a dedicated host. +func (vpc *VpcV1) DeleteDedicatedHost(deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteDedicatedHostWithContext(context.Background(), deleteDedicatedHostOptions) } -// ListDedicatedHostsWithContext is an alternate form of the ListDedicatedHosts method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostsWithContext(ctx context.Context, listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostsOptions, "listDedicatedHostsOptions") +// DeleteDedicatedHostWithContext is an alternate form of the DeleteDedicatedHost method which supports a Context parameter +func (vpc *VpcV1) DeleteDedicatedHostWithContext(ctx context.Context, deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteDedicatedHostOptions, "deleteDedicatedHostOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteDedicatedHostOptions, "deleteDedicatedHostOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *deleteDedicatedHostOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listDedicatedHostsOptions.Headers { + for headerName, headerValue := range deleteDedicatedHostOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHosts") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHost") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostsOptions.DedicatedHostGroupID != nil { - builder.AddQuery("dedicated_host_group.id", fmt.Sprint(*listDedicatedHostsOptions.DedicatedHostGroupID)) - } - if listDedicatedHostsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostsOptions.Start)) - } - if listDedicatedHostsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostsOptions.Limit)) - } - if listDedicatedHostsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostsOptions.ResourceGroupID)) - } - if listDedicatedHostsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostsOptions.ZoneName)) - } - if listDedicatedHostsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listDedicatedHostsOptions.Name)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateDedicatedHost : Create a dedicated host -// This request creates a new dedicated host. -func (vpc *VpcV1) CreateDedicatedHost(createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.CreateDedicatedHostWithContext(context.Background(), createDedicatedHostOptions) +// DeleteDedicatedHostGroup : Delete a dedicated host group +// This request deletes a dedicated host group. +func (vpc *VpcV1) DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteDedicatedHostGroupWithContext(context.Background(), deleteDedicatedHostGroupOptions) } -// CreateDedicatedHostWithContext is an alternate form of the CreateDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) CreateDedicatedHostWithContext(ctx context.Context, createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createDedicatedHostOptions, "createDedicatedHostOptions cannot be nil") +// DeleteDedicatedHostGroupWithContext is an alternate form of the DeleteDedicatedHostGroup method which supports a Context parameter +func (vpc *VpcV1) DeleteDedicatedHostGroupWithContext(ctx context.Context, deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createDedicatedHostOptions, "createDedicatedHostOptions") + err = core.ValidateStruct(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *deleteDedicatedHostGroupOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createDedicatedHostOptions.Headers { + for headerName, headerValue := range deleteDedicatedHostGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHost") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHostGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createDedicatedHostOptions.DedicatedHostPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListDedicatedHostDisks : List all disks on a dedicated host -// This request lists all disks on a dedicated host. A disk is a physical device that is locally attached to the -// compute node. By default, the listed disks are sorted by their -// `created_at` property values, with the newest disk first. -func (vpc *VpcV1) ListDedicatedHostDisks(listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostDisksWithContext(context.Background(), listDedicatedHostDisksOptions) +// GetDedicatedHost : Retrieve a dedicated host +// This request retrieves a single dedicated host specified by the identifiers in the URL. +func (vpc *VpcV1) GetDedicatedHost(getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + return vpc.GetDedicatedHostWithContext(context.Background(), getDedicatedHostOptions) } -// ListDedicatedHostDisksWithContext is an alternate form of the ListDedicatedHostDisks method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostDisksWithContext(ctx context.Context, listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions cannot be nil") +// GetDedicatedHostWithContext is an alternate form of the GetDedicatedHost method which supports a Context parameter +func (vpc *VpcV1) GetDedicatedHostWithContext(ctx context.Context, getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getDedicatedHostOptions, "getDedicatedHostOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions") + err = core.ValidateStruct(getDedicatedHostOptions, "getDedicatedHostOptions") if err != nil { return } pathParamsMap := map[string]string{ - "dedicated_host_id": *listDedicatedHostDisksOptions.DedicatedHostID, + "id": *getDedicatedHostOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listDedicatedHostDisksOptions.Headers { + for headerName, headerValue := range getDedicatedHostOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostDisks") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHost") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9960,7 +9961,7 @@ func (vpc *VpcV1) ListDedicatedHostDisksWithContext(ctx context.Context, listDed return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDiskCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) if err != nil { return } @@ -10034,55 +10035,48 @@ func (vpc *VpcV1) GetDedicatedHostDiskWithContext(ctx context.Context, getDedica return } -// UpdateDedicatedHostDisk : Update a dedicated host disk -// This request updates the dedicated host disk with the information in a provided patch. -func (vpc *VpcV1) UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostDiskWithContext(context.Background(), updateDedicatedHostDiskOptions) +// GetDedicatedHostGroup : Retrieve a dedicated host group +// This request retrieves a single dedicated host group specified by the identifier in the URL. +func (vpc *VpcV1) GetDedicatedHostGroup(getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + return vpc.GetDedicatedHostGroupWithContext(context.Background(), getDedicatedHostGroupOptions) } -// UpdateDedicatedHostDiskWithContext is an alternate form of the UpdateDedicatedHostDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostDiskWithContext(ctx context.Context, updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions cannot be nil") +// GetDedicatedHostGroupWithContext is an alternate form of the GetDedicatedHostGroup method which supports a Context parameter +func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions") + err = core.ValidateStruct(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "dedicated_host_id": *updateDedicatedHostDiskOptions.DedicatedHostID, - "id": *updateDedicatedHostDiskOptions.ID, + "id": *getDedicatedHostGroupOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateDedicatedHostDiskOptions.Headers { + for headerName, headerValue := range getDedicatedHostGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostDisk") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateDedicatedHostDiskOptions.DedicatedHostDiskPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -10094,7 +10088,7 @@ func (vpc *VpcV1) UpdateDedicatedHostDiskWithContext(ctx context.Context, update return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDisk) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) if err != nil { return } @@ -10104,43 +10098,44 @@ func (vpc *VpcV1) UpdateDedicatedHostDiskWithContext(ctx context.Context, update return } -// DeleteDedicatedHost : Delete a dedicated host -// This request deletes a dedicated host. -func (vpc *VpcV1) DeleteDedicatedHost(deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteDedicatedHostWithContext(context.Background(), deleteDedicatedHostOptions) +// GetDedicatedHostProfile : Retrieve a dedicated host profile +// This request retrieves a single dedicated host profile specified by the name in the URL. +func (vpc *VpcV1) GetDedicatedHostProfile(getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { + return vpc.GetDedicatedHostProfileWithContext(context.Background(), getDedicatedHostProfileOptions) } -// DeleteDedicatedHostWithContext is an alternate form of the DeleteDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) DeleteDedicatedHostWithContext(ctx context.Context, deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteDedicatedHostOptions, "deleteDedicatedHostOptions cannot be nil") +// GetDedicatedHostProfileWithContext is an alternate form of the GetDedicatedHostProfile method which supports a Context parameter +func (vpc *VpcV1) GetDedicatedHostProfileWithContext(ctx context.Context, getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteDedicatedHostOptions, "deleteDedicatedHostOptions") + err = core.ValidateStruct(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteDedicatedHostOptions.ID, + "name": *getDedicatedHostProfileOptions.Name, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteDedicatedHostOptions.Headers { + for headerName, headerValue := range getDedicatedHostProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHost") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -10150,45 +10145,58 @@ func (vpc *VpcV1) DeleteDedicatedHostWithContext(ctx context.Context, deleteDedi return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfile) + if err != nil { + return + } + response.Result = result + } return } -// GetDedicatedHost : Retrieve a dedicated host -// This request retrieves a single dedicated host specified by the identifiers in the URL. -func (vpc *VpcV1) GetDedicatedHost(getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostWithContext(context.Background(), getDedicatedHostOptions) +// ListDedicatedHostDisks : List all disks on a dedicated host +// This request lists all disks on a dedicated host. A disk is a physical device that is locally attached to the +// compute node. By default, the listed disks are sorted by their +// `created_at` property values, with the newest disk first. +func (vpc *VpcV1) ListDedicatedHostDisks(listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { + return vpc.ListDedicatedHostDisksWithContext(context.Background(), listDedicatedHostDisksOptions) } -// GetDedicatedHostWithContext is an alternate form of the GetDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostWithContext(ctx context.Context, getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostOptions, "getDedicatedHostOptions cannot be nil") +// ListDedicatedHostDisksWithContext is an alternate form of the ListDedicatedHostDisks method which supports a Context parameter +func (vpc *VpcV1) ListDedicatedHostDisksWithContext(ctx context.Context, listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getDedicatedHostOptions, "getDedicatedHostOptions") + err = core.ValidateStruct(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getDedicatedHostOptions.ID, + "dedicated_host_id": *listDedicatedHostDisksOptions.DedicatedHostID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getDedicatedHostOptions.Headers { + for headerName, headerValue := range listDedicatedHostDisksOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHost") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostDisks") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10208,7 +10216,7 @@ func (vpc *VpcV1) GetDedicatedHostWithContext(ctx context.Context, getDedicatedH return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDiskCollection) if err != nil { return } @@ -10218,54 +10226,116 @@ func (vpc *VpcV1) GetDedicatedHostWithContext(ctx context.Context, getDedicatedH return } -// UpdateDedicatedHost : Update a dedicated host -// This request updates a dedicated host with the information in a provided dedicated host patch. The dedicated host -// patch object is structured in the same way as a retrieved dedicated host and contains only the information to be -// updated. -func (vpc *VpcV1) UpdateDedicatedHost(updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostWithContext(context.Background(), updateDedicatedHostOptions) +// ListDedicatedHostGroups : List all dedicated host groups +// This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for +// placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. +func (vpc *VpcV1) ListDedicatedHostGroups(listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListDedicatedHostGroupsWithContext(context.Background(), listDedicatedHostGroupsOptions) } -// UpdateDedicatedHostWithContext is an alternate form of the UpdateDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostWithContext(ctx context.Context, updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostOptions, "updateDedicatedHostOptions cannot be nil") +// ListDedicatedHostGroupsWithContext is an alternate form of the ListDedicatedHostGroups method which supports a Context parameter +func (vpc *VpcV1) ListDedicatedHostGroupsWithContext(ctx context.Context, listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listDedicatedHostGroupsOptions, "listDedicatedHostGroupsOptions") if err != nil { return } - err = core.ValidateStruct(updateDedicatedHostOptions, "updateDedicatedHostOptions") + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateDedicatedHostOptions.ID, + for headerName, headerValue := range listDedicatedHostGroupsOptions.Headers { + builder.AddHeader(headerName, headerValue) } - builder := core.NewRequestBuilder(core.PATCH) + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostGroups") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listDedicatedHostGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listDedicatedHostGroupsOptions.Start)) + } + if listDedicatedHostGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostGroupsOptions.Limit)) + } + if listDedicatedHostGroupsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostGroupsOptions.ResourceGroupID)) + } + if listDedicatedHostGroupsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostGroupsOptions.ZoneName)) + } + if listDedicatedHostGroupsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listDedicatedHostGroupsOptions.Name)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroupCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListDedicatedHostProfiles : List all dedicated host profiles +// This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in +// the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. +func (vpc *VpcV1) ListDedicatedHostProfiles(listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListDedicatedHostProfilesWithContext(context.Background(), listDedicatedHostProfilesOptions) +} + +// ListDedicatedHostProfilesWithContext is an alternate form of the ListDedicatedHostProfiles method which supports a Context parameter +func (vpc *VpcV1) ListDedicatedHostProfilesWithContext(ctx context.Context, listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listDedicatedHostProfilesOptions, "listDedicatedHostProfilesOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles`, nil) if err != nil { return } - for headerName, headerValue := range updateDedicatedHostOptions.Headers { + for headerName, headerValue := range listDedicatedHostProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHost") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateDedicatedHostOptions.DedicatedHostPatch) - if err != nil { - return + if listDedicatedHostProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listDedicatedHostProfilesOptions.Start)) + } + if listDedicatedHostProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostProfilesOptions.Limit)) } request, err := builder.Build() @@ -10279,7 +10349,7 @@ func (vpc *VpcV1) UpdateDedicatedHostWithContext(ctx context.Context, updateDedi return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfileCollection) if err != nil { return } @@ -10289,16 +10359,15 @@ func (vpc *VpcV1) UpdateDedicatedHostWithContext(ctx context.Context, updateDedi return } -// ListBackupPolicies : List all backup policies -// This request lists all backup policies in the region. Backup policies control which sources are selected for backup -// and include a set of backup policy plans that provide the backup schedules and deletion triggers. -func (vpc *VpcV1) ListBackupPolicies(listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPoliciesWithContext(context.Background(), listBackupPoliciesOptions) +// ListDedicatedHosts : List all dedicated hosts +// This request lists all dedicated hosts in the region. +func (vpc *VpcV1) ListDedicatedHosts(listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { + return vpc.ListDedicatedHostsWithContext(context.Background(), listDedicatedHostsOptions) } -// ListBackupPoliciesWithContext is an alternate form of the ListBackupPolicies method which supports a Context parameter -func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBackupPoliciesOptions, "listBackupPoliciesOptions") +// ListDedicatedHostsWithContext is an alternate form of the ListDedicatedHosts method which supports a Context parameter +func (vpc *VpcV1) ListDedicatedHostsWithContext(ctx context.Context, listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listDedicatedHostsOptions, "listDedicatedHostsOptions") if err != nil { return } @@ -10306,16 +10375,16 @@ func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupP builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) if err != nil { return } - for headerName, headerValue := range listBackupPoliciesOptions.Headers { + for headerName, headerValue := range listDedicatedHostsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHosts") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10323,20 +10392,23 @@ func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupP builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBackupPoliciesOptions.Start)) + if listDedicatedHostsOptions.DedicatedHostGroupID != nil { + builder.AddQuery("dedicated_host_group.id", fmt.Sprint(*listDedicatedHostsOptions.DedicatedHostGroupID)) } - if listBackupPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBackupPoliciesOptions.Limit)) + if listDedicatedHostsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listDedicatedHostsOptions.Start)) } - if listBackupPoliciesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listBackupPoliciesOptions.ResourceGroupID)) + if listDedicatedHostsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostsOptions.Limit)) } - if listBackupPoliciesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBackupPoliciesOptions.Name)) + if listDedicatedHostsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostsOptions.ResourceGroupID)) } - if listBackupPoliciesOptions.Tag != nil { - builder.AddQuery("tag", fmt.Sprint(*listBackupPoliciesOptions.Tag)) + if listDedicatedHostsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostsOptions.ZoneName)) + } + if listDedicatedHostsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listDedicatedHostsOptions.Name)) } request, err := builder.Build() @@ -10350,7 +10422,7 @@ func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostCollection) if err != nil { return } @@ -10360,66 +10432,52 @@ func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupP return } -// CreateBackupPolicy : Create a backup policy -// This request creates a new backup policy from a backup policy prototype object. The prototype object is structured in -// the same way as a retrieved backup policy, and contains the information necessary to create the new backup policy. -func (vpc *VpcV1) CreateBackupPolicy(createBackupPolicyOptions *CreateBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateBackupPolicyWithContext(context.Background(), createBackupPolicyOptions) +// UpdateDedicatedHost : Update a dedicated host +// This request updates a dedicated host with the information in a provided dedicated host patch. The dedicated host +// patch object is structured in the same way as a retrieved dedicated host and contains only the information to be +// updated. +func (vpc *VpcV1) UpdateDedicatedHost(updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + return vpc.UpdateDedicatedHostWithContext(context.Background(), updateDedicatedHostOptions) } -// CreateBackupPolicyWithContext is an alternate form of the CreateBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBackupPolicyOptions *CreateBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBackupPolicyOptions, "createBackupPolicyOptions cannot be nil") +// UpdateDedicatedHostWithContext is an alternate form of the UpdateDedicatedHost method which supports a Context parameter +func (vpc *VpcV1) UpdateDedicatedHostWithContext(ctx context.Context, updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateDedicatedHostOptions, "updateDedicatedHostOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createBackupPolicyOptions, "createBackupPolicyOptions") + err = core.ValidateStruct(updateDedicatedHostOptions, "updateDedicatedHostOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *updateDedicatedHostOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createBackupPolicyOptions.Headers { + for headerName, headerValue := range updateDedicatedHostOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBackupPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHost") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createBackupPolicyOptions.MatchUserTags != nil { - body["match_user_tags"] = createBackupPolicyOptions.MatchUserTags - } - if createBackupPolicyOptions.MatchResourceTypes != nil { - body["match_resource_types"] = createBackupPolicyOptions.MatchResourceTypes - } - if createBackupPolicyOptions.Name != nil { - body["name"] = createBackupPolicyOptions.Name - } - if createBackupPolicyOptions.Plans != nil { - body["plans"] = createBackupPolicyOptions.Plans - } - if createBackupPolicyOptions.ResourceGroup != nil { - body["resource_group"] = createBackupPolicyOptions.ResourceGroup - } - if createBackupPolicyOptions.Scope != nil { - body["scope"] = createBackupPolicyOptions.Scope - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateDedicatedHostOptions.DedicatedHostPatch) if err != nil { return } @@ -10435,7 +10493,7 @@ func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBacku return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) if err != nil { return } @@ -10445,71 +10503,53 @@ func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBacku return } -// ListBackupPolicyJobs : List all jobs for a backup policy -// This request retrieves all jobs for a backup policy. A backup job represents the execution of a backup policy plan -// for a resource matching the policy's criteria. -func (vpc *VpcV1) ListBackupPolicyJobs(listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPolicyJobsWithContext(context.Background(), listBackupPolicyJobsOptions) +// UpdateDedicatedHostDisk : Update a dedicated host disk +// This request updates the dedicated host disk with the information in a provided patch. +func (vpc *VpcV1) UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { + return vpc.UpdateDedicatedHostDiskWithContext(context.Background(), updateDedicatedHostDiskOptions) } -// ListBackupPolicyJobsWithContext is an alternate form of the ListBackupPolicyJobs method which supports a Context parameter -func (vpc *VpcV1) ListBackupPolicyJobsWithContext(ctx context.Context, listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions cannot be nil") +// UpdateDedicatedHostDiskWithContext is an alternate form of the UpdateDedicatedHostDisk method which supports a Context parameter +func (vpc *VpcV1) UpdateDedicatedHostDiskWithContext(ctx context.Context, updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions") + err = core.ValidateStruct(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "backup_policy_id": *listBackupPolicyJobsOptions.BackupPolicyID, + "dedicated_host_id": *updateDedicatedHostDiskOptions.DedicatedHostID, + "id": *updateDedicatedHostDiskOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBackupPolicyJobsOptions.Headers { + for headerName, headerValue := range updateDedicatedHostDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyJobs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPolicyJobsOptions.Status != nil { - builder.AddQuery("status", fmt.Sprint(*listBackupPolicyJobsOptions.Status)) - } - if listBackupPolicyJobsOptions.BackupPolicyPlanID != nil { - builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listBackupPolicyJobsOptions.BackupPolicyPlanID)) - } - if listBackupPolicyJobsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBackupPolicyJobsOptions.Start)) - } - if listBackupPolicyJobsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBackupPolicyJobsOptions.Limit)) - } - if listBackupPolicyJobsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listBackupPolicyJobsOptions.Sort)) - } - if listBackupPolicyJobsOptions.SourceID != nil { - builder.AddQuery("source.id", fmt.Sprint(*listBackupPolicyJobsOptions.SourceID)) - } - if listBackupPolicyJobsOptions.TargetSnapshotsID != nil { - builder.AddQuery("target_snapshots[].id", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsID)) - } - if listBackupPolicyJobsOptions.TargetSnapshotsCRN != nil { - builder.AddQuery("target_snapshots[].crn", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsCRN)) + + _, err = builder.SetBodyContentJSON(updateDedicatedHostDiskOptions.DedicatedHostDiskPatch) + if err != nil { + return } request, err := builder.Build() @@ -10523,7 +10563,7 @@ func (vpc *VpcV1) ListBackupPolicyJobsWithContext(ctx context.Context, listBacku return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJobCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDisk) if err != nil { return } @@ -10533,49 +10573,56 @@ func (vpc *VpcV1) ListBackupPolicyJobsWithContext(ctx context.Context, listBacku return } -// GetBackupPolicyJob : Retrieve a backup policy job -// This request retrieves a single backup policy job specified by the identifier in the URL. -func (vpc *VpcV1) GetBackupPolicyJob(getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { - return vpc.GetBackupPolicyJobWithContext(context.Background(), getBackupPolicyJobOptions) +// UpdateDedicatedHostGroup : Update a dedicated host group +// This request updates a dedicated host group with the information in a provided dedicated host group patch. The +// dedicated host group patch object is structured in the same way as a retrieved dedicated host group and contains only +// the information to be updated. +func (vpc *VpcV1) UpdateDedicatedHostGroup(updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + return vpc.UpdateDedicatedHostGroupWithContext(context.Background(), updateDedicatedHostGroupOptions) } -// GetBackupPolicyJobWithContext is an alternate form of the GetBackupPolicyJob method which supports a Context parameter -func (vpc *VpcV1) GetBackupPolicyJobWithContext(ctx context.Context, getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBackupPolicyJobOptions, "getBackupPolicyJobOptions cannot be nil") +// UpdateDedicatedHostGroupWithContext is an alternate form of the UpdateDedicatedHostGroup method which supports a Context parameter +func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBackupPolicyJobOptions, "getBackupPolicyJobOptions") + err = core.ValidateStruct(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "backup_policy_id": *getBackupPolicyJobOptions.BackupPolicyID, - "id": *getBackupPolicyJobOptions.ID, + "id": *updateDedicatedHostGroupOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBackupPolicyJobOptions.Headers { + for headerName, headerValue := range updateDedicatedHostGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicyJob") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateDedicatedHostGroupOptions.DedicatedHostGroupPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -10587,7 +10634,7 @@ func (vpc *VpcV1) GetBackupPolicyJobWithContext(ctx context.Context, getBackupPo return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJob) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) if err != nil { return } @@ -10597,49 +10644,49 @@ func (vpc *VpcV1) GetBackupPolicyJobWithContext(ctx context.Context, getBackupPo return } -// ListBackupPolicyPlans : List all plans for a backup policy -// This request retrieves all plans for a backup policy. Backup plans provide the backup schedule and deletion triggers. -func (vpc *VpcV1) ListBackupPolicyPlans(listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPolicyPlansWithContext(context.Background(), listBackupPolicyPlansOptions) +// CreateBackupPolicy : Create a backup policy +// This request creates a new backup policy from a backup policy prototype object. The prototype object is structured in +// the same way as a retrieved backup policy, and contains the information necessary to create the new backup policy. +func (vpc *VpcV1) CreateBackupPolicy(createBackupPolicyOptions *CreateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + return vpc.CreateBackupPolicyWithContext(context.Background(), createBackupPolicyOptions) } -// ListBackupPolicyPlansWithContext is an alternate form of the ListBackupPolicyPlans method which supports a Context parameter -func (vpc *VpcV1) ListBackupPolicyPlansWithContext(ctx context.Context, listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions cannot be nil") +// CreateBackupPolicyWithContext is an alternate form of the CreateBackupPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBackupPolicyOptions *CreateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBackupPolicyOptions, "createBackupPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions") + err = core.ValidateStruct(createBackupPolicyOptions, "createBackupPolicyOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "backup_policy_id": *listBackupPolicyPlansOptions.BackupPolicyID, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) if err != nil { return } - for headerName, headerValue := range listBackupPolicyPlansOptions.Headers { + for headerName, headerValue := range createBackupPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyPlans") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBackupPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPolicyPlansOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBackupPolicyPlansOptions.Name)) + + _, err = builder.SetBodyContentJSON(createBackupPolicyOptions.BackupPolicyPrototype) + if err != nil { + return } request, err := builder.Build() @@ -10653,7 +10700,7 @@ func (vpc *VpcV1) ListBackupPolicyPlansWithContext(ctx context.Context, listBack return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlanCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) if err != nil { return } @@ -10764,53 +10811,122 @@ func (vpc *VpcV1) CreateBackupPolicyPlanWithContext(ctx context.Context, createB return } -// DeleteBackupPolicyPlan : Delete a backup policy plan -// This request deletes a backup policy plan. This operation cannot be reversed. Any backups that have been created by -// the plan will remain but will no longer be subject to the plan's deletion trigger. Any running jobs associated with -// the plan will run to completion before the plan is deleted. +// DeleteBackupPolicy : Delete a backup policy +// This request deletes a backup policy. This operation cannot be reversed. // -// If the request is accepted, the backup policy plan `status` will be set to `deleting`. Once deletion processing -// completes, the backup policy plan will no longer be retrievable. -func (vpc *VpcV1) DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.DeleteBackupPolicyPlanWithContext(context.Background(), deleteBackupPolicyPlanOptions) +// If the request is accepted, the backup policy `status` will be set to `deleting`. Once deletion processing completes, +// the backup policy will no longer be retrievable. +func (vpc *VpcV1) DeleteBackupPolicy(deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + return vpc.DeleteBackupPolicyWithContext(context.Background(), deleteBackupPolicyOptions) } -// DeleteBackupPolicyPlanWithContext is an alternate form of the DeleteBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) DeleteBackupPolicyPlanWithContext(ctx context.Context, deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions cannot be nil") +// DeleteBackupPolicyWithContext is an alternate form of the DeleteBackupPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteBackupPolicyWithContext(ctx context.Context, deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBackupPolicyOptions, "deleteBackupPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions") + err = core.ValidateStruct(deleteBackupPolicyOptions, "deleteBackupPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "backup_policy_id": *deleteBackupPolicyPlanOptions.BackupPolicyID, - "id": *deleteBackupPolicyPlanOptions.ID, + "id": *deleteBackupPolicyOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteBackupPolicyPlanOptions.Headers { + for headerName, headerValue := range deleteBackupPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicyPlan") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if deleteBackupPolicyPlanOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyPlanOptions.IfMatch)) - } + if deleteBackupPolicyOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyOptions.IfMatch)) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteBackupPolicyPlan : Delete a backup policy plan +// This request deletes a backup policy plan. This operation cannot be reversed. Any backups that have been created by +// the plan will remain but will no longer be subject to the plan's deletion trigger. Any running jobs associated with +// the plan will run to completion before the plan is deleted. +// +// If the request is accepted, the backup policy plan `status` will be set to `deleting`. Once deletion processing +// completes, the backup policy plan will no longer be retrievable. +func (vpc *VpcV1) DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { + return vpc.DeleteBackupPolicyPlanWithContext(context.Background(), deleteBackupPolicyPlanOptions) +} + +// DeleteBackupPolicyPlanWithContext is an alternate form of the DeleteBackupPolicyPlan method which supports a Context parameter +func (vpc *VpcV1) DeleteBackupPolicyPlanWithContext(ctx context.Context, deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "backup_policy_id": *deleteBackupPolicyPlanOptions.BackupPolicyID, + "id": *deleteBackupPolicyPlanOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteBackupPolicyPlanOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicyPlan") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if deleteBackupPolicyPlanOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyPlanOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -10836,6 +10952,133 @@ func (vpc *VpcV1) DeleteBackupPolicyPlanWithContext(ctx context.Context, deleteB return } +// GetBackupPolicy : Retrieve a backup policy +// This request retrieves a single backup policy specified by the identifier in the URL. +func (vpc *VpcV1) GetBackupPolicy(getBackupPolicyOptions *GetBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + return vpc.GetBackupPolicyWithContext(context.Background(), getBackupPolicyOptions) +} + +// GetBackupPolicyWithContext is an alternate form of the GetBackupPolicy method which supports a Context parameter +func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolicyOptions *GetBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBackupPolicyOptions, "getBackupPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getBackupPolicyOptions, "getBackupPolicyOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *getBackupPolicyOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getBackupPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetBackupPolicyJob : Retrieve a backup policy job +// This request retrieves a single backup policy job specified by the identifier in the URL. +func (vpc *VpcV1) GetBackupPolicyJob(getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { + return vpc.GetBackupPolicyJobWithContext(context.Background(), getBackupPolicyJobOptions) +} + +// GetBackupPolicyJobWithContext is an alternate form of the GetBackupPolicyJob method which supports a Context parameter +func (vpc *VpcV1) GetBackupPolicyJobWithContext(ctx context.Context, getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBackupPolicyJobOptions, "getBackupPolicyJobOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getBackupPolicyJobOptions, "getBackupPolicyJobOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "backup_policy_id": *getBackupPolicyJobOptions.BackupPolicyID, + "id": *getBackupPolicyJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getBackupPolicyJobOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicyJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJob) + if err != nil { + return + } + response.Result = result + } + + return +} + // GetBackupPolicyPlan : Retrieve a backup policy plan // This request retrieves a single backup policy plan specified by the identifier in the URL. func (vpc *VpcV1) GetBackupPolicyPlan(getBackupPolicyPlanOptions *GetBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { @@ -10900,57 +11143,54 @@ func (vpc *VpcV1) GetBackupPolicyPlanWithContext(ctx context.Context, getBackupP return } -// UpdateBackupPolicyPlan : Update a backup policy plan -// This request updates a backup policy plan with the information in a provided plan patch. The plan patch object is -// structured in the same way as a retrieved backup policy plan and can contains only the information to be updated. -func (vpc *VpcV1) UpdateBackupPolicyPlan(updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.UpdateBackupPolicyPlanWithContext(context.Background(), updateBackupPolicyPlanOptions) +// ListBackupPolicies : List all backup policies +// This request lists all backup policies in the region. Backup policies control which sources are selected for backup +// and include a set of backup policy plans that provide the backup schedules and deletion triggers. +func (vpc *VpcV1) ListBackupPolicies(listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListBackupPoliciesWithContext(context.Background(), listBackupPoliciesOptions) } -// UpdateBackupPolicyPlanWithContext is an alternate form of the UpdateBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) UpdateBackupPolicyPlanWithContext(ctx context.Context, updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions") +// ListBackupPoliciesWithContext is an alternate form of the ListBackupPolicies method which supports a Context parameter +func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listBackupPoliciesOptions, "listBackupPoliciesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "backup_policy_id": *updateBackupPolicyPlanOptions.BackupPolicyID, - "id": *updateBackupPolicyPlanOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) if err != nil { return } - for headerName, headerValue := range updateBackupPolicyPlanOptions.Headers { + for headerName, headerValue := range listBackupPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBackupPolicyPlan") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateBackupPolicyPlanOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateBackupPolicyPlanOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBackupPolicyPlanOptions.BackupPolicyPlanPatch) - if err != nil { - return + if listBackupPoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBackupPoliciesOptions.Start)) + } + if listBackupPoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBackupPoliciesOptions.Limit)) + } + if listBackupPoliciesOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listBackupPoliciesOptions.ResourceGroupID)) + } + if listBackupPoliciesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listBackupPoliciesOptions.Name)) + } + if listBackupPoliciesOptions.Tag != nil { + builder.AddQuery("tag", fmt.Sprint(*listBackupPoliciesOptions.Tag)) } request, err := builder.Build() @@ -10964,7 +11204,7 @@ func (vpc *VpcV1) UpdateBackupPolicyPlanWithContext(ctx context.Context, updateB return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyCollection) if err != nil { return } @@ -10974,53 +11214,72 @@ func (vpc *VpcV1) UpdateBackupPolicyPlanWithContext(ctx context.Context, updateB return } -// DeleteBackupPolicy : Delete a backup policy -// This request deletes a backup policy. This operation cannot be reversed. -// -// If the request is accepted, the backup policy `status` will be set to `deleting`. Once deletion processing completes, -// the backup policy will no longer be retrievable. -func (vpc *VpcV1) DeleteBackupPolicy(deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - return vpc.DeleteBackupPolicyWithContext(context.Background(), deleteBackupPolicyOptions) +// ListBackupPolicyJobs : List all jobs for a backup policy +// This request retrieves all jobs for a backup policy. A backup job represents the execution of a backup policy plan +// for a resource matching the policy's criteria. +func (vpc *VpcV1) ListBackupPolicyJobs(listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { + return vpc.ListBackupPolicyJobsWithContext(context.Background(), listBackupPolicyJobsOptions) } -// DeleteBackupPolicyWithContext is an alternate form of the DeleteBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteBackupPolicyWithContext(ctx context.Context, deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBackupPolicyOptions, "deleteBackupPolicyOptions cannot be nil") +// ListBackupPolicyJobsWithContext is an alternate form of the ListBackupPolicyJobs method which supports a Context parameter +func (vpc *VpcV1) ListBackupPolicyJobsWithContext(ctx context.Context, listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteBackupPolicyOptions, "deleteBackupPolicyOptions") + err = core.ValidateStruct(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteBackupPolicyOptions.ID, + "backup_policy_id": *listBackupPolicyJobsOptions.BackupPolicyID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteBackupPolicyOptions.Headers { + for headerName, headerValue := range listBackupPolicyJobsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyJobs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if deleteBackupPolicyOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBackupPolicyJobsOptions.Status != nil { + builder.AddQuery("status", fmt.Sprint(*listBackupPolicyJobsOptions.Status)) + } + if listBackupPolicyJobsOptions.BackupPolicyPlanID != nil { + builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listBackupPolicyJobsOptions.BackupPolicyPlanID)) + } + if listBackupPolicyJobsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBackupPolicyJobsOptions.Start)) + } + if listBackupPolicyJobsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBackupPolicyJobsOptions.Limit)) + } + if listBackupPolicyJobsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listBackupPolicyJobsOptions.Sort)) + } + if listBackupPolicyJobsOptions.SourceID != nil { + builder.AddQuery("source.id", fmt.Sprint(*listBackupPolicyJobsOptions.SourceID)) + } + if listBackupPolicyJobsOptions.TargetSnapshotsID != nil { + builder.AddQuery("target_snapshots[].id", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsID)) + } + if listBackupPolicyJobsOptions.TargetSnapshotsCRN != nil { + builder.AddQuery("target_snapshots[].crn", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsCRN)) + } request, err := builder.Build() if err != nil { @@ -11033,7 +11292,7 @@ func (vpc *VpcV1) DeleteBackupPolicyWithContext(ctx context.Context, deleteBacku return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJobCollection) if err != nil { return } @@ -11043,40 +11302,40 @@ func (vpc *VpcV1) DeleteBackupPolicyWithContext(ctx context.Context, deleteBacku return } -// GetBackupPolicy : Retrieve a backup policy -// This request retrieves a single backup policy specified by the identifier in the URL. -func (vpc *VpcV1) GetBackupPolicy(getBackupPolicyOptions *GetBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - return vpc.GetBackupPolicyWithContext(context.Background(), getBackupPolicyOptions) +// ListBackupPolicyPlans : List all plans for a backup policy +// This request retrieves all plans for a backup policy. Backup plans provide the backup schedule and deletion triggers. +func (vpc *VpcV1) ListBackupPolicyPlans(listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { + return vpc.ListBackupPolicyPlansWithContext(context.Background(), listBackupPolicyPlansOptions) } -// GetBackupPolicyWithContext is an alternate form of the GetBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolicyOptions *GetBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBackupPolicyOptions, "getBackupPolicyOptions cannot be nil") +// ListBackupPolicyPlansWithContext is an alternate form of the ListBackupPolicyPlans method which supports a Context parameter +func (vpc *VpcV1) ListBackupPolicyPlansWithContext(ctx context.Context, listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBackupPolicyOptions, "getBackupPolicyOptions") + err = core.ValidateStruct(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getBackupPolicyOptions.ID, + "backup_policy_id": *listBackupPolicyPlansOptions.BackupPolicyID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBackupPolicyOptions.Headers { + for headerName, headerValue := range listBackupPolicyPlansOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyPlans") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11084,6 +11343,9 @@ func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolic builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBackupPolicyPlansOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listBackupPolicyPlansOptions.Name)) + } request, err := builder.Build() if err != nil { @@ -11096,7 +11358,7 @@ func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlanCollection) if err != nil { return } @@ -11109,12 +11371,12 @@ func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolic // UpdateBackupPolicy : Update a backup policy // This request updates a backup policy with the information in a provided backup policy patch. The backup policy patch // object is structured in the same way as a retrieved backup policy and contains only the information to be updated. -func (vpc *VpcV1) UpdateBackupPolicy(updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) UpdateBackupPolicy(updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { return vpc.UpdateBackupPolicyWithContext(context.Background(), updateBackupPolicyOptions) } // UpdateBackupPolicyWithContext is an alternate form of the UpdateBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateBackupPolicyWithContext(ctx context.Context, updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result *BackupPolicy, response *core.DetailedResponse, err error) { +func (vpc *VpcV1) UpdateBackupPolicyWithContext(ctx context.Context, updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateBackupPolicyOptions, "updateBackupPolicyOptions cannot be nil") if err != nil { return @@ -11179,44 +11441,57 @@ func (vpc *VpcV1) UpdateBackupPolicyWithContext(ctx context.Context, updateBacku return } -// ListPlacementGroups : List all placement groups -// This request lists all placement groups in the region. -func (vpc *VpcV1) ListPlacementGroups(listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListPlacementGroupsWithContext(context.Background(), listPlacementGroupsOptions) +// UpdateBackupPolicyPlan : Update a backup policy plan +// This request updates a backup policy plan with the information in a provided plan patch. The plan patch object is +// structured in the same way as a retrieved backup policy plan and can contains only the information to be updated. +func (vpc *VpcV1) UpdateBackupPolicyPlan(updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { + return vpc.UpdateBackupPolicyPlanWithContext(context.Background(), updateBackupPolicyPlanOptions) } -// ListPlacementGroupsWithContext is an alternate form of the ListPlacementGroups method which supports a Context parameter -func (vpc *VpcV1) ListPlacementGroupsWithContext(ctx context.Context, listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listPlacementGroupsOptions, "listPlacementGroupsOptions") +// UpdateBackupPolicyPlanWithContext is an alternate form of the UpdateBackupPolicyPlan method which supports a Context parameter +func (vpc *VpcV1) UpdateBackupPolicyPlanWithContext(ctx context.Context, updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "backup_policy_id": *updateBackupPolicyPlanOptions.BackupPolicyID, + "id": *updateBackupPolicyPlanOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listPlacementGroupsOptions.Headers { + for headerName, headerValue := range updateBackupPolicyPlanOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPlacementGroups") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBackupPolicyPlan") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateBackupPolicyPlanOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateBackupPolicyPlanOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listPlacementGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listPlacementGroupsOptions.Start)) - } - if listPlacementGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listPlacementGroupsOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateBackupPolicyPlanOptions.BackupPolicyPlanPatch) + if err != nil { + return } request, err := builder.Build() @@ -11230,7 +11505,7 @@ func (vpc *VpcV1) ListPlacementGroupsWithContext(ctx context.Context, listPlacem return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroupCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) if err != nil { return } @@ -11430,53 +11705,44 @@ func (vpc *VpcV1) GetPlacementGroupWithContext(ctx context.Context, getPlacement return } -// UpdatePlacementGroup : Update a placement group -// This request updates a placement group with the information provided placement group patch. The placement group patch -// object is structured in the same way as a retrieved placement group and contains only the information to be updated. -func (vpc *VpcV1) UpdatePlacementGroup(updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - return vpc.UpdatePlacementGroupWithContext(context.Background(), updatePlacementGroupOptions) +// ListPlacementGroups : List all placement groups +// This request lists all placement groups in the region. +func (vpc *VpcV1) ListPlacementGroups(listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListPlacementGroupsWithContext(context.Background(), listPlacementGroupsOptions) } -// UpdatePlacementGroupWithContext is an alternate form of the UpdatePlacementGroup method which supports a Context parameter -func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updatePlacementGroupOptions, "updatePlacementGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updatePlacementGroupOptions, "updatePlacementGroupOptions") +// ListPlacementGroupsWithContext is an alternate form of the ListPlacementGroups method which supports a Context parameter +func (vpc *VpcV1) ListPlacementGroupsWithContext(ctx context.Context, listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listPlacementGroupsOptions, "listPlacementGroupsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updatePlacementGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups`, nil) if err != nil { return } - for headerName, headerValue := range updatePlacementGroupOptions.Headers { + for headerName, headerValue := range listPlacementGroupsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePlacementGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPlacementGroups") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updatePlacementGroupOptions.PlacementGroupPatch) - if err != nil { - return + if listPlacementGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listPlacementGroupsOptions.Start)) + } + if listPlacementGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listPlacementGroupsOptions.Limit)) } request, err := builder.Build() @@ -11490,7 +11756,7 @@ func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePla return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroupCollection) if err != nil { return } @@ -11500,46 +11766,53 @@ func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePla return } -// ListBareMetalServerProfiles : List all bare metal server profiles -// This request lists all [bare metal server -// profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare metal -// server profile specifies the performance characteristics and pricing model for a bare metal server. -func (vpc *VpcV1) ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerProfilesWithContext(context.Background(), listBareMetalServerProfilesOptions) +// UpdatePlacementGroup : Update a placement group +// This request updates a placement group with the information provided placement group patch. The placement group patch +// object is structured in the same way as a retrieved placement group and contains only the information to be updated. +func (vpc *VpcV1) UpdatePlacementGroup(updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { + return vpc.UpdatePlacementGroupWithContext(context.Background(), updatePlacementGroupOptions) } -// ListBareMetalServerProfilesWithContext is an alternate form of the ListBareMetalServerProfiles method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBareMetalServerProfilesOptions, "listBareMetalServerProfilesOptions") +// UpdatePlacementGroupWithContext is an alternate form of the UpdatePlacementGroup method which supports a Context parameter +func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updatePlacementGroupOptions, "updatePlacementGroupOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updatePlacementGroupOptions, "updatePlacementGroupOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *updatePlacementGroupOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBareMetalServerProfilesOptions.Headers { + for headerName, headerValue := range updatePlacementGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePlacementGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServerProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServerProfilesOptions.Start)) - } - if listBareMetalServerProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerProfilesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updatePlacementGroupOptions.PlacementGroupPatch) + if err != nil { + return } request, err := builder.Build() @@ -11553,7 +11826,7 @@ func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, li return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroup) if err != nil { return } @@ -11563,40 +11836,50 @@ func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, li return } -// GetBareMetalServerProfile : Retrieve a bare metal server profile -// This request retrieves a single bare metal server profile specified by the name in the URL. -func (vpc *VpcV1) GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerProfileWithContext(context.Background(), getBareMetalServerProfileOptions) +// AddBareMetalServerNetworkInterfaceFloatingIP : Associate a floating IP with a bare metal server network interface +// This request associates the specified floating IP with the specified bare metal server network interface. If +// `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If `enable_infrastructure_nat` +// is `true`, this replaces any existing association. +// +// The existing floating IP must: +// - not be required by another resource, such as a public gateway +// - be in the same `zone` as the bare metal server +// +// A request body is not required, and if provided, is ignored. +func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), addBareMetalServerNetworkInterfaceFloatingIPOptions) } -// GetBareMetalServerProfileWithContext is an alternate form of the GetBareMetalServerProfile method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerProfileWithContext(ctx context.Context, getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions cannot be nil") +// AddBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the AddBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions") + err = core.ValidateStruct(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getBareMetalServerProfileOptions.Name, + "bare_metal_server_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerProfileOptions.Headers { + for headerName, headerValue := range addBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddBareMetalServerNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11616,83 +11899,7 @@ func (vpc *VpcV1) GetBareMetalServerProfileWithContext(ctx context.Context, getB return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServers : List all bare metal servers -// This request lists all bare metal servers in the region. -func (vpc *VpcV1) ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServersWithContext(context.Background(), listBareMetalServersOptions) -} - -// ListBareMetalServersWithContext is an alternate form of the ListBareMetalServers method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServersWithContext(ctx context.Context, listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBareMetalServersOptions, "listBareMetalServersOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServersOptions.Start)) - } - if listBareMetalServersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServersOptions.Limit)) - } - if listBareMetalServersOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listBareMetalServersOptions.ResourceGroupID)) - } - if listBareMetalServersOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBareMetalServersOptions.Name)) - } - if listBareMetalServersOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listBareMetalServersOptions.VPCID)) - } - if listBareMetalServersOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listBareMetalServersOptions.VPCCRN)) - } - if listBareMetalServersOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listBareMetalServersOptions.VPCName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -11743,38 +11950,7 @@ func (vpc *VpcV1) CreateBareMetalServerWithContext(ctx context.Context, createBa builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createBareMetalServerOptions.Initialization != nil { - body["initialization"] = createBareMetalServerOptions.Initialization - } - if createBareMetalServerOptions.PrimaryNetworkInterface != nil { - body["primary_network_interface"] = createBareMetalServerOptions.PrimaryNetworkInterface - } - if createBareMetalServerOptions.Profile != nil { - body["profile"] = createBareMetalServerOptions.Profile - } - if createBareMetalServerOptions.Zone != nil { - body["zone"] = createBareMetalServerOptions.Zone - } - if createBareMetalServerOptions.EnableSecureBoot != nil { - body["enable_secure_boot"] = createBareMetalServerOptions.EnableSecureBoot - } - if createBareMetalServerOptions.Name != nil { - body["name"] = createBareMetalServerOptions.Name - } - if createBareMetalServerOptions.NetworkInterfaces != nil { - body["network_interfaces"] = createBareMetalServerOptions.NetworkInterfaces - } - if createBareMetalServerOptions.ResourceGroup != nil { - body["resource_group"] = createBareMetalServerOptions.ResourceGroup - } - if createBareMetalServerOptions.TrustedPlatformModule != nil { - body["trusted_platform_module"] = createBareMetalServerOptions.TrustedPlatformModule - } - if createBareMetalServerOptions.VPC != nil { - body["vpc"] = createBareMetalServerOptions.VPC - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(createBareMetalServerOptions.BareMetalServerPrototype) if err != nil { return } @@ -11879,114 +12055,56 @@ func (vpc *VpcV1) CreateBareMetalServerConsoleAccessTokenWithContext(ctx context return } -// ListBareMetalServerDisks : List all disks on a bare metal server -// This request lists all disks on a bare metal server. A disk is a block device that is locally attached to the -// physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest disk -// first. -func (vpc *VpcV1) ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerDisksWithContext(context.Background(), listBareMetalServerDisksOptions) +// CreateBareMetalServerNetworkAttachment : Create a network attachment on a bare metal server +// This request creates a new bare metal server network attachment from a bare metal server network attachment prototype +// object. The prototype object is structured in the same way as a retrieved bare metal server network attachment, and +// contains the information necessary to create the new bare metal server network attachment. +func (vpc *VpcV1) CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + return vpc.CreateBareMetalServerNetworkAttachmentWithContext(context.Background(), createBareMetalServerNetworkAttachmentOptions) } -// ListBareMetalServerDisksWithContext is an alternate form of the ListBareMetalServerDisks method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerDisksWithContext(ctx context.Context, listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions cannot be nil") +// CreateBareMetalServerNetworkAttachmentWithContext is an alternate form of the CreateBareMetalServerNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) CreateBareMetalServerNetworkAttachmentWithContext(ctx context.Context, createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBareMetalServerNetworkAttachmentOptions, "createBareMetalServerNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions") + err = core.ValidateStruct(createBareMetalServerNetworkAttachmentOptions, "createBareMetalServerNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerDisksOptions.BareMetalServerID, + "bare_metal_server_id": *createBareMetalServerNetworkAttachmentOptions.BareMetalServerID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBareMetalServerDisksOptions.Headers { + for headerName, headerValue := range createBareMetalServerNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerDisks") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDiskCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerDisk : Retrieve a bare metal server disk -// This request retrieves a single disk specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerDiskWithContext(context.Background(), getBareMetalServerDiskOptions) -} - -// GetBareMetalServerDiskWithContext is an alternate form of the GetBareMetalServerDisk method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerDiskOptions.BareMetalServerID, - "id": *getBareMetalServerDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) + _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkAttachmentOptions.BareMetalServerNetworkAttachmentPrototype) if err != nil { return } - for headerName, headerValue := range getBareMetalServerDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() if err != nil { return @@ -11998,7 +12116,7 @@ func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBare return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) if err != nil { return } @@ -12008,51 +12126,58 @@ func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBare return } -// UpdateBareMetalServerDisk : Update a bare metal server disk -// This request updates the bare metal server disk with the information in a provided patch. -func (vpc *VpcV1) UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerDiskWithContext(context.Background(), updateBareMetalServerDiskOptions) +// CreateBareMetalServerNetworkInterface : Create a network interface on a bare metal server +// This request creates a new bare metal server network interface from a bare metal server network interface prototype +// object. The prototype object is structured in the same way as a retrieved bare metal server network interface, and +// contains the information necessary to create the new bare metal server network interface. Any subnet in the bare +// metal server's VPC may be specified, even if it is already attached to another bare metal server network interface. +// Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. +// +// If this bare metal server has network attachments, each network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. +func (vpc *VpcV1) CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.CreateBareMetalServerNetworkInterfaceWithContext(context.Background(), createBareMetalServerNetworkInterfaceOptions) } -// UpdateBareMetalServerDiskWithContext is an alternate form of the UpdateBareMetalServerDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions cannot be nil") +// CreateBareMetalServerNetworkInterfaceWithContext is an alternate form of the CreateBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions") + err = core.ValidateStruct(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *updateBareMetalServerDiskOptions.BareMetalServerID, - "id": *updateBareMetalServerDiskOptions.ID, + "bare_metal_server_id": *createBareMetalServerNetworkInterfaceOptions.BareMetalServerID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateBareMetalServerDiskOptions.Headers { + for headerName, headerValue := range createBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerDisk") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateBareMetalServerDiskOptions.BareMetalServerDiskPatch) + _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePrototype) if err != nil { return } @@ -12068,7 +12193,7 @@ func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, upda return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -12078,147 +12203,109 @@ func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, upda return } -// ListBareMetalServerNetworkInterfaces : List all network interfaces on a bare metal server -// This request lists all network interfaces on a bare metal server. A bare metal server network interface is an -// abstract representation of a network device and attaches a bare metal server to a single subnet. Each network -// interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached to -// the bare metal server. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfacesWithContext(context.Background(), listBareMetalServerNetworkInterfacesOptions) +// DeleteBareMetalServer : Delete a bare metal server +// This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the +// bare metal server network interfaces are implicitly disassociated. +func (vpc *VpcV1) DeleteBareMetalServer(deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteBareMetalServerWithContext(context.Background(), deleteBareMetalServerOptions) } -// ListBareMetalServerNetworkInterfacesWithContext is an alternate form of the ListBareMetalServerNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfacesWithContext(ctx context.Context, listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions cannot be nil") +// DeleteBareMetalServerWithContext is an alternate form of the DeleteBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) DeleteBareMetalServerWithContext(ctx context.Context, deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBareMetalServerOptions, "deleteBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions") + err = core.ValidateStruct(deleteBareMetalServerOptions, "deleteBareMetalServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfacesOptions.BareMetalServerID, + "id": *deleteBareMetalServerOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBareMetalServerNetworkInterfacesOptions.Headers { + for headerName, headerValue := range deleteBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaces") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServerNetworkInterfacesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Start)) - } - if listBareMetalServerNetworkInterfacesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Limit)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterfaceCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateBareMetalServerNetworkInterface : Create a network interface on a bare metal server -// This request creates a new bare metal server network interface from a bare metal server network interface prototype -// object. The prototype object is structured in the same way as a retrieved bare metal server network interface, and -// contains the information necessary to create the new bare metal server network interface. Any subnet in the bare -// metal server's VPC may be specified, even if it is already attached to another bare metal server network interface. -// Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. -func (vpc *VpcV1) CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.CreateBareMetalServerNetworkInterfaceWithContext(context.Background(), createBareMetalServerNetworkInterfaceOptions) +// DeleteBareMetalServerNetworkAttachment : Delete a bare metal server network attachment +// This request deletes a bare metal server network attachment. This operation cannot be reversed. Any floating IPs +// associated with the bare metal server network attachment are implicitly disassociated. +// +// The bare metal server's primary network attachment cannot be deleted. +func (vpc *VpcV1) DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptions *DeleteBareMetalServerNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteBareMetalServerNetworkAttachmentWithContext(context.Background(), deleteBareMetalServerNetworkAttachmentOptions) } -// CreateBareMetalServerNetworkInterfaceWithContext is an alternate form of the CreateBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions cannot be nil") +// DeleteBareMetalServerNetworkAttachmentWithContext is an alternate form of the DeleteBareMetalServerNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) DeleteBareMetalServerNetworkAttachmentWithContext(ctx context.Context, deleteBareMetalServerNetworkAttachmentOptions *DeleteBareMetalServerNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBareMetalServerNetworkAttachmentOptions, "deleteBareMetalServerNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions") + err = core.ValidateStruct(deleteBareMetalServerNetworkAttachmentOptions, "deleteBareMetalServerNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *createBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "bare_metal_server_id": *deleteBareMetalServerNetworkAttachmentOptions.BareMetalServerID, + "id": *deleteBareMetalServerNetworkAttachmentOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createBareMetalServerNetworkInterfaceOptions.Headers { + for headerName, headerValue := range deleteBareMetalServerNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServerNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } @@ -12227,6 +12314,10 @@ func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.C // This request deletes a bare metal server network interface. This operation cannot be reversed. Any floating IPs // associated with the bare metal server network interface are implicitly disassociated. The primary bare metal server // network interface is not allowed to be deleted. +// +// If this bare metal server has network attachments, this network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be deleted. func (vpc *VpcV1) DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { return vpc.DeleteBareMetalServerNetworkInterfaceWithContext(context.Background(), deleteBareMetalServerNetworkInterfaceOptions) } @@ -12277,41 +12368,40 @@ func (vpc *VpcV1) DeleteBareMetalServerNetworkInterfaceWithContext(ctx context.C return } -// GetBareMetalServerNetworkInterface : Retrieve a bare metal server network interface -// This request retrieves a single bare metal server network interface specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceWithContext(context.Background(), getBareMetalServerNetworkInterfaceOptions) +// GetBareMetalServer : Retrieve a bare metal server +// This request retrieves a single bare metal server specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerWithContext(context.Background(), getBareMetalServerOptions) } -// GetBareMetalServerNetworkInterfaceWithContext is an alternate form of the GetBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions cannot be nil") +// GetBareMetalServerWithContext is an alternate form of the GetBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerOptions, "getBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions") + err = core.ValidateStruct(getBareMetalServerOptions, "getBareMetalServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - "id": *getBareMetalServerNetworkInterfaceOptions.ID, + "id": *getBareMetalServerOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12331,7 +12421,7 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Cont return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) if err != nil { return } @@ -12341,57 +12431,49 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Cont return } -// UpdateBareMetalServerNetworkInterface : Update a bare metal server network interface -// This request updates a bare metal server network interface with the information provided in a bare metal server -// network interface patch object. The bare metal server network interface patch object is structured in the same way as -// a retrieved bare metal server network interface and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerNetworkInterfaceWithContext(context.Background(), updateBareMetalServerNetworkInterfaceOptions) +// GetBareMetalServerDisk : Retrieve a bare metal server disk +// This request retrieves a single disk specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerDiskWithContext(context.Background(), getBareMetalServerDiskOptions) } -// UpdateBareMetalServerNetworkInterfaceWithContext is an alternate form of the UpdateBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions cannot be nil") +// GetBareMetalServerDiskWithContext is an alternate form of the GetBareMetalServerDisk method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions") + err = core.ValidateStruct(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *updateBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - "id": *updateBareMetalServerNetworkInterfaceOptions.ID, + "bare_metal_server_id": *getBareMetalServerDiskOptions.BareMetalServerID, + "id": *getBareMetalServerDiskOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateBareMetalServerNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getBareMetalServerDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -12403,7 +12485,7 @@ func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.C return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) if err != nil { return } @@ -12413,41 +12495,42 @@ func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.C return } -// ListBareMetalServerNetworkInterfaceFloatingIps : List all floating IPs associated with a bare metal server network interface -// This request lists all floating IPs associated with a bare metal server network interface. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceFloatingIpsOptions) +// GetBareMetalServerInitialization : Retrieve initialization configuration for a bare metal server +// This request retrieves configuration used to initialize the bare metal server, such as the image used, SSH keys, and +// any configured usernames and passwords. These can subsequently be changed on the server and therefore may not be +// current. +func (vpc *VpcV1) GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerInitializationWithContext(context.Background(), getBareMetalServerInitializationOptions) } -// ListBareMetalServerNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be nil") +// GetBareMetalServerInitializationWithContext is an alternate form of the GetBareMetalServerInitialization method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Context, getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions") + err = core.ValidateStruct(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.BareMetalServerID, - "network_interface_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, + "id": *getBareMetalServerInitializationOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/initialization`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBareMetalServerNetworkInterfaceFloatingIpsOptions.Headers { + for headerName, headerValue := range getBareMetalServerInitializationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceFloatingIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerInitialization") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12467,7 +12550,7 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerInitialization) if err != nil { return } @@ -12477,45 +12560,45 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx return } -// RemoveBareMetalServerNetworkInterfaceFloatingIP : Disassociate a floating IP from a bare metal server network interface -// This request disassociates the specified floating IP from the specified bare metal server network interface. -func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), removeBareMetalServerNetworkInterfaceFloatingIPOptions) +// GetBareMetalServerNetworkAttachment : Retrieve a bare metal server network attachment +// This request retrieves a single bare metal server network attachment specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkAttachmentWithContext(context.Background(), getBareMetalServerNetworkAttachmentOptions) } -// RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") +// GetBareMetalServerNetworkAttachmentWithContext is an alternate form of the GetBareMetalServerNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkAttachmentWithContext(ctx context.Context, getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkAttachmentOptions, "getBareMetalServerNetworkAttachmentOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(getBareMetalServerNetworkAttachmentOptions, "getBareMetalServerNetworkAttachmentOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.ID, + "bare_metal_server_id": *getBareMetalServerNetworkAttachmentOptions.BareMetalServerID, + "id": *getBareMetalServerNetworkAttachmentOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveBareMetalServerNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -12525,48 +12608,61 @@ func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) + if err != nil { + return + } + response.Result = result + } return } -// GetBareMetalServerNetworkInterfaceFloatingIP : Retrieve associated floating IP -// This request retrieves a specified floating IP if it is associated with the bare metal server network interface -// specified in the URL. -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceFloatingIPOptions) +// GetBareMetalServerNetworkInterface : Retrieve a bare metal server network interface +// This request retrieves a single bare metal server network interface specified by the identifier in the URL. +// +// If this bare metal server has network attachments, the retrieved network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. +func (vpc *VpcV1) GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkInterfaceWithContext(context.Background(), getBareMetalServerNetworkInterfaceOptions) } -// GetBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") +// GetBareMetalServerNetworkInterfaceWithContext is an alternate form of the GetBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.ID, + "bare_metal_server_id": *getBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "id": *getBareMetalServerNetworkInterfaceOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12586,7 +12682,7 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx co return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -12596,33 +12692,31 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx co return } -// AddBareMetalServerNetworkInterfaceFloatingIP : Associate a floating IP with a bare metal server network interface -// This request associates the specified floating IP with the specified bare metal server network interface. If -// `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If `enable_infrastructure_nat` -// is `true`, this replaces any existing association. For this request to succeed, the existing floating IP must not be -// required by another resource, such as a public gateway. A request body is not required, and if provided, is ignored. -func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), addBareMetalServerNetworkInterfaceFloatingIPOptions) +// GetBareMetalServerNetworkInterfaceFloatingIP : Retrieve associated floating IP +// This request retrieves a specified floating IP if it is associated with the bare metal server network interface +// specified in the URL. +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceFloatingIPOptions) } -// AddBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the AddBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") +// GetBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions") + err = core.ValidateStruct(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.ID, + "bare_metal_server_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) @@ -12630,11 +12724,11 @@ func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx co return } - for headerName, headerValue := range addBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddBareMetalServerNetworkInterfaceFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12664,41 +12758,42 @@ func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx co return } -// ListBareMetalServerNetworkInterfaceIps : List the primary reserved IP for a bare metal server network interface -// This request lists the primary reserved IP for a bare metal server network interface. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfaceIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceIpsOptions) +// GetBareMetalServerNetworkInterfaceIP : Retrieve the primary reserved IP +// This request retrieves the primary reserved IP for a bare metal server network interface. +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkInterfaceIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceIPOptions) } -// ListBareMetalServerNetworkInterfaceIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceIps method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions cannot be nil") +// GetBareMetalServerNetworkInterfaceIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceIP method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions") + err = core.ValidateStruct(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfaceIpsOptions.BareMetalServerID, - "network_interface_id": *listBareMetalServerNetworkInterfaceIpsOptions.NetworkInterfaceID, + "bare_metal_server_id": *getBareMetalServerNetworkInterfaceIPOptions.BareMetalServerID, + "network_interface_id": *getBareMetalServerNetworkInterfaceIPOptions.NetworkInterfaceID, + "id": *getBareMetalServerNetworkInterfaceIPOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listBareMetalServerNetworkInterfaceIpsOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkInterfaceIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12718,7 +12813,7 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context. return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) if err != nil { return } @@ -12728,42 +12823,40 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context. return } -// GetBareMetalServerNetworkInterfaceIP : Retrieve the primary reserved IP -// This request retrieves the primary reserved IP for a bare metal server network interface. -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceIPOptions) +// GetBareMetalServerProfile : Retrieve a bare metal server profile +// This request retrieves a single bare metal server profile specified by the name in the URL. +func (vpc *VpcV1) GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerProfileWithContext(context.Background(), getBareMetalServerProfileOptions) } -// GetBareMetalServerNetworkInterfaceIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions cannot be nil") +// GetBareMetalServerProfileWithContext is an alternate form of the GetBareMetalServerProfile method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerProfileWithContext(ctx context.Context, getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions") + err = core.ValidateStruct(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceIPOptions.BareMetalServerID, - "network_interface_id": *getBareMetalServerNetworkInterfaceIPOptions.NetworkInterfaceID, - "id": *getBareMetalServerNetworkInterfaceIPOptions.ID, + "name": *getBareMetalServerProfileOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerNetworkInterfaceIPOptions.Headers { + for headerName, headerValue := range getBareMetalServerProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12783,7 +12876,7 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIPWithContext(ctx context.Co return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfile) if err != nil { return } @@ -12793,44 +12886,46 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIPWithContext(ctx context.Co return } -// DeleteBareMetalServer : Delete a bare metal server -// This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the -// bare metal server network interfaces are implicitly disassociated. -func (vpc *VpcV1) DeleteBareMetalServer(deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteBareMetalServerWithContext(context.Background(), deleteBareMetalServerOptions) +// ListBareMetalServerDisks : List all disks on a bare metal server +// This request lists all disks on a bare metal server. A disk is a block device that is locally attached to the +// physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest disk +// first. +func (vpc *VpcV1) ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerDisksWithContext(context.Background(), listBareMetalServerDisksOptions) } -// DeleteBareMetalServerWithContext is an alternate form of the DeleteBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) DeleteBareMetalServerWithContext(ctx context.Context, deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBareMetalServerOptions, "deleteBareMetalServerOptions cannot be nil") +// ListBareMetalServerDisksWithContext is an alternate form of the ListBareMetalServerDisks method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerDisksWithContext(ctx context.Context, listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteBareMetalServerOptions, "deleteBareMetalServerOptions") + err = core.ValidateStruct(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteBareMetalServerOptions.ID, + "bare_metal_server_id": *listBareMetalServerDisksOptions.BareMetalServerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteBareMetalServerOptions.Headers { + for headerName, headerValue := range listBareMetalServerDisksOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerDisks") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -12840,45 +12935,63 @@ func (vpc *VpcV1) DeleteBareMetalServerWithContext(ctx context.Context, deleteBa return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDiskCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetBareMetalServer : Retrieve a bare metal server -// This request retrieves a single bare metal server specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerWithContext(context.Background(), getBareMetalServerOptions) +// ListBareMetalServerNetworkAttachments : List all network attachments on a bare metal server +// This request lists all network attachments on a bare metal server. A bare metal server network attachment is an +// abstract representation of a network device and attaches a bare metal server to a single subnet. Each network +// interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached to +// the bare metal server. +// +// The network attachments will be sorted by their `created_at` property values, with newest network attachments first. +// Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` property +// values. +func (vpc *VpcV1) ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions) (result *BareMetalServerNetworkAttachmentCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkAttachmentsWithContext(context.Background(), listBareMetalServerNetworkAttachmentsOptions) } -// GetBareMetalServerWithContext is an alternate form of the GetBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerOptions, "getBareMetalServerOptions cannot be nil") +// ListBareMetalServerNetworkAttachmentsWithContext is an alternate form of the ListBareMetalServerNetworkAttachments method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkAttachmentsWithContext(ctx context.Context, listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions) (result *BareMetalServerNetworkAttachmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkAttachmentsOptions, "listBareMetalServerNetworkAttachmentsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerOptions, "getBareMetalServerOptions") + err = core.ValidateStruct(listBareMetalServerNetworkAttachmentsOptions, "listBareMetalServerNetworkAttachmentsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getBareMetalServerOptions.ID, + "bare_metal_server_id": *listBareMetalServerNetworkAttachmentsOptions.BareMetalServerID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerOptions.Headers { + for headerName, headerValue := range listBareMetalServerNetworkAttachmentsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkAttachments") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12886,6 +12999,12 @@ func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMeta builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBareMetalServerNetworkAttachmentsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkAttachmentsOptions.Start)) + } + if listBareMetalServerNetworkAttachmentsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkAttachmentsOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -12898,7 +13017,7 @@ func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMeta return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachmentCollection) if err != nil { return } @@ -12908,55 +13027,113 @@ func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMeta return } -// UpdateBareMetalServer : Update a bare metal server -// This request updates a bare metal server with the information in a provided patch. The bare metal server patch object -// is structured in the same way as a retrieved bare metal server and contains only the information to be updated. -func (vpc *VpcV1) UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerWithContext(context.Background(), updateBareMetalServerOptions) +// ListBareMetalServerNetworkInterfaceFloatingIps : List all floating IPs associated with a bare metal server network interface +// This request lists all floating IPs associated with a bare metal server network interface. +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceFloatingIpsOptions) } -// UpdateBareMetalServerWithContext is an alternate form of the UpdateBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerOptions, "updateBareMetalServerOptions cannot be nil") +// ListBareMetalServerNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateBareMetalServerOptions, "updateBareMetalServerOptions") + err = core.ValidateStruct(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateBareMetalServerOptions.ID, + "bare_metal_server_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.BareMetalServerID, + "network_interface_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateBareMetalServerOptions.Headers { + for headerName, headerValue := range listBareMetalServerNetworkInterfaceFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateBareMetalServerOptions.BareMetalServerPatch) + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListBareMetalServerNetworkInterfaceIps : List the primary reserved IP for a bare metal server network interface +// This request lists the primary reserved IP for a bare metal server network interface. +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkInterfaceIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceIpsOptions) +} + +// ListBareMetalServerNetworkInterfaceIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceIps method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "bare_metal_server_id": *listBareMetalServerNetworkInterfaceIpsOptions.BareMetalServerID, + "network_interface_id": *listBareMetalServerNetworkInterfaceIpsOptions.NetworkInterfaceID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips`, pathParamsMap) if err != nil { return } + for headerName, headerValue := range listBareMetalServerNetworkInterfaceIpsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceIps") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + request, err := builder.Build() if err != nil { return @@ -12968,7 +13145,7 @@ func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBa return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext) if err != nil { return } @@ -12978,42 +13155,47 @@ func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBa return } -// GetBareMetalServerInitialization : Retrieve initialization configuration for a bare metal server -// This request retrieves configuration used to initialize the bare metal server, such as the image used, SSH keys, and -// any configured usernames and passwords. These can subsequently be changed on the server and therefore may not be -// current. -func (vpc *VpcV1) GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerInitializationWithContext(context.Background(), getBareMetalServerInitializationOptions) +// ListBareMetalServerNetworkInterfaces : List all network interfaces on a bare metal server +// This request lists all network interfaces on a bare metal server. A bare metal server network interface is an +// abstract representation of a network device and attaches a bare metal server to a single subnet. Each network +// interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached to +// the bare metal server. +// +// If this bare metal server has network attachments, each returned network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkInterfacesWithContext(context.Background(), listBareMetalServerNetworkInterfacesOptions) } -// GetBareMetalServerInitializationWithContext is an alternate form of the GetBareMetalServerInitialization method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Context, getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions cannot be nil") +// ListBareMetalServerNetworkInterfacesWithContext is an alternate form of the ListBareMetalServerNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkInterfacesWithContext(ctx context.Context, listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions") + err = core.ValidateStruct(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getBareMetalServerInitializationOptions.ID, + "bare_metal_server_id": *listBareMetalServerNetworkInterfacesOptions.BareMetalServerID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/initialization`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getBareMetalServerInitializationOptions.Headers { + for headerName, headerValue := range listBareMetalServerNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerInitialization") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13021,6 +13203,12 @@ func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Contex builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBareMetalServerNetworkInterfacesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Start)) + } + if listBareMetalServerNetworkInterfacesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -13033,7 +13221,146 @@ func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerInitialization) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterfaceCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListBareMetalServerProfiles : List all bare metal server profiles +// This request lists all [bare metal server +// profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare metal +// server profile specifies the performance characteristics and pricing model for a bare metal server. +func (vpc *VpcV1) ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerProfilesWithContext(context.Background(), listBareMetalServerProfilesOptions) +} + +// ListBareMetalServerProfilesWithContext is an alternate form of the ListBareMetalServerProfiles method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listBareMetalServerProfilesOptions, "listBareMetalServerProfilesOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listBareMetalServerProfilesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerProfiles") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBareMetalServerProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServerProfilesOptions.Start)) + } + if listBareMetalServerProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerProfilesOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfileCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListBareMetalServers : List all bare metal servers +// This request lists all bare metal servers in the region. +func (vpc *VpcV1) ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServersWithContext(context.Background(), listBareMetalServersOptions) +} + +// ListBareMetalServersWithContext is an alternate form of the ListBareMetalServers method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServersWithContext(ctx context.Context, listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listBareMetalServersOptions, "listBareMetalServersOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listBareMetalServersOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServers") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listBareMetalServersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServersOptions.Start)) + } + if listBareMetalServersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServersOptions.Limit)) + } + if listBareMetalServersOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listBareMetalServersOptions.ResourceGroupID)) + } + if listBareMetalServersOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listBareMetalServersOptions.Name)) + } + if listBareMetalServersOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listBareMetalServersOptions.VPCID)) + } + if listBareMetalServersOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listBareMetalServersOptions.VPCCRN)) + } + if listBareMetalServersOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listBareMetalServersOptions.VPCName)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerCollection) if err != nil { return } @@ -13043,6 +13370,59 @@ func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Contex return } +// RemoveBareMetalServerNetworkInterfaceFloatingIP : Disassociate a floating IP from a bare metal server network interface +// This request disassociates the specified floating IP from the specified bare metal server network interface. +func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), removeBareMetalServerNetworkInterfaceFloatingIPOptions) +} + +// RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "bare_metal_server_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range removeBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveBareMetalServerNetworkInterfaceFloatingIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + response, err = vpc.Service.Request(request, nil) + + return +} + // RestartBareMetalServer : Restart a bare metal server // This request restarts a bare metal server. It will run immediately regardless of the state of the server. func (vpc *VpcV1) RestartBareMetalServer(restartBareMetalServerOptions *RestartBareMetalServerOptions) (response *core.DetailedResponse, err error) { @@ -13207,45 +13587,53 @@ func (vpc *VpcV1) StopBareMetalServerWithContext(ctx context.Context, stopBareMe return } -// ListVolumeProfiles : List all volume profiles -// This request lists all [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available -// in the region. A volume profile specifies the performance characteristics and pricing model for a volume. -func (vpc *VpcV1) ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumeProfilesWithContext(context.Background(), listVolumeProfilesOptions) +// UpdateBareMetalServer : Update a bare metal server +// This request updates a bare metal server with the information in a provided patch. The bare metal server patch object +// is structured in the same way as a retrieved bare metal server and contains only the information to be updated. +func (vpc *VpcV1) UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerWithContext(context.Background(), updateBareMetalServerOptions) } -// ListVolumeProfilesWithContext is an alternate form of the ListVolumeProfiles method which supports a Context parameter -func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumeProfilesOptions, "listVolumeProfilesOptions") +// UpdateBareMetalServerWithContext is an alternate form of the UpdateBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerOptions, "updateBareMetalServerOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateBareMetalServerOptions, "updateBareMetalServerOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *updateBareMetalServerOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVolumeProfilesOptions.Headers { + for headerName, headerValue := range updateBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumeProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumeProfilesOptions.Start)) - } - if listVolumeProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumeProfilesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateBareMetalServerOptions.BareMetalServerPatch) + if err != nil { + return } request, err := builder.Build() @@ -13259,7 +13647,7 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) if err != nil { return } @@ -13269,48 +13657,55 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP return } -// GetVolumeProfile : Retrieve a volume profile -// This request retrieves a single volume profile specified by the name in the URL. -func (vpc *VpcV1) GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - return vpc.GetVolumeProfileWithContext(context.Background(), getVolumeProfileOptions) +// UpdateBareMetalServerDisk : Update a bare metal server disk +// This request updates the bare metal server disk with the information in a provided patch. +func (vpc *VpcV1) UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerDiskWithContext(context.Background(), updateBareMetalServerDiskOptions) } -// GetVolumeProfileWithContext is an alternate form of the GetVolumeProfile method which supports a Context parameter -func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVolumeProfileOptions, "getVolumeProfileOptions cannot be nil") +// UpdateBareMetalServerDiskWithContext is an alternate form of the UpdateBareMetalServerDisk method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVolumeProfileOptions, "getVolumeProfileOptions") + err = core.ValidateStruct(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getVolumeProfileOptions.Name, + "bare_metal_server_id": *updateBareMetalServerDiskOptions.BareMetalServerID, + "id": *updateBareMetalServerDiskOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVolumeProfileOptions.Headers { + for headerName, headerValue := range updateBareMetalServerDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateBareMetalServerDiskOptions.BareMetalServerDiskPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -13322,7 +13717,7 @@ func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProf return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) if err != nil { return } @@ -13332,63 +13727,131 @@ func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProf return } -// ListVolumes : List all volumes -// This request lists all volumes in the region. Volumes are network-connected block storage devices that may be -// attached to one or more instances in the same region. -func (vpc *VpcV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumesWithContext(context.Background(), listVolumesOptions) +// UpdateBareMetalServerNetworkAttachment : Update a bare metal server network attachment +// This request updates a bare metal server network attachment with the information provided in a bare metal server +// network attachment patch object. The bare metal server network attachment patch object is structured in the same way +// as a retrieved bare metal server network attachment and contains only the information to be updated. +func (vpc *VpcV1) UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerNetworkAttachmentWithContext(context.Background(), updateBareMetalServerNetworkAttachmentOptions) } -// ListVolumesWithContext is an alternate form of the ListVolumes method which supports a Context parameter -func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumesOptions, "listVolumesOptions") +// UpdateBareMetalServerNetworkAttachmentWithContext is an alternate form of the UpdateBareMetalServerNetworkAttachment method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerNetworkAttachmentWithContext(ctx context.Context, updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerNetworkAttachmentOptions, "updateBareMetalServerNetworkAttachmentOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateBareMetalServerNetworkAttachmentOptions, "updateBareMetalServerNetworkAttachmentOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "bare_metal_server_id": *updateBareMetalServerNetworkAttachmentOptions.BareMetalServerID, + "id": *updateBareMetalServerNetworkAttachmentOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVolumesOptions.Headers { + for headerName, headerValue := range updateBareMetalServerNetworkAttachmentOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkAttachment") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumesOptions.Start)) - } - if listVolumesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkAttachmentOptions.BareMetalServerNetworkAttachmentPatch) + if err != nil { + return } - if listVolumesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVolumesOptions.Name)) + + request, err := builder.Build() + if err != nil { + return } - if listVolumesOptions.AttachmentState != nil { - builder.AddQuery("attachment_state", fmt.Sprint(*listVolumesOptions.AttachmentState)) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return } - if listVolumesOptions.Encryption != nil { - builder.AddQuery("encryption", fmt.Sprint(*listVolumesOptions.Encryption)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) + if err != nil { + return + } + response.Result = result } - if listVolumesOptions.OperatingSystemFamily != nil { - builder.AddQuery("operating_system.family", fmt.Sprint(*listVolumesOptions.OperatingSystemFamily)) + + return +} + +// UpdateBareMetalServerNetworkInterface : Update a bare metal server network interface +// This request updates a bare metal server network interface with the information provided in a bare metal server +// network interface patch object. The bare metal server network interface patch object is structured in the same way as +// a retrieved bare metal server network interface and needs to contain only the information to be updated. +// +// If this bare metal server has network attachments, this network interface is a [read-only +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be updated. +func (vpc *VpcV1) UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerNetworkInterfaceWithContext(context.Background(), updateBareMetalServerNetworkInterfaceOptions) +} + +// UpdateBareMetalServerNetworkInterfaceWithContext is an alternate form of the UpdateBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions cannot be nil") + if err != nil { + return } - if listVolumesOptions.OperatingSystemArchitecture != nil { - builder.AddQuery("operating_system.architecture", fmt.Sprint(*listVolumesOptions.OperatingSystemArchitecture)) + err = core.ValidateStruct(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions") + if err != nil { + return } - if listVolumesOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listVolumesOptions.ZoneName)) + + pathParamsMap := map[string]string{ + "bare_metal_server_id": *updateBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "id": *updateBareMetalServerNetworkInterfaceOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateBareMetalServerNetworkInterfaceOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkInterface") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePatch) + if err != nil { + return } request, err := builder.Build() @@ -13402,7 +13865,7 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -13596,58 +14059,48 @@ func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *Ge return } -// UpdateVolume : Update a volume -// This request updates a volume with the information in a provided volume patch. The volume patch object is structured -// in the same way as a retrieved volume and contains only the information to be updated. -func (vpc *VpcV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.UpdateVolumeWithContext(context.Background(), updateVolumeOptions) +// GetVolumeProfile : Retrieve a volume profile +// This request retrieves a single volume profile specified by the name in the URL. +func (vpc *VpcV1) GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { + return vpc.GetVolumeProfileWithContext(context.Background(), getVolumeProfileOptions) } -// UpdateVolumeWithContext is an alternate form of the UpdateVolume method which supports a Context parameter -func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVolumeOptions, "updateVolumeOptions cannot be nil") +// GetVolumeProfileWithContext is an alternate form of the GetVolumeProfile method which supports a Context parameter +func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVolumeProfileOptions, "getVolumeProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVolumeOptions, "updateVolumeOptions") + err = core.ValidateStruct(getVolumeProfileOptions, "getVolumeProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVolumeOptions.ID, + "name": *getVolumeProfileOptions.Name, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVolumeOptions.Headers { + for headerName, headerValue := range getVolumeProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolume") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVolumeOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVolumeOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVolumeOptions.VolumePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -13659,7 +14112,7 @@ func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfile) if err != nil { return } @@ -13669,64 +14122,78 @@ func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptio return } -// DeleteSnapshots : Delete a filtered collection of snapshots -// This request deletes all snapshots created from a specific source volume. -func (vpc *VpcV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotsWithContext(context.Background(), deleteSnapshotsOptions) +// ListVolumeProfiles : List all volume profiles +// This request lists all [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available +// in the region. A volume profile specifies the performance characteristics and pricing model for a volume. +func (vpc *VpcV1) ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListVolumeProfilesWithContext(context.Background(), listVolumeProfilesOptions) } -// DeleteSnapshotsWithContext is an alternate form of the DeleteSnapshots method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotsOptions, "deleteSnapshotsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSnapshotsOptions, "deleteSnapshotsOptions") +// ListVolumeProfilesWithContext is an alternate form of the ListVolumeProfiles method which supports a Context parameter +func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVolumeProfilesOptions, "listVolumeProfilesOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles`, nil) if err != nil { return } - for headerName, headerValue := range deleteSnapshotsOptions.Headers { + for headerName, headerValue := range listVolumeProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshots") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - builder.AddQuery("source_volume.id", fmt.Sprint(*deleteSnapshotsOptions.SourceVolumeID)) + if listVolumeProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVolumeProfilesOptions.Start)) + } + if listVolumeProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVolumeProfilesOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfileCollection) + if err != nil { + return + } + response.Result = result + } return } -// ListSnapshots : List all snapshots -// This request lists all snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is -// created. -func (vpc *VpcV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotsWithContext(context.Background(), listSnapshotsOptions) +// ListVolumes : List all volumes +// This request lists all volumes in the region. Volumes are network-connected block storage devices that may be +// attached to one or more instances in the same region. +func (vpc *VpcV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { + return vpc.ListVolumesWithContext(context.Background(), listVolumesOptions) } -// ListSnapshotsWithContext is an alternate form of the ListSnapshots method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSnapshotsOptions, "listSnapshotsOptions") +// ListVolumesWithContext is an alternate form of the ListVolumes method which supports a Context parameter +func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVolumesOptions, "listVolumesOptions") if err != nil { return } @@ -13734,16 +14201,16 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) if err != nil { return } - for headerName, headerValue := range listSnapshotsOptions.Headers { + for headerName, headerValue := range listVolumesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshots") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumes") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13751,65 +14218,29 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSnapshotsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSnapshotsOptions.Start)) - } - if listSnapshotsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSnapshotsOptions.Limit)) - } - if listSnapshotsOptions.Tag != nil { - builder.AddQuery("tag", fmt.Sprint(*listSnapshotsOptions.Tag)) - } - if listSnapshotsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotsOptions.ResourceGroupID)) - } - if listSnapshotsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSnapshotsOptions.Name)) - } - if listSnapshotsOptions.SourceVolumeID != nil { - builder.AddQuery("source_volume.id", fmt.Sprint(*listSnapshotsOptions.SourceVolumeID)) - } - if listSnapshotsOptions.SourceVolumeCRN != nil { - builder.AddQuery("source_volume.crn", fmt.Sprint(*listSnapshotsOptions.SourceVolumeCRN)) - } - if listSnapshotsOptions.SourceImageID != nil { - builder.AddQuery("source_image.id", fmt.Sprint(*listSnapshotsOptions.SourceImageID)) - } - if listSnapshotsOptions.SourceImageCRN != nil { - builder.AddQuery("source_image.crn", fmt.Sprint(*listSnapshotsOptions.SourceImageCRN)) - } - if listSnapshotsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSnapshotsOptions.Sort)) - } - if listSnapshotsOptions.BackupPolicyPlanID != nil { - builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotsOptions.BackupPolicyPlanID)) - } - if listSnapshotsOptions.CopiesID != nil { - builder.AddQuery("copies[].id", fmt.Sprint(*listSnapshotsOptions.CopiesID)) - } - if listSnapshotsOptions.CopiesName != nil { - builder.AddQuery("copies[].name", fmt.Sprint(*listSnapshotsOptions.CopiesName)) + if listVolumesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVolumesOptions.Start)) } - if listSnapshotsOptions.CopiesCRN != nil { - builder.AddQuery("copies[].crn", fmt.Sprint(*listSnapshotsOptions.CopiesCRN)) + if listVolumesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVolumesOptions.Limit)) } - if listSnapshotsOptions.CopiesRemoteRegionName != nil { - builder.AddQuery("copies[].remote.region.name", fmt.Sprint(*listSnapshotsOptions.CopiesRemoteRegionName)) + if listVolumesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listVolumesOptions.Name)) } - if listSnapshotsOptions.SourceSnapshotID != nil { - builder.AddQuery("source_snapshot.id", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotID)) + if listVolumesOptions.AttachmentState != nil { + builder.AddQuery("attachment_state", fmt.Sprint(*listVolumesOptions.AttachmentState)) } - if listSnapshotsOptions.SourceSnapshotRemoteRegionName != nil { - builder.AddQuery("source_snapshot.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotRemoteRegionName)) + if listVolumesOptions.Encryption != nil { + builder.AddQuery("encryption", fmt.Sprint(*listVolumesOptions.Encryption)) } - if listSnapshotsOptions.SourceVolumeRemoteRegionName != nil { - builder.AddQuery("source_volume.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceVolumeRemoteRegionName)) + if listVolumesOptions.OperatingSystemFamily != nil { + builder.AddQuery("operating_system.family", fmt.Sprint(*listVolumesOptions.OperatingSystemFamily)) } - if listSnapshotsOptions.SourceImageRemoteRegionName != nil { - builder.AddQuery("source_image.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceImageRemoteRegionName)) + if listVolumesOptions.OperatingSystemArchitecture != nil { + builder.AddQuery("operating_system.architecture", fmt.Sprint(*listVolumesOptions.OperatingSystemArchitecture)) } - if listSnapshotsOptions.ClonesZoneName != nil { - builder.AddQuery("clones[].zone.name", fmt.Sprint(*listSnapshotsOptions.ClonesZoneName)) + if listVolumesOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listVolumesOptions.ZoneName)) } request, err := builder.Build() @@ -13823,7 +14254,7 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeCollection) if err != nil { return } @@ -13833,47 +14264,54 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt return } -// CreateSnapshot : Create a snapshot -// This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same -// way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. -func (vpc *VpcV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotWithContext(context.Background(), createSnapshotOptions) +// UpdateVolume : Update a volume +// This request updates a volume with the information in a provided volume patch. The volume patch object is structured +// in the same way as a retrieved volume and contains only the information to be updated. +func (vpc *VpcV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + return vpc.UpdateVolumeWithContext(context.Background(), updateVolumeOptions) } -// CreateSnapshotWithContext is an alternate form of the CreateSnapshot method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotOptions, "createSnapshotOptions cannot be nil") +// UpdateVolumeWithContext is an alternate form of the UpdateVolume method which supports a Context parameter +func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVolumeOptions, "updateVolumeOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSnapshotOptions, "createSnapshotOptions") + err = core.ValidateStruct(updateVolumeOptions, "updateVolumeOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *updateVolumeOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSnapshotOptions.Headers { + for headerName, headerValue := range updateVolumeOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolume") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVolumeOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVolumeOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createSnapshotOptions.SnapshotPrototype) + _, err = builder.SetBodyContentJSON(updateVolumeOptions.VolumePatch) if err != nil { return } @@ -13889,7 +14327,7 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) if err != nil { return } @@ -13899,94 +14337,108 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO return } -// DeleteSnapshot : Delete a snapshot -// This request deletes a snapshot. This operation cannot be reversed. -func (vpc *VpcV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotWithContext(context.Background(), deleteSnapshotOptions) +// CreateSnapshot : Create a snapshot +// This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same +// way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. +func (vpc *VpcV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.CreateSnapshotWithContext(context.Background(), createSnapshotOptions) } -// DeleteSnapshotWithContext is an alternate form of the DeleteSnapshot method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotOptions, "deleteSnapshotOptions cannot be nil") +// CreateSnapshotWithContext is an alternate form of the CreateSnapshot method which supports a Context parameter +func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSnapshotOptions, "createSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSnapshotOptions, "deleteSnapshotOptions") + err = core.ValidateStruct(createSnapshotOptions, "createSnapshotOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *deleteSnapshotOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) if err != nil { return } - for headerName, headerValue := range deleteSnapshotOptions.Headers { + for headerName, headerValue := range createSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - if deleteSnapshotOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteSnapshotOptions.IfMatch)) - } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createSnapshotOptions.SnapshotPrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + if err != nil { + return + } + response.Result = result + } return } -// GetSnapshot : Retrieve a snapshot -// This request retrieves a single snapshot specified by the identifier in the URL. -func (vpc *VpcV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotWithContext(context.Background(), getSnapshotOptions) +// CreateSnapshotClone : Create a clone for a snapshot +// This request creates a new clone for a snapshot in the specified zone. A request body is not required, and if +// provided, is ignored. If the snapshot already has a clone in the zone, it is returned. +func (vpc *VpcV1) CreateSnapshotClone(createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { + return vpc.CreateSnapshotCloneWithContext(context.Background(), createSnapshotCloneOptions) } -// GetSnapshotWithContext is an alternate form of the GetSnapshot method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotOptions, "getSnapshotOptions cannot be nil") +// CreateSnapshotCloneWithContext is an alternate form of the CreateSnapshotClone method which supports a Context parameter +func (vpc *VpcV1) CreateSnapshotCloneWithContext(ctx context.Context, createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSnapshotCloneOptions, "createSnapshotCloneOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSnapshotOptions, "getSnapshotOptions") + err = core.ValidateStruct(createSnapshotCloneOptions, "createSnapshotCloneOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSnapshotOptions.ID, + "id": *createSnapshotCloneOptions.ID, + "zone_name": *createSnapshotCloneOptions.ZoneName, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSnapshotOptions.Headers { + for headerName, headerValue := range createSnapshotCloneOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshotClone") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14006,7 +14458,7 @@ func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) if err != nil { return } @@ -14016,54 +14468,48 @@ func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions return } -// UpdateSnapshot : Update a snapshot -// This request updates a snapshot with the information in a provided snapshot patch. The snapshot consistency group -// patch object is structured in the same way as a retrieved snapshot and contains only the information to be updated. -func (vpc *VpcV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.UpdateSnapshotWithContext(context.Background(), updateSnapshotOptions) +// CreateSnapshotConsistencyGroup : Create a snapshot consistency group +// This request creates a new snapshot consistency group from a snapshot consistency group object. The prototype object +// is structured in the same way as a retrieved consistency group, and contains the information necessary to provision +// the new snapshot consistency group. +func (vpc *VpcV1) CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + return vpc.CreateSnapshotConsistencyGroupWithContext(context.Background(), createSnapshotConsistencyGroupOptions) } -// UpdateSnapshotWithContext is an alternate form of the UpdateSnapshot method which supports a Context parameter -func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSnapshotOptions, "updateSnapshotOptions cannot be nil") +// CreateSnapshotConsistencyGroupWithContext is an alternate form of the CreateSnapshotConsistencyGroup method which supports a Context parameter +func (vpc *VpcV1) CreateSnapshotConsistencyGroupWithContext(ctx context.Context, createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSnapshotConsistencyGroupOptions, "createSnapshotConsistencyGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSnapshotOptions, "updateSnapshotOptions") + err = core.ValidateStruct(createSnapshotConsistencyGroupOptions, "createSnapshotConsistencyGroupOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateSnapshotOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups`, nil) if err != nil { return } - for headerName, headerValue := range updateSnapshotOptions.Headers { + for headerName, headerValue := range createSnapshotConsistencyGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshotConsistencyGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateSnapshotOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateSnapshotOptions.IfMatch)) - } + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSnapshotOptions.SnapshotPatch) + _, err = builder.SetBodyContentJSON(createSnapshotConsistencyGroupOptions.SnapshotConsistencyGroupPrototype) if err != nil { return } @@ -14079,7 +14525,7 @@ func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) if err != nil { return } @@ -14089,44 +14535,46 @@ func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotO return } -// ListSnapshotClones : List all clones for a snapshot -// This request lists all clones for a snapshot. Use a clone to quickly restore a snapshot within the clone's zone. -func (vpc *VpcV1) ListSnapshotClones(listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotClonesWithContext(context.Background(), listSnapshotClonesOptions) +// DeleteSnapshot : Delete a snapshot +// This request deletes a snapshot. This operation cannot be reversed. +func (vpc *VpcV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSnapshotWithContext(context.Background(), deleteSnapshotOptions) } -// ListSnapshotClonesWithContext is an alternate form of the ListSnapshotClones method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotClonesWithContext(ctx context.Context, listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSnapshotClonesOptions, "listSnapshotClonesOptions cannot be nil") +// DeleteSnapshotWithContext is an alternate form of the DeleteSnapshot method which supports a Context parameter +func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSnapshotOptions, "deleteSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listSnapshotClonesOptions, "listSnapshotClonesOptions") + err = core.ValidateStruct(deleteSnapshotOptions, "deleteSnapshotOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *listSnapshotClonesOptions.ID, + "id": *deleteSnapshotOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSnapshotClonesOptions.Headers { + for headerName, headerValue := range deleteSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshotClones") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") + if deleteSnapshotOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteSnapshotOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -14136,18 +14584,7 @@ func (vpc *VpcV1) ListSnapshotClonesWithContext(ctx context.Context, listSnapsho return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCloneCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } @@ -14205,41 +14642,41 @@ func (vpc *VpcV1) DeleteSnapshotCloneWithContext(ctx context.Context, deleteSnap return } -// GetSnapshotClone : Retrieve a snapshot clone -// This request retrieves a single clone specified by the snapshot identifier and zone name in the URL. -func (vpc *VpcV1) GetSnapshotClone(getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotCloneWithContext(context.Background(), getSnapshotCloneOptions) +// DeleteSnapshotConsistencyGroup : Delete a snapshot consistency group +// This request deletes snapshot consistency group. This operation cannot be reversed. If the +// `delete_snapshots_on_delete` property is `true`, all snapshots in the consistency group will also be deleted. +func (vpc *VpcV1) DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + return vpc.DeleteSnapshotConsistencyGroupWithContext(context.Background(), deleteSnapshotConsistencyGroupOptions) } -// GetSnapshotCloneWithContext is an alternate form of the GetSnapshotClone method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotCloneWithContext(ctx context.Context, getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotCloneOptions, "getSnapshotCloneOptions cannot be nil") +// DeleteSnapshotConsistencyGroupWithContext is an alternate form of the DeleteSnapshotConsistencyGroup method which supports a Context parameter +func (vpc *VpcV1) DeleteSnapshotConsistencyGroupWithContext(ctx context.Context, deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSnapshotConsistencyGroupOptions, "deleteSnapshotConsistencyGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSnapshotCloneOptions, "getSnapshotCloneOptions") + err = core.ValidateStruct(deleteSnapshotConsistencyGroupOptions, "deleteSnapshotConsistencyGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSnapshotCloneOptions.ID, - "zone_name": *getSnapshotCloneOptions.ZoneName, + "id": *deleteSnapshotConsistencyGroupOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSnapshotCloneOptions.Headers { + for headerName, headerValue := range deleteSnapshotConsistencyGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshotClone") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshotConsistencyGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14259,7 +14696,7 @@ func (vpc *VpcV1) GetSnapshotCloneWithContext(ctx context.Context, getSnapshotCl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) if err != nil { return } @@ -14269,99 +14706,88 @@ func (vpc *VpcV1) GetSnapshotCloneWithContext(ctx context.Context, getSnapshotCl return } -// CreateSnapshotClone : Create a clone for a snapshot -// This request creates a new clone for a snapshot in the specified zone. A request body is not required, and if -// provided, is ignored. If the snapshot already has a clone in the zone, it is returned. -func (vpc *VpcV1) CreateSnapshotClone(createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotCloneWithContext(context.Background(), createSnapshotCloneOptions) +// DeleteSnapshots : Delete a filtered collection of snapshots +// This request deletes all snapshots created from a specific source volume. +func (vpc *VpcV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSnapshotsWithContext(context.Background(), deleteSnapshotsOptions) } -// CreateSnapshotCloneWithContext is an alternate form of the CreateSnapshotClone method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotCloneWithContext(ctx context.Context, createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotCloneOptions, "createSnapshotCloneOptions cannot be nil") +// DeleteSnapshotsWithContext is an alternate form of the DeleteSnapshots method which supports a Context parameter +func (vpc *VpcV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSnapshotsOptions, "deleteSnapshotsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSnapshotCloneOptions, "createSnapshotCloneOptions") + err = core.ValidateStruct(deleteSnapshotsOptions, "deleteSnapshotsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *createSnapshotCloneOptions.ID, - "zone_name": *createSnapshotCloneOptions.ZoneName, - } - - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) if err != nil { return } - for headerName, headerValue := range createSnapshotCloneOptions.Headers { + for headerName, headerValue := range deleteSnapshotsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshotClone") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshots") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + builder.AddQuery("source_volume.id", fmt.Sprint(*deleteSnapshotsOptions.SourceVolumeID)) request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListShareProfiles : List all file share profiles -// This request lists all [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) -// available in the region. A file share profile specifies the performance characteristics and pricing model for a file -// share. -func (vpc *VpcV1) ListShareProfiles(listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListShareProfilesWithContext(context.Background(), listShareProfilesOptions) +// GetSnapshot : Retrieve a snapshot +// This request retrieves a single snapshot specified by the identifier in the URL. +func (vpc *VpcV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.GetSnapshotWithContext(context.Background(), getSnapshotOptions) } -// ListShareProfilesWithContext is an alternate form of the ListShareProfiles method which supports a Context parameter -func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listShareProfilesOptions, "listShareProfilesOptions") +// GetSnapshotWithContext is an alternate form of the GetSnapshot method which supports a Context parameter +func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSnapshotOptions, "getSnapshotOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getSnapshotOptions, "getSnapshotOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "id": *getSnapshotOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listShareProfilesOptions.Headers { + for headerName, headerValue := range getSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14369,15 +14795,6 @@ func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listSharePro builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listShareProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listShareProfilesOptions.Start)) - } - if listShareProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listShareProfilesOptions.Limit)) - } - if listShareProfilesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listShareProfilesOptions.Sort)) - } request, err := builder.Build() if err != nil { @@ -14390,7 +14807,7 @@ func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listSharePro return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) if err != nil { return } @@ -14400,40 +14817,41 @@ func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listSharePro return } -// GetShareProfile : Retrieve a file share profile -// This request retrieves a single file share profile specified by the name in the URL. -func (vpc *VpcV1) GetShareProfile(getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { - return vpc.GetShareProfileWithContext(context.Background(), getShareProfileOptions) +// GetSnapshotClone : Retrieve a snapshot clone +// This request retrieves a single clone specified by the snapshot identifier and zone name in the URL. +func (vpc *VpcV1) GetSnapshotClone(getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { + return vpc.GetSnapshotCloneWithContext(context.Background(), getSnapshotCloneOptions) } -// GetShareProfileWithContext is an alternate form of the GetShareProfile method which supports a Context parameter -func (vpc *VpcV1) GetShareProfileWithContext(ctx context.Context, getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareProfileOptions, "getShareProfileOptions cannot be nil") +// GetSnapshotCloneWithContext is an alternate form of the GetSnapshotClone method which supports a Context parameter +func (vpc *VpcV1) GetSnapshotCloneWithContext(ctx context.Context, getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSnapshotCloneOptions, "getSnapshotCloneOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getShareProfileOptions, "getShareProfileOptions") + err = core.ValidateStruct(getSnapshotCloneOptions, "getSnapshotCloneOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getShareProfileOptions.Name, + "id": *getSnapshotCloneOptions.ID, + "zone_name": *getSnapshotCloneOptions.ZoneName, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getShareProfileOptions.Headers { + for headerName, headerValue := range getSnapshotCloneOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshotClone") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14453,7 +14871,7 @@ func (vpc *VpcV1) GetShareProfileWithContext(ctx context.Context, getShareProfil return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) if err != nil { return } @@ -14463,32 +14881,40 @@ func (vpc *VpcV1) GetShareProfileWithContext(ctx context.Context, getShareProfil return } -// ListShares : List all file shares -// This request lists all file shares in the region. -func (vpc *VpcV1) ListShares(listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { - return vpc.ListSharesWithContext(context.Background(), listSharesOptions) +// GetSnapshotConsistencyGroup : Retrieve a snapshot consistency group +// This request retrieves a single snapshot consistency group specified by the identifier in the URL. +func (vpc *VpcV1) GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + return vpc.GetSnapshotConsistencyGroupWithContext(context.Background(), getSnapshotConsistencyGroupOptions) } -// ListSharesWithContext is an alternate form of the ListShares method which supports a Context parameter -func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSharesOptions, "listSharesOptions") +// GetSnapshotConsistencyGroupWithContext is an alternate form of the GetSnapshotConsistencyGroup method which supports a Context parameter +func (vpc *VpcV1) GetSnapshotConsistencyGroupWithContext(ctx context.Context, getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSnapshotConsistencyGroupOptions, "getSnapshotConsistencyGroupOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getSnapshotConsistencyGroupOptions, "getSnapshotConsistencyGroupOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "id": *getSnapshotConsistencyGroupOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSharesOptions.Headers { + for headerName, headerValue := range getSnapshotConsistencyGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShares") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshotConsistencyGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14496,24 +14922,6 @@ func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions * builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSharesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSharesOptions.Start)) - } - if listSharesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSharesOptions.Limit)) - } - if listSharesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSharesOptions.ResourceGroupID)) - } - if listSharesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSharesOptions.Name)) - } - if listSharesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSharesOptions.Sort)) - } - if listSharesOptions.ReplicationRole != nil { - builder.AddQuery("replication_role", fmt.Sprint(*listSharesOptions.ReplicationRole)) - } request, err := builder.Build() if err != nil { @@ -14526,7 +14934,7 @@ func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions * return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) if err != nil { return } @@ -14536,54 +14944,48 @@ func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions * return } -// CreateShare : Create a file share -// This request provisions new file shares from a share prototype object. The new file shares can be a standalone share, -// a replica share, or both a source and replica share. -// -// The prototype object is structured in the same way as a retrieved share, and contains the information necessary to -// provision the new file shares. -func (vpc *VpcV1) CreateShare(createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.CreateShareWithContext(context.Background(), createShareOptions) +// ListSnapshotClones : List all clones for a snapshot +// This request lists all clones for a snapshot. Use a clone to quickly restore a snapshot within the clone's zone. +func (vpc *VpcV1) ListSnapshotClones(listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { + return vpc.ListSnapshotClonesWithContext(context.Background(), listSnapshotClonesOptions) } -// CreateShareWithContext is an alternate form of the CreateShare method which supports a Context parameter -func (vpc *VpcV1) CreateShareWithContext(ctx context.Context, createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createShareOptions, "createShareOptions cannot be nil") +// ListSnapshotClonesWithContext is an alternate form of the ListSnapshotClones method which supports a Context parameter +func (vpc *VpcV1) ListSnapshotClonesWithContext(ctx context.Context, listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSnapshotClonesOptions, "listSnapshotClonesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createShareOptions, "createShareOptions") + err = core.ValidateStruct(listSnapshotClonesOptions, "listSnapshotClonesOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *listSnapshotClonesOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createShareOptions.Headers { + for headerName, headerValue := range listSnapshotClonesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateShare") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshotClones") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createShareOptions.SharePrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -14595,7 +14997,7 @@ func (vpc *VpcV1) CreateShareWithContext(ctx context.Context, createShareOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCloneCollection) if err != nil { return } @@ -14605,56 +15007,58 @@ func (vpc *VpcV1) CreateShareWithContext(ctx context.Context, createShareOptions return } -// DeleteShare : Delete a file share -// This request deletes a share. This operation cannot be reversed. A share cannot be deleted if it: -// - has share mount targets -// - has a `lifecycle_state` of `updating` -// - has a replication operation in progress -// -// If the request is accepted, the share `lifecycle_state` will be set to `deleting`. Once deletion processing -// completes, it will no longer be retrievable. -func (vpc *VpcV1) DeleteShare(deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.DeleteShareWithContext(context.Background(), deleteShareOptions) +// ListSnapshotConsistencyGroups : List all snapshot consistency groups +// This request lists all snapshot consistency groups in the region. A snapshot consistency group is a collection of +// individual snapshots taken at the same time. +func (vpc *VpcV1) ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions) (result *SnapshotConsistencyGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListSnapshotConsistencyGroupsWithContext(context.Background(), listSnapshotConsistencyGroupsOptions) } -// DeleteShareWithContext is an alternate form of the DeleteShare method which supports a Context parameter -func (vpc *VpcV1) DeleteShareWithContext(ctx context.Context, deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareOptions, "deleteShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteShareOptions, "deleteShareOptions") +// ListSnapshotConsistencyGroupsWithContext is an alternate form of the ListSnapshotConsistencyGroups method which supports a Context parameter +func (vpc *VpcV1) ListSnapshotConsistencyGroupsWithContext(ctx context.Context, listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions) (result *SnapshotConsistencyGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSnapshotConsistencyGroupsOptions, "listSnapshotConsistencyGroupsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *deleteShareOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups`, nil) if err != nil { return } - for headerName, headerValue := range deleteShareOptions.Headers { + for headerName, headerValue := range listSnapshotConsistencyGroupsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShare") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshotConsistencyGroups") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if deleteShareOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteShareOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSnapshotConsistencyGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Start)) + } + if listSnapshotConsistencyGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Limit)) + } + if listSnapshotConsistencyGroupsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.ResourceGroupID)) + } + if listSnapshotConsistencyGroupsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Name)) + } + if listSnapshotConsistencyGroupsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Sort)) + } + if listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID != nil { + builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID)) + } request, err := builder.Build() if err != nil { @@ -14667,7 +15071,7 @@ func (vpc *VpcV1) DeleteShareWithContext(ctx context.Context, deleteShareOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroupCollection) if err != nil { return } @@ -14677,40 +15081,33 @@ func (vpc *VpcV1) DeleteShareWithContext(ctx context.Context, deleteShareOptions return } -// GetShare : Retrieve a file share -// This request retrieves a single file share specified by the identifier in the URL. -func (vpc *VpcV1) GetShare(getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.GetShareWithContext(context.Background(), getShareOptions) +// ListSnapshots : List all snapshots +// This request lists all snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is +// created. +func (vpc *VpcV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { + return vpc.ListSnapshotsWithContext(context.Background(), listSnapshotsOptions) } -// GetShareWithContext is an alternate form of the GetShare method which supports a Context parameter -func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareOptions, "getShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getShareOptions, "getShareOptions") +// ListSnapshotsWithContext is an alternate form of the ListSnapshots method which supports a Context parameter +func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSnapshotsOptions, "listSnapshotsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *getShareOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) if err != nil { return } - for headerName, headerValue := range getShareOptions.Headers { + for headerName, headerValue := range listSnapshotsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShare") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshots") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14718,6 +15115,72 @@ func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetS builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSnapshotsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSnapshotsOptions.Start)) + } + if listSnapshotsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSnapshotsOptions.Limit)) + } + if listSnapshotsOptions.Tag != nil { + builder.AddQuery("tag", fmt.Sprint(*listSnapshotsOptions.Tag)) + } + if listSnapshotsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotsOptions.ResourceGroupID)) + } + if listSnapshotsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listSnapshotsOptions.Name)) + } + if listSnapshotsOptions.SourceVolumeID != nil { + builder.AddQuery("source_volume.id", fmt.Sprint(*listSnapshotsOptions.SourceVolumeID)) + } + if listSnapshotsOptions.SourceVolumeCRN != nil { + builder.AddQuery("source_volume.crn", fmt.Sprint(*listSnapshotsOptions.SourceVolumeCRN)) + } + if listSnapshotsOptions.SourceImageID != nil { + builder.AddQuery("source_image.id", fmt.Sprint(*listSnapshotsOptions.SourceImageID)) + } + if listSnapshotsOptions.SourceImageCRN != nil { + builder.AddQuery("source_image.crn", fmt.Sprint(*listSnapshotsOptions.SourceImageCRN)) + } + if listSnapshotsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listSnapshotsOptions.Sort)) + } + if listSnapshotsOptions.BackupPolicyPlanID != nil { + builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotsOptions.BackupPolicyPlanID)) + } + if listSnapshotsOptions.CopiesID != nil { + builder.AddQuery("copies[].id", fmt.Sprint(*listSnapshotsOptions.CopiesID)) + } + if listSnapshotsOptions.CopiesName != nil { + builder.AddQuery("copies[].name", fmt.Sprint(*listSnapshotsOptions.CopiesName)) + } + if listSnapshotsOptions.CopiesCRN != nil { + builder.AddQuery("copies[].crn", fmt.Sprint(*listSnapshotsOptions.CopiesCRN)) + } + if listSnapshotsOptions.CopiesRemoteRegionName != nil { + builder.AddQuery("copies[].remote.region.name", fmt.Sprint(*listSnapshotsOptions.CopiesRemoteRegionName)) + } + if listSnapshotsOptions.SourceSnapshotID != nil { + builder.AddQuery("source_snapshot.id", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotID)) + } + if listSnapshotsOptions.SourceSnapshotRemoteRegionName != nil { + builder.AddQuery("source_snapshot.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotRemoteRegionName)) + } + if listSnapshotsOptions.SourceVolumeRemoteRegionName != nil { + builder.AddQuery("source_volume.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceVolumeRemoteRegionName)) + } + if listSnapshotsOptions.SourceImageRemoteRegionName != nil { + builder.AddQuery("source_image.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceImageRemoteRegionName)) + } + if listSnapshotsOptions.ClonesZoneName != nil { + builder.AddQuery("clones[].zone.name", fmt.Sprint(*listSnapshotsOptions.ClonesZoneName)) + } + if listSnapshotsOptions.SnapshotConsistencyGroupID != nil { + builder.AddQuery("snapshot_consistency_group.id", fmt.Sprint(*listSnapshotsOptions.SnapshotConsistencyGroupID)) + } + if listSnapshotsOptions.SnapshotConsistencyGroupCRN != nil { + builder.AddQuery("snapshot_consistency_group.crn", fmt.Sprint(*listSnapshotsOptions.SnapshotConsistencyGroupCRN)) + } request, err := builder.Build() if err != nil { @@ -14730,7 +15193,7 @@ func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetS return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCollection) if err != nil { return } @@ -14740,54 +15203,54 @@ func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetS return } -// UpdateShare : Update a file share -// This request updates a share with the information in a provided share patch. The share patch object is structured in -// the same way as a retrieved share and contains only the information to be updated. -func (vpc *VpcV1) UpdateShare(updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.UpdateShareWithContext(context.Background(), updateShareOptions) +// UpdateSnapshot : Update a snapshot +// This request updates a snapshot with the information in a provided snapshot patch. The snapshot consistency group +// patch object is structured in the same way as a retrieved snapshot and contains only the information to be updated. +func (vpc *VpcV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.UpdateSnapshotWithContext(context.Background(), updateSnapshotOptions) } -// UpdateShareWithContext is an alternate form of the UpdateShare method which supports a Context parameter -func (vpc *VpcV1) UpdateShareWithContext(ctx context.Context, updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateShareOptions, "updateShareOptions cannot be nil") +// UpdateSnapshotWithContext is an alternate form of the UpdateSnapshot method which supports a Context parameter +func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSnapshotOptions, "updateSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateShareOptions, "updateShareOptions") + err = core.ValidateStruct(updateSnapshotOptions, "updateSnapshotOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateShareOptions.ID, + "id": *updateSnapshotOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateShareOptions.Headers { + for headerName, headerValue := range updateSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShare") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateShareOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateShareOptions.IfMatch)) + if updateSnapshotOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateSnapshotOptions.IfMatch)) } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateShareOptions.SharePatch) + _, err = builder.SetBodyContentJSON(updateSnapshotOptions.SnapshotPatch) if err != nil { return } @@ -14803,7 +15266,7 @@ func (vpc *VpcV1) UpdateShareWithContext(ctx context.Context, updateShareOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) if err != nil { return } @@ -14813,61 +15276,55 @@ func (vpc *VpcV1) UpdateShareWithContext(ctx context.Context, updateShareOptions return } -// FailoverShare : Failover to replica file share -// This request triggers a failover to the replica file share specified by the identifier in the URL. The failover -// cannot be started if a source share or the replica share has a `lifecycle_state` of `updating`, or has a replication -// operation in progress. -// -// If `fallback_policy` is specified as `split`, and the request is accepted but the failover operation cannot be -// performed, a split will be triggered. -func (vpc *VpcV1) FailoverShare(failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { - return vpc.FailoverShareWithContext(context.Background(), failoverShareOptions) +// UpdateSnapshotConsistencyGroup : Update a snapshot consistency group +// This request updates a snapshot consistency group with the information in a provided snapshot consistency group +// patch. The snapshot consistency group patch object is structured in the same way as a retrieved snapshot consistency +// group and contains only the information to be updated. +func (vpc *VpcV1) UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + return vpc.UpdateSnapshotConsistencyGroupWithContext(context.Background(), updateSnapshotConsistencyGroupOptions) } -// FailoverShareWithContext is an alternate form of the FailoverShare method which supports a Context parameter -func (vpc *VpcV1) FailoverShareWithContext(ctx context.Context, failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(failoverShareOptions, "failoverShareOptions cannot be nil") +// UpdateSnapshotConsistencyGroupWithContext is an alternate form of the UpdateSnapshotConsistencyGroup method which supports a Context parameter +func (vpc *VpcV1) UpdateSnapshotConsistencyGroupWithContext(ctx context.Context, updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSnapshotConsistencyGroupOptions, "updateSnapshotConsistencyGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(failoverShareOptions, "failoverShareOptions") + err = core.ValidateStruct(updateSnapshotConsistencyGroupOptions, "updateSnapshotConsistencyGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *failoverShareOptions.ShareID, + "id": *updateSnapshotConsistencyGroupOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/failover`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range failoverShareOptions.Headers { + for headerName, headerValue := range updateSnapshotConsistencyGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "FailoverShare") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshotConsistencyGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateSnapshotConsistencyGroupOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateSnapshotConsistencyGroupOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if failoverShareOptions.FallbackPolicy != nil { - body["fallback_policy"] = failoverShareOptions.FallbackPolicy - } - if failoverShareOptions.Timeout != nil { - body["timeout"] = failoverShareOptions.Timeout - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateSnapshotConsistencyGroupOptions.SnapshotConsistencyGroupPatch) if err != nil { return } @@ -14877,64 +15334,68 @@ func (vpc *VpcV1) FailoverShareWithContext(ctx context.Context, failoverShareOpt return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) + if err != nil { + return + } + response.Result = result + } return } -// ListShareMountTargets : List all mount targets for a file share -// This request retrieves all share mount targets for a file share. A share mount target is a network endpoint at which -// a file share may be mounted. The file share can be mounted by clients in the same VPC and zone after creating share -// mount targets. +// CreateShare : Create a file share +// This request provisions new file shares from a share prototype object. The new file shares can be a standalone share, +// a replica share, or both a source and replica share. // -// The share mount targets will be sorted by their `created_at` property values, with newest targets first. -func (vpc *VpcV1) ListShareMountTargets(listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { - return vpc.ListShareMountTargetsWithContext(context.Background(), listShareMountTargetsOptions) +// The prototype object is structured in the same way as a retrieved share, and contains the information necessary to +// provision the new file shares. +func (vpc *VpcV1) CreateShare(createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { + return vpc.CreateShareWithContext(context.Background(), createShareOptions) } -// ListShareMountTargetsWithContext is an alternate form of the ListShareMountTargets method which supports a Context parameter -func (vpc *VpcV1) ListShareMountTargetsWithContext(ctx context.Context, listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listShareMountTargetsOptions, "listShareMountTargetsOptions cannot be nil") +// CreateShareWithContext is an alternate form of the CreateShare method which supports a Context parameter +func (vpc *VpcV1) CreateShareWithContext(ctx context.Context, createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createShareOptions, "createShareOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listShareMountTargetsOptions, "listShareMountTargetsOptions") + err = core.ValidateStruct(createShareOptions, "createShareOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "share_id": *listShareMountTargetsOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) if err != nil { return } - for headerName, headerValue := range listShareMountTargetsOptions.Headers { + for headerName, headerValue := range createShareOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareMountTargets") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateShare") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listShareMountTargetsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listShareMountTargetsOptions.Name)) - } - if listShareMountTargetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listShareMountTargetsOptions.Start)) - } - if listShareMountTargetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listShareMountTargetsOptions.Limit)) + + _, err = builder.SetBodyContentJSON(createShareOptions.SharePrototype) + if err != nil { + return } request, err := builder.Build() @@ -14948,7 +15409,7 @@ func (vpc *VpcV1) ListShareMountTargetsWithContext(ctx context.Context, listShar return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTargetCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) if err != nil { return } @@ -15030,48 +15491,53 @@ func (vpc *VpcV1) CreateShareMountTargetWithContext(ctx context.Context, createS return } -// DeleteShareMountTarget : Delete a share mount target -// This request deletes a share mount target. This operation cannot be reversed. +// DeleteShare : Delete a file share +// This request deletes a share. This operation cannot be reversed. A share cannot be deleted if it: +// - has share mount targets +// - has a `lifecycle_state` of `updating` +// - has a replication operation in progress // -// If the request is accepted, the share mount target `lifecycle_state` will be set to -// `deleting`. Once deletion processing completes, it will no longer be retrievable. -func (vpc *VpcV1) DeleteShareMountTarget(deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.DeleteShareMountTargetWithContext(context.Background(), deleteShareMountTargetOptions) +// If the request is accepted, the share `lifecycle_state` will be set to `deleting`. Once deletion processing +// completes, it will no longer be retrievable. +func (vpc *VpcV1) DeleteShare(deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { + return vpc.DeleteShareWithContext(context.Background(), deleteShareOptions) } -// DeleteShareMountTargetWithContext is an alternate form of the DeleteShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) DeleteShareMountTargetWithContext(ctx context.Context, deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareMountTargetOptions, "deleteShareMountTargetOptions cannot be nil") +// DeleteShareWithContext is an alternate form of the DeleteShare method which supports a Context parameter +func (vpc *VpcV1) DeleteShareWithContext(ctx context.Context, deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteShareOptions, "deleteShareOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteShareMountTargetOptions, "deleteShareMountTargetOptions") + err = core.ValidateStruct(deleteShareOptions, "deleteShareOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *deleteShareMountTargetOptions.ShareID, - "id": *deleteShareMountTargetOptions.ID, + "id": *deleteShareOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteShareMountTargetOptions.Headers { + for headerName, headerValue := range deleteShareOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareMountTarget") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShare") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if deleteShareOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteShareOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -15087,7 +15553,7 @@ func (vpc *VpcV1) DeleteShareMountTargetWithContext(ctx context.Context, deleteS return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) if err != nil { return } @@ -15097,29 +15563,32 @@ func (vpc *VpcV1) DeleteShareMountTargetWithContext(ctx context.Context, deleteS return } -// GetShareMountTarget : Retrieve a share mount target -// This request retrieves a single share mount target specified by the identifier in the URL. -func (vpc *VpcV1) GetShareMountTarget(getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.GetShareMountTargetWithContext(context.Background(), getShareMountTargetOptions) +// DeleteShareMountTarget : Delete a share mount target +// This request deletes a share mount target. This operation cannot be reversed. +// +// If the request is accepted, the share mount target `lifecycle_state` will be set to +// `deleting`. Once deletion processing completes, it will no longer be retrievable. +func (vpc *VpcV1) DeleteShareMountTarget(deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + return vpc.DeleteShareMountTargetWithContext(context.Background(), deleteShareMountTargetOptions) } -// GetShareMountTargetWithContext is an alternate form of the GetShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) GetShareMountTargetWithContext(ctx context.Context, getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareMountTargetOptions, "getShareMountTargetOptions cannot be nil") +// DeleteShareMountTargetWithContext is an alternate form of the DeleteShareMountTarget method which supports a Context parameter +func (vpc *VpcV1) DeleteShareMountTargetWithContext(ctx context.Context, deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteShareMountTargetOptions, "deleteShareMountTargetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getShareMountTargetOptions, "getShareMountTargetOptions") + err = core.ValidateStruct(deleteShareMountTargetOptions, "deleteShareMountTargetOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *getShareMountTargetOptions.ShareID, - "id": *getShareMountTargetOptions.ID, + "share_id": *deleteShareMountTargetOptions.ShareID, + "id": *deleteShareMountTargetOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) @@ -15127,11 +15596,11 @@ func (vpc *VpcV1) GetShareMountTargetWithContext(ctx context.Context, getShareMo return } - for headerName, headerValue := range getShareMountTargetOptions.Headers { + for headerName, headerValue := range deleteShareMountTargetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareMountTarget") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareMountTarget") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15161,123 +15630,120 @@ func (vpc *VpcV1) GetShareMountTargetWithContext(ctx context.Context, getShareMo return } -// UpdateShareMountTarget : Update a share mount target -// This request updates a share mount target with the information provided in a share mount target patch object. The -// share mount target patch object is structured in the same way as a retrieved share mount target and needs to contain -// only the information to be updated. -func (vpc *VpcV1) UpdateShareMountTarget(updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.UpdateShareMountTargetWithContext(context.Background(), updateShareMountTargetOptions) +// DeleteShareSource : Split the source file share from a replica share +// This request removes the replication relationship between a source share and the replica share specified by the +// identifier in the URL. The replication relationship cannot be removed if a source share or the replica share has a +// `lifecycle_state` of `updating`, or has a replication operation in progress. +// +// This operation cannot be reversed. +func (vpc *VpcV1) DeleteShareSource(deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteShareSourceWithContext(context.Background(), deleteShareSourceOptions) } -// UpdateShareMountTargetWithContext is an alternate form of the UpdateShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) UpdateShareMountTargetWithContext(ctx context.Context, updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateShareMountTargetOptions, "updateShareMountTargetOptions cannot be nil") +// DeleteShareSourceWithContext is an alternate form of the DeleteShareSource method which supports a Context parameter +func (vpc *VpcV1) DeleteShareSourceWithContext(ctx context.Context, deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteShareSourceOptions, "deleteShareSourceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateShareMountTargetOptions, "updateShareMountTargetOptions") + err = core.ValidateStruct(deleteShareSourceOptions, "deleteShareSourceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *updateShareMountTargetOptions.ShareID, - "id": *updateShareMountTargetOptions.ID, + "share_id": *deleteShareSourceOptions.ShareID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateShareMountTargetOptions.Headers { + for headerName, headerValue := range deleteShareSourceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShareMountTarget") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareSource") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateShareMountTargetOptions.ShareMountTargetPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteShareSource : Split the source file share from a replica share -// This request removes the replication relationship between a source share and the replica share specified by the -// identifier in the URL. The replication relationship cannot be removed if a source share or the replica share has a -// `lifecycle_state` of `updating`, or has a replication operation in progress. +// FailoverShare : Failover to replica file share +// This request triggers a failover to the replica file share specified by the identifier in the URL. The failover +// cannot be started if a source share or the replica share has a `lifecycle_state` of `updating`, or has a replication +// operation in progress. // -// This operation cannot be reversed. -func (vpc *VpcV1) DeleteShareSource(deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteShareSourceWithContext(context.Background(), deleteShareSourceOptions) +// If `fallback_policy` is specified as `split`, and the request is accepted but the failover operation cannot be +// performed, a split will be triggered. +func (vpc *VpcV1) FailoverShare(failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { + return vpc.FailoverShareWithContext(context.Background(), failoverShareOptions) } -// DeleteShareSourceWithContext is an alternate form of the DeleteShareSource method which supports a Context parameter -func (vpc *VpcV1) DeleteShareSourceWithContext(ctx context.Context, deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareSourceOptions, "deleteShareSourceOptions cannot be nil") +// FailoverShareWithContext is an alternate form of the FailoverShare method which supports a Context parameter +func (vpc *VpcV1) FailoverShareWithContext(ctx context.Context, failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(failoverShareOptions, "failoverShareOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteShareSourceOptions, "deleteShareSourceOptions") + err = core.ValidateStruct(failoverShareOptions, "failoverShareOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *deleteShareSourceOptions.ShareID, + "share_id": *failoverShareOptions.ShareID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/failover`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteShareSourceOptions.Headers { + for headerName, headerValue := range failoverShareOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareSource") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "FailoverShare") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if failoverShareOptions.FallbackPolicy != nil { + body["fallback_policy"] = failoverShareOptions.FallbackPolicy + } + if failoverShareOptions.Timeout != nil { + body["timeout"] = failoverShareOptions.Timeout + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -15288,41 +15754,40 @@ func (vpc *VpcV1) DeleteShareSourceWithContext(ctx context.Context, deleteShareS return } -// GetShareSource : Retrieve the source file share for a replica file share -// This request retrieves the source file share associated with the replica file share specified by the identifier in -// the URL. -func (vpc *VpcV1) GetShareSource(getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { - return vpc.GetShareSourceWithContext(context.Background(), getShareSourceOptions) +// GetShare : Retrieve a file share +// This request retrieves a single file share specified by the identifier in the URL. +func (vpc *VpcV1) GetShare(getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { + return vpc.GetShareWithContext(context.Background(), getShareOptions) } -// GetShareSourceWithContext is an alternate form of the GetShareSource method which supports a Context parameter -func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareSourceOptions, "getShareSourceOptions cannot be nil") +// GetShareWithContext is an alternate form of the GetShare method which supports a Context parameter +func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getShareOptions, "getShareOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getShareSourceOptions, "getShareSourceOptions") + err = core.ValidateStruct(getShareOptions, "getShareOptions") if err != nil { return } pathParamsMap := map[string]string{ - "share_id": *getShareSourceOptions.ShareID, + "id": *getShareOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getShareSourceOptions.Headers { + for headerName, headerValue := range getShareOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareSource") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShare") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15342,7 +15807,7 @@ func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareReference) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) if err != nil { return } @@ -15352,36 +15817,41 @@ func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceO return } -// ListRegions : List all regions -// This request lists all regions. Each region is a separate geographic area that contains multiple isolated zones. -// Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other zones -// in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault isolation -// available. Resources deployed within a single region also benefit from the low latency afforded by geographic -// proximity. -func (vpc *VpcV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionsWithContext(context.Background(), listRegionsOptions) +// GetShareMountTarget : Retrieve a share mount target +// This request retrieves a single share mount target specified by the identifier in the URL. +func (vpc *VpcV1) GetShareMountTarget(getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + return vpc.GetShareMountTargetWithContext(context.Background(), getShareMountTargetOptions) } -// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter -func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") +// GetShareMountTargetWithContext is an alternate form of the GetShareMountTarget method which supports a Context parameter +func (vpc *VpcV1) GetShareMountTargetWithContext(ctx context.Context, getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getShareMountTargetOptions, "getShareMountTargetOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getShareMountTargetOptions, "getShareMountTargetOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "share_id": *getShareMountTargetOptions.ShareID, + "id": *getShareMountTargetOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listRegionsOptions.Headers { + for headerName, headerValue := range getShareMountTargetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegions") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareMountTarget") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15401,7 +15871,7 @@ func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) if err != nil { return } @@ -15411,40 +15881,40 @@ func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions return } -// GetRegion : Retrieve a region -// This request retrieves a single region specified by the name in the URL. -func (vpc *VpcV1) GetRegion(getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - return vpc.GetRegionWithContext(context.Background(), getRegionOptions) +// GetShareProfile : Retrieve a file share profile +// This request retrieves a single file share profile specified by the name in the URL. +func (vpc *VpcV1) GetShareProfile(getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { + return vpc.GetShareProfileWithContext(context.Background(), getShareProfileOptions) } -// GetRegionWithContext is an alternate form of the GetRegion method which supports a Context parameter -func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionOptions, "getRegionOptions cannot be nil") +// GetShareProfileWithContext is an alternate form of the GetShareProfile method which supports a Context parameter +func (vpc *VpcV1) GetShareProfileWithContext(ctx context.Context, getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getShareProfileOptions, "getShareProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getRegionOptions, "getRegionOptions") + err = core.ValidateStruct(getShareProfileOptions, "getShareProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getRegionOptions.Name, + "name": *getShareProfileOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getRegionOptions.Headers { + for headerName, headerValue := range getShareProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegion") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15464,7 +15934,7 @@ func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *Ge return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegion) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfile) if err != nil { return } @@ -15474,41 +15944,41 @@ func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *Ge return } -// ListRegionZones : List all zones in a region -// This request lists all zones in a region. Zones represent logically-isolated data centers with high-bandwidth and -// low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. -func (vpc *VpcV1) ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionZonesWithContext(context.Background(), listRegionZonesOptions) +// GetShareSource : Retrieve the source file share for a replica file share +// This request retrieves the source file share associated with the replica file share specified by the identifier in +// the URL. +func (vpc *VpcV1) GetShareSource(getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { + return vpc.GetShareSourceWithContext(context.Background(), getShareSourceOptions) } -// ListRegionZonesWithContext is an alternate form of the ListRegionZones method which supports a Context parameter -func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listRegionZonesOptions, "listRegionZonesOptions cannot be nil") +// GetShareSourceWithContext is an alternate form of the GetShareSource method which supports a Context parameter +func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getShareSourceOptions, "getShareSourceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listRegionZonesOptions, "listRegionZonesOptions") + err = core.ValidateStruct(getShareSourceOptions, "getShareSourceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "region_name": *listRegionZonesOptions.RegionName, + "share_id": *getShareSourceOptions.ShareID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listRegionZonesOptions.Headers { + for headerName, headerValue := range getShareSourceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegionZones") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareSource") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15528,7 +15998,7 @@ func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZone return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZoneCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareReference) if err != nil { return } @@ -15538,41 +16008,44 @@ func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZone return } -// GetRegionZone : Retrieve a zone -// This request retrieves a single zone specified by the region and zone names in the URL. -func (vpc *VpcV1) GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - return vpc.GetRegionZoneWithContext(context.Background(), getRegionZoneOptions) +// ListShareMountTargets : List all mount targets for a file share +// This request retrieves all share mount targets for a file share. A share mount target is a network endpoint at which +// a file share may be mounted. The file share can be mounted by clients in the same VPC and zone after creating share +// mount targets. +// +// The share mount targets will be sorted by their `created_at` property values, with newest targets first. +func (vpc *VpcV1) ListShareMountTargets(listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { + return vpc.ListShareMountTargetsWithContext(context.Background(), listShareMountTargetsOptions) } -// GetRegionZoneWithContext is an alternate form of the GetRegionZone method which supports a Context parameter -func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionZoneOptions, "getRegionZoneOptions cannot be nil") +// ListShareMountTargetsWithContext is an alternate form of the ListShareMountTargets method which supports a Context parameter +func (vpc *VpcV1) ListShareMountTargetsWithContext(ctx context.Context, listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listShareMountTargetsOptions, "listShareMountTargetsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getRegionZoneOptions, "getRegionZoneOptions") + err = core.ValidateStruct(listShareMountTargetsOptions, "listShareMountTargetsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "region_name": *getRegionZoneOptions.RegionName, - "name": *getRegionZoneOptions.Name, + "share_id": *listShareMountTargetsOptions.ShareID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getRegionZoneOptions.Headers { + for headerName, headerValue := range listShareMountTargetsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegionZone") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareMountTargets") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15580,6 +16053,15 @@ func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listShareMountTargetsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listShareMountTargetsOptions.Name)) + } + if listShareMountTargetsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listShareMountTargetsOptions.Start)) + } + if listShareMountTargetsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listShareMountTargetsOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -15592,7 +16074,7 @@ func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZone) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTargetCollection) if err != nil { return } @@ -15602,20 +16084,17 @@ func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOpt return } -// ListVirtualNetworkInterfaces : List all virtual network interfaces -// This request lists all virtual network interfaces in the region. A virtual network interface is a logical abstraction -// of a virtual network interface in a subnet, and may be attached to a target resource. -// -// The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network -// interfaces first. Virtual network interfaces with identical -// `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - return vpc.ListVirtualNetworkInterfacesWithContext(context.Background(), listVirtualNetworkInterfacesOptions) +// ListShareProfiles : List all file share profiles +// This request lists all [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) +// available in the region. A file share profile specifies the performance characteristics and pricing model for a file +// share. +func (vpc *VpcV1) ListShareProfiles(listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListShareProfilesWithContext(context.Background(), listShareProfilesOptions) } -// ListVirtualNetworkInterfacesWithContext is an alternate form of the ListVirtualNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVirtualNetworkInterfacesOptions, "listVirtualNetworkInterfacesOptions") +// ListShareProfilesWithContext is an alternate form of the ListShareProfiles method which supports a Context parameter +func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listShareProfilesOptions, "listShareProfilesOptions") if err != nil { return } @@ -15623,16 +16102,16 @@ func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, l builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles`, nil) if err != nil { return } - for headerName, headerValue := range listVirtualNetworkInterfacesOptions.Headers { + for headerName, headerValue := range listShareProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVirtualNetworkInterfaces") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15640,14 +16119,14 @@ func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, l builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVirtualNetworkInterfacesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Start)) + if listShareProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listShareProfilesOptions.Start)) } - if listVirtualNetworkInterfacesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Limit)) + if listShareProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listShareProfilesOptions.Limit)) } - if listVirtualNetworkInterfacesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVirtualNetworkInterfacesOptions.ResourceGroupID)) + if listShareProfilesOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listShareProfilesOptions.Sort)) } request, err := builder.Build() @@ -15661,7 +16140,7 @@ func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, l return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterfaceCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfileCollection) if err != nil { return } @@ -15671,40 +16150,32 @@ func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, l return } -// GetVirtualNetworkInterface : Retrieve a virtual network interface -// This request retrieves a single virtual network interface specified by the identifier in the URL. -func (vpc *VpcV1) GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - return vpc.GetVirtualNetworkInterfaceWithContext(context.Background(), getVirtualNetworkInterfaceOptions) +// ListShares : List all file shares +// This request lists all file shares in the region. +func (vpc *VpcV1) ListShares(listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { + return vpc.ListSharesWithContext(context.Background(), listSharesOptions) } -// GetVirtualNetworkInterfaceWithContext is an alternate form of the GetVirtualNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions") +// ListSharesWithContext is an alternate form of the ListShares method which supports a Context parameter +func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSharesOptions, "listSharesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *getVirtualNetworkInterfaceOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) if err != nil { return } - for headerName, headerValue := range getVirtualNetworkInterfaceOptions.Headers { + for headerName, headerValue := range listSharesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVirtualNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShares") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15712,6 +16183,24 @@ func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, get builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSharesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSharesOptions.Start)) + } + if listSharesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSharesOptions.Limit)) + } + if listSharesOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSharesOptions.ResourceGroupID)) + } + if listSharesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listSharesOptions.Name)) + } + if listSharesOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listSharesOptions.Sort)) + } + if listSharesOptions.ReplicationRole != nil { + builder.AddQuery("replication_role", fmt.Sprint(*listSharesOptions.ReplicationRole)) + } request, err := builder.Build() if err != nil { @@ -15724,7 +16213,7 @@ func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, get return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareCollection) if err != nil { return } @@ -15734,52 +16223,54 @@ func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, get return } -// UpdateVirtualNetworkInterface : Update a virtual network interface -// This request updates a virtual network interface with the information in a provided virtual network interface patch. -// The virtual network interface patch object is structured in the same way as a retrieved virtual network interface and -// contains only the information to be updated. -func (vpc *VpcV1) UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - return vpc.UpdateVirtualNetworkInterfaceWithContext(context.Background(), updateVirtualNetworkInterfaceOptions) +// UpdateShare : Update a file share +// This request updates a share with the information in a provided share patch. The share patch object is structured in +// the same way as a retrieved share and contains only the information to be updated. +func (vpc *VpcV1) UpdateShare(updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { + return vpc.UpdateShareWithContext(context.Background(), updateShareOptions) } -// UpdateVirtualNetworkInterfaceWithContext is an alternate form of the UpdateVirtualNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions cannot be nil") +// UpdateShareWithContext is an alternate form of the UpdateShare method which supports a Context parameter +func (vpc *VpcV1) UpdateShareWithContext(ctx context.Context, updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateShareOptions, "updateShareOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions") + err = core.ValidateStruct(updateShareOptions, "updateShareOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVirtualNetworkInterfaceOptions.ID, + "id": *updateShareOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVirtualNetworkInterfaceOptions.Headers { + for headerName, headerValue := range updateShareOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVirtualNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShare") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateShareOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateShareOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVirtualNetworkInterfaceOptions.VirtualNetworkInterfacePatch) + _, err = builder.SetBodyContentJSON(updateShareOptions.SharePatch) if err != nil { return } @@ -15795,7 +16286,7 @@ func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) if err != nil { return } @@ -15805,49 +16296,55 @@ func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, return } -// ListPublicGateways : List all public gateways -// This request lists all public gateways in the region. A public gateway is a virtual network device associated with a -// VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the -// same zone only. -func (vpc *VpcV1) ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListPublicGatewaysWithContext(context.Background(), listPublicGatewaysOptions) +// UpdateShareMountTarget : Update a share mount target +// This request updates a share mount target with the information provided in a share mount target patch object. The +// share mount target patch object is structured in the same way as a retrieved share mount target and needs to contain +// only the information to be updated. +func (vpc *VpcV1) UpdateShareMountTarget(updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + return vpc.UpdateShareMountTargetWithContext(context.Background(), updateShareMountTargetOptions) } -// ListPublicGatewaysWithContext is an alternate form of the ListPublicGateways method which supports a Context parameter -func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listPublicGatewaysOptions, "listPublicGatewaysOptions") +// UpdateShareMountTargetWithContext is an alternate form of the UpdateShareMountTarget method which supports a Context parameter +func (vpc *VpcV1) UpdateShareMountTargetWithContext(ctx context.Context, updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateShareMountTargetOptions, "updateShareMountTargetOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateShareMountTargetOptions, "updateShareMountTargetOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "share_id": *updateShareMountTargetOptions.ShareID, + "id": *updateShareMountTargetOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listPublicGatewaysOptions.Headers { + for headerName, headerValue := range updateShareMountTargetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPublicGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShareMountTarget") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listPublicGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listPublicGatewaysOptions.Start)) - } - if listPublicGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listPublicGatewaysOptions.Limit)) - } - if listPublicGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listPublicGatewaysOptions.ResourceGroupID)) + + _, err = builder.SetBodyContentJSON(updateShareMountTargetOptions.ShareMountTargetPatch) + if err != nil { + return } request, err := builder.Build() @@ -15861,7 +16358,7 @@ func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicG return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGatewayCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) if err != nil { return } @@ -15871,71 +16368,48 @@ func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicG return } -// CreatePublicGateway : Create a public gateway -// This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must -// not already have a public gateway in the specified zone. -// -// If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound to -// the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway must -// be explicitly attached to each subnet it will provide connectivity for. -func (vpc *VpcV1) CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.CreatePublicGatewayWithContext(context.Background(), createPublicGatewayOptions) +// GetRegion : Retrieve a region +// This request retrieves a single region specified by the name in the URL. +func (vpc *VpcV1) GetRegion(getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { + return vpc.GetRegionWithContext(context.Background(), getRegionOptions) } -// CreatePublicGatewayWithContext is an alternate form of the CreatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createPublicGatewayOptions, "createPublicGatewayOptions cannot be nil") +// GetRegionWithContext is an alternate form of the GetRegion method which supports a Context parameter +func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRegionOptions, "getRegionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createPublicGatewayOptions, "createPublicGatewayOptions") + err = core.ValidateStruct(getRegionOptions, "getRegionOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "name": *getRegionOptions.Name, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createPublicGatewayOptions.Headers { + for headerName, headerValue := range getRegionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegion") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createPublicGatewayOptions.VPC != nil { - body["vpc"] = createPublicGatewayOptions.VPC - } - if createPublicGatewayOptions.Zone != nil { - body["zone"] = createPublicGatewayOptions.Zone - } - if createPublicGatewayOptions.FloatingIP != nil { - body["floating_ip"] = createPublicGatewayOptions.FloatingIP - } - if createPublicGatewayOptions.Name != nil { - body["name"] = createPublicGatewayOptions.Name - } - if createPublicGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createPublicGatewayOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -15947,7 +16421,7 @@ func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPubl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegion) if err != nil { return } @@ -15957,45 +16431,45 @@ func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPubl return } -// DeletePublicGateway : Delete a public gateway -// This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public -// gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the -// floating IP was created when the public gateway was created, it will be deleted. -func (vpc *VpcV1) DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeletePublicGatewayWithContext(context.Background(), deletePublicGatewayOptions) +// GetRegionZone : Retrieve a zone +// This request retrieves a single zone specified by the region and zone names in the URL. +func (vpc *VpcV1) GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { + return vpc.GetRegionZoneWithContext(context.Background(), getRegionZoneOptions) } -// DeletePublicGatewayWithContext is an alternate form of the DeletePublicGateway method which supports a Context parameter -func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deletePublicGatewayOptions, "deletePublicGatewayOptions cannot be nil") +// GetRegionZoneWithContext is an alternate form of the GetRegionZone method which supports a Context parameter +func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRegionZoneOptions, "getRegionZoneOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deletePublicGatewayOptions, "deletePublicGatewayOptions") + err = core.ValidateStruct(getRegionZoneOptions, "getRegionZoneOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deletePublicGatewayOptions.ID, + "region_name": *getRegionZoneOptions.RegionName, + "name": *getRegionZoneOptions.Name, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deletePublicGatewayOptions.Headers { + for headerName, headerValue := range getRegionZoneOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegionZone") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -16005,45 +16479,57 @@ func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePubl return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZone) + if err != nil { + return + } + response.Result = result + } return } -// GetPublicGateway : Retrieve a public gateway -// This request retrieves a single public gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.GetPublicGatewayWithContext(context.Background(), getPublicGatewayOptions) +// ListRegionZones : List all zones in a region +// This request lists all zones in a region. Zones represent logically-isolated data centers with high-bandwidth and +// low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. +func (vpc *VpcV1) ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { + return vpc.ListRegionZonesWithContext(context.Background(), listRegionZonesOptions) } -// GetPublicGatewayWithContext is an alternate form of the GetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getPublicGatewayOptions, "getPublicGatewayOptions cannot be nil") +// ListRegionZonesWithContext is an alternate form of the ListRegionZones method which supports a Context parameter +func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRegionZonesOptions, "listRegionZonesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getPublicGatewayOptions, "getPublicGatewayOptions") + err = core.ValidateStruct(listRegionZonesOptions, "listRegionZonesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getPublicGatewayOptions.ID, + "region_name": *listRegionZonesOptions.RegionName, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getPublicGatewayOptions.Headers { + for headerName, headerValue := range listRegionZonesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegionZones") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16063,7 +16549,7 @@ func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZoneCollection) if err != nil { return } @@ -16073,54 +16559,44 @@ func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGate return } -// UpdatePublicGateway : Update a public gateway -// This request updates a public gateway's name. -func (vpc *VpcV1) UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.UpdatePublicGatewayWithContext(context.Background(), updatePublicGatewayOptions) -} - -// UpdatePublicGatewayWithContext is an alternate form of the UpdatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updatePublicGatewayOptions, "updatePublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updatePublicGatewayOptions, "updatePublicGatewayOptions") +// ListRegions : List all regions +// This request lists all regions. Each region is a separate geographic area that contains multiple isolated zones. +// Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other zones +// in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault isolation +// available. Resources deployed within a single region also benefit from the low latency afforded by geographic +// proximity. +func (vpc *VpcV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { + return vpc.ListRegionsWithContext(context.Background(), listRegionsOptions) +} + +// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter +func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updatePublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions`, nil) if err != nil { return } - for headerName, headerValue := range updatePublicGatewayOptions.Headers { + for headerName, headerValue := range listRegionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegions") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updatePublicGatewayOptions.PublicGatewayPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16132,7 +16608,7 @@ func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePubl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionCollection) if err != nil { return } @@ -16142,33 +16618,56 @@ func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePubl return } -// ListFloatingIps : List all floating IPs -// This request lists all floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet -// to an instance. -func (vpc *VpcV1) ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - return vpc.ListFloatingIpsWithContext(context.Background(), listFloatingIpsOptions) +// AddNetworkInterfaceFloatingIP : Add an association between a floating IP and a virtual network interface +// This request adds an association between the specified floating IP and the specified virtual network interface. +// +// If the virtual network interface has `enable_infrastructure_nat` set to `true`, no more than one floating IP can be +// associated, and network address translation is performed between the floating IP address and the virtual network +// interface's `primary_ip` address. +// +// If the virtual network interface has `enable_infrastructure_nat` set to `false`, packets are passed unchanged to/from +// the virtual network interface. +// +// The floating IP must: +// - be in the same `zone` as the virtual network interface +// - not currently be associated with another resource +// +// The virtual network interface's `target` must not currently be a file share mount target. +// +// A request body is not required, and if provided, is ignored. +func (vpc *VpcV1) AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { + return vpc.AddNetworkInterfaceFloatingIPWithContext(context.Background(), addNetworkInterfaceFloatingIPOptions) } -// ListFloatingIpsWithContext is an alternate form of the ListFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFloatingIpsOptions, "listFloatingIpsOptions") +// AddNetworkInterfaceFloatingIPWithContext is an alternate form of the AddNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) AddNetworkInterfaceFloatingIPWithContext(ctx context.Context, addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addNetworkInterfaceFloatingIPOptions, "addNetworkInterfaceFloatingIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(addNetworkInterfaceFloatingIPOptions, "addNetworkInterfaceFloatingIPOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "virtual_network_interface_id": *addNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, + "id": *addNetworkInterfaceFloatingIPOptions.ID, + } + + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listFloatingIpsOptions.Headers { + for headerName, headerValue := range addNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFloatingIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16176,18 +16675,6 @@ func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIp builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFloatingIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFloatingIpsOptions.Start)) - } - if listFloatingIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFloatingIpsOptions.Limit)) - } - if listFloatingIpsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFloatingIpsOptions.ResourceGroupID)) - } - if listFloatingIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listFloatingIpsOptions.Sort)) - } request, err := builder.Build() if err != nil { @@ -16200,7 +16687,7 @@ func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIp return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPReference) if err != nil { return } @@ -16210,50 +16697,52 @@ func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIp return } -// CreateFloatingIP : Reserve a floating IP -// This request reserves a new floating IP. -func (vpc *VpcV1) CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.CreateFloatingIPWithContext(context.Background(), createFloatingIPOptions) +// AddVirtualNetworkInterfaceIP : Bind a reserved IP to a virtual network interface +// This request binds the specified reserved IP to the specified virtual network interface. +// +// The reserved IP must currently be unbound and in the primary IP's subnet. The virtual network interface's `target` +// must not currently be a file share mount target. +func (vpc *VpcV1) AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { + return vpc.AddVirtualNetworkInterfaceIPWithContext(context.Background(), addVirtualNetworkInterfaceIPOptions) } -// CreateFloatingIPWithContext is an alternate form of the CreateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFloatingIPOptions, "createFloatingIPOptions cannot be nil") +// AddVirtualNetworkInterfaceIPWithContext is an alternate form of the AddVirtualNetworkInterfaceIP method which supports a Context parameter +func (vpc *VpcV1) AddVirtualNetworkInterfaceIPWithContext(ctx context.Context, addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVirtualNetworkInterfaceIPOptions, "addVirtualNetworkInterfaceIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createFloatingIPOptions, "createFloatingIPOptions") + err = core.ValidateStruct(addVirtualNetworkInterfaceIPOptions, "addVirtualNetworkInterfaceIPOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "virtual_network_interface_id": *addVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, + "id": *addVirtualNetworkInterfaceIPOptions.ID, + } + + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createFloatingIPOptions.Headers { + for headerName, headerValue := range addVirtualNetworkInterfaceIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVirtualNetworkInterfaceIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createFloatingIPOptions.FloatingIPPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16265,7 +16754,7 @@ func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatin return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPReference) if err != nil { return } @@ -16275,99 +16764,79 @@ func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatin return } -// DeleteFloatingIP : Delete a floating IP -// This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this -// request to succeed, the floating IP must not be required by another resource, such as a public gateway. -func (vpc *VpcV1) DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFloatingIPWithContext(context.Background(), deleteFloatingIPOptions) +// CreateVirtualNetworkInterface : Create a virtual network interface +// This request creates a new virtual network interface from a virtual network interface prototype object. The prototype +// object is structured in the same way as a retrieved virtual network interface, and contains the information necessary +// to create the new virtual network interface. +func (vpc *VpcV1) CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + return vpc.CreateVirtualNetworkInterfaceWithContext(context.Background(), createVirtualNetworkInterfaceOptions) } -// DeleteFloatingIPWithContext is an alternate form of the DeleteFloatingIP method which supports a Context parameter -func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFloatingIPOptions, "deleteFloatingIPOptions cannot be nil") +// CreateVirtualNetworkInterfaceWithContext is an alternate form of the CreateVirtualNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) CreateVirtualNetworkInterfaceWithContext(ctx context.Context, createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVirtualNetworkInterfaceOptions, "createVirtualNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteFloatingIPOptions, "deleteFloatingIPOptions") + err = core.ValidateStruct(createVirtualNetworkInterfaceOptions, "createVirtualNetworkInterfaceOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *deleteFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces`, nil) if err != nil { return } - for headerName, headerValue := range deleteFloatingIPOptions.Headers { + for headerName, headerValue := range createVirtualNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVirtualNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return + body := make(map[string]interface{}) + if createVirtualNetworkInterfaceOptions.AllowIPSpoofing != nil { + body["allow_ip_spoofing"] = createVirtualNetworkInterfaceOptions.AllowIPSpoofing } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetFloatingIP : Retrieve a floating IP -// This request retrieves a single floating IP specified by the identifier in the URL. -func (vpc *VpcV1) GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetFloatingIPWithContext(context.Background(), getFloatingIPOptions) -} - -// GetFloatingIPWithContext is an alternate form of the GetFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFloatingIPOptions, "getFloatingIPOptions cannot be nil") - if err != nil { - return + if createVirtualNetworkInterfaceOptions.AutoDelete != nil { + body["auto_delete"] = createVirtualNetworkInterfaceOptions.AutoDelete } - err = core.ValidateStruct(getFloatingIPOptions, "getFloatingIPOptions") - if err != nil { - return + if createVirtualNetworkInterfaceOptions.EnableInfrastructureNat != nil { + body["enable_infrastructure_nat"] = createVirtualNetworkInterfaceOptions.EnableInfrastructureNat } - - pathParamsMap := map[string]string{ - "id": *getFloatingIPOptions.ID, + if createVirtualNetworkInterfaceOptions.Ips != nil { + body["ips"] = createVirtualNetworkInterfaceOptions.Ips } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) - if err != nil { - return + if createVirtualNetworkInterfaceOptions.Name != nil { + body["name"] = createVirtualNetworkInterfaceOptions.Name } - - for headerName, headerValue := range getFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) + if createVirtualNetworkInterfaceOptions.PrimaryIP != nil { + body["primary_ip"] = createVirtualNetworkInterfaceOptions.PrimaryIP } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) + if createVirtualNetworkInterfaceOptions.ResourceGroup != nil { + body["resource_group"] = createVirtualNetworkInterfaceOptions.ResourceGroup + } + if createVirtualNetworkInterfaceOptions.SecurityGroups != nil { + body["security_groups"] = createVirtualNetworkInterfaceOptions.SecurityGroups + } + if createVirtualNetworkInterfaceOptions.Subnet != nil { + body["subnet"] = createVirtualNetworkInterfaceOptions.Subnet + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) request, err := builder.Build() if err != nil { @@ -16380,7 +16849,7 @@ func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) if err != nil { return } @@ -16390,103 +16859,95 @@ func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOpt return } -// UpdateFloatingIP : Update a floating IP -// This request updates a floating IP's name and/or target. -func (vpc *VpcV1) UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.UpdateFloatingIPWithContext(context.Background(), updateFloatingIPOptions) +// DeleteVirtualNetworkInterfaces : Delete a virtual network interface +// This request deletes a virtual network interface. This operation cannot be reversed. For this request to succeed, the +// virtual network interface must not be required by another resource, such as the primary network attachment for an +// instance. +func (vpc *VpcV1) DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVirtualNetworkInterfacesWithContext(context.Background(), deleteVirtualNetworkInterfacesOptions) } -// UpdateFloatingIPWithContext is an alternate form of the UpdateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFloatingIPOptions, "updateFloatingIPOptions cannot be nil") +// DeleteVirtualNetworkInterfacesWithContext is an alternate form of the DeleteVirtualNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) DeleteVirtualNetworkInterfacesWithContext(ctx context.Context, deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVirtualNetworkInterfacesOptions, "deleteVirtualNetworkInterfacesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateFloatingIPOptions, "updateFloatingIPOptions") + err = core.ValidateStruct(deleteVirtualNetworkInterfacesOptions, "deleteVirtualNetworkInterfacesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateFloatingIPOptions.ID, + "id": *deleteVirtualNetworkInterfacesOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateFloatingIPOptions.Headers { + for headerName, headerValue := range deleteVirtualNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVirtualNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateFloatingIPOptions.FloatingIPPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListNetworkAcls : List all network ACLs -// This request lists all network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules -// for all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that -// reverse traffic in response to allowed traffic is not automatically permitted. -func (vpc *VpcV1) ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkAclsWithContext(context.Background(), listNetworkAclsOptions) +// GetNetworkInterfaceFloatingIP : Retrieve associated floating IP +// This request retrieves a specified floating IP if it is associated with the virtual network interface specified in +// the URL. +func (vpc *VpcV1) GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { + return vpc.GetNetworkInterfaceFloatingIPWithContext(context.Background(), getNetworkInterfaceFloatingIPOptions) } -// ListNetworkAclsWithContext is an alternate form of the ListNetworkAcls method which supports a Context parameter -func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listNetworkAclsOptions, "listNetworkAclsOptions") +// GetNetworkInterfaceFloatingIPWithContext is an alternate form of the GetNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetNetworkInterfaceFloatingIPWithContext(ctx context.Context, getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNetworkInterfaceFloatingIPOptions, "getNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } + err = core.ValidateStruct(getNetworkInterfaceFloatingIPOptions, "getNetworkInterfaceFloatingIPOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "virtual_network_interface_id": *getNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, + "id": *getNetworkInterfaceFloatingIPOptions.ID, + } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listNetworkAclsOptions.Headers { + for headerName, headerValue := range getNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkAcls") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16494,15 +16955,6 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkAclsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkAclsOptions.Start)) - } - if listNetworkAclsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkAclsOptions.Limit)) - } - if listNetworkAclsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listNetworkAclsOptions.ResourceGroupID)) - } request, err := builder.Build() if err != nil { @@ -16515,7 +16967,7 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPReference) if err != nil { return } @@ -16525,52 +16977,48 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl return } -// CreateNetworkACL : Create a network ACL -// This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is -// structured in the same way as a retrieved network ACL, and contains the information necessary to create the new -// network ACL. -func (vpc *VpcV1) CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLWithContext(context.Background(), createNetworkACLOptions) +// GetVirtualNetworkInterface : Retrieve a virtual network interface +// This request retrieves a single virtual network interface specified by the identifier in the URL. +func (vpc *VpcV1) GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + return vpc.GetVirtualNetworkInterfaceWithContext(context.Background(), getVirtualNetworkInterfaceOptions) } -// CreateNetworkACLWithContext is an alternate form of the CreateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createNetworkACLOptions, "createNetworkACLOptions cannot be nil") +// GetVirtualNetworkInterfaceWithContext is an alternate form of the GetVirtualNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createNetworkACLOptions, "createNetworkACLOptions") + err = core.ValidateStruct(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *getVirtualNetworkInterfaceOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createNetworkACLOptions.Headers { + for headerName, headerValue := range getVirtualNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVirtualNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createNetworkACLOptions.NetworkACLPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16582,7 +17030,7 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) if err != nil { return } @@ -16592,44 +17040,46 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork return } -// DeleteNetworkACL : Delete a network ACL -// This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL -// must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. -func (vpc *VpcV1) DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLWithContext(context.Background(), deleteNetworkACLOptions) +// GetVirtualNetworkInterfaceIP : Retrieve bound reserved IP +// This request retrieves the specified reserved IP address if it is bound to the virtual network interface specified in +// the URL. +func (vpc *VpcV1) GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { + return vpc.GetVirtualNetworkInterfaceIPWithContext(context.Background(), getVirtualNetworkInterfaceIPOptions) } -// DeleteNetworkACLWithContext is an alternate form of the DeleteNetworkACL method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLOptions, "deleteNetworkACLOptions cannot be nil") +// GetVirtualNetworkInterfaceIPWithContext is an alternate form of the GetVirtualNetworkInterfaceIP method which supports a Context parameter +func (vpc *VpcV1) GetVirtualNetworkInterfaceIPWithContext(ctx context.Context, getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVirtualNetworkInterfaceIPOptions, "getVirtualNetworkInterfaceIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteNetworkACLOptions, "deleteNetworkACLOptions") + err = core.ValidateStruct(getVirtualNetworkInterfaceIPOptions, "getVirtualNetworkInterfaceIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteNetworkACLOptions.ID, + "virtual_network_interface_id": *getVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, + "id": *getVirtualNetworkInterfaceIPOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteNetworkACLOptions.Headers { + for headerName, headerValue := range getVirtualNetworkInterfaceIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVirtualNetworkInterfaceIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -16639,45 +17089,56 @@ func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetwork return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPReference) + if err != nil { + return + } + response.Result = result + } return } -// GetNetworkACL : Retrieve a network ACL -// This request retrieves a single network ACL specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLWithContext(context.Background(), getNetworkACLOptions) +// ListNetworkInterfaceFloatingIps : List all floating IPs associated with a virtual network interface +// This request lists all floating IPs associated with a virtual network interface. +func (vpc *VpcV1) ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions) (result *FloatingIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { + return vpc.ListNetworkInterfaceFloatingIpsWithContext(context.Background(), listNetworkInterfaceFloatingIpsOptions) } -// GetNetworkACLWithContext is an alternate form of the GetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLOptions, "getNetworkACLOptions cannot be nil") +// ListNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListNetworkInterfaceFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions) (result *FloatingIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listNetworkInterfaceFloatingIpsOptions, "listNetworkInterfaceFloatingIpsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getNetworkACLOptions, "getNetworkACLOptions") + err = core.ValidateStruct(listNetworkInterfaceFloatingIpsOptions, "listNetworkInterfaceFloatingIpsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getNetworkACLOptions.ID, + "virtual_network_interface_id": *listNetworkInterfaceFloatingIpsOptions.VirtualNetworkInterfaceID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getNetworkACLOptions.Headers { + for headerName, headerValue := range listNetworkInterfaceFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkInterfaceFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16685,6 +17146,15 @@ func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listNetworkInterfaceFloatingIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Start)) + } + if listNetworkInterfaceFloatingIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Limit)) + } + if listNetworkInterfaceFloatingIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Sort)) + } request, err := builder.Build() if err != nil { @@ -16697,7 +17167,7 @@ func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext) if err != nil { return } @@ -16707,52 +17177,55 @@ func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOpt return } -// UpdateNetworkACL : Update a network ACL -// This request updates a network ACL's name. -func (vpc *VpcV1) UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLWithContext(context.Background(), updateNetworkACLOptions) +// ListVirtualNetworkInterfaceIps : List all reserved IPs bound to a virtual network interface +// This request lists all reserved IPs bound to a virtual network interface. +func (vpc *VpcV1) ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions) (result *ReservedIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { + return vpc.ListVirtualNetworkInterfaceIpsWithContext(context.Background(), listVirtualNetworkInterfaceIpsOptions) } -// UpdateNetworkACLWithContext is an alternate form of the UpdateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLOptions, "updateNetworkACLOptions cannot be nil") +// ListVirtualNetworkInterfaceIpsWithContext is an alternate form of the ListVirtualNetworkInterfaceIps method which supports a Context parameter +func (vpc *VpcV1) ListVirtualNetworkInterfaceIpsWithContext(ctx context.Context, listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions) (result *ReservedIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVirtualNetworkInterfaceIpsOptions, "listVirtualNetworkInterfaceIpsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateNetworkACLOptions, "updateNetworkACLOptions") + err = core.ValidateStruct(listVirtualNetworkInterfaceIpsOptions, "listVirtualNetworkInterfaceIpsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateNetworkACLOptions.ID, + "virtual_network_interface_id": *listVirtualNetworkInterfaceIpsOptions.VirtualNetworkInterfaceID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateNetworkACLOptions.Headers { + for headerName, headerValue := range listVirtualNetworkInterfaceIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVirtualNetworkInterfaceIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateNetworkACLOptions.NetworkACLPatch) - if err != nil { - return + if listVirtualNetworkInterfaceIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Start)) + } + if listVirtualNetworkInterfaceIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Limit)) + } + if listVirtualNetworkInterfaceIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Sort)) } request, err := builder.Build() @@ -16766,7 +17239,7 @@ func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetwork return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext) if err != nil { return } @@ -16776,41 +17249,37 @@ func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetwork return } -// ListNetworkACLRules : List all rules for a network ACL -// This request lists all rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and -// a destination CIDR block over a particular protocol and port range. -func (vpc *VpcV1) ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkACLRulesWithContext(context.Background(), listNetworkACLRulesOptions) +// ListVirtualNetworkInterfaces : List all virtual network interfaces +// This request lists all virtual network interfaces in the region. A virtual network interface is a logical abstraction +// of a virtual network interface in a subnet, and may be attached to a target resource. +// +// The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network +// interfaces first. Virtual network interfaces with identical +// `created_at` property values will in turn be sorted by ascending `name` property values. +func (vpc *VpcV1) ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + return vpc.ListVirtualNetworkInterfacesWithContext(context.Background(), listVirtualNetworkInterfacesOptions) } -// ListNetworkACLRulesWithContext is an alternate form of the ListNetworkACLRules method which supports a Context parameter -func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listNetworkACLRulesOptions, "listNetworkACLRulesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listNetworkACLRulesOptions, "listNetworkACLRulesOptions") +// ListVirtualNetworkInterfacesWithContext is an alternate form of the ListVirtualNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVirtualNetworkInterfacesOptions, "listVirtualNetworkInterfacesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "network_acl_id": *listNetworkACLRulesOptions.NetworkACLID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces`, nil) if err != nil { return } - for headerName, headerValue := range listNetworkACLRulesOptions.Headers { + for headerName, headerValue := range listVirtualNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkACLRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVirtualNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16818,14 +17287,14 @@ func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetwor builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkACLRulesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkACLRulesOptions.Start)) + if listVirtualNetworkInterfacesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Start)) } - if listNetworkACLRulesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkACLRulesOptions.Limit)) + if listVirtualNetworkInterfacesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Limit)) } - if listNetworkACLRulesOptions.Direction != nil { - builder.AddQuery("direction", fmt.Sprint(*listNetworkACLRulesOptions.Direction)) + if listVirtualNetworkInterfacesOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listVirtualNetworkInterfacesOptions.ResourceGroupID)) } request, err := builder.Build() @@ -16839,7 +17308,7 @@ func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetwor return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRuleCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterfaceCollection) if err != nil { return } @@ -16849,111 +17318,96 @@ func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetwor return } -// CreateNetworkACLRule : Create a rule for a network ACL -// This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the -// same way as a retrieved rule, and contains the information necessary to create the new rule. -func (vpc *VpcV1) CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLRuleWithContext(context.Background(), createNetworkACLRuleOptions) +// RemoveNetworkInterfaceFloatingIP : Disassociate a floating IP from a virtual network interface +// This request disassociates the specified floating IP from the specified virtual network interface. +func (vpc *VpcV1) RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptions *RemoveNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveNetworkInterfaceFloatingIPWithContext(context.Background(), removeNetworkInterfaceFloatingIPOptions) } -// CreateNetworkACLRuleWithContext is an alternate form of the CreateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createNetworkACLRuleOptions, "createNetworkACLRuleOptions cannot be nil") +// RemoveNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) RemoveNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeNetworkInterfaceFloatingIPOptions *RemoveNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeNetworkInterfaceFloatingIPOptions, "removeNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createNetworkACLRuleOptions, "createNetworkACLRuleOptions") + err = core.ValidateStruct(removeNetworkInterfaceFloatingIPOptions, "removeNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *createNetworkACLRuleOptions.NetworkACLID, + "virtual_network_interface_id": *removeNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, + "id": *removeNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createNetworkACLRuleOptions.Headers { + for headerName, headerValue := range removeNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createNetworkACLRuleOptions.NetworkACLRulePrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteNetworkACLRule : Delete a network ACL rule -// This request deletes a rule. This operation cannot be reversed. -func (vpc *VpcV1) DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLRuleWithContext(context.Background(), deleteNetworkACLRuleOptions) +// RemoveVirtualNetworkInterfaceIP : Unbind a reserved IP from a virtual network interface +// This request unbinds the specified reserved IP from the specified virtual network interface. If the reserved IP has +// `auto_delete` set to `true`, the reserved IP will be deleted. +// +// The reserved IP for the `primary_ip` cannot be unbound. +func (vpc *VpcV1) RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptions *RemoveVirtualNetworkInterfaceIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveVirtualNetworkInterfaceIPWithContext(context.Background(), removeVirtualNetworkInterfaceIPOptions) } -// DeleteNetworkACLRuleWithContext is an alternate form of the DeleteNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions cannot be nil") +// RemoveVirtualNetworkInterfaceIPWithContext is an alternate form of the RemoveVirtualNetworkInterfaceIP method which supports a Context parameter +func (vpc *VpcV1) RemoveVirtualNetworkInterfaceIPWithContext(ctx context.Context, removeVirtualNetworkInterfaceIPOptions *RemoveVirtualNetworkInterfaceIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVirtualNetworkInterfaceIPOptions, "removeVirtualNetworkInterfaceIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions") + err = core.ValidateStruct(removeVirtualNetworkInterfaceIPOptions, "removeVirtualNetworkInterfaceIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *deleteNetworkACLRuleOptions.NetworkACLID, - "id": *deleteNetworkACLRuleOptions.ID, + "virtual_network_interface_id": *removeVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, + "id": *removeVirtualNetworkInterfaceIPOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteNetworkACLRuleOptions.Headers { + for headerName, headerValue := range removeVirtualNetworkInterfaceIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVirtualNetworkInterfaceIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16971,49 +17425,56 @@ func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNet return } -// GetNetworkACLRule : Retrieve a network ACL rule -// This request retrieves a single rule specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLRuleWithContext(context.Background(), getNetworkACLRuleOptions) +// UpdateVirtualNetworkInterface : Update a virtual network interface +// This request updates a virtual network interface with the information in a provided virtual network interface patch. +// The virtual network interface patch object is structured in the same way as a retrieved virtual network interface and +// contains only the information to be updated. +func (vpc *VpcV1) UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + return vpc.UpdateVirtualNetworkInterfaceWithContext(context.Background(), updateVirtualNetworkInterfaceOptions) } -// GetNetworkACLRuleWithContext is an alternate form of the GetNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLRuleOptions, "getNetworkACLRuleOptions cannot be nil") +// UpdateVirtualNetworkInterfaceWithContext is an alternate form of the UpdateVirtualNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getNetworkACLRuleOptions, "getNetworkACLRuleOptions") + err = core.ValidateStruct(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *getNetworkACLRuleOptions.NetworkACLID, - "id": *getNetworkACLRuleOptions.ID, + "id": *updateVirtualNetworkInterfaceOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getNetworkACLRuleOptions.Headers { + for headerName, headerValue := range updateVirtualNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVirtualNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateVirtualNetworkInterfaceOptions.VirtualNetworkInterfacePatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17025,7 +17486,7 @@ func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkAC return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) if err != nil { return } @@ -17035,52 +17496,67 @@ func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkAC return } -// UpdateNetworkACLRule : Update a network ACL rule -// This request updates a rule with the information in a provided rule patch. The rule patch object contains only the -// information to be updated. The request will fail if the information is not applicable to the rule's protocol. -func (vpc *VpcV1) UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLRuleWithContext(context.Background(), updateNetworkACLRuleOptions) +// CreatePublicGateway : Create a public gateway +// This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must +// not already have a public gateway in the specified zone. +// +// If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound to +// the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway must +// be explicitly attached to each subnet it will provide connectivity for. +func (vpc *VpcV1) CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.CreatePublicGatewayWithContext(context.Background(), createPublicGatewayOptions) } -// UpdateNetworkACLRuleWithContext is an alternate form of the UpdateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions cannot be nil") +// CreatePublicGatewayWithContext is an alternate form of the CreatePublicGateway method which supports a Context parameter +func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createPublicGatewayOptions, "createPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions") + err = core.ValidateStruct(createPublicGatewayOptions, "createPublicGatewayOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "network_acl_id": *updateNetworkACLRuleOptions.NetworkACLID, - "id": *updateNetworkACLRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) if err != nil { return } - for headerName, headerValue := range updateNetworkACLRuleOptions.Headers { + for headerName, headerValue := range createPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateNetworkACLRuleOptions.NetworkACLRulePatch) + body := make(map[string]interface{}) + if createPublicGatewayOptions.VPC != nil { + body["vpc"] = createPublicGatewayOptions.VPC + } + if createPublicGatewayOptions.Zone != nil { + body["zone"] = createPublicGatewayOptions.Zone + } + if createPublicGatewayOptions.FloatingIP != nil { + body["floating_ip"] = createPublicGatewayOptions.FloatingIP + } + if createPublicGatewayOptions.Name != nil { + body["name"] = createPublicGatewayOptions.Name + } + if createPublicGatewayOptions.ResourceGroup != nil { + body["resource_group"] = createPublicGatewayOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -17096,7 +17572,7 @@ func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNet return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -17106,142 +17582,101 @@ func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNet return } -// ListSecurityGroups : List all security groups -// This request lists all security groups in the region. Security groups provide a way to apply IP filtering rules to -// instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to security -// groups define which traffic the security group permits. Security group rules are stateful such that reverse traffic -// in response to allowed traffic is automatically permitted. -func (vpc *VpcV1) ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupsWithContext(context.Background(), listSecurityGroupsOptions) +// DeletePublicGateway : Delete a public gateway +// This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public +// gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the +// floating IP was created when the public gateway was created, it will be deleted. +func (vpc *VpcV1) DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeletePublicGatewayWithContext(context.Background(), deletePublicGatewayOptions) } -// ListSecurityGroupsWithContext is an alternate form of the ListSecurityGroups method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSecurityGroupsOptions, "listSecurityGroupsOptions") +// DeletePublicGatewayWithContext is an alternate form of the DeletePublicGateway method which supports a Context parameter +func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deletePublicGatewayOptions, "deletePublicGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deletePublicGatewayOptions, "deletePublicGatewayOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *deletePublicGatewayOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSecurityGroupsOptions.Headers { + for headerName, headerValue := range deletePublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroups") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupsOptions.Start)) - } - if listSecurityGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupsOptions.Limit)) - } - if listSecurityGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSecurityGroupsOptions.ResourceGroupID)) - } - if listSecurityGroupsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listSecurityGroupsOptions.VPCID)) - } - if listSecurityGroupsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listSecurityGroupsOptions.VPCCRN)) - } - if listSecurityGroupsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listSecurityGroupsOptions.VPCName)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateSecurityGroup : Create a security group -// This request creates a new security group from a security group prototype object. The prototype object is structured -// in the same way as a retrieved security group, and contains the information necessary to create the new security -// group. If security group rules are included in the prototype object, those rules will be added to the security group. -// Each security group is scoped to one VPC. Only resources in that VPC can be added to the security group. -func (vpc *VpcV1) CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupWithContext(context.Background(), createSecurityGroupOptions) +// GetPublicGateway : Retrieve a public gateway +// This request retrieves a single public gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.GetPublicGatewayWithContext(context.Background(), getPublicGatewayOptions) } -// CreateSecurityGroupWithContext is an alternate form of the CreateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupOptions, "createSecurityGroupOptions cannot be nil") +// GetPublicGatewayWithContext is an alternate form of the GetPublicGateway method which supports a Context parameter +func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getPublicGatewayOptions, "getPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupOptions, "createSecurityGroupOptions") + err = core.ValidateStruct(getPublicGatewayOptions, "getPublicGatewayOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *getPublicGatewayOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSecurityGroupOptions.Headers { + for headerName, headerValue := range getPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createSecurityGroupOptions.VPC != nil { - body["vpc"] = createSecurityGroupOptions.VPC - } - if createSecurityGroupOptions.Name != nil { - body["name"] = createSecurityGroupOptions.Name - } - if createSecurityGroupOptions.ResourceGroup != nil { - body["resource_group"] = createSecurityGroupOptions.ResourceGroup - } - if createSecurityGroupOptions.Rules != nil { - body["rules"] = createSecurityGroupOptions.Rules - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -17253,7 +17688,7 @@ func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecu return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -17263,100 +17698,120 @@ func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecu return } -// DeleteSecurityGroup : Delete a security group -// This request deletes a security group. A security group cannot be deleted if it is referenced by any security group -// targets or rules. Additionally, a VPC's default security group cannot be deleted. This operation cannot be reversed. -func (vpc *VpcV1) DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupWithContext(context.Background(), deleteSecurityGroupOptions) +// ListPublicGateways : List all public gateways +// This request lists all public gateways in the region. A public gateway is a virtual network device associated with a +// VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the +// same zone only. +func (vpc *VpcV1) ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListPublicGatewaysWithContext(context.Background(), listPublicGatewaysOptions) } -// DeleteSecurityGroupWithContext is an alternate form of the DeleteSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupOptions, "deleteSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSecurityGroupOptions, "deleteSecurityGroupOptions") +// ListPublicGatewaysWithContext is an alternate form of the ListPublicGateways method which supports a Context parameter +func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listPublicGatewaysOptions, "listPublicGatewaysOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *deleteSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupOptions.Headers { + for headerName, headerValue := range listPublicGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPublicGateways") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listPublicGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listPublicGatewaysOptions.Start)) + } + if listPublicGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listPublicGatewaysOptions.Limit)) + } + if listPublicGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listPublicGatewaysOptions.ResourceGroupID)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGatewayCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetSecurityGroup : Retrieve a security group -// This request retrieves a single security group specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupWithContext(context.Background(), getSecurityGroupOptions) +// UpdatePublicGateway : Update a public gateway +// This request updates a public gateway's name. +func (vpc *VpcV1) UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.UpdatePublicGatewayWithContext(context.Background(), updatePublicGatewayOptions) } -// GetSecurityGroupWithContext is an alternate form of the GetSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupOptions, "getSecurityGroupOptions cannot be nil") +// UpdatePublicGatewayWithContext is an alternate form of the UpdatePublicGateway method which supports a Context parameter +func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updatePublicGatewayOptions, "updatePublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupOptions, "getSecurityGroupOptions") + err = core.ValidateStruct(updatePublicGatewayOptions, "updatePublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSecurityGroupOptions.ID, + "id": *updatePublicGatewayOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupOptions.Headers { + for headerName, headerValue := range updatePublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updatePublicGatewayOptions.PublicGatewayPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17368,7 +17823,7 @@ func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGr return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -17378,52 +17833,46 @@ func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGr return } -// UpdateSecurityGroup : Update a security group -// This request updates a security group with the information provided in a security group patch object. The security -// group patch object is structured in the same way as a retrieved security group and contains only the information to -// be updated. -func (vpc *VpcV1) UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupWithContext(context.Background(), updateSecurityGroupOptions) +// CreateFloatingIP : Reserve a floating IP +// This request reserves a new floating IP. +func (vpc *VpcV1) CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.CreateFloatingIPWithContext(context.Background(), createFloatingIPOptions) } -// UpdateSecurityGroupWithContext is an alternate form of the UpdateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupOptions, "updateSecurityGroupOptions cannot be nil") +// CreateFloatingIPWithContext is an alternate form of the CreateFloatingIP method which supports a Context parameter +func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createFloatingIPOptions, "createFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSecurityGroupOptions, "updateSecurityGroupOptions") + err = core.ValidateStruct(createFloatingIPOptions, "createFloatingIPOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) if err != nil { return } - for headerName, headerValue := range updateSecurityGroupOptions.Headers { + for headerName, headerValue := range createFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSecurityGroupOptions.SecurityGroupPatch) + _, err = builder.SetBodyContentJSON(createFloatingIPOptions.FloatingIPPrototype) if err != nil { return } @@ -17439,7 +17888,7 @@ func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecu return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -17449,46 +17898,44 @@ func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecu return } -// ListSecurityGroupRules : List all rules in a security group -// This request lists all rules in a security group. These rules define what traffic the security group permits. -// Security group rules are stateful, such that reverse traffic in response to allowed traffic is automatically -// permitted. -func (vpc *VpcV1) ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupRulesWithContext(context.Background(), listSecurityGroupRulesOptions) +// DeleteFloatingIP : Delete a floating IP +// This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this +// request to succeed, the floating IP must not be required by another resource, such as a public gateway. +func (vpc *VpcV1) DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteFloatingIPWithContext(context.Background(), deleteFloatingIPOptions) } -// ListSecurityGroupRulesWithContext is an alternate form of the ListSecurityGroupRules method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions cannot be nil") +// DeleteFloatingIPWithContext is an alternate form of the DeleteFloatingIP method which supports a Context parameter +func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteFloatingIPOptions, "deleteFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions") + err = core.ValidateStruct(deleteFloatingIPOptions, "deleteFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupRulesOptions.SecurityGroupID, + "id": *deleteFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSecurityGroupRulesOptions.Headers { + for headerName, headerValue := range deleteFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -17498,75 +17945,53 @@ func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSec return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRuleCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateSecurityGroupRule : Create a rule for a security group -// This request creates a new security group rule from a security group rule prototype object. The prototype object is -// structured in the same way as a retrieved security group rule and contains the information necessary to create the -// rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in the -// security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, such -// that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP traffic -// on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. -func (vpc *VpcV1) CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupRuleWithContext(context.Background(), createSecurityGroupRuleOptions) +// GetFloatingIP : Retrieve a floating IP +// This request retrieves a single floating IP specified by the identifier in the URL. +func (vpc *VpcV1) GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.GetFloatingIPWithContext(context.Background(), getFloatingIPOptions) } -// CreateSecurityGroupRuleWithContext is an alternate form of the CreateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions cannot be nil") +// GetFloatingIPWithContext is an alternate form of the GetFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getFloatingIPOptions, "getFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions") + err = core.ValidateStruct(getFloatingIPOptions, "getFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupRuleOptions.SecurityGroupID, + "id": *getFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range getFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createSecurityGroupRuleOptions.SecurityGroupRulePrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -17578,7 +18003,7 @@ func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, create return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -17588,102 +18013,134 @@ func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, create return } -// DeleteSecurityGroupRule : Delete a security group rule -// This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will -// not end existing connections allowed by that rule. -func (vpc *VpcV1) DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupRuleWithContext(context.Background(), deleteSecurityGroupRuleOptions) +// ListFloatingIps : List all floating IPs +// This request lists all floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet +// to an instance. +func (vpc *VpcV1) ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { + return vpc.ListFloatingIpsWithContext(context.Background(), listFloatingIpsOptions) } -// DeleteSecurityGroupRuleWithContext is an alternate form of the DeleteSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions") +// ListFloatingIpsWithContext is an alternate form of the ListFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listFloatingIpsOptions, "listFloatingIpsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupRuleOptions.SecurityGroupID, - "id": *deleteSecurityGroupRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range listFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listFloatingIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listFloatingIpsOptions.Start)) + } + if listFloatingIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listFloatingIpsOptions.Limit)) + } + if listFloatingIpsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listFloatingIpsOptions.ResourceGroupID)) + } + if listFloatingIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listFloatingIpsOptions.Sort)) + } + if listFloatingIpsOptions.TargetID != nil { + builder.AddQuery("target.id", fmt.Sprint(*listFloatingIpsOptions.TargetID)) + } + if listFloatingIpsOptions.TargetCRN != nil { + builder.AddQuery("target.crn", fmt.Sprint(*listFloatingIpsOptions.TargetCRN)) + } + if listFloatingIpsOptions.TargetName != nil { + builder.AddQuery("target.name", fmt.Sprint(*listFloatingIpsOptions.TargetName)) + } + if listFloatingIpsOptions.TargetResourceType != nil { + builder.AddQuery("target.resource_type", fmt.Sprint(*listFloatingIpsOptions.TargetResourceType)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetSecurityGroupRule : Retrieve a security group rule -// This request retrieves a single security group rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupRuleWithContext(context.Background(), getSecurityGroupRuleOptions) +// UpdateFloatingIP : Update a floating IP +// This request updates a floating IP's name and/or target. +func (vpc *VpcV1) UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.UpdateFloatingIPWithContext(context.Background(), updateFloatingIPOptions) } -// GetSecurityGroupRuleWithContext is an alternate form of the GetSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions cannot be nil") +// UpdateFloatingIPWithContext is an alternate form of the UpdateFloatingIP method which supports a Context parameter +func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateFloatingIPOptions, "updateFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions") + err = core.ValidateStruct(updateFloatingIPOptions, "updateFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupRuleOptions.SecurityGroupID, - "id": *getSecurityGroupRuleOptions.ID, + "id": *updateFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range updateFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateFloatingIPOptions.FloatingIPPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17695,7 +18152,7 @@ func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecuri return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -17705,53 +18162,48 @@ func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecuri return } -// UpdateSecurityGroupRule : Update a security group rule -// This request updates a security group rule with the information in a provided rule patch object. The rule patch -// object contains only the information to be updated. The request will fail if the information is not applicable to the -// rule's protocol. -func (vpc *VpcV1) UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupRuleWithContext(context.Background(), updateSecurityGroupRuleOptions) +// CreateNetworkACL : Create a network ACL +// This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is +// structured in the same way as a retrieved network ACL, and contains the information necessary to create the new +// network ACL. +func (vpc *VpcV1) CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.CreateNetworkACLWithContext(context.Background(), createNetworkACLOptions) } -// UpdateSecurityGroupRuleWithContext is an alternate form of the UpdateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions cannot be nil") +// CreateNetworkACLWithContext is an alternate form of the CreateNetworkACL method which supports a Context parameter +func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createNetworkACLOptions, "createNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions") + err = core.ValidateStruct(createNetworkACLOptions, "createNetworkACLOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *updateSecurityGroupRuleOptions.SecurityGroupID, - "id": *updateSecurityGroupRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) if err != nil { return } - for headerName, headerValue := range updateSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range createNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSecurityGroupRuleOptions.SecurityGroupRulePatch) + _, err = builder.SetBodyContentJSON(createNetworkACLOptions.NetworkACLPrototype) if err != nil { return } @@ -17767,7 +18219,7 @@ func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, update return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -17777,53 +18229,53 @@ func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, update return } -// ListSecurityGroupTargets : List all targets associated with a security group -// This request lists all targets associated with a security group, to which the rules in the security group are -// applied. -func (vpc *VpcV1) ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupTargetsWithContext(context.Background(), listSecurityGroupTargetsOptions) +// CreateNetworkACLRule : Create a rule for a network ACL +// This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the +// same way as a retrieved rule, and contains the information necessary to create the new rule. +func (vpc *VpcV1) CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.CreateNetworkACLRuleWithContext(context.Background(), createNetworkACLRuleOptions) } -// ListSecurityGroupTargetsWithContext is an alternate form of the ListSecurityGroupTargets method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions cannot be nil") +// CreateNetworkACLRuleWithContext is an alternate form of the CreateNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createNetworkACLRuleOptions, "createNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions") + err = core.ValidateStruct(createNetworkACLRuleOptions, "createNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupTargetsOptions.SecurityGroupID, + "network_acl_id": *createNetworkACLRuleOptions.NetworkACLID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSecurityGroupTargetsOptions.Headers { + for headerName, headerValue := range createNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupTargets") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupTargetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupTargetsOptions.Start)) - } - if listSecurityGroupTargetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupTargetsOptions.Limit)) + + _, err = builder.SetBodyContentJSON(createNetworkACLRuleOptions.NetworkACLRulePrototype) + if err != nil { + return } request, err := builder.Build() @@ -17837,7 +18289,7 @@ func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listS return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -17847,52 +18299,41 @@ func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listS return } -// DeleteSecurityGroupTargetBinding : Remove a target from a security group -// This request removes a target from a security group. For this request to succeed, the target must be attached to at -// least one other security group. The specified target identifier can be: -// -// - A bare metal server network interface identifier -// - A virtual network interface identifier -// - A VPN server identifier -// - A load balancer identifier -// - An endpoint gateway identifier -// - An instance network interface identifier -// -// Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing -// connections are not affected. -func (vpc *VpcV1) DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupTargetBindingWithContext(context.Background(), deleteSecurityGroupTargetBindingOptions) +// DeleteNetworkACL : Delete a network ACL +// This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL +// must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. +func (vpc *VpcV1) DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteNetworkACLWithContext(context.Background(), deleteNetworkACLOptions) } -// DeleteSecurityGroupTargetBindingWithContext is an alternate form of the DeleteSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Context, deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions cannot be nil") +// DeleteNetworkACLWithContext is an alternate form of the DeleteNetworkACL method which supports a Context parameter +func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteNetworkACLOptions, "deleteNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions") + err = core.ValidateStruct(deleteNetworkACLOptions, "deleteNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *deleteSecurityGroupTargetBindingOptions.ID, + "id": *deleteNetworkACLOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupTargetBindingOptions.Headers { + for headerName, headerValue := range deleteNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupTargetBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -17910,46 +18351,44 @@ func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Contex return } -// GetSecurityGroupTarget : Retrieve a security group target -// This request retrieves a single target specified by the identifier in the URL path. The target must be an existing -// target of the security group. -func (vpc *VpcV1) GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupTargetWithContext(context.Background(), getSecurityGroupTargetOptions) +// DeleteNetworkACLRule : Delete a network ACL rule +// This request deletes a rule. This operation cannot be reversed. +func (vpc *VpcV1) DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteNetworkACLRuleWithContext(context.Background(), deleteNetworkACLRuleOptions) } -// GetSecurityGroupTargetWithContext is an alternate form of the GetSecurityGroupTarget method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions cannot be nil") +// DeleteNetworkACLRuleWithContext is an alternate form of the DeleteNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions") + err = core.ValidateStruct(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupTargetOptions.SecurityGroupID, - "id": *getSecurityGroupTargetOptions.ID, + "network_acl_id": *deleteNetworkACLRuleOptions.NetworkACLID, + "id": *deleteNetworkACLRuleOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupTargetOptions.Headers { + for headerName, headerValue := range deleteNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupTarget") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -17959,67 +18398,45 @@ func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecu return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateSecurityGroupTargetBinding : Add a target to a security group -// This request adds a resource to an existing security group. The specified target identifier can be: -// -// - A bare metal server network interface identifier -// - A virtual network interface identifier -// - A VPN server identifier -// - A load balancer identifier -// - An endpoint gateway identifier -// - An instance network interface identifier -// -// When a target is added to a security group, the security group rules are applied to the target. A request body is not -// required, and if provided, is ignored. -func (vpc *VpcV1) CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupTargetBindingWithContext(context.Background(), createSecurityGroupTargetBindingOptions) +// GetNetworkACL : Retrieve a network ACL +// This request retrieves a single network ACL specified by the identifier in the URL. +func (vpc *VpcV1) GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.GetNetworkACLWithContext(context.Background(), getNetworkACLOptions) } -// CreateSecurityGroupTargetBindingWithContext is an alternate form of the CreateSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Context, createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions cannot be nil") +// GetNetworkACLWithContext is an alternate form of the GetNetworkACL method which supports a Context parameter +func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNetworkACLOptions, "getNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions") + err = core.ValidateStruct(getNetworkACLOptions, "getNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *createSecurityGroupTargetBindingOptions.ID, + "id": *getNetworkACLOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSecurityGroupTargetBindingOptions.Headers { + for headerName, headerValue := range getNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupTargetBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18039,7 +18456,7 @@ func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -18049,32 +18466,41 @@ func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Contex return } -// ListIkePolicies : List all IKE policies -// This request lists all IKE policies in the region. -func (vpc *VpcV1) ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePoliciesWithContext(context.Background(), listIkePoliciesOptions) +// GetNetworkACLRule : Retrieve a network ACL rule +// This request retrieves a single rule specified by the identifier in the URL. +func (vpc *VpcV1) GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.GetNetworkACLRuleWithContext(context.Background(), getNetworkACLRuleOptions) } -// ListIkePoliciesWithContext is an alternate form of the ListIkePolicies method which supports a Context parameter -func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIkePoliciesOptions, "listIkePoliciesOptions") +// GetNetworkACLRuleWithContext is an alternate form of the GetNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNetworkACLRuleOptions, "getNetworkACLRuleOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getNetworkACLRuleOptions, "getNetworkACLRuleOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "network_acl_id": *getNetworkACLRuleOptions.NetworkACLID, + "id": *getNetworkACLRuleOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listIkePoliciesOptions.Headers { + for headerName, headerValue := range getNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18082,12 +18508,6 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIkePoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIkePoliciesOptions.Start)) - } - if listIkePoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIkePoliciesOptions.Limit)) - } request, err := builder.Build() if err != nil { @@ -18100,7 +18520,7 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -18110,70 +18530,56 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie return } -// CreateIkePolicy : Create an IKE policy -// This request creates a new IKE policy. -func (vpc *VpcV1) CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIkePolicyWithContext(context.Background(), createIkePolicyOptions) +// ListNetworkACLRules : List all rules for a network ACL +// This request lists all rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and +// a destination CIDR block over a particular protocol and port range. +func (vpc *VpcV1) ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListNetworkACLRulesWithContext(context.Background(), listNetworkACLRulesOptions) } -// CreateIkePolicyWithContext is an alternate form of the CreateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIkePolicyOptions, "createIkePolicyOptions cannot be nil") +// ListNetworkACLRulesWithContext is an alternate form of the ListNetworkACLRules method which supports a Context parameter +func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listNetworkACLRulesOptions, "listNetworkACLRulesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createIkePolicyOptions, "createIkePolicyOptions") + err = core.ValidateStruct(listNetworkACLRulesOptions, "listNetworkACLRulesOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "network_acl_id": *listNetworkACLRulesOptions.NetworkACLID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createIkePolicyOptions.Headers { + for headerName, headerValue := range listNetworkACLRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkACLRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createIkePolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm - } - if createIkePolicyOptions.DhGroup != nil { - body["dh_group"] = createIkePolicyOptions.DhGroup - } - if createIkePolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm - } - if createIkePolicyOptions.IkeVersion != nil { - body["ike_version"] = createIkePolicyOptions.IkeVersion - } - if createIkePolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIkePolicyOptions.KeyLifetime - } - if createIkePolicyOptions.Name != nil { - body["name"] = createIkePolicyOptions.Name + if listNetworkACLRulesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listNetworkACLRulesOptions.Start)) } - if createIkePolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIkePolicyOptions.ResourceGroup + if listNetworkACLRulesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listNetworkACLRulesOptions.Limit)) } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listNetworkACLRulesOptions.Direction != nil { + builder.AddQuery("direction", fmt.Sprint(*listNetworkACLRulesOptions.Direction)) } request, err := builder.Build() @@ -18187,7 +18593,7 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRuleCollection) if err != nil { return } @@ -18197,100 +18603,120 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic return } -// DeleteIkePolicy : Delete an IKE policy -// This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not be -// any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIkePolicyWithContext(context.Background(), deleteIkePolicyOptions) +// ListNetworkAcls : List all network ACLs +// This request lists all network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules +// for all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that +// reverse traffic in response to allowed traffic is not automatically permitted. +func (vpc *VpcV1) ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { + return vpc.ListNetworkAclsWithContext(context.Background(), listNetworkAclsOptions) } -// DeleteIkePolicyWithContext is an alternate form of the DeleteIkePolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIkePolicyOptions, "deleteIkePolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteIkePolicyOptions, "deleteIkePolicyOptions") +// ListNetworkAclsWithContext is an alternate form of the ListNetworkAcls method which supports a Context parameter +func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listNetworkAclsOptions, "listNetworkAclsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *deleteIkePolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) if err != nil { return } - for headerName, headerValue := range deleteIkePolicyOptions.Headers { + for headerName, headerValue := range listNetworkAclsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkAcls") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listNetworkAclsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listNetworkAclsOptions.Start)) + } + if listNetworkAclsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listNetworkAclsOptions.Limit)) + } + if listNetworkAclsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listNetworkAclsOptions.ResourceGroupID)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetIkePolicy : Retrieve an IKE policy -// This request retrieves a single IKE policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.GetIkePolicyWithContext(context.Background(), getIkePolicyOptions) +// UpdateNetworkACL : Update a network ACL +// This request updates a network ACL's name. +func (vpc *VpcV1) UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.UpdateNetworkACLWithContext(context.Background(), updateNetworkACLOptions) } -// GetIkePolicyWithContext is an alternate form of the GetIkePolicy method which supports a Context parameter -func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIkePolicyOptions, "getIkePolicyOptions cannot be nil") +// UpdateNetworkACLWithContext is an alternate form of the UpdateNetworkACL method which supports a Context parameter +func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateNetworkACLOptions, "updateNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getIkePolicyOptions, "getIkePolicyOptions") + err = core.ValidateStruct(updateNetworkACLOptions, "updateNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getIkePolicyOptions.ID, + "id": *updateNetworkACLOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getIkePolicyOptions.Headers { + for headerName, headerValue := range updateNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateNetworkACLOptions.NetworkACLPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -18302,7 +18728,7 @@ func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -18312,40 +18738,42 @@ func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptio return } -// UpdateIkePolicy : Update an IKE policy -// This request updates the properties of an existing IKE policy. -func (vpc *VpcV1) UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIkePolicyWithContext(context.Background(), updateIkePolicyOptions) +// UpdateNetworkACLRule : Update a network ACL rule +// This request updates a rule with the information in a provided rule patch. The rule patch object contains only the +// information to be updated. The request will fail if the information is not applicable to the rule's protocol. +func (vpc *VpcV1) UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateNetworkACLRuleWithContext(context.Background(), updateNetworkACLRuleOptions) } -// UpdateIkePolicyWithContext is an alternate form of the UpdateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIkePolicyOptions, "updateIkePolicyOptions cannot be nil") +// UpdateNetworkACLRuleWithContext is an alternate form of the UpdateNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateIkePolicyOptions, "updateIkePolicyOptions") + err = core.ValidateStruct(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateIkePolicyOptions.ID, + "network_acl_id": *updateNetworkACLRuleOptions.NetworkACLID, + "id": *updateNetworkACLRuleOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateIkePolicyOptions.Headers { + for headerName, headerValue := range updateNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18355,7 +18783,7 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateIkePolicyOptions.IkePolicyPatch) + _, err = builder.SetBodyContentJSON(updateNetworkACLRuleOptions.NetworkACLRulePatch) if err != nil { return } @@ -18371,7 +18799,7 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -18381,48 +18809,66 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic return } -// ListIkePolicyConnections : List all VPN gateway connections that use a specified IKE policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePolicyConnectionsWithContext(context.Background(), listIkePolicyConnectionsOptions) +// CreateSecurityGroup : Create a security group +// This request creates a new security group from a security group prototype object. The prototype object is structured +// in the same way as a retrieved security group, and contains the information necessary to create the new security +// group. If security group rules are included in the prototype object, those rules will be added to the security group. +// Each security group is scoped to one VPC. Only resources in that VPC can be added to the security group. +func (vpc *VpcV1) CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupWithContext(context.Background(), createSecurityGroupOptions) } -// ListIkePolicyConnectionsWithContext is an alternate form of the ListIkePolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions cannot be nil") +// CreateSecurityGroupWithContext is an alternate form of the CreateSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupOptions, "createSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions") + err = core.ValidateStruct(createSecurityGroupOptions, "createSecurityGroupOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *listIkePolicyConnectionsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) if err != nil { return } - for headerName, headerValue := range listIkePolicyConnectionsOptions.Headers { + for headerName, headerValue := range createSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicyConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createSecurityGroupOptions.VPC != nil { + body["vpc"] = createSecurityGroupOptions.VPC + } + if createSecurityGroupOptions.Name != nil { + body["name"] = createSecurityGroupOptions.Name + } + if createSecurityGroupOptions.ResourceGroup != nil { + body["resource_group"] = createSecurityGroupOptions.ResourceGroup + } + if createSecurityGroupOptions.Rules != nil { + body["rules"] = createSecurityGroupOptions.Rules + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -18434,7 +18880,7 @@ func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listI return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -18444,44 +18890,57 @@ func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listI return } -// ListIpsecPolicies : List all IPsec policies -// This request lists all IPsec policies in the region. -func (vpc *VpcV1) ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPoliciesWithContext(context.Background(), listIpsecPoliciesOptions) +// CreateSecurityGroupRule : Create a rule for a security group +// This request creates a new security group rule from a security group rule prototype object. The prototype object is +// structured in the same way as a retrieved security group rule and contains the information necessary to create the +// rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in the +// security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, such +// that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP traffic +// on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. +func (vpc *VpcV1) CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupRuleWithContext(context.Background(), createSecurityGroupRuleOptions) } -// ListIpsecPoliciesWithContext is an alternate form of the ListIpsecPolicies method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIpsecPoliciesOptions, "listIpsecPoliciesOptions") +// CreateSecurityGroupRuleWithContext is an alternate form of the CreateSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "security_group_id": *createSecurityGroupRuleOptions.SecurityGroupID, + } + + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listIpsecPoliciesOptions.Headers { + for headerName, headerValue := range createSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIpsecPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIpsecPoliciesOptions.Start)) - } - if listIpsecPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIpsecPoliciesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(createSecurityGroupRuleOptions.SecurityGroupRulePrototype) + if err != nil { + return } request, err := builder.Build() @@ -18495,7 +18954,7 @@ func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPol return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) if err != nil { return } @@ -18505,70 +18964,60 @@ func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPol return } -// CreateIpsecPolicy : Create an IPsec policy -// This request creates a new IPsec policy. -func (vpc *VpcV1) CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIpsecPolicyWithContext(context.Background(), createIpsecPolicyOptions) +// CreateSecurityGroupTargetBinding : Add a target to a security group +// This request adds a resource to an existing security group. The specified target identifier can be: +// +// - A bare metal server network interface identifier +// - A virtual network interface identifier +// - A VPN server identifier +// - A load balancer identifier +// - An endpoint gateway identifier +// - An instance network interface identifier +// +// When a target is added to a security group, the security group rules are applied to the target. A request body is not +// required, and if provided, is ignored. +func (vpc *VpcV1) CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupTargetBindingWithContext(context.Background(), createSecurityGroupTargetBindingOptions) } -// CreateIpsecPolicyWithContext is an alternate form of the CreateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIpsecPolicyOptions, "createIpsecPolicyOptions cannot be nil") +// CreateSecurityGroupTargetBindingWithContext is an alternate form of the CreateSecurityGroupTargetBinding method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Context, createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createIpsecPolicyOptions, "createIpsecPolicyOptions") + err = core.ValidateStruct(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "security_group_id": *createSecurityGroupTargetBindingOptions.SecurityGroupID, + "id": *createSecurityGroupTargetBindingOptions.ID, + } + + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createIpsecPolicyOptions.Headers { + for headerName, headerValue := range createSecurityGroupTargetBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupTargetBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm - } - if createIpsecPolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm - } - if createIpsecPolicyOptions.Pfs != nil { - body["pfs"] = createIpsecPolicyOptions.Pfs - } - if createIpsecPolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime - } - if createIpsecPolicyOptions.Name != nil { - body["name"] = createIpsecPolicyOptions.Name - } - if createIpsecPolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIpsecPolicyOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() + request, err := builder.Build() if err != nil { return } @@ -18579,7 +19028,7 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) if err != nil { return } @@ -18589,41 +19038,41 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP return } -// DeleteIpsecPolicy : Delete an IPsec policy -// This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must not -// be any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIpsecPolicyWithContext(context.Background(), deleteIpsecPolicyOptions) +// DeleteSecurityGroup : Delete a security group +// This request deletes a security group. A security group cannot be deleted if it is referenced by any security group +// targets or rules. Additionally, a VPC's default security group cannot be deleted. This operation cannot be reversed. +func (vpc *VpcV1) DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupWithContext(context.Background(), deleteSecurityGroupOptions) } -// DeleteIpsecPolicyWithContext is an alternate form of the DeleteIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions cannot be nil") +// DeleteSecurityGroupWithContext is an alternate form of the DeleteSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupOptions, "deleteSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions") + err = core.ValidateStruct(deleteSecurityGroupOptions, "deleteSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteIpsecPolicyOptions.ID, + "id": *deleteSecurityGroupOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteIpsecPolicyOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18641,44 +19090,45 @@ func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecP return } -// GetIpsecPolicy : Retrieve an IPsec policy -// This request retrieves a single IPsec policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.GetIpsecPolicyWithContext(context.Background(), getIpsecPolicyOptions) +// DeleteSecurityGroupRule : Delete a security group rule +// This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will +// not end existing connections allowed by that rule. +func (vpc *VpcV1) DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupRuleWithContext(context.Background(), deleteSecurityGroupRuleOptions) } -// GetIpsecPolicyWithContext is an alternate form of the GetIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIpsecPolicyOptions, "getIpsecPolicyOptions cannot be nil") +// DeleteSecurityGroupRuleWithContext is an alternate form of the DeleteSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getIpsecPolicyOptions, "getIpsecPolicyOptions") + err = core.ValidateStruct(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getIpsecPolicyOptions.ID, + "security_group_id": *deleteSecurityGroupRuleOptions.SecurityGroupID, + "id": *deleteSecurityGroupRuleOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getIpsecPolicyOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -18688,125 +19138,108 @@ func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyO return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateIpsecPolicy : Update an IPsec policy -// This request updates the properties of an existing IPsec policy. -func (vpc *VpcV1) UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIpsecPolicyWithContext(context.Background(), updateIpsecPolicyOptions) +// DeleteSecurityGroupTargetBinding : Remove a target from a security group +// This request removes a target from a security group. For this request to succeed, the target must be attached to at +// least one other security group. The specified target identifier can be: +// +// - A bare metal server network interface identifier +// - A virtual network interface identifier +// - A VPN server identifier +// - A load balancer identifier +// - An endpoint gateway identifier +// - An instance network interface identifier +// +// Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing +// connections are not affected. +func (vpc *VpcV1) DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupTargetBindingWithContext(context.Background(), deleteSecurityGroupTargetBindingOptions) } -// UpdateIpsecPolicyWithContext is an alternate form of the UpdateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIpsecPolicyOptions, "updateIpsecPolicyOptions cannot be nil") +// DeleteSecurityGroupTargetBindingWithContext is an alternate form of the DeleteSecurityGroupTargetBinding method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Context, deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateIpsecPolicyOptions, "updateIpsecPolicyOptions") + err = core.ValidateStruct(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateIpsecPolicyOptions.ID, + "security_group_id": *deleteSecurityGroupTargetBindingOptions.SecurityGroupID, + "id": *deleteSecurityGroupTargetBindingOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateIpsecPolicyOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupTargetBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupTargetBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateIpsecPolicyOptions.IPsecPolicyPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListIpsecPolicyConnections : List all VPN gateway connections that use a specified IPsec policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPolicyConnectionsWithContext(context.Background(), listIpsecPolicyConnectionsOptions) +// GetSecurityGroup : Retrieve a security group +// This request retrieves a single security group specified by the identifier in the URL path. +func (vpc *VpcV1) GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupWithContext(context.Background(), getSecurityGroupOptions) } -// ListIpsecPolicyConnectionsWithContext is an alternate form of the ListIpsecPolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions cannot be nil") +// GetSecurityGroupWithContext is an alternate form of the GetSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupOptions, "getSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions") + err = core.ValidateStruct(getSecurityGroupOptions, "getSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *listIpsecPolicyConnectionsOptions.ID, + "id": *getSecurityGroupOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listIpsecPolicyConnectionsOptions.Headers { + for headerName, headerValue := range getSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicyConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18826,7 +19259,7 @@ func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, lis return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -18836,32 +19269,41 @@ func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, lis return } -// ListVPNGateways : List all VPN gateways -// This request lists all VPN gateways in the region. -func (vpc *VpcV1) ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewaysWithContext(context.Background(), listVPNGatewaysOptions) +// GetSecurityGroupRule : Retrieve a security group rule +// This request retrieves a single security group rule specified by the identifier in the URL path. +func (vpc *VpcV1) GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupRuleWithContext(context.Background(), getSecurityGroupRuleOptions) } -// ListVPNGatewaysWithContext is an alternate form of the ListVPNGateways method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVPNGatewaysOptions, "listVPNGatewaysOptions") +// GetSecurityGroupRuleWithContext is an alternate form of the GetSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "security_group_id": *getSecurityGroupRuleOptions.SecurityGroupID, + "id": *getSecurityGroupRuleOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewaysOptions.Headers { + for headerName, headerValue := range getSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -18869,21 +19311,6 @@ func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGateway builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNGatewaysOptions.Start)) - } - if listVPNGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNGatewaysOptions.Limit)) - } - if listVPNGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNGatewaysOptions.ResourceGroupID)) - } - if listVPNGatewaysOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNGatewaysOptions.Sort)) - } - if listVPNGatewaysOptions.Mode != nil { - builder.AddQuery("mode", fmt.Sprint(*listVPNGatewaysOptions.Mode)) - } request, err := builder.Build() if err != nil { @@ -18896,7 +19323,7 @@ func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGateway return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) if err != nil { return } @@ -18906,50 +19333,50 @@ func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGateway return } -// CreateVPNGateway : Create a VPN gateway -// This request creates a new VPN gateway. -func (vpc *VpcV1) CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayWithContext(context.Background(), createVPNGatewayOptions) +// GetSecurityGroupTarget : Retrieve a security group target +// This request retrieves a single target specified by the identifier in the URL path. The target must be an existing +// target of the security group. +func (vpc *VpcV1) GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupTargetWithContext(context.Background(), getSecurityGroupTargetOptions) } -// CreateVPNGatewayWithContext is an alternate form of the CreateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayOptions, "createVPNGatewayOptions cannot be nil") +// GetSecurityGroupTargetWithContext is an alternate form of the GetSecurityGroupTarget method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNGatewayOptions, "createVPNGatewayOptions") + err = core.ValidateStruct(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "security_group_id": *getSecurityGroupTargetOptions.SecurityGroupID, + "id": *getSecurityGroupTargetOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNGatewayOptions.Headers { + for headerName, headerValue := range getSecurityGroupTargetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupTarget") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createVPNGatewayOptions.VPNGatewayPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -18961,7 +19388,7 @@ func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) if err != nil { return } @@ -18971,45 +19398,46 @@ func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGate return } -// DeleteVPNGateway : Delete a VPN gateway -// This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway -// must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as a -// next hop. -func (vpc *VpcV1) DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayWithContext(context.Background(), deleteVPNGatewayOptions) +// ListSecurityGroupRules : List all rules in a security group +// This request lists all rules in a security group. These rules define what traffic the security group permits. +// Security group rules are stateful, such that reverse traffic in response to allowed traffic is automatically +// permitted. +func (vpc *VpcV1) ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupRulesWithContext(context.Background(), listSecurityGroupRulesOptions) } -// DeleteVPNGatewayWithContext is an alternate form of the DeleteVPNGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayOptions, "deleteVPNGatewayOptions cannot be nil") +// ListSecurityGroupRulesWithContext is an alternate form of the ListSecurityGroupRules method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPNGatewayOptions, "deleteVPNGatewayOptions") + err = core.ValidateStruct(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteVPNGatewayOptions.ID, + "security_group_id": *listSecurityGroupRulesOptions.SecurityGroupID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPNGatewayOptions.Headers { + for headerName, headerValue := range listSecurityGroupRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -19019,45 +19447,57 @@ func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGate return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRuleCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNGateway : Retrieve a VPN gateway -// This request retrieves a single VPN gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayWithContext(context.Background(), getVPNGatewayOptions) +// ListSecurityGroupTargets : List all targets associated with a security group +// This request lists all targets associated with a security group, to which the rules in the security group are +// applied. +func (vpc *VpcV1) ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupTargetsWithContext(context.Background(), listSecurityGroupTargetsOptions) } -// GetVPNGatewayWithContext is an alternate form of the GetVPNGateway method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayOptions, "getVPNGatewayOptions cannot be nil") +// ListSecurityGroupTargetsWithContext is an alternate form of the ListSecurityGroupTargets method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNGatewayOptions, "getVPNGatewayOptions") + err = core.ValidateStruct(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPNGatewayOptions.ID, + "security_group_id": *listSecurityGroupTargetsOptions.SecurityGroupID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNGatewayOptions.Headers { + for headerName, headerValue := range listSecurityGroupTargetsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupTargets") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -19065,6 +19505,12 @@ func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSecurityGroupTargetsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSecurityGroupTargetsOptions.Start)) + } + if listSecurityGroupTargetsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupTargetsOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -19077,7 +19523,7 @@ func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetCollection) if err != nil { return } @@ -19087,52 +19533,59 @@ func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOpt return } -// UpdateVPNGateway : Update a VPN gateway -// This request updates the properties of an existing VPN gateway. -func (vpc *VpcV1) UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayWithContext(context.Background(), updateVPNGatewayOptions) +// ListSecurityGroups : List all security groups +// This request lists all security groups in the region. Security groups provide a way to apply IP filtering rules to +// instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to security +// groups define which traffic the security group permits. Security group rules are stateful such that reverse traffic +// in response to allowed traffic is automatically permitted. +func (vpc *VpcV1) ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupsWithContext(context.Background(), listSecurityGroupsOptions) } -// UpdateVPNGatewayWithContext is an alternate form of the UpdateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayOptions, "updateVPNGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPNGatewayOptions, "updateVPNGatewayOptions") +// ListSecurityGroupsWithContext is an alternate form of the ListSecurityGroups method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSecurityGroupsOptions, "listSecurityGroupsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateVPNGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) if err != nil { return } - for headerName, headerValue := range updateVPNGatewayOptions.Headers { + for headerName, headerValue := range listSecurityGroupsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroups") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPNGatewayOptions.VPNGatewayPatch) - if err != nil { - return + if listSecurityGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSecurityGroupsOptions.Start)) + } + if listSecurityGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupsOptions.Limit)) + } + if listSecurityGroupsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSecurityGroupsOptions.ResourceGroupID)) + } + if listSecurityGroupsOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listSecurityGroupsOptions.VPCID)) + } + if listSecurityGroupsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listSecurityGroupsOptions.VPCCRN)) + } + if listSecurityGroupsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listSecurityGroupsOptions.VPCName)) } request, err := builder.Build() @@ -19146,7 +19599,7 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupCollection) if err != nil { return } @@ -19156,49 +19609,54 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } -// ListVPNGatewayConnections : List all connections of a VPN gateway -// This request lists all connections of a VPN gateway. -func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionsWithContext(context.Background(), listVPNGatewayConnectionsOptions) +// UpdateSecurityGroup : Update a security group +// This request updates a security group with the information provided in a security group patch object. The security +// group patch object is structured in the same way as a retrieved security group and contains only the information to +// be updated. +func (vpc *VpcV1) UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.UpdateSecurityGroupWithContext(context.Background(), updateSecurityGroupOptions) } -// ListVPNGatewayConnectionsWithContext is an alternate form of the ListVPNGatewayConnections method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions cannot be nil") +// UpdateSecurityGroupWithContext is an alternate form of the UpdateSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSecurityGroupOptions, "updateSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions") + err = core.ValidateStruct(updateSecurityGroupOptions, "updateSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionsOptions.VPNGatewayID, + "id": *updateSecurityGroupOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionsOptions.Headers { + for headerName, headerValue := range updateSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewayConnectionsOptions.Status != nil { - builder.AddQuery("status", fmt.Sprint(*listVPNGatewayConnectionsOptions.Status)) + + _, err = builder.SetBodyContentJSON(updateSecurityGroupOptions.SecurityGroupPatch) + if err != nil { + return } request, err := builder.Build() @@ -19212,7 +19670,7 @@ func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, list return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -19222,50 +19680,53 @@ func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, list return } -// CreateVPNGatewayConnection : Create a connection for a VPN gateway -// This request creates a new VPN gateway connection. -func (vpc *VpcV1) CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayConnectionWithContext(context.Background(), createVPNGatewayConnectionOptions) +// UpdateSecurityGroupRule : Update a security group rule +// This request updates a security group rule with the information in a provided rule patch object. The rule patch +// object contains only the information to be updated. The request will fail if the information is not applicable to the +// rule's protocol. +func (vpc *VpcV1) UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateSecurityGroupRuleWithContext(context.Background(), updateSecurityGroupRuleOptions) } -// CreateVPNGatewayConnectionWithContext is an alternate form of the CreateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions cannot be nil") +// UpdateSecurityGroupRuleWithContext is an alternate form of the UpdateSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions") + err = core.ValidateStruct(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *createVPNGatewayConnectionOptions.VPNGatewayID, + "security_group_id": *updateSecurityGroupRuleOptions.SecurityGroupID, + "id": *updateSecurityGroupRuleOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range updateSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createVPNGatewayConnectionOptions.VPNGatewayConnectionPrototype) + _, err = builder.SetBodyContentJSON(updateSecurityGroupRuleOptions.SecurityGroupRulePatch) if err != nil { return } @@ -19281,7 +19742,7 @@ func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, cre return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) if err != nil { return } @@ -19291,42 +19752,46 @@ func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, cre return } -// DeleteVPNGatewayConnection : Delete a VPN gateway connection -// This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, there -// must not be VPC routes using this VPN connection as a next hop. -func (vpc *VpcV1) DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayConnectionWithContext(context.Background(), deleteVPNGatewayConnectionOptions) +// AddVPNGatewayConnectionLocalCIDR : Set a local CIDR on a VPN gateway connection +// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified +// CIDR already exists. A request body is not required, and if provided, is ignored. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDR(addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.AddVPNGatewayConnectionLocalCIDRWithContext(context.Background(), addVPNGatewayConnectionLocalCIDROptions) } -// DeleteVPNGatewayConnectionWithContext is an alternate form of the DeleteVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions cannot be nil") +// AddVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the AddVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions") + err = core.ValidateStruct(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *deleteVPNGatewayConnectionOptions.VPNGatewayID, - "id": *deleteVPNGatewayConnectionOptions.ID, + "vpn_gateway_id": *addVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *addVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *addVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *addVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range addVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -19344,45 +19809,49 @@ func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, del return } -// GetVPNGatewayConnection : Retrieve a VPN gateway connection -// This request retrieves a single VPN gateway connection specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayConnectionWithContext(context.Background(), getVPNGatewayConnectionOptions) +// AddVPNGatewayConnectionPeerCIDR : Set a peer CIDR on a VPN gateway connection +// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified +// CIDR already exists. A request body is not required, and if provided, is ignored. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDR(addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.AddVPNGatewayConnectionPeerCIDRWithContext(context.Background(), addVPNGatewayConnectionPeerCIDROptions) } -// GetVPNGatewayConnectionWithContext is an alternate form of the GetVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions cannot be nil") +// AddVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the AddVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions") + err = core.ValidateStruct(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *getVPNGatewayConnectionOptions.VPNGatewayID, - "id": *getVPNGatewayConnectionOptions.ID, + "vpn_gateway_id": *addVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *addVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *addVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *addVPNGatewayConnectionPeerCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range addVPNGatewayConnectionPeerCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionPeerCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -19392,133 +19861,109 @@ func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPN return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateVPNGatewayConnection : Update a VPN gateway connection -// This request updates the properties of an existing VPN gateway connection. -func (vpc *VpcV1) UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayConnectionWithContext(context.Background(), updateVPNGatewayConnectionOptions) +// CheckVPNGatewayConnectionLocalCIDR : Check if the specified local CIDR exists on a VPN gateway connection +// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDR(checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.CheckVPNGatewayConnectionLocalCIDRWithContext(context.Background(), checkVPNGatewayConnectionLocalCIDROptions) } -// UpdateVPNGatewayConnectionWithContext is an alternate form of the UpdateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions cannot be nil") +// CheckVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions") + err = core.ValidateStruct(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *updateVPNGatewayConnectionOptions.VPNGatewayID, - "id": *updateVPNGatewayConnectionOptions.ID, + "vpn_gateway_id": *checkVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *checkVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *checkVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *checkVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range checkVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPNGatewayConnectionOptions.VPNGatewayConnectionPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListVPNGatewayConnectionLocalCIDRs : List all local CIDRs for a VPN gateway connection -// This request lists all local CIDRs for a VPN gateway connection. +// CheckVPNGatewayConnectionPeerCIDR : Check if the specified peer CIDR exists on a VPN gateway connection +// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. // // This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRs(listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionLocalCIDRsWithContext(context.Background(), listVPNGatewayConnectionLocalCIDRsOptions) +func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDR(checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.CheckVPNGatewayConnectionPeerCIDRWithContext(context.Background(), checkVPNGatewayConnectionPeerCIDROptions) } -// ListVPNGatewayConnectionLocalCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionLocalCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions cannot be nil") +// CheckVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions") + err = core.ValidateStruct(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionLocalCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionLocalCIDRsOptions.ID, + "vpn_gateway_id": *checkVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *checkVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *checkVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *checkVPNGatewayConnectionPeerCIDROptions.PrefixLength, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionLocalCIDRsOptions.Headers { + for headerName, headerValue := range checkVPNGatewayConnectionPeerCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionLocalCIDRs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionPeerCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -19528,236 +19973,295 @@ func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Cont return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionLocalCIDRs) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// RemoveVPNGatewayConnectionLocalCIDR : Remove a local CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDR(removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionLocalCIDRWithContext(context.Background(), removeVPNGatewayConnectionLocalCIDROptions) +// CreateIkePolicy : Create an IKE policy +// This request creates a new IKE policy. +func (vpc *VpcV1) CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.CreateIkePolicyWithContext(context.Background(), createIkePolicyOptions) } -// RemoveVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions cannot be nil") +// CreateIkePolicyWithContext is an alternate form of the CreateIkePolicy method which supports a Context parameter +func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createIkePolicyOptions, "createIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions") + err = core.ValidateStruct(createIkePolicyOptions, "createIkePolicyOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) if err != nil { return } - for headerName, headerValue := range removeVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range createIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createIkePolicyOptions.AuthenticationAlgorithm != nil { + body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm + } + if createIkePolicyOptions.DhGroup != nil { + body["dh_group"] = createIkePolicyOptions.DhGroup + } + if createIkePolicyOptions.EncryptionAlgorithm != nil { + body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm + } + if createIkePolicyOptions.IkeVersion != nil { + body["ike_version"] = createIkePolicyOptions.IkeVersion + } + if createIkePolicyOptions.KeyLifetime != nil { + body["key_lifetime"] = createIkePolicyOptions.KeyLifetime + } + if createIkePolicyOptions.Name != nil { + body["name"] = createIkePolicyOptions.Name + } + if createIkePolicyOptions.ResourceGroup != nil { + body["resource_group"] = createIkePolicyOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + if err != nil { + return + } + response.Result = result + } return } -// CheckVPNGatewayConnectionLocalCIDR : Check if the specified local CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDR(checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionLocalCIDRWithContext(context.Background(), checkVPNGatewayConnectionLocalCIDROptions) +// CreateIpsecPolicy : Create an IPsec policy +// This request creates a new IPsec policy. +func (vpc *VpcV1) CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.CreateIpsecPolicyWithContext(context.Background(), createIpsecPolicyOptions) } -// CheckVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions cannot be nil") +// CreateIpsecPolicyWithContext is an alternate form of the CreateIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createIpsecPolicyOptions, "createIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions") + err = core.ValidateStruct(createIpsecPolicyOptions, "createIpsecPolicyOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) if err != nil { return } - for headerName, headerValue := range checkVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range createIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { + body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm + } + if createIpsecPolicyOptions.EncryptionAlgorithm != nil { + body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm + } + if createIpsecPolicyOptions.Pfs != nil { + body["pfs"] = createIpsecPolicyOptions.Pfs + } + if createIpsecPolicyOptions.KeyLifetime != nil { + body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime + } + if createIpsecPolicyOptions.Name != nil { + body["name"] = createIpsecPolicyOptions.Name + } + if createIpsecPolicyOptions.ResourceGroup != nil { + body["resource_group"] = createIpsecPolicyOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + if err != nil { + return + } + response.Result = result + } return } -// AddVPNGatewayConnectionLocalCIDR : Set a local CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified -// CIDR already exists. A request body is not required, and if provided, is ignored. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDR(addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionLocalCIDRWithContext(context.Background(), addVPNGatewayConnectionLocalCIDROptions) +// CreateVPNGateway : Create a VPN gateway +// This request creates a new VPN gateway. +func (vpc *VpcV1) CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.CreateVPNGatewayWithContext(context.Background(), createVPNGatewayOptions) } -// AddVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the AddVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions cannot be nil") +// CreateVPNGatewayWithContext is an alternate form of the CreateVPNGateway method which supports a Context parameter +func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNGatewayOptions, "createVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions") + err = core.ValidateStruct(createVPNGatewayOptions, "createVPNGatewayOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) if err != nil { return } - for headerName, headerValue := range addVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range createVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createVPNGatewayOptions.VPNGatewayPrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + if err != nil { + return + } + response.Result = result + } return } -// ListVPNGatewayConnectionPeerCIDRs : List all peer CIDRs for a VPN gateway connection -// This request lists all peer CIDRs for a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRs(listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionPeerCIDRsWithContext(context.Background(), listVPNGatewayConnectionPeerCIDRsOptions) +// CreateVPNGatewayConnection : Create a connection for a VPN gateway +// This request creates a new VPN gateway connection. +func (vpc *VpcV1) CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.CreateVPNGatewayConnectionWithContext(context.Background(), createVPNGatewayConnectionOptions) } -// ListVPNGatewayConnectionPeerCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionPeerCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions cannot be nil") +// CreateVPNGatewayConnectionWithContext is an alternate form of the CreateVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions") + err = core.ValidateStruct(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionPeerCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionPeerCIDRsOptions.ID, + "vpn_gateway_id": *createVPNGatewayConnectionOptions.VPNGatewayID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionPeerCIDRsOptions.Headers { + for headerName, headerValue := range createVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionPeerCIDRs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(createVPNGatewayConnectionOptions.VPNGatewayConnectionPrototype) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -19769,7 +20273,7 @@ func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Conte return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionPeerCIDRs) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -19779,45 +20283,41 @@ func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Conte return } -// RemoveVPNGatewayConnectionPeerCIDR : Remove a peer CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDR(removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionPeerCIDRWithContext(context.Background(), removeVPNGatewayConnectionPeerCIDROptions) +// DeleteIkePolicy : Delete an IKE policy +// This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not be +// any VPN gateway connections using this policy. +func (vpc *VpcV1) DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteIkePolicyWithContext(context.Background(), deleteIkePolicyOptions) } -// RemoveVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions cannot be nil") +// DeleteIkePolicyWithContext is an alternate form of the DeleteIkePolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteIkePolicyOptions, "deleteIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions") + err = core.ValidateStruct(deleteIkePolicyOptions, "deleteIkePolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionPeerCIDROptions.PrefixLength, + "id": *deleteIkePolicyOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeVPNGatewayConnectionPeerCIDROptions.Headers { + for headerName, headerValue := range deleteIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionPeerCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -19835,45 +20335,41 @@ func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Cont return } -// CheckVPNGatewayConnectionPeerCIDR : Check if the specified peer CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDR(checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionPeerCIDRWithContext(context.Background(), checkVPNGatewayConnectionPeerCIDROptions) +// DeleteIpsecPolicy : Delete an IPsec policy +// This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must not +// be any VPN gateway connections using this policy. +func (vpc *VpcV1) DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteIpsecPolicyWithContext(context.Background(), deleteIpsecPolicyOptions) } -// CheckVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions cannot be nil") +// DeleteIpsecPolicyWithContext is an alternate form of the DeleteIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions") + err = core.ValidateStruct(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionPeerCIDROptions.PrefixLength, + "id": *deleteIpsecPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range checkVPNGatewayConnectionPeerCIDROptions.Headers { + for headerName, headerValue := range deleteIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionPeerCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -19891,46 +20387,42 @@ func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Conte return } -// AddVPNGatewayConnectionPeerCIDR : Set a peer CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified -// CIDR already exists. A request body is not required, and if provided, is ignored. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDR(addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionPeerCIDRWithContext(context.Background(), addVPNGatewayConnectionPeerCIDROptions) +// DeleteVPNGateway : Delete a VPN gateway +// This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway +// must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as a +// next hop. +func (vpc *VpcV1) DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNGatewayWithContext(context.Background(), deleteVPNGatewayOptions) } -// AddVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the AddVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions cannot be nil") +// DeleteVPNGatewayWithContext is an alternate form of the DeleteVPNGateway method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNGatewayOptions, "deleteVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions") + err = core.ValidateStruct(deleteVPNGatewayOptions, "deleteVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionPeerCIDROptions.PrefixLength, + "id": *deleteVPNGatewayOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addVPNGatewayConnectionPeerCIDROptions.Headers { + for headerName, headerValue := range deleteVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionPeerCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -19948,157 +20440,101 @@ func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context return } -// ListVPNServers : List all VPN servers -// This request lists all VPN servers. -func (vpc *VpcV1) ListVPNServers(listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServersWithContext(context.Background(), listVPNServersOptions) +// DeleteVPNGatewayConnection : Delete a VPN gateway connection +// This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, there +// must not be VPC routes using this VPN connection as a next hop. +func (vpc *VpcV1) DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNGatewayConnectionWithContext(context.Background(), deleteVPNGatewayConnectionOptions) } -// ListVPNServersWithContext is an alternate form of the ListVPNServers method which supports a Context parameter -func (vpc *VpcV1) ListVPNServersWithContext(ctx context.Context, listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVPNServersOptions, "listVPNServersOptions") +// DeleteVPNGatewayConnectionWithContext is an alternate form of the DeleteVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "vpn_gateway_id": *deleteVPNGatewayConnectionOptions.VPNGatewayID, + "id": *deleteVPNGatewayConnectionOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNServersOptions.Headers { + for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServersOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVPNServersOptions.Name)) - } - if listVPNServersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServersOptions.Start)) - } - if listVPNServersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServersOptions.Limit)) - } - if listVPNServersOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNServersOptions.ResourceGroupID)) - } - if listVPNServersOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServersOptions.Sort)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateVPNServer : Create a VPN server -// This request creates a new VPN server. -func (vpc *VpcV1) CreateVPNServer(createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.CreateVPNServerWithContext(context.Background(), createVPNServerOptions) -} - -// CreateVPNServerWithContext is an alternate form of the CreateVPNServer method which supports a Context parameter -func (vpc *VpcV1) CreateVPNServerWithContext(ctx context.Context, createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNServerOptions, "createVPNServerOptions cannot be nil") +// GetIkePolicy : Retrieve an IKE policy +// This request retrieves a single IKE policy specified by the identifier in the URL. +func (vpc *VpcV1) GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.GetIkePolicyWithContext(context.Background(), getIkePolicyOptions) +} + +// GetIkePolicyWithContext is an alternate form of the GetIkePolicy method which supports a Context parameter +func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getIkePolicyOptions, "getIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNServerOptions, "createVPNServerOptions") + err = core.ValidateStruct(getIkePolicyOptions, "getIkePolicyOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *getIkePolicyOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNServerOptions.Headers { + for headerName, headerValue := range getIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createVPNServerOptions.Certificate != nil { - body["certificate"] = createVPNServerOptions.Certificate - } - if createVPNServerOptions.ClientAuthentication != nil { - body["client_authentication"] = createVPNServerOptions.ClientAuthentication - } - if createVPNServerOptions.ClientIPPool != nil { - body["client_ip_pool"] = createVPNServerOptions.ClientIPPool - } - if createVPNServerOptions.Subnets != nil { - body["subnets"] = createVPNServerOptions.Subnets - } - if createVPNServerOptions.ClientDnsServerIps != nil { - body["client_dns_server_ips"] = createVPNServerOptions.ClientDnsServerIps - } - if createVPNServerOptions.ClientIdleTimeout != nil { - body["client_idle_timeout"] = createVPNServerOptions.ClientIdleTimeout - } - if createVPNServerOptions.EnableSplitTunneling != nil { - body["enable_split_tunneling"] = createVPNServerOptions.EnableSplitTunneling - } - if createVPNServerOptions.Name != nil { - body["name"] = createVPNServerOptions.Name - } - if createVPNServerOptions.Port != nil { - body["port"] = createVPNServerOptions.Port - } - if createVPNServerOptions.Protocol != nil { - body["protocol"] = createVPNServerOptions.Protocol - } - if createVPNServerOptions.ResourceGroup != nil { - body["resource_group"] = createVPNServerOptions.ResourceGroup - } - if createVPNServerOptions.SecurityGroups != nil { - body["security_groups"] = createVPNServerOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -20110,7 +20546,7 @@ func (vpc *VpcV1) CreateVPNServerWithContext(ctx context.Context, createVPNServe return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) if err != nil { return } @@ -20120,46 +20556,44 @@ func (vpc *VpcV1) CreateVPNServerWithContext(ctx context.Context, createVPNServe return } -// DeleteVPNServer : Delete a VPN server -// This request deletes a VPN server. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPNServer(deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerWithContext(context.Background(), deleteVPNServerOptions) +// GetIpsecPolicy : Retrieve an IPsec policy +// This request retrieves a single IPsec policy specified by the identifier in the URL. +func (vpc *VpcV1) GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.GetIpsecPolicyWithContext(context.Background(), getIpsecPolicyOptions) } -// DeleteVPNServerWithContext is an alternate form of the DeleteVPNServer method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerWithContext(ctx context.Context, deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerOptions, "deleteVPNServerOptions cannot be nil") +// GetIpsecPolicyWithContext is an alternate form of the GetIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getIpsecPolicyOptions, "getIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPNServerOptions, "deleteVPNServerOptions") + err = core.ValidateStruct(getIpsecPolicyOptions, "getIpsecPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteVPNServerOptions.ID, + "id": *getIpsecPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPNServerOptions.Headers { + for headerName, headerValue := range getIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - if deleteVPNServerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPNServerOptions.IfMatch)) - } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -20169,45 +20603,56 @@ func (vpc *VpcV1) DeleteVPNServerWithContext(ctx context.Context, deleteVPNServe return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNServer : Retrieve a VPN server -// This request retrieves a single VPN server specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServer(getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerWithContext(context.Background(), getVPNServerOptions) +// GetVPNGateway : Retrieve a VPN gateway +// This request retrieves a single VPN gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.GetVPNGatewayWithContext(context.Background(), getVPNGatewayOptions) } -// GetVPNServerWithContext is an alternate form of the GetVPNServer method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerWithContext(ctx context.Context, getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerOptions, "getVPNServerOptions cannot be nil") +// GetVPNGatewayWithContext is an alternate form of the GetVPNGateway method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayOptions, "getVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNServerOptions, "getVPNServerOptions") + err = core.ValidateStruct(getVPNGatewayOptions, "getVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPNServerOptions.ID, + "id": *getVPNGatewayOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNServerOptions.Headers { + for headerName, headerValue := range getVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -20227,7 +20672,7 @@ func (vpc *VpcV1) GetVPNServerWithContext(ctx context.Context, getVPNServerOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) if err != nil { return } @@ -20237,58 +20682,49 @@ func (vpc *VpcV1) GetVPNServerWithContext(ctx context.Context, getVPNServerOptio return } -// UpdateVPNServer : Update a VPN server -// This request updates the properties of an existing VPN server. Any property changes will cause all connected VPN -// clients are disconnected from this VPN server except for the name change. -func (vpc *VpcV1) UpdateVPNServer(updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNServerWithContext(context.Background(), updateVPNServerOptions) +// GetVPNGatewayConnection : Retrieve a VPN gateway connection +// This request retrieves a single VPN gateway connection specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.GetVPNGatewayConnectionWithContext(context.Background(), getVPNGatewayConnectionOptions) } -// UpdateVPNServerWithContext is an alternate form of the UpdateVPNServer method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNServerWithContext(ctx context.Context, updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNServerOptions, "updateVPNServerOptions cannot be nil") +// GetVPNGatewayConnectionWithContext is an alternate form of the GetVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPNServerOptions, "updateVPNServerOptions") + err = core.ValidateStruct(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVPNServerOptions.ID, + "vpn_gateway_id": *getVPNGatewayConnectionOptions.VPNGatewayID, + "id": *getVPNGatewayConnectionOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPNServerOptions.Headers { + for headerName, headerValue := range getVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPNServerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPNServerOptions.IfMatch)) - } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPNServerOptions.VPNServerPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -20300,7 +20736,7 @@ func (vpc *VpcV1) UpdateVPNServerWithContext(ctx context.Context, updateVPNServe return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -20310,94 +20746,101 @@ func (vpc *VpcV1) UpdateVPNServerWithContext(ctx context.Context, updateVPNServe return } -// GetVPNServerClientConfiguration : Retrieve client configuration -// This request retrieves OpenVPN client configuration on a single VPN server specified by the identifier in the URL. -// This configuration includes directives compatible with OpenVPN releases 2.4 and 2.5. -func (vpc *VpcV1) GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerClientConfigurationWithContext(context.Background(), getVPNServerClientConfigurationOptions) +// ListIkePolicies : List all IKE policies +// This request lists all IKE policies in the region. +func (vpc *VpcV1) ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListIkePoliciesWithContext(context.Background(), listIkePoliciesOptions) } -// GetVPNServerClientConfigurationWithContext is an alternate form of the GetVPNServerClientConfiguration method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerClientConfigurationWithContext(ctx context.Context, getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions") +// ListIkePoliciesWithContext is an alternate form of the ListIkePolicies method which supports a Context parameter +func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listIkePoliciesOptions, "listIkePoliciesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *getVPNServerClientConfigurationOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}/client_configuration`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) if err != nil { return } - for headerName, headerValue := range getVPNServerClientConfigurationOptions.Headers { + for headerName, headerValue := range listIkePoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClientConfiguration") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "text/plain") + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listIkePoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listIkePoliciesOptions.Start)) + } + if listIkePoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listIkePoliciesOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, &result) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicyCollection) + if err != nil { + return + } + response.Result = result + } return } -// ListVPNServerClients : List all VPN clients for a VPN server -// This request retrieves all connected VPN clients, and any disconnected VPN clients that the VPN server has not yet -// deleted based on its auto-deletion policy. -func (vpc *VpcV1) ListVPNServerClients(listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServerClientsWithContext(context.Background(), listVPNServerClientsOptions) +// ListIkePolicyConnections : List all VPN gateway connections that use a specified IKE policy +// This request lists all VPN gateway connections that use a policy. +func (vpc *VpcV1) ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListIkePolicyConnectionsWithContext(context.Background(), listIkePolicyConnectionsOptions) } -// ListVPNServerClientsWithContext is an alternate form of the ListVPNServerClients method which supports a Context parameter -func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNServerClientsOptions, "listVPNServerClientsOptions cannot be nil") +// ListIkePolicyConnectionsWithContext is an alternate form of the ListIkePolicyConnections method which supports a Context parameter +func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNServerClientsOptions, "listVPNServerClientsOptions") + err = core.ValidateStruct(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *listVPNServerClientsOptions.VPNServerID, + "id": *listIkePolicyConnectionsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNServerClientsOptions.Headers { + for headerName, headerValue := range listIkePolicyConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerClients") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicyConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -20405,15 +20848,6 @@ func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNSe builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServerClientsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServerClientsOptions.Start)) - } - if listVPNServerClientsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServerClientsOptions.Limit)) - } - if listVPNServerClientsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServerClientsOptions.Sort)) - } request, err := builder.Build() if err != nil { @@ -20426,7 +20860,7 @@ func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNSe return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClientCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -20436,95 +20870,101 @@ func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNSe return } -// DeleteVPNServerClient : Delete a VPN client -// This request disconnects and deletes the VPN client from the VPN server. The VPN client may reconnect unless its -// authentication permissions for the configured authentication methods (such as its client certificate) have been -// revoked. -func (vpc *VpcV1) DeleteVPNServerClient(deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerClientWithContext(context.Background(), deleteVPNServerClientOptions) +// ListIpsecPolicies : List all IPsec policies +// This request lists all IPsec policies in the region. +func (vpc *VpcV1) ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListIpsecPoliciesWithContext(context.Background(), listIpsecPoliciesOptions) } -// DeleteVPNServerClientWithContext is an alternate form of the DeleteVPNServerClient method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerClientWithContext(ctx context.Context, deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerClientOptions, "deleteVPNServerClientOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNServerClientOptions, "deleteVPNServerClientOptions") +// ListIpsecPoliciesWithContext is an alternate form of the ListIpsecPolicies method which supports a Context parameter +func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listIpsecPoliciesOptions, "listIpsecPoliciesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_server_id": *deleteVPNServerClientOptions.VPNServerID, - "id": *deleteVPNServerClientOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) if err != nil { return } - for headerName, headerValue := range deleteVPNServerClientOptions.Headers { + for headerName, headerValue := range listIpsecPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerClient") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listIpsecPoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listIpsecPoliciesOptions.Start)) + } + if listIpsecPoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listIpsecPoliciesOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicyCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNServerClient : Retrieve a VPN client -// This request retrieves a single VPN client specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServerClient(getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerClientWithContext(context.Background(), getVPNServerClientOptions) +// ListIpsecPolicyConnections : List all VPN gateway connections that use a specified IPsec policy +// This request lists all VPN gateway connections that use a policy. +func (vpc *VpcV1) ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListIpsecPolicyConnectionsWithContext(context.Background(), listIpsecPolicyConnectionsOptions) } -// GetVPNServerClientWithContext is an alternate form of the GetVPNServerClient method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerClientWithContext(ctx context.Context, getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerClientOptions, "getVPNServerClientOptions cannot be nil") +// ListIpsecPolicyConnectionsWithContext is an alternate form of the ListIpsecPolicyConnections method which supports a Context parameter +func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNServerClientOptions, "getVPNServerClientOptions") + err = core.ValidateStruct(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *getVPNServerClientOptions.VPNServerID, - "id": *getVPNServerClientOptions.ID, + "id": *listIpsecPolicyConnectionsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNServerClientOptions.Headers { + for headerName, headerValue := range listIpsecPolicyConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClient") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicyConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -20544,7 +20984,7 @@ func (vpc *VpcV1) GetVPNServerClientWithContext(ctx context.Context, getVPNServe return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClient) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -20554,46 +20994,47 @@ func (vpc *VpcV1) GetVPNServerClientWithContext(ctx context.Context, getVPNServe return } -// DisconnectVPNClient : Disconnect a VPN client -// This request disconnects the specified VPN client, and deletes the client according to the VPN server's auto-deletion -// policy. The VPN client may reconnect unless its authentication permissions for the configured authentication methods -// (such as its client certificate) have been revoked. -func (vpc *VpcV1) DisconnectVPNClient(disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { - return vpc.DisconnectVPNClientWithContext(context.Background(), disconnectVPNClientOptions) +// ListVPNGatewayConnectionLocalCIDRs : List all local CIDRs for a VPN gateway connection +// This request lists all local CIDRs for a VPN gateway connection. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRs(listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionLocalCIDRsWithContext(context.Background(), listVPNGatewayConnectionLocalCIDRsOptions) } -// DisconnectVPNClientWithContext is an alternate form of the DisconnectVPNClient method which supports a Context parameter -func (vpc *VpcV1) DisconnectVPNClientWithContext(ctx context.Context, disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(disconnectVPNClientOptions, "disconnectVPNClientOptions cannot be nil") +// ListVPNGatewayConnectionLocalCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionLocalCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(disconnectVPNClientOptions, "disconnectVPNClientOptions") + err = core.ValidateStruct(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *disconnectVPNClientOptions.VPNServerID, - "id": *disconnectVPNClientOptions.ID, + "vpn_gateway_id": *listVPNGatewayConnectionLocalCIDRsOptions.VPNGatewayID, + "id": *listVPNGatewayConnectionLocalCIDRsOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}/disconnect`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range disconnectVPNClientOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionLocalCIDRsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DisconnectVPNClient") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionLocalCIDRs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -20603,47 +21044,59 @@ func (vpc *VpcV1) DisconnectVPNClientWithContext(ctx context.Context, disconnect return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionLocalCIDRs) + if err != nil { + return + } + response.Result = result + } return } -// ListVPNServerRoutes : List all VPN routes for a VPN server -// This request lists all VPN routes in a VPN server. All VPN routes are provided to the VPN client when the connection -// is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN route -// matching their specified destinations. All VPN routes must be unique within the VPN server. -func (vpc *VpcV1) ListVPNServerRoutes(listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServerRoutesWithContext(context.Background(), listVPNServerRoutesOptions) +// ListVPNGatewayConnectionPeerCIDRs : List all peer CIDRs for a VPN gateway connection +// This request lists all peer CIDRs for a VPN gateway connection. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRs(listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionPeerCIDRsWithContext(context.Background(), listVPNGatewayConnectionPeerCIDRsOptions) } -// ListVPNServerRoutesWithContext is an alternate form of the ListVPNServerRoutes method which supports a Context parameter -func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNServerRoutesOptions, "listVPNServerRoutesOptions cannot be nil") +// ListVPNGatewayConnectionPeerCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionPeerCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNServerRoutesOptions, "listVPNServerRoutesOptions") + err = core.ValidateStruct(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *listVPNServerRoutesOptions.VPNServerID, + "vpn_gateway_id": *listVPNGatewayConnectionPeerCIDRsOptions.VPNGatewayID, + "id": *listVPNGatewayConnectionPeerCIDRsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNServerRoutesOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionPeerCIDRsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerRoutes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionPeerCIDRs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -20651,15 +21104,6 @@ func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNSer builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServerRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServerRoutesOptions.Start)) - } - if listVPNServerRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServerRoutesOptions.Limit)) - } - if listVPNServerRoutesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServerRoutesOptions.Sort)) - } request, err := builder.Build() if err != nil { @@ -20672,7 +21116,7 @@ func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNSer return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRouteCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionPeerCIDRs) if err != nil { return } @@ -20682,65 +21126,49 @@ func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNSer return } -// CreateVPNServerRoute : Create a VPN route for a VPN server -// This request creates a new VPN route in the VPN server. All VPN routes are provided to the VPN client when the -// connection is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN -// route matching their specified destinations. All VPN routes must be unique within the VPN server. destination of the -// packet. -func (vpc *VpcV1) CreateVPNServerRoute(createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.CreateVPNServerRouteWithContext(context.Background(), createVPNServerRouteOptions) +// ListVPNGatewayConnections : List all connections of a VPN gateway +// This request lists all connections of a VPN gateway. +func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionsWithContext(context.Background(), listVPNGatewayConnectionsOptions) } -// CreateVPNServerRouteWithContext is an alternate form of the CreateVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) CreateVPNServerRouteWithContext(ctx context.Context, createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNServerRouteOptions, "createVPNServerRouteOptions cannot be nil") +// ListVPNGatewayConnectionsWithContext is an alternate form of the ListVPNGatewayConnections method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNServerRouteOptions, "createVPNServerRouteOptions") + err = core.ValidateStruct(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *createVPNServerRouteOptions.VPNServerID, + "vpn_gateway_id": *listVPNGatewayConnectionsOptions.VPNGatewayID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNServerRouteOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServerRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPNServerRouteOptions.Destination != nil { - body["destination"] = createVPNServerRouteOptions.Destination - } - if createVPNServerRouteOptions.Action != nil { - body["action"] = createVPNServerRouteOptions.Action - } - if createVPNServerRouteOptions.Name != nil { - body["name"] = createVPNServerRouteOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listVPNGatewayConnectionsOptions.Status != nil { + builder.AddQuery("status", fmt.Sprint(*listVPNGatewayConnectionsOptions.Status)) } request, err := builder.Build() @@ -20754,7 +21182,7 @@ func (vpc *VpcV1) CreateVPNServerRouteWithContext(ctx context.Context, createVPN return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -20764,97 +21192,118 @@ func (vpc *VpcV1) CreateVPNServerRouteWithContext(ctx context.Context, createVPN return } -// DeleteVPNServerRoute : Delete a VPN route -// This request deletes a VPN route. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPNServerRoute(deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerRouteWithContext(context.Background(), deleteVPNServerRouteOptions) +// ListVPNGateways : List all VPN gateways +// This request lists all VPN gateways in the region. +func (vpc *VpcV1) ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewaysWithContext(context.Background(), listVPNGatewaysOptions) } -// DeleteVPNServerRouteWithContext is an alternate form of the DeleteVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerRouteWithContext(ctx context.Context, deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions") +// ListVPNGatewaysWithContext is an alternate form of the ListVPNGateways method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVPNGatewaysOptions, "listVPNGatewaysOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_server_id": *deleteVPNServerRouteOptions.VPNServerID, - "id": *deleteVPNServerRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) if err != nil { return } - for headerName, headerValue := range deleteVPNServerRouteOptions.Headers { + for headerName, headerValue := range listVPNGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGateways") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() + if listVPNGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNGatewaysOptions.Start)) + } + if listVPNGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNGatewaysOptions.Limit)) + } + if listVPNGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNGatewaysOptions.ResourceGroupID)) + } + if listVPNGatewaysOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVPNGatewaysOptions.Sort)) + } + if listVPNGatewaysOptions.Mode != nil { + builder.AddQuery("mode", fmt.Sprint(*listVPNGatewaysOptions.Mode)) + } + + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNServerRoute : Retrieve a VPN route -// This request retrieves a single VPN route specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServerRoute(getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerRouteWithContext(context.Background(), getVPNServerRouteOptions) +// RemoveVPNGatewayConnectionLocalCIDR : Remove a local CIDR from a VPN gateway connection +// This request removes a CIDR from a VPN gateway connection. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDR(removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveVPNGatewayConnectionLocalCIDRWithContext(context.Background(), removeVPNGatewayConnectionLocalCIDROptions) } -// GetVPNServerRouteWithContext is an alternate form of the GetVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerRouteWithContext(ctx context.Context, getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerRouteOptions, "getVPNServerRouteOptions cannot be nil") +// RemoveVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNServerRouteOptions, "getVPNServerRouteOptions") + err = core.ValidateStruct(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *getVPNServerRouteOptions.VPNServerID, - "id": *getVPNServerRouteOptions.ID, + "vpn_gateway_id": *removeVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *removeVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *removeVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *removeVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNServerRouteOptions.Headers { + for headerName, headerValue := range removeVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -20864,58 +21313,101 @@ func (vpc *VpcV1) GetVPNServerRouteWithContext(ctx context.Context, getVPNServer return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) + response, err = vpc.Service.Request(request, nil) + + return +} + +// RemoveVPNGatewayConnectionPeerCIDR : Remove a peer CIDR from a VPN gateway connection +// This request removes a CIDR from a VPN gateway connection. +// +// This request is only supported for policy mode VPN gateways. +func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDR(removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveVPNGatewayConnectionPeerCIDRWithContext(context.Background(), removeVPNGatewayConnectionPeerCIDROptions) +} + +// RemoveVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) - if err != nil { - return - } - response.Result = result + err = core.ValidateStruct(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *removeVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *removeVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *removeVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *removeVPNGatewayConnectionPeerCIDROptions.PrefixLength, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range removeVPNGatewayConnectionPeerCIDROptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionPeerCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return } + response, err = vpc.Service.Request(request, nil) + return } -// UpdateVPNServerRoute : Update a VPN route -// This request updates a VPN route with the information in a provided VPN route patch. The VPN route patch object is -// structured in the same way as a retrieved VPN route and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPNServerRoute(updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNServerRouteWithContext(context.Background(), updateVPNServerRouteOptions) +// UpdateIkePolicy : Update an IKE policy +// This request updates the properties of an existing IKE policy. +func (vpc *VpcV1) UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateIkePolicyWithContext(context.Background(), updateIkePolicyOptions) } -// UpdateVPNServerRouteWithContext is an alternate form of the UpdateVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNServerRouteOptions, "updateVPNServerRouteOptions cannot be nil") +// UpdateIkePolicyWithContext is an alternate form of the UpdateIkePolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateIkePolicyOptions, "updateIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPNServerRouteOptions, "updateVPNServerRouteOptions") + err = core.ValidateStruct(updateIkePolicyOptions, "updateIkePolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_server_id": *updateVPNServerRouteOptions.VPNServerID, - "id": *updateVPNServerRouteOptions.ID, + "id": *updateIkePolicyOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPNServerRouteOptions.Headers { + for headerName, headerValue := range updateIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServerRoute") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -20925,7 +21417,7 @@ func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPN builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPNServerRouteOptions.VPNServerRoutePatch) + _, err = builder.SetBodyContentJSON(updateIkePolicyOptions.IkePolicyPatch) if err != nil { return } @@ -20941,7 +21433,7 @@ func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPN return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) if err != nil { return } @@ -20951,45 +21443,52 @@ func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPN return } -// ListLoadBalancerProfiles : List all load balancer profiles -// This request lists all load balancer profiles available in the region. A load balancer profile specifies the -// performance characteristics and pricing model for a load balancer. -func (vpc *VpcV1) ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerProfilesWithContext(context.Background(), listLoadBalancerProfilesOptions) +// UpdateIpsecPolicy : Update an IPsec policy +// This request updates the properties of an existing IPsec policy. +func (vpc *VpcV1) UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateIpsecPolicyWithContext(context.Background(), updateIpsecPolicyOptions) } -// ListLoadBalancerProfilesWithContext is an alternate form of the ListLoadBalancerProfiles method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancerProfilesOptions, "listLoadBalancerProfilesOptions") +// UpdateIpsecPolicyWithContext is an alternate form of the UpdateIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateIpsecPolicyOptions, "updateIpsecPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateIpsecPolicyOptions, "updateIpsecPolicyOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *updateIpsecPolicyOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerProfilesOptions.Headers { + for headerName, headerValue := range updateIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancerProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancerProfilesOptions.Start)) - } - if listLoadBalancerProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancerProfilesOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateIpsecPolicyOptions.IPsecPolicyPatch) + if err != nil { + return } request, err := builder.Build() @@ -21003,7 +21502,7 @@ func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) if err != nil { return } @@ -21013,48 +21512,54 @@ func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listL return } -// GetLoadBalancerProfile : Retrieve a load balancer profile -// This request retrieves a load balancer profile specified by the name in the URL. -func (vpc *VpcV1) GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerProfileWithContext(context.Background(), getLoadBalancerProfileOptions) +// UpdateVPNGateway : Update a VPN gateway +// This request updates the properties of an existing VPN gateway. +func (vpc *VpcV1) UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNGatewayWithContext(context.Background(), updateVPNGatewayOptions) } -// GetLoadBalancerProfileWithContext is an alternate form of the GetLoadBalancerProfile method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions cannot be nil") +// UpdateVPNGatewayWithContext is an alternate form of the UpdateVPNGateway method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNGatewayOptions, "updateVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions") + err = core.ValidateStruct(updateVPNGatewayOptions, "updateVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getLoadBalancerProfileOptions.Name, + "id": *updateVPNGatewayOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerProfileOptions.Headers { + for headerName, headerValue := range updateVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateVPNGatewayOptions.VPNGatewayPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -21066,7 +21571,7 @@ func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoad return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) if err != nil { return } @@ -21076,44 +21581,53 @@ func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoad return } -// ListLoadBalancers : List all load balancers -// This request lists all load balancers in the region. -func (vpc *VpcV1) ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancersWithContext(context.Background(), listLoadBalancersOptions) +// UpdateVPNGatewayConnection : Update a VPN gateway connection +// This request updates the properties of an existing VPN gateway connection. +func (vpc *VpcV1) UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNGatewayConnectionWithContext(context.Background(), updateVPNGatewayConnectionOptions) } -// ListLoadBalancersWithContext is an alternate form of the ListLoadBalancers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancersOptions, "listLoadBalancersOptions") +// UpdateVPNGatewayConnectionWithContext is an alternate form of the UpdateVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "vpn_gateway_id": *updateVPNGatewayConnectionOptions.VPNGatewayID, + "id": *updateVPNGatewayConnectionOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancersOptions.Headers { + for headerName, headerValue := range updateVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancersOptions.Start)) - } - if listLoadBalancersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancersOptions.Limit)) + + _, err = builder.SetBodyContentJSON(updateVPNGatewayConnectionOptions.VPNGatewayConnectionPatch) + if err != nil { + return } request, err := builder.Build() @@ -21127,7 +21641,7 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -21137,19 +21651,19 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala return } -// CreateLoadBalancer : Create a load balancer -// This request creates and provisions a new load balancer. -func (vpc *VpcV1) CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerWithContext(context.Background(), createLoadBalancerOptions) +// CreateVPNServer : Create a VPN server +// This request creates a new VPN server. +func (vpc *VpcV1) CreateVPNServer(createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + return vpc.CreateVPNServerWithContext(context.Background(), createVPNServerOptions) } -// CreateLoadBalancerWithContext is an alternate form of the CreateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerOptions, "createLoadBalancerOptions cannot be nil") +// CreateVPNServerWithContext is an alternate form of the CreateVPNServer method which supports a Context parameter +func (vpc *VpcV1) CreateVPNServerWithContext(ctx context.Context, createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNServerOptions, "createVPNServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerOptions, "createLoadBalancerOptions") + err = core.ValidateStruct(createVPNServerOptions, "createVPNServerOptions") if err != nil { return } @@ -21157,16 +21671,16 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) if err != nil { return } - for headerName, headerValue := range createLoadBalancerOptions.Headers { + for headerName, headerValue := range createVPNServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -21177,41 +21691,41 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createLoadBalancerOptions.IsPublic != nil { - body["is_public"] = createLoadBalancerOptions.IsPublic + if createVPNServerOptions.Certificate != nil { + body["certificate"] = createVPNServerOptions.Certificate } - if createLoadBalancerOptions.Subnets != nil { - body["subnets"] = createLoadBalancerOptions.Subnets + if createVPNServerOptions.ClientAuthentication != nil { + body["client_authentication"] = createVPNServerOptions.ClientAuthentication } - if createLoadBalancerOptions.Datapath != nil { - body["datapath"] = createLoadBalancerOptions.Datapath + if createVPNServerOptions.ClientIPPool != nil { + body["client_ip_pool"] = createVPNServerOptions.ClientIPPool } - if createLoadBalancerOptions.Dns != nil { - body["dns"] = createLoadBalancerOptions.Dns + if createVPNServerOptions.Subnets != nil { + body["subnets"] = createVPNServerOptions.Subnets } - if createLoadBalancerOptions.Listeners != nil { - body["listeners"] = createLoadBalancerOptions.Listeners + if createVPNServerOptions.ClientDnsServerIps != nil { + body["client_dns_server_ips"] = createVPNServerOptions.ClientDnsServerIps } - if createLoadBalancerOptions.Logging != nil { - body["logging"] = createLoadBalancerOptions.Logging + if createVPNServerOptions.ClientIdleTimeout != nil { + body["client_idle_timeout"] = createVPNServerOptions.ClientIdleTimeout } - if createLoadBalancerOptions.Name != nil { - body["name"] = createLoadBalancerOptions.Name + if createVPNServerOptions.EnableSplitTunneling != nil { + body["enable_split_tunneling"] = createVPNServerOptions.EnableSplitTunneling } - if createLoadBalancerOptions.Pools != nil { - body["pools"] = createLoadBalancerOptions.Pools + if createVPNServerOptions.Name != nil { + body["name"] = createVPNServerOptions.Name } - if createLoadBalancerOptions.Profile != nil { - body["profile"] = createLoadBalancerOptions.Profile + if createVPNServerOptions.Port != nil { + body["port"] = createVPNServerOptions.Port } - if createLoadBalancerOptions.ResourceGroup != nil { - body["resource_group"] = createLoadBalancerOptions.ResourceGroup + if createVPNServerOptions.Protocol != nil { + body["protocol"] = createVPNServerOptions.Protocol } - if createLoadBalancerOptions.RouteMode != nil { - body["route_mode"] = createLoadBalancerOptions.RouteMode + if createVPNServerOptions.ResourceGroup != nil { + body["resource_group"] = createVPNServerOptions.ResourceGroup } - if createLoadBalancerOptions.SecurityGroups != nil { - body["security_groups"] = createLoadBalancerOptions.SecurityGroups + if createVPNServerOptions.SecurityGroups != nil { + body["security_groups"] = createVPNServerOptions.SecurityGroups } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -21229,7 +21743,7 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) if err != nil { return } @@ -21239,103 +21753,67 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB return } -// DeleteLoadBalancer : Delete a load balancer -// This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its -// `provisioning_status` is `delete_pending`. -func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) +// CreateVPNServerRoute : Create a VPN route for a VPN server +// This request creates a new VPN route in the VPN server. All VPN routes are provided to the VPN client when the +// connection is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN +// route matching their specified destinations. All VPN routes must be unique within the VPN server. destination of the +// packet. +func (vpc *VpcV1) CreateVPNServerRoute(createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + return vpc.CreateVPNServerRouteWithContext(context.Background(), createVPNServerRouteOptions) } -// DeleteLoadBalancerWithContext is an alternate form of the DeleteLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerOptions, "deleteLoadBalancerOptions cannot be nil") +// CreateVPNServerRouteWithContext is an alternate form of the CreateVPNServerRoute method which supports a Context parameter +func (vpc *VpcV1) CreateVPNServerRouteWithContext(ctx context.Context, createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNServerRouteOptions, "createVPNServerRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerOptions, "deleteLoadBalancerOptions") + err = core.ValidateStruct(createVPNServerRouteOptions, "createVPNServerRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteLoadBalancerOptions.ID, + "vpn_server_id": *createVPNServerRouteOptions.VPNServerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerOptions.Headers { + for headerName, headerValue := range createVPNServerRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServerRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - if deleteLoadBalancerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteLoadBalancerOptions.IfMatch)) - } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetLoadBalancer : Retrieve a load balancer -// This request retrieves a single load balancer specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerWithContext(context.Background(), getLoadBalancerOptions) -} - -// GetLoadBalancerWithContext is an alternate form of the GetLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerOptions, "getLoadBalancerOptions cannot be nil") - if err != nil { - return + body := make(map[string]interface{}) + if createVPNServerRouteOptions.Destination != nil { + body["destination"] = createVPNServerRouteOptions.Destination } - err = core.ValidateStruct(getLoadBalancerOptions, "getLoadBalancerOptions") - if err != nil { - return + if createVPNServerRouteOptions.Action != nil { + body["action"] = createVPNServerRouteOptions.Action } - - pathParamsMap := map[string]string{ - "id": *getLoadBalancerOptions.ID, + if createVPNServerRouteOptions.Name != nil { + body["name"] = createVPNServerRouteOptions.Name } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.SetBodyContentJSON(body) if err != nil { return } - for headerName, headerValue := range getLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() if err != nil { return @@ -21347,7 +21825,7 @@ func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalance return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) if err != nil { return } @@ -21357,118 +21835,100 @@ func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalance return } -// UpdateLoadBalancer : Update a load balancer -// This request updates a load balancer with the information in a provided load balancer patch. The load balancer patch -// object is structured in the same way as a retrieved load balancer and contains only the information to be updated. A -// load balancer can only be updated if its `provisioning_status` is `active`. -func (vpc *VpcV1) UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerWithContext(context.Background(), updateLoadBalancerOptions) +// DeleteVPNServer : Delete a VPN server +// This request deletes a VPN server. This operation cannot be reversed. +func (vpc *VpcV1) DeleteVPNServer(deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNServerWithContext(context.Background(), deleteVPNServerOptions) } -// UpdateLoadBalancerWithContext is an alternate form of the UpdateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerOptions, "updateLoadBalancerOptions cannot be nil") +// DeleteVPNServerWithContext is an alternate form of the DeleteVPNServer method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNServerWithContext(ctx context.Context, deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNServerOptions, "deleteVPNServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerOptions, "updateLoadBalancerOptions") + err = core.ValidateStruct(deleteVPNServerOptions, "deleteVPNServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateLoadBalancerOptions.ID, + "id": *deleteVPNServerOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerOptions.Headers { + for headerName, headerValue := range deleteVPNServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateLoadBalancerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateLoadBalancerOptions.IfMatch)) + if deleteVPNServerOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVPNServerOptions.IfMatch)) } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerOptions.LoadBalancerPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// GetLoadBalancerStatistics : List all statistics of a load balancer -// This request lists statistics of a load balancer. -func (vpc *VpcV1) GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerStatisticsWithContext(context.Background(), getLoadBalancerStatisticsOptions) +// DeleteVPNServerClient : Delete a VPN client +// This request disconnects and deletes the VPN client from the VPN server. The VPN client may reconnect unless its +// authentication permissions for the configured authentication methods (such as its client certificate) have been +// revoked. +func (vpc *VpcV1) DeleteVPNServerClient(deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNServerClientWithContext(context.Background(), deleteVPNServerClientOptions) } -// GetLoadBalancerStatisticsWithContext is an alternate form of the GetLoadBalancerStatistics method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions cannot be nil") +// DeleteVPNServerClientWithContext is an alternate form of the DeleteVPNServerClient method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNServerClientWithContext(ctx context.Context, deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNServerClientOptions, "deleteVPNServerClientOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions") + err = core.ValidateStruct(deleteVPNServerClientOptions, "deleteVPNServerClientOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getLoadBalancerStatisticsOptions.ID, + "vpn_server_id": *deleteVPNServerClientOptions.VPNServerID, + "id": *deleteVPNServerClientOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}/statistics`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerStatisticsOptions.Headers { + for headerName, headerValue := range deleteVPNServerClientOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerStatistics") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerClient") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -21478,60 +21938,49 @@ func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getL return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerStatistics) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListLoadBalancerListeners : List all listeners for a load balancer -// This request lists all listeners for a load balancer. -func (vpc *VpcV1) ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenersWithContext(context.Background(), listLoadBalancerListenersOptions) +// DeleteVPNServerRoute : Delete a VPN route +// This request deletes a VPN route. This operation cannot be reversed. +func (vpc *VpcV1) DeleteVPNServerRoute(deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNServerRouteWithContext(context.Background(), deleteVPNServerRouteOptions) } -// ListLoadBalancerListenersWithContext is an alternate form of the ListLoadBalancerListeners method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions cannot be nil") +// DeleteVPNServerRouteWithContext is an alternate form of the DeleteVPNServerRoute method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNServerRouteWithContext(ctx context.Context, deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions") + err = core.ValidateStruct(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenersOptions.LoadBalancerID, + "vpn_server_id": *deleteVPNServerRouteOptions.VPNServerID, + "id": *deleteVPNServerRouteOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenersOptions.Headers { + for headerName, headerValue := range deleteVPNServerRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListeners") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -21541,164 +21990,103 @@ func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, list return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateLoadBalancerListener : Create a listener for a load balancer -// This request creates a new listener for a load balancer. -func (vpc *VpcV1) CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerWithContext(context.Background(), createLoadBalancerListenerOptions) +// DisconnectVPNClient : Disconnect a VPN client +// This request disconnects the specified VPN client, and deletes the client according to the VPN server's auto-deletion +// policy. The VPN client may reconnect unless its authentication permissions for the configured authentication methods +// (such as its client certificate) have been revoked. +func (vpc *VpcV1) DisconnectVPNClient(disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { + return vpc.DisconnectVPNClientWithContext(context.Background(), disconnectVPNClientOptions) } -// CreateLoadBalancerListenerWithContext is an alternate form of the CreateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions cannot be nil") +// DisconnectVPNClientWithContext is an alternate form of the DisconnectVPNClient method which supports a Context parameter +func (vpc *VpcV1) DisconnectVPNClientWithContext(ctx context.Context, disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(disconnectVPNClientOptions, "disconnectVPNClientOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions") + err = core.ValidateStruct(disconnectVPNClientOptions, "disconnectVPNClientOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerOptions.LoadBalancerID, + "vpn_server_id": *disconnectVPNClientOptions.VPNServerID, + "id": *disconnectVPNClientOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}/disconnect`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range disconnectVPNClientOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DisconnectVPNClient") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerListenerOptions.Protocol != nil { - body["protocol"] = createLoadBalancerListenerOptions.Protocol - } - if createLoadBalancerListenerOptions.AcceptProxyProtocol != nil { - body["accept_proxy_protocol"] = createLoadBalancerListenerOptions.AcceptProxyProtocol - } - if createLoadBalancerListenerOptions.CertificateInstance != nil { - body["certificate_instance"] = createLoadBalancerListenerOptions.CertificateInstance - } - if createLoadBalancerListenerOptions.ConnectionLimit != nil { - body["connection_limit"] = createLoadBalancerListenerOptions.ConnectionLimit - } - if createLoadBalancerListenerOptions.DefaultPool != nil { - body["default_pool"] = createLoadBalancerListenerOptions.DefaultPool - } - if createLoadBalancerListenerOptions.HTTPSRedirect != nil { - body["https_redirect"] = createLoadBalancerListenerOptions.HTTPSRedirect - } - if createLoadBalancerListenerOptions.IdleConnectionTimeout != nil { - body["idle_connection_timeout"] = createLoadBalancerListenerOptions.IdleConnectionTimeout - } - if createLoadBalancerListenerOptions.Policies != nil { - body["policies"] = createLoadBalancerListenerOptions.Policies - } - if createLoadBalancerListenerOptions.Port != nil { - body["port"] = createLoadBalancerListenerOptions.Port - } - if createLoadBalancerListenerOptions.PortMax != nil { - body["port_max"] = createLoadBalancerListenerOptions.PortMax - } - if createLoadBalancerListenerOptions.PortMin != nil { - body["port_min"] = createLoadBalancerListenerOptions.PortMin - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteLoadBalancerListener : Delete a load balancer listener -// This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, the -// listener must not be the target of another load balancer listener. -func (vpc *VpcV1) DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerWithContext(context.Background(), deleteLoadBalancerListenerOptions) +// GetVPNServer : Retrieve a VPN server +// This request retrieves a single VPN server specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNServer(getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + return vpc.GetVPNServerWithContext(context.Background(), getVPNServerOptions) } -// DeleteLoadBalancerListenerWithContext is an alternate form of the DeleteLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions cannot be nil") +// GetVPNServerWithContext is an alternate form of the GetVPNServer method which supports a Context parameter +func (vpc *VpcV1) GetVPNServerWithContext(ctx context.Context, getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNServerOptions, "getVPNServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions") + err = core.ValidateStruct(getVPNServerOptions, "getVPNServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerOptions.LoadBalancerID, - "id": *deleteLoadBalancerListenerOptions.ID, + "id": *getVPNServerOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range getVPNServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -21708,46 +22096,57 @@ func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, del return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) + if err != nil { + return + } + response.Result = result + } return } -// GetLoadBalancerListener : Retrieve a load balancer listener -// This request retrieves a single listener specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerWithContext(context.Background(), getLoadBalancerListenerOptions) +// GetVPNServerClient : Retrieve a VPN client +// This request retrieves a single VPN client specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNServerClient(getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { + return vpc.GetVPNServerClientWithContext(context.Background(), getVPNServerClientOptions) } -// GetLoadBalancerListenerWithContext is an alternate form of the GetLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions cannot be nil") +// GetVPNServerClientWithContext is an alternate form of the GetVPNServerClient method which supports a Context parameter +func (vpc *VpcV1) GetVPNServerClientWithContext(ctx context.Context, getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNServerClientOptions, "getVPNServerClientOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions") + err = core.ValidateStruct(getVPNServerClientOptions, "getVPNServerClientOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerOptions.LoadBalancerID, - "id": *getLoadBalancerListenerOptions.ID, + "vpn_server_id": *getVPNServerClientOptions.VPNServerID, + "id": *getVPNServerClientOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range getVPNServerClientOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClient") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -21767,7 +22166,7 @@ func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoa return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClient) if err != nil { return } @@ -21777,111 +22176,94 @@ func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoa return } -// UpdateLoadBalancerListener : Update a load balancer listener -// This request updates a load balancer listener from a listener patch. -func (vpc *VpcV1) UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerWithContext(context.Background(), updateLoadBalancerListenerOptions) +// GetVPNServerClientConfiguration : Retrieve client configuration +// This request retrieves OpenVPN client configuration on a single VPN server specified by the identifier in the URL. +// This configuration includes directives compatible with OpenVPN releases 2.4 and 2.5. +func (vpc *VpcV1) GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { + return vpc.GetVPNServerClientConfigurationWithContext(context.Background(), getVPNServerClientConfigurationOptions) } -// UpdateLoadBalancerListenerWithContext is an alternate form of the UpdateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions cannot be nil") +// GetVPNServerClientConfigurationWithContext is an alternate form of the GetVPNServerClientConfiguration method which supports a Context parameter +func (vpc *VpcV1) GetVPNServerClientConfigurationWithContext(ctx context.Context, getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions") + err = core.ValidateStruct(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerOptions.LoadBalancerID, - "id": *updateLoadBalancerListenerOptions.ID, + "id": *getVPNServerClientConfigurationOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}/client_configuration`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range getVPNServerClientConfigurationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClientConfiguration") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Accept", "text/plain") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerOptions.LoadBalancerListenerPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, &result) return } -// ListLoadBalancerListenerPolicies : List all policies for a load balancer listener -// This request lists all policies for a load balancer listener. -func (vpc *VpcV1) ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPoliciesWithContext(context.Background(), listLoadBalancerListenerPoliciesOptions) +// GetVPNServerRoute : Retrieve a VPN route +// This request retrieves a single VPN route specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNServerRoute(getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + return vpc.GetVPNServerRouteWithContext(context.Background(), getVPNServerRouteOptions) } -// ListLoadBalancerListenerPoliciesWithContext is an alternate form of the ListLoadBalancerListenerPolicies method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Context, listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions cannot be nil") +// GetVPNServerRouteWithContext is an alternate form of the GetVPNServerRoute method which supports a Context parameter +func (vpc *VpcV1) GetVPNServerRouteWithContext(ctx context.Context, getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNServerRouteOptions, "getVPNServerRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions") + err = core.ValidateStruct(getVPNServerRouteOptions, "getVPNServerRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPoliciesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPoliciesOptions.ListenerID, + "vpn_server_id": *getVPNServerRouteOptions.VPNServerID, + "id": *getVPNServerRouteOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenerPoliciesOptions.Headers { + for headerName, headerValue := range getVPNServerRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -21901,7 +22283,7 @@ func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) if err != nil { return } @@ -21911,69 +22293,56 @@ func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Contex return } -// CreateLoadBalancerListenerPolicy : Create a policy for a load balancer listener -// Creates a new policy for a load balancer listener. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyWithContext(context.Background(), createLoadBalancerListenerPolicyOptions) +// ListVPNServerClients : List all VPN clients for a VPN server +// This request retrieves all connected VPN clients, and any disconnected VPN clients that the VPN server has not yet +// deleted based on its auto-deletion policy. +func (vpc *VpcV1) ListVPNServerClients(listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNServerClientsWithContext(context.Background(), listVPNServerClientsOptions) } -// CreateLoadBalancerListenerPolicyWithContext is an alternate form of the CreateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Context, createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions cannot be nil") +// ListVPNServerClientsWithContext is an alternate form of the ListVPNServerClients method which supports a Context parameter +func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNServerClientsOptions, "listVPNServerClientsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(listVPNServerClientsOptions, "listVPNServerClientsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyOptions.ListenerID, + "vpn_server_id": *listVPNServerClientsOptions.VPNServerID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range listVPNServerClientsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerClients") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyOptions.Action != nil { - body["action"] = createLoadBalancerListenerPolicyOptions.Action - } - if createLoadBalancerListenerPolicyOptions.Priority != nil { - body["priority"] = createLoadBalancerListenerPolicyOptions.Priority - } - if createLoadBalancerListenerPolicyOptions.Name != nil { - body["name"] = createLoadBalancerListenerPolicyOptions.Name - } - if createLoadBalancerListenerPolicyOptions.Rules != nil { - body["rules"] = createLoadBalancerListenerPolicyOptions.Rules + if listVPNServerClientsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNServerClientsOptions.Start)) } - if createLoadBalancerListenerPolicyOptions.Target != nil { - body["target"] = createLoadBalancerListenerPolicyOptions.Target + if listVPNServerClientsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNServerClientsOptions.Limit)) } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listVPNServerClientsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVPNServerClientsOptions.Sort)) } request, err := builder.Build() @@ -21987,7 +22356,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClientCollection) if err != nil { return } @@ -21997,95 +22366,106 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } -// DeleteLoadBalancerListenerPolicy : Delete a load balancer listener policy -// Deletes a policy of the load balancer listener. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyWithContext(context.Background(), deleteLoadBalancerListenerPolicyOptions) +// ListVPNServerRoutes : List all VPN routes for a VPN server +// This request lists all VPN routes in a VPN server. All VPN routes are provided to the VPN client when the connection +// is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN route +// matching their specified destinations. All VPN routes must be unique within the VPN server. +func (vpc *VpcV1) ListVPNServerRoutes(listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNServerRoutesWithContext(context.Background(), listVPNServerRoutesOptions) } -// DeleteLoadBalancerListenerPolicyWithContext is an alternate form of the DeleteLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions cannot be nil") +// ListVPNServerRoutesWithContext is an alternate form of the ListVPNServerRoutes method which supports a Context parameter +func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNServerRoutesOptions, "listVPNServerRoutesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(listVPNServerRoutesOptions, "listVPNServerRoutesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyOptions.ListenerID, - "id": *deleteLoadBalancerListenerPolicyOptions.ID, + "vpn_server_id": *listVPNServerRoutesOptions.VPNServerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range listVPNServerRoutesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerRoutes") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPNServerRoutesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNServerRoutesOptions.Start)) + } + if listVPNServerRoutesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNServerRoutesOptions.Limit)) + } + if listVPNServerRoutesOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVPNServerRoutesOptions.Sort)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRouteCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetLoadBalancerListenerPolicy : Retrieve a load balancer listener policy -// Retrieve a single policy specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyWithContext(context.Background(), getLoadBalancerListenerPolicyOptions) +// ListVPNServers : List all VPN servers +// This request lists all VPN servers. +func (vpc *VpcV1) ListVPNServers(listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNServersWithContext(context.Background(), listVPNServersOptions) } -// GetLoadBalancerListenerPolicyWithContext is an alternate form of the GetLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions") +// ListVPNServersWithContext is an alternate form of the ListVPNServers method which supports a Context parameter +func (vpc *VpcV1) ListVPNServersWithContext(ctx context.Context, listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVPNServersOptions, "listVPNServersOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyOptions.ListenerID, - "id": *getLoadBalancerListenerPolicyOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) if err != nil { return } - for headerName, headerValue := range getLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range listVPNServersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -22093,6 +22473,21 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPNServersOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listVPNServersOptions.Name)) + } + if listVPNServersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNServersOptions.Start)) + } + if listVPNServersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNServersOptions.Limit)) + } + if listVPNServersOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNServersOptions.ResourceGroupID)) + } + if listVPNServersOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listVPNServersOptions.Sort)) + } request, err := builder.Build() if err != nil { @@ -22105,7 +22500,7 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerCollection) if err != nil { return } @@ -22115,52 +22510,54 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, return } -// UpdateLoadBalancerListenerPolicy : Update a load balancer listener policy -// Updates a policy from a policy patch. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyWithContext(context.Background(), updateLoadBalancerListenerPolicyOptions) +// UpdateVPNServer : Update a VPN server +// This request updates the properties of an existing VPN server. Any property changes will cause all connected VPN +// clients are disconnected from this VPN server except for the name change. +func (vpc *VpcV1) UpdateVPNServer(updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNServerWithContext(context.Background(), updateVPNServerOptions) } -// UpdateLoadBalancerListenerPolicyWithContext is an alternate form of the UpdateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Context, updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions cannot be nil") +// UpdateVPNServerWithContext is an alternate form of the UpdateVPNServer method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNServerWithContext(ctx context.Context, updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNServerOptions, "updateVPNServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(updateVPNServerOptions, "updateVPNServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyOptions.ListenerID, - "id": *updateLoadBalancerListenerPolicyOptions.ID, + "id": *updateVPNServerOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range updateVPNServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVPNServerOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVPNServerOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyOptions.LoadBalancerListenerPolicyPatch) + _, err = builder.SetBodyContentJSON(updateVPNServerOptions.VPNServerPatch) if err != nil { return } @@ -22176,7 +22573,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) if err != nil { return } @@ -22186,50 +22583,56 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } -// ListLoadBalancerListenerPolicyRules : List all rules of a load balancer listener policy -// This request lists all rules of a load balancer listener policy. -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPolicyRulesWithContext(context.Background(), listLoadBalancerListenerPolicyRulesOptions) +// UpdateVPNServerRoute : Update a VPN route +// This request updates a VPN route with the information in a provided VPN route patch. The VPN route patch object is +// structured in the same way as a retrieved VPN route and contains only the information to be updated. +func (vpc *VpcV1) UpdateVPNServerRoute(updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNServerRouteWithContext(context.Background(), updateVPNServerRouteOptions) } -// ListLoadBalancerListenerPolicyRulesWithContext is an alternate form of the ListLoadBalancerListenerPolicyRules method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Context, listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions cannot be nil") +// UpdateVPNServerRouteWithContext is an alternate form of the UpdateVPNServerRoute method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNServerRouteOptions, "updateVPNServerRouteOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions") + err = core.ValidateStruct(updateVPNServerRouteOptions, "updateVPNServerRouteOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPolicyRulesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPolicyRulesOptions.ListenerID, - "policy_id": *listLoadBalancerListenerPolicyRulesOptions.PolicyID, + "vpn_server_id": *updateVPNServerRouteOptions.VPNServerID, + "id": *updateVPNServerRouteOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenerPolicyRulesOptions.Headers { + for headerName, headerValue := range updateVPNServerRouteOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicyRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServerRoute") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateVPNServerRouteOptions.VPNServerRoutePatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -22241,7 +22644,7 @@ func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Con return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRuleCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) if err != nil { return } @@ -22251,42 +22654,36 @@ func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Con return } -// CreateLoadBalancerListenerPolicyRule : Create a rule for a load balancer listener policy -// Creates a new rule for the load balancer listener policy. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyRuleWithContext(context.Background(), createLoadBalancerListenerPolicyRuleOptions) +// CreateLoadBalancer : Create a load balancer +// This request creates and provisions a new load balancer. +func (vpc *VpcV1) CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerWithContext(context.Background(), createLoadBalancerOptions) } -// CreateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the CreateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions cannot be nil") +// CreateLoadBalancerWithContext is an alternate form of the CreateLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerOptions, "createLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(createLoadBalancerOptions, "createLoadBalancerOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *createLoadBalancerListenerPolicyRuleOptions.PolicyID, - } - builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range createLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -22297,17 +22694,38 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyRuleOptions.Condition != nil { - body["condition"] = createLoadBalancerListenerPolicyRuleOptions.Condition + if createLoadBalancerOptions.IsPublic != nil { + body["is_public"] = createLoadBalancerOptions.IsPublic } - if createLoadBalancerListenerPolicyRuleOptions.Type != nil { - body["type"] = createLoadBalancerListenerPolicyRuleOptions.Type + if createLoadBalancerOptions.Subnets != nil { + body["subnets"] = createLoadBalancerOptions.Subnets } - if createLoadBalancerListenerPolicyRuleOptions.Value != nil { - body["value"] = createLoadBalancerListenerPolicyRuleOptions.Value + if createLoadBalancerOptions.Dns != nil { + body["dns"] = createLoadBalancerOptions.Dns } - if createLoadBalancerListenerPolicyRuleOptions.Field != nil { - body["field"] = createLoadBalancerListenerPolicyRuleOptions.Field + if createLoadBalancerOptions.Listeners != nil { + body["listeners"] = createLoadBalancerOptions.Listeners + } + if createLoadBalancerOptions.Logging != nil { + body["logging"] = createLoadBalancerOptions.Logging + } + if createLoadBalancerOptions.Name != nil { + body["name"] = createLoadBalancerOptions.Name + } + if createLoadBalancerOptions.Pools != nil { + body["pools"] = createLoadBalancerOptions.Pools + } + if createLoadBalancerOptions.Profile != nil { + body["profile"] = createLoadBalancerOptions.Profile + } + if createLoadBalancerOptions.ResourceGroup != nil { + body["resource_group"] = createLoadBalancerOptions.ResourceGroup + } + if createLoadBalancerOptions.RouteMode != nil { + body["route_mode"] = createLoadBalancerOptions.RouteMode + } + if createLoadBalancerOptions.SecurityGroups != nil { + body["security_groups"] = createLoadBalancerOptions.SecurityGroups } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -22325,7 +22743,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -22335,104 +22753,87 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } -// DeleteLoadBalancerListenerPolicyRule : Delete a load balancer listener policy rule -// Deletes a rule from the load balancer listener policy. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyRuleWithContext(context.Background(), deleteLoadBalancerListenerPolicyRuleOptions) +// CreateLoadBalancerListener : Create a listener for a load balancer +// This request creates a new listener for a load balancer. +func (vpc *VpcV1) CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerWithContext(context.Background(), createLoadBalancerListenerOptions) } -// DeleteLoadBalancerListenerPolicyRuleWithContext is an alternate form of the DeleteLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions cannot be nil") +// CreateLoadBalancerListenerWithContext is an alternate form of the CreateLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *deleteLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *deleteLoadBalancerListenerPolicyRuleOptions.ID, + "load_balancer_id": *createLoadBalancerListenerOptions.LoadBalancerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return + body := make(map[string]interface{}) + if createLoadBalancerListenerOptions.Protocol != nil { + body["protocol"] = createLoadBalancerListenerOptions.Protocol } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetLoadBalancerListenerPolicyRule : Retrieve a load balancer listener policy rule -// Retrieves a single rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyRuleWithContext(context.Background(), getLoadBalancerListenerPolicyRuleOptions) -} - -// GetLoadBalancerListenerPolicyRuleWithContext is an alternate form of the GetLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions cannot be nil") - if err != nil { - return + if createLoadBalancerListenerOptions.AcceptProxyProtocol != nil { + body["accept_proxy_protocol"] = createLoadBalancerListenerOptions.AcceptProxyProtocol } - err = core.ValidateStruct(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions") - if err != nil { - return + if createLoadBalancerListenerOptions.CertificateInstance != nil { + body["certificate_instance"] = createLoadBalancerListenerOptions.CertificateInstance } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *getLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *getLoadBalancerListenerPolicyRuleOptions.ID, + if createLoadBalancerListenerOptions.ConnectionLimit != nil { + body["connection_limit"] = createLoadBalancerListenerOptions.ConnectionLimit } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) - if err != nil { - return + if createLoadBalancerListenerOptions.DefaultPool != nil { + body["default_pool"] = createLoadBalancerListenerOptions.DefaultPool } - - for headerName, headerValue := range getLoadBalancerListenerPolicyRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) + if createLoadBalancerListenerOptions.HTTPSRedirect != nil { + body["https_redirect"] = createLoadBalancerListenerOptions.HTTPSRedirect } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicyRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) + if createLoadBalancerListenerOptions.IdleConnectionTimeout != nil { + body["idle_connection_timeout"] = createLoadBalancerListenerOptions.IdleConnectionTimeout + } + if createLoadBalancerListenerOptions.Policies != nil { + body["policies"] = createLoadBalancerListenerOptions.Policies + } + if createLoadBalancerListenerOptions.Port != nil { + body["port"] = createLoadBalancerListenerOptions.Port + } + if createLoadBalancerListenerOptions.PortMax != nil { + body["port_max"] = createLoadBalancerListenerOptions.PortMax + } + if createLoadBalancerListenerOptions.PortMin != nil { + body["port_min"] = createLoadBalancerListenerOptions.PortMin + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) request, err := builder.Build() if err != nil { @@ -22445,7 +22846,7 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Conte return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -22455,53 +22856,67 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Conte return } -// UpdateLoadBalancerListenerPolicyRule : Update a load balancer listener policy rule -// Updates a rule of the load balancer listener policy. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyRuleWithContext(context.Background(), updateLoadBalancerListenerPolicyRuleOptions) +// CreateLoadBalancerListenerPolicy : Create a policy for a load balancer listener +// Creates a new policy for a load balancer listener. +func (vpc *VpcV1) CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerPolicyWithContext(context.Background(), createLoadBalancerListenerPolicyOptions) } -// UpdateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the UpdateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions cannot be nil") +// CreateLoadBalancerListenerPolicyWithContext is an alternate form of the CreateLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Context, createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *updateLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *updateLoadBalancerListenerPolicyRuleOptions.ID, + "load_balancer_id": *createLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *createLoadBalancerListenerPolicyOptions.ListenerID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerListenerPolicyRulePatch) + body := make(map[string]interface{}) + if createLoadBalancerListenerPolicyOptions.Action != nil { + body["action"] = createLoadBalancerListenerPolicyOptions.Action + } + if createLoadBalancerListenerPolicyOptions.Priority != nil { + body["priority"] = createLoadBalancerListenerPolicyOptions.Priority + } + if createLoadBalancerListenerPolicyOptions.Name != nil { + body["name"] = createLoadBalancerListenerPolicyOptions.Name + } + if createLoadBalancerListenerPolicyOptions.Rules != nil { + body["rules"] = createLoadBalancerListenerPolicyOptions.Rules + } + if createLoadBalancerListenerPolicyOptions.Target != nil { + body["target"] = createLoadBalancerListenerPolicyOptions.Target + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -22517,7 +22932,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -22527,48 +22942,69 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } -// ListLoadBalancerPools : List all pools of a load balancer -// This request lists all pools of a load balancer. -func (vpc *VpcV1) ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolsWithContext(context.Background(), listLoadBalancerPoolsOptions) +// CreateLoadBalancerListenerPolicyRule : Create a rule for a load balancer listener policy +// Creates a new rule for the load balancer listener policy. +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerPolicyRuleWithContext(context.Background(), createLoadBalancerListenerPolicyRuleOptions) } -// ListLoadBalancerPoolsWithContext is an alternate form of the ListLoadBalancerPools method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions cannot be nil") +// CreateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the CreateLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions") + err = core.ValidateStruct(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolsOptions.LoadBalancerID, + "load_balancer_id": *createLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *createLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *createLoadBalancerListenerPolicyRuleOptions.PolicyID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerPoolsOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerPolicyRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPools") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicyRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createLoadBalancerListenerPolicyRuleOptions.Condition != nil { + body["condition"] = createLoadBalancerListenerPolicyRuleOptions.Condition + } + if createLoadBalancerListenerPolicyRuleOptions.Type != nil { + body["type"] = createLoadBalancerListenerPolicyRuleOptions.Type + } + if createLoadBalancerListenerPolicyRuleOptions.Value != nil { + body["value"] = createLoadBalancerListenerPolicyRuleOptions.Value + } + if createLoadBalancerListenerPolicyRuleOptions.Field != nil { + body["field"] = createLoadBalancerListenerPolicyRuleOptions.Field + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -22580,7 +23016,7 @@ func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoad return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) if err != nil { return } @@ -22681,98 +23117,127 @@ func (vpc *VpcV1) CreateLoadBalancerPoolWithContext(ctx context.Context, createL return } -// DeleteLoadBalancerPool : Delete a load balancer pool -// This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the -// default pool for any listener in the load balancer. -func (vpc *VpcV1) DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerPoolWithContext(context.Background(), deleteLoadBalancerPoolOptions) +// CreateLoadBalancerPoolMember : Create a member in a load balancer pool +// This request creates a new member and adds the member to the pool. +func (vpc *VpcV1) CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerPoolMemberWithContext(context.Background(), createLoadBalancerPoolMemberOptions) } -// DeleteLoadBalancerPoolWithContext is an alternate form of the DeleteLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions cannot be nil") +// CreateLoadBalancerPoolMemberWithContext is an alternate form of the CreateLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions") + err = core.ValidateStruct(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerPoolOptions.LoadBalancerID, - "id": *deleteLoadBalancerPoolOptions.ID, + "load_balancer_id": *createLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *createLoadBalancerPoolMemberOptions.PoolID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range createLoadBalancerPoolMemberOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPoolMember") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createLoadBalancerPoolMemberOptions.Port != nil { + body["port"] = createLoadBalancerPoolMemberOptions.Port + } + if createLoadBalancerPoolMemberOptions.Target != nil { + body["target"] = createLoadBalancerPoolMemberOptions.Target + } + if createLoadBalancerPoolMemberOptions.Weight != nil { + body["weight"] = createLoadBalancerPoolMemberOptions.Weight + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } return } -// GetLoadBalancerPool : Retrieve a load balancer pool -// This request retrieves a single pool specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolWithContext(context.Background(), getLoadBalancerPoolOptions) +// DeleteLoadBalancer : Delete a load balancer +// This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its +// `provisioning_status` is `delete_pending` or it is referenced by a resource. +func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) } -// GetLoadBalancerPoolWithContext is an alternate form of the GetLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions cannot be nil") +// DeleteLoadBalancerWithContext is an alternate form of the DeleteLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerOptions, "deleteLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions") + err = core.ValidateStruct(deleteLoadBalancerOptions, "deleteLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolOptions.LoadBalancerID, - "id": *getLoadBalancerPoolOptions.ID, + "id": *deleteLoadBalancerOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") + if deleteLoadBalancerOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteLoadBalancerOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -22782,131 +23247,103 @@ func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBal return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateLoadBalancerPool : Update a load balancer pool -// This request updates a load balancer pool from a pool patch. -func (vpc *VpcV1) UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolWithContext(context.Background(), updateLoadBalancerPoolOptions) +// DeleteLoadBalancerListener : Delete a load balancer listener +// This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, the +// listener must not be the target of another load balancer listener. +func (vpc *VpcV1) DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerWithContext(context.Background(), deleteLoadBalancerListenerOptions) } -// UpdateLoadBalancerPoolWithContext is an alternate form of the UpdateLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions cannot be nil") +// DeleteLoadBalancerListenerWithContext is an alternate form of the DeleteLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolOptions.LoadBalancerID, - "id": *updateLoadBalancerPoolOptions.ID, + "load_balancer_id": *deleteLoadBalancerListenerOptions.LoadBalancerID, + "id": *deleteLoadBalancerListenerOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolOptions.LoadBalancerPoolPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListLoadBalancerPoolMembers : List all members of a load balancer pool -// This request lists all members of a load balancer pool. -func (vpc *VpcV1) ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolMembersWithContext(context.Background(), listLoadBalancerPoolMembersOptions) +// DeleteLoadBalancerListenerPolicy : Delete a load balancer listener policy +// Deletes a policy of the load balancer listener. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerPolicyWithContext(context.Background(), deleteLoadBalancerListenerPolicyOptions) } -// ListLoadBalancerPoolMembersWithContext is an alternate form of the ListLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions cannot be nil") +// DeleteLoadBalancerListenerPolicyWithContext is an alternate form of the DeleteLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *listLoadBalancerPoolMembersOptions.PoolID, + "load_balancer_id": *deleteLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *deleteLoadBalancerListenerPolicyOptions.ListenerID, + "id": *deleteLoadBalancerListenerPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerPoolMembersOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPoolMembers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -22916,173 +23353,114 @@ func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, li return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateLoadBalancerPoolMember : Create a member in a load balancer pool -// This request creates a new member and adds the member to the pool. -func (vpc *VpcV1) CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerPoolMemberWithContext(context.Background(), createLoadBalancerPoolMemberOptions) +// DeleteLoadBalancerListenerPolicyRule : Delete a load balancer listener policy rule +// Deletes a rule from the load balancer listener policy. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerPolicyRuleWithContext(context.Background(), deleteLoadBalancerListenerPolicyRuleOptions) } -// CreateLoadBalancerPoolMemberWithContext is an alternate form of the CreateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions cannot be nil") +// DeleteLoadBalancerListenerPolicyRuleWithContext is an alternate form of the DeleteLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *createLoadBalancerPoolMemberOptions.PoolID, + "load_balancer_id": *deleteLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *deleteLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *deleteLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *deleteLoadBalancerListenerPolicyRuleOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerPolicyRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicyRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerPoolMemberOptions.Port != nil { - body["port"] = createLoadBalancerPoolMemberOptions.Port - } - if createLoadBalancerPoolMemberOptions.Target != nil { - body["target"] = createLoadBalancerPoolMemberOptions.Target - } - if createLoadBalancerPoolMemberOptions.Weight != nil { - body["weight"] = createLoadBalancerPoolMemberOptions.Weight - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return + request, err := builder.Build() + if err != nil { + return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ReplaceLoadBalancerPoolMembers : Replace load balancer pool members -// This request replaces the existing members of the load balancer pool with new members created from the collection of -// member prototype objects. -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ReplaceLoadBalancerPoolMembersWithContext(context.Background(), replaceLoadBalancerPoolMembersOptions) +// DeleteLoadBalancerPool : Delete a load balancer pool +// This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the +// default pool for any listener in the load balancer. +func (vpc *VpcV1) DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerPoolWithContext(context.Background(), deleteLoadBalancerPoolOptions) } -// ReplaceLoadBalancerPoolMembersWithContext is an alternate form of the ReplaceLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions cannot be nil") +// DeleteLoadBalancerPoolWithContext is an alternate form of the DeleteLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions") + err = core.ValidateStruct(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *replaceLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *replaceLoadBalancerPoolMembersOptions.PoolID, + "load_balancer_id": *deleteLoadBalancerPoolOptions.LoadBalancerID, + "id": *deleteLoadBalancerPoolOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range replaceLoadBalancerPoolMembersOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerPoolOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceLoadBalancerPoolMembers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPool") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if replaceLoadBalancerPoolMembersOptions.Members != nil { - body["members"] = replaceLoadBalancerPoolMembersOptions.Members - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } @@ -23140,42 +23518,40 @@ func (vpc *VpcV1) DeleteLoadBalancerPoolMemberWithContext(ctx context.Context, d return } -// GetLoadBalancerPoolMember : Retrieve a load balancer pool member -// This request retrieves a single member specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolMemberWithContext(context.Background(), getLoadBalancerPoolMemberOptions) +// GetLoadBalancer : Retrieve a load balancer +// This request retrieves a single load balancer specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerWithContext(context.Background(), getLoadBalancerOptions) } -// GetLoadBalancerPoolMemberWithContext is an alternate form of the GetLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions cannot be nil") +// GetLoadBalancerWithContext is an alternate form of the GetLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerOptions, "getLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(getLoadBalancerOptions, "getLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *getLoadBalancerPoolMemberOptions.PoolID, - "id": *getLoadBalancerPoolMemberOptions.ID, + "id": *getLoadBalancerOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range getLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23195,7 +23571,7 @@ func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -23205,56 +23581,49 @@ func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getL return } -// UpdateLoadBalancerPoolMember : Update a load balancer pool member -// This request updates an existing member from a member patch. -func (vpc *VpcV1) UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolMemberWithContext(context.Background(), updateLoadBalancerPoolMemberOptions) +// GetLoadBalancerListener : Retrieve a load balancer listener +// This request retrieves a single listener specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerWithContext(context.Background(), getLoadBalancerListenerOptions) } -// UpdateLoadBalancerPoolMemberWithContext is an alternate form of the UpdateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions cannot be nil") +// GetLoadBalancerListenerWithContext is an alternate form of the GetLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *updateLoadBalancerPoolMemberOptions.PoolID, - "id": *updateLoadBalancerPoolMemberOptions.ID, + "load_balancer_id": *getLoadBalancerListenerOptions.LoadBalancerID, + "id": *getLoadBalancerListenerOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range getLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolMemberOptions.LoadBalancerPoolMemberPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -23266,7 +23635,7 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, u return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -23276,33 +23645,42 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, u return } -// ListEndpointGateways : List all endpoint gateways -// This request lists all endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to -// a target outside the VPC. -func (vpc *VpcV1) ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewaysWithContext(context.Background(), listEndpointGatewaysOptions) +// GetLoadBalancerListenerPolicy : Retrieve a load balancer listener policy +// Retrieve a single policy specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerPolicyWithContext(context.Background(), getLoadBalancerListenerPolicyOptions) } -// ListEndpointGatewaysWithContext is an alternate form of the ListEndpointGateways method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listEndpointGatewaysOptions, "listEndpointGatewaysOptions") +// GetLoadBalancerListenerPolicyWithContext is an alternate form of the GetLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *getLoadBalancerListenerPolicyOptions.ListenerID, + "id": *getLoadBalancerListenerPolicyOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listEndpointGatewaysOptions.Headers { + for headerName, headerValue := range getLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23310,30 +23688,6 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewaysOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) - } - if listEndpointGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewaysOptions.Start)) - } - if listEndpointGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewaysOptions.Limit)) - } - if listEndpointGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listEndpointGatewaysOptions.ResourceGroupID)) - } - if listEndpointGatewaysOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listEndpointGatewaysOptions.VPCID)) - } - if listEndpointGatewaysOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listEndpointGatewaysOptions.VPCCRN)) - } - if listEndpointGatewaysOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listEndpointGatewaysOptions.VPCName)) - } - if listEndpointGatewaysOptions.AllowDnsResolutionBinding != nil { - builder.AddQuery("allow_dns_resolution_binding", fmt.Sprint(*listEndpointGatewaysOptions.AllowDnsResolutionBinding)) - } request, err := builder.Build() if err != nil { @@ -23346,7 +23700,7 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -23356,73 +23710,51 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo return } -// CreateEndpointGateway : Create an endpoint gateway -// This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target -// outside the VPC. -func (vpc *VpcV1) CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.CreateEndpointGatewayWithContext(context.Background(), createEndpointGatewayOptions) +// GetLoadBalancerListenerPolicyRule : Retrieve a load balancer listener policy rule +// Retrieves a single rule specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerPolicyRuleWithContext(context.Background(), getLoadBalancerListenerPolicyRuleOptions) } -// CreateEndpointGatewayWithContext is an alternate form of the CreateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createEndpointGatewayOptions, "createEndpointGatewayOptions cannot be nil") +// GetLoadBalancerListenerPolicyRuleWithContext is an alternate form of the GetLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createEndpointGatewayOptions, "createEndpointGatewayOptions") + err = core.ValidateStruct(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *getLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *getLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *getLoadBalancerListenerPolicyRuleOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createEndpointGatewayOptions.Headers { + for headerName, headerValue := range getLoadBalancerListenerPolicyRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicyRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createEndpointGatewayOptions.Target != nil { - body["target"] = createEndpointGatewayOptions.Target - } - if createEndpointGatewayOptions.VPC != nil { - body["vpc"] = createEndpointGatewayOptions.VPC - } - if createEndpointGatewayOptions.AllowDnsResolutionBinding != nil { - body["allow_dns_resolution_binding"] = createEndpointGatewayOptions.AllowDnsResolutionBinding - } - if createEndpointGatewayOptions.Ips != nil { - body["ips"] = createEndpointGatewayOptions.Ips - } - if createEndpointGatewayOptions.Name != nil { - body["name"] = createEndpointGatewayOptions.Name - } - if createEndpointGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createEndpointGatewayOptions.ResourceGroup - } - if createEndpointGatewayOptions.SecurityGroups != nil { - body["security_groups"] = createEndpointGatewayOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -23434,7 +23766,7 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) if err != nil { return } @@ -23444,40 +23776,41 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn return } -// ListEndpointGatewayIps : List all reserved IPs bound to an endpoint gateway -// This request lists all reserved IPs bound to an endpoint gateway. -func (vpc *VpcV1) ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewayIpsWithContext(context.Background(), listEndpointGatewayIpsOptions) +// GetLoadBalancerPool : Retrieve a load balancer pool +// This request retrieves a single pool specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerPoolWithContext(context.Background(), getLoadBalancerPoolOptions) } -// ListEndpointGatewayIpsWithContext is an alternate form of the ListEndpointGatewayIps method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions cannot be nil") +// GetLoadBalancerPoolWithContext is an alternate form of the GetLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions") + err = core.ValidateStruct(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *listEndpointGatewayIpsOptions.EndpointGatewayID, + "load_balancer_id": *getLoadBalancerPoolOptions.LoadBalancerID, + "id": *getLoadBalancerPoolOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listEndpointGatewayIpsOptions.Headers { + for headerName, headerValue := range getLoadBalancerPoolOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPool") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23485,15 +23818,6 @@ func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEnd builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewayIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayIpsOptions.Start)) - } - if listEndpointGatewayIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayIpsOptions.Limit)) - } - if listEndpointGatewayIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listEndpointGatewayIpsOptions.Sort)) - } request, err := builder.Build() if err != nil { @@ -23506,7 +23830,7 @@ func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEnd return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionEndpointGatewayContext) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) if err != nil { return } @@ -23516,45 +23840,46 @@ func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEnd return } -// RemoveEndpointGatewayIP : Unbind a reserved IP from an endpoint gateway -// This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has -// `auto_delete` set to `true`, the reserved IP will be deleted. -func (vpc *VpcV1) RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveEndpointGatewayIPWithContext(context.Background(), removeEndpointGatewayIPOptions) +// GetLoadBalancerPoolMember : Retrieve a load balancer pool member +// This request retrieves a single member specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerPoolMemberWithContext(context.Background(), getLoadBalancerPoolMemberOptions) } -// RemoveEndpointGatewayIPWithContext is an alternate form of the RemoveEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions cannot be nil") +// GetLoadBalancerPoolMemberWithContext is an alternate form of the GetLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions") + err = core.ValidateStruct(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *removeEndpointGatewayIPOptions.EndpointGatewayID, - "id": *removeEndpointGatewayIPOptions.ID, + "load_balancer_id": *getLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *getLoadBalancerPoolMemberOptions.PoolID, + "id": *getLoadBalancerPoolMemberOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range getLoadBalancerPoolMemberOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPoolMember") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -23564,46 +23889,56 @@ func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, remove return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } return } -// GetEndpointGatewayIP : Retrieve a reserved IP bound to an endpoint gateway -// This request retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the URL. -func (vpc *VpcV1) GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayIPWithContext(context.Background(), getEndpointGatewayIPOptions) +// GetLoadBalancerProfile : Retrieve a load balancer profile +// This request retrieves a load balancer profile specified by the name in the URL. +func (vpc *VpcV1) GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerProfileWithContext(context.Background(), getLoadBalancerProfileOptions) } -// GetEndpointGatewayIPWithContext is an alternate form of the GetEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions cannot be nil") +// GetLoadBalancerProfileWithContext is an alternate form of the GetLoadBalancerProfile method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions") + err = core.ValidateStruct(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *getEndpointGatewayIPOptions.EndpointGatewayID, - "id": *getEndpointGatewayIPOptions.ID, + "name": *getLoadBalancerProfileOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range getLoadBalancerProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23623,7 +23958,7 @@ func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpoi return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfile) if err != nil { return } @@ -23633,44 +23968,40 @@ func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpoi return } -// AddEndpointGatewayIP : Bind a reserved IP to an endpoint gateway -// This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: -// -// - must currently be unbound -// - must not be in the same zone as any other reserved IP bound to the endpoint gateway. -func (vpc *VpcV1) AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.AddEndpointGatewayIPWithContext(context.Background(), addEndpointGatewayIPOptions) +// GetLoadBalancerStatistics : List all statistics of a load balancer +// This request lists statistics of a load balancer. +func (vpc *VpcV1) GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerStatisticsWithContext(context.Background(), getLoadBalancerStatisticsOptions) } -// AddEndpointGatewayIPWithContext is an alternate form of the AddEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions cannot be nil") +// GetLoadBalancerStatisticsWithContext is an alternate form of the GetLoadBalancerStatistics method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions") + err = core.ValidateStruct(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *addEndpointGatewayIPOptions.EndpointGatewayID, - "id": *addEndpointGatewayIPOptions.ID, + "id": *getLoadBalancerStatisticsOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}/statistics`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range getLoadBalancerStatisticsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerStatistics") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23690,7 +24021,7 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerStatistics) if err != nil { return } @@ -23700,46 +24031,45 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } -// DeleteEndpointGateway : Delete an endpoint gateway -// This request deletes an endpoint gateway. This operation cannot be reversed. -// -// Reserved IPs that were bound to the endpoint gateway will be released if their -// `auto_delete` property is set to true. -func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) +// ListLoadBalancerListenerPolicies : List all policies for a load balancer listener +// This request lists all policies for a load balancer listener. +func (vpc *VpcV1) ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenerPoliciesWithContext(context.Background(), listLoadBalancerListenerPoliciesOptions) } -// DeleteEndpointGatewayWithContext is an alternate form of the DeleteEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions cannot be nil") +// ListLoadBalancerListenerPoliciesWithContext is an alternate form of the ListLoadBalancerListenerPolicies method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Context, listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions") + err = core.ValidateStruct(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteEndpointGatewayOptions.ID, + "load_balancer_id": *listLoadBalancerListenerPoliciesOptions.LoadBalancerID, + "listener_id": *listLoadBalancerListenerPoliciesOptions.ListenerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteEndpointGatewayOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenerPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -23749,45 +24079,58 @@ func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEn return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetEndpointGateway : Retrieve an endpoint gateway -// This request retrieves a single endpoint gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayWithContext(context.Background(), getEndpointGatewayOptions) +// ListLoadBalancerListenerPolicyRules : List all rules of a load balancer listener policy +// This request lists all rules of a load balancer listener policy. +func (vpc *VpcV1) ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenerPolicyRulesWithContext(context.Background(), listLoadBalancerListenerPolicyRulesOptions) } -// GetEndpointGatewayWithContext is an alternate form of the GetEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayOptions, "getEndpointGatewayOptions cannot be nil") +// ListLoadBalancerListenerPolicyRulesWithContext is an alternate form of the ListLoadBalancerListenerPolicyRules method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Context, listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getEndpointGatewayOptions, "getEndpointGatewayOptions") + err = core.ValidateStruct(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getEndpointGatewayOptions.ID, + "load_balancer_id": *listLoadBalancerListenerPolicyRulesOptions.LoadBalancerID, + "listener_id": *listLoadBalancerListenerPolicyRulesOptions.ListenerID, + "policy_id": *listLoadBalancerListenerPolicyRulesOptions.PolicyID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getEndpointGatewayOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenerPolicyRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicyRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23807,7 +24150,7 @@ func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpoint return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRuleCollection) if err != nil { return } @@ -23817,54 +24160,48 @@ func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpoint return } -// UpdateEndpointGateway : Update an endpoint gateway -// This request updates an endpoint gateway's name. -func (vpc *VpcV1) UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.UpdateEndpointGatewayWithContext(context.Background(), updateEndpointGatewayOptions) +// ListLoadBalancerListeners : List all listeners for a load balancer +// This request lists all listeners for a load balancer. +func (vpc *VpcV1) ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenersWithContext(context.Background(), listLoadBalancerListenersOptions) } -// UpdateEndpointGatewayWithContext is an alternate form of the UpdateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateEndpointGatewayOptions, "updateEndpointGatewayOptions cannot be nil") +// ListLoadBalancerListenersWithContext is an alternate form of the ListLoadBalancerListeners method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateEndpointGatewayOptions, "updateEndpointGatewayOptions") + err = core.ValidateStruct(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateEndpointGatewayOptions.ID, + "load_balancer_id": *listLoadBalancerListenersOptions.LoadBalancerID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateEndpointGatewayOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListeners") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateEndpointGatewayOptions.EndpointGatewayPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -23876,7 +24213,7 @@ func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEn return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerCollection) if err != nil { return } @@ -23886,33 +24223,41 @@ func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEn return } -// ListFlowLogCollectors : List all flow log collectors -// This request lists all flow log collectors in the region. A flow log collector summarizes data sent over the instance -// network interfaces contained within its target. -func (vpc *VpcV1) ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - return vpc.ListFlowLogCollectorsWithContext(context.Background(), listFlowLogCollectorsOptions) +// ListLoadBalancerPoolMembers : List all members of a load balancer pool +// This request lists all members of a load balancer pool. +func (vpc *VpcV1) ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerPoolMembersWithContext(context.Background(), listLoadBalancerPoolMembersOptions) } -// ListFlowLogCollectorsWithContext is an alternate form of the ListFlowLogCollectors method which supports a Context parameter -func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFlowLogCollectorsOptions, "listFlowLogCollectorsOptions") +// ListLoadBalancerPoolMembersWithContext is an alternate form of the ListLoadBalancerPoolMembers method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "load_balancer_id": *listLoadBalancerPoolMembersOptions.LoadBalancerID, + "pool_id": *listLoadBalancerPoolMembersOptions.PoolID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listFlowLogCollectorsOptions.Headers { + for headerName, headerValue := range listLoadBalancerPoolMembersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFlowLogCollectors") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPoolMembers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -23920,33 +24265,69 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFlowLogCollectorsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFlowLogCollectorsOptions.Start)) + + request, err := builder.Build() + if err != nil { + return } - if listFlowLogCollectorsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFlowLogCollectorsOptions.Limit)) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return } - if listFlowLogCollectorsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFlowLogCollectorsOptions.ResourceGroupID)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + if err != nil { + return + } + response.Result = result } - if listFlowLogCollectorsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listFlowLogCollectorsOptions.Name)) + + return +} + +// ListLoadBalancerPools : List all pools of a load balancer +// This request lists all pools of a load balancer. +func (vpc *VpcV1) ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerPoolsWithContext(context.Background(), listLoadBalancerPoolsOptions) +} + +// ListLoadBalancerPoolsWithContext is an alternate form of the ListLoadBalancerPools method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions cannot be nil") + if err != nil { + return } - if listFlowLogCollectorsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listFlowLogCollectorsOptions.VPCID)) + err = core.ValidateStruct(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions") + if err != nil { + return } - if listFlowLogCollectorsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listFlowLogCollectorsOptions.VPCCRN)) + + pathParamsMap := map[string]string{ + "load_balancer_id": *listLoadBalancerPoolsOptions.LoadBalancerID, } - if listFlowLogCollectorsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listFlowLogCollectorsOptions.VPCName)) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) + if err != nil { + return } - if listFlowLogCollectorsOptions.TargetID != nil { - builder.AddQuery("target.id", fmt.Sprint(*listFlowLogCollectorsOptions.TargetID)) + + for headerName, headerValue := range listLoadBalancerPoolsOptions.Headers { + builder.AddHeader(headerName, headerValue) } - if listFlowLogCollectorsOptions.TargetResourceType != nil { - builder.AddQuery("target.resource_type", fmt.Sprint(*listFlowLogCollectorsOptions.TargetResourceType)) + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPools") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) request, err := builder.Build() if err != nil { @@ -23959,7 +24340,7 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollectorCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolCollection) if err != nil { return } @@ -23969,68 +24350,108 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow return } -// CreateFlowLogCollector : Create a flow log collector -// This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype -// object is structured in the same way as a retrieved flow log collector, and contains the information necessary to -// create and start the new flow log collector. -func (vpc *VpcV1) CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.CreateFlowLogCollectorWithContext(context.Background(), createFlowLogCollectorOptions) +// ListLoadBalancerProfiles : List all load balancer profiles +// This request lists all load balancer profiles available in the region. A load balancer profile specifies the +// performance characteristics and pricing model for a load balancer. +func (vpc *VpcV1) ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerProfilesWithContext(context.Background(), listLoadBalancerProfilesOptions) } -// CreateFlowLogCollectorWithContext is an alternate form of the CreateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFlowLogCollectorOptions, "createFlowLogCollectorOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createFlowLogCollectorOptions, "createFlowLogCollectorOptions") +// ListLoadBalancerProfilesWithContext is an alternate form of the ListLoadBalancerProfiles method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listLoadBalancerProfilesOptions, "listLoadBalancerProfilesOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles`, nil) if err != nil { return } - for headerName, headerValue := range createFlowLogCollectorOptions.Headers { + for headerName, headerValue := range listLoadBalancerProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createFlowLogCollectorOptions.StorageBucket != nil { - body["storage_bucket"] = createFlowLogCollectorOptions.StorageBucket + if listLoadBalancerProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listLoadBalancerProfilesOptions.Start)) } - if createFlowLogCollectorOptions.Target != nil { - body["target"] = createFlowLogCollectorOptions.Target + if listLoadBalancerProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listLoadBalancerProfilesOptions.Limit)) } - if createFlowLogCollectorOptions.Active != nil { - body["active"] = createFlowLogCollectorOptions.Active + + request, err := builder.Build() + if err != nil { + return } - if createFlowLogCollectorOptions.Name != nil { - body["name"] = createFlowLogCollectorOptions.Name + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return } - if createFlowLogCollectorOptions.ResourceGroup != nil { - body["resource_group"] = createFlowLogCollectorOptions.ResourceGroup + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfileCollection) + if err != nil { + return + } + response.Result = result } - _, err = builder.SetBodyContentJSON(body) + + return +} + +// ListLoadBalancers : List all load balancers +// This request lists all load balancers in the region. +func (vpc *VpcV1) ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancersWithContext(context.Background(), listLoadBalancersOptions) +} + +// ListLoadBalancersWithContext is an alternate form of the ListLoadBalancers method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listLoadBalancersOptions, "listLoadBalancersOptions") if err != nil { return } + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listLoadBalancersOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancers") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listLoadBalancersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listLoadBalancersOptions.Start)) + } + if listLoadBalancersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listLoadBalancersOptions.Limit)) + } + request, err := builder.Build() if err != nil { return @@ -24042,7 +24463,7 @@ func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createF return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerCollection) if err != nil { return } @@ -24052,101 +24473,134 @@ func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createF return } -// DeleteFlowLogCollector : Delete a flow log collector -// This request stops and deletes a flow log collector. This operation cannot be reversed. -// -// Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. -func (vpc *VpcV1) DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFlowLogCollectorWithContext(context.Background(), deleteFlowLogCollectorOptions) +// ReplaceLoadBalancerPoolMembers : Replace load balancer pool members +// This request replaces the existing members of the load balancer pool with new members created from the collection of +// member prototype objects. +func (vpc *VpcV1) ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + return vpc.ReplaceLoadBalancerPoolMembersWithContext(context.Background(), replaceLoadBalancerPoolMembersOptions) } -// DeleteFlowLogCollectorWithContext is an alternate form of the DeleteFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions cannot be nil") +// ReplaceLoadBalancerPoolMembersWithContext is an alternate form of the ReplaceLoadBalancerPoolMembers method which supports a Context parameter +func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions") + err = core.ValidateStruct(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteFlowLogCollectorOptions.ID, + "load_balancer_id": *replaceLoadBalancerPoolMembersOptions.LoadBalancerID, + "pool_id": *replaceLoadBalancerPoolMembersOptions.PoolID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteFlowLogCollectorOptions.Headers { + for headerName, headerValue := range replaceLoadBalancerPoolMembersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceLoadBalancerPoolMembers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if replaceLoadBalancerPoolMembersOptions.Members != nil { + body["members"] = replaceLoadBalancerPoolMembersOptions.Members + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetFlowLogCollector : Retrieve a flow log collector -// This request retrieves a single flow log collector specified by the identifier in the URL. -func (vpc *VpcV1) GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.GetFlowLogCollectorWithContext(context.Background(), getFlowLogCollectorOptions) +// UpdateLoadBalancer : Update a load balancer +// This request updates a load balancer with the information in a provided load balancer patch. The load balancer patch +// object is structured in the same way as a retrieved load balancer and contains only the information to be updated. A +// load balancer can only be updated if its `provisioning_status` is `active`. +func (vpc *VpcV1) UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerWithContext(context.Background(), updateLoadBalancerOptions) } -// GetFlowLogCollectorWithContext is an alternate form of the GetFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFlowLogCollectorOptions, "getFlowLogCollectorOptions cannot be nil") +// UpdateLoadBalancerWithContext is an alternate form of the UpdateLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerOptions, "updateLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getFlowLogCollectorOptions, "getFlowLogCollectorOptions") + err = core.ValidateStruct(updateLoadBalancerOptions, "updateLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getFlowLogCollectorOptions.ID, + "id": *updateLoadBalancerOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getFlowLogCollectorOptions.Headers { + for headerName, headerValue := range updateLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateLoadBalancerOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateLoadBalancerOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateLoadBalancerOptions.LoadBalancerPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -24158,7 +24612,7 @@ func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLog return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -24168,42 +24622,41 @@ func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLog return } -// UpdateFlowLogCollector : Update a flow log collector -// This request updates a flow log collector with the information in a provided flow log collector patch. The flow log -// collector patch object is structured in the same way as a retrieved flow log collector and contains only the -// information to be updated. -func (vpc *VpcV1) UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.UpdateFlowLogCollectorWithContext(context.Background(), updateFlowLogCollectorOptions) +// UpdateLoadBalancerListener : Update a load balancer listener +// This request updates a load balancer listener from a listener patch. +func (vpc *VpcV1) UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerWithContext(context.Background(), updateLoadBalancerListenerOptions) } -// UpdateFlowLogCollectorWithContext is an alternate form of the UpdateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions cannot be nil") +// UpdateLoadBalancerListenerWithContext is an alternate form of the UpdateLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions") + err = core.ValidateStruct(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateFlowLogCollectorOptions.ID, + "load_balancer_id": *updateLoadBalancerListenerOptions.LoadBalancerID, + "id": *updateLoadBalancerListenerOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateFlowLogCollectorOptions.Headers { + for headerName, headerValue := range updateLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -24213,7 +24666,7 @@ func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateF builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateFlowLogCollectorOptions.FlowLogCollectorPatch) + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerOptions.LoadBalancerListenerPatch) if err != nil { return } @@ -24229,7 +24682,7 @@ func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateF return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -24239,1326 +24692,1275 @@ func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateF return } -// AccountReference : AccountReference struct -type AccountReference struct { - // The unique identifier for this account. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// UpdateLoadBalancerListenerPolicy : Update a load balancer listener policy +// Updates a policy from a policy patch. +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerPolicyWithContext(context.Background(), updateLoadBalancerListenerPolicyOptions) } -// Constants associated with the AccountReference.ResourceType property. -// The resource type. -const ( - AccountReferenceResourceTypeAccountConst = "account" -) - -// UnmarshalAccountReference unmarshals an instance of AccountReference from the specified map of raw messages. -func UnmarshalAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UpdateLoadBalancerListenerPolicyWithContext is an alternate form of the UpdateLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Context, updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.ValidateStruct(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ActivateReservationOptions : The ActivateReservation options. -type ActivateReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} -// NewActivateReservationOptions : Instantiate ActivateReservationOptions -func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { - return &ActivateReservationOptions{ - ID: core.StringPtr(id), + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *updateLoadBalancerListenerPolicyOptions.ListenerID, + "id": *updateLoadBalancerListenerPolicyOptions.ID, } -} -// SetID : Allow user to set ID -func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { - options.Headers = param - return options -} + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + if err != nil { + return + } -// AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. -type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + for headerName, headerValue := range updateLoadBalancerListenerPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyOptions.LoadBalancerListenerPolicyPatch) + if err != nil { + return + } -// NewAddBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate AddBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - return &AddBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), + request, err := builder.Build() + if err != nil { + return } -} -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + if err != nil { + return + } + response.Result = result + } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options + return } -// SetID : Allow user to set ID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options +// UpdateLoadBalancerListenerPolicyRule : Update a load balancer listener policy rule +// Updates a rule of the load balancer listener policy. +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerPolicyRuleWithContext(context.Background(), updateLoadBalancerListenerPolicyRuleOptions) } -// SetHeaders : Allow user to set Headers -func (options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} +// UpdateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the UpdateLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions") + if err != nil { + return + } -// AddEndpointGatewayIPOptions : The AddEndpointGatewayIP options. -type AddEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *updateLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *updateLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *updateLoadBalancerListenerPolicyRuleOptions.ID, + } - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + for headerName, headerValue := range updateLoadBalancerListenerPolicyRuleOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// NewAddEndpointGatewayIPOptions : Instantiate AddEndpointGatewayIPOptions -func (*VpcV1) NewAddEndpointGatewayIPOptions(endpointGatewayID string, id string) *AddEndpointGatewayIPOptions { - return &AddEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicyRule") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *AddEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *AddEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddEndpointGatewayIPOptions) SetID(id string) *AddEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddEndpointGatewayIPOptions) SetHeaders(param map[string]string) *AddEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// AddInstanceNetworkInterfaceFloatingIPOptions : The AddInstanceNetworkInterfaceFloatingIP options. -type AddInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerListenerPolicyRulePatch) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + return + } -// NewAddInstanceNetworkInterfaceFloatingIPOptions : Instantiate AddInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - return &AddInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + if err != nil { + return + } + response.Result = result } -} -// SetInstanceID : Allow user to set InstanceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options + return } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options +// UpdateLoadBalancerPool : Update a load balancer pool +// This request updates a load balancer pool from a pool patch. +func (vpc *VpcV1) UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerPoolWithContext(context.Background(), updateLoadBalancerPoolOptions) } -// SetID : Allow user to set ID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} +// UpdateLoadBalancerPoolWithContext is an alternate form of the UpdateLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions") + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *AddInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerPoolOptions.LoadBalancerID, + "id": *updateLoadBalancerPoolOptions.ID, + } -// AddVPNGatewayConnectionLocalCIDROptions : The AddVPNGatewayConnectionLocalCIDR options. -type AddVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + if err != nil { + return + } - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + for headerName, headerValue := range updateLoadBalancerPoolOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPool") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolOptions.LoadBalancerPoolPatch) + if err != nil { + return + } -// NewAddVPNGatewayConnectionLocalCIDROptions : Instantiate AddVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - return &AddVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + request, err := builder.Build() + if err != nil { + return } -} -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + if err != nil { + return + } + response.Result = result + } -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetID(id string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options + return } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// UpdateLoadBalancerPoolMember : Update a load balancer pool member +// This request updates an existing member from a member patch. +func (vpc *VpcV1) UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerPoolMemberWithContext(context.Background(), updateLoadBalancerPoolMemberOptions) } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} +// UpdateLoadBalancerPoolMemberWithContext is an alternate form of the UpdateLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions") + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *updateLoadBalancerPoolMemberOptions.PoolID, + "id": *updateLoadBalancerPoolMemberOptions.ID, + } -// AddVPNGatewayConnectionPeerCIDROptions : The AddVPNGatewayConnectionPeerCIDR options. -type AddVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + if err != nil { + return + } - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + for headerName, headerValue := range updateLoadBalancerPoolMemberOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPoolMember") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolMemberOptions.LoadBalancerPoolMemberPatch) + if err != nil { + return + } -// NewAddVPNGatewayConnectionPeerCIDROptions : Instantiate AddVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - return &AddVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + request, err := builder.Build() + if err != nil { + return } -} -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetID(id string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options + return } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// AddEndpointGatewayIP : Bind a reserved IP to an endpoint gateway +// This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: +// +// - must currently be unbound, or not required by its target +// - must not be in the same zone as any other reserved IP bound to the endpoint gateway. +func (vpc *VpcV1) AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.AddEndpointGatewayIPWithContext(context.Background(), addEndpointGatewayIPOptions) } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} +// AddEndpointGatewayIPWithContext is an alternate form of the AddEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions") + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *addEndpointGatewayIPOptions.EndpointGatewayID, + "id": *addEndpointGatewayIPOptions.ID, + } -// AddressPrefix : AddressPrefix struct -type AddressPrefix struct { - // The CIDR block for this prefix. - CIDR *string `json:"cidr" validate:"required"` + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + if err != nil { + return + } - // The date and time that the prefix was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + for headerName, headerValue := range addEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // Indicates whether subnets exist with addresses from this prefix. - HasSubnets *bool `json:"has_subnets" validate:"required"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // The URL for this address prefix. - Href *string `json:"href" validate:"required"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // The unique identifier for this address prefix. - ID *string `json:"id" validate:"required"` + request, err := builder.Build() + if err != nil { + return + } - // Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically - // created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected - // words, but may be changed. - IsDefault *bool `json:"is_default" validate:"required"` + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + if err != nil { + return + } + response.Result = result + } - // The name for this address prefix. The name must not be used by another address prefix for the VPC. - Name *string `json:"name" validate:"required"` + return +} - // The zone this address prefix resides in. - Zone *ZoneReference `json:"zone" validate:"required"` +// CreateEndpointGateway : Create an endpoint gateway +// This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target +// outside the VPC. +func (vpc *VpcV1) CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.CreateEndpointGatewayWithContext(context.Background(), createEndpointGatewayOptions) } -// UnmarshalAddressPrefix unmarshals an instance of AddressPrefix from the specified map of raw messages. -func UnmarshalAddressPrefix(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefix) - err = core.UnmarshalPrimitive(m, "cidr", &obj.CIDR) +// CreateEndpointGatewayWithContext is an alternate form of the CreateEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createEndpointGatewayOptions, "createEndpointGatewayOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.ValidateStruct(createEndpointGatewayOptions, "createEndpointGatewayOptions") if err != nil { return } - err = core.UnmarshalPrimitive(m, "has_subnets", &obj.HasSubnets) + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + + for headerName, headerValue := range createEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + body := make(map[string]interface{}) + if createEndpointGatewayOptions.Target != nil { + body["target"] = createEndpointGatewayOptions.Target + } + if createEndpointGatewayOptions.VPC != nil { + body["vpc"] = createEndpointGatewayOptions.VPC + } + if createEndpointGatewayOptions.AllowDnsResolutionBinding != nil { + body["allow_dns_resolution_binding"] = createEndpointGatewayOptions.AllowDnsResolutionBinding + } + if createEndpointGatewayOptions.Ips != nil { + body["ips"] = createEndpointGatewayOptions.Ips + } + if createEndpointGatewayOptions.Name != nil { + body["name"] = createEndpointGatewayOptions.Name + } + if createEndpointGatewayOptions.ResourceGroup != nil { + body["resource_group"] = createEndpointGatewayOptions.ResourceGroup + } + if createEndpointGatewayOptions.SecurityGroups != nil { + body["security_groups"] = createEndpointGatewayOptions.SecurityGroups + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result + } + return } -// AddressPrefixCollection : AddressPrefixCollection struct -type AddressPrefixCollection struct { - // Collection of address prefixes. - AddressPrefixes []AddressPrefix `json:"address_prefixes" validate:"required"` - - // A link to the first page of resources. - First *AddressPrefixCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *AddressPrefixCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// DeleteEndpointGateway : Delete an endpoint gateway +// This request deletes an endpoint gateway. This operation cannot be reversed. +// +// Reserved IPs that were bound to the endpoint gateway will be released if their +// `auto_delete` property is set to true. +func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) } -// UnmarshalAddressPrefixCollection unmarshals an instance of AddressPrefixCollection from the specified map of raw messages. -func UnmarshalAddressPrefixCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollection) - err = core.UnmarshalModel(m, "address_prefixes", &obj.AddressPrefixes, UnmarshalAddressPrefix) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalAddressPrefixCollectionFirst) +// DeleteEndpointGatewayWithContext is an alternate form of the DeleteEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.ValidateStruct(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions") if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalAddressPrefixCollectionNext) - if err != nil { - return + + pathParamsMap := map[string]string{ + "id": *deleteEndpointGatewayOptions.ID, } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *AddressPrefixCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + for headerName, headerValue := range deleteEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - return start, nil -} -// AddressPrefixCollectionFirst : A link to the first page of resources. -type AddressPrefixCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalAddressPrefixCollectionFirst unmarshals an instance of AddressPrefixCollectionFirst from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + request, err := builder.Build() if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AddressPrefixCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type AddressPrefixCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + response, err = vpc.Service.Request(request, nil) -// UnmarshalAddressPrefixCollectionNext unmarshals an instance of AddressPrefixCollectionNext from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// AddressPrefixPatch : AddressPrefixPatch struct -type AddressPrefixPatch struct { - // Indicates whether this is the default prefix for this zone in this VPC. Updating to true makes this prefix the - // default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. - // Updating to false removes the default prefix for this zone in this VPC. - IsDefault *bool `json:"is_default,omitempty"` - - // The name for this address prefix. The name must not be used by another address prefix for the VPC. - Name *string `json:"name,omitempty"` +// GetEndpointGateway : Retrieve an endpoint gateway +// This request retrieves a single endpoint gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.GetEndpointGatewayWithContext(context.Background(), getEndpointGatewayOptions) } -// UnmarshalAddressPrefixPatch unmarshals an instance of AddressPrefixPatch from the specified map of raw messages. -func UnmarshalAddressPrefixPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixPatch) - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) +// GetEndpointGatewayWithContext is an alternate form of the GetEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayOptions, "getEndpointGatewayOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.ValidateStruct(getEndpointGatewayOptions, "getEndpointGatewayOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AsPatch returns a generic map representation of the AddressPrefixPatch -func (addressPrefixPatch *AddressPrefixPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(addressPrefixPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + pathParamsMap := map[string]string{ + "id": *getEndpointGatewayOptions.ID, } - return -} - -// BackupPolicy : BackupPolicy struct -type BackupPolicy struct { - // The date and time that the backup policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this backup policy. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this backup policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy. - ID *string `json:"id" validate:"required"` - // The date and time that the most recent job for this backup policy completed. - // - // If absent, no job has yet completed for this backup policy. - LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` - - // The lifecycle state of the backup policy. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The resource types this backup policy applies to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - MatchResourceTypes []string `json:"match_resource_types" validate:"required"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + if err != nil { + return + } - // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will - // be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` + for headerName, headerValue := range getEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The name for this backup policy. The name is unique across all backup policies in the region. - Name *string `json:"name" validate:"required"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // The plans for the backup policy. - Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // The resource group for this backup policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + request, err := builder.Build() + if err != nil { + return + } - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result + } - // The scope for this backup policy. - Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` + return } -// Constants associated with the BackupPolicy.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - BackupPolicyHealthStateDegradedConst = "degraded" - BackupPolicyHealthStateFaultedConst = "faulted" - BackupPolicyHealthStateInapplicableConst = "inapplicable" - BackupPolicyHealthStateOkConst = "ok" -) - -// Constants associated with the BackupPolicy.LifecycleState property. -// The lifecycle state of the backup policy. -const ( - BackupPolicyLifecycleStateDeletingConst = "deleting" - BackupPolicyLifecycleStateFailedConst = "failed" - BackupPolicyLifecycleStatePendingConst = "pending" - BackupPolicyLifecycleStateStableConst = "stable" - BackupPolicyLifecycleStateSuspendedConst = "suspended" - BackupPolicyLifecycleStateUpdatingConst = "updating" - BackupPolicyLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicy.MatchResourceTypes property. -// The resource type. -const ( - BackupPolicyMatchResourceTypesVolumeConst = "volume" -) - -// Constants associated with the BackupPolicy.ResourceType property. -// The resource type. -const ( - BackupPolicyResourceTypeBackupPolicyConst = "backup_policy" -) +// GetEndpointGatewayIP : Retrieve a reserved IP bound to an endpoint gateway +// This request retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the URL. +func (vpc *VpcV1) GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.GetEndpointGatewayIPWithContext(context.Background(), getEndpointGatewayIPOptions) +} -// UnmarshalBackupPolicy unmarshals an instance of BackupPolicy from the specified map of raw messages. -func UnmarshalBackupPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// GetEndpointGatewayIPWithContext is an alternate form of the GetEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.ValidateStruct(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions") if err != nil { return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) - if err != nil { - return + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *getEndpointGatewayIPOptions.EndpointGatewayID, + "id": *getEndpointGatewayIPOptions.ID, } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + + for headerName, headerValue := range getEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - err = core.UnmarshalPrimitive(m, "match_resource_types", &obj.MatchResourceTypes) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + if err != nil { + return + } + response.Result = result } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) + + return +} + +// ListEndpointGatewayIps : List all reserved IPs bound to an endpoint gateway +// This request lists all reserved IPs bound to an endpoint gateway. +func (vpc *VpcV1) ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { + return vpc.ListEndpointGatewayIpsWithContext(context.Background(), listEndpointGatewayIpsOptions) +} + +// ListEndpointGatewayIpsWithContext is an alternate form of the ListEndpointGatewayIps method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.ValidateStruct(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions") if err != nil { return } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) - if err != nil { - return + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *listEndpointGatewayIpsOptions.EndpointGatewayID, } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips`, pathParamsMap) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + + for headerName, headerValue := range listEndpointGatewayIpsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayIps") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listEndpointGatewayIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayIpsOptions.Start)) + } + if listEndpointGatewayIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayIpsOptions.Limit)) + } + if listEndpointGatewayIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listEndpointGatewayIpsOptions.Sort)) + } + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionEndpointGatewayContext) + if err != nil { + return + } + response.Result = result + } + return } -// BackupPolicyCollection : BackupPolicyCollection struct -type BackupPolicyCollection struct { - // Collection of backup policies. - BackupPolicies []BackupPolicy `json:"backup_policies" validate:"required"` +// ListEndpointGateways : List all endpoint gateways +// This request lists all endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to +// a target outside the VPC. +func (vpc *VpcV1) ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListEndpointGatewaysWithContext(context.Background(), listEndpointGatewaysOptions) +} - // A link to the first page of resources. - First *BackupPolicyCollectionFirst `json:"first" validate:"required"` +// ListEndpointGatewaysWithContext is an alternate form of the ListEndpointGateways method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listEndpointGatewaysOptions, "listEndpointGatewaysOptions") + if err != nil { + return + } - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + if err != nil { + return + } - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BackupPolicyCollectionNext `json:"next,omitempty"` + for headerName, headerValue := range listEndpointGatewaysOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGateways") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// UnmarshalBackupPolicyCollection unmarshals an instance of BackupPolicyCollection from the specified map of raw messages. -func UnmarshalBackupPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollection) - err = core.UnmarshalModel(m, "backup_policies", &obj.BackupPolicies, UnmarshalBackupPolicy) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listEndpointGatewaysOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) + } + if listEndpointGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewaysOptions.Start)) + } + if listEndpointGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewaysOptions.Limit)) + } + if listEndpointGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listEndpointGatewaysOptions.ResourceGroupID)) + } + if listEndpointGatewaysOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listEndpointGatewaysOptions.VPCID)) + } + if listEndpointGatewaysOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listEndpointGatewaysOptions.VPCCRN)) + } + if listEndpointGatewaysOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listEndpointGatewaysOptions.VPCName)) + } + if listEndpointGatewaysOptions.AllowDnsResolutionBinding != nil { + builder.AddQuery("allow_dns_resolution_binding", fmt.Sprint(*listEndpointGatewaysOptions.AllowDnsResolutionBinding)) + } + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyCollectionFirst) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// RemoveEndpointGatewayIP : Unbind a reserved IP from an endpoint gateway +// This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has +// `auto_delete` set to `true`, the reserved IP will be deleted. +func (vpc *VpcV1) RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveEndpointGatewayIPWithContext(context.Background(), removeEndpointGatewayIPOptions) +} + +// RemoveEndpointGatewayIPWithContext is an alternate form of the RemoveEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions cannot be nil") if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyCollectionNext) + err = core.ValidateStruct(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions") if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *removeEndpointGatewayIPOptions.EndpointGatewayID, + "id": *removeEndpointGatewayIPOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BackupPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + for headerName, headerValue := range removeEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - return start, nil -} -// BackupPolicyCollectionFirst : A link to the first page of resources. -type BackupPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalBackupPolicyCollectionFirst unmarshals an instance of BackupPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalBackupPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + request, err := builder.Build() if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + response, err = vpc.Service.Request(request, nil) + return } -// BackupPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BackupPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateEndpointGateway : Update an endpoint gateway +// This request updates an endpoint gateway's name. +func (vpc *VpcV1) UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.UpdateEndpointGatewayWithContext(context.Background(), updateEndpointGatewayOptions) } -// UnmarshalBackupPolicyCollectionNext unmarshals an instance of BackupPolicyCollectionNext from the specified map of raw messages. -func UnmarshalBackupPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UpdateEndpointGatewayWithContext is an alternate form of the UpdateEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateEndpointGatewayOptions, "updateEndpointGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateEndpointGatewayOptions, "updateEndpointGatewayOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// BackupPolicyHealthReason : BackupPolicyHealthReason struct -type BackupPolicyHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` + pathParamsMap := map[string]string{ + "id": *updateEndpointGatewayOptions.ID, + } - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + if err != nil { + return + } - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} + for headerName, headerValue := range updateEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// Constants associated with the BackupPolicyHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - BackupPolicyHealthReasonCodeMissingServiceAuthorizationPoliciesConst = "missing_service_authorization_policies" -) + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") -// UnmarshalBackupPolicyHealthReason unmarshals an instance of BackupPolicyHealthReason from the specified map of raw messages. -func UnmarshalBackupPolicyHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateEndpointGatewayOptions.EndpointGatewayPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result + } + return } -// BackupPolicyJob : BackupPolicyJob struct -type BackupPolicyJob struct { - // Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is - // always `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, the days after completion that this backup policy job will be deleted. This value may be - // modifiable in the future. - AutoDeleteAfter *int64 `json:"auto_delete_after" validate:"required"` - - // The backup policy plan operated this backup policy job (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan" validate:"required"` - - // The date and time that the backup policy job was completed. - // - // If absent, the backup policy job has not yet completed. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the backup policy job was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this backup policy job. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy job. - ID *string `json:"id" validate:"required"` - - // The type of backup policy job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the - // unexpected property value was encountered. - JobType *string `json:"job_type" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The source this backup was created from (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - Source BackupPolicyJobSourceIntf `json:"source" validate:"required"` - - // The status of the backup policy job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []BackupPolicyJobStatusReason `json:"status_reasons" validate:"required"` - - // The snapshots operated on by this backup policy job (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - TargetSnapshots []SnapshotReference `json:"target_snapshots" validate:"required"` +// CreateFlowLogCollector : Create a flow log collector +// This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype +// object is structured in the same way as a retrieved flow log collector, and contains the information necessary to +// create and start the new flow log collector. +func (vpc *VpcV1) CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.CreateFlowLogCollectorWithContext(context.Background(), createFlowLogCollectorOptions) } -// Constants associated with the BackupPolicyJob.JobType property. -// The type of backup policy job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the -// unexpected property value was encountered. -const ( - BackupPolicyJobJobTypeCreationConst = "creation" - BackupPolicyJobJobTypeDeletionConst = "deletion" -) - -// Constants associated with the BackupPolicyJob.ResourceType property. -// The resource type. -const ( - BackupPolicyJobResourceTypeBackupPolicyJobConst = "backup_policy_job" -) - -// Constants associated with the BackupPolicyJob.Status property. -// The status of the backup policy job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the -// unexpected property value was encountered. -const ( - BackupPolicyJobStatusFailedConst = "failed" - BackupPolicyJobStatusRunningConst = "running" - BackupPolicyJobStatusSucceededConst = "succeeded" -) - -// UnmarshalBackupPolicyJob unmarshals an instance of BackupPolicyJob from the specified map of raw messages. -func UnmarshalBackupPolicyJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJob) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) +// CreateFlowLogCollectorWithContext is an alternate form of the CreateFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createFlowLogCollectorOptions, "createFlowLogCollectorOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete_after", &obj.AutoDeleteAfter) + err = core.ValidateStruct(createFlowLogCollectorOptions, "createFlowLogCollectorOptions") if err != nil { return } - err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) if err != nil { return } - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return + + for headerName, headerValue := range createFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + body := make(map[string]interface{}) + if createFlowLogCollectorOptions.StorageBucket != nil { + body["storage_bucket"] = createFlowLogCollectorOptions.StorageBucket } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return + if createFlowLogCollectorOptions.Target != nil { + body["target"] = createFlowLogCollectorOptions.Target } - err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) - if err != nil { - return + if createFlowLogCollectorOptions.Active != nil { + body["active"] = createFlowLogCollectorOptions.Active } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return + if createFlowLogCollectorOptions.Name != nil { + body["name"] = createFlowLogCollectorOptions.Name } - err = core.UnmarshalModel(m, "source", &obj.Source, UnmarshalBackupPolicyJobSource) - if err != nil { - return + if createFlowLogCollectorOptions.ResourceGroup != nil { + body["resource_group"] = createFlowLogCollectorOptions.ResourceGroup } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + _, err = builder.SetBodyContentJSON(body) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBackupPolicyJobStatusReason) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalModel(m, "target_snapshots", &obj.TargetSnapshots, UnmarshalSnapshotReference) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result + } + return } -// BackupPolicyJobCollection : BackupPolicyJobCollection struct -type BackupPolicyJobCollection struct { - // A link to the first page of resources. - First *BackupPolicyJobCollectionFirst `json:"first" validate:"required"` - - // Collection of backup policy jobs. - Jobs []BackupPolicyJob `json:"jobs" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BackupPolicyJobCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// DeleteFlowLogCollector : Delete a flow log collector +// This request stops and deletes a flow log collector. This operation cannot be reversed. +// +// Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. +func (vpc *VpcV1) DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteFlowLogCollectorWithContext(context.Background(), deleteFlowLogCollectorOptions) } -// UnmarshalBackupPolicyJobCollection unmarshals an instance of BackupPolicyJobCollection from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyJobCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "jobs", &obj.Jobs, UnmarshalBackupPolicyJob) +// DeleteFlowLogCollectorWithContext is an alternate form of the DeleteFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.ValidateStruct(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions") if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyJobCollectionNext) - if err != nil { - return + + pathParamsMap := map[string]string{ + "id": *deleteFlowLogCollectorOptions.ID, } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BackupPolicyJobCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + for headerName, headerValue := range deleteFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - return start, nil -} -// BackupPolicyJobCollectionFirst : A link to the first page of resources. -type BackupPolicyJobCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalBackupPolicyJobCollectionFirst unmarshals an instance of BackupPolicyJobCollectionFirst from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + request, err := builder.Build() if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + response, err = vpc.Service.Request(request, nil) + return } -// BackupPolicyJobCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BackupPolicyJobCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// GetFlowLogCollector : Retrieve a flow log collector +// This request retrieves a single flow log collector specified by the identifier in the URL. +func (vpc *VpcV1) GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.GetFlowLogCollectorWithContext(context.Background(), getFlowLogCollectorOptions) } -// UnmarshalBackupPolicyJobCollectionNext unmarshals an instance of BackupPolicyJobCollectionNext from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// GetFlowLogCollectorWithContext is an alternate form of the GetFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getFlowLogCollectorOptions, "getFlowLogCollectorOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getFlowLogCollectorOptions, "getFlowLogCollectorOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobSource : The source this backup was created from (may be -// [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). -// Models which "extend" this model: -// - BackupPolicyJobSourceVolumeReference -type BackupPolicyJobSource struct { - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` + pathParamsMap := map[string]string{ + "id": *getFlowLogCollectorOptions.ID, + } - // The URL for this volume. - Href *string `json:"href,omitempty"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + if err != nil { + return + } - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` + for headerName, headerValue := range getFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} + request, err := builder.Build() + if err != nil { + return + } -// Constants associated with the BackupPolicyJobSource.ResourceType property. -// The resource type. -const ( - BackupPolicyJobSourceResourceTypeVolumeConst = "volume" -) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result + } -func (*BackupPolicyJobSource) isaBackupPolicyJobSource() bool { - return true + return } -type BackupPolicyJobSourceIntf interface { - isaBackupPolicyJobSource() bool +// ListFlowLogCollectors : List all flow log collectors +// This request lists all flow log collectors in the region. A flow log collector summarizes data sent over the instance +// network interfaces and instance network attachments contained within its target. +func (vpc *VpcV1) ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { + return vpc.ListFlowLogCollectorsWithContext(context.Background(), listFlowLogCollectorsOptions) } -// UnmarshalBackupPolicyJobSource unmarshals an instance of BackupPolicyJobSource from the specified map of raw messages. -func UnmarshalBackupPolicyJobSource(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobSource) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// ListFlowLogCollectorsWithContext is an alternate form of the ListFlowLogCollectors method which supports a Context parameter +func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listFlowLogCollectorsOptions, "listFlowLogCollectorsOptions") if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + + for headerName, headerValue := range listFlowLogCollectorsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFlowLogCollectors") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listFlowLogCollectorsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listFlowLogCollectorsOptions.Start)) + } + if listFlowLogCollectorsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listFlowLogCollectorsOptions.Limit)) + } + if listFlowLogCollectorsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listFlowLogCollectorsOptions.ResourceGroupID)) + } + if listFlowLogCollectorsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listFlowLogCollectorsOptions.Name)) + } + if listFlowLogCollectorsOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listFlowLogCollectorsOptions.VPCID)) + } + if listFlowLogCollectorsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listFlowLogCollectorsOptions.VPCCRN)) + } + if listFlowLogCollectorsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listFlowLogCollectorsOptions.VPCName)) + } + if listFlowLogCollectorsOptions.TargetID != nil { + builder.AddQuery("target.id", fmt.Sprint(*listFlowLogCollectorsOptions.TargetID)) + } + if listFlowLogCollectorsOptions.TargetResourceType != nil { + builder.AddQuery("target.resource_type", fmt.Sprint(*listFlowLogCollectorsOptions.TargetResourceType)) + } + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollectorCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateFlowLogCollector : Update a flow log collector +// This request updates a flow log collector with the information in a provided flow log collector patch. The flow log +// collector patch object is structured in the same way as a retrieved flow log collector and contains only the +// information to be updated. +func (vpc *VpcV1) UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.UpdateFlowLogCollectorWithContext(context.Background(), updateFlowLogCollectorOptions) +} + +// UpdateFlowLogCollectorWithContext is an alternate form of the UpdateFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions cannot be nil") if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) + err = core.ValidateStruct(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions") if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + + pathParamsMap := map[string]string{ + "id": *updateFlowLogCollectorOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobStatusReason : BackupPolicyJobStatusReason struct -type BackupPolicyJobStatusReason struct { - // A snake case string succinctly identifying the status reason: - // - `internal_error`: Internal error (contact IBM support) - // - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state - // - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached - // - `source_volume_busy`: The source volume has `busy` set (after multiple retries). - Code *string `json:"code" validate:"required"` - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` + for headerName, headerValue := range updateFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") -// Constants associated with the BackupPolicyJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason: -// - `internal_error`: Internal error (contact IBM support) -// - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state -// - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached -// - `source_volume_busy`: The source volume has `busy` set (after multiple retries). -const ( - BackupPolicyJobStatusReasonCodeInternalErrorConst = "internal_error" - BackupPolicyJobStatusReasonCodeSnapshotPendingConst = "snapshot_pending" - BackupPolicyJobStatusReasonCodeSnapshotVolumeLimitConst = "snapshot_volume_limit" - BackupPolicyJobStatusReasonCodeSourceVolumeBusyConst = "source_volume_busy" -) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalBackupPolicyJobStatusReason unmarshals an instance of BackupPolicyJobStatusReason from the specified map of raw messages. -func UnmarshalBackupPolicyJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + _, err = builder.SetBodyContentJSON(updateFlowLogCollectorOptions.FlowLogCollectorPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPatch : BackupPolicyPatch struct -type BackupPolicyPatch struct { - // The user tags this backup policy will apply to (replacing any existing tags). Resources that have both a matching - // user tag and a matching type will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags,omitempty"` - - // The name for this backup policy. The name must not be used by another backup policy in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalBackupPolicyPatch unmarshals an instance of BackupPolicyPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPatch) - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AsPatch returns a generic map representation of the BackupPolicyPatch -func (backupPolicyPatch *BackupPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(backupPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } return } -// BackupPolicyPlan : BackupPolicyPlan struct -type BackupPolicyPlan struct { - // Indicates whether the plan is active. - Active *bool `json:"active" validate:"required"` - - // The user tags to attach to backups (snapshots) created by this plan. - AttachUserTags []string `json:"attach_user_tags" validate:"required"` - - ClonePolicy *BackupPolicyPlanClonePolicy `json:"clone_policy" validate:"required"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags" validate:"required"` - - // The date and time that the backup policy plan was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` - - DeletionTrigger *BackupPolicyPlanDeletionTrigger `json:"deletion_trigger" validate:"required"` - - // The URL for this backup policy plan. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy plan. +// AccountReference : AccountReference struct +type AccountReference struct { + // The unique identifier for this account. ID *string `json:"id" validate:"required"` - // The lifecycle state of this backup policy plan. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this backup policy plan. The name is unique across all plans in the backup policy. - Name *string `json:"name" validate:"required"` - - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicy `json:"remote_region_policies" validate:"required"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the BackupPolicyPlan.LifecycleState property. -// The lifecycle state of this backup policy plan. -const ( - BackupPolicyPlanLifecycleStateDeletingConst = "deleting" - BackupPolicyPlanLifecycleStateFailedConst = "failed" - BackupPolicyPlanLifecycleStatePendingConst = "pending" - BackupPolicyPlanLifecycleStateStableConst = "stable" - BackupPolicyPlanLifecycleStateSuspendedConst = "suspended" - BackupPolicyPlanLifecycleStateUpdatingConst = "updating" - BackupPolicyPlanLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicyPlan.ResourceType property. +// Constants associated with the AccountReference.ResourceType property. // The resource type. const ( - BackupPolicyPlanResourceTypeBackupPolicyPlanConst = "backup_policy_plan" + AccountReferenceResourceTypeAccountConst = "account" ) -// UnmarshalBackupPolicyPlan unmarshals an instance of BackupPolicyPlan from the specified map of raw messages. -func UnmarshalBackupPolicyPlan(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlan) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTrigger) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalAccountReference unmarshals an instance of AccountReference from the specified map of raw messages. +func UnmarshalAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountReference) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicy) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return @@ -25567,319 +25969,413 @@ func UnmarshalBackupPolicyPlan(m map[string]json.RawMessage, result interface{}) return } -// BackupPolicyPlanClonePolicy : BackupPolicyPlanClonePolicy struct -type BackupPolicyPlanClonePolicy struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots" validate:"required"` +// ActivateReservationOptions : The ActivateReservation options. +type ActivateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` - // The zone this backup policy plan will create snapshot clones in. - Zones []ZoneReference `json:"zones" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalBackupPolicyPlanClonePolicy unmarshals an instance of BackupPolicyPlanClonePolicy from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicy) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) - if err != nil { - return +// NewActivateReservationOptions : Instantiate ActivateReservationOptions +func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { + return &ActivateReservationOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// BackupPolicyPlanClonePolicyPatch : BackupPolicyPlanClonePolicyPatch struct -type BackupPolicyPlanClonePolicyPatch struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots,omitempty"` - - // The zones this backup policy plan will create snapshot clones in. Updating this value does not change the clones for - // snapshots that have already been created by this plan. - Zones []ZoneIdentityIntf `json:"zones,omitempty"` +// SetID : Allow user to set ID +func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalBackupPolicyPlanClonePolicyPatch unmarshals an instance of BackupPolicyPlanClonePolicyPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicyPatch) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { + options.Headers = param + return options } -// BackupPolicyPlanClonePolicyPrototype : BackupPolicyPlanClonePolicyPrototype struct -type BackupPolicyPlanClonePolicyPrototype struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots,omitempty"` +// AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. +type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The zone this backup policy plan will create snapshot clones in. - Zones []ZoneIdentityIntf `json:"zones" validate:"required"` + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// NewBackupPolicyPlanClonePolicyPrototype : Instantiate BackupPolicyPlanClonePolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanClonePolicyPrototype(zones []ZoneIdentityIntf) (_model *BackupPolicyPlanClonePolicyPrototype, err error) { - _model = &BackupPolicyPlanClonePolicyPrototype{ - Zones: zones, +// NewAddBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate AddBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewAddBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + return &AddBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } - err = core.ValidateStruct(_model, "required parameters") - return } -// UnmarshalBackupPolicyPlanClonePolicyPrototype unmarshals an instance of BackupPolicyPlanClonePolicyPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicyPrototype) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -// BackupPolicyPlanCollection : BackupPolicyPlanCollection struct -type BackupPolicyPlanCollection struct { - // Collection of backup policy plans. - Plans []BackupPolicyPlan `json:"plans" validate:"required"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options } -// UnmarshalBackupPolicyPlanCollection unmarshals an instance of BackupPolicyPlanCollection from the specified map of raw messages. -func UnmarshalBackupPolicyPlanCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanCollection) - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// BackupPolicyPlanDeletionTrigger : BackupPolicyPlanDeletionTrigger struct -type BackupPolicyPlanDeletionTrigger struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - // The maximum number of recent backups to keep. If absent, there is no maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` +// AddEndpointGatewayIPOptions : The AddEndpointGatewayIP options. +type AddEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalBackupPolicyPlanDeletionTrigger unmarshals an instance of BackupPolicyPlanDeletionTrigger from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTrigger(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTrigger) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return +// NewAddEndpointGatewayIPOptions : Instantiate AddEndpointGatewayIPOptions +func (*VpcV1) NewAddEndpointGatewayIPOptions(endpointGatewayID string, id string) *AddEndpointGatewayIPOptions { + return &AddEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// BackupPolicyPlanDeletionTriggerPatch : BackupPolicyPlanDeletionTriggerPatch struct -type BackupPolicyPlanDeletionTriggerPatch struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after,omitempty"` +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *AddEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *AddEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} - // The maximum number of recent backups to keep. Specify `null` to remove any existing maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` +// SetID : Allow user to set ID +func (_options *AddEndpointGatewayIPOptions) SetID(id string) *AddEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalBackupPolicyPlanDeletionTriggerPatch unmarshals an instance of BackupPolicyPlanDeletionTriggerPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTriggerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTriggerPatch) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *AddEndpointGatewayIPOptions) SetHeaders(param map[string]string) *AddEndpointGatewayIPOptions { + options.Headers = param + return options } -// BackupPolicyPlanDeletionTriggerPrototype : BackupPolicyPlanDeletionTriggerPrototype struct -type BackupPolicyPlanDeletionTriggerPrototype struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after,omitempty"` +// AddInstanceNetworkInterfaceFloatingIPOptions : The AddInstanceNetworkInterfaceFloatingIP options. +type AddInstanceNetworkInterfaceFloatingIPOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The maximum number of recent backups to keep. If unspecified, there will be no maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalBackupPolicyPlanDeletionTriggerPrototype unmarshals an instance of BackupPolicyPlanDeletionTriggerPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTriggerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTriggerPrototype) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return +// NewAddInstanceNetworkInterfaceFloatingIPOptions : Instantiate AddInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *AddInstanceNetworkInterfaceFloatingIPOptions { + return &AddInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// BackupPolicyPlanPatch : BackupPolicyPlanPatch struct -type BackupPolicyPlanPatch struct { - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` - - // The user tags to attach to backups (snapshots) created by this plan. Updating this value does not change the user - // tags for backups that have already been created by this plan. - AttachUserTags []string `json:"attach_user_tags,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - ClonePolicy *BackupPolicyPlanClonePolicyPatch `json:"clone_policy,omitempty"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` +// SetID : Allow user to set ID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *AddInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - DeletionTrigger *BackupPolicyPlanDeletionTriggerPatch `json:"deletion_trigger,omitempty"` +// AddNetworkInterfaceFloatingIPOptions : The AddNetworkInterfaceFloatingIP options. +type AddNetworkInterfaceFloatingIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. - Name *string `json:"name,omitempty"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The policies for additional backups in remote regions (replacing any existing policies). - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalBackupPolicyPlanPatch unmarshals an instance of BackupPolicyPlanPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) - if err != nil { - return +// NewAddNetworkInterfaceFloatingIPOptions : Instantiate AddNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewAddNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *AddNetworkInterfaceFloatingIPOptions { + return &AddNetworkInterfaceFloatingIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the BackupPolicyPlanPatch -func (backupPolicyPlanPatch *BackupPolicyPlanPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(backupPolicyPlanPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *AddNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *AddNetworkInterfaceFloatingIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options } -// BackupPolicyPlanPrototype : BackupPolicyPlanPrototype struct -type BackupPolicyPlanPrototype struct { - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` - - // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. - AttachUserTags []string `json:"attach_user_tags,omitempty"` - - ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` +// SetID : Allow user to set ID +func (_options *AddNetworkInterfaceFloatingIPOptions) SetID(id string) *AddNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *AddNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` +// AddVirtualNetworkInterfaceIPOptions : The AddVirtualNetworkInterfaceIP options. +type AddVirtualNetworkInterfaceIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// NewBackupPolicyPlanPrototype : Instantiate BackupPolicyPlanPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanPrototype(cronSpec string) (_model *BackupPolicyPlanPrototype, err error) { - _model = &BackupPolicyPlanPrototype{ - CronSpec: core.StringPtr(cronSpec), +// NewAddVirtualNetworkInterfaceIPOptions : Instantiate AddVirtualNetworkInterfaceIPOptions +func (*VpcV1) NewAddVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *AddVirtualNetworkInterfaceIPOptions { + return &AddVirtualNetworkInterfaceIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), } - err = core.ValidateStruct(_model, "required parameters") - return } -// UnmarshalBackupPolicyPlanPrototype unmarshals an instance of BackupPolicyPlanPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanPrototype) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *AddVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *AddVirtualNetworkInterfaceIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options +} + +// SetID : Allow user to set ID +func (_options *AddVirtualNetworkInterfaceIPOptions) SetID(id string) *AddVirtualNetworkInterfaceIPOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *AddVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *AddVirtualNetworkInterfaceIPOptions { + options.Headers = param + return options +} + +// AddVPNGatewayConnectionLocalCIDROptions : The AddVPNGatewayConnectionLocalCIDR options. +type AddVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewAddVPNGatewayConnectionLocalCIDROptions : Instantiate AddVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewAddVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { + return &AddVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetID(id string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options +} + +// SetPrefixLength : Allow user to set PrefixLength +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *AddVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionLocalCIDROptions { + options.Headers = param + return options +} + +// AddVPNGatewayConnectionPeerCIDROptions : The AddVPNGatewayConnectionPeerCIDR options. +type AddVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewAddVPNGatewayConnectionPeerCIDROptions : Instantiate AddVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewAddVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { + return &AddVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetID(id string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options +} + +// SetPrefixLength : Allow user to set PrefixLength +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *AddVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionPeerCIDROptions { + options.Headers = param + return options +} + +// AddressPrefix : AddressPrefix struct +type AddressPrefix struct { + // The CIDR block for this prefix. + CIDR *string `json:"cidr" validate:"required"` + + // The date and time that the prefix was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // Indicates whether subnets exist with addresses from this prefix. + HasSubnets *bool `json:"has_subnets" validate:"required"` + + // The URL for this address prefix. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this address prefix. + ID *string `json:"id" validate:"required"` + + // Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically + // created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected + // words, but may be changed. + IsDefault *bool `json:"is_default" validate:"required"` + + // The name for this address prefix. The name must not be used by another address prefix for the VPC. + Name *string `json:"name" validate:"required"` + + // The zone this address prefix resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// UnmarshalAddressPrefix unmarshals an instance of AddressPrefix from the specified map of raw messages. +func UnmarshalAddressPrefix(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefix) + err = core.UnmarshalPrimitive(m, "cidr", &obj.CIDR) if err != nil { return } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPrototype) + err = core.UnmarshalPrimitive(m, "has_subnets", &obj.HasSubnets) if err != nil { return } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPrototype) + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) if err != nil { return } @@ -25887,7 +26383,7 @@ func UnmarshalBackupPolicyPlanPrototype(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -25895,59 +26391,45 @@ func UnmarshalBackupPolicyPlanPrototype(m map[string]json.RawMessage, result int return } -// BackupPolicyPlanReference : BackupPolicyPlanReference struct -type BackupPolicyPlanReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BackupPolicyPlanReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this backup policy plan. - Href *string `json:"href" validate:"required"` +// AddressPrefixCollection : AddressPrefixCollection struct +type AddressPrefixCollection struct { + // Collection of address prefixes. + AddressPrefixes []AddressPrefix `json:"address_prefixes" validate:"required"` - // The unique identifier for this backup policy plan. - ID *string `json:"id" validate:"required"` + // A link to the first page of resources. + First *AddressPrefixCollectionFirst `json:"first" validate:"required"` - // The name for this backup policy plan. The name is unique across all plans in the backup policy. - Name *string `json:"name" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *BackupPolicyPlanRemote `json:"remote,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *AddressPrefixCollectionNext `json:"next,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// Constants associated with the BackupPolicyPlanReference.ResourceType property. -// The resource type. -const ( - BackupPolicyPlanReferenceResourceTypeBackupPolicyPlanConst = "backup_policy_plan" -) - -// UnmarshalBackupPolicyPlanReference unmarshals an instance of BackupPolicyPlanReference from the specified map of raw messages. -func UnmarshalBackupPolicyPlanReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBackupPolicyPlanReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalAddressPrefixCollection unmarshals an instance of AddressPrefixCollection from the specified map of raw messages. +func UnmarshalAddressPrefixCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollection) + err = core.UnmarshalModel(m, "address_prefixes", &obj.AddressPrefixes, UnmarshalAddressPrefix) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalAddressPrefixCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalBackupPolicyPlanRemote) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalAddressPrefixCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -25955,67 +26437,28 @@ func UnmarshalBackupPolicyPlanReference(m map[string]json.RawMessage, result int return } -// BackupPolicyPlanReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BackupPolicyPlanReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBackupPolicyPlanReferenceDeleted unmarshals an instance of BackupPolicyPlanReferenceDeleted from the specified map of raw messages. -func UnmarshalBackupPolicyPlanReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// Retrieve the value to be passed to a request to access the next page of results +func (resp *AddressPrefixCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type BackupPolicyPlanRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalBackupPolicyPlanRemote unmarshals an instance of BackupPolicyPlanRemote from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + return start, nil } -// BackupPolicyPlanRemoteRegionPolicy : BackupPolicyPlanRemoteRegionPolicy struct -type BackupPolicyPlanRemoteRegionPolicy struct { - // The region this backup policy plan will create backups in. - DeleteOverCount *int64 `json:"delete_over_count" validate:"required"` - - // The root key used to rewrap the data encryption key for the backup (snapshot). - EncryptionKey *EncryptionKeyReference `json:"encryption_key" validate:"required"` - - // The region this backup policy plan will create backups in. - Region *RegionReference `json:"region" validate:"required"` +// AddressPrefixCollectionFirst : A link to the first page of resources. +type AddressPrefixCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalBackupPolicyPlanRemoteRegionPolicy unmarshals an instance of BackupPolicyPlanRemoteRegionPolicy from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemoteRegionPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemoteRegionPolicy) - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) +// UnmarshalAddressPrefixCollectionFirst unmarshals an instance of AddressPrefixCollectionFirst from the specified map of raw messages. +func UnmarshalAddressPrefixCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -26023,42 +26466,16 @@ func UnmarshalBackupPolicyPlanRemoteRegionPolicy(m map[string]json.RawMessage, r return } -// BackupPolicyPlanRemoteRegionPolicyPrototype : BackupPolicyPlanRemoteRegionPolicyPrototype struct -type BackupPolicyPlanRemoteRegionPolicyPrototype struct { - // The region this backup policy plan will create backups in. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` - - // The root key to use to rewrap the data encryption key for the backup (snapshot). - // - // If unspecified, the source's `encryption_key` will be used. - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The region this backup policy plan will create backups in. - Region RegionIdentityIntf `json:"region" validate:"required"` -} - -// NewBackupPolicyPlanRemoteRegionPolicyPrototype : Instantiate BackupPolicyPlanRemoteRegionPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanRemoteRegionPolicyPrototype(region RegionIdentityIntf) (_model *BackupPolicyPlanRemoteRegionPolicyPrototype, err error) { - _model = &BackupPolicyPlanRemoteRegionPolicyPrototype{ - Region: region, - } - err = core.ValidateStruct(_model, "required parameters") - return +// AddressPrefixCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type AddressPrefixCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype unmarshals an instance of BackupPolicyPlanRemoteRegionPolicyPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemoteRegionPolicyPrototype) - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionIdentity) +// UnmarshalAddressPrefixCollectionNext unmarshals an instance of AddressPrefixCollectionNext from the specified map of raw messages. +func UnmarshalAddressPrefixCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -26066,47 +26483,25 @@ func UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(m map[string]json.RawM return } -// BackupPolicyScope : The scope for this backup policy. -// Models which "extend" this model: -// - BackupPolicyScopeEnterpriseReference -// - BackupPolicyScopeAccountReference -type BackupPolicyScope struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` - - // The unique identifier for this enterprise. - ID *string `json:"id,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the BackupPolicyScope.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeResourceTypeEnterpriseConst = "enterprise" -) - -func (*BackupPolicyScope) isaBackupPolicyScope() bool { - return true -} +// AddressPrefixPatch : AddressPrefixPatch struct +type AddressPrefixPatch struct { + // Indicates whether this is the default prefix for this zone in this VPC. Updating to true makes this prefix the + // default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. + // Updating to false removes the default prefix for this zone in this VPC. + IsDefault *bool `json:"is_default,omitempty"` -type BackupPolicyScopeIntf interface { - isaBackupPolicyScope() bool + // The name for this address prefix. The name must not be used by another address prefix for the VPC. + Name *string `json:"name,omitempty"` } -// UnmarshalBackupPolicyScope unmarshals an instance of BackupPolicyScope from the specified map of raw messages. -func UnmarshalBackupPolicyScope(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScope) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalAddressPrefixPatch unmarshals an instance of AddressPrefixPatch from the specified map of raw messages. +func UnmarshalAddressPrefixPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixPatch) + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -26114,241 +26509,310 @@ func UnmarshalBackupPolicyScope(m map[string]json.RawMessage, result interface{} return } -// BackupPolicyScopePrototype : The scope to use for this backup policy. -// -// If unspecified, the policy will be scoped to the account. -// Models which "extend" this model: -// - BackupPolicyScopePrototypeEnterpriseIdentity -type BackupPolicyScopePrototype struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` -} - -func (*BackupPolicyScopePrototype) isaBackupPolicyScopePrototype() bool { - return true -} - -type BackupPolicyScopePrototypeIntf interface { - isaBackupPolicyScopePrototype() bool -} - -// UnmarshalBackupPolicyScopePrototype unmarshals an instance of BackupPolicyScopePrototype from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototype) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +// AsPatch returns a generic map representation of the AddressPrefixPatch +func (addressPrefixPatch *AddressPrefixPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(addressPrefixPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// BareMetalServer : BareMetalServer struct -type BareMetalServer struct { - // The total bandwidth (in megabits per second) shared across the bare metal server network interfaces. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // The possible resource types for this property are expected to expand in the future. - BootTarget BareMetalServerBootTargetIntf `json:"boot_target" validate:"required"` - - // The bare metal server CPU configuration. - Cpu *BareMetalServerCpu `json:"cpu" validate:"required"` - - // The date and time that the bare metal server was created. +// BackupPolicy : BackupPolicy struct +// Models which "extend" this model: +// - BackupPolicyMatchResourceTypeInstance +// - BackupPolicyMatchResourceTypeVolume +type BackupPolicy struct { + // The date and time that the backup policy was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this bare metal server. + // The CRN for this backup policy. CRN *string `json:"crn" validate:"required"` - // The disks for this bare metal server, including any disks that are associated with the - // `boot_target`. - Disks []BareMetalServerDisk `json:"disks" validate:"required"` + // The reasons for the current `health_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot" validate:"required"` + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` - // The URL for this bare metal server. + // The URL for this backup policy. Href *string `json:"href" validate:"required"` - // The unique identifier for this bare metal server. + // The unique identifier for this backup policy. ID *string `json:"id" validate:"required"` - // The reasons for the current `lifecycle_state` (if any). + // The date and time that the most recent job for this backup policy completed. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []BareMetalServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // If absent, no job has yet completed for this backup policy. + LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` - // The lifecycle state of the bare metal server. + // The lifecycle state of the backup policy. LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The amount of memory, truncated to whole gibibytes. - Memory *int64 `json:"memory" validate:"required"` - - // The name for this bare metal server. The name is unique across all bare metal servers in the region. - Name *string `json:"name" validate:"required"` + // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the + // unexpected property value was encountered. + MatchResourceType *string `json:"match_resource_type" validate:"required"` - // The network interfaces for this bare metal server, including the primary network interface. - NetworkInterfaces []NetworkInterfaceBareMetalServerContextReference `json:"network_interfaces" validate:"required"` + // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will + // be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` - // The primary network interface for this bare metal server. - PrimaryNetworkInterface *NetworkInterfaceBareMetalServerContextReference `json:"primary_network_interface" validate:"required"` + // The name for this backup policy. The name is unique across all backup policies in the region. + Name *string `json:"name" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - // for this bare metal server. - Profile *BareMetalServerProfileReference `json:"profile" validate:"required"` + // The plans for the backup policy. + Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` - // The resource group for this bare metal server. + // The resource group for this backup policy. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the bare metal server. - Status *string `json:"status" validate:"required"` + // The scope for this backup policy. + Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` - // The reasons for the current status (if any). + // The included content for backups created using this policy: + // - `boot_volume`: Include the instance's boot volume. + // - `data_volumes`: Include the instance's data volumes. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []BareMetalServerStatusReason `json:"status_reasons" validate:"required"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModule `json:"trusted_platform_module" validate:"required"` + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the + // unexpected property value was encountered. + IncludedContent []string `json:"included_content,omitempty"` +} - // The VPC this bare metal server resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// Constants associated with the BackupPolicy.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + BackupPolicyHealthStateDegradedConst = "degraded" + BackupPolicyHealthStateFaultedConst = "faulted" + BackupPolicyHealthStateInapplicableConst = "inapplicable" + BackupPolicyHealthStateOkConst = "ok" +) - // The zone this bare metal server resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} +// Constants associated with the BackupPolicy.LifecycleState property. +// The lifecycle state of the backup policy. +const ( + BackupPolicyLifecycleStateDeletingConst = "deleting" + BackupPolicyLifecycleStateFailedConst = "failed" + BackupPolicyLifecycleStatePendingConst = "pending" + BackupPolicyLifecycleStateStableConst = "stable" + BackupPolicyLifecycleStateSuspendedConst = "suspended" + BackupPolicyLifecycleStateUpdatingConst = "updating" + BackupPolicyLifecycleStateWaitingConst = "waiting" +) -// Constants associated with the BareMetalServer.LifecycleState property. -// The lifecycle state of the bare metal server. +// Constants associated with the BackupPolicy.MatchResourceType property. +// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected +// property value was encountered. const ( - BareMetalServerLifecycleStateDeletingConst = "deleting" - BareMetalServerLifecycleStateFailedConst = "failed" - BareMetalServerLifecycleStatePendingConst = "pending" - BareMetalServerLifecycleStateStableConst = "stable" - BareMetalServerLifecycleStateSuspendedConst = "suspended" - BareMetalServerLifecycleStateUpdatingConst = "updating" - BareMetalServerLifecycleStateWaitingConst = "waiting" + BackupPolicyMatchResourceTypeInstanceConst = "instance" + BackupPolicyMatchResourceTypeVolumeConst = "volume" ) -// Constants associated with the BareMetalServer.ResourceType property. +// Constants associated with the BackupPolicy.ResourceType property. // The resource type. const ( - BareMetalServerResourceTypeBareMetalServerConst = "bare_metal_server" + BackupPolicyResourceTypeBackupPolicyConst = "backup_policy" ) -// Constants associated with the BareMetalServer.Status property. -// The status of the bare metal server. +// Constants associated with the BackupPolicy.IncludedContent property. +// An item to include. const ( - BareMetalServerStatusDeletingConst = "deleting" - BareMetalServerStatusFailedConst = "failed" - BareMetalServerStatusMaintenanceConst = "maintenance" - BareMetalServerStatusPendingConst = "pending" - BareMetalServerStatusRestartingConst = "restarting" - BareMetalServerStatusRunningConst = "running" - BareMetalServerStatusStartingConst = "starting" - BareMetalServerStatusStoppedConst = "stopped" - BareMetalServerStatusStoppingConst = "stopping" + BackupPolicyIncludedContentBootVolumeConst = "boot_volume" + BackupPolicyIncludedContentDataVolumesConst = "data_volumes" ) -// UnmarshalBareMetalServer unmarshals an instance of BareMetalServer from the specified map of raw messages. -func UnmarshalBareMetalServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServer) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) +func (*BackupPolicy) isaBackupPolicy() bool { + return true +} + +type BackupPolicyIntf interface { + isaBackupPolicy() bool +} + +// UnmarshalBackupPolicy unmarshals an instance of BackupPolicy from the specified map of raw messages. +func UnmarshalBackupPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicy) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "boot_target", &obj.BootTarget, UnmarshalBareMetalServerBootTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "cpu", &obj.Cpu, UnmarshalBareMetalServerCpu) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalBareMetalServerLifecycleReason) + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceBareMetalServerContextReference) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceBareMetalServerContextReference) + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileReference) + err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyCollection : BackupPolicyCollection struct +type BackupPolicyCollection struct { + // Collection of backup policies. + BackupPolicies []BackupPolicyIntf `json:"backup_policies" validate:"required"` + + // A link to the first page of resources. + First *BackupPolicyCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BackupPolicyCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalBackupPolicyCollection unmarshals an instance of BackupPolicyCollection from the specified map of raw messages. +func UnmarshalBackupPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyCollection) + err = core.UnmarshalModel(m, "backup_policies", &obj.BackupPolicies, UnmarshalBackupPolicy) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBareMetalServerStatusReason) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModule) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BackupPolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// BackupPolicyCollectionFirst : A link to the first page of resources. +type BackupPolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalBackupPolicyCollectionFirst unmarshals an instance of BackupPolicyCollectionFirst from the specified map of raw messages. +func UnmarshalBackupPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BackupPolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalBackupPolicyCollectionNext unmarshals an instance of BackupPolicyCollectionNext from the specified map of raw messages. +func UnmarshalBackupPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -26356,45 +26820,153 @@ func UnmarshalBareMetalServer(m map[string]json.RawMessage, result interface{}) return } -// BareMetalServerBootTarget : The possible resource types for this property are expected to expand in the future. -// Models which "extend" this model: -// - BareMetalServerBootTargetBareMetalServerDiskReference -type BareMetalServerBootTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` +// BackupPolicyHealthReason : BackupPolicyHealthReason struct +type BackupPolicyHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` - // The URL for this bare metal server disk. - Href *string `json:"href,omitempty"` + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` - // The unique identifier for this bare metal server disk. - ID *string `json:"id,omitempty"` + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. - Name *string `json:"name,omitempty"` +// Constants associated with the BackupPolicyHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + BackupPolicyHealthReasonCodeMissingServiceAuthorizationPoliciesConst = "missing_service_authorization_policies" +) + +// UnmarshalBackupPolicyHealthReason unmarshals an instance of BackupPolicyHealthReason from the specified map of raw messages. +func UnmarshalBackupPolicyHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyJob : BackupPolicyJob struct +type BackupPolicyJob struct { + // Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is + // always `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` + + // If `auto_delete` is `true`, the days after completion that this backup policy job will be deleted. This value may be + // modifiable in the future. + AutoDeleteAfter *int64 `json:"auto_delete_after" validate:"required"` + + // The backup policy plan operated this backup policy job (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan" validate:"required"` + + // The date and time that the backup policy job was completed. + // + // If absent, the backup policy job has not yet completed. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // The date and time that the backup policy job was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this backup policy job. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this backup policy job. + ID *string `json:"id" validate:"required"` + + // The type of backup policy job. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the + // unexpected property value was encountered. + JobType *string `json:"job_type" validate:"required"` // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + ResourceType *string `json:"resource_type" validate:"required"` + + // The source this backup was created from (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + Source BackupPolicyJobSourceIntf `json:"source" validate:"required"` + + // The status of the backup policy job. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []BackupPolicyJobStatusReason `json:"status_reasons" validate:"required"` + + // The snapshots operated on by this backup policy job (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + TargetSnapshots []SnapshotReference `json:"target_snapshots" validate:"required"` } -// Constants associated with the BareMetalServerBootTarget.ResourceType property. -// The resource type. +// Constants associated with the BackupPolicyJob.JobType property. +// The type of backup policy job. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the +// unexpected property value was encountered. const ( - BareMetalServerBootTargetResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" + BackupPolicyJobJobTypeCreationConst = "creation" + BackupPolicyJobJobTypeDeletionConst = "deletion" ) -func (*BareMetalServerBootTarget) isaBareMetalServerBootTarget() bool { - return true -} +// Constants associated with the BackupPolicyJob.ResourceType property. +// The resource type. +const ( + BackupPolicyJobResourceTypeBackupPolicyJobConst = "backup_policy_job" +) -type BareMetalServerBootTargetIntf interface { - isaBareMetalServerBootTarget() bool -} +// Constants associated with the BackupPolicyJob.Status property. +// The status of the backup policy job. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the +// unexpected property value was encountered. +const ( + BackupPolicyJobStatusFailedConst = "failed" + BackupPolicyJobStatusRunningConst = "running" + BackupPolicyJobStatusSucceededConst = "succeeded" +) -// UnmarshalBareMetalServerBootTarget unmarshals an instance of BareMetalServerBootTarget from the specified map of raw messages. -func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerBootTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) +// UnmarshalBackupPolicyJob unmarshals an instance of BackupPolicyJob from the specified map of raw messages. +func UnmarshalBackupPolicyJob(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJob) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete_after", &obj.AutoDeleteAfter) + if err != nil { + return + } + err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -26406,7 +26978,7 @@ func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) if err != nil { return } @@ -26414,41 +26986,19 @@ func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result int if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerCpu : The bare metal server CPU configuration. -type BareMetalServerCpu struct { - // The CPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The total number of cores. - CoreCount *int64 `json:"core_count" validate:"required"` - - // The total number of CPU sockets. - SocketCount *int64 `json:"socket_count" validate:"required"` - - // The total number of hardware threads per core. - ThreadsPerCore *int64 `json:"threads_per_core" validate:"required"` -} - -// UnmarshalBareMetalServerCpu unmarshals an instance of BareMetalServerCpu from the specified map of raw messages. -func UnmarshalBareMetalServerCpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + err = core.UnmarshalModel(m, "source", &obj.Source, UnmarshalBackupPolicyJobSource) if err != nil { return } - err = core.UnmarshalPrimitive(m, "core_count", &obj.CoreCount) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBackupPolicyJobStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "threads_per_core", &obj.ThreadsPerCore) + err = core.UnmarshalModel(m, "target_snapshots", &obj.TargetSnapshots, UnmarshalSnapshotReference) if err != nil { return } @@ -26456,33 +27006,33 @@ func UnmarshalBareMetalServerCpu(m map[string]json.RawMessage, result interface{ return } -// BareMetalServerCollection : BareMetalServerCollection struct -type BareMetalServerCollection struct { - // Collection of bare metal servers. - BareMetalServers []BareMetalServer `json:"bare_metal_servers" validate:"required"` - +// BackupPolicyJobCollection : BackupPolicyJobCollection struct +type BackupPolicyJobCollection struct { // A link to the first page of resources. - First *BareMetalServerCollectionFirst `json:"first" validate:"required"` + First *BackupPolicyJobCollectionFirst `json:"first" validate:"required"` + + // Collection of backup policy jobs. + Jobs []BackupPolicyJob `json:"jobs" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *BareMetalServerCollectionNext `json:"next,omitempty"` + Next *BackupPolicyJobCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalBareMetalServerCollection unmarshals an instance of BareMetalServerCollection from the specified map of raw messages. -func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollection) - err = core.UnmarshalModel(m, "bare_metal_servers", &obj.BareMetalServers, UnmarshalBareMetalServer) +// UnmarshalBackupPolicyJobCollection unmarshals an instance of BackupPolicyJobCollection from the specified map of raw messages. +func UnmarshalBackupPolicyJobCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyJobCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerCollectionFirst) + err = core.UnmarshalModel(m, "jobs", &obj.Jobs, UnmarshalBackupPolicyJob) if err != nil { return } @@ -26490,7 +27040,7 @@ func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyJobCollectionNext) if err != nil { return } @@ -26503,7 +27053,7 @@ func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result int } // Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerCollection) GetNextStart() (*string, error) { +func (resp *BackupPolicyJobCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -26514,15 +27064,15 @@ func (resp *BareMetalServerCollection) GetNextStart() (*string, error) { return start, nil } -// BareMetalServerCollectionFirst : A link to the first page of resources. -type BareMetalServerCollectionFirst struct { +// BackupPolicyJobCollectionFirst : A link to the first page of resources. +type BackupPolicyJobCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalBareMetalServerCollectionFirst unmarshals an instance of BareMetalServerCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollectionFirst) +// UnmarshalBackupPolicyJobCollectionFirst unmarshals an instance of BackupPolicyJobCollectionFirst from the specified map of raw messages. +func UnmarshalBackupPolicyJobCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -26531,15 +27081,15 @@ func UnmarshalBareMetalServerCollectionFirst(m map[string]json.RawMessage, resul return } -// BareMetalServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerCollectionNext struct { +// BackupPolicyJobCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BackupPolicyJobCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalBareMetalServerCollectionNext unmarshals an instance of BareMetalServerCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollectionNext) +// UnmarshalBackupPolicyJobCollectionNext unmarshals an instance of BackupPolicyJobCollectionNext from the specified map of raw messages. +func UnmarshalBackupPolicyJobCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -26548,59 +27098,78 @@ func UnmarshalBareMetalServerCollectionNext(m map[string]json.RawMessage, result return } -// BareMetalServerConsoleAccessToken : The bare metal server console access token information. -type BareMetalServerConsoleAccessToken struct { - // A URL safe single-use token used to access the console WebSocket. - AccessToken *string `json:"access_token" validate:"required"` +// BackupPolicyJobSource : The source this backup was created from (may be +// [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). +// Models which "extend" this model: +// - BackupPolicyJobSourceVolumeReference +// - BackupPolicyJobSourceInstanceReference +type BackupPolicyJobSource struct { + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` - // The bare metal server console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` - // The date and time that the access token was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The URL for this volume. + Href *string `json:"href,omitempty"` - // The date and time that the access token will expire. - ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force" validate:"required"` + // The name for this volume. The name is unique across all volumes in the region. + Name *string `json:"name,omitempty"` - // The URL to access this bare metal server console. - Href *string `json:"href" validate:"required"` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *VolumeRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the BareMetalServerConsoleAccessToken.ConsoleType property. -// The bare metal server console type for which this token may be used. +// Constants associated with the BackupPolicyJobSource.ResourceType property. +// The resource type. const ( - BareMetalServerConsoleAccessTokenConsoleTypeSerialConst = "serial" - BareMetalServerConsoleAccessTokenConsoleTypeVncConst = "vnc" + BackupPolicyJobSourceResourceTypeVolumeConst = "volume" ) -// UnmarshalBareMetalServerConsoleAccessToken unmarshals an instance of BareMetalServerConsoleAccessToken from the specified map of raw messages. -func UnmarshalBareMetalServerConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerConsoleAccessToken) - err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) +func (*BackupPolicyJobSource) isaBackupPolicyJobSource() bool { + return true +} + +type BackupPolicyJobSourceIntf interface { + isaBackupPolicyJobSource() bool +} + +// UnmarshalBackupPolicyJobSource unmarshals an instance of BackupPolicyJobSource from the specified map of raw messages. +func UnmarshalBackupPolicyJobSource(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobSource) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -26608,67 +27177,198 @@ func UnmarshalBareMetalServerConsoleAccessToken(m map[string]json.RawMessage, re return } -// BareMetalServerDisk : BareMetalServerDisk struct -type BareMetalServerDisk struct { - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this bare metal server disk. - Href *string `json:"href" validate:"required"` +// BackupPolicyJobStatusReason : BackupPolicyJobStatusReason struct +type BackupPolicyJobStatusReason struct { + // A snake case string succinctly identifying the status reason: + // - `internal_error`: Internal error (contact IBM support) + // - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state + // - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached + // - `source_volume_busy`: The source volume has `busy` set (after multiple retries). + Code *string `json:"code" validate:"required"` - // The unique identifier for this bare metal server disk. - ID *string `json:"id" validate:"required"` + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` - // The disk interface used for attaching the disk. - // - // - `fcp`: Attached using Fiber Channel Protocol - // - `sata`: Attached using Serial Advanced Technology Attachment - // - `nvme`: Attached using Non-Volatile Memory Express + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the BackupPolicyJobStatusReason.Code property. +// A snake case string succinctly identifying the status reason: +// - `internal_error`: Internal error (contact IBM support) +// - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state +// - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached +// - `source_volume_busy`: The source volume has `busy` set (after multiple retries). +const ( + BackupPolicyJobStatusReasonCodeInternalErrorConst = "internal_error" + BackupPolicyJobStatusReasonCodeSnapshotPendingConst = "snapshot_pending" + BackupPolicyJobStatusReasonCodeSnapshotVolumeLimitConst = "snapshot_volume_limit" + BackupPolicyJobStatusReasonCodeSourceVolumeBusyConst = "source_volume_busy" +) + +// UnmarshalBackupPolicyJobStatusReason unmarshals an instance of BackupPolicyJobStatusReason from the specified map of raw messages. +func UnmarshalBackupPolicyJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyPatch : BackupPolicyPatch struct +type BackupPolicyPatch struct { + // The included content for backups created using this policy: + // - `boot_volume`: Include the instance's boot volume. + // - `data_volumes`: Include the instance's data volumes. + IncludedContent []string `json:"included_content,omitempty"` + + // The user tags this backup policy will apply to (replacing any existing tags). Resources that have both a matching + // user tag and a matching type will be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags,omitempty"` + + // The name for this backup policy. The name must not be used by another backup policy in the region. + Name *string `json:"name,omitempty"` +} + +// Constants associated with the BackupPolicyPatch.IncludedContent property. +// An item to include. +const ( + BackupPolicyPatchIncludedContentBootVolumeConst = "boot_volume" + BackupPolicyPatchIncludedContentDataVolumesConst = "data_volumes" +) + +// UnmarshalBackupPolicyPatch unmarshals an instance of BackupPolicyPatch from the specified map of raw messages. +func UnmarshalBackupPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPatch) + err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the BackupPolicyPatch +func (backupPolicyPatch *BackupPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(backupPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// BackupPolicyPlan : BackupPolicyPlan struct +type BackupPolicyPlan struct { + // Indicates whether the plan is active. + Active *bool `json:"active" validate:"required"` + + // The user tags to attach to backups (snapshots) created by this plan. + AttachUserTags []string `json:"attach_user_tags" validate:"required"` + + ClonePolicy *BackupPolicyPlanClonePolicy `json:"clone_policy" validate:"required"` + + // Indicates whether to copy the source's user tags to the created backups (snapshots). + CopyUserTags *bool `json:"copy_user_tags" validate:"required"` + + // The date and time that the backup policy plan was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The cron specification for the backup schedule. The backup policy jobs + // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes + // after this time. // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` + // All backup schedules for plans in the same policy must be at least an hour apart. + CronSpec *string `json:"cron_spec" validate:"required"` - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. + DeletionTrigger *BackupPolicyPlanDeletionTrigger `json:"deletion_trigger" validate:"required"` + + // The URL for this backup policy plan. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this backup policy plan. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of this backup policy plan. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this backup policy plan. The name is unique across all plans in the backup policy. Name *string `json:"name" validate:"required"` + // The policies for additional backups in remote regions. + RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicy `json:"remote_region_policies" validate:"required"` + // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` } -// Constants associated with the BareMetalServerDisk.InterfaceType property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. +// Constants associated with the BackupPolicyPlan.LifecycleState property. +// The lifecycle state of this backup policy plan. const ( - BareMetalServerDiskInterfaceTypeFcpConst = "fcp" - BareMetalServerDiskInterfaceTypeNvmeConst = "nvme" - BareMetalServerDiskInterfaceTypeSataConst = "sata" + BackupPolicyPlanLifecycleStateDeletingConst = "deleting" + BackupPolicyPlanLifecycleStateFailedConst = "failed" + BackupPolicyPlanLifecycleStatePendingConst = "pending" + BackupPolicyPlanLifecycleStateStableConst = "stable" + BackupPolicyPlanLifecycleStateSuspendedConst = "suspended" + BackupPolicyPlanLifecycleStateUpdatingConst = "updating" + BackupPolicyPlanLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the BareMetalServerDisk.ResourceType property. +// Constants associated with the BackupPolicyPlan.ResourceType property. // The resource type. const ( - BareMetalServerDiskResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" + BackupPolicyPlanResourceTypeBackupPolicyPlanConst = "backup_policy_plan" ) -// UnmarshalBareMetalServerDisk unmarshals an instance of BareMetalServerDisk from the specified map of raw messages. -func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDisk) +// UnmarshalBackupPolicyPlan unmarshals an instance of BackupPolicyPlan from the specified map of raw messages. +func UnmarshalBackupPolicyPlan(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlan) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTrigger) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -26677,7 +27377,7 @@ func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -26685,11 +27385,11 @@ func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicy) if err != nil { return } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -26697,16 +27397,23 @@ func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface return } -// BareMetalServerDiskCollection : BareMetalServerDiskCollection struct -type BareMetalServerDiskCollection struct { - // Collection of the bare metal server's disks. - Disks []BareMetalServerDisk `json:"disks" validate:"required"` +// BackupPolicyPlanClonePolicy : BackupPolicyPlanClonePolicy struct +type BackupPolicyPlanClonePolicy struct { + // The maximum number of recent snapshots (per source) that will keep clones. + MaxSnapshots *int64 `json:"max_snapshots" validate:"required"` + + // The zone this backup policy plan will create snapshot clones in. + Zones []ZoneReference `json:"zones" validate:"required"` } -// UnmarshalBareMetalServerDiskCollection unmarshals an instance of BareMetalServerDiskCollection from the specified map of raw messages. -func UnmarshalBareMetalServerDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) +// UnmarshalBackupPolicyPlanClonePolicy unmarshals an instance of BackupPolicyPlanClonePolicy from the specified map of raw messages. +func UnmarshalBackupPolicyPlanClonePolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanClonePolicy) + err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) if err != nil { return } @@ -26714,16 +27421,24 @@ func UnmarshalBareMetalServerDiskCollection(m map[string]json.RawMessage, result return } -// BareMetalServerDiskPatch : BareMetalServerDiskPatch struct -type BareMetalServerDiskPatch struct { - // The name for this bare metal server disk. The name must not be used by another disk on the bare metal server. - Name *string `json:"name,omitempty"` +// BackupPolicyPlanClonePolicyPatch : BackupPolicyPlanClonePolicyPatch struct +type BackupPolicyPlanClonePolicyPatch struct { + // The maximum number of recent snapshots (per source) that will keep clones. + MaxSnapshots *int64 `json:"max_snapshots,omitempty"` + + // The zones this backup policy plan will create snapshot clones in. Updating this value does not change the clones for + // snapshots that have already been created by this plan. + Zones []ZoneIdentityIntf `json:"zones,omitempty"` } -// UnmarshalBareMetalServerDiskPatch unmarshals an instance of BareMetalServerDiskPatch from the specified map of raw messages. -func UnmarshalBareMetalServerDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBackupPolicyPlanClonePolicyPatch unmarshals an instance of BackupPolicyPlanClonePolicyPatch from the specified map of raw messages. +func UnmarshalBackupPolicyPlanClonePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanClonePolicyPatch) + err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) if err != nil { return } @@ -26731,27 +27446,32 @@ func UnmarshalBareMetalServerDiskPatch(m map[string]json.RawMessage, result inte return } -// AsPatch returns a generic map representation of the BareMetalServerDiskPatch -func (bareMetalServerDiskPatch *BareMetalServerDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// BackupPolicyPlanClonePolicyPrototype : BackupPolicyPlanClonePolicyPrototype struct +type BackupPolicyPlanClonePolicyPrototype struct { + // The maximum number of recent snapshots (per source) that will keep clones. + MaxSnapshots *int64 `json:"max_snapshots,omitempty"` + + // The zone this backup policy plan will create snapshot clones in. + Zones []ZoneIdentityIntf `json:"zones" validate:"required"` } -// BareMetalServerDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerDiskReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// NewBackupPolicyPlanClonePolicyPrototype : Instantiate BackupPolicyPlanClonePolicyPrototype (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyPlanClonePolicyPrototype(zones []ZoneIdentityIntf) (_model *BackupPolicyPlanClonePolicyPrototype, err error) { + _model = &BackupPolicyPlanClonePolicyPrototype{ + Zones: zones, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalBareMetalServerDiskReferenceDeleted unmarshals an instance of BareMetalServerDiskReferenceDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalBackupPolicyPlanClonePolicyPrototype unmarshals an instance of BackupPolicyPlanClonePolicyPrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPlanClonePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanClonePolicyPrototype) + err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) if err != nil { return } @@ -26759,31 +27479,40 @@ func UnmarshalBareMetalServerDiskReferenceDeleted(m map[string]json.RawMessage, return } -// BareMetalServerInitialization : BareMetalServerInitialization struct -type BareMetalServerInitialization struct { - // The image the bare metal server was provisioned from. - Image *ImageReference `json:"image" validate:"required"` - - // The public SSH keys used at initialization. - Keys []KeyReference `json:"keys" validate:"required"` - - // The user accounts that are created at initialization. There can be multiple account types distinguished by the - // `resource_type` property. - UserAccounts []BareMetalServerInitializationUserAccountIntf `json:"user_accounts" validate:"required"` +// BackupPolicyPlanCollection : BackupPolicyPlanCollection struct +type BackupPolicyPlanCollection struct { + // Collection of backup policy plans. + Plans []BackupPolicyPlan `json:"plans" validate:"required"` } -// UnmarshalBareMetalServerInitialization unmarshals an instance of BareMetalServerInitialization from the specified map of raw messages. -func UnmarshalBareMetalServerInitialization(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitialization) - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) +// UnmarshalBackupPolicyPlanCollection unmarshals an instance of BackupPolicyPlanCollection from the specified map of raw messages. +func UnmarshalBackupPolicyPlanCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanCollection) + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlan) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyPlanDeletionTrigger : BackupPolicyPlanDeletionTrigger struct +type BackupPolicyPlanDeletionTrigger struct { + // The maximum number of days to keep each backup after creation. + DeleteAfter *int64 `json:"delete_after" validate:"required"` + + // The maximum number of recent backups to keep. If absent, there is no maximum. + DeleteOverCount *int64 `json:"delete_over_count,omitempty"` +} + +// UnmarshalBackupPolicyPlanDeletionTrigger unmarshals an instance of BackupPolicyPlanDeletionTrigger from the specified map of raw messages. +func UnmarshalBackupPolicyPlanDeletionTrigger(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanDeletionTrigger) + err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) if err != nil { return } - err = core.UnmarshalModel(m, "user_accounts", &obj.UserAccounts, UnmarshalBareMetalServerInitializationUserAccount) + err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) if err != nil { return } @@ -26791,46 +27520,47 @@ func UnmarshalBareMetalServerInitialization(m map[string]json.RawMessage, result return } -// BareMetalServerInitializationPrototype : BareMetalServerInitializationPrototype struct -type BareMetalServerInitializationPrototype struct { - // The image to be used when provisioning the bare metal server. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as - // cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the - // administrative user. - // - // For Windows images, at least one key must be specified, and one will be selected to encrypt the administrator - // password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless - // the specified image provides another means of access. - Keys []KeyIdentityIntf `json:"keys" validate:"required"` +// BackupPolicyPlanDeletionTriggerPatch : BackupPolicyPlanDeletionTriggerPatch struct +type BackupPolicyPlanDeletionTriggerPatch struct { + // The maximum number of days to keep each backup after creation. + DeleteAfter *int64 `json:"delete_after,omitempty"` - // User data to be made available when initializing the bare metal server. - UserData *string `json:"user_data,omitempty"` + // The maximum number of recent backups to keep. Specify `null` to remove any existing maximum. + DeleteOverCount *int64 `json:"delete_over_count,omitempty"` } -// NewBareMetalServerInitializationPrototype : Instantiate BareMetalServerInitializationPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerInitializationPrototype(image ImageIdentityIntf, keys []KeyIdentityIntf) (_model *BareMetalServerInitializationPrototype, err error) { - _model = &BareMetalServerInitializationPrototype{ - Image: image, - Keys: keys, +// UnmarshalBackupPolicyPlanDeletionTriggerPatch unmarshals an instance of BackupPolicyPlanDeletionTriggerPatch from the specified map of raw messages. +func UnmarshalBackupPolicyPlanDeletionTriggerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanDeletionTriggerPatch) + err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBareMetalServerInitializationPrototype unmarshals an instance of BareMetalServerInitializationPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationPrototype) - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyPlanDeletionTriggerPrototype : BackupPolicyPlanDeletionTriggerPrototype struct +type BackupPolicyPlanDeletionTriggerPrototype struct { + // The maximum number of days to keep each backup after creation. + DeleteAfter *int64 `json:"delete_after,omitempty"` + + // The maximum number of recent backups to keep. If unspecified, there will be no maximum. + DeleteOverCount *int64 `json:"delete_over_count,omitempty"` +} + +// UnmarshalBackupPolicyPlanDeletionTriggerPrototype unmarshals an instance of BackupPolicyPlanDeletionTriggerPrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPlanDeletionTriggerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanDeletionTriggerPrototype) + err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) if err != nil { return } @@ -26838,90 +27568,68 @@ func UnmarshalBareMetalServerInitializationPrototype(m map[string]json.RawMessag return } -// BareMetalServerInitializationUserAccount : BareMetalServerInitializationUserAccount struct -// Models which "extend" this model: -// - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount -type BareMetalServerInitializationUserAccount struct { - // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password,omitempty"` +// BackupPolicyPlanPatch : BackupPolicyPlanPatch struct +type BackupPolicyPlanPatch struct { + // Indicates whether the plan is active. + Active *bool `json:"active,omitempty"` - // The public SSH key used to encrypt the password. - EncryptionKey *KeyReference `json:"encryption_key,omitempty"` + // The user tags to attach to backups (snapshots) created by this plan. Updating this value does not change the user + // tags for backups that have already been created by this plan. + AttachUserTags []string `json:"attach_user_tags,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + ClonePolicy *BackupPolicyPlanClonePolicyPatch `json:"clone_policy,omitempty"` - // The username for the account created at initialization. - Username *string `json:"username,omitempty"` -} + // Indicates whether to copy the source's user tags to the created backups (snapshots). + CopyUserTags *bool `json:"copy_user_tags,omitempty"` -// Constants associated with the BareMetalServerInitializationUserAccount.ResourceType property. -// The resource type. -const ( - BareMetalServerInitializationUserAccountResourceTypeHostUserAccountConst = "host_user_account" -) + // The cron specification for the backup schedule. The backup policy jobs + // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes + // after this time. + // + // All backup schedules for plans in the same policy must be at least an hour apart. + CronSpec *string `json:"cron_spec,omitempty"` -func (*BareMetalServerInitializationUserAccount) isaBareMetalServerInitializationUserAccount() bool { - return true -} + DeletionTrigger *BackupPolicyPlanDeletionTriggerPatch `json:"deletion_trigger,omitempty"` -type BareMetalServerInitializationUserAccountIntf interface { - isaBareMetalServerInitializationUserAccount() bool + // The name for this backup policy plan. The name must not be used by another plan for the backup policy. + Name *string `json:"name,omitempty"` + + // The policies for additional backups in remote regions (replacing any existing policies). + RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` } -// UnmarshalBareMetalServerInitializationUserAccount unmarshals an instance of BareMetalServerInitializationUserAccount from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationUserAccount) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) +// UnmarshalBackupPolicyPlanPatch unmarshals an instance of BackupPolicyPlanPatch from the specified map of raw messages. +func UnmarshalBackupPolicyPlanPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanPatch) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) + err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) + err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerLifecycleReason : BareMetalServerLifecycleReason struct -type BareMetalServerLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BareMetalServerLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - BareMetalServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalBareMetalServerLifecycleReason unmarshals an instance of BareMetalServerLifecycleReason from the specified map of raw messages. -func UnmarshalBareMetalServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) if err != nil { return } @@ -26929,221 +27637,147 @@ func UnmarshalBareMetalServerLifecycleReason(m map[string]json.RawMessage, resul return } -// BareMetalServerNetworkInterface : BareMetalServerNetworkInterface struct -// Models which "extend" this model: -// - BareMetalServerNetworkInterfaceByHiperSocket -// - BareMetalServerNetworkInterfaceByPci -// - BareMetalServerNetworkInterfaceByVlan -type BareMetalServerNetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` +// AsPatch returns a generic map representation of the BackupPolicyPlanPatch +func (backupPolicyPlanPatch *BackupPolicyPlanPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(backupPolicyPlanPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The date and time that the bare metal server network interface was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// BackupPolicyPlanPrototype : BackupPolicyPlanPrototype struct +type BackupPolicyPlanPrototype struct { + // Indicates whether the plan is active. + Active *bool `json:"active,omitempty"` - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` + // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. + AttachUserTags []string `json:"attach_user_tags,omitempty"` - // The floating IPs associated with this bare metal server network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` - - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - // The bare metal server network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network interface type. - Type *string `json:"type" validate:"required"` + ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + // Indicates whether to copy the source's user tags to the created backups (snapshots). + CopyUserTags *bool `json:"copy_user_tags,omitempty"` - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. + // The cron specification for the backup schedule. The backup policy jobs + // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes + // after this time. // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - Vlan *int64 `json:"vlan,omitempty"` -} - -// Constants associated with the BareMetalServerNetworkInterface.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerNetworkInterfaceInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerNetworkInterfaceInterfaceTypePciConst = "pci" - BareMetalServerNetworkInterfaceInterfaceTypeVlanConst = "vlan" -) - -// Constants associated with the BareMetalServerNetworkInterface.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" -) + // All backup schedules for plans in the same policy must be at least an hour apart. + CronSpec *string `json:"cron_spec" validate:"required"` -// Constants associated with the BareMetalServerNetworkInterface.Status property. -// The status of the bare metal server network interface. -const ( - BareMetalServerNetworkInterfaceStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceStatusPendingConst = "pending" -) + DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` -// Constants associated with the BareMetalServerNetworkInterface.Type property. -// The bare metal server network interface type. -const ( - BareMetalServerNetworkInterfaceTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceTypeSecondaryConst = "secondary" -) + // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -func (*BareMetalServerNetworkInterface) isaBareMetalServerNetworkInterface() bool { - return true + // The policies for additional backups in remote regions. + RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` } -type BareMetalServerNetworkInterfaceIntf interface { - isaBareMetalServerNetworkInterface() bool +// NewBackupPolicyPlanPrototype : Instantiate BackupPolicyPlanPrototype (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyPlanPrototype(cronSpec string) (_model *BackupPolicyPlanPrototype, err error) { + _model = &BackupPolicyPlanPrototype{ + CronSpec: core.StringPtr(cronSpec), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalBareMetalServerNetworkInterface unmarshals an instance of BareMetalServerNetworkInterface from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "interface_type", &discValue) +// UnmarshalBackupPolicyPlanPrototype unmarshals an instance of BackupPolicyPlanPrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanPrototype) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) + if err != nil { return } - if discValue == "hipersocket" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByHiperSocket) - } else if discValue == "pci" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByPci) - } else if discValue == "vlan" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByVlan) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPrototype) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// BareMetalServerNetworkInterfaceCollection : BareMetalServerNetworkInterfaceCollection struct -type BareMetalServerNetworkInterfaceCollection struct { - // A link to the first page of resources. - First *BareMetalServerNetworkInterfaceCollectionFirst `json:"first" validate:"required"` +// BackupPolicyPlanReference : BackupPolicyPlanReference struct +type BackupPolicyPlanReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BackupPolicyPlanReferenceDeleted `json:"deleted,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The URL for this backup policy plan. + Href *string `json:"href" validate:"required"` - // Collection of bare metal server network interfaces. - NetworkInterfaces []BareMetalServerNetworkInterfaceIntf `json:"network_interfaces" validate:"required"` + // The unique identifier for this backup policy plan. + ID *string `json:"id" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BareMetalServerNetworkInterfaceCollectionNext `json:"next,omitempty"` + // The name for this backup policy plan. The name is unique across all plans in the backup policy. + Name *string `json:"name" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *BackupPolicyPlanRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalBareMetalServerNetworkInterfaceCollection unmarshals an instance of BareMetalServerNetworkInterfaceCollection from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkInterfaceCollectionFirst) +// Constants associated with the BackupPolicyPlanReference.ResourceType property. +// The resource type. +const ( + BackupPolicyPlanReferenceResourceTypeBackupPolicyPlanConst = "backup_policy_plan" +) + +// UnmarshalBackupPolicyPlanReference unmarshals an instance of BackupPolicyPlanReference from the specified map of raw messages. +func UnmarshalBackupPolicyPlanReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBackupPolicyPlanReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterface) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkInterfaceCollectionNext) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalBackupPolicyPlanRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -27151,28 +27785,36 @@ func UnmarshalBareMetalServerNetworkInterfaceCollection(m map[string]json.RawMes return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerNetworkInterfaceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// BackupPolicyPlanReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type BackupPolicyPlanReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalBackupPolicyPlanReferenceDeleted unmarshals an instance of BackupPolicyPlanReferenceDeleted from the specified map of raw messages. +func UnmarshalBackupPolicyPlanReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } - return start, nil + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// BareMetalServerNetworkInterfaceCollectionFirst : A link to the first page of resources. -type BareMetalServerNetworkInterfaceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// BackupPolicyPlanRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type BackupPolicyPlanRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` } -// UnmarshalBareMetalServerNetworkInterfaceCollectionFirst unmarshals an instance of BareMetalServerNetworkInterfaceCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBackupPolicyPlanRemote unmarshals an instance of BackupPolicyPlanRemote from the specified map of raw messages. +func UnmarshalBackupPolicyPlanRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanRemote) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) if err != nil { return } @@ -27180,16 +27822,30 @@ func UnmarshalBareMetalServerNetworkInterfaceCollectionFirst(m map[string]json.R return } -// BareMetalServerNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerNetworkInterfaceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// BackupPolicyPlanRemoteRegionPolicy : BackupPolicyPlanRemoteRegionPolicy struct +type BackupPolicyPlanRemoteRegionPolicy struct { + // The region this backup policy plan will create backups in. + DeleteOverCount *int64 `json:"delete_over_count" validate:"required"` + + // The root key used to rewrap the data encryption key for the backup (snapshot). + EncryptionKey *EncryptionKeyReference `json:"encryption_key" validate:"required"` + + // The region this backup policy plan will create backups in. + Region *RegionReference `json:"region" validate:"required"` } -// UnmarshalBareMetalServerNetworkInterfaceCollectionNext unmarshals an instance of BareMetalServerNetworkInterfaceCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBackupPolicyPlanRemoteRegionPolicy unmarshals an instance of BackupPolicyPlanRemoteRegionPolicy from the specified map of raw messages. +func UnmarshalBackupPolicyPlanRemoteRegionPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanRemoteRegionPolicy) + err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) if err != nil { return } @@ -27197,47 +27853,42 @@ func UnmarshalBareMetalServerNetworkInterfaceCollectionNext(m map[string]json.Ra return } -// BareMetalServerNetworkInterfacePatch : BareMetalServerNetworkInterfacePatch struct -type BareMetalServerNetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface, replacing any existing VLAN IDs. The specified - // values must include IDs for all `vlan` interfaces currently using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` +// BackupPolicyPlanRemoteRegionPolicyPrototype : BackupPolicyPlanRemoteRegionPolicyPrototype struct +type BackupPolicyPlanRemoteRegionPolicyPrototype struct { + // The region this backup policy plan will create backups in. + DeleteOverCount *int64 `json:"delete_over_count,omitempty"` - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. + // The root key to use to rewrap the data encryption key for the backup (snapshot). // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + // If unspecified, the source's `encryption_key` will be used. + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. - Name *string `json:"name,omitempty"` + // The region this backup policy plan will create backups in. + Region RegionIdentityIntf `json:"region" validate:"required"` } -// UnmarshalBareMetalServerNetworkInterfacePatch unmarshals an instance of BareMetalServerNetworkInterfacePatch from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return +// NewBackupPolicyPlanRemoteRegionPolicyPrototype : Instantiate BackupPolicyPlanRemoteRegionPolicyPrototype (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyPlanRemoteRegionPolicyPrototype(region RegionIdentityIntf) (_model *BackupPolicyPlanRemoteRegionPolicyPrototype, err error) { + _model = &BackupPolicyPlanRemoteRegionPolicyPrototype{ + Region: region, } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype unmarshals an instance of BackupPolicyPlanRemoteRegionPolicyPrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPlanRemoteRegionPolicyPrototype) + err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionIdentity) if err != nil { return } @@ -27245,212 +27896,92 @@ func UnmarshalBareMetalServerNetworkInterfacePatch(m map[string]json.RawMessage, return } -// AsPatch returns a generic map representation of the BareMetalServerNetworkInterfacePatch -func (bareMetalServerNetworkInterfacePatch *BareMetalServerNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerNetworkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerNetworkInterfacePrototype : BareMetalServerNetworkInterfacePrototype struct +// BackupPolicyPrototype : BackupPolicyPrototype struct // Models which "extend" this model: -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype -type BareMetalServerNetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` +// - BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype +// - BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype +type BackupPolicyPrototype struct { + // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + MatchResourceType *string `json:"match_resource_type" validate:"required"` - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` + // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type + // will be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. + // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The primary IP address to bind to the bare metal server network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the bare metal server network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The prototype objects for backup plans to be created for this backup policy. + Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. + // The scope to use for this backup policy. // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` + // If unspecified, the policy will be scoped to the account. + Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - Vlan *int64 `json:"vlan,omitempty"` + // The included content for backups created using this policy: + // - `boot_volume`: Include the instance's boot volume. + // - `data_volumes`: Include the instance's data volumes. + IncludedContent []string `json:"included_content,omitempty"` } -// Constants associated with the BareMetalServerNetworkInterfacePrototype.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x` -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. +// Constants associated with the BackupPolicyPrototype.MatchResourceType property. +// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. const ( - BareMetalServerNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerNetworkInterfacePrototypeInterfaceTypePciConst = "pci" - BareMetalServerNetworkInterfacePrototypeInterfaceTypeVlanConst = "vlan" + BackupPolicyPrototypeMatchResourceTypeInstanceConst = "instance" + BackupPolicyPrototypeMatchResourceTypeVolumeConst = "volume" ) -func (*BareMetalServerNetworkInterfacePrototype) isaBareMetalServerNetworkInterfacePrototype() bool { +// Constants associated with the BackupPolicyPrototype.IncludedContent property. +// An item to include. +const ( + BackupPolicyPrototypeIncludedContentBootVolumeConst = "boot_volume" + BackupPolicyPrototypeIncludedContentDataVolumesConst = "data_volumes" +) + +func (*BackupPolicyPrototype) isaBackupPolicyPrototype() bool { return true } -type BareMetalServerNetworkInterfacePrototypeIntf interface { - isaBareMetalServerNetworkInterfacePrototype() bool +type BackupPolicyPrototypeIntf interface { + isaBackupPolicyPrototype() bool } -// UnmarshalBareMetalServerNetworkInterfacePrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "interface_type", &discValue) +// UnmarshalBackupPolicyPrototype unmarshals an instance of BackupPolicyPrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPrototype) + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) + if err != nil { return } - if discValue == "hipersocket" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) - } else if discValue == "pci" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) - } else if discValue == "vlan" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } - return -} - -// BareMetalServerNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerNetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerNetworkInterfaceReferenceTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPatch : BareMetalServerPatch struct -type BareMetalServerPatch struct { - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the bare metal server - // will fail to boot. - // - // For `enable_secure_boot` to be changed, the bare metal server `status` must be - // `stopped`. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - - // The name for this bare metal server. The name must not be used by another bare metal server in the region. Changing - // the name will not affect the system hostname. - Name *string `json:"name,omitempty"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePatch `json:"trusted_platform_module,omitempty"` -} - -// UnmarshalBareMetalServerPatch unmarshals an instance of BareMetalServerPatch from the specified map of raw messages. -func UnmarshalBareMetalServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPatch) - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePatch) + err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) if err != nil { return } @@ -27458,124 +27989,76 @@ func UnmarshalBareMetalServerPatch(m map[string]json.RawMessage, result interfac return } -// AsPatch returns a generic map representation of the BareMetalServerPatch -func (bareMetalServerPatch *BareMetalServerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerPrimaryNetworkInterfacePrototype : BareMetalServerPrimaryNetworkInterfacePrototype struct -type BareMetalServerPrimaryNetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the bare metal server network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` +// BackupPolicyScope : The scope for this backup policy. +// Models which "extend" this model: +// - BackupPolicyScopeEnterpriseReference +// - BackupPolicyScopeAccountReference +type BackupPolicyScope struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The unique identifier for this enterprise. + ID *string `json:"id,omitempty"` - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the BareMetalServerPrimaryNetworkInterfacePrototype.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. +// Constants associated with the BackupPolicyScope.ResourceType property. +// The resource type. const ( - BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypePciConst = "pci" + BackupPolicyScopeResourceTypeEnterpriseConst = "enterprise" ) -// NewBareMetalServerPrimaryNetworkInterfacePrototype : Instantiate BareMetalServerPrimaryNetworkInterfacePrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerPrimaryNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *BareMetalServerPrimaryNetworkInterfacePrototype, err error) { - _model = &BareMetalServerPrimaryNetworkInterfacePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*BackupPolicyScope) isaBackupPolicyScope() bool { + return true } -// UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype unmarshals an instance of BareMetalServerPrimaryNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrimaryNetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +type BackupPolicyScopeIntf interface { + isaBackupPolicyScope() bool +} + +// UnmarshalBackupPolicyScope unmarshals an instance of BackupPolicyScope from the specified map of raw messages. +func UnmarshalBackupPolicyScope(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScope) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BackupPolicyScopePrototype : The scope to use for this backup policy. +// +// If unspecified, the policy will be scoped to the account. +// Models which "extend" this model: +// - BackupPolicyScopePrototypeEnterpriseIdentity +type BackupPolicyScopePrototype struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` +} + +func (*BackupPolicyScopePrototype) isaBackupPolicyScopePrototype() bool { + return true +} + +type BackupPolicyScopePrototypeIntf interface { + isaBackupPolicyScopePrototype() bool +} + +// UnmarshalBackupPolicyScopePrototype unmarshals an instance of BackupPolicyScopePrototype from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -27583,78 +28066,164 @@ func UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(m map[string]json. return } -// BareMetalServerProfile : BareMetalServerProfile struct -type BareMetalServerProfile struct { - Bandwidth BareMetalServerProfileBandwidthIntf `json:"bandwidth" validate:"required"` +// BareMetalServer : BareMetalServer struct +type BareMetalServer struct { + // The total bandwidth (in megabits per second) shared across the bare metal server network attachments or bare metal + // server network interfaces. + Bandwidth *int64 `json:"bandwidth" validate:"required"` - // The console type configuration for a bare metal server with this profile. - ConsoleTypes *BareMetalServerProfileConsoleTypes `json:"console_types" validate:"required"` + // The possible resource types for this property are expected to expand in the future. + BootTarget BareMetalServerBootTargetIntf `json:"boot_target" validate:"required"` - CpuArchitecture *BareMetalServerProfileCpuArchitecture `json:"cpu_architecture" validate:"required"` + // The bare metal server CPU configuration. + Cpu *BareMetalServerCpu `json:"cpu" validate:"required"` - CpuCoreCount BareMetalServerProfileCpuCoreCountIntf `json:"cpu_core_count" validate:"required"` + // The date and time that the bare metal server was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - CpuSocketCount BareMetalServerProfileCpuSocketCountIntf `json:"cpu_socket_count" validate:"required"` + // The CRN for this bare metal server. + CRN *string `json:"crn" validate:"required"` - // Collection of the bare metal server profile's disks. - Disks []BareMetalServerProfileDisk `json:"disks" validate:"required"` + // The disks for this bare metal server, including any disks that are associated with the + // `boot_target`. + Disks []BareMetalServerDisk `json:"disks" validate:"required"` - // The product family this bare metal server profile belongs to. - Family *string `json:"family" validate:"required"` + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to + // boot. + EnableSecureBoot *bool `json:"enable_secure_boot" validate:"required"` - // The URL for this bare metal server profile. + // The URL for this bare metal server. Href *string `json:"href" validate:"required"` - Memory BareMetalServerProfileMemoryIntf `json:"memory" validate:"required"` + // The unique identifier for this bare metal server. + ID *string `json:"id" validate:"required"` - // The name for this bare metal server profile. + // The reasons for the current `lifecycle_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []BareMetalServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the bare metal server. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The amount of memory, truncated to whole gibibytes. + Memory *int64 `json:"memory" validate:"required"` + + // The name for this bare metal server. The name is unique across all bare metal servers in the region. Name *string `json:"name" validate:"required"` - NetworkInterfaceCount BareMetalServerProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` + // The network attachments for this bare metal server, including the primary network attachment. + NetworkAttachments []BareMetalServerNetworkAttachmentReference `json:"network_attachments,omitempty"` - OsArchitecture *BareMetalServerProfileOsArchitecture `json:"os_architecture" validate:"required"` + // The network interfaces for this bare metal server, including the primary network interface. + // + // If this bare metal server has network attachments, each network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface. + NetworkInterfaces []NetworkInterfaceBareMetalServerContextReference `json:"network_interfaces" validate:"required"` + + // The primary network attachment for this bare metal server. + PrimaryNetworkAttachment *BareMetalServerNetworkAttachmentReference `json:"primary_network_attachment,omitempty"` + + // The primary network interface for this bare metal server. + // + // If this bare metal server has network attachments, this primary network interface is + // a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + // of the primary network attachment and its attached virtual network interface. + PrimaryNetworkInterface *NetworkInterfaceBareMetalServerContextReference `json:"primary_network_interface" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + // for this bare metal server. + Profile *BareMetalServerProfileReference `json:"profile" validate:"required"` + + // The resource group for this bare metal server. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The supported trusted platform module modes for this bare metal server profile. - SupportedTrustedPlatformModuleModes *BareMetalServerProfileSupportedTrustedPlatformModuleModes `json:"supported_trusted_platform_module_modes" validate:"required"` + // The status of the bare metal server. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []BareMetalServerStatusReason `json:"status_reasons" validate:"required"` + + TrustedPlatformModule *BareMetalServerTrustedPlatformModule `json:"trusted_platform_module" validate:"required"` + + // The VPC this bare metal server resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // The zone this bare metal server resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the BareMetalServerProfile.ResourceType property. +// Constants associated with the BareMetalServer.LifecycleState property. +// The lifecycle state of the bare metal server. +const ( + BareMetalServerLifecycleStateDeletingConst = "deleting" + BareMetalServerLifecycleStateFailedConst = "failed" + BareMetalServerLifecycleStatePendingConst = "pending" + BareMetalServerLifecycleStateStableConst = "stable" + BareMetalServerLifecycleStateSuspendedConst = "suspended" + BareMetalServerLifecycleStateUpdatingConst = "updating" + BareMetalServerLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the BareMetalServer.ResourceType property. // The resource type. const ( - BareMetalServerProfileResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" + BareMetalServerResourceTypeBareMetalServerConst = "bare_metal_server" ) -// UnmarshalBareMetalServerProfile unmarshals an instance of BareMetalServerProfile from the specified map of raw messages. -func UnmarshalBareMetalServerProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfile) - err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalBareMetalServerProfileBandwidth) +// Constants associated with the BareMetalServer.Status property. +// The status of the bare metal server. +const ( + BareMetalServerStatusDeletingConst = "deleting" + BareMetalServerStatusFailedConst = "failed" + BareMetalServerStatusMaintenanceConst = "maintenance" + BareMetalServerStatusPendingConst = "pending" + BareMetalServerStatusRestartingConst = "restarting" + BareMetalServerStatusRunningConst = "running" + BareMetalServerStatusStartingConst = "starting" + BareMetalServerStatusStoppedConst = "stopped" + BareMetalServerStatusStoppingConst = "stopping" +) + +// UnmarshalBareMetalServer unmarshals an instance of BareMetalServer from the specified map of raw messages. +func UnmarshalBareMetalServer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServer) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "console_types", &obj.ConsoleTypes, UnmarshalBareMetalServerProfileConsoleTypes) + err = core.UnmarshalModel(m, "boot_target", &obj.BootTarget, UnmarshalBareMetalServerBootTarget) if err != nil { return } - err = core.UnmarshalModel(m, "cpu_architecture", &obj.CpuArchitecture, UnmarshalBareMetalServerProfileCpuArchitecture) + err = core.UnmarshalModel(m, "cpu", &obj.Cpu, UnmarshalBareMetalServerCpu) if err != nil { return } - err = core.UnmarshalModel(m, "cpu_core_count", &obj.CpuCoreCount, UnmarshalBareMetalServerProfileCpuCoreCount) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "cpu_socket_count", &obj.CpuSocketCount, UnmarshalBareMetalServerProfileCpuSocketCount) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerProfileDisk) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) if err != nil { return } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) if err != nil { return } @@ -27662,142 +28231,71 @@ func UnmarshalBareMetalServerProfile(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalBareMetalServerProfileMemory) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalBareMetalServerLifecycleReason) if err != nil { return } - err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalBareMetalServerProfileNetworkInterfaceCount) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalBareMetalServerProfileOsArchitecture) + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "supported_trusted_platform_module_modes", &obj.SupportedTrustedPlatformModuleModes, UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidth : BareMetalServerProfileBandwidth struct -// Models which "extend" this model: -// - BareMetalServerProfileBandwidthFixed -// - BareMetalServerProfileBandwidthRange -// - BareMetalServerProfileBandwidthEnum -// - BareMetalServerProfileBandwidthDependent -type BareMetalServerProfileBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileBandwidth.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileBandwidth) isaBareMetalServerProfileBandwidth() bool { - return true -} - -type BareMetalServerProfileBandwidthIntf interface { - isaBareMetalServerProfileBandwidth() bool -} - -// UnmarshalBareMetalServerProfileBandwidth unmarshals an instance of BareMetalServerProfileBandwidth from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceBareMetalServerContextReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerNetworkAttachmentReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceBareMetalServerContextReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuArchitecture : BareMetalServerProfileCpuArchitecture struct -type BareMetalServerProfileCpuArchitecture struct { - // The default CPU architecture for a bare metal server with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The CPU architecture for a bare metal server with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuArchitecture.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuArchitectureTypeFixedConst = "fixed" -) - -// UnmarshalBareMetalServerProfileCpuArchitecture unmarshals an instance of BareMetalServerProfileCpuArchitecture from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBareMetalServerStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModule) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -27805,77 +28303,61 @@ func UnmarshalBareMetalServerProfileCpuArchitecture(m map[string]json.RawMessage return } -// BareMetalServerProfileCpuCoreCount : BareMetalServerProfileCpuCoreCount struct +// BareMetalServerBootTarget : The possible resource types for this property are expected to expand in the future. // Models which "extend" this model: -// - BareMetalServerProfileCpuCoreCountFixed -// - BareMetalServerProfileCpuCoreCountRange -// - BareMetalServerProfileCpuCoreCountEnum -// - BareMetalServerProfileCpuCoreCountDependent -type BareMetalServerProfileCpuCoreCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// - BareMetalServerBootTargetBareMetalServerDiskReference +type BareMetalServerBootTarget struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The URL for this bare metal server disk. + Href *string `json:"href,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The unique identifier for this bare metal server disk. + ID *string `json:"id,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. + Name *string `json:"name,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the BareMetalServerProfileCpuCoreCount.Type property. -// The type for this profile field. +// Constants associated with the BareMetalServerBootTarget.ResourceType property. +// The resource type. const ( - BareMetalServerProfileCpuCoreCountTypeFixedConst = "fixed" + BareMetalServerBootTargetResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" ) -func (*BareMetalServerProfileCpuCoreCount) isaBareMetalServerProfileCpuCoreCount() bool { +func (*BareMetalServerBootTarget) isaBareMetalServerBootTarget() bool { return true } -type BareMetalServerProfileCpuCoreCountIntf interface { - isaBareMetalServerProfileCpuCoreCount() bool +type BareMetalServerBootTargetIntf interface { + isaBareMetalServerBootTarget() bool } -// UnmarshalBareMetalServerProfileCpuCoreCount unmarshals an instance of BareMetalServerProfileCpuCoreCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalBareMetalServerBootTarget unmarshals an instance of BareMetalServerBootTarget from the specified map of raw messages. +func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerBootTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -27883,77 +28365,37 @@ func UnmarshalBareMetalServerProfileCpuCoreCount(m map[string]json.RawMessage, r return } -// BareMetalServerProfileCpuSocketCount : BareMetalServerProfileCpuSocketCount struct -// Models which "extend" this model: -// - BareMetalServerProfileCpuSocketCountFixed -// - BareMetalServerProfileCpuSocketCountRange -// - BareMetalServerProfileCpuSocketCountEnum -// - BareMetalServerProfileCpuSocketCountDependent -type BareMetalServerProfileCpuSocketCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} +// BareMetalServerCpu : The bare metal server CPU configuration. +type BareMetalServerCpu struct { + // The CPU architecture. + Architecture *string `json:"architecture" validate:"required"` -// Constants associated with the BareMetalServerProfileCpuSocketCount.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountTypeFixedConst = "fixed" -) + // The total number of cores. + CoreCount *int64 `json:"core_count" validate:"required"` -func (*BareMetalServerProfileCpuSocketCount) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} + // The total number of CPU sockets. + SocketCount *int64 `json:"socket_count" validate:"required"` -type BareMetalServerProfileCpuSocketCountIntf interface { - isaBareMetalServerProfileCpuSocketCount() bool + // The total number of hardware threads per core. + ThreadsPerCore *int64 `json:"threads_per_core" validate:"required"` } -// UnmarshalBareMetalServerProfileCpuSocketCount unmarshals an instance of BareMetalServerProfileCpuSocketCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalBareMetalServerCpu unmarshals an instance of BareMetalServerCpu from the specified map of raw messages. +func UnmarshalBareMetalServerCpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "core_count", &obj.CoreCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "threads_per_core", &obj.ThreadsPerCore) if err != nil { return } @@ -27961,41 +28403,41 @@ func UnmarshalBareMetalServerProfileCpuSocketCount(m map[string]json.RawMessage, return } -// BareMetalServerProfileCollection : BareMetalServerProfileCollection struct -type BareMetalServerProfileCollection struct { +// BareMetalServerCollection : BareMetalServerCollection struct +type BareMetalServerCollection struct { + // Collection of bare metal servers. + BareMetalServers []BareMetalServer `json:"bare_metal_servers" validate:"required"` + // A link to the first page of resources. - First *BareMetalServerProfileCollectionFirst `json:"first" validate:"required"` + First *BareMetalServerCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *BareMetalServerProfileCollectionNext `json:"next,omitempty"` - - // Collection of bare metal server profiles. - Profiles []BareMetalServerProfile `json:"profiles" validate:"required"` + Next *BareMetalServerCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalBareMetalServerProfileCollection unmarshals an instance of BareMetalServerProfileCollection from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerProfileCollectionFirst) +// UnmarshalBareMetalServerCollection unmarshals an instance of BareMetalServerCollection from the specified map of raw messages. +func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollection) + err = core.UnmarshalModel(m, "bare_metal_servers", &obj.BareMetalServers, UnmarshalBareMetalServer) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalBareMetalServerProfile) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerCollectionNext) if err != nil { return } @@ -28008,7 +28450,7 @@ func UnmarshalBareMetalServerProfileCollection(m map[string]json.RawMessage, res } // Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerProfileCollection) GetNextStart() (*string, error) { +func (resp *BareMetalServerCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -28019,15 +28461,15 @@ func (resp *BareMetalServerProfileCollection) GetNextStart() (*string, error) { return start, nil } -// BareMetalServerProfileCollectionFirst : A link to the first page of resources. -type BareMetalServerProfileCollectionFirst struct { +// BareMetalServerCollectionFirst : A link to the first page of resources. +type BareMetalServerCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalBareMetalServerProfileCollectionFirst unmarshals an instance of BareMetalServerProfileCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollectionFirst) +// UnmarshalBareMetalServerCollectionFirst unmarshals an instance of BareMetalServerCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -28036,15 +28478,15 @@ func UnmarshalBareMetalServerProfileCollectionFirst(m map[string]json.RawMessage return } -// BareMetalServerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerProfileCollectionNext struct { +// BareMetalServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalBareMetalServerProfileCollectionNext unmarshals an instance of BareMetalServerProfileCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollectionNext) +// UnmarshalBareMetalServerCollectionNext unmarshals an instance of BareMetalServerCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -28053,64 +28495,59 @@ func UnmarshalBareMetalServerProfileCollectionNext(m map[string]json.RawMessage, return } -// BareMetalServerProfileConsoleTypes : The console type configuration for a bare metal server with this profile. -type BareMetalServerProfileConsoleTypes struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// BareMetalServerConsoleAccessToken : The bare metal server console access token information. +type BareMetalServerConsoleAccessToken struct { + // A URL safe single-use token used to access the console WebSocket. + AccessToken *string `json:"access_token" validate:"required"` - // The console types for a bare metal server with this profile. - Values []string `json:"values" validate:"required"` -} + // The bare metal server console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` -// Constants associated with the BareMetalServerProfileConsoleTypes.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileConsoleTypesTypeEnumConst = "enum" -) + // The date and time that the access token was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// Constants associated with the BareMetalServerProfileConsoleTypes.Values property. -// A console type. + // The date and time that the access token will expire. + ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` + + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force" validate:"required"` + + // The URL to access this bare metal server console. + Href *string `json:"href" validate:"required"` +} + +// Constants associated with the BareMetalServerConsoleAccessToken.ConsoleType property. +// The bare metal server console type for which this token may be used. const ( - BareMetalServerProfileConsoleTypesValuesSerialConst = "serial" - BareMetalServerProfileConsoleTypesValuesVncConst = "vnc" + BareMetalServerConsoleAccessTokenConsoleTypeSerialConst = "serial" + BareMetalServerConsoleAccessTokenConsoleTypeVncConst = "vnc" ) -// UnmarshalBareMetalServerProfileConsoleTypes unmarshals an instance of BareMetalServerProfileConsoleTypes from the specified map of raw messages. -func UnmarshalBareMetalServerProfileConsoleTypes(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileConsoleTypes) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalBareMetalServerConsoleAccessToken unmarshals an instance of BareMetalServerConsoleAccessToken from the specified map of raw messages. +func UnmarshalBareMetalServerConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerConsoleAccessToken) + err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDisk : Disks provided by this profile. -type BareMetalServerProfileDisk struct { - Quantity BareMetalServerProfileDiskQuantityIntf `json:"quantity" validate:"required"` - - Size BareMetalServerProfileDiskSizeIntf `json:"size" validate:"required"` - - SupportedInterfaceTypes *BareMetalServerProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` -} - -// UnmarshalBareMetalServerProfileDisk unmarshals an instance of BareMetalServerProfileDisk from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDisk) - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalBareMetalServerProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalBareMetalServerProfileDiskSize) + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) if err != nil { return } - err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalBareMetalServerProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "force", &obj.Force) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -28118,77 +28555,88 @@ func UnmarshalBareMetalServerProfileDisk(m map[string]json.RawMessage, result in return } -// BareMetalServerProfileDiskQuantity : BareMetalServerProfileDiskQuantity struct -// Models which "extend" this model: -// - BareMetalServerProfileDiskQuantityFixed -// - BareMetalServerProfileDiskQuantityRange -// - BareMetalServerProfileDiskQuantityEnum -// - BareMetalServerProfileDiskQuantityDependent -type BareMetalServerProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// BareMetalServerDisk : BareMetalServerDisk struct +type BareMetalServerDisk struct { + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The URL for this bare metal server disk. + Href *string `json:"href" validate:"required"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The unique identifier for this bare metal server disk. + ID *string `json:"id" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The disk interface used for attaching the disk. + // + // - `fcp`: Attached using Fiber Channel Protocol + // - `sata`: Attached using Serial Advanced Technology Attachment + // - `nvme`: Attached using Non-Volatile Memory Express + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. + Name *string `json:"name" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskQuantity.Type property. -// The type for this profile field. +// Constants associated with the BareMetalServerDisk.InterfaceType property. +// The disk interface used for attaching the disk. +// +// - `fcp`: Attached using Fiber Channel Protocol +// - `sata`: Attached using Serial Advanced Technology Attachment +// - `nvme`: Attached using Non-Volatile Memory Express +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. const ( - BareMetalServerProfileDiskQuantityTypeFixedConst = "fixed" + BareMetalServerDiskInterfaceTypeFcpConst = "fcp" + BareMetalServerDiskInterfaceTypeNvmeConst = "nvme" + BareMetalServerDiskInterfaceTypeSataConst = "sata" ) -func (*BareMetalServerProfileDiskQuantity) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -type BareMetalServerProfileDiskQuantityIntf interface { - isaBareMetalServerProfileDiskQuantity() bool -} +// Constants associated with the BareMetalServerDisk.ResourceType property. +// The resource type. +const ( + BareMetalServerDiskResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" +) -// UnmarshalBareMetalServerProfileDiskQuantity unmarshals an instance of BareMetalServerProfileDiskQuantity from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalBareMetalServerDisk unmarshals an instance of BareMetalServerDisk from the specified map of raw messages. +func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDisk) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } @@ -28196,77 +28644,93 @@ func UnmarshalBareMetalServerProfileDiskQuantity(m map[string]json.RawMessage, r return } -// BareMetalServerProfileDiskSize : BareMetalServerProfileDiskSize struct -// Models which "extend" this model: -// - BareMetalServerProfileDiskSizeFixed -// - BareMetalServerProfileDiskSizeRange -// - BareMetalServerProfileDiskSizeEnum -// - BareMetalServerProfileDiskSizeDependent -type BareMetalServerProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` +// BareMetalServerDiskCollection : BareMetalServerDiskCollection struct +type BareMetalServerDiskCollection struct { + // Collection of the bare metal server's disks. + Disks []BareMetalServerDisk `json:"disks" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskSize.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileDiskSize) isaBareMetalServerProfileDiskSize() bool { - return true +// UnmarshalBareMetalServerDiskCollection unmarshals an instance of BareMetalServerDiskCollection from the specified map of raw messages. +func UnmarshalBareMetalServerDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type BareMetalServerProfileDiskSizeIntf interface { - isaBareMetalServerProfileDiskSize() bool +// BareMetalServerDiskPatch : BareMetalServerDiskPatch struct +type BareMetalServerDiskPatch struct { + // The name for this bare metal server disk. The name must not be used by another disk on the bare metal server. + Name *string `json:"name,omitempty"` } -// UnmarshalBareMetalServerProfileDiskSize unmarshals an instance of BareMetalServerProfileDiskSize from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalBareMetalServerDiskPatch unmarshals an instance of BareMetalServerDiskPatch from the specified map of raw messages. +func UnmarshalBareMetalServerDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the BareMetalServerDiskPatch +func (bareMetalServerDiskPatch *BareMetalServerDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + return +} + +// BareMetalServerDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type BareMetalServerDiskReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalBareMetalServerDiskReferenceDeleted unmarshals an instance of BareMetalServerDiskReferenceDeleted from the specified map of raw messages. +func UnmarshalBareMetalServerDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerInitialization : BareMetalServerInitialization struct +type BareMetalServerInitialization struct { + // The image the bare metal server was provisioned from. + Image *ImageReference `json:"image" validate:"required"` + + // The public SSH keys used at initialization. + Keys []KeyReference `json:"keys" validate:"required"` + + // The user accounts that are created at initialization. There can be multiple account types distinguished by the + // `resource_type` property. + UserAccounts []BareMetalServerInitializationUserAccountIntf `json:"user_accounts" validate:"required"` +} + +// UnmarshalBareMetalServerInitialization unmarshals an instance of BareMetalServerInitialization from the specified map of raw messages. +func UnmarshalBareMetalServerInitialization(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitialization) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "user_accounts", &obj.UserAccounts, UnmarshalBareMetalServerInitializationUserAccount) if err != nil { return } @@ -28274,76 +28738,46 @@ func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, resul return } -// BareMetalServerProfileDiskSupportedInterfaces : BareMetalServerProfileDiskSupportedInterfaces struct -type BareMetalServerProfileDiskSupportedInterfaces struct { - // The disk interface used for attaching the disk. - // - // - `fcp`: Attached using Fiber Channel Protocol - // - `sata`: Attached using Serial Advanced Technology Attachment - // - `nvme`: Attached using Non-Volatile Memory Express - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Default *string `json:"default" validate:"required"` +// BareMetalServerInitializationPrototype : BareMetalServerInitializationPrototype struct +type BareMetalServerInitializationPrototype struct { + // The image to be used when provisioning the bare metal server. + Image ImageIdentityIntf `json:"image" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as + // cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the + // administrative user. + // + // For Windows images, at least one key must be specified, and one will be selected to encrypt the administrator + // password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless + // the specified image provides another means of access. + Keys []KeyIdentityIntf `json:"keys" validate:"required"` - // The supported disk interfaces used for attaching the disk. - Values []string `json:"values" validate:"required"` + // User data to be made available when initializing the bare metal server. + UserData *string `json:"user_data,omitempty"` } -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Default property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileDiskSupportedInterfacesDefaultFcpConst = "fcp" - BareMetalServerProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" - BareMetalServerProfileDiskSupportedInterfacesDefaultSataConst = "sata" -) - -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSupportedInterfacesTypeEnumConst = "enum" -) - -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Values property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileDiskSupportedInterfacesValuesFcpConst = "fcp" - BareMetalServerProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" - BareMetalServerProfileDiskSupportedInterfacesValuesSataConst = "sata" -) +// NewBareMetalServerInitializationPrototype : Instantiate BareMetalServerInitializationPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerInitializationPrototype(image ImageIdentityIntf, keys []KeyIdentityIntf) (_model *BareMetalServerInitializationPrototype, err error) { + _model = &BareMetalServerInitializationPrototype{ + Image: image, + Keys: keys, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// UnmarshalBareMetalServerProfileDiskSupportedInterfaces unmarshals an instance of BareMetalServerProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalBareMetalServerInitializationPrototype unmarshals an instance of BareMetalServerInitializationPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationPrototype) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } @@ -28351,112 +28785,90 @@ func UnmarshalBareMetalServerProfileDiskSupportedInterfaces(m map[string]json.Ra return } -// BareMetalServerProfileIdentity : Identifies a bare metal server profile by a unique property. +// BareMetalServerInitializationUserAccount : BareMetalServerInitializationUserAccount struct // Models which "extend" this model: -// - BareMetalServerProfileIdentityByName -// - BareMetalServerProfileIdentityByHref -type BareMetalServerProfileIdentity struct { - // The name for this bare metal server profile. - Name *string `json:"name,omitempty"` - - // The URL for this bare metal server profile. - Href *string `json:"href,omitempty"` -} - -func (*BareMetalServerProfileIdentity) isaBareMetalServerProfileIdentity() bool { - return true -} - -type BareMetalServerProfileIdentityIntf interface { - isaBareMetalServerProfileIdentity() bool -} - -// UnmarshalBareMetalServerProfileIdentity unmarshals an instance of BareMetalServerProfileIdentity from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemory : BareMetalServerProfileMemory struct -// Models which "extend" this model: -// - BareMetalServerProfileMemoryFixed -// - BareMetalServerProfileMemoryRange -// - BareMetalServerProfileMemoryEnum -// - BareMetalServerProfileMemoryDependent -type BareMetalServerProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount +type BareMetalServerInitializationUserAccount struct { + // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The public SSH key used to encrypt the password. + EncryptionKey *KeyReference `json:"encryption_key,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The username for the account created at initialization. + Username *string `json:"username,omitempty"` } -// Constants associated with the BareMetalServerProfileMemory.Type property. -// The type for this profile field. +// Constants associated with the BareMetalServerInitializationUserAccount.ResourceType property. +// The resource type. const ( - BareMetalServerProfileMemoryTypeFixedConst = "fixed" + BareMetalServerInitializationUserAccountResourceTypeHostUserAccountConst = "host_user_account" ) -func (*BareMetalServerProfileMemory) isaBareMetalServerProfileMemory() bool { +func (*BareMetalServerInitializationUserAccount) isaBareMetalServerInitializationUserAccount() bool { return true } -type BareMetalServerProfileMemoryIntf interface { - isaBareMetalServerProfileMemory() bool +type BareMetalServerInitializationUserAccountIntf interface { + isaBareMetalServerInitializationUserAccount() bool } -// UnmarshalBareMetalServerProfileMemory unmarshals an instance of BareMetalServerProfileMemory from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalBareMetalServerInitializationUserAccount unmarshals an instance of BareMetalServerInitializationUserAccount from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationUserAccount) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "username", &obj.Username) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerLifecycleReason : BareMetalServerLifecycleReason struct +type BareMetalServerLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the BareMetalServerLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + BareMetalServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalBareMetalServerLifecycleReason unmarshals an instance of BareMetalServerLifecycleReason from the specified map of raw messages. +func UnmarshalBareMetalServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -28464,117 +28876,166 @@ func UnmarshalBareMetalServerProfileMemory(m map[string]json.RawMessage, result return } -// BareMetalServerProfileNetworkInterfaceCount : BareMetalServerProfileNetworkInterfaceCount struct +// BareMetalServerNetworkAttachment : BareMetalServerNetworkAttachment struct // Models which "extend" this model: -// - BareMetalServerProfileNetworkInterfaceCountRange -// - BareMetalServerProfileNetworkInterfaceCountDependent -type BareMetalServerProfileNetworkInterfaceCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// - BareMetalServerNetworkAttachmentByPci +// - BareMetalServerNetworkAttachmentByVlan +type BareMetalServerNetworkAttachment struct { + // The date and time that the bare metal server network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The URL for this bare metal server network attachment. + Href *string `json:"href" validate:"required"` - // The type for this profile field. - Type *string `json:"type,omitempty"` + // The unique identifier for this bare metal server network attachment. + ID *string `json:"id" validate:"required"` + + // The network attachment's interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + // array of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` + + // The lifecycle state of the bare metal server network attachment. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this bare metal server network attachment. The name is unique across all network attachments for the + // bare metal server. + Name *string `json:"name" validate:"required"` + + // The port speed for this bare metal server network attachment in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + // The primary IP address of the virtual network interface for the bare metal server + // network attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the bare metal server network + // attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The bare metal server network attachment type. + Type *string `json:"type" validate:"required"` + + // The virtual network interface for this bare metal server network attachment. + VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` + + // The VLAN IDs allowed for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + + // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for + // network attachments with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network attachment will be automatically deleted from this bare metal server and a new network attachment with + // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for + // this network attachment will be automatically be attached to the new network attachment. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including + // this network attachment's `vlan`. + AllowToFloat *bool `json:"allow_to_float,omitempty"` + + // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. + Vlan *int64 `json:"vlan,omitempty"` } -// Constants associated with the BareMetalServerProfileNetworkInterfaceCount.Type property. -// The type for this profile field. +// Constants associated with the BareMetalServerNetworkAttachment.InterfaceType property. +// The network attachment's interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its +// array of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. const ( - BareMetalServerProfileNetworkInterfaceCountTypeRangeConst = "range" + BareMetalServerNetworkAttachmentInterfaceTypePciConst = "pci" + BareMetalServerNetworkAttachmentInterfaceTypeVlanConst = "vlan" ) -func (*BareMetalServerProfileNetworkInterfaceCount) isaBareMetalServerProfileNetworkInterfaceCount() bool { +// Constants associated with the BareMetalServerNetworkAttachment.LifecycleState property. +// The lifecycle state of the bare metal server network attachment. +const ( + BareMetalServerNetworkAttachmentLifecycleStateDeletingConst = "deleting" + BareMetalServerNetworkAttachmentLifecycleStateFailedConst = "failed" + BareMetalServerNetworkAttachmentLifecycleStatePendingConst = "pending" + BareMetalServerNetworkAttachmentLifecycleStateStableConst = "stable" + BareMetalServerNetworkAttachmentLifecycleStateSuspendedConst = "suspended" + BareMetalServerNetworkAttachmentLifecycleStateUpdatingConst = "updating" + BareMetalServerNetworkAttachmentLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the BareMetalServerNetworkAttachment.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkAttachmentResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" +) + +// Constants associated with the BareMetalServerNetworkAttachment.Type property. +// The bare metal server network attachment type. +const ( + BareMetalServerNetworkAttachmentTypePrimaryConst = "primary" + BareMetalServerNetworkAttachmentTypeSecondaryConst = "secondary" +) + +func (*BareMetalServerNetworkAttachment) isaBareMetalServerNetworkAttachment() bool { return true } -type BareMetalServerProfileNetworkInterfaceCountIntf interface { - isaBareMetalServerProfileNetworkInterfaceCount() bool +type BareMetalServerNetworkAttachmentIntf interface { + isaBareMetalServerNetworkAttachment() bool } -// UnmarshalBareMetalServerProfileNetworkInterfaceCount unmarshals an instance of BareMetalServerProfileNetworkInterfaceCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalBareMetalServerNetworkAttachment unmarshals an instance of BareMetalServerNetworkAttachment from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachment) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileOsArchitecture : BareMetalServerProfileOsArchitecture struct -type BareMetalServerProfileOsArchitecture struct { - // The default OS architecture for a bare metal server with this profile. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported OS architecture(s) for a bare metal server with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileOsArchitecture.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileOsArchitectureTypeEnumConst = "enum" -) - -// UnmarshalBareMetalServerProfileOsArchitecture unmarshals an instance of BareMetalServerProfileOsArchitecture from the specified map of raw messages. -func UnmarshalBareMetalServerProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileOsArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileReference : BareMetalServerProfileReference struct -type BareMetalServerProfileReference struct { - // The URL for this bare metal server profile. - Href *string `json:"href" validate:"required"` - - // The name for this bare metal server profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileReference.ResourceType property. -// The resource type. -const ( - BareMetalServerProfileReferenceResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" -) - -// UnmarshalBareMetalServerProfileReference unmarshals an instance of BareMetalServerProfileReference from the specified map of raw messages. -func UnmarshalBareMetalServerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } @@ -28582,97 +29043,27 @@ func UnmarshalBareMetalServerProfileReference(m map[string]json.RawMessage, resu if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module modes for this bare metal server profile. -type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported trusted platform module modes. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileSupportedTrustedPlatformModuleModesTypeEnumConst = "enum" -) - -// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Values property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesDisabledConst = "disabled" - BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes unmarshals an instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes from the specified map of raw messages. -func UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileSupportedTrustedPlatformModuleModes) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerStatusReason : BareMetalServerStatusReason struct -type BareMetalServerStatusReason struct { - // The status reason code: - // - `cannot_start`: Failed to start due to an internal error - // - `cannot_start_capacity`: Insufficient capacity within the selected zone - // - `cannot_start_compute`: An error occurred while allocating compute resources - // - `cannot_start_ip_address`: An error occurred while allocating an IP address - // - `cannot_start_network`: An error occurred while allocating network resources. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BareMetalServerStatusReason.Code property. -// The status reason code: -// - `cannot_start`: Failed to start due to an internal error -// - `cannot_start_capacity`: Insufficient capacity within the selected zone -// - `cannot_start_compute`: An error occurred while allocating compute resources -// - `cannot_start_ip_address`: An error occurred while allocating an IP address -// - `cannot_start_network`: An error occurred while allocating network resources. -const ( - BareMetalServerStatusReasonCodeCannotStartConst = "cannot_start" - BareMetalServerStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - BareMetalServerStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - BareMetalServerStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - BareMetalServerStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" -) - -// UnmarshalBareMetalServerStatusReason unmarshals an instance of BareMetalServerStatusReason from the specified map of raw messages. -func UnmarshalBareMetalServerStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -28680,62 +29071,45 @@ func UnmarshalBareMetalServerStatusReason(m map[string]json.RawMessage, result i return } -// BareMetalServerTrustedPlatformModule : BareMetalServerTrustedPlatformModule struct -type BareMetalServerTrustedPlatformModule struct { - // Indicates whether the trusted platform module is enabled. - Enabled *bool `json:"enabled" validate:"required"` +// BareMetalServerNetworkAttachmentCollection : BareMetalServerNetworkAttachmentCollection struct +type BareMetalServerNetworkAttachmentCollection struct { + // A link to the first page of resources. + First *BareMetalServerNetworkAttachmentCollectionFirst `json:"first" validate:"required"` - // The trusted platform module (TPM) mode: - // - `disabled`: No TPM functionality - // - `tpm_2`: TPM 2.0 - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Mode *string `json:"mode" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The supported trusted platform module modes. - SupportedModes []string `json:"supported_modes" validate:"required"` -} + // Collection of bare metal server network attachments. + NetworkAttachments []BareMetalServerNetworkAttachmentIntf `json:"network_attachments" validate:"required"` -// Constants associated with the BareMetalServerTrustedPlatformModule.Mode property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerTrustedPlatformModuleModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModuleModeTpm2Const = "tpm_2" -) + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BareMetalServerNetworkAttachmentCollectionNext `json:"next,omitempty"` -// Constants associated with the BareMetalServerTrustedPlatformModule.SupportedModes property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerTrustedPlatformModuleSupportedModesDisabledConst = "disabled" - BareMetalServerTrustedPlatformModuleSupportedModesTpm2Const = "tpm_2" -) + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} -// UnmarshalBareMetalServerTrustedPlatformModule unmarshals an instance of BareMetalServerTrustedPlatformModule from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModule(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModule) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) +// UnmarshalBareMetalServerNetworkAttachmentCollection unmarshals an instance of BareMetalServerNetworkAttachmentCollection from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkAttachmentCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "supported_modes", &obj.SupportedModes) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachment) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkAttachmentCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -28743,29 +29117,28 @@ func UnmarshalBareMetalServerTrustedPlatformModule(m map[string]json.RawMessage, return } -// BareMetalServerTrustedPlatformModulePatch : BareMetalServerTrustedPlatformModulePatch struct -type BareMetalServerTrustedPlatformModulePatch struct { - // The trusted platform module mode to use. The specified value must be listed in the bare metal server's - // `supported_modes`. - // - // For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. - Mode *string `json:"mode,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BareMetalServerNetworkAttachmentCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// Constants associated with the BareMetalServerTrustedPlatformModulePatch.Mode property. -// The trusted platform module mode to use. The specified value must be listed in the bare metal server's -// `supported_modes`. -// -// For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. -const ( - BareMetalServerTrustedPlatformModulePatchModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModulePatchModeTpm2Const = "tpm_2" -) +// BareMetalServerNetworkAttachmentCollectionFirst : A link to the first page of resources. +type BareMetalServerNetworkAttachmentCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} -// UnmarshalBareMetalServerTrustedPlatformModulePatch unmarshals an instance of BareMetalServerTrustedPlatformModulePatch from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModulePatch) - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) +// UnmarshalBareMetalServerNetworkAttachmentCollectionFirst unmarshals an instance of BareMetalServerNetworkAttachmentCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -28773,25 +29146,16 @@ func UnmarshalBareMetalServerTrustedPlatformModulePatch(m map[string]json.RawMes return } -// BareMetalServerTrustedPlatformModulePrototype : BareMetalServerTrustedPlatformModulePrototype struct -type BareMetalServerTrustedPlatformModulePrototype struct { - // The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's - // `supported_trusted_platform_module_modes`. - Mode *string `json:"mode,omitempty"` +// BareMetalServerNetworkAttachmentCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerNetworkAttachmentCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// Constants associated with the BareMetalServerTrustedPlatformModulePrototype.Mode property. -// The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's -// `supported_trusted_platform_module_modes`. -const ( - BareMetalServerTrustedPlatformModulePrototypeModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModulePrototypeModeTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerTrustedPlatformModulePrototype unmarshals an instance of BareMetalServerTrustedPlatformModulePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModulePrototype) - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) +// UnmarshalBareMetalServerNetworkAttachmentCollectionNext unmarshals an instance of BareMetalServerNetworkAttachmentCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -28799,28 +29163,25 @@ func UnmarshalBareMetalServerTrustedPlatformModulePrototype(m map[string]json.Ra return } -// CatalogOfferingIdentity : Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique -// property. -// Models which "extend" this model: -// - CatalogOfferingIdentityCatalogOfferingByCRN -type CatalogOfferingIdentity struct { - // The CRN for this - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn,omitempty"` -} - -func (*CatalogOfferingIdentity) isaCatalogOfferingIdentity() bool { - return true -} +// BareMetalServerNetworkAttachmentPatch : BareMetalServerNetworkAttachmentPatch struct +type BareMetalServerNetworkAttachmentPatch struct { + // The VLAN IDs to allow for `vlan` attachments using this PCI attachment, replacing any existing VLAN IDs. The + // specified values must include IDs for all `vlan` attachments currently using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -type CatalogOfferingIdentityIntf interface { - isaCatalogOfferingIdentity() bool + // The name for this network attachment. The name must not be used by another network attachment for the bare metal + // server. + Name *string `json:"name,omitempty"` } -// UnmarshalCatalogOfferingIdentity unmarshals an instance of CatalogOfferingIdentity from the specified map of raw messages. -func UnmarshalCatalogOfferingIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalBareMetalServerNetworkAttachmentPatch unmarshals an instance of BareMetalServerNetworkAttachmentPatch from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPatch) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -28828,90 +29189,115 @@ func UnmarshalCatalogOfferingIdentity(m map[string]json.RawMessage, result inter return } -// CatalogOfferingVersionIdentity : Identifies a version of a -// [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique property. -// Models which "extend" this model: -// - CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN -type CatalogOfferingVersionIdentity struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn,omitempty"` -} - -func (*CatalogOfferingVersionIdentity) isaCatalogOfferingVersionIdentity() bool { - return true +// AsPatch returns a generic map representation of the BareMetalServerNetworkAttachmentPatch +func (bareMetalServerNetworkAttachmentPatch *BareMetalServerNetworkAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerNetworkAttachmentPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -type CatalogOfferingVersionIdentityIntf interface { - isaCatalogOfferingVersionIdentity() bool -} +// BareMetalServerNetworkAttachmentPrototype : BareMetalServerNetworkAttachmentPrototype struct +// Models which "extend" this model: +// - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype +// - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype +type BareMetalServerNetworkAttachmentPrototype struct { + // The network attachment's interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + // array of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type" validate:"required"` -// UnmarshalCatalogOfferingVersionIdentity unmarshals an instance of CatalogOfferingVersionIdentity from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this bare metal server network attachment. Names must be unique within the bare metal server the + // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// CatalogOfferingVersionReference : CatalogOfferingVersionReference struct -type CatalogOfferingVersionReference struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} + // A virtual network interface for the bare metal server network attachment. This can be + // specified using an existing virtual network interface, or a prototype object for a new + // virtual network interface. + // + // If an existing virtual network interface is specified, it must not be the target of a flow + // log collector. + VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` -// UnmarshalCatalogOfferingVersionReference unmarshals an instance of CatalogOfferingVersionReference from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -// CertificateInstanceIdentity : Identifies a certificate instance by a unique property. -// Models which "extend" this model: -// - CertificateInstanceIdentityByCRN -type CertificateInstanceIdentity struct { - // The CRN for this certificate instance. - CRN *string `json:"crn,omitempty"` + // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for + // network attachments with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network attachment will be automatically deleted from this bare metal server and a new network attachment with + // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for + // this network attachment will be automatically be attached to the new network attachment. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including + // this network attachment's `vlan`. + AllowToFloat *bool `json:"allow_to_float,omitempty"` + + // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. + Vlan *int64 `json:"vlan,omitempty"` } -func (*CertificateInstanceIdentity) isaCertificateInstanceIdentity() bool { +// Constants associated with the BareMetalServerNetworkAttachmentPrototype.InterfaceType property. +// The network attachment's interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x` +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its +// array of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. +const ( + BareMetalServerNetworkAttachmentPrototypeInterfaceTypePciConst = "pci" + BareMetalServerNetworkAttachmentPrototypeInterfaceTypeVlanConst = "vlan" +) + +func (*BareMetalServerNetworkAttachmentPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { return true } -type CertificateInstanceIdentityIntf interface { - isaCertificateInstanceIdentity() bool +type BareMetalServerNetworkAttachmentPrototypeIntf interface { + isaBareMetalServerNetworkAttachmentPrototype() bool } -// UnmarshalCertificateInstanceIdentity unmarshals an instance of CertificateInstanceIdentity from the specified map of raw messages. -func UnmarshalCertificateInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalBareMetalServerNetworkAttachmentPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CertificateInstanceReference : CertificateInstanceReference struct -type CertificateInstanceReference struct { - // The CRN for this certificate instance. - CRN *string `json:"crn" validate:"required"` -} - -// UnmarshalCertificateInstanceReference unmarshals an instance of CertificateInstanceReference from the specified map of raw messages. -func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -28919,149 +29305,138 @@ func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result return } -// CheckVPNGatewayConnectionLocalCIDROptions : The CheckVPNGatewayConnectionLocalCIDR options. -type CheckVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCheckVPNGatewayConnectionLocalCIDROptions : Instantiate CheckVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - return &CheckVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetID(id string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} - -// CheckVPNGatewayConnectionPeerCIDROptions : The CheckVPNGatewayConnectionPeerCIDR options. -type CheckVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface : A virtual network interface for the bare metal server network attachment. This can be specified using an existing +// virtual network interface, or a prototype object for a new virtual network interface. +// +// If an existing virtual network interface is specified, it must not be the target of a flow log collector. +// Models which "extend" this model: +// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext +// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` -// NewCheckVPNGatewayConnectionPeerCIDROptions : Instantiate CheckVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - return &CheckVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetID(id string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} + // The resource group to use for this virtual network interface. If unspecified, the + // bare metal server's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` -// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName -// - CloudObjectStorageBucketIdentityByCRN -type CloudObjectStorageBucketIdentity struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name,omitempty"` + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` - // The CRN of this Cloud Object Storage bucket. + // The CRN for this virtual network interface. CRN *string `json:"crn,omitempty"` } -func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { return true } -type CloudObjectStorageBucketIdentityIntf interface { - isaCloudObjectStorageBucketIdentity() bool +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf interface { + isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool } -// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentity) +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -29070,19 +29445,52 @@ func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, res return } -// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct -type CloudObjectStorageBucketReference struct { - // The CRN of this Cloud Object Storage bucket. - CRN *string `json:"crn" validate:"required"` +// BareMetalServerNetworkAttachmentReference : BareMetalServerNetworkAttachmentReference struct +type BareMetalServerNetworkAttachmentReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` - // The globally unique name of this Cloud Object Storage bucket. + // The URL for this bare metal server network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this bare metal server network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this bare metal server network attachment. The name is unique across all network attachments for the + // bare metal server. Name *string `json:"name" validate:"required"` + + // The primary IP address of the virtual network interface for the bare metal server + // network attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the bare metal server network + // attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// Constants associated with the BareMetalServerNetworkAttachmentReference.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkAttachmentReferenceResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" +) + +// UnmarshalBareMetalServerNetworkAttachmentReference unmarshals an instance of BareMetalServerNetworkAttachmentReference from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -29090,20 +29498,33 @@ func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, re if err != nil { return } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// CloudObjectStorageObjectReference : CloudObjectStorageObjectReference struct -type CloudObjectStorageObjectReference struct { - // The name of this Cloud Object Storage object. Names are unique within a Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` +// BareMetalServerNetworkAttachmentReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type BareMetalServerNetworkAttachmentReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalCloudObjectStorageObjectReference unmarshals an instance of CloudObjectStorageObjectReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageObjectReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageObjectReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted unmarshals an instance of BareMetalServerNetworkAttachmentReferenceDeleted from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -29111,2503 +29532,3015 @@ func UnmarshalCloudObjectStorageObjectReference(m map[string]json.RawMessage, re return } -// CreateBackupPolicyOptions : The CreateBackupPolicy options. -type CreateBackupPolicyOptions struct { - // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type - // will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` +// BareMetalServerNetworkInterface : BareMetalServerNetworkInterface struct +// Models which "extend" this model: +// - BareMetalServerNetworkInterfaceByHiperSocket +// - BareMetalServerNetworkInterfaceByPci +// - BareMetalServerNetworkInterfaceByVlan +type BareMetalServerNetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The resource types this backup policy will apply to. Resources that have both a matching type and a matching user - // tag will be subject to the backup policy. - MatchResourceTypes []string `json:"match_resource_types,omitempty"` + // The date and time that the bare metal server network interface was created. + // + // If this bare metal server has network attachments, this network interface was created as a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - // The prototype objects for backup plans to be created for this backup policy. - Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` + // The floating IPs associated with this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` - // The scope to use for this backup policy. + // The unique identifier for this bare metal server network interface. // - // If unspecified, the policy will be scoped to the account. - Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The interface type: + // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + // within a `s390x` based system + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI interface + // - Cannot directly use an IEEE 802.1Q tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + // array of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the interface type is that of the + // corresponding network attachment. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` -// Constants associated with the CreateBackupPolicyOptions.MatchResourceTypes property. -// The resource type. -const ( - CreateBackupPolicyOptionsMatchResourceTypesVolumeConst = "volume" -) + // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value + // will be an empty string. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. + MacAddress *string `json:"mac_address" validate:"required"` -// NewCreateBackupPolicyOptions : Instantiate CreateBackupPolicyOptions -func (*VpcV1) NewCreateBackupPolicyOptions(matchUserTags []string) *CreateBackupPolicyOptions { - return &CreateBackupPolicyOptions{ - MatchUserTags: matchUserTags, - } -} + // The name for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. + Name *string `json:"name" validate:"required"` -// SetMatchUserTags : Allow user to set MatchUserTags -func (_options *CreateBackupPolicyOptions) SetMatchUserTags(matchUserTags []string) *CreateBackupPolicyOptions { - _options.MatchUserTags = matchUserTags - return _options -} + // The bare metal server network interface port speed in Mbps. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. + PortSpeed *int64 `json:"port_speed" validate:"required"` -// SetMatchResourceTypes : Allow user to set MatchResourceTypes -func (_options *CreateBackupPolicyOptions) SetMatchResourceTypes(matchResourceTypes []string) *CreateBackupPolicyOptions { - _options.MatchResourceTypes = matchResourceTypes - return _options -} + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateBackupPolicyOptions) SetName(name string) *CreateBackupPolicyOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetPlans : Allow user to set Plans -func (_options *CreateBackupPolicyOptions) SetPlans(plans []BackupPolicyPlanPrototype) *CreateBackupPolicyOptions { - _options.Plans = plans - return _options -} + // The security groups targeting this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateBackupPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateBackupPolicyOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // The status of the bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a read-only representation of its + // corresponding network attachment and its attached virtual network interface, and the status is [computed from + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + Status *string `json:"status" validate:"required"` -// SetScope : Allow user to set Scope -func (_options *CreateBackupPolicyOptions) SetScope(scope BackupPolicyScopePrototypeIntf) *CreateBackupPolicyOptions { - _options.Scope = scope - return _options -} + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateBackupPolicyOptions) SetHeaders(param map[string]string) *CreateBackupPolicyOptions { - options.Headers = param - return options -} + // The bare metal server network interface type. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. + Type *string `json:"type" validate:"required"` -// CreateBackupPolicyPlanOptions : The CreateBackupPolicyPlan options. -type CreateBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. + Vlan *int64 `json:"vlan,omitempty"` +} - // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. - AttachUserTags []string `json:"attach_user_tags,omitempty"` - - ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` +// Constants associated with the BareMetalServerNetworkInterface.InterfaceType property. +// The interface type: +// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity +// within a `s390x` based system +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI interface +// - Cannot directly use an IEEE 802.1Q tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its +// array of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +// +// If this bare metal server has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the interface type is that of the +// corresponding network attachment. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerNetworkInterfaceInterfaceTypeHipersocketConst = "hipersocket" + BareMetalServerNetworkInterfaceInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfaceInterfaceTypeVlanConst = "vlan" +) - DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` +// Constants associated with the BareMetalServerNetworkInterface.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" +) - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// Constants associated with the BareMetalServerNetworkInterface.Status property. +// The status of the bare metal server network interface. +// +// If this bare metal server has network attachments, this network interface is a read-only representation of its +// corresponding network attachment and its attached virtual network interface, and the status is [computed from +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). +const ( + BareMetalServerNetworkInterfaceStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceStatusPendingConst = "pending" +) - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` +// Constants associated with the BareMetalServerNetworkInterface.Type property. +// The bare metal server network interface type. +// +// If this bare metal server has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. +const ( + BareMetalServerNetworkInterfaceTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceTypeSecondaryConst = "secondary" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*BareMetalServerNetworkInterface) isaBareMetalServerNetworkInterface() bool { + return true } -// NewCreateBackupPolicyPlanOptions : Instantiate CreateBackupPolicyPlanOptions -func (*VpcV1) NewCreateBackupPolicyPlanOptions(backupPolicyID string, cronSpec string) *CreateBackupPolicyPlanOptions { - return &CreateBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - CronSpec: core.StringPtr(cronSpec), - } +type BareMetalServerNetworkInterfaceIntf interface { + isaBareMetalServerNetworkInterface() bool } -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *CreateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *CreateBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options +// UnmarshalBareMetalServerNetworkInterface unmarshals an instance of BareMetalServerNetworkInterface from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "interface_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + return + } + if discValue == "hipersocket" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByHiperSocket) + } else if discValue == "pci" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByPci) + } else if discValue == "vlan" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByVlan) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + } + return } -// SetCronSpec : Allow user to set CronSpec -func (_options *CreateBackupPolicyPlanOptions) SetCronSpec(cronSpec string) *CreateBackupPolicyPlanOptions { - _options.CronSpec = core.StringPtr(cronSpec) - return _options -} +// BareMetalServerNetworkInterfaceCollection : BareMetalServerNetworkInterfaceCollection struct +type BareMetalServerNetworkInterfaceCollection struct { + // A link to the first page of resources. + First *BareMetalServerNetworkInterfaceCollectionFirst `json:"first" validate:"required"` -// SetActive : Allow user to set Active -func (_options *CreateBackupPolicyPlanOptions) SetActive(active bool) *CreateBackupPolicyPlanOptions { - _options.Active = core.BoolPtr(active) - return _options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetAttachUserTags : Allow user to set AttachUserTags -func (_options *CreateBackupPolicyPlanOptions) SetAttachUserTags(attachUserTags []string) *CreateBackupPolicyPlanOptions { - _options.AttachUserTags = attachUserTags - return _options -} + // Collection of bare metal server network interfaces. + NetworkInterfaces []BareMetalServerNetworkInterfaceIntf `json:"network_interfaces" validate:"required"` -// SetClonePolicy : Allow user to set ClonePolicy -func (_options *CreateBackupPolicyPlanOptions) SetClonePolicy(clonePolicy *BackupPolicyPlanClonePolicyPrototype) *CreateBackupPolicyPlanOptions { - _options.ClonePolicy = clonePolicy - return _options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BareMetalServerNetworkInterfaceCollectionNext `json:"next,omitempty"` -// SetCopyUserTags : Allow user to set CopyUserTags -func (_options *CreateBackupPolicyPlanOptions) SetCopyUserTags(copyUserTags bool) *CreateBackupPolicyPlanOptions { - _options.CopyUserTags = core.BoolPtr(copyUserTags) - return _options + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetDeletionTrigger : Allow user to set DeletionTrigger -func (_options *CreateBackupPolicyPlanOptions) SetDeletionTrigger(deletionTrigger *BackupPolicyPlanDeletionTriggerPrototype) *CreateBackupPolicyPlanOptions { - _options.DeletionTrigger = deletionTrigger - return _options +// UnmarshalBareMetalServerNetworkInterfaceCollection unmarshals an instance of BareMetalServerNetworkInterfaceCollection from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkInterfaceCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterface) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkInterfaceCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *CreateBackupPolicyPlanOptions) SetName(name string) *CreateBackupPolicyPlanOptions { - _options.Name = core.StringPtr(name) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BareMetalServerNetworkInterfaceCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetRemoteRegionPolicies : Allow user to set RemoteRegionPolicies -func (_options *CreateBackupPolicyPlanOptions) SetRemoteRegionPolicies(remoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype) *CreateBackupPolicyPlanOptions { - _options.RemoteRegionPolicies = remoteRegionPolicies - return _options +// BareMetalServerNetworkInterfaceCollectionFirst : A link to the first page of resources. +type BareMetalServerNetworkInterfaceCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *CreateBackupPolicyPlanOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerNetworkInterfaceCollectionFirst unmarshals an instance of BareMetalServerNetworkInterfaceCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateBareMetalServerConsoleAccessTokenOptions : The CreateBareMetalServerConsoleAccessToken options. -type CreateBareMetalServerConsoleAccessTokenOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server console type for which this token may be used - // - // Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. - ConsoleType *string `json:"console_type" validate:"required"` - - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// BareMetalServerNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerNetworkInterfaceCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// Constants associated with the CreateBareMetalServerConsoleAccessTokenOptions.ConsoleType property. -// The bare metal server console type for which this token may be used -// -// Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. -const ( - CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" - CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" -) - -// NewCreateBareMetalServerConsoleAccessTokenOptions : Instantiate CreateBareMetalServerConsoleAccessTokenOptions -func (*VpcV1) NewCreateBareMetalServerConsoleAccessTokenOptions(bareMetalServerID string, consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { - return &CreateBareMetalServerConsoleAccessTokenOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ConsoleType: core.StringPtr(consoleType), +// UnmarshalBareMetalServerNetworkInterfaceCollectionNext unmarshals an instance of BareMetalServerNetworkInterfaceCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} +// BareMetalServerNetworkInterfacePatch : BareMetalServerNetworkInterfacePatch struct +type BareMetalServerNetworkInterfacePatch struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// SetConsoleType : Allow user to set ConsoleType -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.ConsoleType = core.StringPtr(consoleType) - return _options -} + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface, replacing any existing VLAN IDs. The specified + // values must include IDs for all `vlan` interfaces currently using this PCI interface. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -// SetForce : Allow user to set Force -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetForce(force bool) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.Force = core.BoolPtr(force) - return _options -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateBareMetalServerConsoleAccessTokenOptions { - options.Headers = param - return options + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. + Name *string `json:"name,omitempty"` } -// CreateBareMetalServerNetworkInterfaceOptions : The CreateBareMetalServerNetworkInterface options. -type CreateBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface prototype object. - BareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf `json:"BareMetalServerNetworkInterfacePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalBareMetalServerNetworkInterfacePatch unmarshals an instance of BareMetalServerNetworkInterfacePatch from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePatch) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewCreateBareMetalServerNetworkInterfaceOptions : Instantiate CreateBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewCreateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { - return &CreateBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - BareMetalServerNetworkInterfacePrototype: bareMetalServerNetworkInterfacePrototype, +// AsPatch returns a generic map representation of the BareMetalServerNetworkInterfacePatch +func (bareMetalServerNetworkInterfacePatch *BareMetalServerNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerNetworkInterfacePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} +// BareMetalServerNetworkInterfacePrototype : BareMetalServerNetworkInterfacePrototype struct +// Models which "extend" this model: +// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype +// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype +// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype +type BareMetalServerNetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// SetBareMetalServerNetworkInterfacePrototype : Allow user to set BareMetalServerNetworkInterfacePrototype -func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototype - return _options -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} + // The interface type: + // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + // within a `s390x` based system + // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI interface + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + // array of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type" validate:"required"` -// CreateBareMetalServerOptions : The CreateBareMetalServer options. -type CreateBareMetalServerOptions struct { - Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The primary bare metal server network interface to create. - PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + // The primary IP address to bind to the bare metal server network interface. This can be + // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must + // be available on the bare metal server network interface's subnet. Otherwise, an + // available address on the subnet will be automatically selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - // to use for this bare metal server. - Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` + // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security + // group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The zone this bare metal server will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // The name for this bare metal server. The name must not be used by another bare metal server in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The additional bare metal server network interfaces to create. - NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. + Vlan *int64 `json:"vlan,omitempty"` +} - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc,omitempty"` +// Constants associated with the BareMetalServerNetworkInterfacePrototype.InterfaceType property. +// The interface type: +// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity +// within a `s390x` based system +// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI interface +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x` +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its +// array of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. +const ( + BareMetalServerNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" + BareMetalServerNetworkInterfacePrototypeInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfacePrototypeInterfaceTypeVlanConst = "vlan" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*BareMetalServerNetworkInterfacePrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true } -// NewCreateBareMetalServerOptions : Instantiate CreateBareMetalServerOptions -func (*VpcV1) NewCreateBareMetalServerOptions(initialization *BareMetalServerInitializationPrototype, primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf) *CreateBareMetalServerOptions { - return &CreateBareMetalServerOptions{ - Initialization: initialization, - PrimaryNetworkInterface: primaryNetworkInterface, - Profile: profile, - Zone: zone, - } +type BareMetalServerNetworkInterfacePrototypeIntf interface { + isaBareMetalServerNetworkInterfacePrototype() bool } -// SetInitialization : Allow user to set Initialization -func (_options *CreateBareMetalServerOptions) SetInitialization(initialization *BareMetalServerInitializationPrototype) *CreateBareMetalServerOptions { - _options.Initialization = initialization - return _options +// UnmarshalBareMetalServerNetworkInterfacePrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "interface_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + return + } + if discValue == "hipersocket" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) + } else if discValue == "pci" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) + } else if discValue == "vlan" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + } + return } -// SetPrimaryNetworkInterface : Allow user to set PrimaryNetworkInterface -func (_options *CreateBareMetalServerOptions) SetPrimaryNetworkInterface(primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype) *CreateBareMetalServerOptions { - _options.PrimaryNetworkInterface = primaryNetworkInterface - return _options +// BareMetalServerNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type BareMetalServerNetworkInterfaceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetProfile : Allow user to set Profile -func (_options *CreateBareMetalServerOptions) SetProfile(profile BareMetalServerProfileIdentityIntf) *CreateBareMetalServerOptions { - _options.Profile = profile - return _options +// UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceDeleted from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetZone : Allow user to set Zone -func (_options *CreateBareMetalServerOptions) SetZone(zone ZoneIdentityIntf) *CreateBareMetalServerOptions { - _options.Zone = zone - return _options -} - -// SetEnableSecureBoot : Allow user to set EnableSecureBoot -func (_options *CreateBareMetalServerOptions) SetEnableSecureBoot(enableSecureBoot bool) *CreateBareMetalServerOptions { - _options.EnableSecureBoot = core.BoolPtr(enableSecureBoot) - return _options +// BareMetalServerNetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type BareMetalServerNetworkInterfaceReferenceTargetContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetName : Allow user to set Name -func (_options *CreateBareMetalServerOptions) SetName(name string) *CreateBareMetalServerOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceReferenceTargetContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkInterfaces : Allow user to set NetworkInterfaces -func (_options *CreateBareMetalServerOptions) SetNetworkInterfaces(networkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerOptions { - _options.NetworkInterfaces = networkInterfaces - return _options -} +// BareMetalServerPatch : BareMetalServerPatch struct +type BareMetalServerPatch struct { + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the bare metal server + // will fail to boot. + // + // For `enable_secure_boot` to be changed, the bare metal server `status` must be + // `stopped`. + EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateBareMetalServerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateBareMetalServerOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // The name for this bare metal server. The name must not be used by another bare metal server in the region. Changing + // the name will not affect the system hostname. + Name *string `json:"name,omitempty"` -// SetTrustedPlatformModule : Allow user to set TrustedPlatformModule -func (_options *CreateBareMetalServerOptions) SetTrustedPlatformModule(trustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype) *CreateBareMetalServerOptions { - _options.TrustedPlatformModule = trustedPlatformModule - return _options + TrustedPlatformModule *BareMetalServerTrustedPlatformModulePatch `json:"trusted_platform_module,omitempty"` } -// SetVPC : Allow user to set VPC -func (_options *CreateBareMetalServerOptions) SetVPC(vpc VPCIdentityIntf) *CreateBareMetalServerOptions { - _options.VPC = vpc - return _options +// UnmarshalBareMetalServerPatch unmarshals an instance of BareMetalServerPatch from the specified map of raw messages. +func UnmarshalBareMetalServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPatch) + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerOptions) SetHeaders(param map[string]string) *CreateBareMetalServerOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the BareMetalServerPatch +func (bareMetalServerPatch *BareMetalServerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// CreateDedicatedHostGroupOptions : The CreateDedicatedHostGroup options. -type CreateDedicatedHostGroupOptions struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class" validate:"required"` - - // The dedicated host profile family for hosts in this group. - Family *string `json:"family" validate:"required"` - - // The zone this dedicated host group will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` +// BareMetalServerPrimaryNetworkAttachmentPrototype : BareMetalServerPrimaryNetworkAttachmentPrototype struct +// Models which "extend" this model: +// - BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype +type BareMetalServerPrimaryNetworkAttachmentPrototype struct { + // The network attachment's interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type,omitempty"` - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // The name for this bare metal server network attachment. Names must be unique within the bare metal server the + // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // A virtual network interface for the bare metal server network attachment. This can be + // specified using an existing virtual network interface, or a prototype object for a new + // virtual network interface. + // + // If an existing virtual network interface is specified, it must not be the target of a flow + // log collector. + VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` } -// Constants associated with the CreateDedicatedHostGroupOptions.Family property. -// The dedicated host profile family for hosts in this group. +// Constants associated with the BareMetalServerPrimaryNetworkAttachmentPrototype.InterfaceType property. +// The network attachment's interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( - CreateDedicatedHostGroupOptionsFamilyBalancedConst = "balanced" - CreateDedicatedHostGroupOptionsFamilyComputeConst = "compute" - CreateDedicatedHostGroupOptionsFamilyMemoryConst = "memory" + BareMetalServerPrimaryNetworkAttachmentPrototypeInterfaceTypePciConst = "pci" ) -// NewCreateDedicatedHostGroupOptions : Instantiate CreateDedicatedHostGroupOptions -func (*VpcV1) NewCreateDedicatedHostGroupOptions(class string, family string, zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { - return &CreateDedicatedHostGroupOptions{ - Class: core.StringPtr(class), - Family: core.StringPtr(family), - Zone: zone, - } +func (*BareMetalServerPrimaryNetworkAttachmentPrototype) isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool { + return true } -// SetClass : Allow user to set Class -func (_options *CreateDedicatedHostGroupOptions) SetClass(class string) *CreateDedicatedHostGroupOptions { - _options.Class = core.StringPtr(class) - return _options +type BareMetalServerPrimaryNetworkAttachmentPrototypeIntf interface { + isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool } -// SetFamily : Allow user to set Family -func (_options *CreateDedicatedHostGroupOptions) SetFamily(family string) *CreateDedicatedHostGroupOptions { - _options.Family = core.StringPtr(family) - return _options +// UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype unmarshals an instance of BareMetalServerPrimaryNetworkAttachmentPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrimaryNetworkAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetZone : Allow user to set Zone -func (_options *CreateDedicatedHostGroupOptions) SetZone(zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.Zone = zone - return _options -} +// BareMetalServerPrimaryNetworkInterfacePrototype : BareMetalServerPrimaryNetworkInterfacePrototype struct +type BareMetalServerPrimaryNetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// SetName : Allow user to set Name -func (_options *CreateDedicatedHostGroupOptions) SetName(name string) *CreateDedicatedHostGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateDedicatedHostGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *CreateDedicatedHostGroupOptions { - options.Headers = param - return options -} + // The interface type: + // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + // within a `s390x` based system. + // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI interface + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type,omitempty"` -// CreateDedicatedHostOptions : The CreateDedicatedHost options. -type CreateDedicatedHostOptions struct { - // The dedicated host prototype object. - DedicatedHostPrototype DedicatedHostPrototypeIntf `json:"DedicatedHostPrototype" validate:"required"` + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The primary IP address to bind to the bare metal server network interface. This can be + // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must + // be available on the bare metal server network interface's subnet. Otherwise, an + // available address on the subnet will be automatically selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` + + // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security + // group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` } -// NewCreateDedicatedHostOptions : Instantiate CreateDedicatedHostOptions -func (*VpcV1) NewCreateDedicatedHostOptions(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - return &CreateDedicatedHostOptions{ - DedicatedHostPrototype: dedicatedHostPrototype, +// Constants associated with the BareMetalServerPrimaryNetworkInterfacePrototype.InterfaceType property. +// The interface type: +// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity +// within a `s390x` based system. +// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI interface +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. +const ( + BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" + BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypePciConst = "pci" +) + +// NewBareMetalServerPrimaryNetworkInterfacePrototype : Instantiate BareMetalServerPrimaryNetworkInterfacePrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerPrimaryNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *BareMetalServerPrimaryNetworkInterfacePrototype, err error) { + _model = &BareMetalServerPrimaryNetworkInterfacePrototype{ + Subnet: subnet, } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetDedicatedHostPrototype : Allow user to set DedicatedHostPrototype -func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - _options.DedicatedHostPrototype = dedicatedHostPrototype - return _options +// UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype unmarshals an instance of BareMetalServerPrimaryNetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrimaryNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostOptions) SetHeaders(param map[string]string) *CreateDedicatedHostOptions { - options.Headers = param - return options -} +// BareMetalServerProfile : BareMetalServerProfile struct +type BareMetalServerProfile struct { + Bandwidth BareMetalServerProfileBandwidthIntf `json:"bandwidth" validate:"required"` -// CreateEndpointGatewayOptions : The CreateEndpointGateway options. -type CreateEndpointGatewayOptions struct { - // The target to use for this endpoint gateway. Must not already be the target of another - // endpoint gateway in the VPC. - Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` + // The console type configuration for a bare metal server with this profile. + ConsoleTypes *BareMetalServerProfileConsoleTypes `json:"console_types" validate:"required"` - // The VPC this endpoint gateway will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + CpuArchitecture *BareMetalServerProfileCpuArchitecture `json:"cpu_architecture" validate:"required"` - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + CpuCoreCount BareMetalServerProfileCpuCoreCountIntf `json:"cpu_core_count" validate:"required"` - // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. - Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` + CpuSocketCount BareMetalServerProfileCpuSocketCountIntf `json:"cpu_socket_count" validate:"required"` - // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // Collection of the bare metal server profile's disks. + Disks []BareMetalServerProfileDisk `json:"disks" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The product family this bare metal server profile belongs to. + Family *string `json:"family" validate:"required"` - // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The URL for this bare metal server profile. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + Memory BareMetalServerProfileMemoryIntf `json:"memory" validate:"required"` -// NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions -func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - return &CreateEndpointGatewayOptions{ - Target: target, - VPC: vpc, - } -} + // The name for this bare metal server profile. + Name *string `json:"name" validate:"required"` -// SetTarget : Allow user to set Target -func (_options *CreateEndpointGatewayOptions) SetTarget(target EndpointGatewayTargetPrototypeIntf) *CreateEndpointGatewayOptions { - _options.Target = target - return _options -} + NetworkAttachmentCount BareMetalServerProfileNetworkAttachmentCountIntf `json:"network_attachment_count" validate:"required"` -// SetVPC : Allow user to set VPC -func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - _options.VPC = vpc - return _options -} + NetworkInterfaceCount BareMetalServerProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *CreateEndpointGatewayOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *CreateEndpointGatewayOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) - return _options -} + OsArchitecture *BareMetalServerProfileOsArchitecture `json:"os_architecture" validate:"required"` -// SetIps : Allow user to set Ips -func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { - _options.Ips = ips - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateEndpointGatewayOptions) SetName(name string) *CreateEndpointGatewayOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The supported trusted platform module modes for this bare metal server profile. + SupportedTrustedPlatformModuleModes *BareMetalServerProfileSupportedTrustedPlatformModuleModes `json:"supported_trusted_platform_module_modes" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateEndpointGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.ResourceGroup = resourceGroup - return _options + // Indicates whether this profile supports virtual network interfaces. + VirtualNetworkInterfacesSupported *BareMetalServerProfileVirtualNetworkInterfacesSupported `json:"virtual_network_interfaces_supported" validate:"required"` } -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateEndpointGatewayOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.SecurityGroups = securityGroups - return _options -} +// Constants associated with the BareMetalServerProfile.ResourceType property. +// The resource type. +const ( + BareMetalServerProfileResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" +) -// SetHeaders : Allow user to set Headers -func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfile unmarshals an instance of BareMetalServerProfile from the specified map of raw messages. +func UnmarshalBareMetalServerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfile) + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalBareMetalServerProfileBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "console_types", &obj.ConsoleTypes, UnmarshalBareMetalServerProfileConsoleTypes) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_architecture", &obj.CpuArchitecture, UnmarshalBareMetalServerProfileCpuArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_core_count", &obj.CpuCoreCount, UnmarshalBareMetalServerProfileCpuCoreCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_socket_count", &obj.CpuSocketCount, UnmarshalBareMetalServerProfileCpuSocketCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalBareMetalServerProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachment_count", &obj.NetworkAttachmentCount, UnmarshalBareMetalServerProfileNetworkAttachmentCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalBareMetalServerProfileNetworkInterfaceCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalBareMetalServerProfileOsArchitecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_trusted_platform_module_modes", &obj.SupportedTrustedPlatformModuleModes, UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interfaces_supported", &obj.VirtualNetworkInterfacesSupported, UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateFloatingIPOptions : The CreateFloatingIP options. -type CreateFloatingIPOptions struct { - // The floating IP prototype object. - FloatingIPPrototype FloatingIPPrototypeIntf `json:"FloatingIPPrototype" validate:"required"` +// BareMetalServerProfileBandwidth : BareMetalServerProfileBandwidth struct +// Models which "extend" this model: +// - BareMetalServerProfileBandwidthFixed +// - BareMetalServerProfileBandwidthRange +// - BareMetalServerProfileBandwidthEnum +// - BareMetalServerProfileBandwidthDependent +type BareMetalServerProfileBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// NewCreateFloatingIPOptions : Instantiate CreateFloatingIPOptions -func (*VpcV1) NewCreateFloatingIPOptions(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - return &CreateFloatingIPOptions{ - FloatingIPPrototype: floatingIPPrototype, - } + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetFloatingIPPrototype : Allow user to set FloatingIPPrototype -func (_options *CreateFloatingIPOptions) SetFloatingIPPrototype(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - _options.FloatingIPPrototype = floatingIPPrototype - return _options +// Constants associated with the BareMetalServerProfileBandwidth.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileBandwidth) isaBareMetalServerProfileBandwidth() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *CreateFloatingIPOptions) SetHeaders(param map[string]string) *CreateFloatingIPOptions { - options.Headers = param - return options +type BareMetalServerProfileBandwidthIntf interface { + isaBareMetalServerProfileBandwidth() bool } -// CreateFlowLogCollectorOptions : The CreateFlowLogCollector options. -type CreateFlowLogCollectorOptions struct { - // The Cloud Object Storage bucket where the collected flows will be logged. - // The bucket must exist and an IAM service authorization must grant - // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - // access to the bucket. For more information, see [Creating a flow log - // collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). - StorageBucket LegacyCloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - - // The target this collector will collect flow logs for. If the target is an instance, - // subnet, or VPC, flow logs will not be collected for any instance network interfaces within - // the target that are themselves the target of a more specific flow log collector. - Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` - - // Indicates whether this collector will be active upon creation. - Active *bool `json:"active,omitempty"` - - // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions -func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket LegacyCloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - return &CreateFlowLogCollectorOptions{ - StorageBucket: storageBucket, - Target: target, +// UnmarshalBareMetalServerProfileBandwidth unmarshals an instance of BareMetalServerProfileBandwidth from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket LegacyCloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { - _options.StorageBucket = storageBucket - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateFlowLogCollectorOptions) SetTarget(target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - _options.Target = target - return _options -} +// BareMetalServerProfileCpuArchitecture : BareMetalServerProfileCpuArchitecture struct +type BareMetalServerProfileCpuArchitecture struct { + // The default CPU architecture for a bare metal server with this profile. + Default *string `json:"default,omitempty"` -// SetActive : Allow user to set Active -func (_options *CreateFlowLogCollectorOptions) SetActive(active bool) *CreateFlowLogCollectorOptions { - _options.Active = core.BoolPtr(active) - return _options -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateFlowLogCollectorOptions) SetName(name string) *CreateFlowLogCollectorOptions { - _options.Name = core.StringPtr(name) - return _options + // The CPU architecture for a bare metal server with this profile. + Value *string `json:"value" validate:"required"` } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateFlowLogCollectorOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateFlowLogCollectorOptions { - _options.ResourceGroup = resourceGroup - return _options -} +// Constants associated with the BareMetalServerProfileCpuArchitecture.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuArchitectureTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string) *CreateFlowLogCollectorOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileCpuArchitecture unmarshals an instance of BareMetalServerProfileCpuArchitecture from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateIkePolicyOptions : The CreateIkePolicy options. -type CreateIkePolicyOptions struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group" validate:"required"` +// BareMetalServerProfileCpuCoreCount : BareMetalServerProfileCpuCoreCount struct +// Models which "extend" this model: +// - BareMetalServerProfileCpuCoreCountFixed +// - BareMetalServerProfileCpuCoreCountRange +// - BareMetalServerProfileCpuCoreCountEnum +// - BareMetalServerProfileCpuCoreCountDependent +type BareMetalServerProfileCpuCoreCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The name for this IKE policy. The name must not be used by another IKE policies in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIkePolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" - CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm. +// Constants associated with the BareMetalServerProfileCpuCoreCount.Type property. +// The type for this profile field. const ( - CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIkePolicyOptionsEncryptionAlgorithmAes192Const = "aes192" - CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" + BareMetalServerProfileCpuCoreCountTypeFixedConst = "fixed" ) -// NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions -func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { - return &CreateIkePolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - DhGroup: core.Int64Ptr(dhGroup), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - IkeVersion: core.Int64Ptr(ikeVersion), - } -} - -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options -} - -// SetDhGroup : Allow user to set DhGroup -func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { - _options.DhGroup = core.Int64Ptr(dhGroup) - return _options -} - -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIkePolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options -} - -// SetIkeVersion : Allow user to set IkeVersion -func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { - _options.IkeVersion = core.Int64Ptr(ikeVersion) - return _options +func (*BareMetalServerProfileCpuCoreCount) isaBareMetalServerProfileCpuCoreCount() bool { + return true } -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIkePolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIkePolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) - return _options +type BareMetalServerProfileCpuCoreCountIntf interface { + isaBareMetalServerProfileCpuCoreCount() bool } -// SetName : Allow user to set Name -func (_options *CreateIkePolicyOptions) SetName(name string) *CreateIkePolicyOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerProfileCpuCoreCount unmarshals an instance of BareMetalServerProfileCpuCoreCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIkePolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIkePolicyOptions { - _options.ResourceGroup = resourceGroup - return _options -} +// BareMetalServerProfileCpuSocketCount : BareMetalServerProfileCpuSocketCount struct +// Models which "extend" this model: +// - BareMetalServerProfileCpuSocketCountFixed +// - BareMetalServerProfileCpuSocketCountRange +// - BareMetalServerProfileCpuSocketCountEnum +// - BareMetalServerProfileCpuSocketCountDependent +type BareMetalServerProfileCpuSocketCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateIkePolicyOptions) SetHeaders(param map[string]string) *CreateIkePolicyOptions { - options.Headers = param - return options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// CreateImageExportJobOptions : The CreateImageExportJob options. -type CreateImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The Cloud Object Storage bucket to export the image to. The bucket must exist and an IAM - // service authorization must grant `Image Service for VPC` of - // `VPC Infrastructure Services` writer access to the bucket. - StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. - Format *string `json:"format,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The name for this image export job. The name must not be used by another export job for the image. If unspecified, - // the name will be a hyphenated list of randomly-selected words prefixed with the first 16 characters of the parent - // image name. - // - // The exported image object name in Cloud Object Storage (`storage_object.name` in the response) will be based on this - // name. The object name will be unique within the bucket. - Name *string `json:"name,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the CreateImageExportJobOptions.Format property. -// The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. +// Constants associated with the BareMetalServerProfileCpuSocketCount.Type property. +// The type for this profile field. const ( - CreateImageExportJobOptionsFormatQcow2Const = "qcow2" - CreateImageExportJobOptionsFormatVhdConst = "vhd" + BareMetalServerProfileCpuSocketCountTypeFixedConst = "fixed" ) -// NewCreateImageExportJobOptions : Instantiate CreateImageExportJobOptions -func (*VpcV1) NewCreateImageExportJobOptions(imageID string, storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { - return &CreateImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - StorageBucket: storageBucket, - } +func (*BareMetalServerProfileCpuSocketCount) isaBareMetalServerProfileCpuSocketCount() bool { + return true } -// SetImageID : Allow user to set ImageID -func (_options *CreateImageExportJobOptions) SetImageID(imageID string) *CreateImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options +type BareMetalServerProfileCpuSocketCountIntf interface { + isaBareMetalServerProfileCpuSocketCount() bool } -// SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateImageExportJobOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { - _options.StorageBucket = storageBucket - return _options +// UnmarshalBareMetalServerProfileCpuSocketCount unmarshals an instance of BareMetalServerProfileCpuSocketCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetFormat : Allow user to set Format -func (_options *CreateImageExportJobOptions) SetFormat(format string) *CreateImageExportJobOptions { - _options.Format = core.StringPtr(format) - return _options -} +// BareMetalServerProfileCollection : BareMetalServerProfileCollection struct +type BareMetalServerProfileCollection struct { + // A link to the first page of resources. + First *BareMetalServerProfileCollectionFirst `json:"first" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateImageExportJobOptions) SetName(name string) *CreateImageExportJobOptions { - _options.Name = core.StringPtr(name) - return _options + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BareMetalServerProfileCollectionNext `json:"next,omitempty"` + + // Collection of bare metal server profiles. + Profiles []BareMetalServerProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateImageExportJobOptions) SetHeaders(param map[string]string) *CreateImageExportJobOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileCollection unmarshals an instance of BareMetalServerProfileCollection from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerProfileCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalBareMetalServerProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateImageOptions : The CreateImage options. -type CreateImageOptions struct { - // The image prototype object. - ImagePrototype ImagePrototypeIntf `json:"ImagePrototype" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BareMetalServerProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // Allows users to set headers on API requests - Headers map[string]string +// BareMetalServerProfileCollectionFirst : A link to the first page of resources. +type BareMetalServerProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewCreateImageOptions : Instantiate CreateImageOptions -func (*VpcV1) NewCreateImageOptions(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - return &CreateImageOptions{ - ImagePrototype: imagePrototype, +// UnmarshalBareMetalServerProfileCollectionFirst unmarshals an instance of BareMetalServerProfileCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetImagePrototype : Allow user to set ImagePrototype -func (_options *CreateImageOptions) SetImagePrototype(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - _options.ImagePrototype = imagePrototype - return _options +// BareMetalServerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateImageOptions) SetHeaders(param map[string]string) *CreateImageOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileCollectionNext unmarshals an instance of BareMetalServerProfileCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceActionOptions : The CreateInstanceAction options. -type CreateInstanceActionOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The type of action. +// BareMetalServerProfileConsoleTypes : The console type configuration for a bare metal server with this profile. +type BareMetalServerProfileConsoleTypes struct { + // The type for this profile field. Type *string `json:"type" validate:"required"` - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string + // The console types for a bare metal server with this profile. + Values []string `json:"values" validate:"required"` } -// Constants associated with the CreateInstanceActionOptions.Type property. -// The type of action. +// Constants associated with the BareMetalServerProfileConsoleTypes.Type property. +// The type for this profile field. const ( - CreateInstanceActionOptionsTypeRebootConst = "reboot" - CreateInstanceActionOptionsTypeStartConst = "start" - CreateInstanceActionOptionsTypeStopConst = "stop" + BareMetalServerProfileConsoleTypesTypeEnumConst = "enum" ) -// NewCreateInstanceActionOptions : Instantiate CreateInstanceActionOptions -func (*VpcV1) NewCreateInstanceActionOptions(instanceID string, typeVar string) *CreateInstanceActionOptions { - return &CreateInstanceActionOptions{ - InstanceID: core.StringPtr(instanceID), - Type: core.StringPtr(typeVar), - } -} +// Constants associated with the BareMetalServerProfileConsoleTypes.Values property. +// A console type. +const ( + BareMetalServerProfileConsoleTypesValuesSerialConst = "serial" + BareMetalServerProfileConsoleTypesValuesVncConst = "vnc" +) -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceActionOptions) SetInstanceID(instanceID string) *CreateInstanceActionOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetType : Allow user to set Type -func (_options *CreateInstanceActionOptions) SetType(typeVar string) *CreateInstanceActionOptions { - _options.Type = core.StringPtr(typeVar) - return _options +// UnmarshalBareMetalServerProfileConsoleTypes unmarshals an instance of BareMetalServerProfileConsoleTypes from the specified map of raw messages. +func UnmarshalBareMetalServerProfileConsoleTypes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileConsoleTypes) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetForce : Allow user to set Force -func (_options *CreateInstanceActionOptions) SetForce(force bool) *CreateInstanceActionOptions { - _options.Force = core.BoolPtr(force) - return _options +// BareMetalServerProfileDisk : Disks provided by this profile. +type BareMetalServerProfileDisk struct { + Quantity BareMetalServerProfileDiskQuantityIntf `json:"quantity" validate:"required"` + + Size BareMetalServerProfileDiskSizeIntf `json:"size" validate:"required"` + + SupportedInterfaceTypes *BareMetalServerProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceActionOptions) SetHeaders(param map[string]string) *CreateInstanceActionOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileDisk unmarshals an instance of BareMetalServerProfileDisk from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDisk) + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalBareMetalServerProfileDiskQuantity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalBareMetalServerProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalBareMetalServerProfileDiskSupportedInterfaces) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceConsoleAccessTokenOptions : The CreateInstanceConsoleAccessToken options. -type CreateInstanceConsoleAccessTokenOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// BareMetalServerProfileDiskQuantity : BareMetalServerProfileDiskQuantity struct +// Models which "extend" this model: +// - BareMetalServerProfileDiskQuantityFixed +// - BareMetalServerProfileDiskQuantityRange +// - BareMetalServerProfileDiskQuantityEnum +// - BareMetalServerProfileDiskQuantityDependent +type BareMetalServerProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// Constants associated with the CreateInstanceConsoleAccessTokenOptions.ConsoleType property. -// The instance console type for which this token may be used. -const ( - CreateInstanceConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" - CreateInstanceConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" -) + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// NewCreateInstanceConsoleAccessTokenOptions : Instantiate CreateInstanceConsoleAccessTokenOptions -func (*VpcV1) NewCreateInstanceConsoleAccessTokenOptions(instanceID string, consoleType string) *CreateInstanceConsoleAccessTokenOptions { - return &CreateInstanceConsoleAccessTokenOptions{ - InstanceID: core.StringPtr(instanceID), - ConsoleType: core.StringPtr(consoleType), - } -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceConsoleAccessTokenOptions) SetInstanceID(instanceID string) *CreateInstanceConsoleAccessTokenOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetConsoleType : Allow user to set ConsoleType -func (_options *CreateInstanceConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateInstanceConsoleAccessTokenOptions { - _options.ConsoleType = core.StringPtr(consoleType) - return _options +// Constants associated with the BareMetalServerProfileDiskQuantity.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileDiskQuantity) isaBareMetalServerProfileDiskQuantity() bool { + return true } -// SetForce : Allow user to set Force -func (_options *CreateInstanceConsoleAccessTokenOptions) SetForce(force bool) *CreateInstanceConsoleAccessTokenOptions { - _options.Force = core.BoolPtr(force) - return _options +type BareMetalServerProfileDiskQuantityIntf interface { + isaBareMetalServerProfileDiskQuantity() bool } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateInstanceConsoleAccessTokenOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileDiskQuantity unmarshals an instance of BareMetalServerProfileDiskQuantity from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceGroupManagerActionOptions : The CreateInstanceGroupManagerAction options. -type CreateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// BareMetalServerProfileDiskSize : BareMetalServerProfileDiskSize struct +// Models which "extend" this model: +// - BareMetalServerProfileDiskSizeFixed +// - BareMetalServerProfileDiskSizeRange +// - BareMetalServerProfileDiskSizeEnum +// - BareMetalServerProfileDiskSizeDependent +type BareMetalServerProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The instance group manager action prototype object. - InstanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf `json:"InstanceGroupManagerActionPrototype" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewCreateInstanceGroupManagerActionOptions : Instantiate CreateInstanceGroupManagerActionOptions -func (*VpcV1) NewCreateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - return &CreateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerActionPrototype: instanceGroupManagerActionPrototype, - } -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetInstanceGroupManagerActionPrototype : Allow user to set InstanceGroupManagerActionPrototype -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototype - return _options -} +// Constants associated with the BareMetalServerProfileDiskSize.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerActionOptions { - options.Headers = param - return options +func (*BareMetalServerProfileDiskSize) isaBareMetalServerProfileDiskSize() bool { + return true } -// CreateInstanceGroupManagerOptions : The CreateInstanceGroupManager options. -type CreateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager prototype object. - InstanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf `json:"InstanceGroupManagerPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type BareMetalServerProfileDiskSizeIntf interface { + isaBareMetalServerProfileDiskSize() bool } -// NewCreateInstanceGroupManagerOptions : Instantiate CreateInstanceGroupManagerOptions -func (*VpcV1) NewCreateInstanceGroupManagerOptions(instanceGroupID string, instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - return &CreateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerPrototype: instanceGroupManagerPrototype, +// UnmarshalBareMetalServerProfileDiskSize unmarshals an instance of BareMetalServerProfileDiskSize from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} +// BareMetalServerProfileDiskSupportedInterfaces : BareMetalServerProfileDiskSupportedInterfaces struct +type BareMetalServerProfileDiskSupportedInterfaces struct { + // The disk interface used for attaching the disk. + // + // - `fcp`: Attached using Fiber Channel Protocol + // - `sata`: Attached using Serial Advanced Technology Attachment + // - `nvme`: Attached using Non-Volatile Memory Express + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Default *string `json:"default" validate:"required"` -// SetInstanceGroupManagerPrototype : Allow user to set InstanceGroupManagerPrototype -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupManagerPrototype(instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPrototype = instanceGroupManagerPrototype - return _options -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerOptions { - options.Headers = param - return options + // The supported disk interfaces used for attaching the disk. + Values []string `json:"values" validate:"required"` } -// CreateInstanceGroupManagerPolicyOptions : The CreateInstanceGroupManagerPolicy options. -type CreateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Default property. +// The disk interface used for attaching the disk. +// +// - `fcp`: Attached using Fiber Channel Protocol +// - `sata`: Attached using Serial Advanced Technology Attachment +// - `nvme`: Attached using Non-Volatile Memory Express +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerProfileDiskSupportedInterfacesDefaultFcpConst = "fcp" + BareMetalServerProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" + BareMetalServerProfileDiskSupportedInterfacesDefaultSataConst = "sata" +) - // The instance group manager policy prototype object. - InstanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf `json:"InstanceGroupManagerPolicyPrototype" validate:"required"` +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSupportedInterfacesTypeEnumConst = "enum" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Values property. +// The disk interface used for attaching the disk. +// +// - `fcp`: Attached using Fiber Channel Protocol +// - `sata`: Attached using Serial Advanced Technology Attachment +// - `nvme`: Attached using Non-Volatile Memory Express +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerProfileDiskSupportedInterfacesValuesFcpConst = "fcp" + BareMetalServerProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" + BareMetalServerProfileDiskSupportedInterfacesValuesSataConst = "sata" +) -// NewCreateInstanceGroupManagerPolicyOptions : Instantiate CreateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - return &CreateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerPolicyPrototype: instanceGroupManagerPolicyPrototype, +// UnmarshalBareMetalServerProfileDiskSupportedInterfaces unmarshals an instance of BareMetalServerProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} +// BareMetalServerProfileIdentity : Identifies a bare metal server profile by a unique property. +// Models which "extend" this model: +// - BareMetalServerProfileIdentityByName +// - BareMetalServerProfileIdentityByHref +type BareMetalServerProfileIdentity struct { + // The name for this bare metal server profile. + Name *string `json:"name,omitempty"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options + // The URL for this bare metal server profile. + Href *string `json:"href,omitempty"` } -// SetInstanceGroupManagerPolicyPrototype : Allow user to set InstanceGroupManagerPolicyPrototype -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototype - return _options +func (*BareMetalServerProfileIdentity) isaBareMetalServerProfileIdentity() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerPolicyOptions { - options.Headers = param - return options +type BareMetalServerProfileIdentityIntf interface { + isaBareMetalServerProfileIdentity() bool } -// CreateInstanceGroupOptions : The CreateInstanceGroup options. -type CreateInstanceGroupOptions struct { - // Instance template to use when creating new instances. - // - // Instance groups are not compatible with instance templates that specify `true` for - // `default_trusted_profile.auto_link`. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template" validate:"required"` - - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - - // The port to use for new load balancer pool members created by this instance group. The load balancer pool member - // will receive load balancer traffic on this port, unless the load balancer listener is using a port range. (Traffic - // received on a listener using a port range will be sent to members using the same port the listener received it on.) - // - // This port will also be used for health checks unless the port property of - // `health_monitor` property is specified. - // - // This property must be specified if and only if `load_balancer_pool` has been specified. - ApplicationPort *int64 `json:"application_port,omitempty"` - - // The load balancer associated with the specified load balancer pool. - // Required if `load_balancer_pool` is specified. The load balancer must have - // `instance_groups_supported` set to `true`. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` +// UnmarshalBareMetalServerProfileIdentity unmarshals an instance of BareMetalServerProfileIdentity from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // If specified, this instance group will manage the load balancer pool. A pool member - // will be created for each instance created by this group. The specified load - // balancer pool must not be used by another instance group in the VPC. - // - // If specified, `load_balancer` and `application_port` must also be specified. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` +// BareMetalServerProfileMemory : BareMetalServerProfileMemory struct +// Models which "extend" this model: +// - BareMetalServerProfileMemoryFixed +// - BareMetalServerProfileMemoryRange +// - BareMetalServerProfileMemoryEnum +// - BareMetalServerProfileMemoryDependent +type BareMetalServerProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The name for this instance group. The name must not be used by another instance group in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// NewCreateInstanceGroupOptions : Instantiate CreateInstanceGroupOptions -func (*VpcV1) NewCreateInstanceGroupOptions(instanceTemplate InstanceTemplateIdentityIntf, subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - return &CreateInstanceGroupOptions{ - InstanceTemplate: instanceTemplate, - Subnets: subnets, - } -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetInstanceTemplate : Allow user to set InstanceTemplate -func (_options *CreateInstanceGroupOptions) SetInstanceTemplate(instanceTemplate InstanceTemplateIdentityIntf) *CreateInstanceGroupOptions { - _options.InstanceTemplate = instanceTemplate - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetSubnets : Allow user to set Subnets -func (_options *CreateInstanceGroupOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - _options.Subnets = subnets - return _options -} +// Constants associated with the BareMetalServerProfileMemory.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryTypeFixedConst = "fixed" +) -// SetApplicationPort : Allow user to set ApplicationPort -func (_options *CreateInstanceGroupOptions) SetApplicationPort(applicationPort int64) *CreateInstanceGroupOptions { - _options.ApplicationPort = core.Int64Ptr(applicationPort) - return _options +func (*BareMetalServerProfileMemory) isaBareMetalServerProfileMemory() bool { + return true } -// SetLoadBalancer : Allow user to set LoadBalancer -func (_options *CreateInstanceGroupOptions) SetLoadBalancer(loadBalancer LoadBalancerIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancer = loadBalancer - return _options +type BareMetalServerProfileMemoryIntf interface { + isaBareMetalServerProfileMemory() bool } -// SetLoadBalancerPool : Allow user to set LoadBalancerPool -func (_options *CreateInstanceGroupOptions) SetLoadBalancerPool(loadBalancerPool LoadBalancerPoolIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancerPool = loadBalancerPool - return _options -} - -// SetMembershipCount : Allow user to set MembershipCount -func (_options *CreateInstanceGroupOptions) SetMembershipCount(membershipCount int64) *CreateInstanceGroupOptions { - _options.MembershipCount = core.Int64Ptr(membershipCount) - return _options +// UnmarshalBareMetalServerProfileMemory unmarshals an instance of BareMetalServerProfileMemory from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *CreateInstanceGroupOptions) SetName(name string) *CreateInstanceGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} +// BareMetalServerProfileNetworkAttachmentCount : BareMetalServerProfileNetworkAttachmentCount struct +// Models which "extend" this model: +// - BareMetalServerProfileNetworkAttachmentCountRange +// - BareMetalServerProfileNetworkAttachmentCountDependent +type BareMetalServerProfileNetworkAttachmentCount struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateInstanceGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateInstanceGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupOptions) SetHeaders(param map[string]string) *CreateInstanceGroupOptions { - options.Headers = param - return options + // The type for this profile field. + Type *string `json:"type,omitempty"` } -// CreateInstanceNetworkInterfaceOptions : The CreateInstanceNetworkInterface options. -type CreateInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Indicates whether source IP spoofing is allowed on this instance network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` +// Constants associated with the BareMetalServerProfileNetworkAttachmentCount.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileNetworkAttachmentCountTypeRangeConst = "range" +) - // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is - // used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` +func (*BareMetalServerProfileNetworkAttachmentCount) isaBareMetalServerProfileNetworkAttachmentCount() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type BareMetalServerProfileNetworkAttachmentCountIntf interface { + isaBareMetalServerProfileNetworkAttachmentCount() bool } -// NewCreateInstanceNetworkInterfaceOptions : Instantiate CreateInstanceNetworkInterfaceOptions -func (*VpcV1) NewCreateInstanceNetworkInterfaceOptions(instanceID string, subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - return &CreateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - Subnet: subnet, +// UnmarshalBareMetalServerProfileNetworkAttachmentCount unmarshals an instance of BareMetalServerProfileNetworkAttachmentCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkAttachmentCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkAttachmentCount) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} +// BareMetalServerProfileNetworkInterfaceCount : BareMetalServerProfileNetworkInterfaceCount struct +// Models which "extend" this model: +// - BareMetalServerProfileNetworkInterfaceCountRange +// - BareMetalServerProfileNetworkInterfaceCountDependent +type BareMetalServerProfileNetworkInterfaceCount struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// SetSubnet : Allow user to set Subnet -func (_options *CreateInstanceNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.Subnet = subnet - return _options -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing -func (_options *CreateInstanceNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateInstanceNetworkInterfaceOptions { - _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) - return _options + // The type for this profile field. + Type *string `json:"type,omitempty"` } -// SetName : Allow user to set Name -func (_options *CreateInstanceNetworkInterfaceOptions) SetName(name string) *CreateInstanceNetworkInterfaceOptions { - _options.Name = core.StringPtr(name) - return _options -} +// Constants associated with the BareMetalServerProfileNetworkInterfaceCount.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileNetworkInterfaceCountTypeRangeConst = "range" +) -// SetPrimaryIP : Allow user to set PrimaryIP -func (_options *CreateInstanceNetworkInterfaceOptions) SetPrimaryIP(primaryIP NetworkInterfaceIPPrototypeIntf) *CreateInstanceNetworkInterfaceOptions { - _options.PrimaryIP = primaryIP - return _options +func (*BareMetalServerProfileNetworkInterfaceCount) isaBareMetalServerProfileNetworkInterfaceCount() bool { + return true } -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateInstanceNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.SecurityGroups = securityGroups - return _options +type BareMetalServerProfileNetworkInterfaceCountIntf interface { + isaBareMetalServerProfileNetworkInterfaceCount() bool } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkInterfaceOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileNetworkInterfaceCount unmarshals an instance of BareMetalServerProfileNetworkInterfaceCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkInterfaceCount) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceOptions : The CreateInstance options. -type CreateInstanceOptions struct { - // The instance prototype object. - InstancePrototype InstancePrototypeIntf `json:"InstancePrototype" validate:"required"` +// BareMetalServerProfileOsArchitecture : BareMetalServerProfileOsArchitecture struct +type BareMetalServerProfileOsArchitecture struct { + // The default OS architecture for a bare metal server with this profile. + Default *string `json:"default" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// NewCreateInstanceOptions : Instantiate CreateInstanceOptions -func (*VpcV1) NewCreateInstanceOptions(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - return &CreateInstanceOptions{ - InstancePrototype: instancePrototype, - } + // The supported OS architecture(s) for a bare metal server with this profile. + Values []string `json:"values" validate:"required"` } -// SetInstancePrototype : Allow user to set InstancePrototype -func (_options *CreateInstanceOptions) SetInstancePrototype(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - _options.InstancePrototype = instancePrototype - return _options -} +// Constants associated with the BareMetalServerProfileOsArchitecture.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileOsArchitectureTypeEnumConst = "enum" +) -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceOptions) SetHeaders(param map[string]string) *CreateInstanceOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileOsArchitecture unmarshals an instance of BareMetalServerProfileOsArchitecture from the specified map of raw messages. +func UnmarshalBareMetalServerProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileOsArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceTemplateOptions : The CreateInstanceTemplate options. -type CreateInstanceTemplateOptions struct { - // The instance template prototype object. - InstanceTemplatePrototype InstanceTemplatePrototypeIntf `json:"InstanceTemplatePrototype" validate:"required"` +// BareMetalServerProfileReference : BareMetalServerProfileReference struct +type BareMetalServerProfileReference struct { + // The URL for this bare metal server profile. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The name for this bare metal server profile. + Name *string `json:"name" validate:"required"` -// NewCreateInstanceTemplateOptions : Instantiate CreateInstanceTemplateOptions -func (*VpcV1) NewCreateInstanceTemplateOptions(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - return &CreateInstanceTemplateOptions{ - InstanceTemplatePrototype: instanceTemplatePrototype, - } + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// SetInstanceTemplatePrototype : Allow user to set InstanceTemplatePrototype -func (_options *CreateInstanceTemplateOptions) SetInstanceTemplatePrototype(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - _options.InstanceTemplatePrototype = instanceTemplatePrototype - return _options -} +// Constants associated with the BareMetalServerProfileReference.ResourceType property. +// The resource type. +const ( + BareMetalServerProfileReferenceResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" +) -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceTemplateOptions) SetHeaders(param map[string]string) *CreateInstanceTemplateOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileReference unmarshals an instance of BareMetalServerProfileReference from the specified map of raw messages. +func UnmarshalBareMetalServerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateInstanceVolumeAttachmentOptions : The CreateInstanceVolumeAttachment options. -type CreateInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` +// BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module modes for this bare metal server profile. +type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + // The supported trusted platform module modes. + Values []string `json:"values" validate:"required"` +} - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileSupportedTrustedPlatformModuleModesTypeEnumConst = "enum" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Values property. +// The trusted platform module (TPM) mode: +// - `disabled`: No TPM functionality +// - `tpm_2`: TPM 2.0 +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesDisabledConst = "disabled" + BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesTpm2Const = "tpm_2" +) -// NewCreateInstanceVolumeAttachmentOptions : Instantiate CreateInstanceVolumeAttachmentOptions -func (*VpcV1) NewCreateInstanceVolumeAttachmentOptions(instanceID string, volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - return &CreateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - Volume: volume, +// UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes unmarshals an instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes from the specified map of raw messages. +func UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileSupportedTrustedPlatformModuleModes) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} +// BareMetalServerProfileVirtualNetworkInterfacesSupported : Indicates whether this profile supports virtual network interfaces. +type BareMetalServerProfileVirtualNetworkInterfacesSupported struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetVolume : Allow user to set Volume -func (_options *CreateInstanceVolumeAttachmentOptions) SetVolume(volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - _options.Volume = volume - return _options + // The value for this profile field. + Value *bool `json:"value" validate:"required"` } -// SetDeleteVolumeOnInstanceDelete : Allow user to set DeleteVolumeOnInstanceDelete -func (_options *CreateInstanceVolumeAttachmentOptions) SetDeleteVolumeOnInstanceDelete(deleteVolumeOnInstanceDelete bool) *CreateInstanceVolumeAttachmentOptions { - _options.DeleteVolumeOnInstanceDelete = core.BoolPtr(deleteVolumeOnInstanceDelete) - return _options -} +// Constants associated with the BareMetalServerProfileVirtualNetworkInterfacesSupported.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileVirtualNetworkInterfacesSupportedTypeFixedConst = "fixed" +) -// SetName : Allow user to set Name -func (_options *CreateInstanceVolumeAttachmentOptions) SetName(name string) *CreateInstanceVolumeAttachmentOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported unmarshals an instance of BareMetalServerProfileVirtualNetworkInterfacesSupported from the specified map of raw messages. +func UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileVirtualNetworkInterfacesSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} +// BareMetalServerPrototype : BareMetalServerPrototype struct +// Models which "extend" this model: +// - BareMetalServerPrototypeBareMetalServerByNetworkAttachment +// - BareMetalServerPrototypeBareMetalServerByNetworkInterface +type BareMetalServerPrototype struct { + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to + // boot. + EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` -// CreateIpsecPolicyOptions : The CreateIpsecPolicy options. -type CreateIpsecPolicyOptions struct { - // The authentication algorithm - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - // The encryption algorithm + // The name for this bare metal server. The name must not be used by another bare metal server in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // Perfect Forward Secrecy. - Pfs *string `json:"pfs" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The name for this IPsec policy. The name must not be used by another IPsec policies in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + // to use for this bare metal server. + Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - CreateIpsecPolicyOptionsAuthenticationAlgorithmDisabledConst = "disabled" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - CreateIpsecPolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes192Const = "aes192" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes256Const = "aes256" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" -) - -// Constants associated with the CreateIpsecPolicyOptions.Pfs property. -// Perfect Forward Secrecy. -const ( - CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" - CreateIpsecPolicyOptionsPfsGroup14Const = "group_14" - CreateIpsecPolicyOptionsPfsGroup15Const = "group_15" - CreateIpsecPolicyOptionsPfsGroup16Const = "group_16" - CreateIpsecPolicyOptionsPfsGroup17Const = "group_17" - CreateIpsecPolicyOptionsPfsGroup18Const = "group_18" - CreateIpsecPolicyOptionsPfsGroup19Const = "group_19" - CreateIpsecPolicyOptionsPfsGroup20Const = "group_20" - CreateIpsecPolicyOptionsPfsGroup21Const = "group_21" - CreateIpsecPolicyOptionsPfsGroup22Const = "group_22" - CreateIpsecPolicyOptionsPfsGroup23Const = "group_23" - CreateIpsecPolicyOptionsPfsGroup24Const = "group_24" - CreateIpsecPolicyOptionsPfsGroup31Const = "group_31" -) + TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` -// NewCreateIpsecPolicyOptions : Instantiate CreateIpsecPolicyOptions -func (*VpcV1) NewCreateIpsecPolicyOptions(authenticationAlgorithm string, encryptionAlgorithm string, pfs string) *CreateIpsecPolicyOptions { - return &CreateIpsecPolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - Pfs: core.StringPtr(pfs), - } -} + // Identifies a VPC by a unique property. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options -} + // The zone this bare metal server will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options -} + // The additional network attachments to create for the bare metal server. + NetworkAttachments []BareMetalServerNetworkAttachmentPrototypeIntf `json:"network_attachments,omitempty"` -// SetPfs : Allow user to set Pfs -func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { - _options.Pfs = core.StringPtr(pfs) - return _options -} + // The primary network attachment to create for the bare metal server. + PrimaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf `json:"primary_network_attachment,omitempty"` -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIpsecPolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIpsecPolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) - return _options -} + // The additional bare metal server network interfaces to create. + NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` -// SetName : Allow user to set Name -func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolicyOptions { - _options.Name = core.StringPtr(name) - return _options + // The primary bare metal server network interface to create. + PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { - _options.ResourceGroup = resourceGroup - return _options +func (*BareMetalServerPrototype) isaBareMetalServerPrototype() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *CreateIpsecPolicyOptions) SetHeaders(param map[string]string) *CreateIpsecPolicyOptions { - options.Headers = param - return options +type BareMetalServerPrototypeIntf interface { + isaBareMetalServerPrototype() bool } -// CreateKeyOptions : The CreateKey options. -type CreateKeyOptions struct { - // A unique public SSH key to import, in OpenSSH format (consisting of three space-separated fields: the algorithm - // name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is - // imported. - // - // Keys of type `rsa` may be 2048 or 4096 bits in length, however 4096 is recommended. Keys of type `ed25519` are 256 - // bits in length. - PublicKey *string `json:"public_key" validate:"required"` - - // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// UnmarshalBareMetalServerPrototype unmarshals an instance of BareMetalServerPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrototype) + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + if err != nil { + return + } + err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// BareMetalServerStatusReason : BareMetalServerStatusReason struct +type BareMetalServerStatusReason struct { + // The status reason code: + // - `cannot_start`: Failed to start due to an internal error + // - `cannot_start_capacity`: Insufficient capacity within the selected zone + // - `cannot_start_compute`: An error occurred while allocating compute resources + // - `cannot_start_ip_address`: An error occurred while allocating an IP address + // - `cannot_start_network`: An error occurred while allocating network resources. + Code *string `json:"code" validate:"required"` - // The crypto-system used by this key. - Type *string `json:"type,omitempty"` + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// Constants associated with the CreateKeyOptions.Type property. -// The crypto-system used by this key. +// Constants associated with the BareMetalServerStatusReason.Code property. +// The status reason code: +// - `cannot_start`: Failed to start due to an internal error +// - `cannot_start_capacity`: Insufficient capacity within the selected zone +// - `cannot_start_compute`: An error occurred while allocating compute resources +// - `cannot_start_ip_address`: An error occurred while allocating an IP address +// - `cannot_start_network`: An error occurred while allocating network resources. const ( - CreateKeyOptionsTypeEd25519Const = "ed25519" - CreateKeyOptionsTypeRsaConst = "rsa" + BareMetalServerStatusReasonCodeCannotStartConst = "cannot_start" + BareMetalServerStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + BareMetalServerStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + BareMetalServerStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + BareMetalServerStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" ) -// NewCreateKeyOptions : Instantiate CreateKeyOptions -func (*VpcV1) NewCreateKeyOptions(publicKey string) *CreateKeyOptions { - return &CreateKeyOptions{ - PublicKey: core.StringPtr(publicKey), +// UnmarshalBareMetalServerStatusReason unmarshals an instance of BareMetalServerStatusReason from the specified map of raw messages. +func UnmarshalBareMetalServerStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPublicKey : Allow user to set PublicKey -func (_options *CreateKeyOptions) SetPublicKey(publicKey string) *CreateKeyOptions { - _options.PublicKey = core.StringPtr(publicKey) - return _options -} +// BareMetalServerTrustedPlatformModule : BareMetalServerTrustedPlatformModule struct +type BareMetalServerTrustedPlatformModule struct { + // Indicates whether the trusted platform module is enabled. + Enabled *bool `json:"enabled" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateKeyOptions) SetName(name string) *CreateKeyOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The trusted platform module (TPM) mode: + // - `disabled`: No TPM functionality + // - `tpm_2`: TPM 2.0 + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Mode *string `json:"mode" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateKeyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateKeyOptions { - _options.ResourceGroup = resourceGroup - return _options + // The supported trusted platform module modes. + SupportedModes []string `json:"supported_modes" validate:"required"` } -// SetType : Allow user to set Type -func (_options *CreateKeyOptions) SetType(typeVar string) *CreateKeyOptions { - _options.Type = core.StringPtr(typeVar) - return _options +// Constants associated with the BareMetalServerTrustedPlatformModule.Mode property. +// The trusted platform module (TPM) mode: +// - `disabled`: No TPM functionality +// - `tpm_2`: TPM 2.0 +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerTrustedPlatformModuleModeDisabledConst = "disabled" + BareMetalServerTrustedPlatformModuleModeTpm2Const = "tpm_2" +) + +// Constants associated with the BareMetalServerTrustedPlatformModule.SupportedModes property. +// The trusted platform module (TPM) mode: +// - `disabled`: No TPM functionality +// - `tpm_2`: TPM 2.0 +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerTrustedPlatformModuleSupportedModesDisabledConst = "disabled" + BareMetalServerTrustedPlatformModuleSupportedModesTpm2Const = "tpm_2" +) + +// UnmarshalBareMetalServerTrustedPlatformModule unmarshals an instance of BareMetalServerTrustedPlatformModule from the specified map of raw messages. +func UnmarshalBareMetalServerTrustedPlatformModule(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerTrustedPlatformModule) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "supported_modes", &obj.SupportedModes) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateKeyOptions) SetHeaders(param map[string]string) *CreateKeyOptions { - options.Headers = param - return options +// BareMetalServerTrustedPlatformModulePatch : BareMetalServerTrustedPlatformModulePatch struct +type BareMetalServerTrustedPlatformModulePatch struct { + // The trusted platform module mode to use. The specified value must be listed in the bare metal server's + // `supported_modes`. + // + // For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. + Mode *string `json:"mode,omitempty"` } -// CreateLoadBalancerListenerOptions : The CreateLoadBalancerListener options. -type CreateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// Constants associated with the BareMetalServerTrustedPlatformModulePatch.Mode property. +// The trusted platform module mode to use. The specified value must be listed in the bare metal server's +// `supported_modes`. +// +// For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. +const ( + BareMetalServerTrustedPlatformModulePatchModeDisabledConst = "disabled" + BareMetalServerTrustedPlatformModulePatchModeTpm2Const = "tpm_2" +) - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // Additional restrictions: - // - If `default_pool` is set, the pool's protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and - // `https`. - // - If `https_redirect` is set, the protocol must be `http`. - Protocol *string `json:"protocol" validate:"required"` +// UnmarshalBareMetalServerTrustedPlatformModulePatch unmarshals an instance of BareMetalServerTrustedPlatformModulePatch from the specified map of raw messages. +func UnmarshalBareMetalServerTrustedPlatformModulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerTrustedPlatformModulePatch) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` +// BareMetalServerTrustedPlatformModulePrototype : BareMetalServerTrustedPlatformModulePrototype struct +type BareMetalServerTrustedPlatformModulePrototype struct { + // The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's + // `supported_trusted_platform_module_modes`. + Mode *string `json:"mode,omitempty"` +} - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` +// Constants associated with the BareMetalServerTrustedPlatformModulePrototype.Mode property. +// The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's +// `supported_trusted_platform_module_modes`. +const ( + BareMetalServerTrustedPlatformModulePrototypeModeDisabledConst = "disabled" + BareMetalServerTrustedPlatformModulePrototypeModeTpm2Const = "tpm_2" +) - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// UnmarshalBareMetalServerTrustedPlatformModulePrototype unmarshals an instance of BareMetalServerTrustedPlatformModulePrototype from the specified map of raw messages. +func UnmarshalBareMetalServerTrustedPlatformModulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerTrustedPlatformModulePrototype) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The default pool for this listener. If specified, the pool must: - // - Belong to this load balancer. - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener. - // - // If unspecified, this listener will be created with no default pool, but one may be - // subsequently set. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` +// CatalogOfferingIdentity : Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique +// property. +// Models which "extend" this model: +// - CatalogOfferingIdentityCatalogOfferingByCRN +type CatalogOfferingIdentity struct { + // The CRN for this + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + CRN *string `json:"crn,omitempty"` +} - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` +func (*CatalogOfferingIdentity) isaCatalogOfferingIdentity() bool { + return true +} - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` +type CatalogOfferingIdentityIntf interface { + isaCatalogOfferingIdentity() bool +} - // The policy prototype objects for this listener. The load balancer must be in the - // `application` family. - Policies []LoadBalancerListenerPolicyPrototype `json:"policies,omitempty"` +// UnmarshalCatalogOfferingIdentity unmarshals an instance of CatalogOfferingIdentity from the specified map of raw messages. +func UnmarshalCatalogOfferingIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CatalogOfferingIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` +// CatalogOfferingVersionIdentity : Identifies a version of a +// [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique property. +// Models which "extend" this model: +// - CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN +type CatalogOfferingVersionIdentity struct { + // The CRN for this version of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + CRN *string `json:"crn,omitempty"` +} - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` +func (*CatalogOfferingVersionIdentity) isaCatalogOfferingVersionIdentity() bool { + return true +} - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` +type CatalogOfferingVersionIdentityIntf interface { + isaCatalogOfferingVersionIdentity() bool +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalCatalogOfferingVersionIdentity unmarshals an instance of CatalogOfferingVersionIdentity from the specified map of raw messages. +func UnmarshalCatalogOfferingVersionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CatalogOfferingVersionIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// Constants associated with the CreateLoadBalancerListenerOptions.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the pool's protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and -// `https`. -// - If `https_redirect` is set, the protocol must be `http`. -const ( - CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" - CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerListenerOptionsProtocolTCPConst = "tcp" - CreateLoadBalancerListenerOptionsProtocolUDPConst = "udp" -) +// CatalogOfferingVersionReference : CatalogOfferingVersionReference struct +type CatalogOfferingVersionReference struct { + // The CRN for this version of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + CRN *string `json:"crn" validate:"required"` +} -// NewCreateLoadBalancerListenerOptions : Instantiate CreateLoadBalancerListenerOptions -func (*VpcV1) NewCreateLoadBalancerListenerOptions(loadBalancerID string, protocol string) *CreateLoadBalancerListenerOptions { - return &CreateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Protocol: core.StringPtr(protocol), +// UnmarshalCatalogOfferingVersionReference unmarshals an instance of CatalogOfferingVersionReference from the specified map of raw messages. +func UnmarshalCatalogOfferingVersionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CatalogOfferingVersionReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// CertificateInstanceIdentity : Identifies a certificate instance by a unique property. +// Models which "extend" this model: +// - CertificateInstanceIdentityByCRN +type CertificateInstanceIdentity struct { + // The CRN for this certificate instance. + CRN *string `json:"crn,omitempty"` } -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerListenerOptions) SetProtocol(protocol string) *CreateLoadBalancerListenerOptions { - _options.Protocol = core.StringPtr(protocol) - return _options +func (*CertificateInstanceIdentity) isaCertificateInstanceIdentity() bool { + return true } -// SetAcceptProxyProtocol : Allow user to set AcceptProxyProtocol -func (_options *CreateLoadBalancerListenerOptions) SetAcceptProxyProtocol(acceptProxyProtocol bool) *CreateLoadBalancerListenerOptions { - _options.AcceptProxyProtocol = core.BoolPtr(acceptProxyProtocol) - return _options +type CertificateInstanceIdentityIntf interface { + isaCertificateInstanceIdentity() bool } -// SetCertificateInstance : Allow user to set CertificateInstance -func (_options *CreateLoadBalancerListenerOptions) SetCertificateInstance(certificateInstance CertificateInstanceIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.CertificateInstance = certificateInstance - return _options +// UnmarshalCertificateInstanceIdentity unmarshals an instance of CertificateInstanceIdentity from the specified map of raw messages. +func UnmarshalCertificateInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CertificateInstanceIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetConnectionLimit : Allow user to set ConnectionLimit -func (_options *CreateLoadBalancerListenerOptions) SetConnectionLimit(connectionLimit int64) *CreateLoadBalancerListenerOptions { - _options.ConnectionLimit = core.Int64Ptr(connectionLimit) - return _options +// CertificateInstanceReference : CertificateInstanceReference struct +type CertificateInstanceReference struct { + // The CRN for this certificate instance. + CRN *string `json:"crn" validate:"required"` } -// SetDefaultPool : Allow user to set DefaultPool -func (_options *CreateLoadBalancerListenerOptions) SetDefaultPool(defaultPool LoadBalancerPoolIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.DefaultPool = defaultPool - return _options +// UnmarshalCertificateInstanceReference unmarshals an instance of CertificateInstanceReference from the specified map of raw messages. +func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CertificateInstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHTTPSRedirect : Allow user to set HTTPSRedirect -func (_options *CreateLoadBalancerListenerOptions) SetHTTPSRedirect(httpsRedirect *LoadBalancerListenerHTTPSRedirectPrototype) *CreateLoadBalancerListenerOptions { - _options.HTTPSRedirect = httpsRedirect - return _options +// CheckVPNGatewayConnectionLocalCIDROptions : The CheckVPNGatewayConnectionLocalCIDR options. +type CheckVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetIdleConnectionTimeout : Allow user to set IdleConnectionTimeout -func (_options *CreateLoadBalancerListenerOptions) SetIdleConnectionTimeout(idleConnectionTimeout int64) *CreateLoadBalancerListenerOptions { - _options.IdleConnectionTimeout = core.Int64Ptr(idleConnectionTimeout) - return _options +// NewCheckVPNGatewayConnectionLocalCIDROptions : Instantiate CheckVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewCheckVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { + return &CheckVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), + } } -// SetPolicies : Allow user to set Policies -func (_options *CreateLoadBalancerListenerOptions) SetPolicies(policies []LoadBalancerListenerPolicyPrototype) *CreateLoadBalancerListenerOptions { - _options.Policies = policies +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerListenerOptions) SetPort(port int64) *CreateLoadBalancerListenerOptions { - _options.Port = core.Int64Ptr(port) +// SetID : Allow user to set ID +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetID(id string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetPortMax : Allow user to set PortMax -func (_options *CreateLoadBalancerListenerOptions) SetPortMax(portMax int64) *CreateLoadBalancerListenerOptions { - _options.PortMax = core.Int64Ptr(portMax) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetPortMin : Allow user to set PortMin -func (_options *CreateLoadBalancerListenerOptions) SetPortMin(portMin int64) *CreateLoadBalancerListenerOptions { - _options.PortMin = core.Int64Ptr(portMin) +// SetPrefixLength : Allow user to set PrefixLength +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerOptions { +func (options *CheckVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionLocalCIDROptions { options.Headers = param return options } -// CreateLoadBalancerListenerPolicyOptions : The CreateLoadBalancerListenerPolicy options. -type CreateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` +// CheckVPNGatewayConnectionPeerCIDROptions : The CheckVPNGatewayConnectionPeerCIDR options. +type CheckVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The name for this policy. The name must not be used by another policy for the load balancer listener. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateLoadBalancerListenerPolicyOptions.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - CreateLoadBalancerListenerPolicyOptionsActionForwardConst = "forward" - CreateLoadBalancerListenerPolicyOptionsActionHTTPSRedirectConst = "https_redirect" - CreateLoadBalancerListenerPolicyOptionsActionRedirectConst = "redirect" - CreateLoadBalancerListenerPolicyOptionsActionRejectConst = "reject" -) - -// NewCreateLoadBalancerListenerPolicyOptions : Instantiate CreateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, action string, priority int64) *CreateLoadBalancerListenerPolicyOptions { - return &CreateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), +// NewCheckVPNGatewayConnectionPeerCIDROptions : Instantiate CheckVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewCheckVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { + return &CheckVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateLoadBalancerListenerPolicyOptions) SetAction(action string) *CreateLoadBalancerListenerPolicyOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetPriority : Allow user to set Priority -func (_options *CreateLoadBalancerListenerPolicyOptions) SetPriority(priority int64) *CreateLoadBalancerListenerPolicyOptions { - _options.Priority = core.Int64Ptr(priority) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerListenerPolicyOptions) SetName(name string) *CreateLoadBalancerListenerPolicyOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetID(id string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetRules : Allow user to set Rules -func (_options *CreateLoadBalancerListenerPolicyOptions) SetRules(rules []LoadBalancerListenerPolicyRulePrototype) *CreateLoadBalancerListenerPolicyOptions { - _options.Rules = rules +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerListenerPolicyOptions) SetTarget(target LoadBalancerListenerPolicyTargetPrototypeIntf) *CreateLoadBalancerListenerPolicyOptions { - _options.Target = target +// SetPrefixLength : Allow user to set PrefixLength +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyOptions { +func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionPeerCIDROptions { options.Headers = param return options } -// CreateLoadBalancerListenerPolicyRuleOptions : The CreateLoadBalancerListenerPolicyRule options. -type CreateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` +// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. +// Models which "extend" this model: +// - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName +// - CloudObjectStorageBucketIdentityByCRN +type CloudObjectStorageBucketIdentity struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The CRN of this Cloud Object Storage bucket. + CRN *string `json:"crn,omitempty"` } -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Condition property. -// The condition of the rule. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsConditionContainsConst = "contains" - CreateLoadBalancerListenerPolicyRuleOptionsConditionEqualsConst = "equals" - CreateLoadBalancerListenerPolicyRuleOptionsConditionMatchesRegexConst = "matches_regex" -) +func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { + return true +} -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsTypeBodyConst = "body" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHeaderConst = "header" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHostnameConst = "hostname" - CreateLoadBalancerListenerPolicyRuleOptionsTypePathConst = "path" - CreateLoadBalancerListenerPolicyRuleOptionsTypeQueryConst = "query" -) +type CloudObjectStorageBucketIdentityIntf interface { + isaCloudObjectStorageBucketIdentity() bool +} -// NewCreateLoadBalancerListenerPolicyRuleOptions : Instantiate CreateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, condition string, typeVar string, value string) *CreateLoadBalancerListenerPolicyRuleOptions { - return &CreateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), +// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct +type CloudObjectStorageBucketReference struct { + // The CRN of this Cloud Object Storage bucket. + CRN *string `json:"crn" validate:"required"` + + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` } -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPolicyID : Allow user to set PolicyID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options +// CloudObjectStorageObjectReference : CloudObjectStorageObjectReference struct +type CloudObjectStorageObjectReference struct { + // The name of this Cloud Object Storage object. Names are unique within a Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` } -// SetCondition : Allow user to set Condition -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetCondition(condition string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Condition = core.StringPtr(condition) - return _options +// UnmarshalCloudObjectStorageObjectReference unmarshals an instance of CloudObjectStorageObjectReference from the specified map of raw messages. +func UnmarshalCloudObjectStorageObjectReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageObjectReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetType : Allow user to set Type -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetType(typeVar string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Type = core.StringPtr(typeVar) - return _options +// CreateBackupPolicyOptions : The CreateBackupPolicy options. +type CreateBackupPolicyOptions struct { + // The backup policy prototype object. + BackupPolicyPrototype BackupPolicyPrototypeIntf `json:"BackupPolicyPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetValue : Allow user to set Value -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetValue(value string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Value = core.StringPtr(value) - return _options +// NewCreateBackupPolicyOptions : Instantiate CreateBackupPolicyOptions +func (*VpcV1) NewCreateBackupPolicyOptions(backupPolicyPrototype BackupPolicyPrototypeIntf) *CreateBackupPolicyOptions { + return &CreateBackupPolicyOptions{ + BackupPolicyPrototype: backupPolicyPrototype, + } } -// SetField : Allow user to set Field -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetField(field string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Field = core.StringPtr(field) +// SetBackupPolicyPrototype : Allow user to set BackupPolicyPrototype +func (_options *CreateBackupPolicyOptions) SetBackupPolicyPrototype(backupPolicyPrototype BackupPolicyPrototypeIntf) *CreateBackupPolicyOptions { + _options.BackupPolicyPrototype = backupPolicyPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyRuleOptions { +func (options *CreateBackupPolicyOptions) SetHeaders(param map[string]string) *CreateBackupPolicyOptions { options.Headers = param return options } -// CreateLoadBalancerOptions : The CreateLoadBalancer options. -type CreateLoadBalancerOptions struct { - // Indicates whether this load balancer is public. - // - // At present, if route mode is enabled, the load balancer must not be public. - IsPublic *bool `json:"is_public" validate:"required"` - - // The subnets to provision this load balancer in. The subnets must be in the same VPC. The load balancer's - // availability will depend on the availability of the zones that the subnets reside in. - // - // Load balancers in the `network` family allow only one subnet to be specified. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"` +// CreateBackupPolicyPlanOptions : The CreateBackupPolicyPlan options. +type CreateBackupPolicyPlanOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - // The DNS configuration for this load balancer. + // The cron specification for the backup schedule. The backup policy jobs + // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes + // after this time. // - // If unspecified, DNS `A` records for this load balancer's `hostname` property will be added - // to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be - // added to the specified `zone`. - Dns *LoadBalancerDnsPrototype `json:"dns,omitempty"` - - // The listeners of this load balancer. - Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"` + // All backup schedules for plans in the same policy must be at least an hour apart. + CronSpec *string `json:"cron_spec" validate:"required"` - // The logging configuration to use for this load balancer. See [VPC Datapath - // Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging - // format, fields and permitted values. - // - // To activate logging, the load balancer profile must support the specified logging type. - Logging *LoadBalancerLoggingPrototype `json:"logging,omitempty"` + // Indicates whether the plan is active. + Active *bool `json:"active,omitempty"` - // The name for this load balancer. The name must not be used by another load balancer in the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. + AttachUserTags []string `json:"attach_user_tags,omitempty"` - // The pools of this load balancer. - Pools []LoadBalancerPoolPrototype `json:"pools,omitempty"` + ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - // The profile to use for this load balancer. - // - // If unspecified, `application` will be used. - Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` + // Indicates whether to copy the source's user tags to the created backups (snapshots). + CopyUserTags *bool `json:"copy_user_tags,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode,omitempty"` + // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The security groups to use for this load balancer. If unspecified, the VPC's default security group is used. - // - // The load balancer profile must support security groups. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The policies for additional backups in remote regions. + RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateLoadBalancerOptions : Instantiate CreateLoadBalancerOptions -func (*VpcV1) NewCreateLoadBalancerOptions(isPublic bool, subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - return &CreateLoadBalancerOptions{ - IsPublic: core.BoolPtr(isPublic), - Subnets: subnets, +// NewCreateBackupPolicyPlanOptions : Instantiate CreateBackupPolicyPlanOptions +func (*VpcV1) NewCreateBackupPolicyPlanOptions(backupPolicyID string, cronSpec string) *CreateBackupPolicyPlanOptions { + return &CreateBackupPolicyPlanOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + CronSpec: core.StringPtr(cronSpec), } } -// SetIsPublic : Allow user to set IsPublic -func (_options *CreateLoadBalancerOptions) SetIsPublic(isPublic bool) *CreateLoadBalancerOptions { - _options.IsPublic = core.BoolPtr(isPublic) - return _options -} - -// SetSubnets : Allow user to set Subnets -func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - _options.Subnets = subnets - return _options -} - -// SetDatapath : Allow user to set Datapath -func (_options *CreateLoadBalancerOptions) SetDatapath(datapath *LoadBalancerLoggingDatapathPrototype) *CreateLoadBalancerOptions { - _options.Datapath = datapath - return _options -} - -// SetDns : Allow user to set Dns -func (_options *CreateLoadBalancerOptions) SetDns(dns *LoadBalancerDnsPrototype) *CreateLoadBalancerOptions { - _options.Dns = dns +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *CreateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *CreateBackupPolicyPlanOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) return _options } -// SetListeners : Allow user to set Listeners -func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions { - _options.Listeners = listeners +// SetCronSpec : Allow user to set CronSpec +func (_options *CreateBackupPolicyPlanOptions) SetCronSpec(cronSpec string) *CreateBackupPolicyPlanOptions { + _options.CronSpec = core.StringPtr(cronSpec) return _options } -// SetLogging : Allow user to set Logging -func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLoggingPrototype) *CreateLoadBalancerOptions { - _options.Logging = logging +// SetActive : Allow user to set Active +func (_options *CreateBackupPolicyPlanOptions) SetActive(active bool) *CreateBackupPolicyPlanOptions { + _options.Active = core.BoolPtr(active) return _options } -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerOptions) SetName(name string) *CreateLoadBalancerOptions { - _options.Name = core.StringPtr(name) +// SetAttachUserTags : Allow user to set AttachUserTags +func (_options *CreateBackupPolicyPlanOptions) SetAttachUserTags(attachUserTags []string) *CreateBackupPolicyPlanOptions { + _options.AttachUserTags = attachUserTags return _options } -// SetPools : Allow user to set Pools -func (_options *CreateLoadBalancerOptions) SetPools(pools []LoadBalancerPoolPrototype) *CreateLoadBalancerOptions { - _options.Pools = pools +// SetClonePolicy : Allow user to set ClonePolicy +func (_options *CreateBackupPolicyPlanOptions) SetClonePolicy(clonePolicy *BackupPolicyPlanClonePolicyPrototype) *CreateBackupPolicyPlanOptions { + _options.ClonePolicy = clonePolicy return _options } -// SetProfile : Allow user to set Profile -func (_options *CreateLoadBalancerOptions) SetProfile(profile LoadBalancerProfileIdentityIntf) *CreateLoadBalancerOptions { - _options.Profile = profile +// SetCopyUserTags : Allow user to set CopyUserTags +func (_options *CreateBackupPolicyPlanOptions) SetCopyUserTags(copyUserTags bool) *CreateBackupPolicyPlanOptions { + _options.CopyUserTags = core.BoolPtr(copyUserTags) return _options } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateLoadBalancerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.ResourceGroup = resourceGroup +// SetDeletionTrigger : Allow user to set DeletionTrigger +func (_options *CreateBackupPolicyPlanOptions) SetDeletionTrigger(deletionTrigger *BackupPolicyPlanDeletionTriggerPrototype) *CreateBackupPolicyPlanOptions { + _options.DeletionTrigger = deletionTrigger return _options } -// SetRouteMode : Allow user to set RouteMode -func (_options *CreateLoadBalancerOptions) SetRouteMode(routeMode bool) *CreateLoadBalancerOptions { - _options.RouteMode = core.BoolPtr(routeMode) +// SetName : Allow user to set Name +func (_options *CreateBackupPolicyPlanOptions) SetName(name string) *CreateBackupPolicyPlanOptions { + _options.Name = core.StringPtr(name) return _options } -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateLoadBalancerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.SecurityGroups = securityGroups +// SetRemoteRegionPolicies : Allow user to set RemoteRegionPolicies +func (_options *CreateBackupPolicyPlanOptions) SetRemoteRegionPolicies(remoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype) *CreateBackupPolicyPlanOptions { + _options.RemoteRegionPolicies = remoteRegionPolicies return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerOptions { +func (options *CreateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *CreateBackupPolicyPlanOptions { options.Headers = param return options } -// CreateLoadBalancerPoolMemberOptions : The CreateLoadBalancerPoolMember options. -type CreateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` +// CreateBareMetalServerConsoleAccessTokenOptions : The CreateBareMetalServerConsoleAccessToken options. +type CreateBareMetalServerConsoleAccessTokenOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. + // The bare metal server console type for which this token may be used // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` + // Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. + ConsoleType *string `json:"console_type" validate:"required"` - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateLoadBalancerPoolMemberOptions : Instantiate CreateLoadBalancerPoolMemberOptions -func (*VpcV1) NewCreateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - return &CreateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Port: core.Int64Ptr(port), - Target: target, +// Constants associated with the CreateBareMetalServerConsoleAccessTokenOptions.ConsoleType property. +// The bare metal server console type for which this token may be used +// +// Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. +const ( + CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" + CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" +) + +// NewCreateBareMetalServerConsoleAccessTokenOptions : Instantiate CreateBareMetalServerConsoleAccessTokenOptions +func (*VpcV1) NewCreateBareMetalServerConsoleAccessTokenOptions(bareMetalServerID string, consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { + return &CreateBareMetalServerConsoleAccessTokenOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ConsoleType: core.StringPtr(consoleType), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetPoolID : Allow user to set PoolID -func (_options *CreateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *CreateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) +// SetConsoleType : Allow user to set ConsoleType +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.ConsoleType = core.StringPtr(consoleType) return _options } -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerPoolMemberOptions) SetPort(port int64) *CreateLoadBalancerPoolMemberOptions { - _options.Port = core.Int64Ptr(port) +// SetForce : Allow user to set Force +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetForce(force bool) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.Force = core.BoolPtr(force) return _options } -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerPoolMemberOptions) SetTarget(target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - _options.Target = target +// SetHeaders : Allow user to set Headers +func (options *CreateBareMetalServerConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateBareMetalServerConsoleAccessTokenOptions { + options.Headers = param + return options +} + +// CreateBareMetalServerNetworkAttachmentOptions : The CreateBareMetalServerNetworkAttachment options. +type CreateBareMetalServerNetworkAttachmentOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network attachment prototype object. + BareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf `json:"BareMetalServerNetworkAttachmentPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateBareMetalServerNetworkAttachmentOptions : Instantiate CreateBareMetalServerNetworkAttachmentOptions +func (*VpcV1) NewCreateBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, bareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf) *CreateBareMetalServerNetworkAttachmentOptions { + return &CreateBareMetalServerNetworkAttachmentOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + BareMetalServerNetworkAttachmentPrototype: bareMetalServerNetworkAttachmentPrototype, + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *CreateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetWeight : Allow user to set Weight -func (_options *CreateLoadBalancerPoolMemberOptions) SetWeight(weight int64) *CreateLoadBalancerPoolMemberOptions { - _options.Weight = core.Int64Ptr(weight) +// SetBareMetalServerNetworkAttachmentPrototype : Allow user to set BareMetalServerNetworkAttachmentPrototype +func (_options *CreateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf) *CreateBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolMemberOptions { +func (options *CreateBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkAttachmentOptions { options.Headers = param return options } -// CreateLoadBalancerPoolOptions : The CreateLoadBalancerPool options. -type CreateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` - - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - // `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http`, and `https`. - Protocol *string `json:"protocol" validate:"required"` - - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` - - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` +// CreateBareMetalServerNetworkInterfaceOptions : The CreateBareMetalServerNetworkInterface options. +type CreateBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` + // The bare metal server network interface prototype object. + BareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf `json:"BareMetalServerNetworkInterfacePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateLoadBalancerPoolOptions.Algorithm property. -// The load balancing algorithm. -const ( - CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst = "least_connections" - CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst = "round_robin" - CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the CreateLoadBalancerPoolOptions.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if -// `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http`, and `https`. -const ( - CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" - CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerPoolOptionsProtocolTCPConst = "tcp" - CreateLoadBalancerPoolOptionsProtocolUDPConst = "udp" -) - -// Constants associated with the CreateLoadBalancerPoolOptions.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - CreateLoadBalancerPoolOptionsProxyProtocolDisabledConst = "disabled" - CreateLoadBalancerPoolOptionsProxyProtocolV1Const = "v1" - CreateLoadBalancerPoolOptionsProxyProtocolV2Const = "v2" -) - -// NewCreateLoadBalancerPoolOptions : Instantiate CreateLoadBalancerPoolOptions -func (*VpcV1) NewCreateLoadBalancerPoolOptions(loadBalancerID string, algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) *CreateLoadBalancerPoolOptions { - return &CreateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), +// NewCreateBareMetalServerNetworkInterfaceOptions : Instantiate CreateBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewCreateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { + return &CreateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + BareMetalServerNetworkInterfacePrototype: bareMetalServerNetworkInterfacePrototype, } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetAlgorithm : Allow user to set Algorithm -func (_options *CreateLoadBalancerPoolOptions) SetAlgorithm(algorithm string) *CreateLoadBalancerPoolOptions { - _options.Algorithm = core.StringPtr(algorithm) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetHealthMonitor : Allow user to set HealthMonitor -func (_options *CreateLoadBalancerPoolOptions) SetHealthMonitor(healthMonitor *LoadBalancerPoolHealthMonitorPrototype) *CreateLoadBalancerPoolOptions { - _options.HealthMonitor = healthMonitor +// SetBareMetalServerNetworkInterfacePrototype : Allow user to set BareMetalServerNetworkInterfacePrototype +func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototype return _options } -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerPoolOptions) SetProtocol(protocol string) *CreateLoadBalancerPoolOptions { - _options.Protocol = core.StringPtr(protocol) - return _options +// SetHeaders : Allow user to set Headers +func (options *CreateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkInterfaceOptions { + options.Headers = param + return options } -// SetMembers : Allow user to set Members -func (_options *CreateLoadBalancerPoolOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *CreateLoadBalancerPoolOptions { - _options.Members = members - return _options -} +// CreateBareMetalServerOptions : The CreateBareMetalServer options. +type CreateBareMetalServerOptions struct { + // The bare metal server prototype object. + BareMetalServerPrototype BareMetalServerPrototypeIntf `json:"BareMetalServerPrototype" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerPoolOptions) SetName(name string) *CreateLoadBalancerPoolOptions { - _options.Name = core.StringPtr(name) - return _options + // Allows users to set headers on API requests + Headers map[string]string } -// SetProxyProtocol : Allow user to set ProxyProtocol -func (_options *CreateLoadBalancerPoolOptions) SetProxyProtocol(proxyProtocol string) *CreateLoadBalancerPoolOptions { - _options.ProxyProtocol = core.StringPtr(proxyProtocol) - return _options +// NewCreateBareMetalServerOptions : Instantiate CreateBareMetalServerOptions +func (*VpcV1) NewCreateBareMetalServerOptions(bareMetalServerPrototype BareMetalServerPrototypeIntf) *CreateBareMetalServerOptions { + return &CreateBareMetalServerOptions{ + BareMetalServerPrototype: bareMetalServerPrototype, + } } -// SetSessionPersistence : Allow user to set SessionPersistence -func (_options *CreateLoadBalancerPoolOptions) SetSessionPersistence(sessionPersistence *LoadBalancerPoolSessionPersistencePrototype) *CreateLoadBalancerPoolOptions { - _options.SessionPersistence = sessionPersistence +// SetBareMetalServerPrototype : Allow user to set BareMetalServerPrototype +func (_options *CreateBareMetalServerOptions) SetBareMetalServerPrototype(bareMetalServerPrototype BareMetalServerPrototypeIntf) *CreateBareMetalServerOptions { + _options.BareMetalServerPrototype = bareMetalServerPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolOptions { +func (options *CreateBareMetalServerOptions) SetHeaders(param map[string]string) *CreateBareMetalServerOptions { options.Headers = param return options } -// CreateNetworkACLOptions : The CreateNetworkACL options. -type CreateNetworkACLOptions struct { - // The network ACL prototype object. - NetworkACLPrototype NetworkACLPrototypeIntf `json:"NetworkACLPrototype" validate:"required"` +// CreateDedicatedHostGroupOptions : The CreateDedicatedHostGroup options. +type CreateDedicatedHostGroupOptions struct { + // The dedicated host profile class for hosts in this group. + Class *string `json:"class" validate:"required"` + + // The dedicated host profile family for hosts in this group. + Family *string `json:"family" validate:"required"` + + // The zone this dedicated host group will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateNetworkACLOptions : Instantiate CreateNetworkACLOptions -func (*VpcV1) NewCreateNetworkACLOptions(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { - return &CreateNetworkACLOptions{ - NetworkACLPrototype: networkACLPrototype, +// Constants associated with the CreateDedicatedHostGroupOptions.Family property. +// The dedicated host profile family for hosts in this group. +const ( + CreateDedicatedHostGroupOptionsFamilyBalancedConst = "balanced" + CreateDedicatedHostGroupOptionsFamilyComputeConst = "compute" + CreateDedicatedHostGroupOptionsFamilyMemoryConst = "memory" +) + +// NewCreateDedicatedHostGroupOptions : Instantiate CreateDedicatedHostGroupOptions +func (*VpcV1) NewCreateDedicatedHostGroupOptions(class string, family string, zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { + return &CreateDedicatedHostGroupOptions{ + Class: core.StringPtr(class), + Family: core.StringPtr(family), + Zone: zone, } } -// SetNetworkACLPrototype : Allow user to set NetworkACLPrototype -func (_options *CreateNetworkACLOptions) SetNetworkACLPrototype(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { - _options.NetworkACLPrototype = networkACLPrototype +// SetClass : Allow user to set Class +func (_options *CreateDedicatedHostGroupOptions) SetClass(class string) *CreateDedicatedHostGroupOptions { + _options.Class = core.StringPtr(class) + return _options +} + +// SetFamily : Allow user to set Family +func (_options *CreateDedicatedHostGroupOptions) SetFamily(family string) *CreateDedicatedHostGroupOptions { + _options.Family = core.StringPtr(family) + return _options +} + +// SetZone : Allow user to set Zone +func (_options *CreateDedicatedHostGroupOptions) SetZone(zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { + _options.Zone = zone + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateDedicatedHostGroupOptions) SetName(name string) *CreateDedicatedHostGroupOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateDedicatedHostGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateDedicatedHostGroupOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLOptions) SetHeaders(param map[string]string) *CreateNetworkACLOptions { +func (options *CreateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *CreateDedicatedHostGroupOptions { options.Headers = param return options } -// CreateNetworkACLRuleOptions : The CreateNetworkACLRule options. -type CreateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The network ACL rule prototype object. - NetworkACLRulePrototype NetworkACLRulePrototypeIntf `json:"NetworkACLRulePrototype" validate:"required"` +// CreateDedicatedHostOptions : The CreateDedicatedHost options. +type CreateDedicatedHostOptions struct { + // The dedicated host prototype object. + DedicatedHostPrototype DedicatedHostPrototypeIntf `json:"DedicatedHostPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateNetworkACLRuleOptions : Instantiate CreateNetworkACLRuleOptions -func (*VpcV1) NewCreateNetworkACLRuleOptions(networkACLID string, networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - return &CreateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - NetworkACLRulePrototype: networkACLRulePrototype, +// NewCreateDedicatedHostOptions : Instantiate CreateDedicatedHostOptions +func (*VpcV1) NewCreateDedicatedHostOptions(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { + return &CreateDedicatedHostOptions{ + DedicatedHostPrototype: dedicatedHostPrototype, } } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *CreateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetNetworkACLRulePrototype : Allow user to set NetworkACLRulePrototype -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLRulePrototype(networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - _options.NetworkACLRulePrototype = networkACLRulePrototype +// SetDedicatedHostPrototype : Allow user to set DedicatedHostPrototype +func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { + _options.DedicatedHostPrototype = dedicatedHostPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLRuleOptions) SetHeaders(param map[string]string) *CreateNetworkACLRuleOptions { +func (options *CreateDedicatedHostOptions) SetHeaders(param map[string]string) *CreateDedicatedHostOptions { options.Headers = param return options } -// CreatePlacementGroupOptions : The CreatePlacementGroup options. -type CreatePlacementGroupOptions struct { - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources +// CreateEndpointGatewayOptions : The CreateEndpointGateway options. +type CreateEndpointGatewayOptions struct { + // The target to use for this endpoint gateway. Must not already be the target of another + // endpoint gateway in the VPC. + Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` + + // The VPC this endpoint gateway will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in + // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` + // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to + // `true`. + AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` - // The name for this placement group. The name must not be used by another placement group in the region. If + // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. + Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` + + // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -31615,66 +32548,121 @@ type CreatePlacementGroupOptions struct { // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreatePlacementGroupOptions.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. -const ( - CreatePlacementGroupOptionsStrategyHostSpreadConst = "host_spread" - CreatePlacementGroupOptionsStrategyPowerSpreadConst = "power_spread" -) - -// NewCreatePlacementGroupOptions : Instantiate CreatePlacementGroupOptions -func (*VpcV1) NewCreatePlacementGroupOptions(strategy string) *CreatePlacementGroupOptions { - return &CreatePlacementGroupOptions{ - Strategy: core.StringPtr(strategy), +// NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions +func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { + return &CreateEndpointGatewayOptions{ + Target: target, + VPC: vpc, } } -// SetStrategy : Allow user to set Strategy -func (_options *CreatePlacementGroupOptions) SetStrategy(strategy string) *CreatePlacementGroupOptions { - _options.Strategy = core.StringPtr(strategy) +// SetTarget : Allow user to set Target +func (_options *CreateEndpointGatewayOptions) SetTarget(target EndpointGatewayTargetPrototypeIntf) *CreateEndpointGatewayOptions { + _options.Target = target + return _options +} + +// SetVPC : Allow user to set VPC +func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { + _options.VPC = vpc + return _options +} + +// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding +func (_options *CreateEndpointGatewayOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *CreateEndpointGatewayOptions { + _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) + return _options +} + +// SetIps : Allow user to set Ips +func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { + _options.Ips = ips return _options } // SetName : Allow user to set Name -func (_options *CreatePlacementGroupOptions) SetName(name string) *CreatePlacementGroupOptions { +func (_options *CreateEndpointGatewayOptions) SetName(name string) *CreateEndpointGatewayOptions { _options.Name = core.StringPtr(name) return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePlacementGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePlacementGroupOptions { +func (_options *CreateEndpointGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateEndpointGatewayOptions { _options.ResourceGroup = resourceGroup return _options } +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateEndpointGatewayOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateEndpointGatewayOptions { + _options.SecurityGroups = securityGroups + return _options +} + // SetHeaders : Allow user to set Headers -func (options *CreatePlacementGroupOptions) SetHeaders(param map[string]string) *CreatePlacementGroupOptions { +func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayOptions { options.Headers = param return options } -// CreatePublicGatewayOptions : The CreatePublicGateway options. -type CreatePublicGatewayOptions struct { - // The VPC this public gateway will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` +// CreateFloatingIPOptions : The CreateFloatingIP options. +type CreateFloatingIPOptions struct { + // The floating IP prototype object. + FloatingIPPrototype FloatingIPPrototypeIntf `json:"FloatingIPPrototype" validate:"required"` - // The zone this public gateway will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - FloatingIP PublicGatewayFloatingIPPrototypeIntf `json:"floating_ip,omitempty"` +// NewCreateFloatingIPOptions : Instantiate CreateFloatingIPOptions +func (*VpcV1) NewCreateFloatingIPOptions(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { + return &CreateFloatingIPOptions{ + FloatingIPPrototype: floatingIPPrototype, + } +} - // The name for this public gateway. The name must not be used by another public gateway in the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. +// SetFloatingIPPrototype : Allow user to set FloatingIPPrototype +func (_options *CreateFloatingIPOptions) SetFloatingIPPrototype(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { + _options.FloatingIPPrototype = floatingIPPrototype + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateFloatingIPOptions) SetHeaders(param map[string]string) *CreateFloatingIPOptions { + options.Headers = param + return options +} + +// CreateFlowLogCollectorOptions : The CreateFlowLogCollector options. +type CreateFlowLogCollectorOptions struct { + // The Cloud Object Storage bucket where the collected flows will be logged. + // The bucket must exist and an IAM service authorization must grant + // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer + // access to the bucket. For more information, see [Creating a flow log + // collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). + StorageBucket LegacyCloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` + + // The target this collector will collect flow logs for. + // + // If the target is an instance, subnet, or VPC, flow logs will not be collected for any + // instance network attachments, virtual network interfaces or instance network interfaces + // within the target that are themselves the target of a more specific flow log collector. + // + // The target must not be a virtual network interface that is attached to a bare metal server + // network attachment or to a file share mount target. + Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` + + // Indicates whether this collector will be active upon creation. + Active *bool `json:"active,omitempty"` + + // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -31685,70 +32673,68 @@ type CreatePublicGatewayOptions struct { Headers map[string]string } -// NewCreatePublicGatewayOptions : Instantiate CreatePublicGatewayOptions -func (*VpcV1) NewCreatePublicGatewayOptions(vpc VPCIdentityIntf, zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - return &CreatePublicGatewayOptions{ - VPC: vpc, - Zone: zone, +// NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions +func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket LegacyCloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { + return &CreateFlowLogCollectorOptions{ + StorageBucket: storageBucket, + Target: target, } } -// SetVPC : Allow user to set VPC -func (_options *CreatePublicGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreatePublicGatewayOptions { - _options.VPC = vpc +// SetStorageBucket : Allow user to set StorageBucket +func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket LegacyCloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { + _options.StorageBucket = storageBucket return _options } -// SetZone : Allow user to set Zone -func (_options *CreatePublicGatewayOptions) SetZone(zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - _options.Zone = zone +// SetTarget : Allow user to set Target +func (_options *CreateFlowLogCollectorOptions) SetTarget(target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { + _options.Target = target return _options } -// SetFloatingIP : Allow user to set FloatingIP -func (_options *CreatePublicGatewayOptions) SetFloatingIP(floatingIP PublicGatewayFloatingIPPrototypeIntf) *CreatePublicGatewayOptions { - _options.FloatingIP = floatingIP +// SetActive : Allow user to set Active +func (_options *CreateFlowLogCollectorOptions) SetActive(active bool) *CreateFlowLogCollectorOptions { + _options.Active = core.BoolPtr(active) return _options } // SetName : Allow user to set Name -func (_options *CreatePublicGatewayOptions) SetName(name string) *CreatePublicGatewayOptions { +func (_options *CreateFlowLogCollectorOptions) SetName(name string) *CreateFlowLogCollectorOptions { _options.Name = core.StringPtr(name) return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePublicGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePublicGatewayOptions { +func (_options *CreateFlowLogCollectorOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateFlowLogCollectorOptions { _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) *CreatePublicGatewayOptions { +func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string) *CreateFlowLogCollectorOptions { options.Headers = param return options } -// CreateReservationOptions : The CreateReservation options. -type CreateReservationOptions struct { - // The capacity reservation configuration to use. - Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` +// CreateIkePolicyOptions : The CreateIkePolicy options. +type CreateIkePolicyOptions struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - // The committed use configuration to use for this reservation. - CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` + // The Diffie-Hellman group. + DhGroup *int64 `json:"dh_group" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // reservation. - Profile *ReservationProfilePrototype `json:"profile" validate:"required"` + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - // The zone to use for this reservation. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version" validate:"required"` - // The affinity policy to use for this reservation: - // - `restricted`: The reservation must be manually requested. - AffinityPolicy *string `json:"affinity_policy,omitempty"` + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the + // The name for this IKE policy. The name must not be used by another IKE policies in the region. If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -31760,770 +32746,807 @@ type CreateReservationOptions struct { Headers map[string]string } -// Constants associated with the CreateReservationOptions.AffinityPolicy property. -// The affinity policy to use for this reservation: -// - `restricted`: The reservation must be manually requested. +// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" + CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" + CreateIkePolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" + CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" ) -// NewCreateReservationOptions : Instantiate CreateReservationOptions -func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { - return &CreateReservationOptions{ - Capacity: capacity, - CommittedUse: committedUse, - Profile: profile, - Zone: zone, +// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" + CreateIkePolicyOptionsEncryptionAlgorithmAes192Const = "aes192" + CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" +) + +// NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions +func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { + return &CreateIkePolicyOptions{ + AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), + DhGroup: core.Int64Ptr(dhGroup), + EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), + IkeVersion: core.Int64Ptr(ikeVersion), } } -// SetCapacity : Allow user to set Capacity -func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { - _options.Capacity = capacity +// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { + _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) return _options } -// SetCommittedUse : Allow user to set CommittedUse -func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { - _options.CommittedUse = committedUse +// SetDhGroup : Allow user to set DhGroup +func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { + _options.DhGroup = core.Int64Ptr(dhGroup) return _options } -// SetProfile : Allow user to set Profile -func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { - _options.Profile = profile +// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIkePolicyOptions { + _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) return _options } -// SetZone : Allow user to set Zone -func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { - _options.Zone = zone +// SetIkeVersion : Allow user to set IkeVersion +func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { + _options.IkeVersion = core.Int64Ptr(ikeVersion) return _options } -// SetAffinityPolicy : Allow user to set AffinityPolicy -func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { - _options.AffinityPolicy = core.StringPtr(affinityPolicy) +// SetKeyLifetime : Allow user to set KeyLifetime +func (_options *CreateIkePolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIkePolicyOptions { + _options.KeyLifetime = core.Int64Ptr(keyLifetime) return _options } // SetName : Allow user to set Name -func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { +func (_options *CreateIkePolicyOptions) SetName(name string) *CreateIkePolicyOptions { _options.Name = core.StringPtr(name) return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { +func (_options *CreateIkePolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIkePolicyOptions { _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { +func (options *CreateIkePolicyOptions) SetHeaders(param map[string]string) *CreateIkePolicyOptions { options.Headers = param return options } -// CreateSecurityGroupOptions : The CreateSecurityGroup options. -type CreateSecurityGroupOptions struct { - // The VPC this security group will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` +// CreateImageExportJobOptions : The CreateImageExportJob options. +type CreateImageExportJobOptions struct { + // The image identifier. + ImageID *string `json:"image_id" validate:"required,ne="` - // The name for this security group. The name must not be used by another security group for the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The Cloud Object Storage bucket to export the image to. The bucket must exist and an IAM + // service authorization must grant `Image Service for VPC` of + // `VPC Infrastructure Services` writer access to the bucket. + StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. + Format *string `json:"format,omitempty"` - // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []SecurityGroupRulePrototypeIntf `json:"rules,omitempty"` + // The name for this image export job. The name must not be used by another export job for the image. If unspecified, + // the name will be a hyphenated list of randomly-selected words prefixed with the first 16 characters of the parent + // image name. + // + // The exported image object name in Cloud Object Storage (`storage_object.name` in the response) will be based on this + // name. The object name will be unique within the bucket. + Name *string `json:"name,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSecurityGroupOptions : Instantiate CreateSecurityGroupOptions -func (*VpcV1) NewCreateSecurityGroupOptions(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - return &CreateSecurityGroupOptions{ - VPC: vpc, +// Constants associated with the CreateImageExportJobOptions.Format property. +// The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. +const ( + CreateImageExportJobOptionsFormatQcow2Const = "qcow2" + CreateImageExportJobOptionsFormatVhdConst = "vhd" +) + +// NewCreateImageExportJobOptions : Instantiate CreateImageExportJobOptions +func (*VpcV1) NewCreateImageExportJobOptions(imageID string, storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { + return &CreateImageExportJobOptions{ + ImageID: core.StringPtr(imageID), + StorageBucket: storageBucket, } } -// SetVPC : Allow user to set VPC -func (_options *CreateSecurityGroupOptions) SetVPC(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - _options.VPC = vpc +// SetImageID : Allow user to set ImageID +func (_options *CreateImageExportJobOptions) SetImageID(imageID string) *CreateImageExportJobOptions { + _options.ImageID = core.StringPtr(imageID) return _options } -// SetName : Allow user to set Name -func (_options *CreateSecurityGroupOptions) SetName(name string) *CreateSecurityGroupOptions { - _options.Name = core.StringPtr(name) +// SetStorageBucket : Allow user to set StorageBucket +func (_options *CreateImageExportJobOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { + _options.StorageBucket = storageBucket return _options } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateSecurityGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSecurityGroupOptions { - _options.ResourceGroup = resourceGroup +// SetFormat : Allow user to set Format +func (_options *CreateImageExportJobOptions) SetFormat(format string) *CreateImageExportJobOptions { + _options.Format = core.StringPtr(format) return _options } -// SetRules : Allow user to set Rules -func (_options *CreateSecurityGroupOptions) SetRules(rules []SecurityGroupRulePrototypeIntf) *CreateSecurityGroupOptions { - _options.Rules = rules +// SetName : Allow user to set Name +func (_options *CreateImageExportJobOptions) SetName(name string) *CreateImageExportJobOptions { + _options.Name = core.StringPtr(name) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupOptions) SetHeaders(param map[string]string) *CreateSecurityGroupOptions { +func (options *CreateImageExportJobOptions) SetHeaders(param map[string]string) *CreateImageExportJobOptions { options.Headers = param return options } -// CreateSecurityGroupRuleOptions : The CreateSecurityGroupRule options. -type CreateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The properties of the security group rule to be created. - SecurityGroupRulePrototype SecurityGroupRulePrototypeIntf `json:"SecurityGroupRulePrototype" validate:"required"` +// CreateImageOptions : The CreateImage options. +type CreateImageOptions struct { + // The image prototype object. + ImagePrototype ImagePrototypeIntf `json:"ImagePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSecurityGroupRuleOptions : Instantiate CreateSecurityGroupRuleOptions -func (*VpcV1) NewCreateSecurityGroupRuleOptions(securityGroupID string, securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - return &CreateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - SecurityGroupRulePrototype: securityGroupRulePrototype, +// NewCreateImageOptions : Instantiate CreateImageOptions +func (*VpcV1) NewCreateImageOptions(imagePrototype ImagePrototypeIntf) *CreateImageOptions { + return &CreateImageOptions{ + ImagePrototype: imagePrototype, } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetSecurityGroupRulePrototype : Allow user to set SecurityGroupRulePrototype -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupRulePrototype(securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupRulePrototype = securityGroupRulePrototype +// SetImagePrototype : Allow user to set ImagePrototype +func (_options *CreateImageOptions) SetImagePrototype(imagePrototype ImagePrototypeIntf) *CreateImageOptions { + _options.ImagePrototype = imagePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *CreateSecurityGroupRuleOptions { +func (options *CreateImageOptions) SetHeaders(param map[string]string) *CreateImageOptions { options.Headers = param return options } -// CreateSecurityGroupTargetBindingOptions : The CreateSecurityGroupTargetBinding options. -type CreateSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` +// CreateInstanceActionOptions : The CreateInstanceAction options. +type CreateInstanceActionOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` + // The type of action. + Type *string `json:"type" validate:"required"` + + // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. + Force *bool `json:"force,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSecurityGroupTargetBindingOptions : Instantiate CreateSecurityGroupTargetBindingOptions -func (*VpcV1) NewCreateSecurityGroupTargetBindingOptions(securityGroupID string, id string) *CreateSecurityGroupTargetBindingOptions { - return &CreateSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// Constants associated with the CreateInstanceActionOptions.Type property. +// The type of action. +const ( + CreateInstanceActionOptionsTypeRebootConst = "reboot" + CreateInstanceActionOptionsTypeStartConst = "start" + CreateInstanceActionOptionsTypeStopConst = "stop" +) + +// NewCreateInstanceActionOptions : Instantiate CreateInstanceActionOptions +func (*VpcV1) NewCreateInstanceActionOptions(instanceID string, typeVar string) *CreateInstanceActionOptions { + return &CreateInstanceActionOptions{ + InstanceID: core.StringPtr(instanceID), + Type: core.StringPtr(typeVar), } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceActionOptions) SetInstanceID(instanceID string) *CreateInstanceActionOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetID : Allow user to set ID -func (_options *CreateSecurityGroupTargetBindingOptions) SetID(id string) *CreateSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) +// SetType : Allow user to set Type +func (_options *CreateInstanceActionOptions) SetType(typeVar string) *CreateInstanceActionOptions { + _options.Type = core.StringPtr(typeVar) + return _options +} + +// SetForce : Allow user to set Force +func (_options *CreateInstanceActionOptions) SetForce(force bool) *CreateInstanceActionOptions { + _options.Force = core.BoolPtr(force) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *CreateSecurityGroupTargetBindingOptions { +func (options *CreateInstanceActionOptions) SetHeaders(param map[string]string) *CreateInstanceActionOptions { options.Headers = param return options } -// CreateShareMountTargetOptions : The CreateShareMountTarget options. -type CreateShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` +// CreateInstanceConsoleAccessTokenOptions : The CreateInstanceConsoleAccessToken options. +type CreateInstanceConsoleAccessTokenOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The share mount target prototype object. - ShareMountTargetPrototype ShareMountTargetPrototypeIntf `json:"ShareMountTargetPrototype" validate:"required"` + // The instance console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` + + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateShareMountTargetOptions : Instantiate CreateShareMountTargetOptions -func (*VpcV1) NewCreateShareMountTargetOptions(shareID string, shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { - return &CreateShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ShareMountTargetPrototype: shareMountTargetPrototype, +// Constants associated with the CreateInstanceConsoleAccessTokenOptions.ConsoleType property. +// The instance console type for which this token may be used. +const ( + CreateInstanceConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" + CreateInstanceConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" +) + +// NewCreateInstanceConsoleAccessTokenOptions : Instantiate CreateInstanceConsoleAccessTokenOptions +func (*VpcV1) NewCreateInstanceConsoleAccessTokenOptions(instanceID string, consoleType string) *CreateInstanceConsoleAccessTokenOptions { + return &CreateInstanceConsoleAccessTokenOptions{ + InstanceID: core.StringPtr(instanceID), + ConsoleType: core.StringPtr(consoleType), } } -// SetShareID : Allow user to set ShareID -func (_options *CreateShareMountTargetOptions) SetShareID(shareID string) *CreateShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceConsoleAccessTokenOptions) SetInstanceID(instanceID string) *CreateInstanceConsoleAccessTokenOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetShareMountTargetPrototype : Allow user to set ShareMountTargetPrototype -func (_options *CreateShareMountTargetOptions) SetShareMountTargetPrototype(shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { - _options.ShareMountTargetPrototype = shareMountTargetPrototype +// SetConsoleType : Allow user to set ConsoleType +func (_options *CreateInstanceConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateInstanceConsoleAccessTokenOptions { + _options.ConsoleType = core.StringPtr(consoleType) + return _options +} + +// SetForce : Allow user to set Force +func (_options *CreateInstanceConsoleAccessTokenOptions) SetForce(force bool) *CreateInstanceConsoleAccessTokenOptions { + _options.Force = core.BoolPtr(force) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateShareMountTargetOptions) SetHeaders(param map[string]string) *CreateShareMountTargetOptions { +func (options *CreateInstanceConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateInstanceConsoleAccessTokenOptions { options.Headers = param return options } -// CreateShareOptions : The CreateShare options. -type CreateShareOptions struct { - // The file share prototype object. - SharePrototype SharePrototypeIntf `json:"SharePrototype" validate:"required"` +// CreateInstanceGroupManagerActionOptions : The CreateInstanceGroupManagerAction options. +type CreateInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager action prototype object. + InstanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf `json:"InstanceGroupManagerActionPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateShareOptions : Instantiate CreateShareOptions -func (*VpcV1) NewCreateShareOptions(sharePrototype SharePrototypeIntf) *CreateShareOptions { - return &CreateShareOptions{ - SharePrototype: sharePrototype, +// NewCreateInstanceGroupManagerActionOptions : Instantiate CreateInstanceGroupManagerActionOptions +func (*VpcV1) NewCreateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { + return &CreateInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + InstanceGroupManagerActionPrototype: instanceGroupManagerActionPrototype, } } -// SetSharePrototype : Allow user to set SharePrototype -func (_options *CreateShareOptions) SetSharePrototype(sharePrototype SharePrototypeIntf) *CreateShareOptions { - _options.SharePrototype = sharePrototype +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetInstanceGroupManagerActionPrototype : Allow user to set InstanceGroupManagerActionPrototype +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateShareOptions) SetHeaders(param map[string]string) *CreateShareOptions { +func (options *CreateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerActionOptions { options.Headers = param return options } -// CreateSnapshotCloneOptions : The CreateSnapshotClone options. -type CreateSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceGroupManagerOptions : The CreateInstanceGroupManager options. +type CreateInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` + // The instance group manager prototype object. + InstanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf `json:"InstanceGroupManagerPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSnapshotCloneOptions : Instantiate CreateSnapshotCloneOptions -func (*VpcV1) NewCreateSnapshotCloneOptions(id string, zoneName string) *CreateSnapshotCloneOptions { - return &CreateSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), +// NewCreateInstanceGroupManagerOptions : Instantiate CreateInstanceGroupManagerOptions +func (*VpcV1) NewCreateInstanceGroupManagerOptions(instanceGroupID string, instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { + return &CreateInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerPrototype: instanceGroupManagerPrototype, } } -// SetID : Allow user to set ID -func (_options *CreateSnapshotCloneOptions) SetID(id string) *CreateSnapshotCloneOptions { - _options.ID = core.StringPtr(id) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } -// SetZoneName : Allow user to set ZoneName -func (_options *CreateSnapshotCloneOptions) SetZoneName(zoneName string) *CreateSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) +// SetInstanceGroupManagerPrototype : Allow user to set InstanceGroupManagerPrototype +func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupManagerPrototype(instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { + _options.InstanceGroupManagerPrototype = instanceGroupManagerPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSnapshotCloneOptions) SetHeaders(param map[string]string) *CreateSnapshotCloneOptions { +func (options *CreateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerOptions { options.Headers = param return options } -// CreateSnapshotOptions : The CreateSnapshot options. -type CreateSnapshotOptions struct { - // The snapshot prototype object. - SnapshotPrototype SnapshotPrototypeIntf `json:"SnapshotPrototype" validate:"required"` +// CreateInstanceGroupManagerPolicyOptions : The CreateInstanceGroupManagerPolicy options. +type CreateInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager policy prototype object. + InstanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf `json:"InstanceGroupManagerPolicyPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSnapshotOptions : Instantiate CreateSnapshotOptions -func (*VpcV1) NewCreateSnapshotOptions(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { - return &CreateSnapshotOptions{ - SnapshotPrototype: snapshotPrototype, +// NewCreateInstanceGroupManagerPolicyOptions : Instantiate CreateInstanceGroupManagerPolicyOptions +func (*VpcV1) NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { + return &CreateInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + InstanceGroupManagerPolicyPrototype: instanceGroupManagerPolicyPrototype, } } -// SetSnapshotPrototype : Allow user to set SnapshotPrototype -func (_options *CreateSnapshotOptions) SetSnapshotPrototype(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { - _options.SnapshotPrototype = snapshotPrototype +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } -// SetHeaders : Allow user to set Headers -func (options *CreateSnapshotOptions) SetHeaders(param map[string]string) *CreateSnapshotOptions { - options.Headers = param - return options -} - -// CreateSubnetOptions : The CreateSubnet options. -type CreateSubnetOptions struct { - // The subnet prototype object. - SubnetPrototype SubnetPrototypeIntf `json:"SubnetPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSubnetOptions : Instantiate CreateSubnetOptions -func (*VpcV1) NewCreateSubnetOptions(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - return &CreateSubnetOptions{ - SubnetPrototype: subnetPrototype, - } +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// SetSubnetPrototype : Allow user to set SubnetPrototype -func (_options *CreateSubnetOptions) SetSubnetPrototype(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - _options.SubnetPrototype = subnetPrototype +// SetInstanceGroupManagerPolicyPrototype : Allow user to set InstanceGroupManagerPolicyPrototype +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSubnetOptions) SetHeaders(param map[string]string) *CreateSubnetOptions { +func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerPolicyOptions { options.Headers = param return options } -// CreateSubnetReservedIPOptions : The CreateSubnetReservedIP options. -type CreateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` +// CreateInstanceGroupOptions : The CreateInstanceGroup options. +type CreateInstanceGroupOptions struct { + // Instance template to use when creating new instances. + // + // Instance groups are not compatible with instance templates that specify `true` for + // `default_trusted_profile.auto_link`. + InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template" validate:"required"` - // The IP address to reserve, which must not already be reserved on the subnet. + // The subnets to use when creating new instances. + Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` + + // The port to use for new load balancer pool members created by this instance group. The load balancer pool member + // will receive load balancer traffic on this port, unless the load balancer listener is using a port range. (Traffic + // received on a listener using a port range will be sent to members using the same port the listener received it on.) // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` + // This port will also be used for health checks unless the port property of + // `health_monitor` property is specified. + // + // This property must be specified if and only if `load_balancer_pool` has been specified. + ApplicationPort *int64 `json:"application_port,omitempty"` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` + // The load balancer associated with the specified load balancer pool. + // Required if `load_balancer_pool` is specified. The load balancer must have + // `instance_groups_supported` set to `true`. + LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. + // If specified, this instance group will manage the load balancer pool. A pool member + // will be created for each instance created by this group. The specified load + // balancer pool must not be used by another instance group in the VPC. + // + // If specified, `load_balancer` and `application_port` must also be specified. + LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count,omitempty"` + + // The name for this instance group. The name must not be used by another instance group in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The target to bind this reserved IP to. The target must be in the same VPC. - // - // At present, only endpoint gateway targets are supported. The endpoint gateway must - // not be already bound to a reserved IP in the subnet's zone. - // - // If unspecified, the reserved IP will be created unbound. - Target ReservedIPTargetPrototypeIntf `json:"target,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateSubnetReservedIPOptions : Instantiate CreateSubnetReservedIPOptions -func (*VpcV1) NewCreateSubnetReservedIPOptions(subnetID string) *CreateSubnetReservedIPOptions { - return &CreateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), +// NewCreateInstanceGroupOptions : Instantiate CreateInstanceGroupOptions +func (*VpcV1) NewCreateInstanceGroupOptions(instanceTemplate InstanceTemplateIdentityIntf, subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { + return &CreateInstanceGroupOptions{ + InstanceTemplate: instanceTemplate, + Subnets: subnets, } } -// SetSubnetID : Allow user to set SubnetID -func (_options *CreateSubnetReservedIPOptions) SetSubnetID(subnetID string) *CreateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) +// SetInstanceTemplate : Allow user to set InstanceTemplate +func (_options *CreateInstanceGroupOptions) SetInstanceTemplate(instanceTemplate InstanceTemplateIdentityIntf) *CreateInstanceGroupOptions { + _options.InstanceTemplate = instanceTemplate return _options } -// SetAddress : Allow user to set Address -func (_options *CreateSubnetReservedIPOptions) SetAddress(address string) *CreateSubnetReservedIPOptions { - _options.Address = core.StringPtr(address) +// SetSubnets : Allow user to set Subnets +func (_options *CreateInstanceGroupOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { + _options.Subnets = subnets return _options } -// SetAutoDelete : Allow user to set AutoDelete -func (_options *CreateSubnetReservedIPOptions) SetAutoDelete(autoDelete bool) *CreateSubnetReservedIPOptions { - _options.AutoDelete = core.BoolPtr(autoDelete) +// SetApplicationPort : Allow user to set ApplicationPort +func (_options *CreateInstanceGroupOptions) SetApplicationPort(applicationPort int64) *CreateInstanceGroupOptions { + _options.ApplicationPort = core.Int64Ptr(applicationPort) + return _options +} + +// SetLoadBalancer : Allow user to set LoadBalancer +func (_options *CreateInstanceGroupOptions) SetLoadBalancer(loadBalancer LoadBalancerIdentityIntf) *CreateInstanceGroupOptions { + _options.LoadBalancer = loadBalancer + return _options +} + +// SetLoadBalancerPool : Allow user to set LoadBalancerPool +func (_options *CreateInstanceGroupOptions) SetLoadBalancerPool(loadBalancerPool LoadBalancerPoolIdentityIntf) *CreateInstanceGroupOptions { + _options.LoadBalancerPool = loadBalancerPool + return _options +} + +// SetMembershipCount : Allow user to set MembershipCount +func (_options *CreateInstanceGroupOptions) SetMembershipCount(membershipCount int64) *CreateInstanceGroupOptions { + _options.MembershipCount = core.Int64Ptr(membershipCount) return _options } // SetName : Allow user to set Name -func (_options *CreateSubnetReservedIPOptions) SetName(name string) *CreateSubnetReservedIPOptions { +func (_options *CreateInstanceGroupOptions) SetName(name string) *CreateInstanceGroupOptions { _options.Name = core.StringPtr(name) return _options } -// SetTarget : Allow user to set Target -func (_options *CreateSubnetReservedIPOptions) SetTarget(target ReservedIPTargetPrototypeIntf) *CreateSubnetReservedIPOptions { - _options.Target = target +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateInstanceGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateInstanceGroupOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string) *CreateSubnetReservedIPOptions { +func (options *CreateInstanceGroupOptions) SetHeaders(param map[string]string) *CreateInstanceGroupOptions { options.Headers = param return options } -// CreateVPCRouteResponse : CreateVPCRouteResponse struct -type CreateVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// CreateInstanceNetworkAttachmentOptions : The CreateInstanceNetworkAttachment options. +type CreateInstanceNetworkAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` + // A virtual network interface for the instance network attachment. This can be specified + // using an existing virtual network interface, or a prototype object for a new virtual + // network interface. + // + // If an existing virtual network interface is specified, `enable_infrastructure_nat` must be + // `true`. + VirtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` + // The name for this network attachment. Names must be unique within the instance the network attachment resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The URL for this route. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` +// NewCreateInstanceNetworkAttachmentOptions : Instantiate CreateInstanceNetworkAttachmentOptions +func (*VpcV1) NewCreateInstanceNetworkAttachmentOptions(instanceID string, virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) *CreateInstanceNetworkAttachmentOptions { + return &CreateInstanceNetworkAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + VirtualNetworkInterface: virtualNetworkInterface, + } +} - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` +// SetVirtualNetworkInterface : Allow user to set VirtualNetworkInterface +func (_options *CreateInstanceNetworkAttachmentOptions) SetVirtualNetworkInterface(virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) *CreateInstanceNetworkAttachmentOptions { + _options.VirtualNetworkInterface = virtualNetworkInterface + return _options +} - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateInstanceNetworkAttachmentOptions) SetName(name string) *CreateInstanceNetworkAttachmentOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkAttachmentOptions { + options.Headers = param + return options } -// Constants associated with the CreateVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - CreateVPCRouteResponseActionDelegateConst = "delegate" - CreateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - CreateVPCRouteResponseActionDeliverConst = "deliver" - CreateVPCRouteResponseActionDropConst = "drop" -) +// CreateInstanceNetworkInterfaceOptions : The CreateInstanceNetworkInterface options. +type CreateInstanceNetworkInterfaceOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` -// Constants associated with the CreateVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - CreateVPCRouteResponseLifecycleStateDeletingConst = "deleting" - CreateVPCRouteResponseLifecycleStateFailedConst = "failed" - CreateVPCRouteResponseLifecycleStatePendingConst = "pending" - CreateVPCRouteResponseLifecycleStateStableConst = "stable" - CreateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - CreateVPCRouteResponseLifecycleStateUpdatingConst = "updating" - CreateVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -// Constants associated with the CreateVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - CreateVPCRouteResponseOriginServiceConst = "service" - CreateVPCRouteResponseOriginUserConst = "user" -) + // Indicates whether source IP spoofing is allowed on this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// UnmarshalCreateVPCRouteResponse unmarshals an instance of CreateVPCRouteResponse from the specified map of raw messages. -func UnmarshalCreateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CreateVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for the instance network interface. The name must not be used by another network interface on the virtual + // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// CreateVolumeOptions : The CreateVolume options. -type CreateVolumeOptions struct { - // The volume prototype object. - VolumePrototype VolumePrototypeIntf `json:"VolumePrototype" validate:"required"` + // The primary IP address to bind to the instance network interface. This can be + // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must + // be available on the instance network interface's subnet. Otherwise, an + // available address on the subnet will be automatically selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` + + // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is + // used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateVolumeOptions : Instantiate CreateVolumeOptions -func (*VpcV1) NewCreateVolumeOptions(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - return &CreateVolumeOptions{ - VolumePrototype: volumePrototype, +// NewCreateInstanceNetworkInterfaceOptions : Instantiate CreateInstanceNetworkInterfaceOptions +func (*VpcV1) NewCreateInstanceNetworkInterfaceOptions(instanceID string, subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + return &CreateInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + Subnet: subnet, } } -// SetVolumePrototype : Allow user to set VolumePrototype -func (_options *CreateVolumeOptions) SetVolumePrototype(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - _options.VolumePrototype = volumePrototype +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetHeaders : Allow user to set Headers -func (options *CreateVolumeOptions) SetHeaders(param map[string]string) *CreateVolumeOptions { - options.Headers = param - return options +// SetSubnet : Allow user to set Subnet +func (_options *CreateInstanceNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + _options.Subnet = subnet + return _options } -// CreateVPCAddressPrefixOptions : The CreateVPCAddressPrefix options. -type CreateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing +func (_options *CreateInstanceNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateInstanceNetworkInterfaceOptions { + _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) + return _options +} - // The IPv4 range of the address prefix, expressed in CIDR format. The range must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) - // - // The prefix length of the address prefix's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). - CIDR *string `json:"cidr" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateInstanceNetworkInterfaceOptions) SetName(name string) *CreateInstanceNetworkInterfaceOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The zone this address prefix will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` +// SetPrimaryIP : Allow user to set PrimaryIP +func (_options *CreateInstanceNetworkInterfaceOptions) SetPrimaryIP(primaryIP NetworkInterfaceIPPrototypeIntf) *CreateInstanceNetworkInterfaceOptions { + _options.PrimaryIP = primaryIP + return _options +} - // Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not - // have a default address prefix for this zone. - IsDefault *bool `json:"is_default,omitempty"` +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateInstanceNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + _options.SecurityGroups = securityGroups + return _options +} - // The name for this address prefix. The name must not be used by another address prefix for the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkInterfaceOptions { + options.Headers = param + return options +} + +// CreateInstanceOptions : The CreateInstance options. +type CreateInstanceOptions struct { + // The instance prototype object. + InstancePrototype InstancePrototypeIntf `json:"InstancePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateVPCAddressPrefixOptions : Instantiate CreateVPCAddressPrefixOptions -func (*VpcV1) NewCreateVPCAddressPrefixOptions(vpcID string, cidr string, zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - return &CreateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - CIDR: core.StringPtr(cidr), - Zone: zone, +// NewCreateInstanceOptions : Instantiate CreateInstanceOptions +func (*VpcV1) NewCreateInstanceOptions(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { + return &CreateInstanceOptions{ + InstancePrototype: instancePrototype, } } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCAddressPrefixOptions) SetVPCID(vpcID string) *CreateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetInstancePrototype : Allow user to set InstancePrototype +func (_options *CreateInstanceOptions) SetInstancePrototype(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { + _options.InstancePrototype = instancePrototype return _options } -// SetCIDR : Allow user to set CIDR -func (_options *CreateVPCAddressPrefixOptions) SetCIDR(cidr string) *CreateVPCAddressPrefixOptions { - _options.CIDR = core.StringPtr(cidr) - return _options +// SetHeaders : Allow user to set Headers +func (options *CreateInstanceOptions) SetHeaders(param map[string]string) *CreateInstanceOptions { + options.Headers = param + return options } -// SetZone : Allow user to set Zone -func (_options *CreateVPCAddressPrefixOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - _options.Zone = zone - return _options +// CreateInstanceTemplateOptions : The CreateInstanceTemplate options. +type CreateInstanceTemplateOptions struct { + // The instance template prototype object. + InstanceTemplatePrototype InstanceTemplatePrototypeIntf `json:"InstanceTemplatePrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetIsDefault : Allow user to set IsDefault -func (_options *CreateVPCAddressPrefixOptions) SetIsDefault(isDefault bool) *CreateVPCAddressPrefixOptions { - _options.IsDefault = core.BoolPtr(isDefault) - return _options +// NewCreateInstanceTemplateOptions : Instantiate CreateInstanceTemplateOptions +func (*VpcV1) NewCreateInstanceTemplateOptions(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { + return &CreateInstanceTemplateOptions{ + InstanceTemplatePrototype: instanceTemplatePrototype, + } } -// SetName : Allow user to set Name -func (_options *CreateVPCAddressPrefixOptions) SetName(name string) *CreateVPCAddressPrefixOptions { - _options.Name = core.StringPtr(name) +// SetInstanceTemplatePrototype : Allow user to set InstanceTemplatePrototype +func (_options *CreateInstanceTemplateOptions) SetInstanceTemplatePrototype(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { + _options.InstanceTemplatePrototype = instanceTemplatePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *CreateVPCAddressPrefixOptions { +func (options *CreateInstanceTemplateOptions) SetHeaders(param map[string]string) *CreateInstanceTemplateOptions { options.Headers = param return options } -// CreateVPCDnsResolutionBindingOptions : The CreateVPCDnsResolutionBinding options. -type CreateVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// CreateInstanceVolumeAttachmentOptions : The CreateInstanceVolumeAttachment options. +type CreateInstanceVolumeAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // Another VPC to bind this VPC to for DNS resolution. The VPC must have - // `dns.enable_hub` set to `true`, and may be in a different account (subject to - // IAM policies). - // - // Additionally, the VPC specified in the URL (this VPC) must have `dns.enable_hub` - // set to `false` and a `dns.resolution_binding_count` of zero. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + // An existing volume to attach to the instance, or a prototype object for a new volume. + Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` - // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. - // If unspecified, the name will be a hyphenated list of randomly-selected words. + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateVPCDnsResolutionBindingOptions : Instantiate CreateVPCDnsResolutionBindingOptions -func (*VpcV1) NewCreateVPCDnsResolutionBindingOptions(vpcID string, vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { - return &CreateVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - VPC: vpc, +// NewCreateInstanceVolumeAttachmentOptions : Instantiate CreateInstanceVolumeAttachmentOptions +func (*VpcV1) NewCreateInstanceVolumeAttachmentOptions(instanceID string, volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { + return &CreateInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + Volume: volume, } } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *CreateVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetVPC : Allow user to set VPC -func (_options *CreateVPCDnsResolutionBindingOptions) SetVPC(vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { - _options.VPC = vpc +// SetVolume : Allow user to set Volume +func (_options *CreateInstanceVolumeAttachmentOptions) SetVolume(volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { + _options.Volume = volume + return _options +} + +// SetDeleteVolumeOnInstanceDelete : Allow user to set DeleteVolumeOnInstanceDelete +func (_options *CreateInstanceVolumeAttachmentOptions) SetDeleteVolumeOnInstanceDelete(deleteVolumeOnInstanceDelete bool) *CreateInstanceVolumeAttachmentOptions { + _options.DeleteVolumeOnInstanceDelete = core.BoolPtr(deleteVolumeOnInstanceDelete) return _options } // SetName : Allow user to set Name -func (_options *CreateVPCDnsResolutionBindingOptions) SetName(name string) *CreateVPCDnsResolutionBindingOptions { +func (_options *CreateInstanceVolumeAttachmentOptions) SetName(name string) *CreateInstanceVolumeAttachmentOptions { _options.Name = core.StringPtr(name) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *CreateVPCDnsResolutionBindingOptions { +func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceVolumeAttachmentOptions { options.Headers = param return options } -// CreateVPCOptions : The CreateVPC options. -type CreateVPCOptions struct { - // Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) - // will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default - // address prefixes. +// CreateIpsecPolicyOptions : The CreateIpsecPolicy options. +type CreateIpsecPolicyOptions struct { + // The authentication algorithm // - // Since address prefixes are managed identically regardless of whether they were automatically created, the value is - // not preserved as a VPC property. - AddressPrefixManagement *string `json:"address_prefix_management,omitempty"` - - // Indicates whether this VPC will be connected to Classic Infrastructure. If true, this VPC's resources will have - // private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be - // connected in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access,omitempty"` + // Must be `disabled` if and only if the `encryption_algorithm` is + // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - // The DNS configuration for this VPC. + // The encryption algorithm // - // If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint - // gateways within this VPC, and hosts on the internet. - Dns *VpcdnsPrototype `json:"dns,omitempty"` + // The `authentication_algorithm` must be `disabled` if and only if + // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + // `aes256gcm16`. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - // The name for this VPC. The name must not be used by another VPC in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. + // Perfect Forward Secrecy. + Pfs *string `json:"pfs" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` + + // The name for this IPsec policy. The name must not be used by another IPsec policies in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -32534,1941 +33557,1785 @@ type CreateVPCOptions struct { Headers map[string]string } -// Constants associated with the CreateVPCOptions.AddressPrefixManagement property. -// Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) -// will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default -// address prefixes. +// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. +// The authentication algorithm // -// Since address prefixes are managed identically regardless of whether they were automatically created, the value is -// not preserved as a VPC property. +// Must be `disabled` if and only if the `encryption_algorithm` is +// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. const ( - CreateVPCOptionsAddressPrefixManagementAutoConst = "auto" - CreateVPCOptionsAddressPrefixManagementManualConst = "manual" + CreateIpsecPolicyOptionsAuthenticationAlgorithmDisabledConst = "disabled" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" ) -// NewCreateVPCOptions : Instantiate CreateVPCOptions -func (*VpcV1) NewCreateVPCOptions() *CreateVPCOptions { - return &CreateVPCOptions{} +// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. +// The encryption algorithm +// +// The `authentication_algorithm` must be `disabled` if and only if +// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or +// `aes256gcm16`. +const ( + CreateIpsecPolicyOptionsEncryptionAlgorithmAes128Const = "aes128" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes192Const = "aes192" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes256Const = "aes256" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" +) + +// Constants associated with the CreateIpsecPolicyOptions.Pfs property. +// Perfect Forward Secrecy. +const ( + CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" + CreateIpsecPolicyOptionsPfsGroup14Const = "group_14" + CreateIpsecPolicyOptionsPfsGroup15Const = "group_15" + CreateIpsecPolicyOptionsPfsGroup16Const = "group_16" + CreateIpsecPolicyOptionsPfsGroup17Const = "group_17" + CreateIpsecPolicyOptionsPfsGroup18Const = "group_18" + CreateIpsecPolicyOptionsPfsGroup19Const = "group_19" + CreateIpsecPolicyOptionsPfsGroup20Const = "group_20" + CreateIpsecPolicyOptionsPfsGroup21Const = "group_21" + CreateIpsecPolicyOptionsPfsGroup22Const = "group_22" + CreateIpsecPolicyOptionsPfsGroup23Const = "group_23" + CreateIpsecPolicyOptionsPfsGroup24Const = "group_24" + CreateIpsecPolicyOptionsPfsGroup31Const = "group_31" +) + +// NewCreateIpsecPolicyOptions : Instantiate CreateIpsecPolicyOptions +func (*VpcV1) NewCreateIpsecPolicyOptions(authenticationAlgorithm string, encryptionAlgorithm string, pfs string) *CreateIpsecPolicyOptions { + return &CreateIpsecPolicyOptions{ + AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), + EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), + Pfs: core.StringPtr(pfs), + } } -// SetAddressPrefixManagement : Allow user to set AddressPrefixManagement -func (_options *CreateVPCOptions) SetAddressPrefixManagement(addressPrefixManagement string) *CreateVPCOptions { - _options.AddressPrefixManagement = core.StringPtr(addressPrefixManagement) +// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { + _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) return _options } -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *CreateVPCOptions) SetClassicAccess(classicAccess bool) *CreateVPCOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) +// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { + _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) return _options } -// SetDns : Allow user to set Dns -func (_options *CreateVPCOptions) SetDns(dns *VpcdnsPrototype) *CreateVPCOptions { - _options.Dns = dns +// SetPfs : Allow user to set Pfs +func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { + _options.Pfs = core.StringPtr(pfs) + return _options +} + +// SetKeyLifetime : Allow user to set KeyLifetime +func (_options *CreateIpsecPolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIpsecPolicyOptions { + _options.KeyLifetime = core.Int64Ptr(keyLifetime) return _options } // SetName : Allow user to set Name -func (_options *CreateVPCOptions) SetName(name string) *CreateVPCOptions { +func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolicyOptions { _options.Name = core.StringPtr(name) return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVPCOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPCOptions { +func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCOptions) SetHeaders(param map[string]string) *CreateVPCOptions { +func (options *CreateIpsecPolicyOptions) SetHeaders(param map[string]string) *CreateIpsecPolicyOptions { options.Headers = param return options } -// CreateVPCRouteOptions : The CreateVPCRoute options. -type CreateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The destination CIDR of the route. The host identifier in the CIDR must be zero. +// CreateKeyOptions : The CreateKey options. +type CreateKeyOptions struct { + // A unique public SSH key to import, in OpenSSH format (consisting of three space-separated fields: the algorithm + // name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is + // imported. // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` - - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` + // Keys of type `rsa` may be 2048 or 4096 bits in length, however 4096 is recommended. Keys of type `ed25519` are 256 + // bits in length. + PublicKey *string `json:"public_key" validate:"required"` - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a + // hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` + // The crypto-system used by this key. + Type *string `json:"type,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateVPCRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. +// Constants associated with the CreateKeyOptions.Type property. +// The crypto-system used by this key. const ( - CreateVPCRouteOptionsActionDelegateConst = "delegate" - CreateVPCRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRouteOptionsActionDeliverConst = "deliver" - CreateVPCRouteOptionsActionDropConst = "drop" + CreateKeyOptionsTypeEd25519Const = "ed25519" + CreateKeyOptionsTypeRsaConst = "rsa" ) -// NewCreateVPCRouteOptions : Instantiate CreateVPCRouteOptions -func (*VpcV1) NewCreateVPCRouteOptions(vpcID string, destination string, zone ZoneIdentityIntf) *CreateVPCRouteOptions { - return &CreateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - Destination: core.StringPtr(destination), - Zone: zone, +// NewCreateKeyOptions : Instantiate CreateKeyOptions +func (*VpcV1) NewCreateKeyOptions(publicKey string) *CreateKeyOptions { + return &CreateKeyOptions{ + PublicKey: core.StringPtr(publicKey), } } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRouteOptions) SetVPCID(vpcID string) *CreateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRouteOptions) SetDestination(destination string) *CreateVPCRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateVPCRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRouteOptions { - _options.Zone = zone - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateVPCRouteOptions) SetAction(action string) *CreateVPCRouteOptions { - _options.Action = core.StringPtr(action) +// SetPublicKey : Allow user to set PublicKey +func (_options *CreateKeyOptions) SetPublicKey(publicKey string) *CreateKeyOptions { + _options.PublicKey = core.StringPtr(publicKey) return _options } // SetName : Allow user to set Name -func (_options *CreateVPCRouteOptions) SetName(name string) *CreateVPCRouteOptions { +func (_options *CreateKeyOptions) SetName(name string) *CreateKeyOptions { _options.Name = core.StringPtr(name) return _options } -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRouteOptions { - _options.NextHop = nextHop +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateKeyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateKeyOptions { + _options.ResourceGroup = resourceGroup return _options } -// SetPriority : Allow user to set Priority -func (_options *CreateVPCRouteOptions) SetPriority(priority int64) *CreateVPCRouteOptions { - _options.Priority = core.Int64Ptr(priority) +// SetType : Allow user to set Type +func (_options *CreateKeyOptions) SetType(typeVar string) *CreateKeyOptions { + _options.Type = core.StringPtr(typeVar) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCRouteOptions) SetHeaders(param map[string]string) *CreateVPCRouteOptions { +func (options *CreateKeyOptions) SetHeaders(param map[string]string) *CreateKeyOptions { options.Headers = param return options } -// CreateVPCRoutingTableOptions : The CreateVPCRoutingTable options. -type CreateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// CreateLoadBalancerListenerOptions : The CreateLoadBalancerListener options. +type CreateLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The filters specifying the resources that may create routes in this routing table. + // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` + // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http` and + // `https`. + // + // Additional restrictions: + // - If `default_pool` is set, the pool's protocol must match, or be compatible with + // the listener's protocol. At present, the compatible protocols are `http` and + // `https`. + // - If `https_redirect` is set, the protocol must be `http`. + Protocol *string `json:"protocol" validate:"required"` - // The name for this routing table. The name must not be used by another routing table in the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - // If set to `true`, this routing table will be used to route traffic that originates from [Direct - // Link](https://cloud.ibm.com/docs/dl) to this VPC. The VPC must not already have a routing table with this property - // set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` + // The certificate instance to use for SSL termination. The listener must have a + // `protocol` of `https`. + CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` - // If set to `true`, this routing table will be used to route traffic that originates from the internet. For this to - // succeed, the VPC must not already have a routing table with this property set to `true`. + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The default pool for this listener. If specified, the pool must: + // - Belong to this load balancer. + // - Have the same `protocol` as this listener, or have a compatible protocol. + // At present, the compatible protocols are `http` and `https`. + // - Not already be the `default_pool` for another listener. // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` + // If unspecified, this listener will be created with no default pool, but one may be + // subsequently set. + DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` - // If set to `true`, this routing table will be used to route traffic that originates from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. The VPC must not already have a routing table with - // this property set to `true`. + // The target listener that requests will be redirected to. This listener must have a + // `protocol` of `http`, and the target listener must have a `protocol` of `https`. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` + + // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. + IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` + + // The policy prototype objects for this listener. The load balancer must be in the + // `application` family. + Policies []LoadBalancerListenerPolicyPrototype `json:"policies,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` - // If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in - // this VPC. The VPC must not already have a routing table with this property set to `true`. + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` - // The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created - // with no routes. - Routes []RoutePrototype `json:"routes,omitempty"` + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateVPCRoutingTableOptions : Instantiate CreateVPCRoutingTableOptions -func (*VpcV1) NewCreateVPCRoutingTableOptions(vpcID string) *CreateVPCRoutingTableOptions { - return &CreateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), +// Constants associated with the CreateLoadBalancerListenerOptions.Protocol property. +// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. +// +// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http` and +// `https`. +// +// Additional restrictions: +// - If `default_pool` is set, the pool's protocol must match, or be compatible with +// the listener's protocol. At present, the compatible protocols are `http` and +// `https`. +// - If `https_redirect` is set, the protocol must be `http`. +const ( + CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" + CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" + CreateLoadBalancerListenerOptionsProtocolTCPConst = "tcp" + CreateLoadBalancerListenerOptionsProtocolUDPConst = "udp" +) + +// NewCreateLoadBalancerListenerOptions : Instantiate CreateLoadBalancerListenerOptions +func (*VpcV1) NewCreateLoadBalancerListenerOptions(loadBalancerID string, protocol string) *CreateLoadBalancerListenerOptions { + return &CreateLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + Protocol: core.StringPtr(protocol), } } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetAcceptRoutesFrom : Allow user to set AcceptRoutesFrom -func (_options *CreateVPCRoutingTableOptions) SetAcceptRoutesFrom(acceptRoutesFrom []ResourceFilter) *CreateVPCRoutingTableOptions { - _options.AcceptRoutesFrom = acceptRoutesFrom +// SetProtocol : Allow user to set Protocol +func (_options *CreateLoadBalancerListenerOptions) SetProtocol(protocol string) *CreateLoadBalancerListenerOptions { + _options.Protocol = core.StringPtr(protocol) return _options } -// SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableOptions) SetName(name string) *CreateVPCRoutingTableOptions { - _options.Name = core.StringPtr(name) +// SetAcceptProxyProtocol : Allow user to set AcceptProxyProtocol +func (_options *CreateLoadBalancerListenerOptions) SetAcceptProxyProtocol(acceptProxyProtocol bool) *CreateLoadBalancerListenerOptions { + _options.AcceptProxyProtocol = core.BoolPtr(acceptProxyProtocol) return _options } -// SetRouteDirectLinkIngress : Allow user to set RouteDirectLinkIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteDirectLinkIngress(routeDirectLinkIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteDirectLinkIngress = core.BoolPtr(routeDirectLinkIngress) +// SetCertificateInstance : Allow user to set CertificateInstance +func (_options *CreateLoadBalancerListenerOptions) SetCertificateInstance(certificateInstance CertificateInstanceIdentityIntf) *CreateLoadBalancerListenerOptions { + _options.CertificateInstance = certificateInstance return _options } -// SetRouteInternetIngress : Allow user to set RouteInternetIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteInternetIngress(routeInternetIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteInternetIngress = core.BoolPtr(routeInternetIngress) +// SetConnectionLimit : Allow user to set ConnectionLimit +func (_options *CreateLoadBalancerListenerOptions) SetConnectionLimit(connectionLimit int64) *CreateLoadBalancerListenerOptions { + _options.ConnectionLimit = core.Int64Ptr(connectionLimit) return _options } -// SetRouteTransitGatewayIngress : Allow user to set RouteTransitGatewayIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteTransitGatewayIngress(routeTransitGatewayIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteTransitGatewayIngress = core.BoolPtr(routeTransitGatewayIngress) +// SetDefaultPool : Allow user to set DefaultPool +func (_options *CreateLoadBalancerListenerOptions) SetDefaultPool(defaultPool LoadBalancerPoolIdentityIntf) *CreateLoadBalancerListenerOptions { + _options.DefaultPool = defaultPool return _options } -// SetRouteVPCZoneIngress : Allow user to set RouteVPCZoneIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteVPCZoneIngress(routeVPCZoneIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteVPCZoneIngress = core.BoolPtr(routeVPCZoneIngress) +// SetHTTPSRedirect : Allow user to set HTTPSRedirect +func (_options *CreateLoadBalancerListenerOptions) SetHTTPSRedirect(httpsRedirect *LoadBalancerListenerHTTPSRedirectPrototype) *CreateLoadBalancerListenerOptions { + _options.HTTPSRedirect = httpsRedirect return _options } -// SetRoutes : Allow user to set Routes -func (_options *CreateVPCRoutingTableOptions) SetRoutes(routes []RoutePrototype) *CreateVPCRoutingTableOptions { - _options.Routes = routes +// SetIdleConnectionTimeout : Allow user to set IdleConnectionTimeout +func (_options *CreateLoadBalancerListenerOptions) SetIdleConnectionTimeout(idleConnectionTimeout int64) *CreateLoadBalancerListenerOptions { + _options.IdleConnectionTimeout = core.Int64Ptr(idleConnectionTimeout) + return _options +} + +// SetPolicies : Allow user to set Policies +func (_options *CreateLoadBalancerListenerOptions) SetPolicies(policies []LoadBalancerListenerPolicyPrototype) *CreateLoadBalancerListenerOptions { + _options.Policies = policies + return _options +} + +// SetPort : Allow user to set Port +func (_options *CreateLoadBalancerListenerOptions) SetPort(port int64) *CreateLoadBalancerListenerOptions { + _options.Port = core.Int64Ptr(port) + return _options +} + +// SetPortMax : Allow user to set PortMax +func (_options *CreateLoadBalancerListenerOptions) SetPortMax(portMax int64) *CreateLoadBalancerListenerOptions { + _options.PortMax = core.Int64Ptr(portMax) + return _options +} + +// SetPortMin : Allow user to set PortMin +func (_options *CreateLoadBalancerListenerOptions) SetPortMin(portMin int64) *CreateLoadBalancerListenerOptions { + _options.PortMin = core.Int64Ptr(portMin) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableOptions { +func (options *CreateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerOptions { options.Headers = param return options } -// CreateVPCRoutingTableRouteOptions : The CreateVPCRoutingTableRoute options. -type CreateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// CreateLoadBalancerListenerPolicyOptions : The CreateLoadBalancerListenerPolicy options. +type CreateLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // The destination CIDR of the route. The host identifier in the CIDR must be zero. + // The policy action. // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` - - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + // The name for this policy. The name must not be used by another policy for the load balancer listener. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` + // The rule prototype objects for this policy. + Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateVPCRoutingTableRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. +// Constants associated with the CreateLoadBalancerListenerPolicyOptions.Action property. +// The policy action. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. const ( - CreateVPCRoutingTableRouteOptionsActionDelegateConst = "delegate" - CreateVPCRoutingTableRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRoutingTableRouteOptionsActionDeliverConst = "deliver" - CreateVPCRoutingTableRouteOptionsActionDropConst = "drop" + CreateLoadBalancerListenerPolicyOptionsActionForwardConst = "forward" + CreateLoadBalancerListenerPolicyOptionsActionHTTPSRedirectConst = "https_redirect" + CreateLoadBalancerListenerPolicyOptionsActionRedirectConst = "redirect" + CreateLoadBalancerListenerPolicyOptionsActionRejectConst = "reject" ) -// NewCreateVPCRoutingTableRouteOptions : Instantiate CreateVPCRoutingTableRouteOptions -func (*VpcV1) NewCreateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, destination string, zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - return &CreateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - Destination: core.StringPtr(destination), - Zone: zone, +// NewCreateLoadBalancerListenerPolicyOptions : Instantiate CreateLoadBalancerListenerPolicyOptions +func (*VpcV1) NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, action string, priority int64) *CreateLoadBalancerListenerPolicyOptions { + return &CreateLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + Action: core.StringPtr(action), + Priority: core.Int64Ptr(priority), } } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *CreateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *CreateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRoutingTableRouteOptions) SetDestination(destination string) *CreateVPCRoutingTableRouteOptions { - _options.Destination = core.StringPtr(destination) +// SetListenerID : Allow user to set ListenerID +func (_options *CreateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) return _options } -// SetZone : Allow user to set Zone -func (_options *CreateVPCRoutingTableRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - _options.Zone = zone +// SetAction : Allow user to set Action +func (_options *CreateLoadBalancerListenerPolicyOptions) SetAction(action string) *CreateLoadBalancerListenerPolicyOptions { + _options.Action = core.StringPtr(action) return _options } -// SetAction : Allow user to set Action -func (_options *CreateVPCRoutingTableRouteOptions) SetAction(action string) *CreateVPCRoutingTableRouteOptions { - _options.Action = core.StringPtr(action) +// SetPriority : Allow user to set Priority +func (_options *CreateLoadBalancerListenerPolicyOptions) SetPriority(priority int64) *CreateLoadBalancerListenerPolicyOptions { + _options.Priority = core.Int64Ptr(priority) return _options } // SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableRouteOptions) SetName(name string) *CreateVPCRoutingTableRouteOptions { +func (_options *CreateLoadBalancerListenerPolicyOptions) SetName(name string) *CreateLoadBalancerListenerPolicyOptions { _options.Name = core.StringPtr(name) return _options } -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRoutingTableRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRoutingTableRouteOptions { - _options.NextHop = nextHop +// SetRules : Allow user to set Rules +func (_options *CreateLoadBalancerListenerPolicyOptions) SetRules(rules []LoadBalancerListenerPolicyRulePrototype) *CreateLoadBalancerListenerPolicyOptions { + _options.Rules = rules return _options } -// SetPriority : Allow user to set Priority -func (_options *CreateVPCRoutingTableRouteOptions) SetPriority(priority int64) *CreateVPCRoutingTableRouteOptions { - _options.Priority = core.Int64Ptr(priority) +// SetTarget : Allow user to set Target +func (_options *CreateLoadBalancerListenerPolicyOptions) SetTarget(target LoadBalancerListenerPolicyTargetPrototypeIntf) *CreateLoadBalancerListenerPolicyOptions { + _options.Target = target return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableRouteOptions { +func (options *CreateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyOptions { options.Headers = param return options } -// CreateVPNGatewayConnectionOptions : The CreateVPNGatewayConnection options. -type CreateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// CreateLoadBalancerListenerPolicyRuleOptions : The CreateLoadBalancerListenerPolicyRule options. +type CreateLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The VPN gateway connection prototype object. - VPNGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf `json:"VPNGatewayConnectionPrototype" validate:"required"` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewCreateVPNGatewayConnectionOptions : Instantiate CreateVPNGatewayConnectionOptions -func (*VpcV1) NewCreateVPNGatewayConnectionOptions(vpnGatewayID string, vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - return &CreateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - VPNGatewayConnectionPrototype: vpnGatewayConnectionPrototype, +// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Condition property. +// The condition of the rule. +const ( + CreateLoadBalancerListenerPolicyRuleOptionsConditionContainsConst = "contains" + CreateLoadBalancerListenerPolicyRuleOptionsConditionEqualsConst = "equals" + CreateLoadBalancerListenerPolicyRuleOptionsConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + CreateLoadBalancerListenerPolicyRuleOptionsTypeBodyConst = "body" + CreateLoadBalancerListenerPolicyRuleOptionsTypeHeaderConst = "header" + CreateLoadBalancerListenerPolicyRuleOptionsTypeHostnameConst = "hostname" + CreateLoadBalancerListenerPolicyRuleOptionsTypePathConst = "path" + CreateLoadBalancerListenerPolicyRuleOptionsTypeQueryConst = "query" +) + +// NewCreateLoadBalancerListenerPolicyRuleOptions : Instantiate CreateLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, condition string, typeVar string, value string) *CreateLoadBalancerListenerPolicyRuleOptions { + return &CreateLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + Condition: core.StringPtr(condition), + Type: core.StringPtr(typeVar), + Value: core.StringPtr(value), } } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetVPNGatewayConnectionPrototype : Allow user to set VPNGatewayConnectionPrototype -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototype +// SetListenerID : Allow user to set ListenerID +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) return _options } -// SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *CreateVPNGatewayConnectionOptions { - options.Headers = param - return options +// SetPolicyID : Allow user to set PolicyID +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options } -// CreateVPNGatewayOptions : The CreateVPNGateway options. -type CreateVPNGatewayOptions struct { - // The VPN gateway prototype object. - VPNGatewayPrototype VPNGatewayPrototypeIntf `json:"VPNGatewayPrototype" validate:"required"` +// SetCondition : Allow user to set Condition +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetCondition(condition string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Condition = core.StringPtr(condition) + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetType : Allow user to set Type +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetType(typeVar string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Type = core.StringPtr(typeVar) + return _options } -// NewCreateVPNGatewayOptions : Instantiate CreateVPNGatewayOptions -func (*VpcV1) NewCreateVPNGatewayOptions(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - return &CreateVPNGatewayOptions{ - VPNGatewayPrototype: vpnGatewayPrototype, - } +// SetValue : Allow user to set Value +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetValue(value string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Value = core.StringPtr(value) + return _options } -// SetVPNGatewayPrototype : Allow user to set VPNGatewayPrototype -func (_options *CreateVPNGatewayOptions) SetVPNGatewayPrototype(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - _options.VPNGatewayPrototype = vpnGatewayPrototype +// SetField : Allow user to set Field +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetField(field string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Field = core.StringPtr(field) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayOptions) SetHeaders(param map[string]string) *CreateVPNGatewayOptions { +func (options *CreateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyRuleOptions { options.Headers = param return options } -// CreateVPNServerOptions : The CreateVPNServer options. -type CreateVPNServerOptions struct { - // The certificate instance for this VPN server. - Certificate CertificateInstanceIdentityIntf `json:"certificate" validate:"required"` - - // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified - // methods. - ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication" validate:"required"` - - // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) +// CreateLoadBalancerOptions : The CreateLoadBalancer options. +type CreateLoadBalancerOptions struct { + // Indicates whether this load balancer is public. // - // The prefix length of the client IP address pool's CIDR must be between - // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses - // that are required to enable the maximum number of concurrent connections is recommended. - ClientIPPool *string `json:"client_ip_pool" validate:"required"` + // At present, if route mode is enabled, the load balancer must not be public. + IsPublic *bool `json:"is_public" validate:"required"` - // The subnets to provision this VPN server in. Use subnets in different zones for high availability. + // The subnets to provision this load balancer in. The subnets must be in the same VPC. The load balancer's + // availability will depend on the availability of the zones that the subnets reside in. + // + // Load balancers in the `network` family allow only one subnet to be specified. Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - // The DNS server addresses that will be provided to VPN clients connected to this VPN server. - ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` + // The DNS configuration for this load balancer. + // + // If unspecified, DNS `A` records for this load balancer's `hostname` property will be added + // to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be + // added to the specified `zone`. + Dns *LoadBalancerDnsPrototype `json:"dns,omitempty"` - // The seconds a VPN client can be idle before this VPN server will disconnect it. Specify `0` to prevent the server - // from disconnecting idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` + // The listeners of this load balancer. + Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"` - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` + // The logging configuration to use for this load balancer. See [VPC Datapath + // Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging + // format, fields and permitted values. If unspecified, `datapath.active` will be `false`. + // + // To activate logging, the load balancer profile must support the specified logging type. + Logging *LoadBalancerLoggingPrototype `json:"logging,omitempty"` - // The name for this VPN server. The name must not be used by another VPN server in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. + // The name for this load balancer. The name must not be used by another load balancer in the VPC. If unspecified, the + // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The port number to use for this VPN server. - Port *int64 `json:"port,omitempty"` + // The pools of this load balancer. + Pools []LoadBalancerPoolPrototype `json:"pools,omitempty"` - // The transport protocol to use for this VPN server. - Protocol *string `json:"protocol,omitempty"` + // The profile to use for this load balancer. + // + // If unspecified, `application` will be used. + Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The security groups to use for this VPN server. If unspecified, the VPC's default security group is used. + // Indicates whether route mode is enabled for this load balancer. + // + // At present, public load balancers are not supported with route mode enabled. + RouteMode *bool `json:"route_mode,omitempty"` + + // The security groups to use for this load balancer. If unspecified, the VPC's default security group is used. + // + // The load balancer profile must support security groups. SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateVPNServerOptions.Protocol property. -// The transport protocol to use for this VPN server. -const ( - CreateVPNServerOptionsProtocolTCPConst = "tcp" - CreateVPNServerOptionsProtocolUDPConst = "udp" -) - -// NewCreateVPNServerOptions : Instantiate CreateVPNServerOptions -func (*VpcV1) NewCreateVPNServerOptions(certificate CertificateInstanceIdentityIntf, clientAuthentication []VPNServerAuthenticationPrototypeIntf, clientIPPool string, subnets []SubnetIdentityIntf) *CreateVPNServerOptions { - return &CreateVPNServerOptions{ - Certificate: certificate, - ClientAuthentication: clientAuthentication, - ClientIPPool: core.StringPtr(clientIPPool), - Subnets: subnets, +// NewCreateLoadBalancerOptions : Instantiate CreateLoadBalancerOptions +func (*VpcV1) NewCreateLoadBalancerOptions(isPublic bool, subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { + return &CreateLoadBalancerOptions{ + IsPublic: core.BoolPtr(isPublic), + Subnets: subnets, } } -// SetCertificate : Allow user to set Certificate -func (_options *CreateVPNServerOptions) SetCertificate(certificate CertificateInstanceIdentityIntf) *CreateVPNServerOptions { - _options.Certificate = certificate - return _options -} - -// SetClientAuthentication : Allow user to set ClientAuthentication -func (_options *CreateVPNServerOptions) SetClientAuthentication(clientAuthentication []VPNServerAuthenticationPrototypeIntf) *CreateVPNServerOptions { - _options.ClientAuthentication = clientAuthentication - return _options -} - -// SetClientIPPool : Allow user to set ClientIPPool -func (_options *CreateVPNServerOptions) SetClientIPPool(clientIPPool string) *CreateVPNServerOptions { - _options.ClientIPPool = core.StringPtr(clientIPPool) +// SetIsPublic : Allow user to set IsPublic +func (_options *CreateLoadBalancerOptions) SetIsPublic(isPublic bool) *CreateLoadBalancerOptions { + _options.IsPublic = core.BoolPtr(isPublic) return _options } // SetSubnets : Allow user to set Subnets -func (_options *CreateVPNServerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateVPNServerOptions { +func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { _options.Subnets = subnets return _options } -// SetClientDnsServerIps : Allow user to set ClientDnsServerIps -func (_options *CreateVPNServerOptions) SetClientDnsServerIps(clientDnsServerIps []IP) *CreateVPNServerOptions { - _options.ClientDnsServerIps = clientDnsServerIps +// SetDns : Allow user to set Dns +func (_options *CreateLoadBalancerOptions) SetDns(dns *LoadBalancerDnsPrototype) *CreateLoadBalancerOptions { + _options.Dns = dns return _options } -// SetClientIdleTimeout : Allow user to set ClientIdleTimeout -func (_options *CreateVPNServerOptions) SetClientIdleTimeout(clientIdleTimeout int64) *CreateVPNServerOptions { - _options.ClientIdleTimeout = core.Int64Ptr(clientIdleTimeout) +// SetListeners : Allow user to set Listeners +func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions { + _options.Listeners = listeners return _options } -// SetEnableSplitTunneling : Allow user to set EnableSplitTunneling -func (_options *CreateVPNServerOptions) SetEnableSplitTunneling(enableSplitTunneling bool) *CreateVPNServerOptions { - _options.EnableSplitTunneling = core.BoolPtr(enableSplitTunneling) +// SetLogging : Allow user to set Logging +func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLoggingPrototype) *CreateLoadBalancerOptions { + _options.Logging = logging return _options } // SetName : Allow user to set Name -func (_options *CreateVPNServerOptions) SetName(name string) *CreateVPNServerOptions { +func (_options *CreateLoadBalancerOptions) SetName(name string) *CreateLoadBalancerOptions { _options.Name = core.StringPtr(name) return _options } -// SetPort : Allow user to set Port -func (_options *CreateVPNServerOptions) SetPort(port int64) *CreateVPNServerOptions { - _options.Port = core.Int64Ptr(port) +// SetPools : Allow user to set Pools +func (_options *CreateLoadBalancerOptions) SetPools(pools []LoadBalancerPoolPrototype) *CreateLoadBalancerOptions { + _options.Pools = pools return _options } -// SetProtocol : Allow user to set Protocol -func (_options *CreateVPNServerOptions) SetProtocol(protocol string) *CreateVPNServerOptions { - _options.Protocol = core.StringPtr(protocol) +// SetProfile : Allow user to set Profile +func (_options *CreateLoadBalancerOptions) SetProfile(profile LoadBalancerProfileIdentityIntf) *CreateLoadBalancerOptions { + _options.Profile = profile return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVPNServerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPNServerOptions { +func (_options *CreateLoadBalancerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateLoadBalancerOptions { _options.ResourceGroup = resourceGroup return _options } +// SetRouteMode : Allow user to set RouteMode +func (_options *CreateLoadBalancerOptions) SetRouteMode(routeMode bool) *CreateLoadBalancerOptions { + _options.RouteMode = core.BoolPtr(routeMode) + return _options +} + // SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateVPNServerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateVPNServerOptions { +func (_options *CreateLoadBalancerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateLoadBalancerOptions { _options.SecurityGroups = securityGroups return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPNServerOptions) SetHeaders(param map[string]string) *CreateVPNServerOptions { +func (options *CreateLoadBalancerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerOptions { options.Headers = param return options } -// CreateVPNServerRouteOptions : The CreateVPNServerRoute options. -type CreateVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` +// CreateLoadBalancerPoolMemberOptions : The CreateLoadBalancerPoolMember options. +type CreateLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The destination to use for this VPN route in the VPN server. Must be unique within the VPN server. If an incoming - // packet does not match any destination, it will be dropped. - Destination *string `json:"destination" validate:"required"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // The action to perform with a packet matching the VPN route: - // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver - // the packet to target. - // - `deliver`: deliver the packet to the target. - // - `drop`: drop the packet + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the - // unexpected property value was encountered. - Action *string `json:"action,omitempty"` + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + // + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port" validate:"required"` - // The name for this VPN server route. The name must not be used by another route for the VPN server. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. If the load + // balancer has route mode enabled, the member must be in a zone the load balancer has a + // subnet in. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` + + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateVPNServerRouteOptions.Action property. -// The action to perform with a packet matching the VPN route: -// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver the -// packet to target. -// - `deliver`: deliver the packet to the target. -// - `drop`: drop the packet -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the -// unexpected property value was encountered. -const ( - CreateVPNServerRouteOptionsActionDeliverConst = "deliver" - CreateVPNServerRouteOptionsActionDropConst = "drop" - CreateVPNServerRouteOptionsActionTranslateConst = "translate" -) - -// NewCreateVPNServerRouteOptions : Instantiate CreateVPNServerRouteOptions -func (*VpcV1) NewCreateVPNServerRouteOptions(vpnServerID string, destination string) *CreateVPNServerRouteOptions { - return &CreateVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - Destination: core.StringPtr(destination), +// NewCreateLoadBalancerPoolMemberOptions : Instantiate CreateLoadBalancerPoolMemberOptions +func (*VpcV1) NewCreateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { + return &CreateLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + Port: core.Int64Ptr(port), + Target: target, } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *CreateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *CreateVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetDestination : Allow user to set Destination -func (_options *CreateVPNServerRouteOptions) SetDestination(destination string) *CreateVPNServerRouteOptions { - _options.Destination = core.StringPtr(destination) +// SetPoolID : Allow user to set PoolID +func (_options *CreateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *CreateLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) return _options } -// SetAction : Allow user to set Action -func (_options *CreateVPNServerRouteOptions) SetAction(action string) *CreateVPNServerRouteOptions { - _options.Action = core.StringPtr(action) +// SetPort : Allow user to set Port +func (_options *CreateLoadBalancerPoolMemberOptions) SetPort(port int64) *CreateLoadBalancerPoolMemberOptions { + _options.Port = core.Int64Ptr(port) return _options } -// SetName : Allow user to set Name -func (_options *CreateVPNServerRouteOptions) SetName(name string) *CreateVPNServerRouteOptions { - _options.Name = core.StringPtr(name) +// SetTarget : Allow user to set Target +func (_options *CreateLoadBalancerPoolMemberOptions) SetTarget(target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { + _options.Target = target + return _options +} + +// SetWeight : Allow user to set Weight +func (_options *CreateLoadBalancerPoolMemberOptions) SetWeight(weight int64) *CreateLoadBalancerPoolMemberOptions { + _options.Weight = core.Int64Ptr(weight) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateVPNServerRouteOptions) SetHeaders(param map[string]string) *CreateVPNServerRouteOptions { +func (options *CreateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolMemberOptions { options.Headers = param return options } -// DnsInstanceIdentity : Identifies a DNS instance by a unique property. -// Models which "extend" this model: -// - DnsInstanceIdentityByCRN -type DnsInstanceIdentity struct { - // The CRN for this DNS instance. - CRN *string `json:"crn,omitempty"` -} +// CreateLoadBalancerPoolOptions : The CreateLoadBalancerPool options. +type CreateLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` -func (*DnsInstanceIdentity) isaDnsInstanceIdentity() bool { - return true -} + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` -type DnsInstanceIdentityIntf interface { - isaDnsInstanceIdentity() bool -} + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` -// UnmarshalDnsInstanceIdentity unmarshals an instance of DnsInstanceIdentity from the specified map of raw messages. -func UnmarshalDnsInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if + // `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http`, and `https`. + Protocol *string `json:"protocol" validate:"required"` -// DnsInstanceReference : DnsInstanceReference struct -type DnsInstanceReference struct { - // The CRN for this DNS instance. - CRN *string `json:"crn" validate:"required"` -} + // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` + // tuple cannot be shared by a pool member of any other load balancer in the same VPC. + Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` -// UnmarshalDnsInstanceReference unmarshals an instance of DnsInstanceReference from the specified map of raw messages. -func UnmarshalDnsInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// DnsServer : A DNS server. -type DnsServer struct { - // The IP address. + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` - // If present, DHCP configuration for this zone will have this DNS server listed first. - ZoneAffinity *ZoneReference `json:"zone_affinity,omitempty"` -} + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` -// UnmarshalDnsServer unmarshals an instance of DnsServer from the specified map of raw messages. -func UnmarshalDnsServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsServer) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// DnsServerPrototype : DnsServerPrototype struct -type DnsServerPrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// Constants associated with the CreateLoadBalancerPoolOptions.Algorithm property. +// The load balancing algorithm. +const ( + CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst = "least_connections" + CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst = "round_robin" + CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) - // DHCP configuration for the specified zone will have this DNS server listed first. - ZoneAffinity ZoneIdentityIntf `json:"zone_affinity,omitempty"` -} +// Constants associated with the CreateLoadBalancerPoolOptions.Protocol property. +// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if +// `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http`, and `https`. +const ( + CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" + CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" + CreateLoadBalancerPoolOptionsProtocolTCPConst = "tcp" + CreateLoadBalancerPoolOptionsProtocolUDPConst = "udp" +) -// NewDnsServerPrototype : Instantiate DnsServerPrototype (Generic Model Constructor) -func (*VpcV1) NewDnsServerPrototype(address string) (_model *DnsServerPrototype, err error) { - _model = &DnsServerPrototype{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the CreateLoadBalancerPoolOptions.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + CreateLoadBalancerPoolOptionsProxyProtocolDisabledConst = "disabled" + CreateLoadBalancerPoolOptionsProxyProtocolV1Const = "v1" + CreateLoadBalancerPoolOptionsProxyProtocolV2Const = "v2" +) -// UnmarshalDnsServerPrototype unmarshals an instance of DnsServerPrototype from the specified map of raw messages. -func UnmarshalDnsServerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsServerPrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneIdentity) - if err != nil { - return +// NewCreateLoadBalancerPoolOptions : Instantiate CreateLoadBalancerPoolOptions +func (*VpcV1) NewCreateLoadBalancerPoolOptions(loadBalancerID string, algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) *CreateLoadBalancerPoolOptions { + return &CreateLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + Algorithm: core.StringPtr(algorithm), + HealthMonitor: healthMonitor, + Protocol: core.StringPtr(protocol), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DnsZoneIdentity : Identifies a DNS zone by a unique property. -// Models which "extend" this model: -// - DnsZoneIdentityByID -type DnsZoneIdentity struct { - ID *string `json:"id,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -func (*DnsZoneIdentity) isaDnsZoneIdentity() bool { - return true +// SetAlgorithm : Allow user to set Algorithm +func (_options *CreateLoadBalancerPoolOptions) SetAlgorithm(algorithm string) *CreateLoadBalancerPoolOptions { + _options.Algorithm = core.StringPtr(algorithm) + return _options } -type DnsZoneIdentityIntf interface { - isaDnsZoneIdentity() bool +// SetHealthMonitor : Allow user to set HealthMonitor +func (_options *CreateLoadBalancerPoolOptions) SetHealthMonitor(healthMonitor *LoadBalancerPoolHealthMonitorPrototype) *CreateLoadBalancerPoolOptions { + _options.HealthMonitor = healthMonitor + return _options } -// UnmarshalDnsZoneIdentity unmarshals an instance of DnsZoneIdentity from the specified map of raw messages. -func UnmarshalDnsZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetProtocol : Allow user to set Protocol +func (_options *CreateLoadBalancerPoolOptions) SetProtocol(protocol string) *CreateLoadBalancerPoolOptions { + _options.Protocol = core.StringPtr(protocol) + return _options } -// DnsZoneReference : DnsZoneReference struct -type DnsZoneReference struct { - ID *string `json:"id" validate:"required"` +// SetMembers : Allow user to set Members +func (_options *CreateLoadBalancerPoolOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *CreateLoadBalancerPoolOptions { + _options.Members = members + return _options } -// UnmarshalDnsZoneReference unmarshals an instance of DnsZoneReference from the specified map of raw messages. -func UnmarshalDnsZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetName : Allow user to set Name +func (_options *CreateLoadBalancerPoolOptions) SetName(name string) *CreateLoadBalancerPoolOptions { + _options.Name = core.StringPtr(name) + return _options } -// DedicatedHost : DedicatedHost struct -type DedicatedHost struct { - // The amount of memory in gibibytes that is currently available for instances. - AvailableMemory *int64 `json:"available_memory" validate:"required"` +// SetProxyProtocol : Allow user to set ProxyProtocol +func (_options *CreateLoadBalancerPoolOptions) SetProxyProtocol(proxyProtocol string) *CreateLoadBalancerPoolOptions { + _options.ProxyProtocol = core.StringPtr(proxyProtocol) + return _options +} - // The available VCPU for the dedicated host. - AvailableVcpu *Vcpu `json:"available_vcpu" validate:"required"` +// SetSessionPersistence : Allow user to set SessionPersistence +func (_options *CreateLoadBalancerPoolOptions) SetSessionPersistence(sessionPersistence *LoadBalancerPoolSessionPersistencePrototype) *CreateLoadBalancerPoolOptions { + _options.SessionPersistence = sessionPersistence + return _options +} - // The date and time that the dedicated host was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolOptions { + options.Headers = param + return options +} - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` +// CreateNetworkACLOptions : The CreateNetworkACL options. +type CreateNetworkACLOptions struct { + // The network ACL prototype object. + NetworkACLPrototype NetworkACLPrototypeIntf `json:"NetworkACLPrototype" validate:"required"` - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` - - // The dedicated host group this dedicated host is in. - Group *DedicatedHostGroupReference `json:"group" validate:"required"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` - - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The instances that are allocated to this dedicated host. - Instances []InstanceReference `json:"instances" validate:"required"` +// NewCreateNetworkACLOptions : Instantiate CreateNetworkACLOptions +func (*VpcV1) NewCreateNetworkACLOptions(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { + return &CreateNetworkACLOptions{ + NetworkACLPrototype: networkACLPrototype, + } +} - // The lifecycle state of the dedicated host. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// SetNetworkACLPrototype : Allow user to set NetworkACLPrototype +func (_options *CreateNetworkACLOptions) SetNetworkACLPrototype(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { + _options.NetworkACLPrototype = networkACLPrototype + return _options +} - // The total amount of memory in gibibytes for this host. - Memory *int64 `json:"memory" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateNetworkACLOptions) SetHeaders(param map[string]string) *CreateNetworkACLOptions { + options.Headers = param + return options +} - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. - Name *string `json:"name" validate:"required"` +// CreateNetworkACLRuleOptions : The CreateNetworkACLRule options. +type CreateNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - // The dedicated host NUMA configuration. - Numa *DedicatedHostNuma `json:"numa" validate:"required"` + // The network ACL rule prototype object. + NetworkACLRulePrototype NetworkACLRulePrototypeIntf `json:"NetworkACLRulePrototype" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this - // dedicated host. - Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // Indicates whether this dedicated host is available for instance creation. - Provisionable *bool `json:"provisionable" validate:"required"` +// NewCreateNetworkACLRuleOptions : Instantiate CreateNetworkACLRuleOptions +func (*VpcV1) NewCreateNetworkACLRuleOptions(networkACLID string, networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { + return &CreateNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + NetworkACLRulePrototype: networkACLRulePrototype, + } +} - // The resource group for this dedicated host. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *CreateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *CreateNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetNetworkACLRulePrototype : Allow user to set NetworkACLRulePrototype +func (_options *CreateNetworkACLRuleOptions) SetNetworkACLRulePrototype(networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { + _options.NetworkACLRulePrototype = networkACLRulePrototype + return _options +} - // The total number of sockets for this host. - SocketCount *int64 `json:"socket_count" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateNetworkACLRuleOptions) SetHeaders(param map[string]string) *CreateNetworkACLRuleOptions { + options.Headers = param + return options +} - // The administrative state of the dedicated host. +// CreatePlacementGroupOptions : The CreatePlacementGroup options. +type CreatePlacementGroupOptions struct { + // The strategy for this placement group + // - `host_spread`: place on different compute hosts + // - `power_spread`: place on compute hosts that use different power sources // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which - // the unexpected property value was encountered. - State *string `json:"state" validate:"required"` + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the + // unexpected strategy was encountered. + Strategy *string `json:"strategy" validate:"required"` - // The instance profiles usable by instances placed on this dedicated host. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` + // The name for this placement group. The name must not be used by another placement group in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The total VCPU of the dedicated host. - Vcpu *Vcpu `json:"vcpu" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The zone this dedicated host resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHost.LifecycleState property. -// The lifecycle state of the dedicated host. -const ( - DedicatedHostLifecycleStateDeletingConst = "deleting" - DedicatedHostLifecycleStateFailedConst = "failed" - DedicatedHostLifecycleStatePendingConst = "pending" - DedicatedHostLifecycleStateStableConst = "stable" - DedicatedHostLifecycleStateSuspendedConst = "suspended" - DedicatedHostLifecycleStateUpdatingConst = "updating" - DedicatedHostLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DedicatedHost.ResourceType property. -// The resource type. -const ( - DedicatedHostResourceTypeDedicatedHostConst = "dedicated_host" -) - -// Constants associated with the DedicatedHost.State property. -// The administrative state of the dedicated host. +// Constants associated with the CreatePlacementGroupOptions.Strategy property. +// The strategy for this placement group +// - `host_spread`: place on different compute hosts +// - `power_spread`: place on compute hosts that use different power sources // -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which -// the unexpected property value was encountered. +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the +// unexpected strategy was encountered. const ( - DedicatedHostStateAvailableConst = "available" - DedicatedHostStateDegradedConst = "degraded" - DedicatedHostStateMigratingConst = "migrating" - DedicatedHostStateUnavailableConst = "unavailable" + CreatePlacementGroupOptionsStrategyHostSpreadConst = "host_spread" + CreatePlacementGroupOptionsStrategyPowerSpreadConst = "power_spread" ) -// UnmarshalDedicatedHost unmarshals an instance of DedicatedHost from the specified map of raw messages. -func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHost) - err = core.UnmarshalPrimitive(m, "available_memory", &obj.AvailableMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "available_vcpu", &obj.AvailableVcpu, UnmarshalVcpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "numa", &obj.Numa, UnmarshalDedicatedHostNuma) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return +// NewCreatePlacementGroupOptions : Instantiate CreatePlacementGroupOptions +func (*VpcV1) NewCreatePlacementGroupOptions(strategy string) *CreatePlacementGroupOptions { + return &CreatePlacementGroupOptions{ + Strategy: core.StringPtr(strategy), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostCollection : DedicatedHostCollection struct -type DedicatedHostCollection struct { - // Collection of dedicated hosts. - DedicatedHosts []DedicatedHost `json:"dedicated_hosts" validate:"required"` - - // A link to the first page of resources. - First *DedicatedHostCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostCollectionNext `json:"next,omitempty"` +// SetStrategy : Allow user to set Strategy +func (_options *CreatePlacementGroupOptions) SetStrategy(strategy string) *CreatePlacementGroupOptions { + _options.Strategy = core.StringPtr(strategy) + return _options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreatePlacementGroupOptions) SetName(name string) *CreatePlacementGroupOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalDedicatedHostCollection unmarshals an instance of DedicatedHostCollection from the specified map of raw messages. -func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollection) - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHost) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreatePlacementGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePlacementGroupOptions { + _options.ResourceGroup = resourceGroup + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetHeaders : Allow user to set Headers +func (options *CreatePlacementGroupOptions) SetHeaders(param map[string]string) *CreatePlacementGroupOptions { + options.Headers = param + return options } -// DedicatedHostCollectionFirst : A link to the first page of resources. -type DedicatedHostCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// CreatePublicGatewayOptions : The CreatePublicGateway options. +type CreatePublicGatewayOptions struct { + // The VPC this public gateway will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // The zone this public gateway will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + FloatingIP PublicGatewayFloatingIPPrototypeIntf `json:"floating_ip,omitempty"` + + // The name for this public gateway. The name must not be used by another public gateway in the VPC. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostCollectionFirst unmarshals an instance of DedicatedHostCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewCreatePublicGatewayOptions : Instantiate CreatePublicGatewayOptions +func (*VpcV1) NewCreatePublicGatewayOptions(vpc VPCIdentityIntf, zone ZoneIdentityIntf) *CreatePublicGatewayOptions { + return &CreatePublicGatewayOptions{ + VPC: vpc, + Zone: zone, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetVPC : Allow user to set VPC +func (_options *CreatePublicGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreatePublicGatewayOptions { + _options.VPC = vpc + return _options } -// UnmarshalDedicatedHostCollectionNext unmarshals an instance of DedicatedHostCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetZone : Allow user to set Zone +func (_options *CreatePublicGatewayOptions) SetZone(zone ZoneIdentityIntf) *CreatePublicGatewayOptions { + _options.Zone = zone + return _options } -// DedicatedHostDisk : DedicatedHostDisk struct -type DedicatedHostDisk struct { - // The remaining space left for instance placement in GB (gigabytes). - Available *int64 `json:"available" validate:"required"` +// SetFloatingIP : Allow user to set FloatingIP +func (_options *CreatePublicGatewayOptions) SetFloatingIP(floatingIP PublicGatewayFloatingIPPrototypeIntf) *CreatePublicGatewayOptions { + _options.FloatingIP = floatingIP + return _options +} - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreatePublicGatewayOptions) SetName(name string) *CreatePublicGatewayOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The URL for this disk. - Href *string `json:"href" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreatePublicGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePublicGatewayOptions { + _options.ResourceGroup = resourceGroup + return _options +} - // The unique identifier for this disk. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) *CreatePublicGatewayOptions { + options.Headers = param + return options +} - // Instance disks that are on this dedicated host disk. - InstanceDisks []InstanceDiskReference `json:"instance_disks" validate:"required"` +// CreateReservationOptions : The CreateReservation options. +type CreateReservationOptions struct { + // The capacity reservation configuration to use. + Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` - // The disk interface used for attaching the disk - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` - // The lifecycle state of this dedicated host disk. - LifecycleState *string `json:"lifecycle_state,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + Profile *ReservationProfilePrototype `json:"profile" validate:"required"` - // The name for this dedicated host disk. The name is unique across all disks on the dedicated host. - Name *string `json:"name" validate:"required"` + // The zone to use for this reservation. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // Indicates whether this dedicated host disk is available for instance disk creation. - Provisionable *bool `json:"provisionable" validate:"required"` + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested. + AffinityPolicy *string `json:"affinity_policy,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The instance disk interfaces supported for this dedicated host disk. - SupportedInstanceInterfaceTypes []string `json:"supported_instance_interface_types" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostDisk.InterfaceType property. -// The disk interface used for attaching the disk -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. +// Constants associated with the CreateReservationOptions.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested. const ( - DedicatedHostDiskInterfaceTypeNvmeConst = "nvme" + CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" ) -// Constants associated with the DedicatedHostDisk.LifecycleState property. -// The lifecycle state of this dedicated host disk. -const ( - DedicatedHostDiskLifecycleStateDeletingConst = "deleting" - DedicatedHostDiskLifecycleStateFailedConst = "failed" - DedicatedHostDiskLifecycleStatePendingConst = "pending" - DedicatedHostDiskLifecycleStateStableConst = "stable" - DedicatedHostDiskLifecycleStateSuspendedConst = "suspended" - DedicatedHostDiskLifecycleStateUpdatingConst = "updating" - DedicatedHostDiskLifecycleStateWaitingConst = "waiting" -) +// NewCreateReservationOptions : Instantiate CreateReservationOptions +func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { + return &CreateReservationOptions{ + Capacity: capacity, + CommittedUse: committedUse, + Profile: profile, + Zone: zone, + } +} -// Constants associated with the DedicatedHostDisk.ResourceType property. -// The resource type. -const ( - DedicatedHostDiskResourceTypeDedicatedHostDiskConst = "dedicated_host_disk" -) +// SetCapacity : Allow user to set Capacity +func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { + _options.Capacity = capacity + return _options +} -// Constants associated with the DedicatedHostDisk.SupportedInstanceInterfaceTypes property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostDiskSupportedInstanceInterfaceTypesNvmeConst = "nvme" - DedicatedHostDiskSupportedInstanceInterfaceTypesVirtioBlkConst = "virtio_blk" -) +// SetCommittedUse : Allow user to set CommittedUse +func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { + _options.CommittedUse = committedUse + return _options +} -// UnmarshalDedicatedHostDisk unmarshals an instance of DedicatedHostDisk from the specified map of raw messages. -func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDisk) - err = core.UnmarshalPrimitive(m, "available", &obj.Available) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_disks", &obj.InstanceDisks, UnmarshalInstanceDiskReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetProfile : Allow user to set Profile +func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { + _options.Profile = profile + return _options } -// DedicatedHostDiskCollection : DedicatedHostDiskCollection struct -type DedicatedHostDiskCollection struct { - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` +// SetZone : Allow user to set Zone +func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { + _options.Zone = zone + return _options } -// UnmarshalDedicatedHostDiskCollection unmarshals an instance of DedicatedHostDiskCollection from the specified map of raw messages. -func UnmarshalDedicatedHostDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetAffinityPolicy : Allow user to set AffinityPolicy +func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { + _options.AffinityPolicy = core.StringPtr(affinityPolicy) + return _options } -// DedicatedHostDiskPatch : DedicatedHostDiskPatch struct -type DedicatedHostDiskPatch struct { - // The name for this dedicated host disk. The name must not be used by another disk on the dedicated host. - Name *string `json:"name,omitempty"` +// SetName : Allow user to set Name +func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalDedicatedHostDiskPatch unmarshals an instance of DedicatedHostDiskPatch from the specified map of raw messages. -func UnmarshalDedicatedHostDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { + _options.ResourceGroup = resourceGroup + return _options } -// AsPatch returns a generic map representation of the DedicatedHostDiskPatch -func (dedicatedHostDiskPatch *DedicatedHostDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { + options.Headers = param + return options } -// DedicatedHostGroup : DedicatedHostGroup struct -type DedicatedHostGroup struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class" validate:"required"` - - // The date and time that the dedicated host group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // The dedicated hosts that are in this dedicated host group. - DedicatedHosts []DedicatedHostReference `json:"dedicated_hosts" validate:"required"` - - // The dedicated host profile family for hosts in this group. - Family *string `json:"family" validate:"required"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` +// CreateSecurityGroupOptions : The CreateSecurityGroup options. +type CreateSecurityGroupOptions struct { + // The VPC this security group will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` + // The name for this security group. The name must not be used by another security group for the VPC. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The resource group for this dedicated host group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, + // resulting in all traffic being denied. + Rules []SecurityGroupRulePrototypeIntf `json:"rules,omitempty"` - // The instance profiles usable by instances placed on this dedicated host group. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The zone this dedicated host group resides in. - Zone *ZoneReference `json:"zone" validate:"required"` +// NewCreateSecurityGroupOptions : Instantiate CreateSecurityGroupOptions +func (*VpcV1) NewCreateSecurityGroupOptions(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { + return &CreateSecurityGroupOptions{ + VPC: vpc, + } } -// Constants associated with the DedicatedHostGroup.Family property. -// The dedicated host profile family for hosts in this group. -const ( - DedicatedHostGroupFamilyBalancedConst = "balanced" - DedicatedHostGroupFamilyComputeConst = "compute" - DedicatedHostGroupFamilyMemoryConst = "memory" -) +// SetVPC : Allow user to set VPC +func (_options *CreateSecurityGroupOptions) SetVPC(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { + _options.VPC = vpc + return _options +} -// Constants associated with the DedicatedHostGroup.ResourceType property. -// The resource type. -const ( - DedicatedHostGroupResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) +// SetName : Allow user to set Name +func (_options *CreateSecurityGroupOptions) SetName(name string) *CreateSecurityGroupOptions { + _options.Name = core.StringPtr(name) + return _options +} -// UnmarshalDedicatedHostGroup unmarshals an instance of DedicatedHostGroup from the specified map of raw messages. -func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroup) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHostReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateSecurityGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSecurityGroupOptions { + _options.ResourceGroup = resourceGroup + return _options } -// DedicatedHostGroupCollection : DedicatedHostGroupCollection struct -type DedicatedHostGroupCollection struct { - // A link to the first page of resources. - First *DedicatedHostGroupCollectionFirst `json:"first" validate:"required"` +// SetRules : Allow user to set Rules +func (_options *CreateSecurityGroupOptions) SetRules(rules []SecurityGroupRulePrototypeIntf) *CreateSecurityGroupOptions { + _options.Rules = rules + return _options +} - // Collection of dedicated host groups. - Groups []DedicatedHostGroup `json:"groups" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateSecurityGroupOptions) SetHeaders(param map[string]string) *CreateSecurityGroupOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// CreateSecurityGroupRuleOptions : The CreateSecurityGroupRule options. +type CreateSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostGroupCollectionNext `json:"next,omitempty"` + // The properties of the security group rule to be created. + SecurityGroupRulePrototype SecurityGroupRulePrototypeIntf `json:"SecurityGroupRulePrototype" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostGroupCollection unmarshals an instance of DedicatedHostGroupCollection from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "groups", &obj.Groups, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewCreateSecurityGroupRuleOptions : Instantiate CreateSecurityGroupRuleOptions +func (*VpcV1) NewCreateSecurityGroupRuleOptions(securityGroupID string, securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { + return &CreateSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + SecurityGroupRulePrototype: securityGroupRulePrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options } -// DedicatedHostGroupCollectionFirst : A link to the first page of resources. -type DedicatedHostGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetSecurityGroupRulePrototype : Allow user to set SecurityGroupRulePrototype +func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupRulePrototype(securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { + _options.SecurityGroupRulePrototype = securityGroupRulePrototype + return _options } -// UnmarshalDedicatedHostGroupCollectionFirst unmarshals an instance of DedicatedHostGroupCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *CreateSecurityGroupRuleOptions { + options.Headers = param + return options } -// DedicatedHostGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// CreateSecurityGroupTargetBindingOptions : The CreateSecurityGroupTargetBinding options. +type CreateSecurityGroupTargetBindingOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // The security group target identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostGroupCollectionNext unmarshals an instance of DedicatedHostGroupCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewCreateSecurityGroupTargetBindingOptions : Instantiate CreateSecurityGroupTargetBindingOptions +func (*VpcV1) NewCreateSecurityGroupTargetBindingOptions(securityGroupID string, id string) *CreateSecurityGroupTargetBindingOptions { + return &CreateSecurityGroupTargetBindingOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. -// Models which "extend" this model: -// - DedicatedHostGroupIdentityByID -// - DedicatedHostGroupIdentityByCRN -// - DedicatedHostGroupIdentityByHref -type DedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *CreateSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupTargetBindingOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *CreateSecurityGroupTargetBindingOptions) SetID(id string) *CreateSecurityGroupTargetBindingOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*DedicatedHostGroupIdentity) isaDedicatedHostGroupIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *CreateSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *CreateSecurityGroupTargetBindingOptions { + options.Headers = param + return options } -type DedicatedHostGroupIdentityIntf interface { - isaDedicatedHostGroupIdentity() bool +// CreateShareMountTargetOptions : The CreateShareMountTarget options. +type CreateShareMountTargetOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` + + // The share mount target prototype object. + ShareMountTargetPrototype ShareMountTargetPrototypeIntf `json:"ShareMountTargetPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostGroupIdentity unmarshals an instance of DedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewCreateShareMountTargetOptions : Instantiate CreateShareMountTargetOptions +func (*VpcV1) NewCreateShareMountTargetOptions(shareID string, shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { + return &CreateShareMountTargetOptions{ + ShareID: core.StringPtr(shareID), + ShareMountTargetPrototype: shareMountTargetPrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostGroupPatch : DedicatedHostGroupPatch struct -type DedicatedHostGroupPatch struct { - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. - Name *string `json:"name,omitempty"` +// SetShareID : Allow user to set ShareID +func (_options *CreateShareMountTargetOptions) SetShareID(shareID string) *CreateShareMountTargetOptions { + _options.ShareID = core.StringPtr(shareID) + return _options } -// UnmarshalDedicatedHostGroupPatch unmarshals an instance of DedicatedHostGroupPatch from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetShareMountTargetPrototype : Allow user to set ShareMountTargetPrototype +func (_options *CreateShareMountTargetOptions) SetShareMountTargetPrototype(shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { + _options.ShareMountTargetPrototype = shareMountTargetPrototype + return _options } -// AsPatch returns a generic map representation of the DedicatedHostGroupPatch -func (dedicatedHostGroupPatch *DedicatedHostGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *CreateShareMountTargetOptions) SetHeaders(param map[string]string) *CreateShareMountTargetOptions { + options.Headers = param + return options } -// DedicatedHostGroupPrototypeDedicatedHostByZoneContext : DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct -type DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct { - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// CreateShareOptions : The CreateShare options. +type CreateShareOptions struct { + // The file share prototype object. + SharePrototype SharePrototypeIntf `json:"SharePrototype" validate:"required"` - // The resource group to use. If unspecified, the host's resource group is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext unmarshals an instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPrototypeDedicatedHostByZoneContext) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return +// NewCreateShareOptions : Instantiate CreateShareOptions +func (*VpcV1) NewCreateShareOptions(sharePrototype SharePrototypeIntf) *CreateShareOptions { + return &CreateShareOptions{ + SharePrototype: sharePrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostGroupReference : DedicatedHostGroupReference struct -type DedicatedHostGroupReference struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` +// SetSharePrototype : Allow user to set SharePrototype +func (_options *CreateShareOptions) SetSharePrototype(sharePrototype SharePrototypeIntf) *CreateShareOptions { + _options.SharePrototype = sharePrototype + return _options +} - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateShareOptions) SetHeaders(param map[string]string) *CreateShareOptions { + options.Headers = param + return options +} - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` +// CreateSnapshotCloneOptions : The CreateSnapshotClone options. +type CreateSnapshotCloneOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` + // The zone name. + ZoneName *string `json:"zone_name" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostGroupReference.ResourceType property. -// The resource type. -const ( - DedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -// UnmarshalDedicatedHostGroupReference unmarshals an instance of DedicatedHostGroupReference from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewCreateSnapshotCloneOptions : Instantiate CreateSnapshotCloneOptions +func (*VpcV1) NewCreateSnapshotCloneOptions(id string, zoneName string) *CreateSnapshotCloneOptions { + return &CreateSnapshotCloneOptions{ + ID: core.StringPtr(id), + ZoneName: core.StringPtr(zoneName), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type DedicatedHostGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *CreateSnapshotCloneOptions) SetID(id string) *CreateSnapshotCloneOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalDedicatedHostGroupReferenceDeleted unmarshals an instance of DedicatedHostGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetZoneName : Allow user to set ZoneName +func (_options *CreateSnapshotCloneOptions) SetZoneName(zoneName string) *CreateSnapshotCloneOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options } -// DedicatedHostNuma : The dedicated host NUMA configuration. -type DedicatedHostNuma struct { - // The total number of NUMA nodes for this dedicated host. - Count *int64 `json:"count" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateSnapshotCloneOptions) SetHeaders(param map[string]string) *CreateSnapshotCloneOptions { + options.Headers = param + return options +} - // The NUMA nodes for this dedicated host. - Nodes []DedicatedHostNumaNode `json:"nodes" validate:"required"` +// CreateSnapshotConsistencyGroupOptions : The CreateSnapshotConsistencyGroup options. +type CreateSnapshotConsistencyGroupOptions struct { + // The snapshot consistency group prototype object. + SnapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf `json:"SnapshotConsistencyGroupPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostNuma unmarshals an instance of DedicatedHostNuma from the specified map of raw messages. -func UnmarshalDedicatedHostNuma(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostNuma) - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalModel(m, "nodes", &obj.Nodes, UnmarshalDedicatedHostNumaNode) - if err != nil { - return +// NewCreateSnapshotConsistencyGroupOptions : Instantiate CreateSnapshotConsistencyGroupOptions +func (*VpcV1) NewCreateSnapshotConsistencyGroupOptions(snapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf) *CreateSnapshotConsistencyGroupOptions { + return &CreateSnapshotConsistencyGroupOptions{ + SnapshotConsistencyGroupPrototype: snapshotConsistencyGroupPrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostNumaNode : The dedicated host NUMA node configuration. -type DedicatedHostNumaNode struct { - // The available VCPU for this NUMA node. - AvailableVcpu *int64 `json:"available_vcpu" validate:"required"` +// SetSnapshotConsistencyGroupPrototype : Allow user to set SnapshotConsistencyGroupPrototype +func (_options *CreateSnapshotConsistencyGroupOptions) SetSnapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf) *CreateSnapshotConsistencyGroupOptions { + _options.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototype + return _options +} - // The total VCPU capacity for this NUMA node. - Vcpu *int64 `json:"vcpu" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *CreateSnapshotConsistencyGroupOptions { + options.Headers = param + return options } -// UnmarshalDedicatedHostNumaNode unmarshals an instance of DedicatedHostNumaNode from the specified map of raw messages. -func UnmarshalDedicatedHostNumaNode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostNumaNode) - err = core.UnmarshalPrimitive(m, "available_vcpu", &obj.AvailableVcpu) - if err != nil { - return +// CreateSnapshotOptions : The CreateSnapshot options. +type CreateSnapshotOptions struct { + // The snapshot prototype object. + SnapshotPrototype SnapshotPrototypeIntf `json:"SnapshotPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateSnapshotOptions : Instantiate CreateSnapshotOptions +func (*VpcV1) NewCreateSnapshotOptions(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { + return &CreateSnapshotOptions{ + SnapshotPrototype: snapshotPrototype, } - err = core.UnmarshalPrimitive(m, "vcpu", &obj.Vcpu) - if err != nil { - return +} + +// SetSnapshotPrototype : Allow user to set SnapshotPrototype +func (_options *CreateSnapshotOptions) SetSnapshotPrototype(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { + _options.SnapshotPrototype = snapshotPrototype + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateSnapshotOptions) SetHeaders(param map[string]string) *CreateSnapshotOptions { + options.Headers = param + return options +} + +// CreateSubnetOptions : The CreateSubnet options. +type CreateSubnetOptions struct { + // The subnet prototype object. + SubnetPrototype SubnetPrototypeIntf `json:"SubnetPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateSubnetOptions : Instantiate CreateSubnetOptions +func (*VpcV1) NewCreateSubnetOptions(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { + return &CreateSubnetOptions{ + SubnetPrototype: subnetPrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostPatch : DedicatedHostPatch struct -type DedicatedHostPatch struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// SetSubnetPrototype : Allow user to set SubnetPrototype +func (_options *CreateSubnetOptions) SetSubnetPrototype(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { + _options.SubnetPrototype = subnetPrototype + return _options +} - // The name for this dedicated host. The name must not be used by another dedicated host in the region. +// SetHeaders : Allow user to set Headers +func (options *CreateSubnetOptions) SetHeaders(param map[string]string) *CreateSubnetOptions { + options.Headers = param + return options +} + +// CreateSubnetReservedIPOptions : The CreateSubnetReservedIP options. +type CreateSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` + + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. Name *string `json:"name,omitempty"` + + // The target to bind this reserved IP to. The target must be in the same VPC. + // + // The following targets are supported: + // - An endpoint gateway not already bound to a reserved IP in the subnet's zone. + // - A virtual network interface. + // + // If unspecified, the reserved IP will be created unbound. + Target ReservedIPTargetPrototypeIntf `json:"target,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostPatch unmarshals an instance of DedicatedHostPatch from the specified map of raw messages. -func UnmarshalDedicatedHostPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPatch) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewCreateSubnetReservedIPOptions : Instantiate CreateSubnetReservedIPOptions +func (*VpcV1) NewCreateSubnetReservedIPOptions(subnetID string) *CreateSubnetReservedIPOptions { + return &CreateSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the DedicatedHostPatch -func (dedicatedHostPatch *DedicatedHostPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetSubnetID : Allow user to set SubnetID +func (_options *CreateSubnetReservedIPOptions) SetSubnetID(subnetID string) *CreateSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options } -// DedicatedHostProfile : DedicatedHostProfile struct -type DedicatedHostProfile struct { - // The product class this dedicated host profile belongs to. - Class *string `json:"class" validate:"required"` +// SetAddress : Allow user to set Address +func (_options *CreateSubnetReservedIPOptions) SetAddress(address string) *CreateSubnetReservedIPOptions { + _options.Address = core.StringPtr(address) + return _options +} - // Collection of the dedicated host profile's disks. - Disks []DedicatedHostProfileDisk `json:"disks" validate:"required"` +// SetAutoDelete : Allow user to set AutoDelete +func (_options *CreateSubnetReservedIPOptions) SetAutoDelete(autoDelete bool) *CreateSubnetReservedIPOptions { + _options.AutoDelete = core.BoolPtr(autoDelete) + return _options +} - // The product family this dedicated host profile belongs to - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateSubnetReservedIPOptions) SetName(name string) *CreateSubnetReservedIPOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The URL for this dedicated host. +// SetTarget : Allow user to set Target +func (_options *CreateSubnetReservedIPOptions) SetTarget(target ReservedIPTargetPrototypeIntf) *CreateSubnetReservedIPOptions { + _options.Target = target + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string) *CreateSubnetReservedIPOptions { + options.Headers = param + return options +} + +// CreateVPCRouteResponse : CreateVPCRouteResponse struct +type CreateVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. Href *string `json:"href" validate:"required"` - Memory DedicatedHostProfileMemoryIntf `json:"memory" validate:"required"` + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` - // The globally unique name for this dedicated host profile. + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. Name *string `json:"name" validate:"required"` - SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - // The status of the dedicated host profile: - // - `previous`: This dedicated host profile is an older revision, but remains provisionable - // and usable. - // - `current`: This profile is the latest revision. - // - // Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming - // conventions] - // (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how - // generations are defined within a dedicated host profile. + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user // // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The instance profiles usable by instances placed on dedicated hosts with this profile. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - VcpuArchitecture *DedicatedHostProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` + Origin *string `json:"origin,omitempty"` - VcpuCount DedicatedHostProfileVcpuIntf `json:"vcpu_count" validate:"required"` + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` - VcpuManufacturer *DedicatedHostProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` + // The zone the route applies to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the DedicatedHostProfile.Family property. -// The product family this dedicated host profile belongs to -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. +// Constants associated with the CreateVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - DedicatedHostProfileFamilyBalancedConst = "balanced" - DedicatedHostProfileFamilyComputeConst = "compute" - DedicatedHostProfileFamilyMemoryConst = "memory" + CreateVPCRouteResponseActionDelegateConst = "delegate" + CreateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + CreateVPCRouteResponseActionDeliverConst = "deliver" + CreateVPCRouteResponseActionDropConst = "drop" ) -// Constants associated with the DedicatedHostProfile.Status property. -// The status of the dedicated host profile: -// - `previous`: This dedicated host profile is an older revision, but remains provisionable -// and usable. -// - `current`: This profile is the latest revision. -// -// Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming -// conventions] -// (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how -// generations are defined within a dedicated host profile. +// Constants associated with the CreateVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. +const ( + CreateVPCRouteResponseLifecycleStateDeletingConst = "deleting" + CreateVPCRouteResponseLifecycleStateFailedConst = "failed" + CreateVPCRouteResponseLifecycleStatePendingConst = "pending" + CreateVPCRouteResponseLifecycleStateStableConst = "stable" + CreateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + CreateVPCRouteResponseLifecycleStateUpdatingConst = "updating" + CreateVPCRouteResponseLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the CreateVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user // // The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the // unexpected property value was encountered. const ( - DedicatedHostProfileStatusCurrentConst = "current" - DedicatedHostProfileStatusPreviousConst = "previous" + CreateVPCRouteResponseOriginServiceConst = "service" + CreateVPCRouteResponseOriginUserConst = "user" ) -// UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. -func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfile) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) +// UnmarshalCreateVPCRouteResponse unmarshals an instance of CreateVPCRouteResponse from the specified map of raw messages. +func UnmarshalCreateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CreateVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostProfileDisk) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) if err != nil { return } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalDedicatedHostProfileMemory) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "socket_count", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) if err != nil { return } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu) + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) if err != nil { return } - err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalDedicatedHostProfileVcpuManufacturer) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -34476,7277 +35343,7207 @@ func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interfac return } -// DedicatedHostProfileCollection : DedicatedHostProfileCollection struct -type DedicatedHostProfileCollection struct { - // A link to the first page of resources. - First *DedicatedHostProfileCollectionFirst `json:"first" validate:"required"` +// CreateVirtualNetworkInterfaceOptions : The CreateVirtualNetworkInterface options. +type CreateVirtualNetworkInterfaceOptions struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. Must be `false` if the virtual network interface is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostProfileCollectionNext `json:"next,omitempty"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // Collection of dedicated host profiles. - Profiles []DedicatedHostProfile `json:"profiles" validate:"required"` + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` + + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostProfileCollection unmarshals an instance of DedicatedHostProfileCollection from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalDedicatedHostProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// NewCreateVirtualNetworkInterfaceOptions : Instantiate CreateVirtualNetworkInterfaceOptions +func (*VpcV1) NewCreateVirtualNetworkInterfaceOptions() *CreateVirtualNetworkInterfaceOptions { + return &CreateVirtualNetworkInterfaceOptions{} } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing +func (_options *CreateVirtualNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateVirtualNetworkInterfaceOptions { + _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) + return _options } -// DedicatedHostProfileCollectionFirst : A link to the first page of resources. -type DedicatedHostProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetAutoDelete : Allow user to set AutoDelete +func (_options *CreateVirtualNetworkInterfaceOptions) SetAutoDelete(autoDelete bool) *CreateVirtualNetworkInterfaceOptions { + _options.AutoDelete = core.BoolPtr(autoDelete) + return _options } -// UnmarshalDedicatedHostProfileCollectionFirst unmarshals an instance of DedicatedHostProfileCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetEnableInfrastructureNat : Allow user to set EnableInfrastructureNat +func (_options *CreateVirtualNetworkInterfaceOptions) SetEnableInfrastructureNat(enableInfrastructureNat bool) *CreateVirtualNetworkInterfaceOptions { + _options.EnableInfrastructureNat = core.BoolPtr(enableInfrastructureNat) + return _options } -// DedicatedHostProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetIps : Allow user to set Ips +func (_options *CreateVirtualNetworkInterfaceOptions) SetIps(ips []VirtualNetworkInterfaceIPPrototypeIntf) *CreateVirtualNetworkInterfaceOptions { + _options.Ips = ips + return _options } -// UnmarshalDedicatedHostProfileCollectionNext unmarshals an instance of DedicatedHostProfileCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetName : Allow user to set Name +func (_options *CreateVirtualNetworkInterfaceOptions) SetName(name string) *CreateVirtualNetworkInterfaceOptions { + _options.Name = core.StringPtr(name) + return _options } -// DedicatedHostProfileDisk : Disks provided by this profile. -type DedicatedHostProfileDisk struct { - InterfaceType *DedicatedHostProfileDiskInterface `json:"interface_type" validate:"required"` - - // The number of disks of this type for a dedicated host with this profile. - Quantity *DedicatedHostProfileDiskQuantity `json:"quantity" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *DedicatedHostProfileDiskSize `json:"size" validate:"required"` +// SetPrimaryIP : Allow user to set PrimaryIP +func (_options *CreateVirtualNetworkInterfaceOptions) SetPrimaryIP(primaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf) *CreateVirtualNetworkInterfaceOptions { + _options.PrimaryIP = primaryIP + return _options +} - SupportedInstanceInterfaceTypes *DedicatedHostProfileDiskSupportedInterfaces `json:"supported_instance_interface_types" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateVirtualNetworkInterfaceOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVirtualNetworkInterfaceOptions { + _options.ResourceGroup = resourceGroup + return _options } -// UnmarshalDedicatedHostProfileDisk unmarshals an instance of DedicatedHostProfileDisk from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDisk) - err = core.UnmarshalModel(m, "interface_type", &obj.InterfaceType, UnmarshalDedicatedHostProfileDiskInterface) - if err != nil { - return - } - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalDedicatedHostProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalDedicatedHostProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes, UnmarshalDedicatedHostProfileDiskSupportedInterfaces) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateVirtualNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateVirtualNetworkInterfaceOptions { + _options.SecurityGroups = securityGroups + return _options } -// DedicatedHostProfileDiskInterface : DedicatedHostProfileDiskInterface struct -type DedicatedHostProfileDiskInterface struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetSubnet : Allow user to set Subnet +func (_options *CreateVirtualNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateVirtualNetworkInterfaceOptions { + _options.Subnet = subnet + return _options +} - // The interface of the disk for a dedicated host with this profile - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Value *string `json:"value" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateVirtualNetworkInterfaceOptions { + options.Headers = param + return options } -// Constants associated with the DedicatedHostProfileDiskInterface.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskInterfaceTypeFixedConst = "fixed" -) +// CreateVolumeOptions : The CreateVolume options. +type CreateVolumeOptions struct { + // The volume prototype object. + VolumePrototype VolumePrototypeIntf `json:"VolumePrototype" validate:"required"` -// Constants associated with the DedicatedHostProfileDiskInterface.Value property. -// The interface of the disk for a dedicated host with this profile -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileDiskInterfaceValueNvmeConst = "nvme" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalDedicatedHostProfileDiskInterface unmarshals an instance of DedicatedHostProfileDiskInterface from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskInterface) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return +// NewCreateVolumeOptions : Instantiate CreateVolumeOptions +func (*VpcV1) NewCreateVolumeOptions(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { + return &CreateVolumeOptions{ + VolumePrototype: volumePrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostProfileDiskQuantity : The number of disks of this type for a dedicated host with this profile. -type DedicatedHostProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetVolumePrototype : Allow user to set VolumePrototype +func (_options *CreateVolumeOptions) SetVolumePrototype(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { + _options.VolumePrototype = volumePrototype + return _options +} - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVolumeOptions) SetHeaders(param map[string]string) *CreateVolumeOptions { + options.Headers = param + return options } -// Constants associated with the DedicatedHostProfileDiskQuantity.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskQuantityTypeFixedConst = "fixed" -) +// CreateVPCAddressPrefixOptions : The CreateVPCAddressPrefix options. +type CreateVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` -// UnmarshalDedicatedHostProfileDiskQuantity unmarshals an instance of DedicatedHostProfileDiskQuantity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The IPv4 range of the address prefix, expressed in CIDR format. The range must not overlap with any existing address + // prefixes in the VPC or any of the following reserved address ranges: + // + // - `127.0.0.0/8` (IPv4 loopback addresses) + // - `161.26.0.0/16` (IBM services) + // - `166.8.0.0/14` (Cloud Service Endpoints) + // - `169.254.0.0/16` (IPv4 link-local addresses) + // - `224.0.0.0/4` (IPv4 multicast addresses) + // + // The prefix length of the address prefix's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). + CIDR *string `json:"cidr" validate:"required"` -// DedicatedHostProfileDiskSize : The size of the disk in GB (gigabytes). -type DedicatedHostProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The zone this address prefix will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The size of the disk in GB (gigabytes). - Value *int64 `json:"value" validate:"required"` -} + // Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not + // have a default address prefix for this zone. + IsDefault *bool `json:"is_default,omitempty"` -// Constants associated with the DedicatedHostProfileDiskSize.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSizeTypeFixedConst = "fixed" -) + // The name for this address prefix. The name must not be used by another address prefix for the VPC. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// UnmarshalDedicatedHostProfileDiskSize unmarshals an instance of DedicatedHostProfileDiskSize from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateVPCAddressPrefixOptions : Instantiate CreateVPCAddressPrefixOptions +func (*VpcV1) NewCreateVPCAddressPrefixOptions(vpcID string, cidr string, zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { + return &CreateVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + CIDR: core.StringPtr(cidr), + Zone: zone, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostProfileDiskSupportedInterfaces : DedicatedHostProfileDiskSupportedInterfaces struct -type DedicatedHostProfileDiskSupportedInterfaces struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCAddressPrefixOptions) SetVPCID(vpcID string) *CreateVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The instance disk interfaces supported for a dedicated host with this profile. - Value []string `json:"value" validate:"required"` +// SetCIDR : Allow user to set CIDR +func (_options *CreateVPCAddressPrefixOptions) SetCIDR(cidr string) *CreateVPCAddressPrefixOptions { + _options.CIDR = core.StringPtr(cidr) + return _options } -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSupportedInterfacesTypeFixedConst = "fixed" -) +// SetZone : Allow user to set Zone +func (_options *CreateVPCAddressPrefixOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { + _options.Zone = zone + return _options +} -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Value property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileDiskSupportedInterfacesValueNvmeConst = "nvme" - DedicatedHostProfileDiskSupportedInterfacesValueVirtioBlkConst = "virtio_blk" -) +// SetIsDefault : Allow user to set IsDefault +func (_options *CreateVPCAddressPrefixOptions) SetIsDefault(isDefault bool) *CreateVPCAddressPrefixOptions { + _options.IsDefault = core.BoolPtr(isDefault) + return _options +} -// UnmarshalDedicatedHostProfileDiskSupportedInterfaces unmarshals an instance of DedicatedHostProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetName : Allow user to set Name +func (_options *CreateVPCAddressPrefixOptions) SetName(name string) *CreateVPCAddressPrefixOptions { + _options.Name = core.StringPtr(name) + return _options } -// DedicatedHostProfileIdentity : Identifies a dedicated host profile by a unique property. -// Models which "extend" this model: -// - DedicatedHostProfileIdentityByName -// - DedicatedHostProfileIdentityByHref -type DedicatedHostProfileIdentity struct { - // The globally unique name for this dedicated host profile. +// SetHeaders : Allow user to set Headers +func (options *CreateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *CreateVPCAddressPrefixOptions { + options.Headers = param + return options +} + +// CreateVPCDnsResolutionBindingOptions : The CreateVPCDnsResolutionBinding options. +type CreateVPCDnsResolutionBindingOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // Another VPC to bind this VPC to for DNS resolution. The VPC must have + // `dns.enable_hub` set to `true`, and may be in a different account (subject to + // IAM policies). + // + // Additionally, the VPC specified in the URL (this VPC) must have `dns.enable_hub` + // set to `false` and a `dns.resolution_binding_count` of zero. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. + // If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The URL for this dedicated host profile. - Href *string `json:"href,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*DedicatedHostProfileIdentity) isaDedicatedHostProfileIdentity() bool { - return true +// NewCreateVPCDnsResolutionBindingOptions : Instantiate CreateVPCDnsResolutionBindingOptions +func (*VpcV1) NewCreateVPCDnsResolutionBindingOptions(vpcID string, vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { + return &CreateVPCDnsResolutionBindingOptions{ + VPCID: core.StringPtr(vpcID), + VPC: vpc, + } } -type DedicatedHostProfileIdentityIntf interface { - isaDedicatedHostProfileIdentity() bool +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *CreateVPCDnsResolutionBindingOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// UnmarshalDedicatedHostProfileIdentity unmarshals an instance of DedicatedHostProfileIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetVPC : Allow user to set VPC +func (_options *CreateVPCDnsResolutionBindingOptions) SetVPC(vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { + _options.VPC = vpc + return _options } -// DedicatedHostProfileMemory : DedicatedHostProfileMemory struct -// Models which "extend" this model: -// - DedicatedHostProfileMemoryFixed -// - DedicatedHostProfileMemoryRange -// - DedicatedHostProfileMemoryEnum -// - DedicatedHostProfileMemoryDependent -type DedicatedHostProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetName : Allow user to set Name +func (_options *CreateVPCDnsResolutionBindingOptions) SetName(name string) *CreateVPCDnsResolutionBindingOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *CreateVPCDnsResolutionBindingOptions { + options.Headers = param + return options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// CreateVPCOptions : The CreateVPC options. +type CreateVPCOptions struct { + // Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) + // will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default + // address prefixes. + // + // Since address prefixes are managed identically regardless of whether they were automatically created, the value is + // not preserved as a VPC property. + AddressPrefixManagement *string `json:"address_prefix_management,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // Indicates whether this VPC will be connected to Classic Infrastructure. If true, this VPC's resources will have + // private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be + // connected in this way. This value is set at creation and subsequently immutable. + ClassicAccess *bool `json:"classic_access,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The DNS configuration for this VPC. + // + // If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint + // gateways within this VPC, and hosts on the internet. + Dns *VpcdnsPrototype `json:"dns,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The name for this VPC. The name must not be used by another VPC in the region. If unspecified, the name will be a + // hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostProfileMemory.Type property. -// The type for this profile field. +// Constants associated with the CreateVPCOptions.AddressPrefixManagement property. +// Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) +// will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default +// address prefixes. +// +// Since address prefixes are managed identically regardless of whether they were automatically created, the value is +// not preserved as a VPC property. const ( - DedicatedHostProfileMemoryTypeFixedConst = "fixed" + CreateVPCOptionsAddressPrefixManagementAutoConst = "auto" + CreateVPCOptionsAddressPrefixManagementManualConst = "manual" ) -func (*DedicatedHostProfileMemory) isaDedicatedHostProfileMemory() bool { - return true +// NewCreateVPCOptions : Instantiate CreateVPCOptions +func (*VpcV1) NewCreateVPCOptions() *CreateVPCOptions { + return &CreateVPCOptions{} } -type DedicatedHostProfileMemoryIntf interface { - isaDedicatedHostProfileMemory() bool +// SetAddressPrefixManagement : Allow user to set AddressPrefixManagement +func (_options *CreateVPCOptions) SetAddressPrefixManagement(addressPrefixManagement string) *CreateVPCOptions { + _options.AddressPrefixManagement = core.StringPtr(addressPrefixManagement) + return _options } -// UnmarshalDedicatedHostProfileMemory unmarshals an instance of DedicatedHostProfileMemory from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetClassicAccess : Allow user to set ClassicAccess +func (_options *CreateVPCOptions) SetClassicAccess(classicAccess bool) *CreateVPCOptions { + _options.ClassicAccess = core.BoolPtr(classicAccess) + return _options } -// DedicatedHostProfileReference : DedicatedHostProfileReference struct -type DedicatedHostProfileReference struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` +// SetDns : Allow user to set Dns +func (_options *CreateVPCOptions) SetDns(dns *VpcdnsPrototype) *CreateVPCOptions { + _options.Dns = dns + return _options +} - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateVPCOptions) SetName(name string) *CreateVPCOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalDedicatedHostProfileReference unmarshals an instance of DedicatedHostProfileReference from the specified map of raw messages. -func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateVPCOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPCOptions { + _options.ResourceGroup = resourceGroup + return _options } -// DedicatedHostProfileSocket : DedicatedHostProfileSocket struct -// Models which "extend" this model: -// - DedicatedHostProfileSocketFixed -// - DedicatedHostProfileSocketRange -// - DedicatedHostProfileSocketEnum -// - DedicatedHostProfileSocketDependent -type DedicatedHostProfileSocket struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCOptions) SetHeaders(param map[string]string) *CreateVPCOptions { + options.Headers = param + return options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// CreateVPCRouteOptions : The CreateVPCRoute options. +type CreateVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The destination CIDR of the route. The host identifier in the CIDR must be zero. + // + // At most two routes per `zone` in a table can have the same `destination` and + // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The zone to apply the route to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + // + // All routes in a routing table with the same `destination` and `zone` must have the same + // `advertise` value. + Advertise *bool `json:"advertise,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` + // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For other + // `action` values, it must be omitted or specified as `0.0.0.0`. + // + // At most two routes per `zone` in a table can have the same `destination` and `priority`, + // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. + NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostProfileSocket.Type property. -// The type for this profile field. +// Constants associated with the CreateVPCRouteOptions.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - DedicatedHostProfileSocketTypeFixedConst = "fixed" + CreateVPCRouteOptionsActionDelegateConst = "delegate" + CreateVPCRouteOptionsActionDelegateVPCConst = "delegate_vpc" + CreateVPCRouteOptionsActionDeliverConst = "deliver" + CreateVPCRouteOptionsActionDropConst = "drop" ) -func (*DedicatedHostProfileSocket) isaDedicatedHostProfileSocket() bool { - return true +// NewCreateVPCRouteOptions : Instantiate CreateVPCRouteOptions +func (*VpcV1) NewCreateVPCRouteOptions(vpcID string, destination string, zone ZoneIdentityIntf) *CreateVPCRouteOptions { + return &CreateVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + Destination: core.StringPtr(destination), + Zone: zone, + } } -type DedicatedHostProfileSocketIntf interface { - isaDedicatedHostProfileSocket() bool +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRouteOptions) SetVPCID(vpcID string) *CreateVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// UnmarshalDedicatedHostProfileSocket unmarshals an instance of DedicatedHostProfileSocket from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocket(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocket) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetDestination : Allow user to set Destination +func (_options *CreateVPCRouteOptions) SetDestination(destination string) *CreateVPCRouteOptions { + _options.Destination = core.StringPtr(destination) + return _options } -// DedicatedHostProfileVcpu : DedicatedHostProfileVcpu struct -// Models which "extend" this model: -// - DedicatedHostProfileVcpuFixed -// - DedicatedHostProfileVcpuRange -// - DedicatedHostProfileVcpuEnum -// - DedicatedHostProfileVcpuDependent -type DedicatedHostProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetZone : Allow user to set Zone +func (_options *CreateVPCRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRouteOptions { + _options.Zone = zone + return _options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetAction : Allow user to set Action +func (_options *CreateVPCRouteOptions) SetAction(action string) *CreateVPCRouteOptions { + _options.Action = core.StringPtr(action) + return _options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// SetAdvertise : Allow user to set Advertise +func (_options *CreateVPCRouteOptions) SetAdvertise(advertise bool) *CreateVPCRouteOptions { + _options.Advertise = core.BoolPtr(advertise) + return _options +} - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// SetName : Allow user to set Name +func (_options *CreateVPCRouteOptions) SetName(name string) *CreateVPCRouteOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// SetNextHop : Allow user to set NextHop +func (_options *CreateVPCRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRouteOptions { + _options.NextHop = nextHop + return _options +} - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` +// SetPriority : Allow user to set Priority +func (_options *CreateVPCRouteOptions) SetPriority(priority int64) *CreateVPCRouteOptions { + _options.Priority = core.Int64Ptr(priority) + return _options +} - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRouteOptions) SetHeaders(param map[string]string) *CreateVPCRouteOptions { + options.Headers = param + return options } -// Constants associated with the DedicatedHostProfileVcpu.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuTypeFixedConst = "fixed" -) +// CreateVPCRoutingTableOptions : The CreateVPCRoutingTable options. +type CreateVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` -func (*DedicatedHostProfileVcpu) isaDedicatedHostProfileVcpu() bool { - return true -} + // The filters specifying the resources that may create routes in this routing table. + // + // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter + // support is expected to expand in the future. + AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` -type DedicatedHostProfileVcpuIntf interface { - isaDedicatedHostProfileVcpu() bool -} + // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these + // sources. + AdvertiseRoutesTo []string `json:"advertise_routes_to,omitempty"` -// UnmarshalDedicatedHostProfileVcpu unmarshals an instance of DedicatedHostProfileVcpu from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this routing table. The name must not be used by another routing table in the VPC. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// DedicatedHostProfileVcpuArchitecture : DedicatedHostProfileVcpuArchitecture struct -type DedicatedHostProfileVcpuArchitecture struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // If set to `true`, this routing table will be used to route traffic that originates from [Direct + // Link](https://cloud.ibm.com/docs/dl) to this VPC. The VPC must not already have a routing table with this property + // set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + // + // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled + // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing + // table. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - // The VCPU architecture for a dedicated host with this profile. - Value *string `json:"value" validate:"required"` -} + // If set to `true`, this routing table will be used to route traffic that originates from the internet. For this to + // succeed, the VPC must not already have a routing table with this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with two exceptions: + // - Traffic destined for IP addresses associated with public gateways will not be + // subject to routes in this routing table. + // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is + // an IP address in a subnet in the route's `zone` that is able to accept traffic. + // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` -// Constants associated with the DedicatedHostProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuArchitectureTypeFixedConst = "fixed" -) + // If set to `true`, this routing table will be used to route traffic that originates from [Transit + // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. The VPC must not already have a routing table with + // this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` -// UnmarshalDedicatedHostProfileVcpuArchitecture unmarshals an instance of DedicatedHostProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in + // this VPC. The VPC must not already have a routing table with this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` -// DedicatedHostProfileVcpuManufacturer : DedicatedHostProfileVcpuManufacturer struct -type DedicatedHostProfileVcpuManufacturer struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created + // with no routes. + Routes []RoutePrototype `json:"routes,omitempty"` - // The VCPU manufacturer for a dedicated host with this profile. - Value *string `json:"value" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostProfileVcpuManufacturer.Type property. -// The type for this profile field. +// Constants associated with the CreateVPCRoutingTableOptions.AdvertiseRoutesTo property. +// An ingress source that routes can be advertised to: +// +// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) +// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). const ( - DedicatedHostProfileVcpuManufacturerTypeFixedConst = "fixed" + CreateVPCRoutingTableOptionsAdvertiseRoutesToDirectLinkConst = "direct_link" + CreateVPCRoutingTableOptionsAdvertiseRoutesToTransitGatewayConst = "transit_gateway" ) -// UnmarshalDedicatedHostProfileVcpuManufacturer unmarshals an instance of DedicatedHostProfileVcpuManufacturer from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuManufacturer) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return +// NewCreateVPCRoutingTableOptions : Instantiate CreateVPCRoutingTableOptions +func (*VpcV1) NewCreateVPCRoutingTableOptions(vpcID string) *CreateVPCRoutingTableOptions { + return &CreateVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostPrototype : DedicatedHostPrototype struct -// Models which "extend" this model: -// - DedicatedHostPrototypeDedicatedHostByGroup -// - DedicatedHostPrototypeDedicatedHostByZone -type DedicatedHostPrototype struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRoutingTableOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// SetAcceptRoutesFrom : Allow user to set AcceptRoutesFrom +func (_options *CreateVPCRoutingTableOptions) SetAcceptRoutesFrom(acceptRoutesFrom []ResourceFilter) *CreateVPCRoutingTableOptions { + _options.AcceptRoutesFrom = acceptRoutesFrom + return _options +} - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this - // dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` +// SetAdvertiseRoutesTo : Allow user to set AdvertiseRoutesTo +func (_options *CreateVPCRoutingTableOptions) SetAdvertiseRoutesTo(advertiseRoutesTo []string) *CreateVPCRoutingTableOptions { + _options.AdvertiseRoutesTo = advertiseRoutesTo + return _options +} - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// SetName : Allow user to set Name +func (_options *CreateVPCRoutingTableOptions) SetName(name string) *CreateVPCRoutingTableOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The dedicated host group for this dedicated host. - Group DedicatedHostGroupIdentityIntf `json:"group,omitempty"` +// SetRouteDirectLinkIngress : Allow user to set RouteDirectLinkIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteDirectLinkIngress(routeDirectLinkIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteDirectLinkIngress = core.BoolPtr(routeDirectLinkIngress) + return _options +} - // The zone this dedicated host will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` +// SetRouteInternetIngress : Allow user to set RouteInternetIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteInternetIngress(routeInternetIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteInternetIngress = core.BoolPtr(routeInternetIngress) + return _options } -func (*DedicatedHostPrototype) isaDedicatedHostPrototype() bool { - return true +// SetRouteTransitGatewayIngress : Allow user to set RouteTransitGatewayIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteTransitGatewayIngress(routeTransitGatewayIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteTransitGatewayIngress = core.BoolPtr(routeTransitGatewayIngress) + return _options } -type DedicatedHostPrototypeIntf interface { - isaDedicatedHostPrototype() bool +// SetRouteVPCZoneIngress : Allow user to set RouteVPCZoneIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteVPCZoneIngress(routeVPCZoneIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteVPCZoneIngress = core.BoolPtr(routeVPCZoneIngress) + return _options } -// UnmarshalDedicatedHostPrototype unmarshals an instance of DedicatedHostPrototype from the specified map of raw messages. -func UnmarshalDedicatedHostPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototype) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetRoutes : Allow user to set Routes +func (_options *CreateVPCRoutingTableOptions) SetRoutes(routes []RoutePrototype) *CreateVPCRoutingTableOptions { + _options.Routes = routes + return _options } -// DedicatedHostReference : DedicatedHostReference struct -type DedicatedHostReference struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRoutingTableOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableOptions { + options.Headers = param + return options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` +// CreateVPCRoutingTableRouteOptions : The CreateVPCRoutingTableRoute options. +type CreateVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` + // The destination CIDR of the route. The host identifier in the CIDR must be zero. + // + // At most two routes per `zone` in a table can have the same `destination` and + // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. - Name *string `json:"name" validate:"required"` + // The zone to apply the route to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` + + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + // + // All routes in a routing table with the same `destination` and `zone` must have the same + // `advertise` value. + Advertise *bool `json:"advertise,omitempty"` + + // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` + // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For other + // `action` values, it must be omitted or specified as `0.0.0.0`. + // + // At most two routes per `zone` in a table can have the same `destination` and `priority`, + // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. + NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostReference.ResourceType property. -// The resource type. +// Constants associated with the CreateVPCRoutingTableRouteOptions.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - DedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" + CreateVPCRoutingTableRouteOptionsActionDelegateConst = "delegate" + CreateVPCRoutingTableRouteOptionsActionDelegateVPCConst = "delegate_vpc" + CreateVPCRoutingTableRouteOptionsActionDeliverConst = "deliver" + CreateVPCRoutingTableRouteOptionsActionDropConst = "drop" ) -// UnmarshalDedicatedHostReference unmarshals an instance of DedicatedHostReference from the specified map of raw messages. -func UnmarshalDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewCreateVPCRoutingTableRouteOptions : Instantiate CreateVPCRoutingTableRouteOptions +func (*VpcV1) NewCreateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, destination string, zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { + return &CreateVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + Destination: core.StringPtr(destination), + Zone: zone, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type DedicatedHostReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// UnmarshalDedicatedHostReferenceDeleted unmarshals an instance of DedicatedHostReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *CreateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *CreateVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options } -// DefaultNetworkACL : DefaultNetworkACL struct -type DefaultNetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` - - // The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words - // at creation, but may be changed. - Name *string `json:"name" validate:"required"` - - // The resource group for the default network ACL for a VPC. Set to the VPC's - // resource group at creation. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The ordered rules for the default network ACL for a VPC. Defaults to two rules which allow all inbound and outbound - // traffic, respectively. Rules for the default network ACL may be changed, added, or removed. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The VPC this network ACL resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetDestination : Allow user to set Destination +func (_options *CreateVPCRoutingTableRouteOptions) SetDestination(destination string) *CreateVPCRoutingTableRouteOptions { + _options.Destination = core.StringPtr(destination) + return _options } -// UnmarshalDefaultNetworkACL unmarshals an instance of DefaultNetworkACL from the specified map of raw messages. -func UnmarshalDefaultNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultNetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetZone : Allow user to set Zone +func (_options *CreateVPCRoutingTableRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { + _options.Zone = zone + return _options } -// DefaultRoutingTable : DefaultRoutingTable struct -type DefaultRoutingTable struct { - // The filters specifying the resources that may create routes in this routing table. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this routing table. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` - - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected - // words at creation, but may be changed. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from the internet. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` - - // The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, - // changed, or removed with a subsequent request. - Routes []RouteReference `json:"routes" validate:"required"` - - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` +// SetAction : Allow user to set Action +func (_options *CreateVPCRoutingTableRouteOptions) SetAction(action string) *CreateVPCRoutingTableRouteOptions { + _options.Action = core.StringPtr(action) + return _options } -// Constants associated with the DefaultRoutingTable.LifecycleState property. -// The lifecycle state of the routing table. -const ( - DefaultRoutingTableLifecycleStateDeletingConst = "deleting" - DefaultRoutingTableLifecycleStateFailedConst = "failed" - DefaultRoutingTableLifecycleStatePendingConst = "pending" - DefaultRoutingTableLifecycleStateStableConst = "stable" - DefaultRoutingTableLifecycleStateSuspendedConst = "suspended" - DefaultRoutingTableLifecycleStateUpdatingConst = "updating" - DefaultRoutingTableLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DefaultRoutingTable.ResourceType property. -// The resource type. -const ( - DefaultRoutingTableResourceTypeRoutingTableConst = "routing_table" -) - -// UnmarshalDefaultRoutingTable unmarshals an instance of DefaultRoutingTable from the specified map of raw messages. -func UnmarshalDefaultRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultRoutingTable) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetAdvertise : Allow user to set Advertise +func (_options *CreateVPCRoutingTableRouteOptions) SetAdvertise(advertise bool) *CreateVPCRoutingTableRouteOptions { + _options.Advertise = core.BoolPtr(advertise) + return _options } -// DefaultSecurityGroup : DefaultSecurityGroup struct -type DefaultSecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name for the default security group for a VPC. The name will be a hyphenated list of randomly-selected words at - // creation, but may changed. - Name *string `json:"name" validate:"required"` - - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The rules for the default security group for a VPC. Defaults to allowing all outbound traffic, and allowing all - // inbound traffic from other interfaces in the VPC's default security group. Rules for the default security group may - // be changed, added or removed. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateVPCRoutingTableRouteOptions) SetName(name string) *CreateVPCRoutingTableRouteOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` +// SetNextHop : Allow user to set NextHop +func (_options *CreateVPCRoutingTableRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRoutingTableRouteOptions { + _options.NextHop = nextHop + return _options +} - // The VPC this security group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetPriority : Allow user to set Priority +func (_options *CreateVPCRoutingTableRouteOptions) SetPriority(priority int64) *CreateVPCRoutingTableRouteOptions { + _options.Priority = core.Int64Ptr(priority) + return _options } -// UnmarshalDefaultSecurityGroup unmarshals an instance of DefaultSecurityGroup from the specified map of raw messages. -func UnmarshalDefaultSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultSecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableRouteOptions { + options.Headers = param + return options } -// DeleteBackupPolicyOptions : The DeleteBackupPolicy options. -type DeleteBackupPolicyOptions struct { - // The backup policy identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateVPNGatewayConnectionOptions : The CreateVPNGatewayConnection options. +type CreateVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` + // The VPN gateway connection prototype object. + VPNGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf `json:"VPNGatewayConnectionPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteBackupPolicyOptions : Instantiate DeleteBackupPolicyOptions -func (*VpcV1) NewDeleteBackupPolicyOptions(id string) *DeleteBackupPolicyOptions { - return &DeleteBackupPolicyOptions{ - ID: core.StringPtr(id), +// NewCreateVPNGatewayConnectionOptions : Instantiate CreateVPNGatewayConnectionOptions +func (*VpcV1) NewCreateVPNGatewayConnectionOptions(vpnGatewayID string, vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { + return &CreateVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + VPNGatewayConnectionPrototype: vpnGatewayConnectionPrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteBackupPolicyOptions) SetID(id string) *DeleteBackupPolicyOptions { - _options.ID = core.StringPtr(id) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *CreateVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteBackupPolicyOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) +// SetVPNGatewayConnectionPrototype : Allow user to set VPNGatewayConnectionPrototype +func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { + _options.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteBackupPolicyOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyOptions { +func (options *CreateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *CreateVPNGatewayConnectionOptions { options.Headers = param return options } -// DeleteBackupPolicyPlanOptions : The DeleteBackupPolicyPlan options. -type DeleteBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` +// CreateVPNGatewayOptions : The CreateVPNGateway options. +type CreateVPNGatewayOptions struct { + // The VPN gateway prototype object. + VPNGatewayPrototype VPNGatewayPrototypeIntf `json:"VPNGatewayPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteBackupPolicyPlanOptions : Instantiate DeleteBackupPolicyPlanOptions -func (*VpcV1) NewDeleteBackupPolicyPlanOptions(backupPolicyID string, id string) *DeleteBackupPolicyPlanOptions { - return &DeleteBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), +// NewCreateVPNGatewayOptions : Instantiate CreateVPNGatewayOptions +func (*VpcV1) NewCreateVPNGatewayOptions(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { + return &CreateVPNGatewayOptions{ + VPNGatewayPrototype: vpnGatewayPrototype, } } -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *DeleteBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *DeleteBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteBackupPolicyPlanOptions) SetID(id string) *DeleteBackupPolicyPlanOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyPlanOptions { - _options.IfMatch = core.StringPtr(ifMatch) +// SetVPNGatewayPrototype : Allow user to set VPNGatewayPrototype +func (_options *CreateVPNGatewayOptions) SetVPNGatewayPrototype(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { + _options.VPNGatewayPrototype = vpnGatewayPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteBackupPolicyPlanOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyPlanOptions { +func (options *CreateVPNGatewayOptions) SetHeaders(param map[string]string) *CreateVPNGatewayOptions { options.Headers = param return options } -// DeleteBareMetalServerNetworkInterfaceOptions : The DeleteBareMetalServerNetworkInterface options. -type DeleteBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` +// CreateVPNServerOptions : The CreateVPNServer options. +type CreateVPNServerOptions struct { + // The certificate instance for this VPN server. + Certificate CertificateInstanceIdentityIntf `json:"certificate" validate:"required"` - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` + // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified + // methods. + ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication" validate:"required"` + + // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address + // prefixes in the VPC or any of the following reserved address ranges: + // - `127.0.0.0/8` (IPv4 loopback addresses) + // - `161.26.0.0/16` (IBM services) + // - `166.8.0.0/14` (Cloud Service Endpoints) + // - `169.254.0.0/16` (IPv4 link-local addresses) + // - `224.0.0.0/4` (IPv4 multicast addresses) + // + // The prefix length of the client IP address pool's CIDR must be between + // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses + // that are required to enable the maximum number of concurrent connections is recommended. + ClientIPPool *string `json:"client_ip_pool" validate:"required"` + + // The subnets to provision this VPN server in. Use subnets in different zones for high availability. + Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` + + // The DNS server addresses that will be provided to VPN clients connected to this VPN server. + ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` + + // The seconds a VPN client can be idle before this VPN server will disconnect it. Specify `0` to prevent the server + // from disconnecting idle clients. + ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` + + // Indicates whether the split tunneling is enabled on this VPN server. + EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` + + // The name for this VPN server. The name must not be used by another VPN server in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The port number to use for this VPN server. + Port *int64 `json:"port,omitempty"` + + // The transport protocol to use for this VPN server. + Protocol *string `json:"protocol,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The security groups to use for this VPN server. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteBareMetalServerNetworkInterfaceOptions : Instantiate DeleteBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewDeleteBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkInterfaceOptions { - return &DeleteBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), +// Constants associated with the CreateVPNServerOptions.Protocol property. +// The transport protocol to use for this VPN server. +const ( + CreateVPNServerOptionsProtocolTCPConst = "tcp" + CreateVPNServerOptionsProtocolUDPConst = "udp" +) + +// NewCreateVPNServerOptions : Instantiate CreateVPNServerOptions +func (*VpcV1) NewCreateVPNServerOptions(certificate CertificateInstanceIdentityIntf, clientAuthentication []VPNServerAuthenticationPrototypeIntf, clientIPPool string, subnets []SubnetIdentityIntf) *CreateVPNServerOptions { + return &CreateVPNServerOptions{ + Certificate: certificate, + ClientAuthentication: clientAuthentication, + ClientIPPool: core.StringPtr(clientIPPool), + Subnets: subnets, } } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) +// SetCertificate : Allow user to set Certificate +func (_options *CreateVPNServerOptions) SetCertificate(certificate CertificateInstanceIdentityIntf) *CreateVPNServerOptions { + _options.Certificate = certificate return _options } -// SetID : Allow user to set ID -func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetID(id string) *DeleteBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) +// SetClientAuthentication : Allow user to set ClientAuthentication +func (_options *CreateVPNServerOptions) SetClientAuthentication(clientAuthentication []VPNServerAuthenticationPrototypeIntf) *CreateVPNServerOptions { + _options.ClientAuthentication = clientAuthentication return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options +// SetClientIPPool : Allow user to set ClientIPPool +func (_options *CreateVPNServerOptions) SetClientIPPool(clientIPPool string) *CreateVPNServerOptions { + _options.ClientIPPool = core.StringPtr(clientIPPool) + return _options } -// DeleteBareMetalServerOptions : The DeleteBareMetalServer options. -type DeleteBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` +// SetSubnets : Allow user to set Subnets +func (_options *CreateVPNServerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateVPNServerOptions { + _options.Subnets = subnets + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetClientDnsServerIps : Allow user to set ClientDnsServerIps +func (_options *CreateVPNServerOptions) SetClientDnsServerIps(clientDnsServerIps []IP) *CreateVPNServerOptions { + _options.ClientDnsServerIps = clientDnsServerIps + return _options } -// NewDeleteBareMetalServerOptions : Instantiate DeleteBareMetalServerOptions -func (*VpcV1) NewDeleteBareMetalServerOptions(id string) *DeleteBareMetalServerOptions { - return &DeleteBareMetalServerOptions{ - ID: core.StringPtr(id), - } +// SetClientIdleTimeout : Allow user to set ClientIdleTimeout +func (_options *CreateVPNServerOptions) SetClientIdleTimeout(clientIdleTimeout int64) *CreateVPNServerOptions { + _options.ClientIdleTimeout = core.Int64Ptr(clientIdleTimeout) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteBareMetalServerOptions) SetID(id string) *DeleteBareMetalServerOptions { - _options.ID = core.StringPtr(id) +// SetEnableSplitTunneling : Allow user to set EnableSplitTunneling +func (_options *CreateVPNServerOptions) SetEnableSplitTunneling(enableSplitTunneling bool) *CreateVPNServerOptions { + _options.EnableSplitTunneling = core.BoolPtr(enableSplitTunneling) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteBareMetalServerOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerOptions { - options.Headers = param - return options +// SetName : Allow user to set Name +func (_options *CreateVPNServerOptions) SetName(name string) *CreateVPNServerOptions { + _options.Name = core.StringPtr(name) + return _options } -// DeleteDedicatedHostGroupOptions : The DeleteDedicatedHostGroup options. -type DeleteDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` +// SetPort : Allow user to set Port +func (_options *CreateVPNServerOptions) SetPort(port int64) *CreateVPNServerOptions { + _options.Port = core.Int64Ptr(port) + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetProtocol : Allow user to set Protocol +func (_options *CreateVPNServerOptions) SetProtocol(protocol string) *CreateVPNServerOptions { + _options.Protocol = core.StringPtr(protocol) + return _options } -// NewDeleteDedicatedHostGroupOptions : Instantiate DeleteDedicatedHostGroupOptions -func (*VpcV1) NewDeleteDedicatedHostGroupOptions(id string) *DeleteDedicatedHostGroupOptions { - return &DeleteDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - } +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateVPNServerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPNServerOptions { + _options.ResourceGroup = resourceGroup + return _options } -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostGroupOptions) SetID(id string) *DeleteDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateVPNServerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateVPNServerOptions { + _options.SecurityGroups = securityGroups return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostGroupOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostGroupOptions { +func (options *CreateVPNServerOptions) SetHeaders(param map[string]string) *CreateVPNServerOptions { options.Headers = param return options } -// DeleteDedicatedHostOptions : The DeleteDedicatedHost options. -type DeleteDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateVPNServerRouteOptions : The CreateVPNServerRoute options. +type CreateVPNServerRouteOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` + + // The destination to use for this VPN route in the VPN server. Must be unique within the VPN server. If an incoming + // packet does not match any destination, it will be dropped. + Destination *string `json:"destination" validate:"required"` + + // The action to perform with a packet matching the VPN route: + // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver + // the packet to target. + // - `deliver`: deliver the packet to the target. + // - `drop`: drop the packet + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the + // unexpected property value was encountered. + Action *string `json:"action,omitempty"` + + // The name for this VPN server route. The name must not be used by another route for the VPN server. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteDedicatedHostOptions : Instantiate DeleteDedicatedHostOptions -func (*VpcV1) NewDeleteDedicatedHostOptions(id string) *DeleteDedicatedHostOptions { - return &DeleteDedicatedHostOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreateVPNServerRouteOptions.Action property. +// The action to perform with a packet matching the VPN route: +// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver the +// packet to target. +// - `deliver`: deliver the packet to the target. +// - `drop`: drop the packet +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the +// unexpected property value was encountered. +const ( + CreateVPNServerRouteOptionsActionDeliverConst = "deliver" + CreateVPNServerRouteOptionsActionDropConst = "drop" + CreateVPNServerRouteOptionsActionTranslateConst = "translate" +) + +// NewCreateVPNServerRouteOptions : Instantiate CreateVPNServerRouteOptions +func (*VpcV1) NewCreateVPNServerRouteOptions(vpnServerID string, destination string) *CreateVPNServerRouteOptions { + return &CreateVPNServerRouteOptions{ + VPNServerID: core.StringPtr(vpnServerID), + Destination: core.StringPtr(destination), } } -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostOptions) SetID(id string) *DeleteDedicatedHostOptions { - _options.ID = core.StringPtr(id) +// SetVPNServerID : Allow user to set VPNServerID +func (_options *CreateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *CreateVPNServerRouteOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostOptions { - options.Headers = param - return options -} - -// DeleteEndpointGatewayOptions : The DeleteEndpointGateway options. -type DeleteEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetDestination : Allow user to set Destination +func (_options *CreateVPNServerRouteOptions) SetDestination(destination string) *CreateVPNServerRouteOptions { + _options.Destination = core.StringPtr(destination) + return _options } -// NewDeleteEndpointGatewayOptions : Instantiate DeleteEndpointGatewayOptions -func (*VpcV1) NewDeleteEndpointGatewayOptions(id string) *DeleteEndpointGatewayOptions { - return &DeleteEndpointGatewayOptions{ - ID: core.StringPtr(id), - } +// SetAction : Allow user to set Action +func (_options *CreateVPNServerRouteOptions) SetAction(action string) *CreateVPNServerRouteOptions { + _options.Action = core.StringPtr(action) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteEndpointGatewayOptions) SetID(id string) *DeleteEndpointGatewayOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *CreateVPNServerRouteOptions) SetName(name string) *CreateVPNServerRouteOptions { + _options.Name = core.StringPtr(name) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayOptions { +func (options *CreateVPNServerRouteOptions) SetHeaders(param map[string]string) *CreateVPNServerRouteOptions { options.Headers = param return options } -// DeleteFloatingIPOptions : The DeleteFloatingIP options. -type DeleteFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DnsInstanceIdentity : Identifies a DNS instance by a unique property. +// Models which "extend" this model: +// - DnsInstanceIdentityByCRN +type DnsInstanceIdentity struct { + // The CRN for this DNS instance. + CRN *string `json:"crn,omitempty"` } -// NewDeleteFloatingIPOptions : Instantiate DeleteFloatingIPOptions -func (*VpcV1) NewDeleteFloatingIPOptions(id string) *DeleteFloatingIPOptions { - return &DeleteFloatingIPOptions{ - ID: core.StringPtr(id), - } +func (*DnsInstanceIdentity) isaDnsInstanceIdentity() bool { + return true } -// SetID : Allow user to set ID -func (_options *DeleteFloatingIPOptions) SetID(id string) *DeleteFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options +type DnsInstanceIdentityIntf interface { + isaDnsInstanceIdentity() bool } -// SetHeaders : Allow user to set Headers -func (options *DeleteFloatingIPOptions) SetHeaders(param map[string]string) *DeleteFloatingIPOptions { - options.Headers = param - return options +// UnmarshalDnsInstanceIdentity unmarshals an instance of DnsInstanceIdentity from the specified map of raw messages. +func UnmarshalDnsInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsInstanceIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteFlowLogCollectorOptions : The DeleteFlowLogCollector options. -type DeleteFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DnsInstanceReference : DnsInstanceReference struct +type DnsInstanceReference struct { + // The CRN for this DNS instance. + CRN *string `json:"crn" validate:"required"` } -// NewDeleteFlowLogCollectorOptions : Instantiate DeleteFlowLogCollectorOptions -func (*VpcV1) NewDeleteFlowLogCollectorOptions(id string) *DeleteFlowLogCollectorOptions { - return &DeleteFlowLogCollectorOptions{ - ID: core.StringPtr(id), +// UnmarshalDnsInstanceReference unmarshals an instance of DnsInstanceReference from the specified map of raw messages. +func UnmarshalDnsInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsInstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteFlowLogCollectorOptions) SetID(id string) *DeleteFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options +// DnsServer : A DNS server. +type DnsServer struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` + + // If present, DHCP configuration for this zone will have this DNS server listed first. + ZoneAffinity *ZoneReference `json:"zone_affinity,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteFlowLogCollectorOptions) SetHeaders(param map[string]string) *DeleteFlowLogCollectorOptions { - options.Headers = param - return options +// UnmarshalDnsServer unmarshals an instance of DnsServer from the specified map of raw messages. +func UnmarshalDnsServer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsServer) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteIkePolicyOptions : The DeleteIkePolicy options. -type DeleteIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` +// DnsServerPrototype : DnsServerPrototype struct +type DnsServerPrototype struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // DHCP configuration for the specified zone will have this DNS server listed first. + ZoneAffinity ZoneIdentityIntf `json:"zone_affinity,omitempty"` } -// NewDeleteIkePolicyOptions : Instantiate DeleteIkePolicyOptions -func (*VpcV1) NewDeleteIkePolicyOptions(id string) *DeleteIkePolicyOptions { - return &DeleteIkePolicyOptions{ - ID: core.StringPtr(id), +// NewDnsServerPrototype : Instantiate DnsServerPrototype (Generic Model Constructor) +func (*VpcV1) NewDnsServerPrototype(address string) (_model *DnsServerPrototype, err error) { + _model = &DnsServerPrototype{ + Address: core.StringPtr(address), } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetID : Allow user to set ID -func (_options *DeleteIkePolicyOptions) SetID(id string) *DeleteIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDnsServerPrototype unmarshals an instance of DnsServerPrototype from the specified map of raw messages. +func UnmarshalDnsServerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsServerPrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteIkePolicyOptions) SetHeaders(param map[string]string) *DeleteIkePolicyOptions { - options.Headers = param - return options +// DnsZoneIdentity : Identifies a DNS zone by a unique property. +// Models which "extend" this model: +// - DnsZoneIdentityByID +type DnsZoneIdentity struct { + ID *string `json:"id,omitempty"` } -// DeleteImageExportJobOptions : The DeleteImageExportJob options. -type DeleteImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The image export job identifier. - ID *string `json:"id" validate:"required,ne="` +func (*DnsZoneIdentity) isaDnsZoneIdentity() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type DnsZoneIdentityIntf interface { + isaDnsZoneIdentity() bool } -// NewDeleteImageExportJobOptions : Instantiate DeleteImageExportJobOptions -func (*VpcV1) NewDeleteImageExportJobOptions(imageID string, id string) *DeleteImageExportJobOptions { - return &DeleteImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), +// UnmarshalDnsZoneIdentity unmarshals an instance of DnsZoneIdentity from the specified map of raw messages. +func UnmarshalDnsZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsZoneIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetImageID : Allow user to set ImageID -func (_options *DeleteImageExportJobOptions) SetImageID(imageID string) *DeleteImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options +// DnsZoneReference : DnsZoneReference struct +type DnsZoneReference struct { + ID *string `json:"id" validate:"required"` } -// SetID : Allow user to set ID -func (_options *DeleteImageExportJobOptions) SetID(id string) *DeleteImageExportJobOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDnsZoneReference unmarshals an instance of DnsZoneReference from the specified map of raw messages. +func UnmarshalDnsZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsZoneReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteImageExportJobOptions) SetHeaders(param map[string]string) *DeleteImageExportJobOptions { - options.Headers = param - return options -} +// DedicatedHost : DedicatedHost struct +type DedicatedHost struct { + // The amount of memory in gibibytes that is currently available for instances. + AvailableMemory *int64 `json:"available_memory" validate:"required"` -// DeleteImageOptions : The DeleteImage options. -type DeleteImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` + // The available VCPU for the dedicated host. + AvailableVcpu *Vcpu `json:"available_vcpu" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The date and time that the dedicated host was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// NewDeleteImageOptions : Instantiate DeleteImageOptions -func (*VpcV1) NewDeleteImageOptions(id string) *DeleteImageOptions { - return &DeleteImageOptions{ - ID: core.StringPtr(id), - } -} + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteImageOptions) SetID(id string) *DeleteImageOptions { - _options.ID = core.StringPtr(id) - return _options -} + // Collection of the dedicated host's disks. + Disks []DedicatedHostDisk `json:"disks" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteImageOptions) SetHeaders(param map[string]string) *DeleteImageOptions { - options.Headers = param - return options -} + // The dedicated host group this dedicated host is in. + Group *DedicatedHostGroupReference `json:"group" validate:"required"` -// DeleteInstanceGroupLoadBalancerOptions : The DeleteInstanceGroupLoadBalancer options. -type DeleteInstanceGroupLoadBalancerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` -// NewDeleteInstanceGroupLoadBalancerOptions : Instantiate DeleteInstanceGroupLoadBalancerOptions -func (*VpcV1) NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { - return &DeleteInstanceGroupLoadBalancerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled" validate:"required"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupLoadBalancerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The instances that are allocated to this dedicated host. + Instances []InstanceReference `json:"instances" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupLoadBalancerOptions { - options.Headers = param - return options -} + // The lifecycle state of the dedicated host. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// DeleteInstanceGroupManagerActionOptions : The DeleteInstanceGroupManagerAction options. -type DeleteInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The total amount of memory in gibibytes for this host. + Memory *int64 `json:"memory" validate:"required"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The name for this dedicated host. The name is unique across all dedicated hosts in the region. + Name *string `json:"name" validate:"required"` - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` + // The dedicated host NUMA configuration. + Numa *DedicatedHostNuma `json:"numa" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this + // dedicated host. + Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` -// NewDeleteInstanceGroupManagerActionOptions : Instantiate DeleteInstanceGroupManagerActionOptions -func (*VpcV1) NewDeleteInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerActionOptions { - return &DeleteInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} + // Indicates whether this dedicated host is available for instance creation. + Provisionable *bool `json:"provisionable" validate:"required"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The resource group for this dedicated host. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerActionOptions) SetID(id string) *DeleteInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The total number of sockets for this host. + SocketCount *int64 `json:"socket_count" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerActionOptions { - options.Headers = param - return options -} + // The administrative state of the dedicated host. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which + // the unexpected property value was encountered. + State *string `json:"state" validate:"required"` -// DeleteInstanceGroupManagerOptions : The DeleteInstanceGroupManager options. -type DeleteInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The instance profiles usable by instances placed on this dedicated host. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` + // The total VCPU of the dedicated host. + Vcpu *Vcpu `json:"vcpu" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The zone this dedicated host resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// NewDeleteInstanceGroupManagerOptions : Instantiate DeleteInstanceGroupManagerOptions -func (*VpcV1) NewDeleteInstanceGroupManagerOptions(instanceGroupID string, id string) *DeleteInstanceGroupManagerOptions { - return &DeleteInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} +// Constants associated with the DedicatedHost.LifecycleState property. +// The lifecycle state of the dedicated host. +const ( + DedicatedHostLifecycleStateDeletingConst = "deleting" + DedicatedHostLifecycleStateFailedConst = "failed" + DedicatedHostLifecycleStatePendingConst = "pending" + DedicatedHostLifecycleStateStableConst = "stable" + DedicatedHostLifecycleStateSuspendedConst = "suspended" + DedicatedHostLifecycleStateUpdatingConst = "updating" + DedicatedHostLifecycleStateWaitingConst = "waiting" +) -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} +// Constants associated with the DedicatedHost.ResourceType property. +// The resource type. +const ( + DedicatedHostResourceTypeDedicatedHostConst = "dedicated_host" +) -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerOptions) SetID(id string) *DeleteInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the DedicatedHost.State property. +// The administrative state of the dedicated host. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which +// the unexpected property value was encountered. +const ( + DedicatedHostStateAvailableConst = "available" + DedicatedHostStateDegradedConst = "degraded" + DedicatedHostStateMigratingConst = "migrating" + DedicatedHostStateUnavailableConst = "unavailable" +) -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerOptions { - options.Headers = param - return options +// UnmarshalDedicatedHost unmarshals an instance of DedicatedHost from the specified map of raw messages. +func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHost) + err = core.UnmarshalPrimitive(m, "available_memory", &obj.AvailableMemory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "available_vcpu", &obj.AvailableVcpu, UnmarshalVcpu) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "numa", &obj.Numa, UnmarshalDedicatedHostNuma) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalVcpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteInstanceGroupManagerPolicyOptions : The DeleteInstanceGroupManagerPolicy options. -type DeleteInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// DedicatedHostCollection : DedicatedHostCollection struct +type DedicatedHostCollection struct { + // Collection of dedicated hosts. + DedicatedHosts []DedicatedHost `json:"dedicated_hosts" validate:"required"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // A link to the first page of resources. + First *DedicatedHostCollectionFirst `json:"first" validate:"required"` - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *DedicatedHostCollectionNext `json:"next,omitempty"` -// NewDeleteInstanceGroupManagerPolicyOptions : Instantiate DeleteInstanceGroupManagerPolicyOptions -func (*VpcV1) NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerPolicyOptions { - return &DeleteInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// UnmarshalDedicatedHostCollection unmarshals an instance of DedicatedHostCollection from the specified map of raw messages. +func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollection) + err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHost) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetID(id string) *DeleteInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostCollectionFirst : A link to the first page of resources. +type DedicatedHostCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerPolicyOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostCollectionFirst unmarshals an instance of DedicatedHostCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteInstanceGroupMembershipOptions : The DeleteInstanceGroupMembership options. -type DeleteInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewDeleteInstanceGroupMembershipOptions : Instantiate DeleteInstanceGroupMembershipOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipOptions(instanceGroupID string, id string) *DeleteInstanceGroupMembershipOptions { - return &DeleteInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostCollectionNext unmarshals an instance of DedicatedHostCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} +// DedicatedHostDisk : DedicatedHostDisk struct +type DedicatedHostDisk struct { + // The remaining space left for instance placement in GB (gigabytes). + Available *int64 `json:"available" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupMembershipOptions) SetID(id string) *DeleteInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipOptions { - options.Headers = param - return options -} + // The URL for this disk. + Href *string `json:"href" validate:"required"` -// DeleteInstanceGroupMembershipsOptions : The DeleteInstanceGroupMemberships options. -type DeleteInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The unique identifier for this disk. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Instance disks that are on this dedicated host disk. + InstanceDisks []InstanceDiskReference `json:"instance_disks" validate:"required"` -// NewDeleteInstanceGroupMembershipsOptions : Instantiate DeleteInstanceGroupMembershipsOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipsOptions(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - return &DeleteInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} + // The disk interface used for attaching the disk + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The lifecycle state of this dedicated host disk. + LifecycleState *string `json:"lifecycle_state,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipsOptions { - options.Headers = param - return options -} + // The name for this dedicated host disk. The name is unique across all disks on the dedicated host. + Name *string `json:"name" validate:"required"` -// DeleteInstanceGroupOptions : The DeleteInstanceGroup options. -type DeleteInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` + // Indicates whether this dedicated host disk is available for instance disk creation. + Provisionable *bool `json:"provisionable" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// NewDeleteInstanceGroupOptions : Instantiate DeleteInstanceGroupOptions -func (*VpcV1) NewDeleteInstanceGroupOptions(id string) *DeleteInstanceGroupOptions { - return &DeleteInstanceGroupOptions{ - ID: core.StringPtr(id), - } -} + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupOptions) SetID(id string) *DeleteInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options + // The instance disk interfaces supported for this dedicated host disk. + SupportedInstanceInterfaceTypes []string `json:"supported_instance_interface_types" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupOptions { - options.Headers = param - return options -} +// Constants associated with the DedicatedHostDisk.InterfaceType property. +// The disk interface used for attaching the disk +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostDiskInterfaceTypeNvmeConst = "nvme" +) -// DeleteInstanceNetworkInterfaceOptions : The DeleteInstanceNetworkInterface options. -type DeleteInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// Constants associated with the DedicatedHostDisk.LifecycleState property. +// The lifecycle state of this dedicated host disk. +const ( + DedicatedHostDiskLifecycleStateDeletingConst = "deleting" + DedicatedHostDiskLifecycleStateFailedConst = "failed" + DedicatedHostDiskLifecycleStatePendingConst = "pending" + DedicatedHostDiskLifecycleStateStableConst = "stable" + DedicatedHostDiskLifecycleStateSuspendedConst = "suspended" + DedicatedHostDiskLifecycleStateUpdatingConst = "updating" + DedicatedHostDiskLifecycleStateWaitingConst = "waiting" +) - // The instance network interface identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostDisk.ResourceType property. +// The resource type. +const ( + DedicatedHostDiskResourceTypeDedicatedHostDiskConst = "dedicated_host_disk" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostDisk.SupportedInstanceInterfaceTypes property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostDiskSupportedInstanceInterfaceTypesNvmeConst = "nvme" + DedicatedHostDiskSupportedInstanceInterfaceTypesVirtioBlkConst = "virtio_blk" +) -// NewDeleteInstanceNetworkInterfaceOptions : Instantiate DeleteInstanceNetworkInterfaceOptions -func (*VpcV1) NewDeleteInstanceNetworkInterfaceOptions(instanceID string, id string) *DeleteInstanceNetworkInterfaceOptions { - return &DeleteInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostDisk unmarshals an instance of DedicatedHostDisk from the specified map of raw messages. +func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDisk) + err = core.UnmarshalPrimitive(m, "available", &obj.Available) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_disks", &obj.InstanceDisks, UnmarshalInstanceDiskReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetID(id string) *DeleteInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostDiskCollection : DedicatedHostDiskCollection struct +type DedicatedHostDiskCollection struct { + // Collection of the dedicated host's disks. + Disks []DedicatedHostDisk `json:"disks" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkInterfaceOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostDiskCollection unmarshals an instance of DedicatedHostDiskCollection from the specified map of raw messages. +func UnmarshalDedicatedHostDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteInstanceOptions : The DeleteInstance options. -type DeleteInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostDiskPatch : DedicatedHostDiskPatch struct +type DedicatedHostDiskPatch struct { + // The name for this dedicated host disk. The name must not be used by another disk on the dedicated host. + Name *string `json:"name,omitempty"` } -// NewDeleteInstanceOptions : Instantiate DeleteInstanceOptions -func (*VpcV1) NewDeleteInstanceOptions(id string) *DeleteInstanceOptions { - return &DeleteInstanceOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostDiskPatch unmarshals an instance of DedicatedHostDiskPatch from the specified map of raw messages. +func UnmarshalDedicatedHostDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { - _options.ID = core.StringPtr(id) - return _options +// AsPatch returns a generic map representation of the DedicatedHostDiskPatch +func (dedicatedHostDiskPatch *DedicatedHostDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(dedicatedHostDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteInstanceOptions) SetIfMatch(ifMatch string) *DeleteInstanceOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} +// DedicatedHostGroup : DedicatedHostGroup struct +type DedicatedHostGroup struct { + // The dedicated host profile class for hosts in this group. + Class *string `json:"class" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { - options.Headers = param - return options -} + // The date and time that the dedicated host group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// DeleteInstanceTemplateOptions : The DeleteInstanceTemplate options. -type DeleteInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The dedicated hosts that are in this dedicated host group. + DedicatedHosts []DedicatedHostReference `json:"dedicated_hosts" validate:"required"` -// NewDeleteInstanceTemplateOptions : Instantiate DeleteInstanceTemplateOptions -func (*VpcV1) NewDeleteInstanceTemplateOptions(id string) *DeleteInstanceTemplateOptions { - return &DeleteInstanceTemplateOptions{ - ID: core.StringPtr(id), - } -} + // The dedicated host profile family for hosts in this group. + Family *string `json:"family" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceTemplateOptions) SetID(id string) *DeleteInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceTemplateOptions) SetHeaders(param map[string]string) *DeleteInstanceTemplateOptions { - options.Headers = param - return options -} + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` -// DeleteInstanceVolumeAttachmentOptions : The DeleteInstanceVolumeAttachment options. -type DeleteInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. + Name *string `json:"name" validate:"required"` - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group for this dedicated host group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The instance profiles usable by instances placed on this dedicated host group. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` + + // The zone this dedicated host group resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// NewDeleteInstanceVolumeAttachmentOptions : Instantiate DeleteInstanceVolumeAttachmentOptions -func (*VpcV1) NewDeleteInstanceVolumeAttachmentOptions(instanceID string, id string) *DeleteInstanceVolumeAttachmentOptions { - return &DeleteInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// Constants associated with the DedicatedHostGroup.Family property. +// The dedicated host profile family for hosts in this group. +const ( + DedicatedHostGroupFamilyBalancedConst = "balanced" + DedicatedHostGroupFamilyComputeConst = "compute" + DedicatedHostGroupFamilyMemoryConst = "memory" +) + +// Constants associated with the DedicatedHostGroup.ResourceType property. +// The resource type. +const ( + DedicatedHostGroupResourceTypeDedicatedHostGroupConst = "dedicated_host_group" +) + +// UnmarshalDedicatedHostGroup unmarshals an instance of DedicatedHostGroup from the specified map of raw messages. +func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroup) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHostReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} +// DedicatedHostGroupCollection : DedicatedHostGroupCollection struct +type DedicatedHostGroupCollection struct { + // A link to the first page of resources. + First *DedicatedHostGroupCollectionFirst `json:"first" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetID(id string) *DeleteInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} + // Collection of dedicated host groups. + Groups []DedicatedHostGroup `json:"groups" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// DeleteIpsecPolicyOptions : The DeleteIpsecPolicy options. -type DeleteIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *DedicatedHostGroupCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewDeleteIpsecPolicyOptions : Instantiate DeleteIpsecPolicyOptions -func (*VpcV1) NewDeleteIpsecPolicyOptions(id string) *DeleteIpsecPolicyOptions { - return &DeleteIpsecPolicyOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostGroupCollection unmarshals an instance of DedicatedHostGroupCollection from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostGroupCollectionFirst) + if err != nil { + return } + err = core.UnmarshalModel(m, "groups", &obj.Groups, UnmarshalDedicatedHostGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostGroupCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteIpsecPolicyOptions) SetID(id string) *DeleteIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteIpsecPolicyOptions) SetHeaders(param map[string]string) *DeleteIpsecPolicyOptions { - options.Headers = param - return options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *DedicatedHostGroupCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// DeleteKeyOptions : The DeleteKey options. -type DeleteKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostGroupCollectionFirst : A link to the first page of resources. +type DedicatedHostGroupCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewDeleteKeyOptions : Instantiate DeleteKeyOptions -func (*VpcV1) NewDeleteKeyOptions(id string) *DeleteKeyOptions { - return &DeleteKeyOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostGroupCollectionFirst unmarshals an instance of DedicatedHostGroupCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteKeyOptions) SetID(id string) *DeleteKeyOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostGroupCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteKeyOptions) SetHeaders(param map[string]string) *DeleteKeyOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostGroupCollectionNext unmarshals an instance of DedicatedHostGroupCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteLoadBalancerListenerOptions : The DeleteLoadBalancerListener options. -type DeleteLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// DedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// Models which "extend" this model: +// - DedicatedHostGroupIdentityByID +// - DedicatedHostGroupIdentityByCRN +// - DedicatedHostGroupIdentityByHref +type DedicatedHostGroupIdentity struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` } -// NewDeleteLoadBalancerListenerOptions : Instantiate DeleteLoadBalancerListenerOptions -func (*VpcV1) NewDeleteLoadBalancerListenerOptions(loadBalancerID string, id string) *DeleteLoadBalancerListenerOptions { - return &DeleteLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } +func (*DedicatedHostGroupIdentity) isaDedicatedHostGroupIdentity() bool { + return true } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +type DedicatedHostGroupIdentityIntf interface { + isaDedicatedHostGroupIdentity() bool } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerOptions) SetID(id string) *DeleteLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDedicatedHostGroupIdentity unmarshals an instance of DedicatedHostGroupIdentity from the specified map of raw messages. +func UnmarshalDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerOptions { - options.Headers = param - return options +// DedicatedHostGroupPatch : DedicatedHostGroupPatch struct +type DedicatedHostGroupPatch struct { + // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. + Name *string `json:"name,omitempty"` } -// DeleteLoadBalancerListenerPolicyOptions : The DeleteLoadBalancerListenerPolicy options. -type DeleteLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalDedicatedHostGroupPatch unmarshals an instance of DedicatedHostGroupPatch from the specified map of raw messages. +func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewDeleteLoadBalancerListenerPolicyOptions : Instantiate DeleteLoadBalancerListenerPolicyOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *DeleteLoadBalancerListenerPolicyOptions { - return &DeleteLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), +// AsPatch returns a generic map representation of the DedicatedHostGroupPatch +func (dedicatedHostGroupPatch *DedicatedHostGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(dedicatedHostGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// DedicatedHostGroupPrototypeDedicatedHostByZoneContext : DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct +type DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct { + // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options + // The resource group to use. If unspecified, the host's resource group is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext unmarshals an instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext from the specified map of raw messages. +func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupPrototypeDedicatedHostByZoneContext) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} +// DedicatedHostGroupReference : DedicatedHostGroupReference struct +type DedicatedHostGroupReference struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` -// DeleteLoadBalancerListenerPolicyRuleOptions : The DeleteLoadBalancerListenerPolicyRule options. -type DeleteLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewDeleteLoadBalancerListenerPolicyRuleOptions : Instantiate DeleteLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - return &DeleteLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), +// Constants associated with the DedicatedHostGroupReference.ResourceType property. +// The resource type. +const ( + DedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" +) + +// UnmarshalDedicatedHostGroupReference unmarshals an instance of DedicatedHostGroupReference from the specified map of raw messages. +func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// DedicatedHostGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type DedicatedHostGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// UnmarshalDedicatedHostGroupReferenceDeleted unmarshals an instance of DedicatedHostGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPolicyID : Allow user to set PolicyID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} +// DedicatedHostNuma : The dedicated host NUMA configuration. +type DedicatedHostNuma struct { + // The total number of NUMA nodes for this dedicated host. + Count *int64 `json:"count" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options + // The NUMA nodes for this dedicated host. + Nodes []DedicatedHostNumaNode `json:"nodes" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostNuma unmarshals an instance of DedicatedHostNuma from the specified map of raw messages. +func UnmarshalDedicatedHostNuma(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostNuma) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + err = core.UnmarshalModel(m, "nodes", &obj.Nodes, UnmarshalDedicatedHostNumaNode) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteLoadBalancerOptions : The DeleteLoadBalancer options. -type DeleteLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` +// DedicatedHostNumaNode : The dedicated host NUMA node configuration. +type DedicatedHostNumaNode struct { + // The available VCPU for this NUMA node. + AvailableVcpu *int64 `json:"available_vcpu" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total VCPU capacity for this NUMA node. + Vcpu *int64 `json:"vcpu" validate:"required"` } -// NewDeleteLoadBalancerOptions : Instantiate DeleteLoadBalancerOptions -func (*VpcV1) NewDeleteLoadBalancerOptions(id string) *DeleteLoadBalancerOptions { - return &DeleteLoadBalancerOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostNumaNode unmarshals an instance of DedicatedHostNumaNode from the specified map of raw messages. +func UnmarshalDedicatedHostNumaNode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostNumaNode) + err = core.UnmarshalPrimitive(m, "available_vcpu", &obj.AvailableVcpu) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "vcpu", &obj.Vcpu) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerOptions) SetID(id string) *DeleteLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostPatch : DedicatedHostPatch struct +type DedicatedHostPatch struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` + + // The name for this dedicated host. The name must not be used by another dedicated host in the region. + Name *string `json:"name,omitempty"` } -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteLoadBalancerOptions) SetIfMatch(ifMatch string) *DeleteLoadBalancerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// UnmarshalDedicatedHostPatch unmarshals an instance of DedicatedHostPatch from the specified map of raw messages. +func UnmarshalDedicatedHostPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPatch) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the DedicatedHostPatch +func (dedicatedHostPatch *DedicatedHostPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(dedicatedHostPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// DeleteLoadBalancerPoolMemberOptions : The DeleteLoadBalancerPoolMember options. -type DeleteLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// DedicatedHostProfile : DedicatedHostProfile struct +type DedicatedHostProfile struct { + // The product class this dedicated host profile belongs to. + Class *string `json:"class" validate:"required"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // Collection of the dedicated host profile's disks. + Disks []DedicatedHostProfileDisk `json:"disks" validate:"required"` - // The member identifier. - ID *string `json:"id" validate:"required,ne="` + // The product family this dedicated host profile belongs to + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Family *string `json:"family" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` -// NewDeleteLoadBalancerPoolMemberOptions : Instantiate DeleteLoadBalancerPoolMemberOptions -func (*VpcV1) NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *DeleteLoadBalancerPoolMemberOptions { - return &DeleteLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - } -} + Memory DedicatedHostProfileMemoryIntf `json:"memory" validate:"required"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The globally unique name for this dedicated host profile. + Name *string `json:"name" validate:"required"` -// SetPoolID : Allow user to set PoolID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *DeleteLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} + SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetID(id string) *DeleteLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The status of the dedicated host profile: + // - `previous`: This dedicated host profile is an older revision, but remains provisionable + // and usable. + // - `current`: This profile is the latest revision. + // + // Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming + // conventions] + // (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how + // generations are defined within a dedicated host profile. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} + // The instance profiles usable by instances placed on dedicated hosts with this profile. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` -// DeleteLoadBalancerPoolOptions : The DeleteLoadBalancerPool options. -type DeleteLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + VcpuArchitecture *DedicatedHostProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` + VcpuCount DedicatedHostProfileVcpuIntf `json:"vcpu_count" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + VcpuManufacturer *DedicatedHostProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` } -// NewDeleteLoadBalancerPoolOptions : Instantiate DeleteLoadBalancerPoolOptions -func (*VpcV1) NewDeleteLoadBalancerPoolOptions(loadBalancerID string, id string) *DeleteLoadBalancerPoolOptions { - return &DeleteLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), +// Constants associated with the DedicatedHostProfile.Family property. +// The product family this dedicated host profile belongs to +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileFamilyBalancedConst = "balanced" + DedicatedHostProfileFamilyComputeConst = "compute" + DedicatedHostProfileFamilyMemoryConst = "memory" +) + +// Constants associated with the DedicatedHostProfile.Status property. +// The status of the dedicated host profile: +// - `previous`: This dedicated host profile is an older revision, but remains provisionable +// and usable. +// - `current`: This profile is the latest revision. +// +// Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming +// conventions] +// (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how +// generations are defined within a dedicated host profile. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileStatusCurrentConst = "current" + DedicatedHostProfileStatusPreviousConst = "previous" +) + +// UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. +func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfile) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalDedicatedHostProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "socket_count", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture) + if err != nil { + return } + err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalDedicatedHostProfileVcpuManufacturer) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// DedicatedHostProfileCollection : DedicatedHostProfileCollection struct +type DedicatedHostProfileCollection struct { + // A link to the first page of resources. + First *DedicatedHostProfileCollectionFirst `json:"first" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolOptions) SetID(id string) *DeleteLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolOptions { - options.Headers = param - return options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *DedicatedHostProfileCollectionNext `json:"next,omitempty"` -// DeleteNetworkACLOptions : The DeleteNetworkACL options. -type DeleteNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` + // Collection of dedicated host profiles. + Profiles []DedicatedHostProfile `json:"profiles" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewDeleteNetworkACLOptions : Instantiate DeleteNetworkACLOptions -func (*VpcV1) NewDeleteNetworkACLOptions(id string) *DeleteNetworkACLOptions { - return &DeleteNetworkACLOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileCollection unmarshals an instance of DedicatedHostProfileCollection from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostProfileCollectionFirst) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalDedicatedHostProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLOptions) SetID(id string) *DeleteNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLOptions) SetHeaders(param map[string]string) *DeleteNetworkACLOptions { - options.Headers = param - return options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *DedicatedHostProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// DeleteNetworkACLRuleOptions : The DeleteNetworkACLRule options. -type DeleteNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostProfileCollectionFirst : A link to the first page of resources. +type DedicatedHostProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewDeleteNetworkACLRuleOptions : Instantiate DeleteNetworkACLRuleOptions -func (*VpcV1) NewDeleteNetworkACLRuleOptions(networkACLID string, id string) *DeleteNetworkACLRuleOptions { - return &DeleteNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileCollectionFirst unmarshals an instance of DedicatedHostProfileCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *DeleteNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *DeleteNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options +// DedicatedHostProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLRuleOptions) SetID(id string) *DeleteNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDedicatedHostProfileCollectionNext unmarshals an instance of DedicatedHostProfileCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLRuleOptions) SetHeaders(param map[string]string) *DeleteNetworkACLRuleOptions { - options.Headers = param - return options -} +// DedicatedHostProfileDisk : Disks provided by this profile. +type DedicatedHostProfileDisk struct { + InterfaceType *DedicatedHostProfileDiskInterface `json:"interface_type" validate:"required"` -// DeletePlacementGroupOptions : The DeletePlacementGroup options. -type DeletePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` + // The number of disks of this type for a dedicated host with this profile. + Quantity *DedicatedHostProfileDiskQuantity `json:"quantity" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The size of the disk in GB (gigabytes). + Size *DedicatedHostProfileDiskSize `json:"size" validate:"required"` + + SupportedInstanceInterfaceTypes *DedicatedHostProfileDiskSupportedInterfaces `json:"supported_instance_interface_types" validate:"required"` } -// NewDeletePlacementGroupOptions : Instantiate DeletePlacementGroupOptions -func (*VpcV1) NewDeletePlacementGroupOptions(id string) *DeletePlacementGroupOptions { - return &DeletePlacementGroupOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDisk unmarshals an instance of DedicatedHostProfileDisk from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDisk) + err = core.UnmarshalModel(m, "interface_type", &obj.InterfaceType, UnmarshalDedicatedHostProfileDiskInterface) + if err != nil { + return + } + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalDedicatedHostProfileDiskQuantity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalDedicatedHostProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes, UnmarshalDedicatedHostProfileDiskSupportedInterfaces) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeletePlacementGroupOptions) SetID(id string) *DeletePlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskInterface : DedicatedHostProfileDiskInterface struct +type DedicatedHostProfileDiskInterface struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeletePlacementGroupOptions) SetHeaders(param map[string]string) *DeletePlacementGroupOptions { - options.Headers = param - return options + // The interface of the disk for a dedicated host with this profile + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Value *string `json:"value" validate:"required"` } -// DeletePublicGatewayOptions : The DeletePublicGateway options. -type DeletePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileDiskInterface.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskInterfaceTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskInterface.Value property. +// The interface of the disk for a dedicated host with this profile +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileDiskInterfaceValueNvmeConst = "nvme" +) -// NewDeletePublicGatewayOptions : Instantiate DeletePublicGatewayOptions -func (*VpcV1) NewDeletePublicGatewayOptions(id string) *DeletePublicGatewayOptions { - return &DeletePublicGatewayOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskInterface unmarshals an instance of DedicatedHostProfileDiskInterface from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskInterface) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeletePublicGatewayOptions) SetID(id string) *DeletePublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskQuantity : The number of disks of this type for a dedicated host with this profile. +type DedicatedHostProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) *DeletePublicGatewayOptions { - options.Headers = param - return options + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// DeleteReservationOptions : The DeleteReservation options. -type DeleteReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskQuantity.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskQuantityTypeFixedConst = "fixed" +) -// NewDeleteReservationOptions : Instantiate DeleteReservationOptions -func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { - return &DeleteReservationOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskQuantity unmarshals an instance of DedicatedHostProfileDiskQuantity from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskSize : The size of the disk in GB (gigabytes). +type DedicatedHostProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { - options.Headers = param - return options + // The size of the disk in GB (gigabytes). + Value *int64 `json:"value" validate:"required"` } -// DeleteSecurityGroupOptions : The DeleteSecurityGroup options. -type DeleteSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskSize.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskSizeTypeFixedConst = "fixed" +) -// NewDeleteSecurityGroupOptions : Instantiate DeleteSecurityGroupOptions -func (*VpcV1) NewDeleteSecurityGroupOptions(id string) *DeleteSecurityGroupOptions { - return &DeleteSecurityGroupOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskSize unmarshals an instance of DedicatedHostProfileDiskSize from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupOptions) SetID(id string) *DeleteSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskSupportedInterfaces : DedicatedHostProfileDiskSupportedInterfaces struct +type DedicatedHostProfileDiskSupportedInterfaces struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupOptions { - options.Headers = param - return options + // The instance disk interfaces supported for a dedicated host with this profile. + Value []string `json:"value" validate:"required"` } -// DeleteSecurityGroupRuleOptions : The DeleteSecurityGroupRule options. -type DeleteSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskSupportedInterfacesTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Value property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileDiskSupportedInterfacesValueNvmeConst = "nvme" + DedicatedHostProfileDiskSupportedInterfacesValueVirtioBlkConst = "virtio_blk" +) -// NewDeleteSecurityGroupRuleOptions : Instantiate DeleteSecurityGroupRuleOptions -func (*VpcV1) NewDeleteSecurityGroupRuleOptions(securityGroupID string, id string) *DeleteSecurityGroupRuleOptions { - return &DeleteSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskSupportedInterfaces unmarshals an instance of DedicatedHostProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} +// DedicatedHostProfileIdentity : Identifies a dedicated host profile by a unique property. +// Models which "extend" this model: +// - DedicatedHostProfileIdentityByName +// - DedicatedHostProfileIdentityByHref +type DedicatedHostProfileIdentity struct { + // The globally unique name for this dedicated host profile. + Name *string `json:"name,omitempty"` -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupRuleOptions) SetID(id string) *DeleteSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options + // The URL for this dedicated host profile. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupRuleOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupRuleOptions { - options.Headers = param - return options +func (*DedicatedHostProfileIdentity) isaDedicatedHostProfileIdentity() bool { + return true } -// DeleteSecurityGroupTargetBindingOptions : The DeleteSecurityGroupTargetBinding options. -type DeleteSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +type DedicatedHostProfileIdentityIntf interface { + isaDedicatedHostProfileIdentity() bool } -// NewDeleteSecurityGroupTargetBindingOptions : Instantiate DeleteSecurityGroupTargetBindingOptions -func (*VpcV1) NewDeleteSecurityGroupTargetBindingOptions(securityGroupID string, id string) *DeleteSecurityGroupTargetBindingOptions { - return &DeleteSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileIdentity unmarshals an instance of DedicatedHostProfileIdentity from the specified map of raw messages. +func UnmarshalDedicatedHostProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} +// DedicatedHostProfileMemory : DedicatedHostProfileMemory struct +// Models which "extend" this model: +// - DedicatedHostProfileMemoryFixed +// - DedicatedHostProfileMemoryRange +// - DedicatedHostProfileMemoryEnum +// - DedicatedHostProfileMemoryDependent +type DedicatedHostProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetID(id string) *DeleteSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupTargetBindingOptions { - options.Headers = param - return options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// DeleteShareMountTargetOptions : The DeleteShareMountTarget options. -type DeleteShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// NewDeleteShareMountTargetOptions : Instantiate DeleteShareMountTargetOptions -func (*VpcV1) NewDeleteShareMountTargetOptions(shareID string, id string) *DeleteShareMountTargetOptions { - return &DeleteShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - } + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetShareID : Allow user to set ShareID -func (_options *DeleteShareMountTargetOptions) SetShareID(shareID string) *DeleteShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} +// Constants associated with the DedicatedHostProfileMemory.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileMemoryTypeFixedConst = "fixed" +) -// SetID : Allow user to set ID -func (_options *DeleteShareMountTargetOptions) SetID(id string) *DeleteShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options +func (*DedicatedHostProfileMemory) isaDedicatedHostProfileMemory() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *DeleteShareMountTargetOptions) SetHeaders(param map[string]string) *DeleteShareMountTargetOptions { - options.Headers = param - return options +type DedicatedHostProfileMemoryIntf interface { + isaDedicatedHostProfileMemory() bool } -// DeleteShareOptions : The DeleteShare options. -type DeleteShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` +// UnmarshalDedicatedHostProfileMemory unmarshals an instance of DedicatedHostProfileMemory from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` +// DedicatedHostProfileReference : DedicatedHostProfileReference struct +type DedicatedHostProfileReference struct { + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The globally unique name for this dedicated host profile. + Name *string `json:"name" validate:"required"` } -// NewDeleteShareOptions : Instantiate DeleteShareOptions -func (*VpcV1) NewDeleteShareOptions(id string) *DeleteShareOptions { - return &DeleteShareOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileReference unmarshals an instance of DedicatedHostProfileReference from the specified map of raw messages. +func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteShareOptions) SetID(id string) *DeleteShareOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteShareOptions) SetIfMatch(ifMatch string) *DeleteShareOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} +// DedicatedHostProfileSocket : DedicatedHostProfileSocket struct +// Models which "extend" this model: +// - DedicatedHostProfileSocketFixed +// - DedicatedHostProfileSocketRange +// - DedicatedHostProfileSocketEnum +// - DedicatedHostProfileSocketDependent +type DedicatedHostProfileSocket struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteShareOptions) SetHeaders(param map[string]string) *DeleteShareOptions { - options.Headers = param - return options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// DeleteShareSourceOptions : The DeleteShareSource options. -type DeleteShareSourceOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewDeleteShareSourceOptions : Instantiate DeleteShareSourceOptions -func (*VpcV1) NewDeleteShareSourceOptions(shareID string) *DeleteShareSourceOptions { - return &DeleteShareSourceOptions{ - ShareID: core.StringPtr(shareID), - } -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetShareID : Allow user to set ShareID -func (_options *DeleteShareSourceOptions) SetShareID(shareID string) *DeleteShareSourceOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteShareSourceOptions) SetHeaders(param map[string]string) *DeleteShareSourceOptions { - options.Headers = param - return options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// DeleteSnapshotCloneOptions : The DeleteSnapshotClone options. -type DeleteSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileSocket.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileSocketTypeFixedConst = "fixed" +) - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` +func (*DedicatedHostProfileSocket) isaDedicatedHostProfileSocket() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type DedicatedHostProfileSocketIntf interface { + isaDedicatedHostProfileSocket() bool } -// NewDeleteSnapshotCloneOptions : Instantiate DeleteSnapshotCloneOptions -func (*VpcV1) NewDeleteSnapshotCloneOptions(id string, zoneName string) *DeleteSnapshotCloneOptions { - return &DeleteSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), +// UnmarshalDedicatedHostProfileSocket unmarshals an instance of DedicatedHostProfileSocket from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocket(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocket) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteSnapshotCloneOptions) SetID(id string) *DeleteSnapshotCloneOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileVcpu : DedicatedHostProfileVcpu struct +// Models which "extend" this model: +// - DedicatedHostProfileVcpuFixed +// - DedicatedHostProfileVcpuRange +// - DedicatedHostProfileVcpuEnum +// - DedicatedHostProfileVcpuDependent +type DedicatedHostProfileVcpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetZoneName : Allow user to set ZoneName -func (_options *DeleteSnapshotCloneOptions) SetZoneName(zoneName string) *DeleteSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotCloneOptions) SetHeaders(param map[string]string) *DeleteSnapshotCloneOptions { - options.Headers = param - return options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// DeleteSnapshotOptions : The DeleteSnapshot options. -type DeleteSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// NewDeleteSnapshotOptions : Instantiate DeleteSnapshotOptions -func (*VpcV1) NewDeleteSnapshotOptions(id string) *DeleteSnapshotOptions { - return &DeleteSnapshotOptions{ - ID: core.StringPtr(id), - } + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetID : Allow user to set ID -func (_options *DeleteSnapshotOptions) SetID(id string) *DeleteSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the DedicatedHostProfileVcpu.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuTypeFixedConst = "fixed" +) -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteSnapshotOptions) SetIfMatch(ifMatch string) *DeleteSnapshotOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +func (*DedicatedHostProfileVcpu) isaDedicatedHostProfileVcpu() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotOptions) SetHeaders(param map[string]string) *DeleteSnapshotOptions { - options.Headers = param - return options +type DedicatedHostProfileVcpuIntf interface { + isaDedicatedHostProfileVcpu() bool } -// DeleteSnapshotsOptions : The DeleteSnapshots options. -type DeleteSnapshotsOptions struct { - // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. - SourceVolumeID *string `json:"source_volume.id" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSnapshotsOptions : Instantiate DeleteSnapshotsOptions -func (*VpcV1) NewDeleteSnapshotsOptions(sourceVolumeID string) *DeleteSnapshotsOptions { - return &DeleteSnapshotsOptions{ - SourceVolumeID: core.StringPtr(sourceVolumeID), +// UnmarshalDedicatedHostProfileVcpu unmarshals an instance of DedicatedHostProfileVcpu from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *DeleteSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *DeleteSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) - return _options -} +// DedicatedHostProfileVcpuArchitecture : DedicatedHostProfileVcpuArchitecture struct +type DedicatedHostProfileVcpuArchitecture struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotsOptions) SetHeaders(param map[string]string) *DeleteSnapshotsOptions { - options.Headers = param - return options + // The VCPU architecture for a dedicated host with this profile. + Value *string `json:"value" validate:"required"` } -// DeleteSubnetOptions : The DeleteSubnet options. -type DeleteSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileVcpuArchitecture.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuArchitectureTypeFixedConst = "fixed" +) -// NewDeleteSubnetOptions : Instantiate DeleteSubnetOptions -func (*VpcV1) NewDeleteSubnetOptions(id string) *DeleteSubnetOptions { - return &DeleteSubnetOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileVcpuArchitecture unmarshals an instance of DedicatedHostProfileVcpuArchitecture from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuArchitecture) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *DeleteSubnetOptions) SetID(id string) *DeleteSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileVcpuManufacturer : DedicatedHostProfileVcpuManufacturer struct +type DedicatedHostProfileVcpuManufacturer struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSubnetOptions) SetHeaders(param map[string]string) *DeleteSubnetOptions { - options.Headers = param - return options + // The VCPU manufacturer for a dedicated host with this profile. + Value *string `json:"value" validate:"required"` } -// DeleteSubnetReservedIPOptions : The DeleteSubnetReservedIP options. -type DeleteSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileVcpuManufacturer.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuManufacturerTypeFixedConst = "fixed" +) -// NewDeleteSubnetReservedIPOptions : Instantiate DeleteSubnetReservedIPOptions -func (*VpcV1) NewDeleteSubnetReservedIPOptions(subnetID string, id string) *DeleteSubnetReservedIPOptions { - return &DeleteSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileVcpuManufacturer unmarshals an instance of DedicatedHostProfileVcpuManufacturer from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuManufacturer) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSubnetID : Allow user to set SubnetID -func (_options *DeleteSubnetReservedIPOptions) SetSubnetID(subnetID string) *DeleteSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} +// DedicatedHostPrototype : DedicatedHostPrototype struct +// Models which "extend" this model: +// - DedicatedHostPrototypeDedicatedHostByGroup +// - DedicatedHostPrototypeDedicatedHostByZone +type DedicatedHostPrototype struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` -// SetID : Allow user to set ID -func (_options *DeleteSubnetReservedIPOptions) SetID(id string) *DeleteSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteSubnetReservedIPOptions) SetHeaders(param map[string]string) *DeleteSubnetReservedIPOptions { - options.Headers = param - return options -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this + // dedicated host. + Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` -// DeleteVolumeOptions : The DeleteVolume options. -type DeleteVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` + // The dedicated host group for this dedicated host. + Group DedicatedHostGroupIdentityIntf `json:"group,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The zone this dedicated host will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } -// NewDeleteVolumeOptions : Instantiate DeleteVolumeOptions -func (*VpcV1) NewDeleteVolumeOptions(id string) *DeleteVolumeOptions { - return &DeleteVolumeOptions{ - ID: core.StringPtr(id), - } +func (*DedicatedHostPrototype) isaDedicatedHostPrototype() bool { + return true } -// SetID : Allow user to set ID -func (_options *DeleteVolumeOptions) SetID(id string) *DeleteVolumeOptions { - _options.ID = core.StringPtr(id) - return _options +type DedicatedHostPrototypeIntf interface { + isaDedicatedHostPrototype() bool } -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVolumeOptions) SetIfMatch(ifMatch string) *DeleteVolumeOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// UnmarshalDedicatedHostPrototype unmarshals an instance of DedicatedHostPrototype from the specified map of raw messages. +func UnmarshalDedicatedHostPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPrototype) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *DeleteVolumeOptions) SetHeaders(param map[string]string) *DeleteVolumeOptions { - options.Headers = param - return options -} +// DedicatedHostReference : DedicatedHostReference struct +type DedicatedHostReference struct { + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` -// DeleteVPCAddressPrefixOptions : The DeleteVPCAddressPrefix options. -type DeleteVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` -// NewDeleteVPCAddressPrefixOptions : Instantiate DeleteVPCAddressPrefixOptions -func (*VpcV1) NewDeleteVPCAddressPrefixOptions(vpcID string, id string) *DeleteVPCAddressPrefixOptions { - return &DeleteVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} + // The name for this dedicated host. The name is unique across all dedicated hosts in the region. + Name *string `json:"name" validate:"required"` -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCAddressPrefixOptions) SetVPCID(vpcID string) *DeleteVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// SetID : Allow user to set ID -func (_options *DeleteVPCAddressPrefixOptions) SetID(id string) *DeleteVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the DedicatedHostReference.ResourceType property. +// The resource type. +const ( + DedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" +) -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCAddressPrefixOptions) SetHeaders(param map[string]string) *DeleteVPCAddressPrefixOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostReference unmarshals an instance of DedicatedHostReference from the specified map of raw messages. +func UnmarshalDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteVPCDnsResolutionBindingOptions : The DeleteVPCDnsResolutionBinding options. -type DeleteVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The DNS resolution binding identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type DedicatedHostReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// NewDeleteVPCDnsResolutionBindingOptions : Instantiate DeleteVPCDnsResolutionBindingOptions -func (*VpcV1) NewDeleteVPCDnsResolutionBindingOptions(vpcID string, id string) *DeleteVPCDnsResolutionBindingOptions { - return &DeleteVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostReferenceDeleted unmarshals an instance of DedicatedHostReferenceDeleted from the specified map of raw messages. +func UnmarshalDedicatedHostReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *DeleteVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} +// DefaultNetworkACL : DefaultNetworkACL struct +type DefaultNetworkACL struct { + // The date and time that the network ACL was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteVPCDnsResolutionBindingOptions) SetID(id string) *DeleteVPCDnsResolutionBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *DeleteVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` -// DeleteVPCOptions : The DeleteVPC options. -type DeleteVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` + // The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words + // at creation, but may be changed. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource group for the default network ACL for a VPC. Set to the VPC's + // resource group at creation. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// NewDeleteVPCOptions : Instantiate DeleteVPCOptions -func (*VpcV1) NewDeleteVPCOptions(id string) *DeleteVPCOptions { - return &DeleteVPCOptions{ - ID: core.StringPtr(id), - } -} + // The ordered rules for the default network ACL for a VPC. Defaults to two rules which allow all inbound and outbound + // traffic, respectively. Rules for the default network ACL may be changed, added, or removed. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteVPCOptions) SetID(id string) *DeleteVPCOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The subnets to which this network ACL is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPCOptions) SetIfMatch(ifMatch string) *DeleteVPCOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options + // The VPC this network ACL resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCOptions) SetHeaders(param map[string]string) *DeleteVPCOptions { - options.Headers = param - return options +// UnmarshalDefaultNetworkACL unmarshals an instance of DefaultNetworkACL from the specified map of raw messages. +func UnmarshalDefaultNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultNetworkACL) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// DeleteVPCRouteOptions : The DeleteVPCRoute options. -type DeleteVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// DefaultRoutingTable : DefaultRoutingTable struct +type DefaultRoutingTable struct { + // The filters specifying the resources that may create routes in this routing table. + // + // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter + // support is expected to expand in the future. + AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - // The route identifier. - ID *string `json:"id" validate:"required,ne="` + // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these + // sources. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + AdvertiseRoutesTo []string `json:"advertise_routes_to" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The date and time that this routing table was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// NewDeleteVPCRouteOptions : Instantiate DeleteVPCRouteOptions -func (*VpcV1) NewDeleteVPCRouteOptions(vpcID string, id string) *DeleteVPCRouteOptions { - return &DeleteVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} + // The URL for this routing table. + Href *string `json:"href" validate:"required"` -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRouteOptions) SetVPCID(vpcID string) *DeleteVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} + // The unique identifier for this routing table. + ID *string `json:"id" validate:"required"` -// SetID : Allow user to set ID -func (_options *DeleteVPCRouteOptions) SetID(id string) *DeleteVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} + // Indicates whether this is the default routing table for this VPC. + IsDefault *bool `json:"is_default" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRouteOptions { - options.Headers = param - return options -} + // The lifecycle state of the routing table. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// DeleteVPCRoutingTableOptions : The DeleteVPCRoutingTable options. -type DeleteVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected + // words at creation, but may be changed. + Name *string `json:"name" validate:"required"` - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Indicates whether this routing table is used to route traffic that originates from the internet. + // + // Incoming traffic will be routed according to the routing table with two exceptions: + // - Traffic destined for IP addresses associated with public gateways will not be + // subject to routes in this routing table. + // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is + // an IP address in a subnet in the route's `zone` that is able to accept traffic. + // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from from [Transit + // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` + + // The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, + // changed, or removed with a subsequent request. + Routes []RouteReference `json:"routes" validate:"required"` + + // The subnets to which this routing table is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` } -// NewDeleteVPCRoutingTableOptions : Instantiate DeleteVPCRoutingTableOptions -func (*VpcV1) NewDeleteVPCRoutingTableOptions(vpcID string, id string) *DeleteVPCRoutingTableOptions { - return &DeleteVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// Constants associated with the DefaultRoutingTable.AdvertiseRoutesTo property. +// An ingress source that routes can be advertised to: +// +// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) +// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). +const ( + DefaultRoutingTableAdvertiseRoutesToDirectLinkConst = "direct_link" + DefaultRoutingTableAdvertiseRoutesToTransitGatewayConst = "transit_gateway" +) + +// Constants associated with the DefaultRoutingTable.LifecycleState property. +// The lifecycle state of the routing table. +const ( + DefaultRoutingTableLifecycleStateDeletingConst = "deleting" + DefaultRoutingTableLifecycleStateFailedConst = "failed" + DefaultRoutingTableLifecycleStatePendingConst = "pending" + DefaultRoutingTableLifecycleStateStableConst = "stable" + DefaultRoutingTableLifecycleStateSuspendedConst = "suspended" + DefaultRoutingTableLifecycleStateUpdatingConst = "updating" + DefaultRoutingTableLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the DefaultRoutingTable.ResourceType property. +// The resource type. +const ( + DefaultRoutingTableResourceTypeRoutingTableConst = "routing_table" +) + +// UnmarshalDefaultRoutingTable unmarshals an instance of DefaultRoutingTable from the specified map of raw messages. +func UnmarshalDefaultRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultRoutingTable) + err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// DefaultSecurityGroup : DefaultSecurityGroup struct +type DefaultSecurityGroup struct { + // The date and time that this security group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` + + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` + + // The name for the default security group for a VPC. The name will be a hyphenated list of randomly-selected words at + // creation, but may changed. + Name *string `json:"name" validate:"required"` + + // The resource group for this security group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The rules for the default security group for a VPC. Defaults to allowing all outbound traffic, and allowing all + // inbound traffic from other interfaces in the VPC's default security group. Rules for the default security group may + // be changed, added or removed. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` + + // The targets for this security group. + Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` + + // The VPC this security group resides in. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// UnmarshalDefaultSecurityGroup unmarshals an instance of DefaultSecurityGroup from the specified map of raw messages. +func UnmarshalDefaultSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultSecurityGroup) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) + if err != nil { + return + } + err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DeleteBackupPolicyOptions : The DeleteBackupPolicy options. +type DeleteBackupPolicyOptions struct { + // The backup policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteBackupPolicyOptions : Instantiate DeleteBackupPolicyOptions +func (*VpcV1) NewDeleteBackupPolicyOptions(id string) *DeleteBackupPolicyOptions { + return &DeleteBackupPolicyOptions{ + ID: core.StringPtr(id), + } } // SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableOptions) SetID(id string) *DeleteVPCRoutingTableOptions { +func (_options *DeleteBackupPolicyOptions) SetID(id string) *DeleteBackupPolicyOptions { _options.ID = core.StringPtr(id) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPCRoutingTableOptions) SetIfMatch(ifMatch string) *DeleteVPCRoutingTableOptions { +func (_options *DeleteBackupPolicyOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableOptions { +func (options *DeleteBackupPolicyOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyOptions { options.Headers = param return options } -// DeleteVPCRoutingTableRouteOptions : The DeleteVPCRoutingTableRoute options. -type DeleteVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` +// DeleteBackupPolicyPlanOptions : The DeleteBackupPolicyPlan options. +type DeleteBackupPolicyPlanOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - // The VPC routing table route identifier. + // The backup policy plan identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPCRoutingTableRouteOptions : Instantiate DeleteVPCRoutingTableRouteOptions -func (*VpcV1) NewDeleteVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *DeleteVPCRoutingTableRouteOptions { - return &DeleteVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), +// NewDeleteBackupPolicyPlanOptions : Instantiate DeleteBackupPolicyPlanOptions +func (*VpcV1) NewDeleteBackupPolicyPlanOptions(backupPolicyID string, id string) *DeleteBackupPolicyPlanOptions { + return &DeleteBackupPolicyPlanOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *DeleteBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *DeleteBackupPolicyPlanOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) return _options } -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *DeleteVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *DeleteVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) +// SetID : Allow user to set ID +func (_options *DeleteBackupPolicyPlanOptions) SetID(id string) *DeleteBackupPolicyPlanOptions { + _options.ID = core.StringPtr(id) return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableRouteOptions) SetID(id string) *DeleteVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyPlanOptions { + _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableRouteOptions { +func (options *DeleteBackupPolicyPlanOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyPlanOptions { options.Headers = param return options } -// DeleteVPNGatewayConnectionOptions : The DeleteVPNGatewayConnection options. -type DeleteVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// DeleteBareMetalServerNetworkAttachmentOptions : The DeleteBareMetalServerNetworkAttachment options. +type DeleteBareMetalServerNetworkAttachmentOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The VPN gateway connection identifier. + // The bare metal server network attachment identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNGatewayConnectionOptions : Instantiate DeleteVPNGatewayConnectionOptions -func (*VpcV1) NewDeleteVPNGatewayConnectionOptions(vpnGatewayID string, id string) *DeleteVPNGatewayConnectionOptions { - return &DeleteVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// NewDeleteBareMetalServerNetworkAttachmentOptions : Instantiate DeleteBareMetalServerNetworkAttachmentOptions +func (*VpcV1) NewDeleteBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkAttachmentOptions { + return &DeleteBareMetalServerNetworkAttachmentOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *DeleteVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *DeleteVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *DeleteBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } // SetID : Allow user to set ID -func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGatewayConnectionOptions { +func (_options *DeleteBareMetalServerNetworkAttachmentOptions) SetID(id string) *DeleteBareMetalServerNetworkAttachmentOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { +func (options *DeleteBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkAttachmentOptions { options.Headers = param return options } -// DeleteVPNGatewayOptions : The DeleteVPNGateway options. -type DeleteVPNGatewayOptions struct { - // The VPN gateway identifier. +// DeleteBareMetalServerNetworkInterfaceOptions : The DeleteBareMetalServerNetworkInterface options. +type DeleteBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network interface identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNGatewayOptions : Instantiate DeleteVPNGatewayOptions -func (*VpcV1) NewDeleteVPNGatewayOptions(id string) *DeleteVPNGatewayOptions { - return &DeleteVPNGatewayOptions{ - ID: core.StringPtr(id), +// NewDeleteBareMetalServerNetworkInterfaceOptions : Instantiate DeleteBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewDeleteBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkInterfaceOptions { + return &DeleteBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + // SetID : Allow user to set ID -func (_options *DeleteVPNGatewayOptions) SetID(id string) *DeleteVPNGatewayOptions { +func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetID(id string) *DeleteBareMetalServerNetworkInterfaceOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayOptions { +func (options *DeleteBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkInterfaceOptions { options.Headers = param return options } -// DeleteVPNServerClientOptions : The DeleteVPNServerClient options. -type DeleteVPNServerClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN client identifier. +// DeleteBareMetalServerOptions : The DeleteBareMetalServer options. +type DeleteBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNServerClientOptions : Instantiate DeleteVPNServerClientOptions -func (*VpcV1) NewDeleteVPNServerClientOptions(vpnServerID string, id string) *DeleteVPNServerClientOptions { - return &DeleteVPNServerClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), +// NewDeleteBareMetalServerOptions : Instantiate DeleteBareMetalServerOptions +func (*VpcV1) NewDeleteBareMetalServerOptions(id string) *DeleteBareMetalServerOptions { + return &DeleteBareMetalServerOptions{ + ID: core.StringPtr(id), } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DeleteVPNServerClientOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - // SetID : Allow user to set ID -func (_options *DeleteVPNServerClientOptions) SetID(id string) *DeleteVPNServerClientOptions { +func (_options *DeleteBareMetalServerOptions) SetID(id string) *DeleteBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerClientOptions) SetHeaders(param map[string]string) *DeleteVPNServerClientOptions { +func (options *DeleteBareMetalServerOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerOptions { options.Headers = param return options } -// DeleteVPNServerOptions : The DeleteVPNServer options. -type DeleteVPNServerOptions struct { - // The VPN server identifier. +// DeleteDedicatedHostGroupOptions : The DeleteDedicatedHostGroup options. +type DeleteDedicatedHostGroupOptions struct { + // The dedicated host group identifier. ID *string `json:"id" validate:"required,ne="` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNServerOptions : Instantiate DeleteVPNServerOptions -func (*VpcV1) NewDeleteVPNServerOptions(id string) *DeleteVPNServerOptions { - return &DeleteVPNServerOptions{ +// NewDeleteDedicatedHostGroupOptions : Instantiate DeleteDedicatedHostGroupOptions +func (*VpcV1) NewDeleteDedicatedHostGroupOptions(id string) *DeleteDedicatedHostGroupOptions { + return &DeleteDedicatedHostGroupOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *DeleteVPNServerOptions) SetID(id string) *DeleteVPNServerOptions { +func (_options *DeleteDedicatedHostGroupOptions) SetID(id string) *DeleteDedicatedHostGroupOptions { _options.ID = core.StringPtr(id) return _options } -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPNServerOptions) SetIfMatch(ifMatch string) *DeleteVPNServerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - // SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerOptions) SetHeaders(param map[string]string) *DeleteVPNServerOptions { +func (options *DeleteDedicatedHostGroupOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostGroupOptions { options.Headers = param return options } -// DeleteVPNServerRouteOptions : The DeleteVPNServerRoute options. -type DeleteVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN route identifier. +// DeleteDedicatedHostOptions : The DeleteDedicatedHost options. +type DeleteDedicatedHostOptions struct { + // The dedicated host identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNServerRouteOptions : Instantiate DeleteVPNServerRouteOptions -func (*VpcV1) NewDeleteVPNServerRouteOptions(vpnServerID string, id string) *DeleteVPNServerRouteOptions { - return &DeleteVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), +// NewDeleteDedicatedHostOptions : Instantiate DeleteDedicatedHostOptions +func (*VpcV1) NewDeleteDedicatedHostOptions(id string) *DeleteDedicatedHostOptions { + return &DeleteDedicatedHostOptions{ + ID: core.StringPtr(id), } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DeleteVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - // SetID : Allow user to set ID -func (_options *DeleteVPNServerRouteOptions) SetID(id string) *DeleteVPNServerRouteOptions { +func (_options *DeleteDedicatedHostOptions) SetID(id string) *DeleteDedicatedHostOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerRouteOptions) SetHeaders(param map[string]string) *DeleteVPNServerRouteOptions { +func (options *DeleteDedicatedHostOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostOptions { options.Headers = param return options } -// DeprecateImageOptions : The DeprecateImage options. -type DeprecateImageOptions struct { - // The image identifier. +// DeleteEndpointGatewayOptions : The DeleteEndpointGateway options. +type DeleteEndpointGatewayOptions struct { + // The endpoint gateway identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeprecateImageOptions : Instantiate DeprecateImageOptions -func (*VpcV1) NewDeprecateImageOptions(id string) *DeprecateImageOptions { - return &DeprecateImageOptions{ +// NewDeleteEndpointGatewayOptions : Instantiate DeleteEndpointGatewayOptions +func (*VpcV1) NewDeleteEndpointGatewayOptions(id string) *DeleteEndpointGatewayOptions { + return &DeleteEndpointGatewayOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *DeprecateImageOptions) SetID(id string) *DeprecateImageOptions { +func (_options *DeleteEndpointGatewayOptions) SetID(id string) *DeleteEndpointGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeprecateImageOptions) SetHeaders(param map[string]string) *DeprecateImageOptions { +func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayOptions { options.Headers = param return options } -// DisconnectVPNClientOptions : The DisconnectVPNClient options. -type DisconnectVPNClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN client identifier. +// DeleteFloatingIPOptions : The DeleteFloatingIP options. +type DeleteFloatingIPOptions struct { + // The floating IP identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDisconnectVPNClientOptions : Instantiate DisconnectVPNClientOptions -func (*VpcV1) NewDisconnectVPNClientOptions(vpnServerID string, id string) *DisconnectVPNClientOptions { - return &DisconnectVPNClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), +// NewDeleteFloatingIPOptions : Instantiate DeleteFloatingIPOptions +func (*VpcV1) NewDeleteFloatingIPOptions(id string) *DeleteFloatingIPOptions { + return &DeleteFloatingIPOptions{ + ID: core.StringPtr(id), } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DisconnectVPNClientOptions) SetVPNServerID(vpnServerID string) *DisconnectVPNClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - // SetID : Allow user to set ID -func (_options *DisconnectVPNClientOptions) SetID(id string) *DisconnectVPNClientOptions { +func (_options *DeleteFloatingIPOptions) SetID(id string) *DeleteFloatingIPOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DisconnectVPNClientOptions) SetHeaders(param map[string]string) *DisconnectVPNClientOptions { +func (options *DeleteFloatingIPOptions) SetHeaders(param map[string]string) *DeleteFloatingIPOptions { options.Headers = param return options } -// EncryptionKeyIdentity : Identifies an encryption key by a unique property. -// Models which "extend" this model: -// - EncryptionKeyIdentityByCRN -type EncryptionKeyIdentity struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn,omitempty"` -} - -func (*EncryptionKeyIdentity) isaEncryptionKeyIdentity() bool { - return true -} +// DeleteFlowLogCollectorOptions : The DeleteFlowLogCollector options. +type DeleteFlowLogCollectorOptions struct { + // The flow log collector identifier. + ID *string `json:"id" validate:"required,ne="` -type EncryptionKeyIdentityIntf interface { - isaEncryptionKeyIdentity() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEncryptionKeyIdentity unmarshals an instance of EncryptionKeyIdentity from the specified map of raw messages. -func UnmarshalEncryptionKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +// NewDeleteFlowLogCollectorOptions : Instantiate DeleteFlowLogCollectorOptions +func (*VpcV1) NewDeleteFlowLogCollectorOptions(id string) *DeleteFlowLogCollectorOptions { + return &DeleteFlowLogCollectorOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EncryptionKeyReference : EncryptionKeyReference struct -type EncryptionKeyReference struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteFlowLogCollectorOptions) SetID(id string) *DeleteFlowLogCollectorOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalEncryptionKeyReference unmarshals an instance of EncryptionKeyReference from the specified map of raw messages. -func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteFlowLogCollectorOptions) SetHeaders(param map[string]string) *DeleteFlowLogCollectorOptions { + options.Headers = param + return options } -// EndpointGateway : EndpointGateway struct -type EndpointGateway struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding" validate:"required"` +// DeleteIkePolicyOptions : The DeleteIkePolicy options. +type DeleteIkePolicyOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The date and time that the endpoint gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` +// NewDeleteIkePolicyOptions : Instantiate DeleteIkePolicyOptions +func (*VpcV1) NewDeleteIkePolicyOptions(id string) *DeleteIkePolicyOptions { + return &DeleteIkePolicyOptions{ + ID: core.StringPtr(id), + } +} - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteIkePolicyOptions) SetID(id string) *DeleteIkePolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteIkePolicyOptions) SetHeaders(param map[string]string) *DeleteIkePolicyOptions { + options.Headers = param + return options +} - // The reserved IPs bound to this endpoint gateway. - Ips []ReservedIPReference `json:"ips" validate:"required"` +// DeleteImageExportJobOptions : The DeleteImageExportJob options. +type DeleteImageExportJobOptions struct { + // The image identifier. + ImageID *string `json:"image_id" validate:"required,ne="` - // The reasons for the current `lifecycle_state` (if any): - // - `dns_resolution_binding_pending`: the DNS resolution binding is being set up. - LifecycleReasons []EndpointGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // The image export job identifier. + ID *string `json:"id" validate:"required,ne="` - // The lifecycle state of the endpoint gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` +// NewDeleteImageExportJobOptions : Instantiate DeleteImageExportJobOptions +func (*VpcV1) NewDeleteImageExportJobOptions(imageID string, id string) *DeleteImageExportJobOptions { + return &DeleteImageExportJobOptions{ + ImageID: core.StringPtr(imageID), + ID: core.StringPtr(id), + } +} - // The resource group for this endpoint gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetImageID : Allow user to set ImageID +func (_options *DeleteImageExportJobOptions) SetImageID(imageID string) *DeleteImageExportJobOptions { + _options.ImageID = core.StringPtr(imageID) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteImageExportJobOptions) SetID(id string) *DeleteImageExportJobOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The security groups targeting this endpoint gateway. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteImageExportJobOptions) SetHeaders(param map[string]string) *DeleteImageExportJobOptions { + options.Headers = param + return options +} - // The fully qualified domain name for the target service. - // Deprecated: this field is deprecated and may be removed in a future release. - ServiceEndpoint *string `json:"service_endpoint,omitempty"` +// DeleteImageOptions : The DeleteImage options. +type DeleteImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` - // The fully qualified domain names for the target service. - ServiceEndpoints []string `json:"service_endpoints" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The target for this endpoint gateway. - Target EndpointGatewayTargetIntf `json:"target" validate:"required"` +// NewDeleteImageOptions : Instantiate DeleteImageOptions +func (*VpcV1) NewDeleteImageOptions(id string) *DeleteImageOptions { + return &DeleteImageOptions{ + ID: core.StringPtr(id), + } +} - // The VPC this endpoint gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteImageOptions) SetID(id string) *DeleteImageOptions { + _options.ID = core.StringPtr(id) + return _options } -// Constants associated with the EndpointGateway.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - EndpointGatewayHealthStateDegradedConst = "degraded" - EndpointGatewayHealthStateFaultedConst = "faulted" - EndpointGatewayHealthStateInapplicableConst = "inapplicable" - EndpointGatewayHealthStateOkConst = "ok" -) +// SetHeaders : Allow user to set Headers +func (options *DeleteImageOptions) SetHeaders(param map[string]string) *DeleteImageOptions { + options.Headers = param + return options +} -// Constants associated with the EndpointGateway.LifecycleState property. -// The lifecycle state of the endpoint gateway. -const ( - EndpointGatewayLifecycleStateDeletingConst = "deleting" - EndpointGatewayLifecycleStateFailedConst = "failed" - EndpointGatewayLifecycleStatePendingConst = "pending" - EndpointGatewayLifecycleStateStableConst = "stable" - EndpointGatewayLifecycleStateSuspendedConst = "suspended" - EndpointGatewayLifecycleStateUpdatingConst = "updating" - EndpointGatewayLifecycleStateWaitingConst = "waiting" -) +// DeleteInstanceGroupLoadBalancerOptions : The DeleteInstanceGroupLoadBalancer options. +type DeleteInstanceGroupLoadBalancerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` -// Constants associated with the EndpointGateway.ResourceType property. -// The resource type. -const ( - EndpointGatewayResourceTypeEndpointGatewayConst = "endpoint_gateway" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalEndpointGateway unmarshals an instance of EndpointGateway from the specified map of raw messages. -func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGateway) - err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoints", &obj.ServiceEndpoints) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return +// NewDeleteInstanceGroupLoadBalancerOptions : Instantiate DeleteInstanceGroupLoadBalancerOptions +func (*VpcV1) NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { + return &DeleteInstanceGroupLoadBalancerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayCollection : EndpointGatewayCollection struct -type EndpointGatewayCollection struct { - // Collection of endpoint gateways. - EndpointGateways []EndpointGateway `json:"endpoint_gateways" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupLoadBalancerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // A link to the first page of resources. - First *EndpointGatewayCollectionFirst `json:"first" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupLoadBalancerOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// DeleteInstanceGroupManagerActionOptions : The DeleteInstanceGroupManagerAction options. +type DeleteInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *EndpointGatewayCollectionNext `json:"next,omitempty"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + // The instance group manager action identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalEndpointGatewayCollection unmarshals an instance of EndpointGatewayCollection from the specified map of raw messages. -func UnmarshalEndpointGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollection) - err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGateway) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalEndpointGatewayCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalEndpointGatewayCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *EndpointGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// NewDeleteInstanceGroupManagerActionOptions : Instantiate DeleteInstanceGroupManagerActionOptions +func (*VpcV1) NewDeleteInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerActionOptions { + return &DeleteInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } - return start, nil } -// EndpointGatewayCollectionFirst : A link to the first page of resources. -type EndpointGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// UnmarshalEndpointGatewayCollectionFirst unmarshals an instance of EndpointGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// EndpointGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type EndpointGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceGroupManagerActionOptions) SetID(id string) *DeleteInstanceGroupManagerActionOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalEndpointGatewayCollectionNext unmarshals an instance of EndpointGatewayCollectionNext from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerActionOptions { + options.Headers = param + return options } -// EndpointGatewayLifecycleReason : EndpointGatewayLifecycleReason struct -type EndpointGatewayLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` +// DeleteInstanceGroupManagerOptions : The DeleteInstanceGroupManager options. +type DeleteInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` + // The instance group manager identifier. + ID *string `json:"id" validate:"required,ne="` - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the EndpointGatewayLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - EndpointGatewayLifecycleReasonCodeDnsResolutionBindingPendingConst = "dns_resolution_binding_pending" - EndpointGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalEndpointGatewayLifecycleReason unmarshals an instance of EndpointGatewayLifecycleReason from the specified map of raw messages. -func UnmarshalEndpointGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewDeleteInstanceGroupManagerOptions : Instantiate DeleteInstanceGroupManagerOptions +func (*VpcV1) NewDeleteInstanceGroupManagerOptions(instanceGroupID string, id string) *DeleteInstanceGroupManagerOptions { + return &DeleteInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayPatch : EndpointGatewayPatch struct -type EndpointGatewayPatch struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. - Name *string `json:"name,omitempty"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceGroupManagerOptions) SetID(id string) *DeleteInstanceGroupManagerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalEndpointGatewayPatch unmarshals an instance of EndpointGatewayPatch from the specified map of raw messages. -func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayPatch) - err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupManagerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerOptions { + options.Headers = param + return options } -// AsPatch returns a generic map representation of the EndpointGatewayPatch -func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(endpointGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// DeleteInstanceGroupManagerPolicyOptions : The DeleteInstanceGroupManagerPolicy options. +type DeleteInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteInstanceGroupManagerPolicyOptions : Instantiate DeleteInstanceGroupManagerPolicyOptions +func (*VpcV1) NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerPolicyOptions { + return &DeleteInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } - return } -// EndpointGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type EndpointGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// UnmarshalEndpointGatewayReferenceDeleted unmarshals an instance of EndpointGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalEndpointGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// EndpointGatewayReferenceRemote : EndpointGatewayReferenceRemote struct -type EndpointGatewayReferenceRemote struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetID(id string) *DeleteInstanceGroupManagerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerPolicyOptions { + options.Headers = param + return options +} - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` +// DeleteInstanceGroupMembershipOptions : The DeleteInstanceGroupMembership options. +type DeleteInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` + // The instance group membership identifier. + ID *string `json:"id" validate:"required,ne="` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *EndpointGatewayRemote `json:"remote,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewDeleteInstanceGroupMembershipOptions : Instantiate DeleteInstanceGroupMembershipOptions +func (*VpcV1) NewDeleteInstanceGroupMembershipOptions(instanceGroupID string, id string) *DeleteInstanceGroupMembershipOptions { + return &DeleteInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + } } -// Constants associated with the EndpointGatewayReferenceRemote.ResourceType property. -// The resource type. -const ( - EndpointGatewayReferenceRemoteResourceTypeEndpointGatewayConst = "endpoint_gateway" -) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} -// UnmarshalEndpointGatewayReferenceRemote unmarshals an instance of EndpointGatewayReferenceRemote from the specified map of raw messages. -func UnmarshalEndpointGatewayReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReferenceRemote) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalEndpointGatewayRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *DeleteInstanceGroupMembershipOptions) SetID(id string) *DeleteInstanceGroupMembershipOptions { + _options.ID = core.StringPtr(id) + return _options } -// EndpointGatewayRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type EndpointGatewayRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipOptions { + options.Headers = param + return options +} - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` +// DeleteInstanceGroupMembershipsOptions : The DeleteInstanceGroupMemberships options. +type DeleteInstanceGroupMembershipsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEndpointGatewayRemote unmarshals an instance of EndpointGatewayRemote from the specified map of raw messages. -func UnmarshalEndpointGatewayRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return +// NewDeleteInstanceGroupMembershipsOptions : Instantiate DeleteInstanceGroupMembershipsOptions +func (*VpcV1) NewDeleteInstanceGroupMembershipsOptions(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { + return &DeleteInstanceGroupMembershipsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayReservedIP : A reserved IP to bind to the endpoint gateway. This can be specified using an existing reserved IP, or a prototype -// object for a new reserved IP. The reserved IP will be bound to the endpoint gateway to function as a virtual private -// endpoint for the service. -// Models which "extend" this model: -// - EndpointGatewayReservedIPReservedIPIdentity -// - EndpointGatewayReservedIPReservedIPPrototypeTargetContext -type EndpointGatewayReservedIP struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipsOptions { + options.Headers = param + return options +} - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` +// DeleteInstanceGroupOptions : The DeleteInstanceGroup options. +type DeleteInstanceGroupOptions struct { + // The instance group identifier. + ID *string `json:"id" validate:"required,ne="` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` +// NewDeleteInstanceGroupOptions : Instantiate DeleteInstanceGroupOptions +func (*VpcV1) NewDeleteInstanceGroupOptions(id string) *DeleteInstanceGroupOptions { + return &DeleteInstanceGroupOptions{ + ID: core.StringPtr(id), + } +} - // The subnet in which to create this reserved IP. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceGroupOptions) SetID(id string) *DeleteInstanceGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*EndpointGatewayReservedIP) isaEndpointGatewayReservedIP() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceGroupOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupOptions { + options.Headers = param + return options } -type EndpointGatewayReservedIPIntf interface { - isaEndpointGatewayReservedIP() bool +// DeleteInstanceNetworkAttachmentOptions : The DeleteInstanceNetworkAttachment options. +type DeleteInstanceNetworkAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The instance network attachment identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEndpointGatewayReservedIP unmarshals an instance of EndpointGatewayReservedIP from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIP) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return +// NewDeleteInstanceNetworkAttachmentOptions : Instantiate DeleteInstanceNetworkAttachmentOptions +func (*VpcV1) NewDeleteInstanceNetworkAttachmentOptions(instanceID string, id string) *DeleteInstanceNetworkAttachmentOptions { + return &DeleteInstanceNetworkAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayTarget : The target for this endpoint gateway. -// Models which "extend" this model: -// - EndpointGatewayTargetProviderCloudServiceReference -// - EndpointGatewayTargetProviderInfrastructureServiceReference -type EndpointGatewayTarget struct { - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *DeleteInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The type of target. - ResourceType *string `json:"resource_type,omitempty"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceNetworkAttachmentOptions) SetID(id string) *DeleteInstanceNetworkAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkAttachmentOptions { + options.Headers = param + return options } -// Constants associated with the EndpointGatewayTarget.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetResourceTypeProviderCloudServiceConst = "provider_cloud_service" -) +// DeleteInstanceNetworkInterfaceOptions : The DeleteInstanceNetworkInterface options. +type DeleteInstanceNetworkInterfaceOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` -func (*EndpointGatewayTarget) isaEndpointGatewayTarget() bool { - return true -} + // The instance network interface identifier. + ID *string `json:"id" validate:"required,ne="` -type EndpointGatewayTargetIntf interface { - isaEndpointGatewayTarget() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEndpointGatewayTarget unmarshals an instance of EndpointGatewayTarget from the specified map of raw messages. -func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewDeleteInstanceNetworkInterfaceOptions : Instantiate DeleteInstanceNetworkInterfaceOptions +func (*VpcV1) NewDeleteInstanceNetworkInterfaceOptions(instanceID string, id string) *DeleteInstanceNetworkInterfaceOptions { + return &DeleteInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayTargetPrototype : The target to use for this endpoint gateway. Must not already be the target of another endpoint gateway in the VPC. -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity -// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity -type EndpointGatewayTargetPrototype struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *DeleteInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` +// SetID : Allow user to set ID +func (_options *DeleteInstanceNetworkInterfaceOptions) SetID(id string) *DeleteInstanceNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkInterfaceOptions { + options.Headers = param + return options } -// Constants associated with the EndpointGatewayTargetPrototype.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) +// DeleteInstanceOptions : The DeleteInstance options. +type DeleteInstanceOptions struct { + // The virtual server instance identifier. + ID *string `json:"id" validate:"required,ne="` -func (*EndpointGatewayTargetPrototype) isaEndpointGatewayTargetPrototype() bool { - return true -} + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` -type EndpointGatewayTargetPrototypeIntf interface { - isaEndpointGatewayTargetPrototype() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEndpointGatewayTargetPrototype unmarshals an instance of EndpointGatewayTargetPrototype from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "resource_type", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'resource_type': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'resource_type' not found in JSON object") - return - } - if discValue == "provider_cloud_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity) - } else if discValue == "provider_infrastructure_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'resource_type': %s", discValue) +// NewDeleteInstanceOptions : Instantiate DeleteInstanceOptions +func (*VpcV1) NewDeleteInstanceOptions(id string) *DeleteInstanceOptions { + return &DeleteInstanceOptions{ + ID: core.StringPtr(id), } - return } -// FailoverShareOptions : The FailoverShare options. -type FailoverShareOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` +// SetID : Allow user to set ID +func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The action to take if the failover request is accepted but cannot be performed or times out: - // - `fail`: Fail the operation, resulting in the replication relationship being unchanged. - // - `split`: Split the replica from its source, resulting in two individual read-write - // file shares. Because the final sync was not completed, the replica may be - // out-of-date. This occurs in disaster recovery scenarios where the source is known to - // be unreachable. - FallbackPolicy *string `json:"fallback_policy,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteInstanceOptions) SetIfMatch(ifMatch string) *DeleteInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The failover timeout in seconds. - // - // If the timeout is reached, the `fallback_policy` will be triggered. - Timeout *int64 `json:"timeout,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { + options.Headers = param + return options +} + +// DeleteInstanceTemplateOptions : The DeleteInstanceTemplate options. +type DeleteInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the FailoverShareOptions.FallbackPolicy property. -// The action to take if the failover request is accepted but cannot be performed or times out: -// - `fail`: Fail the operation, resulting in the replication relationship being unchanged. -// - `split`: Split the replica from its source, resulting in two individual read-write -// file shares. Because the final sync was not completed, the replica may be -// out-of-date. This occurs in disaster recovery scenarios where the source is known to -// be unreachable. -const ( - FailoverShareOptionsFallbackPolicyFailConst = "fail" - FailoverShareOptionsFallbackPolicySplitConst = "split" -) - -// NewFailoverShareOptions : Instantiate FailoverShareOptions -func (*VpcV1) NewFailoverShareOptions(shareID string) *FailoverShareOptions { - return &FailoverShareOptions{ - ShareID: core.StringPtr(shareID), +// NewDeleteInstanceTemplateOptions : Instantiate DeleteInstanceTemplateOptions +func (*VpcV1) NewDeleteInstanceTemplateOptions(id string) *DeleteInstanceTemplateOptions { + return &DeleteInstanceTemplateOptions{ + ID: core.StringPtr(id), } } -// SetShareID : Allow user to set ShareID -func (_options *FailoverShareOptions) SetShareID(shareID string) *FailoverShareOptions { - _options.ShareID = core.StringPtr(shareID) +// SetID : Allow user to set ID +func (_options *DeleteInstanceTemplateOptions) SetID(id string) *DeleteInstanceTemplateOptions { + _options.ID = core.StringPtr(id) return _options } -// SetFallbackPolicy : Allow user to set FallbackPolicy -func (_options *FailoverShareOptions) SetFallbackPolicy(fallbackPolicy string) *FailoverShareOptions { - _options.FallbackPolicy = core.StringPtr(fallbackPolicy) +// SetHeaders : Allow user to set Headers +func (options *DeleteInstanceTemplateOptions) SetHeaders(param map[string]string) *DeleteInstanceTemplateOptions { + options.Headers = param + return options +} + +// DeleteInstanceVolumeAttachmentOptions : The DeleteInstanceVolumeAttachment options. +type DeleteInstanceVolumeAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The volume attachment identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteInstanceVolumeAttachmentOptions : Instantiate DeleteInstanceVolumeAttachmentOptions +func (*VpcV1) NewDeleteInstanceVolumeAttachmentOptions(instanceID string, id string) *DeleteInstanceVolumeAttachmentOptions { + return &DeleteInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *DeleteInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetTimeout : Allow user to set Timeout -func (_options *FailoverShareOptions) SetTimeout(timeout int64) *FailoverShareOptions { - _options.Timeout = core.Int64Ptr(timeout) +// SetID : Allow user to set ID +func (_options *DeleteInstanceVolumeAttachmentOptions) SetID(id string) *DeleteInstanceVolumeAttachmentOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *FailoverShareOptions) SetHeaders(param map[string]string) *FailoverShareOptions { +func (options *DeleteInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceVolumeAttachmentOptions { options.Headers = param return options } -// FloatingIP : FloatingIP struct -type FloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` +// DeleteIpsecPolicyOptions : The DeleteIpsecPolicy options. +type DeleteIpsecPolicyOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The date and time that the floating IP was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` +// NewDeleteIpsecPolicyOptions : Instantiate DeleteIpsecPolicyOptions +func (*VpcV1) NewDeleteIpsecPolicyOptions(id string) *DeleteIpsecPolicyOptions { + return &DeleteIpsecPolicyOptions{ + ID: core.StringPtr(id), + } +} - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteIpsecPolicyOptions) SetID(id string) *DeleteIpsecPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteIpsecPolicyOptions) SetHeaders(param map[string]string) *DeleteIpsecPolicyOptions { + options.Headers = param + return options +} - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` +// DeleteKeyOptions : The DeleteKey options. +type DeleteKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource group for this floating IP. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The status of the floating IP. - Status *string `json:"status" validate:"required"` +// NewDeleteKeyOptions : Instantiate DeleteKeyOptions +func (*VpcV1) NewDeleteKeyOptions(id string) *DeleteKeyOptions { + return &DeleteKeyOptions{ + ID: core.StringPtr(id), + } +} - // The target of this floating IP. - Target FloatingIPTargetIntf `json:"target,omitempty"` +// SetID : Allow user to set ID +func (_options *DeleteKeyOptions) SetID(id string) *DeleteKeyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The zone this floating IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *DeleteKeyOptions) SetHeaders(param map[string]string) *DeleteKeyOptions { + options.Headers = param + return options } -// Constants associated with the FloatingIP.Status property. -// The status of the floating IP. -const ( - FloatingIPStatusAvailableConst = "available" - FloatingIPStatusDeletingConst = "deleting" - FloatingIPStatusFailedConst = "failed" - FloatingIPStatusPendingConst = "pending" -) +// DeleteLoadBalancerListenerOptions : The DeleteLoadBalancerListener options. +type DeleteLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` -// UnmarshalFloatingIP unmarshals an instance of FloatingIP from the specified map of raw messages. -func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteLoadBalancerListenerOptions : Instantiate DeleteLoadBalancerListenerOptions +func (*VpcV1) NewDeleteLoadBalancerListenerOptions(loadBalancerID string, id string) *DeleteLoadBalancerListenerOptions { + return &DeleteLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// FloatingIPCollection : FloatingIPCollection struct -type FloatingIPCollection struct { - // A link to the first page of resources. - First *FloatingIPCollectionFirst `json:"first" validate:"required"` - - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *FloatingIPCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalFloatingIPCollection unmarshals an instance of FloatingIPCollection from the specified map of raw messages. -func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerOptions) SetID(id string) *DeleteLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *FloatingIPCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerListenerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerOptions { + options.Headers = param + return options } -// FloatingIPCollectionFirst : A link to the first page of resources. -type FloatingIPCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} +// DeleteLoadBalancerListenerPolicyOptions : The DeleteLoadBalancerListenerPolicy options. +type DeleteLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` -// UnmarshalFloatingIPCollectionFirst unmarshals an instance of FloatingIPCollectionFirst from the specified map of raw messages. -func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` -// FloatingIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FloatingIPCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // The policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalFloatingIPCollectionNext unmarshals an instance of FloatingIPCollectionNext from the specified map of raw messages. -func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewDeleteLoadBalancerListenerPolicyOptions : Instantiate DeleteLoadBalancerListenerPolicyOptions +func (*VpcV1) NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *DeleteLoadBalancerListenerPolicyOptions { + return &DeleteLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// FloatingIPPatch : FloatingIPPatch struct -type FloatingIPPatch struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. - Name *string `json:"name,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The target resource to bind this floating IP to, replacing any existing binding. - // The floating IP must not be required by another resource, such as a public gateway. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true`. - Target FloatingIPTargetPatchIntf `json:"target,omitempty"` +// SetListenerID : Allow user to set ListenerID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -// UnmarshalFloatingIPPatch unmarshals an instance of FloatingIPPatch from the specified map of raw messages. -func UnmarshalFloatingIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// AsPatch returns a generic map representation of the FloatingIPPatch -func (floatingIPPatch *FloatingIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(floatingIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyOptions { + options.Headers = param + return options } -// FloatingIPPrototype : FloatingIPPrototype struct -// Models which "extend" this model: -// - FloatingIPPrototypeFloatingIPByZone -// - FloatingIPPrototypeFloatingIPByTarget -type FloatingIPPrototype struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// DeleteLoadBalancerListenerPolicyRuleOptions : The DeleteLoadBalancerListenerPolicyRule options. +type DeleteLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // The zone this floating IP will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` - // The target resource to bind this floating IP to. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true`. - Target FloatingIPTargetPrototypeIntf `json:"target,omitempty"` + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -func (*FloatingIPPrototype) isaFloatingIPPrototype() bool { - return true +// NewDeleteLoadBalancerListenerPolicyRuleOptions : Instantiate DeleteLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *DeleteLoadBalancerListenerPolicyRuleOptions { + return &DeleteLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), + } } -type FloatingIPPrototypeIntf interface { - isaFloatingIPPrototype() bool +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalFloatingIPPrototype unmarshals an instance of FloatingIPPrototype from the specified map of raw messages. -func UnmarshalFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetListenerID : Allow user to set ListenerID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -// FloatingIPReference : FloatingIPReference struct -type FloatingIPReference struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` +// SetPolicyID : Allow user to set PolicyID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyRuleOptions { + options.Headers = param + return options +} - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` +// DeleteLoadBalancerOptions : The DeleteLoadBalancer options. +type DeleteLoadBalancerOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalFloatingIPReference unmarshals an instance of FloatingIPReference from the specified map of raw messages. -func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewDeleteLoadBalancerOptions : Instantiate DeleteLoadBalancerOptions +func (*VpcV1) NewDeleteLoadBalancerOptions(id string) *DeleteLoadBalancerOptions { + return &DeleteLoadBalancerOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// FloatingIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type FloatingIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerOptions) SetID(id string) *DeleteLoadBalancerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalFloatingIPReferenceDeleted unmarshals an instance of FloatingIPReferenceDeleted from the specified map of raw messages. -func UnmarshalFloatingIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteLoadBalancerOptions) SetIfMatch(ifMatch string) *DeleteLoadBalancerOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options } -// FloatingIPTarget : The target of this floating IP. -// Models which "extend" this model: -// - FloatingIPTargetNetworkInterfaceReference -// - FloatingIPTargetBareMetalServerNetworkInterfaceReference -// - FloatingIPTargetPublicGatewayReference -type FloatingIPTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerOptions { + options.Headers = param + return options +} - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` +// DeleteLoadBalancerPoolMemberOptions : The DeleteLoadBalancerPoolMember options. +type DeleteLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The name for this instance network interface. - Name *string `json:"name,omitempty"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` + // The member identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` +// NewDeleteLoadBalancerPoolMemberOptions : Instantiate DeleteLoadBalancerPoolMemberOptions +func (*VpcV1) NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *DeleteLoadBalancerPoolMemberOptions { + return &DeleteLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), + } } -// Constants associated with the FloatingIPTarget.ResourceType property. -// The resource type. -const ( - FloatingIPTargetResourceTypeNetworkInterfaceConst = "network_interface" -) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} -func (*FloatingIPTarget) isaFloatingIPTarget() bool { - return true +// SetPoolID : Allow user to set PoolID +func (_options *DeleteLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *DeleteLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) + return _options } -type FloatingIPTargetIntf interface { - isaFloatingIPTarget() bool +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerPoolMemberOptions) SetID(id string) *DeleteLoadBalancerPoolMemberOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalFloatingIPTarget unmarshals an instance of FloatingIPTarget from the specified map of raw messages. -func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolMemberOptions { + options.Headers = param + return options } -// FloatingIPTargetPatch : The target resource to bind this floating IP to, replacing any existing binding. The floating IP must not be required -// by another resource, such as a public gateway. -// -// The target resource must not already have a floating IP bound to it if the target resource is: -// -// - an instance network interface -// - a bare metal server network interface with `enable_infrastructure_nat` set to `true`. -// Models which "extend" this model: -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -// - FloatingIPTargetPatchNetworkInterfaceIdentity -type FloatingIPTargetPatch struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id,omitempty"` +// DeleteLoadBalancerPoolOptions : The DeleteLoadBalancerPool options. +type DeleteLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The URL for this bare metal server network interface. - Href *string `json:"href,omitempty"` + // The pool identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -func (*FloatingIPTargetPatch) isaFloatingIPTargetPatch() bool { - return true +// NewDeleteLoadBalancerPoolOptions : Instantiate DeleteLoadBalancerPoolOptions +func (*VpcV1) NewDeleteLoadBalancerPoolOptions(loadBalancerID string, id string) *DeleteLoadBalancerPoolOptions { + return &DeleteLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + } } -type FloatingIPTargetPatchIntf interface { - isaFloatingIPTargetPatch() bool +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalFloatingIPTargetPatch unmarshals an instance of FloatingIPTargetPatch from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerPoolOptions) SetID(id string) *DeleteLoadBalancerPoolOptions { + _options.ID = core.StringPtr(id) + return _options } -// FloatingIPTargetPrototype : The target resource to bind this floating IP to. -// -// The target resource must not already have a floating IP bound to it if the target resource is: -// -// - an instance network interface -// - a bare metal server network interface with `enable_infrastructure_nat` set to `true`. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -// - FloatingIPTargetPrototypeNetworkInterfaceIdentity -type FloatingIPTargetPrototype struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPrototype) isaFloatingIPTargetPrototype() bool { - return true -} - -type FloatingIPTargetPrototypeIntf interface { - isaFloatingIPTargetPrototype() bool -} - -// UnmarshalFloatingIPTargetPrototype unmarshals an instance of FloatingIPTargetPrototype from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPUnpaginatedCollection : FloatingIPUnpaginatedCollection struct -type FloatingIPUnpaginatedCollection struct { - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` -} - -// UnmarshalFloatingIPUnpaginatedCollection unmarshals an instance of FloatingIPUnpaginatedCollection from the specified map of raw messages. -func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPUnpaginatedCollection) - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollector : FlowLogCollector struct -type FlowLogCollector struct { - // Indicates whether this collector is active. - Active *bool `json:"active" validate:"required"` - - // Indicates whether this flow log collector will be automatically deleted when `target` is deleted. At present, this - // is always `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the flow log collector was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this flow log collector. - CRN *string `json:"crn" validate:"required"` - - // The URL for this flow log collector. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this flow log collector. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the flow log collector. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this flow log collector. The name is unique across all flow log collectors in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this flow log collector. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The Cloud Object Storage bucket where the collected flows are logged. For more - // information, see [Viewing flow log - // objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). - StorageBucket *LegacyCloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` - - // The target this collector is collecting flow logs for. - // - If the target is an instance network interface, flow logs will be collected - // for that instance network interface. - // - If the target is a virtual server instance, flow logs will be collected - // for all network interfaces on that instance. - // - If the target is a subnet, flow logs will be collected - // for all instance network interfaces attached to that subnet. - // - If the target is a VPC, flow logs will be collected for instance network interfaces - // attached to all subnets within that VPC. - // If the target is an instance, subnet, or VPC, flow logs will not be collected - // for any instance network interfaces within the target that are themselves the target of - // a more specific flow log collector. - Target FlowLogCollectorTargetIntf `json:"target" validate:"required"` - - // The VPC this flow log collector resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the FlowLogCollector.LifecycleState property. -// The lifecycle state of the flow log collector. -const ( - FlowLogCollectorLifecycleStateDeletingConst = "deleting" - FlowLogCollectorLifecycleStateFailedConst = "failed" - FlowLogCollectorLifecycleStatePendingConst = "pending" - FlowLogCollectorLifecycleStateStableConst = "stable" - FlowLogCollectorLifecycleStateSuspendedConst = "suspended" - FlowLogCollectorLifecycleStateUpdatingConst = "updating" - FlowLogCollectorLifecycleStateWaitingConst = "waiting" -) - -// UnmarshalFlowLogCollector unmarshals an instance of FlowLogCollector from the specified map of raw messages. -func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollector) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalLegacyCloudObjectStorageBucketReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFlowLogCollectorTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorCollection : FlowLogCollectorCollection struct -type FlowLogCollectorCollection struct { - // A link to the first page of resources. - First *FlowLogCollectorCollectionFirst `json:"first" validate:"required"` - - // Collection of flow log collectors. - FlowLogCollectors []FlowLogCollector `json:"flow_log_collectors" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *FlowLogCollectorCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalFlowLogCollectorCollection unmarshals an instance of FlowLogCollectorCollection from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFlowLogCollectorCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "flow_log_collectors", &obj.FlowLogCollectors, UnmarshalFlowLogCollector) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFlowLogCollectorCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerPoolOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolOptions { + options.Headers = param + return options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} +// DeleteNetworkACLOptions : The DeleteNetworkACL options. +type DeleteNetworkACLOptions struct { + // The network ACL identifier. + ID *string `json:"id" validate:"required,ne="` -// FlowLogCollectorCollectionFirst : A link to the first page of resources. -type FlowLogCollectorCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalFlowLogCollectorCollectionFirst unmarshals an instance of FlowLogCollectorCollectionFirst from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewDeleteNetworkACLOptions : Instantiate DeleteNetworkACLOptions +func (*VpcV1) NewDeleteNetworkACLOptions(id string) *DeleteNetworkACLOptions { + return &DeleteNetworkACLOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// FlowLogCollectorCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FlowLogCollectorCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeleteNetworkACLOptions) SetID(id string) *DeleteNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalFlowLogCollectorCollectionNext unmarshals an instance of FlowLogCollectorCollectionNext from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeleteNetworkACLOptions) SetHeaders(param map[string]string) *DeleteNetworkACLOptions { + options.Headers = param + return options } -// FlowLogCollectorPatch : FlowLogCollectorPatch struct -type FlowLogCollectorPatch struct { - // Indicates whether this collector is active. Updating to false deactivates the collector and updating to true - // activates the collector. - Active *bool `json:"active,omitempty"` +// DeleteNetworkACLRuleOptions : The DeleteNetworkACLRule options. +type DeleteNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. - Name *string `json:"name,omitempty"` -} + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalFlowLogCollectorPatch unmarshals an instance of FlowLogCollectorPatch from the specified map of raw messages. -func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// AsPatch returns a generic map representation of the FlowLogCollectorPatch -func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(flowLogCollectorPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NewDeleteNetworkACLRuleOptions : Instantiate DeleteNetworkACLRuleOptions +func (*VpcV1) NewDeleteNetworkACLRuleOptions(networkACLID string, id string) *DeleteNetworkACLRuleOptions { + return &DeleteNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), } - return -} - -// FlowLogCollectorTarget : The target this collector is collecting flow logs for. -// - If the target is an instance network interface, flow logs will be collected -// for that instance network interface. -// - If the target is a virtual server instance, flow logs will be collected -// for all network interfaces on that instance. -// - If the target is a subnet, flow logs will be collected -// for all instance network interfaces attached to that subnet. -// - If the target is a VPC, flow logs will be collected for instance network interfaces -// attached to all subnets within that VPC. If the target is an instance, subnet, or VPC, flow logs will not be -// -// collected for any instance network interfaces within the target that are themselves the target of a more specific -// flow log collector. -// Models which "extend" this model: -// - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext -// - FlowLogCollectorTargetInstanceReference -// - FlowLogCollectorTargetSubnetReference -// - FlowLogCollectorTargetVPCReference -type FlowLogCollectorTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` - - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` - - // The name for this instance network interface. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` -} - -// Constants associated with the FlowLogCollectorTarget.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FlowLogCollectorTarget) isaFlowLogCollectorTarget() bool { - return true } -type FlowLogCollectorTargetIntf interface { - isaFlowLogCollectorTarget() bool +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *DeleteNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *DeleteNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options } -// UnmarshalFlowLogCollectorTarget unmarshals an instance of FlowLogCollectorTarget from the specified map of raw messages. -func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *DeleteNetworkACLRuleOptions) SetID(id string) *DeleteNetworkACLRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -// FlowLogCollectorTargetPrototype : The target this collector will collect flow logs for. If the target is an instance, subnet, or VPC, flow logs will -// not be collected for any instance network interfaces within the target that are themselves the target of a more -// specific flow log collector. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -// - FlowLogCollectorTargetPrototypeInstanceIdentity -// - FlowLogCollectorTargetPrototypeSubnetIdentity -// - FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototype struct { - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *DeleteNetworkACLRuleOptions) SetHeaders(param map[string]string) *DeleteNetworkACLRuleOptions { + options.Headers = param + return options } -func (*FlowLogCollectorTargetPrototype) isaFlowLogCollectorTargetPrototype() bool { - return true -} +// DeletePlacementGroupOptions : The DeletePlacementGroup options. +type DeletePlacementGroupOptions struct { + // The placement group identifier. + ID *string `json:"id" validate:"required,ne="` -type FlowLogCollectorTargetPrototypeIntf interface { - isaFlowLogCollectorTargetPrototype() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalFlowLogCollectorTargetPrototype unmarshals an instance of FlowLogCollectorTargetPrototype from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +// NewDeletePlacementGroupOptions : Instantiate DeletePlacementGroupOptions +func (*VpcV1) NewDeletePlacementGroupOptions(id string) *DeletePlacementGroupOptions { + return &DeletePlacementGroupOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// GenericResourceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type GenericResourceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *DeletePlacementGroupOptions) SetID(id string) *DeletePlacementGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalGenericResourceReferenceDeleted unmarshals an instance of GenericResourceReferenceDeleted from the specified map of raw messages. -func UnmarshalGenericResourceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GenericResourceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *DeletePlacementGroupOptions) SetHeaders(param map[string]string) *DeletePlacementGroupOptions { + options.Headers = param + return options } -// GetBackupPolicyJobOptions : The GetBackupPolicyJob options. -type GetBackupPolicyJobOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy job identifier. +// DeletePublicGatewayOptions : The DeletePublicGateway options. +type DeletePublicGatewayOptions struct { + // The public gateway identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBackupPolicyJobOptions : Instantiate GetBackupPolicyJobOptions -func (*VpcV1) NewGetBackupPolicyJobOptions(backupPolicyID string, id string) *GetBackupPolicyJobOptions { - return &GetBackupPolicyJobOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), +// NewDeletePublicGatewayOptions : Instantiate DeletePublicGatewayOptions +func (*VpcV1) NewDeletePublicGatewayOptions(id string) *DeletePublicGatewayOptions { + return &DeletePublicGatewayOptions{ + ID: core.StringPtr(id), } } -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *GetBackupPolicyJobOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyJobOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetBackupPolicyJobOptions) SetID(id string) *GetBackupPolicyJobOptions { +func (_options *DeletePublicGatewayOptions) SetID(id string) *DeletePublicGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyJobOptions) SetHeaders(param map[string]string) *GetBackupPolicyJobOptions { +func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) *DeletePublicGatewayOptions { options.Headers = param return options } -// GetBackupPolicyOptions : The GetBackupPolicy options. -type GetBackupPolicyOptions struct { - // The backup policy identifier. +// DeleteReservationOptions : The DeleteReservation options. +type DeleteReservationOptions struct { + // The reservation identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBackupPolicyOptions : Instantiate GetBackupPolicyOptions -func (*VpcV1) NewGetBackupPolicyOptions(id string) *GetBackupPolicyOptions { - return &GetBackupPolicyOptions{ +// NewDeleteReservationOptions : Instantiate DeleteReservationOptions +func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { + return &DeleteReservationOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetBackupPolicyOptions) SetID(id string) *GetBackupPolicyOptions { +func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyOptions) SetHeaders(param map[string]string) *GetBackupPolicyOptions { +func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { options.Headers = param return options } -// GetBackupPolicyPlanOptions : The GetBackupPolicyPlan options. -type GetBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. +// DeleteSecurityGroupOptions : The DeleteSecurityGroup options. +type DeleteSecurityGroupOptions struct { + // The security group identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBackupPolicyPlanOptions : Instantiate GetBackupPolicyPlanOptions -func (*VpcV1) NewGetBackupPolicyPlanOptions(backupPolicyID string, id string) *GetBackupPolicyPlanOptions { - return &GetBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), +// NewDeleteSecurityGroupOptions : Instantiate DeleteSecurityGroupOptions +func (*VpcV1) NewDeleteSecurityGroupOptions(id string) *DeleteSecurityGroupOptions { + return &DeleteSecurityGroupOptions{ + ID: core.StringPtr(id), } } -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *GetBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetBackupPolicyPlanOptions) SetID(id string) *GetBackupPolicyPlanOptions { +func (_options *DeleteSecurityGroupOptions) SetID(id string) *DeleteSecurityGroupOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyPlanOptions) SetHeaders(param map[string]string) *GetBackupPolicyPlanOptions { +func (options *DeleteSecurityGroupOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupOptions { options.Headers = param return options } -// GetBareMetalServerDiskOptions : The GetBareMetalServerDisk options. -type GetBareMetalServerDiskOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` +// DeleteSecurityGroupRuleOptions : The DeleteSecurityGroupRule options. +type DeleteSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The bare metal server disk identifier. + // The rule identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerDiskOptions : Instantiate GetBareMetalServerDiskOptions -func (*VpcV1) NewGetBareMetalServerDiskOptions(bareMetalServerID string, id string) *GetBareMetalServerDiskOptions { - return &GetBareMetalServerDiskOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), +// NewDeleteSecurityGroupRuleOptions : Instantiate DeleteSecurityGroupRuleOptions +func (*VpcV1) NewDeleteSecurityGroupRuleOptions(securityGroupID string, id string) *DeleteSecurityGroupRuleOptions { + return &DeleteSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerDiskOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *DeleteSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } // SetID : Allow user to set ID -func (_options *GetBareMetalServerDiskOptions) SetID(id string) *GetBareMetalServerDiskOptions { +func (_options *DeleteSecurityGroupRuleOptions) SetID(id string) *DeleteSecurityGroupRuleOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerDiskOptions) SetHeaders(param map[string]string) *GetBareMetalServerDiskOptions { +func (options *DeleteSecurityGroupRuleOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupRuleOptions { options.Headers = param return options } -// GetBareMetalServerInitializationOptions : The GetBareMetalServerInitialization options. -type GetBareMetalServerInitializationOptions struct { - // The bare metal server identifier. +// DeleteSecurityGroupTargetBindingOptions : The DeleteSecurityGroupTargetBinding options. +type DeleteSecurityGroupTargetBindingOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // The security group target identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerInitializationOptions : Instantiate GetBareMetalServerInitializationOptions -func (*VpcV1) NewGetBareMetalServerInitializationOptions(id string) *GetBareMetalServerInitializationOptions { - return &GetBareMetalServerInitializationOptions{ - ID: core.StringPtr(id), +// NewDeleteSecurityGroupTargetBindingOptions : Instantiate DeleteSecurityGroupTargetBindingOptions +func (*VpcV1) NewDeleteSecurityGroupTargetBindingOptions(securityGroupID string, id string) *DeleteSecurityGroupTargetBindingOptions { + return &DeleteSecurityGroupTargetBindingOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *DeleteSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupTargetBindingOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetBareMetalServerInitializationOptions) SetID(id string) *GetBareMetalServerInitializationOptions { +func (_options *DeleteSecurityGroupTargetBindingOptions) SetID(id string) *DeleteSecurityGroupTargetBindingOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerInitializationOptions) SetHeaders(param map[string]string) *GetBareMetalServerInitializationOptions { +func (options *DeleteSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupTargetBindingOptions { options.Headers = param return options } -// GetBareMetalServerNetworkInterfaceFloatingIPOptions : The GetBareMetalServerNetworkInterfaceFloatingIP options. -type GetBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` +// DeleteShareMountTargetOptions : The DeleteShareMountTarget options. +type DeleteShareMountTargetOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` - // The floating IP identifier. + // The share mount target identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate GetBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - return &GetBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// NewDeleteShareMountTargetOptions : Instantiate DeleteShareMountTargetOptions +func (*VpcV1) NewDeleteShareMountTargetOptions(shareID string, id string) *DeleteShareMountTargetOptions { + return &DeleteShareMountTargetOptions{ + ShareID: core.StringPtr(shareID), + ID: core.StringPtr(id), } } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) +// SetShareID : Allow user to set ShareID +func (_options *DeleteShareMountTargetOptions) SetShareID(shareID string) *DeleteShareMountTargetOptions { + _options.ShareID = core.StringPtr(shareID) return _options } // SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { +func (_options *DeleteShareMountTargetOptions) SetID(id string) *DeleteShareMountTargetOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { +func (options *DeleteShareMountTargetOptions) SetHeaders(param map[string]string) *DeleteShareMountTargetOptions { options.Headers = param return options } -// GetBareMetalServerNetworkInterfaceIPOptions : The GetBareMetalServerNetworkInterfaceIP options. -type GetBareMetalServerNetworkInterfaceIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. +// DeleteShareOptions : The DeleteShare options. +type DeleteShareOptions struct { + // The file share identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerNetworkInterfaceIPOptions : Instantiate GetBareMetalServerNetworkInterfaceIPOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceIPOptions { - return &GetBareMetalServerNetworkInterfaceIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// NewDeleteShareOptions : Instantiate DeleteShareOptions +func (*VpcV1) NewDeleteShareOptions(id string) *DeleteShareOptions { + return &DeleteShareOptions{ + ID: core.StringPtr(id), } } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) +// SetID : Allow user to set ID +func (_options *DeleteShareOptions) SetID(id string) *DeleteShareOptions { + _options.ID = core.StringPtr(id) return _options } -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteShareOptions) SetIfMatch(ifMatch string) *DeleteShareOptions { + _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceIPOptions { +func (options *DeleteShareOptions) SetHeaders(param map[string]string) *DeleteShareOptions { options.Headers = param return options } -// GetBareMetalServerNetworkInterfaceOptions : The GetBareMetalServerNetworkInterface options. -type GetBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` +// DeleteShareSourceOptions : The DeleteShareSource options. +type DeleteShareSourceOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerNetworkInterfaceOptions : Instantiate GetBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkInterfaceOptions { - return &GetBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), +// NewDeleteShareSourceOptions : Instantiate DeleteShareSourceOptions +func (*VpcV1) NewDeleteShareSourceOptions(shareID string) *DeleteShareSourceOptions { + return &DeleteShareSourceOptions{ + ShareID: core.StringPtr(shareID), } } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) +// SetShareID : Allow user to set ShareID +func (_options *DeleteShareSourceOptions) SetShareID(shareID string) *DeleteShareSourceOptions { + _options.ShareID = core.StringPtr(shareID) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceOptions { +func (options *DeleteShareSourceOptions) SetHeaders(param map[string]string) *DeleteShareSourceOptions { options.Headers = param return options } -// GetBareMetalServerOptions : The GetBareMetalServer options. -type GetBareMetalServerOptions struct { - // The bare metal server identifier. +// DeleteSnapshotCloneOptions : The DeleteSnapshotClone options. +type DeleteSnapshotCloneOptions struct { + // The snapshot identifier. ID *string `json:"id" validate:"required,ne="` + // The zone name. + ZoneName *string `json:"zone_name" validate:"required,ne="` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerOptions : Instantiate GetBareMetalServerOptions -func (*VpcV1) NewGetBareMetalServerOptions(id string) *GetBareMetalServerOptions { - return &GetBareMetalServerOptions{ - ID: core.StringPtr(id), +// NewDeleteSnapshotCloneOptions : Instantiate DeleteSnapshotCloneOptions +func (*VpcV1) NewDeleteSnapshotCloneOptions(id string, zoneName string) *DeleteSnapshotCloneOptions { + return &DeleteSnapshotCloneOptions{ + ID: core.StringPtr(id), + ZoneName: core.StringPtr(zoneName), } } // SetID : Allow user to set ID -func (_options *GetBareMetalServerOptions) SetID(id string) *GetBareMetalServerOptions { +func (_options *DeleteSnapshotCloneOptions) SetID(id string) *DeleteSnapshotCloneOptions { _options.ID = core.StringPtr(id) return _options } +// SetZoneName : Allow user to set ZoneName +func (_options *DeleteSnapshotCloneOptions) SetZoneName(zoneName string) *DeleteSnapshotCloneOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerOptions) SetHeaders(param map[string]string) *GetBareMetalServerOptions { +func (options *DeleteSnapshotCloneOptions) SetHeaders(param map[string]string) *DeleteSnapshotCloneOptions { options.Headers = param return options } -// GetBareMetalServerProfileOptions : The GetBareMetalServerProfile options. -type GetBareMetalServerProfileOptions struct { - // The bare metal server profile name. - Name *string `json:"name" validate:"required,ne="` +// DeleteSnapshotConsistencyGroupOptions : The DeleteSnapshotConsistencyGroup options. +type DeleteSnapshotConsistencyGroupOptions struct { + // The snapshot consistency group identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetBareMetalServerProfileOptions : Instantiate GetBareMetalServerProfileOptions -func (*VpcV1) NewGetBareMetalServerProfileOptions(name string) *GetBareMetalServerProfileOptions { - return &GetBareMetalServerProfileOptions{ - Name: core.StringPtr(name), +// NewDeleteSnapshotConsistencyGroupOptions : Instantiate DeleteSnapshotConsistencyGroupOptions +func (*VpcV1) NewDeleteSnapshotConsistencyGroupOptions(id string) *DeleteSnapshotConsistencyGroupOptions { + return &DeleteSnapshotConsistencyGroupOptions{ + ID: core.StringPtr(id), } } -// SetName : Allow user to set Name -func (_options *GetBareMetalServerProfileOptions) SetName(name string) *GetBareMetalServerProfileOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *DeleteSnapshotConsistencyGroupOptions) SetID(id string) *DeleteSnapshotConsistencyGroupOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerProfileOptions) SetHeaders(param map[string]string) *GetBareMetalServerProfileOptions { +func (options *DeleteSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *DeleteSnapshotConsistencyGroupOptions { options.Headers = param return options } -// GetDedicatedHostDiskOptions : The GetDedicatedHostDisk options. -type GetDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // The dedicated host disk identifier. +// DeleteSnapshotOptions : The DeleteSnapshot options. +type DeleteSnapshotOptions struct { + // The snapshot identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetDedicatedHostDiskOptions : Instantiate GetDedicatedHostDiskOptions -func (*VpcV1) NewGetDedicatedHostDiskOptions(dedicatedHostID string, id string) *GetDedicatedHostDiskOptions { - return &GetDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), +// NewDeleteSnapshotOptions : Instantiate DeleteSnapshotOptions +func (*VpcV1) NewDeleteSnapshotOptions(id string) *DeleteSnapshotOptions { + return &DeleteSnapshotOptions{ + ID: core.StringPtr(id), } } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *GetDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *GetDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) +// SetID : Allow user to set ID +func (_options *DeleteSnapshotOptions) SetID(id string) *DeleteSnapshotOptions { + _options.ID = core.StringPtr(id) return _options } -// SetID : Allow user to set ID -func (_options *GetDedicatedHostDiskOptions) SetID(id string) *GetDedicatedHostDiskOptions { - _options.ID = core.StringPtr(id) +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteSnapshotOptions) SetIfMatch(ifMatch string) *DeleteSnapshotOptions { + _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostDiskOptions) SetHeaders(param map[string]string) *GetDedicatedHostDiskOptions { +func (options *DeleteSnapshotOptions) SetHeaders(param map[string]string) *DeleteSnapshotOptions { options.Headers = param return options } -// GetDedicatedHostGroupOptions : The GetDedicatedHostGroup options. -type GetDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` +// DeleteSnapshotsOptions : The DeleteSnapshots options. +type DeleteSnapshotsOptions struct { + // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. + SourceVolumeID *string `json:"source_volume.id" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewGetDedicatedHostGroupOptions : Instantiate GetDedicatedHostGroupOptions -func (*VpcV1) NewGetDedicatedHostGroupOptions(id string) *GetDedicatedHostGroupOptions { - return &GetDedicatedHostGroupOptions{ - ID: core.StringPtr(id), +// NewDeleteSnapshotsOptions : Instantiate DeleteSnapshotsOptions +func (*VpcV1) NewDeleteSnapshotsOptions(sourceVolumeID string) *DeleteSnapshotsOptions { + return &DeleteSnapshotsOptions{ + SourceVolumeID: core.StringPtr(sourceVolumeID), } } -// SetID : Allow user to set ID -func (_options *GetDedicatedHostGroupOptions) SetID(id string) *GetDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) +// SetSourceVolumeID : Allow user to set SourceVolumeID +func (_options *DeleteSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *DeleteSnapshotsOptions { + _options.SourceVolumeID = core.StringPtr(sourceVolumeID) return _options } // SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostGroupOptions) SetHeaders(param map[string]string) *GetDedicatedHostGroupOptions { +func (options *DeleteSnapshotsOptions) SetHeaders(param map[string]string) *DeleteSnapshotsOptions { options.Headers = param return options } -// GetDedicatedHostOptions : The GetDedicatedHost options. -type GetDedicatedHostOptions struct { - // The dedicated host identifier. +// DeleteSubnetOptions : The DeleteSubnet options. +type DeleteSubnetOptions struct { + // The subnet identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetDedicatedHostOptions : Instantiate GetDedicatedHostOptions -func (*VpcV1) NewGetDedicatedHostOptions(id string) *GetDedicatedHostOptions { - return &GetDedicatedHostOptions{ +// NewDeleteSubnetOptions : Instantiate DeleteSubnetOptions +func (*VpcV1) NewDeleteSubnetOptions(id string) *DeleteSubnetOptions { + return &DeleteSubnetOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetDedicatedHostOptions) SetID(id string) *GetDedicatedHostOptions { +func (_options *DeleteSubnetOptions) SetID(id string) *DeleteSubnetOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostOptions) SetHeaders(param map[string]string) *GetDedicatedHostOptions { +func (options *DeleteSubnetOptions) SetHeaders(param map[string]string) *DeleteSubnetOptions { options.Headers = param return options } -// GetDedicatedHostProfileOptions : The GetDedicatedHostProfile options. -type GetDedicatedHostProfileOptions struct { - // The dedicated host profile name. - Name *string `json:"name" validate:"required,ne="` +// DeleteSubnetReservedIPOptions : The DeleteSubnetReservedIP options. +type DeleteSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetDedicatedHostProfileOptions : Instantiate GetDedicatedHostProfileOptions -func (*VpcV1) NewGetDedicatedHostProfileOptions(name string) *GetDedicatedHostProfileOptions { - return &GetDedicatedHostProfileOptions{ - Name: core.StringPtr(name), +// NewDeleteSubnetReservedIPOptions : Instantiate DeleteSubnetReservedIPOptions +func (*VpcV1) NewDeleteSubnetReservedIPOptions(subnetID string, id string) *DeleteSubnetReservedIPOptions { + return &DeleteSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), } } -// SetName : Allow user to set Name -func (_options *GetDedicatedHostProfileOptions) SetName(name string) *GetDedicatedHostProfileOptions { - _options.Name = core.StringPtr(name) +// SetSubnetID : Allow user to set SubnetID +func (_options *DeleteSubnetReservedIPOptions) SetSubnetID(subnetID string) *DeleteSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteSubnetReservedIPOptions) SetID(id string) *DeleteSubnetReservedIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostProfileOptions) SetHeaders(param map[string]string) *GetDedicatedHostProfileOptions { +func (options *DeleteSubnetReservedIPOptions) SetHeaders(param map[string]string) *DeleteSubnetReservedIPOptions { options.Headers = param return options } -// GetEndpointGatewayIPOptions : The GetEndpointGatewayIP options. -type GetEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. +// DeleteVirtualNetworkInterfacesOptions : The DeleteVirtualNetworkInterfaces options. +type DeleteVirtualNetworkInterfacesOptions struct { + // The virtual network interface identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetEndpointGatewayIPOptions : Instantiate GetEndpointGatewayIPOptions -func (*VpcV1) NewGetEndpointGatewayIPOptions(endpointGatewayID string, id string) *GetEndpointGatewayIPOptions { - return &GetEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), +// NewDeleteVirtualNetworkInterfacesOptions : Instantiate DeleteVirtualNetworkInterfacesOptions +func (*VpcV1) NewDeleteVirtualNetworkInterfacesOptions(id string) *DeleteVirtualNetworkInterfacesOptions { + return &DeleteVirtualNetworkInterfacesOptions{ + ID: core.StringPtr(id), } } -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *GetEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetEndpointGatewayIPOptions) SetID(id string) *GetEndpointGatewayIPOptions { +func (_options *DeleteVirtualNetworkInterfacesOptions) SetID(id string) *DeleteVirtualNetworkInterfacesOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayIPOptions) SetHeaders(param map[string]string) *GetEndpointGatewayIPOptions { +func (options *DeleteVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *DeleteVirtualNetworkInterfacesOptions { options.Headers = param return options } -// GetEndpointGatewayOptions : The GetEndpointGateway options. -type GetEndpointGatewayOptions struct { - // The endpoint gateway identifier. +// DeleteVolumeOptions : The DeleteVolume options. +type DeleteVolumeOptions struct { + // The volume identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetEndpointGatewayOptions : Instantiate GetEndpointGatewayOptions -func (*VpcV1) NewGetEndpointGatewayOptions(id string) *GetEndpointGatewayOptions { - return &GetEndpointGatewayOptions{ +// NewDeleteVolumeOptions : Instantiate DeleteVolumeOptions +func (*VpcV1) NewDeleteVolumeOptions(id string) *DeleteVolumeOptions { + return &DeleteVolumeOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetEndpointGatewayOptions) SetID(id string) *GetEndpointGatewayOptions { +func (_options *DeleteVolumeOptions) SetID(id string) *DeleteVolumeOptions { _options.ID = core.StringPtr(id) return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVolumeOptions) SetIfMatch(ifMatch string) *DeleteVolumeOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *GetEndpointGatewayOptions { +func (options *DeleteVolumeOptions) SetHeaders(param map[string]string) *DeleteVolumeOptions { options.Headers = param return options } -// GetFloatingIPOptions : The GetFloatingIP options. -type GetFloatingIPOptions struct { - // The floating IP identifier. +// DeleteVPCAddressPrefixOptions : The DeleteVPCAddressPrefix options. +type DeleteVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The prefix identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetFloatingIPOptions : Instantiate GetFloatingIPOptions -func (*VpcV1) NewGetFloatingIPOptions(id string) *GetFloatingIPOptions { - return &GetFloatingIPOptions{ - ID: core.StringPtr(id), +// NewDeleteVPCAddressPrefixOptions : Instantiate DeleteVPCAddressPrefixOptions +func (*VpcV1) NewDeleteVPCAddressPrefixOptions(vpcID string, id string) *DeleteVPCAddressPrefixOptions { + return &DeleteVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } } +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCAddressPrefixOptions) SetVPCID(vpcID string) *DeleteVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetFloatingIPOptions) SetID(id string) *GetFloatingIPOptions { +func (_options *DeleteVPCAddressPrefixOptions) SetID(id string) *DeleteVPCAddressPrefixOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetFloatingIPOptions) SetHeaders(param map[string]string) *GetFloatingIPOptions { +func (options *DeleteVPCAddressPrefixOptions) SetHeaders(param map[string]string) *DeleteVPCAddressPrefixOptions { options.Headers = param return options } -// GetFlowLogCollectorOptions : The GetFlowLogCollector options. -type GetFlowLogCollectorOptions struct { - // The flow log collector identifier. +// DeleteVPCDnsResolutionBindingOptions : The DeleteVPCDnsResolutionBinding options. +type DeleteVPCDnsResolutionBindingOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The DNS resolution binding identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetFlowLogCollectorOptions : Instantiate GetFlowLogCollectorOptions -func (*VpcV1) NewGetFlowLogCollectorOptions(id string) *GetFlowLogCollectorOptions { - return &GetFlowLogCollectorOptions{ - ID: core.StringPtr(id), +// NewDeleteVPCDnsResolutionBindingOptions : Instantiate DeleteVPCDnsResolutionBindingOptions +func (*VpcV1) NewDeleteVPCDnsResolutionBindingOptions(vpcID string, id string) *DeleteVPCDnsResolutionBindingOptions { + return &DeleteVPCDnsResolutionBindingOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } } +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *DeleteVPCDnsResolutionBindingOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetFlowLogCollectorOptions) SetID(id string) *GetFlowLogCollectorOptions { +func (_options *DeleteVPCDnsResolutionBindingOptions) SetID(id string) *DeleteVPCDnsResolutionBindingOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetFlowLogCollectorOptions) SetHeaders(param map[string]string) *GetFlowLogCollectorOptions { +func (options *DeleteVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *DeleteVPCDnsResolutionBindingOptions { options.Headers = param return options } -// GetIkePolicyOptions : The GetIkePolicy options. -type GetIkePolicyOptions struct { - // The IKE policy identifier. +// DeleteVPCOptions : The DeleteVPC options. +type DeleteVPCOptions struct { + // The VPC identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetIkePolicyOptions : Instantiate GetIkePolicyOptions -func (*VpcV1) NewGetIkePolicyOptions(id string) *GetIkePolicyOptions { - return &GetIkePolicyOptions{ +// NewDeleteVPCOptions : Instantiate DeleteVPCOptions +func (*VpcV1) NewDeleteVPCOptions(id string) *DeleteVPCOptions { + return &DeleteVPCOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetIkePolicyOptions) SetID(id string) *GetIkePolicyOptions { +func (_options *DeleteVPCOptions) SetID(id string) *DeleteVPCOptions { _options.ID = core.StringPtr(id) return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVPCOptions) SetIfMatch(ifMatch string) *DeleteVPCOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers -func (options *GetIkePolicyOptions) SetHeaders(param map[string]string) *GetIkePolicyOptions { +func (options *DeleteVPCOptions) SetHeaders(param map[string]string) *DeleteVPCOptions { options.Headers = param return options } -// GetImageExportJobOptions : The GetImageExportJob options. -type GetImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` +// DeleteVPCRouteOptions : The DeleteVPCRoute options. +type DeleteVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The image export job identifier. + // The route identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetImageExportJobOptions : Instantiate GetImageExportJobOptions -func (*VpcV1) NewGetImageExportJobOptions(imageID string, id string) *GetImageExportJobOptions { - return &GetImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), +// NewDeleteVPCRouteOptions : Instantiate DeleteVPCRouteOptions +func (*VpcV1) NewDeleteVPCRouteOptions(vpcID string, id string) *DeleteVPCRouteOptions { + return &DeleteVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } } -// SetImageID : Allow user to set ImageID -func (_options *GetImageExportJobOptions) SetImageID(imageID string) *GetImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCRouteOptions) SetVPCID(vpcID string) *DeleteVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *GetImageExportJobOptions) SetID(id string) *GetImageExportJobOptions { +func (_options *DeleteVPCRouteOptions) SetID(id string) *DeleteVPCRouteOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetImageExportJobOptions) SetHeaders(param map[string]string) *GetImageExportJobOptions { - options.Headers = param - return options -} - -// GetImageOptions : The GetImage options. -type GetImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetImageOptions : Instantiate GetImageOptions -func (*VpcV1) NewGetImageOptions(id string) *GetImageOptions { - return &GetImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetImageOptions) SetID(id string) *GetImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetImageOptions) SetHeaders(param map[string]string) *GetImageOptions { +func (options *DeleteVPCRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRouteOptions { options.Headers = param return options } -// GetInstanceDiskOptions : The GetInstanceDisk options. -type GetInstanceDiskOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// DeleteVPCRoutingTableOptions : The DeleteVPCRoutingTable options. +type DeleteVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The instance disk identifier. + // The routing table identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceDiskOptions : Instantiate GetInstanceDiskOptions -func (*VpcV1) NewGetInstanceDiskOptions(instanceID string, id string) *GetInstanceDiskOptions { - return &GetInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// NewDeleteVPCRoutingTableOptions : Instantiate DeleteVPCRoutingTableOptions +func (*VpcV1) NewDeleteVPCRoutingTableOptions(vpcID string, id string) *DeleteVPCRoutingTableOptions { + return &DeleteVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceDiskOptions) SetInstanceID(instanceID string) *GetInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCRoutingTableOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceDiskOptions) SetID(id string) *GetInstanceDiskOptions { +func (_options *DeleteVPCRoutingTableOptions) SetID(id string) *DeleteVPCRoutingTableOptions { _options.ID = core.StringPtr(id) return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVPCRoutingTableOptions) SetIfMatch(ifMatch string) *DeleteVPCRoutingTableOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers -func (options *GetInstanceDiskOptions) SetHeaders(param map[string]string) *GetInstanceDiskOptions { +func (options *DeleteVPCRoutingTableOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableOptions { options.Headers = param return options } -// GetInstanceGroupManagerActionOptions : The GetInstanceGroupManagerAction options. -type GetInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// DeleteVPCRoutingTableRouteOptions : The DeleteVPCRoutingTableRoute options. +type DeleteVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The instance group manager action identifier. + // The VPC routing table route identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceGroupManagerActionOptions : Instantiate GetInstanceGroupManagerActionOptions -func (*VpcV1) NewGetInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerActionOptions { - return &GetInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), +// NewDeleteVPCRoutingTableRouteOptions : Instantiate DeleteVPCRoutingTableRouteOptions +func (*VpcV1) NewDeleteVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *DeleteVPCRoutingTableRouteOptions { + return &DeleteVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + ID: core.StringPtr(id), } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) return _options } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *DeleteVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *DeleteVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerActionOptions) SetID(id string) *GetInstanceGroupManagerActionOptions { +func (_options *DeleteVPCRoutingTableRouteOptions) SetID(id string) *DeleteVPCRoutingTableRouteOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerActionOptions { +func (options *DeleteVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableRouteOptions { options.Headers = param return options } -// GetInstanceGroupManagerOptions : The GetInstanceGroupManager options. -type GetInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// DeleteVPNGatewayConnectionOptions : The DeleteVPNGatewayConnection options. +type DeleteVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The instance group manager identifier. + // The VPN gateway connection identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceGroupManagerOptions : Instantiate GetInstanceGroupManagerOptions -func (*VpcV1) NewGetInstanceGroupManagerOptions(instanceGroupID string, id string) *GetInstanceGroupManagerOptions { - return &GetInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), +// NewDeleteVPNGatewayConnectionOptions : Instantiate DeleteVPNGatewayConnectionOptions +func (*VpcV1) NewDeleteVPNGatewayConnectionOptions(vpnGatewayID string, id string) *DeleteVPNGatewayConnectionOptions { + return &DeleteVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *DeleteVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *DeleteVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerOptions) SetID(id string) *GetInstanceGroupManagerOptions { +func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGatewayConnectionOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerOptions { +func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { options.Headers = param return options } -// GetInstanceGroupManagerPolicyOptions : The GetInstanceGroupManagerPolicy options. -type GetInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy identifier. +// DeleteVPNGatewayOptions : The DeleteVPNGateway options. +type DeleteVPNGatewayOptions struct { + // The VPN gateway identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceGroupManagerPolicyOptions : Instantiate GetInstanceGroupManagerPolicyOptions -func (*VpcV1) NewGetInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerPolicyOptions { - return &GetInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), +// NewDeleteVPNGatewayOptions : Instantiate DeleteVPNGatewayOptions +func (*VpcV1) NewDeleteVPNGatewayOptions(id string) *DeleteVPNGatewayOptions { + return &DeleteVPNGatewayOptions{ + ID: core.StringPtr(id), } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerPolicyOptions) SetID(id string) *GetInstanceGroupManagerPolicyOptions { +func (_options *DeleteVPNGatewayOptions) SetID(id string) *DeleteVPNGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerPolicyOptions { +func (options *DeleteVPNGatewayOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayOptions { options.Headers = param return options } -// GetInstanceGroupMembershipOptions : The GetInstanceGroupMembership options. -type GetInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// DeleteVPNServerClientOptions : The DeleteVPNServerClient options. +type DeleteVPNServerClientOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - // The instance group membership identifier. + // The VPN client identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceGroupMembershipOptions : Instantiate GetInstanceGroupMembershipOptions -func (*VpcV1) NewGetInstanceGroupMembershipOptions(instanceGroupID string, id string) *GetInstanceGroupMembershipOptions { - return &GetInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), +// NewDeleteVPNServerClientOptions : Instantiate DeleteVPNServerClientOptions +func (*VpcV1) NewDeleteVPNServerClientOptions(vpnServerID string, id string) *DeleteVPNServerClientOptions { + return &DeleteVPNServerClientOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetVPNServerID : Allow user to set VPNServerID +func (_options *DeleteVPNServerClientOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerClientOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceGroupMembershipOptions) SetID(id string) *GetInstanceGroupMembershipOptions { +func (_options *DeleteVPNServerClientOptions) SetID(id string) *DeleteVPNServerClientOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *GetInstanceGroupMembershipOptions { +func (options *DeleteVPNServerClientOptions) SetHeaders(param map[string]string) *DeleteVPNServerClientOptions { options.Headers = param return options } -// GetInstanceGroupOptions : The GetInstanceGroup options. -type GetInstanceGroupOptions struct { - // The instance group identifier. +// DeleteVPNServerOptions : The DeleteVPNServer options. +type DeleteVPNServerOptions struct { + // The VPN server identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceGroupOptions : Instantiate GetInstanceGroupOptions -func (*VpcV1) NewGetInstanceGroupOptions(id string) *GetInstanceGroupOptions { - return &GetInstanceGroupOptions{ +// NewDeleteVPNServerOptions : Instantiate DeleteVPNServerOptions +func (*VpcV1) NewDeleteVPNServerOptions(id string) *DeleteVPNServerOptions { + return &DeleteVPNServerOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetInstanceGroupOptions) SetID(id string) *GetInstanceGroupOptions { +func (_options *DeleteVPNServerOptions) SetID(id string) *DeleteVPNServerOptions { _options.ID = core.StringPtr(id) return _options } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupOptions) SetHeaders(param map[string]string) *GetInstanceGroupOptions { - options.Headers = param - return options -} - -// GetInstanceInitializationOptions : The GetInstanceInitialization options. -type GetInstanceInitializationOptions struct { - // The instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceInitializationOptions : Instantiate GetInstanceInitializationOptions -func (*VpcV1) NewGetInstanceInitializationOptions(id string) *GetInstanceInitializationOptions { - return &GetInstanceInitializationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetInstanceInitializationOptions) SetID(id string) *GetInstanceInitializationOptions { - _options.ID = core.StringPtr(id) +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVPNServerOptions) SetIfMatch(ifMatch string) *DeleteVPNServerOptions { + _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceInitializationOptions) SetHeaders(param map[string]string) *GetInstanceInitializationOptions { +func (options *DeleteVPNServerOptions) SetHeaders(param map[string]string) *DeleteVPNServerOptions { options.Headers = param return options } -// GetInstanceNetworkInterfaceFloatingIPOptions : The GetInstanceNetworkInterfaceFloatingIP options. -type GetInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` +// DeleteVPNServerRouteOptions : The DeleteVPNServerRoute options. +type DeleteVPNServerRouteOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - // The floating IP identifier. + // The VPN route identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceNetworkInterfaceFloatingIPOptions : Instantiate GetInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceFloatingIPOptions { - return &GetInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// NewDeleteVPNServerRouteOptions : Instantiate DeleteVPNServerRouteOptions +func (*VpcV1) NewDeleteVPNServerRouteOptions(vpnServerID string, id string) *DeleteVPNServerRouteOptions { + return &DeleteVPNServerRouteOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) +// SetVPNServerID : Allow user to set VPNServerID +func (_options *DeleteVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerRouteOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *GetInstanceNetworkInterfaceFloatingIPOptions { +func (_options *DeleteVPNServerRouteOptions) SetID(id string) *DeleteVPNServerRouteOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceFloatingIPOptions { +func (options *DeleteVPNServerRouteOptions) SetHeaders(param map[string]string) *DeleteVPNServerRouteOptions { options.Headers = param return options } -// GetInstanceNetworkInterfaceIPOptions : The GetInstanceNetworkInterfaceIP options. -type GetInstanceNetworkInterfaceIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. +// DeprecateImageOptions : The DeprecateImage options. +type DeprecateImageOptions struct { + // The image identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceNetworkInterfaceIPOptions : Instantiate GetInstanceNetworkInterfaceIPOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceIPOptions { - return &GetInstanceNetworkInterfaceIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// NewDeprecateImageOptions : Instantiate DeprecateImageOptions +func (*VpcV1) NewDeprecateImageOptions(id string) *DeprecateImageOptions { + return &DeprecateImageOptions{ + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetID(id string) *GetInstanceNetworkInterfaceIPOptions { +func (_options *DeprecateImageOptions) SetID(id string) *DeprecateImageOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceIPOptions { +func (options *DeprecateImageOptions) SetHeaders(param map[string]string) *DeprecateImageOptions { options.Headers = param return options } -// GetInstanceNetworkInterfaceOptions : The GetInstanceNetworkInterface options. -type GetInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// DisconnectVPNClientOptions : The DisconnectVPNClient options. +type DisconnectVPNClientOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - // The instance network interface identifier. + // The VPN client identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceNetworkInterfaceOptions : Instantiate GetInstanceNetworkInterfaceOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceOptions(instanceID string, id string) *GetInstanceNetworkInterfaceOptions { - return &GetInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// NewDisconnectVPNClientOptions : Instantiate DisconnectVPNClientOptions +func (*VpcV1) NewDisconnectVPNClientOptions(vpnServerID string, id string) *DisconnectVPNClientOptions { + return &DisconnectVPNClientOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetVPNServerID : Allow user to set VPNServerID +func (_options *DisconnectVPNClientOptions) SetVPNServerID(vpnServerID string) *DisconnectVPNClientOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceOptions) SetID(id string) *GetInstanceNetworkInterfaceOptions { +func (_options *DisconnectVPNClientOptions) SetID(id string) *DisconnectVPNClientOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceOptions { +func (options *DisconnectVPNClientOptions) SetHeaders(param map[string]string) *DisconnectVPNClientOptions { options.Headers = param return options } -// GetInstanceOptions : The GetInstance options. -type GetInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// EncryptionKeyIdentity : Identifies an encryption key by a unique property. +// Models which "extend" this model: +// - EncryptionKeyIdentityByCRN +type EncryptionKeyIdentity struct { + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + CRN *string `json:"crn,omitempty"` } -// NewGetInstanceOptions : Instantiate GetInstanceOptions -func (*VpcV1) NewGetInstanceOptions(id string) *GetInstanceOptions { - return &GetInstanceOptions{ - ID: core.StringPtr(id), - } +func (*EncryptionKeyIdentity) isaEncryptionKeyIdentity() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetInstanceOptions) SetID(id string) *GetInstanceOptions { - _options.ID = core.StringPtr(id) - return _options +type EncryptionKeyIdentityIntf interface { + isaEncryptionKeyIdentity() bool } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceOptions) SetHeaders(param map[string]string) *GetInstanceOptions { - options.Headers = param - return options +// UnmarshalEncryptionKeyIdentity unmarshals an instance of EncryptionKeyIdentity from the specified map of raw messages. +func UnmarshalEncryptionKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetInstanceProfileOptions : The GetInstanceProfile options. -type GetInstanceProfileOptions struct { - // The instance profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// EncryptionKeyReference : EncryptionKeyReference struct +type EncryptionKeyReference struct { + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + CRN *string `json:"crn" validate:"required"` } -// NewGetInstanceProfileOptions : Instantiate GetInstanceProfileOptions -func (*VpcV1) NewGetInstanceProfileOptions(name string) *GetInstanceProfileOptions { - return &GetInstanceProfileOptions{ - Name: core.StringPtr(name), +// UnmarshalEncryptionKeyReference unmarshals an instance of EncryptionKeyReference from the specified map of raw messages. +func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EncryptionKeyReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *GetInstanceProfileOptions) SetName(name string) *GetInstanceProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} +// EndpointGateway : EndpointGateway struct +type EndpointGateway struct { + // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in + // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. + AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetInstanceProfileOptions) SetHeaders(param map[string]string) *GetInstanceProfileOptions { - options.Headers = param - return options -} + // The date and time that the endpoint gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// GetInstanceTemplateOptions : The GetInstanceTemplate options. -type GetInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` + // The CRN for this endpoint gateway. + CRN *string `json:"crn" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` -// NewGetInstanceTemplateOptions : Instantiate GetInstanceTemplateOptions -func (*VpcV1) NewGetInstanceTemplateOptions(id string) *GetInstanceTemplateOptions { - return &GetInstanceTemplateOptions{ - ID: core.StringPtr(id), - } -} + // The URL for this endpoint gateway. + Href *string `json:"href" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetInstanceTemplateOptions) SetID(id string) *GetInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The unique identifier for this endpoint gateway. + ID *string `json:"id" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetInstanceTemplateOptions) SetHeaders(param map[string]string) *GetInstanceTemplateOptions { - options.Headers = param - return options -} + // The reserved IPs bound to this endpoint gateway. + Ips []ReservedIPReference `json:"ips" validate:"required"` -// GetInstanceVolumeAttachmentOptions : The GetInstanceVolumeAttachment options. -type GetInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The reasons for the current `lifecycle_state` (if any): + // - `dns_resolution_binding_pending`: the DNS resolution binding is being set up. + LifecycleReasons []EndpointGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` + // The lifecycle state of the endpoint gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. + Name *string `json:"name" validate:"required"` -// NewGetInstanceVolumeAttachmentOptions : Instantiate GetInstanceVolumeAttachmentOptions -func (*VpcV1) NewGetInstanceVolumeAttachmentOptions(instanceID string, id string) *GetInstanceVolumeAttachmentOptions { - return &GetInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} + // The resource group for this endpoint gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceVolumeAttachmentOptions) SetID(id string) *GetInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} + // The security groups targeting this endpoint gateway. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// GetIpsecPolicyOptions : The GetIpsecPolicy options. -type GetIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The fully qualified domain name for the target service. + // Deprecated: this field is deprecated and may be removed in a future release. + ServiceEndpoint *string `json:"service_endpoint,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The fully qualified domain names for the target service. + ServiceEndpoints []string `json:"service_endpoints" validate:"required"` -// NewGetIpsecPolicyOptions : Instantiate GetIpsecPolicyOptions -func (*VpcV1) NewGetIpsecPolicyOptions(id string) *GetIpsecPolicyOptions { - return &GetIpsecPolicyOptions{ - ID: core.StringPtr(id), - } -} + // The target for this endpoint gateway. + Target EndpointGatewayTargetIntf `json:"target" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetIpsecPolicyOptions) SetID(id string) *GetIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options + // The VPC this endpoint gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetIpsecPolicyOptions) SetHeaders(param map[string]string) *GetIpsecPolicyOptions { - options.Headers = param - return options -} +// Constants associated with the EndpointGateway.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + EndpointGatewayHealthStateDegradedConst = "degraded" + EndpointGatewayHealthStateFaultedConst = "faulted" + EndpointGatewayHealthStateInapplicableConst = "inapplicable" + EndpointGatewayHealthStateOkConst = "ok" +) -// GetKeyOptions : The GetKey options. -type GetKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the EndpointGateway.LifecycleState property. +// The lifecycle state of the endpoint gateway. +const ( + EndpointGatewayLifecycleStateDeletingConst = "deleting" + EndpointGatewayLifecycleStateFailedConst = "failed" + EndpointGatewayLifecycleStatePendingConst = "pending" + EndpointGatewayLifecycleStateStableConst = "stable" + EndpointGatewayLifecycleStateSuspendedConst = "suspended" + EndpointGatewayLifecycleStateUpdatingConst = "updating" + EndpointGatewayLifecycleStateWaitingConst = "waiting" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the EndpointGateway.ResourceType property. +// The resource type. +const ( + EndpointGatewayResourceTypeEndpointGatewayConst = "endpoint_gateway" +) -// NewGetKeyOptions : Instantiate GetKeyOptions -func (*VpcV1) NewGetKeyOptions(id string) *GetKeyOptions { - return &GetKeyOptions{ - ID: core.StringPtr(id), +// UnmarshalEndpointGateway unmarshals an instance of EndpointGateway from the specified map of raw messages. +func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGateway) + err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "service_endpoints", &obj.ServiceEndpoints) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetKeyOptions) SetID(id string) *GetKeyOptions { - _options.ID = core.StringPtr(id) - return _options -} +// EndpointGatewayCollection : EndpointGatewayCollection struct +type EndpointGatewayCollection struct { + // Collection of endpoint gateways. + EndpointGateways []EndpointGateway `json:"endpoint_gateways" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetKeyOptions) SetHeaders(param map[string]string) *GetKeyOptions { - options.Headers = param - return options -} + // A link to the first page of resources. + First *EndpointGatewayCollectionFirst `json:"first" validate:"required"` -// GetLoadBalancerListenerOptions : The GetLoadBalancerListener options. -type GetLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *EndpointGatewayCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewGetLoadBalancerListenerOptions : Instantiate GetLoadBalancerListenerOptions -func (*VpcV1) NewGetLoadBalancerListenerOptions(loadBalancerID string, id string) *GetLoadBalancerListenerOptions { - return &GetLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), +// UnmarshalEndpointGatewayCollection unmarshals an instance of EndpointGatewayCollection from the specified map of raw messages. +func UnmarshalEndpointGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollection) + err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGateway) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalEndpointGatewayCollectionFirst) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalEndpointGatewayCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *EndpointGatewayCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerOptions) SetID(id string) *GetLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options +// EndpointGatewayCollectionFirst : A link to the first page of resources. +type EndpointGatewayCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerOptions { - options.Headers = param - return options +// UnmarshalEndpointGatewayCollectionFirst unmarshals an instance of EndpointGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalEndpointGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetLoadBalancerListenerPolicyOptions : The GetLoadBalancerListenerPolicy options. -type GetLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// EndpointGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type EndpointGatewayCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewGetLoadBalancerListenerPolicyOptions : Instantiate GetLoadBalancerListenerPolicyOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *GetLoadBalancerListenerPolicyOptions { - return &GetLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), +// UnmarshalEndpointGatewayCollectionNext unmarshals an instance of EndpointGatewayCollectionNext from the specified map of raw messages. +func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} +// EndpointGatewayLifecycleReason : EndpointGatewayLifecycleReason struct +type EndpointGatewayLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyOptions) SetID(id string) *GetLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyOptions { - options.Headers = param - return options + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` } -// GetLoadBalancerListenerPolicyRuleOptions : The GetLoadBalancerListenerPolicyRule options. -type GetLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` +// Constants associated with the EndpointGatewayLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + EndpointGatewayLifecycleReasonCodeDnsResolutionBindingPendingConst = "dns_resolution_binding_pending" + EndpointGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` +// UnmarshalEndpointGatewayLifecycleReason unmarshals an instance of EndpointGatewayLifecycleReason from the specified map of raw messages. +func UnmarshalEndpointGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` +// EndpointGatewayPatch : EndpointGatewayPatch struct +type EndpointGatewayPatch struct { + // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in + // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. + // + // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to + // `true`. + AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. + Name *string `json:"name,omitempty"` } -// NewGetLoadBalancerListenerPolicyRuleOptions : Instantiate GetLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *GetLoadBalancerListenerPolicyRuleOptions { - return &GetLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), +// UnmarshalEndpointGatewayPatch unmarshals an instance of EndpointGatewayPatch from the specified map of raw messages. +func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayPatch) + err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// AsPatch returns a generic map representation of the EndpointGatewayPatch +func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(endpointGatewayPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// EndpointGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type EndpointGatewayReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetPolicyID : Allow user to set PolicyID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options +// UnmarshalEndpointGatewayReferenceDeleted unmarshals an instance of EndpointGatewayReferenceDeleted from the specified map of raw messages. +func UnmarshalEndpointGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetID(id string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} +// EndpointGatewayReferenceRemote : EndpointGatewayReferenceRemote struct +type EndpointGatewayReferenceRemote struct { + // The CRN for this endpoint gateway. + CRN *string `json:"crn" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} + // The URL for this endpoint gateway. + Href *string `json:"href" validate:"required"` -// GetLoadBalancerOptions : The GetLoadBalancer options. -type GetLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this endpoint gateway. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. + Name *string `json:"name" validate:"required"` + + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *EndpointGatewayRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewGetLoadBalancerOptions : Instantiate GetLoadBalancerOptions -func (*VpcV1) NewGetLoadBalancerOptions(id string) *GetLoadBalancerOptions { - return &GetLoadBalancerOptions{ - ID: core.StringPtr(id), +// Constants associated with the EndpointGatewayReferenceRemote.ResourceType property. +// The resource type. +const ( + EndpointGatewayReferenceRemoteResourceTypeEndpointGatewayConst = "endpoint_gateway" +) + +// UnmarshalEndpointGatewayReferenceRemote unmarshals an instance of EndpointGatewayReferenceRemote from the specified map of raw messages. +func UnmarshalEndpointGatewayReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReferenceRemote) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalEndpointGatewayRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerOptions) SetID(id string) *GetLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options -} +// EndpointGatewayRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type EndpointGatewayRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // account, and identifies the owning account. + Account *AccountReference `json:"account,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerOptions) SetHeaders(param map[string]string) *GetLoadBalancerOptions { - options.Headers = param - return options + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` } -// GetLoadBalancerPoolMemberOptions : The GetLoadBalancerPoolMember options. -type GetLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The member identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerPoolMemberOptions : Instantiate GetLoadBalancerPoolMemberOptions -func (*VpcV1) NewGetLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *GetLoadBalancerPoolMemberOptions { - return &GetLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), +// UnmarshalEndpointGatewayRemote unmarshals an instance of EndpointGatewayRemote from the specified map of raw messages. +func UnmarshalEndpointGatewayRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayRemote) + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) + if err != nil { + return } + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *GetLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *GetLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolMemberOptions) SetID(id string) *GetLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} +// EndpointGatewayReservedIP : A reserved IP to bind to the endpoint gateway. This can be specified using an existing reserved IP, or a prototype +// object for a new reserved IP. The reserved IP will be bound to the endpoint gateway to function as a virtual private +// endpoint for the service. +// Models which "extend" this model: +// - EndpointGatewayReservedIPReservedIPIdentity +// - EndpointGatewayReservedIPReservedIPPrototypeTargetContext +type EndpointGatewayReservedIP struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` -// GetLoadBalancerPoolOptions : The GetLoadBalancerPool options. -type GetLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` -// NewGetLoadBalancerPoolOptions : Instantiate GetLoadBalancerPoolOptions -func (*VpcV1) NewGetLoadBalancerPoolOptions(loadBalancerID string, id string) *GetLoadBalancerPoolOptions { - return &GetLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } + // The subnet in which to create this reserved IP. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +func (*EndpointGatewayReservedIP) isaEndpointGatewayReservedIP() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolOptions) SetID(id string) *GetLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options +type EndpointGatewayReservedIPIntf interface { + isaEndpointGatewayReservedIP() bool } -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolOptions { - options.Headers = param - return options +// UnmarshalEndpointGatewayReservedIP unmarshals an instance of EndpointGatewayReservedIP from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIP) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetLoadBalancerProfileOptions : The GetLoadBalancerProfile options. -type GetLoadBalancerProfileOptions struct { - // The load balancer profile name. - Name *string `json:"name" validate:"required,ne="` +// EndpointGatewayTarget : The target for this endpoint gateway. +// Models which "extend" this model: +// - EndpointGatewayTargetProviderCloudServiceReference +// - EndpointGatewayTargetProviderInfrastructureServiceReference +type EndpointGatewayTarget struct { + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The type of target. + ResourceType *string `json:"resource_type,omitempty"` -// NewGetLoadBalancerProfileOptions : Instantiate GetLoadBalancerProfileOptions -func (*VpcV1) NewGetLoadBalancerProfileOptions(name string) *GetLoadBalancerProfileOptions { - return &GetLoadBalancerProfileOptions{ - Name: core.StringPtr(name), - } + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name,omitempty"` } -// SetName : Allow user to set Name -func (_options *GetLoadBalancerProfileOptions) SetName(name string) *GetLoadBalancerProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} +// Constants associated with the EndpointGatewayTarget.ResourceType property. +// The type of target. +const ( + EndpointGatewayTargetResourceTypeProviderCloudServiceConst = "provider_cloud_service" +) -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerProfileOptions) SetHeaders(param map[string]string) *GetLoadBalancerProfileOptions { - options.Headers = param - return options +func (*EndpointGatewayTarget) isaEndpointGatewayTarget() bool { + return true } -// GetLoadBalancerStatisticsOptions : The GetLoadBalancerStatistics options. -type GetLoadBalancerStatisticsOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +type EndpointGatewayTargetIntf interface { + isaEndpointGatewayTarget() bool } -// NewGetLoadBalancerStatisticsOptions : Instantiate GetLoadBalancerStatisticsOptions -func (*VpcV1) NewGetLoadBalancerStatisticsOptions(id string) *GetLoadBalancerStatisticsOptions { - return &GetLoadBalancerStatisticsOptions{ - ID: core.StringPtr(id), +// UnmarshalEndpointGatewayTarget unmarshals an instance of EndpointGatewayTarget from the specified map of raw messages. +func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerStatisticsOptions) SetID(id string) *GetLoadBalancerStatisticsOptions { - _options.ID = core.StringPtr(id) - return _options -} +// EndpointGatewayTargetPrototype : The target to use for this endpoint gateway. Must not already be the target of another endpoint gateway in the VPC. +// Models which "extend" this model: +// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity +// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity +type EndpointGatewayTargetPrototype struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerStatisticsOptions) SetHeaders(param map[string]string) *GetLoadBalancerStatisticsOptions { - options.Headers = param - return options + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn,omitempty"` + + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name,omitempty"` } -// GetNetworkACLOptions : The GetNetworkACL options. -type GetNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the EndpointGatewayTargetPrototype.ResourceType property. +// The type of target for this endpoint gateway. +const ( + EndpointGatewayTargetPrototypeResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*EndpointGatewayTargetPrototype) isaEndpointGatewayTargetPrototype() bool { + return true } -// NewGetNetworkACLOptions : Instantiate GetNetworkACLOptions -func (*VpcV1) NewGetNetworkACLOptions(id string) *GetNetworkACLOptions { - return &GetNetworkACLOptions{ - ID: core.StringPtr(id), - } +type EndpointGatewayTargetPrototypeIntf interface { + isaEndpointGatewayTargetPrototype() bool } -// SetID : Allow user to set ID -func (_options *GetNetworkACLOptions) SetID(id string) *GetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalEndpointGatewayTargetPrototype unmarshals an instance of EndpointGatewayTargetPrototype from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "resource_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'resource_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'resource_type' not found in JSON object") + return + } + if discValue == "provider_cloud_service" { + err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity) + } else if discValue == "provider_infrastructure_service" { + err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'resource_type': %s", discValue) + } + return } -// SetHeaders : Allow user to set Headers -func (options *GetNetworkACLOptions) SetHeaders(param map[string]string) *GetNetworkACLOptions { - options.Headers = param - return options -} +// FailoverShareOptions : The FailoverShare options. +type FailoverShareOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` -// GetNetworkACLRuleOptions : The GetNetworkACLRule options. -type GetNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + // The action to take if the failover request is accepted but cannot be performed or times out: + // - `fail`: Fail the operation, resulting in the replication relationship being unchanged. + // - `split`: Split the replica from its source, resulting in two individual read-write + // file shares. Because the final sync was not completed, the replica may be + // out-of-date. This occurs in disaster recovery scenarios where the source is known to + // be unreachable. + FallbackPolicy *string `json:"fallback_policy,omitempty"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The failover timeout in seconds. + // + // If the timeout is reached, the `fallback_policy` will be triggered. + Timeout *int64 `json:"timeout,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewGetNetworkACLRuleOptions : Instantiate GetNetworkACLRuleOptions -func (*VpcV1) NewGetNetworkACLRuleOptions(networkACLID string, id string) *GetNetworkACLRuleOptions { - return &GetNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), +// Constants associated with the FailoverShareOptions.FallbackPolicy property. +// The action to take if the failover request is accepted but cannot be performed or times out: +// - `fail`: Fail the operation, resulting in the replication relationship being unchanged. +// - `split`: Split the replica from its source, resulting in two individual read-write +// file shares. Because the final sync was not completed, the replica may be +// out-of-date. This occurs in disaster recovery scenarios where the source is known to +// be unreachable. +const ( + FailoverShareOptionsFallbackPolicyFailConst = "fail" + FailoverShareOptionsFallbackPolicySplitConst = "split" +) + +// NewFailoverShareOptions : Instantiate FailoverShareOptions +func (*VpcV1) NewFailoverShareOptions(shareID string) *FailoverShareOptions { + return &FailoverShareOptions{ + ShareID: core.StringPtr(shareID), } } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *GetNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *GetNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) +// SetShareID : Allow user to set ShareID +func (_options *FailoverShareOptions) SetShareID(shareID string) *FailoverShareOptions { + _options.ShareID = core.StringPtr(shareID) return _options } -// SetID : Allow user to set ID -func (_options *GetNetworkACLRuleOptions) SetID(id string) *GetNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) +// SetFallbackPolicy : Allow user to set FallbackPolicy +func (_options *FailoverShareOptions) SetFallbackPolicy(fallbackPolicy string) *FailoverShareOptions { + _options.FallbackPolicy = core.StringPtr(fallbackPolicy) return _options } -// SetHeaders : Allow user to set Headers -func (options *GetNetworkACLRuleOptions) SetHeaders(param map[string]string) *GetNetworkACLRuleOptions { - options.Headers = param - return options -} - -// GetOperatingSystemOptions : The GetOperatingSystem options. -type GetOperatingSystemOptions struct { - // The operating system name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetOperatingSystemOptions : Instantiate GetOperatingSystemOptions -func (*VpcV1) NewGetOperatingSystemOptions(name string) *GetOperatingSystemOptions { - return &GetOperatingSystemOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetOperatingSystemOptions) SetName(name string) *GetOperatingSystemOptions { - _options.Name = core.StringPtr(name) +// SetTimeout : Allow user to set Timeout +func (_options *FailoverShareOptions) SetTimeout(timeout int64) *FailoverShareOptions { + _options.Timeout = core.Int64Ptr(timeout) return _options } // SetHeaders : Allow user to set Headers -func (options *GetOperatingSystemOptions) SetHeaders(param map[string]string) *GetOperatingSystemOptions { +func (options *FailoverShareOptions) SetHeaders(param map[string]string) *FailoverShareOptions { options.Headers = param return options } -// GetPlacementGroupOptions : The GetPlacementGroup options. -type GetPlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` +// FloatingIP : FloatingIP struct +type FloatingIP struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The date and time that the floating IP was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// NewGetPlacementGroupOptions : Instantiate GetPlacementGroupOptions -func (*VpcV1) NewGetPlacementGroupOptions(id string) *GetPlacementGroupOptions { - return &GetPlacementGroupOptions{ - ID: core.StringPtr(id), - } -} + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetPlacementGroupOptions) SetID(id string) *GetPlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The URL for this floating IP. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetPlacementGroupOptions) SetHeaders(param map[string]string) *GetPlacementGroupOptions { - options.Headers = param - return options -} + // The unique identifier for this floating IP. + ID *string `json:"id" validate:"required"` -// GetPublicGatewayOptions : The GetPublicGateway options. -type GetPublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this floating IP. The name is unique across all floating IPs in the region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource group for this floating IP. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// NewGetPublicGatewayOptions : Instantiate GetPublicGatewayOptions -func (*VpcV1) NewGetPublicGatewayOptions(id string) *GetPublicGatewayOptions { - return &GetPublicGatewayOptions{ - ID: core.StringPtr(id), - } -} + // The status of the floating IP. + Status *string `json:"status" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetPublicGatewayOptions) SetID(id string) *GetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The target of this floating IP. + Target FloatingIPTargetIntf `json:"target,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetPublicGatewayOptions) SetHeaders(param map[string]string) *GetPublicGatewayOptions { - options.Headers = param - return options + // The zone this floating IP resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// GetRegionOptions : The GetRegion options. -type GetRegionOptions struct { - // The region name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the FloatingIP.Status property. +// The status of the floating IP. +const ( + FloatingIPStatusAvailableConst = "available" + FloatingIPStatusDeletingConst = "deleting" + FloatingIPStatusFailedConst = "failed" + FloatingIPStatusPendingConst = "pending" +) -// NewGetRegionOptions : Instantiate GetRegionOptions -func (*VpcV1) NewGetRegionOptions(name string) *GetRegionOptions { - return &GetRegionOptions{ - Name: core.StringPtr(name), +// UnmarshalFloatingIP unmarshals an instance of FloatingIP from the specified map of raw messages. +func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *GetRegionOptions) SetName(name string) *GetRegionOptions { - _options.Name = core.StringPtr(name) - return _options -} +// FloatingIPCollection : FloatingIPCollection struct +type FloatingIPCollection struct { + // A link to the first page of resources. + First *FloatingIPCollectionFirst `json:"first" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetRegionOptions) SetHeaders(param map[string]string) *GetRegionOptions { - options.Headers = param - return options -} + // Collection of floating IPs. + FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` -// GetRegionZoneOptions : The GetRegionZone options. -type GetRegionZoneOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The zone name. - Name *string `json:"name" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *FloatingIPCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewGetRegionZoneOptions : Instantiate GetRegionZoneOptions -func (*VpcV1) NewGetRegionZoneOptions(regionName string, name string) *GetRegionZoneOptions { - return &GetRegionZoneOptions{ - RegionName: core.StringPtr(regionName), - Name: core.StringPtr(name), +// UnmarshalFloatingIPCollection unmarshals an instance of FloatingIPCollection from the specified map of raw messages. +func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRegionName : Allow user to set RegionName -func (_options *GetRegionZoneOptions) SetRegionName(regionName string) *GetRegionZoneOptions { - _options.RegionName = core.StringPtr(regionName) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *FloatingIPCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetName : Allow user to set Name -func (_options *GetRegionZoneOptions) SetName(name string) *GetRegionZoneOptions { - _options.Name = core.StringPtr(name) - return _options +// FloatingIPCollectionFirst : A link to the first page of resources. +type FloatingIPCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetRegionZoneOptions { - options.Headers = param - return options +// UnmarshalFloatingIPCollectionFirst unmarshals an instance of FloatingIPCollectionFirst from the specified map of raw messages. +func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetReservationOptions : The GetReservation options. -type GetReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// FloatingIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type FloatingIPCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewGetReservationOptions : Instantiate GetReservationOptions -func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { - return &GetReservationOptions{ - ID: core.StringPtr(id), +// UnmarshalFloatingIPCollectionNext unmarshals an instance of FloatingIPCollectionNext from the specified map of raw messages. +func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} +// FloatingIPCollectionVirtualNetworkInterfaceContext : FloatingIPCollectionVirtualNetworkInterfaceContext struct +type FloatingIPCollectionVirtualNetworkInterfaceContext struct { + // A link to the first page of resources. + First *FloatingIPCollectionVirtualNetworkInterfaceContextFirst `json:"first" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { - options.Headers = param - return options -} + // Collection of floating IPs bound to the virtual network interface specified by the identifier in the URL. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` -// GetSecurityGroupOptions : The GetSecurityGroup options. -type GetSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *FloatingIPCollectionVirtualNetworkInterfaceContextNext `json:"next,omitempty"` -// NewGetSecurityGroupOptions : Instantiate GetSecurityGroupOptions -func (*VpcV1) NewGetSecurityGroupOptions(id string) *GetSecurityGroupOptions { - return &GetSecurityGroupOptions{ - ID: core.StringPtr(id), - } + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetID : Allow user to set ID -func (_options *GetSecurityGroupOptions) SetID(id string) *GetSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionVirtualNetworkInterfaceContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupOptions) SetHeaders(param map[string]string) *GetSecurityGroupOptions { - options.Headers = param - return options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *FloatingIPCollectionVirtualNetworkInterfaceContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// GetSecurityGroupRuleOptions : The GetSecurityGroupRule options. -type GetSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// FloatingIPCollectionVirtualNetworkInterfaceContextFirst : A link to the first page of resources. +type FloatingIPCollectionVirtualNetworkInterfaceContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewGetSecurityGroupRuleOptions : Instantiate GetSecurityGroupRuleOptions -func (*VpcV1) NewGetSecurityGroupRuleOptions(securityGroupID string, id string) *GetSecurityGroupRuleOptions { - return &GetSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst from the specified map of raw messages. +func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionVirtualNetworkInterfaceContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetSecurityGroupRuleOptions) SetID(id string) *GetSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options +// FloatingIPCollectionVirtualNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type FloatingIPCollectionVirtualNetworkInterfaceContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupRuleOptions) SetHeaders(param map[string]string) *GetSecurityGroupRuleOptions { - options.Headers = param - return options +// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext from the specified map of raw messages. +func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionVirtualNetworkInterfaceContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetSecurityGroupTargetOptions : The GetSecurityGroupTarget options. -type GetSecurityGroupTargetOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` +// FloatingIPPatch : FloatingIPPatch struct +type FloatingIPPatch struct { + // The name for this floating IP. The name must not be used by another floating IP in the region. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The target resource to bind this floating IP to, replacing any existing binding. + // The floating IP must not be required by another resource, such as a public gateway. + // + // The target resource must not already have a floating IP bound to it if the target + // resource is: + // + // - an instance network interface + // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` + // - a virtual network interface with `enable_infrastructure_nat` set to `true` + // + // Specify `null` to remove an existing binding. + Target FloatingIPTargetPatchIntf `json:"target,omitempty"` } -// NewGetSecurityGroupTargetOptions : Instantiate GetSecurityGroupTargetOptions -func (*VpcV1) NewGetSecurityGroupTargetOptions(securityGroupID string, id string) *GetSecurityGroupTargetOptions { - return &GetSecurityGroupTargetOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// UnmarshalFloatingIPPatch unmarshals an instance of FloatingIPPatch from the specified map of raw messages. +func UnmarshalFloatingIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupTargetOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupTargetOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetSecurityGroupTargetOptions) SetID(id string) *GetSecurityGroupTargetOptions { - _options.ID = core.StringPtr(id) - return _options +// AsPatch returns a generic map representation of the FloatingIPPatch +func (floatingIPPatch *FloatingIPPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(floatingIPPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupTargetOptions) SetHeaders(param map[string]string) *GetSecurityGroupTargetOptions { - options.Headers = param - return options -} +// FloatingIPPrototype : FloatingIPPrototype struct +// Models which "extend" this model: +// - FloatingIPPrototypeFloatingIPByZone +// - FloatingIPPrototypeFloatingIPByTarget +type FloatingIPPrototype struct { + // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// GetShareMountTargetOptions : The GetShareMountTarget options. -type GetShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` + // The zone this floating IP will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The target resource to bind this floating IP to. + // + // The target resource must not already have a floating IP bound to it if the target + // resource is: + // + // - an instance network interface + // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` + // - a virtual network interface with `enable_infrastructure_nat` set to `true`. + Target FloatingIPTargetPrototypeIntf `json:"target,omitempty"` } -// NewGetShareMountTargetOptions : Instantiate GetShareMountTargetOptions -func (*VpcV1) NewGetShareMountTargetOptions(shareID string, id string) *GetShareMountTargetOptions { - return &GetShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - } +func (*FloatingIPPrototype) isaFloatingIPPrototype() bool { + return true } -// SetShareID : Allow user to set ShareID -func (_options *GetShareMountTargetOptions) SetShareID(shareID string) *GetShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options +type FloatingIPPrototypeIntf interface { + isaFloatingIPPrototype() bool } -// SetID : Allow user to set ID -func (_options *GetShareMountTargetOptions) SetID(id string) *GetShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalFloatingIPPrototype unmarshals an instance of FloatingIPPrototype from the specified map of raw messages. +func UnmarshalFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *GetShareMountTargetOptions) SetHeaders(param map[string]string) *GetShareMountTargetOptions { - options.Headers = param - return options -} +// FloatingIPReference : FloatingIPReference struct +type FloatingIPReference struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` -// GetShareOptions : The GetShare options. -type GetShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` -// NewGetShareOptions : Instantiate GetShareOptions -func (*VpcV1) NewGetShareOptions(id string) *GetShareOptions { - return &GetShareOptions{ - ID: core.StringPtr(id), - } -} + // The URL for this floating IP. + Href *string `json:"href" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetShareOptions) SetID(id string) *GetShareOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The unique identifier for this floating IP. + ID *string `json:"id" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetShareOptions) SetHeaders(param map[string]string) *GetShareOptions { - options.Headers = param - return options + // The name for this floating IP. The name is unique across all floating IPs in the region. + Name *string `json:"name" validate:"required"` } -// GetShareProfileOptions : The GetShareProfile options. -type GetShareProfileOptions struct { - // The file share profile name. - Name *string `json:"name" validate:"required,ne="` +// UnmarshalFloatingIPReference unmarshals an instance of FloatingIPReference from the specified map of raw messages. +func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPReference) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Allows users to set headers on API requests - Headers map[string]string +// FloatingIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type FloatingIPReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// NewGetShareProfileOptions : Instantiate GetShareProfileOptions -func (*VpcV1) NewGetShareProfileOptions(name string) *GetShareProfileOptions { - return &GetShareProfileOptions{ - Name: core.StringPtr(name), +// UnmarshalFloatingIPReferenceDeleted unmarshals an instance of FloatingIPReferenceDeleted from the specified map of raw messages. +func UnmarshalFloatingIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *GetShareProfileOptions) SetName(name string) *GetShareProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} +// FloatingIPTarget : The target of this floating IP. +// Models which "extend" this model: +// - FloatingIPTargetNetworkInterfaceReference +// - FloatingIPTargetBareMetalServerNetworkInterfaceReference +// - FloatingIPTargetPublicGatewayReference +// - FloatingIPTargetVirtualNetworkInterfaceReference +type FloatingIPTarget struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetShareProfileOptions) SetHeaders(param map[string]string) *GetShareProfileOptions { - options.Headers = param - return options -} + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` -// GetShareSourceOptions : The GetShareSource options. -type GetShareSourceOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The name for this instance network interface. + Name *string `json:"name,omitempty"` -// NewGetShareSourceOptions : Instantiate GetShareSourceOptions -func (*VpcV1) NewGetShareSourceOptions(shareID string) *GetShareSourceOptions { - return &GetShareSourceOptions{ - ShareID: core.StringPtr(shareID), - } -} + PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` -// SetShareID : Allow user to set ShareID -func (_options *GetShareSourceOptions) SetShareID(shareID string) *GetShareSourceOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetShareSourceOptions) SetHeaders(param map[string]string) *GetShareSourceOptions { - options.Headers = param - return options -} + // The CRN for this public gateway. + CRN *string `json:"crn,omitempty"` -// GetSnapshotCloneOptions : The GetSnapshotClone options. -type GetSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` + // The associated subnet. + Subnet *SubnetReference `json:"subnet,omitempty"` +} - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` +// Constants associated with the FloatingIPTarget.ResourceType property. +// The resource type. +const ( + FloatingIPTargetResourceTypeNetworkInterfaceConst = "network_interface" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*FloatingIPTarget) isaFloatingIPTarget() bool { + return true } -// NewGetSnapshotCloneOptions : Instantiate GetSnapshotCloneOptions -func (*VpcV1) NewGetSnapshotCloneOptions(id string, zoneName string) *GetSnapshotCloneOptions { - return &GetSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), - } +type FloatingIPTargetIntf interface { + isaFloatingIPTarget() bool } -// SetID : Allow user to set ID -func (_options *GetSnapshotCloneOptions) SetID(id string) *GetSnapshotCloneOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *GetSnapshotCloneOptions) SetZoneName(zoneName string) *GetSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSnapshotCloneOptions) SetHeaders(param map[string]string) *GetSnapshotCloneOptions { - options.Headers = param - return options -} - -// GetSnapshotOptions : The GetSnapshot options. -type GetSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSnapshotOptions : Instantiate GetSnapshotOptions -func (*VpcV1) NewGetSnapshotOptions(id string) *GetSnapshotOptions { - return &GetSnapshotOptions{ - ID: core.StringPtr(id), +// UnmarshalFloatingIPTarget unmarshals an instance of FloatingIPTarget from the specified map of raw messages. +func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) + if err != nil { + return } -} - -// SetID : Allow user to set ID -func (_options *GetSnapshotOptions) SetID(id string) *GetSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSnapshotOptions) SetHeaders(param map[string]string) *GetSnapshotOptions { - options.Headers = param - return options -} - -// GetSubnetNetworkACLOptions : The GetSubnetNetworkACL options. -type GetSubnetNetworkACLOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetNetworkACLOptions : Instantiate GetSubnetNetworkACLOptions -func (*VpcV1) NewGetSubnetNetworkACLOptions(id string) *GetSubnetNetworkACLOptions { - return &GetSubnetNetworkACLOptions{ - ID: core.StringPtr(id), + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } -} - -// SetID : Allow user to set ID -func (_options *GetSubnetNetworkACLOptions) SetID(id string) *GetSubnetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetNetworkACLOptions) SetHeaders(param map[string]string) *GetSubnetNetworkACLOptions { - options.Headers = param - return options -} - -// GetSubnetOptions : The GetSubnet options. -type GetSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetOptions : Instantiate GetSubnetOptions -func (*VpcV1) NewGetSubnetOptions(id string) *GetSubnetOptions { - return &GetSubnetOptions{ - ID: core.StringPtr(id), + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetSubnetOptions) SetID(id string) *GetSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetOptions) SetHeaders(param map[string]string) *GetSubnetOptions { - options.Headers = param - return options -} +// FloatingIPTargetPatch : The target resource to bind this floating IP to, replacing any existing binding. The floating IP must not be required +// by another resource, such as a public gateway. +// +// The target resource must not already have a floating IP bound to it if the target resource is: +// +// - an instance network interface +// - a bare metal server network interface with `enable_infrastructure_nat` set to `true` +// - a virtual network interface with `enable_infrastructure_nat` set to `true` +// +// Specify `null` to remove an existing binding. +// Models which "extend" this model: +// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity +// - FloatingIPTargetPatchNetworkInterfaceIdentity +// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentity +type FloatingIPTargetPatch struct { + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` -// GetSubnetPublicGatewayOptions : The GetSubnetPublicGateway options. -type GetSubnetPublicGatewayOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -// NewGetSubnetPublicGatewayOptions : Instantiate GetSubnetPublicGatewayOptions -func (*VpcV1) NewGetSubnetPublicGatewayOptions(id string) *GetSubnetPublicGatewayOptions { - return &GetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - } +func (*FloatingIPTargetPatch) isaFloatingIPTargetPatch() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetSubnetPublicGatewayOptions) SetID(id string) *GetSubnetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options +type FloatingIPTargetPatchIntf interface { + isaFloatingIPTargetPatch() bool } -// SetHeaders : Allow user to set Headers -func (options *GetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *GetSubnetPublicGatewayOptions { - options.Headers = param - return options +// UnmarshalFloatingIPTargetPatch unmarshals an instance of FloatingIPTargetPatch from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetSubnetReservedIPOptions : The GetSubnetReservedIP options. -type GetSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` +// FloatingIPTargetPrototype : The target resource to bind this floating IP to. +// +// The target resource must not already have a floating IP bound to it if the target resource is: +// +// - an instance network interface +// - a bare metal server network interface with `enable_infrastructure_nat` set to `true` +// - a virtual network interface with `enable_infrastructure_nat` set to `true`. +// Models which "extend" this model: +// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity +// - FloatingIPTargetPrototypeNetworkInterfaceIdentity +// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity +type FloatingIPTargetPrototype struct { + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` -// NewGetSubnetReservedIPOptions : Instantiate GetSubnetReservedIPOptions -func (*VpcV1) NewGetSubnetReservedIPOptions(subnetID string, id string) *GetSubnetReservedIPOptions { - return &GetSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - } + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -// SetSubnetID : Allow user to set SubnetID -func (_options *GetSubnetReservedIPOptions) SetSubnetID(subnetID string) *GetSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options +func (*FloatingIPTargetPrototype) isaFloatingIPTargetPrototype() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetSubnetReservedIPOptions) SetID(id string) *GetSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options +type FloatingIPTargetPrototypeIntf interface { + isaFloatingIPTargetPrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *GetSubnetReservedIPOptions) SetHeaders(param map[string]string) *GetSubnetReservedIPOptions { - options.Headers = param - return options +// UnmarshalFloatingIPTargetPrototype unmarshals an instance of FloatingIPTargetPrototype from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetSubnetRoutingTableOptions : The GetSubnetRoutingTable options. -type GetSubnetRoutingTableOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// FloatingIPUnpaginatedCollection : FloatingIPUnpaginatedCollection struct +type FloatingIPUnpaginatedCollection struct { + // Collection of floating IPs. + FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` } -// NewGetSubnetRoutingTableOptions : Instantiate GetSubnetRoutingTableOptions -func (*VpcV1) NewGetSubnetRoutingTableOptions(id string) *GetSubnetRoutingTableOptions { - return &GetSubnetRoutingTableOptions{ - ID: core.StringPtr(id), +// UnmarshalFloatingIPUnpaginatedCollection unmarshals an instance of FloatingIPUnpaginatedCollection from the specified map of raw messages. +func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPUnpaginatedCollection) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetSubnetRoutingTableOptions) SetID(id string) *GetSubnetRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) *GetSubnetRoutingTableOptions { - options.Headers = param - return options -} +// FlowLogCollector : FlowLogCollector struct +type FlowLogCollector struct { + // Indicates whether this collector is active. + Active *bool `json:"active" validate:"required"` -// GetVPCRouteResponse : GetVPCRouteResponse struct -type GetVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` + // Indicates whether this flow log collector will be automatically deleted when `target` is deleted. At present, this + // is always `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The date and time that the route was created. + // The date and time that the flow log collector was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` + // The CRN for this flow log collector. + CRN *string `json:"crn" validate:"required"` - // The URL for this route. + // The URL for this flow log collector. Href *string `json:"href" validate:"required"` - // The unique identifier for this route. + // The unique identifier for this flow log collector. ID *string `json:"id" validate:"required"` - // The lifecycle state of the route. + // The lifecycle state of the flow log collector. LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The name for this route. The name is unique across all routes in the routing table. + // The name for this flow log collector. The name is unique across all flow log collectors in the VPC. Name *string `json:"name" validate:"required"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + // The resource group for this flow log collector. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` + // The Cloud Object Storage bucket where the collected flows are logged. For more + // information, see [Viewing flow log + // objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). + StorageBucket *LegacyCloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` + // The target this collector is collecting flow logs for. + // - If the target is an instance network attachment, flow logs will be collected + // for that instance network attachment. + // - If the target is an instance network interface, flow logs will be collected + // for that instance network interface. + // - If the target is a virtual network interface, flow logs will be collected for the + // the virtual network interface's `target` resource if the resource is: + // - an instance network attachment + // - If the target is a virtual server instance, flow logs will be collected + // for all network attachments or network interfaces on that instance. + // - If the target is a subnet, flow logs will be collected + // for all instance network interfaces and virtual network interfaces + // attached to that subnet. + // - If the target is a VPC, flow logs will be collected for all instance network + // interfaces and virtual network interfaces attached to all subnets within that VPC. + // If the target is an instance, subnet, or VPC, flow logs will not be collected + // for any instance network attachments or instance network interfaces within the target + // that are themselves the target of a more specific flow log collector. + Target FlowLogCollectorTargetIntf `json:"target" validate:"required"` - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` + // The VPC this flow log collector resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// Constants associated with the GetVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - GetVPCRouteResponseActionDelegateConst = "delegate" - GetVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - GetVPCRouteResponseActionDeliverConst = "deliver" - GetVPCRouteResponseActionDropConst = "drop" -) - -// Constants associated with the GetVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - GetVPCRouteResponseLifecycleStateDeletingConst = "deleting" - GetVPCRouteResponseLifecycleStateFailedConst = "failed" - GetVPCRouteResponseLifecycleStatePendingConst = "pending" - GetVPCRouteResponseLifecycleStateStableConst = "stable" - GetVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - GetVPCRouteResponseLifecycleStateUpdatingConst = "updating" - GetVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the GetVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. +// Constants associated with the FlowLogCollector.LifecycleState property. +// The lifecycle state of the flow log collector. const ( - GetVPCRouteResponseOriginServiceConst = "service" - GetVPCRouteResponseOriginUserConst = "user" + FlowLogCollectorLifecycleStateDeletingConst = "deleting" + FlowLogCollectorLifecycleStateFailedConst = "failed" + FlowLogCollectorLifecycleStatePendingConst = "pending" + FlowLogCollectorLifecycleStateStableConst = "stable" + FlowLogCollectorLifecycleStateSuspendedConst = "suspended" + FlowLogCollectorLifecycleStateUpdatingConst = "updating" + FlowLogCollectorLifecycleStateWaitingConst = "waiting" ) -// UnmarshalGetVPCRouteResponse unmarshals an instance of GetVPCRouteResponse from the specified map of raw messages. -func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalFlowLogCollector unmarshals an instance of FlowLogCollector from the specified map of raw messages. +func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollector) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -41766,19 +42563,19 @@ func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalLegacyCloudObjectStorageBucketReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFlowLogCollectorTarget) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -41786,2804 +42583,2882 @@ func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface return } -// GetVirtualNetworkInterfaceOptions : The GetVirtualNetworkInterface options. -type GetVirtualNetworkInterfaceOptions struct { - // The virtual network interface identifier. - ID *string `json:"id" validate:"required,ne="` +// FlowLogCollectorCollection : FlowLogCollectorCollection struct +type FlowLogCollectorCollection struct { + // A link to the first page of resources. + First *FlowLogCollectorCollectionFirst `json:"first" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Collection of flow log collectors. + FlowLogCollectors []FlowLogCollector `json:"flow_log_collectors" validate:"required"` -// NewGetVirtualNetworkInterfaceOptions : Instantiate GetVirtualNetworkInterfaceOptions -func (*VpcV1) NewGetVirtualNetworkInterfaceOptions(id string) *GetVirtualNetworkInterfaceOptions { - return &GetVirtualNetworkInterfaceOptions{ - ID: core.StringPtr(id), - } -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetVirtualNetworkInterfaceOptions) SetID(id string) *GetVirtualNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *FlowLogCollectorCollectionNext `json:"next,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetVirtualNetworkInterfaceOptions { - options.Headers = param - return options + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// GetVolumeOptions : The GetVolume options. -type GetVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalFlowLogCollectorCollection unmarshals an instance of FlowLogCollectorCollection from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFlowLogCollectorCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "flow_log_collectors", &obj.FlowLogCollectors, UnmarshalFlowLogCollector) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFlowLogCollectorCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewGetVolumeOptions : Instantiate GetVolumeOptions -func (*VpcV1) NewGetVolumeOptions(id string) *GetVolumeOptions { - return &GetVolumeOptions{ - ID: core.StringPtr(id), +// Retrieve the value to be passed to a request to access the next page of results +func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *GetVolumeOptions) SetID(id string) *GetVolumeOptions { - _options.ID = core.StringPtr(id) - return _options +// FlowLogCollectorCollectionFirst : A link to the first page of resources. +type FlowLogCollectorCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetVolumeOptions) SetHeaders(param map[string]string) *GetVolumeOptions { - options.Headers = param - return options +// UnmarshalFlowLogCollectorCollectionFirst unmarshals an instance of FlowLogCollectorCollectionFirst from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetVolumeProfileOptions : The GetVolumeProfile options. -type GetVolumeProfileOptions struct { - // The volume profile name. - Name *string `json:"name" validate:"required,ne="` +// FlowLogCollectorCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type FlowLogCollectorCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalFlowLogCollectorCollectionNext unmarshals an instance of FlowLogCollectorCollectionNext from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewGetVolumeProfileOptions : Instantiate GetVolumeProfileOptions -func (*VpcV1) NewGetVolumeProfileOptions(name string) *GetVolumeProfileOptions { - return &GetVolumeProfileOptions{ - Name: core.StringPtr(name), +// FlowLogCollectorPatch : FlowLogCollectorPatch struct +type FlowLogCollectorPatch struct { + // Indicates whether this collector is active. Updating to false deactivates the collector and updating to true + // activates the collector. + Active *bool `json:"active,omitempty"` + + // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. + Name *string `json:"name,omitempty"` +} + +// UnmarshalFlowLogCollectorPatch unmarshals an instance of FlowLogCollectorPatch from the specified map of raw messages. +func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorPatch) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *GetVolumeProfileOptions) SetName(name string) *GetVolumeProfileOptions { - _options.Name = core.StringPtr(name) - return _options +// AsPatch returns a generic map representation of the FlowLogCollectorPatch +func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(flowLogCollectorPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *GetVolumeProfileOptions) SetHeaders(param map[string]string) *GetVolumeProfileOptions { - options.Headers = param - return options +// FlowLogCollectorTarget : The target this collector is collecting flow logs for. +// - If the target is an instance network attachment, flow logs will be collected +// for that instance network attachment. +// - If the target is an instance network interface, flow logs will be collected +// for that instance network interface. +// - If the target is a virtual network interface, flow logs will be collected for the +// the virtual network interface's `target` resource if the resource is: +// - an instance network attachment +// - If the target is a virtual server instance, flow logs will be collected +// for all network attachments or network interfaces on that instance. +// - If the target is a subnet, flow logs will be collected +// for all instance network interfaces and virtual network interfaces +// attached to that subnet. +// - If the target is a VPC, flow logs will be collected for all instance network +// interfaces and virtual network interfaces attached to all subnets within that VPC. If the target is an instance, +// +// subnet, or VPC, flow logs will not be collected for any instance network attachments or instance network interfaces +// within the target that are themselves the target of a more specific flow log collector. +// Models which "extend" this model: +// - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext +// - FlowLogCollectorTargetInstanceReference +// - FlowLogCollectorTargetSubnetReference +// - FlowLogCollectorTargetVPCReference +// - FlowLogCollectorTargetInstanceNetworkAttachmentReference +// - FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext +type FlowLogCollectorTarget struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` + + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` + + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` + + // The name for this instance network interface. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` + + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` + + // The primary IP address of the virtual network interface for the instance network + // attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` + + // The subnet of the virtual network interface for the instance network attachment. + Subnet *SubnetReference `json:"subnet,omitempty"` } -// GetVPCAddressPrefixOptions : The GetVPCAddressPrefix options. -type GetVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// Constants associated with the FlowLogCollectorTarget.ResourceType property. +// The resource type. +const ( + FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" +) - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` +func (*FlowLogCollectorTarget) isaFlowLogCollectorTarget() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type FlowLogCollectorTargetIntf interface { + isaFlowLogCollectorTarget() bool } -// NewGetVPCAddressPrefixOptions : Instantiate GetVPCAddressPrefixOptions -func (*VpcV1) NewGetVPCAddressPrefixOptions(vpcID string, id string) *GetVPCAddressPrefixOptions { - return &GetVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// UnmarshalFlowLogCollectorTarget unmarshals an instance of FlowLogCollectorTarget from the specified map of raw messages. +func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCAddressPrefixOptions) SetVPCID(vpcID string) *GetVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// FlowLogCollectorTargetPrototype : The target this collector will collect flow logs for. +// +// If the target is an instance, subnet, or VPC, flow logs will not be collected for any instance network attachments, +// virtual network interfaces or instance network interfaces within the target that are themselves the target of a more +// specific flow log collector. +// +// The target must not be a virtual network interface that is attached to a bare metal server network attachment or to a +// file share mount target. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity +// - FlowLogCollectorTargetPrototypeInstanceIdentity +// - FlowLogCollectorTargetPrototypeSubnetIdentity +// - FlowLogCollectorTargetPrototypeVPCIdentity +// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity +// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity +type FlowLogCollectorTargetPrototype struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` + + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` + + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` } -// SetID : Allow user to set ID -func (_options *GetVPCAddressPrefixOptions) SetID(id string) *GetVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options +func (*FlowLogCollectorTargetPrototype) isaFlowLogCollectorTargetPrototype() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *GetVPCAddressPrefixOptions) SetHeaders(param map[string]string) *GetVPCAddressPrefixOptions { - options.Headers = param - return options +type FlowLogCollectorTargetPrototypeIntf interface { + isaFlowLogCollectorTargetPrototype() bool } -// GetVPCDefaultNetworkACLOptions : The GetVPCDefaultNetworkACL options. -type GetVPCDefaultNetworkACLOptions struct { - // The VPC identifier. +// UnmarshalFlowLogCollectorTargetPrototype unmarshals an instance of FlowLogCollectorTargetPrototype from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GenericResourceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type GenericResourceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalGenericResourceReferenceDeleted unmarshals an instance of GenericResourceReferenceDeleted from the specified map of raw messages. +func UnmarshalGenericResourceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GenericResourceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetBackupPolicyJobOptions : The GetBackupPolicyJob options. +type GetBackupPolicyJobOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + + // The backup policy job identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultNetworkACLOptions : Instantiate GetVPCDefaultNetworkACLOptions -func (*VpcV1) NewGetVPCDefaultNetworkACLOptions(id string) *GetVPCDefaultNetworkACLOptions { - return &GetVPCDefaultNetworkACLOptions{ - ID: core.StringPtr(id), +// NewGetBackupPolicyJobOptions : Instantiate GetBackupPolicyJobOptions +func (*VpcV1) NewGetBackupPolicyJobOptions(backupPolicyID string, id string) *GetBackupPolicyJobOptions { + return &GetBackupPolicyJobOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + ID: core.StringPtr(id), } } +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *GetBackupPolicyJobOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyJobOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetVPCDefaultNetworkACLOptions) SetID(id string) *GetVPCDefaultNetworkACLOptions { +func (_options *GetBackupPolicyJobOptions) SetID(id string) *GetBackupPolicyJobOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultNetworkACLOptions) SetHeaders(param map[string]string) *GetVPCDefaultNetworkACLOptions { +func (options *GetBackupPolicyJobOptions) SetHeaders(param map[string]string) *GetBackupPolicyJobOptions { options.Headers = param return options } -// GetVPCDefaultRoutingTableOptions : The GetVPCDefaultRoutingTable options. -type GetVPCDefaultRoutingTableOptions struct { - // The VPC identifier. +// GetBackupPolicyOptions : The GetBackupPolicy options. +type GetBackupPolicyOptions struct { + // The backup policy identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultRoutingTableOptions : Instantiate GetVPCDefaultRoutingTableOptions -func (*VpcV1) NewGetVPCDefaultRoutingTableOptions(id string) *GetVPCDefaultRoutingTableOptions { - return &GetVPCDefaultRoutingTableOptions{ +// NewGetBackupPolicyOptions : Instantiate GetBackupPolicyOptions +func (*VpcV1) NewGetBackupPolicyOptions(id string) *GetBackupPolicyOptions { + return &GetBackupPolicyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPCDefaultRoutingTableOptions) SetID(id string) *GetVPCDefaultRoutingTableOptions { +func (_options *GetBackupPolicyOptions) SetID(id string) *GetBackupPolicyOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCDefaultRoutingTableOptions { +func (options *GetBackupPolicyOptions) SetHeaders(param map[string]string) *GetBackupPolicyOptions { options.Headers = param return options } -// GetVPCDefaultSecurityGroupOptions : The GetVPCDefaultSecurityGroup options. -type GetVPCDefaultSecurityGroupOptions struct { - // The VPC identifier. +// GetBackupPolicyPlanOptions : The GetBackupPolicyPlan options. +type GetBackupPolicyPlanOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + + // The backup policy plan identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultSecurityGroupOptions : Instantiate GetVPCDefaultSecurityGroupOptions -func (*VpcV1) NewGetVPCDefaultSecurityGroupOptions(id string) *GetVPCDefaultSecurityGroupOptions { - return &GetVPCDefaultSecurityGroupOptions{ - ID: core.StringPtr(id), +// NewGetBackupPolicyPlanOptions : Instantiate GetBackupPolicyPlanOptions +func (*VpcV1) NewGetBackupPolicyPlanOptions(backupPolicyID string, id string) *GetBackupPolicyPlanOptions { + return &GetBackupPolicyPlanOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + ID: core.StringPtr(id), } } +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *GetBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyPlanOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetVPCDefaultSecurityGroupOptions) SetID(id string) *GetVPCDefaultSecurityGroupOptions { +func (_options *GetBackupPolicyPlanOptions) SetID(id string) *GetBackupPolicyPlanOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultSecurityGroupOptions) SetHeaders(param map[string]string) *GetVPCDefaultSecurityGroupOptions { +func (options *GetBackupPolicyPlanOptions) SetHeaders(param map[string]string) *GetBackupPolicyPlanOptions { options.Headers = param return options } -// GetVPCDnsResolutionBindingOptions : The GetVPCDnsResolutionBinding options. -type GetVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// GetBareMetalServerDiskOptions : The GetBareMetalServerDisk options. +type GetBareMetalServerDiskOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The DNS resolution binding identifier. + // The bare metal server disk identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDnsResolutionBindingOptions : Instantiate GetVPCDnsResolutionBindingOptions -func (*VpcV1) NewGetVPCDnsResolutionBindingOptions(vpcID string, id string) *GetVPCDnsResolutionBindingOptions { - return &GetVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewGetBareMetalServerDiskOptions : Instantiate GetBareMetalServerDiskOptions +func (*VpcV1) NewGetBareMetalServerDiskOptions(bareMetalServerID string, id string) *GetBareMetalServerDiskOptions { + return &GetBareMetalServerDiskOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *GetVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerDiskOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCDnsResolutionBindingOptions) SetID(id string) *GetVPCDnsResolutionBindingOptions { +func (_options *GetBareMetalServerDiskOptions) SetID(id string) *GetBareMetalServerDiskOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *GetVPCDnsResolutionBindingOptions { +func (options *GetBareMetalServerDiskOptions) SetHeaders(param map[string]string) *GetBareMetalServerDiskOptions { options.Headers = param return options } -// GetVPCOptions : The GetVPC options. -type GetVPCOptions struct { - // The VPC identifier. +// GetBareMetalServerInitializationOptions : The GetBareMetalServerInitialization options. +type GetBareMetalServerInitializationOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCOptions : Instantiate GetVPCOptions -func (*VpcV1) NewGetVPCOptions(id string) *GetVPCOptions { - return &GetVPCOptions{ +// NewGetBareMetalServerInitializationOptions : Instantiate GetBareMetalServerInitializationOptions +func (*VpcV1) NewGetBareMetalServerInitializationOptions(id string) *GetBareMetalServerInitializationOptions { + return &GetBareMetalServerInitializationOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPCOptions) SetID(id string) *GetVPCOptions { +func (_options *GetBareMetalServerInitializationOptions) SetID(id string) *GetBareMetalServerInitializationOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCOptions) SetHeaders(param map[string]string) *GetVPCOptions { +func (options *GetBareMetalServerInitializationOptions) SetHeaders(param map[string]string) *GetBareMetalServerInitializationOptions { options.Headers = param return options } -// GetVPCRouteOptions : The GetVPCRoute options. -type GetVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// GetBareMetalServerNetworkAttachmentOptions : The GetBareMetalServerNetworkAttachment options. +type GetBareMetalServerNetworkAttachmentOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The route identifier. + // The bare metal server network attachment identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCRouteOptions : Instantiate GetVPCRouteOptions -func (*VpcV1) NewGetVPCRouteOptions(vpcID string, id string) *GetVPCRouteOptions { - return &GetVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewGetBareMetalServerNetworkAttachmentOptions : Instantiate GetBareMetalServerNetworkAttachmentOptions +func (*VpcV1) NewGetBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkAttachmentOptions { + return &GetBareMetalServerNetworkAttachmentOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRouteOptions) SetVPCID(vpcID string) *GetVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRouteOptions) SetID(id string) *GetVPCRouteOptions { +func (_options *GetBareMetalServerNetworkAttachmentOptions) SetID(id string) *GetBareMetalServerNetworkAttachmentOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRouteOptions) SetHeaders(param map[string]string) *GetVPCRouteOptions { +func (options *GetBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkAttachmentOptions { options.Headers = param return options } -// GetVPCRoutingTableOptions : The GetVPCRoutingTable options. -type GetVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// GetBareMetalServerNetworkInterfaceFloatingIPOptions : The GetBareMetalServerNetworkInterfaceFloatingIP options. +type GetBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The routing table identifier. + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCRoutingTableOptions : Instantiate GetVPCRoutingTableOptions -func (*VpcV1) NewGetVPCRoutingTableOptions(vpcID string, id string) *GetVPCRoutingTableOptions { - return &GetVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewGetBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate GetBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewGetBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + return &GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableOptions) SetVPCID(vpcID string) *GetVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRoutingTableOptions) SetID(id string) *GetVPCRoutingTableOptions { +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableOptions { +func (options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { options.Headers = param return options } -// GetVPCRoutingTableRouteOptions : The GetVPCRoutingTableRoute options. -type GetVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// GetBareMetalServerNetworkInterfaceIPOptions : The GetBareMetalServerNetworkInterfaceIP options. +type GetBareMetalServerNetworkInterfaceIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // The VPC routing table route identifier. + // The reserved IP identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCRoutingTableRouteOptions : Instantiate GetVPCRoutingTableRouteOptions -func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *GetVPCRoutingTableRouteOptions { - return &GetVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), +// NewGetBareMetalServerNetworkInterfaceIPOptions : Instantiate GetBareMetalServerNetworkInterfaceIPOptions +func (*VpcV1) NewGetBareMetalServerNetworkInterfaceIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceIPOptions { + return &GetBareMetalServerNetworkInterfaceIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *GetVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *GetVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *GetVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRoutingTableRouteOptions) SetID(id string) *GetVPCRoutingTableRouteOptions { +func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceIPOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableRouteOptions { +func (options *GetBareMetalServerNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceIPOptions { options.Headers = param return options } -// GetVPNGatewayConnectionOptions : The GetVPNGatewayConnection options. -type GetVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// GetBareMetalServerNetworkInterfaceOptions : The GetBareMetalServerNetworkInterface options. +type GetBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The VPN gateway connection identifier. + // The bare metal server network interface identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNGatewayConnectionOptions : Instantiate GetVPNGatewayConnectionOptions -func (*VpcV1) NewGetVPNGatewayConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayConnectionOptions { - return &GetVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// NewGetBareMetalServerNetworkInterfaceOptions : Instantiate GetBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewGetBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkInterfaceOptions { + return &GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *GetVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } // SetID : Allow user to set ID -func (_options *GetVPNGatewayConnectionOptions) SetID(id string) *GetVPNGatewayConnectionOptions { +func (_options *GetBareMetalServerNetworkInterfaceOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayConnectionOptions { +func (options *GetBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceOptions { options.Headers = param return options } -// GetVPNGatewayOptions : The GetVPNGateway options. -type GetVPNGatewayOptions struct { - // The VPN gateway identifier. +// GetBareMetalServerOptions : The GetBareMetalServer options. +type GetBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNGatewayOptions : Instantiate GetVPNGatewayOptions -func (*VpcV1) NewGetVPNGatewayOptions(id string) *GetVPNGatewayOptions { - return &GetVPNGatewayOptions{ +// NewGetBareMetalServerOptions : Instantiate GetBareMetalServerOptions +func (*VpcV1) NewGetBareMetalServerOptions(id string) *GetBareMetalServerOptions { + return &GetBareMetalServerOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPNGatewayOptions) SetID(id string) *GetVPNGatewayOptions { +func (_options *GetBareMetalServerOptions) SetID(id string) *GetBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPNGatewayOptions { +func (options *GetBareMetalServerOptions) SetHeaders(param map[string]string) *GetBareMetalServerOptions { options.Headers = param return options } -// GetVPNServerClientConfigurationOptions : The GetVPNServerClientConfiguration options. -type GetVPNServerClientConfigurationOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests +// GetBareMetalServerProfileOptions : The GetBareMetalServerProfile options. +type GetBareMetalServerProfileOptions struct { + // The bare metal server profile name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNServerClientConfigurationOptions : Instantiate GetVPNServerClientConfigurationOptions -func (*VpcV1) NewGetVPNServerClientConfigurationOptions(id string) *GetVPNServerClientConfigurationOptions { - return &GetVPNServerClientConfigurationOptions{ - ID: core.StringPtr(id), +// NewGetBareMetalServerProfileOptions : Instantiate GetBareMetalServerProfileOptions +func (*VpcV1) NewGetBareMetalServerProfileOptions(name string) *GetBareMetalServerProfileOptions { + return &GetBareMetalServerProfileOptions{ + Name: core.StringPtr(name), } } -// SetID : Allow user to set ID -func (_options *GetVPNServerClientConfigurationOptions) SetID(id string) *GetVPNServerClientConfigurationOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *GetBareMetalServerProfileOptions) SetName(name string) *GetBareMetalServerProfileOptions { + _options.Name = core.StringPtr(name) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNServerClientConfigurationOptions) SetHeaders(param map[string]string) *GetVPNServerClientConfigurationOptions { +func (options *GetBareMetalServerProfileOptions) SetHeaders(param map[string]string) *GetBareMetalServerProfileOptions { options.Headers = param return options } -// GetVPNServerClientOptions : The GetVPNServerClient options. -type GetVPNServerClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` +// GetDedicatedHostDiskOptions : The GetDedicatedHostDisk options. +type GetDedicatedHostDiskOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - // The VPN client identifier. + // The dedicated host disk identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNServerClientOptions : Instantiate GetVPNServerClientOptions -func (*VpcV1) NewGetVPNServerClientOptions(vpnServerID string, id string) *GetVPNServerClientOptions { - return &GetVPNServerClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), +// NewGetDedicatedHostDiskOptions : Instantiate GetDedicatedHostDiskOptions +func (*VpcV1) NewGetDedicatedHostDiskOptions(dedicatedHostID string, id string) *GetDedicatedHostDiskOptions { + return &GetDedicatedHostDiskOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + ID: core.StringPtr(id), } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *GetVPNServerClientOptions) SetVPNServerID(vpnServerID string) *GetVPNServerClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *GetDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *GetDedicatedHostDiskOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) return _options } // SetID : Allow user to set ID -func (_options *GetVPNServerClientOptions) SetID(id string) *GetVPNServerClientOptions { +func (_options *GetDedicatedHostDiskOptions) SetID(id string) *GetDedicatedHostDiskOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNServerClientOptions) SetHeaders(param map[string]string) *GetVPNServerClientOptions { +func (options *GetDedicatedHostDiskOptions) SetHeaders(param map[string]string) *GetDedicatedHostDiskOptions { options.Headers = param return options } -// GetVPNServerOptions : The GetVPNServer options. -type GetVPNServerOptions struct { - // The VPN server identifier. +// GetDedicatedHostGroupOptions : The GetDedicatedHostGroup options. +type GetDedicatedHostGroupOptions struct { + // The dedicated host group identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNServerOptions : Instantiate GetVPNServerOptions -func (*VpcV1) NewGetVPNServerOptions(id string) *GetVPNServerOptions { - return &GetVPNServerOptions{ +// NewGetDedicatedHostGroupOptions : Instantiate GetDedicatedHostGroupOptions +func (*VpcV1) NewGetDedicatedHostGroupOptions(id string) *GetDedicatedHostGroupOptions { + return &GetDedicatedHostGroupOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPNServerOptions) SetID(id string) *GetVPNServerOptions { +func (_options *GetDedicatedHostGroupOptions) SetID(id string) *GetDedicatedHostGroupOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNServerOptions) SetHeaders(param map[string]string) *GetVPNServerOptions { +func (options *GetDedicatedHostGroupOptions) SetHeaders(param map[string]string) *GetDedicatedHostGroupOptions { options.Headers = param return options } -// GetVPNServerRouteOptions : The GetVPNServerRoute options. -type GetVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN route identifier. +// GetDedicatedHostOptions : The GetDedicatedHost options. +type GetDedicatedHostOptions struct { + // The dedicated host identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPNServerRouteOptions : Instantiate GetVPNServerRouteOptions -func (*VpcV1) NewGetVPNServerRouteOptions(vpnServerID string, id string) *GetVPNServerRouteOptions { - return &GetVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), +// NewGetDedicatedHostOptions : Instantiate GetDedicatedHostOptions +func (*VpcV1) NewGetDedicatedHostOptions(id string) *GetDedicatedHostOptions { + return &GetDedicatedHostOptions{ + ID: core.StringPtr(id), } } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *GetVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *GetVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetVPNServerRouteOptions) SetID(id string) *GetVPNServerRouteOptions { +func (_options *GetDedicatedHostOptions) SetID(id string) *GetDedicatedHostOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNServerRouteOptions) SetHeaders(param map[string]string) *GetVPNServerRouteOptions { +func (options *GetDedicatedHostOptions) SetHeaders(param map[string]string) *GetDedicatedHostOptions { options.Headers = param return options } -// IkePolicy : IkePolicy struct -type IkePolicy struct { - // The authentication algorithm - // - // The `md5` and `sha1` algorithms have been deprecated. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The VPN gateway connections that use this IKE policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this IKE policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The Diffie-Hellman group - // - // Groups `2` and `5` have been deprecated. - DhGroup *int64 `json:"dh_group" validate:"required"` +// GetDedicatedHostProfileOptions : The GetDedicatedHostProfile options. +type GetDedicatedHostProfileOptions struct { + // The dedicated host profile name. + Name *string `json:"name" validate:"required,ne="` - // The encryption algorithm - // - // The `triple_des` algorithm has been deprecated. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` +// NewGetDedicatedHostProfileOptions : Instantiate GetDedicatedHostProfileOptions +func (*VpcV1) NewGetDedicatedHostProfileOptions(name string) *GetDedicatedHostProfileOptions { + return &GetDedicatedHostProfileOptions{ + Name: core.StringPtr(name), + } +} - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` +// SetName : Allow user to set Name +func (_options *GetDedicatedHostProfileOptions) SetName(name string) *GetDedicatedHostProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetDedicatedHostProfileOptions) SetHeaders(param map[string]string) *GetDedicatedHostProfileOptions { + options.Headers = param + return options +} - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` +// GetEndpointGatewayIPOptions : The GetEndpointGatewayIP options. +type GetEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - // The name for this IKE policy. The name is unique across all IKE policies in the region. - Name *string `json:"name" validate:"required"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The IKE negotiation mode. Only `main` is supported. - NegotiationMode *string `json:"negotiation_mode" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource group for this IKE policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// NewGetEndpointGatewayIPOptions : Instantiate GetEndpointGatewayIPOptions +func (*VpcV1) NewGetEndpointGatewayIPOptions(endpointGatewayID string, id string) *GetEndpointGatewayIPOptions { + return &GetEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *GetEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options } -// Constants associated with the IkePolicy.AuthenticationAlgorithm property. -// The authentication algorithm -// -// The `md5` and `sha1` algorithms have been deprecated. -const ( - IkePolicyAuthenticationAlgorithmMd5Const = "md5" - IkePolicyAuthenticationAlgorithmSha1Const = "sha1" - IkePolicyAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyAuthenticationAlgorithmSha384Const = "sha384" - IkePolicyAuthenticationAlgorithmSha512Const = "sha512" -) +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayIPOptions) SetID(id string) *GetEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the IkePolicy.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `triple_des` algorithm has been deprecated. -const ( - IkePolicyEncryptionAlgorithmAes128Const = "aes128" - IkePolicyEncryptionAlgorithmAes192Const = "aes192" - IkePolicyEncryptionAlgorithmAes256Const = "aes256" - IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" -) +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayIPOptions) SetHeaders(param map[string]string) *GetEndpointGatewayIPOptions { + options.Headers = param + return options +} -// Constants associated with the IkePolicy.NegotiationMode property. -// The IKE negotiation mode. Only `main` is supported. -const ( - IkePolicyNegotiationModeMainConst = "main" -) +// GetEndpointGatewayOptions : The GetEndpointGateway options. +type GetEndpointGatewayOptions struct { + // The endpoint gateway identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the IkePolicy.ResourceType property. -// The resource type. -const ( - IkePolicyResourceTypeIkePolicyConst = "ike_policy" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalIkePolicy unmarshals an instance of IkePolicy from the specified map of raw messages. -func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "negotiation_mode", &obj.NegotiationMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewGetEndpointGatewayOptions : Instantiate GetEndpointGatewayOptions +func (*VpcV1) NewGetEndpointGatewayOptions(id string) *GetEndpointGatewayOptions { + return &GetEndpointGatewayOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IkePolicyCollection : IkePolicyCollection struct -type IkePolicyCollection struct { - // A link to the first page of resources. - First *IkePolicyCollectionFirst `json:"first" validate:"required"` - - // Collection of IKE policies. - IkePolicies []IkePolicy `json:"ike_policies" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayOptions) SetID(id string) *GetEndpointGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *GetEndpointGatewayOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *IkePolicyCollectionNext `json:"next,omitempty"` +// GetFloatingIPOptions : The GetFloatingIP options. +type GetFloatingIPOptions struct { + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalIkePolicyCollection unmarshals an instance of IkePolicyCollection from the specified map of raw messages. -func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIkePolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policies", &obj.IkePolicies, UnmarshalIkePolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIkePolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetFloatingIPOptions : Instantiate GetFloatingIPOptions +func (*VpcV1) NewGetFloatingIPOptions(id string) *GetFloatingIPOptions { + return &GetFloatingIPOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *IkePolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *GetFloatingIPOptions) SetID(id string) *GetFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// IkePolicyPatch : IkePolicyPatch struct -type IkePolicyPatch struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetFloatingIPOptions) SetHeaders(param map[string]string) *GetFloatingIPOptions { + options.Headers = param + return options +} - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group,omitempty"` +// GetFlowLogCollectorOptions : The GetFlowLogCollector options. +type GetFlowLogCollectorOptions struct { + // The flow log collector identifier. + ID *string `json:"id" validate:"required,ne="` - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version,omitempty"` +// NewGetFlowLogCollectorOptions : Instantiate GetFlowLogCollectorOptions +func (*VpcV1) NewGetFlowLogCollectorOptions(id string) *GetFlowLogCollectorOptions { + return &GetFlowLogCollectorOptions{ + ID: core.StringPtr(id), + } +} - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` +// SetID : Allow user to set ID +func (_options *GetFlowLogCollectorOptions) SetID(id string) *GetFlowLogCollectorOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name for this IKE policy. The name must not be used by another IKE policy in the region. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetFlowLogCollectorOptions) SetHeaders(param map[string]string) *GetFlowLogCollectorOptions { + options.Headers = param + return options } -// Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyPatchAuthenticationAlgorithmSha384Const = "sha384" - IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) +// GetIkePolicyOptions : The GetIkePolicy options. +type GetIkePolicyOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IkePolicyPatchEncryptionAlgorithmAes192Const = "aes192" - IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalIkePolicyPatch unmarshals an instance of IkePolicyPatch from the specified map of raw messages. -func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewGetIkePolicyOptions : Instantiate GetIkePolicyOptions +func (*VpcV1) NewGetIkePolicyOptions(id string) *GetIkePolicyOptions { + return &GetIkePolicyOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the IkePolicyPatch -func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(ikePolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetID : Allow user to set ID +func (_options *GetIkePolicyOptions) SetID(id string) *GetIkePolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// IkePolicyReference : IkePolicyReference struct -type IkePolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *IkePolicyReferenceDeleted `json:"deleted,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetIkePolicyOptions) SetHeaders(param map[string]string) *GetIkePolicyOptions { + options.Headers = param + return options +} - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` +// GetImageExportJobOptions : The GetImageExportJob options. +type GetImageExportJobOptions struct { + // The image identifier. + ImageID *string `json:"image_id" validate:"required,ne="` - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` + // The image export job identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this IKE policy. The name is unique across all IKE policies in the region. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewGetImageExportJobOptions : Instantiate GetImageExportJobOptions +func (*VpcV1) NewGetImageExportJobOptions(imageID string, id string) *GetImageExportJobOptions { + return &GetImageExportJobOptions{ + ImageID: core.StringPtr(imageID), + ID: core.StringPtr(id), + } } -// Constants associated with the IkePolicyReference.ResourceType property. -// The resource type. -const ( - IkePolicyReferenceResourceTypeIkePolicyConst = "ike_policy" -) +// SetImageID : Allow user to set ImageID +func (_options *GetImageExportJobOptions) SetImageID(imageID string) *GetImageExportJobOptions { + _options.ImageID = core.StringPtr(imageID) + return _options +} -// UnmarshalIkePolicyReference unmarshals an instance of IkePolicyReference from the specified map of raw messages. -func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIkePolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetImageExportJobOptions) SetID(id string) *GetImageExportJobOptions { + _options.ID = core.StringPtr(id) + return _options } -// IP : IP struct -type IP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetImageExportJobOptions) SetHeaders(param map[string]string) *GetImageExportJobOptions { + options.Headers = param + return options } -// NewIP : Instantiate IP (Generic Model Constructor) -func (*VpcV1) NewIP(address string) (_model *IP, err error) { - _model = &IP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return +// GetImageOptions : The GetImage options. +type GetImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalIP unmarshals an instance of IP from the specified map of raw messages. -func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return +// NewGetImageOptions : Instantiate GetImageOptions +func (*VpcV1) NewGetImageOptions(id string) *GetImageOptions { + return &GetImageOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IPsecPolicy : IPsecPolicy struct -type IPsecPolicy struct { - // The authentication algorithm - // - // The `md5` and `sha1` algorithms have been deprecated - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetImageOptions) SetID(id string) *GetImageOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The VPN gateway connections that use this IPsec policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetImageOptions) SetHeaders(param map[string]string) *GetImageOptions { + options.Headers = param + return options +} - // The date and time that this IPsec policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// GetInstanceDiskOptions : The GetInstanceDisk options. +type GetInstanceDiskOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The encapsulation mode used. Only `tunnel` is supported. - EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` + // The instance disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The encryption algorithm - // - // The `triple_des` algorithm has been deprecated - // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` +// NewGetInstanceDiskOptions : Instantiate GetInstanceDiskOptions +func (*VpcV1) NewGetInstanceDiskOptions(instanceID string, id string) *GetInstanceDiskOptions { + return &GetInstanceDiskOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } +} - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceDiskOptions) SetInstanceID(instanceID string) *GetInstanceDiskOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceDiskOptions) SetID(id string) *GetInstanceDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name for this IPsec policy. The name is unique across all IPsec policies in the region. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceDiskOptions) SetHeaders(param map[string]string) *GetInstanceDiskOptions { + options.Headers = param + return options +} - // Perfect Forward Secrecy - // - // Groups `group_2` and `group_5` have been deprecated. - Pfs *string `json:"pfs" validate:"required"` +// GetInstanceGroupManagerActionOptions : The GetInstanceGroupManagerAction options. +type GetInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The resource group for this IPsec policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The instance group manager action identifier. + ID *string `json:"id" validate:"required,ne="` - // The transform protocol used. Only `esp` is supported. - TransformProtocol *string `json:"transform_protocol" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. -// The authentication algorithm -// -// # The `md5` and `sha1` algorithms have been deprecated -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - IPsecPolicyAuthenticationAlgorithmDisabledConst = "disabled" - IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" - IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" - IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyAuthenticationAlgorithmSha384Const = "sha384" - IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" -) +// NewGetInstanceGroupManagerActionOptions : Instantiate GetInstanceGroupManagerActionOptions +func (*VpcV1) NewGetInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerActionOptions { + return &GetInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + } +} -// Constants associated with the IPsecPolicy.EncapsulationMode property. -// The encapsulation mode used. Only `tunnel` is supported. -const ( - IPsecPolicyEncapsulationModeTunnelConst = "tunnel" -) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} -// Constants associated with the IPsecPolicy.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `triple_des` algorithm has been deprecated -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - IPsecPolicyEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - IPsecPolicyEncryptionAlgorithmAes192Const = "aes192" - IPsecPolicyEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" - IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" -) +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} -// Constants associated with the IPsecPolicy.Pfs property. -// Perfect Forward Secrecy -// -// Groups `group_2` and `group_5` have been deprecated. -const ( - IPsecPolicyPfsDisabledConst = "disabled" - IPsecPolicyPfsGroup14Const = "group_14" - IPsecPolicyPfsGroup15Const = "group_15" - IPsecPolicyPfsGroup16Const = "group_16" - IPsecPolicyPfsGroup17Const = "group_17" - IPsecPolicyPfsGroup18Const = "group_18" - IPsecPolicyPfsGroup19Const = "group_19" - IPsecPolicyPfsGroup2Const = "group_2" - IPsecPolicyPfsGroup20Const = "group_20" - IPsecPolicyPfsGroup21Const = "group_21" - IPsecPolicyPfsGroup22Const = "group_22" - IPsecPolicyPfsGroup23Const = "group_23" - IPsecPolicyPfsGroup24Const = "group_24" - IPsecPolicyPfsGroup31Const = "group_31" - IPsecPolicyPfsGroup5Const = "group_5" -) +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerActionOptions) SetID(id string) *GetInstanceGroupManagerActionOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the IPsecPolicy.ResourceType property. -// The resource type. -const ( - IPsecPolicyResourceTypeIpsecPolicyConst = "ipsec_policy" -) +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerActionOptions { + options.Headers = param + return options +} -// Constants associated with the IPsecPolicy.TransformProtocol property. -// The transform protocol used. Only `esp` is supported. -const ( - IPsecPolicyTransformProtocolEspConst = "esp" -) +// GetInstanceGroupManagerOptions : The GetInstanceGroupManager options. +type GetInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` -// UnmarshalIPsecPolicy unmarshals an instance of IPsecPolicy from the specified map of raw messages. -func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encapsulation_mode", &obj.EncapsulationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transform_protocol", &obj.TransformProtocol) - if err != nil { - return + // The instance group manager identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetInstanceGroupManagerOptions : Instantiate GetInstanceGroupManagerOptions +func (*VpcV1) NewGetInstanceGroupManagerOptions(instanceGroupID string, id string) *GetInstanceGroupManagerOptions { + return &GetInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IPsecPolicyCollection : IPsecPolicyCollection struct -type IPsecPolicyCollection struct { - // A link to the first page of resources. - First *IPsecPolicyCollectionFirst `json:"first" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // Collection of IPsec policies. - IpsecPolicies []IPsecPolicy `json:"ipsec_policies" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerOptions) SetID(id string) *GetInstanceGroupManagerOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *IPsecPolicyCollectionNext `json:"next,omitempty"` +// GetInstanceGroupManagerPolicyOptions : The GetInstanceGroupManagerPolicy options. +type GetInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalIPsecPolicyCollection unmarshals an instance of IPsecPolicyCollection from the specified map of raw messages. -func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIPsecPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policies", &obj.IpsecPolicies, UnmarshalIPsecPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIPsecPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetInstanceGroupManagerPolicyOptions : Instantiate GetInstanceGroupManagerPolicyOptions +func (*VpcV1) NewGetInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerPolicyOptions { + return &GetInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// IPsecPolicyCollectionFirst : A link to the first page of resources. -type IPsecPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// UnmarshalIPsecPolicyCollectionFirst unmarshals an instance of IPsecPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerPolicyOptions) SetID(id string) *GetInstanceGroupManagerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// IPsecPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IPsecPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerPolicyOptions { + options.Headers = param + return options } -// UnmarshalIPsecPolicyCollectionNext unmarshals an instance of IPsecPolicyCollectionNext from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// GetInstanceGroupMembershipOptions : The GetInstanceGroupMembership options. +type GetInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group membership identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetInstanceGroupMembershipOptions : Instantiate GetInstanceGroupMembershipOptions +func (*VpcV1) NewGetInstanceGroupMembershipOptions(instanceGroupID string, id string) *GetInstanceGroupMembershipOptions { + return &GetInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IPsecPolicyPatch : IPsecPolicyPatch struct -type IPsecPolicyPatch struct { - // The authentication algorithm - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The encryption algorithm - // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceGroupMembershipOptions) SetID(id string) *GetInstanceGroupMembershipOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *GetInstanceGroupMembershipOptions { + options.Headers = param + return options +} - // The name for this IPsec policy. The name must not be used by another IPsec policy in the region. - Name *string `json:"name,omitempty"` +// GetInstanceGroupOptions : The GetInstanceGroup options. +type GetInstanceGroupOptions struct { + // The instance group identifier. + ID *string `json:"id" validate:"required,ne="` - // Perfect Forward Secrecy. - Pfs *string `json:"pfs,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - IPsecPolicyPatchAuthenticationAlgorithmDisabledConst = "disabled" - IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyPatchAuthenticationAlgorithmSha384Const = "sha384" - IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyPatchEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - IPsecPolicyPatchEncryptionAlgorithmAes192Const = "aes192" - IPsecPolicyPatchEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - IPsecPolicyPatchEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyPatchEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" -) +// NewGetInstanceGroupOptions : Instantiate GetInstanceGroupOptions +func (*VpcV1) NewGetInstanceGroupOptions(id string) *GetInstanceGroupOptions { + return &GetInstanceGroupOptions{ + ID: core.StringPtr(id), + } +} -// Constants associated with the IPsecPolicyPatch.Pfs property. -// Perfect Forward Secrecy. -const ( - IPsecPolicyPatchPfsDisabledConst = "disabled" - IPsecPolicyPatchPfsGroup14Const = "group_14" - IPsecPolicyPatchPfsGroup15Const = "group_15" - IPsecPolicyPatchPfsGroup16Const = "group_16" - IPsecPolicyPatchPfsGroup17Const = "group_17" - IPsecPolicyPatchPfsGroup18Const = "group_18" - IPsecPolicyPatchPfsGroup19Const = "group_19" - IPsecPolicyPatchPfsGroup20Const = "group_20" - IPsecPolicyPatchPfsGroup21Const = "group_21" - IPsecPolicyPatchPfsGroup22Const = "group_22" - IPsecPolicyPatchPfsGroup23Const = "group_23" - IPsecPolicyPatchPfsGroup24Const = "group_24" - IPsecPolicyPatchPfsGroup31Const = "group_31" -) +// SetID : Allow user to set ID +func (_options *GetInstanceGroupOptions) SetID(id string) *GetInstanceGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalIPsecPolicyPatch unmarshals an instance of IPsecPolicyPatch from the specified map of raw messages. -func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupOptions) SetHeaders(param map[string]string) *GetInstanceGroupOptions { + options.Headers = param + return options } -// AsPatch returns a generic map representation of the IPsecPolicyPatch -func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(iPsecPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// GetInstanceInitializationOptions : The GetInstanceInitialization options. +type GetInstanceInitializationOptions struct { + // The instance identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetInstanceInitializationOptions : Instantiate GetInstanceInitializationOptions +func (*VpcV1) NewGetInstanceInitializationOptions(id string) *GetInstanceInitializationOptions { + return &GetInstanceInitializationOptions{ + ID: core.StringPtr(id), } - return } -// IPsecPolicyReference : IPsecPolicyReference struct -type IPsecPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *IPsecPolicyReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceInitializationOptions) SetID(id string) *GetInstanceInitializationOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceInitializationOptions) SetHeaders(param map[string]string) *GetInstanceInitializationOptions { + options.Headers = param + return options +} - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` +// GetInstanceNetworkAttachmentOptions : The GetInstanceNetworkAttachment options. +type GetInstanceNetworkAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The name for this IPsec policy. The name is unique across all IPsec policies in the region. - Name *string `json:"name" validate:"required"` + // The instance network attachment identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the IPsecPolicyReference.ResourceType property. -// The resource type. -const ( - IPsecPolicyReferenceResourceTypeIpsecPolicyConst = "ipsec_policy" -) - -// UnmarshalIPsecPolicyReference unmarshals an instance of IPsecPolicyReference from the specified map of raw messages. -func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIPsecPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewGetInstanceNetworkAttachmentOptions : Instantiate GetInstanceNetworkAttachmentOptions +func (*VpcV1) NewGetInstanceNetworkAttachmentOptions(instanceID string, id string) *GetInstanceNetworkAttachmentOptions { + return &GetInstanceNetworkAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IPsecPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type IPsecPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceNetworkAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalIPsecPolicyReferenceDeleted unmarshals an instance of IPsecPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkAttachmentOptions) SetID(id string) *GetInstanceNetworkAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options } -// IkePolicyCollectionFirst : A link to the first page of resources. -type IkePolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceNetworkAttachmentOptions { + options.Headers = param + return options } -// UnmarshalIkePolicyCollectionFirst unmarshals an instance of IkePolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIkePolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// GetInstanceNetworkInterfaceFloatingIPOptions : The GetInstanceNetworkInterfaceFloatingIP options. +type GetInstanceNetworkInterfaceFloatingIPOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetInstanceNetworkInterfaceFloatingIPOptions : Instantiate GetInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceFloatingIPOptions { + return &GetInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// IkePolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IkePolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalIkePolicyCollectionNext unmarshals an instance of IkePolicyCollectionNext from the specified map of raw messages. -func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options } -// IkePolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type IkePolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalIkePolicyReferenceDeleted unmarshals an instance of IkePolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options } -// Image : Image struct -type Image struct { - CatalogOffering *ImageCatalogOffering `json:"catalog_offering" validate:"required"` +// GetInstanceNetworkInterfaceIPOptions : The GetInstanceNetworkInterfaceIP options. +type GetInstanceNetworkInterfaceIPOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The date and time that the image was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The deprecation date and time (UTC) for this image. - // - // If absent, no deprecation date and time has been set. - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The type of encryption used on the image. - Encryption *string `json:"encryption" validate:"required"` +// NewGetInstanceNetworkInterfaceIPOptions : Instantiate GetInstanceNetworkInterfaceIPOptions +func (*VpcV1) NewGetInstanceNetworkInterfaceIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceIPOptions { + return &GetInstanceNetworkInterfaceIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } +} - // The key that will be used to encrypt volumes created from this image (unless an - // alternate `encryption_key` is specified at volume creation). - // - // This property will be present for images with an `encryption` type of `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkInterfaceIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // Details for the stored image file. - File *ImageFile `json:"file" validate:"required"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetInstanceNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} - // The URL for this image. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkInterfaceIPOptions) SetID(id string) *GetInstanceNetworkInterfaceIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceIPOptions { + options.Headers = param + return options +} - // The minimum size (in gigabytes) of a volume onto which this image may be provisioned. - // - // This property may be absent if the image has a `status` of `pending` or `failed`. - MinimumProvisionedSize *int64 `json:"minimum_provisioned_size,omitempty"` +// GetInstanceNetworkInterfaceOptions : The GetInstanceNetworkInterface options. +type GetInstanceNetworkInterfaceOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The name for this image. The name is unique across all images in the region. - Name *string `json:"name" validate:"required"` + // The instance network interface identifier. + ID *string `json:"id" validate:"required,ne="` - // The obsolescence date and time (UTC) for this image. - // - // If absent, no obsolescence date and time has been set. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The operating system included in this image. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` +// NewGetInstanceNetworkInterfaceOptions : Instantiate GetInstanceNetworkInterfaceOptions +func (*VpcV1) NewGetInstanceNetworkInterfaceOptions(instanceID string, id string) *GetInstanceNetworkInterfaceOptions { + return &GetInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } +} - // The resource group for this image. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkInterfaceOptions) SetID(id string) *GetInstanceNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The volume used to create this image (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this image was not created from a volume. - SourceVolume *VolumeReference `json:"source_volume,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceOptions { + options.Headers = param + return options +} - // The status of this image - // - available: image can be used (provisionable) - // - deleting: image is being deleted, and can no longer be used to provision new - // resources - // - deprecated: image is administratively slated to become `obsolete` - // - failed: image is corrupt or did not pass validation - // - obsolete: image administratively set to not be used for new resources - // - pending: image is being imported and is not yet `available` - // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` +// GetInstanceOptions : The GetInstance options. +type GetInstanceOptions struct { + // The virtual server instance identifier. + ID *string `json:"id" validate:"required,ne="` - // The reasons for the current status (if any): - // - `encrypted_data_key_invalid`: image cannot be decrypted with the specified - // `encryption_key` - // - `encryption_key_deleted`: image unusable because its `encryption_key` was deleted - // - `encryption_key_disabled`: image unusable until its `encryption_key` is re-enabled - // - `image_data_corrupted`: image data is corrupt, or is not in the specified format - // - `image_provisioned_size_unsupported`: image requires a boot volume size greater - // than the maximum supported value - // - `image_request_in_progress`: image operation is in progress (such as an import from - // Cloud Object Storage) - // - `image_request_queued`: image request has been accepted but the requested - // operation has not started - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ImageStatusReason `json:"status_reasons" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The visibility of this image. - // - `private`: Visible only to this account - // - `public`: Visible to all accounts. - Visibility *string `json:"visibility" validate:"required"` +// NewGetInstanceOptions : Instantiate GetInstanceOptions +func (*VpcV1) NewGetInstanceOptions(id string) *GetInstanceOptions { + return &GetInstanceOptions{ + ID: core.StringPtr(id), + } } -// Constants associated with the Image.Encryption property. -// The type of encryption used on the image. -const ( - ImageEncryptionNoneConst = "none" - ImageEncryptionUserManagedConst = "user_managed" -) +// SetID : Allow user to set ID +func (_options *GetInstanceOptions) SetID(id string) *GetInstanceOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the Image.ResourceType property. -// The resource type. -const ( - ImageResourceTypeImageConst = "image" -) +// SetHeaders : Allow user to set Headers +func (options *GetInstanceOptions) SetHeaders(param map[string]string) *GetInstanceOptions { + options.Headers = param + return options +} -// Constants associated with the Image.Status property. -// The status of this image -// - available: image can be used (provisionable) -// - deleting: image is being deleted, and can no longer be used to provision new -// resources -// - deprecated: image is administratively slated to become `obsolete` -// - failed: image is corrupt or did not pass validation -// - obsolete: image administratively set to not be used for new resources -// - pending: image is being imported and is not yet `available` -// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the -// unexpected property value was encountered. -const ( - ImageStatusAvailableConst = "available" - ImageStatusDeletingConst = "deleting" - ImageStatusDeprecatedConst = "deprecated" - ImageStatusFailedConst = "failed" - ImageStatusObsoleteConst = "obsolete" - ImageStatusPendingConst = "pending" - ImageStatusUnusableConst = "unusable" -) +// GetInstanceProfileOptions : The GetInstanceProfile options. +type GetInstanceProfileOptions struct { + // The instance profile name. + Name *string `json:"name" validate:"required,ne="` -// Constants associated with the Image.Visibility property. -// The visibility of this image. -// - `private`: Visible only to this account -// - `public`: Visible to all accounts. -const ( - ImageVisibilityPrivateConst = "private" - ImageVisibilityPublicConst = "public" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalImage unmarshals an instance of Image from the specified map of raw messages. -func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Image) - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalImageCatalogOffering) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return +// NewGetInstanceProfileOptions : Instantiate GetInstanceProfileOptions +func (*VpcV1) NewGetInstanceProfileOptions(name string) *GetInstanceProfileOptions { + return &GetInstanceProfileOptions{ + Name: core.StringPtr(name), } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +} + +// SetName : Allow user to set Name +func (_options *GetInstanceProfileOptions) SetName(name string) *GetInstanceProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetInstanceProfileOptions) SetHeaders(param map[string]string) *GetInstanceProfileOptions { + options.Headers = param + return options +} + +// GetInstanceTemplateOptions : The GetInstanceTemplate options. +type GetInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetInstanceTemplateOptions : Instantiate GetInstanceTemplateOptions +func (*VpcV1) NewGetInstanceTemplateOptions(id string) *GetInstanceTemplateOptions { + return &GetInstanceTemplateOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "minimum_provisioned_size", &obj.MinimumProvisionedSize) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageCatalogOffering : ImageCatalogOffering struct -type ImageCatalogOffering struct { - // Indicates whether this image is managed as part of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. If an image is managed, - // accounts in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) with access to that catalog can - // specify the image's catalog offering version CRN to provision virtual server instances using the image. - Managed *bool `json:"managed" validate:"required"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version associated with this image. - // - // If absent, this image is not associated with a cloud catalog offering. - Version *CatalogOfferingVersionReference `json:"version,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceTemplateOptions) SetID(id string) *GetInstanceTemplateOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalImageCatalogOffering unmarshals an instance of ImageCatalogOffering from the specified map of raw messages. -func UnmarshalImageCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCatalogOffering) - err = core.UnmarshalPrimitive(m, "managed", &obj.Managed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceTemplateOptions) SetHeaders(param map[string]string) *GetInstanceTemplateOptions { + options.Headers = param + return options } -// ImageCollection : ImageCollection struct -type ImageCollection struct { - // A link to the first page of resources. - First *ImageCollectionFirst `json:"first" validate:"required"` - - // Collection of images. - Images []Image `json:"images" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// GetInstanceVolumeAttachmentOptions : The GetInstanceVolumeAttachment options. +type GetInstanceVolumeAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ImageCollectionNext `json:"next,omitempty"` + // The volume attachment identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImageCollection unmarshals an instance of ImageCollection from the specified map of raw messages. -func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalImageCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "images", &obj.Images, UnmarshalImage) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalImageCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetInstanceVolumeAttachmentOptions : Instantiate GetInstanceVolumeAttachmentOptions +func (*VpcV1) NewGetInstanceVolumeAttachmentOptions(instanceID string, id string) *GetInstanceVolumeAttachmentOptions { + return &GetInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ImageCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// ImageCollectionFirst : A link to the first page of resources. -type ImageCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceVolumeAttachmentOptions) SetID(id string) *GetInstanceVolumeAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalImageCollectionFirst unmarshals an instance of ImageCollectionFirst from the specified map of raw messages. -func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceVolumeAttachmentOptions { + options.Headers = param + return options } -// ImageCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ImageCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// GetIpsecPolicyOptions : The GetIpsecPolicy options. +type GetIpsecPolicyOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImageCollectionNext unmarshals an instance of ImageCollectionNext from the specified map of raw messages. -func UnmarshalImageCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetIpsecPolicyOptions : Instantiate GetIpsecPolicyOptions +func (*VpcV1) NewGetIpsecPolicyOptions(id string) *GetIpsecPolicyOptions { + return &GetIpsecPolicyOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageExportJob : ImageExportJob struct -type ImageExportJob struct { - // The date and time that the image export job was completed. - // - // If absent, the export job has not yet completed. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the image export job was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This - // key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto - // Services. - // - // If absent, the export job is for an unencrypted image. - EncryptedDataKey *[]byte `json:"encrypted_data_key,omitempty"` - - // The format of the exported image. - Format *string `json:"format" validate:"required"` - - // The URL for this image export job. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this image export job. - ID *string `json:"id" validate:"required"` - - // The name for this image export job. The name must not be used by another export job for the image. Changing the name - // will not affect the exported image name, - // `storage_object.name`, or `storage_href` values. - Name *string `json:"name" validate:"required"` - - // The type of resource referenced. - ResourceType *string `json:"resource_type" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetIpsecPolicyOptions) SetID(id string) *GetIpsecPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The date and time that the image export job started running. - // - // If absent, the export job has not yet started. - StartedAt *strfmt.DateTime `json:"started_at,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetIpsecPolicyOptions) SetHeaders(param map[string]string) *GetIpsecPolicyOptions { + options.Headers = param + return options +} - // The status of this image export job: - // - `deleting`: Export job is being deleted - // - `failed`: Export job could not be completed successfully - // - `queued`: Export job is queued - // - `running`: Export job is in progress - // - `succeeded`: Export job was completed successfully - // - // The exported image object is automatically deleted for `failed` jobs. - Status *string `json:"status" validate:"required"` +// GetKeyOptions : The GetKey options. +type GetKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ImageExportJobStatusReason `json:"status_reasons" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The Cloud Object Storage bucket of the exported image object. - StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` +// NewGetKeyOptions : Instantiate GetKeyOptions +func (*VpcV1) NewGetKeyOptions(id string) *GetKeyOptions { + return &GetKeyOptions{ + ID: core.StringPtr(id), + } +} - // The Cloud Object Storage location of the exported image object. The object at this location will not exist until the - // job completes successfully. The exported image object is not managed by the IBM VPC service, and may be removed or - // replaced with a different object by any user or service with IAM authorization to the storage bucket. - StorageHref *string `json:"storage_href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetKeyOptions) SetID(id string) *GetKeyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The Cloud Object Storage object for the exported image. This object will not exist until - // the job completes successfully. The exported image object is not managed by the IBM VPC - // service, and may be removed or replaced with a different object by any user or service - // with IAM authorization to the storage bucket. - StorageObject *CloudObjectStorageObjectReference `json:"storage_object" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetKeyOptions) SetHeaders(param map[string]string) *GetKeyOptions { + options.Headers = param + return options } -// Constants associated with the ImageExportJob.Format property. -// The format of the exported image. -const ( - ImageExportJobFormatQcow2Const = "qcow2" - ImageExportJobFormatVhdConst = "vhd" -) +// GetLoadBalancerListenerOptions : The GetLoadBalancerListener options. +type GetLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` -// Constants associated with the ImageExportJob.ResourceType property. -// The type of resource referenced. -const ( - ImageExportJobResourceTypeImageExportJobConst = "image_export_job" -) + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the ImageExportJob.Status property. -// The status of this image export job: -// - `deleting`: Export job is being deleted -// - `failed`: Export job could not be completed successfully -// - `queued`: Export job is queued -// - `running`: Export job is in progress -// - `succeeded`: Export job was completed successfully -// -// The exported image object is automatically deleted for `failed` jobs. -const ( - ImageExportJobStatusDeletingConst = "deleting" - ImageExportJobStatusFailedConst = "failed" - ImageExportJobStatusQueuedConst = "queued" - ImageExportJobStatusRunningConst = "running" - ImageExportJobStatusSucceededConst = "succeeded" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalImageExportJob unmarshals an instance of ImageExportJob from the specified map of raw messages. -func UnmarshalImageExportJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJob) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "format", &obj.Format) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageExportJobStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "storage_href", &obj.StorageHref) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_object", &obj.StorageObject, UnmarshalCloudObjectStorageObjectReference) - if err != nil { - return +// NewGetLoadBalancerListenerOptions : Instantiate GetLoadBalancerListenerOptions +func (*VpcV1) NewGetLoadBalancerListenerOptions(loadBalancerID string, id string) *GetLoadBalancerListenerOptions { + return &GetLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageExportJobPatch : ImageExportJobPatch struct -type ImageExportJobPatch struct { - // The name for this image export job. The name must not be used by another export job for the image. Changing the name - // will not affect the exported image name, - // `storage_object.name`, or `storage_href` values. - Name *string `json:"name,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalImageExportJobPatch unmarshals an instance of ImageExportJobPatch from the specified map of raw messages. -func UnmarshalImageExportJobPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerOptions) SetID(id string) *GetLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) + return _options } -// AsPatch returns a generic map representation of the ImageExportJobPatch -func (imageExportJobPatch *ImageExportJobPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(imageExportJobPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerOptions { + options.Headers = param + return options } -// ImageExportJobStatusReason : ImageExportJobStatusReason struct -type ImageExportJobStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// GetLoadBalancerListenerPolicyOptions : The GetLoadBalancerListenerPolicy options. +type GetLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} + // The policy identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the ImageExportJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ImageExportJobStatusReasonCodeCannotAccessStorageBucketConst = "cannot_access_storage_bucket" - ImageExportJobStatusReasonCodeInternalErrorConst = "internal_error" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalImageExportJobStatusReason unmarshals an instance of ImageExportJobStatusReason from the specified map of raw messages. -func UnmarshalImageExportJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewGetLoadBalancerListenerPolicyOptions : Instantiate GetLoadBalancerListenerPolicyOptions +func (*VpcV1) NewGetLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *GetLoadBalancerListenerPolicyOptions { + return &GetLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageExportJobUnpaginatedCollection : ImageExportJobUnpaginatedCollection struct -type ImageExportJobUnpaginatedCollection struct { - // Collection of image export jobs. - ExportJobs []ImageExportJob `json:"export_jobs" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalImageExportJobUnpaginatedCollection unmarshals an instance of ImageExportJobUnpaginatedCollection from the specified map of raw messages. -func UnmarshalImageExportJobUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobUnpaginatedCollection) - err = core.UnmarshalModel(m, "export_jobs", &obj.ExportJobs, UnmarshalImageExportJob) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetListenerID : Allow user to set ListenerID +func (_options *GetLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -// ImageFile : ImageFile struct -type ImageFile struct { - // Checksums for this image file. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Checksums *ImageFileChecksums `json:"checksums,omitempty"` - - // The size of the stored image file rounded up to the next gigabyte. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Size *int64 `json:"size,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerPolicyOptions) SetID(id string) *GetLoadBalancerListenerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalImageFile unmarshals an instance of ImageFile from the specified map of raw messages. -func UnmarshalImageFile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFile) - err = core.UnmarshalModel(m, "checksums", &obj.Checksums, UnmarshalImageFileChecksums) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyOptions { + options.Headers = param + return options } -// ImageFileChecksums : ImageFileChecksums struct -type ImageFileChecksums struct { - // The SHA256 fingerprint of the image file. - Sha256 *string `json:"sha256,omitempty"` +// GetLoadBalancerListenerPolicyRuleOptions : The GetLoadBalancerListenerPolicyRule options. +type GetLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImageFileChecksums unmarshals an instance of ImageFileChecksums from the specified map of raw messages. -func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFileChecksums) - err = core.UnmarshalPrimitive(m, "sha256", &obj.Sha256) - if err != nil { - return +// NewGetLoadBalancerListenerPolicyRuleOptions : Instantiate GetLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *GetLoadBalancerListenerPolicyRuleOptions { + return &GetLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageFilePrototype : ImageFilePrototype struct -type ImageFilePrototype struct { - // The Cloud Object Storage location of the image file. - // - // The image file format is specified by the file's extension, which must be either - // `qcow2` or `vhd`. - Href *string `json:"href" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// NewImageFilePrototype : Instantiate ImageFilePrototype (Generic Model Constructor) -func (*VpcV1) NewImageFilePrototype(href string) (_model *ImageFilePrototype, err error) { - _model = &ImageFilePrototype{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return +// SetListenerID : Allow user to set ListenerID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -// UnmarshalImageFilePrototype unmarshals an instance of ImageFilePrototype from the specified map of raw messages. -func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFilePrototype) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetPolicyID : Allow user to set PolicyID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options } -// ImageIdentity : Identifies an image by a unique property. -// Models which "extend" this model: -// - ImageIdentityByID -// - ImageIdentityByCRN -// - ImageIdentityByHref -type ImageIdentity struct { - // The unique identifier for this image. - ID *string `json:"id,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetID(id string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The CRN for this image. - CRN *string `json:"crn,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyRuleOptions { + options.Headers = param + return options +} - // The URL for this image. - Href *string `json:"href,omitempty"` +// GetLoadBalancerOptions : The GetLoadBalancer options. +type GetLoadBalancerOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -func (*ImageIdentity) isaImageIdentity() bool { - return true +// NewGetLoadBalancerOptions : Instantiate GetLoadBalancerOptions +func (*VpcV1) NewGetLoadBalancerOptions(id string) *GetLoadBalancerOptions { + return &GetLoadBalancerOptions{ + ID: core.StringPtr(id), + } } -type ImageIdentityIntf interface { - isaImageIdentity() bool +// SetID : Allow user to set ID +func (_options *GetLoadBalancerOptions) SetID(id string) *GetLoadBalancerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalImageIdentity unmarshals an instance of ImageIdentity from the specified map of raw messages. -func UnmarshalImageIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerOptions) SetHeaders(param map[string]string) *GetLoadBalancerOptions { + options.Headers = param + return options } -// ImagePatch : ImagePatch struct -type ImagePatch struct { - // The deprecation date and time to set for this image. - // - // This cannot be set if the image has a `status` of `failed` or `deleting`, or if - // `catalog_offering.managed` is `true`. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). Additionally, if the image status is currently - // `deprecated`, the value cannot be changed (but may be removed). - // - // Specify `null` to remove an existing deprecation date and time. If the image status is currently `deprecated`, it - // will become `available`. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` +// GetLoadBalancerPoolMemberOptions : The GetLoadBalancerPoolMember options. +type GetLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. - Name *string `json:"name,omitempty"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // The obsolescence date and time to set for this image. - // - // This cannot be set if the image has a `status` of `failed` or `deleting`, or if - // `catalog_offering.managed` is `true`. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). Additionally, if the image status is currently `obsolete`, the value cannot be changed - // (but may be removed). - // - // Specify `null` to remove an existing obsolescence date and time. If the image status is currently `obsolete`, it - // will become `deprecated` if `deprecation_at` is in the past. Otherwise, it will become `available`. - // - // If the obsolescence date and time is reached while the image has a status of `pending`, the image's status will - // transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + // The member identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImagePatch unmarshals an instance of ImagePatch from the specified map of raw messages. -func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePatch) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return +// NewGetLoadBalancerPoolMemberOptions : Instantiate GetLoadBalancerPoolMemberOptions +func (*VpcV1) NewGetLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *GetLoadBalancerPoolMemberOptions { + return &GetLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the ImagePatch -func (imagePatch *ImagePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(imagePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// ImagePrototype : ImagePrototype struct -// Models which "extend" this model: -// - ImagePrototypeImageByFile -// - ImagePrototypeImageBySourceVolume -type ImagePrototype struct { - // The deprecation date and time to set for this image. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). - // - // If unspecified, no deprecation date and time will be set. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` +// SetPoolID : Allow user to set PoolID +func (_options *GetLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *GetLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) + return _options +} - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerPoolMemberOptions) SetID(id string) *GetLoadBalancerPoolMemberOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). - // - // If unspecified, no obsolescence date and time will be set. - // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolMemberOptions { + options.Headers = param + return options +} - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// GetLoadBalancerPoolOptions : The GetLoadBalancerPool options. +type GetLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. - // - // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be - // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the - // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + // The pool identifier. + ID *string `json:"id" validate:"required,ne="` - // The root key that was used to wrap the data key (which is ultimately represented as - // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes - // created from this image (unless an alternate `encryption_key` is specified at volume - // creation). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The file from which to create the image. - File *ImageFilePrototype `json:"file,omitempty"` +// NewGetLoadBalancerPoolOptions : Instantiate GetLoadBalancerPoolOptions +func (*VpcV1) NewGetLoadBalancerPoolOptions(loadBalancerID string, id string) *GetLoadBalancerPoolOptions { + return &GetLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + } +} - // The [supported operating - // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this - // image. - OperatingSystem OperatingSystemIdentityIntf `json:"operating_system,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The volume from which to create the image. The specified volume must: - // - Have an `operating_system`, which will be used to populate this image's - // operating system information. - // - Not be `active` or `busy`. - // - // During image creation, the specified volume may briefly become `busy`. - SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerPoolOptions) SetID(id string) *GetLoadBalancerPoolOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*ImagePrototype) isaImagePrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerPoolOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolOptions { + options.Headers = param + return options } -type ImagePrototypeIntf interface { - isaImagePrototype() bool +// GetLoadBalancerProfileOptions : The GetLoadBalancerProfile options. +type GetLoadBalancerProfileOptions struct { + // The load balancer profile name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImagePrototype unmarshals an instance of ImagePrototype from the specified map of raw messages. -func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototype) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return +// NewGetLoadBalancerProfileOptions : Instantiate GetLoadBalancerProfileOptions +func (*VpcV1) NewGetLoadBalancerProfileOptions(name string) *GetLoadBalancerProfileOptions { + return &GetLoadBalancerProfileOptions{ + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageReference : ImageReference struct -type ImageReference struct { - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` +// SetName : Allow user to set Name +func (_options *GetLoadBalancerProfileOptions) SetName(name string) *GetLoadBalancerProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ImageReferenceDeleted `json:"deleted,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerProfileOptions) SetHeaders(param map[string]string) *GetLoadBalancerProfileOptions { + options.Headers = param + return options +} - // The URL for this image. - Href *string `json:"href" validate:"required"` +// GetLoadBalancerStatisticsOptions : The GetLoadBalancerStatistics options. +type GetLoadBalancerStatisticsOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The name for this image. The name is unique across all images in the region. - Name *string `json:"name" validate:"required"` +// NewGetLoadBalancerStatisticsOptions : Instantiate GetLoadBalancerStatisticsOptions +func (*VpcV1) NewGetLoadBalancerStatisticsOptions(id string) *GetLoadBalancerStatisticsOptions { + return &GetLoadBalancerStatisticsOptions{ + ID: core.StringPtr(id), + } +} - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *ImageRemote `json:"remote,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerStatisticsOptions) SetID(id string) *GetLoadBalancerStatisticsOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerStatisticsOptions) SetHeaders(param map[string]string) *GetLoadBalancerStatisticsOptions { + options.Headers = param + return options } -// Constants associated with the ImageReference.ResourceType property. -// The resource type. -const ( - ImageReferenceResourceTypeImageConst = "image" -) +// GetNetworkACLOptions : The GetNetworkACL options. +type GetNetworkACLOptions struct { + // The network ACL identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalImageReference unmarshals an instance of ImageReference from the specified map of raw messages. -func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalImageReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalImageRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// ImageReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ImageReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// NewGetNetworkACLOptions : Instantiate GetNetworkACLOptions +func (*VpcV1) NewGetNetworkACLOptions(id string) *GetNetworkACLOptions { + return &GetNetworkACLOptions{ + ID: core.StringPtr(id), + } } -// UnmarshalImageReferenceDeleted unmarshals an instance of ImageReferenceDeleted from the specified map of raw messages. -func UnmarshalImageReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetNetworkACLOptions) SetID(id string) *GetNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options } -// ImageRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type ImageRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetNetworkACLOptions) SetHeaders(param map[string]string) *GetNetworkACLOptions { + options.Headers = param + return options +} - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` +// GetNetworkACLRuleOptions : The GetNetworkACLRule options. +type GetNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImageRemote unmarshals an instance of ImageRemote from the specified map of raw messages. -func UnmarshalImageRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return +// NewGetNetworkACLRuleOptions : Instantiate GetNetworkACLRuleOptions +func (*VpcV1) NewGetNetworkACLRuleOptions(networkACLID string, id string) *GetNetworkACLRuleOptions { + return &GetNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageStatusReason : ImageStatusReason struct -type ImageStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *GetNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *GetNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetNetworkACLRuleOptions) SetID(id string) *GetNetworkACLRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetNetworkACLRuleOptions) SetHeaders(param map[string]string) *GetNetworkACLRuleOptions { + options.Headers = param + return options } -// Constants associated with the ImageStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ImageStatusReasonCodeEncryptedDataKeyInvalidConst = "encrypted_data_key_invalid" - ImageStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - ImageStatusReasonCodeEncryptionKeyDisabledConst = "encryption_key_disabled" - ImageStatusReasonCodeImageDataCorruptedConst = "image_data_corrupted" - ImageStatusReasonCodeImageProvisionedSizeUnsupportedConst = "image_provisioned_size_unsupported" - ImageStatusReasonCodeImageRequestInProgressConst = "image_request_in_progress" - ImageStatusReasonCodeImageRequestQueuedConst = "image_request_queued" -) +// GetNetworkInterfaceFloatingIPOptions : The GetNetworkInterfaceFloatingIP options. +type GetNetworkInterfaceFloatingIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` -// UnmarshalImageStatusReason unmarshals an instance of ImageStatusReason from the specified map of raw messages. -func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetNetworkInterfaceFloatingIPOptions : Instantiate GetNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewGetNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *GetNetworkInterfaceFloatingIPOptions { + return &GetNetworkInterfaceFloatingIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Instance : Instance struct -type Instance struct { - // The availability policy for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicy `json:"availability_policy" validate:"required"` +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *GetNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *GetNetworkInterfaceFloatingIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options +} - // The total bandwidth (in megabits per second) shared across the instance network interfaces and storage volumes of - // virtual server instance. - Bandwidth *int64 `json:"bandwidth" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetNetworkInterfaceFloatingIPOptions) SetID(id string) *GetNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Boot volume attachment. - BootVolumeAttachment *VolumeAttachmentReferenceInstanceContext `json:"boot_volume_attachment" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - // If present, this virtual server instance was provisioned from a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). - CatalogOffering *InstanceCatalogOffering `json:"catalog_offering,omitempty"` +// GetOperatingSystemOptions : The GetOperatingSystem options. +type GetOperatingSystemOptions struct { + // The operating system name. + Name *string `json:"name" validate:"required,ne="` - // The date and time that the virtual server instance was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` +// NewGetOperatingSystemOptions : Instantiate GetOperatingSystemOptions +func (*VpcV1) NewGetOperatingSystemOptions(name string) *GetOperatingSystemOptions { + return &GetOperatingSystemOptions{ + Name: core.StringPtr(name), + } +} - // If present, the dedicated host this virtual server instance has been placed on. - DedicatedHost *DedicatedHostReference `json:"dedicated_host,omitempty"` +// SetName : Allow user to set Name +func (_options *GetOperatingSystemOptions) SetName(name string) *GetOperatingSystemOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The instance disks for this virtual server instance. - Disks []InstanceDisk `json:"disks" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetOperatingSystemOptions) SetHeaders(param map[string]string) *GetOperatingSystemOptions { + options.Headers = param + return options +} - // The virtual server instance GPU configuration. - Gpu *InstanceGpu `json:"gpu,omitempty"` +// GetPlacementGroupOptions : The GetPlacementGroup options. +type GetPlacementGroupOptions struct { + // The placement group identifier. + ID *string `json:"id" validate:"required,ne="` - // The reasons for the current instance `health_state` (if any): - // - `reservation_capacity_unavailable`: The reservation affinity pool has no - // available capacity. - // - `reservation_deleted`: The reservation affinity pool has a deleted reservation. - // - `reservation_expired`: The reservation affinity pool has an expired reservation. - // - `reservation_failed`: The reservation affinity pool has a failed reservation. - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []InstanceHealthReason `json:"health_reasons" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` +// NewGetPlacementGroupOptions : Instantiate GetPlacementGroupOptions +func (*VpcV1) NewGetPlacementGroupOptions(id string) *GetPlacementGroupOptions { + return &GetPlacementGroupOptions{ + ID: core.StringPtr(id), + } +} - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetPlacementGroupOptions) SetID(id string) *GetPlacementGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetPlacementGroupOptions) SetHeaders(param map[string]string) *GetPlacementGroupOptions { + options.Headers = param + return options +} - // The image the virtual server instance was provisioned from. - Image *ImageReference `json:"image,omitempty"` +// GetPublicGatewayOptions : The GetPublicGateway options. +type GetPublicGatewayOptions struct { + // The public gateway identifier. + ID *string `json:"id" validate:"required,ne="` - // The reasons for the current `lifecycle_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []InstanceLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The lifecycle state of the virtual server instance. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// NewGetPublicGatewayOptions : Instantiate GetPublicGatewayOptions +func (*VpcV1) NewGetPublicGatewayOptions(id string) *GetPublicGatewayOptions { + return &GetPublicGatewayOptions{ + ID: core.StringPtr(id), + } +} - // The amount of memory, truncated to whole gibibytes. - Memory *int64 `json:"memory" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetPublicGatewayOptions) SetID(id string) *GetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The metadata service configuration. - MetadataService *InstanceMetadataService `json:"metadata_service" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetPublicGatewayOptions) SetHeaders(param map[string]string) *GetPublicGatewayOptions { + options.Headers = param + return options +} - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` +// GetRegionOptions : The GetRegion options. +type GetRegionOptions struct { + // The region name. + Name *string `json:"name" validate:"required,ne="` - // The network interfaces for this instance, including the primary network interface. - NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The number of NUMA nodes this virtual server instance is provisioned on. - // - // This property will be absent if the instance's `status` is not `running`. - NumaCount *int64 `json:"numa_count,omitempty"` +// NewGetRegionOptions : Instantiate GetRegionOptions +func (*VpcV1) NewGetRegionOptions(name string) *GetRegionOptions { + return &GetRegionOptions{ + Name: core.StringPtr(name), + } +} - // The placement restrictions for the virtual server instance. - PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` +// SetName : Allow user to set Name +func (_options *GetRegionOptions) SetName(name string) *GetRegionOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The primary network interface for this virtual server instance. - PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetRegionOptions) SetHeaders(param map[string]string) *GetRegionOptions { + options.Headers = param + return options +} - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual - // server instance. - Profile *InstanceProfileReference `json:"profile" validate:"required"` +// GetRegionZoneOptions : The GetRegionZone options. +type GetRegionZoneOptions struct { + // The region name. + RegionName *string `json:"region_name" validate:"required,ne="` - // The reservation used by this virtual server instance. - // - // If absent, no reservation is in use. - Reservation *ReservationReference `json:"reservation,omitempty"` + // The zone name. + Name *string `json:"name" validate:"required,ne="` - ReservationAffinity *InstanceReservationAffinity `json:"reservation_affinity" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource group for this instance. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// NewGetRegionZoneOptions : Instantiate GetRegionZoneOptions +func (*VpcV1) NewGetRegionZoneOptions(regionName string, name string) *GetRegionZoneOptions { + return &GetRegionZoneOptions{ + RegionName: core.StringPtr(regionName), + Name: core.StringPtr(name), + } +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetRegionName : Allow user to set RegionName +func (_options *GetRegionZoneOptions) SetRegionName(regionName string) *GetRegionZoneOptions { + _options.RegionName = core.StringPtr(regionName) + return _options +} - // Indicates whether the state of the virtual server instance permits a start request. - Startable *bool `json:"startable" validate:"required"` +// SetName : Allow user to set Name +func (_options *GetRegionZoneOptions) SetName(name string) *GetRegionZoneOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The status of the virtual server instance. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetRegionZoneOptions { + options.Headers = param + return options +} - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []InstanceStatusReason `json:"status_reasons" validate:"required"` +// GetReservationOptions : The GetReservation options. +type GetReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces. - TotalNetworkBandwidth *int64 `json:"total_network_bandwidth" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth" validate:"required"` +// NewGetReservationOptions : Instantiate GetReservationOptions +func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { + return &GetReservationOptions{ + ID: core.StringPtr(id), + } +} - // The virtual server instance VCPU configuration. - Vcpu *InstanceVcpu `json:"vcpu" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The volume attachments for this virtual server instance, including the boot volume attachment. - VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { + options.Headers = param + return options +} - // The VPC this virtual server instance resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// GetSecurityGroupOptions : The GetSecurityGroup options. +type GetSecurityGroupOptions struct { + // The security group identifier. + ID *string `json:"id" validate:"required,ne="` - // The zone this virtual server instance resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the Instance.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - InstanceHealthStateDegradedConst = "degraded" - InstanceHealthStateFaultedConst = "faulted" - InstanceHealthStateInapplicableConst = "inapplicable" - InstanceHealthStateOkConst = "ok" -) +// NewGetSecurityGroupOptions : Instantiate GetSecurityGroupOptions +func (*VpcV1) NewGetSecurityGroupOptions(id string) *GetSecurityGroupOptions { + return &GetSecurityGroupOptions{ + ID: core.StringPtr(id), + } +} -// Constants associated with the Instance.LifecycleState property. -// The lifecycle state of the virtual server instance. -const ( - InstanceLifecycleStateDeletingConst = "deleting" - InstanceLifecycleStateFailedConst = "failed" - InstanceLifecycleStatePendingConst = "pending" - InstanceLifecycleStateStableConst = "stable" - InstanceLifecycleStateSuspendedConst = "suspended" - InstanceLifecycleStateUpdatingConst = "updating" - InstanceLifecycleStateWaitingConst = "waiting" -) +// SetID : Allow user to set ID +func (_options *GetSecurityGroupOptions) SetID(id string) *GetSecurityGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the Instance.ResourceType property. -// The resource type. -const ( - InstanceResourceTypeInstanceConst = "instance" -) +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupOptions) SetHeaders(param map[string]string) *GetSecurityGroupOptions { + options.Headers = param + return options +} -// Constants associated with the Instance.Status property. -// The status of the virtual server instance. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected -// property value was encountered. -const ( - InstanceStatusDeletingConst = "deleting" - InstanceStatusFailedConst = "failed" - InstanceStatusPendingConst = "pending" - InstanceStatusRestartingConst = "restarting" - InstanceStatusRunningConst = "running" - InstanceStatusStartingConst = "starting" - InstanceStatusStoppedConst = "stopped" - InstanceStatusStoppingConst = "stopping" -) +// GetSecurityGroupRuleOptions : The GetSecurityGroupRule options. +type GetSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` -// UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. -func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Instance) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSecurityGroupRuleOptions : Instantiate GetSecurityGroupRuleOptions +func (*VpcV1) NewGetSecurityGroupRuleOptions(securityGroupID string, id string) *GetSecurityGroupRuleOptions { + return &GetSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return +} + +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *GetSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetSecurityGroupRuleOptions) SetID(id string) *GetSecurityGroupRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupRuleOptions) SetHeaders(param map[string]string) *GetSecurityGroupRuleOptions { + options.Headers = param + return options +} + +// GetSecurityGroupTargetOptions : The GetSecurityGroupTarget options. +type GetSecurityGroupTargetOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // The security group target identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSecurityGroupTargetOptions : Instantiate GetSecurityGroupTargetOptions +func (*VpcV1) NewGetSecurityGroupTargetOptions(securityGroupID string, id string) *GetSecurityGroupTargetOptions { + return &GetSecurityGroupTargetOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOffering) - if err != nil { - return +} + +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *GetSecurityGroupTargetOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupTargetOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetSecurityGroupTargetOptions) SetID(id string) *GetSecurityGroupTargetOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupTargetOptions) SetHeaders(param map[string]string) *GetSecurityGroupTargetOptions { + options.Headers = param + return options +} + +// GetShareMountTargetOptions : The GetShareMountTarget options. +type GetShareMountTargetOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` + + // The share mount target identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetShareMountTargetOptions : Instantiate GetShareMountTargetOptions +func (*VpcV1) NewGetShareMountTargetOptions(shareID string, id string) *GetShareMountTargetOptions { + return &GetShareMountTargetOptions{ + ShareID: core.StringPtr(shareID), + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return +} + +// SetShareID : Allow user to set ShareID +func (_options *GetShareMountTargetOptions) SetShareID(shareID string) *GetShareMountTargetOptions { + _options.ShareID = core.StringPtr(shareID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetShareMountTargetOptions) SetID(id string) *GetShareMountTargetOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetShareMountTargetOptions) SetHeaders(param map[string]string) *GetShareMountTargetOptions { + options.Headers = param + return options +} + +// GetShareOptions : The GetShare options. +type GetShareOptions struct { + // The file share identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetShareOptions : Instantiate GetShareOptions +func (*VpcV1) NewGetShareOptions(id string) *GetShareOptions { + return &GetShareOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetShareOptions) SetID(id string) *GetShareOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetShareOptions) SetHeaders(param map[string]string) *GetShareOptions { + options.Headers = param + return options +} + +// GetShareProfileOptions : The GetShareProfile options. +type GetShareProfileOptions struct { + // The file share profile name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetShareProfileOptions : Instantiate GetShareProfileOptions +func (*VpcV1) NewGetShareProfileOptions(name string) *GetShareProfileOptions { + return &GetShareProfileOptions{ + Name: core.StringPtr(name), } - err = core.UnmarshalModel(m, "dedicated_host", &obj.DedicatedHost, UnmarshalDedicatedHostReference) - if err != nil { - return +} + +// SetName : Allow user to set Name +func (_options *GetShareProfileOptions) SetName(name string) *GetShareProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetShareProfileOptions) SetHeaders(param map[string]string) *GetShareProfileOptions { + options.Headers = param + return options +} + +// GetShareSourceOptions : The GetShareSource options. +type GetShareSourceOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetShareSourceOptions : Instantiate GetShareSourceOptions +func (*VpcV1) NewGetShareSourceOptions(shareID string) *GetShareSourceOptions { + return &GetShareSourceOptions{ + ShareID: core.StringPtr(shareID), } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return +} + +// SetShareID : Allow user to set ShareID +func (_options *GetShareSourceOptions) SetShareID(shareID string) *GetShareSourceOptions { + _options.ShareID = core.StringPtr(shareID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetShareSourceOptions) SetHeaders(param map[string]string) *GetShareSourceOptions { + options.Headers = param + return options +} + +// GetSnapshotCloneOptions : The GetSnapshotClone options. +type GetSnapshotCloneOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` + + // The zone name. + ZoneName *string `json:"zone_name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSnapshotCloneOptions : Instantiate GetSnapshotCloneOptions +func (*VpcV1) NewGetSnapshotCloneOptions(id string, zoneName string) *GetSnapshotCloneOptions { + return &GetSnapshotCloneOptions{ + ID: core.StringPtr(id), + ZoneName: core.StringPtr(zoneName), } - err = core.UnmarshalModel(m, "gpu", &obj.Gpu, UnmarshalInstanceGpu) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetSnapshotCloneOptions) SetID(id string) *GetSnapshotCloneOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *GetSnapshotCloneOptions) SetZoneName(zoneName string) *GetSnapshotCloneOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSnapshotCloneOptions) SetHeaders(param map[string]string) *GetSnapshotCloneOptions { + options.Headers = param + return options +} + +// GetSnapshotConsistencyGroupOptions : The GetSnapshotConsistencyGroup options. +type GetSnapshotConsistencyGroupOptions struct { + // The snapshot consistency group identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSnapshotConsistencyGroupOptions : Instantiate GetSnapshotConsistencyGroupOptions +func (*VpcV1) NewGetSnapshotConsistencyGroupOptions(id string) *GetSnapshotConsistencyGroupOptions { + return &GetSnapshotConsistencyGroupOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalInstanceHealthReason) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetSnapshotConsistencyGroupOptions) SetID(id string) *GetSnapshotConsistencyGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *GetSnapshotConsistencyGroupOptions { + options.Headers = param + return options +} + +// GetSnapshotOptions : The GetSnapshot options. +type GetSnapshotOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSnapshotOptions : Instantiate GetSnapshotOptions +func (*VpcV1) NewGetSnapshotOptions(id string) *GetSnapshotOptions { + return &GetSnapshotOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) +} + +// SetID : Allow user to set ID +func (_options *GetSnapshotOptions) SetID(id string) *GetSnapshotOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSnapshotOptions) SetHeaders(param map[string]string) *GetSnapshotOptions { + options.Headers = param + return options +} + +// GetSubnetNetworkACLOptions : The GetSubnetNetworkACL options. +type GetSubnetNetworkACLOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetNetworkACLOptions : Instantiate GetSubnetNetworkACLOptions +func (*VpcV1) NewGetSubnetNetworkACLOptions(id string) *GetSubnetNetworkACLOptions { + return &GetSubnetNetworkACLOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetSubnetNetworkACLOptions) SetID(id string) *GetSubnetNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSubnetNetworkACLOptions) SetHeaders(param map[string]string) *GetSubnetNetworkACLOptions { + options.Headers = param + return options +} + +// GetSubnetOptions : The GetSubnet options. +type GetSubnetOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetOptions : Instantiate GetSubnetOptions +func (*VpcV1) NewGetSubnetOptions(id string) *GetSubnetOptions { + return &GetSubnetOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetSubnetOptions) SetID(id string) *GetSubnetOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSubnetOptions) SetHeaders(param map[string]string) *GetSubnetOptions { + options.Headers = param + return options +} + +// GetSubnetPublicGatewayOptions : The GetSubnetPublicGateway options. +type GetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetPublicGatewayOptions : Instantiate GetSubnetPublicGatewayOptions +func (*VpcV1) NewGetSubnetPublicGatewayOptions(id string) *GetSubnetPublicGatewayOptions { + return &GetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetSubnetPublicGatewayOptions) SetID(id string) *GetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *GetSubnetPublicGatewayOptions { + options.Headers = param + return options +} + +// GetSubnetReservedIPOptions : The GetSubnetReservedIP options. +type GetSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetReservedIPOptions : Instantiate GetSubnetReservedIPOptions +func (*VpcV1) NewGetSubnetReservedIPOptions(subnetID string, id string) *GetSubnetReservedIPOptions { + return &GetSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), + } +} + +// SetSubnetID : Allow user to set SubnetID +func (_options *GetSubnetReservedIPOptions) SetSubnetID(subnetID string) *GetSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetSubnetReservedIPOptions) SetID(id string) *GetSubnetReservedIPOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSubnetReservedIPOptions) SetHeaders(param map[string]string) *GetSubnetReservedIPOptions { + options.Headers = param + return options +} + +// GetSubnetRoutingTableOptions : The GetSubnetRoutingTable options. +type GetSubnetRoutingTableOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetRoutingTableOptions : Instantiate GetSubnetRoutingTableOptions +func (*VpcV1) NewGetSubnetRoutingTableOptions(id string) *GetSubnetRoutingTableOptions { + return &GetSubnetRoutingTableOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetSubnetRoutingTableOptions) SetID(id string) *GetSubnetRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) *GetSubnetRoutingTableOptions { + options.Headers = param + return options +} + +// GetVPCRouteResponse : GetVPCRouteResponse struct +type GetVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` + + // The zone the route applies to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the GetVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + GetVPCRouteResponseActionDelegateConst = "delegate" + GetVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + GetVPCRouteResponseActionDeliverConst = "deliver" + GetVPCRouteResponseActionDropConst = "drop" +) + +// Constants associated with the GetVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. +const ( + GetVPCRouteResponseLifecycleStateDeletingConst = "deleting" + GetVPCRouteResponseLifecycleStateFailedConst = "failed" + GetVPCRouteResponseLifecycleStatePendingConst = "pending" + GetVPCRouteResponseLifecycleStateStableConst = "stable" + GetVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + GetVPCRouteResponseLifecycleStateUpdatingConst = "updating" + GetVPCRouteResponseLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the GetVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + GetVPCRouteResponseOriginServiceConst = "service" + GetVPCRouteResponseOriginUserConst = "user" +) + +// UnmarshalGetVPCRouteResponse unmarshals an instance of GetVPCRouteResponse from the specified map of raw messages. +func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalInstanceLifecycleReason) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataService) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -44591,75 +45466,19 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceInstanceContextReference) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) if err != nil { return } - err = core.UnmarshalPrimitive(m, "numa_count", &obj.NumaCount) + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceInstanceContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation", &obj.Reservation, UnmarshalReservationReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "startable", &obj.Startable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalInstanceStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_network_bandwidth", &obj.TotalNetworkBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -44667,4075 +45486,14330 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er return } -// InstanceAction : InstanceAction struct -type InstanceAction struct { - // The date and time that the action was completed. - // Deprecated: this field is deprecated and may be removed in a future release. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` +// GetVirtualNetworkInterfaceIPOptions : The GetVirtualNetworkInterfaceIP options. +type GetVirtualNetworkInterfaceIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The date and time that the action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL for this instance action. - // Deprecated: this field is deprecated and may be removed in a future release. - Href *string `json:"href" validate:"required"` +// NewGetVirtualNetworkInterfaceIPOptions : Instantiate GetVirtualNetworkInterfaceIPOptions +func (*VpcV1) NewGetVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *GetVirtualNetworkInterfaceIPOptions { + return &GetVirtualNetworkInterfaceIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), + } +} - // The identifier for this instance action. - // Deprecated: this field is deprecated and may be removed in a future release. - ID *string `json:"id" validate:"required"` +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *GetVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *GetVirtualNetworkInterfaceIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options +} - // The date and time that the action was started. - // Deprecated: this field is deprecated and may be removed in a future release. - StartedAt *strfmt.DateTime `json:"started_at,omitempty"` +// SetID : Allow user to set ID +func (_options *GetVirtualNetworkInterfaceIPOptions) SetID(id string) *GetVirtualNetworkInterfaceIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The current status of this action. - // Deprecated: this field is deprecated and may be removed in a future release. - Status *string `json:"status" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetVirtualNetworkInterfaceIPOptions { + options.Headers = param + return options +} - // The type of action. - Type *string `json:"type" validate:"required"` +// GetVirtualNetworkInterfaceOptions : The GetVirtualNetworkInterface options. +type GetVirtualNetworkInterfaceOptions struct { + // The virtual network interface identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceAction.Status property. -// The current status of this action. -const ( - InstanceActionStatusCompletedConst = "completed" - InstanceActionStatusFailedConst = "failed" - InstanceActionStatusPendingConst = "pending" - InstanceActionStatusRunningConst = "running" -) +// NewGetVirtualNetworkInterfaceOptions : Instantiate GetVirtualNetworkInterfaceOptions +func (*VpcV1) NewGetVirtualNetworkInterfaceOptions(id string) *GetVirtualNetworkInterfaceOptions { + return &GetVirtualNetworkInterfaceOptions{ + ID: core.StringPtr(id), + } +} -// Constants associated with the InstanceAction.Type property. -// The type of action. -const ( - InstanceActionTypeRebootConst = "reboot" - InstanceActionTypeStartConst = "start" - InstanceActionTypeStopConst = "stop" -) +// SetID : Allow user to set ID +func (_options *GetVirtualNetworkInterfaceOptions) SetID(id string) *GetVirtualNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalInstanceAction unmarshals an instance of InstanceAction from the specified map of raw messages. -func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAction) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return +// SetHeaders : Allow user to set Headers +func (options *GetVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetVirtualNetworkInterfaceOptions { + options.Headers = param + return options +} + +// GetVolumeOptions : The GetVolume options. +type GetVolumeOptions struct { + // The volume identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVolumeOptions : Instantiate GetVolumeOptions +func (*VpcV1) NewGetVolumeOptions(id string) *GetVolumeOptions { + return &GetVolumeOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetVolumeOptions) SetID(id string) *GetVolumeOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVolumeOptions) SetHeaders(param map[string]string) *GetVolumeOptions { + options.Headers = param + return options +} + +// GetVolumeProfileOptions : The GetVolumeProfile options. +type GetVolumeProfileOptions struct { + // The volume profile name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVolumeProfileOptions : Instantiate GetVolumeProfileOptions +func (*VpcV1) NewGetVolumeProfileOptions(name string) *GetVolumeProfileOptions { + return &GetVolumeProfileOptions{ + Name: core.StringPtr(name), } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return +} + +// SetName : Allow user to set Name +func (_options *GetVolumeProfileOptions) SetName(name string) *GetVolumeProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVolumeProfileOptions) SetHeaders(param map[string]string) *GetVolumeProfileOptions { + options.Headers = param + return options +} + +// GetVPCAddressPrefixOptions : The GetVPCAddressPrefix options. +type GetVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The prefix identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCAddressPrefixOptions : Instantiate GetVPCAddressPrefixOptions +func (*VpcV1) NewGetVPCAddressPrefixOptions(vpcID string, id string) *GetVPCAddressPrefixOptions { + return &GetVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +} + +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCAddressPrefixOptions) SetVPCID(vpcID string) *GetVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPCAddressPrefixOptions) SetID(id string) *GetVPCAddressPrefixOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCAddressPrefixOptions) SetHeaders(param map[string]string) *GetVPCAddressPrefixOptions { + options.Headers = param + return options +} + +// GetVPCDefaultNetworkACLOptions : The GetVPCDefaultNetworkACL options. +type GetVPCDefaultNetworkACLOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCDefaultNetworkACLOptions : Instantiate GetVPCDefaultNetworkACLOptions +func (*VpcV1) NewGetVPCDefaultNetworkACLOptions(id string) *GetVPCDefaultNetworkACLOptions { + return &GetVPCDefaultNetworkACLOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetVPCDefaultNetworkACLOptions) SetID(id string) *GetVPCDefaultNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultNetworkACLOptions) SetHeaders(param map[string]string) *GetVPCDefaultNetworkACLOptions { + options.Headers = param + return options +} + +// GetVPCDefaultRoutingTableOptions : The GetVPCDefaultRoutingTable options. +type GetVPCDefaultRoutingTableOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCDefaultRoutingTableOptions : Instantiate GetVPCDefaultRoutingTableOptions +func (*VpcV1) NewGetVPCDefaultRoutingTableOptions(id string) *GetVPCDefaultRoutingTableOptions { + return &GetVPCDefaultRoutingTableOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetVPCDefaultRoutingTableOptions) SetID(id string) *GetVPCDefaultRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCDefaultRoutingTableOptions { + options.Headers = param + return options +} + +// GetVPCDefaultSecurityGroupOptions : The GetVPCDefaultSecurityGroup options. +type GetVPCDefaultSecurityGroupOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCDefaultSecurityGroupOptions : Instantiate GetVPCDefaultSecurityGroupOptions +func (*VpcV1) NewGetVPCDefaultSecurityGroupOptions(id string) *GetVPCDefaultSecurityGroupOptions { + return &GetVPCDefaultSecurityGroupOptions{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *GetVPCDefaultSecurityGroupOptions) SetID(id string) *GetVPCDefaultSecurityGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultSecurityGroupOptions) SetHeaders(param map[string]string) *GetVPCDefaultSecurityGroupOptions { + options.Headers = param + return options +} + +// GetVPCDnsResolutionBindingOptions : The GetVPCDnsResolutionBinding options. +type GetVPCDnsResolutionBindingOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The DNS resolution binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCDnsResolutionBindingOptions : Instantiate GetVPCDnsResolutionBindingOptions +func (*VpcV1) NewGetVPCDnsResolutionBindingOptions(vpcID string, id string) *GetVPCDnsResolutionBindingOptions { + return &GetVPCDnsResolutionBindingOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return +} + +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *GetVPCDnsResolutionBindingOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPCDnsResolutionBindingOptions) SetID(id string) *GetVPCDnsResolutionBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *GetVPCDnsResolutionBindingOptions { + options.Headers = param + return options +} + +// GetVPCOptions : The GetVPC options. +type GetVPCOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCOptions : Instantiate GetVPCOptions +func (*VpcV1) NewGetVPCOptions(id string) *GetVPCOptions { + return &GetVPCOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceAvailabilityPolicy : InstanceAvailabilityPolicy struct -type InstanceAvailabilityPolicy struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the - // unexpected property value was encountered. - HostFailure *string `json:"host_failure" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetVPCOptions) SetID(id string) *GetVPCOptions { + _options.ID = core.StringPtr(id) + return _options } -// Constants associated with the InstanceAvailabilityPolicy.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the -// unexpected property value was encountered. -const ( - InstanceAvailabilityPolicyHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyHostFailureStopConst = "stop" -) +// SetHeaders : Allow user to set Headers +func (options *GetVPCOptions) SetHeaders(param map[string]string) *GetVPCOptions { + options.Headers = param + return options +} -// UnmarshalInstanceAvailabilityPolicy unmarshals an instance of InstanceAvailabilityPolicy from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicy) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return +// GetVPCRouteOptions : The GetVPCRoute options. +type GetVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The route identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCRouteOptions : Instantiate GetVPCRouteOptions +func (*VpcV1) NewGetVPCRouteOptions(vpcID string, id string) *GetVPCRouteOptions { + return &GetVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceAvailabilityPolicyPatch : InstanceAvailabilityPolicyPatch struct -type InstanceAvailabilityPolicyPatch struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure. - HostFailure *string `json:"host_failure,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRouteOptions) SetVPCID(vpcID string) *GetVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// Constants associated with the InstanceAvailabilityPolicyPatch.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure. -const ( - InstanceAvailabilityPolicyPatchHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyPatchHostFailureStopConst = "stop" -) +// SetID : Allow user to set ID +func (_options *GetVPCRouteOptions) SetID(id string) *GetVPCRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalInstanceAvailabilityPolicyPatch unmarshals an instance of InstanceAvailabilityPolicyPatch from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicyPatch) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return +// SetHeaders : Allow user to set Headers +func (options *GetVPCRouteOptions) SetHeaders(param map[string]string) *GetVPCRouteOptions { + options.Headers = param + return options +} + +// GetVPCRoutingTableOptions : The GetVPCRoutingTable options. +type GetVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The routing table identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCRoutingTableOptions : Instantiate GetVPCRoutingTableOptions +func (*VpcV1) NewGetVPCRoutingTableOptions(vpcID string, id string) *GetVPCRoutingTableOptions { + return &GetVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRoutingTableOptions) SetVPCID(vpcID string) *GetVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPCRoutingTableOptions) SetID(id string) *GetVPCRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableOptions { + options.Headers = param + return options +} + +// GetVPCRoutingTableRouteOptions : The GetVPCRoutingTableRoute options. +type GetVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + + // The VPC routing table route identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPCRoutingTableRouteOptions : Instantiate GetVPCRoutingTableRouteOptions +func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *GetVPCRoutingTableRouteOptions { + return &GetVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + ID: core.StringPtr(id), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *GetVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *GetVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *GetVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPCRoutingTableRouteOptions) SetID(id string) *GetVPCRoutingTableRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableRouteOptions { + options.Headers = param + return options +} + +// GetVPNGatewayConnectionOptions : The GetVPNGatewayConnection options. +type GetVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNGatewayConnectionOptions : Instantiate GetVPNGatewayConnectionOptions +func (*VpcV1) NewGetVPNGatewayConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayConnectionOptions { + return &GetVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *GetVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPNGatewayConnectionOptions) SetID(id string) *GetVPNGatewayConnectionOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayConnectionOptions { + options.Headers = param + return options +} + +// GetVPNGatewayOptions : The GetVPNGateway options. +type GetVPNGatewayOptions struct { + // The VPN gateway identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNGatewayOptions : Instantiate GetVPNGatewayOptions +func (*VpcV1) NewGetVPNGatewayOptions(id string) *GetVPNGatewayOptions { + return &GetVPNGatewayOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetVPNGatewayOptions) SetID(id string) *GetVPNGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPNGatewayOptions { + options.Headers = param + return options +} + +// GetVPNServerClientConfigurationOptions : The GetVPNServerClientConfiguration options. +type GetVPNServerClientConfigurationOptions struct { + // The VPN server identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNServerClientConfigurationOptions : Instantiate GetVPNServerClientConfigurationOptions +func (*VpcV1) NewGetVPNServerClientConfigurationOptions(id string) *GetVPNServerClientConfigurationOptions { + return &GetVPNServerClientConfigurationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetVPNServerClientConfigurationOptions) SetID(id string) *GetVPNServerClientConfigurationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNServerClientConfigurationOptions) SetHeaders(param map[string]string) *GetVPNServerClientConfigurationOptions { + options.Headers = param + return options +} + +// GetVPNServerClientOptions : The GetVPNServerClient options. +type GetVPNServerClientOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` + + // The VPN client identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNServerClientOptions : Instantiate GetVPNServerClientOptions +func (*VpcV1) NewGetVPNServerClientOptions(vpnServerID string, id string) *GetVPNServerClientOptions { + return &GetVPNServerClientOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), + } +} + +// SetVPNServerID : Allow user to set VPNServerID +func (_options *GetVPNServerClientOptions) SetVPNServerID(vpnServerID string) *GetVPNServerClientOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPNServerClientOptions) SetID(id string) *GetVPNServerClientOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNServerClientOptions) SetHeaders(param map[string]string) *GetVPNServerClientOptions { + options.Headers = param + return options +} + +// GetVPNServerOptions : The GetVPNServer options. +type GetVPNServerOptions struct { + // The VPN server identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNServerOptions : Instantiate GetVPNServerOptions +func (*VpcV1) NewGetVPNServerOptions(id string) *GetVPNServerOptions { + return &GetVPNServerOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetVPNServerOptions) SetID(id string) *GetVPNServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNServerOptions) SetHeaders(param map[string]string) *GetVPNServerOptions { + options.Headers = param + return options +} + +// GetVPNServerRouteOptions : The GetVPNServerRoute options. +type GetVPNServerRouteOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` + + // The VPN route identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVPNServerRouteOptions : Instantiate GetVPNServerRouteOptions +func (*VpcV1) NewGetVPNServerRouteOptions(vpnServerID string, id string) *GetVPNServerRouteOptions { + return &GetVPNServerRouteOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), + } +} + +// SetVPNServerID : Allow user to set VPNServerID +func (_options *GetVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *GetVPNServerRouteOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPNServerRouteOptions) SetID(id string) *GetVPNServerRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNServerRouteOptions) SetHeaders(param map[string]string) *GetVPNServerRouteOptions { + options.Headers = param + return options +} + +// IkePolicy : IkePolicy struct +type IkePolicy struct { + // The authentication algorithm + // + // The `md5` and `sha1` algorithms have been deprecated. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + + // The VPN gateway connections that use this IKE policy. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` + + // The date and time that this IKE policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The Diffie-Hellman group + // + // Groups `2` and `5` have been deprecated. + DhGroup *int64 `json:"dh_group" validate:"required"` + + // The encryption algorithm + // + // The `triple_des` algorithm has been deprecated. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` + + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime" validate:"required"` + + // The name for this IKE policy. The name is unique across all IKE policies in the region. + Name *string `json:"name" validate:"required"` + + // The IKE negotiation mode. Only `main` is supported. + NegotiationMode *string `json:"negotiation_mode" validate:"required"` + + // The resource group for this IKE policy. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the IkePolicy.AuthenticationAlgorithm property. +// The authentication algorithm +// +// The `md5` and `sha1` algorithms have been deprecated. +const ( + IkePolicyAuthenticationAlgorithmMd5Const = "md5" + IkePolicyAuthenticationAlgorithmSha1Const = "sha1" + IkePolicyAuthenticationAlgorithmSha256Const = "sha256" + IkePolicyAuthenticationAlgorithmSha384Const = "sha384" + IkePolicyAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the IkePolicy.EncryptionAlgorithm property. +// The encryption algorithm +// +// The `triple_des` algorithm has been deprecated. +const ( + IkePolicyEncryptionAlgorithmAes128Const = "aes128" + IkePolicyEncryptionAlgorithmAes192Const = "aes192" + IkePolicyEncryptionAlgorithmAes256Const = "aes256" + IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" +) + +// Constants associated with the IkePolicy.NegotiationMode property. +// The IKE negotiation mode. Only `main` is supported. +const ( + IkePolicyNegotiationModeMainConst = "main" +) + +// Constants associated with the IkePolicy.ResourceType property. +// The resource type. +const ( + IkePolicyResourceTypeIkePolicyConst = "ike_policy" +) + +// UnmarshalIkePolicy unmarshals an instance of IkePolicy from the specified map of raw messages. +func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicy) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) + if err != nil { + return + } + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "negotiation_mode", &obj.NegotiationMode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IkePolicyCollection : IkePolicyCollection struct +type IkePolicyCollection struct { + // A link to the first page of resources. + First *IkePolicyCollectionFirst `json:"first" validate:"required"` + + // Collection of IKE policies. + IkePolicies []IkePolicy `json:"ike_policies" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *IkePolicyCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalIkePolicyCollection unmarshals an instance of IkePolicyCollection from the specified map of raw messages. +func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIkePolicyCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ike_policies", &obj.IkePolicies, UnmarshalIkePolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIkePolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *IkePolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// IkePolicyPatch : IkePolicyPatch struct +type IkePolicyPatch struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` + + // The Diffie-Hellman group. + DhGroup *int64 `json:"dh_group,omitempty"` + + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version,omitempty"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` + + // The name for this IKE policy. The name must not be used by another IKE policy in the region. + Name *string `json:"name,omitempty"` +} + +// Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. +// The authentication algorithm. +const ( + IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" + IkePolicyPatchAuthenticationAlgorithmSha384Const = "sha384" + IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" + IkePolicyPatchEncryptionAlgorithmAes192Const = "aes192" + IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" +) + +// UnmarshalIkePolicyPatch unmarshals an instance of IkePolicyPatch from the specified map of raw messages. +func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyPatch) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the IkePolicyPatch +func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(ikePolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// IkePolicyReference : IkePolicyReference struct +type IkePolicyReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *IkePolicyReferenceDeleted `json:"deleted,omitempty"` + + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` + + // The name for this IKE policy. The name is unique across all IKE policies in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the IkePolicyReference.ResourceType property. +// The resource type. +const ( + IkePolicyReferenceResourceTypeIkePolicyConst = "ike_policy" +) + +// UnmarshalIkePolicyReference unmarshals an instance of IkePolicyReference from the specified map of raw messages. +func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIkePolicyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IP : IP struct +type IP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} + +// NewIP : Instantiate IP (Generic Model Constructor) +func (*VpcV1) NewIP(address string) (_model *IP, err error) { + _model = &IP{ + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalIP unmarshals an instance of IP from the specified map of raw messages. +func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicy : IPsecPolicy struct +type IPsecPolicy struct { + // The authentication algorithm + // + // The `md5` and `sha1` algorithms have been deprecated + // + // Must be `disabled` if and only if the `encryption_algorithm` is + // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + + // The VPN gateway connections that use this IPsec policy. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` + + // The date and time that this IPsec policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The encapsulation mode used. Only `tunnel` is supported. + EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` + + // The encryption algorithm + // + // The `triple_des` algorithm has been deprecated + // + // The `authentication_algorithm` must be `disabled` if and only if + // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + // `aes256gcm16`. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime" validate:"required"` + + // The name for this IPsec policy. The name is unique across all IPsec policies in the region. + Name *string `json:"name" validate:"required"` + + // Perfect Forward Secrecy + // + // Groups `group_2` and `group_5` have been deprecated. + Pfs *string `json:"pfs" validate:"required"` + + // The resource group for this IPsec policy. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The transform protocol used. Only `esp` is supported. + TransformProtocol *string `json:"transform_protocol" validate:"required"` +} + +// Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. +// The authentication algorithm +// +// # The `md5` and `sha1` algorithms have been deprecated +// +// Must be `disabled` if and only if the `encryption_algorithm` is +// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. +const ( + IPsecPolicyAuthenticationAlgorithmDisabledConst = "disabled" + IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" + IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" + IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" + IPsecPolicyAuthenticationAlgorithmSha384Const = "sha384" + IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the IPsecPolicy.EncapsulationMode property. +// The encapsulation mode used. Only `tunnel` is supported. +const ( + IPsecPolicyEncapsulationModeTunnelConst = "tunnel" +) + +// Constants associated with the IPsecPolicy.EncryptionAlgorithm property. +// The encryption algorithm +// +// The `triple_des` algorithm has been deprecated +// +// The `authentication_algorithm` must be `disabled` if and only if +// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or +// `aes256gcm16`. +const ( + IPsecPolicyEncryptionAlgorithmAes128Const = "aes128" + IPsecPolicyEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" + IPsecPolicyEncryptionAlgorithmAes192Const = "aes192" + IPsecPolicyEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" + IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" + IPsecPolicyEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" + IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" +) + +// Constants associated with the IPsecPolicy.Pfs property. +// Perfect Forward Secrecy +// +// Groups `group_2` and `group_5` have been deprecated. +const ( + IPsecPolicyPfsDisabledConst = "disabled" + IPsecPolicyPfsGroup14Const = "group_14" + IPsecPolicyPfsGroup15Const = "group_15" + IPsecPolicyPfsGroup16Const = "group_16" + IPsecPolicyPfsGroup17Const = "group_17" + IPsecPolicyPfsGroup18Const = "group_18" + IPsecPolicyPfsGroup19Const = "group_19" + IPsecPolicyPfsGroup2Const = "group_2" + IPsecPolicyPfsGroup20Const = "group_20" + IPsecPolicyPfsGroup21Const = "group_21" + IPsecPolicyPfsGroup22Const = "group_22" + IPsecPolicyPfsGroup23Const = "group_23" + IPsecPolicyPfsGroup24Const = "group_24" + IPsecPolicyPfsGroup31Const = "group_31" + IPsecPolicyPfsGroup5Const = "group_5" +) + +// Constants associated with the IPsecPolicy.ResourceType property. +// The resource type. +const ( + IPsecPolicyResourceTypeIpsecPolicyConst = "ipsec_policy" +) + +// Constants associated with the IPsecPolicy.TransformProtocol property. +// The transform protocol used. Only `esp` is supported. +const ( + IPsecPolicyTransformProtocolEspConst = "esp" +) + +// UnmarshalIPsecPolicy unmarshals an instance of IPsecPolicy from the specified map of raw messages. +func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicy) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) + if err != nil { + return + } + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encapsulation_mode", &obj.EncapsulationMode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "transform_protocol", &obj.TransformProtocol) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicyCollection : IPsecPolicyCollection struct +type IPsecPolicyCollection struct { + // A link to the first page of resources. + First *IPsecPolicyCollectionFirst `json:"first" validate:"required"` + + // Collection of IPsec policies. + IpsecPolicies []IPsecPolicy `json:"ipsec_policies" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *IPsecPolicyCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalIPsecPolicyCollection unmarshals an instance of IPsecPolicyCollection from the specified map of raw messages. +func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIPsecPolicyCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ipsec_policies", &obj.IpsecPolicies, UnmarshalIPsecPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIPsecPolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// IPsecPolicyCollectionFirst : A link to the first page of resources. +type IPsecPolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalIPsecPolicyCollectionFirst unmarshals an instance of IPsecPolicyCollectionFirst from the specified map of raw messages. +func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type IPsecPolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalIPsecPolicyCollectionNext unmarshals an instance of IPsecPolicyCollectionNext from the specified map of raw messages. +func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicyPatch : IPsecPolicyPatch struct +type IPsecPolicyPatch struct { + // The authentication algorithm + // + // Must be `disabled` if and only if the `encryption_algorithm` is + // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` + + // The encryption algorithm + // + // The `authentication_algorithm` must be `disabled` if and only if + // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + // `aes256gcm16`. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` + + // The name for this IPsec policy. The name must not be used by another IPsec policy in the region. + Name *string `json:"name,omitempty"` + + // Perfect Forward Secrecy. + Pfs *string `json:"pfs,omitempty"` +} + +// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. +// The authentication algorithm +// +// Must be `disabled` if and only if the `encryption_algorithm` is +// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. +const ( + IPsecPolicyPatchAuthenticationAlgorithmDisabledConst = "disabled" + IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" + IPsecPolicyPatchAuthenticationAlgorithmSha384Const = "sha384" + IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. +// The encryption algorithm +// +// The `authentication_algorithm` must be `disabled` if and only if +// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or +// `aes256gcm16`. +const ( + IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" + IPsecPolicyPatchEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" + IPsecPolicyPatchEncryptionAlgorithmAes192Const = "aes192" + IPsecPolicyPatchEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" + IPsecPolicyPatchEncryptionAlgorithmAes256Const = "aes256" + IPsecPolicyPatchEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" +) + +// Constants associated with the IPsecPolicyPatch.Pfs property. +// Perfect Forward Secrecy. +const ( + IPsecPolicyPatchPfsDisabledConst = "disabled" + IPsecPolicyPatchPfsGroup14Const = "group_14" + IPsecPolicyPatchPfsGroup15Const = "group_15" + IPsecPolicyPatchPfsGroup16Const = "group_16" + IPsecPolicyPatchPfsGroup17Const = "group_17" + IPsecPolicyPatchPfsGroup18Const = "group_18" + IPsecPolicyPatchPfsGroup19Const = "group_19" + IPsecPolicyPatchPfsGroup20Const = "group_20" + IPsecPolicyPatchPfsGroup21Const = "group_21" + IPsecPolicyPatchPfsGroup22Const = "group_22" + IPsecPolicyPatchPfsGroup23Const = "group_23" + IPsecPolicyPatchPfsGroup24Const = "group_24" + IPsecPolicyPatchPfsGroup31Const = "group_31" +) + +// UnmarshalIPsecPolicyPatch unmarshals an instance of IPsecPolicyPatch from the specified map of raw messages. +func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyPatch) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the IPsecPolicyPatch +func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(iPsecPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// IPsecPolicyReference : IPsecPolicyReference struct +type IPsecPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *IPsecPolicyReferenceDeleted `json:"deleted,omitempty"` + + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` + + // The name for this IPsec policy. The name is unique across all IPsec policies in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the IPsecPolicyReference.ResourceType property. +// The resource type. +const ( + IPsecPolicyReferenceResourceTypeIpsecPolicyConst = "ipsec_policy" +) + +// UnmarshalIPsecPolicyReference unmarshals an instance of IPsecPolicyReference from the specified map of raw messages. +func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIPsecPolicyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type IPsecPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalIPsecPolicyReferenceDeleted unmarshals an instance of IPsecPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IkePolicyCollectionFirst : A link to the first page of resources. +type IkePolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalIkePolicyCollectionFirst unmarshals an instance of IkePolicyCollectionFirst from the specified map of raw messages. +func UnmarshalIkePolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IkePolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type IkePolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalIkePolicyCollectionNext unmarshals an instance of IkePolicyCollectionNext from the specified map of raw messages. +func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IkePolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type IkePolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalIkePolicyReferenceDeleted unmarshals an instance of IkePolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Image : Image struct +type Image struct { + CatalogOffering *ImageCatalogOffering `json:"catalog_offering" validate:"required"` + + // The date and time that the image was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this image. + CRN *string `json:"crn" validate:"required"` + + // The deprecation date and time (UTC) for this image. + // + // If absent, no deprecation date and time has been set. + DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + + // The type of encryption used on the image. + Encryption *string `json:"encryption" validate:"required"` + + // The key that will be used to encrypt volumes created from this image (unless an + // alternate `encryption_key` is specified at volume creation). + // + // This property will be present for images with an `encryption` type of `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + + // Details for the stored image file. + File *ImageFile `json:"file" validate:"required"` + + // The URL for this image. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this image. + ID *string `json:"id" validate:"required"` + + // The minimum size (in gigabytes) of a volume onto which this image may be provisioned. + // + // This property may be absent if the image has a `status` of `pending` or `failed`. + MinimumProvisionedSize *int64 `json:"minimum_provisioned_size,omitempty"` + + // The name for this image. The name is unique across all images in the region. + Name *string `json:"name" validate:"required"` + + // The obsolescence date and time (UTC) for this image. + // + // If absent, no obsolescence date and time has been set. + ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + + // The operating system included in this image. + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + + // The resource group for this image. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The volume used to create this image (this may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + // If absent, this image was not created from a volume. + SourceVolume *VolumeReference `json:"source_volume,omitempty"` + + // The status of this image + // - available: image can be used (provisionable) + // - deleting: image is being deleted, and can no longer be used to provision new + // resources + // - deprecated: image is administratively slated to become `obsolete` + // - failed: image is corrupt or did not pass validation + // - obsolete: image administratively set to not be used for new resources + // - pending: image is being imported and is not yet `available` + // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any): + // - `encrypted_data_key_invalid`: image cannot be decrypted with the specified + // `encryption_key` + // - `encryption_key_deleted`: image unusable because its `encryption_key` was deleted + // - `encryption_key_disabled`: image unusable until its `encryption_key` is re-enabled + // - `image_data_corrupted`: image data is corrupt, or is not in the specified format + // - `image_provisioned_size_unsupported`: image requires a boot volume size greater + // than the maximum supported value + // - `image_request_in_progress`: image operation is in progress (such as an import from + // Cloud Object Storage) + // - `image_request_queued`: image request has been accepted but the requested + // operation has not started + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ImageStatusReason `json:"status_reasons" validate:"required"` + + // The visibility of this image. + // - `private`: Visible only to this account + // - `public`: Visible to all accounts. + Visibility *string `json:"visibility" validate:"required"` +} + +// Constants associated with the Image.Encryption property. +// The type of encryption used on the image. +const ( + ImageEncryptionNoneConst = "none" + ImageEncryptionUserManagedConst = "user_managed" +) + +// Constants associated with the Image.ResourceType property. +// The resource type. +const ( + ImageResourceTypeImageConst = "image" +) + +// Constants associated with the Image.Status property. +// The status of this image +// - available: image can be used (provisionable) +// - deleting: image is being deleted, and can no longer be used to provision new +// resources +// - deprecated: image is administratively slated to become `obsolete` +// - failed: image is corrupt or did not pass validation +// - obsolete: image administratively set to not be used for new resources +// - pending: image is being imported and is not yet `available` +// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the +// unexpected property value was encountered. +const ( + ImageStatusAvailableConst = "available" + ImageStatusDeletingConst = "deleting" + ImageStatusDeprecatedConst = "deprecated" + ImageStatusFailedConst = "failed" + ImageStatusObsoleteConst = "obsolete" + ImageStatusPendingConst = "pending" + ImageStatusUnusableConst = "unusable" +) + +// Constants associated with the Image.Visibility property. +// The visibility of this image. +// - `private`: Visible only to this account +// - `public`: Visible to all accounts. +const ( + ImageVisibilityPrivateConst = "private" + ImageVisibilityPublicConst = "public" +) + +// UnmarshalImage unmarshals an instance of Image from the specified map of raw messages. +func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Image) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalImageCatalogOffering) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "minimum_provisioned_size", &obj.MinimumProvisionedSize) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageStatusReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageCatalogOffering : ImageCatalogOffering struct +type ImageCatalogOffering struct { + // Indicates whether this image is managed as part of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. If an image is managed, + // accounts in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) with access to that catalog can + // specify the image's catalog offering version CRN to provision virtual server instances using the image. + Managed *bool `json:"managed" validate:"required"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering version associated with this image. + // + // If absent, this image is not associated with a cloud catalog offering. + Version *CatalogOfferingVersionReference `json:"version,omitempty"` +} + +// UnmarshalImageCatalogOffering unmarshals an instance of ImageCatalogOffering from the specified map of raw messages. +func UnmarshalImageCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCatalogOffering) + err = core.UnmarshalPrimitive(m, "managed", &obj.Managed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageCollection : ImageCollection struct +type ImageCollection struct { + // A link to the first page of resources. + First *ImageCollectionFirst `json:"first" validate:"required"` + + // Collection of images. + Images []Image `json:"images" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ImageCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalImageCollection unmarshals an instance of ImageCollection from the specified map of raw messages. +func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalImageCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "images", &obj.Images, UnmarshalImage) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalImageCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ImageCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ImageCollectionFirst : A link to the first page of resources. +type ImageCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalImageCollectionFirst unmarshals an instance of ImageCollectionFirst from the specified map of raw messages. +func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ImageCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalImageCollectionNext unmarshals an instance of ImageCollectionNext from the specified map of raw messages. +func UnmarshalImageCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageExportJob : ImageExportJob struct +type ImageExportJob struct { + // The date and time that the image export job was completed. + // + // If absent, the export job has not yet completed. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // The date and time that the image export job was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This + // key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto + // Services. + // + // If absent, the export job is for an unencrypted image. + EncryptedDataKey *[]byte `json:"encrypted_data_key,omitempty"` + + // The format of the exported image. + Format *string `json:"format" validate:"required"` + + // The URL for this image export job. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this image export job. + ID *string `json:"id" validate:"required"` + + // The name for this image export job. The name must not be used by another export job for the image. Changing the name + // will not affect the exported image name, + // `storage_object.name`, or `storage_href` values. + Name *string `json:"name" validate:"required"` + + // The type of resource referenced. + ResourceType *string `json:"resource_type" validate:"required"` + + // The date and time that the image export job started running. + // + // If absent, the export job has not yet started. + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // The status of this image export job: + // - `deleting`: Export job is being deleted + // - `failed`: Export job could not be completed successfully + // - `queued`: Export job is queued + // - `running`: Export job is in progress + // - `succeeded`: Export job was completed successfully + // + // The exported image object is automatically deleted for `failed` jobs. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ImageExportJobStatusReason `json:"status_reasons" validate:"required"` + + // The Cloud Object Storage bucket of the exported image object. + StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` + + // The Cloud Object Storage location of the exported image object. The object at this location will not exist until the + // job completes successfully. The exported image object is not managed by the IBM VPC service, and may be removed or + // replaced with a different object by any user or service with IAM authorization to the storage bucket. + StorageHref *string `json:"storage_href" validate:"required"` + + // The Cloud Object Storage object for the exported image. This object will not exist until + // the job completes successfully. The exported image object is not managed by the IBM VPC + // service, and may be removed or replaced with a different object by any user or service + // with IAM authorization to the storage bucket. + StorageObject *CloudObjectStorageObjectReference `json:"storage_object" validate:"required"` +} + +// Constants associated with the ImageExportJob.Format property. +// The format of the exported image. +const ( + ImageExportJobFormatQcow2Const = "qcow2" + ImageExportJobFormatVhdConst = "vhd" +) + +// Constants associated with the ImageExportJob.ResourceType property. +// The type of resource referenced. +const ( + ImageExportJobResourceTypeImageExportJobConst = "image_export_job" +) + +// Constants associated with the ImageExportJob.Status property. +// The status of this image export job: +// - `deleting`: Export job is being deleted +// - `failed`: Export job could not be completed successfully +// - `queued`: Export job is queued +// - `running`: Export job is in progress +// - `succeeded`: Export job was completed successfully +// +// The exported image object is automatically deleted for `failed` jobs. +const ( + ImageExportJobStatusDeletingConst = "deleting" + ImageExportJobStatusFailedConst = "failed" + ImageExportJobStatusQueuedConst = "queued" + ImageExportJobStatusRunningConst = "running" + ImageExportJobStatusSucceededConst = "succeeded" +) + +// UnmarshalImageExportJob unmarshals an instance of ImageExportJob from the specified map of raw messages. +func UnmarshalImageExportJob(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageExportJob) + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "format", &obj.Format) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageExportJobStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "storage_href", &obj.StorageHref) + if err != nil { + return + } + err = core.UnmarshalModel(m, "storage_object", &obj.StorageObject, UnmarshalCloudObjectStorageObjectReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageExportJobPatch : ImageExportJobPatch struct +type ImageExportJobPatch struct { + // The name for this image export job. The name must not be used by another export job for the image. Changing the name + // will not affect the exported image name, + // `storage_object.name`, or `storage_href` values. + Name *string `json:"name,omitempty"` +} + +// UnmarshalImageExportJobPatch unmarshals an instance of ImageExportJobPatch from the specified map of raw messages. +func UnmarshalImageExportJobPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageExportJobPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the ImageExportJobPatch +func (imageExportJobPatch *ImageExportJobPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(imageExportJobPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// ImageExportJobStatusReason : ImageExportJobStatusReason struct +type ImageExportJobStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the ImageExportJobStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ImageExportJobStatusReasonCodeCannotAccessStorageBucketConst = "cannot_access_storage_bucket" + ImageExportJobStatusReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalImageExportJobStatusReason unmarshals an instance of ImageExportJobStatusReason from the specified map of raw messages. +func UnmarshalImageExportJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageExportJobStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageExportJobUnpaginatedCollection : ImageExportJobUnpaginatedCollection struct +type ImageExportJobUnpaginatedCollection struct { + // Collection of image export jobs. + ExportJobs []ImageExportJob `json:"export_jobs" validate:"required"` +} + +// UnmarshalImageExportJobUnpaginatedCollection unmarshals an instance of ImageExportJobUnpaginatedCollection from the specified map of raw messages. +func UnmarshalImageExportJobUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageExportJobUnpaginatedCollection) + err = core.UnmarshalModel(m, "export_jobs", &obj.ExportJobs, UnmarshalImageExportJob) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFile : ImageFile struct +type ImageFile struct { + // Checksums for this image file. + // + // This property may be absent if the associated image has a `status` of `pending` or + // `failed`. + Checksums *ImageFileChecksums `json:"checksums,omitempty"` + + // The size of the stored image file rounded up to the next gigabyte. + // + // This property may be absent if the associated image has a `status` of `pending` or + // `failed`. + Size *int64 `json:"size,omitempty"` +} + +// UnmarshalImageFile unmarshals an instance of ImageFile from the specified map of raw messages. +func UnmarshalImageFile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFile) + err = core.UnmarshalModel(m, "checksums", &obj.Checksums, UnmarshalImageFileChecksums) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFileChecksums : ImageFileChecksums struct +type ImageFileChecksums struct { + // The SHA256 fingerprint of the image file. + Sha256 *string `json:"sha256,omitempty"` +} + +// UnmarshalImageFileChecksums unmarshals an instance of ImageFileChecksums from the specified map of raw messages. +func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFileChecksums) + err = core.UnmarshalPrimitive(m, "sha256", &obj.Sha256) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFilePrototype : ImageFilePrototype struct +type ImageFilePrototype struct { + // The Cloud Object Storage location of the image file. + // + // The image file format is specified by the file's extension, which must be either + // `qcow2` or `vhd`. + Href *string `json:"href" validate:"required"` +} + +// NewImageFilePrototype : Instantiate ImageFilePrototype (Generic Model Constructor) +func (*VpcV1) NewImageFilePrototype(href string) (_model *ImageFilePrototype, err error) { + _model = &ImageFilePrototype{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalImageFilePrototype unmarshals an instance of ImageFilePrototype from the specified map of raw messages. +func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFilePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageIdentity : Identifies an image by a unique property. +// Models which "extend" this model: +// - ImageIdentityByID +// - ImageIdentityByCRN +// - ImageIdentityByHref +type ImageIdentity struct { + // The unique identifier for this image. + ID *string `json:"id,omitempty"` + + // The CRN for this image. + CRN *string `json:"crn,omitempty"` + + // The URL for this image. + Href *string `json:"href,omitempty"` +} + +func (*ImageIdentity) isaImageIdentity() bool { + return true +} + +type ImageIdentityIntf interface { + isaImageIdentity() bool +} + +// UnmarshalImageIdentity unmarshals an instance of ImageIdentity from the specified map of raw messages. +func UnmarshalImageIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImagePatch : ImagePatch struct +type ImagePatch struct { + // The deprecation date and time to set for this image. + // + // This cannot be set if the image has a `status` of `failed` or `deleting`, or if + // `catalog_offering.managed` is `true`. + // + // The date and time must not be in the past, and must be earlier than `obsolescence_at` + // (if `obsolescence_at` is set). Additionally, if the image status is currently + // `deprecated`, the value cannot be changed (but may be removed). + // + // Specify `null` to remove an existing deprecation date and time. If the image status is currently `deprecated`, it + // will become `available`. + // + // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + // transition to `deprecated` upon its successful creation (or + // `obsolete` if the obsolescence date and time was also reached). + DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + + // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are + // reserved for system-provided images, and are not allowed. + Name *string `json:"name,omitempty"` + + // The obsolescence date and time to set for this image. + // + // This cannot be set if the image has a `status` of `failed` or `deleting`, or if + // `catalog_offering.managed` is `true`. + // + // The date and time must not be in the past, and must be later than `deprecation_at` (if + // `deprecation_at` is set). Additionally, if the image status is currently `obsolete`, the value cannot be changed + // (but may be removed). + // + // Specify `null` to remove an existing obsolescence date and time. If the image status is currently `obsolete`, it + // will become `deprecated` if `deprecation_at` is in the past. Otherwise, it will become `available`. + // + // If the obsolescence date and time is reached while the image has a status of `pending`, the image's status will + // transition to `obsolete` upon its successful creation. + ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` +} + +// UnmarshalImagePatch unmarshals an instance of ImagePatch from the specified map of raw messages. +func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePatch) + err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the ImagePatch +func (imagePatch *ImagePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(imagePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// ImagePrototype : ImagePrototype struct +// Models which "extend" this model: +// - ImagePrototypeImageByFile +// - ImagePrototypeImageBySourceVolume +type ImagePrototype struct { + // The deprecation date and time to set for this image. + // + // The date and time must not be in the past, and must be earlier than `obsolescence_at` + // (if `obsolescence_at` is set). + // + // If unspecified, no deprecation date and time will be set. + // + // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + // transition to `deprecated` upon its successful creation (or + // `obsolete` if the obsolescence date and time was also reached). + DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + + // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are + // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // The obsolescence date and time to set for this image. + // + // The date and time must not be in the past, and must be later than `deprecation_at` (if + // `deprecation_at` is set). + // + // If unspecified, no obsolescence date and time will be set. + // + // If the obsolescence date and time is reached while the image has a status of + // `pending`, the image's status will transition to `obsolete` upon its successful creation. + ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. + // + // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be + // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the + // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + + // The root key that was used to wrap the data key (which is ultimately represented as + // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes + // created from this image (unless an alternate `encryption_key` is specified at volume + // creation). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The file from which to create the image. + File *ImageFilePrototype `json:"file,omitempty"` + + // The [supported operating + // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this + // image. + OperatingSystem OperatingSystemIdentityIntf `json:"operating_system,omitempty"` + + // The volume from which to create the image. The specified volume must: + // - Have an `operating_system`, which will be used to populate this image's + // operating system information. + // - Not be `active` or `busy`. + // + // During image creation, the specified volume may briefly become `busy`. + SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` +} + +func (*ImagePrototype) isaImagePrototype() bool { + return true +} + +type ImagePrototypeIntf interface { + isaImagePrototype() bool +} + +// UnmarshalImagePrototype unmarshals an instance of ImagePrototype from the specified map of raw messages. +func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePrototype) + err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageReference : ImageReference struct +type ImageReference struct { + // The CRN for this image. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ImageReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this image. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this image. + ID *string `json:"id" validate:"required"` + + // The name for this image. The name is unique across all images in the region. + Name *string `json:"name" validate:"required"` + + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *ImageRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ImageReference.ResourceType property. +// The resource type. +const ( + ImageReferenceResourceTypeImageConst = "image" +) + +// UnmarshalImageReference unmarshals an instance of ImageReference from the specified map of raw messages. +func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalImageReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalImageRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ImageReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalImageReferenceDeleted unmarshals an instance of ImageReferenceDeleted from the specified map of raw messages. +func UnmarshalImageReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type ImageRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // account, and identifies the owning account. + Account *AccountReference `json:"account,omitempty"` + + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` +} + +// UnmarshalImageRemote unmarshals an instance of ImageRemote from the specified map of raw messages. +func UnmarshalImageRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageRemote) + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageStatusReason : ImageStatusReason struct +type ImageStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the ImageStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ImageStatusReasonCodeEncryptedDataKeyInvalidConst = "encrypted_data_key_invalid" + ImageStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + ImageStatusReasonCodeEncryptionKeyDisabledConst = "encryption_key_disabled" + ImageStatusReasonCodeImageDataCorruptedConst = "image_data_corrupted" + ImageStatusReasonCodeImageProvisionedSizeUnsupportedConst = "image_provisioned_size_unsupported" + ImageStatusReasonCodeImageRequestInProgressConst = "image_request_in_progress" + ImageStatusReasonCodeImageRequestQueuedConst = "image_request_queued" +) + +// UnmarshalImageStatusReason unmarshals an instance of ImageStatusReason from the specified map of raw messages. +func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Instance : Instance struct +type Instance struct { + // The availability policy for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicy `json:"availability_policy" validate:"required"` + + // The total bandwidth (in megabits per second) shared across the instance network attachments or instance network + // interfaces and storage volumes of the virtual server instance. + Bandwidth *int64 `json:"bandwidth" validate:"required"` + + // Boot volume attachment. + BootVolumeAttachment *VolumeAttachmentReferenceInstanceContext `json:"boot_volume_attachment" validate:"required"` + + // If present, this virtual server instance was provisioned from a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + CatalogOffering *InstanceCatalogOffering `json:"catalog_offering,omitempty"` + + // The date and time that the virtual server instance was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` + + // If present, the dedicated host this virtual server instance has been placed on. + DedicatedHost *DedicatedHostReference `json:"dedicated_host,omitempty"` + + // The instance disks for this virtual server instance. + Disks []InstanceDisk `json:"disks" validate:"required"` + + // The virtual server instance GPU configuration. + Gpu *InstanceGpu `json:"gpu,omitempty"` + + // The reasons for the current instance `health_state` (if any): + // - `reservation_capacity_unavailable`: The reservation affinity pool has no + // available capacity. + // - `reservation_deleted`: The reservation affinity pool has a deleted reservation. + // - `reservation_expired`: The reservation affinity pool has an expired reservation. + // - `reservation_failed`: The reservation affinity pool has a failed reservation. + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []InstanceHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` + + // The image the virtual server instance was provisioned from. + Image *ImageReference `json:"image,omitempty"` + + // The reasons for the current `lifecycle_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []InstanceLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the virtual server instance. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The amount of memory, truncated to whole gibibytes. + Memory *int64 `json:"memory" validate:"required"` + + // The metadata service configuration. + MetadataService *InstanceMetadataService `json:"metadata_service" validate:"required"` + + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. + Name *string `json:"name" validate:"required"` + + // The network attachments for this virtual server instance, including the primary network attachment. + NetworkAttachments []InstanceNetworkAttachmentReference `json:"network_attachments" validate:"required"` + + // The network interfaces for this instance, including the primary network interface. + // + // If this instance has network attachments, each network interface is a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network + // attachment and its attached virtual network interface. + NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` + + // The number of NUMA nodes this virtual server instance is provisioned on. + // + // This property will be absent if the instance's `status` is not `running`. + NumaCount *int64 `json:"numa_count,omitempty"` + + // The placement restrictions for the virtual server instance. + PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` + + // The primary network attachment for this virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentReference `json:"primary_network_attachment,omitempty"` + + // The primary network interface for this virtual server instance. + // + // If this instance has network attachments, this primary network interface is a + // [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + // of the primary network attachment and its attached virtual network interface. + PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual + // server instance. + Profile *InstanceProfileReference `json:"profile" validate:"required"` + + // The reservation used by this virtual server instance. + // + // If absent, no reservation is in use. + Reservation *ReservationReference `json:"reservation,omitempty"` + + ReservationAffinity *InstanceReservationAffinity `json:"reservation_affinity" validate:"required"` + + // The resource group for this instance. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // Indicates whether the state of the virtual server instance permits a start request. + Startable *bool `json:"startable" validate:"required"` + + // The status of the virtual server instance. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []InstanceStatusReason `json:"status_reasons" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance network attachments or instance + // network interfaces. + TotalNetworkBandwidth *int64 `json:"total_network_bandwidth" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth" validate:"required"` + + // The virtual server instance VCPU configuration. + Vcpu *InstanceVcpu `json:"vcpu" validate:"required"` + + // The volume attachments for this virtual server instance, including the boot volume attachment. + VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` + + // The VPC this virtual server instance resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // The zone this virtual server instance resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the Instance.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + InstanceHealthStateDegradedConst = "degraded" + InstanceHealthStateFaultedConst = "faulted" + InstanceHealthStateInapplicableConst = "inapplicable" + InstanceHealthStateOkConst = "ok" +) + +// Constants associated with the Instance.LifecycleState property. +// The lifecycle state of the virtual server instance. +const ( + InstanceLifecycleStateDeletingConst = "deleting" + InstanceLifecycleStateFailedConst = "failed" + InstanceLifecycleStatePendingConst = "pending" + InstanceLifecycleStateStableConst = "stable" + InstanceLifecycleStateSuspendedConst = "suspended" + InstanceLifecycleStateUpdatingConst = "updating" + InstanceLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Instance.ResourceType property. +// The resource type. +const ( + InstanceResourceTypeInstanceConst = "instance" +) + +// Constants associated with the Instance.Status property. +// The status of the virtual server instance. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected +// property value was encountered. +const ( + InstanceStatusDeletingConst = "deleting" + InstanceStatusFailedConst = "failed" + InstanceStatusPendingConst = "pending" + InstanceStatusRestartingConst = "restarting" + InstanceStatusRunningConst = "running" + InstanceStatusStartingConst = "starting" + InstanceStatusStoppedConst = "stopped" + InstanceStatusStoppingConst = "stopping" +) + +// UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. +func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Instance) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentReferenceInstanceContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOffering) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "dedicated_host", &obj.DedicatedHost, UnmarshalDedicatedHostReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu", &obj.Gpu, UnmarshalInstanceGpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalInstanceHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalInstanceLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataService) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceInstanceContextReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "numa_count", &obj.NumaCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceInstanceContextReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation", &obj.Reservation, UnmarshalReservationReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "startable", &obj.Startable) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalInstanceStatusReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_network_bandwidth", &obj.TotalNetworkBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceInstanceContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAction : InstanceAction struct +type InstanceAction struct { + // The date and time that the action was completed. + // Deprecated: this field is deprecated and may be removed in a future release. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // The date and time that the action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. + Force *bool `json:"force,omitempty"` + + // The URL for this instance action. + // Deprecated: this field is deprecated and may be removed in a future release. + Href *string `json:"href" validate:"required"` + + // The identifier for this instance action. + // Deprecated: this field is deprecated and may be removed in a future release. + ID *string `json:"id" validate:"required"` + + // The date and time that the action was started. + // Deprecated: this field is deprecated and may be removed in a future release. + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // The current status of this action. + // Deprecated: this field is deprecated and may be removed in a future release. + Status *string `json:"status" validate:"required"` + + // The type of action. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the InstanceAction.Status property. +// The current status of this action. +const ( + InstanceActionStatusCompletedConst = "completed" + InstanceActionStatusFailedConst = "failed" + InstanceActionStatusPendingConst = "pending" + InstanceActionStatusRunningConst = "running" +) + +// Constants associated with the InstanceAction.Type property. +// The type of action. +const ( + InstanceActionTypeRebootConst = "reboot" + InstanceActionTypeStartConst = "start" + InstanceActionTypeStopConst = "stop" +) + +// UnmarshalInstanceAction unmarshals an instance of InstanceAction from the specified map of raw messages. +func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAction) + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "force", &obj.Force) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAvailabilityPolicy : InstanceAvailabilityPolicy struct +type InstanceAvailabilityPolicy struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the + // unexpected property value was encountered. + HostFailure *string `json:"host_failure" validate:"required"` +} + +// Constants associated with the InstanceAvailabilityPolicy.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the +// unexpected property value was encountered. +const ( + InstanceAvailabilityPolicyHostFailureRestartConst = "restart" + InstanceAvailabilityPolicyHostFailureStopConst = "stop" +) + +// UnmarshalInstanceAvailabilityPolicy unmarshals an instance of InstanceAvailabilityPolicy from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPolicy) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAvailabilityPolicyPatch : InstanceAvailabilityPolicyPatch struct +type InstanceAvailabilityPolicyPatch struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure. + HostFailure *string `json:"host_failure,omitempty"` +} + +// Constants associated with the InstanceAvailabilityPolicyPatch.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure. +const ( + InstanceAvailabilityPolicyPatchHostFailureRestartConst = "restart" + InstanceAvailabilityPolicyPatchHostFailureStopConst = "stop" +) + +// UnmarshalInstanceAvailabilityPolicyPatch unmarshals an instance of InstanceAvailabilityPolicyPatch from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPolicyPatch) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAvailabilityPolicyPrototype : InstanceAvailabilityPolicyPrototype struct +type InstanceAvailabilityPolicyPrototype struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure. + HostFailure *string `json:"host_failure,omitempty"` +} + +// Constants associated with the InstanceAvailabilityPolicyPrototype.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure. +const ( + InstanceAvailabilityPolicyPrototypeHostFailureRestartConst = "restart" + InstanceAvailabilityPolicyPrototypeHostFailureStopConst = "stop" +) + +// UnmarshalInstanceAvailabilityPolicyPrototype unmarshals an instance of InstanceAvailabilityPolicyPrototype from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPolicyPrototype) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceCatalogOffering : InstanceCatalogOffering struct +type InstanceCatalogOffering struct { + // The catalog offering version this virtual server instance was provisioned from. + // + // The catalog offering version is not managed by the IBM VPC service, and may no longer + // exist, or may refer to a different image CRN than the `image.crn` for this virtual + // server instance. However, all images associated with a catalog offering version will + // have the same checksum, and therefore will have the same data. + Version *CatalogOfferingVersionReference `json:"version" validate:"required"` +} + +// UnmarshalInstanceCatalogOffering unmarshals an instance of InstanceCatalogOffering from the specified map of raw messages. +func UnmarshalInstanceCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCatalogOffering) + err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceCatalogOfferingPrototype : The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering or offering version to use +// when provisioning this virtual server instance. +// +// If an offering is specified, the latest version of that offering will be used. +// +// The specified offering or offering version may be in a different account in the same +// [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject to IAM policies. +// Models which "extend" this model: +// - InstanceCatalogOfferingPrototypeCatalogOfferingByOffering +// - InstanceCatalogOfferingPrototypeCatalogOfferingByVersion +type InstanceCatalogOfferingPrototype struct { + // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering by a unique property. + Offering CatalogOfferingIdentityIntf `json:"offering,omitempty"` + + // Identifies a version of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a + // unique property. + Version CatalogOfferingVersionIdentityIntf `json:"version,omitempty"` +} + +func (*InstanceCatalogOfferingPrototype) isaInstanceCatalogOfferingPrototype() bool { + return true +} + +type InstanceCatalogOfferingPrototypeIntf interface { + isaInstanceCatalogOfferingPrototype() bool +} + +// UnmarshalInstanceCatalogOfferingPrototype unmarshals an instance of InstanceCatalogOfferingPrototype from the specified map of raw messages. +func UnmarshalInstanceCatalogOfferingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCatalogOfferingPrototype) + err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceCollection : InstanceCollection struct +type InstanceCollection struct { + // A link to the first page of resources. + First *InstanceCollectionFirst `json:"first" validate:"required"` + + // Collection of virtual server instances. + Instances []Instance `json:"instances" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceCollection unmarshals an instance of InstanceCollection from the specified map of raw messages. +func UnmarshalInstanceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstance) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceCollectionFirst : A link to the first page of resources. +type InstanceCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceCollectionFirst unmarshals an instance of InstanceCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceCollectionNext unmarshals an instance of InstanceCollectionNext from the specified map of raw messages. +func UnmarshalInstanceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceConsoleAccessToken : The instance console access token information. +type InstanceConsoleAccessToken struct { + // A URL safe single-use token used to access the console WebSocket. + AccessToken *string `json:"access_token" validate:"required"` + + // The instance console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` + + // The date and time that the access token was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The date and time that the access token will expire. + ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` + + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force" validate:"required"` + + // The URL to access this instance console. + Href *string `json:"href" validate:"required"` +} + +// Constants associated with the InstanceConsoleAccessToken.ConsoleType property. +// The instance console type for which this token may be used. +const ( + InstanceConsoleAccessTokenConsoleTypeSerialConst = "serial" + InstanceConsoleAccessTokenConsoleTypeVncConst = "vnc" +) + +// UnmarshalInstanceConsoleAccessToken unmarshals an instance of InstanceConsoleAccessToken from the specified map of raw messages. +func UnmarshalInstanceConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceConsoleAccessToken) + err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "force", &obj.Force) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDefaultTrustedProfilePrototype : InstanceDefaultTrustedProfilePrototype struct +type InstanceDefaultTrustedProfilePrototype struct { + // If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. + // Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be + // automatically deleted when the instance is deleted. + AutoLink *bool `json:"auto_link,omitempty"` + + // The default IAM trusted profile to use for this virtual server instance. + Target TrustedProfileIdentityIntf `json:"target" validate:"required"` +} + +// NewInstanceDefaultTrustedProfilePrototype : Instantiate InstanceDefaultTrustedProfilePrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceDefaultTrustedProfilePrototype(target TrustedProfileIdentityIntf) (_model *InstanceDefaultTrustedProfilePrototype, err error) { + _model = &InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalInstanceDefaultTrustedProfilePrototype unmarshals an instance of InstanceDefaultTrustedProfilePrototype from the specified map of raw messages. +func UnmarshalInstanceDefaultTrustedProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDisk : InstanceDisk struct +type InstanceDisk struct { + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance disk. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance disk. + ID *string `json:"id" validate:"required"` + + // The disk interface used for attaching the disk. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` + + // The name for this instance disk. The name is unique across all disks on the instance. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` +} + +// Constants associated with the InstanceDisk.InterfaceType property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceDiskInterfaceTypeNvmeConst = "nvme" + InstanceDiskInterfaceTypeVirtioBlkConst = "virtio_blk" +) + +// Constants associated with the InstanceDisk.ResourceType property. +// The resource type. +const ( + InstanceDiskResourceTypeInstanceDiskConst = "instance_disk" +) + +// UnmarshalInstanceDisk unmarshals an instance of InstanceDisk from the specified map of raw messages. +func UnmarshalInstanceDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDisk) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDiskCollection : InstanceDiskCollection struct +type InstanceDiskCollection struct { + // Collection of the instance's disks. + Disks []InstanceDisk `json:"disks" validate:"required"` +} + +// UnmarshalInstanceDiskCollection unmarshals an instance of InstanceDiskCollection from the specified map of raw messages. +func UnmarshalInstanceDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDiskPatch : InstanceDiskPatch struct +type InstanceDiskPatch struct { + // The name for this instance disk. The name must not be used by another disk on the instance. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceDiskPatch unmarshals an instance of InstanceDiskPatch from the specified map of raw messages. +func UnmarshalInstanceDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceDiskPatch +func (instanceDiskPatch *InstanceDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceDiskReference : InstanceDiskReference struct +type InstanceDiskReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceDiskReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance disk. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance disk. + ID *string `json:"id" validate:"required"` + + // The name for this instance disk. The name is unique across all disks on the instance. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the InstanceDiskReference.ResourceType property. +// The resource type. +const ( + InstanceDiskReferenceResourceTypeInstanceDiskConst = "instance_disk" +) + +// UnmarshalInstanceDiskReference unmarshals an instance of InstanceDiskReference from the specified map of raw messages. +func UnmarshalInstanceDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceDiskReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceDiskReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceDiskReferenceDeleted unmarshals an instance of InstanceDiskReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGpu : The virtual server instance GPU configuration. +type InstanceGpu struct { + // The number of GPUs assigned to the instance. + Count *int64 `json:"count" validate:"required"` + + // The GPU manufacturer. + Manufacturer *string `json:"manufacturer" validate:"required"` + + // The overall amount of GPU memory in GiB (gibibytes). + Memory *int64 `json:"memory" validate:"required"` + + // The GPU model. + Model *string `json:"model" validate:"required"` +} + +// UnmarshalInstanceGpu unmarshals an instance of InstanceGpu from the specified map of raw messages. +func UnmarshalInstanceGpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGpu) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "model", &obj.Model) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroup : InstanceGroup struct +type InstanceGroup struct { + // The port used for new load balancer pool members created by this instance group. + // + // This property will be present if and only if `load_balancer_pool` is present. + ApplicationPort *int64 `json:"application_port,omitempty"` + + // The date and time that the instance group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this instance group. + CRN *string `json:"crn" validate:"required"` + + // The URL for this instance group. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group. + ID *string `json:"id" validate:"required"` + + // The template used to create new instances for this group. + InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` + + // If present, the load balancer pool this instance group manages. A pool member will + // be created for each instance created by this group. + LoadBalancerPool *LoadBalancerPoolReference `json:"load_balancer_pool,omitempty"` + + // The managers for the instance group. + Managers []InstanceGroupManagerReference `json:"managers" validate:"required"` + + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count" validate:"required"` + + // The name for this instance group. The name is unique across all instance groups in the region. + Name *string `json:"name" validate:"required"` + + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The status of the instance group + // - `deleting`: Group is being deleted + // - `healthy`: Group has `membership_count` instances + // - `scaling`: Instances in the group are being created or deleted to reach + // `membership_count` + // - `unhealthy`: Group is unable to reach `membership_count` instances. + Status *string `json:"status" validate:"required"` + + // The subnets to use when creating new instances. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The date and time that the instance group was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The VPC the instance group resides in. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// Constants associated with the InstanceGroup.Status property. +// The status of the instance group +// - `deleting`: Group is being deleted +// - `healthy`: Group has `membership_count` instances +// - `scaling`: Instances in the group are being created or deleted to reach +// `membership_count` +// - `unhealthy`: Group is unable to reach `membership_count` instances. +const ( + InstanceGroupStatusDeletingConst = "deleting" + InstanceGroupStatusHealthyConst = "healthy" + InstanceGroupStatusScalingConst = "scaling" + InstanceGroupStatusUnhealthyConst = "unhealthy" +) + +// UnmarshalInstanceGroup unmarshals an instance of InstanceGroup from the specified map of raw messages. +func UnmarshalInstanceGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroup) + err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManagerReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupCollection : InstanceGroupCollection struct +type InstanceGroupCollection struct { + // A link to the first page of resources. + First *InstanceGroupCollectionFirst `json:"first" validate:"required"` + + // Collection of instance groups. + InstanceGroups []InstanceGroup `json:"instance_groups" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceGroupCollection unmarshals an instance of InstanceGroupCollection from the specified map of raw messages. +func UnmarshalInstanceGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_groups", &obj.InstanceGroups, UnmarshalInstanceGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceGroupCollectionFirst : A link to the first page of resources. +type InstanceGroupCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupCollectionFirst unmarshals an instance of InstanceGroupCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupCollectionNext unmarshals an instance of InstanceGroupCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManager : InstanceGroupManager struct +// Models which "extend" this model: +// - InstanceGroupManagerAutoScale +// - InstanceGroupManagerScheduled +type InstanceGroupManager struct { + // The date and time that the instance group manager was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` + + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled" validate:"required"` + + // The name for this instance group manager. The name is unique across all managers for the instance group. + Name *string `json:"name" validate:"required"` + + // The date and time that the instance group manager was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` + + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` + + // The type of instance group manager. + ManagerType *string `json:"manager_type,omitempty"` + + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The policies of the instance group manager. + Policies []InstanceGroupManagerPolicyReference `json:"policies,omitempty"` + + // The actions of the instance group manager. + Actions []InstanceGroupManagerActionReference `json:"actions,omitempty"` +} + +// Constants associated with the InstanceGroupManager.ManagerType property. +// The type of instance group manager. +const ( + InstanceGroupManagerManagerTypeAutoscaleConst = "autoscale" +) + +func (*InstanceGroupManager) isaInstanceGroupManager() bool { + return true +} + +type InstanceGroupManagerIntf interface { + isaInstanceGroupManager() bool +} + +// UnmarshalInstanceGroupManager unmarshals an instance of InstanceGroupManager from the specified map of raw messages. +func UnmarshalInstanceGroupManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManager) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerAction : InstanceGroupManagerAction struct +// Models which "extend" this model: +// - InstanceGroupManagerActionScheduledAction +type InstanceGroupManagerAction struct { + // Indicates whether this scheduled action will be automatically deleted after it has completed and + // `auto_delete_timeout` hours have passed. At present, this is always + // `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` + + // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically + // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the + // future. + AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` + + // The date and time that the instance group manager action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance group manager action. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager action. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager action. The name is unique across all actions for the instance group + // manager. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance group action + // - `active`: Action is ready to be run + // - `completed`: Action was completed successfully + // - `failed`: Action could not be completed successfully + // - `incompatible`: Action parameters are not compatible with the group or manager + // - `omitted`: Action was not applied because this action's manager was disabled. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group manager action was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of action for the instance group. + ActionType *string `json:"action_type,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + // The date and time the scheduled action was last applied. If absent, the action has never been applied. + LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + + // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run + // time. + NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + + Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` +} + +// Constants associated with the InstanceGroupManagerAction.ResourceType property. +// The resource type. +const ( + InstanceGroupManagerActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" +) + +// Constants associated with the InstanceGroupManagerAction.Status property. +// The status of the instance group action +// - `active`: Action is ready to be run +// - `completed`: Action was completed successfully +// - `failed`: Action could not be completed successfully +// - `incompatible`: Action parameters are not compatible with the group or manager +// - `omitted`: Action was not applied because this action's manager was disabled. +const ( + InstanceGroupManagerActionStatusActiveConst = "active" + InstanceGroupManagerActionStatusCompletedConst = "completed" + InstanceGroupManagerActionStatusFailedConst = "failed" + InstanceGroupManagerActionStatusIncompatibleConst = "incompatible" + InstanceGroupManagerActionStatusOmittedConst = "omitted" +) + +// Constants associated with the InstanceGroupManagerAction.ActionType property. +// The type of action for the instance group. +const ( + InstanceGroupManagerActionActionTypeScheduledConst = "scheduled" +) + +func (*InstanceGroupManagerAction) isaInstanceGroupManagerAction() bool { + return true +} + +type InstanceGroupManagerActionIntf interface { + isaInstanceGroupManagerAction() bool +} + +// UnmarshalInstanceGroupManagerAction unmarshals an instance of InstanceGroupManagerAction from the specified map of raw messages. +func UnmarshalInstanceGroupManagerAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerAction) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionGroupPatch : InstanceGroupManagerActionGroupPatch struct +type InstanceGroupManagerActionGroupPatch struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count,omitempty"` +} + +// UnmarshalInstanceGroupManagerActionGroupPatch unmarshals an instance of InstanceGroupManagerActionGroupPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionGroupPatch) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionManagerPatch : InstanceGroupManagerActionManagerPatch struct +type InstanceGroupManagerActionManagerPatch struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +} + +// UnmarshalInstanceGroupManagerActionManagerPatch unmarshals an instance of InstanceGroupManagerActionManagerPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionManagerPatch) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionPatch : InstanceGroupManagerActionPatch struct +type InstanceGroupManagerActionPatch struct { + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + Group *InstanceGroupManagerActionGroupPatch `json:"group,omitempty"` + + Manager *InstanceGroupManagerActionManagerPatch `json:"manager,omitempty"` + + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. + Name *string `json:"name,omitempty"` + + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` +} + +// UnmarshalInstanceGroupManagerActionPatch unmarshals an instance of InstanceGroupManagerActionPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPatch) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerActionGroupPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerActionManagerPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceGroupManagerActionPatch +func (instanceGroupManagerActionPatch *InstanceGroupManagerActionPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerActionPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceGroupManagerActionPrototype : InstanceGroupManagerActionPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototype struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` + + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` +} + +func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +type InstanceGroupManagerActionPrototypeIntf interface { + isaInstanceGroupManagerActionPrototype() bool +} + +// UnmarshalInstanceGroupManagerActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionReference : InstanceGroupManagerActionReference struct +type InstanceGroupManagerActionReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupManagerActionReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group manager action. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager action. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager action. The name is unique across all actions for the instance group + // manager. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the InstanceGroupManagerActionReference.ResourceType property. +// The resource type. +const ( + InstanceGroupManagerActionReferenceResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" +) + +// UnmarshalInstanceGroupManagerActionReference unmarshals an instance of InstanceGroupManagerActionReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerActionReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceGroupManagerActionReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceGroupManagerActionReferenceDeleted unmarshals an instance of InstanceGroupManagerActionReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionsCollection : InstanceGroupManagerActionsCollection struct +type InstanceGroupManagerActionsCollection struct { + // Collection of instance group manager actions. + Actions []InstanceGroupManagerActionIntf `json:"actions" validate:"required"` + + // A link to the first page of resources. + First *InstanceGroupManagerActionsCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerActionsCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceGroupManagerActionsCollection unmarshals an instance of InstanceGroupManagerActionsCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollection) + err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerAction) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerActionsCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerActionsCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerActionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceGroupManagerActionsCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerActionsCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerActionsCollectionFirst unmarshals an instance of InstanceGroupManagerActionsCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionsCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerActionsCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerActionsCollectionNext unmarshals an instance of InstanceGroupManagerActionsCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerCollection : InstanceGroupManagerCollection struct +type InstanceGroupManagerCollection struct { + // A link to the first page of resources. + First *InstanceGroupManagerCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // Collection of instance group managers. + Managers []InstanceGroupManagerIntf `json:"managers" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceGroupManagerCollection unmarshals an instance of InstanceGroupManagerCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManager) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceGroupManagerCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerCollectionFirst unmarshals an instance of InstanceGroupManagerCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerCollectionNext unmarshals an instance of InstanceGroupManagerCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPatch : InstanceGroupManagerPatch struct +type InstanceGroupManagerPatch struct { + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` + + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` + + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` + + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The name for this instance group manager. The name must not be used by another manager for the instance group. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceGroupManagerPatch unmarshals an instance of InstanceGroupManagerPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPatch) + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceGroupManagerPatch +func (instanceGroupManagerPatch *InstanceGroupManagerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceGroupManagerPolicy : InstanceGroupManagerPolicy struct +// Models which "extend" this model: +// - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy +type InstanceGroupManagerPolicy struct { + // The date and time that the instance group manager policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance group manager policy. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager policy. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager policy. The name is unique across all policies for the instance group + // manager. + Name *string `json:"name" validate:"required"` + + // The date and time that the instance group manager policy was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` + + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` + + // The type of policy for the instance group. + PolicyType *string `json:"policy_type,omitempty"` +} + +// Constants associated with the InstanceGroupManagerPolicy.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyMetricTypeNetworkOutConst = "network_out" +) + +// Constants associated with the InstanceGroupManagerPolicy.PolicyType property. +// The type of policy for the instance group. +const ( + InstanceGroupManagerPolicyPolicyTypeTargetConst = "target" +) + +func (*InstanceGroupManagerPolicy) isaInstanceGroupManagerPolicy() bool { + return true +} + +type InstanceGroupManagerPolicyIntf interface { + isaInstanceGroupManagerPolicy() bool +} + +// UnmarshalInstanceGroupManagerPolicy unmarshals an instance of InstanceGroupManagerPolicy from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicy) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyCollection : InstanceGroupManagerPolicyCollection struct +type InstanceGroupManagerPolicyCollection struct { + // A link to the first page of resources. + First *InstanceGroupManagerPolicyCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerPolicyCollectionNext `json:"next,omitempty"` + + // Collection of instance group manager policies. + Policies []InstanceGroupManagerPolicyIntf `json:"policies" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceGroupManagerPolicyCollection unmarshals an instance of InstanceGroupManagerPolicyCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerPolicyCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerPolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerPolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceGroupManagerPolicyCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerPolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerPolicyCollectionFirst unmarshals an instance of InstanceGroupManagerPolicyCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerPolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupManagerPolicyCollectionNext unmarshals an instance of InstanceGroupManagerPolicyCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyPatch : InstanceGroupManagerPolicyPatch struct +type InstanceGroupManagerPolicyPatch struct { + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` + + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` + + // The name for this instance group manager policy. The name must not be used by another policy for the instance group + // manager. + Name *string `json:"name,omitempty"` +} + +// Constants associated with the InstanceGroupManagerPolicyPatch.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyPatchMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyPatchMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyPatchMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyPatchMetricTypeNetworkOutConst = "network_out" +) + +// UnmarshalInstanceGroupManagerPolicyPatch unmarshals an instance of InstanceGroupManagerPolicyPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyPatch) + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceGroupManagerPolicyPatch +func (instanceGroupManagerPolicyPatch *InstanceGroupManagerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceGroupManagerPolicyPrototype : InstanceGroupManagerPolicyPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype +type InstanceGroupManagerPolicyPrototype struct { + // The name for this instance group manager policy. The name must not be used by another policy for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` + + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` + + // The type of policy for the instance group. + PolicyType *string `json:"policy_type,omitempty"` +} + +// Constants associated with the InstanceGroupManagerPolicyPrototype.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyPrototypeMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyPrototypeMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyPrototypeMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyPrototypeMetricTypeNetworkOutConst = "network_out" +) + +// Constants associated with the InstanceGroupManagerPolicyPrototype.PolicyType property. +// The type of policy for the instance group. +const ( + InstanceGroupManagerPolicyPrototypePolicyTypeTargetConst = "target" +) + +func (*InstanceGroupManagerPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { + return true +} + +type InstanceGroupManagerPolicyPrototypeIntf interface { + isaInstanceGroupManagerPolicyPrototype() bool +} + +// UnmarshalInstanceGroupManagerPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyReference : InstanceGroupManagerPolicyReference struct +type InstanceGroupManagerPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupManagerPolicyReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group manager policy. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager policy. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager policy. The name is unique across all policies for the instance group + // manager. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceGroupManagerPolicyReference unmarshals an instance of InstanceGroupManagerPolicyReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerPolicyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceGroupManagerPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceGroupManagerPolicyReferenceDeleted unmarshals an instance of InstanceGroupManagerPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPrototype : InstanceGroupManagerPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype +// - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype +type InstanceGroupManagerPrototype struct { + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` + + // The name for this instance group manager. The name must not be used by another manager for the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` + + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` + + // The type of instance group manager. + ManagerType *string `json:"manager_type,omitempty"` + + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +} + +// Constants associated with the InstanceGroupManagerPrototype.ManagerType property. +// The type of instance group manager. +const ( + InstanceGroupManagerPrototypeManagerTypeAutoscaleConst = "autoscale" +) + +func (*InstanceGroupManagerPrototype) isaInstanceGroupManagerPrototype() bool { + return true +} + +type InstanceGroupManagerPrototypeIntf interface { + isaInstanceGroupManagerPrototype() bool +} + +// UnmarshalInstanceGroupManagerPrototype unmarshals an instance of InstanceGroupManagerPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPrototype) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerReference : InstanceGroupManagerReference struct +type InstanceGroupManagerReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager. The name is unique across all managers for the instance group. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceGroupManagerReference unmarshals an instance of InstanceGroupManagerReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceGroupManagerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceGroupManagerReferenceDeleted unmarshals an instance of InstanceGroupManagerReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerScheduledActionGroup : InstanceGroupManagerScheduledActionGroup struct +type InstanceGroupManagerScheduledActionGroup struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count" validate:"required"` +} + +// UnmarshalInstanceGroupManagerScheduledActionGroup unmarshals an instance of InstanceGroupManagerScheduledActionGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionGroup) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerScheduledActionGroupPrototype : InstanceGroupManagerScheduledActionGroupPrototype struct +type InstanceGroupManagerScheduledActionGroupPrototype struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count" validate:"required"` +} + +// NewInstanceGroupManagerScheduledActionGroupPrototype : Instantiate InstanceGroupManagerScheduledActionGroupPrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount int64) (_model *InstanceGroupManagerScheduledActionGroupPrototype, err error) { + _model = &InstanceGroupManagerScheduledActionGroupPrototype{ + MembershipCount: core.Int64Ptr(membershipCount), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalInstanceGroupManagerScheduledActionGroupPrototype unmarshals an instance of InstanceGroupManagerScheduledActionGroupPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionGroupPrototype) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerScheduledActionManager : InstanceGroupManagerScheduledActionManager struct +// Models which "extend" this model: +// - InstanceGroupManagerScheduledActionManagerAutoScale +type InstanceGroupManagerScheduledActionManager struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group manager. + Href *string `json:"href,omitempty"` + + // The unique identifier for this instance group manager. + ID *string `json:"id,omitempty"` + + // The name for this instance group manager. The name is unique across all managers for the instance group. + Name *string `json:"name,omitempty"` + + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +} + +func (*InstanceGroupManagerScheduledActionManager) isaInstanceGroupManagerScheduledActionManager() bool { + return true +} + +type InstanceGroupManagerScheduledActionManagerIntf interface { + isaInstanceGroupManagerScheduledActionManager() bool +} + +// UnmarshalInstanceGroupManagerScheduledActionManager unmarshals an instance of InstanceGroupManagerScheduledActionManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManager) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerScheduledActionManagerPrototype : InstanceGroupManagerScheduledActionManagerPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype +type InstanceGroupManagerScheduledActionManagerPrototype struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The unique identifier for this instance group manager. + ID *string `json:"id,omitempty"` + + // The URL for this instance group manager. + Href *string `json:"href,omitempty"` +} + +func (*InstanceGroupManagerScheduledActionManagerPrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { + return true +} + +type InstanceGroupManagerScheduledActionManagerPrototypeIntf interface { + isaInstanceGroupManagerScheduledActionManagerPrototype() bool +} + +// UnmarshalInstanceGroupManagerScheduledActionManagerPrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerPrototype) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupMembership : InstanceGroupMembership struct +type InstanceGroupMembership struct { + // The date and time that the instance group manager policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If set to true, when deleting the membership the instance will also be deleted. + DeleteInstanceOnMembershipDelete *bool `json:"delete_instance_on_membership_delete" validate:"required"` + + // The URL for this instance group membership. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group membership. + ID *string `json:"id" validate:"required"` + + Instance *InstanceReference `json:"instance" validate:"required"` + + InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` + + // The name for this instance group membership. The name is unique across all memberships for the instance group. + Name *string `json:"name" validate:"required"` + + PoolMember *LoadBalancerPoolMemberReference `json:"pool_member,omitempty"` + + // The status of the instance group membership + // - `deleting`: Membership is deleting dependent resources + // - `failed`: Membership was unable to maintain dependent resources + // - `healthy`: Membership is active and serving in the group + // - `pending`: Membership is waiting for dependent resources + // - `unhealthy`: Membership has unhealthy dependent resources. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group membership was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +} + +// Constants associated with the InstanceGroupMembership.Status property. +// The status of the instance group membership +// - `deleting`: Membership is deleting dependent resources +// - `failed`: Membership was unable to maintain dependent resources +// - `healthy`: Membership is active and serving in the group +// - `pending`: Membership is waiting for dependent resources +// - `unhealthy`: Membership has unhealthy dependent resources. +const ( + InstanceGroupMembershipStatusDeletingConst = "deleting" + InstanceGroupMembershipStatusFailedConst = "failed" + InstanceGroupMembershipStatusHealthyConst = "healthy" + InstanceGroupMembershipStatusPendingConst = "pending" + InstanceGroupMembershipStatusUnhealthyConst = "unhealthy" +) + +// UnmarshalInstanceGroupMembership unmarshals an instance of InstanceGroupMembership from the specified map of raw messages. +func UnmarshalInstanceGroupMembership(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembership) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "delete_instance_on_membership_delete", &obj.DeleteInstanceOnMembershipDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool_member", &obj.PoolMember, UnmarshalLoadBalancerPoolMemberReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupMembershipCollection : InstanceGroupMembershipCollection struct +type InstanceGroupMembershipCollection struct { + // A link to the first page of resources. + First *InstanceGroupMembershipCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // Collection of instance group memberships. + Memberships []InstanceGroupMembership `json:"memberships" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupMembershipCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceGroupMembershipCollection unmarshals an instance of InstanceGroupMembershipCollection from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupMembershipCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memberships", &obj.Memberships, UnmarshalInstanceGroupMembership) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupMembershipCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupMembershipCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// InstanceGroupMembershipCollectionFirst : A link to the first page of resources. +type InstanceGroupMembershipCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupMembershipCollectionFirst unmarshals an instance of InstanceGroupMembershipCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupMembershipCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupMembershipCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceGroupMembershipCollectionNext unmarshals an instance of InstanceGroupMembershipCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupMembershipPatch : InstanceGroupMembershipPatch struct +type InstanceGroupMembershipPatch struct { + // The name for this instance group membership. The name must not be used by another membership for the instance group + // manager. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceGroupMembershipPatch unmarshals an instance of InstanceGroupMembershipPatch from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceGroupMembershipPatch +func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupMembershipPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. +type InstanceGroupPatch struct { + // The port to use for new load balancer pool members created by this instance group. + // + // This property must be set if and only if `load_balancer_pool` has been set. + ApplicationPort *int64 `json:"application_port,omitempty"` + + // Instance template to use when creating new instances. + // + // Instance groups are not compatible with instance templates that specify `true` for + // `default_trusted_profile.auto_link`. + InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template,omitempty"` + + // The load balancer associated with `load_balancer_pool`. + // The load balancer must have `instance_groups_supported` set to `true`. + // + // This property must be set if and only if `load_balancer_pool` has been set. + LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` + + // If specified, this instance group will manage the load balancer pool. A pool member + // will be created for each instance created by this group. The specified load + // balancer pool must not be used by another instance group in the VPC. + // + // If set, `load_balancer` and `application_port` must also be set. + LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count,omitempty"` + + // The name for this instance group. The name must not be used by another instance group in the region. + Name *string `json:"name,omitempty"` + + // The subnets to use when creating new instances. + Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` +} + +// UnmarshalInstanceGroupPatch unmarshals an instance of InstanceGroupPatch from the specified map of raw messages. +func UnmarshalInstanceGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupPatch) + err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancer", &obj.LoadBalancer, UnmarshalLoadBalancerIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceGroupPatch +func (instanceGroupPatch *InstanceGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceGroupReference : InstanceGroupReference struct +type InstanceGroupReference struct { + // The CRN for this instance group. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group. + ID *string `json:"id" validate:"required"` + + // The name for this instance group. The name is unique across all instance groups in the region. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceGroupReference unmarshals an instance of InstanceGroupReference from the specified map of raw messages. +func UnmarshalInstanceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceGroupReferenceDeleted unmarshals an instance of InstanceGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceHealthReason : InstanceHealthReason struct +type InstanceHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + InstanceHealthReasonCodeReservationCapacityUnavailableConst = "reservation_capacity_unavailable" + InstanceHealthReasonCodeReservationDeletedConst = "reservation_deleted" + InstanceHealthReasonCodeReservationExpiredConst = "reservation_expired" + InstanceHealthReasonCodeReservationFailedConst = "reservation_failed" +) + +// UnmarshalInstanceHealthReason unmarshals an instance of InstanceHealthReason from the specified map of raw messages. +func UnmarshalInstanceHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceInitialization : InstanceInitialization struct +type InstanceInitialization struct { + // The default trusted profile configuration specified at virtual server instance + // creation. If absent, no default trusted profile was specified. + DefaultTrustedProfile *InstanceInitializationDefaultTrustedProfile `json:"default_trusted_profile,omitempty"` + + // The public SSH keys used at instance initialization. + Keys []KeyReference `json:"keys" validate:"required"` + + Password *InstanceInitializationPassword `json:"password,omitempty"` +} + +// UnmarshalInstanceInitialization unmarshals an instance of InstanceInitialization from the specified map of raw messages. +func UnmarshalInstanceInitialization(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitialization) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceInitializationDefaultTrustedProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "password", &obj.Password, UnmarshalInstanceInitializationPassword) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceInitializationDefaultTrustedProfile : InstanceInitializationDefaultTrustedProfile struct +type InstanceInitializationDefaultTrustedProfile struct { + // If set to `true`, the system created a link to the specified `target` trusted profile during instance creation. + // Regardless of whether a link was created by the system or manually using the IAM Identity service, it will be + // automatically deleted when the instance is deleted. + AutoLink *bool `json:"auto_link" validate:"required"` + + // The default IAM trusted profile to use for this virtual server instance. + Target *TrustedProfileReference `json:"target" validate:"required"` +} + +// UnmarshalInstanceInitializationDefaultTrustedProfile unmarshals an instance of InstanceInitializationDefaultTrustedProfile from the specified map of raw messages. +func UnmarshalInstanceInitializationDefaultTrustedProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitializationDefaultTrustedProfile) + err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceInitializationPassword : InstanceInitializationPassword struct +type InstanceInitializationPassword struct { + // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` + + // The public SSH key used to encrypt the administrator password. + EncryptionKey *KeyIdentityByFingerprint `json:"encryption_key" validate:"required"` +} + +// UnmarshalInstanceInitializationPassword unmarshals an instance of InstanceInitializationPassword from the specified map of raw messages. +func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitializationPassword) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyIdentityByFingerprint) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceLifecycleReason : InstanceLifecycleReason struct +type InstanceLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + InstanceLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalInstanceLifecycleReason unmarshals an instance of InstanceLifecycleReason from the specified map of raw messages. +func UnmarshalInstanceLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceMetadataService : The metadata service configuration. +type InstanceMetadataService struct { + // Indicates whether the metadata service endpoint is available to the virtual server instance. + Enabled *bool `json:"enabled" validate:"required"` + + // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + // enabled. + // - `http`: HTTP protocol (unencrypted) + // - `https`: HTTP Secure protocol. + Protocol *string `json:"protocol" validate:"required"` + + // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata + // service is enabled. + ResponseHopLimit *int64 `json:"response_hop_limit" validate:"required"` +} + +// Constants associated with the InstanceMetadataService.Protocol property. +// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is +// enabled. +// - `http`: HTTP protocol (unencrypted) +// - `https`: HTTP Secure protocol. +const ( + InstanceMetadataServiceProtocolHTTPConst = "http" + InstanceMetadataServiceProtocolHTTPSConst = "https" +) + +// UnmarshalInstanceMetadataService unmarshals an instance of InstanceMetadataService from the specified map of raw messages. +func UnmarshalInstanceMetadataService(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataService) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceMetadataServicePatch : The metadata service configuration. +type InstanceMetadataServicePatch struct { + // Indicates whether the metadata service endpoint will be available to the virtual server instance. + Enabled *bool `json:"enabled,omitempty"` + + // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + // enabled. + // - `http`: HTTP protocol (unencrypted) + // - `https`: HTTP Secure protocol. + Protocol *string `json:"protocol,omitempty"` + + // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata + // service is enabled. + ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` +} + +// Constants associated with the InstanceMetadataServicePatch.Protocol property. +// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is +// enabled. +// - `http`: HTTP protocol (unencrypted) +// - `https`: HTTP Secure protocol. +const ( + InstanceMetadataServicePatchProtocolHTTPConst = "http" + InstanceMetadataServicePatchProtocolHTTPSConst = "https" +) + +// UnmarshalInstanceMetadataServicePatch unmarshals an instance of InstanceMetadataServicePatch from the specified map of raw messages. +func UnmarshalInstanceMetadataServicePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataServicePatch) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceMetadataServicePrototype : The metadata service configuration. +type InstanceMetadataServicePrototype struct { + // Indicates whether the metadata service endpoint will be available to the virtual server instance. + Enabled *bool `json:"enabled,omitempty"` + + // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + // enabled. + // - `http`: HTTP protocol (unencrypted) + // - `https`: HTTP Secure protocol. + Protocol *string `json:"protocol,omitempty"` + + // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata + // service is enabled. + ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` +} + +// Constants associated with the InstanceMetadataServicePrototype.Protocol property. +// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is +// enabled. +// - `http`: HTTP protocol (unencrypted) +// - `https`: HTTP Secure protocol. +const ( + InstanceMetadataServicePrototypeProtocolHTTPConst = "http" + InstanceMetadataServicePrototypeProtocolHTTPSConst = "https" +) + +// UnmarshalInstanceMetadataServicePrototype unmarshals an instance of InstanceMetadataServicePrototype from the specified map of raw messages. +func UnmarshalInstanceMetadataServicePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachment : InstanceNetworkAttachment struct +type InstanceNetworkAttachment struct { + // The date and time that the instance network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance network attachment. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the instance network attachment. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this instance network attachment. The name is unique across all network attachments for the instance. + Name *string `json:"name" validate:"required"` + + // The port speed for this instance network attachment in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + // The primary IP address of the virtual network interface for the instance network + // attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the instance network attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The instance network attachment type. + Type *string `json:"type" validate:"required"` + + // The virtual network interface for this instance network attachment. + VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` +} + +// Constants associated with the InstanceNetworkAttachment.LifecycleState property. +// The lifecycle state of the instance network attachment. +const ( + InstanceNetworkAttachmentLifecycleStateDeletingConst = "deleting" + InstanceNetworkAttachmentLifecycleStateFailedConst = "failed" + InstanceNetworkAttachmentLifecycleStatePendingConst = "pending" + InstanceNetworkAttachmentLifecycleStateStableConst = "stable" + InstanceNetworkAttachmentLifecycleStateSuspendedConst = "suspended" + InstanceNetworkAttachmentLifecycleStateUpdatingConst = "updating" + InstanceNetworkAttachmentLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the InstanceNetworkAttachment.ResourceType property. +// The resource type. +const ( + InstanceNetworkAttachmentResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" +) + +// Constants associated with the InstanceNetworkAttachment.Type property. +// The instance network attachment type. +const ( + InstanceNetworkAttachmentTypePrimaryConst = "primary" + InstanceNetworkAttachmentTypeSecondaryConst = "secondary" +) + +// UnmarshalInstanceNetworkAttachment unmarshals an instance of InstanceNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachment) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentCollection : InstanceNetworkAttachmentCollection struct +type InstanceNetworkAttachmentCollection struct { + // Collection of instance network attachments. + NetworkAttachments []InstanceNetworkAttachment `json:"network_attachments" validate:"required"` +} + +// UnmarshalInstanceNetworkAttachmentCollection unmarshals an instance of InstanceNetworkAttachmentCollection from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentCollection) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachment) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentPatch : InstanceNetworkAttachmentPatch struct +type InstanceNetworkAttachmentPatch struct { + // The name for this network attachment. The name must not be used by another network attachment for the instance. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceNetworkAttachmentPatch unmarshals an instance of InstanceNetworkAttachmentPatch from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceNetworkAttachmentPatch +func (instanceNetworkAttachmentPatch *InstanceNetworkAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceNetworkAttachmentPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceNetworkAttachmentPrototype : InstanceNetworkAttachmentPrototype struct +type InstanceNetworkAttachmentPrototype struct { + // The name for this network attachment. Names must be unique within the instance the network attachment resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // A virtual network interface for the instance network attachment. This can be specified + // using an existing virtual network interface, or a prototype object for a new virtual + // network interface. + // + // If an existing virtual network interface is specified, `enable_infrastructure_nat` must be + // `true`. + VirtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` +} + +// NewInstanceNetworkAttachmentPrototype : Instantiate InstanceNetworkAttachmentPrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceNetworkAttachmentPrototype(virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) (_model *InstanceNetworkAttachmentPrototype, err error) { + _model = &InstanceNetworkAttachmentPrototype{ + VirtualNetworkInterface: virtualNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalInstanceNetworkAttachmentPrototype unmarshals an instance of InstanceNetworkAttachmentPrototype from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterface : A virtual network interface for the instance network attachment. This can be specified using an existing virtual +// network interface, or a prototype object for a new virtual network interface. +// +// If an existing virtual network interface is specified, `enable_infrastructure_nat` must be +// `true`. +// Models which "extend" this model: +// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext +// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` + + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` + + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` + + // The resource group to use for this virtual network interface. If unspecified, the + // virtual server instance's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` + + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` + + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` +} + +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterface) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf interface { + isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool +} + +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterface) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentReference : InstanceNetworkAttachmentReference struct +type InstanceNetworkAttachmentReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this instance network attachment. The name is unique across all network attachments for the instance. + Name *string `json:"name" validate:"required"` + + // The primary IP address of the virtual network interface for the instance network + // attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the instance network attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` +} + +// Constants associated with the InstanceNetworkAttachmentReference.ResourceType property. +// The resource type. +const ( + InstanceNetworkAttachmentReferenceResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" +) + +// UnmarshalInstanceNetworkAttachmentReference unmarshals an instance of InstanceNetworkAttachmentReference from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceNetworkAttachmentReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceNetworkAttachmentReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceNetworkAttachmentReferenceDeleted unmarshals an instance of InstanceNetworkAttachmentReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePatch : InstancePatch struct +type InstancePatch struct { + // The availability policy for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPatch `json:"availability_policy,omitempty"` + + // The metadata service configuration. + MetadataService *InstanceMetadataServicePatch `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. Changing the name will not affect the system hostname. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. For the placement + // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. + // + // If set, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` + + // The profile to use for this virtual server instance. For the profile to be changed, + // the instance `status` must be `stopping` or `stopped`. In addition, the requested + // profile must: + // - Have matching instance disk support. Any disks associated with the current profile + // will be deleted, and any disks associated with the requested profile will be + // created. + // - Be compatible with any `placement_target` constraints. For example, if the + // instance is placed on a dedicated host, the requested profile `family` must be + // the same as the dedicated host `family`. + // - Have the same `vcpu.architecture`. + // - Support the number of network attachments or network interfaces the instance + // currently has. + Profile InstancePatchProfileIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` +} + +// UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. +func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatch) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstancePatchProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstancePatch +func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instancePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstancePatchProfile : The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be +// `stopping` or `stopped`. In addition, the requested profile must: +// - Have matching instance disk support. Any disks associated with the current profile +// will be deleted, and any disks associated with the requested profile will be +// created. +// - Be compatible with any `placement_target` constraints. For example, if the +// instance is placed on a dedicated host, the requested profile `family` must be +// the same as the dedicated host `family`. +// - Have the same `vcpu.architecture`. +// - Support the number of network attachments or network interfaces the instance +// currently has. +// +// Models which "extend" this model: +// - InstancePatchProfileInstanceProfileIdentityByName +// - InstancePatchProfileInstanceProfileIdentityByHref +type InstancePatchProfile struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` + + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` +} + +func (*InstancePatchProfile) isaInstancePatchProfile() bool { + return true +} + +type InstancePatchProfileIntf interface { + isaInstancePatchProfile() bool +} + +// UnmarshalInstancePatchProfile unmarshals an instance of InstancePatchProfile from the specified map of raw messages. +func UnmarshalInstancePatchProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatchProfile) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTarget : InstancePlacementTarget struct +// Models which "extend" this model: +// - InstancePlacementTargetDedicatedHostGroupReference +// - InstancePlacementTargetDedicatedHostReference +// - InstancePlacementTargetPlacementGroupReference +type InstancePlacementTarget struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` + + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` + + // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the InstancePlacementTarget.ResourceType property. +// The resource type. +const ( + InstancePlacementTargetResourceTypeDedicatedHostGroupConst = "dedicated_host_group" +) + +func (*InstancePlacementTarget) isaInstancePlacementTarget() bool { + return true +} + +type InstancePlacementTargetIntf interface { + isaInstancePlacementTarget() bool +} + +// UnmarshalInstancePlacementTarget unmarshals an instance of InstancePlacementTarget from the specified map of raw messages. +func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatch : InstancePlacementTargetPatch struct +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostIdentity +// - InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatch struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPatch) isaInstancePlacementTargetPatch() bool { + return true +} + +type InstancePlacementTargetPatchIntf interface { + isaInstancePlacementTargetPatch() bool +} + +// UnmarshalInstancePlacementTargetPatch unmarshals an instance of InstancePlacementTargetPatch from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPrototype : InstancePlacementTargetPrototype struct +// Models which "extend" this model: +// - InstancePlacementTargetPrototypeDedicatedHostIdentity +// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity +// - InstancePlacementTargetPrototypePlacementGroupIdentity +type InstancePlacementTargetPrototype struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPrototype) isaInstancePlacementTargetPrototype() bool { + return true +} + +type InstancePlacementTargetPrototypeIntf interface { + isaInstancePlacementTargetPrototype() bool +} + +// UnmarshalInstancePlacementTargetPrototype unmarshals an instance of InstancePlacementTargetPrototype from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfile : InstanceProfile struct +type InstanceProfile struct { + Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` + + // Collection of the instance profile's disks. + Disks []InstanceProfileDisk `json:"disks" validate:"required"` + + // The product family this virtual server instance profile belongs to. + Family *string `json:"family" validate:"required"` + + GpuCount InstanceProfileGpuIntf `json:"gpu_count,omitempty"` + + GpuManufacturer *InstanceProfileGpuManufacturer `json:"gpu_manufacturer,omitempty"` + + GpuMemory InstanceProfileGpuMemoryIntf `json:"gpu_memory,omitempty"` + + GpuModel *InstanceProfileGpuModel `json:"gpu_model,omitempty"` + + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` + + Memory InstanceProfileMemoryIntf `json:"memory" validate:"required"` + + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` + + NetworkAttachmentCount InstanceProfileNetworkAttachmentCountIntf `json:"network_attachment_count" validate:"required"` + + NetworkInterfaceCount InstanceProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` + + NumaCount InstanceProfileNumaCountIntf `json:"numa_count,omitempty"` + + OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` + + PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` + + ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance profile: + // - `previous`: This instance profile is an older revision, but remains provisionable and + // usable. + // - `current`: This profile is the latest revision. + // + // Note that revisions are indicated by the generation of an instance profile. Refer to the + // [profile naming conventions] + // (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how + // generations are defined within an instance profile. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + + TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` + + VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` + + VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` + + VcpuManufacturer *InstanceProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` +} + +// Constants associated with the InstanceProfile.ResourceType property. +// The resource type. +const ( + InstanceProfileResourceTypeInstanceProfileConst = "instance_profile" +) + +// Constants associated with the InstanceProfile.Status property. +// The status of the instance profile: +// - `previous`: This instance profile is an older revision, but remains provisionable and +// usable. +// - `current`: This profile is the latest revision. +// +// Note that revisions are indicated by the generation of an instance profile. Refer to the +// [profile naming conventions] +// (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how +// generations are defined within an instance profile. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the +// unexpected property value was encountered. +const ( + InstanceProfileStatusCurrentConst = "current" + InstanceProfileStatusPreviousConst = "previous" +) + +// UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. +func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfile) + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_count", &obj.GpuCount, UnmarshalInstanceProfileGpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_manufacturer", &obj.GpuManufacturer, UnmarshalInstanceProfileGpuManufacturer) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_memory", &obj.GpuMemory, UnmarshalInstanceProfileGpuMemory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_model", &obj.GpuModel, UnmarshalInstanceProfileGpuModel) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalInstanceProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachment_count", &obj.NetworkAttachmentCount, UnmarshalInstanceProfileNetworkAttachmentCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalInstanceProfileNetworkInterfaceCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "numa_count", &obj.NumaCount, UnmarshalInstanceProfileNumaCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "port_speed", &obj.PortSpeed, UnmarshalInstanceProfilePortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_terms", &obj.ReservationTerms, UnmarshalInstanceProfileReservationTerms) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalInstanceProfileVcpuArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalInstanceProfileVcpuManufacturer) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileBandwidth : InstanceProfileBandwidth struct +// Models which "extend" this model: +// - InstanceProfileBandwidthFixed +// - InstanceProfileBandwidthRange +// - InstanceProfileBandwidthEnum +// - InstanceProfileBandwidthDependent +type InstanceProfileBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileBandwidth.Type property. +// The type for this profile field. +const ( + InstanceProfileBandwidthTypeFixedConst = "fixed" +) + +func (*InstanceProfileBandwidth) isaInstanceProfileBandwidth() bool { + return true +} + +type InstanceProfileBandwidthIntf interface { + isaInstanceProfileBandwidth() bool +} + +// UnmarshalInstanceProfileBandwidth unmarshals an instance of InstanceProfileBandwidth from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileCollection : InstanceProfileCollection struct +type InstanceProfileCollection struct { + // Collection of virtual server instance profiles. + Profiles []InstanceProfile `json:"profiles" validate:"required"` +} + +// UnmarshalInstanceProfileCollection unmarshals an instance of InstanceProfileCollection from the specified map of raw messages. +func UnmarshalInstanceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileCollection) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileDisk : Disks provided by this profile. +type InstanceProfileDisk struct { + Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` + + Size InstanceProfileDiskSizeIntf `json:"size" validate:"required"` + + SupportedInterfaceTypes *InstanceProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` +} + +// UnmarshalInstanceProfileDisk unmarshals an instance of InstanceProfileDisk from the specified map of raw messages. +func UnmarshalInstanceProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDisk) + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalInstanceProfileDiskQuantity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalInstanceProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalInstanceProfileDiskSupportedInterfaces) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileDiskQuantity : InstanceProfileDiskQuantity struct +// Models which "extend" this model: +// - InstanceProfileDiskQuantityFixed +// - InstanceProfileDiskQuantityRange +// - InstanceProfileDiskQuantityEnum +// - InstanceProfileDiskQuantityDependent +type InstanceProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileDiskQuantity.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskQuantityTypeFixedConst = "fixed" +) + +func (*InstanceProfileDiskQuantity) isaInstanceProfileDiskQuantity() bool { + return true +} + +type InstanceProfileDiskQuantityIntf interface { + isaInstanceProfileDiskQuantity() bool +} + +// UnmarshalInstanceProfileDiskQuantity unmarshals an instance of InstanceProfileDiskQuantity from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileDiskSize : InstanceProfileDiskSize struct +// Models which "extend" this model: +// - InstanceProfileDiskSizeFixed +// - InstanceProfileDiskSizeRange +// - InstanceProfileDiskSizeEnum +// - InstanceProfileDiskSizeDependent +type InstanceProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileDiskSize.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskSizeTypeFixedConst = "fixed" +) + +func (*InstanceProfileDiskSize) isaInstanceProfileDiskSize() bool { + return true +} + +type InstanceProfileDiskSizeIntf interface { + isaInstanceProfileDiskSize() bool +} + +// UnmarshalInstanceProfileDiskSize unmarshals an instance of InstanceProfileDiskSize from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileDiskSupportedInterfaces : InstanceProfileDiskSupportedInterfaces struct +type InstanceProfileDiskSupportedInterfaces struct { + // The disk interface used for attaching the disk. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported disk interfaces used for attaching the disk. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Default property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" + InstanceProfileDiskSupportedInterfacesDefaultVirtioBlkConst = "virtio_blk" +) + +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskSupportedInterfacesTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Values property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" + InstanceProfileDiskSupportedInterfacesValuesVirtioBlkConst = "virtio_blk" +) + +// UnmarshalInstanceProfileDiskSupportedInterfaces unmarshals an instance of InstanceProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileGpu : InstanceProfileGpu struct +// Models which "extend" this model: +// - InstanceProfileGpuFixed +// - InstanceProfileGpuRange +// - InstanceProfileGpuEnum +// - InstanceProfileGpuDependent +type InstanceProfileGpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileGpu.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuTypeFixedConst = "fixed" +) + +func (*InstanceProfileGpu) isaInstanceProfileGpu() bool { + return true +} + +type InstanceProfileGpuIntf interface { + isaInstanceProfileGpu() bool +} + +// UnmarshalInstanceProfileGpu unmarshals an instance of InstanceProfileGpu from the specified map of raw messages. +func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileGpuManufacturer : InstanceProfileGpuManufacturer struct +type InstanceProfileGpuManufacturer struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The possible GPU manufacturer(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileGpuManufacturer.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuManufacturerTypeEnumConst = "enum" +) + +// UnmarshalInstanceProfileGpuManufacturer unmarshals an instance of InstanceProfileGpuManufacturer from the specified map of raw messages. +func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuManufacturer) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileGpuMemory : InstanceProfileGpuMemory struct +// Models which "extend" this model: +// - InstanceProfileGpuMemoryFixed +// - InstanceProfileGpuMemoryRange +// - InstanceProfileGpuMemoryEnum +// - InstanceProfileGpuMemoryDependent +type InstanceProfileGpuMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileGpuMemory.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuMemoryTypeFixedConst = "fixed" +) + +func (*InstanceProfileGpuMemory) isaInstanceProfileGpuMemory() bool { + return true +} + +type InstanceProfileGpuMemoryIntf interface { + isaInstanceProfileGpuMemory() bool +} + +// UnmarshalInstanceProfileGpuMemory unmarshals an instance of InstanceProfileGpuMemory from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileGpuModel : InstanceProfileGpuModel struct +type InstanceProfileGpuModel struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The possible GPU model(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileGpuModel.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuModelTypeEnumConst = "enum" +) + +// UnmarshalInstanceProfileGpuModel unmarshals an instance of InstanceProfileGpuModel from the specified map of raw messages. +func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuModel) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileIdentity : Identifies an instance profile by a unique property. +// Models which "extend" this model: +// - InstanceProfileIdentityByName +// - InstanceProfileIdentityByHref +type InstanceProfileIdentity struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` + + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` +} + +func (*InstanceProfileIdentity) isaInstanceProfileIdentity() bool { + return true +} + +type InstanceProfileIdentityIntf interface { + isaInstanceProfileIdentity() bool +} + +// UnmarshalInstanceProfileIdentity unmarshals an instance of InstanceProfileIdentity from the specified map of raw messages. +func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileMemory : InstanceProfileMemory struct +// Models which "extend" this model: +// - InstanceProfileMemoryFixed +// - InstanceProfileMemoryRange +// - InstanceProfileMemoryEnum +// - InstanceProfileMemoryDependent +type InstanceProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileMemory.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryTypeFixedConst = "fixed" +) + +func (*InstanceProfileMemory) isaInstanceProfileMemory() bool { + return true +} + +type InstanceProfileMemoryIntf interface { + isaInstanceProfileMemory() bool +} + +// UnmarshalInstanceProfileMemory unmarshals an instance of InstanceProfileMemory from the specified map of raw messages. +func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileNumaCount : InstanceProfileNumaCount struct +// Models which "extend" this model: +// - InstanceProfileNumaCountFixed +// - InstanceProfileNumaCountDependent +type InstanceProfileNumaCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfileNumaCount.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountTypeFixedConst = "fixed" +) + +func (*InstanceProfileNumaCount) isaInstanceProfileNumaCount() bool { + return true +} + +type InstanceProfileNumaCountIntf interface { + isaInstanceProfileNumaCount() bool +} + +// UnmarshalInstanceProfileNumaCount unmarshals an instance of InstanceProfileNumaCount from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileNetworkAttachmentCount : InstanceProfileNetworkAttachmentCount struct +// Models which "extend" this model: +// - InstanceProfileNetworkAttachmentCountRange +// - InstanceProfileNetworkAttachmentCountDependent +type InstanceProfileNetworkAttachmentCount struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` +} + +// Constants associated with the InstanceProfileNetworkAttachmentCount.Type property. +// The type for this profile field. +const ( + InstanceProfileNetworkAttachmentCountTypeRangeConst = "range" +) + +func (*InstanceProfileNetworkAttachmentCount) isaInstanceProfileNetworkAttachmentCount() bool { + return true +} + +type InstanceProfileNetworkAttachmentCountIntf interface { + isaInstanceProfileNetworkAttachmentCount() bool +} + +// UnmarshalInstanceProfileNetworkAttachmentCount unmarshals an instance of InstanceProfileNetworkAttachmentCount from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkAttachmentCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkAttachmentCount) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileNetworkInterfaceCount : InstanceProfileNetworkInterfaceCount struct +// Models which "extend" this model: +// - InstanceProfileNetworkInterfaceCountRange +// - InstanceProfileNetworkInterfaceCountDependent +type InstanceProfileNetworkInterfaceCount struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` +} + +// Constants associated with the InstanceProfileNetworkInterfaceCount.Type property. +// The type for this profile field. +const ( + InstanceProfileNetworkInterfaceCountTypeRangeConst = "range" +) + +func (*InstanceProfileNetworkInterfaceCount) isaInstanceProfileNetworkInterfaceCount() bool { + return true +} + +type InstanceProfileNetworkInterfaceCountIntf interface { + isaInstanceProfileNetworkInterfaceCount() bool +} + +// UnmarshalInstanceProfileNetworkInterfaceCount unmarshals an instance of InstanceProfileNetworkInterfaceCount from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkInterfaceCount) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileOsArchitecture : InstanceProfileOsArchitecture struct +type InstanceProfileOsArchitecture struct { + // The default OS architecture for an instance with this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported OS architecture(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileOsArchitecture.Type property. +// The type for this profile field. +const ( + InstanceProfileOsArchitectureTypeEnumConst = "enum" +) + +// UnmarshalInstanceProfileOsArchitecture unmarshals an instance of InstanceProfileOsArchitecture from the specified map of raw messages. +func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileOsArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfilePortSpeed : InstanceProfilePortSpeed struct +// Models which "extend" this model: +// - InstanceProfilePortSpeedFixed +// - InstanceProfilePortSpeedDependent +type InstanceProfilePortSpeed struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfilePortSpeed.Type property. +// The type for this profile field. +const ( + InstanceProfilePortSpeedTypeFixedConst = "fixed" +) + +func (*InstanceProfilePortSpeed) isaInstanceProfilePortSpeed() bool { + return true +} + +type InstanceProfilePortSpeedIntf interface { + isaInstanceProfilePortSpeed() bool +} + +// UnmarshalInstanceProfilePortSpeed unmarshals an instance of InstanceProfilePortSpeed from the specified map of raw messages. +func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfilePortSpeed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileReference : InstanceProfileReference struct +type InstanceProfileReference struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the InstanceProfileReference.ResourceType property. +// The resource type. +const ( + InstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" +) + +// UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. +func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileReservationTerms : InstanceProfileReservationTerms struct +type InstanceProfileReservationTerms struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported committed use terms for a reservation using this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileReservationTerms.Type property. +// The type for this profile field. +const ( + InstanceProfileReservationTermsTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileReservationTerms.Values property. +const ( + InstanceProfileReservationTermsValuesOneYearConst = "one_year" + InstanceProfileReservationTermsValuesThreeYearConst = "three_year" +) + +// UnmarshalInstanceProfileReservationTerms unmarshals an instance of InstanceProfileReservationTerms from the specified map of raw messages. +func UnmarshalInstanceProfileReservationTerms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileReservationTerms) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVcpu : InstanceProfileVcpu struct +// Models which "extend" this model: +// - InstanceProfileVcpuFixed +// - InstanceProfileVcpuRange +// - InstanceProfileVcpuEnum +// - InstanceProfileVcpuDependent +type InstanceProfileVcpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileVcpu.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuTypeFixedConst = "fixed" +) + +func (*InstanceProfileVcpu) isaInstanceProfileVcpu() bool { + return true +} + +type InstanceProfileVcpuIntf interface { + isaInstanceProfileVcpu() bool +} + +// UnmarshalInstanceProfileVcpu unmarshals an instance of InstanceProfileVcpu from the specified map of raw messages. +func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVcpuArchitecture : InstanceProfileVcpuArchitecture struct +type InstanceProfileVcpuArchitecture struct { + // The default VCPU architecture for an instance with this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The VCPU architecture for an instance with this profile. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileVcpuArchitecture.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuArchitectureTypeFixedConst = "fixed" +) + +// UnmarshalInstanceProfileVcpuArchitecture unmarshals an instance of InstanceProfileVcpuArchitecture from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVcpuManufacturer : InstanceProfileVcpuManufacturer struct +type InstanceProfileVcpuManufacturer struct { + // The default VCPU manufacturer for an instance with this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The VCPU manufacturer for an instance with this profile. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileVcpuManufacturer.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuManufacturerTypeFixedConst = "fixed" +) + +// UnmarshalInstanceProfileVcpuManufacturer unmarshals an instance of InstanceProfileVcpuManufacturer from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuManufacturer) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct +// Models which "extend" this model: +// - InstanceProfileVolumeBandwidthFixed +// - InstanceProfileVolumeBandwidthRange +// - InstanceProfileVolumeBandwidthEnum +// - InstanceProfileVolumeBandwidthDependent +type InstanceProfileVolumeBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileVolumeBandwidth.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthTypeFixedConst = "fixed" +) + +func (*InstanceProfileVolumeBandwidth) isaInstanceProfileVolumeBandwidth() bool { + return true +} + +type InstanceProfileVolumeBandwidthIntf interface { + isaInstanceProfileVolumeBandwidth() bool +} + +// UnmarshalInstanceProfileVolumeBandwidth unmarshals an instance of InstanceProfileVolumeBandwidth from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePrototype : InstancePrototype struct +// Models which "extend" this model: +// - InstancePrototypeInstanceByImage +// - InstancePrototypeInstanceByCatalogOffering +// - InstancePrototypeInstanceByVolume +// - InstancePrototypeInstanceBySourceSnapshot +// - InstancePrototypeInstanceBySourceTemplate +type InstancePrototype struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + // The metadata service configuration. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change + // in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network + // attachments or instance network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` +} + +func (*InstancePrototype) isaInstancePrototype() bool { + return true +} + +type InstancePrototypeIntf interface { + isaInstancePrototype() bool +} + +// UnmarshalInstancePrototype unmarshals an instance of InstancePrototype from the specified map of raw messages. +func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototype) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReference : InstanceReference struct +type InstanceReference struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` + + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. +func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinity : InstanceReservationAffinity struct +type InstanceReservationAffinity struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` are available for use. + Policy *string `json:"policy" validate:"required"` + + // The pool of reservations available for use by this virtual server instance. + Pool []ReservationReference `json:"pool" validate:"required"` +} + +// Constants associated with the InstanceReservationAffinity.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` are available for use. +const ( + InstanceReservationAffinityPolicyDisabledConst = "disabled" + InstanceReservationAffinityPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinity unmarshals an instance of InstanceReservationAffinity from the specified map of raw messages. +func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinity) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPatch : InstanceReservationAffinityPatch struct +type InstanceReservationAffinityPatch struct { + // The reservation affinity policy for this virtual server instance. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance, replacing the existing pool of + // reservations. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is + // `manual`. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPatch.Policy property. +// The reservation affinity policy for this virtual server instance. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" + InstanceReservationAffinityPatchPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPatch unmarshals an instance of InstanceReservationAffinityPatch from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPatch) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPrototype : InstanceReservationAffinityPrototype struct +type InstanceReservationAffinityPrototype struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` will be available for use + // + // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is + // `manual`. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPrototype.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` will be available for use +// +// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. +const ( + InstanceReservationAffinityPrototypePolicyDisabledConst = "disabled" + InstanceReservationAffinityPrototypePolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPrototype unmarshals an instance of InstanceReservationAffinityPrototype from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceStatusReason : InstanceStatusReason struct +type InstanceStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + InstanceStatusReasonCodeCannotStartConst = "cannot_start" + InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" + InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" + InstanceStatusReasonCodeCannotStartReservationCapacityConst = "cannot_start_reservation_capacity" + InstanceStatusReasonCodeCannotStartReservationExpiredConst = "cannot_start_reservation_expired" + InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" + InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" + InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" +) + +// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. +func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplate : InstanceTemplate struct +// Models which "extend" this model: +// - InstanceTemplateInstanceByImageInstanceTemplateContext +// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext +// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext +type InstanceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + // The metadata service configuration. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` + + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change + // in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network + // attachments or instance network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` +} + +func (*InstanceTemplate) isaInstanceTemplate() bool { + return true +} + +type InstanceTemplateIntf interface { + isaInstanceTemplate() bool +} + +// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. +func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateCollection : InstanceTemplateCollection struct +type InstanceTemplateCollection struct { + // A link to the first page of resources. + First *InstanceTemplateCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceTemplateCollectionNext `json:"next,omitempty"` + + // Collection of instance templates. + Templates []InstanceTemplateIntf `json:"templates" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalInstanceTemplateCollection unmarshals an instance of InstanceTemplateCollection from the specified map of raw messages. +func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceTemplateCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceTemplateCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalInstanceTemplate) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateCollectionFirst : A link to the first page of resources. +type InstanceTemplateCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceTemplateCollectionFirst unmarshals an instance of InstanceTemplateCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceTemplateCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceTemplateCollectionNext unmarshals an instance of InstanceTemplateCollectionNext from the specified map of raw messages. +func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateIdentity : Identifies an instance template by a unique property. +// Models which "extend" this model: +// - InstanceTemplateIdentityByID +// - InstanceTemplateIdentityByHref +// - InstanceTemplateIdentityByCRN +type InstanceTemplateIdentity struct { + // The unique identifier for this instance template. + ID *string `json:"id,omitempty"` + + // The URL for this instance template. + Href *string `json:"href,omitempty"` + + // The CRN for this instance template. + CRN *string `json:"crn,omitempty"` +} + +func (*InstanceTemplateIdentity) isaInstanceTemplateIdentity() bool { + return true +} + +type InstanceTemplateIdentityIntf interface { + isaInstanceTemplateIdentity() bool +} + +// UnmarshalInstanceTemplateIdentity unmarshals an instance of InstanceTemplateIdentity from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplatePatch : InstanceTemplatePatch struct +type InstanceTemplatePatch struct { + // The name for this instance template. The name must not be used by another instance template in the region. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceTemplatePatch unmarshals an instance of InstanceTemplatePatch from the specified map of raw messages. +func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceTemplatePatch +func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceTemplatePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// InstanceTemplatePrototype : InstanceTemplatePrototype struct +// Models which "extend" this model: +// - InstanceTemplatePrototypeInstanceTemplateByImage +// - InstanceTemplatePrototypeInstanceTemplateBySourceTemplate +// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot +// - InstanceTemplatePrototypeInstanceTemplateByCatalogOffering +type InstanceTemplatePrototype struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + // The metadata service configuration. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change + // in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network + // attachments or instance network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering version to use when provisioning this virtual server instance. + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account, subject to + // IAM policies. + // + // If specified, `image` must not be specified, and `source_template` must not have + // `image` specified. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` +} + +func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { + return true +} + +type InstanceTemplatePrototypeIntf interface { + isaInstanceTemplatePrototype() bool +} + +// UnmarshalInstanceTemplatePrototype unmarshals an instance of InstanceTemplatePrototype from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototype) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateReference : InstanceTemplateReference struct +type InstanceTemplateReference struct { + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceTemplateReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance template. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` + + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceTemplateReference unmarshals an instance of InstanceTemplateReference from the specified map of raw messages. +func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceTemplateReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceTemplateReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type InstanceTemplateReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalInstanceTemplateReferenceDeleted unmarshals an instance of InstanceTemplateReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceVcpu : The virtual server instance VCPU configuration. +type InstanceVcpu struct { + // The VCPU architecture. + Architecture *string `json:"architecture" validate:"required"` + + // The number of VCPUs assigned. + Count *int64 `json:"count" validate:"required"` + + // The VCPU manufacturer. + Manufacturer *string `json:"manufacturer" validate:"required"` +} + +// UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. +func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceVcpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Key : Key struct +type Key struct { + // The date and time that the key was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this key. + CRN *string `json:"crn" validate:"required"` + + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint" validate:"required"` + + // The URL for this key. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this key. + ID *string `json:"id" validate:"required"` + + // The length of this key (in bits). + Length *int64 `json:"length" validate:"required"` + + // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a + // hyphenated list of randomly-selected words. + Name *string `json:"name" validate:"required"` + + // The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. + PublicKey *string `json:"public_key" validate:"required"` + + // The resource group for this key. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The crypto-system used by this key. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the Key.Type property. +// The crypto-system used by this key. +const ( + KeyTypeEd25519Const = "ed25519" + KeyTypeRsaConst = "rsa" +) + +// UnmarshalKey unmarshals an instance of Key from the specified map of raw messages. +func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Key) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "length", &obj.Length) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "public_key", &obj.PublicKey) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyCollection : KeyCollection struct +type KeyCollection struct { + // A link to the first page of resources. + First *KeyCollectionFirst `json:"first" validate:"required"` + + // Collection of keys. + Keys []Key `json:"keys" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *KeyCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalKeyCollection unmarshals an instance of KeyCollection from the specified map of raw messages. +func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalKeyCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKey) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalKeyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *KeyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// KeyCollectionFirst : A link to the first page of resources. +type KeyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalKeyCollectionFirst unmarshals an instance of KeyCollectionFirst from the specified map of raw messages. +func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type KeyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalKeyCollectionNext unmarshals an instance of KeyCollectionNext from the specified map of raw messages. +func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyIdentity : Identifies a key by a unique property. +// Models which "extend" this model: +// - KeyIdentityByID +// - KeyIdentityByCRN +// - KeyIdentityByHref +// - KeyIdentityByFingerprint +type KeyIdentity struct { + // The unique identifier for this key. + ID *string `json:"id,omitempty"` + + // The CRN for this key. + CRN *string `json:"crn,omitempty"` + + // The URL for this key. + Href *string `json:"href,omitempty"` + + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint,omitempty"` +} + +func (*KeyIdentity) isaKeyIdentity() bool { + return true +} + +type KeyIdentityIntf interface { + isaKeyIdentity() bool +} + +// UnmarshalKeyIdentity unmarshals an instance of KeyIdentity from the specified map of raw messages. +func UnmarshalKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyPatch : KeyPatch struct +type KeyPatch struct { + // The name for this key. The name must not be used by another key in the region. + Name *string `json:"name,omitempty"` +} + +// UnmarshalKeyPatch unmarshals an instance of KeyPatch from the specified map of raw messages. +func UnmarshalKeyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the KeyPatch +func (keyPatch *KeyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(keyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// KeyReference : KeyReference struct +type KeyReference struct { + // The CRN for this key. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *KeyReferenceDeleted `json:"deleted,omitempty"` + + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint" validate:"required"` + + // The URL for this key. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this key. + ID *string `json:"id" validate:"required"` + + // The name for this key. The name is unique across all keys in the region. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalKeyReference unmarshals an instance of KeyReference from the specified map of raw messages. +func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalKeyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type KeyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalKeyReferenceDeleted unmarshals an instance of KeyReferenceDeleted from the specified map of raw messages. +func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LegacyCloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. +// Models which "extend" this model: +// - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName +type LegacyCloudObjectStorageBucketIdentity struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name,omitempty"` +} + +func (*LegacyCloudObjectStorageBucketIdentity) isaLegacyCloudObjectStorageBucketIdentity() bool { + return true +} + +type LegacyCloudObjectStorageBucketIdentityIntf interface { + isaLegacyCloudObjectStorageBucketIdentity() bool +} + +// UnmarshalLegacyCloudObjectStorageBucketIdentity unmarshals an instance of LegacyCloudObjectStorageBucketIdentity from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LegacyCloudObjectStorageBucketReference : LegacyCloudObjectStorageBucketReference struct +type LegacyCloudObjectStorageBucketReference struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalLegacyCloudObjectStorageBucketReference unmarshals an instance of LegacyCloudObjectStorageBucketReference from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListBackupPoliciesOptions : The ListBackupPolicies options. +type ListBackupPoliciesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. + Tag *string `json:"tag,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBackupPoliciesOptions : Instantiate ListBackupPoliciesOptions +func (*VpcV1) NewListBackupPoliciesOptions() *ListBackupPoliciesOptions { + return &ListBackupPoliciesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListBackupPoliciesOptions) SetStart(start string) *ListBackupPoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBackupPoliciesOptions) SetLimit(limit int64) *ListBackupPoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListBackupPoliciesOptions) SetResourceGroupID(resourceGroupID string) *ListBackupPoliciesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListBackupPoliciesOptions) SetName(name string) *ListBackupPoliciesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetTag : Allow user to set Tag +func (_options *ListBackupPoliciesOptions) SetTag(tag string) *ListBackupPoliciesOptions { + _options.Tag = core.StringPtr(tag) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBackupPoliciesOptions) SetHeaders(param map[string]string) *ListBackupPoliciesOptions { + options.Headers = param + return options +} + +// ListBackupPolicyJobsOptions : The ListBackupPolicyJobs options. +type ListBackupPolicyJobsOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + + // Filters the collection to backup policy jobs with a `status` property matching the specified value. + Status *string `json:"status,omitempty"` + + // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified + // identifier. + BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Filters the collection to backup policy jobs with a `source.id` property matching the specified identifier. + SourceID *string `json:"source.id,omitempty"` + + // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with an `id` property + // matching the specified identifier. + TargetSnapshotsID *string `json:"target_snapshots[].id,omitempty"` + + // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with a `crn` property + // matching the specified CRN. + TargetSnapshotsCRN *string `json:"target_snapshots[].crn,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListBackupPolicyJobsOptions.Status property. +// Filters the collection to backup policy jobs with a `status` property matching the specified value. +const ( + ListBackupPolicyJobsOptionsStatusFailedConst = "failed" + ListBackupPolicyJobsOptionsStatusRunningConst = "running" + ListBackupPolicyJobsOptionsStatusSucceededConst = "succeeded" +) + +// Constants associated with the ListBackupPolicyJobsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListBackupPolicyJobsOptionsSortCreatedAtConst = "created_at" + ListBackupPolicyJobsOptionsSortNameConst = "name" +) + +// NewListBackupPolicyJobsOptions : Instantiate ListBackupPolicyJobsOptions +func (*VpcV1) NewListBackupPolicyJobsOptions(backupPolicyID string) *ListBackupPolicyJobsOptions { + return &ListBackupPolicyJobsOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + } +} + +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyJobsOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) + return _options +} + +// SetStatus : Allow user to set Status +func (_options *ListBackupPolicyJobsOptions) SetStatus(status string) *ListBackupPolicyJobsOptions { + _options.Status = core.StringPtr(status) + return _options +} + +// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID +func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListBackupPolicyJobsOptions { + _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListBackupPolicyJobsOptions) SetStart(start string) *ListBackupPolicyJobsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBackupPolicyJobsOptions) SetLimit(limit int64) *ListBackupPolicyJobsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListBackupPolicyJobsOptions) SetSort(sort string) *ListBackupPolicyJobsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetSourceID : Allow user to set SourceID +func (_options *ListBackupPolicyJobsOptions) SetSourceID(sourceID string) *ListBackupPolicyJobsOptions { + _options.SourceID = core.StringPtr(sourceID) + return _options +} + +// SetTargetSnapshotsID : Allow user to set TargetSnapshotsID +func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsID(targetSnapshotsID string) *ListBackupPolicyJobsOptions { + _options.TargetSnapshotsID = core.StringPtr(targetSnapshotsID) + return _options +} + +// SetTargetSnapshotsCRN : Allow user to set TargetSnapshotsCRN +func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsCRN(targetSnapshotsCRN string) *ListBackupPolicyJobsOptions { + _options.TargetSnapshotsCRN = core.StringPtr(targetSnapshotsCRN) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBackupPolicyJobsOptions) SetHeaders(param map[string]string) *ListBackupPolicyJobsOptions { + options.Headers = param + return options +} + +// ListBackupPolicyPlansOptions : The ListBackupPolicyPlans options. +type ListBackupPolicyPlansOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBackupPolicyPlansOptions : Instantiate ListBackupPolicyPlansOptions +func (*VpcV1) NewListBackupPolicyPlansOptions(backupPolicyID string) *ListBackupPolicyPlansOptions { + return &ListBackupPolicyPlansOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + } +} + +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *ListBackupPolicyPlansOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyPlansOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListBackupPolicyPlansOptions) SetName(name string) *ListBackupPolicyPlansOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBackupPolicyPlansOptions) SetHeaders(param map[string]string) *ListBackupPolicyPlansOptions { + options.Headers = param + return options +} + +// ListBareMetalServerDisksOptions : The ListBareMetalServerDisks options. +type ListBareMetalServerDisksOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerDisksOptions : Instantiate ListBareMetalServerDisksOptions +func (*VpcV1) NewListBareMetalServerDisksOptions(bareMetalServerID string) *ListBareMetalServerDisksOptions { + return &ListBareMetalServerDisksOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerDisksOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerDisksOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerDisksOptions) SetHeaders(param map[string]string) *ListBareMetalServerDisksOptions { + options.Headers = param + return options +} + +// ListBareMetalServerNetworkAttachmentsOptions : The ListBareMetalServerNetworkAttachments options. +type ListBareMetalServerNetworkAttachmentsOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerNetworkAttachmentsOptions : Instantiate ListBareMetalServerNetworkAttachmentsOptions +func (*VpcV1) NewListBareMetalServerNetworkAttachmentsOptions(bareMetalServerID string) *ListBareMetalServerNetworkAttachmentsOptions { + return &ListBareMetalServerNetworkAttachmentsOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkAttachmentsOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetStart(start string) *ListBareMetalServerNetworkAttachmentsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetLimit(limit int64) *ListBareMetalServerNetworkAttachmentsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkAttachmentsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkAttachmentsOptions { + options.Headers = param + return options +} + +// ListBareMetalServerNetworkInterfaceFloatingIpsOptions : The ListBareMetalServerNetworkInterfaceFloatingIps options. +type ListBareMetalServerNetworkInterfaceFloatingIpsOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerNetworkInterfaceFloatingIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceFloatingIpsOptions +func (*VpcV1) NewListBareMetalServerNetworkInterfaceFloatingIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + return &ListBareMetalServerNetworkInterfaceFloatingIpsOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + options.Headers = param + return options +} + +// ListBareMetalServerNetworkInterfaceIpsOptions : The ListBareMetalServerNetworkInterfaceIps options. +type ListBareMetalServerNetworkInterfaceIpsOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerNetworkInterfaceIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceIpsOptions +func (*VpcV1) NewListBareMetalServerNetworkInterfaceIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { + return &ListBareMetalServerNetworkInterfaceIpsOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceIpsOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceIpsOptions { + options.Headers = param + return options +} + +// ListBareMetalServerNetworkInterfacesOptions : The ListBareMetalServerNetworkInterfaces options. +type ListBareMetalServerNetworkInterfacesOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerNetworkInterfacesOptions : Instantiate ListBareMetalServerNetworkInterfacesOptions +func (*VpcV1) NewListBareMetalServerNetworkInterfacesOptions(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { + return &ListBareMetalServerNetworkInterfacesOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetStart(start string) *ListBareMetalServerNetworkInterfacesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetLimit(limit int64) *ListBareMetalServerNetworkInterfacesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfacesOptions { + options.Headers = param + return options +} + +// ListBareMetalServerProfilesOptions : The ListBareMetalServerProfiles options. +type ListBareMetalServerProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServerProfilesOptions : Instantiate ListBareMetalServerProfilesOptions +func (*VpcV1) NewListBareMetalServerProfilesOptions() *ListBareMetalServerProfilesOptions { + return &ListBareMetalServerProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListBareMetalServerProfilesOptions) SetStart(start string) *ListBareMetalServerProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServerProfilesOptions) SetLimit(limit int64) *ListBareMetalServerProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerProfilesOptions) SetHeaders(param map[string]string) *ListBareMetalServerProfilesOptions { + options.Headers = param + return options +} + +// ListBareMetalServersOptions : The ListBareMetalServers options. +type ListBareMetalServersOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListBareMetalServersOptions : Instantiate ListBareMetalServersOptions +func (*VpcV1) NewListBareMetalServersOptions() *ListBareMetalServersOptions { + return &ListBareMetalServersOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListBareMetalServersOptions) SetStart(start string) *ListBareMetalServersOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServersOptions) SetLimit(limit int64) *ListBareMetalServersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListBareMetalServersOptions) SetResourceGroupID(resourceGroupID string) *ListBareMetalServersOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListBareMetalServersOptions) SetName(name string) *ListBareMetalServersOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListBareMetalServersOptions) SetVPCID(vpcID string) *ListBareMetalServersOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListBareMetalServersOptions) SetVPCCRN(vpcCRN string) *ListBareMetalServersOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListBareMetalServersOptions) SetVPCName(vpcName string) *ListBareMetalServersOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServersOptions) SetHeaders(param map[string]string) *ListBareMetalServersOptions { + options.Headers = param + return options +} + +// ListDedicatedHostDisksOptions : The ListDedicatedHostDisks options. +type ListDedicatedHostDisksOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostDisksOptions : Instantiate ListDedicatedHostDisksOptions +func (*VpcV1) NewListDedicatedHostDisksOptions(dedicatedHostID string) *ListDedicatedHostDisksOptions { + return &ListDedicatedHostDisksOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + } +} + +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *ListDedicatedHostDisksOptions) SetDedicatedHostID(dedicatedHostID string) *ListDedicatedHostDisksOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostDisksOptions) SetHeaders(param map[string]string) *ListDedicatedHostDisksOptions { + options.Headers = param + return options +} + +// ListDedicatedHostGroupsOptions : The ListDedicatedHostGroups options. +type ListDedicatedHostGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostGroupsOptions : Instantiate ListDedicatedHostGroupsOptions +func (*VpcV1) NewListDedicatedHostGroupsOptions() *ListDedicatedHostGroupsOptions { + return &ListDedicatedHostGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostGroupsOptions) SetStart(start string) *ListDedicatedHostGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostGroupsOptions) SetLimit(limit int64) *ListDedicatedHostGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListDedicatedHostGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostGroupsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListDedicatedHostGroupsOptions) SetZoneName(zoneName string) *ListDedicatedHostGroupsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListDedicatedHostGroupsOptions) SetName(name string) *ListDedicatedHostGroupsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostGroupsOptions) SetHeaders(param map[string]string) *ListDedicatedHostGroupsOptions { + options.Headers = param + return options +} + +// ListDedicatedHostProfilesOptions : The ListDedicatedHostProfiles options. +type ListDedicatedHostProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostProfilesOptions : Instantiate ListDedicatedHostProfilesOptions +func (*VpcV1) NewListDedicatedHostProfilesOptions() *ListDedicatedHostProfilesOptions { + return &ListDedicatedHostProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostProfilesOptions) SetStart(start string) *ListDedicatedHostProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostProfilesOptions) SetLimit(limit int64) *ListDedicatedHostProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostProfilesOptions) SetHeaders(param map[string]string) *ListDedicatedHostProfilesOptions { + options.Headers = param + return options +} + +// ListDedicatedHostsOptions : The ListDedicatedHosts options. +type ListDedicatedHostsOptions struct { + // Filters the collection to dedicated hosts with a `group.id` property matching the specified identifier. + DedicatedHostGroupID *string `json:"dedicated_host_group.id,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostsOptions : Instantiate ListDedicatedHostsOptions +func (*VpcV1) NewListDedicatedHostsOptions() *ListDedicatedHostsOptions { + return &ListDedicatedHostsOptions{} +} + +// SetDedicatedHostGroupID : Allow user to set DedicatedHostGroupID +func (_options *ListDedicatedHostsOptions) SetDedicatedHostGroupID(dedicatedHostGroupID string) *ListDedicatedHostsOptions { + _options.DedicatedHostGroupID = core.StringPtr(dedicatedHostGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostsOptions) SetStart(start string) *ListDedicatedHostsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostsOptions) SetLimit(limit int64) *ListDedicatedHostsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListDedicatedHostsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListDedicatedHostsOptions) SetZoneName(zoneName string) *ListDedicatedHostsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListDedicatedHostsOptions) SetName(name string) *ListDedicatedHostsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostsOptions) SetHeaders(param map[string]string) *ListDedicatedHostsOptions { + options.Headers = param + return options +} + +// ListEndpointGatewayIpsOptions : The ListEndpointGatewayIps options. +type ListEndpointGatewayIpsOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListEndpointGatewayIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListEndpointGatewayIpsOptionsSortAddressConst = "address" + ListEndpointGatewayIpsOptionsSortCreatedAtConst = "created_at" + ListEndpointGatewayIpsOptionsSortNameConst = "name" +) + +// NewListEndpointGatewayIpsOptions : Instantiate ListEndpointGatewayIpsOptions +func (*VpcV1) NewListEndpointGatewayIpsOptions(endpointGatewayID string) *ListEndpointGatewayIpsOptions { + return &ListEndpointGatewayIpsOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *ListEndpointGatewayIpsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayIpsOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewayIpsOptions) SetStart(start string) *ListEndpointGatewayIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewayIpsOptions) SetLimit(limit int64) *ListEndpointGatewayIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListEndpointGatewayIpsOptions) SetSort(sort string) *ListEndpointGatewayIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayIpsOptions { + options.Headers = param + return options +} + +// ListEndpointGatewaysOptions : The ListEndpointGateways options. +type ListEndpointGatewaysOptions struct { + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to endpoint gateways with an `allow_dns_resolution_binding` property matching the specified + // value. + AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions +func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { + return &ListEndpointGatewaysOptions{} +} + +// SetName : Allow user to set Name +func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewaysOptions) SetStart(start string) *ListEndpointGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewaysOptions) SetLimit(limit int64) *ListEndpointGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListEndpointGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListEndpointGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListEndpointGatewaysOptions) SetVPCID(vpcID string) *ListEndpointGatewaysOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListEndpointGatewaysOptions) SetVPCCRN(vpcCRN string) *ListEndpointGatewaysOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListEndpointGatewaysOptions) SetVPCName(vpcName string) *ListEndpointGatewaysOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding +func (_options *ListEndpointGatewaysOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *ListEndpointGatewaysOptions { + _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewaysOptions) SetHeaders(param map[string]string) *ListEndpointGatewaysOptions { + options.Headers = param + return options +} + +// ListFloatingIpsOptions : The ListFloatingIps options. +type ListFloatingIpsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Filters the collection to resources with a `target.id` property matching the specified identifier. + TargetID *string `json:"target.id,omitempty"` + + // Filters the collection to resources with a `target.crn` property matching the specified CRN. + TargetCRN *string `json:"target.crn,omitempty"` + + // Filters the collection to resources with a `target.name` property matching the exact specified name. + TargetName *string `json:"target.name,omitempty"` + + // Filters the collection to resources with a `target.resource_type` property matching the specified value. + TargetResourceType *string `json:"target.resource_type,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListFloatingIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListFloatingIpsOptionsSortCreatedAtConst = "created_at" + ListFloatingIpsOptionsSortNameConst = "name" +) + +// NewListFloatingIpsOptions : Instantiate ListFloatingIpsOptions +func (*VpcV1) NewListFloatingIpsOptions() *ListFloatingIpsOptions { + return &ListFloatingIpsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListFloatingIpsOptions) SetStart(start string) *ListFloatingIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListFloatingIpsOptions) SetLimit(limit int64) *ListFloatingIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListFloatingIpsOptions) SetResourceGroupID(resourceGroupID string) *ListFloatingIpsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListFloatingIpsOptions) SetSort(sort string) *ListFloatingIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetTargetID : Allow user to set TargetID +func (_options *ListFloatingIpsOptions) SetTargetID(targetID string) *ListFloatingIpsOptions { + _options.TargetID = core.StringPtr(targetID) + return _options +} + +// SetTargetCRN : Allow user to set TargetCRN +func (_options *ListFloatingIpsOptions) SetTargetCRN(targetCRN string) *ListFloatingIpsOptions { + _options.TargetCRN = core.StringPtr(targetCRN) + return _options +} + +// SetTargetName : Allow user to set TargetName +func (_options *ListFloatingIpsOptions) SetTargetName(targetName string) *ListFloatingIpsOptions { + _options.TargetName = core.StringPtr(targetName) + return _options +} + +// SetTargetResourceType : Allow user to set TargetResourceType +func (_options *ListFloatingIpsOptions) SetTargetResourceType(targetResourceType string) *ListFloatingIpsOptions { + _options.TargetResourceType = core.StringPtr(targetResourceType) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListFloatingIpsOptions) SetHeaders(param map[string]string) *ListFloatingIpsOptions { + options.Headers = param + return options +} + +// ListFlowLogCollectorsOptions : The ListFlowLogCollectors options. +type ListFlowLogCollectorsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to resources with a `target.id` property matching the specified identifier. + TargetID *string `json:"target.id,omitempty"` + + // Filters the collection to resources with a `target.resource_type` property matching the specified value. + TargetResourceType *string `json:"target.resource_type,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListFlowLogCollectorsOptions : Instantiate ListFlowLogCollectorsOptions +func (*VpcV1) NewListFlowLogCollectorsOptions() *ListFlowLogCollectorsOptions { + return &ListFlowLogCollectorsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListFlowLogCollectorsOptions) SetStart(start string) *ListFlowLogCollectorsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListFlowLogCollectorsOptions) SetLimit(limit int64) *ListFlowLogCollectorsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListFlowLogCollectorsOptions) SetResourceGroupID(resourceGroupID string) *ListFlowLogCollectorsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListFlowLogCollectorsOptions) SetName(name string) *ListFlowLogCollectorsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListFlowLogCollectorsOptions) SetVPCID(vpcID string) *ListFlowLogCollectorsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListFlowLogCollectorsOptions) SetVPCCRN(vpcCRN string) *ListFlowLogCollectorsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListFlowLogCollectorsOptions) SetVPCName(vpcName string) *ListFlowLogCollectorsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetTargetID : Allow user to set TargetID +func (_options *ListFlowLogCollectorsOptions) SetTargetID(targetID string) *ListFlowLogCollectorsOptions { + _options.TargetID = core.StringPtr(targetID) + return _options +} + +// SetTargetResourceType : Allow user to set TargetResourceType +func (_options *ListFlowLogCollectorsOptions) SetTargetResourceType(targetResourceType string) *ListFlowLogCollectorsOptions { + _options.TargetResourceType = core.StringPtr(targetResourceType) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListFlowLogCollectorsOptions) SetHeaders(param map[string]string) *ListFlowLogCollectorsOptions { + options.Headers = param + return options +} + +// ListIkePoliciesOptions : The ListIkePolicies options. +type ListIkePoliciesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIkePoliciesOptions : Instantiate ListIkePoliciesOptions +func (*VpcV1) NewListIkePoliciesOptions() *ListIkePoliciesOptions { + return &ListIkePoliciesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListIkePoliciesOptions) SetStart(start string) *ListIkePoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListIkePoliciesOptions) SetLimit(limit int64) *ListIkePoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIkePoliciesOptions) SetHeaders(param map[string]string) *ListIkePoliciesOptions { + options.Headers = param + return options +} + +// ListIkePolicyConnectionsOptions : The ListIkePolicyConnections options. +type ListIkePolicyConnectionsOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIkePolicyConnectionsOptions : Instantiate ListIkePolicyConnectionsOptions +func (*VpcV1) NewListIkePolicyConnectionsOptions(id string) *ListIkePolicyConnectionsOptions { + return &ListIkePolicyConnectionsOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ListIkePolicyConnectionsOptions) SetID(id string) *ListIkePolicyConnectionsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIkePolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIkePolicyConnectionsOptions { + options.Headers = param + return options +} + +// ListImageExportJobsOptions : The ListImageExportJobs options. +type ListImageExportJobsOptions struct { + // The image identifier. + ImageID *string `json:"image_id" validate:"required,ne="` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListImageExportJobsOptions : Instantiate ListImageExportJobsOptions +func (*VpcV1) NewListImageExportJobsOptions(imageID string) *ListImageExportJobsOptions { + return &ListImageExportJobsOptions{ + ImageID: core.StringPtr(imageID), + } +} + +// SetImageID : Allow user to set ImageID +func (_options *ListImageExportJobsOptions) SetImageID(imageID string) *ListImageExportJobsOptions { + _options.ImageID = core.StringPtr(imageID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListImageExportJobsOptions) SetName(name string) *ListImageExportJobsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListImageExportJobsOptions) SetHeaders(param map[string]string) *ListImageExportJobsOptions { + options.Headers = param + return options +} + +// ListImagesOptions : The ListImages options. +type ListImagesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to images with a `status` property matching one of the specified comma-separated values. + Status []string `json:"status,omitempty"` + + // Filters the collection to images with a `visibility` property matching the specified value. + Visibility *string `json:"visibility,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListImagesOptions.Status property. +const ( + ListImagesOptionsStatusAvailableConst = "available" + ListImagesOptionsStatusDeletingConst = "deleting" + ListImagesOptionsStatusDeprecatedConst = "deprecated" + ListImagesOptionsStatusFailedConst = "failed" + ListImagesOptionsStatusObsoleteConst = "obsolete" + ListImagesOptionsStatusPendingConst = "pending" + ListImagesOptionsStatusUnusableConst = "unusable" +) + +// Constants associated with the ListImagesOptions.Visibility property. +// Filters the collection to images with a `visibility` property matching the specified value. +const ( + ListImagesOptionsVisibilityPrivateConst = "private" + ListImagesOptionsVisibilityPublicConst = "public" +) + +// NewListImagesOptions : Instantiate ListImagesOptions +func (*VpcV1) NewListImagesOptions() *ListImagesOptions { + return &ListImagesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListImagesOptions) SetStart(start string) *ListImagesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListImagesOptions) SetLimit(limit int64) *ListImagesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListImagesOptions) SetResourceGroupID(resourceGroupID string) *ListImagesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListImagesOptions) SetName(name string) *ListImagesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetStatus : Allow user to set Status +func (_options *ListImagesOptions) SetStatus(status []string) *ListImagesOptions { + _options.Status = status + return _options +} + +// SetVisibility : Allow user to set Visibility +func (_options *ListImagesOptions) SetVisibility(visibility string) *ListImagesOptions { + _options.Visibility = core.StringPtr(visibility) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListImagesOptions) SetHeaders(param map[string]string) *ListImagesOptions { + options.Headers = param + return options +} + +// ListInstanceDisksOptions : The ListInstanceDisks options. +type ListInstanceDisksOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceDisksOptions : Instantiate ListInstanceDisksOptions +func (*VpcV1) NewListInstanceDisksOptions(instanceID string) *ListInstanceDisksOptions { + return &ListInstanceDisksOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceDisksOptions) SetInstanceID(instanceID string) *ListInstanceDisksOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceDisksOptions) SetHeaders(param map[string]string) *ListInstanceDisksOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagerActionsOptions : The ListInstanceGroupManagerActions options. +type ListInstanceGroupManagerActionsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagerActionsOptions : Instantiate ListInstanceGroupManagerActionsOptions +func (*VpcV1) NewListInstanceGroupManagerActionsOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { + return &ListInstanceGroupManagerActionsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerActionsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagerActionsOptions) SetStart(start string) *ListInstanceGroupManagerActionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagerActionsOptions) SetLimit(limit int64) *ListInstanceGroupManagerActionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagerActionsOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerActionsOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagerPoliciesOptions : The ListInstanceGroupManagerPolicies options. +type ListInstanceGroupManagerPoliciesOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagerPoliciesOptions : Instantiate ListInstanceGroupManagerPoliciesOptions +func (*VpcV1) NewListInstanceGroupManagerPoliciesOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { + return &ListInstanceGroupManagerPoliciesOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerPoliciesOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagerPoliciesOptions) SetStart(start string) *ListInstanceGroupManagerPoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagerPoliciesOptions) SetLimit(limit int64) *ListInstanceGroupManagerPoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagerPoliciesOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerPoliciesOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagersOptions : The ListInstanceGroupManagers options. +type ListInstanceGroupManagersOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagersOptions : Instantiate ListInstanceGroupManagersOptions +func (*VpcV1) NewListInstanceGroupManagersOptions(instanceGroupID string) *ListInstanceGroupManagersOptions { + return &ListInstanceGroupManagersOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagersOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagersOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagersOptions) SetStart(start string) *ListInstanceGroupManagersOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagersOptions) SetLimit(limit int64) *ListInstanceGroupManagersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagersOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagersOptions { + options.Headers = param + return options +} + +// ListInstanceGroupMembershipsOptions : The ListInstanceGroupMemberships options. +type ListInstanceGroupMembershipsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupMembershipsOptions : Instantiate ListInstanceGroupMembershipsOptions +func (*VpcV1) NewListInstanceGroupMembershipsOptions(instanceGroupID string) *ListInstanceGroupMembershipsOptions { + return &ListInstanceGroupMembershipsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupMembershipsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupMembershipsOptions) SetStart(start string) *ListInstanceGroupMembershipsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupMembershipsOptions) SetLimit(limit int64) *ListInstanceGroupMembershipsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *ListInstanceGroupMembershipsOptions { + options.Headers = param + return options +} + +// ListInstanceGroupsOptions : The ListInstanceGroups options. +type ListInstanceGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupsOptions : Instantiate ListInstanceGroupsOptions +func (*VpcV1) NewListInstanceGroupsOptions() *ListInstanceGroupsOptions { + return &ListInstanceGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupsOptions) SetStart(start string) *ListInstanceGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupsOptions) SetLimit(limit int64) *ListInstanceGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupsOptions) SetHeaders(param map[string]string) *ListInstanceGroupsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkAttachmentsOptions : The ListInstanceNetworkAttachments options. +type ListInstanceNetworkAttachmentsOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkAttachmentsOptions : Instantiate ListInstanceNetworkAttachmentsOptions +func (*VpcV1) NewListInstanceNetworkAttachmentsOptions(instanceID string) *ListInstanceNetworkAttachmentsOptions { + return &ListInstanceNetworkAttachmentsOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkAttachmentsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkAttachmentsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkInterfaceFloatingIpsOptions : The ListInstanceNetworkInterfaceFloatingIps options. +type ListInstanceNetworkInterfaceFloatingIpsOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkInterfaceFloatingIpsOptions : Instantiate ListInstanceNetworkInterfaceFloatingIpsOptions +func (*VpcV1) NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + return &ListInstanceNetworkInterfaceFloatingIpsOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkInterfaceIpsOptions : The ListInstanceNetworkInterfaceIps options. +type ListInstanceNetworkInterfaceIpsOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkInterfaceIpsOptions : Instantiate ListInstanceNetworkInterfaceIpsOptions +func (*VpcV1) NewListInstanceNetworkInterfaceIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { + return &ListInstanceNetworkInterfaceIpsOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkInterfaceIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceIpsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListInstanceNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceNetworkInterfaceIpsOptions) SetStart(start string) *ListInstanceNetworkInterfaceIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceNetworkInterfaceIpsOptions) SetLimit(limit int64) *ListInstanceNetworkInterfaceIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceIpsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkInterfacesOptions : The ListInstanceNetworkInterfaces options. +type ListInstanceNetworkInterfacesOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkInterfacesOptions : Instantiate ListInstanceNetworkInterfacesOptions +func (*VpcV1) NewListInstanceNetworkInterfacesOptions(instanceID string) *ListInstanceNetworkInterfacesOptions { + return &ListInstanceNetworkInterfacesOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkInterfacesOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfacesOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfacesOptions { + options.Headers = param + return options +} + +// ListInstanceProfilesOptions : The ListInstanceProfiles options. +type ListInstanceProfilesOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceProfilesOptions : Instantiate ListInstanceProfilesOptions +func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { + return &ListInstanceProfilesOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { + options.Headers = param + return options +} + +// ListInstanceTemplatesOptions : The ListInstanceTemplates options. +type ListInstanceTemplatesOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceTemplatesOptions : Instantiate ListInstanceTemplatesOptions +func (*VpcV1) NewListInstanceTemplatesOptions() *ListInstanceTemplatesOptions { + return &ListInstanceTemplatesOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceTemplatesOptions) SetHeaders(param map[string]string) *ListInstanceTemplatesOptions { + options.Headers = param + return options +} + +// ListInstanceVolumeAttachmentsOptions : The ListInstanceVolumeAttachments options. +type ListInstanceVolumeAttachmentsOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceVolumeAttachmentsOptions : Instantiate ListInstanceVolumeAttachmentsOptions +func (*VpcV1) NewListInstanceVolumeAttachmentsOptions(instanceID string) *ListInstanceVolumeAttachmentsOptions { + return &ListInstanceVolumeAttachmentsOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceVolumeAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceVolumeAttachmentsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceVolumeAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceVolumeAttachmentsOptions { + options.Headers = param + return options +} + +// ListInstancesOptions : The ListInstances options. +type ListInstancesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to instances with a `dedicated_host.id` property matching the specified identifier. + DedicatedHostID *string `json:"dedicated_host.id,omitempty"` + + // Filters the collection to instances with a `dedicated_host.crn` property matching the specified CRN. + DedicatedHostCRN *string `json:"dedicated_host.crn,omitempty"` + + // Filters the collection to instances with a `dedicated_host.name` property matching the exact specified name. + DedicatedHostName *string `json:"dedicated_host.name,omitempty"` + + // Filters the collection to instances with a `placement_target.id` property matching the specified placement group + // identifier. + PlacementGroupID *string `json:"placement_group.id,omitempty"` + + // Filters the collection to instances with a `placement_target.crn` property matching the specified placement group + // CRN. + PlacementGroupCRN *string `json:"placement_group.crn,omitempty"` + + // Filters the collection to instances with a `placement_target.name` property matching the exact specified placement + // group name. + PlacementGroupName *string `json:"placement_group.name,omitempty"` + + // Filters the collection to instances with a `reservation.id` property matching the specified identifier. + ReservationID *string `json:"reservation.id,omitempty"` + + // Filters the collection to instances with a `reservation.crn` property matching the specified CRN. + ReservationCRN *string `json:"reservation.crn,omitempty"` + + // Filters the collection to resources with a `reservation.name` property matching the exact specified name. + ReservationName *string `json:"reservation.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstancesOptions : Instantiate ListInstancesOptions +func (*VpcV1) NewListInstancesOptions() *ListInstancesOptions { + return &ListInstancesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListInstancesOptions) SetStart(start string) *ListInstancesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstancesOptions) SetLimit(limit int64) *ListInstancesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListInstancesOptions) SetResourceGroupID(resourceGroupID string) *ListInstancesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListInstancesOptions) SetVPCID(vpcID string) *ListInstancesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListInstancesOptions) SetVPCCRN(vpcCRN string) *ListInstancesOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListInstancesOptions) SetVPCName(vpcName string) *ListInstancesOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *ListInstancesOptions) SetDedicatedHostID(dedicatedHostID string) *ListInstancesOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} + +// SetDedicatedHostCRN : Allow user to set DedicatedHostCRN +func (_options *ListInstancesOptions) SetDedicatedHostCRN(dedicatedHostCRN string) *ListInstancesOptions { + _options.DedicatedHostCRN = core.StringPtr(dedicatedHostCRN) + return _options +} + +// SetDedicatedHostName : Allow user to set DedicatedHostName +func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName string) *ListInstancesOptions { + _options.DedicatedHostName = core.StringPtr(dedicatedHostName) + return _options +} + +// SetPlacementGroupID : Allow user to set PlacementGroupID +func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { + _options.PlacementGroupID = core.StringPtr(placementGroupID) + return _options +} + +// SetPlacementGroupCRN : Allow user to set PlacementGroupCRN +func (_options *ListInstancesOptions) SetPlacementGroupCRN(placementGroupCRN string) *ListInstancesOptions { + _options.PlacementGroupCRN = core.StringPtr(placementGroupCRN) + return _options +} + +// SetPlacementGroupName : Allow user to set PlacementGroupName +func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName string) *ListInstancesOptions { + _options.PlacementGroupName = core.StringPtr(placementGroupName) + return _options +} + +// SetReservationID : Allow user to set ReservationID +func (_options *ListInstancesOptions) SetReservationID(reservationID string) *ListInstancesOptions { + _options.ReservationID = core.StringPtr(reservationID) + return _options +} + +// SetReservationCRN : Allow user to set ReservationCRN +func (_options *ListInstancesOptions) SetReservationCRN(reservationCRN string) *ListInstancesOptions { + _options.ReservationCRN = core.StringPtr(reservationCRN) + return _options +} + +// SetReservationName : Allow user to set ReservationName +func (_options *ListInstancesOptions) SetReservationName(reservationName string) *ListInstancesOptions { + _options.ReservationName = core.StringPtr(reservationName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { + options.Headers = param + return options +} + +// ListIpsecPoliciesOptions : The ListIpsecPolicies options. +type ListIpsecPoliciesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIpsecPoliciesOptions : Instantiate ListIpsecPoliciesOptions +func (*VpcV1) NewListIpsecPoliciesOptions() *ListIpsecPoliciesOptions { + return &ListIpsecPoliciesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListIpsecPoliciesOptions) SetStart(start string) *ListIpsecPoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListIpsecPoliciesOptions) SetLimit(limit int64) *ListIpsecPoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIpsecPoliciesOptions) SetHeaders(param map[string]string) *ListIpsecPoliciesOptions { + options.Headers = param + return options +} + +// ListIpsecPolicyConnectionsOptions : The ListIpsecPolicyConnections options. +type ListIpsecPolicyConnectionsOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIpsecPolicyConnectionsOptions : Instantiate ListIpsecPolicyConnectionsOptions +func (*VpcV1) NewListIpsecPolicyConnectionsOptions(id string) *ListIpsecPolicyConnectionsOptions { + return &ListIpsecPolicyConnectionsOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ListIpsecPolicyConnectionsOptions) SetID(id string) *ListIpsecPolicyConnectionsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIpsecPolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIpsecPolicyConnectionsOptions { + options.Headers = param + return options +} + +// ListKeysOptions : The ListKeys options. +type ListKeysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListKeysOptions : Instantiate ListKeysOptions +func (*VpcV1) NewListKeysOptions() *ListKeysOptions { + return &ListKeysOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListKeysOptions) SetStart(start string) *ListKeysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListKeysOptions) SetLimit(limit int64) *ListKeysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListKeysOptions) SetHeaders(param map[string]string) *ListKeysOptions { + options.Headers = param + return options +} + +// ListLoadBalancerListenerPoliciesOptions : The ListLoadBalancerListenerPolicies options. +type ListLoadBalancerListenerPoliciesOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerListenerPoliciesOptions : Instantiate ListLoadBalancerListenerPoliciesOptions +func (*VpcV1) NewListLoadBalancerListenerPoliciesOptions(loadBalancerID string, listenerID string) *ListLoadBalancerListenerPoliciesOptions { + return &ListLoadBalancerListenerPoliciesOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceAvailabilityPolicyPrototype : InstanceAvailabilityPolicyPrototype struct -type InstanceAvailabilityPolicyPrototype struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure. - HostFailure *string `json:"host_failure,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenerPoliciesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPoliciesOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// Constants associated with the InstanceAvailabilityPolicyPrototype.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure. -const ( - InstanceAvailabilityPolicyPrototypeHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyPrototypeHostFailureStopConst = "stop" -) +// SetListenerID : Allow user to set ListenerID +func (_options *ListLoadBalancerListenerPoliciesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPoliciesOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} -// UnmarshalInstanceAvailabilityPolicyPrototype unmarshals an instance of InstanceAvailabilityPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicyPrototype) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenerPoliciesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPoliciesOptions { + options.Headers = param + return options } -// InstanceCatalogOffering : InstanceCatalogOffering struct -type InstanceCatalogOffering struct { - // The catalog offering version this virtual server instance was provisioned from. - // - // The catalog offering version is not managed by the IBM VPC service, and may no longer - // exist, or may refer to a different image CRN than the `image.crn` for this virtual - // server instance. However, all images associated with a catalog offering version will - // have the same checksum, and therefore will have the same data. - Version *CatalogOfferingVersionReference `json:"version" validate:"required"` +// ListLoadBalancerListenerPolicyRulesOptions : The ListLoadBalancerListenerPolicyRules options. +type ListLoadBalancerListenerPolicyRulesOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceCatalogOffering unmarshals an instance of InstanceCatalogOffering from the specified map of raw messages. -func UnmarshalInstanceCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOffering) - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) - if err != nil { - return +// NewListLoadBalancerListenerPolicyRulesOptions : Instantiate ListLoadBalancerListenerPolicyRulesOptions +func (*VpcV1) NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID string, listenerID string, policyID string) *ListLoadBalancerListenerPolicyRulesOptions { + return &ListLoadBalancerListenerPolicyRulesOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceCatalogOfferingPrototype : The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering or offering version to use -// when provisioning this virtual server instance. -// -// If an offering is specified, the latest version of that offering will be used. -// -// The specified offering or offering version may be in a different account in the same -// [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject to IAM policies. -// Models which "extend" this model: -// - InstanceCatalogOfferingPrototypeCatalogOfferingByOffering -// - InstanceCatalogOfferingPrototypeCatalogOfferingByVersion -type InstanceCatalogOfferingPrototype struct { - // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering by a unique property. - Offering CatalogOfferingIdentityIntf `json:"offering,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // Identifies a version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a - // unique property. - Version CatalogOfferingVersionIdentityIntf `json:"version,omitempty"` +// SetListenerID : Allow user to set ListenerID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -func (*InstanceCatalogOfferingPrototype) isaInstanceCatalogOfferingPrototype() bool { - return true +// SetPolicyID : Allow user to set PolicyID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetPolicyID(policyID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options } -type InstanceCatalogOfferingPrototypeIntf interface { - isaInstanceCatalogOfferingPrototype() bool +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenerPolicyRulesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPolicyRulesOptions { + options.Headers = param + return options } -// UnmarshalInstanceCatalogOfferingPrototype unmarshals an instance of InstanceCatalogOfferingPrototype from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototype) - err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) - if err != nil { - return +// ListLoadBalancerListenersOptions : The ListLoadBalancerListeners options. +type ListLoadBalancerListenersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerListenersOptions : Instantiate ListLoadBalancerListenersOptions +func (*VpcV1) NewListLoadBalancerListenersOptions(loadBalancerID string) *ListLoadBalancerListenersOptions { + return &ListLoadBalancerListenersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceCollection : InstanceCollection struct -type InstanceCollection struct { - // A link to the first page of resources. - First *InstanceCollectionFirst `json:"first" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // Collection of virtual server instances. - Instances []Instance `json:"instances" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenersOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenersOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// ListLoadBalancerPoolMembersOptions : The ListLoadBalancerPoolMembers options. +type ListLoadBalancerPoolMembersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceCollectionNext `json:"next,omitempty"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceCollection unmarshals an instance of InstanceCollection from the specified map of raw messages. -func UnmarshalInstanceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstance) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewListLoadBalancerPoolMembersOptions : Instantiate ListLoadBalancerPoolMembersOptions +func (*VpcV1) NewListLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string) *ListLoadBalancerPoolMembersOptions { + return &ListLoadBalancerPoolMembersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolMembersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// InstanceCollectionFirst : A link to the first page of resources. -type InstanceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetPoolID : Allow user to set PoolID +func (_options *ListLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ListLoadBalancerPoolMembersOptions { + _options.PoolID = core.StringPtr(poolID) + return _options } -// UnmarshalInstanceCollectionFirst unmarshals an instance of InstanceCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolMembersOptions { + options.Headers = param + return options } -// InstanceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// ListLoadBalancerPoolsOptions : The ListLoadBalancerPools options. +type ListLoadBalancerPoolsOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceCollectionNext unmarshals an instance of InstanceCollectionNext from the specified map of raw messages. -func UnmarshalInstanceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewListLoadBalancerPoolsOptions : Instantiate ListLoadBalancerPoolsOptions +func (*VpcV1) NewListLoadBalancerPoolsOptions(loadBalancerID string) *ListLoadBalancerPoolsOptions { + return &ListLoadBalancerPoolsOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceConsoleAccessToken : The instance console access token information. -type InstanceConsoleAccessToken struct { - // A URL safe single-use token used to access the console WebSocket. - AccessToken *string `json:"access_token" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerPoolsOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolsOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerPoolsOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolsOptions { + options.Headers = param + return options +} - // The date and time that the access token was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// ListLoadBalancerProfilesOptions : The ListLoadBalancerProfiles options. +type ListLoadBalancerProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The date and time that the access token will expire. - ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL to access this instance console. - Href *string `json:"href" validate:"required"` +// NewListLoadBalancerProfilesOptions : Instantiate ListLoadBalancerProfilesOptions +func (*VpcV1) NewListLoadBalancerProfilesOptions() *ListLoadBalancerProfilesOptions { + return &ListLoadBalancerProfilesOptions{} } -// Constants associated with the InstanceConsoleAccessToken.ConsoleType property. -// The instance console type for which this token may be used. -const ( - InstanceConsoleAccessTokenConsoleTypeSerialConst = "serial" - InstanceConsoleAccessTokenConsoleTypeVncConst = "vnc" -) +// SetStart : Allow user to set Start +func (_options *ListLoadBalancerProfilesOptions) SetStart(start string) *ListLoadBalancerProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} -// UnmarshalInstanceConsoleAccessToken unmarshals an instance of InstanceConsoleAccessToken from the specified map of raw messages. -func UnmarshalInstanceConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceConsoleAccessToken) - err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListLoadBalancerProfilesOptions) SetLimit(limit int64) *ListLoadBalancerProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceDefaultTrustedProfilePrototype : InstanceDefaultTrustedProfilePrototype struct -type InstanceDefaultTrustedProfilePrototype struct { - // If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. - // Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be - // automatically deleted when the instance is deleted. - AutoLink *bool `json:"auto_link,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerProfilesOptions) SetHeaders(param map[string]string) *ListLoadBalancerProfilesOptions { + options.Headers = param + return options +} - // The default IAM trusted profile to use for this virtual server instance. - Target TrustedProfileIdentityIntf `json:"target" validate:"required"` +// ListLoadBalancersOptions : The ListLoadBalancers options. +type ListLoadBalancersOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// NewInstanceDefaultTrustedProfilePrototype : Instantiate InstanceDefaultTrustedProfilePrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceDefaultTrustedProfilePrototype(target TrustedProfileIdentityIntf) (_model *InstanceDefaultTrustedProfilePrototype, err error) { - _model = &InstanceDefaultTrustedProfilePrototype{ - Target: target, - } - err = core.ValidateStruct(_model, "required parameters") - return +// NewListLoadBalancersOptions : Instantiate ListLoadBalancersOptions +func (*VpcV1) NewListLoadBalancersOptions() *ListLoadBalancersOptions { + return &ListLoadBalancersOptions{} } -// UnmarshalInstanceDefaultTrustedProfilePrototype unmarshals an instance of InstanceDefaultTrustedProfilePrototype from the specified map of raw messages. -func UnmarshalInstanceDefaultTrustedProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDefaultTrustedProfilePrototype) - err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListLoadBalancersOptions) SetStart(start string) *ListLoadBalancersOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceDisk : InstanceDisk struct -type InstanceDisk struct { - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListLoadBalancersOptions) SetLimit(limit int64) *ListLoadBalancersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancersOptions) SetHeaders(param map[string]string) *ListLoadBalancersOptions { + options.Headers = param + return options +} - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` +// ListNetworkACLRulesOptions : The ListNetworkACLRules options. +type ListNetworkACLRulesOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The name for this instance disk. The name is unique across all disks on the instance. - Name *string `json:"name" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Filters the collection to rules with a `direction` property matching the specified value. + Direction *string `json:"direction,omitempty"` - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceDisk.InterfaceType property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceDiskInterfaceTypeNvmeConst = "nvme" - InstanceDiskInterfaceTypeVirtioBlkConst = "virtio_blk" -) - -// Constants associated with the InstanceDisk.ResourceType property. -// The resource type. +// Constants associated with the ListNetworkACLRulesOptions.Direction property. +// Filters the collection to rules with a `direction` property matching the specified value. const ( - InstanceDiskResourceTypeInstanceDiskConst = "instance_disk" + ListNetworkACLRulesOptionsDirectionInboundConst = "inbound" + ListNetworkACLRulesOptionsDirectionOutboundConst = "outbound" ) -// UnmarshalInstanceDisk unmarshals an instance of InstanceDisk from the specified map of raw messages. -func UnmarshalInstanceDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDisk) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return +// NewListNetworkACLRulesOptions : Instantiate ListNetworkACLRulesOptions +func (*VpcV1) NewListNetworkACLRulesOptions(networkACLID string) *ListNetworkACLRulesOptions { + return &ListNetworkACLRulesOptions{ + NetworkACLID: core.StringPtr(networkACLID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceDiskCollection : InstanceDiskCollection struct -type InstanceDiskCollection struct { - // Collection of the instance's disks. - Disks []InstanceDisk `json:"disks" validate:"required"` +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *ListNetworkACLRulesOptions) SetNetworkACLID(networkACLID string) *ListNetworkACLRulesOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListNetworkACLRulesOptions) SetStart(start string) *ListNetworkACLRulesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListNetworkACLRulesOptions) SetLimit(limit int64) *ListNetworkACLRulesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetDirection : Allow user to set Direction +func (_options *ListNetworkACLRulesOptions) SetDirection(direction string) *ListNetworkACLRulesOptions { + _options.Direction = core.StringPtr(direction) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListNetworkACLRulesOptions) SetHeaders(param map[string]string) *ListNetworkACLRulesOptions { + options.Headers = param + return options } -// UnmarshalInstanceDiskCollection unmarshals an instance of InstanceDiskCollection from the specified map of raw messages. -func UnmarshalInstanceDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// ListNetworkAclsOptions : The ListNetworkAcls options. +type ListNetworkAclsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// InstanceDiskPatch : InstanceDiskPatch struct -type InstanceDiskPatch struct { - // The name for this instance disk. The name must not be used by another disk on the instance. - Name *string `json:"name,omitempty"` +// NewListNetworkAclsOptions : Instantiate ListNetworkAclsOptions +func (*VpcV1) NewListNetworkAclsOptions() *ListNetworkAclsOptions { + return &ListNetworkAclsOptions{} } -// UnmarshalInstanceDiskPatch unmarshals an instance of InstanceDiskPatch from the specified map of raw messages. -func UnmarshalInstanceDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListNetworkAclsOptions) SetStart(start string) *ListNetworkAclsOptions { + _options.Start = core.StringPtr(start) + return _options } -// AsPatch returns a generic map representation of the InstanceDiskPatch -func (instanceDiskPatch *InstanceDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetLimit : Allow user to set Limit +func (_options *ListNetworkAclsOptions) SetLimit(limit int64) *ListNetworkAclsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceDiskReference : InstanceDiskReference struct -type InstanceDiskReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceDiskReferenceDeleted `json:"deleted,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListNetworkAclsOptions) SetResourceGroupID(resourceGroupID string) *ListNetworkAclsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListNetworkAclsOptions) SetHeaders(param map[string]string) *ListNetworkAclsOptions { + options.Headers = param + return options +} - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` +// ListNetworkInterfaceFloatingIpsOptions : The ListNetworkInterfaceFloatingIps options. +type ListNetworkInterfaceFloatingIpsOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The name for this instance disk. The name is unique across all disks on the instance. - Name *string `json:"name" validate:"required"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value + // `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` + // property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceDiskReference.ResourceType property. -// The resource type. +// Constants associated with the ListNetworkInterfaceFloatingIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value +// `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` +// property in ascending order. const ( - InstanceDiskReferenceResourceTypeInstanceDiskConst = "instance_disk" + ListNetworkInterfaceFloatingIpsOptionsSortAddressConst = "address" + ListNetworkInterfaceFloatingIpsOptionsSortNameConst = "name" ) -// UnmarshalInstanceDiskReference unmarshals an instance of InstanceDiskReference from the specified map of raw messages. -func UnmarshalInstanceDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceDiskReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewListNetworkInterfaceFloatingIpsOptions : Instantiate ListNetworkInterfaceFloatingIpsOptions +func (*VpcV1) NewListNetworkInterfaceFloatingIpsOptions(virtualNetworkInterfaceID string) *ListNetworkInterfaceFloatingIpsOptions { + return &ListNetworkInterfaceFloatingIpsOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceDiskReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *ListNetworkInterfaceFloatingIpsOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *ListNetworkInterfaceFloatingIpsOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options } -// UnmarshalInstanceDiskReferenceDeleted unmarshals an instance of InstanceDiskReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListNetworkInterfaceFloatingIpsOptions) SetStart(start string) *ListNetworkInterfaceFloatingIpsOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGpu : The virtual server instance GPU configuration. -type InstanceGpu struct { - // The number of GPUs assigned to the instance. - Count *int64 `json:"count" validate:"required"` - - // The GPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListNetworkInterfaceFloatingIpsOptions) SetLimit(limit int64) *ListNetworkInterfaceFloatingIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The overall amount of GPU memory in GiB (gibibytes). - Memory *int64 `json:"memory" validate:"required"` +// SetSort : Allow user to set Sort +func (_options *ListNetworkInterfaceFloatingIpsOptions) SetSort(sort string) *ListNetworkInterfaceFloatingIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} - // The GPU model. - Model *string `json:"model" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListNetworkInterfaceFloatingIpsOptions { + options.Headers = param + return options } -// UnmarshalInstanceGpu unmarshals an instance of InstanceGpu from the specified map of raw messages. -func UnmarshalInstanceGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGpu) - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "model", &obj.Model) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// ListOperatingSystemsOptions : The ListOperatingSystems options. +type ListOperatingSystemsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// InstanceGroup : InstanceGroup struct -type InstanceGroup struct { - // The port used for new load balancer pool members created by this instance group. - // - // This property will be present if and only if `load_balancer_pool` is present. - ApplicationPort *int64 `json:"application_port,omitempty"` +// NewListOperatingSystemsOptions : Instantiate ListOperatingSystemsOptions +func (*VpcV1) NewListOperatingSystemsOptions() *ListOperatingSystemsOptions { + return &ListOperatingSystemsOptions{} +} - // The date and time that the instance group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListOperatingSystemsOptions) SetStart(start string) *ListOperatingSystemsOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListOperatingSystemsOptions) SetLimit(limit int64) *ListOperatingSystemsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The URL for this instance group. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListOperatingSystemsOptions) SetHeaders(param map[string]string) *ListOperatingSystemsOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` +// ListPlacementGroupsOptions : The ListPlacementGroups options. +type ListPlacementGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The template used to create new instances for this group. - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // If present, the load balancer pool this instance group manages. A pool member will - // be created for each instance created by this group. - LoadBalancerPool *LoadBalancerPoolReference `json:"load_balancer_pool,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The managers for the instance group. - Managers []InstanceGroupManagerReference `json:"managers" validate:"required"` +// NewListPlacementGroupsOptions : Instantiate ListPlacementGroupsOptions +func (*VpcV1) NewListPlacementGroupsOptions() *ListPlacementGroupsOptions { + return &ListPlacementGroupsOptions{} +} - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListPlacementGroupsOptions) SetStart(start string) *ListPlacementGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The name for this instance group. The name is unique across all instance groups in the region. - Name *string `json:"name" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListPlacementGroupsOptions) SetLimit(limit int64) *ListPlacementGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListPlacementGroupsOptions) SetHeaders(param map[string]string) *ListPlacementGroupsOptions { + options.Headers = param + return options +} - // The status of the instance group - // - `deleting`: Group is being deleted - // - `healthy`: Group has `membership_count` instances - // - `scaling`: Instances in the group are being created or deleted to reach - // `membership_count` - // - `unhealthy`: Group is unable to reach `membership_count` instances. - Status *string `json:"status" validate:"required"` +// ListPublicGatewaysOptions : The ListPublicGateways options. +type ListPublicGatewaysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The subnets to use when creating new instances. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The date and time that the instance group was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The VPC the instance group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceGroup.Status property. -// The status of the instance group -// - `deleting`: Group is being deleted -// - `healthy`: Group has `membership_count` instances -// - `scaling`: Instances in the group are being created or deleted to reach -// `membership_count` -// - `unhealthy`: Group is unable to reach `membership_count` instances. -const ( - InstanceGroupStatusDeletingConst = "deleting" - InstanceGroupStatusHealthyConst = "healthy" - InstanceGroupStatusScalingConst = "scaling" - InstanceGroupStatusUnhealthyConst = "unhealthy" -) +// NewListPublicGatewaysOptions : Instantiate ListPublicGatewaysOptions +func (*VpcV1) NewListPublicGatewaysOptions() *ListPublicGatewaysOptions { + return &ListPublicGatewaysOptions{} +} -// UnmarshalInstanceGroup unmarshals an instance of InstanceGroup from the specified map of raw messages. -func UnmarshalInstanceGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroup) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManagerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListPublicGatewaysOptions) SetStart(start string) *ListPublicGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupCollection : InstanceGroupCollection struct -type InstanceGroupCollection struct { - // A link to the first page of resources. - First *InstanceGroupCollectionFirst `json:"first" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListPublicGatewaysOptions) SetLimit(limit int64) *ListPublicGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // Collection of instance groups. - InstanceGroups []InstanceGroup `json:"instance_groups" validate:"required"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListPublicGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListPublicGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListPublicGatewaysOptions) SetHeaders(param map[string]string) *ListPublicGatewaysOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupCollectionNext `json:"next,omitempty"` +// ListRegionZonesOptions : The ListRegionZones options. +type ListRegionZonesOptions struct { + // The region name. + RegionName *string `json:"region_name" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupCollection unmarshals an instance of InstanceGroupCollection from the specified map of raw messages. -func UnmarshalInstanceGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_groups", &obj.InstanceGroups, UnmarshalInstanceGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewListRegionZonesOptions : Instantiate ListRegionZonesOptions +func (*VpcV1) NewListRegionZonesOptions(regionName string) *ListRegionZonesOptions { + return &ListRegionZonesOptions{ + RegionName: core.StringPtr(regionName), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetRegionName : Allow user to set RegionName +func (_options *ListRegionZonesOptions) SetRegionName(regionName string) *ListRegionZonesOptions { + _options.RegionName = core.StringPtr(regionName) + return _options } -// InstanceGroupCollectionFirst : A link to the first page of resources. -type InstanceGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListRegionZonesOptions) SetHeaders(param map[string]string) *ListRegionZonesOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupCollectionFirst unmarshals an instance of InstanceGroupCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// ListRegionsOptions : The ListRegions options. +type ListRegionsOptions struct { -// InstanceGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupCollectionNext unmarshals an instance of InstanceGroupCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// NewListRegionsOptions : Instantiate ListRegionsOptions +func (*VpcV1) NewListRegionsOptions() *ListRegionsOptions { + return &ListRegionsOptions{} } -// InstanceGroupManager : InstanceGroupManager struct -// Models which "extend" this model: -// - InstanceGroupManagerAutoScale -// - InstanceGroupManagerScheduled -type InstanceGroupManager struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` +// ListReservationsOptions : The ListReservations options. +type ListReservationsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` +// NewListReservationsOptions : Instantiate ListReservationsOptions +func (*VpcV1) NewListReservationsOptions() *ListReservationsOptions { + return &ListReservationsOptions{} +} - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` +// SetStart : Allow user to set Start +func (_options *ListReservationsOptions) SetStart(start string) *ListReservationsOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListReservationsOptions) SetLimit(limit int64) *ListReservationsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The policies of the instance group manager. - Policies []InstanceGroupManagerPolicyReference `json:"policies,omitempty"` +// SetName : Allow user to set Name +func (_options *ListReservationsOptions) SetName(name string) *ListReservationsOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The actions of the instance group manager. - Actions []InstanceGroupManagerActionReference `json:"actions,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListReservationsOptions) SetResourceGroupID(resourceGroupID string) *ListReservationsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options } -// Constants associated with the InstanceGroupManager.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerManagerTypeAutoscaleConst = "autoscale" -) +// SetZoneName : Allow user to set ZoneName +func (_options *ListReservationsOptions) SetZoneName(zoneName string) *ListReservationsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} -func (*InstanceGroupManager) isaInstanceGroupManager() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *ListReservationsOptions) SetHeaders(param map[string]string) *ListReservationsOptions { + options.Headers = param + return options } -type InstanceGroupManagerIntf interface { - isaInstanceGroupManager() bool +// ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. +type ListSecurityGroupRulesOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManager unmarshals an instance of InstanceGroupManager from the specified map of raw messages. -func UnmarshalInstanceGroupManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManager) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) - if err != nil { - return +// NewListSecurityGroupRulesOptions : Instantiate ListSecurityGroupRulesOptions +func (*VpcV1) NewListSecurityGroupRulesOptions(securityGroupID string) *ListSecurityGroupRulesOptions { + return &ListSecurityGroupRulesOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerAction : InstanceGroupManagerAction struct -// Models which "extend" this model: -// - InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerAction struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *ListSecurityGroupRulesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupRulesOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupRulesOptions) SetHeaders(param map[string]string) *ListSecurityGroupRulesOptions { + options.Headers = param + return options +} - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// ListSecurityGroupTargetsOptions : The ListSecurityGroupTargets options. +type ListSecurityGroupTargetsOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewListSecurityGroupTargetsOptions : Instantiate ListSecurityGroupTargetsOptions +func (*VpcV1) NewListSecurityGroupTargetsOptions(securityGroupID string) *ListSecurityGroupTargetsOptions { + return &ListSecurityGroupTargetsOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + } +} - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *ListSecurityGroupTargetsOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupTargetsOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListSecurityGroupTargetsOptions) SetStart(start string) *ListSecurityGroupTargetsOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The type of action for the instance group. - ActionType *string `json:"action_type,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListSecurityGroupTargetsOptions) SetLimit(limit int64) *ListSecurityGroupTargetsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupTargetsOptions) SetHeaders(param map[string]string) *ListSecurityGroupTargetsOptions { + options.Headers = param + return options +} - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` +// ListSecurityGroupsOptions : The ListSecurityGroups options. +type ListSecurityGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` -} + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` -// Constants associated with the InstanceGroupManagerAction.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` -// Constants associated with the InstanceGroupManagerAction.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionStatusActiveConst = "active" - InstanceGroupManagerActionStatusCompletedConst = "completed" - InstanceGroupManagerActionStatusFailedConst = "failed" - InstanceGroupManagerActionStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionStatusOmittedConst = "omitted" -) + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` -// Constants associated with the InstanceGroupManagerAction.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionActionTypeScheduledConst = "scheduled" -) + // Allows users to set headers on API requests + Headers map[string]string +} -func (*InstanceGroupManagerAction) isaInstanceGroupManagerAction() bool { - return true +// NewListSecurityGroupsOptions : Instantiate ListSecurityGroupsOptions +func (*VpcV1) NewListSecurityGroupsOptions() *ListSecurityGroupsOptions { + return &ListSecurityGroupsOptions{} } -type InstanceGroupManagerActionIntf interface { - isaInstanceGroupManagerAction() bool +// SetStart : Allow user to set Start +func (_options *ListSecurityGroupsOptions) SetStart(start string) *ListSecurityGroupsOptions { + _options.Start = core.StringPtr(start) + return _options } -// UnmarshalInstanceGroupManagerAction unmarshals an instance of InstanceGroupManagerAction from the specified map of raw messages. -func UnmarshalInstanceGroupManagerAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerAction) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListSecurityGroupsOptions) SetLimit(limit int64) *ListSecurityGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceGroupManagerActionGroupPatch : InstanceGroupManagerActionGroupPatch struct -type InstanceGroupManagerActionGroupPatch struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSecurityGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSecurityGroupsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options } -// UnmarshalInstanceGroupManagerActionGroupPatch unmarshals an instance of InstanceGroupManagerActionGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionGroupPatch) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetVPCID : Allow user to set VPCID +func (_options *ListSecurityGroupsOptions) SetVPCID(vpcID string) *ListSecurityGroupsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// InstanceGroupManagerActionManagerPatch : InstanceGroupManagerActionManagerPatch struct -type InstanceGroupManagerActionManagerPatch struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListSecurityGroupsOptions) SetVPCCRN(vpcCRN string) *ListSecurityGroupsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// SetVPCName : Allow user to set VPCName +func (_options *ListSecurityGroupsOptions) SetVPCName(vpcName string) *ListSecurityGroupsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options } -// UnmarshalInstanceGroupManagerActionManagerPatch unmarshals an instance of InstanceGroupManagerActionManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionManagerPatch) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupsOptions) SetHeaders(param map[string]string) *ListSecurityGroupsOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionPatch : InstanceGroupManagerActionPatch struct -type InstanceGroupManagerActionPatch struct { - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` +// ListShareMountTargetsOptions : The ListShareMountTargets options. +type ListShareMountTargetsOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` - Group *InstanceGroupManagerActionGroupPatch `json:"group,omitempty"` + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - Manager *InstanceGroupManagerActionManagerPatch `json:"manager,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. - Name *string `json:"name,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionPatch unmarshals an instance of InstanceGroupManagerActionPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPatch) - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerActionGroupPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerActionManagerPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return +// NewListShareMountTargetsOptions : Instantiate ListShareMountTargetsOptions +func (*VpcV1) NewListShareMountTargetsOptions(shareID string) *ListShareMountTargetsOptions { + return &ListShareMountTargetsOptions{ + ShareID: core.StringPtr(shareID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the InstanceGroupManagerActionPatch -func (instanceGroupManagerActionPatch *InstanceGroupManagerActionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerActionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetShareID : Allow user to set ShareID +func (_options *ListShareMountTargetsOptions) SetShareID(shareID string) *ListShareMountTargetsOptions { + _options.ShareID = core.StringPtr(shareID) + return _options } -// InstanceGroupManagerActionPrototype : InstanceGroupManagerActionPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototype struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// SetName : Allow user to set Name +func (_options *ListShareMountTargetsOptions) SetName(name string) *ListShareMountTargetsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListShareMountTargetsOptions) SetStart(start string) *ListShareMountTargetsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListShareMountTargetsOptions) SetLimit(limit int64) *ListShareMountTargetsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListShareMountTargetsOptions) SetHeaders(param map[string]string) *ListShareMountTargetsOptions { + options.Headers = param + return options +} + +// ListShareProfilesOptions : The ListShareProfiles options. +type ListShareProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` +// Constants associated with the ListShareProfilesOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListShareProfilesOptionsSortCreatedAtConst = "created_at" + ListShareProfilesOptionsSortNameConst = "name" +) - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` +// NewListShareProfilesOptions : Instantiate ListShareProfilesOptions +func (*VpcV1) NewListShareProfilesOptions() *ListShareProfilesOptions { + return &ListShareProfilesOptions{} +} - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` +// SetStart : Allow user to set Start +func (_options *ListShareProfilesOptions) SetStart(start string) *ListShareProfilesOptions { + _options.Start = core.StringPtr(start) + return _options } -func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { - return true +// SetLimit : Allow user to set Limit +func (_options *ListShareProfilesOptions) SetLimit(limit int64) *ListShareProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -type InstanceGroupManagerActionPrototypeIntf interface { - isaInstanceGroupManagerActionPrototype() bool +// SetSort : Allow user to set Sort +func (_options *ListShareProfilesOptions) SetSort(sort string) *ListShareProfilesOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// UnmarshalInstanceGroupManagerActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListShareProfilesOptions) SetHeaders(param map[string]string) *ListShareProfilesOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionReference : InstanceGroupManagerActionReference struct -type InstanceGroupManagerActionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerActionReferenceDeleted `json:"deleted,omitempty"` +// ListSharesOptions : The ListShares options. +type ListSharesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Filters the collection to file shares with a `replication_role` property matching the specified value. + ReplicationRole *string `json:"replication_role,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceGroupManagerActionReference.ResourceType property. -// The resource type. +// Constants associated with the ListSharesOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceGroupManagerActionReferenceResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" + ListSharesOptionsSortCreatedAtConst = "created_at" + ListSharesOptionsSortNameConst = "name" ) -// UnmarshalInstanceGroupManagerActionReference unmarshals an instance of InstanceGroupManagerActionReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerActionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the ListSharesOptions.ReplicationRole property. +// Filters the collection to file shares with a `replication_role` property matching the specified value. +const ( + ListSharesOptionsReplicationRoleNoneConst = "none" + ListSharesOptionsReplicationRoleReplicaConst = "replica" + ListSharesOptionsReplicationRoleSourceConst = "source" +) -// InstanceGroupManagerActionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerActionReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// NewListSharesOptions : Instantiate ListSharesOptions +func (*VpcV1) NewListSharesOptions() *ListSharesOptions { + return &ListSharesOptions{} } -// UnmarshalInstanceGroupManagerActionReferenceDeleted unmarshals an instance of InstanceGroupManagerActionReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListSharesOptions) SetStart(start string) *ListSharesOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupManagerActionsCollection : InstanceGroupManagerActionsCollection struct -type InstanceGroupManagerActionsCollection struct { - // Collection of instance group manager actions. - Actions []InstanceGroupManagerActionIntf `json:"actions" validate:"required"` - - // A link to the first page of resources. - First *InstanceGroupManagerActionsCollectionFirst `json:"first" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListSharesOptions) SetLimit(limit int64) *ListSharesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSharesOptions) SetResourceGroupID(resourceGroupID string) *ListSharesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerActionsCollectionNext `json:"next,omitempty"` +// SetName : Allow user to set Name +func (_options *ListSharesOptions) SetName(name string) *ListSharesOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetSort : Allow user to set Sort +func (_options *ListSharesOptions) SetSort(sort string) *ListSharesOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// UnmarshalInstanceGroupManagerActionsCollection unmarshals an instance of InstanceGroupManagerActionsCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollection) - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerActionsCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerActionsCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetReplicationRole : Allow user to set ReplicationRole +func (_options *ListSharesOptions) SetReplicationRole(replicationRole string) *ListSharesOptions { + _options.ReplicationRole = core.StringPtr(replicationRole) + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerActionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetHeaders : Allow user to set Headers +func (options *ListSharesOptions) SetHeaders(param map[string]string) *ListSharesOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionsCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerActionsCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// ListSnapshotClonesOptions : The ListSnapshotClones options. +type ListSnapshotClonesOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionsCollectionFirst unmarshals an instance of InstanceGroupManagerActionsCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewListSnapshotClonesOptions : Instantiate ListSnapshotClonesOptions +func (*VpcV1) NewListSnapshotClonesOptions(id string) *ListSnapshotClonesOptions { + return &ListSnapshotClonesOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerActionsCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerActionsCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *ListSnapshotClonesOptions) SetID(id string) *ListSnapshotClonesOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerActionsCollectionNext unmarshals an instance of InstanceGroupManagerActionsCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListSnapshotClonesOptions) SetHeaders(param map[string]string) *ListSnapshotClonesOptions { + options.Headers = param + return options } -// InstanceGroupManagerCollection : InstanceGroupManagerCollection struct -type InstanceGroupManagerCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerCollectionFirst `json:"first" validate:"required"` +// ListSnapshotConsistencyGroupsOptions : The ListSnapshotConsistencyGroups options. +type ListSnapshotConsistencyGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // Collection of instance group managers. - Managers []InstanceGroupManagerIntf `json:"managers" validate:"required"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerCollectionNext `json:"next,omitempty"` + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified + // identifier. + BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerCollection unmarshals an instance of InstanceGroupManagerCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManager) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// Constants associated with the ListSnapshotConsistencyGroupsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListSnapshotConsistencyGroupsOptionsSortCreatedAtConst = "created_at" + ListSnapshotConsistencyGroupsOptionsSortNameConst = "name" +) + +// NewListSnapshotConsistencyGroupsOptions : Instantiate ListSnapshotConsistencyGroupsOptions +func (*VpcV1) NewListSnapshotConsistencyGroupsOptions() *ListSnapshotConsistencyGroupsOptions { + return &ListSnapshotConsistencyGroupsOptions{} } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetStart : Allow user to set Start +func (_options *ListSnapshotConsistencyGroupsOptions) SetStart(start string) *ListSnapshotConsistencyGroupsOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupManagerCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListSnapshotConsistencyGroupsOptions) SetLimit(limit int64) *ListSnapshotConsistencyGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstanceGroupManagerCollectionFirst unmarshals an instance of InstanceGroupManagerCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSnapshotConsistencyGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotConsistencyGroupsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options } -// InstanceGroupManagerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetName : Allow user to set Name +func (_options *ListSnapshotConsistencyGroupsOptions) SetName(name string) *ListSnapshotConsistencyGroupsOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalInstanceGroupManagerCollectionNext unmarshals an instance of InstanceGroupManagerCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSort : Allow user to set Sort +func (_options *ListSnapshotConsistencyGroupsOptions) SetSort(sort string) *ListSnapshotConsistencyGroupsOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// InstanceGroupManagerPatch : InstanceGroupManagerPatch struct -type InstanceGroupManagerPatch struct { - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` +// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID +func (_options *ListSnapshotConsistencyGroupsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListSnapshotConsistencyGroupsOptions { + _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) + return _options +} - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListSnapshotConsistencyGroupsOptions) SetHeaders(param map[string]string) *ListSnapshotConsistencyGroupsOptions { + options.Headers = param + return options +} - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` +// ListSnapshotsOptions : The ListSnapshots options. +type ListSnapshotsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. + Tag *string `json:"tag,omitempty"` - // The name for this instance group manager. The name must not be used by another manager for the instance group. + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. Name *string `json:"name,omitempty"` -} -// UnmarshalInstanceGroupManagerPatch unmarshals an instance of InstanceGroupManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPatch) - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. + SourceVolumeID *string `json:"source_volume.id,omitempty"` -// AsPatch returns a generic map representation of the InstanceGroupManagerPatch -func (instanceGroupManagerPatch *InstanceGroupManagerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} + // Filters the collection to resources with a `source_volume.crn` property matching the specified CRN. + SourceVolumeCRN *string `json:"source_volume.crn,omitempty"` + + // Filters the collection to resources with a `source_image.id` property matching the specified identifier. + // + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // source image or any existent source image, respectively. + SourceImageID *string `json:"source_image.id,omitempty"` + + // Filters the collection to resources with a `source_image.crn` property matching the specified CRN. + // + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // source image or any existent source image, respectively. + SourceImageCRN *string `json:"source_image.crn,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified + // identifier. + BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` + + // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the + // specified identifier. + CopiesID *string `json:"copies[].id,omitempty"` + + // Filters the collection to snapshots with an item in the `copies` property with a `name` property matching the exact + // specified name. + CopiesName *string `json:"copies[].name,omitempty"` + + // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the + // specified CRN. + CopiesCRN *string `json:"copies[].crn,omitempty"` -// InstanceGroupManagerPolicy : InstanceGroupManagerPolicy struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy -type InstanceGroupManagerPolicy struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // Filters the collection to snapshots with an item in the `copies` property with a + // `remote.region.name` property matching the exact specified name. + CopiesRemoteRegionName *string `json:"copies[].remote.region.name,omitempty"` - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` + // Filters the collection to resources with a `source_snapshot.id` property matching the specified identifier. + SourceSnapshotID *string `json:"source_snapshot.id,omitempty"` - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` + // Filters the collection to resources with a `source_snapshot.remote.region.name` property matching the exact + // specified name. + SourceSnapshotRemoteRegionName *string `json:"source_snapshot.remote.region.name,omitempty"` - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. - Name *string `json:"name" validate:"required"` + // Filters the collection to resources with a `source_volume.remote.region.name` property matching the exact specified + // name. + SourceVolumeRemoteRegionName *string `json:"source_volume.remote.region.name,omitempty"` - // The date and time that the instance group manager policy was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // Filters the collection to resources with a `source_image.remote.region.name` property matching the exact specified + // name. + SourceImageRemoteRegionName *string `json:"source_image.remote.region.name,omitempty"` - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` + // Filters the collection to snapshots with an item in the `clones` property with a `zone.name` property matching the + // exact specified name. + ClonesZoneName *string `json:"clones[].zone.name,omitempty"` - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` + // Filters the collection to resources with a `snapshot_consistency_group.id` property matching the specified + // identifier. + SnapshotConsistencyGroupID *string `json:"snapshot_consistency_group.id,omitempty"` - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` -} + // Filters the collection to resources with a `snapshot_consistency_group.crn` property matching the specified + // identifier. + SnapshotConsistencyGroupCRN *string `json:"snapshot_consistency_group.crn,omitempty"` -// Constants associated with the InstanceGroupManagerPolicy.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyMetricTypeNetworkOutConst = "network_out" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// Constants associated with the InstanceGroupManagerPolicy.PolicyType property. -// The type of policy for the instance group. +// Constants associated with the ListSnapshotsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceGroupManagerPolicyPolicyTypeTargetConst = "target" + ListSnapshotsOptionsSortCreatedAtConst = "created_at" + ListSnapshotsOptionsSortNameConst = "name" ) -func (*InstanceGroupManagerPolicy) isaInstanceGroupManagerPolicy() bool { - return true +// NewListSnapshotsOptions : Instantiate ListSnapshotsOptions +func (*VpcV1) NewListSnapshotsOptions() *ListSnapshotsOptions { + return &ListSnapshotsOptions{} } -type InstanceGroupManagerPolicyIntf interface { - isaInstanceGroupManagerPolicy() bool +// SetStart : Allow user to set Start +func (_options *ListSnapshotsOptions) SetStart(start string) *ListSnapshotsOptions { + _options.Start = core.StringPtr(start) + return _options } -// UnmarshalInstanceGroupManagerPolicy unmarshals an instance of InstanceGroupManagerPolicy from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListSnapshotsOptions) SetLimit(limit int64) *ListSnapshotsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceGroupManagerPolicyCollection : InstanceGroupManagerPolicyCollection struct -type InstanceGroupManagerPolicyCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerPolicyCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerPolicyCollectionNext `json:"next,omitempty"` - - // Collection of instance group manager policies. - Policies []InstanceGroupManagerPolicyIntf `json:"policies" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetTag : Allow user to set Tag +func (_options *ListSnapshotsOptions) SetTag(tag string) *ListSnapshotsOptions { + _options.Tag = core.StringPtr(tag) + return _options } -// UnmarshalInstanceGroupManagerPolicyCollection unmarshals an instance of InstanceGroupManagerPolicyCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSnapshotsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetName : Allow user to set Name +func (_options *ListSnapshotsOptions) SetName(name string) *ListSnapshotsOptions { + _options.Name = core.StringPtr(name) + return _options } -// InstanceGroupManagerPolicyCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetSourceVolumeID : Allow user to set SourceVolumeID +func (_options *ListSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *ListSnapshotsOptions { + _options.SourceVolumeID = core.StringPtr(sourceVolumeID) + return _options } -// UnmarshalInstanceGroupManagerPolicyCollectionFirst unmarshals an instance of InstanceGroupManagerPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSourceVolumeCRN : Allow user to set SourceVolumeCRN +func (_options *ListSnapshotsOptions) SetSourceVolumeCRN(sourceVolumeCRN string) *ListSnapshotsOptions { + _options.SourceVolumeCRN = core.StringPtr(sourceVolumeCRN) + return _options } -// InstanceGroupManagerPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetSourceImageID : Allow user to set SourceImageID +func (_options *ListSnapshotsOptions) SetSourceImageID(sourceImageID string) *ListSnapshotsOptions { + _options.SourceImageID = core.StringPtr(sourceImageID) + return _options } -// UnmarshalInstanceGroupManagerPolicyCollectionNext unmarshals an instance of InstanceGroupManagerPolicyCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSourceImageCRN : Allow user to set SourceImageCRN +func (_options *ListSnapshotsOptions) SetSourceImageCRN(sourceImageCRN string) *ListSnapshotsOptions { + _options.SourceImageCRN = core.StringPtr(sourceImageCRN) + return _options } -// InstanceGroupManagerPolicyPatch : InstanceGroupManagerPolicyPatch struct -type InstanceGroupManagerPolicyPatch struct { - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` - - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. - Name *string `json:"name,omitempty"` +// SetSort : Allow user to set Sort +func (_options *ListSnapshotsOptions) SetSort(sort string) *ListSnapshotsOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// Constants associated with the InstanceGroupManagerPolicyPatch.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPatchMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPatchMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPatchMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPatchMetricTypeNetworkOutConst = "network_out" -) - -// UnmarshalInstanceGroupManagerPolicyPatch unmarshals an instance of InstanceGroupManagerPolicyPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPatch) - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID +func (_options *ListSnapshotsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListSnapshotsOptions { + _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) + return _options } -// AsPatch returns a generic map representation of the InstanceGroupManagerPolicyPatch -func (instanceGroupManagerPolicyPatch *InstanceGroupManagerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetCopiesID : Allow user to set CopiesID +func (_options *ListSnapshotsOptions) SetCopiesID(copiesID string) *ListSnapshotsOptions { + _options.CopiesID = core.StringPtr(copiesID) + return _options } -// InstanceGroupManagerPolicyPrototype : InstanceGroupManagerPolicyPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype -type InstanceGroupManagerPolicyPrototype struct { - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` +// SetCopiesName : Allow user to set CopiesName +func (_options *ListSnapshotsOptions) SetCopiesName(copiesName string) *ListSnapshotsOptions { + _options.CopiesName = core.StringPtr(copiesName) + return _options } -// Constants associated with the InstanceGroupManagerPolicyPrototype.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPrototypeMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPrototypeMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicyPrototype.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPrototypePolicyTypeTargetConst = "target" -) - -func (*InstanceGroupManagerPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { - return true +// SetCopiesCRN : Allow user to set CopiesCRN +func (_options *ListSnapshotsOptions) SetCopiesCRN(copiesCRN string) *ListSnapshotsOptions { + _options.CopiesCRN = core.StringPtr(copiesCRN) + return _options } -type InstanceGroupManagerPolicyPrototypeIntf interface { - isaInstanceGroupManagerPolicyPrototype() bool +// SetCopiesRemoteRegionName : Allow user to set CopiesRemoteRegionName +func (_options *ListSnapshotsOptions) SetCopiesRemoteRegionName(copiesRemoteRegionName string) *ListSnapshotsOptions { + _options.CopiesRemoteRegionName = core.StringPtr(copiesRemoteRegionName) + return _options } -// UnmarshalInstanceGroupManagerPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSourceSnapshotID : Allow user to set SourceSnapshotID +func (_options *ListSnapshotsOptions) SetSourceSnapshotID(sourceSnapshotID string) *ListSnapshotsOptions { + _options.SourceSnapshotID = core.StringPtr(sourceSnapshotID) + return _options } -// InstanceGroupManagerPolicyReference : InstanceGroupManagerPolicyReference struct -type InstanceGroupManagerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerPolicyReferenceDeleted `json:"deleted,omitempty"` +// SetSourceSnapshotRemoteRegionName : Allow user to set SourceSnapshotRemoteRegionName +func (_options *ListSnapshotsOptions) SetSourceSnapshotRemoteRegionName(sourceSnapshotRemoteRegionName string) *ListSnapshotsOptions { + _options.SourceSnapshotRemoteRegionName = core.StringPtr(sourceSnapshotRemoteRegionName) + return _options +} - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` +// SetSourceVolumeRemoteRegionName : Allow user to set SourceVolumeRemoteRegionName +func (_options *ListSnapshotsOptions) SetSourceVolumeRemoteRegionName(sourceVolumeRemoteRegionName string) *ListSnapshotsOptions { + _options.SourceVolumeRemoteRegionName = core.StringPtr(sourceVolumeRemoteRegionName) + return _options +} - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` +// SetSourceImageRemoteRegionName : Allow user to set SourceImageRemoteRegionName +func (_options *ListSnapshotsOptions) SetSourceImageRemoteRegionName(sourceImageRemoteRegionName string) *ListSnapshotsOptions { + _options.SourceImageRemoteRegionName = core.StringPtr(sourceImageRemoteRegionName) + return _options +} - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. - Name *string `json:"name" validate:"required"` +// SetClonesZoneName : Allow user to set ClonesZoneName +func (_options *ListSnapshotsOptions) SetClonesZoneName(clonesZoneName string) *ListSnapshotsOptions { + _options.ClonesZoneName = core.StringPtr(clonesZoneName) + return _options } -// UnmarshalInstanceGroupManagerPolicyReference unmarshals an instance of InstanceGroupManagerPolicyReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSnapshotConsistencyGroupID : Allow user to set SnapshotConsistencyGroupID +func (_options *ListSnapshotsOptions) SetSnapshotConsistencyGroupID(snapshotConsistencyGroupID string) *ListSnapshotsOptions { + _options.SnapshotConsistencyGroupID = core.StringPtr(snapshotConsistencyGroupID) + return _options } -// InstanceGroupManagerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetSnapshotConsistencyGroupCRN : Allow user to set SnapshotConsistencyGroupCRN +func (_options *ListSnapshotsOptions) SetSnapshotConsistencyGroupCRN(snapshotConsistencyGroupCRN string) *ListSnapshotsOptions { + _options.SnapshotConsistencyGroupCRN = core.StringPtr(snapshotConsistencyGroupCRN) + return _options } -// UnmarshalInstanceGroupManagerPolicyReferenceDeleted unmarshals an instance of InstanceGroupManagerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListSnapshotsOptions) SetHeaders(param map[string]string) *ListSnapshotsOptions { + options.Headers = param + return options } -// InstanceGroupManagerPrototype : InstanceGroupManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype -// - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype -type InstanceGroupManagerPrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` +// ListSubnetReservedIpsOptions : The ListSubnetReservedIps options. +type ListSubnetReservedIpsOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` + // Filters the collection to resources with a `target.id` property matching the specified identifier. + TargetID *string `json:"target.id,omitempty"` - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // Filters the collection to resources with a `target.crn` property matching the specified CRN. + TargetCRN *string `json:"target.crn,omitempty"` - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} + // Filters the collection to resources with a `target.name` property matching the exact specified name. + TargetName *string `json:"target.name,omitempty"` -// Constants associated with the InstanceGroupManagerPrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeManagerTypeAutoscaleConst = "autoscale" -) + // Filters the collection to resources with a `target.resource_type` property matching the specified value. + TargetResourceType *string `json:"target.resource_type,omitempty"` -func (*InstanceGroupManagerPrototype) isaInstanceGroupManagerPrototype() bool { - return true + // Allows users to set headers on API requests + Headers map[string]string } -type InstanceGroupManagerPrototypeIntf interface { - isaInstanceGroupManagerPrototype() bool -} +// Constants associated with the ListSubnetReservedIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListSubnetReservedIpsOptionsSortAddressConst = "address" + ListSubnetReservedIpsOptionsSortCreatedAtConst = "created_at" + ListSubnetReservedIpsOptionsSortNameConst = "name" +) -// UnmarshalInstanceGroupManagerPrototype unmarshals an instance of InstanceGroupManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return +// NewListSubnetReservedIpsOptions : Instantiate ListSubnetReservedIpsOptions +func (*VpcV1) NewListSubnetReservedIpsOptions(subnetID string) *ListSubnetReservedIpsOptions { + return &ListSubnetReservedIpsOptions{ + SubnetID: core.StringPtr(subnetID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerReference : InstanceGroupManagerReference struct -type InstanceGroupManagerReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` +// SetSubnetID : Allow user to set SubnetID +func (_options *ListSubnetReservedIpsOptions) SetSubnetID(subnetID string) *ListSubnetReservedIpsOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options } -// UnmarshalInstanceGroupManagerReference unmarshals an instance of InstanceGroupManagerReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListSubnetReservedIpsOptions) SetStart(start string) *ListSubnetReservedIpsOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupManagerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListSubnetReservedIpsOptions) SetLimit(limit int64) *ListSubnetReservedIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstanceGroupManagerReferenceDeleted unmarshals an instance of InstanceGroupManagerReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSort : Allow user to set Sort +func (_options *ListSubnetReservedIpsOptions) SetSort(sort string) *ListSubnetReservedIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// InstanceGroupManagerScheduledActionGroup : InstanceGroupManagerScheduledActionGroup struct -type InstanceGroupManagerScheduledActionGroup struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// SetTargetID : Allow user to set TargetID +func (_options *ListSubnetReservedIpsOptions) SetTargetID(targetID string) *ListSubnetReservedIpsOptions { + _options.TargetID = core.StringPtr(targetID) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionGroup unmarshals an instance of InstanceGroupManagerScheduledActionGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroup) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetTargetCRN : Allow user to set TargetCRN +func (_options *ListSubnetReservedIpsOptions) SetTargetCRN(targetCRN string) *ListSubnetReservedIpsOptions { + _options.TargetCRN = core.StringPtr(targetCRN) + return _options } -// InstanceGroupManagerScheduledActionGroupPrototype : InstanceGroupManagerScheduledActionGroupPrototype struct -type InstanceGroupManagerScheduledActionGroupPrototype struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// SetTargetName : Allow user to set TargetName +func (_options *ListSubnetReservedIpsOptions) SetTargetName(targetName string) *ListSubnetReservedIpsOptions { + _options.TargetName = core.StringPtr(targetName) + return _options } -// NewInstanceGroupManagerScheduledActionGroupPrototype : Instantiate InstanceGroupManagerScheduledActionGroupPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount int64) (_model *InstanceGroupManagerScheduledActionGroupPrototype, err error) { - _model = &InstanceGroupManagerScheduledActionGroupPrototype{ - MembershipCount: core.Int64Ptr(membershipCount), - } - err = core.ValidateStruct(_model, "required parameters") - return +// SetTargetResourceType : Allow user to set TargetResourceType +func (_options *ListSubnetReservedIpsOptions) SetTargetResourceType(targetResourceType string) *ListSubnetReservedIpsOptions { + _options.TargetResourceType = core.StringPtr(targetResourceType) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionGroupPrototype unmarshals an instance of InstanceGroupManagerScheduledActionGroupPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroupPrototype) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListSubnetReservedIpsOptions) SetHeaders(param map[string]string) *ListSubnetReservedIpsOptions { + options.Headers = param + return options } -// InstanceGroupManagerScheduledActionManager : InstanceGroupManagerScheduledActionManager struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerAutoScale -type InstanceGroupManagerScheduledActionManager struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` +// ListSubnetsOptions : The ListSubnets options. +type ListSubnetsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name,omitempty"` + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // Filters the collection to resources with a `vpc.id` property matching the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to subnets with a `routing_table.id` property matching the specified identifier. + RoutingTableID *string `json:"routing_table.id,omitempty"` + + // Filters the collection to subnets with a `routing_table.name` property matching the exact specified name. + RoutingTableName *string `json:"routing_table.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -func (*InstanceGroupManagerScheduledActionManager) isaInstanceGroupManagerScheduledActionManager() bool { - return true +// NewListSubnetsOptions : Instantiate ListSubnetsOptions +func (*VpcV1) NewListSubnetsOptions() *ListSubnetsOptions { + return &ListSubnetsOptions{} } -type InstanceGroupManagerScheduledActionManagerIntf interface { - isaInstanceGroupManagerScheduledActionManager() bool +// SetStart : Allow user to set Start +func (_options *ListSubnetsOptions) SetStart(start string) *ListSubnetsOptions { + _options.Start = core.StringPtr(start) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionManager unmarshals an instance of InstanceGroupManagerScheduledActionManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManager) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListSubnetsOptions) SetLimit(limit int64) *ListSubnetsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceGroupManagerScheduledActionManagerPrototype : InstanceGroupManagerScheduledActionManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototype struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSubnetsOptions) SetResourceGroupID(resourceGroupID string) *ListSubnetsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// SetZoneName : Allow user to set ZoneName +func (_options *ListSubnetsOptions) SetZoneName(zoneName string) *ListSubnetsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *ListSubnetsOptions) SetVPCID(vpcID string) *ListSubnetsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListSubnetsOptions) SetVPCCRN(vpcCRN string) *ListSubnetsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options } -func (*InstanceGroupManagerScheduledActionManagerPrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true +// SetVPCName : Allow user to set VPCName +func (_options *ListSubnetsOptions) SetVPCName(vpcName string) *ListSubnetsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options } -type InstanceGroupManagerScheduledActionManagerPrototypeIntf interface { - isaInstanceGroupManagerScheduledActionManagerPrototype() bool +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *ListSubnetsOptions) SetRoutingTableID(routingTableID string) *ListSubnetsOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototype) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetRoutingTableName : Allow user to set RoutingTableName +func (_options *ListSubnetsOptions) SetRoutingTableName(routingTableName string) *ListSubnetsOptions { + _options.RoutingTableName = core.StringPtr(routingTableName) + return _options } -// InstanceGroupMembership : InstanceGroupMembership struct -type InstanceGroupMembership struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListSubnetsOptions) SetHeaders(param map[string]string) *ListSubnetsOptions { + options.Headers = param + return options +} - // If set to true, when deleting the membership the instance will also be deleted. - DeleteInstanceOnMembershipDelete *bool `json:"delete_instance_on_membership_delete" validate:"required"` +// ListVirtualNetworkInterfaceIpsOptions : The ListVirtualNetworkInterfaceIps options. +type ListVirtualNetworkInterfaceIpsOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The URL for this instance group membership. - Href *string `json:"href" validate:"required"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The unique identifier for this instance group membership. - ID *string `json:"id" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - Instance *InstanceReference `json:"instance" validate:"required"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value + // `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` + // property in ascending order. + Sort *string `json:"sort,omitempty"` - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The name for this instance group membership. The name is unique across all memberships for the instance group. - Name *string `json:"name" validate:"required"` +// Constants associated with the ListVirtualNetworkInterfaceIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value +// `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` +// property in ascending order. +const ( + ListVirtualNetworkInterfaceIpsOptionsSortAddressConst = "address" + ListVirtualNetworkInterfaceIpsOptionsSortNameConst = "name" +) - PoolMember *LoadBalancerPoolMemberReference `json:"pool_member,omitempty"` +// NewListVirtualNetworkInterfaceIpsOptions : Instantiate ListVirtualNetworkInterfaceIpsOptions +func (*VpcV1) NewListVirtualNetworkInterfaceIpsOptions(virtualNetworkInterfaceID string) *ListVirtualNetworkInterfaceIpsOptions { + return &ListVirtualNetworkInterfaceIpsOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + } +} - // The status of the instance group membership - // - `deleting`: Membership is deleting dependent resources - // - `failed`: Membership was unable to maintain dependent resources - // - `healthy`: Membership is active and serving in the group - // - `pending`: Membership is waiting for dependent resources - // - `unhealthy`: Membership has unhealthy dependent resources. - Status *string `json:"status" validate:"required"` +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *ListVirtualNetworkInterfaceIpsOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *ListVirtualNetworkInterfaceIpsOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) + return _options +} - // The date and time that the instance group membership was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListVirtualNetworkInterfaceIpsOptions) SetStart(start string) *ListVirtualNetworkInterfaceIpsOptions { + _options.Start = core.StringPtr(start) + return _options } -// Constants associated with the InstanceGroupMembership.Status property. -// The status of the instance group membership -// - `deleting`: Membership is deleting dependent resources -// - `failed`: Membership was unable to maintain dependent resources -// - `healthy`: Membership is active and serving in the group -// - `pending`: Membership is waiting for dependent resources -// - `unhealthy`: Membership has unhealthy dependent resources. -const ( - InstanceGroupMembershipStatusDeletingConst = "deleting" - InstanceGroupMembershipStatusFailedConst = "failed" - InstanceGroupMembershipStatusHealthyConst = "healthy" - InstanceGroupMembershipStatusPendingConst = "pending" - InstanceGroupMembershipStatusUnhealthyConst = "unhealthy" -) +// SetLimit : Allow user to set Limit +func (_options *ListVirtualNetworkInterfaceIpsOptions) SetLimit(limit int64) *ListVirtualNetworkInterfaceIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} -// UnmarshalInstanceGroupMembership unmarshals an instance of InstanceGroupMembership from the specified map of raw messages. -func UnmarshalInstanceGroupMembership(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembership) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_instance_on_membership_delete", &obj.DeleteInstanceOnMembershipDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool_member", &obj.PoolMember, UnmarshalLoadBalancerPoolMemberReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSort : Allow user to set Sort +func (_options *ListVirtualNetworkInterfaceIpsOptions) SetSort(sort string) *ListVirtualNetworkInterfaceIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// InstanceGroupMembershipCollection : InstanceGroupMembershipCollection struct -type InstanceGroupMembershipCollection struct { - // A link to the first page of resources. - First *InstanceGroupMembershipCollectionFirst `json:"first" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListVirtualNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListVirtualNetworkInterfaceIpsOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// ListVirtualNetworkInterfacesOptions : The ListVirtualNetworkInterfaces options. +type ListVirtualNetworkInterfacesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // Collection of instance group memberships. - Memberships []InstanceGroupMembership `json:"memberships" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupMembershipCollectionNext `json:"next,omitempty"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupMembershipCollection unmarshals an instance of InstanceGroupMembershipCollection from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupMembershipCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memberships", &obj.Memberships, UnmarshalInstanceGroupMembership) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupMembershipCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// NewListVirtualNetworkInterfacesOptions : Instantiate ListVirtualNetworkInterfacesOptions +func (*VpcV1) NewListVirtualNetworkInterfacesOptions() *ListVirtualNetworkInterfacesOptions { + return &ListVirtualNetworkInterfacesOptions{} } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupMembershipCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetStart : Allow user to set Start +func (_options *ListVirtualNetworkInterfacesOptions) SetStart(start string) *ListVirtualNetworkInterfacesOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupMembershipCollectionFirst : A link to the first page of resources. -type InstanceGroupMembershipCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListVirtualNetworkInterfacesOptions) SetLimit(limit int64) *ListVirtualNetworkInterfacesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstanceGroupMembershipCollectionFirst unmarshals an instance of InstanceGroupMembershipCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVirtualNetworkInterfacesOptions) SetResourceGroupID(resourceGroupID string) *ListVirtualNetworkInterfacesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options } -// InstanceGroupMembershipCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupMembershipCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListVirtualNetworkInterfacesOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupMembershipCollectionNext unmarshals an instance of InstanceGroupMembershipCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// ListVolumeProfilesOptions : The ListVolumeProfiles options. +type ListVolumeProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// InstanceGroupMembershipPatch : InstanceGroupMembershipPatch struct -type InstanceGroupMembershipPatch struct { - // The name for this instance group membership. The name must not be used by another membership for the instance group - // manager. - Name *string `json:"name,omitempty"` +// NewListVolumeProfilesOptions : Instantiate ListVolumeProfilesOptions +func (*VpcV1) NewListVolumeProfilesOptions() *ListVolumeProfilesOptions { + return &ListVolumeProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListVolumeProfilesOptions) SetStart(start string) *ListVolumeProfilesOptions { + _options.Start = core.StringPtr(start) + return _options } -// UnmarshalInstanceGroupMembershipPatch unmarshals an instance of InstanceGroupMembershipPatch from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListVolumeProfilesOptions) SetLimit(limit int64) *ListVolumeProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// AsPatch returns a generic map representation of the InstanceGroupMembershipPatch -func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupMembershipPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *ListVolumeProfilesOptions) SetHeaders(param map[string]string) *ListVolumeProfilesOptions { + options.Headers = param + return options } -// InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. -type InstanceGroupPatch struct { - // The port to use for new load balancer pool members created by this instance group. - // - // This property must be set if and only if `load_balancer_pool` has been set. - ApplicationPort *int64 `json:"application_port,omitempty"` +// ListVolumesOptions : The ListVolumes options. +type ListVolumesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // Instance template to use when creating new instances. - // - // Instance groups are not compatible with instance templates that specify `true` for - // `default_trusted_profile.auto_link`. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The load balancer associated with `load_balancer_pool`. - // The load balancer must have `instance_groups_supported` set to `true`. - // - // This property must be set if and only if `load_balancer_pool` has been set. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - // If specified, this instance group will manage the load balancer pool. A pool member - // will be created for each instance created by this group. The specified load - // balancer pool must not be used by another instance group in the VPC. + // Filters the collection to volumes with an `attachment_state` property matching the specified value. + AttachmentState *string `json:"attachment_state,omitempty"` + + // Filters the collection to resources with an `encryption` property matching the specified value. + Encryption *string `json:"encryption,omitempty"` + + // Filters the collection to resources with an `operating_system.family` property matching the specified operating + // system family. // - // If set, `load_balancer` and `application_port` must also be set. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // operating system or any operating system, respectively. + OperatingSystemFamily *string `json:"operating_system.family,omitempty"` - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` + // Filters the collection to resources with an `operating_system.architecture` property matching the specified + // operating system architecture. + // + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // operating system or any operating system, respectively. + OperatingSystemArchitecture *string `json:"operating_system.architecture,omitempty"` - // The name for this instance group. The name must not be used by another instance group in the region. - Name *string `json:"name,omitempty"` + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupPatch unmarshals an instance of InstanceGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupPatch) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer", &obj.LoadBalancer, UnmarshalLoadBalancerIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// Constants associated with the ListVolumesOptions.AttachmentState property. +// Filters the collection to volumes with an `attachment_state` property matching the specified value. +const ( + ListVolumesOptionsAttachmentStateAttachedConst = "attached" + ListVolumesOptionsAttachmentStateUnattachedConst = "unattached" + ListVolumesOptionsAttachmentStateUnusableConst = "unusable" +) + +// Constants associated with the ListVolumesOptions.Encryption property. +// Filters the collection to resources with an `encryption` property matching the specified value. +const ( + ListVolumesOptionsEncryptionProviderManagedConst = "provider_managed" + ListVolumesOptionsEncryptionUserManagedConst = "user_managed" +) + +// NewListVolumesOptions : Instantiate ListVolumesOptions +func (*VpcV1) NewListVolumesOptions() *ListVolumesOptions { + return &ListVolumesOptions{} } -// AsPatch returns a generic map representation of the InstanceGroupPatch -func (instanceGroupPatch *InstanceGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetStart : Allow user to set Start +func (_options *ListVolumesOptions) SetStart(start string) *ListVolumesOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceGroupReference : InstanceGroupReference struct -type InstanceGroupReference struct { - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListVolumesOptions) SetLimit(limit int64) *ListVolumesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupReferenceDeleted `json:"deleted,omitempty"` +// SetName : Allow user to set Name +func (_options *ListVolumesOptions) SetName(name string) *ListVolumesOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The URL for this instance group. - Href *string `json:"href" validate:"required"` +// SetAttachmentState : Allow user to set AttachmentState +func (_options *ListVolumesOptions) SetAttachmentState(attachmentState string) *ListVolumesOptions { + _options.AttachmentState = core.StringPtr(attachmentState) + return _options +} - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` +// SetEncryption : Allow user to set Encryption +func (_options *ListVolumesOptions) SetEncryption(encryption string) *ListVolumesOptions { + _options.Encryption = core.StringPtr(encryption) + return _options +} - // The name for this instance group. The name is unique across all instance groups in the region. - Name *string `json:"name" validate:"required"` +// SetOperatingSystemFamily : Allow user to set OperatingSystemFamily +func (_options *ListVolumesOptions) SetOperatingSystemFamily(operatingSystemFamily string) *ListVolumesOptions { + _options.OperatingSystemFamily = core.StringPtr(operatingSystemFamily) + return _options } -// UnmarshalInstanceGroupReference unmarshals an instance of InstanceGroupReference from the specified map of raw messages. -func UnmarshalInstanceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetOperatingSystemArchitecture : Allow user to set OperatingSystemArchitecture +func (_options *ListVolumesOptions) SetOperatingSystemArchitecture(operatingSystemArchitecture string) *ListVolumesOptions { + _options.OperatingSystemArchitecture = core.StringPtr(operatingSystemArchitecture) + return _options } -// InstanceGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetZoneName : Allow user to set ZoneName +func (_options *ListVolumesOptions) SetZoneName(zoneName string) *ListVolumesOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options } -// UnmarshalInstanceGroupReferenceDeleted unmarshals an instance of InstanceGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListVolumesOptions) SetHeaders(param map[string]string) *ListVolumesOptions { + options.Headers = param + return options } -// InstanceHealthReason : InstanceHealthReason struct -type InstanceHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` +// ListVPCAddressPrefixesOptions : The ListVPCAddressPrefixes options. +type ListVPCAddressPrefixesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` -// Constants associated with the InstanceHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - InstanceHealthReasonCodeReservationCapacityUnavailableConst = "reservation_capacity_unavailable" - InstanceHealthReasonCodeReservationDeletedConst = "reservation_deleted" - InstanceHealthReasonCodeReservationExpiredConst = "reservation_expired" - InstanceHealthReasonCodeReservationFailedConst = "reservation_failed" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalInstanceHealthReason unmarshals an instance of InstanceHealthReason from the specified map of raw messages. -func UnmarshalInstanceHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewListVPCAddressPrefixesOptions : Instantiate ListVPCAddressPrefixesOptions +func (*VpcV1) NewListVPCAddressPrefixesOptions(vpcID string) *ListVPCAddressPrefixesOptions { + return &ListVPCAddressPrefixesOptions{ + VPCID: core.StringPtr(vpcID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceInitialization : InstanceInitialization struct -type InstanceInitialization struct { - // The default trusted profile configuration specified at virtual server instance - // creation. If absent, no default trusted profile was specified. - DefaultTrustedProfile *InstanceInitializationDefaultTrustedProfile `json:"default_trusted_profile,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCAddressPrefixesOptions) SetVPCID(vpcID string) *ListVPCAddressPrefixesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The public SSH keys used at instance initialization. - Keys []KeyReference `json:"keys" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListVPCAddressPrefixesOptions) SetStart(start string) *ListVPCAddressPrefixesOptions { + _options.Start = core.StringPtr(start) + return _options +} - Password *InstanceInitializationPassword `json:"password,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListVPCAddressPrefixesOptions) SetLimit(limit int64) *ListVPCAddressPrefixesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstanceInitialization unmarshals an instance of InstanceInitialization from the specified map of raw messages. -func UnmarshalInstanceInitialization(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitialization) - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceInitializationDefaultTrustedProfile) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "password", &obj.Password, UnmarshalInstanceInitializationPassword) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListVPCAddressPrefixesOptions) SetHeaders(param map[string]string) *ListVPCAddressPrefixesOptions { + options.Headers = param + return options } -// InstanceInitializationDefaultTrustedProfile : InstanceInitializationDefaultTrustedProfile struct -type InstanceInitializationDefaultTrustedProfile struct { - // If set to `true`, the system created a link to the specified `target` trusted profile during instance creation. - // Regardless of whether a link was created by the system or manually using the IAM Identity service, it will be - // automatically deleted when the instance is deleted. - AutoLink *bool `json:"auto_link" validate:"required"` +// ListVPCDnsResolutionBindingsOptions : The ListVPCDnsResolutionBindings options. +type ListVPCDnsResolutionBindingsOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The default IAM trusted profile to use for this virtual server instance. - Target *TrustedProfileReference `json:"target" validate:"required"` -} + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` -// UnmarshalInstanceInitializationDefaultTrustedProfile unmarshals an instance of InstanceInitializationDefaultTrustedProfile from the specified map of raw messages. -func UnmarshalInstanceInitializationDefaultTrustedProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitializationDefaultTrustedProfile) - err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` -// InstanceInitializationPassword : InstanceInitializationPassword struct -type InstanceInitializationPassword struct { - // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The public SSH key used to encrypt the administrator password. - EncryptionKey *KeyIdentityByFingerprint `json:"encryption_key" validate:"required"` -} + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` -// UnmarshalInstanceInitializationPassword unmarshals an instance of InstanceInitializationPassword from the specified map of raw messages. -func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitializationPassword) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyIdentityByFingerprint) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` -// InstanceLifecycleReason : InstanceLifecycleReason struct -type InstanceLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` + // Filters the collection to resources with a `vpc.name` property matching the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` + // Filters the collection to resources with a `vpc.remote.account.id` property matching the specified account + // identifier. + AccountID *string `json:"account.id,omitempty"` - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. +// Constants associated with the ListVPCDnsResolutionBindingsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" + ListVPCDnsResolutionBindingsOptionsSortCreatedAtConst = "created_at" + ListVPCDnsResolutionBindingsOptionsSortNameConst = "name" ) -// UnmarshalInstanceLifecycleReason unmarshals an instance of InstanceLifecycleReason from the specified map of raw messages. -func UnmarshalInstanceLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewListVPCDnsResolutionBindingsOptions : Instantiate ListVPCDnsResolutionBindingsOptions +func (*VpcV1) NewListVPCDnsResolutionBindingsOptions(vpcID string) *ListVPCDnsResolutionBindingsOptions { + return &ListVPCDnsResolutionBindingsOptions{ + VPCID: core.StringPtr(vpcID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceMetadataService : The metadata service configuration. -type InstanceMetadataService struct { - // Indicates whether the metadata service endpoint is available to the virtual server instance. - Enabled *bool `json:"enabled" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCID(vpcID string) *ListVPCDnsResolutionBindingsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol" validate:"required"` +// SetSort : Allow user to set Sort +func (_options *ListVPCDnsResolutionBindingsOptions) SetSort(sort string) *ListVPCDnsResolutionBindingsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListVPCDnsResolutionBindingsOptions) SetStart(start string) *ListVPCDnsResolutionBindingsOptions { + _options.Start = core.StringPtr(start) + return _options } -// Constants associated with the InstanceMetadataService.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServiceProtocolHTTPConst = "http" - InstanceMetadataServiceProtocolHTTPSConst = "https" -) +// SetLimit : Allow user to set Limit +func (_options *ListVPCDnsResolutionBindingsOptions) SetLimit(limit int64) *ListVPCDnsResolutionBindingsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} -// UnmarshalInstanceMetadataService unmarshals an instance of InstanceMetadataService from the specified map of raw messages. -func UnmarshalInstanceMetadataService(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataService) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetName : Allow user to set Name +func (_options *ListVPCDnsResolutionBindingsOptions) SetName(name string) *ListVPCDnsResolutionBindingsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCCRN(vpcCRN string) *ListVPCDnsResolutionBindingsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCName(vpcName string) *ListVPCDnsResolutionBindingsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetAccountID : Allow user to set AccountID +func (_options *ListVPCDnsResolutionBindingsOptions) SetAccountID(accountID string) *ListVPCDnsResolutionBindingsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPCDnsResolutionBindingsOptions) SetHeaders(param map[string]string) *ListVPCDnsResolutionBindingsOptions { + options.Headers = param + return options } -// InstanceMetadataServicePatch : The metadata service configuration. -type InstanceMetadataServicePatch struct { - // Indicates whether the metadata service endpoint will be available to the virtual server instance. - Enabled *bool `json:"enabled,omitempty"` +// ListVPCRoutesOptions : The ListVPCRoutes options. +type ListVPCRoutesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol,omitempty"` + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` -} + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` -// Constants associated with the InstanceMetadataServicePatch.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServicePatchProtocolHTTPConst = "http" - InstanceMetadataServicePatchProtocolHTTPSConst = "https" -) + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` -// UnmarshalInstanceMetadataServicePatch unmarshals an instance of InstanceMetadataServicePatch from the specified map of raw messages. -func UnmarshalInstanceMetadataServicePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataServicePatch) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// InstanceMetadataServicePrototype : The metadata service configuration. -type InstanceMetadataServicePrototype struct { - // Indicates whether the metadata service endpoint will be available to the virtual server instance. - Enabled *bool `json:"enabled,omitempty"` - - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol,omitempty"` +// NewListVPCRoutesOptions : Instantiate ListVPCRoutesOptions +func (*VpcV1) NewListVPCRoutesOptions(vpcID string) *ListVPCRoutesOptions { + return &ListVPCRoutesOptions{ + VPCID: core.StringPtr(vpcID), + } +} - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// Constants associated with the InstanceMetadataServicePrototype.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServicePrototypeProtocolHTTPConst = "http" - InstanceMetadataServicePrototypeProtocolHTTPSConst = "https" -) +// SetZoneName : Allow user to set ZoneName +func (_options *ListVPCRoutesOptions) SetZoneName(zoneName string) *ListVPCRoutesOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} -// UnmarshalInstanceMetadataServicePrototype unmarshals an instance of InstanceMetadataServicePrototype from the specified map of raw messages. -func UnmarshalInstanceMetadataServicePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataServicePrototype) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListVPCRoutesOptions) SetStart(start string) *ListVPCRoutesOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstancePatch : InstancePatch struct -type InstancePatch struct { - // The availability policy for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPatch `json:"availability_policy,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutesOptions) SetLimit(limit int64) *ListVPCRoutesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The metadata service configuration. - MetadataService *InstanceMetadataServicePatch `json:"metadata_service,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutesOptions { + options.Headers = param + return options +} - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. Changing the name will not affect the system hostname. - Name *string `json:"name,omitempty"` +// ListVPCRoutingTableRoutesOptions : The ListVPCRoutingTableRoutes options. +type ListVPCRoutingTableRoutesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The placement restrictions to use for the virtual server instance. For the placement - // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. - // - // If set, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The profile to use for this virtual server instance. For the profile to be changed, - // the instance `status` must be `stopping` or `stopped`. In addition, the requested - // profile must: - // - Have matching instance disk support. Any disks associated with the current profile - // will be deleted, and any disks associated with the requested profile will be - // created. - // - Be compatible with any `placement_target` constraints. For example, if the - // instance is placed on a dedicated host, the requested profile `family` must be - // the same as the dedicated host `family`. - // - Have the same `vcpu.architecture`. - // - Support the number of network interfaces the instance currently has. - Profile InstancePatchProfileIntf `json:"profile,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. -func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatch) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstancePatchProfile) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return +// NewListVPCRoutingTableRoutesOptions : Instantiate ListVPCRoutingTableRoutesOptions +func (*VpcV1) NewListVPCRoutingTableRoutesOptions(vpcID string, routingTableID string) *ListVPCRoutingTableRoutesOptions { + return &ListVPCRoutingTableRoutesOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the InstancePatch -func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instancePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutingTableRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutingTableRoutesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// InstancePatchProfile : The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be -// `stopping` or `stopped`. In addition, the requested profile must: -// - Have matching instance disk support. Any disks associated with the current profile -// will be deleted, and any disks associated with the requested profile will be -// created. -// - Be compatible with any `placement_target` constraints. For example, if the -// instance is placed on a dedicated host, the requested profile `family` must be -// the same as the dedicated host `family`. -// - Have the same `vcpu.architecture`. -// - Support the number of network interfaces the instance currently has. -// -// Models which "extend" this model: -// - InstancePatchProfileInstanceProfileIdentityByName -// - InstancePatchProfileInstanceProfileIdentityByHref -type InstancePatchProfile struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *ListVPCRoutingTableRoutesOptions) SetRoutingTableID(routingTableID string) *ListVPCRoutingTableRoutesOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options } -func (*InstancePatchProfile) isaInstancePatchProfile() bool { - return true +// SetStart : Allow user to set Start +func (_options *ListVPCRoutingTableRoutesOptions) SetStart(start string) *ListVPCRoutingTableRoutesOptions { + _options.Start = core.StringPtr(start) + return _options } -type InstancePatchProfileIntf interface { - isaInstancePatchProfile() bool +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutingTableRoutesOptions) SetLimit(limit int64) *ListVPCRoutingTableRoutesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstancePatchProfile unmarshals an instance of InstancePatchProfile from the specified map of raw messages. -func UnmarshalInstancePatchProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfile) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutingTableRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTableRoutesOptions { + options.Headers = param + return options } -// InstancePlacementTarget : InstancePlacementTarget struct -// Models which "extend" this model: -// - InstancePlacementTargetDedicatedHostGroupReference -// - InstancePlacementTargetDedicatedHostReference -// - InstancePlacementTargetPlacementGroupReference -type InstancePlacementTarget struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` +// ListVPCRoutingTablesOptions : The ListVPCRoutingTables options. +type ListVPCRoutingTablesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` + // Filters the collection to routing tables with an `is_default` property matching the specified value. + IsDefault *bool `json:"is_default,omitempty"` - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// NewListVPCRoutingTablesOptions : Instantiate ListVPCRoutingTablesOptions +func (*VpcV1) NewListVPCRoutingTablesOptions(vpcID string) *ListVPCRoutingTablesOptions { + return &ListVPCRoutingTablesOptions{ + VPCID: core.StringPtr(vpcID), + } } -// Constants associated with the InstancePlacementTarget.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutingTablesOptions) SetVPCID(vpcID string) *ListVPCRoutingTablesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} -func (*InstancePlacementTarget) isaInstancePlacementTarget() bool { - return true +// SetStart : Allow user to set Start +func (_options *ListVPCRoutingTablesOptions) SetStart(start string) *ListVPCRoutingTablesOptions { + _options.Start = core.StringPtr(start) + return _options } -type InstancePlacementTargetIntf interface { - isaInstancePlacementTarget() bool +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutingTablesOptions) SetLimit(limit int64) *ListVPCRoutingTablesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalInstancePlacementTarget unmarshals an instance of InstancePlacementTarget from the specified map of raw messages. -func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetIsDefault : Allow user to set IsDefault +func (_options *ListVPCRoutingTablesOptions) SetIsDefault(isDefault bool) *ListVPCRoutingTablesOptions { + _options.IsDefault = core.BoolPtr(isDefault) + return _options } -// InstancePlacementTargetPatch : InstancePlacementTargetPatch struct -// Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostIdentity -// - InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatch struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutingTablesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTablesOptions { + options.Headers = param + return options +} - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` +// ListVpcsOptions : The ListVpcs options. +type ListVpcsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` -func (*InstancePlacementTargetPatch) isaInstancePlacementTargetPatch() bool { - return true + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to VPCs with a `classic_access` property matching the specified value. + ClassicAccess *bool `json:"classic_access,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -type InstancePlacementTargetPatchIntf interface { - isaInstancePlacementTargetPatch() bool +// NewListVpcsOptions : Instantiate ListVpcsOptions +func (*VpcV1) NewListVpcsOptions() *ListVpcsOptions { + return &ListVpcsOptions{} } -// UnmarshalInstancePlacementTargetPatch unmarshals an instance of InstancePlacementTargetPatch from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListVpcsOptions) SetStart(start string) *ListVpcsOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstancePlacementTargetPrototype : InstancePlacementTargetPrototype struct -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostIdentity -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -// - InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototype struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListVpcsOptions) SetLimit(limit int64) *ListVpcsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVpcsOptions) SetResourceGroupID(resourceGroupID string) *ListVpcsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` +// SetClassicAccess : Allow user to set ClassicAccess +func (_options *ListVpcsOptions) SetClassicAccess(classicAccess bool) *ListVpcsOptions { + _options.ClassicAccess = core.BoolPtr(classicAccess) + return _options } -func (*InstancePlacementTargetPrototype) isaInstancePlacementTargetPrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOptions { + options.Headers = param + return options } -type InstancePlacementTargetPrototypeIntf interface { - isaInstancePlacementTargetPrototype() bool +// ListVPNGatewayConnectionLocalCIDRsOptions : The ListVPNGatewayConnectionLocalCIDRs options. +type ListVPNGatewayConnectionLocalCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstancePlacementTargetPrototype unmarshals an instance of InstancePlacementTargetPrototype from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewListVPNGatewayConnectionLocalCIDRsOptions : Instantiate ListVPNGatewayConnectionLocalCIDRsOptions +func (*VpcV1) NewListVPNGatewayConnectionLocalCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionLocalCIDRsOptions { + return &ListVPNGatewayConnectionLocalCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceProfile : InstanceProfile struct -type InstanceProfile struct { - Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionLocalCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - // Collection of the instance profile's disks. - Disks []InstanceProfileDisk `json:"disks" validate:"required"` +// SetID : Allow user to set ID +func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionLocalCIDRsOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The product family this virtual server instance profile belongs to. - Family *string `json:"family" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionLocalCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionLocalCIDRsOptions { + options.Headers = param + return options +} + +// ListVPNGatewayConnectionPeerCIDRsOptions : The ListVPNGatewayConnectionPeerCIDRs options. +type ListVPNGatewayConnectionPeerCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} - GpuCount InstanceProfileGpuIntf `json:"gpu_count,omitempty"` +// NewListVPNGatewayConnectionPeerCIDRsOptions : Instantiate ListVPNGatewayConnectionPeerCIDRsOptions +func (*VpcV1) NewListVPNGatewayConnectionPeerCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionPeerCIDRsOptions { + return &ListVPNGatewayConnectionPeerCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} - GpuManufacturer *InstanceProfileGpuManufacturer `json:"gpu_manufacturer,omitempty"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionPeerCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - GpuMemory InstanceProfileGpuMemoryIntf `json:"gpu_memory,omitempty"` +// SetID : Allow user to set ID +func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionPeerCIDRsOptions { + _options.ID = core.StringPtr(id) + return _options +} - GpuModel *InstanceProfileGpuModel `json:"gpu_model,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionPeerCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionPeerCIDRsOptions { + options.Headers = param + return options +} - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` +// ListVPNGatewayConnectionsOptions : The ListVPNGatewayConnections options. +type ListVPNGatewayConnectionsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - Memory InstanceProfileMemoryIntf `json:"memory" validate:"required"` + // Filters the collection to VPN gateway connections with a `status` property matching the specified value. + Status *string `json:"status,omitempty"` - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - NetworkInterfaceCount InstanceProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` +// Constants associated with the ListVPNGatewayConnectionsOptions.Status property. +// Filters the collection to VPN gateway connections with a `status` property matching the specified value. +const ( + ListVPNGatewayConnectionsOptionsStatusDownConst = "down" + ListVPNGatewayConnectionsOptionsStatusUpConst = "up" +) - NumaCount InstanceProfileNumaCountIntf `json:"numa_count,omitempty"` +// NewListVPNGatewayConnectionsOptions : Instantiate ListVPNGatewayConnectionsOptions +func (*VpcV1) NewListVPNGatewayConnectionsOptions(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { + return &ListVPNGatewayConnectionsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} - OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` +// SetStatus : Allow user to set Status +func (_options *ListVPNGatewayConnectionsOptions) SetStatus(status string) *ListVPNGatewayConnectionsOptions { + _options.Status = core.StringPtr(status) + return _options +} - ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionsOptions { + options.Headers = param + return options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// ListVPNGatewaysOptions : The ListVPNGateways options. +type ListVPNGatewaysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The status of the instance profile: - // - `previous`: This instance profile is an older revision, but remains provisionable and - // usable. - // - `current`: This profile is the latest revision. - // - // Note that revisions are indicated by the generation of an instance profile. Refer to the - // [profile naming conventions] - // (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how - // generations are defined within an instance profile. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` - VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` + // Filters the collection to VPN gateways with a `mode` property matching the specified value. + Mode *string `json:"mode,omitempty"` - VcpuManufacturer *InstanceProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceProfile.ResourceType property. -// The resource type. +// Constants associated with the ListVPNGatewaysOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceProfileResourceTypeInstanceProfileConst = "instance_profile" + ListVPNGatewaysOptionsSortCreatedAtConst = "created_at" + ListVPNGatewaysOptionsSortNameConst = "name" ) -// Constants associated with the InstanceProfile.Status property. -// The status of the instance profile: -// - `previous`: This instance profile is an older revision, but remains provisionable and -// usable. -// - `current`: This profile is the latest revision. -// -// Note that revisions are indicated by the generation of an instance profile. Refer to the -// [profile naming conventions] -// (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how -// generations are defined within an instance profile. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the -// unexpected property value was encountered. +// Constants associated with the ListVPNGatewaysOptions.Mode property. +// Filters the collection to VPN gateways with a `mode` property matching the specified value. const ( - InstanceProfileStatusCurrentConst = "current" - InstanceProfileStatusPreviousConst = "previous" + ListVPNGatewaysOptionsModePolicyConst = "policy" + ListVPNGatewaysOptionsModeRouteConst = "route" ) -// UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. -func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfile) - err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceProfileDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_count", &obj.GpuCount, UnmarshalInstanceProfileGpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_manufacturer", &obj.GpuManufacturer, UnmarshalInstanceProfileGpuManufacturer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_memory", &obj.GpuMemory, UnmarshalInstanceProfileGpuMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_model", &obj.GpuModel, UnmarshalInstanceProfileGpuModel) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalInstanceProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalInstanceProfileNetworkInterfaceCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "numa_count", &obj.NumaCount, UnmarshalInstanceProfileNumaCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "port_speed", &obj.PortSpeed, UnmarshalInstanceProfilePortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_terms", &obj.ReservationTerms, UnmarshalInstanceProfileReservationTerms) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalInstanceProfileVcpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalInstanceProfileVcpuManufacturer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// NewListVPNGatewaysOptions : Instantiate ListVPNGatewaysOptions +func (*VpcV1) NewListVPNGatewaysOptions() *ListVPNGatewaysOptions { + return &ListVPNGatewaysOptions{} } -// InstanceProfileBandwidth : InstanceProfileBandwidth struct -// Models which "extend" this model: -// - InstanceProfileBandwidthFixed -// - InstanceProfileBandwidthRange -// - InstanceProfileBandwidthEnum -// - InstanceProfileBandwidthDependent -type InstanceProfileBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetStart : Allow user to set Start +func (_options *ListVPNGatewaysOptions) SetStart(start string) *ListVPNGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListVPNGatewaysOptions) SetLimit(limit int64) *ListVPNGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVPNGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListVPNGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// SetSort : Allow user to set Sort +func (_options *ListVPNGatewaysOptions) SetSort(sort string) *ListVPNGatewaysOptions { + _options.Sort = core.StringPtr(sort) + return _options +} - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` +// SetMode : Allow user to set Mode +func (_options *ListVPNGatewaysOptions) SetMode(mode string) *ListVPNGatewaysOptions { + _options.Mode = core.StringPtr(mode) + return _options +} - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewaysOptions) SetHeaders(param map[string]string) *ListVPNGatewaysOptions { + options.Headers = param + return options } -// Constants associated with the InstanceProfileBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthTypeFixedConst = "fixed" -) +// ListVPNServerClientsOptions : The ListVPNServerClients options. +type ListVPNServerClientsOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` -func (*InstanceProfileBandwidth) isaInstanceProfileBandwidth() bool { - return true -} + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` -type InstanceProfileBandwidthIntf interface { - isaInstanceProfileBandwidth() bool -} + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` -// UnmarshalInstanceProfileBandwidth unmarshals an instance of InstanceProfileBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order. + Sort *string `json:"sort,omitempty"` -// InstanceProfileCollection : InstanceProfileCollection struct -type InstanceProfileCollection struct { - // Collection of virtual server instance profiles. - Profiles []InstanceProfile `json:"profiles" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceProfileCollection unmarshals an instance of InstanceProfileCollection from the specified map of raw messages. -func UnmarshalInstanceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileCollection) - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) - if err != nil { - return +// Constants associated with the ListVPNServerClientsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order. +const ( + ListVPNServerClientsOptionsSortCreatedAtConst = "created_at" +) + +// NewListVPNServerClientsOptions : Instantiate ListVPNServerClientsOptions +func (*VpcV1) NewListVPNServerClientsOptions(vpnServerID string) *ListVPNServerClientsOptions { + return &ListVPNServerClientsOptions{ + VPNServerID: core.StringPtr(vpnServerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceProfileDisk : Disks provided by this profile. -type InstanceProfileDisk struct { - Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` - - Size InstanceProfileDiskSizeIntf `json:"size" validate:"required"` +// SetVPNServerID : Allow user to set VPNServerID +func (_options *ListVPNServerClientsOptions) SetVPNServerID(vpnServerID string) *ListVPNServerClientsOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) + return _options +} - SupportedInterfaceTypes *InstanceProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` +// SetStart : Allow user to set Start +func (_options *ListVPNServerClientsOptions) SetStart(start string) *ListVPNServerClientsOptions { + _options.Start = core.StringPtr(start) + return _options } -// UnmarshalInstanceProfileDisk unmarshals an instance of InstanceProfileDisk from the specified map of raw messages. -func UnmarshalInstanceProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDisk) - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalInstanceProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalInstanceProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalInstanceProfileDiskSupportedInterfaces) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListVPNServerClientsOptions) SetLimit(limit int64) *ListVPNServerClientsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// InstanceProfileDiskQuantity : InstanceProfileDiskQuantity struct -// Models which "extend" this model: -// - InstanceProfileDiskQuantityFixed -// - InstanceProfileDiskQuantityRange -// - InstanceProfileDiskQuantityEnum -// - InstanceProfileDiskQuantityDependent -type InstanceProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetSort : Allow user to set Sort +func (_options *ListVPNServerClientsOptions) SetSort(sort string) *ListVPNServerClientsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNServerClientsOptions) SetHeaders(param map[string]string) *ListVPNServerClientsOptions { + options.Headers = param + return options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// ListVPNServerRoutesOptions : The ListVPNServerRoutes options. +type ListVPNServerRoutesOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceProfileDiskQuantity.Type property. -// The type for this profile field. +// Constants associated with the ListVPNServerRoutesOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceProfileDiskQuantityTypeFixedConst = "fixed" + ListVPNServerRoutesOptionsSortCreatedAtConst = "created_at" + ListVPNServerRoutesOptionsSortNameConst = "name" ) -func (*InstanceProfileDiskQuantity) isaInstanceProfileDiskQuantity() bool { - return true +// NewListVPNServerRoutesOptions : Instantiate ListVPNServerRoutesOptions +func (*VpcV1) NewListVPNServerRoutesOptions(vpnServerID string) *ListVPNServerRoutesOptions { + return &ListVPNServerRoutesOptions{ + VPNServerID: core.StringPtr(vpnServerID), + } } -type InstanceProfileDiskQuantityIntf interface { - isaInstanceProfileDiskQuantity() bool +// SetVPNServerID : Allow user to set VPNServerID +func (_options *ListVPNServerRoutesOptions) SetVPNServerID(vpnServerID string) *ListVPNServerRoutesOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) + return _options } -// UnmarshalInstanceProfileDiskQuantity unmarshals an instance of InstanceProfileDiskQuantity from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListVPNServerRoutesOptions) SetStart(start string) *ListVPNServerRoutesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPNServerRoutesOptions) SetLimit(limit int64) *ListVPNServerRoutesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListVPNServerRoutesOptions) SetSort(sort string) *ListVPNServerRoutesOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// InstanceProfileDiskSize : InstanceProfileDiskSize struct -// Models which "extend" this model: -// - InstanceProfileDiskSizeFixed -// - InstanceProfileDiskSizeRange -// - InstanceProfileDiskSizeEnum -// - InstanceProfileDiskSizeDependent -type InstanceProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListVPNServerRoutesOptions) SetHeaders(param map[string]string) *ListVPNServerRoutesOptions { + options.Headers = param + return options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// ListVPNServersOptions : The ListVPNServers options. +type ListVPNServersOptions struct { + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceProfileDiskSize.Type property. -// The type for this profile field. +// Constants associated with the ListVPNServersOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - InstanceProfileDiskSizeTypeFixedConst = "fixed" + ListVPNServersOptionsSortCreatedAtConst = "created_at" + ListVPNServersOptionsSortNameConst = "name" ) -func (*InstanceProfileDiskSize) isaInstanceProfileDiskSize() bool { - return true +// NewListVPNServersOptions : Instantiate ListVPNServersOptions +func (*VpcV1) NewListVPNServersOptions() *ListVPNServersOptions { + return &ListVPNServersOptions{} } -type InstanceProfileDiskSizeIntf interface { - isaInstanceProfileDiskSize() bool +// SetName : Allow user to set Name +func (_options *ListVPNServersOptions) SetName(name string) *ListVPNServersOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalInstanceProfileDiskSize unmarshals an instance of InstanceProfileDiskSize from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListVPNServersOptions) SetStart(start string) *ListVPNServersOptions { + _options.Start = core.StringPtr(start) + return _options } -// InstanceProfileDiskSupportedInterfaces : InstanceProfileDiskSupportedInterfaces struct -type InstanceProfileDiskSupportedInterfaces struct { - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Default *string `json:"default" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListVPNServersOptions) SetLimit(limit int64) *ListVPNServersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVPNServersOptions) SetResourceGroupID(resourceGroupID string) *ListVPNServersOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} - // The supported disk interfaces used for attaching the disk. - Values []string `json:"values" validate:"required"` +// SetSort : Allow user to set Sort +func (_options *ListVPNServersOptions) SetSort(sort string) *ListVPNServersOptions { + _options.Sort = core.StringPtr(sort) + return _options } -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Default property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesDefaultVirtioBlkConst = "virtio_blk" -) +// SetHeaders : Allow user to set Headers +func (options *ListVPNServersOptions) SetHeaders(param map[string]string) *ListVPNServersOptions { + options.Headers = param + return options +} -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSupportedInterfacesTypeEnumConst = "enum" -) +// LoadBalancer : LoadBalancer struct +type LoadBalancer struct { + // The date and time that this load balancer was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Values property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesValuesVirtioBlkConst = "virtio_blk" -) + // The load balancer's CRN. + CRN *string `json:"crn" validate:"required"` -// UnmarshalInstanceProfileDiskSupportedInterfaces unmarshals an instance of InstanceProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The DNS configuration for this load balancer. + // + // If absent, DNS `A` records for this load balancer's `hostname` property will be added to + // the public DNS zone `lb.appdomain.cloud`. + Dns *LoadBalancerDns `json:"dns,omitempty"` -// InstanceProfileGpu : InstanceProfileGpu struct -// Models which "extend" this model: -// - InstanceProfileGpuFixed -// - InstanceProfileGpuRange -// - InstanceProfileGpuEnum -// - InstanceProfileGpuDependent -type InstanceProfileGpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` + // Fully qualified domain name assigned to this load balancer. + Hostname *string `json:"hostname" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The load balancer's canonical URL. + Href *string `json:"href" validate:"required"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The unique identifier for this load balancer. + ID *string `json:"id" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // Indicates whether this load balancer supports instance groups. + InstanceGroupsSupported *bool `json:"instance_groups_supported" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The type of this load balancer, public or private. + IsPublic *bool `json:"is_public" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The listeners of this load balancer. + Listeners []LoadBalancerListenerReference `json:"listeners" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The logging configuration for this load balancer. + Logging *LoadBalancerLogging `json:"logging" validate:"required"` + + // The name for this load balancer. The name is unique across all load balancers in the VPC. + Name *string `json:"name" validate:"required"` + + // The operating status of this load balancer. + OperatingStatus *string `json:"operating_status" validate:"required"` + + // The pools of this load balancer. + Pools []LoadBalancerPoolReference `json:"pools" validate:"required"` + + // The private IP addresses assigned to this load balancer. + PrivateIps []LoadBalancerPrivateIpsItem `json:"private_ips" validate:"required"` + + // The profile for this load balancer. + Profile *LoadBalancerProfileReference `json:"profile" validate:"required"` + + // The provisioning status of this load balancer: + // + // - `active`: The load balancer is running. + // - `create_pending`: The load balancer is being created. + // - `delete_pending`: The load balancer is being deleted. + // - `maintenance_pending`: The load balancer is unavailable due to an internal + // error (contact IBM support). + // - `migrate_pending`: The load balancer is migrating to the requested configuration. + // Performance may be degraded. + // - `update_pending`: The load balancer is being updated + // to the requested configuration. + // + // The enumerated values for this property are expected to expand in the future. When + // processing this property, check for and log unknown values. Optionally halt + // processing and surface the error, or bypass the load balancer on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The public IP addresses assigned to this load balancer. + // + // Applicable only for public load balancers. + PublicIps []IP `json:"public_ips" validate:"required"` + + // The resource group for this load balancer. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // Indicates whether route mode is enabled for this load balancer. + // + // At present, public load balancers are not supported with route mode enabled. + RouteMode *bool `json:"route_mode" validate:"required"` + + // The security groups targeting this load balancer. + // + // If empty, all inbound and outbound traffic is allowed. + // + // Applicable only for load balancers that support security groups. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // Indicates whether this load balancer supports security groups. + SecurityGroupsSupported *bool `json:"security_groups_supported" validate:"required"` + + // The subnets this load balancer is provisioned in. The load balancer's availability depends on the availability of + // the zones that the subnets reside in. + // + // All subnets will be in the same VPC. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // Indicates whether this load balancer supports UDP. + UDPSupported *bool `json:"udp_supported" validate:"required"` } -// Constants associated with the InstanceProfileGpu.Type property. -// The type for this profile field. +// Constants associated with the LoadBalancer.OperatingStatus property. +// The operating status of this load balancer. const ( - InstanceProfileGpuTypeFixedConst = "fixed" + LoadBalancerOperatingStatusOfflineConst = "offline" + LoadBalancerOperatingStatusOnlineConst = "online" ) -func (*InstanceProfileGpu) isaInstanceProfileGpu() bool { - return true -} +// Constants associated with the LoadBalancer.ProvisioningStatus property. +// The provisioning status of this load balancer: +// +// - `active`: The load balancer is running. +// +// - `create_pending`: The load balancer is being created. +// +// - `delete_pending`: The load balancer is being deleted. +// +// - `maintenance_pending`: The load balancer is unavailable due to an internal +// error (contact IBM support). +// +// - `migrate_pending`: The load balancer is migrating to the requested configuration. +// Performance may be degraded. +// +// - `update_pending`: The load balancer is being updated +// to the requested configuration. +// +// The enumerated values for this property are expected to expand in the future. When +// processing this property, check for and log unknown values. Optionally halt +// processing and surface the error, or bypass the load balancer on which the +// unexpected property value was encountered. +const ( + LoadBalancerProvisioningStatusActiveConst = "active" + LoadBalancerProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerProvisioningStatusFailedConst = "failed" + LoadBalancerProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerProvisioningStatusMigratePendingConst = "migrate_pending" + LoadBalancerProvisioningStatusUpdatePendingConst = "update_pending" +) -type InstanceProfileGpuIntf interface { - isaInstanceProfileGpu() bool -} +// Constants associated with the LoadBalancer.ResourceType property. +// The resource type. +const ( + LoadBalancerResourceTypeLoadBalancerConst = "load_balancer" +) -// UnmarshalInstanceProfileGpu unmarshals an instance of InstanceProfileGpu from the specified map of raw messages. -func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalLoadBalancer unmarshals an instance of LoadBalancer from the specified map of raw messages. +func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancer) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDns) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuManufacturer : InstanceProfileGpuManufacturer struct -type InstanceProfileGpuManufacturer struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The possible GPU manufacturer(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuManufacturer.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuManufacturerTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileGpuManufacturer unmarshals an instance of InstanceProfileGpuManufacturer from the specified map of raw messages. -func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuManufacturer) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemory : InstanceProfileGpuMemory struct -// Models which "extend" this model: -// - InstanceProfileGpuMemoryFixed -// - InstanceProfileGpuMemoryRange -// - InstanceProfileGpuMemoryEnum -// - InstanceProfileGpuMemoryDependent -type InstanceProfileGpuMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileGpuMemory.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryTypeFixedConst = "fixed" -) - -func (*InstanceProfileGpuMemory) isaInstanceProfileGpuMemory() bool { - return true -} - -type InstanceProfileGpuMemoryIntf interface { - isaInstanceProfileGpuMemory() bool -} - -// UnmarshalInstanceProfileGpuMemory unmarshals an instance of InstanceProfileGpuMemory from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "instance_groups_supported", &obj.InstanceGroupsSupported) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "is_public", &obj.IsPublic) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListenerReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "operating_status", &obj.OperatingStatus) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPoolReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuModel : InstanceProfileGpuModel struct -type InstanceProfileGpuModel struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The possible GPU model(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuModel.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuModelTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileGpuModel unmarshals an instance of InstanceProfileGpuModel from the specified map of raw messages. -func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuModel) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalLoadBalancerPrivateIpsItem) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalLoadBalancerProfileReference) if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileIdentity : Identifies an instance profile by a unique property. -// Models which "extend" this model: -// - InstanceProfileIdentityByName -// - InstanceProfileIdentityByHref -type InstanceProfileIdentity struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` -} - -func (*InstanceProfileIdentity) isaInstanceProfileIdentity() bool { - return true -} - -type InstanceProfileIdentityIntf interface { - isaInstanceProfileIdentity() bool -} - -// UnmarshalInstanceProfileIdentity unmarshals an instance of InstanceProfileIdentity from the specified map of raw messages. -func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "public_ips", &obj.PublicIps, UnmarshalIP) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemory : InstanceProfileMemory struct -// Models which "extend" this model: -// - InstanceProfileMemoryFixed -// - InstanceProfileMemoryRange -// - InstanceProfileMemoryEnum -// - InstanceProfileMemoryDependent -type InstanceProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileMemory.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryTypeFixedConst = "fixed" -) - -func (*InstanceProfileMemory) isaInstanceProfileMemory() bool { - return true -} - -type InstanceProfileMemoryIntf interface { - isaInstanceProfileMemory() bool -} - -// UnmarshalInstanceProfileMemory unmarshals an instance of InstanceProfileMemory from the specified map of raw messages. -func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "route_mode", &obj.RouteMode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "security_groups_supported", &obj.SecurityGroupsSupported) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "udp_supported", &obj.UDPSupported) if err != nil { return } @@ -48743,40 +59817,45 @@ func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interfa return } -// InstanceProfileNumaCount : InstanceProfileNumaCount struct -// Models which "extend" this model: -// - InstanceProfileNumaCountFixed -// - InstanceProfileNumaCountDependent -type InstanceProfileNumaCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// LoadBalancerCollection : LoadBalancerCollection struct +type LoadBalancerCollection struct { + // A link to the first page of resources. + First *LoadBalancerCollectionFirst `json:"first" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// Constants associated with the InstanceProfileNumaCount.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountTypeFixedConst = "fixed" -) + // Collection of load balancers. + LoadBalancers []LoadBalancer `json:"load_balancers" validate:"required"` -func (*InstanceProfileNumaCount) isaInstanceProfileNumaCount() bool { - return true -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *LoadBalancerCollectionNext `json:"next,omitempty"` -type InstanceProfileNumaCountIntf interface { - isaInstanceProfileNumaCount() bool + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalInstanceProfileNumaCount unmarshals an instance of InstanceProfileNumaCount from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalLoadBalancerCollection unmarshals an instance of LoadBalancerCollection from the specified map of raw messages. +func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancers", &obj.LoadBalancers, UnmarshalLoadBalancer) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -48784,47 +59863,72 @@ func UnmarshalInstanceProfileNumaCount(m map[string]json.RawMessage, result inte return } -// InstanceProfileNetworkInterfaceCount : InstanceProfileNetworkInterfaceCount struct -// Models which "extend" this model: -// - InstanceProfileNetworkInterfaceCountRange -// - InstanceProfileNetworkInterfaceCountDependent -type InstanceProfileNetworkInterfaceCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// Constants associated with the InstanceProfileNetworkInterfaceCount.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkInterfaceCountTypeRangeConst = "range" -) +// LoadBalancerCollectionFirst : A link to the first page of resources. +type LoadBalancerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} -func (*InstanceProfileNetworkInterfaceCount) isaInstanceProfileNetworkInterfaceCount() bool { - return true +// UnmarshalLoadBalancerCollectionFirst unmarshals an instance of LoadBalancerCollectionFirst from the specified map of raw messages. +func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type InstanceProfileNetworkInterfaceCountIntf interface { - isaInstanceProfileNetworkInterfaceCount() bool +// LoadBalancerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type LoadBalancerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalInstanceProfileNetworkInterfaceCount unmarshals an instance of InstanceProfileNetworkInterfaceCount from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalLoadBalancerCollectionNext unmarshals an instance of LoadBalancerCollectionNext from the specified map of raw messages. +func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerDns : The DNS configuration for this load balancer. +// +// If absent, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone +// `lb.appdomain.cloud`. +type LoadBalancerDns struct { + // The DNS instance associated with this load balancer. + Instance *DnsInstanceReference `json:"instance" validate:"required"` + + // The DNS zone associated with this load balancer. + Zone *DnsZoneReference `json:"zone" validate:"required"` +} + +// UnmarshalLoadBalancerDns unmarshals an instance of LoadBalancerDns from the specified map of raw messages. +func UnmarshalLoadBalancerDns(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerDns) + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneReference) if err != nil { return } @@ -48832,36 +59936,31 @@ func UnmarshalInstanceProfileNetworkInterfaceCount(m map[string]json.RawMessage, return } -// InstanceProfileOsArchitecture : InstanceProfileOsArchitecture struct -type InstanceProfileOsArchitecture struct { - // The default OS architecture for an instance with this profile. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// LoadBalancerDnsPatch : The DNS configuration for this load balancer. +// +// Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` records for this load balancer +// that had been added to `zone`, and add equivalent `A` records to the public DNS zone `lb.appdomain.cloud`. +type LoadBalancerDnsPatch struct { + // The DNS instance to associate with this load balancer. + // + // The specified instance may be in a different region or account, subject to IAM + // policies. + Instance DnsInstanceIdentityIntf `json:"instance,omitempty"` - // The supported OS architecture(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` + // The DNS zone to associate with this load balancer. + // + // The specified zone may be in a different region or account, subject to IAM policies. + Zone DnsZoneIdentityIntf `json:"zone,omitempty"` } -// Constants associated with the InstanceProfileOsArchitecture.Type property. -// The type for this profile field. -const ( - InstanceProfileOsArchitectureTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileOsArchitecture unmarshals an instance of InstanceProfileOsArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileOsArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalLoadBalancerDnsPatch unmarshals an instance of LoadBalancerDnsPatch from the specified map of raw messages. +func UnmarshalLoadBalancerDnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerDnsPatch) + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) if err != nil { return } @@ -48869,40 +59968,41 @@ func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result return } -// InstanceProfilePortSpeed : InstanceProfilePortSpeed struct -// Models which "extend" this model: -// - InstanceProfilePortSpeedFixed -// - InstanceProfilePortSpeedDependent -type InstanceProfilePortSpeed struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` -} - -// Constants associated with the InstanceProfilePortSpeed.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedTypeFixedConst = "fixed" -) +// LoadBalancerDnsPrototype : The DNS configuration for this load balancer. +// +// If unspecified, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone +// `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be added to the specified `zone`. +type LoadBalancerDnsPrototype struct { + // The DNS instance to associate with this load balancer. + // + // The specified instance may be in a different region or account, subject to IAM + // policies. + Instance DnsInstanceIdentityIntf `json:"instance" validate:"required"` -func (*InstanceProfilePortSpeed) isaInstanceProfilePortSpeed() bool { - return true + // The DNS zone to associate with this load balancer. + // + // The specified zone may be in a different region or account, subject to IAM policies. + Zone DnsZoneIdentityIntf `json:"zone" validate:"required"` } -type InstanceProfilePortSpeedIntf interface { - isaInstanceProfilePortSpeed() bool +// NewLoadBalancerDnsPrototype : Instantiate LoadBalancerDnsPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerDnsPrototype(instance DnsInstanceIdentityIntf, zone DnsZoneIdentityIntf) (_model *LoadBalancerDnsPrototype, err error) { + _model = &LoadBalancerDnsPrototype{ + Instance: instance, + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalInstanceProfilePortSpeed unmarshals an instance of InstanceProfilePortSpeed from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalLoadBalancerDnsPrototype unmarshals an instance of LoadBalancerDnsPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerDnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerDnsPrototype) + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) if err != nil { return } @@ -48910,36 +60010,42 @@ func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result inte return } -// InstanceProfileReference : InstanceProfileReference struct -type InstanceProfileReference struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` +// LoadBalancerIdentity : Identifies a load balancer by a unique property. +// Models which "extend" this model: +// - LoadBalancerIdentityByID +// - LoadBalancerIdentityByCRN +// - LoadBalancerIdentityByHref +type LoadBalancerIdentity struct { + // The unique identifier for this load balancer. + ID *string `json:"id,omitempty"` - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` + // The load balancer's CRN. + CRN *string `json:"crn,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The load balancer's canonical URL. + Href *string `json:"href,omitempty"` } -// Constants associated with the InstanceProfileReference.ResourceType property. -// The resource type. -const ( - InstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" -) +func (*LoadBalancerIdentity) isaLoadBalancerIdentity() bool { + return true +} -// UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. -func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +type LoadBalancerIdentityIntf interface { + isaLoadBalancerIdentity() bool +} + +// UnmarshalLoadBalancerIdentity unmarshals an instance of LoadBalancerIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -48947,113 +60053,161 @@ func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result inte return } -// InstanceProfileReservationTerms : InstanceProfileReservationTerms struct -type InstanceProfileReservationTerms struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// LoadBalancerListener : LoadBalancerListener struct +type LoadBalancerListener struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol" validate:"required"` - // The supported committed use terms for a reservation using this profile. - Values []string `json:"values" validate:"required"` -} + // The certificate instance used for SSL termination. + // + // If absent, this listener is not using a certificate instance. + CertificateInstance *CertificateInstanceReference `json:"certificate_instance,omitempty"` -// Constants associated with the InstanceProfileReservationTerms.Type property. -// The type for this profile field. -const ( - InstanceProfileReservationTermsTypeEnumConst = "enum" -) + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit" validate:"required"` -// Constants associated with the InstanceProfileReservationTerms.Values property. -const ( - InstanceProfileReservationTermsValuesOneYearConst = "one_year" - InstanceProfileReservationTermsValuesThreeYearConst = "three_year" -) + // The date and time that this listener was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// UnmarshalInstanceProfileReservationTerms unmarshals an instance of InstanceProfileReservationTerms from the specified map of raw messages. -func UnmarshalInstanceProfileReservationTerms(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileReservationTerms) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The default pool for this listener. If absent, this listener has no default pool. + DefaultPool *LoadBalancerPoolReference `json:"default_pool,omitempty"` -// InstanceProfileVcpu : InstanceProfileVcpu struct -// Models which "extend" this model: -// - InstanceProfileVcpuFixed -// - InstanceProfileVcpuRange -// - InstanceProfileVcpuEnum -// - InstanceProfileVcpuDependent -type InstanceProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` + // The listener's canonical URL. + Href *string `json:"href" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // If present, the target listener that requests are redirected to. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirect `json:"https_redirect,omitempty"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The unique identifier for this load balancer listener. + ID *string `json:"id" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The idle connection timeout of the listener in seconds. This property will be present for load balancers in the + // `application` family. + IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The policies for this listener. + Policies []LoadBalancerListenerPolicyReference `json:"policies,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The listener port number, or the inclusive lower bound of the port range. + Port *int64 `json:"port" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The inclusive upper bound of the range of ports used by this listener. + // + // At present, only load balancers in the `network` family support more than one port per listener. + PortMax *int64 `json:"port_max" validate:"required"` + + // The inclusive lower bound of the range of ports used by this listener. + // + // At present, only load balancers in the `network` family support more than one port per listener. + PortMin *int64 `json:"port_min" validate:"required"` + + // The listener protocol. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the + // unexpected property value was encountered. + Protocol *string `json:"protocol" validate:"required"` + + // The provisioning status of this listener + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` } -// Constants associated with the InstanceProfileVcpu.Type property. -// The type for this profile field. +// Constants associated with the LoadBalancerListener.Protocol property. +// The listener protocol. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the +// unexpected property value was encountered. const ( - InstanceProfileVcpuTypeFixedConst = "fixed" + LoadBalancerListenerProtocolHTTPConst = "http" + LoadBalancerListenerProtocolHTTPSConst = "https" + LoadBalancerListenerProtocolTCPConst = "tcp" + LoadBalancerListenerProtocolUDPConst = "udp" ) -func (*InstanceProfileVcpu) isaInstanceProfileVcpu() bool { - return true -} - -type InstanceProfileVcpuIntf interface { - isaInstanceProfileVcpu() bool -} +// Constants associated with the LoadBalancerListener.ProvisioningStatus property. +// The provisioning status of this listener +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerProvisioningStatusActiveConst = "active" + LoadBalancerListenerProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerProvisioningStatusFailedConst = "failed" + LoadBalancerListenerProvisioningStatusUpdatePendingConst = "update_pending" +) -// UnmarshalInstanceProfileVcpu unmarshals an instance of InstanceProfileVcpu from the specified map of raw messages. -func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalLoadBalancerListener unmarshals an instance of LoadBalancerListener from the specified map of raw messages. +func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListener) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirect) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } @@ -49061,36 +60215,46 @@ func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface return } -// InstanceProfileVcpuArchitecture : InstanceProfileVcpuArchitecture struct -type InstanceProfileVcpuArchitecture struct { - // The default VCPU architecture for an instance with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// LoadBalancerListenerCollection : LoadBalancerListenerCollection struct +type LoadBalancerListenerCollection struct { + // Collection of listeners. + Listeners []LoadBalancerListener `json:"listeners" validate:"required"` +} - // The VCPU architecture for an instance with this profile. - Value *string `json:"value" validate:"required"` +// UnmarshalLoadBalancerListenerCollection unmarshals an instance of LoadBalancerListenerCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerCollection) + err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListener) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// Constants associated with the InstanceProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuArchitectureTypeFixedConst = "fixed" -) +// LoadBalancerListenerHTTPSRedirect : LoadBalancerListenerHTTPSRedirect struct +type LoadBalancerListenerHTTPSRedirect struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` -// UnmarshalInstanceProfileVcpuArchitecture unmarshals an instance of InstanceProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +// UnmarshalLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerHTTPSRedirect from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirect) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } @@ -49098,36 +60262,30 @@ func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, resu return } -// InstanceProfileVcpuManufacturer : InstanceProfileVcpuManufacturer struct -type InstanceProfileVcpuManufacturer struct { - // The default VCPU manufacturer for an instance with this profile. - Default *string `json:"default,omitempty"` +// LoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerHTTPSRedirectPatch struct +type LoadBalancerListenerHTTPSRedirectPatch struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - // The VCPU manufacturer for an instance with this profile. - Value *string `json:"value" validate:"required"` + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -// Constants associated with the InstanceProfileVcpuManufacturer.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuManufacturerTypeFixedConst = "fixed" -) - -// UnmarshalInstanceProfileVcpuManufacturer unmarshals an instance of InstanceProfileVcpuManufacturer from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuManufacturer) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirectPatch) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } @@ -49135,77 +60293,75 @@ func UnmarshalInstanceProfileVcpuManufacturer(m map[string]json.RawMessage, resu return } -// InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct -// Models which "extend" this model: -// - InstanceProfileVolumeBandwidthFixed -// - InstanceProfileVolumeBandwidthRange -// - InstanceProfileVolumeBandwidthEnum -// - InstanceProfileVolumeBandwidthDependent -type InstanceProfileVolumeBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} +// LoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerHTTPSRedirectPrototype struct +type LoadBalancerListenerHTTPSRedirectPrototype struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` -// Constants associated with the InstanceProfileVolumeBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthTypeFixedConst = "fixed" -) + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` -func (*InstanceProfileVolumeBandwidth) isaInstanceProfileVolumeBandwidth() bool { - return true + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -type InstanceProfileVolumeBandwidthIntf interface { - isaInstanceProfileVolumeBandwidth() bool +// NewLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerHTTPSRedirectPrototype, err error) { + _model = &LoadBalancerListenerHTTPSRedirectPrototype{ + HTTPStatusCode: core.Int64Ptr(httpStatusCode), + Listener: listener, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalInstanceProfileVolumeBandwidth unmarshals an instance of InstanceProfileVolumeBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirectPrototype) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerIdentity : Identifies a load balancer listener by a unique property. +// Models which "extend" this model: +// - LoadBalancerListenerIdentityByID +// - LoadBalancerListenerIdentityByHref +type LoadBalancerListenerIdentity struct { + // The unique identifier for this load balancer listener. + ID *string `json:"id,omitempty"` + + // The listener's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*LoadBalancerListenerIdentity) isaLoadBalancerListenerIdentity() bool { + return true +} + +type LoadBalancerListenerIdentityIntf interface { + isaLoadBalancerListenerIdentity() bool +} + +// UnmarshalLoadBalancerListenerIdentity unmarshals an instance of LoadBalancerListenerIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -49213,247 +60369,262 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul return } -// InstancePrototype : InstancePrototype struct -// Models which "extend" this model: -// - InstancePrototypeInstanceByImage -// - InstancePrototypeInstanceByCatalogOffering -// - InstancePrototypeInstanceByVolume -// - InstancePrototypeInstanceBySourceSnapshot -// - InstancePrototypeInstanceBySourceTemplate -type InstancePrototype struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` +// LoadBalancerListenerPatch : LoadBalancerListenerPatch struct +type LoadBalancerListenerPatch struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` + // The certificate instance to use for SSL termination. The listener must have a + // `protocol` of `https`. + CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // The default pool for this listener. The specified pool must: // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. + // - Belong to this load balancer + // - Have the same `protocol` as this listener, or have a compatible protocol. + // At present, the compatible protocols are `http` and `https`. + // - Not already be the `default_pool` for another listener // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // Specify `null` to remove an existing default pool. + DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. + // The target listener that requests will be redirected to. This listener must have a + // `protocol` of `http`, and the target listener must have a `protocol` of `https`. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // Specify `null` to remove any existing https redirect. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPatch `json:"https_redirect,omitempty"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. + IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - // The VPC this virtual server instance will reside in. + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. // - // If specified, it must match the VPC for the subnets of the instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. // - // If an offering is specified, the latest version of that offering will be used. + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` -} + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` -func (*InstancePrototype) isaInstancePrototype() bool { - return true + // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + // + // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http` and + // `https`. + // + // Additional restrictions: + // - If `default_pool` is set, the protocol cannot be changed. + // - If `https_redirect` is set, the protocol must be `http`. + // - If another listener's `https_redirect` targets this listener, the protocol must be + // `https`. + Protocol *string `json:"protocol,omitempty"` } -type InstancePrototypeIntf interface { - isaInstancePrototype() bool -} +// Constants associated with the LoadBalancerListenerPatch.Protocol property. +// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. +// +// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http` and +// `https`. +// +// Additional restrictions: +// - If `default_pool` is set, the protocol cannot be changed. +// - If `https_redirect` is set, the protocol must be `http`. +// - If another listener's `https_redirect` targets this listener, the protocol must be +// `https`. +const ( + LoadBalancerListenerPatchProtocolHTTPConst = "http" + LoadBalancerListenerPatchProtocolHTTPSConst = "https" + LoadBalancerListenerPatchProtocolTCPConst = "tcp" + LoadBalancerListenerPatchProtocolUDPConst = "udp" +) -// UnmarshalInstancePrototype unmarshals an instance of InstancePrototype from the specified map of raw messages. -func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototype) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) +// UnmarshalLoadBalancerListenerPatch unmarshals an instance of LoadBalancerListenerPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPatch) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the LoadBalancerListenerPatch +func (loadBalancerListenerPatch *LoadBalancerListenerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + return +} + +// LoadBalancerListenerPolicy : LoadBalancerListenerPolicy struct +type LoadBalancerListenerPolicy struct { + // The policy action. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` + + // The date and time that this policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The listener policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The policy's unique identifier. + ID *string `json:"id" validate:"required"` + + // The name for this load balancer listener policy. The name is unique across all policies for the load balancer + // listener. + Name *string `json:"name" validate:"required"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` + + // The provisioning status of this policy + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The rules for this policy. + Rules []LoadBalancerListenerPolicyRuleReference `json:"rules" validate:"required"` + + // - If `action` is `forward`, the response is a `LoadBalancerPoolReference` + // - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` + // - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. + Target LoadBalancerListenerPolicyTargetIntf `json:"target,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPolicy.Action property. +// The policy action. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerPolicyActionForwardConst = "forward" + LoadBalancerListenerPolicyActionHTTPSRedirectConst = "https_redirect" + LoadBalancerListenerPolicyActionRedirectConst = "redirect" + LoadBalancerListenerPolicyActionRejectConst = "reject" +) + +// Constants associated with the LoadBalancerListenerPolicy.ProvisioningStatus property. +// The provisioning status of this policy +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerPolicyProvisioningStatusActiveConst = "active" + LoadBalancerListenerPolicyProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerPolicyProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerPolicyProvisioningStatusFailedConst = "failed" + LoadBalancerListenerPolicyProvisioningStatusUpdatePendingConst = "update_pending" +) + +// UnmarshalLoadBalancerListenerPolicy unmarshals an instance of LoadBalancerListenerPolicy from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicy) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReference : InstanceReference struct -type InstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. -func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRuleReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTarget) if err != nil { return } @@ -49461,17 +60632,16 @@ func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{} return } -// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// LoadBalancerListenerPolicyCollection : LoadBalancerListenerPolicyCollection struct +type LoadBalancerListenerPolicyCollection struct { + // Collection of policies. + Policies []LoadBalancerListenerPolicy `json:"policies" validate:"required"` } -// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalLoadBalancerListenerPolicyCollection unmarshals an instance of LoadBalancerListenerPolicyCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyCollection) + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -49479,34 +60649,33 @@ func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result inte return } -// InstanceReservationAffinity : InstanceReservationAffinity struct -type InstanceReservationAffinity struct { - // The reservation affinity policy to use for this virtual server instance: - // - `disabled`: Reservations will not be used - // - `manual`: Reservations in `pool` are available for use. - Policy *string `json:"policy" validate:"required"` +// LoadBalancerListenerPolicyPatch : LoadBalancerListenerPolicyPatch struct +type LoadBalancerListenerPolicyPatch struct { + // The name for this policy. The name must not be used by another policy for the load balancer listener. + Name *string `json:"name,omitempty"` - // The pool of reservations available for use by this virtual server instance. - Pool []ReservationReference `json:"pool" validate:"required"` -} + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority,omitempty"` -// Constants associated with the InstanceReservationAffinity.Policy property. -// The reservation affinity policy to use for this virtual server instance: -// - `disabled`: Reservations will not be used -// - `manual`: Reservations in `pool` are available for use. -const ( - InstanceReservationAffinityPolicyDisabledConst = "disabled" - InstanceReservationAffinityPolicyManualConst = "manual" -) + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPatch`. + Target LoadBalancerListenerPolicyTargetPatchIntf `json:"target,omitempty"` +} -// UnmarshalInstanceReservationAffinity unmarshals an instance of InstanceReservationAffinity from the specified map of raw messages. -func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinity) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) +// UnmarshalLoadBalancerListenerPolicyPatch unmarshals an instance of LoadBalancerListenerPolicyPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationReference) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPatch) if err != nil { return } @@ -49514,94 +60683,85 @@ func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result i return } -// InstanceReservationAffinityPatch : InstanceReservationAffinityPatch struct -type InstanceReservationAffinityPatch struct { - // The reservation affinity policy to use for this virtual server instance: - // - `disabled`: Reservations will not be used - // - `manual`: Reservations in `pool` will be available for use - // - // The policy must be `disabled` if `placement_target` is set. - Policy *string `json:"policy,omitempty"` +// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyPatch +func (loadBalancerListenerPolicyPatch *LoadBalancerListenerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The pool of reservations available for use by this virtual server instance, replacing the existing pool of - // reservations. - // - // Specified reservations must have a `status` of `active`, and have the same `profile` and - // `zone` as this virtual server instance. +// LoadBalancerListenerPolicyPrototype : LoadBalancerListenerPolicyPrototype struct +type LoadBalancerListenerPolicyPrototype struct { + // The policy action. // - // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is - // `manual`. - Pool []ReservationIdentityIntf `json:"pool,omitempty"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` + + // The name for this policy. The name must not be used by another policy for the load balancer listener. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` + + // The rule prototype objects for this policy. + Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` } -// Constants associated with the InstanceReservationAffinityPatch.Policy property. -// The reservation affinity policy to use for this virtual server instance: -// - `disabled`: Reservations will not be used -// - `manual`: Reservations in `pool` will be available for use +// Constants associated with the LoadBalancerListenerPolicyPrototype.Action property. +// The policy action. // -// The policy must be `disabled` if `placement_target` is set. +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. const ( - InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" - InstanceReservationAffinityPatchPolicyManualConst = "manual" + LoadBalancerListenerPolicyPrototypeActionForwardConst = "forward" + LoadBalancerListenerPolicyPrototypeActionHTTPSRedirectConst = "https_redirect" + LoadBalancerListenerPolicyPrototypeActionRedirectConst = "redirect" + LoadBalancerListenerPolicyPrototypeActionRejectConst = "reject" ) -// UnmarshalInstanceReservationAffinityPatch unmarshals an instance of InstanceReservationAffinityPatch from the specified map of raw messages. -func UnmarshalInstanceReservationAffinityPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinityPatch) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) +// NewLoadBalancerListenerPolicyPrototype : Instantiate LoadBalancerListenerPolicyPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyPrototype(action string, priority int64) (_model *LoadBalancerListenerPolicyPrototype, err error) { + _model = &LoadBalancerListenerPolicyPrototype{ + Action: core.StringPtr(action), + Priority: core.Int64Ptr(priority), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPolicyPrototype unmarshals an instance of LoadBalancerListenerPolicyPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReservationAffinityPrototype : InstanceReservationAffinityPrototype struct -type InstanceReservationAffinityPrototype struct { - // The reservation affinity policy to use for this virtual server instance: - // - `disabled`: Reservations will not be used - // - `manual`: Reservations in `pool` will be available for use - // - // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. - // - // The policy must be `disabled` if `placement_target` is specified. - Policy *string `json:"policy,omitempty"` - - // The pool of reservations available for use by this virtual server instance. - // - // Specified reservations must have a `status` of `active`, and have the same `profile` and - // `zone` as this virtual server instance. - // - // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is - // `manual`. - Pool []ReservationIdentityIntf `json:"pool,omitempty"` -} - -// Constants associated with the InstanceReservationAffinityPrototype.Policy property. -// The reservation affinity policy to use for this virtual server instance: -// - `disabled`: Reservations will not be used -// - `manual`: Reservations in `pool` will be available for use -// -// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. -// -// The policy must be `disabled` if `placement_target` is specified. -const ( - InstanceReservationAffinityPrototypePolicyDisabledConst = "disabled" - InstanceReservationAffinityPrototypePolicyManualConst = "manual" -) - -// UnmarshalInstanceReservationAffinityPrototype unmarshals an instance of InstanceReservationAffinityPrototype from the specified map of raw messages. -func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinityPrototype) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRulePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPrototype) if err != nil { return } @@ -49609,46 +60769,56 @@ func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, return } -// InstanceStatusReason : InstanceStatusReason struct -type InstanceStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// LoadBalancerListenerPolicyReference : LoadBalancerListenerPolicyReference struct +type LoadBalancerListenerPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerListenerPolicyReferenceDeleted `json:"deleted,omitempty"` - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` + // The listener policy's canonical URL. + Href *string `json:"href" validate:"required"` - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} + // The policy's unique identifier. + ID *string `json:"id" validate:"required"` -// Constants associated with the InstanceStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - InstanceStatusReasonCodeCannotStartConst = "cannot_start" - InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" - InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" - InstanceStatusReasonCodeCannotStartReservationCapacityConst = "cannot_start_reservation_capacity" - InstanceStatusReasonCodeCannotStartReservationExpiredConst = "cannot_start_reservation_expired" - InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" - InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" - InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" -) + // The name for this load balancer listener policy. The name is unique across all policies for the load balancer + // listener. + Name *string `json:"name" validate:"required"` +} -// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. -func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +// UnmarshalLoadBalancerListenerPolicyReference unmarshals an instance of LoadBalancerListenerPolicyReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type LoadBalancerListenerPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -49657,216 +60827,200 @@ func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interfac return } -// InstanceTemplate : InstanceTemplate struct -// Models which "extend" this model: -// - InstanceTemplateInstanceByImageInstanceTemplateContext -// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext -// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext -type InstanceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` +// LoadBalancerListenerPolicyRule : LoadBalancerListenerPolicyRule struct +type LoadBalancerListenerPolicyRule struct { + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` - // The date and time that the instance template was created. + // The date and time that this rule was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance + // The field. This is applicable to `header`, `query`, and `body` rule types. // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. + // If the rule type is `header`, this property is required. // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` + // The rule's canonical URL. + Href *string `json:"href" validate:"required"` - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // The rule's unique identifier. + ID *string `json:"id" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. + // The provisioning status of this rule // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - // The VPC this virtual server instance will reside in. + // The type of the rule. // - // If specified, it must match the VPC for the subnets of the instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. + // Value to be matched for rule condition. // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` } -func (*InstanceTemplate) isaInstanceTemplate() bool { - return true -} +// Constants associated with the LoadBalancerListenerPolicyRule.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRuleConditionContainsConst = "contains" + LoadBalancerListenerPolicyRuleConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRuleConditionMatchesRegexConst = "matches_regex" +) -type InstanceTemplateIntf interface { - isaInstanceTemplate() bool -} +// Constants associated with the LoadBalancerListenerPolicyRule.ProvisioningStatus property. +// The provisioning status of this rule +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerPolicyRuleProvisioningStatusActiveConst = "active" + LoadBalancerListenerPolicyRuleProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerPolicyRuleProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerPolicyRuleProvisioningStatusFailedConst = "failed" + LoadBalancerListenerPolicyRuleProvisioningStatusUpdatePendingConst = "update_pending" +) -// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) +// Constants associated with the LoadBalancerListenerPolicyRule.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRuleTypeBodyConst = "body" + LoadBalancerListenerPolicyRuleTypeHeaderConst = "header" + LoadBalancerListenerPolicyRuleTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRuleTypePathConst = "path" + LoadBalancerListenerPolicyRuleTypeQueryConst = "query" +) + +// UnmarshalLoadBalancerListenerPolicyRule unmarshals an instance of LoadBalancerListenerPolicyRule from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRule) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "field", &obj.Field) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRuleCollection : LoadBalancerListenerPolicyRuleCollection struct +type LoadBalancerListenerPolicyRuleCollection struct { + // Collection of rules. + Rules []LoadBalancerListenerPolicyRule `json:"rules" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyRuleCollection unmarshals an instance of LoadBalancerListenerPolicyRuleCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleCollection) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRule) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRulePatch : LoadBalancerListenerPolicyRulePatch struct +type LoadBalancerListenerPolicyRulePatch struct { + // The condition of the rule. + Condition *string `json:"condition,omitempty"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type,omitempty"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPolicyRulePatch.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRulePatchConditionContainsConst = "contains" + LoadBalancerListenerPolicyRulePatchConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRulePatchConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the LoadBalancerListenerPolicyRulePatch.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRulePatchTypeBodyConst = "body" + LoadBalancerListenerPolicyRulePatchTypeHeaderConst = "header" + LoadBalancerListenerPolicyRulePatchTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRulePatchTypePathConst = "path" + LoadBalancerListenerPolicyRulePatchTypeQueryConst = "query" +) + +// UnmarshalLoadBalancerListenerPolicyRulePatch unmarshals an instance of LoadBalancerListenerPolicyRulePatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRulePatch) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "field", &obj.Field) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -49874,45 +61028,89 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) return } -// InstanceTemplateCollection : InstanceTemplateCollection struct -type InstanceTemplateCollection struct { - // A link to the first page of resources. - First *InstanceTemplateCollectionFirst `json:"first" validate:"required"` +// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyRulePatch +func (loadBalancerListenerPolicyRulePatch *LoadBalancerListenerPolicyRulePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPolicyRulePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// LoadBalancerListenerPolicyRulePrototype : LoadBalancerListenerPolicyRulePrototype struct +type LoadBalancerListenerPolicyRulePrototype struct { + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceTemplateCollectionNext `json:"next,omitempty"` + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` - // Collection of instance templates. - Templates []InstanceTemplateIntf `json:"templates" validate:"required"` + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` } -// UnmarshalInstanceTemplateCollection unmarshals an instance of InstanceTemplateCollection from the specified map of raw messages. -func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceTemplateCollectionFirst) - if err != nil { - return +// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRulePrototypeConditionContainsConst = "contains" + LoadBalancerListenerPolicyRulePrototypeConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRulePrototypeConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRulePrototypeTypeBodyConst = "body" + LoadBalancerListenerPolicyRulePrototypeTypeHeaderConst = "header" + LoadBalancerListenerPolicyRulePrototypeTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRulePrototypeTypePathConst = "path" + LoadBalancerListenerPolicyRulePrototypeTypeQueryConst = "query" +) + +// NewLoadBalancerListenerPolicyRulePrototype : Instantiate LoadBalancerListenerPolicyRulePrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyRulePrototype(condition string, typeVar string, value string) (_model *LoadBalancerListenerPolicyRulePrototype, err error) { + _model = &LoadBalancerListenerPolicyRulePrototype{ + Condition: core.StringPtr(condition), + Type: core.StringPtr(typeVar), + Value: core.StringPtr(value), } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPolicyRulePrototype unmarshals an instance of LoadBalancerListenerPolicyRulePrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRulePrototype) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceTemplateCollectionNext) + err = core.UnmarshalPrimitive(m, "field", &obj.Field) if err != nil { return } - err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalInstanceTemplate) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -49920,33 +61118,49 @@ func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result in return } -// InstanceTemplateCollectionFirst : A link to the first page of resources. -type InstanceTemplateCollectionFirst struct { - // The URL for a page of resources. +// LoadBalancerListenerPolicyRuleReference : LoadBalancerListenerPolicyRuleReference struct +type LoadBalancerListenerPolicyRuleReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerListenerPolicyRuleReferenceDeleted `json:"deleted,omitempty"` + + // The rule's canonical URL. Href *string `json:"href" validate:"required"` + + // The rule's unique identifier. + ID *string `json:"id" validate:"required"` } -// UnmarshalInstanceTemplateCollectionFirst unmarshals an instance of InstanceTemplateCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionFirst) +// UnmarshalLoadBalancerListenerPolicyRuleReference unmarshals an instance of LoadBalancerListenerPolicyRuleReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceTemplateCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceTemplateCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// LoadBalancerListenerPolicyRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type LoadBalancerListenerPolicyRuleReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalInstanceTemplateCollectionNext unmarshals an instance of InstanceTemplateCollectionNext from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyRuleReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -49954,34 +61168,51 @@ func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, resul return } -// InstanceTemplateIdentity : Identifies an instance template by a unique property. +// LoadBalancerListenerPolicyTarget : - If `action` is `forward`, the response is a `LoadBalancerPoolReference` +// - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` +// - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. // Models which "extend" this model: -// - InstanceTemplateIdentityByID -// - InstanceTemplateIdentityByHref -// - InstanceTemplateIdentityByCRN -type InstanceTemplateIdentity struct { - // The unique identifier for this instance template. - ID *string `json:"id,omitempty"` +// - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference +// - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL +// - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect +type LoadBalancerListenerPolicyTarget struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - // The URL for this instance template. + // The pool's canonical URL. Href *string `json:"href,omitempty"` - // The CRN for this instance template. - CRN *string `json:"crn,omitempty"` + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` + + // The name for this load balancer pool. The name is unique across all pools for the load balancer. + Name *string `json:"name,omitempty"` + + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` + + Listener *LoadBalancerListenerReference `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -func (*InstanceTemplateIdentity) isaInstanceTemplateIdentity() bool { +func (*LoadBalancerListenerPolicyTarget) isaLoadBalancerListenerPolicyTarget() bool { return true } -type InstanceTemplateIdentityIntf interface { - isaInstanceTemplateIdentity() bool +type LoadBalancerListenerPolicyTargetIntf interface { + isaLoadBalancerListenerPolicyTarget() bool } -// UnmarshalInstanceTemplateIdentity unmarshals an instance of InstanceTemplateIdentity from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalLoadBalancerListenerPolicyTarget unmarshals an instance of LoadBalancerListenerPolicyTarget from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) if err != nil { return } @@ -49989,234 +61220,312 @@ func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result inte if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePatch : InstanceTemplatePatch struct -type InstanceTemplatePatch struct { - // The name for this instance template. The name must not be used by another instance template in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceTemplatePatch unmarshals an instance of InstanceTemplatePatch from the specified map of raw messages. -func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceTemplatePatch -func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceTemplatePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceTemplatePrototype : InstanceTemplatePrototype struct +// LoadBalancerListenerPolicyTargetPatch : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. +// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. +// - If `action` is `https_redirect`, specify a +// `LoadBalancerListenerPolicyHTTPSRedirectPatch`. +// // Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceTemplateByImage -// - InstanceTemplatePrototypeInstanceTemplateBySourceTemplate -// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot -// - InstanceTemplatePrototypeInstanceTemplateByCatalogOffering -type InstanceTemplatePrototype struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch +type LoadBalancerListenerPolicyTargetPatch struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The pool's canonical URL. + Href *string `json:"href,omitempty"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The redirect target URL. + URL *string `json:"url,omitempty"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { +func (*LoadBalancerListenerPolicyTargetPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { return true } -type InstanceTemplatePrototypeIntf interface { - isaInstanceTemplatePrototype() bool +type LoadBalancerListenerPolicyTargetPatchIntf interface { + isaLoadBalancerListenerPolicyTargetPatch() bool } -// UnmarshalInstanceTemplatePrototype unmarshals an instance of InstanceTemplatePrototype from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototype) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalLoadBalancerListenerPolicyTargetPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyTargetPrototype : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. +// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. +// - If `action` is `https_redirect`, specify a +// `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. +// +// Models which "extend" this model: +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype +type LoadBalancerListenerPolicyTargetPrototype struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href,omitempty"` + + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +func (*LoadBalancerListenerPolicyTargetPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { + return true +} + +type LoadBalancerListenerPolicyTargetPrototypeIntf interface { + isaLoadBalancerListenerPolicyTargetPrototype() bool +} + +// UnmarshalLoadBalancerListenerPolicyTargetPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "url", &obj.URL) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPrototypeLoadBalancerContext : LoadBalancerListenerPrototypeLoadBalancerContext struct +type LoadBalancerListenerPrototypeLoadBalancerContext struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` + + // The certificate instance to use for SSL termination. The listener must have a + // `protocol` of `https`. + CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` + + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The default pool for this listener. If specified, the pool must: + // - Belong to this load balancer. + // - Have the same `protocol` as this listener, or have a compatible protocol. + // At present, the compatible protocols are `http` and `https`. + // - Not already be the `default_pool` for another listener. + // + // If unspecified, this listener will be created with no default pool, but one may be + // subsequently set. + DefaultPool *LoadBalancerPoolIdentityByName `json:"default_pool,omitempty"` + + // The target listener that requests will be redirected to. This listener must have a + // `protocol` of `http`, and the target listener must have a `protocol` of `https`. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` + + // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. + IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. + // + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` + + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` + + // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + // + // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http` and + // `https`. + // + // Additional restrictions: + // - If `default_pool` is set, the pool's protocol must match, or be compatible with + // the listener's protocol. At present, the compatible protocols are `http` and + // `https`. + // - If `https_redirect` is set, the protocol must be `http`. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the LoadBalancerListenerPrototypeLoadBalancerContext.Protocol property. +// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. +// +// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http` and +// `https`. +// +// Additional restrictions: +// - If `default_pool` is set, the pool's protocol must match, or be compatible with +// the listener's protocol. At present, the compatible protocols are `http` and +// `https`. +// - If `https_redirect` is set, the protocol must be `http`. +const ( + LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPConst = "http" + LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPSConst = "https" + LoadBalancerListenerPrototypeLoadBalancerContextProtocolTCPConst = "tcp" + LoadBalancerListenerPrototypeLoadBalancerContextProtocolUDPConst = "udp" +) + +// NewLoadBalancerListenerPrototypeLoadBalancerContext : Instantiate LoadBalancerListenerPrototypeLoadBalancerContext (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol string) (_model *LoadBalancerListenerPrototypeLoadBalancerContext, err error) { + _model = &LoadBalancerListenerPrototypeLoadBalancerContext{ + Protocol: core.StringPtr(protocol), } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext unmarshals an instance of LoadBalancerListenerPrototypeLoadBalancerContext from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPrototypeLoadBalancerContext) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentityByName) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -50224,33 +61533,23 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int return } -// InstanceTemplateReference : InstanceTemplateReference struct -type InstanceTemplateReference struct { - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - +// LoadBalancerListenerReference : LoadBalancerListenerReference struct +type LoadBalancerListenerReference struct { // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *InstanceTemplateReferenceDeleted `json:"deleted,omitempty"` + Deleted *LoadBalancerListenerReferenceDeleted `json:"deleted,omitempty"` - // The URL for this instance template. + // The listener's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance template. + // The unique identifier for this load balancer listener. ID *string `json:"id" validate:"required"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` } -// UnmarshalInstanceTemplateReference unmarshals an instance of InstanceTemplateReference from the specified map of raw messages. -func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceTemplateReferenceDeleted) +// UnmarshalLoadBalancerListenerReference unmarshals an instance of LoadBalancerListenerReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerReferenceDeleted) if err != nil { return } @@ -50262,24 +61561,20 @@ func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceTemplateReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// LoadBalancerListenerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary // information. -type InstanceTemplateReferenceDeleted struct { +type LoadBalancerListenerReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalInstanceTemplateReferenceDeleted unmarshals an instance of InstanceTemplateReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReferenceDeleted) +// UnmarshalLoadBalancerListenerReferenceDeleted unmarshals an instance of LoadBalancerListenerReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -50288,30 +61583,16 @@ func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, res return } -// InstanceVcpu : The virtual server instance VCPU configuration. -type InstanceVcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The number of VCPUs assigned. - Count *int64 `json:"count" validate:"required"` - - // The VCPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` +// LoadBalancerLogging : LoadBalancerLogging struct +type LoadBalancerLogging struct { + // The datapath logging configuration for this load balancer. + Datapath *LoadBalancerLoggingDatapath `json:"datapath" validate:"required"` } -// UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. -func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceVcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) +// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages. +func UnmarshalLoadBalancerLogging(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLogging) + err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapath) if err != nil { return } @@ -50319,88 +61600,84 @@ func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (er return } -// Key : Key struct -type Key struct { - // The date and time that the key was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` - - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` - - // The URL for this key. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` - - // The length of this key (in bits). - Length *int64 `json:"length" validate:"required"` - - // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name" validate:"required"` - - // The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. - PublicKey *string `json:"public_key" validate:"required"` - - // The resource group for this key. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The crypto-system used by this key. - Type *string `json:"type" validate:"required"` +// LoadBalancerLoggingDatapath : The datapath logging configuration for this load balancer. +type LoadBalancerLoggingDatapath struct { + // Indicates whether datapath logging is active for this load balancer. + Active *bool `json:"active" validate:"required"` } -// Constants associated with the Key.Type property. -// The crypto-system used by this key. -const ( - KeyTypeEd25519Const = "ed25519" - KeyTypeRsaConst = "rsa" -) - -// UnmarshalKey unmarshals an instance of Key from the specified map of raw messages. -func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Key) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "length", &obj.Length) +// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingDatapath) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLoggingDatapathPatch : The datapath logging configuration for this load balancer. +type LoadBalancerLoggingDatapathPatch struct { + // Indicates whether datapath logging will be active for this load balancer. + Active *bool `json:"active,omitempty"` +} + +// UnmarshalLoadBalancerLoggingDatapathPatch unmarshals an instance of LoadBalancerLoggingDatapathPatch from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingDatapathPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingDatapathPatch) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalPrimitive(m, "public_key", &obj.PublicKey) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLoggingDatapathPrototype : The datapath logging configuration for this load balancer. +type LoadBalancerLoggingDatapathPrototype struct { + // Indicates whether datapath logging will be active for this load balancer. + Active *bool `json:"active,omitempty"` +} + +// UnmarshalLoadBalancerLoggingDatapathPrototype unmarshals an instance of LoadBalancerLoggingDatapathPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingDatapathPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingDatapathPrototype) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLoggingPatch : LoadBalancerLoggingPatch struct +type LoadBalancerLoggingPatch struct { + // The datapath logging configuration for this load balancer. + Datapath *LoadBalancerLoggingDatapathPatch `json:"datapath,omitempty"` +} + +// UnmarshalLoadBalancerLoggingPatch unmarshals an instance of LoadBalancerLoggingPatch from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingPatch) + err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLoggingPrototype : LoadBalancerLoggingPrototype struct +type LoadBalancerLoggingPrototype struct { + // The datapath logging configuration for this load balancer. + Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"` +} + +// UnmarshalLoadBalancerLoggingPrototype unmarshals an instance of LoadBalancerLoggingPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingPrototype) + err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPrototype) if err != nil { return } @@ -50408,45 +61685,49 @@ func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) return } -// KeyCollection : KeyCollection struct -type KeyCollection struct { - // A link to the first page of resources. - First *KeyCollectionFirst `json:"first" validate:"required"` - - // Collection of keys. - Keys []Key `json:"keys" validate:"required"` +// LoadBalancerPatch : LoadBalancerPatch struct +type LoadBalancerPatch struct { + // The DNS configuration for this load balancer. + // + // Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` + // records for this load balancer that had been added to `zone`, and add equivalent `A` + // records to the public DNS zone `lb.appdomain.cloud`. + Dns *LoadBalancerDnsPatch `json:"dns,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The logging configuration to use for this load balancer. + // + // To activate logging, the load balancer profile must support the specified logging type. + Logging *LoadBalancerLoggingPatch `json:"logging,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *KeyCollectionNext `json:"next,omitempty"` + // The name for this load balancer. The name must not be used by another load balancer in the VPC. + Name *string `json:"name,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The subnets to provision this load balancer in. The load balancer's availability will depend on the availability of + // the zones that the subnets reside in. + // + // The specified subnets must be in the same VPC as the existing subnets, and will completely replace the existing + // subnets. + // + // The load balancer must be in the `application` family. + Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` } -// UnmarshalKeyCollection unmarshals an instance of KeyCollection from the specified map of raw messages. -func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalKeyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKey) +// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPatch) + err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDnsPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLoggingPatch) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalKeyCollectionNext) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) if err != nil { return } @@ -50454,223 +61735,169 @@ func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (e return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *KeyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// AsPatch returns a generic map representation of the LoadBalancerPatch +func (loadBalancerPatch *LoadBalancerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - return start, nil + return } -// KeyCollectionFirst : A link to the first page of resources. -type KeyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} +// LoadBalancerPool : LoadBalancerPool struct +type LoadBalancerPool struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` -// UnmarshalKeyCollectionFirst unmarshals an instance of KeyCollectionFirst from the specified map of raw messages. -func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The date and time that this pool was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// KeyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type KeyCollectionNext struct { - // The URL for a page of resources. + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitor `json:"health_monitor" validate:"required"` + + // The pool's canonical URL. Href *string `json:"href" validate:"required"` -} -// UnmarshalKeyCollectionNext unmarshals an instance of KeyCollectionNext from the specified map of raw messages. -func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The unique identifier for this load balancer pool. + ID *string `json:"id" validate:"required"` -// KeyIdentity : Identifies a key by a unique property. -// Models which "extend" this model: -// - KeyIdentityByID -// - KeyIdentityByCRN -// - KeyIdentityByHref -// - KeyIdentityByFingerprint -type KeyIdentity struct { - // The unique identifier for this key. - ID *string `json:"id,omitempty"` + // The instance group that is managing this pool. + InstanceGroup *InstanceGroupReference `json:"instance_group,omitempty"` - // The CRN for this key. - CRN *string `json:"crn,omitempty"` + // The backend server members of the pool. + Members []LoadBalancerPoolMemberReference `json:"members,omitempty"` - // The URL for this key. - Href *string `json:"href,omitempty"` + // The name for this load balancer pool. The name is unique across all pools for the load balancer. + Name *string `json:"name" validate:"required"` + + // The protocol for this load balancer pool. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the + // unexpected property value was encountered. + Protocol *string `json:"protocol" validate:"required"` + + // The provisioning status of this pool + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol" validate:"required"` + + // The session persistence of this pool. + // + // The enumerated values for this property are expected to expand in the future. When + // processing this property, check for and log unknown values. Optionally halt + // processing and surface the error, or bypass the pool on which the unexpected + // property value was encountered. + SessionPersistence *LoadBalancerPoolSessionPersistence `json:"session_persistence,omitempty"` +} + +// Constants associated with the LoadBalancerPool.Algorithm property. +// The load balancing algorithm. +const ( + LoadBalancerPoolAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint,omitempty"` -} +// Constants associated with the LoadBalancerPool.Protocol property. +// The protocol for this load balancer pool. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the +// unexpected property value was encountered. +const ( + LoadBalancerPoolProtocolHTTPConst = "http" + LoadBalancerPoolProtocolHTTPSConst = "https" + LoadBalancerPoolProtocolTCPConst = "tcp" + LoadBalancerPoolProtocolUDPConst = "udp" +) -func (*KeyIdentity) isaKeyIdentity() bool { - return true -} +// Constants associated with the LoadBalancerPool.ProvisioningStatus property. +// The provisioning status of this pool +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the +// unexpected property value was encountered. +const ( + LoadBalancerPoolProvisioningStatusActiveConst = "active" + LoadBalancerPoolProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerPoolProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerPoolProvisioningStatusFailedConst = "failed" + LoadBalancerPoolProvisioningStatusUpdatePendingConst = "update_pending" +) -type KeyIdentityIntf interface { - isaKeyIdentity() bool -} +// Constants associated with the LoadBalancerPool.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolProxyProtocolV1Const = "v1" + LoadBalancerPoolProxyProtocolV2Const = "v2" +) -// UnmarshalKeyIdentity unmarshals an instance of KeyIdentity from the specified map of raw messages. -func UnmarshalKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalLoadBalancerPool unmarshals an instance of LoadBalancerPool from the specified map of raw messages. +func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPool) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitor) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyPatch : KeyPatch struct -type KeyPatch struct { - // The name for this key. The name must not be used by another key in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalKeyPatch unmarshals an instance of KeyPatch from the specified map of raw messages. -func UnmarshalKeyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the KeyPatch -func (keyPatch *KeyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(keyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// KeyReference : KeyReference struct -type KeyReference struct { - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *KeyReferenceDeleted `json:"deleted,omitempty"` - - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` - - // The URL for this key. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` - - // The name for this key. The name is unique across all keys in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalKeyReference unmarshals an instance of KeyReference from the specified map of raw messages. -func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalKeyReferenceDeleted) + err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type KeyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalKeyReferenceDeleted unmarshals an instance of KeyReferenceDeleted from the specified map of raw messages. -func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LegacyCloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName -type LegacyCloudObjectStorageBucketIdentity struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name,omitempty"` -} - -func (*LegacyCloudObjectStorageBucketIdentity) isaLegacyCloudObjectStorageBucketIdentity() bool { - return true -} - -type LegacyCloudObjectStorageBucketIdentityIntf interface { - isaLegacyCloudObjectStorageBucketIdentity() bool -} - -// UnmarshalLegacyCloudObjectStorageBucketIdentity unmarshals an instance of LegacyCloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistence) if err != nil { return } @@ -50678,16 +61905,16 @@ func UnmarshalLegacyCloudObjectStorageBucketIdentity(m map[string]json.RawMessag return } -// LegacyCloudObjectStorageBucketReference : LegacyCloudObjectStorageBucketReference struct -type LegacyCloudObjectStorageBucketReference struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` +// LoadBalancerPoolCollection : LoadBalancerPoolCollection struct +type LoadBalancerPoolCollection struct { + // Collection of pools. + Pools []LoadBalancerPool `json:"pools" validate:"required"` } -// UnmarshalLegacyCloudObjectStorageBucketReference unmarshals an instance of LegacyCloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalLoadBalancerPoolCollection unmarshals an instance of LoadBalancerPoolCollection from the specified map of raw messages. +func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolCollection) + err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPool) if err != nil { return } @@ -50695,4458 +61922,6147 @@ func UnmarshalLegacyCloudObjectStorageBucketReference(m map[string]json.RawMessa return } -// ListBackupPoliciesOptions : The ListBackupPolicies options. -type ListBackupPoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. - Tag *string `json:"tag,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBackupPoliciesOptions : Instantiate ListBackupPoliciesOptions -func (*VpcV1) NewListBackupPoliciesOptions() *ListBackupPoliciesOptions { - return &ListBackupPoliciesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListBackupPoliciesOptions) SetStart(start string) *ListBackupPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBackupPoliciesOptions) SetLimit(limit int64) *ListBackupPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListBackupPoliciesOptions) SetResourceGroupID(resourceGroupID string) *ListBackupPoliciesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListBackupPoliciesOptions) SetName(name string) *ListBackupPoliciesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetTag : Allow user to set Tag -func (_options *ListBackupPoliciesOptions) SetTag(tag string) *ListBackupPoliciesOptions { - _options.Tag = core.StringPtr(tag) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPoliciesOptions) SetHeaders(param map[string]string) *ListBackupPoliciesOptions { - options.Headers = param - return options -} - -// ListBackupPolicyJobsOptions : The ListBackupPolicyJobs options. -type ListBackupPolicyJobsOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // Filters the collection to backup policy jobs with a `status` property matching the specified value. - Status *string `json:"status,omitempty"` - - // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified - // identifier. - BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct +type LoadBalancerPoolHealthMonitor struct { + // The seconds to wait between health checks. + Delay *int64 `json:"delay" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` - // Filters the collection to backup policy jobs with a `source.id` property matching the specified identifier. - SourceID *string `json:"source.id,omitempty"` + // The health check port. + // + // If present, this overrides the pool member port values. + Port *int64 `json:"port,omitempty"` - // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with an `id` property - // matching the specified identifier. - TargetSnapshotsID *string `json:"target_snapshots[].id,omitempty"` + // The seconds to wait for a response to a health check. + Timeout *int64 `json:"timeout" validate:"required"` - // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with a `crn` property - // matching the specified CRN. - TargetSnapshotsCRN *string `json:"target_snapshots[].crn,omitempty"` + // The protocol type to use for health checks. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which + // the unexpected property value was encountered. + Type *string `json:"type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The health check URL path. Applicable when `type` is `http` or `https`. + // + // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` } -// Constants associated with the ListBackupPolicyJobsOptions.Status property. -// Filters the collection to backup policy jobs with a `status` property matching the specified value. -const ( - ListBackupPolicyJobsOptionsStatusFailedConst = "failed" - ListBackupPolicyJobsOptionsStatusRunningConst = "running" - ListBackupPolicyJobsOptionsStatusSucceededConst = "succeeded" -) - -// Constants associated with the ListBackupPolicyJobsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the LoadBalancerPoolHealthMonitor.Type property. +// The protocol type to use for health checks. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which +// the unexpected property value was encountered. const ( - ListBackupPolicyJobsOptionsSortCreatedAtConst = "created_at" - ListBackupPolicyJobsOptionsSortNameConst = "name" + LoadBalancerPoolHealthMonitorTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorTypeTCPConst = "tcp" ) -// NewListBackupPolicyJobsOptions : Instantiate ListBackupPolicyJobsOptions -func (*VpcV1) NewListBackupPolicyJobsOptions(backupPolicyID string) *ListBackupPolicyJobsOptions { - return &ListBackupPolicyJobsOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), +// UnmarshalLoadBalancerPoolHealthMonitor unmarshals an instance of LoadBalancerPoolHealthMonitor from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitor) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) + if err != nil { + return } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyJobsOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListBackupPolicyJobsOptions) SetStatus(status string) *ListBackupPolicyJobsOptions { - _options.Status = core.StringPtr(status) - return _options -} - -// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID -func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListBackupPolicyJobsOptions { - _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListBackupPolicyJobsOptions) SetStart(start string) *ListBackupPolicyJobsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBackupPolicyJobsOptions) SetLimit(limit int64) *ListBackupPolicyJobsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListBackupPolicyJobsOptions) SetSort(sort string) *ListBackupPolicyJobsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetSourceID : Allow user to set SourceID -func (_options *ListBackupPolicyJobsOptions) SetSourceID(sourceID string) *ListBackupPolicyJobsOptions { - _options.SourceID = core.StringPtr(sourceID) - return _options -} - -// SetTargetSnapshotsID : Allow user to set TargetSnapshotsID -func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsID(targetSnapshotsID string) *ListBackupPolicyJobsOptions { - _options.TargetSnapshotsID = core.StringPtr(targetSnapshotsID) - return _options -} - -// SetTargetSnapshotsCRN : Allow user to set TargetSnapshotsCRN -func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsCRN(targetSnapshotsCRN string) *ListBackupPolicyJobsOptions { - _options.TargetSnapshotsCRN = core.StringPtr(targetSnapshotsCRN) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPolicyJobsOptions) SetHeaders(param map[string]string) *ListBackupPolicyJobsOptions { - options.Headers = param - return options -} - -// ListBackupPolicyPlansOptions : The ListBackupPolicyPlans options. -type ListBackupPolicyPlansOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBackupPolicyPlansOptions : Instantiate ListBackupPolicyPlansOptions -func (*VpcV1) NewListBackupPolicyPlansOptions(backupPolicyID string) *ListBackupPolicyPlansOptions { - return &ListBackupPolicyPlansOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + if err != nil { + return } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *ListBackupPolicyPlansOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyPlansOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListBackupPolicyPlansOptions) SetName(name string) *ListBackupPolicyPlansOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPolicyPlansOptions) SetHeaders(param map[string]string) *ListBackupPolicyPlansOptions { - options.Headers = param - return options -} - -// ListBareMetalServerDisksOptions : The ListBareMetalServerDisks options. -type ListBareMetalServerDisksOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerDisksOptions : Instantiate ListBareMetalServerDisksOptions -func (*VpcV1) NewListBareMetalServerDisksOptions(bareMetalServerID string) *ListBareMetalServerDisksOptions { - return &ListBareMetalServerDisksOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerDisksOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerDisksOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerDisksOptions) SetHeaders(param map[string]string) *ListBareMetalServerDisksOptions { - options.Headers = param - return options -} - -// ListBareMetalServerNetworkInterfaceFloatingIpsOptions : The ListBareMetalServerNetworkInterfaceFloatingIps options. -type ListBareMetalServerNetworkInterfaceFloatingIpsOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerNetworkInterfaceFloatingIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfaceFloatingIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - return &ListBareMetalServerNetworkInterfaceFloatingIpsOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} +// LoadBalancerPoolHealthMonitorPatch : LoadBalancerPoolHealthMonitorPatch struct +type LoadBalancerPoolHealthMonitorPatch struct { + // The seconds to wait between health checks. Must be greater than `timeout`. + Delay *int64 `json:"delay" validate:"required"` -// ListBareMetalServerNetworkInterfaceIpsOptions : The ListBareMetalServerNetworkInterfaceIps options. -type ListBareMetalServerNetworkInterfaceIpsOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + // The health check port. + // + // If set, this overrides the pool member port values. + // + // Specify `null` to remove an existing health check port. + Port *int64 `json:"port,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The seconds to wait for a response to a health check. Must be less than `delay`. + Timeout *int64 `json:"timeout" validate:"required"` + + // The protocol type to use for health checks. + Type *string `json:"type" validate:"required"` + + // The health check URL path. Applicable when `type` is `http` or `https`. + // + // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` } -// NewListBareMetalServerNetworkInterfaceIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceIpsOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfaceIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - return &ListBareMetalServerNetworkInterfaceIpsOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), +// Constants associated with the LoadBalancerPoolHealthMonitorPatch.Type property. +// The protocol type to use for health checks. +const ( + LoadBalancerPoolHealthMonitorPatchTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorPatchTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorPatchTypeTCPConst = "tcp" +) + +// NewLoadBalancerPoolHealthMonitorPatch : Instantiate LoadBalancerPoolHealthMonitorPatch (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolHealthMonitorPatch(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPatch, err error) { + _model = &LoadBalancerPoolHealthMonitorPatch{ + Delay: core.Int64Ptr(delay), + MaxRetries: core.Int64Ptr(maxRetries), + Timeout: core.Int64Ptr(timeout), + Type: core.StringPtr(typeVar), } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options +// UnmarshalLoadBalancerPoolHealthMonitorPatch unmarshals an instance of LoadBalancerPoolHealthMonitorPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitorPatch) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} +// LoadBalancerPoolHealthMonitorPrototype : LoadBalancerPoolHealthMonitorPrototype struct +type LoadBalancerPoolHealthMonitorPrototype struct { + // The seconds to wait between health checks. Must be greater than `timeout`. + Delay *int64 `json:"delay" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceIpsOptions { - options.Headers = param - return options -} + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` -// ListBareMetalServerNetworkInterfacesOptions : The ListBareMetalServerNetworkInterfaces options. -type ListBareMetalServerNetworkInterfacesOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + // The health check port. + // + // If specified, this overrides the pool member port values. + Port *int64 `json:"port,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The seconds to wait for a response to a health check. Must be less than `delay`. + Timeout *int64 `json:"timeout" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The protocol type to use for health checks. + Type *string `json:"type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The health check URL path. Applicable when `type` is `http` or `https`. + // + // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` } -// NewListBareMetalServerNetworkInterfacesOptions : Instantiate ListBareMetalServerNetworkInterfacesOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfacesOptions(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { - return &ListBareMetalServerNetworkInterfacesOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), +// Constants associated with the LoadBalancerPoolHealthMonitorPrototype.Type property. +// The protocol type to use for health checks. +const ( + LoadBalancerPoolHealthMonitorPrototypeTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorPrototypeTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorPrototypeTypeTCPConst = "tcp" +) + +// NewLoadBalancerPoolHealthMonitorPrototype : Instantiate LoadBalancerPoolHealthMonitorPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolHealthMonitorPrototype(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPrototype, err error) { + _model = &LoadBalancerPoolHealthMonitorPrototype{ + Delay: core.Int64Ptr(delay), + MaxRetries: core.Int64Ptr(maxRetries), + Timeout: core.Int64Ptr(timeout), + Type: core.StringPtr(typeVar), } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options +// UnmarshalLoadBalancerPoolHealthMonitorPrototype unmarshals an instance of LoadBalancerPoolHealthMonitorPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitorPrototype) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetStart(start string) *ListBareMetalServerNetworkInterfacesOptions { - _options.Start = core.StringPtr(start) - return _options -} +// LoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. +// Models which "extend" this model: +// - LoadBalancerPoolIdentityByID +// - LoadBalancerPoolIdentityByHref +type LoadBalancerPoolIdentity struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetLimit(limit int64) *ListBareMetalServerNetworkInterfacesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The pool's canonical URL. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfacesOptions { - options.Headers = param - return options +func (*LoadBalancerPoolIdentity) isaLoadBalancerPoolIdentity() bool { + return true } -// ListBareMetalServerProfilesOptions : The ListBareMetalServerProfiles options. -type ListBareMetalServerProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +type LoadBalancerPoolIdentityIntf interface { + isaLoadBalancerPoolIdentity() bool } -// NewListBareMetalServerProfilesOptions : Instantiate ListBareMetalServerProfilesOptions -func (*VpcV1) NewListBareMetalServerProfilesOptions() *ListBareMetalServerProfilesOptions { - return &ListBareMetalServerProfilesOptions{} +// UnmarshalLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerPoolIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListBareMetalServerProfilesOptions) SetStart(start string) *ListBareMetalServerProfilesOptions { - _options.Start = core.StringPtr(start) - return _options +// LoadBalancerPoolIdentityByName : LoadBalancerPoolIdentityByName struct +type LoadBalancerPoolIdentityByName struct { + // The name for this load balancer pool. The name is unique across all pools for the load balancer. + Name *string `json:"name" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServerProfilesOptions) SetLimit(limit int64) *ListBareMetalServerProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// NewLoadBalancerPoolIdentityByName : Instantiate LoadBalancerPoolIdentityByName (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolIdentityByName(name string) (_model *LoadBalancerPoolIdentityByName, err error) { + _model = &LoadBalancerPoolIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerProfilesOptions) SetHeaders(param map[string]string) *ListBareMetalServerProfilesOptions { - options.Headers = param - return options +// UnmarshalLoadBalancerPoolIdentityByName unmarshals an instance of LoadBalancerPoolIdentityByName from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListBareMetalServersOptions : The ListBareMetalServers options. -type ListBareMetalServersOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// LoadBalancerPoolMember : LoadBalancerPoolMember struct +type LoadBalancerPoolMember struct { + // The date and time that this member was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Health of the server member in the pool. + Health *string `json:"health" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The member's canonical URL. + Href *string `json:"href" validate:"required"` - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` + // The unique identifier for this load balancer pool member. + ID *string `json:"id" validate:"required"` - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) + // + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + Port *int64 `json:"port" validate:"required"` - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` + // The provisioning status of this member + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the + // unexpected property value was encountered. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. If the load + // balancer has route mode enabled, the member must be in a zone the load balancer has a + // subnet in. + Target LoadBalancerPoolMemberTargetIntf `json:"target" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// NewListBareMetalServersOptions : Instantiate ListBareMetalServersOptions -func (*VpcV1) NewListBareMetalServersOptions() *ListBareMetalServersOptions { - return &ListBareMetalServersOptions{} +// Constants associated with the LoadBalancerPoolMember.Health property. +// Health of the server member in the pool. +const ( + LoadBalancerPoolMemberHealthFaultedConst = "faulted" + LoadBalancerPoolMemberHealthOkConst = "ok" + LoadBalancerPoolMemberHealthUnknownConst = "unknown" +) + +// Constants associated with the LoadBalancerPoolMember.ProvisioningStatus property. +// The provisioning status of this member +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the +// unexpected property value was encountered. +const ( + LoadBalancerPoolMemberProvisioningStatusActiveConst = "active" + LoadBalancerPoolMemberProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerPoolMemberProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerPoolMemberProvisioningStatusFailedConst = "failed" + LoadBalancerPoolMemberProvisioningStatusUpdatePendingConst = "update_pending" +) + +// UnmarshalLoadBalancerPoolMember unmarshals an instance of LoadBalancerPoolMember from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMember) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health", &obj.Health) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTarget) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListBareMetalServersOptions) SetStart(start string) *ListBareMetalServersOptions { - _options.Start = core.StringPtr(start) - return _options +// LoadBalancerPoolMemberCollection : LoadBalancerPoolMemberCollection struct +type LoadBalancerPoolMemberCollection struct { + // Collection of members. + Members []LoadBalancerPoolMember `json:"members" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServersOptions) SetLimit(limit int64) *ListBareMetalServersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalLoadBalancerPoolMemberCollection unmarshals an instance of LoadBalancerPoolMemberCollection from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberCollection) + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListBareMetalServersOptions) SetResourceGroupID(resourceGroupID string) *ListBareMetalServersOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// LoadBalancerPoolMemberPatch : LoadBalancerPoolMemberPatch struct +type LoadBalancerPoolMemberPatch struct { + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) + // + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + // + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port,omitempty"` + + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. If the load + // balancer has route mode enabled, the member must be in a zone the load balancer has a + // subnet in. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target,omitempty"` + + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// SetName : Allow user to set Name -func (_options *ListBareMetalServersOptions) SetName(name string) *ListBareMetalServersOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalLoadBalancerPoolMemberPatch unmarshals an instance of LoadBalancerPoolMemberPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberPatch) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *ListBareMetalServersOptions) SetVPCID(vpcID string) *ListBareMetalServersOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// AsPatch returns a generic map representation of the LoadBalancerPoolMemberPatch +func (loadBalancerPoolMemberPatch *LoadBalancerPoolMemberPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerPoolMemberPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListBareMetalServersOptions) SetVPCCRN(vpcCRN string) *ListBareMetalServersOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options +// LoadBalancerPoolMemberPrototype : LoadBalancerPoolMemberPrototype struct +type LoadBalancerPoolMemberPrototype struct { + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) + // + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + // + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port" validate:"required"` + + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. If the load + // balancer has route mode enabled, the member must be in a zone the load balancer has a + // subnet in. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` + + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// SetVPCName : Allow user to set VPCName -func (_options *ListBareMetalServersOptions) SetVPCName(vpcName string) *ListBareMetalServersOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options +// NewLoadBalancerPoolMemberPrototype : Instantiate LoadBalancerPoolMemberPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberPrototype(port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) (_model *LoadBalancerPoolMemberPrototype, err error) { + _model = &LoadBalancerPoolMemberPrototype{ + Port: core.Int64Ptr(port), + Target: target, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServersOptions) SetHeaders(param map[string]string) *ListBareMetalServersOptions { - options.Headers = param - return options +// UnmarshalLoadBalancerPoolMemberPrototype unmarshals an instance of LoadBalancerPoolMemberPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberPrototype) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListDedicatedHostDisksOptions : The ListDedicatedHostDisks options. -type ListDedicatedHostDisksOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` +// LoadBalancerPoolMemberReference : LoadBalancerPoolMemberReference struct +type LoadBalancerPoolMemberReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerPoolMemberReferenceDeleted `json:"deleted,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The member's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer pool member. + ID *string `json:"id" validate:"required"` } -// NewListDedicatedHostDisksOptions : Instantiate ListDedicatedHostDisksOptions -func (*VpcV1) NewListDedicatedHostDisksOptions(dedicatedHostID string) *ListDedicatedHostDisksOptions { - return &ListDedicatedHostDisksOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), +// UnmarshalLoadBalancerPoolMemberReference unmarshals an instance of LoadBalancerPoolMemberReference from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolMemberReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListDedicatedHostDisksOptions) SetDedicatedHostID(dedicatedHostID string) *ListDedicatedHostDisksOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options +// LoadBalancerPoolMemberReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type LoadBalancerPoolMemberReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostDisksOptions) SetHeaders(param map[string]string) *ListDedicatedHostDisksOptions { - options.Headers = param - return options +// UnmarshalLoadBalancerPoolMemberReferenceDeleted unmarshals an instance of LoadBalancerPoolMemberReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListDedicatedHostGroupsOptions : The ListDedicatedHostGroups options. -type ListDedicatedHostGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// LoadBalancerPoolMemberTarget : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in +// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a +// zone the load balancer has a subnet in. +// Models which "extend" this model: +// - LoadBalancerPoolMemberTargetInstanceReference +// - LoadBalancerPoolMemberTargetIP +type LoadBalancerPoolMemberTarget struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The URL for this virtual server instance. + Href *string `json:"href,omitempty"` - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The unique identifier for this virtual server instance. + ID *string `json:"id,omitempty"` - // Filters the collection to resources with a `name` property matching the exact specified name. + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListDedicatedHostGroupsOptions : Instantiate ListDedicatedHostGroupsOptions -func (*VpcV1) NewListDedicatedHostGroupsOptions() *ListDedicatedHostGroupsOptions { - return &ListDedicatedHostGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostGroupsOptions) SetStart(start string) *ListDedicatedHostGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostGroupsOptions) SetLimit(limit int64) *ListDedicatedHostGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` } -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostGroupsOptions) SetZoneName(zoneName string) *ListDedicatedHostGroupsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options +func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { + return true } -// SetName : Allow user to set Name -func (_options *ListDedicatedHostGroupsOptions) SetName(name string) *ListDedicatedHostGroupsOptions { - _options.Name = core.StringPtr(name) - return _options +type LoadBalancerPoolMemberTargetIntf interface { + isaLoadBalancerPoolMemberTarget() bool } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostGroupsOptions) SetHeaders(param map[string]string) *ListDedicatedHostGroupsOptions { - options.Headers = param - return options +// UnmarshalLoadBalancerPoolMemberTarget unmarshals an instance of LoadBalancerPoolMemberTarget from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListDedicatedHostProfilesOptions : The ListDedicatedHostProfiles options. -type ListDedicatedHostProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// LoadBalancerPoolMemberTargetPrototype : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in +// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a +// zone the load balancer has a subnet in. +// Models which "extend" this model: +// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity +// - LoadBalancerPoolMemberTargetPrototypeIP +type LoadBalancerPoolMemberTargetPrototype struct { + // The unique identifier for this virtual server instance. + ID *string `json:"id,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The URL for this virtual server instance. + Href *string `json:"href,omitempty"` -// NewListDedicatedHostProfilesOptions : Instantiate ListDedicatedHostProfilesOptions -func (*VpcV1) NewListDedicatedHostProfilesOptions() *ListDedicatedHostProfilesOptions { - return &ListDedicatedHostProfilesOptions{} + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostProfilesOptions) SetStart(start string) *ListDedicatedHostProfilesOptions { - _options.Start = core.StringPtr(start) - return _options +func (*LoadBalancerPoolMemberTargetPrototype) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostProfilesOptions) SetLimit(limit int64) *ListDedicatedHostProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type LoadBalancerPoolMemberTargetPrototypeIntf interface { + isaLoadBalancerPoolMemberTargetPrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostProfilesOptions) SetHeaders(param map[string]string) *ListDedicatedHostProfilesOptions { - options.Headers = param - return options +// UnmarshalLoadBalancerPoolMemberTargetPrototype unmarshals an instance of LoadBalancerPoolMemberTargetPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListDedicatedHostsOptions : The ListDedicatedHosts options. -type ListDedicatedHostsOptions struct { - // Filters the collection to dedicated hosts with a `group.id` property matching the specified identifier. - DedicatedHostGroupID *string `json:"dedicated_host_group.id,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// LoadBalancerPoolPatch : LoadBalancerPoolPatch struct +type LoadBalancerPoolPatch struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm,omitempty"` - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPatch `json:"health_monitor,omitempty"` - // Filters the collection to resources with a `name` property matching the exact specified name. + // The name for this load balancer pool. The name must not be used by another pool for the load balancer. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The protocol for this load balancer pool. + // + // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http` and + // `https`. + // + // If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with + // the listener's protocol. At present, the compatible protocols are `http` and `https`. + Protocol *string `json:"protocol,omitempty"` -// NewListDedicatedHostsOptions : Instantiate ListDedicatedHostsOptions -func (*VpcV1) NewListDedicatedHostsOptions() *ListDedicatedHostsOptions { - return &ListDedicatedHostsOptions{} -} + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` -// SetDedicatedHostGroupID : Allow user to set DedicatedHostGroupID -func (_options *ListDedicatedHostsOptions) SetDedicatedHostGroupID(dedicatedHostGroupID string) *ListDedicatedHostsOptions { - _options.DedicatedHostGroupID = core.StringPtr(dedicatedHostGroupID) - return _options + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePatch `json:"session_persistence,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostsOptions) SetStart(start string) *ListDedicatedHostsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// Constants associated with the LoadBalancerPoolPatch.Algorithm property. +// The load balancing algorithm. +const ( + LoadBalancerPoolPatchAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolPatchAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolPatchAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostsOptions) SetLimit(limit int64) *ListDedicatedHostsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// Constants associated with the LoadBalancerPoolPatch.Protocol property. +// The protocol for this load balancer pool. +// +// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http` and +// `https`. +// +// If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with +// the listener's protocol. At present, the compatible protocols are `http` and `https`. +const ( + LoadBalancerPoolPatchProtocolHTTPConst = "http" + LoadBalancerPoolPatchProtocolHTTPSConst = "https" + LoadBalancerPoolPatchProtocolTCPConst = "tcp" + LoadBalancerPoolPatchProtocolUDPConst = "udp" +) -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// Constants associated with the LoadBalancerPoolPatch.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolPatchProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolPatchProxyProtocolV1Const = "v1" + LoadBalancerPoolPatchProxyProtocolV2Const = "v2" +) -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostsOptions) SetZoneName(zoneName string) *ListDedicatedHostsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options +// UnmarshalLoadBalancerPoolPatch unmarshals an instance of LoadBalancerPoolPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolPatch) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *ListDedicatedHostsOptions) SetName(name string) *ListDedicatedHostsOptions { - _options.Name = core.StringPtr(name) - return _options +// AsPatch returns a generic map representation of the LoadBalancerPoolPatch +func (loadBalancerPoolPatch *LoadBalancerPoolPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerPoolPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostsOptions) SetHeaders(param map[string]string) *ListDedicatedHostsOptions { - options.Headers = param - return options -} +// LoadBalancerPoolPrototype : LoadBalancerPoolPrototype struct +type LoadBalancerPoolPrototype struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` -// ListEndpointGatewayIpsOptions : The ListEndpointGatewayIps options. -type ListEndpointGatewayIpsOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` + // tuple cannot be shared by a pool member of any other load balancer in the same VPC. + Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if + // `udp_supported` is `true`). Load balancers in the + // `application` family support `tcp`, `http`, and `https`. + Protocol *string `json:"protocol" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` + + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` } -// Constants associated with the ListEndpointGatewayIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the LoadBalancerPoolPrototype.Algorithm property. +// The load balancing algorithm. const ( - ListEndpointGatewayIpsOptionsSortAddressConst = "address" - ListEndpointGatewayIpsOptionsSortCreatedAtConst = "created_at" - ListEndpointGatewayIpsOptionsSortNameConst = "name" + LoadBalancerPoolPrototypeAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolPrototypeAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolPrototypeAlgorithmWeightedRoundRobinConst = "weighted_round_robin" ) -// NewListEndpointGatewayIpsOptions : Instantiate ListEndpointGatewayIpsOptions -func (*VpcV1) NewListEndpointGatewayIpsOptions(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - return &ListEndpointGatewayIpsOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), +// Constants associated with the LoadBalancerPoolPrototype.Protocol property. +// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if +// `udp_supported` is `true`). Load balancers in the +// `application` family support `tcp`, `http`, and `https`. +const ( + LoadBalancerPoolPrototypeProtocolHTTPConst = "http" + LoadBalancerPoolPrototypeProtocolHTTPSConst = "https" + LoadBalancerPoolPrototypeProtocolTCPConst = "tcp" + LoadBalancerPoolPrototypeProtocolUDPConst = "udp" +) + +// Constants associated with the LoadBalancerPoolPrototype.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolPrototypeProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolPrototypeProxyProtocolV1Const = "v1" + LoadBalancerPoolPrototypeProxyProtocolV2Const = "v2" +) + +// NewLoadBalancerPoolPrototype : Instantiate LoadBalancerPoolPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolPrototype(algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) (_model *LoadBalancerPoolPrototype, err error) { + _model = &LoadBalancerPoolPrototype{ + Algorithm: core.StringPtr(algorithm), + HealthMonitor: healthMonitor, + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerPoolPrototype unmarshals an instance of LoadBalancerPoolPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolPrototype) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) + if err != nil { + return } + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *ListEndpointGatewayIpsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} +// LoadBalancerPoolReference : LoadBalancerPoolReference struct +type LoadBalancerPoolReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewayIpsOptions) SetStart(start string) *ListEndpointGatewayIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The unique identifier for this load balancer pool. + ID *string `json:"id" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewayIpsOptions) SetLimit(limit int64) *ListEndpointGatewayIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The name for this load balancer pool. The name is unique across all pools for the load balancer. + Name *string `json:"name" validate:"required"` } -// SetSort : Allow user to set Sort -func (_options *ListEndpointGatewayIpsOptions) SetSort(sort string) *ListEndpointGatewayIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options +// UnmarshalLoadBalancerPoolReference unmarshals an instance of LoadBalancerPoolReference from the specified map of raw messages. +func UnmarshalLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayIpsOptions { - options.Headers = param - return options +// LoadBalancerPoolReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type LoadBalancerPoolReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// ListEndpointGatewaysOptions : The ListEndpointGateways options. -type ListEndpointGatewaysOptions struct { - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` +// UnmarshalLoadBalancerPoolReferenceDeleted unmarshals an instance of LoadBalancerPoolReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` +// LoadBalancerPoolSessionPersistence : LoadBalancerPoolSessionPersistence struct +type LoadBalancerPoolSessionPersistence struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type" validate:"required"` +} - // Filters the collection to endpoint gateways with an `allow_dns_resolution_binding` property matching the specified - // value. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` +// Constants associated with the LoadBalancerPoolSessionPersistence.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. +const ( + LoadBalancerPoolSessionPersistenceTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistenceTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistenceTypeSourceIPConst = "source_ip" +) - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalLoadBalancerPoolSessionPersistence unmarshals an instance of LoadBalancerPoolSessionPersistence from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistence) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions -func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { - return &ListEndpointGatewaysOptions{} -} +// LoadBalancerPoolSessionPersistencePatch : The session persistence configuration. Specify `null` to remove any existing session persistence configuration. +type LoadBalancerPoolSessionPersistencePatch struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` -// SetName : Allow user to set Name -func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { - _options.Name = core.StringPtr(name) - return _options + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewaysOptions) SetStart(start string) *ListEndpointGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options -} +// Constants associated with the LoadBalancerPoolSessionPersistencePatch.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. +const ( + LoadBalancerPoolSessionPersistencePatchTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistencePatchTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistencePatchTypeSourceIPConst = "source_ip" +) -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewaysOptions) SetLimit(limit int64) *ListEndpointGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalLoadBalancerPoolSessionPersistencePatch unmarshals an instance of LoadBalancerPoolSessionPersistencePatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistencePatch) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListEndpointGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListEndpointGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// LoadBalancerPoolSessionPersistencePrototype : LoadBalancerPoolSessionPersistencePrototype struct +type LoadBalancerPoolSessionPersistencePrototype struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` -// SetVPCID : Allow user to set VPCID -func (_options *ListEndpointGatewaysOptions) SetVPCID(vpcID string) *ListEndpointGatewaysOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type" validate:"required"` } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListEndpointGatewaysOptions) SetVPCCRN(vpcCRN string) *ListEndpointGatewaysOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} +// Constants associated with the LoadBalancerPoolSessionPersistencePrototype.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. +const ( + LoadBalancerPoolSessionPersistencePrototypeTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistencePrototypeTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistencePrototypeTypeSourceIPConst = "source_ip" +) -// SetVPCName : Allow user to set VPCName -func (_options *ListEndpointGatewaysOptions) SetVPCName(vpcName string) *ListEndpointGatewaysOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options +// NewLoadBalancerPoolSessionPersistencePrototype : Instantiate LoadBalancerPoolSessionPersistencePrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolSessionPersistencePrototype(typeVar string) (_model *LoadBalancerPoolSessionPersistencePrototype, err error) { + _model = &LoadBalancerPoolSessionPersistencePrototype{ + Type: core.StringPtr(typeVar), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *ListEndpointGatewaysOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *ListEndpointGatewaysOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) - return _options +// UnmarshalLoadBalancerPoolSessionPersistencePrototype unmarshals an instance of LoadBalancerPoolSessionPersistencePrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistencePrototype) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewaysOptions) SetHeaders(param map[string]string) *ListEndpointGatewaysOptions { - options.Headers = param - return options -} +// LoadBalancerPrivateIpsItem : LoadBalancerPrivateIpsItem struct +type LoadBalancerPrivateIpsItem struct { + // The IP address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` -// ListFloatingIpsOptions : The ListFloatingIps options. -type ListFloatingIpsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ListFloatingIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the LoadBalancerPrivateIpsItem.ResourceType property. +// The resource type. const ( - ListFloatingIpsOptionsSortCreatedAtConst = "created_at" - ListFloatingIpsOptionsSortNameConst = "name" + LoadBalancerPrivateIpsItemResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) -// NewListFloatingIpsOptions : Instantiate ListFloatingIpsOptions -func (*VpcV1) NewListFloatingIpsOptions() *ListFloatingIpsOptions { - return &ListFloatingIpsOptions{} +// UnmarshalLoadBalancerPrivateIpsItem unmarshals an instance of LoadBalancerPrivateIpsItem from the specified map of raw messages. +func UnmarshalLoadBalancerPrivateIpsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPrivateIpsItem) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListFloatingIpsOptions) SetStart(start string) *ListFloatingIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// LoadBalancerProfile : LoadBalancerProfile struct +type LoadBalancerProfile struct { + // The product family this load balancer profile belongs to. + Family *string `json:"family" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListFloatingIpsOptions) SetLimit(limit int64) *ListFloatingIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The URL for this load balancer profile. + Href *string `json:"href" validate:"required"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFloatingIpsOptions) SetResourceGroupID(resourceGroupID string) *ListFloatingIpsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + InstanceGroupsSupported LoadBalancerProfileInstanceGroupsSupportedIntf `json:"instance_groups_supported" validate:"required"` -// SetSort : Allow user to set Sort -func (_options *ListFloatingIpsOptions) SetSort(sort string) *ListFloatingIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} + // Indicates which logging type(s) are supported for a load balancer with this profile. + LoggingSupported *LoadBalancerProfileLoggingSupported `json:"logging_supported" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListFloatingIpsOptions) SetHeaders(param map[string]string) *ListFloatingIpsOptions { - options.Headers = param - return options -} + // The globally unique name for this load balancer profile. + Name *string `json:"name" validate:"required"` -// ListFlowLogCollectorsOptions : The ListFlowLogCollectors options. -type ListFlowLogCollectorsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + RouteModeSupported LoadBalancerProfileRouteModeSupportedIntf `json:"route_mode_supported" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + SecurityGroupsSupported LoadBalancerProfileSecurityGroupsSupportedIntf `json:"security_groups_supported" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + UDPSupported LoadBalancerProfileUDPSupportedIntf `json:"udp_supported" validate:"required"` +} - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` +// UnmarshalLoadBalancerProfile unmarshals an instance of LoadBalancerProfile from the specified map of raw messages. +func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfile) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_groups_supported", &obj.InstanceGroupsSupported, UnmarshalLoadBalancerProfileInstanceGroupsSupported) + if err != nil { + return + } + err = core.UnmarshalModel(m, "logging_supported", &obj.LoggingSupported, UnmarshalLoadBalancerProfileLoggingSupported) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "route_mode_supported", &obj.RouteModeSupported, UnmarshalLoadBalancerProfileRouteModeSupported) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups_supported", &obj.SecurityGroupsSupported, UnmarshalLoadBalancerProfileSecurityGroupsSupported) + if err != nil { + return + } + err = core.UnmarshalModel(m, "udp_supported", &obj.UDPSupported, UnmarshalLoadBalancerProfileUDPSupported) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` +// LoadBalancerProfileCollection : LoadBalancerProfileCollection struct +type LoadBalancerProfileCollection struct { + // A link to the first page of resources. + First *LoadBalancerProfileCollectionFirst `json:"first" validate:"required"` - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *LoadBalancerProfileCollectionNext `json:"next,omitempty"` - // Filters the collection to resources with a `target.id` property matching the specified identifier. - TargetID *string `json:"target.id,omitempty"` + // Collection of load balancer profiles. + Profiles []LoadBalancerProfile `json:"profiles" validate:"required"` - // Filters the collection to resources with a `target.resource_type` property matching the specified value. - TargetResourceType *string `json:"target.resource_type,omitempty"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalLoadBalancerProfileCollection unmarshals an instance of LoadBalancerProfileCollection from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerProfileCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLoadBalancerProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListFlowLogCollectorsOptions : Instantiate ListFlowLogCollectorsOptions -func (*VpcV1) NewListFlowLogCollectorsOptions() *ListFlowLogCollectorsOptions { - return &ListFlowLogCollectorsOptions{} +// Retrieve the value to be passed to a request to access the next page of results +func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetStart : Allow user to set Start -func (_options *ListFlowLogCollectorsOptions) SetStart(start string) *ListFlowLogCollectorsOptions { - _options.Start = core.StringPtr(start) - return _options +// LoadBalancerProfileCollectionFirst : A link to the first page of resources. +type LoadBalancerProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListFlowLogCollectorsOptions) SetLimit(limit int64) *ListFlowLogCollectorsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalLoadBalancerProfileCollectionFirst unmarshals an instance of LoadBalancerProfileCollectionFirst from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFlowLogCollectorsOptions) SetResourceGroupID(resourceGroupID string) *ListFlowLogCollectorsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// LoadBalancerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type LoadBalancerProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetName : Allow user to set Name -func (_options *ListFlowLogCollectorsOptions) SetName(name string) *ListFlowLogCollectorsOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalLoadBalancerProfileCollectionNext unmarshals an instance of LoadBalancerProfileCollectionNext from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *ListFlowLogCollectorsOptions) SetVPCID(vpcID string) *ListFlowLogCollectorsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// LoadBalancerProfileIdentity : Identifies a load balancer profile by a unique property. +// Models which "extend" this model: +// - LoadBalancerProfileIdentityByName +// - LoadBalancerProfileIdentityByHref +type LoadBalancerProfileIdentity struct { + // The globally unique name for this load balancer profile. + Name *string `json:"name,omitempty"` + + // The URL for this load balancer profile. + Href *string `json:"href,omitempty"` } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListFlowLogCollectorsOptions) SetVPCCRN(vpcCRN string) *ListFlowLogCollectorsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options +func (*LoadBalancerProfileIdentity) isaLoadBalancerProfileIdentity() bool { + return true } -// SetVPCName : Allow user to set VPCName -func (_options *ListFlowLogCollectorsOptions) SetVPCName(vpcName string) *ListFlowLogCollectorsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options +type LoadBalancerProfileIdentityIntf interface { + isaLoadBalancerProfileIdentity() bool } -// SetTargetID : Allow user to set TargetID -func (_options *ListFlowLogCollectorsOptions) SetTargetID(targetID string) *ListFlowLogCollectorsOptions { - _options.TargetID = core.StringPtr(targetID) - return _options +// UnmarshalLoadBalancerProfileIdentity unmarshals an instance of LoadBalancerProfileIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetTargetResourceType : Allow user to set TargetResourceType -func (_options *ListFlowLogCollectorsOptions) SetTargetResourceType(targetResourceType string) *ListFlowLogCollectorsOptions { - _options.TargetResourceType = core.StringPtr(targetResourceType) - return _options -} +// LoadBalancerProfileInstanceGroupsSupported : LoadBalancerProfileInstanceGroupsSupported struct +// Models which "extend" this model: +// - LoadBalancerProfileInstanceGroupsSupportedFixed +// - LoadBalancerProfileInstanceGroupsSupportedDependent +type LoadBalancerProfileInstanceGroupsSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListFlowLogCollectorsOptions) SetHeaders(param map[string]string) *ListFlowLogCollectorsOptions { - options.Headers = param - return options + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -// ListIkePoliciesOptions : The ListIkePolicies options. -type ListIkePoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the LoadBalancerProfileInstanceGroupsSupported.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileInstanceGroupsSupportedTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*LoadBalancerProfileInstanceGroupsSupported) isaLoadBalancerProfileInstanceGroupsSupported() bool { + return true } -// NewListIkePoliciesOptions : Instantiate ListIkePoliciesOptions -func (*VpcV1) NewListIkePoliciesOptions() *ListIkePoliciesOptions { - return &ListIkePoliciesOptions{} +type LoadBalancerProfileInstanceGroupsSupportedIntf interface { + isaLoadBalancerProfileInstanceGroupsSupported() bool } -// SetStart : Allow user to set Start -func (_options *ListIkePoliciesOptions) SetStart(start string) *ListIkePoliciesOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalLoadBalancerProfileInstanceGroupsSupported unmarshals an instance of LoadBalancerProfileInstanceGroupsSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileInstanceGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileInstanceGroupsSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListIkePoliciesOptions) SetLimit(limit int64) *ListIkePoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// LoadBalancerProfileLoggingSupported : Indicates which logging type(s) are supported for a load balancer with this profile. +type LoadBalancerProfileLoggingSupported struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported logging type(s) for a load balancer with this profile. + Value []string `json:"value" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListIkePoliciesOptions) SetHeaders(param map[string]string) *ListIkePoliciesOptions { - options.Headers = param - return options +// Constants associated with the LoadBalancerProfileLoggingSupported.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileLoggingSupportedTypeFixedConst = "fixed" +) + +// UnmarshalLoadBalancerProfileLoggingSupported unmarshals an instance of LoadBalancerProfileLoggingSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileLoggingSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileLoggingSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListIkePolicyConnectionsOptions : The ListIkePolicyConnections options. -type ListIkePolicyConnectionsOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` +// LoadBalancerProfileReference : LoadBalancerProfileReference struct +type LoadBalancerProfileReference struct { + // The product family this load balancer profile belongs to. + Family *string `json:"family" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this load balancer profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this load balancer profile. + Name *string `json:"name" validate:"required"` } -// NewListIkePolicyConnectionsOptions : Instantiate ListIkePolicyConnectionsOptions -func (*VpcV1) NewListIkePolicyConnectionsOptions(id string) *ListIkePolicyConnectionsOptions { - return &ListIkePolicyConnectionsOptions{ - ID: core.StringPtr(id), +// UnmarshalLoadBalancerProfileReference unmarshals an instance of LoadBalancerProfileReference from the specified map of raw messages. +func UnmarshalLoadBalancerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileReference) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ListIkePolicyConnectionsOptions) SetID(id string) *ListIkePolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options -} +// LoadBalancerProfileRouteModeSupported : LoadBalancerProfileRouteModeSupported struct +// Models which "extend" this model: +// - LoadBalancerProfileRouteModeSupportedFixed +// - LoadBalancerProfileRouteModeSupportedDependent +type LoadBalancerProfileRouteModeSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListIkePolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIkePolicyConnectionsOptions { - options.Headers = param - return options + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -// ListImageExportJobsOptions : The ListImageExportJobs options. -type ListImageExportJobsOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` +// Constants associated with the LoadBalancerProfileRouteModeSupported.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileRouteModeSupportedTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*LoadBalancerProfileRouteModeSupported) isaLoadBalancerProfileRouteModeSupported() bool { + return true } -// NewListImageExportJobsOptions : Instantiate ListImageExportJobsOptions -func (*VpcV1) NewListImageExportJobsOptions(imageID string) *ListImageExportJobsOptions { - return &ListImageExportJobsOptions{ - ImageID: core.StringPtr(imageID), - } +type LoadBalancerProfileRouteModeSupportedIntf interface { + isaLoadBalancerProfileRouteModeSupported() bool } -// SetImageID : Allow user to set ImageID -func (_options *ListImageExportJobsOptions) SetImageID(imageID string) *ListImageExportJobsOptions { - _options.ImageID = core.StringPtr(imageID) - return _options +// UnmarshalLoadBalancerProfileRouteModeSupported unmarshals an instance of LoadBalancerProfileRouteModeSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileRouteModeSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileRouteModeSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *ListImageExportJobsOptions) SetName(name string) *ListImageExportJobsOptions { - _options.Name = core.StringPtr(name) - return _options -} +// LoadBalancerProfileSecurityGroupsSupported : LoadBalancerProfileSecurityGroupsSupported struct +// Models which "extend" this model: +// - LoadBalancerProfileSecurityGroupsSupportedFixed +// - LoadBalancerProfileSecurityGroupsSupportedDependent +type LoadBalancerProfileSecurityGroupsSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListImageExportJobsOptions) SetHeaders(param map[string]string) *ListImageExportJobsOptions { - options.Headers = param - return options + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -// ListImagesOptions : The ListImages options. -type ListImagesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the LoadBalancerProfileSecurityGroupsSupported.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileSecurityGroupsSupportedTypeFixedConst = "fixed" +) - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +func (*LoadBalancerProfileSecurityGroupsSupported) isaLoadBalancerProfileSecurityGroupsSupported() bool { + return true +} - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` +type LoadBalancerProfileSecurityGroupsSupportedIntf interface { + isaLoadBalancerProfileSecurityGroupsSupported() bool +} - // Filters the collection to images with a `status` property matching one of the specified comma-separated values. - Status []string `json:"status,omitempty"` +// UnmarshalLoadBalancerProfileSecurityGroupsSupported unmarshals an instance of LoadBalancerProfileSecurityGroupsSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileSecurityGroupsSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to images with a `visibility` property matching the specified value. - Visibility *string `json:"visibility,omitempty"` +// LoadBalancerProfileUDPSupported : LoadBalancerProfileUDPSupported struct +// Models which "extend" this model: +// - LoadBalancerProfileUDPSupportedFixed +// - LoadBalancerProfileUDPSupportedDependent +type LoadBalancerProfileUDPSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -// Constants associated with the ListImagesOptions.Status property. -const ( - ListImagesOptionsStatusAvailableConst = "available" - ListImagesOptionsStatusDeletingConst = "deleting" - ListImagesOptionsStatusDeprecatedConst = "deprecated" - ListImagesOptionsStatusFailedConst = "failed" - ListImagesOptionsStatusObsoleteConst = "obsolete" - ListImagesOptionsStatusPendingConst = "pending" - ListImagesOptionsStatusUnusableConst = "unusable" -) - -// Constants associated with the ListImagesOptions.Visibility property. -// Filters the collection to images with a `visibility` property matching the specified value. +// Constants associated with the LoadBalancerProfileUDPSupported.Type property. +// The type for this profile field. const ( - ListImagesOptionsVisibilityPrivateConst = "private" - ListImagesOptionsVisibilityPublicConst = "public" + LoadBalancerProfileUDPSupportedTypeFixedConst = "fixed" ) -// NewListImagesOptions : Instantiate ListImagesOptions -func (*VpcV1) NewListImagesOptions() *ListImagesOptions { - return &ListImagesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListImagesOptions) SetStart(start string) *ListImagesOptions { - _options.Start = core.StringPtr(start) - return _options +func (*LoadBalancerProfileUDPSupported) isaLoadBalancerProfileUDPSupported() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListImagesOptions) SetLimit(limit int64) *ListImagesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type LoadBalancerProfileUDPSupportedIntf interface { + isaLoadBalancerProfileUDPSupported() bool } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListImagesOptions) SetResourceGroupID(resourceGroupID string) *ListImagesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// UnmarshalLoadBalancerProfileUDPSupported unmarshals an instance of LoadBalancerProfileUDPSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileUDPSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileUDPSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *ListImagesOptions) SetName(name string) *ListImagesOptions { - _options.Name = core.StringPtr(name) - return _options +// LoadBalancerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type LoadBalancerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetStatus : Allow user to set Status -func (_options *ListImagesOptions) SetStatus(status []string) *ListImagesOptions { - _options.Status = status - return _options +// UnmarshalLoadBalancerReferenceDeleted unmarshals an instance of LoadBalancerReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVisibility : Allow user to set Visibility -func (_options *ListImagesOptions) SetVisibility(visibility string) *ListImagesOptions { - _options.Visibility = core.StringPtr(visibility) - return _options -} +// LoadBalancerStatistics : LoadBalancerStatistics struct +type LoadBalancerStatistics struct { + // Number of active connections of this load balancer. + ActiveConnections *int64 `json:"active_connections" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListImagesOptions) SetHeaders(param map[string]string) *ListImagesOptions { - options.Headers = param - return options -} + // Current connection rate (connections per second) of this load balancer. + ConnectionRate *float32 `json:"connection_rate" validate:"required"` -// ListInstanceDisksOptions : The ListInstanceDisks options. -type ListInstanceDisksOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // Total number of data processed (bytes) of this load balancer within current calendar month. + DataProcessedThisMonth *int64 `json:"data_processed_this_month" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Current throughput (Mbps) of this load balancer. + Throughput *float32 `json:"throughput" validate:"required"` } -// NewListInstanceDisksOptions : Instantiate ListInstanceDisksOptions -func (*VpcV1) NewListInstanceDisksOptions(instanceID string) *ListInstanceDisksOptions { - return &ListInstanceDisksOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalLoadBalancerStatistics unmarshals an instance of LoadBalancerStatistics from the specified map of raw messages. +func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerStatistics) + err = core.UnmarshalPrimitive(m, "active_connections", &obj.ActiveConnections) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_rate", &obj.ConnectionRate) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "data_processed_this_month", &obj.DataProcessedThisMonth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "throughput", &obj.Throughput) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceDisksOptions) SetInstanceID(instanceID string) *ListInstanceDisksOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// NetworkACL : NetworkACL struct +type NetworkACL struct { + // The date and time that the network ACL was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` + + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` + + // The name for this network ACL. The name is unique across all network ACLs for the VPC. + Name *string `json:"name" validate:"required"` + + // The resource group for this network ACL. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The ordered rules for this network ACL. If no rules exist, all traffic will be denied. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + + // The subnets to which this network ACL is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The VPC this network ACL resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceDisksOptions) SetHeaders(param map[string]string) *ListInstanceDisksOptions { - options.Headers = param - return options +// UnmarshalNetworkACL unmarshals an instance of NetworkACL from the specified map of raw messages. +func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACL) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceGroupManagerActionsOptions : The ListInstanceGroupManagerActions options. -type ListInstanceGroupManagerActionsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// NetworkACLCollection : NetworkACLCollection struct +type NetworkACLCollection struct { + // A link to the first page of resources. + First *NetworkACLCollectionFirst `json:"first" validate:"required"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // Collection of network ACLs. + NetworkAcls []NetworkACL `json:"network_acls" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *NetworkACLCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListInstanceGroupManagerActionsOptions : Instantiate ListInstanceGroupManagerActionsOptions -func (*VpcV1) NewListInstanceGroupManagerActionsOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - return &ListInstanceGroupManagerActionsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), +// UnmarshalNetworkACLCollection unmarshals an instance of NetworkACLCollection from the specified map of raw messages. +func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_acls", &obj.NetworkAcls, UnmarshalNetworkACL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *NetworkACLCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// NetworkACLCollectionFirst : A link to the first page of resources. +type NetworkACLCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerActionsOptions) SetStart(start string) *ListInstanceGroupManagerActionsOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalNetworkACLCollectionFirst unmarshals an instance of NetworkACLCollectionFirst from the specified map of raw messages. +func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerActionsOptions) SetLimit(limit int64) *ListInstanceGroupManagerActionsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// NetworkACLCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type NetworkACLCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerActionsOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerActionsOptions { - options.Headers = param - return options +// UnmarshalNetworkACLCollectionNext unmarshals an instance of NetworkACLCollectionNext from the specified map of raw messages. +func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceGroupManagerPoliciesOptions : The ListInstanceGroupManagerPolicies options. -type ListInstanceGroupManagerPoliciesOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// NetworkACLIdentity : Identifies a network ACL by a unique property. +// Models which "extend" this model: +// - NetworkACLIdentityByID +// - NetworkACLIdentityByCRN +// - NetworkACLIdentityByHref +type NetworkACLIdentity struct { + // The unique identifier for this network ACL. + ID *string `json:"id,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The CRN for this network ACL. + CRN *string `json:"crn,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this network ACL. + Href *string `json:"href,omitempty"` } -// NewListInstanceGroupManagerPoliciesOptions : Instantiate ListInstanceGroupManagerPoliciesOptions -func (*VpcV1) NewListInstanceGroupManagerPoliciesOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - return &ListInstanceGroupManagerPoliciesOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - } +func (*NetworkACLIdentity) isaNetworkACLIdentity() bool { + return true } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +type NetworkACLIdentityIntf interface { + isaNetworkACLIdentity() bool } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// UnmarshalNetworkACLIdentity unmarshals an instance of NetworkACLIdentity from the specified map of raw messages. +func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerPoliciesOptions) SetStart(start string) *ListInstanceGroupManagerPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options +// NetworkACLPatch : NetworkACLPatch struct +type NetworkACLPatch struct { + // The name for this network ACL. The name must not be used by another network ACL for the VPC. + Name *string `json:"name,omitempty"` } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerPoliciesOptions) SetLimit(limit int64) *ListInstanceGroupManagerPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalNetworkACLPatch unmarshals an instance of NetworkACLPatch from the specified map of raw messages. +func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerPoliciesOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerPoliciesOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the NetworkACLPatch +func (networkACLPatch *NetworkACLPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(networkACLPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// ListInstanceGroupManagersOptions : The ListInstanceGroupManagers options. -type ListInstanceGroupManagersOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// NetworkACLPrototype : NetworkACLPrototype struct +// Models which "extend" this model: +// - NetworkACLPrototypeNetworkACLByRules +// - NetworkACLPrototypeNetworkACLBySourceNetworkACL +type NetworkACLPrototype struct { + // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The VPC this network ACL will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, + // resulting in all traffic being denied. + Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` -// NewListInstanceGroupManagersOptions : Instantiate ListInstanceGroupManagersOptions -func (*VpcV1) NewListInstanceGroupManagersOptions(instanceGroupID string) *ListInstanceGroupManagersOptions { - return &ListInstanceGroupManagersOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } + // Network ACL to copy rules from. + SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl,omitempty"` } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagersOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagersOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +func (*NetworkACLPrototype) isaNetworkACLPrototype() bool { + return true } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagersOptions) SetStart(start string) *ListInstanceGroupManagersOptions { - _options.Start = core.StringPtr(start) - return _options +type NetworkACLPrototypeIntf interface { + isaNetworkACLPrototype() bool } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagersOptions) SetLimit(limit int64) *ListInstanceGroupManagersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalNetworkACLPrototype unmarshals an instance of NetworkACLPrototype from the specified map of raw messages. +func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagersOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagersOptions { - options.Headers = param - return options -} +// NetworkACLReference : NetworkACLReference struct +type NetworkACLReference struct { + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` -// ListInstanceGroupMembershipsOptions : The ListInstanceGroupMemberships options. -type ListInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkACLReferenceDeleted `json:"deleted,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this network ACL. The name is unique across all network ACLs for the VPC. + Name *string `json:"name" validate:"required"` } -// NewListInstanceGroupMembershipsOptions : Instantiate ListInstanceGroupMembershipsOptions -func (*VpcV1) NewListInstanceGroupMembershipsOptions(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - return &ListInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), +// UnmarshalNetworkACLReference unmarshals an instance of NetworkACLReference from the specified map of raw messages. +func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// NetworkACLReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkACLReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupMembershipsOptions) SetStart(start string) *ListInstanceGroupMembershipsOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalNetworkACLReferenceDeleted unmarshals an instance of NetworkACLReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupMembershipsOptions) SetLimit(limit int64) *ListInstanceGroupMembershipsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// NetworkACLRule : NetworkACLRule struct +// Models which "extend" this model: +// - NetworkACLRuleNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleNetworkACLRuleProtocolIcmp +// - NetworkACLRuleNetworkACLRuleProtocolAll +type NetworkACLRule struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *ListInstanceGroupMembershipsOptions { - options.Headers = param - return options -} + // The rule that this rule is immediately before. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` -// ListInstanceGroupsOptions : The ListInstanceGroups options. -type ListInstanceGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// NewListInstanceGroupsOptions : Instantiate ListInstanceGroupsOptions -func (*VpcV1) NewListInstanceGroupsOptions() *ListInstanceGroupsOptions { - return &ListInstanceGroupsOptions{} -} + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupsOptions) SetStart(start string) *ListInstanceGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupsOptions) SetLimit(limit int64) *ListInstanceGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupsOptions) SetHeaders(param map[string]string) *ListInstanceGroupsOptions { - options.Headers = param - return options -} + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` -// ListInstanceNetworkInterfaceFloatingIpsOptions : The ListInstanceNetworkInterfaceFloatingIps options. -type ListInstanceNetworkInterfaceFloatingIpsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` -// NewListInstanceNetworkInterfaceFloatingIpsOptions : Instantiate ListInstanceNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - return &ListInstanceNetworkInterfaceFloatingIpsOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } -} + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} + // The ICMP traffic code to match. + // + // If absent, all codes are matched. + Code *int64 `json:"code,omitempty"` -// ListInstanceNetworkInterfaceIpsOptions : The ListInstanceNetworkInterfaceIps options. -type ListInstanceNetworkInterfaceIpsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The ICMP traffic type to match. + // + // If absent, all types are matched. + Type *int64 `json:"type,omitempty"` +} - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` +// Constants associated with the NetworkACLRule.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleActionAllowConst = "allow" + NetworkACLRuleActionDenyConst = "deny" +) - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// Constants associated with the NetworkACLRule.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleDirectionInboundConst = "inbound" + NetworkACLRuleDirectionOutboundConst = "outbound" +) - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the NetworkACLRule.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleIPVersionIpv4Const = "ipv4" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkACLRule.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleProtocolAllConst = "all" + NetworkACLRuleProtocolIcmpConst = "icmp" + NetworkACLRuleProtocolTCPConst = "tcp" + NetworkACLRuleProtocolUDPConst = "udp" +) -// NewListInstanceNetworkInterfaceIpsOptions : Instantiate ListInstanceNetworkInterfaceIpsOptions -func (*VpcV1) NewListInstanceNetworkInterfaceIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { - return &ListInstanceNetworkInterfaceIpsOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } +func (*NetworkACLRule) isaNetworkACLRule() bool { + return true } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceIpsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +type NetworkACLRuleIntf interface { + isaNetworkACLRule() bool } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options +// UnmarshalNetworkACLRule unmarshals an instance of NetworkACLRule from the specified map of raw messages. +func UnmarshalNetworkACLRule(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + return + } + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return } -// SetStart : Allow user to set Start -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetStart(start string) *ListInstanceNetworkInterfaceIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// NetworkACLRuleBeforePatch : The rule to move this rule immediately before. +// +// Specify `null` to move this rule after all existing rules. +// Models which "extend" this model: +// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID +// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref +type NetworkACLRuleBeforePatch struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetLimit(limit int64) *ListInstanceNetworkInterfaceIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The URL for this network ACL rule. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceIpsOptions { - options.Headers = param - return options +func (*NetworkACLRuleBeforePatch) isaNetworkACLRuleBeforePatch() bool { + return true } -// ListInstanceNetworkInterfacesOptions : The ListInstanceNetworkInterfaces options. -type ListInstanceNetworkInterfacesOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +type NetworkACLRuleBeforePatchIntf interface { + isaNetworkACLRuleBeforePatch() bool } -// NewListInstanceNetworkInterfacesOptions : Instantiate ListInstanceNetworkInterfacesOptions -func (*VpcV1) NewListInstanceNetworkInterfacesOptions(instanceID string) *ListInstanceNetworkInterfacesOptions { - return &ListInstanceNetworkInterfacesOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalNetworkACLRuleBeforePatch unmarshals an instance of NetworkACLRuleBeforePatch from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfacesOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfacesOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} +// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. +// +// If unspecified, this rule will be inserted after all existing rules. +// Models which "extend" this model: +// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID +// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref +type NetworkACLRuleBeforePrototype struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfacesOptions { - options.Headers = param - return options + // The URL for this network ACL rule. + Href *string `json:"href,omitempty"` } -// ListInstanceProfilesOptions : The ListInstanceProfiles options. -type ListInstanceProfilesOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string +func (*NetworkACLRuleBeforePrototype) isaNetworkACLRuleBeforePrototype() bool { + return true } -// NewListInstanceProfilesOptions : Instantiate ListInstanceProfilesOptions -func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { - return &ListInstanceProfilesOptions{} +type NetworkACLRuleBeforePrototypeIntf interface { + isaNetworkACLRuleBeforePrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { - options.Headers = param - return options +// UnmarshalNetworkACLRuleBeforePrototype unmarshals an instance of NetworkACLRuleBeforePrototype from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceTemplatesOptions : The ListInstanceTemplates options. -type ListInstanceTemplatesOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} +// NetworkACLRuleCollection : NetworkACLRuleCollection struct +type NetworkACLRuleCollection struct { + // A link to the first page of resources. + First *NetworkACLRuleCollectionFirst `json:"first" validate:"required"` -// NewListInstanceTemplatesOptions : Instantiate ListInstanceTemplatesOptions -func (*VpcV1) NewListInstanceTemplatesOptions() *ListInstanceTemplatesOptions { - return &ListInstanceTemplatesOptions{} -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceTemplatesOptions) SetHeaders(param map[string]string) *ListInstanceTemplatesOptions { - options.Headers = param - return options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *NetworkACLRuleCollectionNext `json:"next,omitempty"` -// ListInstanceVolumeAttachmentsOptions : The ListInstanceVolumeAttachments options. -type ListInstanceVolumeAttachmentsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // Ordered collection of network ACL rules. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListInstanceVolumeAttachmentsOptions : Instantiate ListInstanceVolumeAttachmentsOptions -func (*VpcV1) NewListInstanceVolumeAttachmentsOptions(instanceID string) *ListInstanceVolumeAttachmentsOptions { - return &ListInstanceVolumeAttachmentsOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalNetworkACLRuleCollection unmarshals an instance of NetworkACLRuleCollection from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLRuleCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLRuleCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceVolumeAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceVolumeAttachmentsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceVolumeAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceVolumeAttachmentsOptions { - options.Headers = param - return options +// NetworkACLRuleCollectionFirst : A link to the first page of resources. +type NetworkACLRuleCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// ListInstancesOptions : The ListInstances options. -type ListInstancesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to instances with a `dedicated_host.id` property matching the specified identifier. - DedicatedHostID *string `json:"dedicated_host.id,omitempty"` - - // Filters the collection to instances with a `dedicated_host.crn` property matching the specified CRN. - DedicatedHostCRN *string `json:"dedicated_host.crn,omitempty"` - - // Filters the collection to instances with a `dedicated_host.name` property matching the exact specified name. - DedicatedHostName *string `json:"dedicated_host.name,omitempty"` - - // Filters the collection to instances with a `placement_target.id` property matching the specified placement group - // identifier. - PlacementGroupID *string `json:"placement_group.id,omitempty"` - - // Filters the collection to instances with a `placement_target.crn` property matching the specified placement group - // CRN. - PlacementGroupCRN *string `json:"placement_group.crn,omitempty"` - - // Filters the collection to instances with a `placement_target.name` property matching the exact specified placement - // group name. - PlacementGroupName *string `json:"placement_group.name,omitempty"` - - // Filters the collection to instances with a `reservation.id` property matching the specified identifier. - ReservationID *string `json:"reservation.id,omitempty"` - - // Filters the collection to instances with a `reservation.crn` property matching the specified CRN. - ReservationCRN *string `json:"reservation.crn,omitempty"` - - // Filters the collection to resources with a `reservation.name` property matching the exact specified name. - ReservationName *string `json:"reservation.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalNetworkACLRuleCollectionFirst unmarshals an instance of NetworkACLRuleCollectionFirst from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListInstancesOptions : Instantiate ListInstancesOptions -func (*VpcV1) NewListInstancesOptions() *ListInstancesOptions { - return &ListInstancesOptions{} +// NetworkACLRuleCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type NetworkACLRuleCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListInstancesOptions) SetStart(start string) *ListInstancesOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalNetworkACLRuleCollectionNext unmarshals an instance of NetworkACLRuleCollectionNext from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListInstancesOptions) SetLimit(limit int64) *ListInstancesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// NetworkACLRuleItem : NetworkACLRuleItem struct +// Models which "extend" this model: +// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp +// - NetworkACLRuleItemNetworkACLRuleProtocolAll +type NetworkACLRuleItem struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListInstancesOptions) SetResourceGroupID(resourceGroupID string) *ListInstancesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The rule that this rule is immediately before. In a rule collection, this always + // refers to the next item in the collection. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` -// SetName : Allow user to set Name -func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetVPCID : Allow user to set VPCID -func (_options *ListInstancesOptions) SetVPCID(vpcID string) *ListInstancesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListInstancesOptions) SetVPCCRN(vpcCRN string) *ListInstancesOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// SetVPCName : Allow user to set VPCName -func (_options *ListInstancesOptions) SetVPCName(vpcName string) *ListInstancesOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListInstancesOptions) SetDedicatedHostID(dedicatedHostID string) *ListInstancesOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` -// SetDedicatedHostCRN : Allow user to set DedicatedHostCRN -func (_options *ListInstancesOptions) SetDedicatedHostCRN(dedicatedHostCRN string) *ListInstancesOptions { - _options.DedicatedHostCRN = core.StringPtr(dedicatedHostCRN) - return _options -} + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` -// SetDedicatedHostName : Allow user to set DedicatedHostName -func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName string) *ListInstancesOptions { - _options.DedicatedHostName = core.StringPtr(dedicatedHostName) - return _options -} + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` -// SetPlacementGroupID : Allow user to set PlacementGroupID -func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { - _options.PlacementGroupID = core.StringPtr(placementGroupID) - return _options -} + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` -// SetPlacementGroupCRN : Allow user to set PlacementGroupCRN -func (_options *ListInstancesOptions) SetPlacementGroupCRN(placementGroupCRN string) *ListInstancesOptions { - _options.PlacementGroupCRN = core.StringPtr(placementGroupCRN) - return _options -} + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` -// SetPlacementGroupName : Allow user to set PlacementGroupName -func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName string) *ListInstancesOptions { - _options.PlacementGroupName = core.StringPtr(placementGroupName) - return _options -} + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` -// SetReservationID : Allow user to set ReservationID -func (_options *ListInstancesOptions) SetReservationID(reservationID string) *ListInstancesOptions { - _options.ReservationID = core.StringPtr(reservationID) - return _options -} + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` -// SetReservationCRN : Allow user to set ReservationCRN -func (_options *ListInstancesOptions) SetReservationCRN(reservationCRN string) *ListInstancesOptions { - _options.ReservationCRN = core.StringPtr(reservationCRN) - return _options -} + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` -// SetReservationName : Allow user to set ReservationName -func (_options *ListInstancesOptions) SetReservationName(reservationName string) *ListInstancesOptions { - _options.ReservationName = core.StringPtr(reservationName) - return _options -} + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { - options.Headers = param - return options + // The ICMP traffic code to match. + // + // If absent, all codes are matched. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to match. + // + // If absent, all types are matched. + Type *int64 `json:"type,omitempty"` } -// ListIpsecPoliciesOptions : The ListIpsecPolicies options. -type ListIpsecPoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// Constants associated with the NetworkACLRuleItem.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleItemActionAllowConst = "allow" + NetworkACLRuleItemActionDenyConst = "deny" +) - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the NetworkACLRuleItem.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemDirectionInboundConst = "inbound" + NetworkACLRuleItemDirectionOutboundConst = "outbound" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkACLRuleItem.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleItemIPVersionIpv4Const = "ipv4" +) -// NewListIpsecPoliciesOptions : Instantiate ListIpsecPoliciesOptions -func (*VpcV1) NewListIpsecPoliciesOptions() *ListIpsecPoliciesOptions { - return &ListIpsecPoliciesOptions{} -} +// Constants associated with the NetworkACLRuleItem.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleItemProtocolAllConst = "all" + NetworkACLRuleItemProtocolIcmpConst = "icmp" + NetworkACLRuleItemProtocolTCPConst = "tcp" + NetworkACLRuleItemProtocolUDPConst = "udp" +) -// SetStart : Allow user to set Start -func (_options *ListIpsecPoliciesOptions) SetStart(start string) *ListIpsecPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options +func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListIpsecPoliciesOptions) SetLimit(limit int64) *ListIpsecPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type NetworkACLRuleItemIntf interface { + isaNetworkACLRuleItem() bool } -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPoliciesOptions) SetHeaders(param map[string]string) *ListIpsecPoliciesOptions { - options.Headers = param - return options +// UnmarshalNetworkACLRuleItem unmarshals an instance of NetworkACLRuleItem from the specified map of raw messages. +func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + return + } + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return } -// ListIpsecPolicyConnectionsOptions : The ListIpsecPolicyConnections options. -type ListIpsecPolicyConnectionsOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` +// NetworkACLRulePatch : NetworkACLRulePatch struct +type NetworkACLRulePatch struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The rule to move this rule immediately before. + // + // Specify `null` to move this rule after all existing rules. + Before NetworkACLRuleBeforePatchIntf `json:"before,omitempty"` -// NewListIpsecPolicyConnectionsOptions : Instantiate ListIpsecPolicyConnectionsOptions -func (*VpcV1) NewListIpsecPolicyConnectionsOptions(id string) *ListIpsecPolicyConnectionsOptions { - return &ListIpsecPolicyConnectionsOptions{ - ID: core.StringPtr(id), - } -} + // The ICMP traffic code to match. If set, `type` must also be set. + // + // Specify `null` to remove an existing ICMP traffic code. + Code *int64 `json:"code,omitempty"` -// SetID : Allow user to set ID -func (_options *ListIpsecPolicyConnectionsOptions) SetID(id string) *ListIpsecPolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIpsecPolicyConnectionsOptions { - options.Headers = param - return options -} + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` -// ListKeysOptions : The ListKeys options. -type ListKeysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The direction of traffic to match. + Direction *string `json:"direction,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. + Name *string `json:"name,omitempty"` -// NewListKeysOptions : Instantiate ListKeysOptions -func (*VpcV1) NewListKeysOptions() *ListKeysOptions { - return &ListKeysOptions{} -} + // The protocol to enforce. + Protocol *string `json:"protocol,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListKeysOptions) SetStart(start string) *ListKeysOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListKeysOptions) SetLimit(limit int64) *ListKeysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListKeysOptions) SetHeaders(param map[string]string) *ListKeysOptions { - options.Headers = param - return options + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic type to match. + // + // Specify `null` to remove an existing ICMP traffic type value. + Type *int64 `json:"type,omitempty"` } -// ListLoadBalancerListenerPoliciesOptions : The ListLoadBalancerListenerPolicies options. -type ListLoadBalancerListenerPoliciesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// Constants associated with the NetworkACLRulePatch.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePatchActionAllowConst = "allow" + NetworkACLRulePatchActionDenyConst = "deny" +) - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` +// Constants associated with the NetworkACLRulePatch.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePatchDirectionInboundConst = "inbound" + NetworkACLRulePatchDirectionOutboundConst = "outbound" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkACLRulePatch.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePatchProtocolAllConst = "all" + NetworkACLRulePatchProtocolIcmpConst = "icmp" + NetworkACLRulePatchProtocolTCPConst = "tcp" + NetworkACLRulePatchProtocolUDPConst = "udp" +) -// NewListLoadBalancerListenerPoliciesOptions : Instantiate ListLoadBalancerListenerPoliciesOptions -func (*VpcV1) NewListLoadBalancerListenerPoliciesOptions(loadBalancerID string, listenerID string) *ListLoadBalancerListenerPoliciesOptions { - return &ListLoadBalancerListenerPoliciesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), +// UnmarshalNetworkACLRulePatch unmarshals an instance of NetworkACLRulePatch from the specified map of raw messages. +func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePatch) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// AsPatch returns a generic map representation of the NetworkACLRulePatch +func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(networkACLRulePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPoliciesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPoliciesOptions { - options.Headers = param - return options -} +// NetworkACLRulePrototype : NetworkACLRulePrototype struct +// Models which "extend" this model: +// - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype +// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype +// - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype +type NetworkACLRulePrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// ListLoadBalancerListenerPolicyRulesOptions : The ListLoadBalancerListenerPolicyRules options. -type ListLoadBalancerListenerPolicyRulesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The rule to insert this rule immediately before. + // + // If unspecified, this rule will be inserted after all existing rules. + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` -// NewListLoadBalancerListenerPolicyRulesOptions : Instantiate ListLoadBalancerListenerPolicyRulesOptions -func (*VpcV1) NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID string, listenerID string, policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - return &ListLoadBalancerListenerPolicyRulesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - } -} + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` -// SetPolicyID : Allow user to set PolicyID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetPolicyID(policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPolicyRulesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPolicyRulesOptions { - options.Headers = param - return options -} + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` -// ListLoadBalancerListenersOptions : The ListLoadBalancerListeners options. -type ListLoadBalancerListenersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` -// NewListLoadBalancerListenersOptions : Instantiate ListLoadBalancerListenersOptions -func (*VpcV1) NewListLoadBalancerListenersOptions(loadBalancerID string) *ListLoadBalancerListenersOptions { - return &ListLoadBalancerListenersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - } -} + // The ICMP traffic code to match. + // + // If specified, `type` must also be specified. If unspecified, all codes are matched. + Code *int64 `json:"code,omitempty"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options + // The ICMP traffic type to match. + // + // If unspecified, all types are matched. + Type *int64 `json:"type,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenersOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenersOptions { - options.Headers = param - return options -} +// Constants associated with the NetworkACLRulePrototype.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeActionDenyConst = "deny" +) -// ListLoadBalancerPoolMembersOptions : The ListLoadBalancerPoolMembers options. -type ListLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// Constants associated with the NetworkACLRulePrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeDirectionOutboundConst = "outbound" +) - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` +// Constants associated with the NetworkACLRulePrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeIPVersionIpv4Const = "ipv4" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkACLRulePrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeProtocolAllConst = "all" + NetworkACLRulePrototypeProtocolIcmpConst = "icmp" + NetworkACLRulePrototypeProtocolTCPConst = "tcp" + NetworkACLRulePrototypeProtocolUDPConst = "udp" +) -// NewListLoadBalancerPoolMembersOptions : Instantiate ListLoadBalancerPoolMembersOptions -func (*VpcV1) NewListLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string) *ListLoadBalancerPoolMembersOptions { - return &ListLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - } +func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { + return true } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +type NetworkACLRulePrototypeIntf interface { + isaNetworkACLRulePrototype() bool } -// SetPoolID : Allow user to set PoolID -func (_options *ListLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ListLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options +// UnmarshalNetworkACLRulePrototype unmarshals an instance of NetworkACLRulePrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + return + } + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolMembersOptions { - options.Headers = param - return options -} +// NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct +// Models which "extend" this model: +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype +type NetworkACLRulePrototypeNetworkACLContext struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// ListLoadBalancerPoolsOptions : The ListLoadBalancerPools options. -type ListLoadBalancerPoolsOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// NewListLoadBalancerPoolsOptions : Instantiate ListLoadBalancerPoolsOptions -func (*VpcV1) NewListLoadBalancerPoolsOptions(loadBalancerID string) *ListLoadBalancerPoolsOptions { - return &ListLoadBalancerPoolsOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - } -} + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolsOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolsOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolsOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolsOptions { - options.Headers = param - return options -} + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` -// ListLoadBalancerProfilesOptions : The ListLoadBalancerProfiles options. -type ListLoadBalancerProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` -// NewListLoadBalancerProfilesOptions : Instantiate ListLoadBalancerProfilesOptions -func (*VpcV1) NewListLoadBalancerProfilesOptions() *ListLoadBalancerProfilesOptions { - return &ListLoadBalancerProfilesOptions{} -} + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListLoadBalancerProfilesOptions) SetStart(start string) *ListLoadBalancerProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancerProfilesOptions) SetLimit(limit int64) *ListLoadBalancerProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The ICMP traffic code to match. + // + // If specified, `type` must also be specified. If unspecified, all codes are matched. + Code *int64 `json:"code,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerProfilesOptions) SetHeaders(param map[string]string) *ListLoadBalancerProfilesOptions { - options.Headers = param - return options + // The ICMP traffic type to match. + // + // If unspecified, all types are matched. + Type *int64 `json:"type,omitempty"` } -// ListLoadBalancersOptions : The ListLoadBalancers options. -type ListLoadBalancersOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" +) - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextDirectionOutboundConst = "outbound" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLContextIPVersionIpv4Const = "ipv4" +) -// NewListLoadBalancersOptions : Instantiate ListLoadBalancersOptions -func (*VpcV1) NewListLoadBalancersOptions() *ListLoadBalancersOptions { - return &ListLoadBalancersOptions{} -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLContextProtocolAllConst = "all" + NetworkACLRulePrototypeNetworkACLContextProtocolIcmpConst = "icmp" + NetworkACLRulePrototypeNetworkACLContextProtocolTCPConst = "tcp" + NetworkACLRulePrototypeNetworkACLContextProtocolUDPConst = "udp" +) -// SetStart : Allow user to set Start -func (_options *ListLoadBalancersOptions) SetStart(start string) *ListLoadBalancersOptions { - _options.Start = core.StringPtr(start) - return _options +func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancersOptions) SetLimit(limit int64) *ListLoadBalancersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type NetworkACLRulePrototypeNetworkACLContextIntf interface { + isaNetworkACLRulePrototypeNetworkACLContext() bool } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancersOptions) SetHeaders(param map[string]string) *ListLoadBalancersOptions { - options.Headers = param - return options +// UnmarshalNetworkACLRulePrototypeNetworkACLContext unmarshals an instance of NetworkACLRulePrototypeNetworkACLContext from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContext(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + return + } + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return } -// ListNetworkACLRulesOptions : The ListNetworkACLRules options. -type ListNetworkACLRulesOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// NetworkACLRuleReference : NetworkACLRuleReference struct +type NetworkACLRuleReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkACLRuleReferenceDeleted `json:"deleted,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` - // Filters the collection to rules with a `direction` property matching the specified value. - Direction *string `json:"direction,omitempty"` + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` } -// Constants associated with the ListNetworkACLRulesOptions.Direction property. -// Filters the collection to rules with a `direction` property matching the specified value. -const ( - ListNetworkACLRulesOptionsDirectionInboundConst = "inbound" - ListNetworkACLRulesOptionsDirectionOutboundConst = "outbound" -) - -// NewListNetworkACLRulesOptions : Instantiate ListNetworkACLRulesOptions -func (*VpcV1) NewListNetworkACLRulesOptions(networkACLID string) *ListNetworkACLRulesOptions { - return &ListNetworkACLRulesOptions{ - NetworkACLID: core.StringPtr(networkACLID), +// UnmarshalNetworkACLRuleReference unmarshals an instance of NetworkACLRuleReference from the specified map of raw messages. +func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLRuleReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *ListNetworkACLRulesOptions) SetNetworkACLID(networkACLID string) *ListNetworkACLRulesOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options +// NetworkACLRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkACLRuleReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListNetworkACLRulesOptions) SetStart(start string) *ListNetworkACLRulesOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalNetworkACLRuleReferenceDeleted unmarshals an instance of NetworkACLRuleReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListNetworkACLRulesOptions) SetLimit(limit int64) *ListNetworkACLRulesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// NetworkInterface : NetworkInterface struct +type NetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` -// SetDirection : Allow user to set Direction -func (_options *ListNetworkACLRulesOptions) SetDirection(direction string) *ListNetworkACLRulesOptions { - _options.Direction = core.StringPtr(direction) - return _options -} + // The date and time that the instance network interface was created. + // + // If this instance has network attachments, this network interface was created as a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListNetworkACLRulesOptions) SetHeaders(param map[string]string) *ListNetworkACLRulesOptions { - options.Headers = param - return options -} + // The floating IPs associated with this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` -// ListNetworkAclsOptions : The ListNetworkAcls options. -type ListNetworkAclsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The name for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The instance network interface port speed in Mbps. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. + PortSpeed *int64 `json:"port_speed" validate:"required"` -// NewListNetworkAclsOptions : Instantiate ListNetworkAclsOptions -func (*VpcV1) NewListNetworkAclsOptions() *ListNetworkAclsOptions { - return &ListNetworkAclsOptions{} -} + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListNetworkAclsOptions) SetStart(start string) *ListNetworkAclsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListNetworkAclsOptions) SetLimit(limit int64) *ListNetworkAclsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The security groups targeting this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListNetworkAclsOptions) SetResourceGroupID(resourceGroupID string) *ListNetworkAclsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The status of the instance network interface. + // + // If this instance has network attachments, this network interface is a read-only representation of its corresponding + // network attachment and its attached virtual network interface, and the status is [computed from + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + Status *string `json:"status" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListNetworkAclsOptions) SetHeaders(param map[string]string) *ListNetworkAclsOptions { - options.Headers = param - return options + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The instance network interface type. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. + Type *string `json:"type" validate:"required"` } -// ListOperatingSystemsOptions : The ListOperatingSystems options. -type ListOperatingSystemsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// Constants associated with the NetworkInterface.ResourceType property. +// The resource type. +const ( + NetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" +) - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the NetworkInterface.Status property. +// The status of the instance network interface. +// +// If this instance has network attachments, this network interface is a read-only representation of its corresponding +// network attachment and its attached virtual network interface, and the status is [computed from +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). +const ( + NetworkInterfaceStatusAvailableConst = "available" + NetworkInterfaceStatusDeletingConst = "deleting" + NetworkInterfaceStatusFailedConst = "failed" + NetworkInterfaceStatusPendingConst = "pending" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the NetworkInterface.Type property. +// The instance network interface type. +// +// If this instance has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. +const ( + NetworkInterfaceTypePrimaryConst = "primary" + NetworkInterfaceTypeSecondaryConst = "secondary" +) -// NewListOperatingSystemsOptions : Instantiate ListOperatingSystemsOptions -func (*VpcV1) NewListOperatingSystemsOptions() *ListOperatingSystemsOptions { - return &ListOperatingSystemsOptions{} +// UnmarshalNetworkInterface unmarshals an instance of NetworkInterface from the specified map of raw messages. +func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterface) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListOperatingSystemsOptions) SetStart(start string) *ListOperatingSystemsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// NetworkInterfaceBareMetalServerContextReference : NetworkInterfaceBareMetalServerContextReference struct +type NetworkInterfaceBareMetalServerContextReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceBareMetalServerContextReferenceDeleted `json:"deleted,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListOperatingSystemsOptions) SetLimit(limit int64) *ListOperatingSystemsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListOperatingSystemsOptions) SetHeaders(param map[string]string) *ListOperatingSystemsOptions { - options.Headers = param - return options -} + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` -// ListPlacementGroupsOptions : The ListPlacementGroups options. -type ListPlacementGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The name for this bare metal server network interface. + Name *string `json:"name" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// NewListPlacementGroupsOptions : Instantiate ListPlacementGroupsOptions -func (*VpcV1) NewListPlacementGroupsOptions() *ListPlacementGroupsOptions { - return &ListPlacementGroupsOptions{} + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListPlacementGroupsOptions) SetStart(start string) *ListPlacementGroupsOptions { - _options.Start = core.StringPtr(start) - return _options +// Constants associated with the NetworkInterfaceBareMetalServerContextReference.ResourceType property. +// The resource type. +const ( + NetworkInterfaceBareMetalServerContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// UnmarshalNetworkInterfaceBareMetalServerContextReference unmarshals an instance of NetworkInterfaceBareMetalServerContextReference from the specified map of raw messages. +func UnmarshalNetworkInterfaceBareMetalServerContextReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceBareMetalServerContextReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListPlacementGroupsOptions) SetLimit(limit int64) *ListPlacementGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// NetworkInterfaceBareMetalServerContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkInterfaceBareMetalServerContextReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListPlacementGroupsOptions) SetHeaders(param map[string]string) *ListPlacementGroupsOptions { - options.Headers = param - return options +// UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted unmarshals an instance of NetworkInterfaceBareMetalServerContextReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceBareMetalServerContextReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListPublicGatewaysOptions : The ListPublicGateways options. -type ListPublicGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// NetworkInterfaceIPPrototype : NetworkInterfaceIPPrototype struct +// Models which "extend" this model: +// - NetworkInterfaceIPPrototypeReservedIPIdentity +// - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext +type NetworkInterfaceIPPrototype struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` -// NewListPublicGatewaysOptions : Instantiate ListPublicGatewaysOptions -func (*VpcV1) NewListPublicGatewaysOptions() *ListPublicGatewaysOptions { - return &ListPublicGatewaysOptions{} + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListPublicGatewaysOptions) SetStart(start string) *ListPublicGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options +func (*NetworkInterfaceIPPrototype) isaNetworkInterfaceIPPrototype() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListPublicGatewaysOptions) SetLimit(limit int64) *ListPublicGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type NetworkInterfaceIPPrototypeIntf interface { + isaNetworkInterfaceIPPrototype() bool } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListPublicGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListPublicGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// UnmarshalNetworkInterfaceIPPrototype unmarshals an instance of NetworkInterfaceIPPrototype from the specified map of raw messages. +func UnmarshalNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListPublicGatewaysOptions) SetHeaders(param map[string]string) *ListPublicGatewaysOptions { - options.Headers = param - return options -} +// NetworkInterfaceInstanceContextReference : NetworkInterfaceInstanceContextReference struct +type NetworkInterfaceInstanceContextReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceInstanceContextReferenceDeleted `json:"deleted,omitempty"` -// ListRegionZonesOptions : The ListRegionZones options. -type ListRegionZonesOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this instance network interface. + Name *string `json:"name" validate:"required"` + + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -// NewListRegionZonesOptions : Instantiate ListRegionZonesOptions -func (*VpcV1) NewListRegionZonesOptions(regionName string) *ListRegionZonesOptions { - return &ListRegionZonesOptions{ - RegionName: core.StringPtr(regionName), +// Constants associated with the NetworkInterfaceInstanceContextReference.ResourceType property. +// The resource type. +const ( + NetworkInterfaceInstanceContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// UnmarshalNetworkInterfaceInstanceContextReference unmarshals an instance of NetworkInterfaceInstanceContextReference from the specified map of raw messages. +func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceInstanceContextReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceInstanceContextReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRegionName : Allow user to set RegionName -func (_options *ListRegionZonesOptions) SetRegionName(regionName string) *ListRegionZonesOptions { - _options.RegionName = core.StringPtr(regionName) - return _options +// NetworkInterfaceInstanceContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkInterfaceInstanceContextReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListRegionZonesOptions) SetHeaders(param map[string]string) *ListRegionZonesOptions { - options.Headers = param - return options +// UnmarshalNetworkInterfaceInstanceContextReferenceDeleted unmarshals an instance of NetworkInterfaceInstanceContextReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceInstanceContextReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListRegionsOptions : The ListRegions options. -type ListRegionsOptions struct { +// NetworkInterfacePatch : NetworkInterfacePatch struct +type NetworkInterfacePatch struct { + // Indicates whether source IP spoofing is allowed on this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for the instance network interface. The name must not be used by another network interface on the virtual + // server instance. + Name *string `json:"name,omitempty"` } -// NewListRegionsOptions : Instantiate ListRegionsOptions -func (*VpcV1) NewListRegionsOptions() *ListRegionsOptions { - return &ListRegionsOptions{} +// UnmarshalNetworkInterfacePatch unmarshals an instance of NetworkInterfacePatch from the specified map of raw messages. +func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfacePatch) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the NetworkInterfacePatch +func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(networkInterfacePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// ListReservationsOptions : The ListReservations options. -type ListReservationsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// NetworkInterfacePrototype : NetworkInterfacePrototype struct +type NetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Filters the collection to resources with a `name` property matching the exact specified name. + // The name for the instance network interface. The name must not be used by another network interface on the virtual + // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListReservationsOptions : Instantiate ListReservationsOptions -func (*VpcV1) NewListReservationsOptions() *ListReservationsOptions { - return &ListReservationsOptions{} -} + // The primary IP address to bind to the instance network interface. This can be + // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must + // be available on the instance network interface's subnet. Otherwise, an + // available address on the subnet will be automatically selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListReservationsOptions) SetStart(start string) *ListReservationsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is + // used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListReservationsOptions) SetLimit(limit int64) *ListReservationsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` } -// SetName : Allow user to set Name -func (_options *ListReservationsOptions) SetName(name string) *ListReservationsOptions { - _options.Name = core.StringPtr(name) - return _options +// NewNetworkInterfacePrototype : Instantiate NetworkInterfacePrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *NetworkInterfacePrototype, err error) { + _model = &NetworkInterfacePrototype{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListReservationsOptions) SetResourceGroupID(resourceGroupID string) *ListReservationsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// UnmarshalNetworkInterfacePrototype unmarshals an instance of NetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetZoneName : Allow user to set ZoneName -func (_options *ListReservationsOptions) SetZoneName(zoneName string) *ListReservationsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options +// NetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkInterfaceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListReservationsOptions) SetHeaders(param map[string]string) *ListReservationsOptions { - options.Headers = param - return options +// UnmarshalNetworkInterfaceReferenceDeleted unmarshals an instance of NetworkInterfaceReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. -type ListSecurityGroupRulesOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// NetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type NetworkInterfaceReferenceTargetContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// NewListSecurityGroupRulesOptions : Instantiate ListSecurityGroupRulesOptions -func (*VpcV1) NewListSecurityGroupRulesOptions(securityGroupID string) *ListSecurityGroupRulesOptions { - return &ListSecurityGroupRulesOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), +// UnmarshalNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of NetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceReferenceTargetContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupRulesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupRulesOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options +// NetworkInterfaceUnpaginatedCollection : NetworkInterfaceUnpaginatedCollection struct +type NetworkInterfaceUnpaginatedCollection struct { + // Collection of instance network interfaces. + NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupRulesOptions) SetHeaders(param map[string]string) *ListSecurityGroupRulesOptions { - options.Headers = param - return options +// UnmarshalNetworkInterfaceUnpaginatedCollection unmarshals an instance of NetworkInterfaceUnpaginatedCollection from the specified map of raw messages. +func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceUnpaginatedCollection) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSecurityGroupTargetsOptions : The ListSecurityGroupTargets options. -type ListSecurityGroupTargetsOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// ObsoleteImageOptions : The ObsoleteImage options. +type ObsoleteImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewListSecurityGroupTargetsOptions : Instantiate ListSecurityGroupTargetsOptions -func (*VpcV1) NewListSecurityGroupTargetsOptions(securityGroupID string) *ListSecurityGroupTargetsOptions { - return &ListSecurityGroupTargetsOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), +// NewObsoleteImageOptions : Instantiate ObsoleteImageOptions +func (*VpcV1) NewObsoleteImageOptions(id string) *ObsoleteImageOptions { + return &ObsoleteImageOptions{ + ID: core.StringPtr(id), } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupTargetsOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupTargetsOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupTargetsOptions) SetStart(start string) *ListSecurityGroupTargetsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupTargetsOptions) SetLimit(limit int64) *ListSecurityGroupTargetsOptions { - _options.Limit = core.Int64Ptr(limit) +// SetID : Allow user to set ID +func (_options *ObsoleteImageOptions) SetID(id string) *ObsoleteImageOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupTargetsOptions) SetHeaders(param map[string]string) *ListSecurityGroupTargetsOptions { +func (options *ObsoleteImageOptions) SetHeaders(param map[string]string) *ObsoleteImageOptions { options.Headers = param return options } -// ListSecurityGroupsOptions : The ListSecurityGroups options. -type ListSecurityGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// OperatingSystem : OperatingSystem struct +type OperatingSystem struct { + // The operating system architecture. + Architecture *string `json:"architecture" validate:"required"` -// NewListSecurityGroupsOptions : Instantiate ListSecurityGroupsOptions -func (*VpcV1) NewListSecurityGroupsOptions() *ListSecurityGroupsOptions { - return &ListSecurityGroupsOptions{} -} + // Images with this operating system can only be used on dedicated hosts or dedicated host groups. + DedicatedHostOnly *bool `json:"dedicated_host_only" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupsOptions) SetStart(start string) *ListSecurityGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // A unique, display-friendly name for the operating system. + DisplayName *string `json:"display_name" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupsOptions) SetLimit(limit int64) *ListSecurityGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The software family for this operating system. + Family *string `json:"family" validate:"required"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSecurityGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSecurityGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The URL for this operating system. + Href *string `json:"href" validate:"required"` -// SetVPCID : Allow user to set VPCID -func (_options *ListSecurityGroupsOptions) SetVPCID(vpcID string) *ListSecurityGroupsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} + // The globally unique name for this operating system. + Name *string `json:"name" validate:"required"` -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListSecurityGroupsOptions) SetVPCCRN(vpcCRN string) *ListSecurityGroupsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} + // The vendor of the operating system. + Vendor *string `json:"vendor" validate:"required"` -// SetVPCName : Allow user to set VPCName -func (_options *ListSecurityGroupsOptions) SetVPCName(vpcName string) *ListSecurityGroupsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options + // The major release version of this operating system. + Version *string `json:"version" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupsOptions) SetHeaders(param map[string]string) *ListSecurityGroupsOptions { - options.Headers = param - return options +// UnmarshalOperatingSystem unmarshals an instance of OperatingSystem from the specified map of raw messages. +func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystem) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "dedicated_host_only", &obj.DedicatedHostOnly) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vendor", &obj.Vendor) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListShareMountTargetsOptions : The ListShareMountTargets options. -type ListShareMountTargetsOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` +// OperatingSystemCollection : OperatingSystemCollection struct +type OperatingSystemCollection struct { + // A link to the first page of resources. + First *OperatingSystemCollectionFirst `json:"first" validate:"required"` - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *OperatingSystemCollectionNext `json:"next,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Collection of operating systems. + OperatingSystems []OperatingSystem `json:"operating_systems" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListShareMountTargetsOptions : Instantiate ListShareMountTargetsOptions -func (*VpcV1) NewListShareMountTargetsOptions(shareID string) *ListShareMountTargetsOptions { - return &ListShareMountTargetsOptions{ - ShareID: core.StringPtr(shareID), +// UnmarshalOperatingSystemCollection unmarshals an instance of OperatingSystemCollection from the specified map of raw messages. +func UnmarshalOperatingSystemCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalOperatingSystemCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalOperatingSystemCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "operating_systems", &obj.OperatingSystems, UnmarshalOperatingSystem) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetShareID : Allow user to set ShareID -func (_options *ListShareMountTargetsOptions) SetShareID(shareID string) *ListShareMountTargetsOptions { - _options.ShareID = core.StringPtr(shareID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *OperatingSystemCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetName : Allow user to set Name -func (_options *ListShareMountTargetsOptions) SetName(name string) *ListShareMountTargetsOptions { - _options.Name = core.StringPtr(name) - return _options +// OperatingSystemCollectionFirst : A link to the first page of resources. +type OperatingSystemCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListShareMountTargetsOptions) SetStart(start string) *ListShareMountTargetsOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalOperatingSystemCollectionFirst unmarshals an instance of OperatingSystemCollectionFirst from the specified map of raw messages. +func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListShareMountTargetsOptions) SetLimit(limit int64) *ListShareMountTargetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// OperatingSystemCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type OperatingSystemCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListShareMountTargetsOptions) SetHeaders(param map[string]string) *ListShareMountTargetsOptions { - options.Headers = param - return options +// UnmarshalOperatingSystemCollectionNext unmarshals an instance of OperatingSystemCollectionNext from the specified map of raw messages. +func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListShareProfilesOptions : The ListShareProfiles options. -type ListShareProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` +// OperatingSystemIdentity : Identifies an operating system by a unique property. +// Models which "extend" this model: +// - OperatingSystemIdentityByName +// - OperatingSystemIdentityByHref +type OperatingSystemIdentity struct { + // The globally unique name for this operating system. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this operating system. + Href *string `json:"href,omitempty"` } -// Constants associated with the ListShareProfilesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListShareProfilesOptionsSortCreatedAtConst = "created_at" - ListShareProfilesOptionsSortNameConst = "name" -) - -// NewListShareProfilesOptions : Instantiate ListShareProfilesOptions -func (*VpcV1) NewListShareProfilesOptions() *ListShareProfilesOptions { - return &ListShareProfilesOptions{} +func (*OperatingSystemIdentity) isaOperatingSystemIdentity() bool { + return true } -// SetStart : Allow user to set Start -func (_options *ListShareProfilesOptions) SetStart(start string) *ListShareProfilesOptions { - _options.Start = core.StringPtr(start) - return _options +type OperatingSystemIdentityIntf interface { + isaOperatingSystemIdentity() bool } -// SetLimit : Allow user to set Limit -func (_options *ListShareProfilesOptions) SetLimit(limit int64) *ListShareProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalOperatingSystemIdentity unmarshals an instance of OperatingSystemIdentity from the specified map of raw messages. +func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSort : Allow user to set Sort -func (_options *ListShareProfilesOptions) SetSort(sort string) *ListShareProfilesOptions { - _options.Sort = core.StringPtr(sort) - return _options -} +// PlacementGroup : PlacementGroup struct +type PlacementGroup struct { + // The date and time that the placement group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListShareProfilesOptions) SetHeaders(param map[string]string) *ListShareProfilesOptions { - options.Headers = param - return options -} + // The CRN for this placement group. + CRN *string `json:"crn" validate:"required"` -// ListSharesOptions : The ListShares options. -type ListSharesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The URL for this placement group. + Href *string `json:"href" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique identifier for this placement group. + ID *string `json:"id" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The lifecycle state of the placement group. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` + // The name for this placement group. The name is unique across all placement groups in the region. + Name *string `json:"name" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The resource group for this placement group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // Filters the collection to file shares with a `replication_role` property matching the specified value. - ReplicationRole *string `json:"replication_role,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The strategy for this placement group + // - `host_spread`: place on different compute hosts + // - `power_spread`: place on compute hosts that use different power sources + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the + // unexpected strategy was encountered. + Strategy *string `json:"strategy" validate:"required"` } -// Constants associated with the ListSharesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the PlacementGroup.LifecycleState property. +// The lifecycle state of the placement group. const ( - ListSharesOptionsSortCreatedAtConst = "created_at" - ListSharesOptionsSortNameConst = "name" + PlacementGroupLifecycleStateDeletingConst = "deleting" + PlacementGroupLifecycleStateFailedConst = "failed" + PlacementGroupLifecycleStatePendingConst = "pending" + PlacementGroupLifecycleStateStableConst = "stable" + PlacementGroupLifecycleStateSuspendedConst = "suspended" + PlacementGroupLifecycleStateUpdatingConst = "updating" + PlacementGroupLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the ListSharesOptions.ReplicationRole property. -// Filters the collection to file shares with a `replication_role` property matching the specified value. +// Constants associated with the PlacementGroup.ResourceType property. +// The resource type. const ( - ListSharesOptionsReplicationRoleNoneConst = "none" - ListSharesOptionsReplicationRoleReplicaConst = "replica" - ListSharesOptionsReplicationRoleSourceConst = "source" + PlacementGroupResourceTypePlacementGroupConst = "placement_group" ) -// NewListSharesOptions : Instantiate ListSharesOptions -func (*VpcV1) NewListSharesOptions() *ListSharesOptions { - return &ListSharesOptions{} +// Constants associated with the PlacementGroup.Strategy property. +// The strategy for this placement group +// - `host_spread`: place on different compute hosts +// - `power_spread`: place on compute hosts that use different power sources +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the +// unexpected strategy was encountered. +const ( + PlacementGroupStrategyHostSpreadConst = "host_spread" + PlacementGroupStrategyPowerSpreadConst = "power_spread" +) + +// UnmarshalPlacementGroup unmarshals an instance of PlacementGroup from the specified map of raw messages. +func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroup) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "strategy", &obj.Strategy) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListSharesOptions) SetStart(start string) *ListSharesOptions { - _options.Start = core.StringPtr(start) - return _options +// PlacementGroupCollection : PlacementGroupCollection struct +type PlacementGroupCollection struct { + // A link to the first page of resources. + First *PlacementGroupCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *PlacementGroupCollectionNext `json:"next,omitempty"` + + // Collection of placement groups. + PlacementGroups []PlacementGroup `json:"placement_groups" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListSharesOptions) SetLimit(limit int64) *ListSharesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalPlacementGroupCollection unmarshals an instance of PlacementGroupCollection from the specified map of raw messages. +func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPlacementGroupCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPlacementGroupCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_groups", &obj.PlacementGroups, UnmarshalPlacementGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSharesOptions) SetResourceGroupID(resourceGroupID string) *ListSharesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetName : Allow user to set Name -func (_options *ListSharesOptions) SetName(name string) *ListSharesOptions { - _options.Name = core.StringPtr(name) - return _options +// PlacementGroupCollectionFirst : A link to the first page of resources. +type PlacementGroupCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetSort : Allow user to set Sort -func (_options *ListSharesOptions) SetSort(sort string) *ListSharesOptions { - _options.Sort = core.StringPtr(sort) - return _options +// UnmarshalPlacementGroupCollectionFirst unmarshals an instance of PlacementGroupCollectionFirst from the specified map of raw messages. +func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetReplicationRole : Allow user to set ReplicationRole -func (_options *ListSharesOptions) SetReplicationRole(replicationRole string) *ListSharesOptions { - _options.ReplicationRole = core.StringPtr(replicationRole) - return _options +// PlacementGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type PlacementGroupCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSharesOptions) SetHeaders(param map[string]string) *ListSharesOptions { - options.Headers = param - return options +// UnmarshalPlacementGroupCollectionNext unmarshals an instance of PlacementGroupCollectionNext from the specified map of raw messages. +func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSnapshotClonesOptions : The ListSnapshotClones options. -type ListSnapshotClonesOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` +// PlacementGroupPatch : PlacementGroupPatch struct +type PlacementGroupPatch struct { + // The name for this placement group. The name must not be used by another placement group in the region. + Name *string `json:"name,omitempty"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalPlacementGroupPatch unmarshals an instance of PlacementGroupPatch from the specified map of raw messages. +func UnmarshalPlacementGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListSnapshotClonesOptions : Instantiate ListSnapshotClonesOptions -func (*VpcV1) NewListSnapshotClonesOptions(id string) *ListSnapshotClonesOptions { - return &ListSnapshotClonesOptions{ - ID: core.StringPtr(id), +// AsPatch returns a generic map representation of the PlacementGroupPatch +func (placementGroupPatch *PlacementGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(placementGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetID : Allow user to set ID -func (_options *ListSnapshotClonesOptions) SetID(id string) *ListSnapshotClonesOptions { - _options.ID = core.StringPtr(id) - return _options +// PlacementGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type PlacementGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotClonesOptions) SetHeaders(param map[string]string) *ListSnapshotClonesOptions { - options.Headers = param - return options +// UnmarshalPlacementGroupReferenceDeleted unmarshals an instance of PlacementGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalPlacementGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSnapshotsOptions : The ListSnapshots options. -type ListSnapshotsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// PublicGateway : PublicGateway struct +type PublicGateway struct { + // The date and time that the public gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` - // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. - Tag *string `json:"tag,omitempty"` + // The floating IP bound to this public gateway. + FloatingIP *PublicGatewayFloatingIP `json:"floating_ip" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The URL for this public gateway. + Href *string `json:"href" validate:"required"` - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` + // The unique identifier for this public gateway. + ID *string `json:"id" validate:"required"` - // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. - SourceVolumeID *string `json:"source_volume.id,omitempty"` + // The name for this public gateway. The name is unique across all public gateways in the VPC. + Name *string `json:"name" validate:"required"` - // Filters the collection to resources with a `source_volume.crn` property matching the specified CRN. - SourceVolumeCRN *string `json:"source_volume.crn,omitempty"` + // The resource group for this public gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // Filters the collection to resources with a `source_image.id` property matching the specified identifier. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageID *string `json:"source_image.id,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // Filters the collection to resources with a `source_image.crn` property matching the specified CRN. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageCRN *string `json:"source_image.crn,omitempty"` + // The status of this public gateway. + Status *string `json:"status" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The VPC this public gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` - // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified - // identifier. - BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` + // The zone this public gateway resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} - // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the - // specified identifier. - CopiesID *string `json:"copies[].id,omitempty"` +// Constants associated with the PublicGateway.ResourceType property. +// The resource type. +const ( + PublicGatewayResourceTypePublicGatewayConst = "public_gateway" +) - // Filters the collection to snapshots with an item in the `copies` property with a `name` property matching the exact - // specified name. - CopiesName *string `json:"copies[].name,omitempty"` +// Constants associated with the PublicGateway.Status property. +// The status of this public gateway. +const ( + PublicGatewayStatusAvailableConst = "available" + PublicGatewayStatusDeletingConst = "deleting" + PublicGatewayStatusFailedConst = "failed" + PublicGatewayStatusPendingConst = "pending" +) - // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the - // specified CRN. - CopiesCRN *string `json:"copies[].crn,omitempty"` +// UnmarshalPublicGateway unmarshals an instance of PublicGateway from the specified map of raw messages. +func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGateway) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ip", &obj.FloatingIP, UnmarshalPublicGatewayFloatingIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayCollection : PublicGatewayCollection struct +type PublicGatewayCollection struct { + // A link to the first page of resources. + First *PublicGatewayCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *PublicGatewayCollectionNext `json:"next,omitempty"` + + // Collection of public gateways. + PublicGateways []PublicGateway `json:"public_gateways" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalPublicGatewayCollection unmarshals an instance of PublicGatewayCollection from the specified map of raw messages. +func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPublicGatewayCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPublicGatewayCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "public_gateways", &obj.PublicGateways, UnmarshalPublicGateway) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // Filters the collection to snapshots with an item in the `copies` property with a - // `remote.region.name` property matching the exact specified name. - CopiesRemoteRegionName *string `json:"copies[].remote.region.name,omitempty"` +// PublicGatewayCollectionFirst : A link to the first page of resources. +type PublicGatewayCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // Filters the collection to resources with a `source_snapshot.id` property matching the specified identifier. - SourceSnapshotID *string `json:"source_snapshot.id,omitempty"` +// UnmarshalPublicGatewayCollectionFirst unmarshals an instance of PublicGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources with a `source_snapshot.remote.region.name` property matching the exact - // specified name. - SourceSnapshotRemoteRegionName *string `json:"source_snapshot.remote.region.name,omitempty"` +// PublicGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type PublicGatewayCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // Filters the collection to resources with a `source_volume.remote.region.name` property matching the exact specified - // name. - SourceVolumeRemoteRegionName *string `json:"source_volume.remote.region.name,omitempty"` +// UnmarshalPublicGatewayCollectionNext unmarshals an instance of PublicGatewayCollectionNext from the specified map of raw messages. +func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources with a `source_image.remote.region.name` property matching the exact specified - // name. - SourceImageRemoteRegionName *string `json:"source_image.remote.region.name,omitempty"` +// PublicGatewayFloatingIP : The floating IP bound to this public gateway. +type PublicGatewayFloatingIP struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` - // Filters the collection to snapshots with an item in the `clones` property with a `zone.name` property matching the - // exact specified name. - ClonesZoneName *string `json:"clones[].zone.name,omitempty"` + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` -// Constants associated with the ListSnapshotsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSnapshotsOptionsSortCreatedAtConst = "created_at" - ListSnapshotsOptionsSortNameConst = "name" -) + // The URL for this floating IP. + Href *string `json:"href" validate:"required"` -// NewListSnapshotsOptions : Instantiate ListSnapshotsOptions -func (*VpcV1) NewListSnapshotsOptions() *ListSnapshotsOptions { - return &ListSnapshotsOptions{} -} + // The unique identifier for this floating IP. + ID *string `json:"id" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListSnapshotsOptions) SetStart(start string) *ListSnapshotsOptions { - _options.Start = core.StringPtr(start) - return _options + // The name for this floating IP. The name is unique across all floating IPs in the region. + Name *string `json:"name" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListSnapshotsOptions) SetLimit(limit int64) *ListSnapshotsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalPublicGatewayFloatingIP unmarshals an instance of PublicGatewayFloatingIP from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetTag : Allow user to set Tag -func (_options *ListSnapshotsOptions) SetTag(tag string) *ListSnapshotsOptions { - _options.Tag = core.StringPtr(tag) - return _options -} +// PublicGatewayFloatingIPPrototype : PublicGatewayFloatingIPPrototype struct +// Models which "extend" this model: +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentity +// - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext +type PublicGatewayFloatingIPPrototype struct { + // The unique identifier for this floating IP. + ID *string `json:"id,omitempty"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSnapshotsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The CRN for this floating IP. + CRN *string `json:"crn,omitempty"` -// SetName : Allow user to set Name -func (_options *ListSnapshotsOptions) SetName(name string) *ListSnapshotsOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The URL for this floating IP. + Href *string `json:"href,omitempty"` -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *ListSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *ListSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) - return _options -} + // The globally unique IP address. + Address *string `json:"address,omitempty"` -// SetSourceVolumeCRN : Allow user to set SourceVolumeCRN -func (_options *ListSnapshotsOptions) SetSourceVolumeCRN(sourceVolumeCRN string) *ListSnapshotsOptions { - _options.SourceVolumeCRN = core.StringPtr(sourceVolumeCRN) - return _options -} + // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetSourceImageID : Allow user to set SourceImageID -func (_options *ListSnapshotsOptions) SetSourceImageID(sourceImageID string) *ListSnapshotsOptions { - _options.SourceImageID = core.StringPtr(sourceImageID) - return _options + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` } -// SetSourceImageCRN : Allow user to set SourceImageCRN -func (_options *ListSnapshotsOptions) SetSourceImageCRN(sourceImageCRN string) *ListSnapshotsOptions { - _options.SourceImageCRN = core.StringPtr(sourceImageCRN) - return _options +func (*PublicGatewayFloatingIPPrototype) isaPublicGatewayFloatingIPPrototype() bool { + return true } -// SetSort : Allow user to set Sort -func (_options *ListSnapshotsOptions) SetSort(sort string) *ListSnapshotsOptions { - _options.Sort = core.StringPtr(sort) - return _options +type PublicGatewayFloatingIPPrototypeIntf interface { + isaPublicGatewayFloatingIPPrototype() bool } -// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID -func (_options *ListSnapshotsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListSnapshotsOptions { - _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) - return _options +// UnmarshalPublicGatewayFloatingIPPrototype unmarshals an instance of PublicGatewayFloatingIPPrototype from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetCopiesID : Allow user to set CopiesID -func (_options *ListSnapshotsOptions) SetCopiesID(copiesID string) *ListSnapshotsOptions { - _options.CopiesID = core.StringPtr(copiesID) - return _options -} +// PublicGatewayIdentity : Identifies a public gateway by a unique property. +// Models which "extend" this model: +// - PublicGatewayIdentityPublicGatewayIdentityByID +// - PublicGatewayIdentityPublicGatewayIdentityByCRN +// - PublicGatewayIdentityPublicGatewayIdentityByHref +type PublicGatewayIdentity struct { + // The unique identifier for this public gateway. + ID *string `json:"id,omitempty"` -// SetCopiesName : Allow user to set CopiesName -func (_options *ListSnapshotsOptions) SetCopiesName(copiesName string) *ListSnapshotsOptions { - _options.CopiesName = core.StringPtr(copiesName) - return _options -} + // The CRN for this public gateway. + CRN *string `json:"crn,omitempty"` -// SetCopiesCRN : Allow user to set CopiesCRN -func (_options *ListSnapshotsOptions) SetCopiesCRN(copiesCRN string) *ListSnapshotsOptions { - _options.CopiesCRN = core.StringPtr(copiesCRN) - return _options + // The URL for this public gateway. + Href *string `json:"href,omitempty"` } -// SetCopiesRemoteRegionName : Allow user to set CopiesRemoteRegionName -func (_options *ListSnapshotsOptions) SetCopiesRemoteRegionName(copiesRemoteRegionName string) *ListSnapshotsOptions { - _options.CopiesRemoteRegionName = core.StringPtr(copiesRemoteRegionName) - return _options +func (*PublicGatewayIdentity) isaPublicGatewayIdentity() bool { + return true } -// SetSourceSnapshotID : Allow user to set SourceSnapshotID -func (_options *ListSnapshotsOptions) SetSourceSnapshotID(sourceSnapshotID string) *ListSnapshotsOptions { - _options.SourceSnapshotID = core.StringPtr(sourceSnapshotID) - return _options +type PublicGatewayIdentityIntf interface { + isaPublicGatewayIdentity() bool } -// SetSourceSnapshotRemoteRegionName : Allow user to set SourceSnapshotRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceSnapshotRemoteRegionName(sourceSnapshotRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceSnapshotRemoteRegionName = core.StringPtr(sourceSnapshotRemoteRegionName) - return _options +// UnmarshalPublicGatewayIdentity unmarshals an instance of PublicGatewayIdentity from the specified map of raw messages. +func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSourceVolumeRemoteRegionName : Allow user to set SourceVolumeRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceVolumeRemoteRegionName(sourceVolumeRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceVolumeRemoteRegionName = core.StringPtr(sourceVolumeRemoteRegionName) - return _options +// PublicGatewayPatch : PublicGatewayPatch struct +type PublicGatewayPatch struct { + // The name for this public gateway. The name must not be used by another public gateway in the VPC. + Name *string `json:"name,omitempty"` } -// SetSourceImageRemoteRegionName : Allow user to set SourceImageRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceImageRemoteRegionName(sourceImageRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceImageRemoteRegionName = core.StringPtr(sourceImageRemoteRegionName) - return _options +// UnmarshalPublicGatewayPatch unmarshals an instance of PublicGatewayPatch from the specified map of raw messages. +func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetClonesZoneName : Allow user to set ClonesZoneName -func (_options *ListSnapshotsOptions) SetClonesZoneName(clonesZoneName string) *ListSnapshotsOptions { - _options.ClonesZoneName = core.StringPtr(clonesZoneName) - return _options +// AsPatch returns a generic map representation of the PublicGatewayPatch +func (publicGatewayPatch *PublicGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(publicGatewayPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotsOptions) SetHeaders(param map[string]string) *ListSnapshotsOptions { - options.Headers = param - return options -} +// PublicGatewayReference : PublicGatewayReference struct +type PublicGatewayReference struct { + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` -// ListSubnetReservedIpsOptions : The ListSubnetReservedIps options. -type ListSubnetReservedIpsOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The URL for this public gateway. + Href *string `json:"href" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique identifier for this public gateway. + ID *string `json:"id" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The name for this public gateway. The name is unique across all public gateways in the VPC. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ListSubnetReservedIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the PublicGatewayReference.ResourceType property. +// The resource type. const ( - ListSubnetReservedIpsOptionsSortAddressConst = "address" - ListSubnetReservedIpsOptionsSortCreatedAtConst = "created_at" - ListSubnetReservedIpsOptionsSortNameConst = "name" + PublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" ) -// NewListSubnetReservedIpsOptions : Instantiate ListSubnetReservedIpsOptions -func (*VpcV1) NewListSubnetReservedIpsOptions(subnetID string) *ListSubnetReservedIpsOptions { - return &ListSubnetReservedIpsOptions{ - SubnetID: core.StringPtr(subnetID), +// UnmarshalPublicGatewayReference unmarshals an instance of PublicGatewayReference from the specified map of raw messages. +func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSubnetID : Allow user to set SubnetID -func (_options *ListSubnetReservedIpsOptions) SetSubnetID(subnetID string) *ListSubnetReservedIpsOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListSubnetReservedIpsOptions) SetStart(start string) *ListSubnetReservedIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSubnetReservedIpsOptions) SetLimit(limit int64) *ListSubnetReservedIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListSubnetReservedIpsOptions) SetSort(sort string) *ListSubnetReservedIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options +// PublicGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type PublicGatewayReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSubnetReservedIpsOptions) SetHeaders(param map[string]string) *ListSubnetReservedIpsOptions { - options.Headers = param - return options +// UnmarshalPublicGatewayReferenceDeleted unmarshals an instance of PublicGatewayReferenceDeleted from the specified map of raw messages. +func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSubnetsOptions : The ListSubnets options. -type ListSubnetsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` +// Region : Region struct +type Region struct { + // The API endpoint for this region. + Endpoint *string `json:"endpoint" validate:"required"` - // Filters the collection to subnets with a `routing_table.id` property matching the specified identifier. - RoutingTableID *string `json:"routing_table.id,omitempty"` + // The URL for this region. + Href *string `json:"href" validate:"required"` - // Filters the collection to subnets with a `routing_table.name` property matching the exact specified name. - RoutingTableName *string `json:"routing_table.name,omitempty"` + // The globally unique name for this region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The availability status of this region. + Status *string `json:"status" validate:"required"` } -// NewListSubnetsOptions : Instantiate ListSubnetsOptions -func (*VpcV1) NewListSubnetsOptions() *ListSubnetsOptions { - return &ListSubnetsOptions{} +// Constants associated with the Region.Status property. +// The availability status of this region. +const ( + RegionStatusAvailableConst = "available" + RegionStatusUnavailableConst = "unavailable" +) + +// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. +func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Region) + err = core.UnmarshalPrimitive(m, "endpoint", &obj.Endpoint) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListSubnetsOptions) SetStart(start string) *ListSubnetsOptions { - _options.Start = core.StringPtr(start) - return _options +// RegionCollection : RegionCollection struct +type RegionCollection struct { + // Collection of regions. + Regions []Region `json:"regions" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListSubnetsOptions) SetLimit(limit int64) *ListSubnetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalRegionCollection unmarshals an instance of RegionCollection from the specified map of raw messages. +func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionCollection) + err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSubnetsOptions) SetResourceGroupID(resourceGroupID string) *ListSubnetsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// RegionIdentity : Identifies a region by a unique property. +// Models which "extend" this model: +// - RegionIdentityByName +// - RegionIdentityByHref +type RegionIdentity struct { + // The globally unique name for this region. + Name *string `json:"name,omitempty"` -// SetZoneName : Allow user to set ZoneName -func (_options *ListSubnetsOptions) SetZoneName(zoneName string) *ListSubnetsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options + // The URL for this region. + Href *string `json:"href,omitempty"` } -// SetVPCID : Allow user to set VPCID -func (_options *ListSubnetsOptions) SetVPCID(vpcID string) *ListSubnetsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +func (*RegionIdentity) isaRegionIdentity() bool { + return true } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListSubnetsOptions) SetVPCCRN(vpcCRN string) *ListSubnetsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options +type RegionIdentityIntf interface { + isaRegionIdentity() bool } -// SetVPCName : Allow user to set VPCName -func (_options *ListSubnetsOptions) SetVPCName(vpcName string) *ListSubnetsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options +// UnmarshalRegionIdentity unmarshals an instance of RegionIdentity from the specified map of raw messages. +func UnmarshalRegionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListSubnetsOptions) SetRoutingTableID(routingTableID string) *ListSubnetsOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} +// RegionReference : RegionReference struct +type RegionReference struct { + // The URL for this region. + Href *string `json:"href" validate:"required"` -// SetRoutingTableName : Allow user to set RoutingTableName -func (_options *ListSubnetsOptions) SetRoutingTableName(routingTableName string) *ListSubnetsOptions { - _options.RoutingTableName = core.StringPtr(routingTableName) - return _options + // The globally unique name for this region. + Name *string `json:"name" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSubnetsOptions) SetHeaders(param map[string]string) *ListSubnetsOptions { - options.Headers = param - return options +// UnmarshalRegionReference unmarshals an instance of RegionReference from the specified map of raw messages. +func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVirtualNetworkInterfacesOptions : The ListVirtualNetworkInterfaces options. -type ListVirtualNetworkInterfacesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// RemoveBareMetalServerNetworkInterfaceFloatingIPOptions : The RemoveBareMetalServerNetworkInterfaceFloatingIP options. +type RemoveBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The bare metal server network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewListVirtualNetworkInterfacesOptions : Instantiate ListVirtualNetworkInterfacesOptions -func (*VpcV1) NewListVirtualNetworkInterfacesOptions() *ListVirtualNetworkInterfacesOptions { - return &ListVirtualNetworkInterfacesOptions{} +// NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate RemoveBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + return &RemoveBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } } -// SetStart : Allow user to set Start -func (_options *ListVirtualNetworkInterfacesOptions) SetStart(start string) *ListVirtualNetworkInterfacesOptions { - _options.Start = core.StringPtr(start) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVirtualNetworkInterfacesOptions) SetLimit(limit int64) *ListVirtualNetworkInterfacesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) return _options } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVirtualNetworkInterfacesOptions) SetResourceGroupID(resourceGroupID string) *ListVirtualNetworkInterfacesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) +// SetID : Allow user to set ID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListVirtualNetworkInterfacesOptions { +func (options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { options.Headers = param return options } -// ListVolumeProfilesOptions : The ListVolumeProfiles options. -type ListVolumeProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// RemoveEndpointGatewayIPOptions : The RemoveEndpointGatewayIP options. +type RemoveEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewListVolumeProfilesOptions : Instantiate ListVolumeProfilesOptions -func (*VpcV1) NewListVolumeProfilesOptions() *ListVolumeProfilesOptions { - return &ListVolumeProfilesOptions{} +// NewRemoveEndpointGatewayIPOptions : Instantiate RemoveEndpointGatewayIPOptions +func (*VpcV1) NewRemoveEndpointGatewayIPOptions(endpointGatewayID string, id string) *RemoveEndpointGatewayIPOptions { + return &RemoveEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } } -// SetStart : Allow user to set Start -func (_options *ListVolumeProfilesOptions) SetStart(start string) *ListVolumeProfilesOptions { - _options.Start = core.StringPtr(start) +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *RemoveEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *RemoveEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVolumeProfilesOptions) SetLimit(limit int64) *ListVolumeProfilesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetID : Allow user to set ID +func (_options *RemoveEndpointGatewayIPOptions) SetID(id string) *RemoveEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVolumeProfilesOptions) SetHeaders(param map[string]string) *ListVolumeProfilesOptions { +func (options *RemoveEndpointGatewayIPOptions) SetHeaders(param map[string]string) *RemoveEndpointGatewayIPOptions { options.Headers = param return options } -// ListVolumesOptions : The ListVolumes options. -type ListVolumesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to volumes with an `attachment_state` property matching the specified value. - AttachmentState *string `json:"attachment_state,omitempty"` - - // Filters the collection to resources with an `encryption` property matching the specified value. - Encryption *string `json:"encryption,omitempty"` - - // Filters the collection to resources with an `operating_system.family` property matching the specified operating - // system family. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // operating system or any operating system, respectively. - OperatingSystemFamily *string `json:"operating_system.family,omitempty"` +// RemoveInstanceNetworkInterfaceFloatingIPOptions : The RemoveInstanceNetworkInterfaceFloatingIP options. +type RemoveInstanceNetworkInterfaceFloatingIPOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // Filters the collection to resources with an `operating_system.architecture` property matching the specified - // operating system architecture. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // operating system or any operating system, respectively. - OperatingSystemArchitecture *string `json:"operating_system.architecture,omitempty"` + // The instance network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the ListVolumesOptions.AttachmentState property. -// Filters the collection to volumes with an `attachment_state` property matching the specified value. -const ( - ListVolumesOptionsAttachmentStateAttachedConst = "attached" - ListVolumesOptionsAttachmentStateUnattachedConst = "unattached" - ListVolumesOptionsAttachmentStateUnusableConst = "unusable" -) - -// Constants associated with the ListVolumesOptions.Encryption property. -// Filters the collection to resources with an `encryption` property matching the specified value. -const ( - ListVolumesOptionsEncryptionProviderManagedConst = "provider_managed" - ListVolumesOptionsEncryptionUserManagedConst = "user_managed" -) - -// NewListVolumesOptions : Instantiate ListVolumesOptions -func (*VpcV1) NewListVolumesOptions() *ListVolumesOptions { - return &ListVolumesOptions{} +// NewRemoveInstanceNetworkInterfaceFloatingIPOptions : Instantiate RemoveInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + return &RemoveInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } } -// SetStart : Allow user to set Start -func (_options *ListVolumesOptions) SetStart(start string) *ListVolumesOptions { - _options.Start = core.StringPtr(start) +// SetInstanceID : Allow user to set InstanceID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVolumesOptions) SetLimit(limit int64) *ListVolumesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) return _options } -// SetName : Allow user to set Name -func (_options *ListVolumesOptions) SetName(name string) *ListVolumesOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) return _options } -// SetAttachmentState : Allow user to set AttachmentState -func (_options *ListVolumesOptions) SetAttachmentState(attachmentState string) *ListVolumesOptions { - _options.AttachmentState = core.StringPtr(attachmentState) - return _options +// SetHeaders : Allow user to set Headers +func (options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options } -// SetEncryption : Allow user to set Encryption -func (_options *ListVolumesOptions) SetEncryption(encryption string) *ListVolumesOptions { - _options.Encryption = core.StringPtr(encryption) - return _options +// RemoveNetworkInterfaceFloatingIPOptions : The RemoveNetworkInterfaceFloatingIP options. +type RemoveNetworkInterfaceFloatingIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetOperatingSystemFamily : Allow user to set OperatingSystemFamily -func (_options *ListVolumesOptions) SetOperatingSystemFamily(operatingSystemFamily string) *ListVolumesOptions { - _options.OperatingSystemFamily = core.StringPtr(operatingSystemFamily) - return _options +// NewRemoveNetworkInterfaceFloatingIPOptions : Instantiate RemoveNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewRemoveNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *RemoveNetworkInterfaceFloatingIPOptions { + return &RemoveNetworkInterfaceFloatingIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), + } } -// SetOperatingSystemArchitecture : Allow user to set OperatingSystemArchitecture -func (_options *ListVolumesOptions) SetOperatingSystemArchitecture(operatingSystemArchitecture string) *ListVolumesOptions { - _options.OperatingSystemArchitecture = core.StringPtr(operatingSystemArchitecture) +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *RemoveNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *RemoveNetworkInterfaceFloatingIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) return _options } -// SetZoneName : Allow user to set ZoneName -func (_options *ListVolumesOptions) SetZoneName(zoneName string) *ListVolumesOptions { - _options.ZoneName = core.StringPtr(zoneName) +// SetID : Allow user to set ID +func (_options *RemoveNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVolumesOptions) SetHeaders(param map[string]string) *ListVolumesOptions { +func (options *RemoveNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveNetworkInterfaceFloatingIPOptions { options.Headers = param return options } -// ListVPCAddressPrefixesOptions : The ListVPCAddressPrefixes options. -type ListVPCAddressPrefixesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// RemoveVirtualNetworkInterfaceIPOptions : The RemoveVirtualNetworkInterfaceIP options. +type RemoveVirtualNetworkInterfaceIPOptions struct { + // The virtual network interface identifier. + VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewListVPCAddressPrefixesOptions : Instantiate ListVPCAddressPrefixesOptions -func (*VpcV1) NewListVPCAddressPrefixesOptions(vpcID string) *ListVPCAddressPrefixesOptions { - return &ListVPCAddressPrefixesOptions{ - VPCID: core.StringPtr(vpcID), +// NewRemoveVirtualNetworkInterfaceIPOptions : Instantiate RemoveVirtualNetworkInterfaceIPOptions +func (*VpcV1) NewRemoveVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *RemoveVirtualNetworkInterfaceIPOptions { + return &RemoveVirtualNetworkInterfaceIPOptions{ + VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCAddressPrefixesOptions) SetVPCID(vpcID string) *ListVPCAddressPrefixesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCAddressPrefixesOptions) SetStart(start string) *ListVPCAddressPrefixesOptions { - _options.Start = core.StringPtr(start) +// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID +func (_options *RemoveVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *RemoveVirtualNetworkInterfaceIPOptions { + _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVPCAddressPrefixesOptions) SetLimit(limit int64) *ListVPCAddressPrefixesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetID : Allow user to set ID +func (_options *RemoveVirtualNetworkInterfaceIPOptions) SetID(id string) *RemoveVirtualNetworkInterfaceIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVPCAddressPrefixesOptions) SetHeaders(param map[string]string) *ListVPCAddressPrefixesOptions { +func (options *RemoveVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *RemoveVirtualNetworkInterfaceIPOptions { options.Headers = param return options } -// ListVPCDnsResolutionBindingsOptions : The ListVPCDnsResolutionBindings options. -type ListVPCDnsResolutionBindingsOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` +// RemoveVPNGatewayConnectionLocalCIDROptions : The RemoveVPNGatewayConnectionLocalCIDR options. +type RemoveVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // Filters the collection to resources with a `vpc.remote.account.id` property matching the specified account - // identifier. - AccountID *string `json:"account.id,omitempty"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the ListVPCDnsResolutionBindingsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPCDnsResolutionBindingsOptionsSortCreatedAtConst = "created_at" - ListVPCDnsResolutionBindingsOptionsSortNameConst = "name" -) - -// NewListVPCDnsResolutionBindingsOptions : Instantiate ListVPCDnsResolutionBindingsOptions -func (*VpcV1) NewListVPCDnsResolutionBindingsOptions(vpcID string) *ListVPCDnsResolutionBindingsOptions { - return &ListVPCDnsResolutionBindingsOptions{ - VPCID: core.StringPtr(vpcID), +// NewRemoveVPNGatewayConnectionLocalCIDROptions : Instantiate RemoveVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewRemoveVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { + return &RemoveVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCID(vpcID string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPCDnsResolutionBindingsOptions) SetSort(sort string) *ListVPCDnsResolutionBindingsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCDnsResolutionBindingsOptions) SetStart(start string) *ListVPCDnsResolutionBindingsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCDnsResolutionBindingsOptions) SetLimit(limit int64) *ListVPCDnsResolutionBindingsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListVPCDnsResolutionBindingsOptions) SetName(name string) *ListVPCDnsResolutionBindingsOptions { - _options.Name = core.StringPtr(name) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCCRN(vpcCRN string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) +// SetID : Allow user to set ID +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetVPCName : Allow user to set VPCName -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCName(vpcName string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCName = core.StringPtr(vpcName) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetAccountID : Allow user to set AccountID -func (_options *ListVPCDnsResolutionBindingsOptions) SetAccountID(accountID string) *ListVPCDnsResolutionBindingsOptions { - _options.AccountID = core.StringPtr(accountID) +// SetPrefixLength : Allow user to set PrefixLength +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVPCDnsResolutionBindingsOptions) SetHeaders(param map[string]string) *ListVPCDnsResolutionBindingsOptions { +func (options *RemoveVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionLocalCIDROptions { options.Headers = param return options } -// ListVPCRoutesOptions : The ListVPCRoutes options. -type ListVPCRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// RemoveVPNGatewayConnectionPeerCIDROptions : The RemoveVPNGatewayConnectionPeerCIDR options. +type RemoveVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewListVPCRoutesOptions : Instantiate ListVPCRoutesOptions -func (*VpcV1) NewListVPCRoutesOptions(vpcID string) *ListVPCRoutesOptions { - return &ListVPCRoutesOptions{ - VPCID: core.StringPtr(vpcID), +// NewRemoveVPNGatewayConnectionPeerCIDROptions : Instantiate RemoveVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewRemoveVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { + return &RemoveVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetZoneName : Allow user to set ZoneName -func (_options *ListVPCRoutesOptions) SetZoneName(zoneName string) *ListVPCRoutesOptions { - _options.ZoneName = core.StringPtr(zoneName) +// SetID : Allow user to set ID +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetStart : Allow user to set Start -func (_options *ListVPCRoutesOptions) SetStart(start string) *ListVPCRoutesOptions { - _options.Start = core.StringPtr(start) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutesOptions) SetLimit(limit int64) *ListVPCRoutesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetPrefixLength : Allow user to set PrefixLength +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *ListVPCRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutesOptions { +func (options *RemoveVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionPeerCIDROptions { options.Headers = param return options } -// ListVPCRoutingTableRoutesOptions : The ListVPCRoutingTableRoutes options. -type ListVPCRoutingTableRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` +// ReplaceLoadBalancerPoolMembersOptions : The ReplaceLoadBalancerPoolMembers options. +type ReplaceLoadBalancerPoolMembersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The member prototype objects for this pool. + Members []LoadBalancerPoolMemberPrototype `json:"members" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewListVPCRoutingTableRoutesOptions : Instantiate ListVPCRoutingTableRoutesOptions -func (*VpcV1) NewListVPCRoutingTableRoutesOptions(vpcID string, routingTableID string) *ListVPCRoutingTableRoutesOptions { - return &ListVPCRoutingTableRoutesOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), +// NewReplaceLoadBalancerPoolMembersOptions : Instantiate ReplaceLoadBalancerPoolMembersOptions +func (*VpcV1) NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string, members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { + return &ReplaceLoadBalancerPoolMembersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + Members: members, } } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTableRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutingTableRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListVPCRoutingTableRoutesOptions) SetRoutingTableID(routingTableID string) *ListVPCRoutingTableRoutesOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ReplaceLoadBalancerPoolMembersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTableRoutesOptions) SetStart(start string) *ListVPCRoutingTableRoutesOptions { - _options.Start = core.StringPtr(start) +// SetPoolID : Allow user to set PoolID +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ReplaceLoadBalancerPoolMembersOptions { + _options.PoolID = core.StringPtr(poolID) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTableRoutesOptions) SetLimit(limit int64) *ListVPCRoutingTableRoutesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetMembers : Allow user to set Members +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { + _options.Members = members return _options } // SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTableRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTableRoutesOptions { +func (options *ReplaceLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ReplaceLoadBalancerPoolMembersOptions { options.Headers = param return options } -// ListVPCRoutingTablesOptions : The ListVPCRoutingTables options. -type ListVPCRoutingTablesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// ReplaceSubnetNetworkACLOptions : The ReplaceSubnetNetworkACL options. +type ReplaceSubnetNetworkACLOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` - // Filters the collection to routing tables with an `is_default` property matching the specified value. - IsDefault *bool `json:"is_default,omitempty"` + // The network ACL identity. + NetworkACLIdentity NetworkACLIdentityIntf `json:"NetworkACLIdentity" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewListVPCRoutingTablesOptions : Instantiate ListVPCRoutingTablesOptions -func (*VpcV1) NewListVPCRoutingTablesOptions(vpcID string) *ListVPCRoutingTablesOptions { - return &ListVPCRoutingTablesOptions{ - VPCID: core.StringPtr(vpcID), +// NewReplaceSubnetNetworkACLOptions : Instantiate ReplaceSubnetNetworkACLOptions +func (*VpcV1) NewReplaceSubnetNetworkACLOptions(id string, networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { + return &ReplaceSubnetNetworkACLOptions{ + ID: core.StringPtr(id), + NetworkACLIdentity: networkACLIdentity, } } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTablesOptions) SetVPCID(vpcID string) *ListVPCRoutingTablesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTablesOptions) SetStart(start string) *ListVPCRoutingTablesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTablesOptions) SetLimit(limit int64) *ListVPCRoutingTablesOptions { - _options.Limit = core.Int64Ptr(limit) +// SetID : Allow user to set ID +func (_options *ReplaceSubnetNetworkACLOptions) SetID(id string) *ReplaceSubnetNetworkACLOptions { + _options.ID = core.StringPtr(id) return _options } -// SetIsDefault : Allow user to set IsDefault -func (_options *ListVPCRoutingTablesOptions) SetIsDefault(isDefault bool) *ListVPCRoutingTablesOptions { - _options.IsDefault = core.BoolPtr(isDefault) +// SetNetworkACLIdentity : Allow user to set NetworkACLIdentity +func (_options *ReplaceSubnetNetworkACLOptions) SetNetworkACLIdentity(networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { + _options.NetworkACLIdentity = networkACLIdentity return _options } // SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTablesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTablesOptions { +func (options *ReplaceSubnetNetworkACLOptions) SetHeaders(param map[string]string) *ReplaceSubnetNetworkACLOptions { options.Headers = param return options } -// ListVpcsOptions : The ListVpcs options. -type ListVpcsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// ReplaceSubnetRoutingTableOptions : The ReplaceSubnetRoutingTable options. +type ReplaceSubnetRoutingTableOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` - // Filters the collection to VPCs with a `classic_access` property matching the specified value. - ClassicAccess *bool `json:"classic_access,omitempty"` + // The routing table identity. + RoutingTableIdentity RoutingTableIdentityIntf `json:"RoutingTableIdentity" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewListVpcsOptions : Instantiate ListVpcsOptions -func (*VpcV1) NewListVpcsOptions() *ListVpcsOptions { - return &ListVpcsOptions{} +// NewReplaceSubnetRoutingTableOptions : Instantiate ReplaceSubnetRoutingTableOptions +func (*VpcV1) NewReplaceSubnetRoutingTableOptions(id string, routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { + return &ReplaceSubnetRoutingTableOptions{ + ID: core.StringPtr(id), + RoutingTableIdentity: routingTableIdentity, + } } -// SetStart : Allow user to set Start -func (_options *ListVpcsOptions) SetStart(start string) *ListVpcsOptions { - _options.Start = core.StringPtr(start) +// SetID : Allow user to set ID +func (_options *ReplaceSubnetRoutingTableOptions) SetID(id string) *ReplaceSubnetRoutingTableOptions { + _options.ID = core.StringPtr(id) return _options } -// SetLimit : Allow user to set Limit -func (_options *ListVpcsOptions) SetLimit(limit int64) *ListVpcsOptions { - _options.Limit = core.Int64Ptr(limit) +// SetRoutingTableIdentity : Allow user to set RoutingTableIdentity +func (_options *ReplaceSubnetRoutingTableOptions) SetRoutingTableIdentity(routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { + _options.RoutingTableIdentity = routingTableIdentity return _options } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVpcsOptions) SetResourceGroupID(resourceGroupID string) *ListVpcsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// SetHeaders : Allow user to set Headers +func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]string) *ReplaceSubnetRoutingTableOptions { + options.Headers = param + return options } -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *ListVpcsOptions) SetClassicAccess(classicAccess bool) *ListVpcsOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) - return _options +// Reservation : Reservation struct +type Reservation struct { + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + AffinityPolicy *string `json:"affinity_policy" validate:"required"` + + // The capacity configuration for this reservation + // + // If absent, this reservation has no assigned capacity. + Capacity *ReservationCapacity `json:"capacity,omitempty"` + + // The committed use configuration for this reservation. + // + // If absent, this reservation has no commitment for use. + CommittedUse *ReservationCommittedUse `json:"committed_use,omitempty"` + + // The date and time that the reservation was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` + + // The URL for this reservation. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of this reservation. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. + Profile ReservationProfileIntf `json:"profile" validate:"required"` + + // The resource group for this reservation. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the reservation. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ReservationStatusReason `json:"status_reasons" validate:"required"` + + // The zone for this reservation. + Zone *ZoneReference `json:"zone" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOptions { - options.Headers = param - return options +// Constants associated with the Reservation.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationAffinityPolicyRestrictedConst = "restricted" +) + +// Constants associated with the Reservation.LifecycleState property. +// The lifecycle state of this reservation. +const ( + ReservationLifecycleStateDeletingConst = "deleting" + ReservationLifecycleStateFailedConst = "failed" + ReservationLifecycleStatePendingConst = "pending" + ReservationLifecycleStateStableConst = "stable" + ReservationLifecycleStateSuspendedConst = "suspended" + ReservationLifecycleStateUpdatingConst = "updating" + ReservationLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Reservation.ResourceType property. +// The resource type. +const ( + ReservationResourceTypeReservationConst = "reservation" +) + +// Constants associated with the Reservation.Status property. +// The status of the reservation. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationStatusActivatingConst = "activating" + ReservationStatusActiveConst = "active" + ReservationStatusDeactivatingConst = "deactivating" + ReservationStatusExpiredConst = "expired" + ReservationStatusFailedConst = "failed" + ReservationStatusInactiveConst = "inactive" +) + +// UnmarshalReservation unmarshals an instance of Reservation from the specified map of raw messages. +func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Reservation) + err = core.UnmarshalPrimitive(m, "affinity_policy", &obj.AffinityPolicy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUse) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalReservationStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVPNGatewayConnectionLocalCIDRsOptions : The ListVPNGatewayConnectionLocalCIDRs options. -type ListVPNGatewayConnectionLocalCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// ReservationCapacity : The capacity configuration for this reservation +// +// If absent, this reservation has no assigned capacity. +type ReservationCapacity struct { + // The amount allocated to this capacity reservation. + Allocated *int64 `json:"allocated" validate:"required"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The amount of this capacity reservation available for new attachments. + Available *int64 `json:"available" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The status of the capacity reservation: + // - `allocating`: The capacity reservation is being allocated for use + // - `allocated`: The total capacity of the reservation has been allocated for use + // - `degraded`: The capacity reservation has been allocated for use, but some of the + // capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more + // information. + // - `unallocated`: The capacity reservation is not allocated for use + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The total amount of this capacity reservation. + Total *int64 `json:"total" validate:"required"` + + // The amount of this capacity reservation used by existing attachments. + Used *int64 `json:"used" validate:"required"` } -// NewListVPNGatewayConnectionLocalCIDRsOptions : Instantiate ListVPNGatewayConnectionLocalCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionLocalCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - return &ListVPNGatewayConnectionLocalCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// Constants associated with the ReservationCapacity.Status property. +// The status of the capacity reservation: +// - `allocating`: The capacity reservation is being allocated for use +// - `allocated`: The total capacity of the reservation has been allocated for use +// - `degraded`: The capacity reservation has been allocated for use, but some of the +// capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more +// information. +// - `unallocated`: The capacity reservation is not allocated for use +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCapacityStatusAllocatedConst = "allocated" + ReservationCapacityStatusAllocatingConst = "allocating" + ReservationCapacityStatusDegradedConst = "degraded" + ReservationCapacityStatusUnallocatedConst = "unallocated" +) + +// UnmarshalReservationCapacity unmarshals an instance of ReservationCapacity from the specified map of raw messages. +func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacity) + err = core.UnmarshalPrimitive(m, "allocated", &obj.Allocated) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "available", &obj.Available) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "used", &obj.Used) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +// ReservationCapacityPatch : The capacity reservation configuration to use. +// +// The configuration can only be changed for reservations with a `status` of `inactive`. +type ReservationCapacityPatch struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total,omitempty"` } -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalReservationCapacityPatch unmarshals an instance of ReservationCapacityPatch from the specified map of raw messages. +func UnmarshalReservationCapacityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPatch) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionLocalCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionLocalCIDRsOptions { - options.Headers = param - return options +// ReservationCapacityPrototype : The capacity reservation configuration to use. +type ReservationCapacityPrototype struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total" validate:"required"` } -// ListVPNGatewayConnectionPeerCIDRsOptions : The ListVPNGatewayConnectionPeerCIDRs options. -type ListVPNGatewayConnectionPeerCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// NewReservationCapacityPrototype : Instantiate ReservationCapacityPrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCapacityPrototype(total int64) (_model *ReservationCapacityPrototype, err error) { + _model = &ReservationCapacityPrototype{ + Total: core.Int64Ptr(total), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` +// UnmarshalReservationCapacityPrototype unmarshals an instance of ReservationCapacityPrototype from the specified map of raw messages. +func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPrototype) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Allows users to set headers on API requests - Headers map[string]string +// ReservationCollection : ReservationCollection struct +type ReservationCollection struct { + // A link to the first page of resources. + First *ReservationCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservationCollectionNext `json:"next,omitempty"` + + // Collection of reservations. + Reservations []Reservation `json:"reservations" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListVPNGatewayConnectionPeerCIDRsOptions : Instantiate ListVPNGatewayConnectionPeerCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionPeerCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - return &ListVPNGatewayConnectionPeerCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// UnmarshalReservationCollection unmarshals an instance of ReservationCollection from the specified map of raw messages. +func UnmarshalReservationCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservationCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservationCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservations", &obj.Reservations, UnmarshalReservation) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservationCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ReservationCollectionFirst : A link to the first page of resources. +type ReservationCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservationCollectionFirst unmarshals an instance of ReservationCollectionFirst from the specified map of raw messages. +func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options +// ReservationCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservationCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionPeerCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionPeerCIDRsOptions { - options.Headers = param - return options +// UnmarshalReservationCollectionNext unmarshals an instance of ReservationCollectionNext from the specified map of raw messages. +func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVPNGatewayConnectionsOptions : The ListVPNGatewayConnections options. -type ListVPNGatewayConnectionsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// ReservationCommittedUse : The committed use reservation configuration. +type ReservationCommittedUse struct { + // The expiration date and time for this committed use reservation. + ExpirationAt *strfmt.DateTime `json:"expiration_at" validate:"required"` - // Filters the collection to VPN gateway connections with a `status` property matching the specified value. - Status *string `json:"status,omitempty"` + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Term *string `json:"term" validate:"required"` } -// Constants associated with the ListVPNGatewayConnectionsOptions.Status property. -// Filters the collection to VPN gateway connections with a `status` property matching the specified value. +// Constants associated with the ReservationCommittedUse.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. const ( - ListVPNGatewayConnectionsOptionsStatusDownConst = "down" - ListVPNGatewayConnectionsOptionsStatusUpConst = "up" + ReservationCommittedUseExpirationPolicyReleaseConst = "release" + ReservationCommittedUseExpirationPolicyRenewConst = "renew" ) -// NewListVPNGatewayConnectionsOptions : Instantiate ListVPNGatewayConnectionsOptions -func (*VpcV1) NewListVPNGatewayConnectionsOptions(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - return &ListVPNGatewayConnectionsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), +// UnmarshalReservationCommittedUse unmarshals an instance of ReservationCommittedUse from the specified map of raw messages. +func UnmarshalReservationCommittedUse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUse) + err = core.UnmarshalPrimitive(m, "expiration_at", &obj.ExpirationAt) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListVPNGatewayConnectionsOptions) SetStatus(status string) *ListVPNGatewayConnectionsOptions { - _options.Status = core.StringPtr(status) - return _options -} +// ReservationCommittedUsePatch : ReservationCommittedUsePatch struct +type ReservationCommittedUsePatch struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionsOptions { - options.Headers = param - return options + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. The term can only + // be changed for a reservation with a `status` of + // `inactive`. + Term *string `json:"term,omitempty"` } -// ListVPNGatewaysOptions : The ListVPNGateways options. -type ListVPNGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// Constants associated with the ReservationCommittedUsePatch.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUsePatchExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePatchExpirationPolicyRenewConst = "renew" +) - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` +// UnmarshalReservationCommittedUsePatch unmarshals an instance of ReservationCommittedUsePatch from the specified map of raw messages. +func UnmarshalReservationCommittedUsePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePatch) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to VPN gateways with a `mode` property matching the specified value. - Mode *string `json:"mode,omitempty"` +// ReservationCommittedUsePrototype : ReservationCommittedUsePrototype struct +type ReservationCommittedUsePrototype struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. + Term *string `json:"term" validate:"required"` } -// Constants associated with the ListVPNGatewaysOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPNGatewaysOptionsSortCreatedAtConst = "created_at" - ListVPNGatewaysOptionsSortNameConst = "name" -) - -// Constants associated with the ListVPNGatewaysOptions.Mode property. -// Filters the collection to VPN gateways with a `mode` property matching the specified value. +// Constants associated with the ReservationCommittedUsePrototype.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. const ( - ListVPNGatewaysOptionsModePolicyConst = "policy" - ListVPNGatewaysOptionsModeRouteConst = "route" + ReservationCommittedUsePrototypeExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePrototypeExpirationPolicyRenewConst = "renew" ) -// NewListVPNGatewaysOptions : Instantiate ListVPNGatewaysOptions -func (*VpcV1) NewListVPNGatewaysOptions() *ListVPNGatewaysOptions { - return &ListVPNGatewaysOptions{} +// NewReservationCommittedUsePrototype : Instantiate ReservationCommittedUsePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCommittedUsePrototype(term string) (_model *ReservationCommittedUsePrototype, err error) { + _model = &ReservationCommittedUsePrototype{ + Term: core.StringPtr(term), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetStart : Allow user to set Start -func (_options *ListVPNGatewaysOptions) SetStart(start string) *ListVPNGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalReservationCommittedUsePrototype unmarshals an instance of ReservationCommittedUsePrototype from the specified map of raw messages. +func UnmarshalReservationCommittedUsePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePrototype) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListVPNGatewaysOptions) SetLimit(limit int64) *ListVPNGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// ReservationIdentity : Identifies a reservation by a unique property. +// Models which "extend" this model: +// - ReservationIdentityByID +// - ReservationIdentityByCRN +// - ReservationIdentityByHref +type ReservationIdentity struct { + // The unique identifier for this reservation. + ID *string `json:"id,omitempty"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVPNGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListVPNGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The CRN for this reservation. + CRN *string `json:"crn,omitempty"` -// SetSort : Allow user to set Sort -func (_options *ListVPNGatewaysOptions) SetSort(sort string) *ListVPNGatewaysOptions { - _options.Sort = core.StringPtr(sort) - return _options + // The URL for this reservation. + Href *string `json:"href,omitempty"` } -// SetMode : Allow user to set Mode -func (_options *ListVPNGatewaysOptions) SetMode(mode string) *ListVPNGatewaysOptions { - _options.Mode = core.StringPtr(mode) - return _options +func (*ReservationIdentity) isaReservationIdentity() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewaysOptions) SetHeaders(param map[string]string) *ListVPNGatewaysOptions { - options.Headers = param - return options +type ReservationIdentityIntf interface { + isaReservationIdentity() bool } -// ListVPNServerClientsOptions : The ListVPNServerClients options. -type ListVPNServerClientsOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` +// UnmarshalReservationIdentity unmarshals an instance of ReservationIdentity from the specified map of raw messages. +func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// ReservationPatch : ReservationPatch struct +type ReservationPatch struct { + // The capacity reservation configuration to use. + // + // The configuration can only be changed for reservations with a `status` of `inactive`. + Capacity *ReservationCapacityPatch `json:"capacity,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePatch `json:"committed_use,omitempty"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order. - Sort *string `json:"sort,omitempty"` + // The name for this reservation. The name must not be used by another reservation in the region. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + // + // The profile can only be changed for a reservation with a `status` of `inactive`. + Profile *ReservationProfilePatch `json:"profile,omitempty"` } -// Constants associated with the ListVPNServerClientsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order. -const ( - ListVPNServerClientsOptionsSortCreatedAtConst = "created_at" -) - -// NewListVPNServerClientsOptions : Instantiate ListVPNServerClientsOptions -func (*VpcV1) NewListVPNServerClientsOptions(vpnServerID string) *ListVPNServerClientsOptions { - return &ListVPNServerClientsOptions{ - VPNServerID: core.StringPtr(vpnServerID), +// UnmarshalReservationPatch unmarshals an instance of ReservationPatch from the specified map of raw messages. +func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationPatch) + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacityPatch) + if err != nil { + return } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUsePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfilePatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *ListVPNServerClientsOptions) SetVPNServerID(vpnServerID string) *ListVPNServerClientsOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options +// AsPatch returns a generic map representation of the ReservationPatch +func (reservationPatch *ReservationPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(reservationPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetStart : Allow user to set Start -func (_options *ListVPNServerClientsOptions) SetStart(start string) *ListVPNServerClientsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// ReservationProfile : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. +// Models which "extend" this model: +// - ReservationProfileInstanceProfileReference +type ReservationProfile struct { + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListVPNServerClientsOptions) SetLimit(limit int64) *ListVPNServerClientsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` -// SetSort : Allow user to set Sort -func (_options *ListVPNServerClientsOptions) SetSort(sort string) *ListVPNServerClientsOptions { - _options.Sort = core.StringPtr(sort) - return _options + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPNServerClientsOptions) SetHeaders(param map[string]string) *ListVPNServerClientsOptions { - options.Headers = param - return options -} +// Constants associated with the ReservationProfile.ResourceType property. +// The resource type. +const ( + ReservationProfileResourceTypeInstanceProfileConst = "instance_profile" +) -// ListVPNServerRoutesOptions : The ListVPNServerRoutes options. -type ListVPNServerRoutesOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` +func (*ReservationProfile) isaReservationProfile() bool { + return true +} - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +type ReservationProfileIntf interface { + isaReservationProfile() bool +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// UnmarshalReservationProfile unmarshals an instance of ReservationProfile from the specified map of raw messages. +func UnmarshalReservationProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfile) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` +// ReservationProfilePatch : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +// +// The profile can only be changed for a reservation with a `status` of `inactive`. +type ReservationProfilePatch struct { + // The globally unique name of the profile. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type of the profile. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the ListVPNServerRoutesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the ReservationProfilePatch.ResourceType property. +// The resource type of the profile. const ( - ListVPNServerRoutesOptionsSortCreatedAtConst = "created_at" - ListVPNServerRoutesOptionsSortNameConst = "name" + ReservationProfilePatchResourceTypeInstanceProfileConst = "instance_profile" ) -// NewListVPNServerRoutesOptions : Instantiate ListVPNServerRoutesOptions -func (*VpcV1) NewListVPNServerRoutesOptions(vpnServerID string) *ListVPNServerRoutesOptions { - return &ListVPNServerRoutesOptions{ - VPNServerID: core.StringPtr(vpnServerID), +// UnmarshalReservationProfilePatch unmarshals an instance of ReservationProfilePatch from the specified map of raw messages. +func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNServerID : Allow user to set VPNServerID -func (_options *ListVPNServerRoutesOptions) SetVPNServerID(vpnServerID string) *ListVPNServerRoutesOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} +// ReservationProfilePrototype : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +type ReservationProfilePrototype struct { + // The globally unique name of the profile. + Name *string `json:"name" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListVPNServerRoutesOptions) SetStart(start string) *ListVPNServerRoutesOptions { - _options.Start = core.StringPtr(start) - return _options + // The resource type of the profile. + ResourceType *string `json:"resource_type" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListVPNServerRoutesOptions) SetLimit(limit int64) *ListVPNServerRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// Constants associated with the ReservationProfilePrototype.ResourceType property. +// The resource type of the profile. +const ( + ReservationProfilePrototypeResourceTypeInstanceProfileConst = "instance_profile" +) -// SetSort : Allow user to set Sort -func (_options *ListVPNServerRoutesOptions) SetSort(sort string) *ListVPNServerRoutesOptions { - _options.Sort = core.StringPtr(sort) - return _options +// NewReservationProfilePrototype : Instantiate ReservationProfilePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationProfilePrototype(name string, resourceType string) (_model *ReservationProfilePrototype, err error) { + _model = &ReservationProfilePrototype{ + Name: core.StringPtr(name), + ResourceType: core.StringPtr(resourceType), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetHeaders : Allow user to set Headers -func (options *ListVPNServerRoutesOptions) SetHeaders(param map[string]string) *ListVPNServerRoutesOptions { - options.Headers = param - return options +// UnmarshalReservationProfilePrototype unmarshals an instance of ReservationProfilePrototype from the specified map of raw messages. +func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVPNServersOptions : The ListVPNServers options. -type ListVPNServersOptions struct { - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` +// ReservationReference : ReservationReference struct +type ReservationReference struct { + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ReservationReferenceDeleted `json:"deleted,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The URL for this reservation. + Href *string `json:"href" validate:"required"` - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ListVPNServersOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the ReservationReference.ResourceType property. +// The resource type. const ( - ListVPNServersOptionsSortCreatedAtConst = "created_at" - ListVPNServersOptionsSortNameConst = "name" + ReservationReferenceResourceTypeReservationConst = "reservation" ) -// NewListVPNServersOptions : Instantiate ListVPNServersOptions -func (*VpcV1) NewListVPNServersOptions() *ListVPNServersOptions { - return &ListVPNServersOptions{} -} - -// SetName : Allow user to set Name -func (_options *ListVPNServersOptions) SetName(name string) *ListVPNServersOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalReservationReference unmarshals an instance of ReservationReference from the specified map of raw messages. +func UnmarshalReservationReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservationReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListVPNServersOptions) SetStart(start string) *ListVPNServersOptions { - _options.Start = core.StringPtr(start) - return _options +// ReservationReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ReservationReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListVPNServersOptions) SetLimit(limit int64) *ListVPNServersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalReservationReferenceDeleted unmarshals an instance of ReservationReferenceDeleted from the specified map of raw messages. +func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVPNServersOptions) SetResourceGroupID(resourceGroupID string) *ListVPNServersOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// ReservationStatusReason : ReservationStatusReason struct +type ReservationStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` -// SetSort : Allow user to set Sort -func (_options *ListVPNServersOptions) SetSort(sort string) *ListVPNServersOptions { - _options.Sort = core.StringPtr(sort) - return _options -} + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListVPNServersOptions) SetHeaders(param map[string]string) *ListVPNServersOptions { - options.Headers = param - return options + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// LoadBalancer : LoadBalancer struct -type LoadBalancer struct { - // The date and time that this load balancer was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// Constants associated with the ReservationStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ReservationStatusReasonCodeCannotActivateNoCapacityAvailableConst = "cannot_activate_no_capacity_available" + ReservationStatusReasonCodeCannotRenewUnsupportedProfileTermConst = "cannot_renew_unsupported_profile_term" +) - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` +// UnmarshalReservationStatusReason unmarshals an instance of ReservationStatusReason from the specified map of raw messages. +func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The DNS configuration for this load balancer. +// ReservedIP : ReservedIP struct +type ReservedIP struct { + // The IP address. // - // If absent, DNS `A` records for this load balancer's `hostname` property will be added to - // the public DNS zone `lb.appdomain.cloud`. - Dns *LoadBalancerDns `json:"dns,omitempty"` + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` - // Fully qualified domain name assigned to this load balancer. - Hostname *string `json:"hostname" validate:"required"` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The load balancer's canonical URL. + // The date and time that the reserved IP was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this reserved IP. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer. + // The unique identifier for this reserved IP. ID *string `json:"id" validate:"required"` - // Indicates whether this load balancer supports instance groups. - InstanceGroupsSupported *bool `json:"instance_groups_supported" validate:"required"` - - // The type of this load balancer, public or private. - IsPublic *bool `json:"is_public" validate:"required"` - - // The listeners of this load balancer. - Listeners []LoadBalancerListenerReference `json:"listeners" validate:"required"` - - // The logging configuration for this load balancer. - Logging *LoadBalancerLogging `json:"logging" validate:"required"` + // The lifecycle state of the reserved IP. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The name for this load balancer. The name is unique across all load balancers in the VPC. + // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. Name *string `json:"name" validate:"required"` - // The operating status of this load balancer. - OperatingStatus *string `json:"operating_status" validate:"required"` - - // The pools of this load balancer. - Pools []LoadBalancerPoolReference `json:"pools" validate:"required"` - - // The private IP addresses assigned to this load balancer. - PrivateIps []LoadBalancerPrivateIpsItem `json:"private_ips" validate:"required"` - - // The profile for this load balancer. - Profile *LoadBalancerProfileReference `json:"profile" validate:"required"` - - // The provisioning status of this load balancer: - // - // - `active`: The load balancer is running. - // - `create_pending`: The load balancer is being created. - // - `delete_pending`: The load balancer is being deleted. - // - `maintenance_pending`: The load balancer is unavailable due to an internal - // error (contact IBM support). - // - `migrate_pending`: The load balancer is migrating to the requested configuration. - // Performance may be degraded. - // - `update_pending`: The load balancer is being updated - // to the requested configuration. - // - // The enumerated values for this property are expected to expand in the future. When - // processing this property, check for and log unknown values. Optionally halt - // processing and surface the error, or bypass the load balancer on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The public IP addresses assigned to this load balancer. - // - // Applicable only for public load balancers. - PublicIps []IP `json:"public_ips" validate:"required"` - - // The resource group for this load balancer. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The owner of the reserved IP. + Owner *string `json:"owner" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode" validate:"required"` - - // The security groups targeting this load balancer. - // - // If empty, all inbound and outbound traffic is allowed. - // - // Applicable only for load balancers that support security groups. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // Indicates whether this load balancer supports security groups. - SecurityGroupsSupported *bool `json:"security_groups_supported" validate:"required"` - - // The subnets this load balancer is provisioned in. The load balancer's availability depends on the availability of - // the zones that the subnets reside in. + // The target this reserved IP is bound to. // - // All subnets will be in the same VPC. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // Indicates whether this load balancer supports UDP. - UDPSupported *bool `json:"udp_supported" validate:"required"` + // If absent, this reserved IP is provider-owned or unbound. + Target ReservedIPTargetIntf `json:"target,omitempty"` } -// Constants associated with the LoadBalancer.OperatingStatus property. -// The operating status of this load balancer. +// Constants associated with the ReservedIP.LifecycleState property. +// The lifecycle state of the reserved IP. const ( - LoadBalancerOperatingStatusOfflineConst = "offline" - LoadBalancerOperatingStatusOnlineConst = "online" + ReservedIPLifecycleStateDeletingConst = "deleting" + ReservedIPLifecycleStateFailedConst = "failed" + ReservedIPLifecycleStatePendingConst = "pending" + ReservedIPLifecycleStateStableConst = "stable" + ReservedIPLifecycleStateSuspendedConst = "suspended" + ReservedIPLifecycleStateUpdatingConst = "updating" + ReservedIPLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the LoadBalancer.ProvisioningStatus property. -// The provisioning status of this load balancer: -// -// - `active`: The load balancer is running. -// -// - `create_pending`: The load balancer is being created. -// -// - `delete_pending`: The load balancer is being deleted. -// -// - `maintenance_pending`: The load balancer is unavailable due to an internal -// error (contact IBM support). -// -// - `migrate_pending`: The load balancer is migrating to the requested configuration. -// Performance may be degraded. -// -// - `update_pending`: The load balancer is being updated -// to the requested configuration. -// -// The enumerated values for this property are expected to expand in the future. When -// processing this property, check for and log unknown values. Optionally halt -// processing and surface the error, or bypass the load balancer on which the -// unexpected property value was encountered. +// Constants associated with the ReservedIP.Owner property. +// The owner of the reserved IP. const ( - LoadBalancerProvisioningStatusActiveConst = "active" - LoadBalancerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerProvisioningStatusFailedConst = "failed" - LoadBalancerProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerProvisioningStatusMigratePendingConst = "migrate_pending" - LoadBalancerProvisioningStatusUpdatePendingConst = "update_pending" + ReservedIPOwnerProviderConst = "provider" + ReservedIPOwnerUserConst = "user" ) -// Constants associated with the LoadBalancer.ResourceType property. +// Constants associated with the ReservedIP.ResourceType property. // The resource type. const ( - LoadBalancerResourceTypeLoadBalancerConst = "load_balancer" + ReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) -// UnmarshalLoadBalancer unmarshals an instance of LoadBalancer from the specified map of raw messages. -func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancer) +// UnmarshalReservedIP unmarshals an instance of ReservedIP from the specified map of raw messages. +func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDns) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "owner", &obj.Owner) if err != nil { return } - err = core.UnmarshalPrimitive(m, "instance_groups_supported", &obj.InstanceGroupsSupported) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "is_public", &obj.IsPublic) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalReservedIPTarget) if err != nil { return } - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListenerReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollection : ReservedIPCollection struct +type ReservedIPCollection struct { + // A link to the first page of resources. + First *ReservedIPCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservedIPCollectionNext `json:"next,omitempty"` + + // Collection of reserved IPs in this subnet. + ReservedIps []ReservedIP `json:"reserved_ips" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalReservedIPCollection unmarshals an instance of ReservedIPCollection from the specified map of raw messages. +func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "operating_status", &obj.OperatingStatus) + err = core.UnmarshalModel(m, "reserved_ips", &obj.ReservedIps, UnmarshalReservedIP) if err != nil { return } - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPoolReference) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalLoadBalancerPrivateIpsItem) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservedIPCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ReservedIPCollectionBareMetalServerNetworkInterfaceContext : ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct +type ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct { + // A link to the first page of resources. + First *ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst `json:"first" validate:"required"` + + // Collection of reserved IPs bound to a bare metal server network interface. + Ips []ReservedIP `json:"ips" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalLoadBalancerProfileReference) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "public_ips", &obj.PublicIps, UnmarshalIP) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst : A link to the first page of resources. +type ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "route_mode", &obj.RouteMode) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionEndpointGatewayContext : ReservedIPCollectionEndpointGatewayContext struct +type ReservedIPCollectionEndpointGatewayContext struct { + // A link to the first page of resources. + First *ReservedIPCollectionEndpointGatewayContextFirst `json:"first" validate:"required"` + + // Collection of reserved IPs bound to an endpoint gateway. + Ips []ReservedIP `json:"ips" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservedIPCollectionEndpointGatewayContextNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalReservedIPCollectionEndpointGatewayContext unmarshals an instance of ReservedIPCollectionEndpointGatewayContext from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionEndpointGatewayContextFirst) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionEndpointGatewayContextNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "security_groups_supported", &obj.SecurityGroupsSupported) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ReservedIPCollectionEndpointGatewayContextFirst : A link to the first page of resources. +type ReservedIPCollectionEndpointGatewayContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionEndpointGatewayContextFirst unmarshals an instance of ReservedIPCollectionEndpointGatewayContextFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionEndpointGatewayContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionEndpointGatewayContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionEndpointGatewayContextNext unmarshals an instance of ReservedIPCollectionEndpointGatewayContextNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "udp_supported", &obj.UDPSupported) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionFirst : A link to the first page of resources. +type ReservedIPCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionFirst unmarshals an instance of ReservedIPCollectionFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -55154,41 +68070,41 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er return } -// LoadBalancerCollection : LoadBalancerCollection struct -type LoadBalancerCollection struct { +// ReservedIPCollectionInstanceNetworkInterfaceContext : ReservedIPCollectionInstanceNetworkInterfaceContext struct +type ReservedIPCollectionInstanceNetworkInterfaceContext struct { // A link to the first page of resources. - First *LoadBalancerCollectionFirst `json:"first" validate:"required"` + First *ReservedIPCollectionInstanceNetworkInterfaceContextFirst `json:"first" validate:"required"` + + // Collection of reserved IPs bound to an instance network interface. + Ips []ReservedIP `json:"ips" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of load balancers. - LoadBalancers []LoadBalancer `json:"load_balancers" validate:"required"` - // A link to the next page of resources. This property is present for all pages // except the last page. - Next *LoadBalancerCollectionNext `json:"next,omitempty"` + Next *ReservedIPCollectionInstanceNetworkInterfaceContextNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerCollection unmarshals an instance of LoadBalancerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerCollectionFirst) +// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionInstanceNetworkInterfaceContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) if err != nil { return } - err = core.UnmarshalModel(m, "load_balancers", &obj.LoadBalancers, UnmarshalLoadBalancer) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext) if err != nil { return } @@ -55201,7 +68117,7 @@ func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interf } // Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { +func (resp *ReservedIPCollectionInstanceNetworkInterfaceContext) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -55212,15 +68128,15 @@ func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { return start, nil } -// LoadBalancerCollectionFirst : A link to the first page of resources. -type LoadBalancerCollectionFirst struct { +// ReservedIPCollectionInstanceNetworkInterfaceContextFirst : A link to the first page of resources. +type ReservedIPCollectionInstanceNetworkInterfaceContextFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerCollectionFirst unmarshals an instance of LoadBalancerCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionFirst) +// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -55229,15 +68145,15 @@ func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result i return } -// LoadBalancerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerCollectionNext struct { +// ReservedIPCollectionInstanceNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionInstanceNetworkInterfaceContextNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerCollectionNext unmarshals an instance of LoadBalancerCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionNext) +// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -55246,26 +68162,16 @@ func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result in return } -// LoadBalancerDns : The DNS configuration for this load balancer. -// -// If absent, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone -// `lb.appdomain.cloud`. -type LoadBalancerDns struct { - // The DNS instance associated with this load balancer. - Instance *DnsInstanceReference `json:"instance" validate:"required"` - - // The DNS zone associated with this load balancer. - Zone *DnsZoneReference `json:"zone" validate:"required"` +// ReservedIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerDns unmarshals an instance of LoadBalancerDns from the specified map of raw messages. -func UnmarshalLoadBalancerDns(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDns) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneReference) +// UnmarshalReservedIPCollectionNext unmarshals an instance of ReservedIPCollectionNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -55273,73 +68179,45 @@ func UnmarshalLoadBalancerDns(m map[string]json.RawMessage, result interface{}) return } -// LoadBalancerDnsPatch : The DNS configuration for this load balancer. -// -// Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` records for this load balancer -// that had been added to `zone`, and add equivalent `A` records to the public DNS zone `lb.appdomain.cloud`. -type LoadBalancerDnsPatch struct { - // The DNS instance to associate with this load balancer. - // - // The specified instance may be in a different region or account, subject to IAM - // policies. - Instance DnsInstanceIdentityIntf `json:"instance,omitempty"` +// ReservedIPCollectionVirtualNetworkInterfaceContext : ReservedIPCollectionVirtualNetworkInterfaceContext struct +type ReservedIPCollectionVirtualNetworkInterfaceContext struct { + // A link to the first page of resources. + First *ReservedIPCollectionVirtualNetworkInterfaceContextFirst `json:"first" validate:"required"` - // The DNS zone to associate with this load balancer. - // - // The specified zone may be in a different region or account, subject to IAM policies. - Zone DnsZoneIdentityIntf `json:"zone,omitempty"` + // Collection of reserved IPs bound to the virtual network interface specified by the identifier in the URL. + Ips []ReservedIPReference `json:"ips" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservedIPCollectionVirtualNetworkInterfaceContextNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerDnsPatch unmarshals an instance of LoadBalancerDnsPatch from the specified map of raw messages. -func UnmarshalLoadBalancerDnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDnsPatch) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) +// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionVirtualNetworkInterfaceContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerDnsPrototype : The DNS configuration for this load balancer. -// -// If unspecified, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone -// `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be added to the specified `zone`. -type LoadBalancerDnsPrototype struct { - // The DNS instance to associate with this load balancer. - // - // The specified instance may be in a different region or account, subject to IAM - // policies. - Instance DnsInstanceIdentityIntf `json:"instance" validate:"required"` - - // The DNS zone to associate with this load balancer. - // - // The specified zone may be in a different region or account, subject to IAM policies. - Zone DnsZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewLoadBalancerDnsPrototype : Instantiate LoadBalancerDnsPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerDnsPrototype(instance DnsInstanceIdentityIntf, zone DnsZoneIdentityIntf) (_model *LoadBalancerDnsPrototype, err error) { - _model = &LoadBalancerDnsPrototype{ - Instance: instance, - Zone: zone, + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerDnsPrototype unmarshals an instance of LoadBalancerDnsPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerDnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDnsPrototype) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -55347,42 +68225,71 @@ func UnmarshalLoadBalancerDnsPrototype(m map[string]json.RawMessage, result inte return } -// LoadBalancerIdentity : Identifies a load balancer by a unique property. -// Models which "extend" this model: -// - LoadBalancerIdentityByID -// - LoadBalancerIdentityByCRN -// - LoadBalancerIdentityByHref -type LoadBalancerIdentity struct { - // The unique identifier for this load balancer. - ID *string `json:"id,omitempty"` - - // The load balancer's CRN. - CRN *string `json:"crn,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservedIPCollectionVirtualNetworkInterfaceContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // The load balancer's canonical URL. - Href *string `json:"href,omitempty"` +// ReservedIPCollectionVirtualNetworkInterfaceContextFirst : A link to the first page of resources. +type ReservedIPCollectionVirtualNetworkInterfaceContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -func (*LoadBalancerIdentity) isaLoadBalancerIdentity() bool { - return true +// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContextFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionVirtualNetworkInterfaceContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type LoadBalancerIdentityIntf interface { - isaLoadBalancerIdentity() bool +// ReservedIPCollectionVirtualNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionVirtualNetworkInterfaceContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerIdentity unmarshals an instance of LoadBalancerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContextNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionVirtualNetworkInterfaceContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPPatch : ReservedIPPatch struct +type ReservedIPPatch struct { + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` +} + +// UnmarshalReservedIPPatch unmarshals an instance of ReservedIPPatch from the specified map of raw messages. +func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPPatch) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -55390,121 +68297,58 @@ func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interfac return } -// LoadBalancerListener : LoadBalancerListener struct -type LoadBalancerListener struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol" validate:"required"` +// AsPatch returns a generic map representation of the ReservedIPPatch +func (reservedIPPatch *ReservedIPPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(reservedIPPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The certificate instance used for SSL termination. +// ReservedIPReference : ReservedIPReference struct +type ReservedIPReference struct { + // The IP address. // - // If absent, this listener is not using a certificate instance. - CertificateInstance *CertificateInstanceReference `json:"certificate_instance,omitempty"` - - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` - - // The date and time that this listener was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` - // The default pool for this listener. If absent, this listener has no default pool. - DefaultPool *LoadBalancerPoolReference `json:"default_pool,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - // The listener's canonical URL. + // The URL for this reserved IP. Href *string `json:"href" validate:"required"` - // If present, the target listener that requests are redirected to. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirect `json:"https_redirect,omitempty"` - - // The unique identifier for this load balancer listener. + // The unique identifier for this reserved IP. ID *string `json:"id" validate:"required"` - // The idle connection timeout of the listener in seconds. This property will be present for load balancers in the - // `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The policies for this listener. - Policies []LoadBalancerListenerPolicyReference `json:"policies,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. - Port *int64 `json:"port" validate:"required"` - - // The inclusive upper bound of the range of ports used by this listener. - // - // At present, only load balancers in the `network` family support more than one port per listener. - PortMax *int64 `json:"port_max" validate:"required"` - - // The inclusive lower bound of the range of ports used by this listener. - // - // At present, only load balancers in the `network` family support more than one port per listener. - PortMin *int64 `json:"port_min" validate:"required"` - - // The listener protocol. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol" validate:"required"` + // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. + Name *string `json:"name" validate:"required"` - // The provisioning status of this listener - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the LoadBalancerListener.Protocol property. -// The listener protocol. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerProtocolHTTPConst = "http" - LoadBalancerListenerProtocolHTTPSConst = "https" - LoadBalancerListenerProtocolTCPConst = "tcp" - LoadBalancerListenerProtocolUDPConst = "udp" -) - -// Constants associated with the LoadBalancerListener.ProvisioningStatus property. -// The provisioning status of this listener -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the -// unexpected property value was encountered. +// Constants associated with the ReservedIPReference.ResourceType property. +// The resource type. const ( - LoadBalancerListenerProvisioningStatusActiveConst = "active" - LoadBalancerListenerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerProvisioningStatusFailedConst = "failed" - LoadBalancerListenerProvisioningStatusUpdatePendingConst = "update_pending" + ReservedIPReferenceResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) -// UnmarshalLoadBalancerListener unmarshals an instance of LoadBalancerListener from the specified map of raw messages. -func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListener) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalReservedIPReference unmarshals an instance of ReservedIPReference from the specified map of raw messages. +func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPReference) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) if err != nil { return } @@ -55512,39 +68356,15 @@ func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirect) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -55552,16 +68372,17 @@ func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interfac return } -// LoadBalancerListenerCollection : LoadBalancerListenerCollection struct -type LoadBalancerListenerCollection struct { - // Collection of listeners. - Listeners []LoadBalancerListener `json:"listeners" validate:"required"` +// ReservedIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ReservedIPReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerListenerCollection unmarshals an instance of LoadBalancerListenerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerCollection) - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListener) +// UnmarshalReservedIPReferenceDeleted unmarshals an instance of ReservedIPReferenceDeleted from the specified map of raw messages. +func UnmarshalReservedIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -55569,101 +68390,77 @@ func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, resul return } -// LoadBalancerListenerHTTPSRedirect : LoadBalancerListenerHTTPSRedirect struct -type LoadBalancerListenerHTTPSRedirect struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` +// ReservedIPTarget : The target this reserved IP is bound to. +// +// If absent, this reserved IP is provider-owned or unbound. +// Models which "extend" this model: +// - ReservedIPTargetEndpointGatewayReference +// - ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext +// - ReservedIPTargetNetworkInterfaceReferenceTargetContext +// - ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext +// - ReservedIPTargetLoadBalancerReference +// - ReservedIPTargetVPNGatewayReference +// - ReservedIPTargetVPNServerReference +// - ReservedIPTargetGenericResourceReference +type ReservedIPTarget struct { + // The CRN for this endpoint gateway. + CRN *string `json:"crn,omitempty"` - Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} + // The URL for this endpoint gateway. + Href *string `json:"href,omitempty"` -// UnmarshalLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerHTTPSRedirect from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirect) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The unique identifier for this endpoint gateway. + ID *string `json:"id,omitempty"` + + // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// LoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerHTTPSRedirectPatch struct -type LoadBalancerListenerHTTPSRedirectPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` +// Constants associated with the ReservedIPTarget.ResourceType property. +// The resource type. +const ( + ReservedIPTargetResourceTypeEndpointGatewayConst = "endpoint_gateway" +) - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` +func (*ReservedIPTarget) isaReservedIPTarget() bool { + return true +} - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` +type ReservedIPTargetIntf interface { + isaReservedIPTarget() bool } -// UnmarshalLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) +// UnmarshalReservedIPTarget unmarshals an instance of ReservedIPTarget from the specified map of raw messages. +func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerHTTPSRedirectPrototype struct -type LoadBalancerListenerHTTPSRedirectPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -// NewLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerHTTPSRedirectPrototype, err error) { - _model = &LoadBalancerListenerHTTPSRedirectPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - Listener: listener, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -55671,33 +68468,46 @@ func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMe return } -// LoadBalancerListenerIdentity : Identifies a load balancer listener by a unique property. +// ReservedIPTargetPrototype : The target to bind this reserved IP to. The target must be in the same VPC. +// +// The following targets are supported: +// - An endpoint gateway not already bound to a reserved IP in the subnet's zone. +// - A virtual network interface. +// +// If unspecified, the reserved IP will be created unbound. // Models which "extend" this model: -// - LoadBalancerListenerIdentityByID -// - LoadBalancerListenerIdentityByHref -type LoadBalancerListenerIdentity struct { - // The unique identifier for this load balancer listener. +// - ReservedIPTargetPrototypeEndpointGatewayIdentity +// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity +type ReservedIPTargetPrototype struct { + // The unique identifier for this endpoint gateway. ID *string `json:"id,omitempty"` - // The listener's canonical URL. + // The CRN for this endpoint gateway. + CRN *string `json:"crn,omitempty"` + + // The URL for this endpoint gateway. Href *string `json:"href,omitempty"` } -func (*LoadBalancerListenerIdentity) isaLoadBalancerListenerIdentity() bool { +func (*ReservedIPTargetPrototype) isaReservedIPTargetPrototype() bool { return true } -type LoadBalancerListenerIdentityIntf interface { - isaLoadBalancerListenerIdentity() bool +type ReservedIPTargetPrototypeIntf interface { + isaReservedIPTargetPrototype() bool } -// UnmarshalLoadBalancerListenerIdentity unmarshals an instance of LoadBalancerListenerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentity) +// UnmarshalReservedIPTargetPrototype unmarshals an instance of ReservedIPTargetPrototype from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototype) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -55706,141 +68516,75 @@ func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result return } -// LoadBalancerListenerPatch : LoadBalancerListenerPatch struct -type LoadBalancerListenerPatch struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` +// ResourceFilter : Identifies one or more resources according to the specified filter property. +type ResourceFilter struct { + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// UnmarshalResourceFilter unmarshals an instance of ResourceFilter from the specified map of raw messages. +func UnmarshalResourceFilter(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceFilter) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The default pool for this listener. The specified pool must: - // - // - Belong to this load balancer - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener - // - // Specify `null` to remove an existing default pool. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` +// ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource +// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. +// Models which "extend" this model: +// - ResourceGroupIdentityByID +type ResourceGroupIdentity struct { + // The unique identifier for this resource group. + ID *string `json:"id,omitempty"` +} - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - // - // Specify `null` to remove any existing https redirect. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPatch `json:"https_redirect,omitempty"` +func (*ResourceGroupIdentity) isaResourceGroupIdentity() bool { + return true +} - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` +type ResourceGroupIdentityIntf interface { + isaResourceGroupIdentity() bool +} - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` +// UnmarshalResourceGroupIdentity unmarshals an instance of ResourceGroupIdentity from the specified map of raw messages. +func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` +// ResourceGroupReference : ResourceGroupReference struct +type ResourceGroupReference struct { + // The URL for this resource group. + Href *string `json:"href" validate:"required"` - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` + // The unique identifier for this resource group. + ID *string `json:"id" validate:"required"` - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // Additional restrictions: - // - If `default_pool` is set, the protocol cannot be changed. - // - If `https_redirect` is set, the protocol must be `http`. - // - If another listener's `https_redirect` targets this listener, the protocol must be - // `https`. - Protocol *string `json:"protocol,omitempty"` + // The name for this resource group. + Name *string `json:"name" validate:"required"` } -// Constants associated with the LoadBalancerListenerPatch.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the protocol cannot be changed. -// - If `https_redirect` is set, the protocol must be `http`. -// - If another listener's `https_redirect` targets this listener, the protocol must be -// `https`. -const ( - LoadBalancerListenerPatchProtocolHTTPConst = "http" - LoadBalancerListenerPatchProtocolHTTPSConst = "https" - LoadBalancerListenerPatchProtocolTCPConst = "tcp" - LoadBalancerListenerPatchProtocolUDPConst = "udp" -) - -// UnmarshalLoadBalancerListenerPatch unmarshals an instance of LoadBalancerListenerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPatch) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) +// UnmarshalResourceGroupReference unmarshals an instance of ResourceGroupReference from the specified map of raw messages. +func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceGroupReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -55848,163 +68592,182 @@ func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result int return } -// AsPatch returns a generic map representation of the LoadBalancerListenerPatch -func (loadBalancerListenerPatch *LoadBalancerListenerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// RestartBareMetalServerOptions : The RestartBareMetalServer options. +type RestartBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewRestartBareMetalServerOptions : Instantiate RestartBareMetalServerOptions +func (*VpcV1) NewRestartBareMetalServerOptions(id string) *RestartBareMetalServerOptions { + return &RestartBareMetalServerOptions{ + ID: core.StringPtr(id), } - return } -// LoadBalancerListenerPolicy : LoadBalancerListenerPolicy struct -type LoadBalancerListenerPolicy struct { - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. +// SetID : Allow user to set ID +func (_options *RestartBareMetalServerOptions) SetID(id string) *RestartBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *RestartBareMetalServerOptions) SetHeaders(param map[string]string) *RestartBareMetalServerOptions { + options.Headers = param + return options +} + +// Route : Route struct +type Route struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. Action *string `json:"action" validate:"required"` - // The date and time that this policy was created. + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The listener policy's canonical URL. + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. Href *string `json:"href" validate:"required"` - // The policy's unique identifier. + // The unique identifier for this route. ID *string `json:"id" validate:"required"` - // The name for this load balancer listener policy. The name is unique across all policies for the load balancer - // listener. + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. Name *string `json:"name" validate:"required"` - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - // The provisioning status of this policy + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user // // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + Origin *string `json:"origin,omitempty"` - // The rules for this policy. - Rules []LoadBalancerListenerPolicyRuleReference `json:"rules" validate:"required"` + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` - // - If `action` is `forward`, the response is a `LoadBalancerPoolReference` - // - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` - // - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. - Target LoadBalancerListenerPolicyTargetIntf `json:"target,omitempty"` + // The zone the route applies to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the LoadBalancerListenerPolicy.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. +// Constants associated with the Route.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - LoadBalancerListenerPolicyActionForwardConst = "forward" - LoadBalancerListenerPolicyActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyActionRedirectConst = "redirect" - LoadBalancerListenerPolicyActionRejectConst = "reject" + RouteActionDelegateConst = "delegate" + RouteActionDelegateVPCConst = "delegate_vpc" + RouteActionDeliverConst = "deliver" + RouteActionDropConst = "drop" ) -// Constants associated with the LoadBalancerListenerPolicy.ProvisioningStatus property. -// The provisioning status of this policy +// Constants associated with the Route.LifecycleState property. +// The lifecycle state of the route. +const ( + RouteLifecycleStateDeletingConst = "deleting" + RouteLifecycleStateFailedConst = "failed" + RouteLifecycleStatePendingConst = "pending" + RouteLifecycleStateStableConst = "stable" + RouteLifecycleStateSuspendedConst = "suspended" + RouteLifecycleStateUpdatingConst = "updating" + RouteLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Route.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user // // The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the // unexpected property value was encountered. const ( - LoadBalancerListenerPolicyProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyProvisioningStatusUpdatePendingConst = "update_pending" + RouteOriginServiceConst = "service" + RouteOriginUserConst = "user" ) -// UnmarshalLoadBalancerListenerPolicy unmarshals an instance of LoadBalancerListenerPolicy from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicy) +// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. +func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Route) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRuleReference) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTarget) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyCollection : LoadBalancerListenerPolicyCollection struct -type LoadBalancerListenerPolicyCollection struct { - // Collection of policies. - Policies []LoadBalancerListenerPolicy `json:"policies" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyCollection unmarshals an instance of LoadBalancerListenerPolicyCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyCollection) - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyPatch : LoadBalancerListenerPolicyPatch struct -type LoadBalancerListenerPolicyPatch struct { - // The name for this policy. The name must not be used by another policy for the load balancer listener. - Name *string `json:"name,omitempty"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority,omitempty"` - - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPatch`. - Target LoadBalancerListenerPolicyTargetPatchIntf `json:"target,omitempty"` -} - -// UnmarshalLoadBalancerListenerPolicyPatch unmarshals an instance of LoadBalancerListenerPolicyPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) if err != nil { return } @@ -56012,7 +68775,7 @@ func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, resu if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPatch) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -56020,85 +68783,45 @@ func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, resu return } -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyPatch -func (loadBalancerListenerPolicyPatch *LoadBalancerListenerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerListenerPolicyPrototype : LoadBalancerListenerPolicyPrototype struct -type LoadBalancerListenerPolicyPrototype struct { - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // The name for this policy. The name must not be used by another policy for the load balancer listener. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` - - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` +// RouteCollection : RouteCollection struct +type RouteCollection struct { + // A link to the first page of resources. + First *RouteCollectionFirst `json:"first" validate:"required"` - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// Constants associated with the LoadBalancerListenerPolicyPrototype.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyPrototypeActionForwardConst = "forward" - LoadBalancerListenerPolicyPrototypeActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyPrototypeActionRedirectConst = "redirect" - LoadBalancerListenerPolicyPrototypeActionRejectConst = "reject" -) + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RouteCollectionNext `json:"next,omitempty"` -// NewLoadBalancerListenerPolicyPrototype : Instantiate LoadBalancerListenerPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyPrototype(action string, priority int64) (_model *LoadBalancerListenerPolicyPrototype, err error) { - _model = &LoadBalancerListenerPolicyPrototype{ - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), - } - err = core.ValidateStruct(_model, "required parameters") - return + // Collection of routes. + Routes []Route `json:"routes" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyPrototype unmarshals an instance of LoadBalancerListenerPolicyPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. +func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRulePrototype) + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPrototype) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -56106,55 +68829,45 @@ func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, return } -// LoadBalancerListenerPolicyReference : LoadBalancerListenerPolicyReference struct -type LoadBalancerListenerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerPolicyReferenceDeleted `json:"deleted,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RouteCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // The listener policy's canonical URL. +// RouteCollectionFirst : A link to the first page of resources. +type RouteCollectionFirst struct { + // The URL for a page of resources. Href *string `json:"href" validate:"required"` - - // The policy's unique identifier. - ID *string `json:"id" validate:"required"` - - Name interface{} `json:"name" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyReference unmarshals an instance of LoadBalancerListenerPolicyReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyReferenceDeleted) - if err != nil { - return - } +// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. +func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type RouteCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. +func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -56162,114 +68875,74 @@ func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMe return } -// LoadBalancerListenerPolicyRule : LoadBalancerListenerPolicyRule struct -type LoadBalancerListenerPolicyRule struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The date and time that this rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // The rule's canonical URL. - Href *string `json:"href" validate:"required"` +// RouteCollectionVPCContext : RouteCollectionVPCContext struct +type RouteCollectionVPCContext struct { + // A link to the first page of resources. + First *RouteCollectionVPCContextFirst `json:"first" validate:"required"` - // The rule's unique identifier. - ID *string `json:"id" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The provisioning status of this rule - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RouteCollectionVPCContextNext `json:"next,omitempty"` - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` + // Collection of routes. + Routes []RouteCollectionVPCContextRoutesItem `json:"routes" validate:"required"` - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// Constants associated with the LoadBalancerListenerPolicyRule.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRuleConditionContainsConst = "contains" - LoadBalancerListenerPolicyRuleConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRuleConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRule.ProvisioningStatus property. -// The provisioning status of this rule -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyRuleProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyRuleProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyRuleProvisioningStatusUpdatePendingConst = "update_pending" -) - -// Constants associated with the LoadBalancerListenerPolicyRule.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRuleTypeBodyConst = "body" - LoadBalancerListenerPolicyRuleTypeHeaderConst = "header" - LoadBalancerListenerPolicyRuleTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRuleTypePathConst = "path" - LoadBalancerListenerPolicyRuleTypeQueryConst = "query" -) - -// UnmarshalLoadBalancerListenerPolicyRule unmarshals an instance of LoadBalancerListenerPolicyRule from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRule) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) +// UnmarshalRouteCollectionVPCContext unmarshals an instance of RouteCollectionVPCContext from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionVPCContextFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionVPCContextNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteCollectionVPCContextRoutesItem) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RouteCollectionVPCContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + return start, nil +} + +// RouteCollectionVPCContextFirst : A link to the first page of resources. +type RouteCollectionVPCContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRouteCollectionVPCContextFirst unmarshals an instance of RouteCollectionVPCContextFirst from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -56277,16 +68950,16 @@ func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, resul return } -// LoadBalancerListenerPolicyRuleCollection : LoadBalancerListenerPolicyRuleCollection struct -type LoadBalancerListenerPolicyRuleCollection struct { - // Collection of rules. - Rules []LoadBalancerListenerPolicyRule `json:"rules" validate:"required"` +// RouteCollectionVPCContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type RouteCollectionVPCContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyRuleCollection unmarshals an instance of LoadBalancerListenerPolicyRuleCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRule) +// UnmarshalRouteCollectionVPCContextNext unmarshals an instance of RouteCollectionVPCContextNext from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -56294,208 +68967,162 @@ func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMess return } -// LoadBalancerListenerPolicyRulePatch : LoadBalancerListenerPolicyRulePatch struct -type LoadBalancerListenerPolicyRulePatch struct { - // The condition of the rule. - Condition *string `json:"condition,omitempty"` +// RouteCollectionVPCContextRoutesItem : RouteCollectionVPCContextRoutesItem struct +type RouteCollectionVPCContextRoutesItem struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` - // The type of the rule. + // The priority of this route. Smaller values have higher priority. // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type,omitempty"` + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` - // Value to be matched for rule condition. + // The zone the route applies to. // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value,omitempty"` + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Condition property. -// The condition of the rule. +// Constants associated with the RouteCollectionVPCContextRoutesItem.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - LoadBalancerListenerPolicyRulePatchConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePatchConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePatchConditionMatchesRegexConst = "matches_regex" + RouteCollectionVPCContextRoutesItemActionDelegateConst = "delegate" + RouteCollectionVPCContextRoutesItemActionDelegateVPCConst = "delegate_vpc" + RouteCollectionVPCContextRoutesItemActionDeliverConst = "deliver" + RouteCollectionVPCContextRoutesItemActionDropConst = "drop" ) -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Type property. -// The type of the rule. +// Constants associated with the RouteCollectionVPCContextRoutesItem.LifecycleState property. +// The lifecycle state of the route. +const ( + RouteCollectionVPCContextRoutesItemLifecycleStateDeletingConst = "deleting" + RouteCollectionVPCContextRoutesItemLifecycleStateFailedConst = "failed" + RouteCollectionVPCContextRoutesItemLifecycleStatePendingConst = "pending" + RouteCollectionVPCContextRoutesItemLifecycleStateStableConst = "stable" + RouteCollectionVPCContextRoutesItemLifecycleStateSuspendedConst = "suspended" + RouteCollectionVPCContextRoutesItemLifecycleStateUpdatingConst = "updating" + RouteCollectionVPCContextRoutesItemLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the RouteCollectionVPCContextRoutesItem.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user // -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. const ( - LoadBalancerListenerPolicyRulePatchTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePatchTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePatchTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePatchTypePathConst = "path" - LoadBalancerListenerPolicyRulePatchTypeQueryConst = "query" + RouteCollectionVPCContextRoutesItemOriginServiceConst = "service" + RouteCollectionVPCContextRoutesItemOriginUserConst = "user" ) -// UnmarshalLoadBalancerListenerPolicyRulePatch unmarshals an instance of LoadBalancerListenerPolicyRulePatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePatch) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) +// UnmarshalRouteCollectionVPCContextRoutesItem unmarshals an instance of RouteCollectionVPCContextRoutesItem from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContextRoutesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContextRoutesItem) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyRulePatch -func (loadBalancerListenerPolicyRulePatch *LoadBalancerListenerPolicyRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerListenerPolicyRulePrototype : LoadBalancerListenerPolicyRulePrototype struct -type LoadBalancerListenerPolicyRulePrototype struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRulePrototypeConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePrototypeConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePrototypeConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRulePrototypeTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePrototypeTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePrototypeTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePrototypeTypePathConst = "path" - LoadBalancerListenerPolicyRulePrototypeTypeQueryConst = "query" -) - -// NewLoadBalancerListenerPolicyRulePrototype : Instantiate LoadBalancerListenerPolicyRulePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyRulePrototype(condition string, typeVar string, value string) (_model *LoadBalancerListenerPolicyRulePrototype, err error) { - _model = &LoadBalancerListenerPolicyRulePrototype{ - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerPolicyRulePrototype unmarshals an instance of LoadBalancerListenerPolicyRulePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePrototype) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRuleReference : LoadBalancerListenerPolicyRuleReference struct -type LoadBalancerListenerPolicyRuleReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerPolicyRuleReferenceDeleted `json:"deleted,omitempty"` - - // The rule's canonical URL. - Href *string `json:"href" validate:"required"` - - // The rule's unique identifier. - ID *string `json:"id" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyRuleReference unmarshals an instance of LoadBalancerListenerPolicyRuleReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerPolicyRuleReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -56503,79 +69130,71 @@ func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.R return } -// LoadBalancerListenerPolicyTarget : - If `action` is `forward`, the response is a `LoadBalancerPoolReference` -// - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` -// - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. +// RouteCreator : If present, the resource that created the route. Routes with this property present cannot be directly deleted. All +// routes with an `origin` of `service` will have this property set, and future `origin` values may also have this +// property set. // Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect -type LoadBalancerListenerPolicyTarget struct { +// - RouteCreatorVPNGatewayReference +// - RouteCreatorVPNServerReference +type RouteCreator struct { + // The VPN gateway's CRN. + CRN *string `json:"crn,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` + Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - // The pool's canonical URL. + // The VPN gateway's canonical URL. Href *string `json:"href,omitempty"` - // The unique identifier for this load balancer pool. + // The unique identifier for this VPN gateway. ID *string `json:"id,omitempty"` - // The name for this load balancer pool. The name is unique across all pools for the load balancer. + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. Name *string `json:"name,omitempty"` - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - Listener *LoadBalancerListenerReference `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -func (*LoadBalancerListenerPolicyTarget) isaLoadBalancerListenerPolicyTarget() bool { +// Constants associated with the RouteCreator.ResourceType property. +// The resource type. +const ( + RouteCreatorResourceTypeVPNGatewayConst = "vpn_gateway" +) + +func (*RouteCreator) isaRouteCreator() bool { return true } -type LoadBalancerListenerPolicyTargetIntf interface { - isaLoadBalancerListenerPolicyTarget() bool +type RouteCreatorIntf interface { + isaRouteCreator() bool } -// UnmarshalLoadBalancerListenerPolicyTarget unmarshals an instance of LoadBalancerListenerPolicyTarget from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalRouteCreator unmarshals an instance of RouteCreator from the specified map of raw messages. +func UnmarshalRouteCreator(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCreator) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -56583,67 +69202,73 @@ func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, res return } -// LoadBalancerListenerPolicyTargetPatch : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPatch`. -// +// RouteNextHop : RouteNextHop struct // Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch -type LoadBalancerListenerPolicyTargetPatch struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` +// - RouteNextHopIP +// - RouteNextHopVPNGatewayConnectionReference +type RouteNextHop struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - // The pool's canonical URL. - Href *string `json:"href,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` - // The redirect target URL. - URL *string `json:"url,omitempty"` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + Name *string `json:"name,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -func (*LoadBalancerListenerPolicyTargetPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { +// Constants associated with the RouteNextHop.ResourceType property. +// The resource type. +const ( + RouteNextHopResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) + +func (*RouteNextHop) isaRouteNextHop() bool { return true } -type LoadBalancerListenerPolicyTargetPatchIntf interface { - isaLoadBalancerListenerPolicyTargetPatch() bool +type RouteNextHopIntf interface { + isaRouteNextHop() bool } -// UnmarshalLoadBalancerListenerPolicyTargetPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalRouteNextHop unmarshals an instance of RouteNextHop from the specified map of raw messages. +func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHop) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -56651,46 +69276,44 @@ func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage return } -// LoadBalancerListenerPolicyTargetPrototype : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. +// RouteNextHopPatch : If `action` is `deliver`, the next hop that packets will be delivered to. For other +// `action` values, specify `0.0.0.0` or remove it by specifying `null`. // +// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has +// an `action` of `deliver` and `next_hop` is an IP address. // Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype -type LoadBalancerListenerPolicyTargetPrototype struct { - // The unique identifier for this load balancer pool. +// - RouteNextHopPatchRouteNextHopIP +// - RouteNextHopPatchVPNGatewayConnectionIdentity +type RouteNextHopPatch struct { + // The sentinel IP address (`0.0.0.0`). + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` + + // The unique identifier for this VPN gateway connection. ID *string `json:"id,omitempty"` - // The pool's canonical URL. + // The VPN connection's canonical URL. Href *string `json:"href,omitempty"` - - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` } -func (*LoadBalancerListenerPolicyTargetPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { +func (*RouteNextHopPatch) isaRouteNextHopPatch() bool { return true } -type LoadBalancerListenerPolicyTargetPrototypeIntf interface { - isaLoadBalancerListenerPolicyTargetPrototype() bool +type RouteNextHopPatchIntf interface { + isaRouteNextHopPatch() bool } -// UnmarshalLoadBalancerListenerPolicyTargetPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototype) +// UnmarshalRouteNextHopPatch unmarshals an instance of RouteNextHopPatch from the specified map of raw messages. +func UnmarshalRouteNextHopPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopPatch) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -56699,19 +69322,56 @@ func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoutePatch : RoutePatch struct +type RoutePatch struct { + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + // + // Since all routes in a routing table with the same `destination` and `zone` must have the same `advertise` value, + // this property can only be changed for routes with a unique + // `destination` and `zone` in the routing table. For more information, see [Advertising + // routes](https://cloud.ibm.com/docs/vpc?topic=vpc-about-custom-routes#rt-advertising-routes). + Advertise *bool `json:"advertise,omitempty"` + + // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` + // are reserved for system-provided routes, and are not allowed. + Name *string `json:"name,omitempty"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For other + // `action` values, specify `0.0.0.0` or remove it by specifying `null`. + // + // At most two routes per `zone` in a table can have the same `destination` and `priority`, + // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. + NextHop RouteNextHopPatchIntf `json:"next_hop,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority,omitempty"` +} + +// UnmarshalRoutePatch unmarshals an instance of RoutePatch from the specified map of raw messages. +func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePatch) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHopPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } @@ -56719,249 +69379,118 @@ func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMes return } -// LoadBalancerListenerPrototypeLoadBalancerContext : LoadBalancerListenerPrototypeLoadBalancerContext struct -type LoadBalancerListenerPrototypeLoadBalancerContext struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` +// AsPatch returns a generic map representation of the RoutePatch +func (routePatch *RoutePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(routePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// RoutePrototype : RoutePrototype struct +type RoutePrototype struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` - // The default pool for this listener. If specified, the pool must: - // - Belong to this load balancer. - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener. + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. // - // If unspecified, this listener will be created with no default pool, but one may be - // subsequently set. - DefaultPool *LoadBalancerPoolIdentityByName `json:"default_pool,omitempty"` + // All routes in a routing table with the same `destination` and `zone` must have the same + // `advertise` value. + Advertise *bool `json:"advertise,omitempty"` - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` - - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. + // The destination CIDR of the route. The host identifier in the CIDR must be zero. // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` + // At most two routes per `zone` in a table can have the same `destination` and + // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` + // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` + // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. + // If `action` is `deliver`, the next hop that packets will be delivered to. For other + // `action` values, it must be omitted or specified as `0.0.0.0`. // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` + // At most two routes per `zone` in a table can have the same `destination` and `priority`, + // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. + NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + // The priority of this route. Smaller values have higher priority. // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority,omitempty"` + + // The zone to apply the route to. // - // Additional restrictions: - // - If `default_pool` is set, the pool's protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and - // `https`. - // - If `https_redirect` is set, the protocol must be `http`. - Protocol *string `json:"protocol" validate:"required"` + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// Constants associated with the LoadBalancerListenerPrototypeLoadBalancerContext.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the pool's protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and -// `https`. -// - If `https_redirect` is set, the protocol must be `http`. +// Constants associated with the RoutePrototype.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPConst = "http" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPSConst = "https" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolTCPConst = "tcp" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolUDPConst = "udp" + RoutePrototypeActionDelegateConst = "delegate" + RoutePrototypeActionDelegateVPCConst = "delegate_vpc" + RoutePrototypeActionDeliverConst = "deliver" + RoutePrototypeActionDropConst = "drop" ) -// NewLoadBalancerListenerPrototypeLoadBalancerContext : Instantiate LoadBalancerListenerPrototypeLoadBalancerContext (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol string) (_model *LoadBalancerListenerPrototypeLoadBalancerContext, err error) { - _model = &LoadBalancerListenerPrototypeLoadBalancerContext{ - Protocol: core.StringPtr(protocol), +// NewRoutePrototype : Instantiate RoutePrototype (Generic Model Constructor) +func (*VpcV1) NewRoutePrototype(destination string, zone ZoneIdentityIntf) (_model *RoutePrototype, err error) { + _model = &RoutePrototype{ + Destination: core.StringPtr(destination), + Zone: zone, } err = core.ValidateStruct(_model, "required parameters") return } -// UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext unmarshals an instance of LoadBalancerListenerPrototypeLoadBalancerContext from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPrototypeLoadBalancerContext) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentityByName) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerReference : LoadBalancerListenerReference struct -type LoadBalancerListenerReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerReferenceDeleted `json:"deleted,omitempty"` - - // The listener's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer listener. - ID *string `json:"id" validate:"required"` -} - -// UnmarshalLoadBalancerListenerReference unmarshals an instance of LoadBalancerListenerReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerReferenceDeleted) +// UnmarshalRoutePrototype unmarshals an instance of RoutePrototype from the specified map of raw messages. +func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerListenerReferenceDeleted unmarshals an instance of LoadBalancerListenerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLogging : LoadBalancerLogging struct -type LoadBalancerLogging struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapath `json:"datapath" validate:"required"` -} - -// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages. -func UnmarshalLoadBalancerLogging(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLogging) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapath) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRoutePrototypeNextHop) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingDatapath : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapath struct { - // Indicates whether datapath logging is active for this load balancer. - Active *bool `json:"active" validate:"required"` -} - -// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapath) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingDatapathPatch : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapathPatch struct { - // Indicates whether datapath logging will be active for this load balancer. - Active *bool `json:"active,omitempty"` -} - -// UnmarshalLoadBalancerLoggingDatapathPatch unmarshals an instance of LoadBalancerLoggingDatapathPatch from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapathPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapathPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -56969,50 +69498,49 @@ func UnmarshalLoadBalancerLoggingDatapathPatch(m map[string]json.RawMessage, res return } -// LoadBalancerLoggingDatapathPrototype : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapathPrototype struct { - // Indicates whether datapath logging will be active for this load balancer. - Active *bool `json:"active,omitempty"` -} +// RoutePrototypeNextHop : If `action` is `deliver`, the next hop that packets will be delivered to. For other +// `action` values, it must be omitted or specified as `0.0.0.0`. +// +// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has +// an `action` of `deliver` and `next_hop` is an IP address. +// Models which "extend" this model: +// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP +// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity +type RoutePrototypeNextHop struct { + // The sentinel IP address (`0.0.0.0`). + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` -// UnmarshalLoadBalancerLoggingDatapathPrototype unmarshals an instance of LoadBalancerLoggingDatapathPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapathPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapathPrototype) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` -// LoadBalancerLoggingPatch : LoadBalancerLoggingPatch struct -type LoadBalancerLoggingPatch struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapathPatch `json:"datapath,omitempty"` + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` } -// UnmarshalLoadBalancerLoggingPatch unmarshals an instance of LoadBalancerLoggingPatch from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingPatch) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +func (*RoutePrototypeNextHop) isaRoutePrototypeNextHop() bool { + return true } -// LoadBalancerLoggingPrototype : LoadBalancerLoggingPrototype struct -type LoadBalancerLoggingPrototype struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"` +type RoutePrototypeNextHopIntf interface { + isaRoutePrototypeNextHop() bool } -// UnmarshalLoadBalancerLoggingPrototype unmarshals an instance of LoadBalancerLoggingPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingPrototype) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPrototype) +// UnmarshalRoutePrototypeNextHop unmarshals an instance of RoutePrototypeNextHop from the specified map of raw messages. +func UnmarshalRoutePrototypeNextHop(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePrototypeNextHop) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -57020,49 +69548,38 @@ func UnmarshalLoadBalancerLoggingPrototype(m map[string]json.RawMessage, result return } -// LoadBalancerPatch : LoadBalancerPatch struct -type LoadBalancerPatch struct { - // The DNS configuration for this load balancer. - // - // Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` - // records for this load balancer that had been added to `zone`, and add equivalent `A` - // records to the public DNS zone `lb.appdomain.cloud`. - Dns *LoadBalancerDnsPatch `json:"dns,omitempty"` +// RouteReference : RouteReference struct +type RouteReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *RouteReferenceDeleted `json:"deleted,omitempty"` - // The logging configuration to use for this load balancer. - // - // To activate logging, the load balancer profile must support the specified logging type. - Logging *LoadBalancerLoggingPatch `json:"logging,omitempty"` + // The URL for this route. + Href *string `json:"href" validate:"required"` - // The name for this load balancer. The name must not be used by another load balancer in the VPC. - Name *string `json:"name,omitempty"` + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` - // The subnets to provision this load balancer in. The load balancer's availability will depend on the availability of - // the zones that the subnets reside in. - // - // The specified subnets must be in the same VPC as the existing subnets, and will completely replace the existing - // subnets. - // - // The load balancer must be in the `application` family. - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` } -// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPatch) - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDnsPatch) +// UnmarshalRouteReference unmarshals an instance of RouteReference from the specified map of raw messages. +func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRouteReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLoggingPatch) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -57070,133 +69587,146 @@ func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{} return } -// AsPatch returns a generic map representation of the LoadBalancerPatch -func (loadBalancerPatch *LoadBalancerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// RouteReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type RouteReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalRouteReferenceDeleted unmarshals an instance of RouteReferenceDeleted from the specified map of raw messages. +func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerPool : LoadBalancerPool struct -type LoadBalancerPool struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` +// RoutingTable : RoutingTable struct +type RoutingTable struct { + // The filters specifying the resources that may create routes in this routing table. + // + // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter + // support is expected to expand in the future. + AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - // The date and time that this pool was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these + // sources. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + AdvertiseRoutesTo []string `json:"advertise_routes_to" validate:"required"` - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitor `json:"health_monitor" validate:"required"` + // The date and time that this routing table was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The pool's canonical URL. + // The URL for this routing table. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer pool. + // The unique identifier for this routing table. ID *string `json:"id" validate:"required"` - // The instance group that is managing this pool. - InstanceGroup *InstanceGroupReference `json:"instance_group,omitempty"` + // Indicates whether this is the default routing table for this VPC. + IsDefault *bool `json:"is_default" validate:"required"` - // The backend server members of the pool. - Members []LoadBalancerPoolMemberReference `json:"members,omitempty"` + // The lifecycle state of the routing table. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The name for this load balancer pool. The name is unique across all pools for the load balancer. + // The name for this routing table. The name is unique across all routing tables for the VPC. Name *string `json:"name" validate:"required"` - // The protocol for this load balancer pool. + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol" validate:"required"` + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` - // The provisioning status of this pool + // Indicates whether this routing table is used to route traffic that originates from the internet. // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // Incoming traffic will be routed according to the routing table with two exceptions: + // - Traffic destined for IP addresses associated with public gateways will not be + // subject to routes in this routing table. + // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is + // an IP address in a subnet in the route's `zone` that is able to accept traffic. + // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled + // Indicates whether this routing table is used to route traffic that originates from from [Transit + // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol" validate:"required"` + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` - // The session persistence of this pool. + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. // - // The enumerated values for this property are expected to expand in the future. When - // processing this property, check for and log unknown values. Optionally halt - // processing and surface the error, or bypass the pool on which the unexpected - // property value was encountered. - SessionPersistence *LoadBalancerPoolSessionPersistence `json:"session_persistence,omitempty"` -} + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` -// Constants associated with the LoadBalancerPool.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) + // The routes for this routing table. + Routes []RouteReference `json:"routes" validate:"required"` -// Constants associated with the LoadBalancerPool.Protocol property. -// The protocol for this load balancer pool. + // The subnets to which this routing table is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` +} + +// Constants associated with the RoutingTable.AdvertiseRoutesTo property. +// An ingress source that routes can be advertised to: // -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. +// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) +// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). const ( - LoadBalancerPoolProtocolHTTPConst = "http" - LoadBalancerPoolProtocolHTTPSConst = "https" - LoadBalancerPoolProtocolTCPConst = "tcp" - LoadBalancerPoolProtocolUDPConst = "udp" + RoutingTableAdvertiseRoutesToDirectLinkConst = "direct_link" + RoutingTableAdvertiseRoutesToTransitGatewayConst = "transit_gateway" ) -// Constants associated with the LoadBalancerPool.ProvisioningStatus property. -// The provisioning status of this pool -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. +// Constants associated with the RoutingTable.LifecycleState property. +// The lifecycle state of the routing table. const ( - LoadBalancerPoolProvisioningStatusActiveConst = "active" - LoadBalancerPoolProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolProvisioningStatusFailedConst = "failed" - LoadBalancerPoolProvisioningStatusUpdatePendingConst = "update_pending" + RoutingTableLifecycleStateDeletingConst = "deleting" + RoutingTableLifecycleStateFailedConst = "failed" + RoutingTableLifecycleStatePendingConst = "pending" + RoutingTableLifecycleStateStableConst = "stable" + RoutingTableLifecycleStateSuspendedConst = "suspended" + RoutingTableLifecycleStateUpdatingConst = "updating" + RoutingTableLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the LoadBalancerPool.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). +// Constants associated with the RoutingTable.ResourceType property. +// The resource type. const ( - LoadBalancerPoolProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolProxyProtocolV1Const = "v1" - LoadBalancerPoolProxyProtocolV2Const = "v2" + RoutingTableResourceTypeRoutingTableConst = "routing_table" ) -// UnmarshalLoadBalancerPool unmarshals an instance of LoadBalancerPool from the specified map of raw messages. -func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPool) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) +// UnmarshalRoutingTable unmarshals an instance of RoutingTable from the specified map of raw messages. +func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTable) + err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) if err != nil { return } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitor) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -57208,11 +69738,11 @@ func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) if err != nil { return } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberReference) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -57220,36 +69750,31 @@ func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) if err != nil { return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistence) + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolCollection : LoadBalancerPoolCollection struct -type LoadBalancerPoolCollection struct { - // Collection of pools. - Pools []LoadBalancerPool `json:"pools" validate:"required"` -} - -// UnmarshalLoadBalancerPoolCollection unmarshals an instance of LoadBalancerPoolCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolCollection) - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPool) + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) if err != nil { return } @@ -57257,71 +69782,74 @@ func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result in return } -// LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct -type LoadBalancerPoolHealthMonitor struct { - // The seconds to wait between health checks. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` +// RoutingTableCollection : RoutingTableCollection struct +type RoutingTableCollection struct { + // A link to the first page of resources. + First *RoutingTableCollectionFirst `json:"first" validate:"required"` - // The health check port. - // - // If present, this overrides the pool member port values. - Port *int64 `json:"port,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The seconds to wait for a response to a health check. - Timeout *int64 `json:"timeout" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RoutingTableCollectionNext `json:"next,omitempty"` - // The protocol type to use for health checks. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which - // the unexpected property value was encountered. - Type *string `json:"type" validate:"required"` + // Collection of routing tables. + RoutingTables []RoutingTable `json:"routing_tables" validate:"required"` - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// Constants associated with the LoadBalancerPoolHealthMonitor.Type property. -// The protocol type to use for health checks. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which -// the unexpected property value was encountered. -const ( - LoadBalancerPoolHealthMonitorTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorTypeTCPConst = "tcp" -) - -// UnmarshalLoadBalancerPoolHealthMonitor unmarshals an instance of LoadBalancerPoolHealthMonitor from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitor) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) +// UnmarshalRoutingTableCollection unmarshals an instance of RoutingTableCollection from the specified map of raw messages. +func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRoutingTableCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRoutingTableCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalModel(m, "routing_tables", &obj.RoutingTables, UnmarshalRoutingTable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoutingTableCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// RoutingTableCollectionFirst : A link to the first page of resources. +type RoutingTableCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRoutingTableCollectionFirst unmarshals an instance of RoutingTableCollectionFirst from the specified map of raw messages. +func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -57329,77 +69857,168 @@ func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result return } -// LoadBalancerPoolHealthMonitorPatch : LoadBalancerPoolHealthMonitorPatch struct -type LoadBalancerPoolHealthMonitorPatch struct { - // The seconds to wait between health checks. Must be greater than `timeout`. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` +// RoutingTableCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type RoutingTableCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The health check port. - // - // If set, this overrides the pool member port values. - // - // Specify `null` to remove an existing health check port. - Port *int64 `json:"port,omitempty"` +// UnmarshalRoutingTableCollectionNext unmarshals an instance of RoutingTableCollectionNext from the specified map of raw messages. +func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The seconds to wait for a response to a health check. Must be less than `delay`. - Timeout *int64 `json:"timeout" validate:"required"` +// RoutingTableIdentity : Identifies a routing table by a unique property. +// Models which "extend" this model: +// - RoutingTableIdentityByID +// - RoutingTableIdentityByHref +type RoutingTableIdentity struct { + // The unique identifier for this routing table. + ID *string `json:"id,omitempty"` - // The protocol type to use for health checks. - Type *string `json:"type" validate:"required"` + // The URL for this routing table. + Href *string `json:"href,omitempty"` +} - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` +func (*RoutingTableIdentity) isaRoutingTableIdentity() bool { + return true } -// Constants associated with the LoadBalancerPoolHealthMonitorPatch.Type property. -// The protocol type to use for health checks. -const ( - LoadBalancerPoolHealthMonitorPatchTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPatchTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPatchTypeTCPConst = "tcp" -) +type RoutingTableIdentityIntf interface { + isaRoutingTableIdentity() bool +} -// NewLoadBalancerPoolHealthMonitorPatch : Instantiate LoadBalancerPoolHealthMonitorPatch (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPatch(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPatch, err error) { - _model = &LoadBalancerPoolHealthMonitorPatch{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), +// UnmarshalRoutingTableIdentity unmarshals an instance of RoutingTableIdentity from the specified map of raw messages. +func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// UnmarshalLoadBalancerPoolHealthMonitorPatch unmarshals an instance of LoadBalancerPoolHealthMonitorPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPatch) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) +// RoutingTablePatch : RoutingTablePatch struct +type RoutingTablePatch struct { + // The filters specifying the resources that may create routes in this routing table + // (replacing any existing filters). All routes created by resources that match a given filter will be removed when an + // existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all + // routes not directly created by the user being removed. + // + // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter + // support is expected to expand in the future. + AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` + + // The ingress sources to advertise routes to, replacing any existing sources to advertise to. Routes in the table with + // `advertise` enabled will be advertised to these sources. + AdvertiseRoutesTo []string `json:"advertise_routes_to,omitempty"` + + // The name for this routing table. The name must not be used by another routing table in the VPC. + Name *string `json:"name,omitempty"` + + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` selects this routing table, provided + // no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this + // routing table. Updating to + // `false` deselects this routing table, provided `direct_link` is absent from + // `advertise_routes_to`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` + + // Indicates whether this routing table is used to route traffic that originates from the internet. Updating to `true` + // selects this routing table, provided no other routing table in the VPC already has this property set to `true`. + // Updating to `false` deselects this routing table. + // + // Incoming traffic will be routed according to the routing table with two exceptions: + // - Traffic destined for IP addresses associated with public gateways will not be subject + // to routes in this routing table. + // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an + // IP address in a subnet in the route's `zone` that is able to accept traffic. + // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` + + // Indicates whether this routing table is used to route traffic that originates from + // [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. Updating to + // `true` selects this routing table, provided no other routing table in the VPC already has this property set to + // `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table, + // provided `transit_gateway` is absent from `advertise_routes_to`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + // + // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled + // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing + // table. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` + + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this + // property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this + // routing table. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is + // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` +} + +// Constants associated with the RoutingTablePatch.AdvertiseRoutesTo property. +// An ingress source that routes can be advertised to: +// +// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) +// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). +const ( + RoutingTablePatchAdvertiseRoutesToDirectLinkConst = "direct_link" + RoutingTablePatchAdvertiseRoutesToTransitGatewayConst = "transit_gateway" +) + +// UnmarshalRoutingTablePatch unmarshals an instance of RoutingTablePatch from the specified map of raw messages. +func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTablePatch) + err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) if err != nil { return } @@ -57407,110 +70026,61 @@ func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, r return } -// LoadBalancerPoolHealthMonitorPrototype : LoadBalancerPoolHealthMonitorPrototype struct -type LoadBalancerPoolHealthMonitorPrototype struct { - // The seconds to wait between health checks. Must be greater than `timeout`. - Delay *int64 `json:"delay" validate:"required"` +// AsPatch returns a generic map representation of the RoutingTablePatch +func (routingTablePatch *RoutingTablePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(routingTablePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` +// RoutingTableReference : RoutingTableReference struct +type RoutingTableReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *RoutingTableReferenceDeleted `json:"deleted,omitempty"` - // The health check port. - // - // If specified, this overrides the pool member port values. - Port *int64 `json:"port,omitempty"` + // The URL for this routing table. + Href *string `json:"href" validate:"required"` - // The seconds to wait for a response to a health check. Must be less than `delay`. - Timeout *int64 `json:"timeout" validate:"required"` + // The unique identifier for this routing table. + ID *string `json:"id" validate:"required"` - // The protocol type to use for health checks. - Type *string `json:"type" validate:"required"` + // The name for this routing table. The name is unique across all routing tables for the VPC. + Name *string `json:"name" validate:"required"` - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the LoadBalancerPoolHealthMonitorPrototype.Type property. -// The protocol type to use for health checks. +// Constants associated with the RoutingTableReference.ResourceType property. +// The resource type. const ( - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPrototypeTypeTCPConst = "tcp" + RoutingTableReferenceResourceTypeRoutingTableConst = "routing_table" ) -// NewLoadBalancerPoolHealthMonitorPrototype : Instantiate LoadBalancerPoolHealthMonitorPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPrototype(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPrototype, err error) { - _model = &LoadBalancerPoolHealthMonitorPrototype{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolHealthMonitorPrototype unmarshals an instance of LoadBalancerPoolHealthMonitorPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPrototype) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) +// UnmarshalRoutingTableReference unmarshals an instance of RoutingTableReference from the specified map of raw messages. +func UnmarshalRoutingTableReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRoutingTableReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerPoolIdentityByID -// - LoadBalancerPoolIdentityByHref -type LoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerPoolIdentity) isaLoadBalancerPoolIdentity() bool { - return true -} - -type LoadBalancerPoolIdentityIntf interface { - isaLoadBalancerPoolIdentity() bool -} - -// UnmarshalLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -57518,25 +70088,17 @@ func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result inte return } -// LoadBalancerPoolIdentityByName : LoadBalancerPoolIdentityByName struct -type LoadBalancerPoolIdentityByName struct { - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` -} - -// NewLoadBalancerPoolIdentityByName : Instantiate LoadBalancerPoolIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByName(name string) (_model *LoadBalancerPoolIdentityByName, err error) { - _model = &LoadBalancerPoolIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return +// RoutingTableReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type RoutingTableReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerPoolIdentityByName unmarshals an instance of LoadBalancerPoolIdentityByName from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalRoutingTableReferenceDeleted unmarshals an instance of RoutingTableReferenceDeleted from the specified map of raw messages. +func UnmarshalRoutingTableReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -57544,76 +70106,44 @@ func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, resul return } -// LoadBalancerPoolMember : LoadBalancerPoolMember struct -type LoadBalancerPoolMember struct { - // The date and time that this member was created. +// SecurityGroup : SecurityGroup struct +type SecurityGroup struct { + // The date and time that this security group was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Health of the server member in the pool. - Health *string `json:"health" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` - // The member's canonical URL. + // The security group's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer pool member. + // The unique identifier for this security group. ID *string `json:"id" validate:"required"` - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - Port *int64 `json:"port" validate:"required"` - - // The provisioning status of this member - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // The name for this security group. The name is unique across all security groups for the VPC. + Name *string `json:"name" validate:"required"` - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetIntf `json:"target" validate:"required"` + // The resource group for this security group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} + // The rules for this security group. If no rules exist, all traffic will be denied. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` -// Constants associated with the LoadBalancerPoolMember.Health property. -// Health of the server member in the pool. -const ( - LoadBalancerPoolMemberHealthFaultedConst = "faulted" - LoadBalancerPoolMemberHealthOkConst = "ok" - LoadBalancerPoolMemberHealthUnknownConst = "unknown" -) + // The targets for this security group. + Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` -// Constants associated with the LoadBalancerPoolMember.ProvisioningStatus property. -// The provisioning status of this member -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolMemberProvisioningStatusActiveConst = "active" - LoadBalancerPoolMemberProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolMemberProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolMemberProvisioningStatusFailedConst = "failed" - LoadBalancerPoolMemberProvisioningStatusUpdatePendingConst = "update_pending" -) + // The VPC this security group resides in. + VPC *VPCReference `json:"vpc" validate:"required"` +} -// UnmarshalLoadBalancerPoolMember unmarshals an instance of LoadBalancerPoolMember from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMember) +// UnmarshalSecurityGroup unmarshals an instance of SecurityGroup from the specified map of raw messages. +func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroup) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health", &obj.Health) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -57625,36 +70155,23 @@ func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTarget) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) if err != nil { return } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberCollection : LoadBalancerPoolMemberCollection struct -type LoadBalancerPoolMemberCollection struct { - // Collection of members. - Members []LoadBalancerPoolMember `json:"members" validate:"required"` -} - -// UnmarshalLoadBalancerPoolMemberCollection unmarshals an instance of LoadBalancerPoolMemberCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberCollection) - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -57662,41 +70179,45 @@ func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, res return } -// LoadBalancerPoolMemberPatch : LoadBalancerPoolMemberPatch struct -type LoadBalancerPoolMemberPatch struct { - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port,omitempty"` +// SecurityGroupCollection : SecurityGroupCollection struct +type SecurityGroupCollection struct { + // A link to the first page of resources. + First *SecurityGroupCollectionFirst `json:"first" validate:"required"` - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *SecurityGroupCollectionNext `json:"next,omitempty"` + + // Collection of security groups. + SecurityGroups []SecurityGroup `json:"security_groups" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerPoolMemberPatch unmarshals an instance of LoadBalancerPoolMemberPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPatch) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) +// UnmarshalSecurityGroupCollection unmarshals an instance of SecurityGroupCollection from the specified map of raw messages. +func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -57704,61 +70225,45 @@ func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result i return } -// AsPatch returns a generic map representation of the LoadBalancerPoolMemberPatch -func (loadBalancerPoolMemberPatch *LoadBalancerPoolMemberPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolMemberPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// Retrieve the value to be passed to a request to access the next page of results +func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } - return + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// LoadBalancerPoolMemberPrototype : LoadBalancerPoolMemberPrototype struct -type LoadBalancerPoolMemberPrototype struct { - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` +// SecurityGroupCollectionFirst : A link to the first page of resources. +type SecurityGroupCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewLoadBalancerPoolMemberPrototype : Instantiate LoadBalancerPoolMemberPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberPrototype(port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) (_model *LoadBalancerPoolMemberPrototype, err error) { - _model = &LoadBalancerPoolMemberPrototype{ - Port: core.Int64Ptr(port), - Target: target, +// UnmarshalSecurityGroupCollectionFirst unmarshals an instance of SecurityGroupCollectionFirst from the specified map of raw messages. +func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// UnmarshalLoadBalancerPoolMemberPrototype unmarshals an instance of LoadBalancerPoolMemberPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPrototype) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) +// SecurityGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SecurityGroupCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalSecurityGroupCollectionNext unmarshals an instance of SecurityGroupCollectionNext from the specified map of raw messages. +func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -57766,31 +70271,42 @@ func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, resu return } -// LoadBalancerPoolMemberReference : LoadBalancerPoolMemberReference struct -type LoadBalancerPoolMemberReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolMemberReferenceDeleted `json:"deleted,omitempty"` +// SecurityGroupIdentity : Identifies a security group by a unique property. +// Models which "extend" this model: +// - SecurityGroupIdentityByID +// - SecurityGroupIdentityByCRN +// - SecurityGroupIdentityByHref +type SecurityGroupIdentity struct { + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The member's canonical URL. - Href *string `json:"href" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - // The unique identifier for this load balancer pool member. - ID *string `json:"id" validate:"required"` + // The security group's canonical URL. + Href *string `json:"href,omitempty"` } -// UnmarshalLoadBalancerPoolMemberReference unmarshals an instance of LoadBalancerPoolMemberReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolMemberReferenceDeleted) +func (*SecurityGroupIdentity) isaSecurityGroupIdentity() bool { + return true +} + +type SecurityGroupIdentityIntf interface { + isaSecurityGroupIdentity() bool +} + +// UnmarshalSecurityGroupIdentity unmarshals an instance of SecurityGroupIdentity from the specified map of raw messages. +func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -57798,17 +70314,16 @@ func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, resu return } -// LoadBalancerPoolMemberReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerPoolMemberReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SecurityGroupPatch : SecurityGroupPatch struct +type SecurityGroupPatch struct { + // The name for this security group. The name must not be used by another security group for the VPC. + Name *string `json:"name,omitempty"` } -// UnmarshalLoadBalancerPoolMemberReferenceDeleted unmarshals an instance of LoadBalancerPoolMemberReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalSecurityGroupPatch unmarshals an instance of SecurityGroupPatch from the specified map of raw messages. +func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -57816,53 +70331,43 @@ func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessag return } -// LoadBalancerPoolMemberTarget : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a -// zone the load balancer has a subnet in. -// Models which "extend" this model: -// - LoadBalancerPoolMemberTargetInstanceReference -// - LoadBalancerPoolMemberTargetIP -type LoadBalancerPoolMemberTarget struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` +// AsPatch returns a generic map representation of the SecurityGroupPatch +func (securityGroupPatch *SecurityGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(securityGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// SecurityGroupReference : SecurityGroupReference struct +type SecurityGroupReference struct { + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name,omitempty"` + Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` -func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { - return true -} + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` -type LoadBalancerPoolMemberTargetIntf interface { - isaLoadBalancerPoolMemberTarget() bool + // The name for this security group. The name is unique across all security groups for the VPC. + Name *string `json:"name" validate:"required"` } -// UnmarshalLoadBalancerPoolMemberTarget unmarshals an instance of LoadBalancerPoolMemberTarget from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTarget) +// UnmarshalSecurityGroupReference unmarshals an instance of SecurityGroupReference from the specified map of raw messages. +func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) if err != nil { return } @@ -57878,7 +70383,21 @@ func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type SecurityGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalSecurityGroupReferenceDeleted unmarshals an instance of SecurityGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -57886,54 +70405,116 @@ func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result return } -// LoadBalancerPoolMemberTargetPrototype : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a -// zone the load balancer has a subnet in. +// SecurityGroupRule : SecurityGroupRule struct // Models which "extend" this model: -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -// - LoadBalancerPoolMemberTargetPrototypeIP -type LoadBalancerPoolMemberTargetPrototype struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` +// - SecurityGroupRuleSecurityGroupRuleProtocolAll +// - SecurityGroupRuleSecurityGroupRuleProtocolIcmp +// - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp +type SecurityGroupRule struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The remote IP addresses or security groups from which this rule allows traffic (or to + // which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source + // (or to any destination, for outbound rules). + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The ICMP traffic code to allow. If absent, all codes are allowed. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. If absent, all types are allowed. + Type *int64 `json:"type,omitempty"` + + // The inclusive upper bound of TCP/UDP destination port range. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + PortMin *int64 `json:"port_min,omitempty"` } -func (*LoadBalancerPoolMemberTargetPrototype) isaLoadBalancerPoolMemberTargetPrototype() bool { +// Constants associated with the SecurityGroupRule.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRuleDirectionInboundConst = "inbound" + SecurityGroupRuleDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRule.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRuleIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRule.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRuleProtocolAllConst = "all" + SecurityGroupRuleProtocolIcmpConst = "icmp" + SecurityGroupRuleProtocolTCPConst = "tcp" + SecurityGroupRuleProtocolUDPConst = "udp" +) + +func (*SecurityGroupRule) isaSecurityGroupRule() bool { return true } -type LoadBalancerPoolMemberTargetPrototypeIntf interface { - isaLoadBalancerPoolMemberTargetPrototype() bool +type SecurityGroupRuleIntf interface { + isaSecurityGroupRule() bool } -// UnmarshalLoadBalancerPoolMemberTargetPrototype unmarshals an instance of LoadBalancerPoolMemberTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSecurityGroupRule unmarshals an instance of SecurityGroupRule from the specified map of raw messages. +func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + return +} + +// SecurityGroupRuleCollection : Collection of rules in a security group. +type SecurityGroupRuleCollection struct { + // Array of rules. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +} + +// UnmarshalSecurityGroupRuleCollection unmarshals an instance of SecurityGroupRuleCollection from the specified map of raw messages. +func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleCollection) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) if err != nil { return } @@ -57941,100 +70522,88 @@ func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage return } -// LoadBalancerPoolPatch : LoadBalancerPoolPatch struct -type LoadBalancerPoolPatch struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm,omitempty"` +// SecurityGroupRulePatch : SecurityGroupRulePatch struct +type SecurityGroupRulePatch struct { + // The ICMP traffic code to allow. If set, `type` must also be set. + // + // Specify `null` to remove an existing ICMP traffic code. + Code *int64 `json:"code,omitempty"` - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPatch `json:"health_monitor,omitempty"` + // The direction of traffic to enforce. + Direction *string `json:"direction,omitempty"` - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. - Name *string `json:"name,omitempty"` + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` - // The protocol for this load balancer pool. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. + // The inclusive upper bound of the protocol destination port range. If set, `port_min` must also be set, and must not + // be larger. // - // If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and `https`. - Protocol *string `json:"protocol,omitempty"` + // Specify `null` to remove an existing upper bound. + PortMax *int64 `json:"port_max,omitempty"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled + // The inclusive lower bound of the protocol destination port range. If set, `port_max` must also be set, and must not + // be smaller. // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` + // Specify `null` to remove an existing lower bound. + PortMin *int64 `json:"port_min,omitempty"` - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePatch `json:"session_persistence,omitempty"` -} + // The remote IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to + // any destination, for outbound rules). + Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` -// Constants associated with the LoadBalancerPoolPatch.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolPatchAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPatchAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPatchAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) + // The ICMP traffic type to allow. + // + // Specify `null` to remove an existing ICMP traffic type value. + Type *int64 `json:"type,omitempty"` +} -// Constants associated with the LoadBalancerPoolPatch.Protocol property. -// The protocol for this load balancer pool. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and `https`. +// Constants associated with the SecurityGroupRulePatch.Direction property. +// The direction of traffic to enforce. const ( - LoadBalancerPoolPatchProtocolHTTPConst = "http" - LoadBalancerPoolPatchProtocolHTTPSConst = "https" - LoadBalancerPoolPatchProtocolTCPConst = "tcp" - LoadBalancerPoolPatchProtocolUDPConst = "udp" + SecurityGroupRulePatchDirectionInboundConst = "inbound" + SecurityGroupRulePatchDirectionOutboundConst = "outbound" ) -// Constants associated with the LoadBalancerPoolPatch.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). +// Constants associated with the SecurityGroupRulePatch.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. const ( - LoadBalancerPoolPatchProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPatchProxyProtocolV1Const = "v1" - LoadBalancerPoolPatchProxyProtocolV2Const = "v2" + SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" ) -// UnmarshalLoadBalancerPoolPatch unmarshals an instance of LoadBalancerPoolPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPatch) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) +// UnmarshalSecurityGroupRulePatch unmarshals an instance of SecurityGroupRulePatch from the specified map of raw messages. +func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePatch) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPatch) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) if err != nil { return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePatch) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -58042,291 +70611,196 @@ func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interfa return } -// AsPatch returns a generic map representation of the LoadBalancerPoolPatch -func (loadBalancerPoolPatch *LoadBalancerPoolPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the SecurityGroupRulePatch +func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolPatch) + jsonData, err = json.Marshal(securityGroupRulePatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// LoadBalancerPoolPrototype : LoadBalancerPoolPrototype struct -type LoadBalancerPoolPrototype struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` +// SecurityGroupRulePrototype : SecurityGroupRulePrototype struct +// Models which "extend" this model: +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp +type SecurityGroupRulePrototype struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The remote IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group within the VPC. + // + // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + // (or to any destination, for outbound rules). + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - // `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http`, and `https`. - Protocol *string `json:"protocol" validate:"required"` + // The ICMP traffic code to allow. + // + // If specified, `type` must also be specified. If unspecified, all codes are allowed. + Code *int64 `json:"code,omitempty"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled + // The ICMP traffic type to allow. // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` + // If unspecified, all types are allowed. + Type *int64 `json:"type,omitempty"` - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` + // The inclusive upper bound of TCP/UDP destination port range. + // + // If specified, `port_min` must also be specified, and must not be larger. If unspecified, + // `port_min` must also be unspecified, allowing traffic on all destination ports. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range + // + // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be + // unspecified, allowing traffic on all destination ports. + PortMin *int64 `json:"port_min,omitempty"` } -// Constants associated with the LoadBalancerPoolPrototype.Algorithm property. -// The load balancing algorithm. +// Constants associated with the SecurityGroupRulePrototype.Direction property. +// The direction of traffic to enforce. const ( - LoadBalancerPoolPrototypeAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPrototypeAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPrototypeAlgorithmWeightedRoundRobinConst = "weighted_round_robin" + SecurityGroupRulePrototypeDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeDirectionOutboundConst = "outbound" ) -// Constants associated with the LoadBalancerPoolPrototype.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if -// `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http`, and `https`. +// Constants associated with the SecurityGroupRulePrototype.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. const ( - LoadBalancerPoolPrototypeProtocolHTTPConst = "http" - LoadBalancerPoolPrototypeProtocolHTTPSConst = "https" - LoadBalancerPoolPrototypeProtocolTCPConst = "tcp" - LoadBalancerPoolPrototypeProtocolUDPConst = "udp" + SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" ) -// Constants associated with the LoadBalancerPoolPrototype.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). +// Constants associated with the SecurityGroupRulePrototype.Protocol property. +// The protocol to enforce. const ( - LoadBalancerPoolPrototypeProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPrototypeProxyProtocolV1Const = "v1" - LoadBalancerPoolPrototypeProxyProtocolV2Const = "v2" + SecurityGroupRulePrototypeProtocolAllConst = "all" + SecurityGroupRulePrototypeProtocolIcmpConst = "icmp" + SecurityGroupRulePrototypeProtocolTCPConst = "tcp" + SecurityGroupRulePrototypeProtocolUDPConst = "udp" ) -// NewLoadBalancerPoolPrototype : Instantiate LoadBalancerPoolPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolPrototype(algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) (_model *LoadBalancerPoolPrototype, err error) { - _model = &LoadBalancerPoolPrototype{ - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { + return true } -// UnmarshalLoadBalancerPoolPrototype unmarshals an instance of LoadBalancerPoolPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPrototype) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) +type SecurityGroupRulePrototypeIntf interface { + isaSecurityGroupRulePrototype() bool +} + +// UnmarshalSecurityGroupRulePrototype unmarshals an instance of SecurityGroupRulePrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePrototype) - if err != nil { - return + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerPoolReference : LoadBalancerPoolReference struct -type LoadBalancerPoolReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` +// SecurityGroupRuleRemote : The remote IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). A +// CIDR block of `0.0.0.0/0` allows traffic from any source +// (or to any destination, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemoteIP +// - SecurityGroupRuleRemoteCIDR +// - SecurityGroupRuleRemoteSecurityGroupReference +type SecurityGroupRuleRemote struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` -} + // The security group's CRN. + CRN *string `json:"crn,omitempty"` -// UnmarshalLoadBalancerPoolReference unmarshals an instance of LoadBalancerPoolReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` -// LoadBalancerPoolReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerPoolReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} + // The security group's canonical URL. + Href *string `json:"href,omitempty"` -// UnmarshalLoadBalancerPoolReferenceDeleted unmarshals an instance of LoadBalancerPoolReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` -// LoadBalancerPoolSessionPersistence : LoadBalancerPoolSessionPersistence struct -type LoadBalancerPoolSessionPersistence struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` + // The name for this security group. The name is unique across all security groups for the VPC. + Name *string `json:"name,omitempty"` +} - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` +func (*SecurityGroupRuleRemote) isaSecurityGroupRuleRemote() bool { + return true } -// Constants associated with the LoadBalancerPoolSessionPersistence.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistenceTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistenceTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistenceTypeSourceIPConst = "source_ip" -) +type SecurityGroupRuleRemoteIntf interface { + isaSecurityGroupRuleRemote() bool +} -// UnmarshalLoadBalancerPoolSessionPersistence unmarshals an instance of LoadBalancerPoolSessionPersistence from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistence) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) +// UnmarshalSecurityGroupRuleRemote unmarshals an instance of SecurityGroupRuleRemote from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemote) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolSessionPersistencePatch : The session persistence configuration. Specify `null` to remove any existing session persistence configuration. -type LoadBalancerPoolSessionPersistencePatch struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the LoadBalancerPoolSessionPersistencePatch.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistencePatchTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePatchTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePatchTypeSourceIPConst = "source_ip" -) - -// UnmarshalLoadBalancerPoolSessionPersistencePatch unmarshals an instance of LoadBalancerPoolSessionPersistencePatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePatch) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolSessionPersistencePrototype : LoadBalancerPoolSessionPersistencePrototype struct -type LoadBalancerPoolSessionPersistencePrototype struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerPoolSessionPersistencePrototype.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistencePrototypeTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeSourceIPConst = "source_ip" -) - -// NewLoadBalancerPoolSessionPersistencePrototype : Instantiate LoadBalancerPoolSessionPersistencePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolSessionPersistencePrototype(typeVar string) (_model *LoadBalancerPoolSessionPersistencePrototype, err error) { - _model = &LoadBalancerPoolSessionPersistencePrototype{ - Type: core.StringPtr(typeVar), + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolSessionPersistencePrototype unmarshals an instance of LoadBalancerPoolSessionPersistencePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePrototype) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -58334,52 +70808,52 @@ func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawM return } -// LoadBalancerPrivateIpsItem : LoadBalancerPrivateIpsItem struct -type LoadBalancerPrivateIpsItem struct { +// SecurityGroupRuleRemotePatch : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). +// Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic +// from any source (or to any destination, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemotePatchIP +// - SecurityGroupRuleRemotePatchCIDR +// - SecurityGroupRuleRemotePatchSecurityGroupIdentity +type SecurityGroupRuleRemotePatch struct { // The IP address. // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` + Address *string `json:"address,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` + // The security group's canonical URL. + Href *string `json:"href,omitempty"` +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +func (*SecurityGroupRuleRemotePatch) isaSecurityGroupRuleRemotePatch() bool { + return true } -// Constants associated with the LoadBalancerPrivateIpsItem.ResourceType property. -// The resource type. -const ( - LoadBalancerPrivateIpsItemResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) +type SecurityGroupRuleRemotePatchIntf interface { + isaSecurityGroupRuleRemotePatch() bool +} -// UnmarshalLoadBalancerPrivateIpsItem unmarshals an instance of LoadBalancerPrivateIpsItem from the specified map of raw messages. -func UnmarshalLoadBalancerPrivateIpsItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPrivateIpsItem) +// UnmarshalSecurityGroupRuleRemotePatch unmarshals an instance of SecurityGroupRuleRemotePatch from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatch) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } @@ -58387,11 +70861,11 @@ func UnmarshalLoadBalancerPrivateIpsItem(m map[string]json.RawMessage, result in if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -58399,61 +70873,66 @@ func UnmarshalLoadBalancerPrivateIpsItem(m map[string]json.RawMessage, result in return } -// LoadBalancerProfile : LoadBalancerProfile struct -type LoadBalancerProfile struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` +// SecurityGroupRuleRemotePrototype : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). +// Can be specified as an IP address, a CIDR block, or a security group within the VPC. +// +// If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source +// (or to any destination, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemotePrototypeIP +// - SecurityGroupRuleRemotePrototypeCIDR +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity +type SecurityGroupRuleRemotePrototype struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - InstanceGroupsSupported LoadBalancerProfileInstanceGroupsSupportedIntf `json:"instance_groups_supported" validate:"required"` + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` - // Indicates which logging type(s) are supported for a load balancer with this profile. - LoggingSupported *LoadBalancerProfileLoggingSupported `json:"logging_supported" validate:"required"` + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - RouteModeSupported LoadBalancerProfileRouteModeSupportedIntf `json:"route_mode_supported" validate:"required"` + // The security group's canonical URL. + Href *string `json:"href,omitempty"` +} - SecurityGroupsSupported LoadBalancerProfileSecurityGroupsSupportedIntf `json:"security_groups_supported" validate:"required"` +func (*SecurityGroupRuleRemotePrototype) isaSecurityGroupRuleRemotePrototype() bool { + return true +} - UDPSupported LoadBalancerProfileUDPSupportedIntf `json:"udp_supported" validate:"required"` +type SecurityGroupRuleRemotePrototypeIntf interface { + isaSecurityGroupRuleRemotePrototype() bool } -// UnmarshalLoadBalancerProfile unmarshals an instance of LoadBalancerProfile from the specified map of raw messages. -func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_groups_supported", &obj.InstanceGroupsSupported, UnmarshalLoadBalancerProfileInstanceGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "logging_supported", &obj.LoggingSupported, UnmarshalLoadBalancerProfileLoggingSupported) +// UnmarshalSecurityGroupRuleRemotePrototype unmarshals an instance of SecurityGroupRuleRemotePrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } - err = core.UnmarshalModel(m, "route_mode_supported", &obj.RouteModeSupported, UnmarshalLoadBalancerProfileRouteModeSupported) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups_supported", &obj.SecurityGroupsSupported, UnmarshalLoadBalancerProfileSecurityGroupsSupported) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "udp_supported", &obj.UDPSupported, UnmarshalLoadBalancerProfileUDPSupported) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -58461,29 +70940,29 @@ func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface return } -// LoadBalancerProfileCollection : LoadBalancerProfileCollection struct -type LoadBalancerProfileCollection struct { +// SecurityGroupTargetCollection : SecurityGroupTargetCollection struct +type SecurityGroupTargetCollection struct { // A link to the first page of resources. - First *LoadBalancerProfileCollectionFirst `json:"first" validate:"required"` + First *SecurityGroupTargetCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *LoadBalancerProfileCollectionNext `json:"next,omitempty"` + Next *SecurityGroupTargetCollectionNext `json:"next,omitempty"` - // Collection of load balancer profiles. - Profiles []LoadBalancerProfile `json:"profiles" validate:"required"` + // Collection of targets for this security group. + Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerProfileCollection unmarshals an instance of LoadBalancerProfileCollection from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerProfileCollectionFirst) +// UnmarshalSecurityGroupTargetCollection unmarshals an instance of SecurityGroupTargetCollection from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupTargetCollectionFirst) if err != nil { return } @@ -58491,11 +70970,11 @@ func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerProfileCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupTargetCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLoadBalancerProfile) + err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) if err != nil { return } @@ -58508,7 +70987,7 @@ func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result } // Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { +func (resp *SecurityGroupTargetCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -58519,15 +70998,15 @@ func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { return start, nil } -// LoadBalancerProfileCollectionFirst : A link to the first page of resources. -type LoadBalancerProfileCollectionFirst struct { +// SecurityGroupTargetCollectionFirst : A link to the first page of resources. +type SecurityGroupTargetCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerProfileCollectionFirst unmarshals an instance of LoadBalancerProfileCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionFirst) +// UnmarshalSecurityGroupTargetCollectionFirst unmarshals an instance of SecurityGroupTargetCollectionFirst from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -58536,15 +71015,15 @@ func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, r return } -// LoadBalancerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerProfileCollectionNext struct { +// SecurityGroupTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SecurityGroupTargetCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerProfileCollectionNext unmarshals an instance of LoadBalancerProfileCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionNext) +// UnmarshalSecurityGroupTargetCollectionNext unmarshals an instance of SecurityGroupTargetCollectionNext from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -58553,388 +71032,437 @@ func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, re return } -// LoadBalancerProfileIdentity : Identifies a load balancer profile by a unique property. +// SecurityGroupTargetReference : The resource types that can be security group targets are expected to expand in the future. When iterating over +// security group targets, do not assume that every target resource will be from a known set of resource types. +// Optionally halt processing and surface an error, or bypass resources of unrecognized types. // Models which "extend" this model: -// - LoadBalancerProfileIdentityByName -// - LoadBalancerProfileIdentityByHref -type LoadBalancerProfileIdentity struct { - // The globally unique name for this load balancer profile. - Name *string `json:"name,omitempty"` +// - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext +// - SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext +// - SecurityGroupTargetReferenceLoadBalancerReference +// - SecurityGroupTargetReferenceEndpointGatewayReference +// - SecurityGroupTargetReferenceVPNServerReference +// - SecurityGroupTargetReferenceVirtualNetworkInterfaceReference +type SecurityGroupTargetReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - // The URL for this load balancer profile. + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` + + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` + + // The name for this instance network interface. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` + + // The load balancer's CRN. + CRN *string `json:"crn,omitempty"` + + // The primary IP for this virtual network interface. + PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet,omitempty"` } -func (*LoadBalancerProfileIdentity) isaLoadBalancerProfileIdentity() bool { +// Constants associated with the SecurityGroupTargetReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*SecurityGroupTargetReference) isaSecurityGroupTargetReference() bool { return true } -type LoadBalancerProfileIdentityIntf interface { - isaLoadBalancerProfileIdentity() bool +type SecurityGroupTargetReferenceIntf interface { + isaSecurityGroupTargetReference() bool +} + +// UnmarshalSecurityGroupTargetReference unmarshals an instance of SecurityGroupTargetReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SetSubnetPublicGatewayOptions : The SetSubnetPublicGateway options. +type SetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // The public gateway identity. + PublicGatewayIdentity PublicGatewayIdentityIntf `json:"PublicGatewayIdentity" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewSetSubnetPublicGatewayOptions : Instantiate SetSubnetPublicGatewayOptions +func (*VpcV1) NewSetSubnetPublicGatewayOptions(id string, publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { + return &SetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), + PublicGatewayIdentity: publicGatewayIdentity, + } +} + +// SetID : Allow user to set ID +func (_options *SetSubnetPublicGatewayOptions) SetID(id string) *SetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetPublicGatewayIdentity : Allow user to set PublicGatewayIdentity +func (_options *SetSubnetPublicGatewayOptions) SetPublicGatewayIdentity(publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { + _options.PublicGatewayIdentity = publicGatewayIdentity + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *SetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *SetSubnetPublicGatewayOptions { + options.Headers = param + return options } -// UnmarshalLoadBalancerProfileIdentity unmarshals an instance of LoadBalancerProfileIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Share : Share struct +type Share struct { + // The access control mode for the share: + // + // - `security_group`: The security groups on the virtual network interface for a mount + // target control access to the mount target. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // + // The enumerated access control mode values for this property may expand in the future. When processing this property, + // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which + // the unexpected access control mode was encountered. + AccessControlMode *string `json:"access_control_mode" validate:"required"` + + // The date and time that the file share is created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this file share. + CRN *string `json:"crn" validate:"required"` + + // The type of encryption used for this file share. + Encryption *string `json:"encryption" validate:"required"` + + // The key used to encrypt this file share. + // + // This property will be present if `encryption_type` is `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + + // The URL for this file share. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this file share. + ID *string `json:"id" validate:"required"` + + // The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the + // share will be restricted to 48,000 IOPS. + // + // The maximum IOPS for a share may increase in the future. + Iops *int64 `json:"iops" validate:"required"` + + // The latest job associated with this file share. + // + // This property will be absent if no jobs have been created for this file share. + LatestJob *ShareJob `json:"latest_job,omitempty"` + + // Information about the latest synchronization for this file share. + // + // This property will be present when the `replication_role` is `replica` and at least + // one replication sync has been completed. + LatestSync *ShareLatestSync `json:"latest_sync,omitempty"` + + // The lifecycle state of the file share. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The mount targets for the file share. + MountTargets []ShareMountTargetReference `json:"mount_targets" validate:"required"` + + // The name for this share. The name is unique across all shares in the region. + Name *string `json:"name" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for + // this file share. + Profile *ShareProfileReference `json:"profile" validate:"required"` + + // The replica file share for this source file share. + // + // This property will be present when the `replication_role` is `source`. + ReplicaShare *ShareReference `json:"replica_share,omitempty"` + + // The cron specification for the file share replication schedule. + // + // This property will be present when the `replication_role` is `replica`. + ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` + + // The replication role of the file share. + // + // * `none`: This share is not participating in replication. + // * `replica`: This share is a replication target. + // * `source`: This share is a replication source. + ReplicationRole *string `json:"replication_role" validate:"required"` + + // The replication status of the file share. + // + // * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the + // replication schedule. + // * `degraded`: This is share is participating in replication, but the replica's data has fallen behind the + // replication schedule. + // * `failover_pending`: This share is performing a replication failover. + // * `initializing`: This share is initializing replication. + // * `none`: This share is not participating in replication. + // * `split_pending`: This share is performing a replication split. + ReplicationStatus *string `json:"replication_status" validate:"required"` + + // The reasons for the current replication status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + ReplicationStatusReasons []ShareReplicationStatusReason `json:"replication_status_reasons" validate:"required"` + + // The resource group for this file share. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The size of the file share rounded up to the next gigabyte. + // + // The maximum size for a share may increase in the future. + Size *int64 `json:"size" validate:"required"` -// LoadBalancerProfileInstanceGroupsSupported : LoadBalancerProfileInstanceGroupsSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileInstanceGroupsSupportedFixed -// - LoadBalancerProfileInstanceGroupsSupportedDependent -type LoadBalancerProfileInstanceGroupsSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` + // The source file share for this replica file share. + // + // This property will be present when the `replication_role` is `replica`. + SourceShare *ShareReference `json:"source_share,omitempty"` - // The value for this profile field. - Value *bool `json:"value,omitempty"` + // Tags for this resource. + UserTags []string `json:"user_tags" validate:"required"` + + // The zone this file share will reside in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the LoadBalancerProfileInstanceGroupsSupported.Type property. -// The type for this profile field. +// Constants associated with the Share.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a mount +// target control access to the mount target. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// +// The enumerated access control mode values for this property may expand in the future. When processing this property, +// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which +// the unexpected access control mode was encountered. const ( - LoadBalancerProfileInstanceGroupsSupportedTypeFixedConst = "fixed" + ShareAccessControlModeSecurityGroupConst = "security_group" + ShareAccessControlModeVPCConst = "vpc" ) -func (*LoadBalancerProfileInstanceGroupsSupported) isaLoadBalancerProfileInstanceGroupsSupported() bool { - return true -} - -type LoadBalancerProfileInstanceGroupsSupportedIntf interface { - isaLoadBalancerProfileInstanceGroupsSupported() bool -} +// Constants associated with the Share.Encryption property. +// The type of encryption used for this file share. +const ( + ShareEncryptionProviderManagedConst = "provider_managed" + ShareEncryptionUserManagedConst = "user_managed" +) -// UnmarshalLoadBalancerProfileInstanceGroupsSupported unmarshals an instance of LoadBalancerProfileInstanceGroupsSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the Share.LifecycleState property. +// The lifecycle state of the file share. +const ( + ShareLifecycleStateDeletingConst = "deleting" + ShareLifecycleStateFailedConst = "failed" + ShareLifecycleStatePendingConst = "pending" + ShareLifecycleStateStableConst = "stable" + ShareLifecycleStateSuspendedConst = "suspended" + ShareLifecycleStateUpdatingConst = "updating" + ShareLifecycleStateWaitingConst = "waiting" +) -// LoadBalancerProfileLoggingSupported : Indicates which logging type(s) are supported for a load balancer with this profile. -type LoadBalancerProfileLoggingSupported struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// Constants associated with the Share.ReplicationRole property. +// The replication role of the file share. +// +// * `none`: This share is not participating in replication. +// * `replica`: This share is a replication target. +// * `source`: This share is a replication source. +const ( + ShareReplicationRoleNoneConst = "none" + ShareReplicationRoleReplicaConst = "replica" + ShareReplicationRoleSourceConst = "source" +) - // The supported logging type(s) for a load balancer with this profile. - Value []string `json:"value" validate:"required"` -} +// Constants associated with the Share.ReplicationStatus property. +// The replication status of the file share. +// +// * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the +// replication schedule. +// * `degraded`: This is share is participating in replication, but the replica's data has fallen behind the replication +// schedule. +// * `failover_pending`: This share is performing a replication failover. +// * `initializing`: This share is initializing replication. +// * `none`: This share is not participating in replication. +// * `split_pending`: This share is performing a replication split. +const ( + ShareReplicationStatusActiveConst = "active" + ShareReplicationStatusDegradedConst = "degraded" + ShareReplicationStatusFailoverPendingConst = "failover_pending" + ShareReplicationStatusInitializingConst = "initializing" + ShareReplicationStatusNoneConst = "none" + ShareReplicationStatusSplitPendingConst = "split_pending" +) -// Constants associated with the LoadBalancerProfileLoggingSupported.Type property. -// The type for this profile field. +// Constants associated with the Share.ResourceType property. +// The resource type. const ( - LoadBalancerProfileLoggingSupportedTypeFixedConst = "fixed" + ShareResourceTypeShareConst = "share" ) -// UnmarshalLoadBalancerProfileLoggingSupported unmarshals an instance of LoadBalancerProfileLoggingSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileLoggingSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileLoggingSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalShare unmarshals an instance of Share from the specified map of raw messages. +func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Share) + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileReference : LoadBalancerProfileReference struct -type LoadBalancerProfileReference struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalLoadBalancerProfileReference unmarshals an instance of LoadBalancerProfileReference from the specified map of raw messages. -func UnmarshalLoadBalancerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileReference) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileRouteModeSupported : LoadBalancerProfileRouteModeSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileRouteModeSupportedFixed -// - LoadBalancerProfileRouteModeSupportedDependent -type LoadBalancerProfileRouteModeSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileRouteModeSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileRouteModeSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileRouteModeSupported) isaLoadBalancerProfileRouteModeSupported() bool { - return true -} - -type LoadBalancerProfileRouteModeSupportedIntf interface { - isaLoadBalancerProfileRouteModeSupported() bool -} - -// UnmarshalLoadBalancerProfileRouteModeSupported unmarshals an instance of LoadBalancerProfileRouteModeSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileSecurityGroupsSupported : LoadBalancerProfileSecurityGroupsSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileSecurityGroupsSupportedFixed -// - LoadBalancerProfileSecurityGroupsSupportedDependent -type LoadBalancerProfileSecurityGroupsSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileSecurityGroupsSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileSecurityGroupsSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileSecurityGroupsSupported) isaLoadBalancerProfileSecurityGroupsSupported() bool { - return true -} - -type LoadBalancerProfileSecurityGroupsSupportedIntf interface { - isaLoadBalancerProfileSecurityGroupsSupported() bool -} - -// UnmarshalLoadBalancerProfileSecurityGroupsSupported unmarshals an instance of LoadBalancerProfileSecurityGroupsSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "latest_job", &obj.LatestJob, UnmarshalShareJob) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileUDPSupported : LoadBalancerProfileUDPSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileUDPSupportedFixed -// - LoadBalancerProfileUDPSupportedDependent -type LoadBalancerProfileUDPSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileUDPSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileUDPSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileUDPSupported) isaLoadBalancerProfileUDPSupported() bool { - return true -} - -type LoadBalancerProfileUDPSupportedIntf interface { - isaLoadBalancerProfileUDPSupported() bool -} - -// UnmarshalLoadBalancerProfileUDPSupported unmarshals an instance of LoadBalancerProfileUDPSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "latest_sync", &obj.LatestSync, UnmarshalShareLatestSync) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerReferenceDeleted unmarshals an instance of LoadBalancerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerStatistics : LoadBalancerStatistics struct -type LoadBalancerStatistics struct { - // Number of active connections of this load balancer. - ActiveConnections *int64 `json:"active_connections" validate:"required"` - - // Current connection rate (connections per second) of this load balancer. - ConnectionRate *float32 `json:"connection_rate" validate:"required"` - - // Total number of data processed (bytes) of this load balancer within current calendar month. - DataProcessedThisMonth *int64 `json:"data_processed_this_month" validate:"required"` - - // Current throughput (Mbps) of this load balancer. - Throughput *float32 `json:"throughput" validate:"required"` -} - -// UnmarshalLoadBalancerStatistics unmarshals an instance of LoadBalancerStatistics from the specified map of raw messages. -func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerStatistics) - err = core.UnmarshalPrimitive(m, "active_connections", &obj.ActiveConnections) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "connection_rate", &obj.ConnectionRate) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "data_processed_this_month", &obj.DataProcessedThisMonth) + err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalShareReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "throughput", &obj.Throughput) + err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACL : NetworkACL struct -type NetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` - - // The name for this network ACL. The name is unique across all network ACLs for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this network ACL. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The ordered rules for this network ACL. If no rules exist, all traffic will be denied. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The VPC this network ACL resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalNetworkACL unmarshals an instance of NetworkACL from the specified map of raw messages. -func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "replication_role", &obj.ReplicationRole) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "replication_status", &obj.ReplicationStatus) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "replication_status_reasons", &obj.ReplicationStatusReasons, UnmarshalShareReplicationStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareReference) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -58942,29 +71470,29 @@ func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err return } -// NetworkACLCollection : NetworkACLCollection struct -type NetworkACLCollection struct { +// ShareCollection : ShareCollection struct +type ShareCollection struct { // A link to the first page of resources. - First *NetworkACLCollectionFirst `json:"first" validate:"required"` + First *ShareCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of network ACLs. - NetworkAcls []NetworkACL `json:"network_acls" validate:"required"` - // A link to the next page of resources. This property is present for all pages // except the last page. - Next *NetworkACLCollectionNext `json:"next,omitempty"` + Next *ShareCollectionNext `json:"next,omitempty"` + + // Collection of file shares. + Shares []Share `json:"shares" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalNetworkACLCollection unmarshals an instance of NetworkACLCollection from the specified map of raw messages. -func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLCollectionFirst) +// UnmarshalShareCollection unmarshals an instance of ShareCollection from the specified map of raw messages. +func UnmarshalShareCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareCollectionFirst) if err != nil { return } @@ -58972,11 +71500,11 @@ func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "network_acls", &obj.NetworkAcls, UnmarshalNetworkACL) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLCollectionNext) + err = core.UnmarshalModel(m, "shares", &obj.Shares, UnmarshalShare) if err != nil { return } @@ -58989,7 +71517,7 @@ func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interfac } // Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLCollection) GetNextStart() (*string, error) { +func (resp *ShareCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -59000,15 +71528,15 @@ func (resp *NetworkACLCollection) GetNextStart() (*string, error) { return start, nil } -// NetworkACLCollectionFirst : A link to the first page of resources. -type NetworkACLCollectionFirst struct { +// ShareCollectionFirst : A link to the first page of resources. +type ShareCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLCollectionFirst unmarshals an instance of NetworkACLCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionFirst) +// UnmarshalShareCollectionFirst unmarshals an instance of ShareCollectionFirst from the specified map of raw messages. +func UnmarshalShareCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -59017,145 +71545,83 @@ func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result int return } -// NetworkACLCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLCollectionNext struct { +// ShareCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ShareCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLCollectionNext unmarshals an instance of NetworkACLCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentity : Identifies a network ACL by a unique property. -// Models which "extend" this model: -// - NetworkACLIdentityByID -// - NetworkACLIdentityByCRN -// - NetworkACLIdentityByHref -type NetworkACLIdentity struct { - // The unique identifier for this network ACL. - ID *string `json:"id,omitempty"` - - // The CRN for this network ACL. - CRN *string `json:"crn,omitempty"` - - // The URL for this network ACL. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLIdentity) isaNetworkACLIdentity() bool { - return true -} - -type NetworkACLIdentityIntf interface { - isaNetworkACLIdentity() bool -} - -// UnmarshalNetworkACLIdentity unmarshals an instance of NetworkACLIdentity from the specified map of raw messages. -func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLPatch : NetworkACLPatch struct -type NetworkACLPatch struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalNetworkACLPatch unmarshals an instance of NetworkACLPatch from the specified map of raw messages. -func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the NetworkACLPatch -func (networkACLPatch *NetworkACLPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkACLPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// NetworkACLPrototype : NetworkACLPrototype struct -// Models which "extend" this model: -// - NetworkACLPrototypeNetworkACLByRules -// - NetworkACLPrototypeNetworkACLBySourceNetworkACL -type NetworkACLPrototype struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// UnmarshalShareCollectionNext unmarshals an instance of ShareCollectionNext from the specified map of raw messages. +func UnmarshalShareCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` +// ShareIdentity : Identifies a file share by a unique property. +// Models which "extend" this model: +// - ShareIdentityByID +// - ShareIdentityByCRN +// - ShareIdentityByHref +type ShareIdentity struct { + // The unique identifier for this file share. + ID *string `json:"id,omitempty"` - // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` + // The CRN for this file share. + CRN *string `json:"crn,omitempty"` - // Network ACL to copy rules from. - SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl,omitempty"` + // The URL for this file share. + Href *string `json:"href,omitempty"` } -func (*NetworkACLPrototype) isaNetworkACLPrototype() bool { +func (*ShareIdentity) isaShareIdentity() bool { return true } -type NetworkACLPrototypeIntf interface { - isaNetworkACLPrototype() bool +type ShareIdentityIntf interface { + isaShareIdentity() bool } -// UnmarshalNetworkACLPrototype unmarshals an instance of NetworkACLPrototype from the specified map of raw messages. -func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalShareIdentity unmarshals an instance of ShareIdentity from the specified map of raw messages. +func UnmarshalShareIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareInitialOwner : ShareInitialOwner struct +type ShareInitialOwner struct { + // The initial group identifier for the file share. + Gid *int64 `json:"gid,omitempty"` + + // The initial user identifier for the file share. + Uid *int64 `json:"uid,omitempty"` +} + +// UnmarshalShareInitialOwner unmarshals an instance of ShareInitialOwner from the specified map of raw messages. +func UnmarshalShareInitialOwner(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareInitialOwner) + err = core.UnmarshalPrimitive(m, "gid", &obj.Gid) if err != nil { return } - err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) + err = core.UnmarshalPrimitive(m, "uid", &obj.Uid) if err != nil { return } @@ -59163,45 +71629,127 @@ func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface return } -// NetworkACLReference : NetworkACLReference struct -type NetworkACLReference struct { - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` +// ShareJob : ShareJob struct +type ShareJob struct { + // The status of the file share job. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the + // unexpected property value was encountered. + // + // * `cancelled`: This job has been cancelled. + // * `failed`: This job has failed. + // * `queued`: This job is queued. + // * `running`: This job is running. + // * `succeeded`: This job completed successfully. + Status *string `json:"status" validate:"required"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkACLReferenceDeleted `json:"deleted,omitempty"` + // The reasons for the file share job status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ShareJobStatusReason `json:"status_reasons" validate:"required"` - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` + // The type of the file share job. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the + // unexpected property value was encountered. + // + // * `replication_failover`: This is a share replication failover job. + // * `replication_init`: This is a share replication is initialization job. + // * `replication_split`: This is a share replication split job. + Type *string `json:"type" validate:"required"` +} - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` +// Constants associated with the ShareJob.Status property. +// The status of the file share job. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the +// unexpected property value was encountered. +// +// * `cancelled`: This job has been cancelled. +// * `failed`: This job has failed. +// * `queued`: This job is queued. +// * `running`: This job is running. +// * `succeeded`: This job completed successfully. +const ( + ShareJobStatusCancelledConst = "cancelled" + ShareJobStatusFailedConst = "failed" + ShareJobStatusQueuedConst = "queued" + ShareJobStatusRunningConst = "running" + ShareJobStatusSucceededConst = "succeeded" +) - // The name for this network ACL. The name is unique across all network ACLs for the VPC. - Name *string `json:"name" validate:"required"` -} +// Constants associated with the ShareJob.Type property. +// The type of the file share job. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the +// unexpected property value was encountered. +// +// * `replication_failover`: This is a share replication failover job. +// * `replication_init`: This is a share replication is initialization job. +// * `replication_split`: This is a share replication split job. +const ( + ShareJobTypeReplicationFailoverConst = "replication_failover" + ShareJobTypeReplicationInitConst = "replication_init" + ShareJobTypeReplicationSplitConst = "replication_split" +) -// UnmarshalNetworkACLReference unmarshals an instance of NetworkACLReference from the specified map of raw messages. -func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalShareJob unmarshals an instance of ShareJob from the specified map of raw messages. +func UnmarshalShareJob(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareJob) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLReferenceDeleted) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalShareJobStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareJobStatusReason : ShareJobStatusReason struct +type ShareJobStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the ShareJobStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ShareJobStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" + ShareJobStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" + ShareJobStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" +) + +// UnmarshalShareJobStatusReason unmarshals an instance of ShareJobStatusReason from the specified map of raw messages. +func UnmarshalShareJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareJobStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -59209,17 +71757,33 @@ func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface return } -// NetworkACLReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkACLReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// ShareLatestSync : Information about the latest synchronization for this file share. +// +// This property will be present when the `replication_role` is `replica` and at least one replication sync has been +// completed. +type ShareLatestSync struct { + // The completed date and time of last synchronization between the replica share and its source. + CompletedAt *strfmt.DateTime `json:"completed_at" validate:"required"` + + // The data transferred (in bytes) in the last synchronization between the replica and its source. + DataTransferred *int64 `json:"data_transferred" validate:"required"` + + // The start date and time of last synchronization between the replica share and its source. + StartedAt *strfmt.DateTime `json:"started_at" validate:"required"` } -// UnmarshalNetworkACLReferenceDeleted unmarshals an instance of NetworkACLReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalShareLatestSync unmarshals an instance of ShareLatestSync from the specified map of raw messages. +func UnmarshalShareLatestSync(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareLatestSync) + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "data_transferred", &obj.DataTransferred) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) if err != nil { return } @@ -59227,199 +71791,182 @@ func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result in return } -// NetworkACLRule : NetworkACLRule struct -// Models which "extend" this model: -// - NetworkACLRuleNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleNetworkACLRuleProtocolIcmp -// - NetworkACLRuleNetworkACLRuleProtocolAll -type NetworkACLRule struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` +// ShareMountTarget : ShareMountTarget struct +type ShareMountTarget struct { + // The access control mode for the share: + // + // - `security_group`: The security groups on the virtual network interface for a mount + // target control access to the mount target. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // + // The enumerated access control mode values for this property may expand in the future. When processing this property, + // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which + // the unexpected access control mode was encountered. + AccessControlMode *string `json:"access_control_mode" validate:"required"` - // The date and time that the rule was created. + // The date and time that the share mount target was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. + // The URL for this share mount target. Href *string `json:"href" validate:"required"` - // The unique identifier for this network ACL rule. + // The unique identifier for this share mount target. ID *string `json:"id" validate:"required"` - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` + // The lifecycle state of the mount target. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The mount path for the share. The server component of the mount path may be either an IP address or a fully + // qualified domain name. + // + // This property will be absent if the `lifecycle_state` of the mount target is + // 'pending', `failed`, or `deleting`. + // + // If the share's `access_control_mode` is: + // + // - `security_group`: The IP address used in the mount path is the `primary_ip` + // address of the virtual network interface for this share mount target. + // - `vpc`: The fully-qualified domain name used in the mount path is an address that + // resolves to the share mount target. + MountPath *string `json:"mount_path,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The name for this share mount target. The name is unique across all mount targets for the file share. + Name *string `json:"name" validate:"required"` - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + // The primary IP address of the virtual network interface for the share mount target. + // + // Absent if `access_control_mode` is `vpc`. + PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` + // The subnet of the virtual network interface for the share mount target. + // + // Absent if `access_control_mode` is `vpc`. + Subnet *SubnetReference `json:"subnet,omitempty"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The transit encryption mode for this share mount target: + // - `none`: Not encrypted in transit + // - `user_managed`: Encrypted in transit using an instance identity certificate + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + TransitEncryption *string `json:"transit_encryption" validate:"required"` - // The ICMP traffic code to match. + // The virtual network interface for this file share mount target. // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` + // This property will be present when the `access_control_mode` is `security_group`. + VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface,omitempty"` - // The ICMP traffic type to match. + // If `access_control_mode` is: // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` + // - `security_group`: The VPC for the virtual network interface for this share mount + // target + // - `vpc`: The VPC in which clients can mount the file share using this share + // mount target. + VPC *VPCReference `json:"vpc" validate:"required"` } -// Constants associated with the NetworkACLRule.Action property. -// The action to perform for a packet matching the rule. +// Constants associated with the ShareMountTarget.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a mount +// target control access to the mount target. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// +// The enumerated access control mode values for this property may expand in the future. When processing this property, +// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which +// the unexpected access control mode was encountered. const ( - NetworkACLRuleActionAllowConst = "allow" - NetworkACLRuleActionDenyConst = "deny" + ShareMountTargetAccessControlModeSecurityGroupConst = "security_group" + ShareMountTargetAccessControlModeVPCConst = "vpc" ) -// Constants associated with the NetworkACLRule.Direction property. -// The direction of traffic to match. +// Constants associated with the ShareMountTarget.LifecycleState property. +// The lifecycle state of the mount target. const ( - NetworkACLRuleDirectionInboundConst = "inbound" - NetworkACLRuleDirectionOutboundConst = "outbound" + ShareMountTargetLifecycleStateDeletingConst = "deleting" + ShareMountTargetLifecycleStateFailedConst = "failed" + ShareMountTargetLifecycleStatePendingConst = "pending" + ShareMountTargetLifecycleStateStableConst = "stable" + ShareMountTargetLifecycleStateSuspendedConst = "suspended" + ShareMountTargetLifecycleStateUpdatingConst = "updating" + ShareMountTargetLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the NetworkACLRule.IPVersion property. -// The IP version for this rule. +// Constants associated with the ShareMountTarget.ResourceType property. +// The resource type. const ( - NetworkACLRuleIPVersionIpv4Const = "ipv4" + ShareMountTargetResourceTypeShareMountTargetConst = "share_mount_target" ) -// Constants associated with the NetworkACLRule.Protocol property. -// The protocol to enforce. +// Constants associated with the ShareMountTarget.TransitEncryption property. +// The transit encryption mode for this share mount target: +// - `none`: Not encrypted in transit +// - `user_managed`: Encrypted in transit using an instance identity certificate +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. const ( - NetworkACLRuleProtocolAllConst = "all" - NetworkACLRuleProtocolIcmpConst = "icmp" - NetworkACLRuleProtocolTCPConst = "tcp" - NetworkACLRuleProtocolUDPConst = "udp" + ShareMountTargetTransitEncryptionNoneConst = "none" + ShareMountTargetTransitEncryptionUserManagedConst = "user_managed" ) -func (*NetworkACLRule) isaNetworkACLRule() bool { - return true -} - -type NetworkACLRuleIntf interface { - isaNetworkACLRule() bool -} - -// UnmarshalNetworkACLRule unmarshals an instance of NetworkACLRule from the specified map of raw messages. -func UnmarshalNetworkACLRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalShareMountTarget unmarshals an instance of ShareMountTarget from the specified map of raw messages. +func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTarget) + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } - return -} - -// NetworkACLRuleBeforePatch : The rule to move this rule immediately before. -// -// Specify `null` to move this rule after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePatch struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLRuleBeforePatch) isaNetworkACLRuleBeforePatch() bool { - return true -} - -type NetworkACLRuleBeforePatchIntf interface { - isaNetworkACLRuleBeforePatch() bool -} - -// UnmarshalNetworkACLRuleBeforePatch unmarshals an instance of NetworkACLRuleBeforePatch from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatch) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. -// -// If unspecified, this rule will be inserted after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePrototype struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLRuleBeforePrototype) isaNetworkACLRuleBeforePrototype() bool { - return true -} - -type NetworkACLRuleBeforePrototypeIntf interface { - isaNetworkACLRuleBeforePrototype() bool -} - -// UnmarshalNetworkACLRuleBeforePrototype unmarshals an instance of NetworkACLRuleBeforePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "mount_path", &obj.MountPath) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -59427,29 +71974,29 @@ func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result return } -// NetworkACLRuleCollection : NetworkACLRuleCollection struct -type NetworkACLRuleCollection struct { +// ShareMountTargetCollection : ShareMountTargetCollection struct +type ShareMountTargetCollection struct { // A link to the first page of resources. - First *NetworkACLRuleCollectionFirst `json:"first" validate:"required"` + First *ShareMountTargetCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` + // Collection of share mount targets. + MountTargets []ShareMountTarget `json:"mount_targets" validate:"required"` + // A link to the next page of resources. This property is present for all pages // except the last page. - Next *NetworkACLRuleCollectionNext `json:"next,omitempty"` - - // Ordered collection of network ACL rules. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + Next *ShareMountTargetCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalNetworkACLRuleCollection unmarshals an instance of NetworkACLRuleCollection from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLRuleCollectionFirst) +// UnmarshalShareMountTargetCollection unmarshals an instance of ShareMountTargetCollection from the specified map of raw messages. +func UnmarshalShareMountTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareMountTargetCollectionFirst) if err != nil { return } @@ -59457,11 +72004,11 @@ func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result inte if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLRuleCollectionNext) + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTarget) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareMountTargetCollectionNext) if err != nil { return } @@ -59474,7 +72021,7 @@ func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result inte } // Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { +func (resp *ShareMountTargetCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -59485,15 +72032,15 @@ func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { return start, nil } -// NetworkACLRuleCollectionFirst : A link to the first page of resources. -type NetworkACLRuleCollectionFirst struct { +// ShareMountTargetCollectionFirst : A link to the first page of resources. +type ShareMountTargetCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLRuleCollectionFirst unmarshals an instance of NetworkACLRuleCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionFirst) +// UnmarshalShareMountTargetCollectionFirst unmarshals an instance of ShareMountTargetCollectionFirst from the specified map of raw messages. +func UnmarshalShareMountTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -59502,15 +72049,15 @@ func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result return } -// NetworkACLRuleCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLRuleCollectionNext struct { +// ShareMountTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ShareMountTargetCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLRuleCollectionNext unmarshals an instance of NetworkACLRuleCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionNext) +// UnmarshalShareMountTargetCollectionNext unmarshals an instance of ShareMountTargetCollectionNext from the specified map of raw messages. +func UnmarshalShareMountTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -59519,232 +72066,131 @@ func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result return } -// NetworkACLRuleItem : NetworkACLRuleItem struct -// Models which "extend" this model: -// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp -// - NetworkACLRuleItemNetworkACLRuleProtocolAll -type NetworkACLRuleItem struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always - // refers to the next item in the collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` +// ShareMountTargetPatch : ShareMountTargetPatch struct +type ShareMountTargetPatch struct { + // The name for this share mount target. The name must not be used by another mount target for the file share. + Name *string `json:"name,omitempty"` +} - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` +// UnmarshalShareMountTargetPatch unmarshals an instance of ShareMountTargetPatch from the specified map of raw messages. +func UnmarshalShareMountTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` +// AsPatch returns a generic map representation of the ShareMountTargetPatch +func (shareMountTargetPatch *ShareMountTargetPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(shareMountTargetPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` +// ShareMountTargetPrototype : ShareMountTargetPrototype struct +// Models which "extend" this model: +// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup +// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC +type ShareMountTargetPrototype struct { + // The name for this share mount target. The name must not be used by another mount target for the file share. + Name *string `json:"name,omitempty"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The transit encryption mode to use for this share mount target: + // - `none`: Not encrypted in transit. + // - `user_managed`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + TransitEncryption *string `json:"transit_encryption,omitempty"` - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` + VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface,omitempty"` - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` + // Identifies a VPC by a unique property. + VPC VPCIdentityIntf `json:"vpc,omitempty"` } -// Constants associated with the NetworkACLRuleItem.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemActionAllowConst = "allow" - NetworkACLRuleItemActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItem.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemDirectionInboundConst = "inbound" - NetworkACLRuleItemDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItem.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItem.Protocol property. -// The protocol to enforce. +// Constants associated with the ShareMountTargetPrototype.TransitEncryption property. +// The transit encryption mode to use for this share mount target: +// - `none`: Not encrypted in transit. +// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. const ( - NetworkACLRuleItemProtocolAllConst = "all" - NetworkACLRuleItemProtocolIcmpConst = "icmp" - NetworkACLRuleItemProtocolTCPConst = "tcp" - NetworkACLRuleItemProtocolUDPConst = "udp" + ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeTransitEncryptionUserManagedConst = "user_managed" ) -func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { +func (*ShareMountTargetPrototype) isaShareMountTargetPrototype() bool { return true } -type NetworkACLRuleItemIntf interface { - isaNetworkACLRuleItem() bool +type ShareMountTargetPrototypeIntf interface { + isaShareMountTargetPrototype() bool } -// UnmarshalNetworkACLRuleItem unmarshals an instance of NetworkACLRuleItem from the specified map of raw messages. -func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalShareMountTargetPrototype unmarshals an instance of ShareMountTargetPrototype from the specified map of raw messages. +func UnmarshalShareMountTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) + if err != nil { + return } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRulePatch : NetworkACLRulePatch struct -type NetworkACLRulePatch struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action,omitempty"` - - // The rule to move this rule immediately before. - // - // Specify `null` to move this rule after all existing rules. - Before NetworkACLRuleBeforePatchIntf `json:"before,omitempty"` - - // The ICMP traffic code to match. If set, `type` must also be set. - // - // Specify `null` to remove an existing ICMP traffic code. - Code *int64 `json:"code,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The direction of traffic to match. - Direction *string `json:"direction,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol,omitempty"` +// ShareMountTargetReference : ShareMountTargetReference struct +type ShareMountTargetReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source,omitempty"` + // The URL for this share mount target. + Href *string `json:"href" validate:"required"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` + // The unique identifier for this share mount target. + ID *string `json:"id" validate:"required"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The name for this share mount target. The name is unique across all mount targets for the file share. + Name *string `json:"name" validate:"required"` - // The ICMP traffic type to match. - // - // Specify `null` to remove an existing ICMP traffic type value. - Type *int64 `json:"type,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the NetworkACLRulePatch.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePatchActionAllowConst = "allow" - NetworkACLRulePatchActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePatch.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePatchDirectionInboundConst = "inbound" - NetworkACLRulePatchDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePatch.Protocol property. -// The protocol to enforce. +// Constants associated with the ShareMountTargetReference.ResourceType property. +// The resource type. const ( - NetworkACLRulePatchProtocolAllConst = "all" - NetworkACLRulePatchProtocolIcmpConst = "icmp" - NetworkACLRulePatchProtocolTCPConst = "tcp" - NetworkACLRulePatchProtocolUDPConst = "udp" + ShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" ) -// UnmarshalNetworkACLRulePatch unmarshals an instance of NetworkACLRulePatch from the specified map of raw messages. -func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) +// UnmarshalShareMountTargetReference unmarshals an instance of ShareMountTargetReference from the specified map of raw messages. +func UnmarshalShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -59752,23 +72198,7 @@ func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -59776,271 +72206,304 @@ func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface return } -// AsPatch returns a generic map representation of the NetworkACLRulePatch -func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkACLRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// ShareMountTargetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ShareMountTargetReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalShareMountTargetReferenceDeleted unmarshals an instance of ShareMountTargetReferenceDeleted from the specified map of raw messages. +func UnmarshalShareMountTargetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRulePrototype : NetworkACLRulePrototype struct +// ShareMountTargetVirtualNetworkInterfacePrototype : ShareMountTargetVirtualNetworkInterfacePrototype struct // Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype -// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype -// - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype -type NetworkACLRulePrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule to insert this rule immediately before. - // - // If unspecified, this rule will be inserted after all existing rules. - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` +// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext +// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity +type ShareMountTargetVirtualNetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. Name *string `json:"name,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + // The resource group to use for this virtual network interface. If unspecified, the + // share's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -// Constants associated with the NetworkACLRulePrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeProtocolAllConst = "all" - NetworkACLRulePrototypeProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeProtocolUDPConst = "udp" -) - -func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { +func (*ShareMountTargetVirtualNetworkInterfacePrototype) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { return true } -type NetworkACLRulePrototypeIntf interface { - isaNetworkACLRulePrototype() bool +type ShareMountTargetVirtualNetworkInterfacePrototypeIntf interface { + isaShareMountTargetVirtualNetworkInterfacePrototype() bool } -// UnmarshalNetworkACLRulePrototype unmarshals an instance of NetworkACLRulePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototype unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct -// Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype -type NetworkACLRulePrototypeNetworkACLContext struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` +// SharePatch : SharePatch struct +type SharePatch struct { + // The access control mode for the share: + // + // - `security_group`: The security groups on the virtual network interface for a + // mount target control access to the mount target. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // + // For this property to be changed, the share must have no mount targets and + // `replication_role` must be `none`. + AccessControlMode *string `json:"access_control_mode,omitempty"` - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` + // The maximum input/output operations per second (IOPS) for the file share. The value must be in the range supported + // by the share's size. + // + // For this property to be changed, the share `lifecycle_state` must be `stable`. + Iops *int64 `json:"iops,omitempty"` - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The name for this share. The name must not be used by another share in the region. Name *string `json:"name,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to match. + // The profile to use for this file share. // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` + // The requested profile must be in the same `family`. + Profile ShareProfileIdentityIntf `json:"profile,omitempty"` - // The ICMP traffic type to match. + // The cron specification for the file share replication schedule. // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" -) + // Replication of a share can be scheduled to occur at most once per hour. + // + // For this property to be changed, the share `replication_role` must be `replica`. + ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextDirectionOutboundConst = "outbound" -) + // The size of the file share rounded up to the next gigabyte. The value must not be less than the share's current + // size, and must not exceed the maximum supported by the share's profile and IOPS. + // + // For this property to be changed, the share `lifecycle_state` must be `stable`. + Size *int64 `json:"size,omitempty"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextIPVersionIpv4Const = "ipv4" -) + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Protocol property. -// The protocol to enforce. +// Constants associated with the SharePatch.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a +// mount target control access to the mount target. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// +// For this property to be changed, the share must have no mount targets and +// `replication_role` must be `none`. const ( - NetworkACLRulePrototypeNetworkACLContextProtocolAllConst = "all" - NetworkACLRulePrototypeNetworkACLContextProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeNetworkACLContextProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLContextProtocolUDPConst = "udp" + SharePatchAccessControlModeSecurityGroupConst = "security_group" + SharePatchAccessControlModeVPCConst = "vpc" ) -func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} - -type NetworkACLRulePrototypeNetworkACLContextIntf interface { - isaNetworkACLRulePrototypeNetworkACLContext() bool -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLContext unmarshals an instance of NetworkACLRulePrototypeNetworkACLContext from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContext(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalSharePatch unmarshals an instance of SharePatch from the specified map of raw messages. +func UnmarshalSharePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePatch) + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRuleReference : NetworkACLRuleReference struct -type NetworkACLRuleReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkACLRuleReferenceDeleted `json:"deleted,omitempty"` +// AsPatch returns a generic map representation of the SharePatch +func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(sharePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The URL for this network ACL rule. +// ShareProfile : ShareProfile struct +type ShareProfile struct { + // The permitted capacity range (in gigabytes) for a share with this profile. + Capacity ShareProfileCapacityIntf `json:"capacity" validate:"required"` + + // The product family this share profile belongs to. + Family *string `json:"family" validate:"required"` + + // The URL for this share profile. Href *string `json:"href" validate:"required"` - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` + // The permitted IOPS range for a share with this profile. + Iops ShareProfileIopsIntf `json:"iops" validate:"required"` - // The name for this network ACL rule. The name is unique across all rules for the network ACL. + // The globally unique name for this share profile. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalNetworkACLRuleReference unmarshals an instance of NetworkACLRuleReference from the specified map of raw messages. -func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLRuleReferenceDeleted) +// Constants associated with the ShareProfile.Family property. +// The product family this share profile belongs to. +const ( + ShareProfileFamilyDefinedPerformanceConst = "defined_performance" +) + +// Constants associated with the ShareProfile.ResourceType property. +// The resource type. +const ( + ShareProfileResourceTypeShareProfileConst = "share_profile" +) + +// UnmarshalShareProfile unmarshals an instance of ShareProfile from the specified map of raw messages. +func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfile) + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalShareProfileCapacity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } @@ -60048,7 +72511,7 @@ func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "iops", &obj.Iops, UnmarshalShareProfileIops) if err != nil { return } @@ -60056,21 +72519,7 @@ func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result inter if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkACLRuleReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkACLRuleReferenceDeleted unmarshals an instance of NetworkACLRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -60078,121 +72527,152 @@ func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, resul return } -// NetworkInterface : NetworkInterface struct -type NetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the instance network interface was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The floating IPs associated with this instance network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The instance network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` +// ShareProfileCapacity : ShareProfileCapacity struct +// Models which "extend" this model: +// - ShareProfileCapacityFixed +// - ShareProfileCapacityRange +// - ShareProfileCapacityEnum +// - ShareProfileCapacityDependentRange +type ShareProfileCapacity struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The security groups targeting this instance network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The status of the instance network interface. - Status *string `json:"status" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // The instance network interface type. - Type *string `json:"type" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the NetworkInterface.ResourceType property. -// The resource type. +// Constants associated with the ShareProfileCapacity.Type property. +// The type for this profile field. const ( - NetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" + ShareProfileCapacityTypeFixedConst = "fixed" ) -// Constants associated with the NetworkInterface.Status property. -// The status of the instance network interface. -const ( - NetworkInterfaceStatusAvailableConst = "available" - NetworkInterfaceStatusDeletingConst = "deleting" - NetworkInterfaceStatusFailedConst = "failed" - NetworkInterfaceStatusPendingConst = "pending" -) +func (*ShareProfileCapacity) isaShareProfileCapacity() bool { + return true +} -// Constants associated with the NetworkInterface.Type property. -// The instance network interface type. -const ( - NetworkInterfaceTypePrimaryConst = "primary" - NetworkInterfaceTypeSecondaryConst = "secondary" -) +type ShareProfileCapacityIntf interface { + isaShareProfileCapacity() bool +} -// UnmarshalNetworkInterface unmarshals an instance of NetworkInterface from the specified map of raw messages. -func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +// UnmarshalShareProfileCapacity unmarshals an instance of ShareProfileCapacity from the specified map of raw messages. +func UnmarshalShareProfileCapacity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCapacity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileCollection : ShareProfileCollection struct +type ShareProfileCollection struct { + // A link to the first page of resources. + First *ShareProfileCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ShareProfileCollectionNext `json:"next,omitempty"` + + // Collection of share profiles. + Profiles []ShareProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalShareProfileCollection unmarshals an instance of ShareProfileCollection from the specified map of raw messages. +func UnmarshalShareProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareProfileCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareProfileCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalShareProfile) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ShareProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ShareProfileCollectionFirst : A link to the first page of resources. +type ShareProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalShareProfileCollectionFirst unmarshals an instance of ShareProfileCollectionFirst from the specified map of raw messages. +func UnmarshalShareProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -60200,82 +72680,94 @@ func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) return } -// NetworkInterfaceBareMetalServerContextReference : NetworkInterfaceBareMetalServerContextReference struct -type NetworkInterfaceBareMetalServerContextReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceBareMetalServerContextReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. +// ShareProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ShareProfileCollectionNext struct { + // The URL for a page of resources. Href *string `json:"href" validate:"required"` +} - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` +// UnmarshalShareProfileCollectionNext unmarshals an instance of ShareProfileCollectionNext from the specified map of raw messages. +func UnmarshalShareProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` +// ShareProfileIops : ShareProfileIops struct +// Models which "extend" this model: +// - ShareProfileIopsFixed +// - ShareProfileIopsRange +// - ShareProfileIopsEnum +// - ShareProfileIopsDependentRange +type ShareProfileIops struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the NetworkInterfaceBareMetalServerContextReference.ResourceType property. -// The resource type. +// Constants associated with the ShareProfileIops.Type property. +// The type for this profile field. const ( - NetworkInterfaceBareMetalServerContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" + ShareProfileIopsTypeFixedConst = "fixed" ) -// UnmarshalNetworkInterfaceBareMetalServerContextReference unmarshals an instance of NetworkInterfaceBareMetalServerContextReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceBareMetalServerContextReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceBareMetalServerContextReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +func (*ShareProfileIops) isaShareProfileIops() bool { + return true +} + +type ShareProfileIopsIntf interface { + isaShareProfileIops() bool +} + +// UnmarshalShareProfileIops unmarshals an instance of ShareProfileIops from the specified map of raw messages. +func UnmarshalShareProfileIops(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIops) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceBareMetalServerContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceBareMetalServerContextReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted unmarshals an instance of NetworkInterfaceBareMetalServerContextReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceBareMetalServerContextReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -60283,44 +72775,30 @@ func UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted(m map[strin return } -// NetworkInterfaceIPPrototype : NetworkInterfaceIPPrototype struct +// ShareProfileIdentity : Identifies a share profile by a unique property. // Models which "extend" this model: -// - NetworkInterfaceIPPrototypeReservedIPIdentity -// - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext -type NetworkInterfaceIPPrototype struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` +// - ShareProfileIdentityByName +// - ShareProfileIdentityByHref +type ShareProfileIdentity struct { + // The globally unique name for this share profile. + Name *string `json:"name,omitempty"` - // The URL for this reserved IP. + // The URL for this share profile. Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` } -func (*NetworkInterfaceIPPrototype) isaNetworkInterfaceIPPrototype() bool { +func (*ShareProfileIdentity) isaShareProfileIdentity() bool { return true } -type NetworkInterfaceIPPrototypeIntf interface { - isaNetworkInterfaceIPPrototype() bool +type ShareProfileIdentityIntf interface { + isaShareProfileIdentity() bool } -// UnmarshalNetworkInterfaceIPPrototype unmarshals an instance of NetworkInterfaceIPPrototype from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalShareProfileIdentity unmarshals an instance of ShareProfileIdentity from the specified map of raw messages. +func UnmarshalShareProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -60328,178 +72806,153 @@ func UnmarshalNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result i if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkInterfaceInstanceContextReference : NetworkInterfaceInstanceContextReference struct -type NetworkInterfaceInstanceContextReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceInstanceContextReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. +// ShareProfileReference : ShareProfileReference struct +type ShareProfileReference struct { + // The URL for this share profile. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. + // The globally unique name for this share profile. Name *string `json:"name" validate:"required"` - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` } -// Constants associated with the NetworkInterfaceInstanceContextReference.ResourceType property. +// Constants associated with the ShareProfileReference.ResourceType property. // The resource type. const ( - NetworkInterfaceInstanceContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" + ShareProfileReferenceResourceTypeShareProfileConst = "share_profile" ) -// UnmarshalNetworkInterfaceInstanceContextReference unmarshals an instance of NetworkInterfaceInstanceContextReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceInstanceContextReferenceDeleted) - if err != nil { - return - } +// UnmarshalShareProfileReference unmarshals an instance of ShareProfileReference from the specified map of raw messages. +func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkInterfaceInstanceContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceInstanceContextReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceInstanceContextReferenceDeleted unmarshals an instance of NetworkInterfaceInstanceContextReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// SharePrototype : SharePrototype struct +// Models which "extend" this model: +// - SharePrototypeShareBySize +// - SharePrototypeShareBySourceShare +type SharePrototype struct { + // The maximum input/output operations per second (IOPS) for the file share. The share must be in the + // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // + // In addition, each client accessing the share will be restricted to 48,000 IOPS. + Iops *int64 `json:"iops,omitempty"` -// NetworkInterfacePatch : NetworkInterfacePatch struct -type NetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + // The mount targets for the file share. Each mount target must be in a unique VPC. + MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. + // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be + // a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` -} -// UnmarshalNetworkInterfacePatch unmarshals an instance of NetworkInterfacePatch from the specified map of raw messages. -func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + // for this file share. The profile must support the share's specified IOPS and size. + Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` -// AsPatch returns a generic map representation of the NetworkInterfacePatch -func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} + // Configuration for a replica file share to create and associate with this file share. If + // unspecified, a replica may be subsequently added by creating a new file share with a + // `source_share` referencing this file share. + ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` -// NetworkInterfacePrototype : NetworkInterfacePrototype struct -type NetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The zone this file share will reside in. + // + // For a replica share, this must be a different zone in the same region as the + // source share. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // The access control mode for the share: // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` + // - `security_group`: The security groups on the virtual network interface for a + // mount target control access to the mount target. Mount targets for this share + // require a virtual network interface. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // Mount targets for this share require a VPC. + AccessControlMode *string `json:"access_control_mode,omitempty"` - // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is - // used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The root key to use to wrap the data encryption key for the share. + // + // If unspecified, the `encryption` type for the share will be `provider_managed`. + // + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The owner assigned to the file share at creation. Subsequent changes to the owner + // must be performed by a client that has mounted the file share. + InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The size of the file share rounded up to the next gigabyte. + // + // The maximum size for a share may increase in the future. + Size *int64 `json:"size,omitempty"` + + // The cron specification for the file share replication schedule. + // + // Replication of a share can be scheduled to occur at most once per hour. + ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` + + // The source file share for this replica file share. The specified file share must not + // already have a replica, and must not be a replica. If source file share is specified + // by CRN, it may be in an [associated partner + // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). + SourceShare ShareIdentityIntf `json:"source_share,omitempty"` } -// NewNetworkInterfacePrototype : Instantiate NetworkInterfacePrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *NetworkInterfacePrototype, err error) { - _model = &NetworkInterfacePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the SharePrototype.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a +// mount target control access to the mount target. Mount targets for this share +// require a virtual network interface. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// Mount targets for this share require a VPC. +const ( + SharePrototypeAccessControlModeSecurityGroupConst = "security_group" + SharePrototypeAccessControlModeVPCConst = "vpc" +) + +func (*SharePrototype) isaSharePrototype() bool { + return true } -// UnmarshalNetworkInterfacePrototype unmarshals an instance of NetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +type SharePrototypeIntf interface { + isaSharePrototype() bool +} + +// UnmarshalSharePrototype unmarshals an instance of SharePrototype from the specified map of raw messages. +func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePrototype) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) if err != nil { return } @@ -60507,68 +72960,47 @@ func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceReferenceDeleted unmarshals an instance of NetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceReferenceTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of NetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceUnpaginatedCollection : NetworkInterfaceUnpaginatedCollection struct -type NetworkInterfaceUnpaginatedCollection struct { - // Collection of instance network interfaces. - NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` -} - -// UnmarshalNetworkInterfaceUnpaginatedCollection unmarshals an instance of NetworkInterfaceUnpaginatedCollection from the specified map of raw messages. -func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceUnpaginatedCollection) - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) if err != nil { return } @@ -60576,93 +73008,90 @@ func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage return } -// ObsoleteImageOptions : The ObsoleteImage options. -type ObsoleteImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewObsoleteImageOptions : Instantiate ObsoleteImageOptions -func (*VpcV1) NewObsoleteImageOptions(id string) *ObsoleteImageOptions { - return &ObsoleteImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ObsoleteImageOptions) SetID(id string) *ObsoleteImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ObsoleteImageOptions) SetHeaders(param map[string]string) *ObsoleteImageOptions { - options.Headers = param - return options -} +// SharePrototypeShareContext : Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be +// subsequently added by creating a new file share with a +// `source_share` referencing this file share. +type SharePrototypeShareContext struct { + // The maximum input/output operations per second (IOPS) for the file share. The share must be in the + // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // + // In addition, each client accessing the share will be restricted to 48,000 IOPS. + Iops *int64 `json:"iops,omitempty"` -// OperatingSystem : OperatingSystem struct -type OperatingSystem struct { - // The operating system architecture. - Architecture *string `json:"architecture" validate:"required"` + // The mount targets for this replica file share. Each mount target must be in a unique VPC. + // + // A replica's mount targets must be mounted read-only. + MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - // Images with this operating system can only be used on dedicated hosts or dedicated host groups. - DedicatedHostOnly *bool `json:"dedicated_host_only" validate:"required"` + // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be + // a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // A unique, display-friendly name for the operating system. - DisplayName *string `json:"display_name" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + // for this file share. The profile must support the share's specified IOPS and size. + Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - // The software family for this operating system. - Family *string `json:"family" validate:"required"` + // The cron specification for the file share replication schedule. + // + // Replication of a share can be scheduled to occur at most once per hour. + ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` - // The URL for this operating system. - Href *string `json:"href" validate:"required"` + // The resource group to use. If unspecified, the resource group from + // the source share will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The globally unique name for this operating system. - Name *string `json:"name" validate:"required"` + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` - // The vendor of the operating system. - Vendor *string `json:"vendor" validate:"required"` + // The zone this replica file share will reside in. + // + // Must be a different zone in the same region as the source share. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} - // The major release version of this operating system. - Version *string `json:"version" validate:"required"` +// NewSharePrototypeShareContext : Instantiate SharePrototypeShareContext (Generic Model Constructor) +func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string, zone ZoneIdentityIntf) (_model *SharePrototypeShareContext, err error) { + _model = &SharePrototypeShareContext{ + Profile: profile, + ReplicationCronSpec: core.StringPtr(replicationCronSpec), + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalOperatingSystem unmarshals an instance of OperatingSystem from the specified map of raw messages. -func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystem) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) +// UnmarshalSharePrototypeShareContext unmarshals an instance of SharePrototypeShareContext from the specified map of raw messages. +func UnmarshalSharePrototypeShareContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePrototypeShareContext) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalPrimitive(m, "dedicated_host_only", &obj.DedicatedHostOnly) + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "vendor", &obj.Vendor) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -60670,74 +73099,84 @@ func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) return } -// OperatingSystemCollection : OperatingSystemCollection struct -type OperatingSystemCollection struct { - // A link to the first page of resources. - First *OperatingSystemCollectionFirst `json:"first" validate:"required"` +// ShareReference : ShareReference struct +type ShareReference struct { + // The CRN for this file share. + CRN *string `json:"crn" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ShareReferenceDeleted `json:"deleted,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *OperatingSystemCollectionNext `json:"next,omitempty"` + // The URL for this file share. + Href *string `json:"href" validate:"required"` - // Collection of operating systems. - OperatingSystems []OperatingSystem `json:"operating_systems" validate:"required"` + // The unique identifier for this file share. + ID *string `json:"id" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The name for this share. The name is unique across all shares in the region. + Name *string `json:"name" validate:"required"` + + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *ShareRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalOperatingSystemCollection unmarshals an instance of OperatingSystemCollection from the specified map of raw messages. -func UnmarshalOperatingSystemCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalOperatingSystemCollectionFirst) +// Constants associated with the ShareReference.ResourceType property. +// The resource type. +const ( + ShareReferenceResourceTypeShareConst = "share" +) + +// UnmarshalShareReference unmarshals an instance of ShareReference from the specified map of raw messages. +func UnmarshalShareReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalOperatingSystemCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "operating_systems", &obj.OperatingSystems, UnmarshalOperatingSystem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *OperatingSystemCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalShareRemote) + if err != nil { + return } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } - return start, nil + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// OperatingSystemCollectionFirst : A link to the first page of resources. -type OperatingSystemCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// ShareReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ShareReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalOperatingSystemCollectionFirst unmarshals an instance of OperatingSystemCollectionFirst from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalShareReferenceDeleted unmarshals an instance of ShareReferenceDeleted from the specified map of raw messages. +func UnmarshalShareReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -60745,16 +73184,18 @@ func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, resul return } -// OperatingSystemCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type OperatingSystemCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// ShareRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type ShareRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` } -// UnmarshalOperatingSystemCollectionNext unmarshals an instance of OperatingSystemCollectionNext from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalShareRemote unmarshals an instance of ShareRemote from the specified map of raw messages. +func UnmarshalShareRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareRemote) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) if err != nil { return } @@ -60762,34 +73203,38 @@ func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result return } -// OperatingSystemIdentity : Identifies an operating system by a unique property. -// Models which "extend" this model: -// - OperatingSystemIdentityByName -// - OperatingSystemIdentityByHref -type OperatingSystemIdentity struct { - // The globally unique name for this operating system. - Name *string `json:"name,omitempty"` +// ShareReplicationStatusReason : ShareReplicationStatusReason struct +type ShareReplicationStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` - // The URL for this operating system. - Href *string `json:"href,omitempty"` -} + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` -func (*OperatingSystemIdentity) isaOperatingSystemIdentity() bool { - return true + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -type OperatingSystemIdentityIntf interface { - isaOperatingSystemIdentity() bool -} +// Constants associated with the ShareReplicationStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ShareReplicationStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" + ShareReplicationStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" + ShareReplicationStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" +) -// UnmarshalOperatingSystemIdentity unmarshals an instance of OperatingSystemIdentity from the specified map of raw messages. -func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalShareReplicationStatusReason unmarshals an instance of ShareReplicationStatusReason from the specified map of raw messages. +func UnmarshalShareReplicationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareReplicationStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -60797,76 +73242,143 @@ func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result inter return } -// PlacementGroup : PlacementGroup struct -type PlacementGroup struct { - // The date and time that the placement group was created. +// Snapshot : Snapshot struct +type Snapshot struct { + // If present, the backup policy plan which created this snapshot. + BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` + + // Indicates if a boot volume attachment can be created with a volume created from this snapshot. + Bootable *bool `json:"bootable" validate:"required"` + + // The date and time the data capture for this snapshot was completed. + // + // If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots + // created before 1 January 2022. + CapturedAt *strfmt.DateTime `json:"captured_at,omitempty"` + + // Clones for this snapshot. + Clones []SnapshotClone `json:"clones" validate:"required"` + + // The copies of this snapshot. + Copies []SnapshotCopiesItem `json:"copies" validate:"required"` + + // The date and time that this snapshot was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this placement group. + // The CRN of this snapshot. CRN *string `json:"crn" validate:"required"` - // The URL for this placement group. + // Indicates whether this snapshot can be deleted. This value will always be `true`. + // Deprecated: this field is deprecated and may be removed in a future release. + Deletable *bool `json:"deletable" validate:"required"` + + // The type of encryption used on the source volume. + Encryption *string `json:"encryption" validate:"required"` + + // The root key used to wrap the data encryption key for the source volume. + // + // This property will be present for volumes with an `encryption` type of + // `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + + // The URL for this snapshot. Href *string `json:"href" validate:"required"` - // The unique identifier for this placement group. + // The unique identifier for this snapshot. ID *string `json:"id" validate:"required"` - // The lifecycle state of the placement group. + // The lifecycle state of this snapshot. LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The name for this placement group. The name is unique across all placement groups in the region. + // The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the + // capacity of the `source_volume`. + MinimumCapacity *int64 `json:"minimum_capacity" validate:"required"` + + // The name for this snapshot. The name is unique across all snapshots in the region. Name *string `json:"name" validate:"required"` - // The resource group for this placement group. + // The operating system included in this snapshot. + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + + // The resource group for this snapshot. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` + // The [service tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with `is.snapshot:` associated with + // this snapshot. + ServiceTags []string `json:"service_tags" validate:"required"` + + // The size of this snapshot rounded up to the next gigabyte. + Size *int64 `json:"size" validate:"required"` + + // If present, the snapshot consistency group which created this snapshot. + SnapshotConsistencyGroup *SnapshotConsistencyGroupReference `json:"snapshot_consistency_group,omitempty"` + + // If present, the image from which the data on this snapshot was most directly + // provisioned. + SourceImage *ImageReference `json:"source_image,omitempty"` + + // If present, the source snapshot this snapshot was created from. + SourceSnapshot *SnapshotSourceSnapshot `json:"source_snapshot,omitempty"` + + // The source volume this snapshot was created from (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + SourceVolume *VolumeReference `json:"source_volume" validate:"required"` + + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags" validate:"required"` } -// Constants associated with the PlacementGroup.LifecycleState property. -// The lifecycle state of the placement group. +// Constants associated with the Snapshot.Encryption property. +// The type of encryption used on the source volume. const ( - PlacementGroupLifecycleStateDeletingConst = "deleting" - PlacementGroupLifecycleStateFailedConst = "failed" - PlacementGroupLifecycleStatePendingConst = "pending" - PlacementGroupLifecycleStateStableConst = "stable" - PlacementGroupLifecycleStateSuspendedConst = "suspended" - PlacementGroupLifecycleStateUpdatingConst = "updating" - PlacementGroupLifecycleStateWaitingConst = "waiting" + SnapshotEncryptionProviderManagedConst = "provider_managed" + SnapshotEncryptionUserManagedConst = "user_managed" ) -// Constants associated with the PlacementGroup.ResourceType property. -// The resource type. +// Constants associated with the Snapshot.LifecycleState property. +// The lifecycle state of this snapshot. const ( - PlacementGroupResourceTypePlacementGroupConst = "placement_group" + SnapshotLifecycleStateDeletingConst = "deleting" + SnapshotLifecycleStateFailedConst = "failed" + SnapshotLifecycleStatePendingConst = "pending" + SnapshotLifecycleStateStableConst = "stable" + SnapshotLifecycleStateSuspendedConst = "suspended" + SnapshotLifecycleStateUpdatingConst = "updating" + SnapshotLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the PlacementGroup.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. +// Constants associated with the Snapshot.ResourceType property. +// The resource type. const ( - PlacementGroupStrategyHostSpreadConst = "host_spread" - PlacementGroupStrategyPowerSpreadConst = "power_spread" + SnapshotResourceTypeSnapshotConst = "snapshot" ) -// UnmarshalPlacementGroup unmarshals an instance of PlacementGroup from the specified map of raw messages. -func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroup) +// UnmarshalSnapshot unmarshals an instance of Snapshot from the specified map of raw messages. +func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Snapshot) + err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "bootable", &obj.Bootable) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "captured_at", &obj.CapturedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) + if err != nil { + return + } + err = core.UnmarshalModel(m, "copies", &obj.Copies, UnmarshalSnapshotCopiesItem) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -60875,6 +73387,18 @@ func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } + err = core.UnmarshalPrimitive(m, "deletable", &obj.Deletable) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -60887,10 +73411,18 @@ func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } + err = core.UnmarshalPrimitive(m, "minimum_capacity", &obj.MinimumCapacity) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -60899,7 +73431,31 @@ func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } - err = core.UnmarshalPrimitive(m, "strategy", &obj.Strategy) + err = core.UnmarshalPrimitive(m, "service_tags", &obj.ServiceTags) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + err = core.UnmarshalModel(m, "snapshot_consistency_group", &obj.SnapshotConsistencyGroup, UnmarshalSnapshotConsistencyGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotSourceSnapshot) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } @@ -60907,29 +73463,104 @@ func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) ( return } -// PlacementGroupCollection : PlacementGroupCollection struct -type PlacementGroupCollection struct { +// SnapshotClone : SnapshotClone struct +type SnapshotClone struct { + // Indicates whether this snapshot clone is available for use. + Available *bool `json:"available" validate:"required"` + + // The date and time that this snapshot clone was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The zone this snapshot clone resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// UnmarshalSnapshotClone unmarshals an instance of SnapshotClone from the specified map of raw messages. +func UnmarshalSnapshotClone(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotClone) + err = core.UnmarshalPrimitive(m, "available", &obj.Available) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SnapshotCloneCollection : SnapshotCloneCollection struct +type SnapshotCloneCollection struct { + // Collection of snapshot clones. + Clones []SnapshotClone `json:"clones" validate:"required"` +} + +// UnmarshalSnapshotCloneCollection unmarshals an instance of SnapshotCloneCollection from the specified map of raw messages. +func UnmarshalSnapshotCloneCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCloneCollection) + err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SnapshotClonePrototype : SnapshotClonePrototype struct +type SnapshotClonePrototype struct { + // The zone this snapshot clone will reside in. Must be in the same region as the + // snapshot. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} + +// NewSnapshotClonePrototype : Instantiate SnapshotClonePrototype (Generic Model Constructor) +func (*VpcV1) NewSnapshotClonePrototype(zone ZoneIdentityIntf) (_model *SnapshotClonePrototype, err error) { + _model = &SnapshotClonePrototype{ + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalSnapshotClonePrototype unmarshals an instance of SnapshotClonePrototype from the specified map of raw messages. +func UnmarshalSnapshotClonePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotClonePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SnapshotCollection : SnapshotCollection struct +type SnapshotCollection struct { // A link to the first page of resources. - First *PlacementGroupCollectionFirst `json:"first" validate:"required"` + First *SnapshotCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *PlacementGroupCollectionNext `json:"next,omitempty"` + Next *SnapshotCollectionNext `json:"next,omitempty"` - // Collection of placement groups. - PlacementGroups []PlacementGroup `json:"placement_groups" validate:"required"` + // Collection of snapshots. + Snapshots []Snapshot `json:"snapshots" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalPlacementGroupCollection unmarshals an instance of PlacementGroupCollection from the specified map of raw messages. -func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPlacementGroupCollectionFirst) +// UnmarshalSnapshotCollection unmarshals an instance of SnapshotCollection from the specified map of raw messages. +func UnmarshalSnapshotCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotCollectionFirst) if err != nil { return } @@ -60937,11 +73568,11 @@ func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result inte if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPlacementGroupCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "placement_groups", &obj.PlacementGroups, UnmarshalPlacementGroup) + err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshot) if err != nil { return } @@ -60954,7 +73585,7 @@ func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result inte } // Retrieve the value to be passed to a request to access the next page of results -func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { +func (resp *SnapshotCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -60965,15 +73596,15 @@ func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { return start, nil } -// PlacementGroupCollectionFirst : A link to the first page of resources. -type PlacementGroupCollectionFirst struct { +// SnapshotCollectionFirst : A link to the first page of resources. +type SnapshotCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalPlacementGroupCollectionFirst unmarshals an instance of PlacementGroupCollectionFirst from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionFirst) +// UnmarshalSnapshotCollectionFirst unmarshals an instance of SnapshotCollectionFirst from the specified map of raw messages. +func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -60982,15 +73613,15 @@ func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result return } -// PlacementGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PlacementGroupCollectionNext struct { +// SnapshotCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SnapshotCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalPlacementGroupCollectionNext unmarshals an instance of PlacementGroupCollectionNext from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionNext) +// UnmarshalSnapshotCollectionNext unmarshals an instance of SnapshotCollectionNext from the specified map of raw messages. +func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -60999,105 +73630,74 @@ func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result return } -// PlacementGroupPatch : PlacementGroupPatch struct -type PlacementGroupPatch struct { - // The name for this placement group. The name must not be used by another placement group in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalPlacementGroupPatch unmarshals an instance of PlacementGroupPatch from the specified map of raw messages. -func UnmarshalPlacementGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the PlacementGroupPatch -func (placementGroupPatch *PlacementGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(placementGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// PlacementGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type PlacementGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalPlacementGroupReferenceDeleted unmarshals an instance of PlacementGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalPlacementGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// SnapshotConsistencyGroup : SnapshotConsistencyGroup struct +type SnapshotConsistencyGroup struct { + // If present, the backup policy plan which created this snapshot consistency group. + BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` -// PublicGateway : PublicGateway struct -type PublicGateway struct { - // The date and time that the public gateway was created. + // The date and time that this snapshot consistency group was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this public gateway. + // The CRN of this snapshot consistency group. CRN *string `json:"crn" validate:"required"` - // The floating IP bound to this public gateway. - FloatingIP *PublicGatewayFloatingIP `json:"floating_ip" validate:"required"` + // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. + DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete" validate:"required"` - // The URL for this public gateway. + // The URL for this snapshot consistency group. Href *string `json:"href" validate:"required"` - // The unique identifier for this public gateway. + // The unique identifier for this snapshot consistency group. ID *string `json:"id" validate:"required"` - // The name for this public gateway. The name is unique across all public gateways in the VPC. + // The lifecycle state of this snapshot consistency group. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this snapshot consistency group. The name is unique across all snapshot consistency groups in the + // region. Name *string `json:"name" validate:"required"` - // The resource group for this public gateway. + // The resource group for this snapshot consistency group. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of this public gateway. - Status *string `json:"status" validate:"required"` - - // The VPC this public gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The [service tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot consistency + // group. Each tag is prefixed with + // [is.instance:](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-faqs). + ServiceTags []string `json:"service_tags" validate:"required"` - // The zone this public gateway resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The member snapshots that are data-consistent with respect to captured time. (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + Snapshots []SnapshotConsistencyGroupSnapshotsItem `json:"snapshots" validate:"required"` } -// Constants associated with the PublicGateway.ResourceType property. -// The resource type. +// Constants associated with the SnapshotConsistencyGroup.LifecycleState property. +// The lifecycle state of this snapshot consistency group. const ( - PublicGatewayResourceTypePublicGatewayConst = "public_gateway" + SnapshotConsistencyGroupLifecycleStateDeletingConst = "deleting" + SnapshotConsistencyGroupLifecycleStateFailedConst = "failed" + SnapshotConsistencyGroupLifecycleStatePendingConst = "pending" + SnapshotConsistencyGroupLifecycleStateStableConst = "stable" + SnapshotConsistencyGroupLifecycleStateSuspendedConst = "suspended" + SnapshotConsistencyGroupLifecycleStateUpdatingConst = "updating" + SnapshotConsistencyGroupLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the PublicGateway.Status property. -// The status of this public gateway. +// Constants associated with the SnapshotConsistencyGroup.ResourceType property. +// The resource type. const ( - PublicGatewayStatusAvailableConst = "available" - PublicGatewayStatusDeletingConst = "deleting" - PublicGatewayStatusFailedConst = "failed" - PublicGatewayStatusPendingConst = "pending" + SnapshotConsistencyGroupResourceTypeSnapshotConsistencyGroupConst = "snapshot_consistency_group" ) -// UnmarshalPublicGateway unmarshals an instance of PublicGateway from the specified map of raw messages. -func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGateway) +// UnmarshalSnapshotConsistencyGroup unmarshals an instance of SnapshotConsistencyGroup from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroup) + err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -61106,7 +73706,7 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalModel(m, "floating_ip", &obj.FloatingIP, UnmarshalPublicGatewayFloatingIP) + err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) if err != nil { return } @@ -61118,27 +73718,27 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalPrimitive(m, "service_tags", &obj.ServiceTags) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupSnapshotsItem) if err != nil { return } @@ -61146,29 +73746,29 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e return } -// PublicGatewayCollection : PublicGatewayCollection struct -type PublicGatewayCollection struct { +// SnapshotConsistencyGroupCollection : SnapshotConsistencyGroupCollection struct +type SnapshotConsistencyGroupCollection struct { // A link to the first page of resources. - First *PublicGatewayCollectionFirst `json:"first" validate:"required"` + First *SnapshotConsistencyGroupCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *PublicGatewayCollectionNext `json:"next,omitempty"` + Next *SnapshotConsistencyGroupCollectionNext `json:"next,omitempty"` - // Collection of public gateways. - PublicGateways []PublicGateway `json:"public_gateways" validate:"required"` + // Collection of snapshot consistency groups. + SnapshotConsistencyGroups []SnapshotConsistencyGroup `json:"snapshot_consistency_groups" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalPublicGatewayCollection unmarshals an instance of PublicGatewayCollection from the specified map of raw messages. -func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPublicGatewayCollectionFirst) +// UnmarshalSnapshotConsistencyGroupCollection unmarshals an instance of SnapshotConsistencyGroupCollection from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotConsistencyGroupCollectionFirst) if err != nil { return } @@ -61176,11 +73776,11 @@ func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPublicGatewayCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotConsistencyGroupCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "public_gateways", &obj.PublicGateways, UnmarshalPublicGateway) + err = core.UnmarshalModel(m, "snapshot_consistency_groups", &obj.SnapshotConsistencyGroups, UnmarshalSnapshotConsistencyGroup) if err != nil { return } @@ -61193,7 +73793,7 @@ func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result inter } // Retrieve the value to be passed to a request to access the next page of results -func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { +func (resp *SnapshotConsistencyGroupCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -61204,15 +73804,15 @@ func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { return start, nil } -// PublicGatewayCollectionFirst : A link to the first page of resources. -type PublicGatewayCollectionFirst struct { +// SnapshotConsistencyGroupCollectionFirst : A link to the first page of resources. +type SnapshotConsistencyGroupCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalPublicGatewayCollectionFirst unmarshals an instance of PublicGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionFirst) +// UnmarshalSnapshotConsistencyGroupCollectionFirst unmarshals an instance of SnapshotConsistencyGroupCollectionFirst from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -61221,15 +73821,15 @@ func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result return } -// PublicGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PublicGatewayCollectionNext struct { +// SnapshotConsistencyGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SnapshotConsistencyGroupCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalPublicGatewayCollectionNext unmarshals an instance of PublicGatewayCollectionNext from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionNext) +// UnmarshalSnapshotConsistencyGroupCollectionNext unmarshals an instance of SnapshotConsistencyGroupCollectionNext from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -61238,48 +73838,20 @@ func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result i return } -// PublicGatewayFloatingIP : The floating IP bound to this public gateway. -type PublicGatewayFloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` +// SnapshotConsistencyGroupPatch : SnapshotConsistencyGroupPatch struct +type SnapshotConsistencyGroupPatch struct { + // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. + DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` + // The name for this snapshot consistency group. The name must not be used by another snapshot consistency groups in + // the region. + Name *string `json:"name,omitempty"` } -// UnmarshalPublicGatewayFloatingIP unmarshals an instance of PublicGatewayFloatingIP from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSnapshotConsistencyGroupPatch unmarshals an instance of SnapshotConsistencyGroupPatch from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupPatch) + err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) if err != nil { return } @@ -61291,64 +73863,62 @@ func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result inter return } -// PublicGatewayFloatingIPPrototype : PublicGatewayFloatingIPPrototype struct -// Models which "extend" this model: -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentity -// - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext -type PublicGatewayFloatingIPPrototype struct { - // The unique identifier for this floating IP. - ID *string `json:"id,omitempty"` - - // The CRN for this floating IP. - CRN *string `json:"crn,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href,omitempty"` +// AsPatch returns a generic map representation of the SnapshotConsistencyGroupPatch +func (snapshotConsistencyGroupPatch *SnapshotConsistencyGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(snapshotConsistencyGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The globally unique IP address. - Address *string `json:"address,omitempty"` +// SnapshotConsistencyGroupPrototype : SnapshotConsistencyGroupPrototype struct +// Models which "extend" this model: +// - SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots +type SnapshotConsistencyGroupPrototype struct { + // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. + DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. + // The name for this snapshot consistency group. The name must be unique across all snapshot consistency groups in the + // region. + // + // If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The data-consistent member snapshots to create. All snapshots must specify a + // `source_volume` attached to the same virtual server instance. + Snapshots []SnapshotConsistencyGroupPrototypeSnapshotsItem `json:"snapshots,omitempty"` } -func (*PublicGatewayFloatingIPPrototype) isaPublicGatewayFloatingIPPrototype() bool { +func (*SnapshotConsistencyGroupPrototype) isaSnapshotConsistencyGroupPrototype() bool { return true } -type PublicGatewayFloatingIPPrototypeIntf interface { - isaPublicGatewayFloatingIPPrototype() bool +type SnapshotConsistencyGroupPrototypeIntf interface { + isaSnapshotConsistencyGroupPrototype() bool } -// UnmarshalPublicGatewayFloatingIPPrototype unmarshals an instance of PublicGatewayFloatingIPPrototype from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSnapshotConsistencyGroupPrototype unmarshals an instance of SnapshotConsistencyGroupPrototype from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupPrototype) + err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem) if err != nil { return } @@ -61356,42 +73926,40 @@ func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, res return } -// PublicGatewayIdentity : Identifies a public gateway by a unique property. -// Models which "extend" this model: -// - PublicGatewayIdentityPublicGatewayIdentityByID -// - PublicGatewayIdentityPublicGatewayIdentityByCRN -// - PublicGatewayIdentityPublicGatewayIdentityByHref -type PublicGatewayIdentity struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` +// SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem : SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem struct +type SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem struct { + // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The URL for this public gateway. - Href *string `json:"href,omitempty"` -} + // The volume to create this snapshot from. + SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` -func (*PublicGatewayIdentity) isaPublicGatewayIdentity() bool { - return true + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` } -type PublicGatewayIdentityIntf interface { - isaPublicGatewayIdentity() bool +// NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem : Instantiate SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem (Generic Model Constructor) +func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem(sourceVolume VolumeIdentityIntf) (_model *SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem, err error) { + _model = &SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem{ + SourceVolume: sourceVolume, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalPublicGatewayIdentity unmarshals an instance of PublicGatewayIdentity from the specified map of raw messages. -func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } @@ -61399,69 +73967,84 @@ func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interfa return } -// PublicGatewayPatch : PublicGatewayPatch struct -type PublicGatewayPatch struct { - // The name for this public gateway. The name must not be used by another public gateway in the VPC. +// SnapshotConsistencyGroupPrototypeSnapshotsItem : SnapshotConsistencyGroupPrototypeSnapshotsItem struct +type SnapshotConsistencyGroupPrototypeSnapshotsItem struct { + // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name + // will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` + + // The volume to create this snapshot from. + SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` + + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` } -// UnmarshalPublicGatewayPatch unmarshals an instance of PublicGatewayPatch from the specified map of raw messages. -func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewSnapshotConsistencyGroupPrototypeSnapshotsItem : Instantiate SnapshotConsistencyGroupPrototypeSnapshotsItem (Generic Model Constructor) +func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotsItem(sourceVolume VolumeIdentityIntf) (_model *SnapshotConsistencyGroupPrototypeSnapshotsItem, err error) { + _model = &SnapshotConsistencyGroupPrototypeSnapshotsItem{ + SourceVolume: sourceVolume, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// AsPatch returns a generic map representation of the PublicGatewayPatch -func (publicGatewayPatch *PublicGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(publicGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotsItem from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupPrototypeSnapshotsItem) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// PublicGatewayReference : PublicGatewayReference struct -type PublicGatewayReference struct { - // The CRN for this public gateway. +// SnapshotConsistencyGroupReference : SnapshotConsistencyGroupReference struct +type SnapshotConsistencyGroupReference struct { + // The CRN of this snapshot consistency group. CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` + Deleted *SnapshotConsistencyGroupReferenceDeleted `json:"deleted,omitempty"` - // The URL for this public gateway. + // The URL for this snapshot consistency group. Href *string `json:"href" validate:"required"` - // The unique identifier for this public gateway. + // The unique identifier for this snapshot consistency group. ID *string `json:"id" validate:"required"` - // The name for this public gateway. The name is unique across all public gateways in the VPC. + // The name for this snapshot consistency group. The name is unique across all snapshot consistency groups in the + // region. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the PublicGatewayReference.ResourceType property. +// Constants associated with the SnapshotConsistencyGroupReference.ResourceType property. // The resource type. const ( - PublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" + SnapshotConsistencyGroupReferenceResourceTypeSnapshotConsistencyGroupConst = "snapshot_consistency_group" ) -// UnmarshalPublicGatewayReference unmarshals an instance of PublicGatewayReference from the specified map of raw messages. -func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReference) +// UnmarshalSnapshotConsistencyGroupReference unmarshals an instance of SnapshotConsistencyGroupReference from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotConsistencyGroupReferenceDeleted) if err != nil { return } @@ -61485,16 +74068,16 @@ func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interf return } -// PublicGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// SnapshotConsistencyGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary // information. -type PublicGatewayReferenceDeleted struct { +type SnapshotConsistencyGroupReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalPublicGatewayReferenceDeleted unmarshals an instance of PublicGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReferenceDeleted) +// UnmarshalSnapshotConsistencyGroupReferenceDeleted unmarshals an instance of SnapshotConsistencyGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -61503,32 +74086,46 @@ func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result return } -// Region : Region struct -type Region struct { - // The API endpoint for this region. - Endpoint *string `json:"endpoint" validate:"required"` +// SnapshotConsistencyGroupSnapshotsItem : SnapshotConsistencyGroupSnapshotsItem struct +type SnapshotConsistencyGroupSnapshotsItem struct { + // The CRN of this snapshot. + CRN *string `json:"crn" validate:"required"` - // The URL for this region. + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this snapshot. Href *string `json:"href" validate:"required"` - // The globally unique name for this region. + // The unique identifier for this snapshot. + ID *string `json:"id" validate:"required"` + + // The name for this snapshot. The name is unique across all snapshots in the region. Name *string `json:"name" validate:"required"` - // The availability status of this region. - Status *string `json:"status" validate:"required"` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *SnapshotRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the Region.Status property. -// The availability status of this region. +// Constants associated with the SnapshotConsistencyGroupSnapshotsItem.ResourceType property. +// The resource type. const ( - RegionStatusAvailableConst = "available" - RegionStatusUnavailableConst = "unavailable" + SnapshotConsistencyGroupSnapshotsItemResourceTypeSnapshotConst = "snapshot" ) -// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. -func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Region) - err = core.UnmarshalPrimitive(m, "endpoint", &obj.Endpoint) +// UnmarshalSnapshotConsistencyGroupSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupSnapshotsItem from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupSnapshotsItem) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) if err != nil { return } @@ -61536,11 +74133,19 @@ func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err erro if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -61548,16 +74153,66 @@ func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err erro return } -// RegionCollection : RegionCollection struct -type RegionCollection struct { - // Collection of regions. - Regions []Region `json:"regions" validate:"required"` +// SnapshotCopiesItem : SnapshotCopiesItem struct +type SnapshotCopiesItem struct { + // The CRN for the copied snapshot. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` + + // The URL for the copied snapshot. + Href *string `json:"href" validate:"required"` + + // The unique identifier for the copied snapshot. + ID *string `json:"id" validate:"required"` + + // The name for the copied snapshot. + Name *string `json:"name" validate:"required"` + + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *SnapshotRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalRegionCollection unmarshals an instance of RegionCollection from the specified map of raw messages. -func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionCollection) - err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) +// Constants associated with the SnapshotCopiesItem.ResourceType property. +// The resource type. +const ( + SnapshotCopiesItemResourceTypeSnapshotConst = "snapshot" +) + +// UnmarshalSnapshotCopiesItem unmarshals an instance of SnapshotCopiesItem from the specified map of raw messages. +func UnmarshalSnapshotCopiesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCopiesItem) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -61565,30 +74220,38 @@ func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) return } -// RegionIdentity : Identifies a region by a unique property. +// SnapshotIdentity : Identifies a snapshot by a unique property. // Models which "extend" this model: -// - RegionIdentityByName -// - RegionIdentityByHref -type RegionIdentity struct { - // The globally unique name for this region. - Name *string `json:"name,omitempty"` +// - SnapshotIdentityByID +// - SnapshotIdentityByCRN +// - SnapshotIdentityByHref +type SnapshotIdentity struct { + // The unique identifier for this snapshot. + ID *string `json:"id,omitempty"` - // The URL for this region. + // The CRN of this snapshot. + CRN *string `json:"crn,omitempty"` + + // The URL for this snapshot. Href *string `json:"href,omitempty"` } -func (*RegionIdentity) isaRegionIdentity() bool { +func (*SnapshotIdentity) isaSnapshotIdentity() bool { return true } -type RegionIdentityIntf interface { - isaRegionIdentity() bool +type SnapshotIdentityIntf interface { + isaSnapshotIdentity() bool } -// UnmarshalRegionIdentity unmarshals an instance of RegionIdentity from the specified map of raw messages. -func UnmarshalRegionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalSnapshotIdentity unmarshals an instance of SnapshotIdentity from the specified map of raw messages. +func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -61600,23 +74263,23 @@ func UnmarshalRegionIdentity(m map[string]json.RawMessage, result interface{}) ( return } -// RegionReference : RegionReference struct -type RegionReference struct { - // The URL for this region. - Href *string `json:"href" validate:"required"` +// SnapshotPatch : SnapshotPatch struct +type SnapshotPatch struct { + // The name for this snapshot. The name must not be used by another snapshot in the region. + Name *string `json:"name,omitempty"` - // The globally unique name for this region. - Name *string `json:"name" validate:"required"` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` } -// UnmarshalRegionReference unmarshals an instance of RegionReference from the specified map of raw messages. -func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalSnapshotPatch unmarshals an instance of SnapshotPatch from the specified map of raw messages. +func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } @@ -61624,501 +74287,428 @@ func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) return } -// RemoveBareMetalServerNetworkInterfaceFloatingIPOptions : The RemoveBareMetalServerNetworkInterfaceFloatingIP options. -type RemoveBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate RemoveBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - return &RemoveBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// RemoveEndpointGatewayIPOptions : The RemoveEndpointGatewayIP options. -type RemoveEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveEndpointGatewayIPOptions : Instantiate RemoveEndpointGatewayIPOptions -func (*VpcV1) NewRemoveEndpointGatewayIPOptions(endpointGatewayID string, id string) *RemoveEndpointGatewayIPOptions { - return &RemoveEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), - } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *RemoveEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *RemoveEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveEndpointGatewayIPOptions) SetID(id string) *RemoveEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveEndpointGatewayIPOptions) SetHeaders(param map[string]string) *RemoveEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// RemoveInstanceNetworkInterfaceFloatingIPOptions : The RemoveInstanceNetworkInterfaceFloatingIP options. -type RemoveInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveInstanceNetworkInterfaceFloatingIPOptions : Instantiate RemoveInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - return &RemoveInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// AsPatch returns a generic map representation of the SnapshotPatch +func (snapshotPatch *SnapshotPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(snapshotPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} +// SnapshotPrototype : SnapshotPrototype struct +// Models which "extend" this model: +// - SnapshotPrototypeSnapshotBySourceVolume +// - SnapshotPrototypeSnapshotBySourceSnapshot +type SnapshotPrototype struct { + // Clones to create for this snapshot. + Clones []SnapshotClonePrototype `json:"clones,omitempty"` -// RemoveVPNGatewayConnectionLocalCIDROptions : The RemoveVPNGatewayConnectionLocalCIDR options. -type RemoveVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + // The volume to create this snapshot from. + SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The root key to use to wrap the data encryption key for this snapshot. + // + // A key must be specified if and only if the source snapshot has an `encryption` type of + // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify + // a key in the same region as the new snapshot, and use the same encryption key for all + // snapshots using the same source volume. + // + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` -// NewRemoveVPNGatewayConnectionLocalCIDROptions : Instantiate RemoveVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - return &RemoveVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } + // The source snapshot (in another region) to create this snapshot from. + // The specified snapshot must not already be the source of another snapshot in this + // region. + SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot,omitempty"` } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +func (*SnapshotPrototype) isaSnapshotPrototype() bool { + return true } -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options +type SnapshotPrototypeIntf interface { + isaSnapshotPrototype() bool } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// UnmarshalSnapshotPrototype unmarshals an instance of SnapshotPrototype from the specified map of raw messages. +func UnmarshalSnapshotPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotPrototype) + err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} +// SnapshotReference : SnapshotReference struct +type SnapshotReference struct { + // The CRN of this snapshot. + CRN *string `json:"crn" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` -// RemoveVPNGatewayConnectionPeerCIDROptions : The RemoveVPNGatewayConnectionPeerCIDR options. -type RemoveVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + // The URL for this snapshot. + Href *string `json:"href" validate:"required"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this snapshot. + ID *string `json:"id" validate:"required"` - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + // The name for this snapshot. The name is unique across all snapshots in the region. + Name *string `json:"name" validate:"required"` - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *SnapshotRemote `json:"remote,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewRemoveVPNGatewayConnectionPeerCIDROptions : Instantiate RemoveVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - return &RemoveVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} +// Constants associated with the SnapshotReference.ResourceType property. +// The resource type. +const ( + SnapshotReferenceResourceTypeSnapshotConst = "snapshot" +) -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +// UnmarshalSnapshotReference unmarshals an instance of SnapshotReference from the specified map of raw messages. +func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options +// SnapshotReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type SnapshotReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// UnmarshalSnapshotReferenceDeleted unmarshals an instance of SnapshotReferenceDeleted from the specified map of raw messages. +func UnmarshalSnapshotReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options +// SnapshotRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type SnapshotRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options +// UnmarshalSnapshotRemote unmarshals an instance of SnapshotRemote from the specified map of raw messages. +func UnmarshalSnapshotRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotRemote) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReplaceLoadBalancerPoolMembersOptions : The ReplaceLoadBalancerPoolMembers options. -type ReplaceLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// SnapshotSourceSnapshot : If present, the source snapshot this snapshot was created from. +type SnapshotSourceSnapshot struct { + // The CRN of the source snapshot. + CRN *string `json:"crn" validate:"required"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - // The member prototype objects for this pool. - Members []LoadBalancerPoolMemberPrototype `json:"members" validate:"required"` + // The URL for the source snapshot. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The unique identifier for the source snapshot. + ID *string `json:"id" validate:"required"` -// NewReplaceLoadBalancerPoolMembersOptions : Instantiate ReplaceLoadBalancerPoolMembersOptions -func (*VpcV1) NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string, members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - return &ReplaceLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Members: members, - } -} + // The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region. + Name *string `json:"name" validate:"required"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *SnapshotRemote `json:"remote,omitempty"` -// SetPoolID : Allow user to set PoolID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// SetMembers : Allow user to set Members -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - _options.Members = members - return _options -} +// Constants associated with the SnapshotSourceSnapshot.ResourceType property. +// The resource type. +const ( + SnapshotSourceSnapshotResourceTypeSnapshotConst = "snapshot" +) -// SetHeaders : Allow user to set Headers -func (options *ReplaceLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ReplaceLoadBalancerPoolMembersOptions { - options.Headers = param - return options +// UnmarshalSnapshotSourceSnapshot unmarshals an instance of SnapshotSourceSnapshot from the specified map of raw messages. +func UnmarshalSnapshotSourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotSourceSnapshot) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReplaceSubnetNetworkACLOptions : The ReplaceSubnetNetworkACL options. -type ReplaceSubnetNetworkACLOptions struct { - // The subnet identifier. +// StartBareMetalServerOptions : The StartBareMetalServer options. +type StartBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` - // The network ACL identity. - NetworkACLIdentity NetworkACLIdentityIntf `json:"NetworkACLIdentity" validate:"required"` - // Allows users to set headers on API requests Headers map[string]string } -// NewReplaceSubnetNetworkACLOptions : Instantiate ReplaceSubnetNetworkACLOptions -func (*VpcV1) NewReplaceSubnetNetworkACLOptions(id string, networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - return &ReplaceSubnetNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLIdentity: networkACLIdentity, +// NewStartBareMetalServerOptions : Instantiate StartBareMetalServerOptions +func (*VpcV1) NewStartBareMetalServerOptions(id string) *StartBareMetalServerOptions { + return &StartBareMetalServerOptions{ + ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *ReplaceSubnetNetworkACLOptions) SetID(id string) *ReplaceSubnetNetworkACLOptions { +func (_options *StartBareMetalServerOptions) SetID(id string) *StartBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } -// SetNetworkACLIdentity : Allow user to set NetworkACLIdentity -func (_options *ReplaceSubnetNetworkACLOptions) SetNetworkACLIdentity(networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - _options.NetworkACLIdentity = networkACLIdentity - return _options -} - // SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetNetworkACLOptions) SetHeaders(param map[string]string) *ReplaceSubnetNetworkACLOptions { +func (options *StartBareMetalServerOptions) SetHeaders(param map[string]string) *StartBareMetalServerOptions { options.Headers = param return options } -// ReplaceSubnetRoutingTableOptions : The ReplaceSubnetRoutingTable options. -type ReplaceSubnetRoutingTableOptions struct { - // The subnet identifier. +// StopBareMetalServerOptions : The StopBareMetalServer options. +type StopBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` - // The routing table identity. - RoutingTableIdentity RoutingTableIdentityIntf `json:"RoutingTableIdentity" validate:"required"` + // The type of stop operation: + // - `soft`: signal running operating system to quiesce and shutdown cleanly + // - `hard`: immediately stop the server. + Type *string `json:"type" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewReplaceSubnetRoutingTableOptions : Instantiate ReplaceSubnetRoutingTableOptions -func (*VpcV1) NewReplaceSubnetRoutingTableOptions(id string, routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - return &ReplaceSubnetRoutingTableOptions{ - ID: core.StringPtr(id), - RoutingTableIdentity: routingTableIdentity, +// Constants associated with the StopBareMetalServerOptions.Type property. +// The type of stop operation: +// - `soft`: signal running operating system to quiesce and shutdown cleanly +// - `hard`: immediately stop the server. +const ( + StopBareMetalServerOptionsTypeHardConst = "hard" + StopBareMetalServerOptionsTypeSoftConst = "soft" +) + +// NewStopBareMetalServerOptions : Instantiate StopBareMetalServerOptions +func (*VpcV1) NewStopBareMetalServerOptions(id string, typeVar string) *StopBareMetalServerOptions { + return &StopBareMetalServerOptions{ + ID: core.StringPtr(id), + Type: core.StringPtr(typeVar), } } // SetID : Allow user to set ID -func (_options *ReplaceSubnetRoutingTableOptions) SetID(id string) *ReplaceSubnetRoutingTableOptions { +func (_options *StopBareMetalServerOptions) SetID(id string) *StopBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } -// SetRoutingTableIdentity : Allow user to set RoutingTableIdentity -func (_options *ReplaceSubnetRoutingTableOptions) SetRoutingTableIdentity(routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - _options.RoutingTableIdentity = routingTableIdentity +// SetType : Allow user to set Type +func (_options *StopBareMetalServerOptions) SetType(typeVar string) *StopBareMetalServerOptions { + _options.Type = core.StringPtr(typeVar) return _options } // SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]string) *ReplaceSubnetRoutingTableOptions { +func (options *StopBareMetalServerOptions) SetHeaders(param map[string]string) *StopBareMetalServerOptions { options.Headers = param return options } -// Reservation : Reservation struct -type Reservation struct { - // The affinity policy to use for this reservation: - // - `restricted`: The reservation must be manually requested - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - AffinityPolicy *string `json:"affinity_policy" validate:"required"` - - // The capacity configuration for this reservation - // - // If absent, this reservation has no assigned capacity. - Capacity *ReservationCapacity `json:"capacity,omitempty"` - - // The committed use configuration for this reservation. - // - // If absent, this reservation has no commitment for use. - CommittedUse *ReservationCommittedUse `json:"committed_use,omitempty"` +// Subnet : Subnet struct +type Subnet struct { + // The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the + // provider. + AvailableIpv4AddressCount *int64 `json:"available_ipv4_address_count" validate:"required"` - // The date and time that the reservation was created. + // The date and time that the subnet was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this reservation. + // The CRN for this subnet. CRN *string `json:"crn" validate:"required"` - // The URL for this reservation. + // The URL for this subnet. Href *string `json:"href" validate:"required"` - // The unique identifier for this reservation. + // The unique identifier for this subnet. ID *string `json:"id" validate:"required"` - // The lifecycle state of this reservation. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The IP version(s) supported by this subnet. + IPVersion *string `json:"ip_version" validate:"required"` - // The name for this reservation. The name is unique across all reservations in the region. + // The IPv4 range of the subnet, expressed in CIDR format. + Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` + + // The name for this subnet. The name is unique across all subnets in the VPC. Name *string `json:"name" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. - Profile ReservationProfileIntf `json:"profile" validate:"required"` + // The network ACL for this subnet. + NetworkACL *NetworkACLReference `json:"network_acl" validate:"required"` - // The resource group for this reservation. + // The public gateway to use for internet-bound traffic for this subnet. + PublicGateway *PublicGatewayReference `json:"public_gateway,omitempty"` + + // The resource group for this subnet. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the reservation. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. + // The routing table for this subnet. + RoutingTable *RoutingTableReference `json:"routing_table" validate:"required"` + + // The status of the subnet. Status *string `json:"status" validate:"required"` - // The reasons for the current status (if any). + // The total number of IPv4 addresses in this subnet. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ReservationStatusReason `json:"status_reasons" validate:"required"` + // Note: This is calculated as 2(32 - prefix length). For example, the prefix length `/24` gives:
+ // 2(32 - 24) = 28 = 256 addresses. + TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` - // The zone for this reservation. + // The VPC this subnet resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // The zone this subnet resides in. Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the Reservation.AffinityPolicy property. -// The affinity policy to use for this reservation: -// - `restricted`: The reservation must be manually requested -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationAffinityPolicyRestrictedConst = "restricted" -) - -// Constants associated with the Reservation.LifecycleState property. -// The lifecycle state of this reservation. +// Constants associated with the Subnet.IPVersion property. +// The IP version(s) supported by this subnet. const ( - ReservationLifecycleStateDeletingConst = "deleting" - ReservationLifecycleStateFailedConst = "failed" - ReservationLifecycleStatePendingConst = "pending" - ReservationLifecycleStateStableConst = "stable" - ReservationLifecycleStateSuspendedConst = "suspended" - ReservationLifecycleStateUpdatingConst = "updating" - ReservationLifecycleStateWaitingConst = "waiting" + SubnetIPVersionIpv4Const = "ipv4" ) -// Constants associated with the Reservation.ResourceType property. +// Constants associated with the Subnet.ResourceType property. // The resource type. const ( - ReservationResourceTypeReservationConst = "reservation" -) - -// Constants associated with the Reservation.Status property. -// The status of the reservation. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationStatusActivatingConst = "activating" - ReservationStatusActiveConst = "active" - ReservationStatusDeactivatingConst = "deactivating" - ReservationStatusExpiredConst = "expired" - ReservationStatusFailedConst = "failed" - ReservationStatusInactiveConst = "inactive" + SubnetResourceTypeSubnetConst = "subnet" ) - -// UnmarshalReservation unmarshals an instance of Reservation from the specified map of raw messages. -func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Reservation) - err = core.UnmarshalPrimitive(m, "affinity_policy", &obj.AffinityPolicy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUse) + +// Constants associated with the Subnet.Status property. +// The status of the subnet. +const ( + SubnetStatusAvailableConst = "available" + SubnetStatusDeletingConst = "deleting" + SubnetStatusFailedConst = "failed" + SubnetStatusPendingConst = "pending" +) + +// UnmarshalSubnet unmarshals an instance of Subnet from the specified map of raw messages. +func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Subnet) + err = core.UnmarshalPrimitive(m, "available_ipv4_address_count", &obj.AvailableIpv4AddressCount) if err != nil { return } @@ -62138,99 +74728,35 @@ func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfile) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLReference) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalReservationStatusReason) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayReference) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacity : The capacity configuration for this reservation -// -// If absent, this reservation has no assigned capacity. -type ReservationCapacity struct { - // The amount allocated to this capacity reservation. - Allocated *int64 `json:"allocated" validate:"required"` - - // The amount of this capacity reservation available for new attachments. - Available *int64 `json:"available" validate:"required"` - - // The status of the capacity reservation: - // - `allocating`: The capacity reservation is being allocated for use - // - `allocated`: The total capacity of the reservation has been allocated for use - // - `degraded`: The capacity reservation has been allocated for use, but some of the - // capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more - // information. - // - `unallocated`: The capacity reservation is not allocated for use - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The total amount of this capacity reservation. - Total *int64 `json:"total" validate:"required"` - - // The amount of this capacity reservation used by existing attachments. - Used *int64 `json:"used" validate:"required"` -} - -// Constants associated with the ReservationCapacity.Status property. -// The status of the capacity reservation: -// - `allocating`: The capacity reservation is being allocated for use -// - `allocated`: The total capacity of the reservation has been allocated for use -// - `degraded`: The capacity reservation has been allocated for use, but some of the -// capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more -// information. -// - `unallocated`: The capacity reservation is not allocated for use -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCapacityStatusAllocatedConst = "allocated" - ReservationCapacityStatusAllocatingConst = "allocating" - ReservationCapacityStatusDegradedConst = "degraded" - ReservationCapacityStatusUnallocatedConst = "unallocated" -) - -// UnmarshalReservationCapacity unmarshals an instance of ReservationCapacity from the specified map of raw messages. -func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacity) - err = core.UnmarshalPrimitive(m, "allocated", &obj.Allocated) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "available", &obj.Available) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableReference) if err != nil { return } @@ -62238,56 +74764,15 @@ func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "total", &obj.Total) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "used", &obj.Used) + err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacityPatch : The capacity reservation configuration to use. -// -// The configuration can only be changed for reservations with a `status` of `inactive`. -type ReservationCapacityPatch struct { - // The total amount to use for this capacity reservation. - Total *int64 `json:"total,omitempty"` -} - -// UnmarshalReservationCapacityPatch unmarshals an instance of ReservationCapacityPatch from the specified map of raw messages. -func UnmarshalReservationCapacityPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacityPatch) - err = core.UnmarshalPrimitive(m, "total", &obj.Total) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacityPrototype : The capacity reservation configuration to use. -type ReservationCapacityPrototype struct { - // The total amount to use for this capacity reservation. - Total *int64 `json:"total" validate:"required"` -} - -// NewReservationCapacityPrototype : Instantiate ReservationCapacityPrototype (Generic Model Constructor) -func (*VpcV1) NewReservationCapacityPrototype(total int64) (_model *ReservationCapacityPrototype, err error) { - _model = &ReservationCapacityPrototype{ - Total: core.Int64Ptr(total), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalReservationCapacityPrototype unmarshals an instance of ReservationCapacityPrototype from the specified map of raw messages. -func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacityPrototype) - err = core.UnmarshalPrimitive(m, "total", &obj.Total) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -62295,29 +74780,29 @@ func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result return } -// ReservationCollection : ReservationCollection struct -type ReservationCollection struct { +// SubnetCollection : SubnetCollection struct +type SubnetCollection struct { // A link to the first page of resources. - First *ReservationCollectionFirst `json:"first" validate:"required"` + First *SubnetCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *ReservationCollectionNext `json:"next,omitempty"` + Next *SubnetCollectionNext `json:"next,omitempty"` - // Collection of reservations. - Reservations []Reservation `json:"reservations" validate:"required"` + // Collection of subnets. + Subnets []Subnet `json:"subnets" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalReservationCollection unmarshals an instance of ReservationCollection from the specified map of raw messages. -func UnmarshalReservationCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservationCollectionFirst) +// UnmarshalSubnetCollection unmarshals an instance of SubnetCollection from the specified map of raw messages. +func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSubnetCollectionFirst) if err != nil { return } @@ -62325,11 +74810,11 @@ func UnmarshalReservationCollection(m map[string]json.RawMessage, result interfa if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservationCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSubnetCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "reservations", &obj.Reservations, UnmarshalReservation) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnet) if err != nil { return } @@ -62342,7 +74827,7 @@ func UnmarshalReservationCollection(m map[string]json.RawMessage, result interfa } // Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservationCollection) GetNextStart() (*string, error) { +func (resp *SubnetCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -62353,15 +74838,15 @@ func (resp *ReservationCollection) GetNextStart() (*string, error) { return start, nil } -// ReservationCollectionFirst : A link to the first page of resources. -type ReservationCollectionFirst struct { +// SubnetCollectionFirst : A link to the first page of resources. +type SubnetCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalReservationCollectionFirst unmarshals an instance of ReservationCollectionFirst from the specified map of raw messages. -func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollectionFirst) +// UnmarshalSubnetCollectionFirst unmarshals an instance of SubnetCollectionFirst from the specified map of raw messages. +func UnmarshalSubnetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -62370,15 +74855,15 @@ func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result in return } -// ReservationCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservationCollectionNext struct { +// SubnetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SubnetCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalReservationCollectionNext unmarshals an instance of ReservationCollectionNext from the specified map of raw messages. -func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollectionNext) +// UnmarshalSubnetCollectionNext unmarshals an instance of SubnetCollectionNext from the specified map of raw messages. +func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -62387,200 +74872,33 @@ func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result int return } -// ReservationCommittedUse : The committed use reservation configuration. -type ReservationCommittedUse struct { - // The expiration date and time for this committed use reservation. - ExpirationAt *strfmt.DateTime `json:"expiration_at" validate:"required"` - - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy" validate:"required"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - Term *string `json:"term" validate:"required"` -} - -// Constants associated with the ReservationCommittedUse.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUseExpirationPolicyReleaseConst = "release" - ReservationCommittedUseExpirationPolicyRenewConst = "renew" -) - -// UnmarshalReservationCommittedUse unmarshals an instance of ReservationCommittedUse from the specified map of raw messages. -func UnmarshalReservationCommittedUse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUse) - err = core.UnmarshalPrimitive(m, "expiration_at", &obj.ExpirationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCommittedUsePatch : ReservationCommittedUsePatch struct -type ReservationCommittedUsePatch struct { - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy,omitempty"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The specified value must be listed in the `reservation_terms` in the profile for this reservation. The term can only - // be changed for a reservation with a `status` of - // `inactive`. - Term *string `json:"term,omitempty"` -} - -// Constants associated with the ReservationCommittedUsePatch.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUsePatchExpirationPolicyReleaseConst = "release" - ReservationCommittedUsePatchExpirationPolicyRenewConst = "renew" -) - -// UnmarshalReservationCommittedUsePatch unmarshals an instance of ReservationCommittedUsePatch from the specified map of raw messages. -func UnmarshalReservationCommittedUsePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUsePatch) - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCommittedUsePrototype : ReservationCommittedUsePrototype struct -type ReservationCommittedUsePrototype struct { - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy,omitempty"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The specified value must be listed in the `reservation_terms` in the profile for this reservation. - Term *string `json:"term" validate:"required"` -} - -// Constants associated with the ReservationCommittedUsePrototype.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUsePrototypeExpirationPolicyReleaseConst = "release" - ReservationCommittedUsePrototypeExpirationPolicyRenewConst = "renew" -) - -// NewReservationCommittedUsePrototype : Instantiate ReservationCommittedUsePrototype (Generic Model Constructor) -func (*VpcV1) NewReservationCommittedUsePrototype(term string) (_model *ReservationCommittedUsePrototype, err error) { - _model = &ReservationCommittedUsePrototype{ - Term: core.StringPtr(term), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalReservationCommittedUsePrototype unmarshals an instance of ReservationCommittedUsePrototype from the specified map of raw messages. -func UnmarshalReservationCommittedUsePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUsePrototype) - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationIdentity : Identifies a reservation by a unique property. +// SubnetIdentity : Identifies a subnet by a unique property. // Models which "extend" this model: -// - ReservationIdentityByID -// - ReservationIdentityByCRN -// - ReservationIdentityByHref -type ReservationIdentity struct { - // The unique identifier for this reservation. +// - SubnetIdentityByID +// - SubnetIdentityByCRN +// - SubnetIdentityByHref +type SubnetIdentity struct { + // The unique identifier for this subnet. ID *string `json:"id,omitempty"` - // The CRN for this reservation. + // The CRN for this subnet. CRN *string `json:"crn,omitempty"` - // The URL for this reservation. + // The URL for this subnet. Href *string `json:"href,omitempty"` } -func (*ReservationIdentity) isaReservationIdentity() bool { +func (*SubnetIdentity) isaSubnetIdentity() bool { return true } -type ReservationIdentityIntf interface { - isaReservationIdentity() bool +type SubnetIdentityIntf interface { + isaSubnetIdentity() bool } -// UnmarshalReservationIdentity unmarshals an instance of ReservationIdentity from the specified map of raw messages. -func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentity) +// UnmarshalSubnetIdentity unmarshals an instance of SubnetIdentity from the specified map of raw messages. +func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -62597,42 +74915,39 @@ func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface return } -// ReservationPatch : ReservationPatch struct -type ReservationPatch struct { - // The capacity reservation configuration to use. - // - // The configuration can only be changed for reservations with a `status` of `inactive`. - Capacity *ReservationCapacityPatch `json:"capacity,omitempty"` +// SubnetPatch : SubnetPatch struct +type SubnetPatch struct { + // The name for this subnet. The name must not be used by another subnet in the VPC. + Name *string `json:"name,omitempty"` - // The committed use configuration to use for this reservation. - CommittedUse *ReservationCommittedUsePatch `json:"committed_use,omitempty"` + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - // The name for this reservation. The name must not be used by another reservation in the region. - Name *string `json:"name,omitempty"` + // The public gateway to use for internet-bound traffic for this subnet. + PublicGateway SubnetPublicGatewayPatchIntf `json:"public_gateway,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // reservation. - // - // The profile can only be changed for a reservation with a `status` of `inactive`. - Profile *ReservationProfilePatch `json:"profile,omitempty"` + // The routing table to use for this subnet. The routing table properties + // `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` } -// UnmarshalReservationPatch unmarshals an instance of ReservationPatch from the specified map of raw messages. -func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationPatch) - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacityPatch) +// UnmarshalSubnetPatch unmarshals an instance of SubnetPatch from the specified map of raw messages. +func UnmarshalSubnetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUsePatch) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalSubnetPublicGatewayPatch) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfilePatch) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } @@ -62640,88 +74955,117 @@ func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the ReservationPatch -func (reservationPatch *ReservationPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the SubnetPatch +func (subnetPatch *SubnetPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(reservationPatch) + jsonData, err = json.Marshal(subnetPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// ReservationProfile : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. +// SubnetPrototype : SubnetPrototype struct // Models which "extend" this model: -// - ReservationProfileInstanceProfileReference -type ReservationProfile struct { - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` +// - SubnetPrototypeSubnetByTotalCount +// - SubnetPrototypeSubnetByCIDR +type SubnetPrototype struct { + // The IP version(s) to support for this subnet. + IPVersion *string `json:"ip_version,omitempty"` - // The globally unique name for this virtual server instance profile. + // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a + // hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` + + // The public gateway to use for internet-bound traffic for this subnet. If + // unspecified, the subnet will not be attached to a public gateway. + PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The routing table to use for this subnet. If unspecified, the default routing table + // for the VPC is used. The routing table properties `route_direct_link_ingress`, + // `route_internet_ingress`, `route_transit_gateway_ingress`, and + // `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` + + // The VPC the subnet will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the + // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. + TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count,omitempty"` + + // The zone this subnet will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` + // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing + // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of + // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix + // that contains the subnet's IPv4 CIDR. + Ipv4CIDRBlock *string `json:"ipv4_cidr_block,omitempty"` } -// Constants associated with the ReservationProfile.ResourceType property. -// The resource type. +// Constants associated with the SubnetPrototype.IPVersion property. +// The IP version(s) to support for this subnet. const ( - ReservationProfileResourceTypeInstanceProfileConst = "instance_profile" + SubnetPrototypeIPVersionIpv4Const = "ipv4" ) -func (*ReservationProfile) isaReservationProfile() bool { +func (*SubnetPrototype) isaSubnetPrototype() bool { return true } -type ReservationProfileIntf interface { - isaReservationProfile() bool +type SubnetPrototypeIntf interface { + isaSubnetPrototype() bool } -// UnmarshalReservationProfile unmarshals an instance of ReservationProfile from the specified map of raw messages. -func UnmarshalReservationProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfile) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalSubnetPrototype unmarshals an instance of SubnetPrototype from the specified map of raw messages. +func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationProfilePatch : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. -// -// The profile can only be changed for a reservation with a `status` of `inactive`. -type ReservationProfilePatch struct { - // The globally unique name of the profile. - Name *string `json:"name,omitempty"` - - // The resource type of the profile. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the ReservationProfilePatch.ResourceType property. -// The resource type of the profile. -const ( - ReservationProfilePatchResourceTypeInstanceProfileConst = "instance_profile" -) - -// UnmarshalReservationProfilePatch unmarshals an instance of ReservationProfilePatch from the specified map of raw messages. -func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfilePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) if err != nil { return } @@ -62729,39 +75073,42 @@ func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result inter return } -// ReservationProfilePrototype : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. -type ReservationProfilePrototype struct { - // The globally unique name of the profile. - Name *string `json:"name" validate:"required"` +// SubnetPublicGatewayPatch : The public gateway to use for internet-bound traffic for this subnet. +// Models which "extend" this model: +// - SubnetPublicGatewayPatchPublicGatewayIdentityByID +// - SubnetPublicGatewayPatchPublicGatewayIdentityByCRN +// - SubnetPublicGatewayPatchPublicGatewayIdentityByHref +type SubnetPublicGatewayPatch struct { + // The unique identifier for this public gateway. + ID *string `json:"id,omitempty"` - // The resource type of the profile. - ResourceType *string `json:"resource_type" validate:"required"` + // The CRN for this public gateway. + CRN *string `json:"crn,omitempty"` + + // The URL for this public gateway. + Href *string `json:"href,omitempty"` } -// Constants associated with the ReservationProfilePrototype.ResourceType property. -// The resource type of the profile. -const ( - ReservationProfilePrototypeResourceTypeInstanceProfileConst = "instance_profile" -) +func (*SubnetPublicGatewayPatch) isaSubnetPublicGatewayPatch() bool { + return true +} -// NewReservationProfilePrototype : Instantiate ReservationProfilePrototype (Generic Model Constructor) -func (*VpcV1) NewReservationProfilePrototype(name string, resourceType string) (_model *ReservationProfilePrototype, err error) { - _model = &ReservationProfilePrototype{ - Name: core.StringPtr(name), - ResourceType: core.StringPtr(resourceType), - } - err = core.ValidateStruct(_model, "required parameters") - return +type SubnetPublicGatewayPatchIntf interface { + isaSubnetPublicGatewayPatch() bool } -// UnmarshalReservationProfilePrototype unmarshals an instance of ReservationProfilePrototype from the specified map of raw messages. -func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfilePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalSubnetPublicGatewayPatch unmarshals an instance of SubnetPublicGatewayPatch from the specified map of raw messages. +func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPublicGatewayPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -62769,42 +75116,42 @@ func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result i return } -// ReservationReference : ReservationReference struct -type ReservationReference struct { - // The CRN for this reservation. +// SubnetReference : SubnetReference struct +type SubnetReference struct { + // The CRN for this subnet. CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *ReservationReferenceDeleted `json:"deleted,omitempty"` + Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` - // The URL for this reservation. + // The URL for this subnet. Href *string `json:"href" validate:"required"` - // The unique identifier for this reservation. + // The unique identifier for this subnet. ID *string `json:"id" validate:"required"` - // The name for this reservation. The name is unique across all reservations in the region. + // The name for this subnet. The name is unique across all subnets in the VPC. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ReservationReference.ResourceType property. +// Constants associated with the SubnetReference.ResourceType property. // The resource type. const ( - ReservationReferenceResourceTypeReservationConst = "reservation" + SubnetReferenceResourceTypeSubnetConst = "subnet" ) -// UnmarshalReservationReference unmarshals an instance of ReservationReference from the specified map of raw messages. -func UnmarshalReservationReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationReference) +// UnmarshalSubnetReference unmarshals an instance of SubnetReference from the specified map of raw messages. +func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservationReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) if err != nil { return } @@ -62828,16 +75175,16 @@ func UnmarshalReservationReference(m map[string]json.RawMessage, result interfac return } -// ReservationReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// SubnetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary // information. -type ReservationReferenceDeleted struct { +type SubnetReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalReservationReferenceDeleted unmarshals an instance of ReservationReferenceDeleted from the specified map of raw messages. -func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationReferenceDeleted) +// UnmarshalSubnetReferenceDeleted unmarshals an instance of SubnetReferenceDeleted from the specified map of raw messages. +func UnmarshalSubnetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -62846,37 +75193,71 @@ func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result i return } -// ReservationStatusReason : ReservationStatusReason struct -type ReservationStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// TrustedProfileIdentity : Identifies a trusted profile by a unique property. +// Models which "extend" this model: +// - TrustedProfileIdentityTrustedProfileByID +// - TrustedProfileIdentityTrustedProfileByCRN +type TrustedProfileIdentity struct { + // The unique identifier for this trusted profile. + ID *string `json:"id,omitempty"` - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` + // The CRN for this trusted profile. + CRN *string `json:"crn,omitempty"` +} - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +func (*TrustedProfileIdentity) isaTrustedProfileIdentity() bool { + return true } -// Constants associated with the ReservationStatusReason.Code property. -// A snake case string succinctly identifying the status reason. +type TrustedProfileIdentityIntf interface { + isaTrustedProfileIdentity() bool +} + +// UnmarshalTrustedProfileIdentity unmarshals an instance of TrustedProfileIdentity from the specified map of raw messages. +func UnmarshalTrustedProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TrustedProfileReference : TrustedProfileReference struct +type TrustedProfileReference struct { + // The CRN for this trusted profile. + CRN *string `json:"crn" validate:"required"` + + // The unique identifier for this trusted profile. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the TrustedProfileReference.ResourceType property. +// The resource type. const ( - ReservationStatusReasonCodeCannotActivateNoCapacityAvailableConst = "cannot_activate_no_capacity_available" - ReservationStatusReasonCodeCannotRenewUnsupportedProfileTermConst = "cannot_renew_unsupported_profile_term" + TrustedProfileReferenceResourceTypeTrustedProfileConst = "trusted_profile" ) -// UnmarshalReservationStatusReason unmarshals an instance of ReservationStatusReason from the specified map of raw messages. -func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +// UnmarshalTrustedProfileReference unmarshals an instance of TrustedProfileReference from the specified map of raw messages. +func UnmarshalTrustedProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -62884,2895 +75265,2304 @@ func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result inter return } -// ReservedIP : ReservedIP struct -type ReservedIP struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// UnsetSubnetPublicGatewayOptions : The UnsetSubnetPublicGateway options. +type UnsetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The date and time that the reserved IP was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// NewUnsetSubnetPublicGatewayOptions : Instantiate UnsetSubnetPublicGatewayOptions +func (*VpcV1) NewUnsetSubnetPublicGatewayOptions(id string) *UnsetSubnetPublicGatewayOptions { + return &UnsetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), + } +} - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UnsetSubnetPublicGatewayOptions) SetID(id string) *UnsetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UnsetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *UnsetSubnetPublicGatewayOptions { + options.Headers = param + return options +} - // The lifecycle state of the reserved IP. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// UpdateBackupPolicyOptions : The UpdateBackupPolicy options. +type UpdateBackupPolicyOptions struct { + // The backup policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` + // The backup policy patch. + BackupPolicyPatch map[string]interface{} `json:"BackupPolicy_patch" validate:"required"` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBackupPolicyOptions : Instantiate UpdateBackupPolicyOptions +func (*VpcV1) NewUpdateBackupPolicyOptions(id string, backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { + return &UpdateBackupPolicyOptions{ + ID: core.StringPtr(id), + BackupPolicyPatch: backupPolicyPatch, + } +} + +// SetID : Allow user to set ID +func (_options *UpdateBackupPolicyOptions) SetID(id string) *UpdateBackupPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBackupPolicyPatch : Allow user to set BackupPolicyPatch +func (_options *UpdateBackupPolicyOptions) SetBackupPolicyPatch(backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { + _options.BackupPolicyPatch = backupPolicyPatch + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateBackupPolicyOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBackupPolicyOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyOptions { + options.Headers = param + return options +} + +// UpdateBackupPolicyPlanOptions : The UpdateBackupPolicyPlan options. +type UpdateBackupPolicyPlanOptions struct { + // The backup policy identifier. + BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` + + // The backup policy plan identifier. + ID *string `json:"id" validate:"required,ne="` + + // The backup policy plan patch. + BackupPolicyPlanPatch map[string]interface{} `json:"BackupPolicyPlan_patch" validate:"required"` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBackupPolicyPlanOptions : Instantiate UpdateBackupPolicyPlanOptions +func (*VpcV1) NewUpdateBackupPolicyPlanOptions(backupPolicyID string, id string, backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { + return &UpdateBackupPolicyPlanOptions{ + BackupPolicyID: core.StringPtr(backupPolicyID), + ID: core.StringPtr(id), + BackupPolicyPlanPatch: backupPolicyPlanPatch, + } +} + +// SetBackupPolicyID : Allow user to set BackupPolicyID +func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *UpdateBackupPolicyPlanOptions { + _options.BackupPolicyID = core.StringPtr(backupPolicyID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateBackupPolicyPlanOptions) SetID(id string) *UpdateBackupPolicyPlanOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBackupPolicyPlanPatch : Allow user to set BackupPolicyPlanPatch +func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyPlanPatch(backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { + _options.BackupPolicyPlanPatch = backupPolicyPlanPatch + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyPlanOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyPlanOptions { + options.Headers = param + return options +} + +// UpdateBareMetalServerDiskOptions : The UpdateBareMetalServerDisk options. +type UpdateBareMetalServerDiskOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server disk identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server disk patch. + BareMetalServerDiskPatch map[string]interface{} `json:"BareMetalServerDisk_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBareMetalServerDiskOptions : Instantiate UpdateBareMetalServerDiskOptions +func (*VpcV1) NewUpdateBareMetalServerDiskOptions(bareMetalServerID string, id string, bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { + return &UpdateBareMetalServerDiskOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + BareMetalServerDiskPatch: bareMetalServerDiskPatch, + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerDiskOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerDiskOptions) SetID(id string) *UpdateBareMetalServerDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBareMetalServerDiskPatch : Allow user to set BareMetalServerDiskPatch +func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerDiskPatch(bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { + _options.BareMetalServerDiskPatch = bareMetalServerDiskPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerDiskOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerDiskOptions { + options.Headers = param + return options +} + +// UpdateBareMetalServerNetworkAttachmentOptions : The UpdateBareMetalServerNetworkAttachment options. +type UpdateBareMetalServerNetworkAttachmentOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network attachment identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server network attachment patch. + BareMetalServerNetworkAttachmentPatch map[string]interface{} `json:"BareMetalServerNetworkAttachment_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBareMetalServerNetworkAttachmentOptions : Instantiate UpdateBareMetalServerNetworkAttachmentOptions +func (*VpcV1) NewUpdateBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string, bareMetalServerNetworkAttachmentPatch map[string]interface{}) *UpdateBareMetalServerNetworkAttachmentOptions { + return &UpdateBareMetalServerNetworkAttachmentOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + BareMetalServerNetworkAttachmentPatch: bareMetalServerNetworkAttachmentPatch, + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetID(id string) *UpdateBareMetalServerNetworkAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBareMetalServerNetworkAttachmentPatch : Allow user to set BareMetalServerNetworkAttachmentPatch +func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatch map[string]interface{}) *UpdateBareMetalServerNetworkAttachmentOptions { + _options.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkAttachmentOptions { + options.Headers = param + return options +} + +// UpdateBareMetalServerNetworkInterfaceOptions : The UpdateBareMetalServerNetworkInterface options. +type UpdateBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server network interface identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server network interface patch. + BareMetalServerNetworkInterfacePatch map[string]interface{} `json:"BareMetalServerNetworkInterface_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBareMetalServerNetworkInterfaceOptions : Instantiate UpdateBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewUpdateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string, bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { + return &UpdateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + BareMetalServerNetworkInterfacePatch: bareMetalServerNetworkInterfacePatch, + } +} + +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetID(id string) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBareMetalServerNetworkInterfacePatch : Allow user to set BareMetalServerNetworkInterfacePatch +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkInterfaceOptions { + options.Headers = param + return options +} + +// UpdateBareMetalServerOptions : The UpdateBareMetalServer options. +type UpdateBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server patch. + BareMetalServerPatch map[string]interface{} `json:"BareMetalServer_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBareMetalServerOptions : Instantiate UpdateBareMetalServerOptions +func (*VpcV1) NewUpdateBareMetalServerOptions(id string, bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { + return &UpdateBareMetalServerOptions{ + ID: core.StringPtr(id), + BareMetalServerPatch: bareMetalServerPatch, + } +} + +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerOptions) SetID(id string) *UpdateBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBareMetalServerPatch : Allow user to set BareMetalServerPatch +func (_options *UpdateBareMetalServerOptions) SetBareMetalServerPatch(bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { + _options.BareMetalServerPatch = bareMetalServerPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerOptions { + options.Headers = param + return options +} + +// UpdateDedicatedHostDiskOptions : The UpdateDedicatedHostDisk options. +type UpdateDedicatedHostDiskOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - // The owner of the reserved IP. - Owner *string `json:"owner" validate:"required"` + // The dedicated host disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The dedicated host disk patch. + DedicatedHostDiskPatch map[string]interface{} `json:"DedicatedHostDisk_patch" validate:"required"` - // The target this reserved IP is bound to. - // - // If absent, this reserved IP is provider-owned or unbound. - Target ReservedIPTargetIntf `json:"target,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the ReservedIP.LifecycleState property. -// The lifecycle state of the reserved IP. -const ( - ReservedIPLifecycleStateDeletingConst = "deleting" - ReservedIPLifecycleStateFailedConst = "failed" - ReservedIPLifecycleStatePendingConst = "pending" - ReservedIPLifecycleStateStableConst = "stable" - ReservedIPLifecycleStateSuspendedConst = "suspended" - ReservedIPLifecycleStateUpdatingConst = "updating" - ReservedIPLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the ReservedIP.Owner property. -// The owner of the reserved IP. -const ( - ReservedIPOwnerProviderConst = "provider" - ReservedIPOwnerUserConst = "user" -) +// NewUpdateDedicatedHostDiskOptions : Instantiate UpdateDedicatedHostDiskOptions +func (*VpcV1) NewUpdateDedicatedHostDiskOptions(dedicatedHostID string, id string, dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { + return &UpdateDedicatedHostDiskOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + ID: core.StringPtr(id), + DedicatedHostDiskPatch: dedicatedHostDiskPatch, + } +} -// Constants associated with the ReservedIP.ResourceType property. -// The resource type. -const ( - ReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *UpdateDedicatedHostDiskOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} -// UnmarshalReservedIP unmarshals an instance of ReservedIP from the specified map of raw messages. -func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "owner", &obj.Owner) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalReservedIPTarget) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostDiskOptions) SetID(id string) *UpdateDedicatedHostDiskOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPCollection : ReservedIPCollection struct -type ReservedIPCollection struct { - // A link to the first page of resources. - First *ReservedIPCollectionFirst `json:"first" validate:"required"` +// SetDedicatedHostDiskPatch : Allow user to set DedicatedHostDiskPatch +func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostDiskPatch(dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { + _options.DedicatedHostDiskPatch = dedicatedHostDiskPatch + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostDiskOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostDiskOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionNext `json:"next,omitempty"` +// UpdateDedicatedHostGroupOptions : The UpdateDedicatedHostGroup options. +type UpdateDedicatedHostGroupOptions struct { + // The dedicated host group identifier. + ID *string `json:"id" validate:"required,ne="` - // Collection of reserved IPs in this subnet. - ReservedIps []ReservedIP `json:"reserved_ips" validate:"required"` + // The dedicated host group patch. + DedicatedHostGroupPatch map[string]interface{} `json:"DedicatedHostGroup_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPCollection unmarshals an instance of ReservedIPCollection from the specified map of raw messages. -func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reserved_ips", &obj.ReservedIps, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateDedicatedHostGroupOptions : Instantiate UpdateDedicatedHostGroupOptions +func (*VpcV1) NewUpdateDedicatedHostGroupOptions(id string, dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { + return &UpdateDedicatedHostGroupOptions{ + ID: core.StringPtr(id), + DedicatedHostGroupPatch: dedicatedHostGroupPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostGroupOptions) SetID(id string) *UpdateDedicatedHostGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPCollectionBareMetalServerNetworkInterfaceContext : ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct -type ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst `json:"first" validate:"required"` +// SetDedicatedHostGroupPatch : Allow user to set DedicatedHostGroupPatch +func (_options *UpdateDedicatedHostGroupOptions) SetDedicatedHostGroupPatch(dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { + _options.DedicatedHostGroupPatch = dedicatedHostGroupPatch + return _options +} - // Collection of reserved IPs bound to a bare metal server network interface. - Ips []ReservedIP `json:"ips" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostGroupOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// UpdateDedicatedHostOptions : The UpdateDedicatedHost options. +type UpdateDedicatedHostOptions struct { + // The dedicated host identifier. + ID *string `json:"id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext `json:"next,omitempty"` + // The dedicated host patch. + DedicatedHostPatch map[string]interface{} `json:"DedicatedHost_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateDedicatedHostOptions : Instantiate UpdateDedicatedHostOptions +func (*VpcV1) NewUpdateDedicatedHostOptions(id string, dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { + return &UpdateDedicatedHostOptions{ + ID: core.StringPtr(id), + DedicatedHostPatch: dedicatedHostPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst : A link to the first page of resources. -type ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostOptions) SetID(id string) *UpdateDedicatedHostOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetDedicatedHostPatch : Allow user to set DedicatedHostPatch +func (_options *UpdateDedicatedHostOptions) SetDedicatedHostPatch(dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { + _options.DedicatedHostPatch = dedicatedHostPatch + return _options } -// ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostOptions { + options.Headers = param + return options } -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// UpdateEndpointGatewayOptions : The UpdateEndpointGateway options. +type UpdateEndpointGatewayOptions struct { + // The endpoint gateway identifier. + ID *string `json:"id" validate:"required,ne="` + + // The endpoint gateway patch. + EndpointGatewayPatch map[string]interface{} `json:"EndpointGateway_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateEndpointGatewayOptions : Instantiate UpdateEndpointGatewayOptions +func (*VpcV1) NewUpdateEndpointGatewayOptions(id string, endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { + return &UpdateEndpointGatewayOptions{ + ID: core.StringPtr(id), + EndpointGatewayPatch: endpointGatewayPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReservedIPCollectionEndpointGatewayContext : ReservedIPCollectionEndpointGatewayContext struct -type ReservedIPCollectionEndpointGatewayContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionEndpointGatewayContextFirst `json:"first" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateEndpointGatewayOptions) SetID(id string) *UpdateEndpointGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Collection of reserved IPs bound to an endpoint gateway. - Ips []ReservedIP `json:"ips" validate:"required"` +// SetEndpointGatewayPatch : Allow user to set EndpointGatewayPatch +func (_options *UpdateEndpointGatewayOptions) SetEndpointGatewayPatch(endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { + _options.EndpointGatewayPatch = endpointGatewayPatch + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionEndpointGatewayContextNext `json:"next,omitempty"` +// UpdateFloatingIPOptions : The UpdateFloatingIP options. +type UpdateFloatingIPOptions struct { + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The floating IP patch. + FloatingIPPatch map[string]interface{} `json:"FloatingIP_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPCollectionEndpointGatewayContext unmarshals an instance of ReservedIPCollectionEndpointGatewayContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionEndpointGatewayContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionEndpointGatewayContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateFloatingIPOptions : Instantiate UpdateFloatingIPOptions +func (*VpcV1) NewUpdateFloatingIPOptions(id string, floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { + return &UpdateFloatingIPOptions{ + ID: core.StringPtr(id), + FloatingIPPatch: floatingIPPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *UpdateFloatingIPOptions) SetID(id string) *UpdateFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPCollectionEndpointGatewayContextFirst : A link to the first page of resources. -type ReservedIPCollectionEndpointGatewayContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetFloatingIPPatch : Allow user to set FloatingIPPatch +func (_options *UpdateFloatingIPOptions) SetFloatingIPPatch(floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { + _options.FloatingIPPatch = floatingIPPatch + return _options } -// UnmarshalReservedIPCollectionEndpointGatewayContextFirst unmarshals an instance of ReservedIPCollectionEndpointGatewayContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateFloatingIPOptions) SetHeaders(param map[string]string) *UpdateFloatingIPOptions { + options.Headers = param + return options } -// ReservedIPCollectionEndpointGatewayContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionEndpointGatewayContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateFlowLogCollectorOptions : The UpdateFlowLogCollector options. +type UpdateFlowLogCollectorOptions struct { + // The flow log collector identifier. + ID *string `json:"id" validate:"required,ne="` + + // The flow log collector patch. + FlowLogCollectorPatch map[string]interface{} `json:"FlowLogCollector_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPCollectionEndpointGatewayContextNext unmarshals an instance of ReservedIPCollectionEndpointGatewayContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateFlowLogCollectorOptions : Instantiate UpdateFlowLogCollectorOptions +func (*VpcV1) NewUpdateFlowLogCollectorOptions(id string, flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { + return &UpdateFlowLogCollectorOptions{ + ID: core.StringPtr(id), + FlowLogCollectorPatch: flowLogCollectorPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReservedIPCollectionFirst : A link to the first page of resources. -type ReservedIPCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateFlowLogCollectorOptions) SetID(id string) *UpdateFlowLogCollectorOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalReservedIPCollectionFirst unmarshals an instance of ReservedIPCollectionFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetFlowLogCollectorPatch : Allow user to set FlowLogCollectorPatch +func (_options *UpdateFlowLogCollectorOptions) SetFlowLogCollectorPatch(flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { + _options.FlowLogCollectorPatch = flowLogCollectorPatch + return _options } -// ReservedIPCollectionInstanceNetworkInterfaceContext : ReservedIPCollectionInstanceNetworkInterfaceContext struct -type ReservedIPCollectionInstanceNetworkInterfaceContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionInstanceNetworkInterfaceContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to an instance network interface. - Ips []ReservedIP `json:"ips" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateFlowLogCollectorOptions) SetHeaders(param map[string]string) *UpdateFlowLogCollectorOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// UpdateIkePolicyOptions : The UpdateIkePolicy options. +type UpdateIkePolicyOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionInstanceNetworkInterfaceContextNext `json:"next,omitempty"` + // The IKE policy patch. + IkePolicyPatch map[string]interface{} `json:"IkePolicy_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateIkePolicyOptions : Instantiate UpdateIkePolicyOptions +func (*VpcV1) NewUpdateIkePolicyOptions(id string, ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { + return &UpdateIkePolicyOptions{ + ID: core.StringPtr(id), + IkePolicyPatch: ikePolicyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionInstanceNetworkInterfaceContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *UpdateIkePolicyOptions) SetID(id string) *UpdateIkePolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetIkePolicyPatch : Allow user to set IkePolicyPatch +func (_options *UpdateIkePolicyOptions) SetIkePolicyPatch(ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { + _options.IkePolicyPatch = ikePolicyPatch + return _options } -// ReservedIPCollectionInstanceNetworkInterfaceContextFirst : A link to the first page of resources. -type ReservedIPCollectionInstanceNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateIkePolicyOptions) SetHeaders(param map[string]string) *UpdateIkePolicyOptions { + options.Headers = param + return options } -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// UpdateImageExportJobOptions : The UpdateImageExportJob options. +type UpdateImageExportJobOptions struct { + // The image identifier. + ImageID *string `json:"image_id" validate:"required,ne="` + + // The image export job identifier. + ID *string `json:"id" validate:"required,ne="` + + // The image export job patch. + ImageExportJobPatch map[string]interface{} `json:"ImageExportJob_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateImageExportJobOptions : Instantiate UpdateImageExportJobOptions +func (*VpcV1) NewUpdateImageExportJobOptions(imageID string, id string, imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { + return &UpdateImageExportJobOptions{ + ImageID: core.StringPtr(imageID), + ID: core.StringPtr(id), + ImageExportJobPatch: imageExportJobPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReservedIPCollectionInstanceNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionInstanceNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetImageID : Allow user to set ImageID +func (_options *UpdateImageExportJobOptions) SetImageID(imageID string) *UpdateImageExportJobOptions { + _options.ImageID = core.StringPtr(imageID) + return _options } -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateImageExportJobOptions) SetID(id string) *UpdateImageExportJobOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetImageExportJobPatch : Allow user to set ImageExportJobPatch +func (_options *UpdateImageExportJobOptions) SetImageExportJobPatch(imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { + _options.ImageExportJobPatch = imageExportJobPatch + return _options } -// UnmarshalReservedIPCollectionNext unmarshals an instance of ReservedIPCollectionNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateImageExportJobOptions) SetHeaders(param map[string]string) *UpdateImageExportJobOptions { + options.Headers = param + return options } -// ReservedIPPatch : ReservedIPPatch struct -type ReservedIPPatch struct { - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` +// UpdateImageOptions : The UpdateImage options. +type UpdateImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` + // The image patch. + ImagePatch map[string]interface{} `json:"Image_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPPatch unmarshals an instance of ReservedIPPatch from the specified map of raw messages. -func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPPatch) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewUpdateImageOptions : Instantiate UpdateImageOptions +func (*VpcV1) NewUpdateImageOptions(id string, imagePatch map[string]interface{}) *UpdateImageOptions { + return &UpdateImageOptions{ + ID: core.StringPtr(id), + ImagePatch: imagePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the ReservedIPPatch -func (reservedIPPatch *ReservedIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(reservedIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetID : Allow user to set ID +func (_options *UpdateImageOptions) SetID(id string) *UpdateImageOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPReference : ReservedIPReference struct -type ReservedIPReference struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// SetImagePatch : Allow user to set ImagePatch +func (_options *UpdateImageOptions) SetImagePatch(imagePatch map[string]interface{}) *UpdateImageOptions { + _options.ImagePatch = imagePatch + return _options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateImageOptions) SetHeaders(param map[string]string) *UpdateImageOptions { + options.Headers = param + return options +} - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` +// UpdateInstanceDiskOptions : The UpdateInstanceDisk options. +type UpdateInstanceDiskOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` + // The instance disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` + // The instance disk patch. + InstanceDiskPatch map[string]interface{} `json:"InstanceDisk_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the ReservedIPReference.ResourceType property. -// The resource type. -const ( - ReservedIPReferenceResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) - -// UnmarshalReservedIPReference unmarshals an instance of ReservedIPReference from the specified map of raw messages. -func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewUpdateInstanceDiskOptions : Instantiate UpdateInstanceDiskOptions +func (*VpcV1) NewUpdateInstanceDiskOptions(instanceID string, id string, instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { + return &UpdateInstanceDiskOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + InstanceDiskPatch: instanceDiskPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReservedIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ReservedIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceDiskOptions) SetInstanceID(instanceID string) *UpdateInstanceDiskOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalReservedIPReferenceDeleted unmarshals an instance of ReservedIPReferenceDeleted from the specified map of raw messages. -func UnmarshalReservedIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceDiskOptions) SetID(id string) *UpdateInstanceDiskOptions { + _options.ID = core.StringPtr(id) + return _options } -// ReservedIPTarget : The target this reserved IP is bound to. -// -// If absent, this reserved IP is provider-owned or unbound. -// Models which "extend" this model: -// - ReservedIPTargetEndpointGatewayReference -// - ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext -// - ReservedIPTargetNetworkInterfaceReferenceTargetContext -// - ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext -// - ReservedIPTargetLoadBalancerReference -// - ReservedIPTargetVPNGatewayReference -// - ReservedIPTargetVPNServerReference -// - ReservedIPTargetGenericResourceReference -type ReservedIPTarget struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` +// SetInstanceDiskPatch : Allow user to set InstanceDiskPatch +func (_options *UpdateInstanceDiskOptions) SetInstanceDiskPatch(instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { + _options.InstanceDiskPatch = instanceDiskPatch + return _options +} - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceDiskOptions) SetHeaders(param map[string]string) *UpdateInstanceDiskOptions { + options.Headers = param + return options +} - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` +// UpdateInstanceGroupManagerActionOptions : The UpdateInstanceGroupManagerAction options. +type UpdateInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name,omitempty"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} + // The instance group manager action identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the ReservedIPTarget.ResourceType property. -// The resource type. -const ( - ReservedIPTargetResourceTypeEndpointGatewayConst = "endpoint_gateway" -) + // The instance group manager action patch. + InstanceGroupManagerActionPatch map[string]interface{} `json:"InstanceGroupManagerAction_patch" validate:"required"` -func (*ReservedIPTarget) isaReservedIPTarget() bool { - return true + // Allows users to set headers on API requests + Headers map[string]string } -type ReservedIPTargetIntf interface { - isaReservedIPTarget() bool +// NewUpdateInstanceGroupManagerActionOptions : Instantiate UpdateInstanceGroupManagerActionOptions +func (*VpcV1) NewUpdateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { + return &UpdateInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + InstanceGroupManagerActionPatch: instanceGroupManagerActionPatch, + } } -// UnmarshalReservedIPTarget unmarshals an instance of ReservedIPTarget from the specified map of raw messages. -func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// ReservedIPTargetPrototype : The target to bind this reserved IP to. The target must be in the same VPC. -// -// At present, only endpoint gateway targets are supported. The endpoint gateway must not be already bound to a -// reserved IP in the subnet's zone. -// -// If unspecified, the reserved IP will be created unbound. -// Models which "extend" this model: -// - ReservedIPTargetPrototypeEndpointGatewayIdentity -type ReservedIPTargetPrototype struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerActionOptions) SetID(id string) *UpdateInstanceGroupManagerActionOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` +// SetInstanceGroupManagerActionPatch : Allow user to set InstanceGroupManagerActionPatch +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPatch(instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch + return _options } -func (*ReservedIPTargetPrototype) isaReservedIPTargetPrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerActionOptions { + options.Headers = param + return options } -type ReservedIPTargetPrototypeIntf interface { - isaReservedIPTargetPrototype() bool +// UpdateInstanceGroupManagerOptions : The UpdateInstanceGroupManager options. +type UpdateInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + ID *string `json:"id" validate:"required,ne="` + + // The instance group manager patch. + InstanceGroupManagerPatch map[string]interface{} `json:"InstanceGroupManager_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalReservedIPTargetPrototype unmarshals an instance of ReservedIPTargetPrototype from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateInstanceGroupManagerOptions : Instantiate UpdateInstanceGroupManagerOptions +func (*VpcV1) NewUpdateInstanceGroupManagerOptions(instanceGroupID string, id string, instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { + return &UpdateInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + InstanceGroupManagerPatch: instanceGroupManagerPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ResourceFilter : Identifies one or more resources according to the specified filter property. -type ResourceFilter struct { - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// UnmarshalResourceFilter unmarshals an instance of ResourceFilter from the specified map of raw messages. -func UnmarshalResourceFilter(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceFilter) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerOptions) SetID(id string) *UpdateInstanceGroupManagerOptions { + _options.ID = core.StringPtr(id) + return _options } -// ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource -// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. -// Models which "extend" this model: -// - ResourceGroupIdentityByID -type ResourceGroupIdentity struct { - // The unique identifier for this resource group. - ID *string `json:"id,omitempty"` +// SetInstanceGroupManagerPatch : Allow user to set InstanceGroupManagerPatch +func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupManagerPatch(instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { + _options.InstanceGroupManagerPatch = instanceGroupManagerPatch + return _options } -func (*ResourceGroupIdentity) isaResourceGroupIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerOptions { + options.Headers = param + return options } -type ResourceGroupIdentityIntf interface { - isaResourceGroupIdentity() bool +// UpdateInstanceGroupManagerPolicyOptions : The UpdateInstanceGroupManagerPolicy options. +type UpdateInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // The instance group manager policy patch. + InstanceGroupManagerPolicyPatch map[string]interface{} `json:"InstanceGroupManagerPolicy_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalResourceGroupIdentity unmarshals an instance of ResourceGroupIdentity from the specified map of raw messages. -func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return +// NewUpdateInstanceGroupManagerPolicyOptions : Instantiate UpdateInstanceGroupManagerPolicyOptions +func (*VpcV1) NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { + return &UpdateInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + InstanceGroupManagerPolicyPatch: instanceGroupManagerPolicyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ResourceGroupReference : ResourceGroupReference struct -type ResourceGroupReference struct { - // The URL for this resource group. - Href *string `json:"href" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The unique identifier for this resource group. - ID *string `json:"id" validate:"required"` +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} - // The name for this resource group. - Name *string `json:"name" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetID(id string) *UpdateInstanceGroupManagerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalResourceGroupReference unmarshals an instance of ResourceGroupReference from the specified map of raw messages. -func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstanceGroupManagerPolicyPatch : Allow user to set InstanceGroupManagerPolicyPatch +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatch + return _options } -// RestartBareMetalServerOptions : The RestartBareMetalServer options. -type RestartBareMetalServerOptions struct { - // The bare metal server identifier. +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerPolicyOptions { + options.Headers = param + return options +} + +// UpdateInstanceGroupMembershipOptions : The UpdateInstanceGroupMembership options. +type UpdateInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group membership identifier. ID *string `json:"id" validate:"required,ne="` + // The instance group membership patch. + InstanceGroupMembershipPatch map[string]interface{} `json:"InstanceGroupMembership_patch" validate:"required"` + // Allows users to set headers on API requests Headers map[string]string } -// NewRestartBareMetalServerOptions : Instantiate RestartBareMetalServerOptions -func (*VpcV1) NewRestartBareMetalServerOptions(id string) *RestartBareMetalServerOptions { - return &RestartBareMetalServerOptions{ - ID: core.StringPtr(id), +// NewUpdateInstanceGroupMembershipOptions : Instantiate UpdateInstanceGroupMembershipOptions +func (*VpcV1) NewUpdateInstanceGroupMembershipOptions(instanceGroupID string, id string, instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { + return &UpdateInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + InstanceGroupMembershipPatch: instanceGroupMembershipPatch, } } +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + // SetID : Allow user to set ID -func (_options *RestartBareMetalServerOptions) SetID(id string) *RestartBareMetalServerOptions { +func (_options *UpdateInstanceGroupMembershipOptions) SetID(id string) *UpdateInstanceGroupMembershipOptions { _options.ID = core.StringPtr(id) return _options } +// SetInstanceGroupMembershipPatch : Allow user to set InstanceGroupMembershipPatch +func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupMembershipPatch(instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { + _options.InstanceGroupMembershipPatch = instanceGroupMembershipPatch + return _options +} + // SetHeaders : Allow user to set Headers -func (options *RestartBareMetalServerOptions) SetHeaders(param map[string]string) *RestartBareMetalServerOptions { +func (options *UpdateInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupMembershipOptions { options.Headers = param return options } -// Route : Route struct -type Route struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// UpdateInstanceGroupOptions : The UpdateInstanceGroup options. +type UpdateInstanceGroupOptions struct { + // The instance group identifier. + ID *string `json:"id" validate:"required,ne="` - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` + // The instance group patch. + InstanceGroupPatch map[string]interface{} `json:"InstanceGroup_patch" validate:"required"` - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL for this route. - Href *string `json:"href" validate:"required"` +// NewUpdateInstanceGroupOptions : Instantiate UpdateInstanceGroupOptions +func (*VpcV1) NewUpdateInstanceGroupOptions(id string, instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { + return &UpdateInstanceGroupOptions{ + ID: core.StringPtr(id), + InstanceGroupPatch: instanceGroupPatch, + } +} - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupOptions) SetID(id string) *UpdateInstanceGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// SetInstanceGroupPatch : Allow user to set InstanceGroupPatch +func (_options *UpdateInstanceGroupOptions) SetInstanceGroupPatch(instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { + _options.InstanceGroupPatch = instanceGroupPatch + return _options +} - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupOptions { + options.Headers = param + return options +} - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` +// UpdateInstanceNetworkAttachmentOptions : The UpdateInstanceNetworkAttachment options. +type UpdateInstanceNetworkAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` + // The instance network attachment identifier. + ID *string `json:"id" validate:"required,ne="` - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` + // The instance network attachment patch. + InstanceNetworkAttachmentPatch map[string]interface{} `json:"InstanceNetworkAttachment_patch" validate:"required"` - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the Route.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteActionDelegateConst = "delegate" - RouteActionDelegateVPCConst = "delegate_vpc" - RouteActionDeliverConst = "deliver" - RouteActionDropConst = "drop" -) - -// Constants associated with the Route.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteLifecycleStateDeletingConst = "deleting" - RouteLifecycleStateFailedConst = "failed" - RouteLifecycleStatePendingConst = "pending" - RouteLifecycleStateStableConst = "stable" - RouteLifecycleStateSuspendedConst = "suspended" - RouteLifecycleStateUpdatingConst = "updating" - RouteLifecycleStateWaitingConst = "waiting" -) +// NewUpdateInstanceNetworkAttachmentOptions : Instantiate UpdateInstanceNetworkAttachmentOptions +func (*VpcV1) NewUpdateInstanceNetworkAttachmentOptions(instanceID string, id string, instanceNetworkAttachmentPatch map[string]interface{}) *UpdateInstanceNetworkAttachmentOptions { + return &UpdateInstanceNetworkAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + InstanceNetworkAttachmentPatch: instanceNetworkAttachmentPatch, + } +} -// Constants associated with the Route.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - RouteOriginServiceConst = "service" - RouteOriginUserConst = "user" -) +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} -// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. -func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Route) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceNetworkAttachmentOptions) SetID(id string) *UpdateInstanceNetworkAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options } -// RouteCollection : RouteCollection struct -type RouteCollection struct { - // A link to the first page of resources. - First *RouteCollectionFirst `json:"first" validate:"required"` +// SetInstanceNetworkAttachmentPatch : Allow user to set InstanceNetworkAttachmentPatch +func (_options *UpdateInstanceNetworkAttachmentOptions) SetInstanceNetworkAttachmentPatch(instanceNetworkAttachmentPatch map[string]interface{}) *UpdateInstanceNetworkAttachmentOptions { + _options.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatch + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkAttachmentOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionNext `json:"next,omitempty"` +// UpdateInstanceNetworkInterfaceOptions : The UpdateInstanceNetworkInterface options. +type UpdateInstanceNetworkInterfaceOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // Collection of routes. - Routes []Route `json:"routes" validate:"required"` + // The instance network interface identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + // The instance network interface patch. + NetworkInterfacePatch map[string]interface{} `json:"NetworkInterface_patch" validate:"required"` -// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. -func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// NewUpdateInstanceNetworkInterfaceOptions : Instantiate UpdateInstanceNetworkInterfaceOptions +func (*VpcV1) NewUpdateInstanceNetworkInterfaceOptions(instanceID string, id string, networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { + return &UpdateInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + NetworkInterfacePatch: networkInterfacePatch, } - return start, nil } -// RouteCollectionFirst : A link to the first page of resources. -type RouteCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. -func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceNetworkInterfaceOptions) SetID(id string) *UpdateInstanceNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetNetworkInterfacePatch : Allow user to set NetworkInterfacePatch +func (_options *UpdateInstanceNetworkInterfaceOptions) SetNetworkInterfacePatch(networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { + _options.NetworkInterfacePatch = networkInterfacePatch + return _options } -// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. -func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkInterfaceOptions { + options.Headers = param + return options } -// RouteCollectionVPCContext : RouteCollectionVPCContext struct -type RouteCollectionVPCContext struct { - // A link to the first page of resources. - First *RouteCollectionVPCContextFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionVPCContextNext `json:"next,omitempty"` +// UpdateInstanceOptions : The UpdateInstance options. +type UpdateInstanceOptions struct { + // The virtual server instance identifier. + ID *string `json:"id" validate:"required,ne="` - // Collection of routes. - Routes []RouteCollectionVPCContextRoutesItem `json:"routes" validate:"required"` + // The instance patch. + InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` -// UnmarshalRouteCollectionVPCContext unmarshals an instance of RouteCollectionVPCContext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionVPCContextFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionVPCContextNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteCollectionVPCContextRoutesItem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollectionVPCContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// NewUpdateInstanceOptions : Instantiate UpdateInstanceOptions +func (*VpcV1) NewUpdateInstanceOptions(id string, instancePatch map[string]interface{}) *UpdateInstanceOptions { + return &UpdateInstanceOptions{ + ID: core.StringPtr(id), + InstancePatch: instancePatch, } - return start, nil } -// RouteCollectionVPCContextFirst : A link to the first page of resources. -type RouteCollectionVPCContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceOptions) SetID(id string) *UpdateInstanceOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalRouteCollectionVPCContextFirst unmarshals an instance of RouteCollectionVPCContextFirst from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstancePatch : Allow user to set InstancePatch +func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string]interface{}) *UpdateInstanceOptions { + _options.InstancePatch = instancePatch + return _options } -// RouteCollectionVPCContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionVPCContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateInstanceOptions) SetIfMatch(ifMatch string) *UpdateInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options } -// UnmarshalRouteCollectionVPCContextNext unmarshals an instance of RouteCollectionVPCContextNext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { + options.Headers = param + return options } -// RouteCollectionVPCContextRoutesItem : RouteCollectionVPCContextRoutesItem struct -type RouteCollectionVPCContextRoutesItem struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` +// UpdateInstanceTemplateOptions : The UpdateInstanceTemplate options. +type UpdateInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The instance template patch. + InstanceTemplatePatch map[string]interface{} `json:"InstanceTemplate_patch" validate:"required"` - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` +// NewUpdateInstanceTemplateOptions : Instantiate UpdateInstanceTemplateOptions +func (*VpcV1) NewUpdateInstanceTemplateOptions(id string, instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { + return &UpdateInstanceTemplateOptions{ + ID: core.StringPtr(id), + InstanceTemplatePatch: instanceTemplatePatch, + } +} - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceTemplateOptions) SetID(id string) *UpdateInstanceTemplateOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` +// SetInstanceTemplatePatch : Allow user to set InstanceTemplatePatch +func (_options *UpdateInstanceTemplateOptions) SetInstanceTemplatePatch(instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { + _options.InstanceTemplatePatch = instanceTemplatePatch + return _options +} - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceTemplateOptions) SetHeaders(param map[string]string) *UpdateInstanceTemplateOptions { + options.Headers = param + return options } -// Constants associated with the RouteCollectionVPCContextRoutesItem.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteCollectionVPCContextRoutesItemActionDelegateConst = "delegate" - RouteCollectionVPCContextRoutesItemActionDelegateVPCConst = "delegate_vpc" - RouteCollectionVPCContextRoutesItemActionDeliverConst = "deliver" - RouteCollectionVPCContextRoutesItemActionDropConst = "drop" -) +// UpdateInstanceVolumeAttachmentOptions : The UpdateInstanceVolumeAttachment options. +type UpdateInstanceVolumeAttachmentOptions struct { + // The virtual server instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` -// Constants associated with the RouteCollectionVPCContextRoutesItem.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteCollectionVPCContextRoutesItemLifecycleStateDeletingConst = "deleting" - RouteCollectionVPCContextRoutesItemLifecycleStateFailedConst = "failed" - RouteCollectionVPCContextRoutesItemLifecycleStatePendingConst = "pending" - RouteCollectionVPCContextRoutesItemLifecycleStateStableConst = "stable" - RouteCollectionVPCContextRoutesItemLifecycleStateSuspendedConst = "suspended" - RouteCollectionVPCContextRoutesItemLifecycleStateUpdatingConst = "updating" - RouteCollectionVPCContextRoutesItemLifecycleStateWaitingConst = "waiting" -) + // The volume attachment identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the RouteCollectionVPCContextRoutesItem.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - RouteCollectionVPCContextRoutesItemOriginServiceConst = "service" - RouteCollectionVPCContextRoutesItemOriginUserConst = "user" -) + // The volume attachment patch. + VolumeAttachmentPatch map[string]interface{} `json:"VolumeAttachment_patch" validate:"required"` -// UnmarshalRouteCollectionVPCContextRoutesItem unmarshals an instance of RouteCollectionVPCContextRoutesItem from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextRoutesItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextRoutesItem) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// RouteCreator : If present, the resource that created the route. Routes with this property present cannot be directly deleted. All -// routes with an `origin` of `service` will have this property set, and future `origin` values may also have this -// property set. -// Models which "extend" this model: -// - RouteCreatorVPNGatewayReference -// - RouteCreatorVPNServerReference -type RouteCreator struct { - // The VPN gateway's CRN. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` +// NewUpdateInstanceVolumeAttachmentOptions : Instantiate UpdateInstanceVolumeAttachmentOptions +func (*VpcV1) NewUpdateInstanceVolumeAttachmentOptions(instanceID string, id string, volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { + return &UpdateInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + VolumeAttachmentPatch: volumeAttachmentPatch, + } +} - // The VPN gateway's canonical URL. - Href *string `json:"href,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The unique identifier for this VPN gateway. - ID *string `json:"id,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceVolumeAttachmentOptions) SetID(id string) *UpdateInstanceVolumeAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name,omitempty"` +// SetVolumeAttachmentPatch : Allow user to set VolumeAttachmentPatch +func (_options *UpdateInstanceVolumeAttachmentOptions) SetVolumeAttachmentPatch(volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { + _options.VolumeAttachmentPatch = volumeAttachmentPatch + return _options +} - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceVolumeAttachmentOptions { + options.Headers = param + return options } -// Constants associated with the RouteCreator.ResourceType property. -// The resource type. -const ( - RouteCreatorResourceTypeVPNGatewayConst = "vpn_gateway" -) +// UpdateIpsecPolicyOptions : The UpdateIpsecPolicy options. +type UpdateIpsecPolicyOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` -func (*RouteCreator) isaRouteCreator() bool { - return true -} + // The IPsec policy patch. + IPsecPolicyPatch map[string]interface{} `json:"IPsecPolicy_patch" validate:"required"` -type RouteCreatorIntf interface { - isaRouteCreator() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRouteCreator unmarshals an instance of RouteCreator from the specified map of raw messages. -func UnmarshalRouteCreator(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreator) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewUpdateIpsecPolicyOptions : Instantiate UpdateIpsecPolicyOptions +func (*VpcV1) NewUpdateIpsecPolicyOptions(id string, iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { + return &UpdateIpsecPolicyOptions{ + ID: core.StringPtr(id), + IPsecPolicyPatch: iPsecPolicyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RouteNextHop : RouteNextHop struct -// Models which "extend" this model: -// - RouteNextHopIP -// - RouteNextHopVPNGatewayConnectionReference -type RouteNextHop struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateIpsecPolicyOptions) SetID(id string) *UpdateIpsecPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` +// SetIPsecPolicyPatch : Allow user to set IPsecPolicyPatch +func (_options *UpdateIpsecPolicyOptions) SetIPsecPolicyPatch(iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { + _options.IPsecPolicyPatch = iPsecPolicyPatch + return _options +} - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateIpsecPolicyOptions) SetHeaders(param map[string]string) *UpdateIpsecPolicyOptions { + options.Headers = param + return options +} - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` +// UpdateKeyOptions : The UpdateKey options. +type UpdateKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name,omitempty"` + // The key patch. + KeyPatch map[string]interface{} `json:"Key_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the RouteNextHop.ResourceType property. -// The resource type. -const ( - RouteNextHopResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) +// NewUpdateKeyOptions : Instantiate UpdateKeyOptions +func (*VpcV1) NewUpdateKeyOptions(id string, keyPatch map[string]interface{}) *UpdateKeyOptions { + return &UpdateKeyOptions{ + ID: core.StringPtr(id), + KeyPatch: keyPatch, + } +} -func (*RouteNextHop) isaRouteNextHop() bool { - return true +// SetID : Allow user to set ID +func (_options *UpdateKeyOptions) SetID(id string) *UpdateKeyOptions { + _options.ID = core.StringPtr(id) + return _options } -type RouteNextHopIntf interface { - isaRouteNextHop() bool +// SetKeyPatch : Allow user to set KeyPatch +func (_options *UpdateKeyOptions) SetKeyPatch(keyPatch map[string]interface{}) *UpdateKeyOptions { + _options.KeyPatch = keyPatch + return _options } -// UnmarshalRouteNextHop unmarshals an instance of RouteNextHop from the specified map of raw messages. -func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHop) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateKeyOptions) SetHeaders(param map[string]string) *UpdateKeyOptions { + options.Headers = param + return options } -// RouteNextHopPatch : If `action` is `deliver`, the next hop that packets will be delivered to. For other -// `action` values, specify `0.0.0.0` or remove it by specifying `null`. -// -// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has -// an `action` of `deliver` and `next_hop` is an IP address. -// Models which "extend" this model: -// - RouteNextHopPatchRouteNextHopIP -// - RouteNextHopPatchVPNGatewayConnectionIdentity -type RouteNextHopPatch struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// UpdateLoadBalancerListenerOptions : The UpdateLoadBalancerListener options. +type UpdateLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` + // The load balancer listener patch. + LoadBalancerListenerPatch map[string]interface{} `json:"LoadBalancerListener_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -func (*RouteNextHopPatch) isaRouteNextHopPatch() bool { - return true +// NewUpdateLoadBalancerListenerOptions : Instantiate UpdateLoadBalancerListenerOptions +func (*VpcV1) NewUpdateLoadBalancerListenerOptions(loadBalancerID string, id string, loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { + return &UpdateLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + LoadBalancerListenerPatch: loadBalancerListenerPatch, + } } -type RouteNextHopPatchIntf interface { - isaRouteNextHopPatch() bool +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalRouteNextHopPatch unmarshals an instance of RouteNextHopPatch from the specified map of raw messages. -func UnmarshalRouteNextHopPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerListenerOptions) SetID(id string) *UpdateLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) + return _options } -// RoutePatch : RoutePatch struct -type RoutePatch struct { - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. - Name *string `json:"name,omitempty"` +// SetLoadBalancerListenerPatch : Allow user to set LoadBalancerListenerPatch +func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerListenerPatch(loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { + _options.LoadBalancerListenerPatch = loadBalancerListenerPatch + return _options +} - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, specify `0.0.0.0` or remove it by specifying `null`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RouteNextHopPatchIntf `json:"next_hop,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerOptions { + options.Headers = param + return options +} - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` +// UpdateLoadBalancerListenerPolicyOptions : The UpdateLoadBalancerListenerPolicy options. +type UpdateLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // The listener policy patch. + LoadBalancerListenerPolicyPatch map[string]interface{} `json:"LoadBalancerListenerPolicy_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutePatch unmarshals an instance of RoutePatch from the specified map of raw messages. -func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHopPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return +// NewUpdateLoadBalancerListenerPolicyOptions : Instantiate UpdateLoadBalancerListenerPolicyOptions +func (*VpcV1) NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string, loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { + return &UpdateLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), + LoadBalancerListenerPolicyPatch: loadBalancerListenerPolicyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the RoutePatch -func (routePatch *RoutePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(routePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// RoutePrototype : RoutePrototype struct -type RoutePrototype struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` +// SetListenerID : Allow user to set ListenerID +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} - // The destination CIDR of the route. The host identifier in the CIDR must be zero. - // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` +// SetLoadBalancerListenerPolicyPatch : Allow user to set LoadBalancerListenerPolicyPatch +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { + _options.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch + return _options +} - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyOptions { + options.Headers = param + return options +} - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` +// UpdateLoadBalancerListenerPolicyRuleOptions : The UpdateLoadBalancerListenerPolicyRule options. +type UpdateLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` -// Constants associated with the RoutePrototype.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RoutePrototypeActionDelegateConst = "delegate" - RoutePrototypeActionDelegateVPCConst = "delegate_vpc" - RoutePrototypeActionDeliverConst = "deliver" - RoutePrototypeActionDropConst = "drop" -) + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` -// NewRoutePrototype : Instantiate RoutePrototype (Generic Model Constructor) -func (*VpcV1) NewRoutePrototype(destination string, zone ZoneIdentityIntf) (_model *RoutePrototype, err error) { - _model = &RoutePrototype{ - Destination: core.StringPtr(destination), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return + // The listener policy rule patch. + LoadBalancerListenerPolicyRulePatch map[string]interface{} `json:"LoadBalancerListenerPolicyRule_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutePrototype unmarshals an instance of RoutePrototype from the specified map of raw messages. -func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRoutePrototypeNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return +// NewUpdateLoadBalancerListenerPolicyRuleOptions : Instantiate UpdateLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string, loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { + return &UpdateLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), + LoadBalancerListenerPolicyRulePatch: loadBalancerListenerPolicyRulePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RoutePrototypeNextHop : If `action` is `deliver`, the next hop that packets will be delivered to. For other -// `action` values, it must be omitted or specified as `0.0.0.0`. -// -// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has -// an `action` of `deliver` and `next_hop` is an IP address. -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity -type RoutePrototypeNextHop struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` +// SetListenerID : Allow user to set ListenerID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` +// SetPolicyID : Allow user to set PolicyID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options } -func (*RoutePrototypeNextHop) isaRoutePrototypeNextHop() bool { - return true +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -type RoutePrototypeNextHopIntf interface { - isaRoutePrototypeNextHop() bool +// SetLoadBalancerListenerPolicyRulePatch : Allow user to set LoadBalancerListenerPolicyRulePatch +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch + return _options } -// UnmarshalRoutePrototypeNextHop unmarshals an instance of RoutePrototypeNextHop from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHop(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHop) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyRuleOptions { + options.Headers = param + return options } -// RouteReference : RouteReference struct -type RouteReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *RouteReferenceDeleted `json:"deleted,omitempty"` +// UpdateLoadBalancerOptions : The UpdateLoadBalancer options. +type UpdateLoadBalancerOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` - // The URL for this route. - Href *string `json:"href" validate:"required"` + // The load balancer patch. + LoadBalancerPatch map[string]interface{} `json:"LoadBalancer_patch" validate:"required"` - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRouteReference unmarshals an instance of RouteReference from the specified map of raw messages. -func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRouteReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewUpdateLoadBalancerOptions : Instantiate UpdateLoadBalancerOptions +func (*VpcV1) NewUpdateLoadBalancerOptions(id string, loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { + return &UpdateLoadBalancerOptions{ + ID: core.StringPtr(id), + LoadBalancerPatch: loadBalancerPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RouteReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type RouteReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerOptions) SetID(id string) *UpdateLoadBalancerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalRouteReferenceDeleted unmarshals an instance of RouteReferenceDeleted from the specified map of raw messages. -func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLoadBalancerPatch : Allow user to set LoadBalancerPatch +func (_options *UpdateLoadBalancerOptions) SetLoadBalancerPatch(loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { + _options.LoadBalancerPatch = loadBalancerPatch + return _options } -// RoutingTable : RoutingTable struct -type RoutingTable struct { - // The filters specifying the resources that may create routes in this routing table. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateLoadBalancerOptions) SetIfMatch(ifMatch string) *UpdateLoadBalancerOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The URL for this routing table. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerOptions { + options.Headers = param + return options +} - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` +// UpdateLoadBalancerPoolMemberOptions : The UpdateLoadBalancerPoolMember options. +type UpdateLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The member identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this routing table. The name is unique across all routing tables for the VPC. - Name *string `json:"name" validate:"required"` + // The load balancer pool member patch. + LoadBalancerPoolMemberPatch map[string]interface{} `json:"LoadBalancerPoolMember_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` +// NewUpdateLoadBalancerPoolMemberOptions : Instantiate UpdateLoadBalancerPoolMemberOptions +func (*VpcV1) NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string, loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { + return &UpdateLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), + LoadBalancerPoolMemberPatch: loadBalancerPoolMemberPatch, + } +} - // Indicates whether this routing table is used to route traffic that originates from the internet. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` +// SetPoolID : Allow user to set PoolID +func (_options *UpdateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *UpdateLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) + return _options +} - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerPoolMemberOptions) SetID(id string) *UpdateLoadBalancerPoolMemberOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The routes for this routing table. - Routes []RouteReference `json:"routes" validate:"required"` +// SetLoadBalancerPoolMemberPatch : Allow user to set LoadBalancerPoolMemberPatch +func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerPoolMemberPatch(loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { + _options.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch + return _options +} - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolMemberOptions { + options.Headers = param + return options } -// Constants associated with the RoutingTable.LifecycleState property. -// The lifecycle state of the routing table. -const ( - RoutingTableLifecycleStateDeletingConst = "deleting" - RoutingTableLifecycleStateFailedConst = "failed" - RoutingTableLifecycleStatePendingConst = "pending" - RoutingTableLifecycleStateStableConst = "stable" - RoutingTableLifecycleStateSuspendedConst = "suspended" - RoutingTableLifecycleStateUpdatingConst = "updating" - RoutingTableLifecycleStateWaitingConst = "waiting" -) +// UpdateLoadBalancerPoolOptions : The UpdateLoadBalancerPool options. +type UpdateLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` -// Constants associated with the RoutingTable.ResourceType property. -// The resource type. -const ( - RoutingTableResourceTypeRoutingTableConst = "routing_table" -) + // The pool identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalRoutingTable unmarshals an instance of RoutingTable from the specified map of raw messages. -func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTable) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return + // The load balancer pool patch. + LoadBalancerPoolPatch map[string]interface{} `json:"LoadBalancerPool_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateLoadBalancerPoolOptions : Instantiate UpdateLoadBalancerPoolOptions +func (*VpcV1) NewUpdateLoadBalancerPoolOptions(loadBalancerID string, id string, loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { + return &UpdateLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + LoadBalancerPoolPatch: loadBalancerPoolPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RoutingTableCollection : RoutingTableCollection struct -type RoutingTableCollection struct { - // A link to the first page of resources. - First *RoutingTableCollectionFirst `json:"first" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerPoolOptions) SetID(id string) *UpdateLoadBalancerPoolOptions { + _options.ID = core.StringPtr(id) + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RoutingTableCollectionNext `json:"next,omitempty"` +// SetLoadBalancerPoolPatch : Allow user to set LoadBalancerPoolPatch +func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerPoolPatch(loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { + _options.LoadBalancerPoolPatch = loadBalancerPoolPatch + return _options +} - // Collection of routing tables. - RoutingTables []RoutingTable `json:"routing_tables" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolOptions { + options.Headers = param + return options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// UpdateNetworkACLOptions : The UpdateNetworkACL options. +type UpdateNetworkACLOptions struct { + // The network ACL identifier. + ID *string `json:"id" validate:"required,ne="` + + // The network ACL patch. + NetworkACLPatch map[string]interface{} `json:"NetworkACL_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutingTableCollection unmarshals an instance of RoutingTableCollection from the specified map of raw messages. -func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRoutingTableCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRoutingTableCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_tables", &obj.RoutingTables, UnmarshalRoutingTable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateNetworkACLOptions : Instantiate UpdateNetworkACLOptions +func (*VpcV1) NewUpdateNetworkACLOptions(id string, networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { + return &UpdateNetworkACLOptions{ + ID: core.StringPtr(id), + NetworkACLPatch: networkACLPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RoutingTableCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *UpdateNetworkACLOptions) SetID(id string) *UpdateNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetNetworkACLPatch : Allow user to set NetworkACLPatch +func (_options *UpdateNetworkACLOptions) SetNetworkACLPatch(networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { + _options.NetworkACLPatch = networkACLPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateNetworkACLOptions) SetHeaders(param map[string]string) *UpdateNetworkACLOptions { + options.Headers = param + return options } -// RoutingTableCollectionFirst : A link to the first page of resources. -type RoutingTableCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateNetworkACLRuleOptions : The UpdateNetworkACLRule options. +type UpdateNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // The network ACL rule patch. + NetworkACLRulePatch map[string]interface{} `json:"NetworkACLRule_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutingTableCollectionFirst unmarshals an instance of RoutingTableCollectionFirst from the specified map of raw messages. -func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateNetworkACLRuleOptions : Instantiate UpdateNetworkACLRuleOptions +func (*VpcV1) NewUpdateNetworkACLRuleOptions(networkACLID string, id string, networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { + return &UpdateNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), + NetworkACLRulePatch: networkACLRulePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RoutingTableCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RoutingTableCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *UpdateNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options } -// UnmarshalRoutingTableCollectionNext unmarshals an instance of RoutingTableCollectionNext from the specified map of raw messages. -func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateNetworkACLRuleOptions) SetID(id string) *UpdateNetworkACLRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -// RoutingTableIdentity : Identifies a routing table by a unique property. -// Models which "extend" this model: -// - RoutingTableIdentityByID -// - RoutingTableIdentityByHref -type RoutingTableIdentity struct { - // The unique identifier for this routing table. - ID *string `json:"id,omitempty"` - - // The URL for this routing table. - Href *string `json:"href,omitempty"` +// SetNetworkACLRulePatch : Allow user to set NetworkACLRulePatch +func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLRulePatch(networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { + _options.NetworkACLRulePatch = networkACLRulePatch + return _options } -func (*RoutingTableIdentity) isaRoutingTableIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *UpdateNetworkACLRuleOptions) SetHeaders(param map[string]string) *UpdateNetworkACLRuleOptions { + options.Headers = param + return options } -type RoutingTableIdentityIntf interface { - isaRoutingTableIdentity() bool +// UpdatePlacementGroupOptions : The UpdatePlacementGroup options. +type UpdatePlacementGroupOptions struct { + // The placement group identifier. + ID *string `json:"id" validate:"required,ne="` + + // The placement group patch. + PlacementGroupPatch map[string]interface{} `json:"PlacementGroup_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutingTableIdentity unmarshals an instance of RoutingTableIdentity from the specified map of raw messages. -func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdatePlacementGroupOptions : Instantiate UpdatePlacementGroupOptions +func (*VpcV1) NewUpdatePlacementGroupOptions(id string, placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { + return &UpdatePlacementGroupOptions{ + ID: core.StringPtr(id), + PlacementGroupPatch: placementGroupPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RoutingTablePatch : RoutingTablePatch struct -type RoutingTablePatch struct { - // The filters specifying the resources that may create routes in this routing table - // (replacing any existing filters). All routes created by resources that match a given filter will be removed when an - // existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all - // routes not directly created by the user being removed. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdatePlacementGroupOptions) SetID(id string) *UpdatePlacementGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The name for this routing table. The name must not be used by another routing table in the VPC. - Name *string `json:"name,omitempty"` +// SetPlacementGroupPatch : Allow user to set PlacementGroupPatch +func (_options *UpdatePlacementGroupOptions) SetPlacementGroupPatch(placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { + _options.PlacementGroupPatch = placementGroupPatch + return _options +} - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` selects this routing table, provided - // no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this - // routing table. Updating to - // `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdatePlacementGroupOptions) SetHeaders(param map[string]string) *UpdatePlacementGroupOptions { + options.Headers = param + return options +} - // Indicates whether this routing table is used to route traffic that originates from the internet. Updating to `true` - // selects this routing table, provided no other routing table in the VPC already has this property set to `true`. - // Updating to `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be subject - // to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an - // IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` +// UpdatePublicGatewayOptions : The UpdatePublicGateway options. +type UpdatePublicGatewayOptions struct { + // The public gateway identifier. + ID *string `json:"id" validate:"required,ne="` - // Indicates whether this routing table is used to route traffic that originates from - // [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. Updating to - // `true` selects this routing table, provided no other routing table in the VPC already has this property set to - // `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` + // The public gateway patch. + PublicGatewayPatch map[string]interface{} `json:"PublicGateway_patch" validate:"required"` - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this - // property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this - // routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalRoutingTablePatch unmarshals an instance of RoutingTablePatch from the specified map of raw messages. -func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTablePatch) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return +// NewUpdatePublicGatewayOptions : Instantiate UpdatePublicGatewayOptions +func (*VpcV1) NewUpdatePublicGatewayOptions(id string, publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { + return &UpdatePublicGatewayOptions{ + ID: core.StringPtr(id), + PublicGatewayPatch: publicGatewayPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the RoutingTablePatch -func (routingTablePatch *RoutingTablePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(routingTablePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetID : Allow user to set ID +func (_options *UpdatePublicGatewayOptions) SetID(id string) *UpdatePublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } -// RoutingTableReference : RoutingTableReference struct -type RoutingTableReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *RoutingTableReferenceDeleted `json:"deleted,omitempty"` +// SetPublicGatewayPatch : Allow user to set PublicGatewayPatch +func (_options *UpdatePublicGatewayOptions) SetPublicGatewayPatch(publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { + _options.PublicGatewayPatch = publicGatewayPatch + return _options +} - // The URL for this routing table. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) *UpdatePublicGatewayOptions { + options.Headers = param + return options +} - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` +// UpdateReservationOptions : The UpdateReservation options. +type UpdateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` - // The name for this routing table. The name is unique across all routing tables for the VPC. - Name *string `json:"name" validate:"required"` + // The reservation patch. + ReservationPatch map[string]interface{} `json:"Reservation_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the RoutingTableReference.ResourceType property. -// The resource type. -const ( - RoutingTableReferenceResourceTypeRoutingTableConst = "routing_table" -) - -// UnmarshalRoutingTableReference unmarshals an instance of RoutingTableReference from the specified map of raw messages. -func UnmarshalRoutingTableReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRoutingTableReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewUpdateReservationOptions : Instantiate UpdateReservationOptions +func (*VpcV1) NewUpdateReservationOptions(id string, reservationPatch map[string]interface{}) *UpdateReservationOptions { + return &UpdateReservationOptions{ + ID: core.StringPtr(id), + ReservationPatch: reservationPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// RoutingTableReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type RoutingTableReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateReservationOptions) SetID(id string) *UpdateReservationOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalRoutingTableReferenceDeleted unmarshals an instance of RoutingTableReferenceDeleted from the specified map of raw messages. -func UnmarshalRoutingTableReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetReservationPatch : Allow user to set ReservationPatch +func (_options *UpdateReservationOptions) SetReservationPatch(reservationPatch map[string]interface{}) *UpdateReservationOptions { + _options.ReservationPatch = reservationPatch + return _options } -// SecurityGroup : SecurityGroup struct -type SecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateReservationOptions) SetHeaders(param map[string]string) *UpdateReservationOptions { + options.Headers = param + return options +} - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` +// UpdateSecurityGroupOptions : The UpdateSecurityGroup options. +type UpdateSecurityGroupOptions struct { + // The security group identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The security group patch. + SecurityGroupPatch map[string]interface{} `json:"SecurityGroup_patch" validate:"required"` - // The rules for this security group. If no rules exist, all traffic will be denied. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` +// NewUpdateSecurityGroupOptions : Instantiate UpdateSecurityGroupOptions +func (*VpcV1) NewUpdateSecurityGroupOptions(id string, securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { + return &UpdateSecurityGroupOptions{ + ID: core.StringPtr(id), + SecurityGroupPatch: securityGroupPatch, + } +} - // The VPC this security group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateSecurityGroupOptions) SetID(id string) *UpdateSecurityGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroup unmarshals an instance of SecurityGroup from the specified map of raw messages. -func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSecurityGroupPatch : Allow user to set SecurityGroupPatch +func (_options *UpdateSecurityGroupOptions) SetSecurityGroupPatch(securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { + _options.SecurityGroupPatch = securityGroupPatch + return _options } -// SecurityGroupCollection : SecurityGroupCollection struct -type SecurityGroupCollection struct { - // A link to the first page of resources. - First *SecurityGroupCollectionFirst `json:"first" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateSecurityGroupOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// UpdateSecurityGroupRuleOptions : The UpdateSecurityGroupRule options. +type UpdateSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SecurityGroupCollectionNext `json:"next,omitempty"` + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` - // Collection of security groups. - SecurityGroups []SecurityGroup `json:"security_groups" validate:"required"` + // The security group rule patch. + SecurityGroupRulePatch map[string]interface{} `json:"SecurityGroupRule_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupCollection unmarshals an instance of SecurityGroupCollection from the specified map of raw messages. -func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateSecurityGroupRuleOptions : Instantiate UpdateSecurityGroupRuleOptions +func (*VpcV1) NewUpdateSecurityGroupRuleOptions(securityGroupID string, id string, securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { + return &UpdateSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), + SecurityGroupRulePatch: securityGroupRulePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *UpdateSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options } -// SecurityGroupCollectionFirst : A link to the first page of resources. -type SecurityGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateSecurityGroupRuleOptions) SetID(id string) *UpdateSecurityGroupRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupCollectionFirst unmarshals an instance of SecurityGroupCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSecurityGroupRulePatch : Allow user to set SecurityGroupRulePatch +func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupRulePatch(securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { + _options.SecurityGroupRulePatch = securityGroupRulePatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupRuleOptions { + options.Headers = param + return options } -// SecurityGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateShareMountTargetOptions : The UpdateShareMountTarget options. +type UpdateShareMountTargetOptions struct { + // The file share identifier. + ShareID *string `json:"share_id" validate:"required,ne="` + + // The share mount target identifier. + ID *string `json:"id" validate:"required,ne="` + + // The share mount target patch. + ShareMountTargetPatch map[string]interface{} `json:"ShareMountTarget_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupCollectionNext unmarshals an instance of SecurityGroupCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateShareMountTargetOptions : Instantiate UpdateShareMountTargetOptions +func (*VpcV1) NewUpdateShareMountTargetOptions(shareID string, id string, shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { + return &UpdateShareMountTargetOptions{ + ShareID: core.StringPtr(shareID), + ID: core.StringPtr(id), + ShareMountTargetPatch: shareMountTargetPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupIdentityByID -// - SecurityGroupIdentityByCRN -// - SecurityGroupIdentityByHref -type SecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` +// SetShareID : Allow user to set ShareID +func (_options *UpdateShareMountTargetOptions) SetShareID(shareID string) *UpdateShareMountTargetOptions { + _options.ShareID = core.StringPtr(shareID) + return _options +} - // The security group's CRN. - CRN *string `json:"crn,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateShareMountTargetOptions) SetID(id string) *UpdateShareMountTargetOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The security group's canonical URL. - Href *string `json:"href,omitempty"` +// SetShareMountTargetPatch : Allow user to set ShareMountTargetPatch +func (_options *UpdateShareMountTargetOptions) SetShareMountTargetPatch(shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { + _options.ShareMountTargetPatch = shareMountTargetPatch + return _options } -func (*SecurityGroupIdentity) isaSecurityGroupIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *UpdateShareMountTargetOptions) SetHeaders(param map[string]string) *UpdateShareMountTargetOptions { + options.Headers = param + return options } -type SecurityGroupIdentityIntf interface { - isaSecurityGroupIdentity() bool +// UpdateShareOptions : The UpdateShare options. +type UpdateShareOptions struct { + // The file share identifier. + ID *string `json:"id" validate:"required,ne="` + + // The file share patch. + SharePatch map[string]interface{} `json:"Share_patch" validate:"required"` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupIdentity unmarshals an instance of SecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateShareOptions : Instantiate UpdateShareOptions +func (*VpcV1) NewUpdateShareOptions(id string, sharePatch map[string]interface{}) *UpdateShareOptions { + return &UpdateShareOptions{ + ID: core.StringPtr(id), + SharePatch: sharePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupPatch : SecurityGroupPatch struct -type SecurityGroupPatch struct { - // The name for this security group. The name must not be used by another security group for the VPC. - Name *string `json:"name,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateShareOptions) SetID(id string) *UpdateShareOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupPatch unmarshals an instance of SecurityGroupPatch from the specified map of raw messages. -func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSharePatch : Allow user to set SharePatch +func (_options *UpdateShareOptions) SetSharePatch(sharePatch map[string]interface{}) *UpdateShareOptions { + _options.SharePatch = sharePatch + return _options } -// AsPatch returns a generic map representation of the SecurityGroupPatch -func (securityGroupPatch *SecurityGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(securityGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateShareOptions) SetIfMatch(ifMatch string) *UpdateShareOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options } -// SecurityGroupReference : SecurityGroupReference struct -type SecurityGroupReference struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateShareOptions) SetHeaders(param map[string]string) *UpdateShareOptions { + options.Headers = param + return options +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` +// UpdateSnapshotConsistencyGroupOptions : The UpdateSnapshotConsistencyGroup options. +type UpdateSnapshotConsistencyGroupOptions struct { + // The snapshot consistency group identifier. + ID *string `json:"id" validate:"required,ne="` - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` + // The snapshot consistency group patch. + SnapshotConsistencyGroupPatch map[string]interface{} `json:"SnapshotConsistencyGroup_patch" validate:"required"` - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupReference unmarshals an instance of SecurityGroupReference from the specified map of raw messages. -func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateSnapshotConsistencyGroupOptions : Instantiate UpdateSnapshotConsistencyGroupOptions +func (*VpcV1) NewUpdateSnapshotConsistencyGroupOptions(id string, snapshotConsistencyGroupPatch map[string]interface{}) *UpdateSnapshotConsistencyGroupOptions { + return &UpdateSnapshotConsistencyGroupOptions{ + ID: core.StringPtr(id), + SnapshotConsistencyGroupPatch: snapshotConsistencyGroupPatch, } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SecurityGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateSnapshotConsistencyGroupOptions) SetID(id string) *UpdateSnapshotConsistencyGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupReferenceDeleted unmarshals an instance of SecurityGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSnapshotConsistencyGroupPatch : Allow user to set SnapshotConsistencyGroupPatch +func (_options *UpdateSnapshotConsistencyGroupOptions) SetSnapshotConsistencyGroupPatch(snapshotConsistencyGroupPatch map[string]interface{}) *UpdateSnapshotConsistencyGroupOptions { + _options.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatch + return _options } -// SecurityGroupRule : SecurityGroupRule struct -// Models which "extend" this model: -// - SecurityGroupRuleSecurityGroupRuleProtocolAll -// - SecurityGroupRuleSecurityGroupRuleProtocolIcmp -// - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp -type SecurityGroupRule struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateSnapshotConsistencyGroupOptions) SetIfMatch(ifMatch string) *UpdateSnapshotConsistencyGroupOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *UpdateSnapshotConsistencyGroupOptions { + options.Headers = param + return options +} - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` +// UpdateSnapshotOptions : The UpdateSnapshot options. +type UpdateSnapshotOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The snapshot patch. + SnapshotPatch map[string]interface{} `json:"Snapshot_patch" validate:"required"` - // The remote IP addresses or security groups from which this rule allows traffic (or to - // which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` - // The ICMP traffic code to allow. If absent, all codes are allowed. - Code *int64 `json:"code,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The ICMP traffic type to allow. If absent, all types are allowed. - Type *int64 `json:"type,omitempty"` +// NewUpdateSnapshotOptions : Instantiate UpdateSnapshotOptions +func (*VpcV1) NewUpdateSnapshotOptions(id string, snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { + return &UpdateSnapshotOptions{ + ID: core.StringPtr(id), + SnapshotPatch: snapshotPatch, + } +} - // The inclusive upper bound of TCP/UDP destination port range. - PortMax *int64 `json:"port_max,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateSnapshotOptions) SetID(id string) *UpdateSnapshotOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The inclusive lower bound of TCP/UDP destination port range. - PortMin *int64 `json:"port_min,omitempty"` +// SetSnapshotPatch : Allow user to set SnapshotPatch +func (_options *UpdateSnapshotOptions) SetSnapshotPatch(snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { + _options.SnapshotPatch = snapshotPatch + return _options } -// Constants associated with the SecurityGroupRule.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleDirectionInboundConst = "inbound" - SecurityGroupRuleDirectionOutboundConst = "outbound" -) +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateSnapshotOptions) SetIfMatch(ifMatch string) *UpdateSnapshotOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} -// Constants associated with the SecurityGroupRule.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleIPVersionIpv4Const = "ipv4" -) +// SetHeaders : Allow user to set Headers +func (options *UpdateSnapshotOptions) SetHeaders(param map[string]string) *UpdateSnapshotOptions { + options.Headers = param + return options +} -// Constants associated with the SecurityGroupRule.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleProtocolAllConst = "all" - SecurityGroupRuleProtocolIcmpConst = "icmp" - SecurityGroupRuleProtocolTCPConst = "tcp" - SecurityGroupRuleProtocolUDPConst = "udp" -) +// UpdateSubnetOptions : The UpdateSubnet options. +type UpdateSubnetOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` -func (*SecurityGroupRule) isaSecurityGroupRule() bool { - return true -} + // The subnet patch. + SubnetPatch map[string]interface{} `json:"Subnet_patch" validate:"required"` -type SecurityGroupRuleIntf interface { - isaSecurityGroupRule() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupRule unmarshals an instance of SecurityGroupRule from the specified map of raw messages. -func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) +// NewUpdateSubnetOptions : Instantiate UpdateSubnetOptions +func (*VpcV1) NewUpdateSubnetOptions(id string, subnetPatch map[string]interface{}) *UpdateSubnetOptions { + return &UpdateSubnetOptions{ + ID: core.StringPtr(id), + SubnetPatch: subnetPatch, } - return } -// SecurityGroupRuleCollection : Collection of rules in a security group. -type SecurityGroupRuleCollection struct { - // Array of rules. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateSubnetOptions) SetID(id string) *UpdateSubnetOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupRuleCollection unmarshals an instance of SecurityGroupRuleCollection from the specified map of raw messages. -func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetSubnetPatch : Allow user to set SubnetPatch +func (_options *UpdateSubnetOptions) SetSubnetPatch(subnetPatch map[string]interface{}) *UpdateSubnetOptions { + _options.SubnetPatch = subnetPatch + return _options } -// SecurityGroupRulePatch : SecurityGroupRulePatch struct -type SecurityGroupRulePatch struct { - // The ICMP traffic code to allow. If set, `type` must also be set. - // - // Specify `null` to remove an existing ICMP traffic code. - Code *int64 `json:"code,omitempty"` - - // The direction of traffic to enforce. - Direction *string `json:"direction,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateSubnetOptions) SetHeaders(param map[string]string) *UpdateSubnetOptions { + options.Headers = param + return options +} - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` +// UpdateSubnetReservedIPOptions : The UpdateSubnetReservedIP options. +type UpdateSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` - // The inclusive upper bound of the protocol destination port range. If set, `port_min` must also be set, and must not - // be larger. - // - // Specify `null` to remove an existing upper bound. - PortMax *int64 `json:"port_max,omitempty"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The inclusive lower bound of the protocol destination port range. If set, `port_max` must also be set, and must not - // be smaller. - // - // Specify `null` to remove an existing lower bound. - PortMin *int64 `json:"port_min,omitempty"` + // The reserved IP patch. + ReservedIPPatch map[string]interface{} `json:"ReservedIP_patch" validate:"required"` - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - // any destination, for outbound rules). - Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The ICMP traffic type to allow. - // - // Specify `null` to remove an existing ICMP traffic type value. - Type *int64 `json:"type,omitempty"` +// NewUpdateSubnetReservedIPOptions : Instantiate UpdateSubnetReservedIPOptions +func (*VpcV1) NewUpdateSubnetReservedIPOptions(subnetID string, id string, reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { + return &UpdateSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), + ReservedIPPatch: reservedIPPatch, + } } -// Constants associated with the SecurityGroupRulePatch.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePatchDirectionInboundConst = "inbound" - SecurityGroupRulePatchDirectionOutboundConst = "outbound" -) +// SetSubnetID : Allow user to set SubnetID +func (_options *UpdateSubnetReservedIPOptions) SetSubnetID(subnetID string) *UpdateSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} -// Constants associated with the SecurityGroupRulePatch.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" -) +// SetID : Allow user to set ID +func (_options *UpdateSubnetReservedIPOptions) SetID(id string) *UpdateSubnetReservedIPOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalSecurityGroupRulePatch unmarshals an instance of SecurityGroupRulePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePatch) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetReservedIPPatch : Allow user to set ReservedIPPatch +func (_options *UpdateSubnetReservedIPOptions) SetReservedIPPatch(reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { + _options.ReservedIPPatch = reservedIPPatch + return _options } -// AsPatch returns a generic map representation of the SecurityGroupRulePatch -func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(securityGroupRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string) *UpdateSubnetReservedIPOptions { + options.Headers = param + return options } -// SecurityGroupRulePrototype : SecurityGroupRulePrototype struct -// Models which "extend" this model: -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp -type SecurityGroupRulePrototype struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` +// UpdateVPCRouteResponse : UpdateVPCRouteResponse struct +type UpdateVPCRouteResponse struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` - // The ICMP traffic code to allow. - // - // If specified, `type` must also be specified. If unspecified, all codes are allowed. - Code *int64 `json:"code,omitempty"` + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - // The ICMP traffic type to allow. + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user // - // If unspecified, all types are allowed. - Type *int64 `json:"type,omitempty"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` - // The inclusive upper bound of TCP/UDP destination port range. + // The priority of this route. Smaller values have higher priority. // - // If specified, `port_min` must also be specified, and must not be larger. If unspecified, - // `port_min` must also be unspecified, allowing traffic on all destination ports. - PortMax *int64 `json:"port_max,omitempty"` + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` - // The inclusive lower bound of TCP/UDP destination port range + // The zone the route applies to. // - // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be - // unspecified, allowing traffic on all destination ports. - PortMin *int64 `json:"port_min,omitempty"` + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the SecurityGroupRulePrototype.Direction property. -// The direction of traffic to enforce. +// Constants associated with the UpdateVPCRouteResponse.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - SecurityGroupRulePrototypeDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeDirectionOutboundConst = "outbound" + UpdateVPCRouteResponseActionDelegateConst = "delegate" + UpdateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" + UpdateVPCRouteResponseActionDeliverConst = "deliver" + UpdateVPCRouteResponseActionDropConst = "drop" ) -// Constants associated with the SecurityGroupRulePrototype.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. +// Constants associated with the UpdateVPCRouteResponse.LifecycleState property. +// The lifecycle state of the route. const ( - SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" + UpdateVPCRouteResponseLifecycleStateDeletingConst = "deleting" + UpdateVPCRouteResponseLifecycleStateFailedConst = "failed" + UpdateVPCRouteResponseLifecycleStatePendingConst = "pending" + UpdateVPCRouteResponseLifecycleStateStableConst = "stable" + UpdateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" + UpdateVPCRouteResponseLifecycleStateUpdatingConst = "updating" + UpdateVPCRouteResponseLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the SecurityGroupRulePrototype.Protocol property. -// The protocol to enforce. +// Constants associated with the UpdateVPCRouteResponse.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. const ( - SecurityGroupRulePrototypeProtocolAllConst = "all" - SecurityGroupRulePrototypeProtocolIcmpConst = "icmp" - SecurityGroupRulePrototypeProtocolTCPConst = "tcp" - SecurityGroupRulePrototypeProtocolUDPConst = "udp" + UpdateVPCRouteResponseOriginServiceConst = "service" + UpdateVPCRouteResponseOriginUserConst = "user" ) -func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { - return true -} - -type SecurityGroupRulePrototypeIntf interface { - isaSecurityGroupRulePrototype() bool -} - -// UnmarshalSecurityGroupRulePrototype unmarshals an instance of SecurityGroupRulePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalUpdateVPCRouteResponse unmarshals an instance of UpdateVPCRouteResponse from the specified map of raw messages. +func UnmarshalUpdateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UpdateVPCRouteResponse) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// SecurityGroupRuleRemote : The remote IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). A -// CIDR block of `0.0.0.0/0` allows traffic from any source -// (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemoteIP -// - SecurityGroupRuleRemoteCIDR -// - SecurityGroupRuleRemoteSecurityGroupReference -type SecurityGroupRuleRemote struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name,omitempty"` -} - -func (*SecurityGroupRuleRemote) isaSecurityGroupRuleRemote() bool { - return true -} - -type SecurityGroupRuleRemoteIntf interface { - isaSecurityGroupRuleRemote() bool -} - -// UnmarshalSecurityGroupRuleRemote unmarshals an instance of SecurityGroupRuleRemote from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemote) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } @@ -65784,72 +77574,27 @@ func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatch : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). -// Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic -// from any source (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemotePatchIP -// - SecurityGroupRuleRemotePatchCIDR -// - SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatch struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePatch) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -type SecurityGroupRuleRemotePatchIntf interface { - isaSecurityGroupRuleRemotePatch() bool -} - -// UnmarshalSecurityGroupRuleRemotePatch unmarshals an instance of SecurityGroupRuleRemotePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -65857,859 +77602,606 @@ func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result return } -// SecurityGroupRuleRemotePrototype : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). -// Can be specified as an IP address, a CIDR block, or a security group within the VPC. -// -// If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source -// (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeIP -// - SecurityGroupRuleRemotePrototypeCIDR -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// UpdateVirtualNetworkInterfaceOptions : The UpdateVirtualNetworkInterface options. +type UpdateVirtualNetworkInterfaceOptions struct { + // The virtual network interface identifier. + ID *string `json:"id" validate:"required,ne="` - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` + // The virtual network interface patch. + VirtualNetworkInterfacePatch map[string]interface{} `json:"VirtualNetworkInterface_patch" validate:"required"` - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The security group's CRN. - CRN *string `json:"crn,omitempty"` +// NewUpdateVirtualNetworkInterfaceOptions : Instantiate UpdateVirtualNetworkInterfaceOptions +func (*VpcV1) NewUpdateVirtualNetworkInterfaceOptions(id string, virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { + return &UpdateVirtualNetworkInterfaceOptions{ + ID: core.StringPtr(id), + VirtualNetworkInterfacePatch: virtualNetworkInterfacePatch, + } +} - // The security group's canonical URL. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateVirtualNetworkInterfaceOptions) SetID(id string) *UpdateVirtualNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*SecurityGroupRuleRemotePrototype) isaSecurityGroupRuleRemotePrototype() bool { - return true +// SetVirtualNetworkInterfacePatch : Allow user to set VirtualNetworkInterfacePatch +func (_options *UpdateVirtualNetworkInterfaceOptions) SetVirtualNetworkInterfacePatch(virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { + _options.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatch + return _options } -type SecurityGroupRuleRemotePrototypeIntf interface { - isaSecurityGroupRuleRemotePrototype() bool +// SetHeaders : Allow user to set Headers +func (options *UpdateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateVirtualNetworkInterfaceOptions { + options.Headers = param + return options } -// UnmarshalSecurityGroupRuleRemotePrototype unmarshals an instance of SecurityGroupRuleRemotePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// UpdateVolumeOptions : The UpdateVolume options. +type UpdateVolumeOptions struct { + // The volume identifier. + ID *string `json:"id" validate:"required,ne="` + + // The volume patch. + VolumePatch map[string]interface{} `json:"Volume_patch" validate:"required"` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateVolumeOptions : Instantiate UpdateVolumeOptions +func (*VpcV1) NewUpdateVolumeOptions(id string, volumePatch map[string]interface{}) *UpdateVolumeOptions { + return &UpdateVolumeOptions{ + ID: core.StringPtr(id), + VolumePatch: volumePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupTargetCollection : SecurityGroupTargetCollection struct -type SecurityGroupTargetCollection struct { - // A link to the first page of resources. - First *SecurityGroupTargetCollectionFirst `json:"first" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateVolumeOptions) SetID(id string) *UpdateVolumeOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetVolumePatch : Allow user to set VolumePatch +func (_options *UpdateVolumeOptions) SetVolumePatch(volumePatch map[string]interface{}) *UpdateVolumeOptions { + _options.VolumePatch = volumePatch + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SecurityGroupTargetCollectionNext `json:"next,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVolumeOptions) SetIfMatch(ifMatch string) *UpdateVolumeOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // Collection of targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateVolumeOptions) SetHeaders(param map[string]string) *UpdateVolumeOptions { + options.Headers = param + return options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// UpdateVPCAddressPrefixOptions : The UpdateVPCAddressPrefix options. +type UpdateVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The prefix identifier. + ID *string `json:"id" validate:"required,ne="` + + // The prefix patch. + AddressPrefixPatch map[string]interface{} `json:"AddressPrefix_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupTargetCollection unmarshals an instance of SecurityGroupTargetCollection from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupTargetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupTargetCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateVPCAddressPrefixOptions : Instantiate UpdateVPCAddressPrefixOptions +func (*VpcV1) NewUpdateVPCAddressPrefixOptions(vpcID string, id string, addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { + return &UpdateVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + AddressPrefixPatch: addressPrefixPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupTargetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCAddressPrefixOptions) SetVPCID(vpcID string) *UpdateVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -// SecurityGroupTargetCollectionFirst : A link to the first page of resources. -type SecurityGroupTargetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateVPCAddressPrefixOptions) SetID(id string) *UpdateVPCAddressPrefixOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupTargetCollectionFirst unmarshals an instance of SecurityGroupTargetCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetAddressPrefixPatch : Allow user to set AddressPrefixPatch +func (_options *UpdateVPCAddressPrefixOptions) SetAddressPrefixPatch(addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { + _options.AddressPrefixPatch = addressPrefixPatch + return _options } -// SecurityGroupTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupTargetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *UpdateVPCAddressPrefixOptions { + options.Headers = param + return options } -// UnmarshalSecurityGroupTargetCollectionNext unmarshals an instance of SecurityGroupTargetCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// UpdateVPCDnsResolutionBindingOptions : The UpdateVPCDnsResolutionBinding options. +type UpdateVPCDnsResolutionBindingOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The DNS resolution binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // The DNS resolution binding patch. + VpcdnsResolutionBindingPatch map[string]interface{} `json:"VpcdnsResolutionBinding_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateVPCDnsResolutionBindingOptions : Instantiate UpdateVPCDnsResolutionBindingOptions +func (*VpcV1) NewUpdateVPCDnsResolutionBindingOptions(vpcID string, id string, vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { + return &UpdateVPCDnsResolutionBindingOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + VpcdnsResolutionBindingPatch: vpcdnsResolutionBindingPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupTargetReference : The resource types that can be security group targets are expected to expand in the future. When iterating over -// security group targets, do not assume that every target resource will be from a known set of resource types. -// Optionally halt processing and surface an error, or bypass resources of unrecognized types. -// Models which "extend" this model: -// - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext -// - SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext -// - SecurityGroupTargetReferenceLoadBalancerReference -// - SecurityGroupTargetReferenceEndpointGatewayReference -// - SecurityGroupTargetReferenceVPNServerReference -// - SecurityGroupTargetReferenceVirtualNetworkInterfaceReference -type SecurityGroupTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *UpdateVPCDnsResolutionBindingOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateVPCDnsResolutionBindingOptions) SetID(id string) *UpdateVPCDnsResolutionBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` +// SetVpcdnsResolutionBindingPatch : Allow user to set VpcdnsResolutionBindingPatch +func (_options *UpdateVPCDnsResolutionBindingOptions) SetVpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { + _options.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatch + return _options +} - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *UpdateVPCDnsResolutionBindingOptions { + options.Headers = param + return options +} - // The name for this instance network interface. - Name *string `json:"name,omitempty"` +// UpdateVPCOptions : The UpdateVPC options. +type UpdateVPCOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + // The VPC patch. + VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` - // The load balancer's CRN. - CRN *string `json:"crn,omitempty"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` - // The primary IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The associated subnet. - Subnet *SubnetReference `json:"subnet,omitempty"` +// NewUpdateVPCOptions : Instantiate UpdateVPCOptions +func (*VpcV1) NewUpdateVPCOptions(id string, vpcPatch map[string]interface{}) *UpdateVPCOptions { + return &UpdateVPCOptions{ + ID: core.StringPtr(id), + VPCPatch: vpcPatch, + } } -// Constants associated with the SecurityGroupTargetReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) +// SetID : Allow user to set ID +func (_options *UpdateVPCOptions) SetID(id string) *UpdateVPCOptions { + _options.ID = core.StringPtr(id) + return _options +} -func (*SecurityGroupTargetReference) isaSecurityGroupTargetReference() bool { - return true +// SetVPCPatch : Allow user to set VPCPatch +func (_options *UpdateVPCOptions) SetVPCPatch(vpcPatch map[string]interface{}) *UpdateVPCOptions { + _options.VPCPatch = vpcPatch + return _options } -type SecurityGroupTargetReferenceIntf interface { - isaSecurityGroupTargetReference() bool +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVPCOptions) SetIfMatch(ifMatch string) *UpdateVPCOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options } -// UnmarshalSecurityGroupTargetReference unmarshals an instance of SecurityGroupTargetReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateVPCOptions) SetHeaders(param map[string]string) *UpdateVPCOptions { + options.Headers = param + return options } -// SetSubnetPublicGatewayOptions : The SetSubnetPublicGateway options. -type SetSubnetPublicGatewayOptions struct { - // The subnet identifier. +// UpdateVPCRouteOptions : The UpdateVPCRoute options. +type UpdateVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The route identifier. ID *string `json:"id" validate:"required,ne="` - // The public gateway identity. - PublicGatewayIdentity PublicGatewayIdentityIntf `json:"PublicGatewayIdentity" validate:"required"` + // The route patch. + RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewSetSubnetPublicGatewayOptions : Instantiate SetSubnetPublicGatewayOptions -func (*VpcV1) NewSetSubnetPublicGatewayOptions(id string, publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - return &SetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - PublicGatewayIdentity: publicGatewayIdentity, +// NewUpdateVPCRouteOptions : Instantiate UpdateVPCRouteOptions +func (*VpcV1) NewUpdateVPCRouteOptions(vpcID string, id string, routePatch map[string]interface{}) *UpdateVPCRouteOptions { + return &UpdateVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + RoutePatch: routePatch, } } +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRouteOptions) SetVPCID(vpcID string) *UpdateVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + // SetID : Allow user to set ID -func (_options *SetSubnetPublicGatewayOptions) SetID(id string) *SetSubnetPublicGatewayOptions { +func (_options *UpdateVPCRouteOptions) SetID(id string) *UpdateVPCRouteOptions { _options.ID = core.StringPtr(id) return _options } -// SetPublicGatewayIdentity : Allow user to set PublicGatewayIdentity -func (_options *SetSubnetPublicGatewayOptions) SetPublicGatewayIdentity(publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - _options.PublicGatewayIdentity = publicGatewayIdentity +// SetRoutePatch : Allow user to set RoutePatch +func (_options *UpdateVPCRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRouteOptions { + _options.RoutePatch = routePatch return _options } // SetHeaders : Allow user to set Headers -func (options *SetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *SetSubnetPublicGatewayOptions { +func (options *UpdateVPCRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRouteOptions { options.Headers = param return options } -// Share : Share struct -type Share struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a mount - // target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // The enumerated access control mode values for this property may expand in the future. When processing this property, - // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which - // the unexpected access control mode was encountered. - AccessControlMode *string `json:"access_control_mode" validate:"required"` - - // The date and time that the file share is created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this file share. - CRN *string `json:"crn" validate:"required"` - - // The type of encryption used for this file share. - Encryption *string `json:"encryption" validate:"required"` - - // The key used to encrypt this file share. - // - // This property will be present if `encryption_type` is `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` +// UpdateVPCRoutingTableOptions : The UpdateVPCRoutingTable options. +type UpdateVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The URL for this file share. - Href *string `json:"href" validate:"required"` + // The routing table identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this file share. - ID *string `json:"id" validate:"required"` + // The routing table patch. + RoutingTablePatch map[string]interface{} `json:"RoutingTable_patch" validate:"required"` - // The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the - // share will be restricted to 48,000 IOPS. - // - // The maximum IOPS for a share may increase in the future. - Iops *int64 `json:"iops" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` - // The latest job associated with this file share. - // - // This property will be absent if no jobs have been created for this file share. - LatestJob *ShareJob `json:"latest_job,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The lifecycle state of the file share. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// NewUpdateVPCRoutingTableOptions : Instantiate UpdateVPCRoutingTableOptions +func (*VpcV1) NewUpdateVPCRoutingTableOptions(vpcID string, id string, routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { + return &UpdateVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + RoutingTablePatch: routingTablePatch, + } +} - // The mount targets for the file share. - MountTargets []ShareMountTargetReference `json:"mount_targets" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRoutingTableOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The name for this share. The name is unique across all shares in the region. - Name *string `json:"name" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateVPCRoutingTableOptions) SetID(id string) *UpdateVPCRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for - // this file share. - Profile *ShareProfileReference `json:"profile" validate:"required"` +// SetRoutingTablePatch : Allow user to set RoutingTablePatch +func (_options *UpdateVPCRoutingTableOptions) SetRoutingTablePatch(routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { + _options.RoutingTablePatch = routingTablePatch + return _options +} - // The replica file share for this source file share. - // - // This property will be present when the `replication_role` is `source`. - ReplicaShare *ShareReference `json:"replica_share,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVPCRoutingTableOptions) SetIfMatch(ifMatch string) *UpdateVPCRoutingTableOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The cron specification for the file share replication schedule. - // - // This property will be present when the `replication_role` is `replica`. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateVPCRoutingTableOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableOptions { + options.Headers = param + return options +} - // The replication role of the file share. - // - // * `none`: This share is not participating in replication. - // * `replica`: This share is a replication target. - // * `source`: This share is a replication source. - ReplicationRole *string `json:"replication_role" validate:"required"` +// UpdateVPCRoutingTableRouteOptions : The UpdateVPCRoutingTableRoute options. +type UpdateVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The replication status of the file share. - // - // * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the - // replication schedule. - // * `failover_pending`: This share is performing a replication failover. - // * `initializing`: This share is initializing replication. - // * `none`: This share is not participating in replication. - // * `split_pending`: This share is performing a replication split. - ReplicationStatus *string `json:"replication_status" validate:"required"` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The reasons for the current replication status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - ReplicationStatusReasons []ShareReplicationStatusReason `json:"replication_status_reasons" validate:"required"` + // The VPC routing table route identifier. + ID *string `json:"id" validate:"required,ne="` - // The resource group for this file share. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The VPC route patch. + RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size" validate:"required"` +// NewUpdateVPCRoutingTableRouteOptions : Instantiate UpdateVPCRoutingTableRouteOptions +func (*VpcV1) NewUpdateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string, routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { + return &UpdateVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + ID: core.StringPtr(id), + RoutePatch: routePatch, + } +} - // The source file share for this replica file share. - // - // This property will be present when the `replication_role` is `replica`. - SourceShare *ShareReference `json:"source_share,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // Tags for this resource. - UserTags []string `json:"user_tags" validate:"required"` +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *UpdateVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} - // The zone this file share will reside in. - Zone *ZoneReference `json:"zone" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateVPCRoutingTableRouteOptions) SetID(id string) *UpdateVPCRoutingTableRouteOptions { + _options.ID = core.StringPtr(id) + return _options } -// Constants associated with the Share.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a mount -// target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// -// The enumerated access control mode values for this property may expand in the future. When processing this property, -// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which -// the unexpected access control mode was encountered. -const ( - ShareAccessControlModeSecurityGroupConst = "security_group" - ShareAccessControlModeVPCConst = "vpc" -) +// SetRoutePatch : Allow user to set RoutePatch +func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { + _options.RoutePatch = routePatch + return _options +} -// Constants associated with the Share.Encryption property. -// The type of encryption used for this file share. -const ( - ShareEncryptionProviderManagedConst = "provider_managed" - ShareEncryptionUserManagedConst = "user_managed" -) +// SetHeaders : Allow user to set Headers +func (options *UpdateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableRouteOptions { + options.Headers = param + return options +} -// Constants associated with the Share.LifecycleState property. -// The lifecycle state of the file share. -const ( - ShareLifecycleStateDeletingConst = "deleting" - ShareLifecycleStateFailedConst = "failed" - ShareLifecycleStatePendingConst = "pending" - ShareLifecycleStateStableConst = "stable" - ShareLifecycleStateSuspendedConst = "suspended" - ShareLifecycleStateUpdatingConst = "updating" - ShareLifecycleStateWaitingConst = "waiting" -) +// UpdateVPNGatewayConnectionOptions : The UpdateVPNGatewayConnection options. +type UpdateVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` -// Constants associated with the Share.ReplicationRole property. -// The replication role of the file share. -// -// * `none`: This share is not participating in replication. -// * `replica`: This share is a replication target. -// * `source`: This share is a replication source. -const ( - ShareReplicationRoleNoneConst = "none" - ShareReplicationRoleReplicaConst = "replica" - ShareReplicationRoleSourceConst = "source" -) + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the Share.ReplicationStatus property. -// The replication status of the file share. -// -// * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the -// replication schedule. -// * `failover_pending`: This share is performing a replication failover. -// * `initializing`: This share is initializing replication. -// * `none`: This share is not participating in replication. -// * `split_pending`: This share is performing a replication split. -const ( - ShareReplicationStatusActiveConst = "active" - ShareReplicationStatusFailoverPendingConst = "failover_pending" - ShareReplicationStatusInitializingConst = "initializing" - ShareReplicationStatusNoneConst = "none" - ShareReplicationStatusSplitPendingConst = "split_pending" -) + // The VPN gateway connection patch. + VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` -// Constants associated with the Share.ResourceType property. -// The resource type. -const ( - ShareResourceTypeShareConst = "share" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalShare unmarshals an instance of Share from the specified map of raw messages. -func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Share) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "latest_job", &obj.LatestJob, UnmarshalShareJob) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalShareReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_role", &obj.ReplicationRole) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_status", &obj.ReplicationStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replication_status_reasons", &obj.ReplicationStatusReasons, UnmarshalShareReplicationStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return +// NewUpdateVPNGatewayConnectionOptions : Instantiate UpdateVPNGatewayConnectionOptions +func (*VpcV1) NewUpdateVPNGatewayConnectionOptions(vpnGatewayID string, id string, vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { + return &UpdateVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + VPNGatewayConnectionPatch: vpnGatewayConnectionPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ShareCollection : ShareCollection struct -type ShareCollection struct { - // A link to the first page of resources. - First *ShareCollectionFirst `json:"first" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *UpdateVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateVPNGatewayConnectionOptions) SetID(id string) *UpdateVPNGatewayConnectionOptions { + _options.ID = core.StringPtr(id) + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ShareCollectionNext `json:"next,omitempty"` +// SetVPNGatewayConnectionPatch : Allow user to set VPNGatewayConnectionPatch +func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch(vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { + _options.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch + return _options +} - // Collection of file shares. - Shares []Share `json:"shares" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { + options.Headers = param + return options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// UpdateVPNGatewayOptions : The UpdateVPNGateway options. +type UpdateVPNGatewayOptions struct { + // The VPN gateway identifier. + ID *string `json:"id" validate:"required,ne="` + + // The VPN gateway patch. + VPNGatewayPatch map[string]interface{} `json:"VPNGateway_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalShareCollection unmarshals an instance of ShareCollection from the specified map of raw messages. -func UnmarshalShareCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "shares", &obj.Shares, UnmarshalShare) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateVPNGatewayOptions : Instantiate UpdateVPNGatewayOptions +func (*VpcV1) NewUpdateVPNGatewayOptions(id string, vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { + return &UpdateVPNGatewayOptions{ + ID: core.StringPtr(id), + VPNGatewayPatch: vpnGatewayPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *UpdateVPNGatewayOptions) SetID(id string) *UpdateVPNGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } -// ShareCollectionFirst : A link to the first page of resources. -type ShareCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetVPNGatewayPatch : Allow user to set VPNGatewayPatch +func (_options *UpdateVPNGatewayOptions) SetVPNGatewayPatch(vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { + _options.VPNGatewayPatch = vpnGatewayPatch + return _options } -// UnmarshalShareCollectionFirst unmarshals an instance of ShareCollectionFirst from the specified map of raw messages. -func UnmarshalShareCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateVPNGatewayOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayOptions { + options.Headers = param + return options } -// ShareCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateVPNServerOptions : The UpdateVPNServer options. +type UpdateVPNServerOptions struct { + // The VPN server identifier. + ID *string `json:"id" validate:"required,ne="` + + // The VPN server patch. + VPNServerPatch map[string]interface{} `json:"VPNServer_patch" validate:"required"` + + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalShareCollectionNext unmarshals an instance of ShareCollectionNext from the specified map of raw messages. -func UnmarshalShareCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateVPNServerOptions : Instantiate UpdateVPNServerOptions +func (*VpcV1) NewUpdateVPNServerOptions(id string, vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { + return &UpdateVPNServerOptions{ + ID: core.StringPtr(id), + VPNServerPatch: vpnServerPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ShareIdentity : Identifies a file share by a unique property. -// Models which "extend" this model: -// - ShareIdentityByID -// - ShareIdentityByCRN -// - ShareIdentityByHref -type ShareIdentity struct { - // The unique identifier for this file share. - ID *string `json:"id,omitempty"` - - // The CRN for this file share. - CRN *string `json:"crn,omitempty"` - - // The URL for this file share. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateVPNServerOptions) SetID(id string) *UpdateVPNServerOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*ShareIdentity) isaShareIdentity() bool { - return true +// SetVPNServerPatch : Allow user to set VPNServerPatch +func (_options *UpdateVPNServerOptions) SetVPNServerPatch(vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { + _options.VPNServerPatch = vpnServerPatch + return _options } -type ShareIdentityIntf interface { - isaShareIdentity() bool +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVPNServerOptions) SetIfMatch(ifMatch string) *UpdateVPNServerOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options } -// UnmarshalShareIdentity unmarshals an instance of ShareIdentity from the specified map of raw messages. -func UnmarshalShareIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateVPNServerOptions) SetHeaders(param map[string]string) *UpdateVPNServerOptions { + options.Headers = param + return options } -// ShareInitialOwner : ShareInitialOwner struct -type ShareInitialOwner struct { - // The initial group identifier for the file share. - Gid *int64 `json:"gid,omitempty"` +// UpdateVPNServerRouteOptions : The UpdateVPNServerRoute options. +type UpdateVPNServerRouteOptions struct { + // The VPN server identifier. + VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - // The initial user identifier for the file share. - Uid *int64 `json:"uid,omitempty"` + // The VPN route identifier. + ID *string `json:"id" validate:"required,ne="` + + // The VPN route patch. + VPNServerRoutePatch map[string]interface{} `json:"VPNServerRoute_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalShareInitialOwner unmarshals an instance of ShareInitialOwner from the specified map of raw messages. -func UnmarshalShareInitialOwner(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareInitialOwner) - err = core.UnmarshalPrimitive(m, "gid", &obj.Gid) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uid", &obj.Uid) - if err != nil { - return +// NewUpdateVPNServerRouteOptions : Instantiate UpdateVPNServerRouteOptions +func (*VpcV1) NewUpdateVPNServerRouteOptions(vpnServerID string, id string, vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { + return &UpdateVPNServerRouteOptions{ + VPNServerID: core.StringPtr(vpnServerID), + ID: core.StringPtr(id), + VPNServerRoutePatch: vpnServerRoutePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ShareJob : ShareJob struct -type ShareJob struct { - // The status of the file share job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the - // unexpected property value was encountered. - // - // * `cancelled`: This job has been cancelled. - // * `failed`: This job has failed. - // * `queued`: This job is queued. - // * `running`: This job is running. - // * `succeeded`: This job completed successfully. - Status *string `json:"status" validate:"required"` - - // The reasons for the file share job status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ShareJobStatusReason `json:"status_reasons" validate:"required"` - - // The type of the file share job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the - // unexpected property value was encountered. - // - // * `replication_failover`: This is a share replication failover job. - // * `replication_init`: This is a share replication is initialization job. - // * `replication_split`: This is a share replication split job. - Type *string `json:"type" validate:"required"` +// SetVPNServerID : Allow user to set VPNServerID +func (_options *UpdateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *UpdateVPNServerRouteOptions { + _options.VPNServerID = core.StringPtr(vpnServerID) + return _options } -// Constants associated with the ShareJob.Status property. -// The status of the file share job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the -// unexpected property value was encountered. -// -// * `cancelled`: This job has been cancelled. -// * `failed`: This job has failed. -// * `queued`: This job is queued. -// * `running`: This job is running. -// * `succeeded`: This job completed successfully. -const ( - ShareJobStatusCancelledConst = "cancelled" - ShareJobStatusFailedConst = "failed" - ShareJobStatusQueuedConst = "queued" - ShareJobStatusRunningConst = "running" - ShareJobStatusSucceededConst = "succeeded" -) +// SetID : Allow user to set ID +func (_options *UpdateVPNServerRouteOptions) SetID(id string) *UpdateVPNServerRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the ShareJob.Type property. -// The type of the file share job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the -// unexpected property value was encountered. -// -// * `replication_failover`: This is a share replication failover job. -// * `replication_init`: This is a share replication is initialization job. -// * `replication_split`: This is a share replication split job. -const ( - ShareJobTypeReplicationFailoverConst = "replication_failover" - ShareJobTypeReplicationInitConst = "replication_init" - ShareJobTypeReplicationSplitConst = "replication_split" -) +// SetVPNServerRoutePatch : Allow user to set VPNServerRoutePatch +func (_options *UpdateVPNServerRouteOptions) SetVPNServerRoutePatch(vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { + _options.VPNServerRoutePatch = vpnServerRoutePatch + return _options +} -// UnmarshalShareJob unmarshals an instance of ShareJob from the specified map of raw messages. -func UnmarshalShareJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareJob) - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalShareJobStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateVPNServerRouteOptions) SetHeaders(param map[string]string) *UpdateVPNServerRouteOptions { + options.Headers = param + return options } -// ShareJobStatusReason : ShareJobStatusReason struct -type ShareJobStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// Vcpu : The VCPU configuration. +type Vcpu struct { + // The VCPU architecture. + Architecture *string `json:"architecture" validate:"required"` - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` + // The number of VCPUs assigned. + Count *int64 `json:"count" validate:"required"` - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` + // The VCPU manufacturer. + Manufacturer *string `json:"manufacturer" validate:"required"` } -// Constants associated with the ShareJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ShareJobStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" - ShareJobStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" - ShareJobStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" -) - -// UnmarshalShareJobStatusReason unmarshals an instance of ShareJobStatusReason from the specified map of raw messages. -func UnmarshalShareJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +// UnmarshalVcpu unmarshals an instance of Vcpu from the specified map of raw messages. +func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Vcpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) if err != nil { return } @@ -66717,134 +78209,106 @@ func UnmarshalShareJobStatusReason(m map[string]json.RawMessage, result interfac return } -// ShareMountTarget : ShareMountTarget struct -type ShareMountTarget struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a mount - // target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // The enumerated access control mode values for this property may expand in the future. When processing this property, - // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which - // the unexpected access control mode was encountered. - AccessControlMode *string `json:"access_control_mode" validate:"required"` +// VPC : VPC struct +type VPC struct { + // Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private + // network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected + // in this way. This value is set at creation and subsequently immutable. + ClassicAccess *bool `json:"classic_access" validate:"required"` - // The date and time that the share mount target was created. + // The date and time that the VPC was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` + // The CSE ([Cloud Service Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) source IP + // addresses for the VPC. The VPC will have one CSE source IP address per zone. + CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` - // The lifecycle state of the mount target. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The default network ACL to use for subnets created in this VPC. + DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` - // The mount path for the share. The server component of the mount path may be either an IP address or a fully - // qualified domain name. - // - // This property will be absent if the `lifecycle_state` of the mount target is - // 'pending', `failed`, or `deleting`. - // - // If the share's `access_control_mode` is: - // - // - `security_group`: The IP address used in the mount path is the `primary_ip` - // address of the virtual network interface for this share mount target. - // - `vpc`: The fully-qualified domain name used in the mount path is an address that - // resolves to the share mount target. - MountPath *string `json:"mount_path,omitempty"` + // The default routing table to use for subnets created in this VPC. + DefaultRoutingTable *RoutingTableReference `json:"default_routing_table" validate:"required"` - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` + // The default security group for this VPC. Resources created in this VPC that allow + // a security group to be optionally specified will use this security group by + // default. + DefaultSecurityGroup *SecurityGroupReference `json:"default_security_group" validate:"required"` - // The primary IP address of the virtual network interface for the share mount target. + // The DNS configuration for this VPC. + Dns *Vpcdns `json:"dns" validate:"required"` + + // The reasons for the current `health_state` (if any). // - // Absent if `access_control_mode` is `vpc`. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPCHealthReason `json:"health_reasons" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` - // The subnet of the virtual network interface for the share mount target. - // - // Absent if `access_control_mode` is `vpc`. - Subnet *SubnetReference `json:"subnet,omitempty"` + // The URL for this VPC. + Href *string `json:"href" validate:"required"` - // The transit encryption mode for this share mount target: - // - `none`: Not encrypted in transit - // - `user_managed`: Encrypted in transit using an instance identity certificate - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - TransitEncryption *string `json:"transit_encryption" validate:"required"` + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` - // The virtual network interface for this file share mount target. - // - // This property will be present when the `access_control_mode` is `security_group`. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface,omitempty"` + // The name for this VPC. The name is unique across all VPCs in the region. + Name *string `json:"name" validate:"required"` - // If `access_control_mode` is: - // - // - `security_group`: The VPC for the virtual network interface for this share mount - // target - // - `vpc`: The VPC in which clients can mount the file share using this share - // mount target. - VPC *VPCReference `json:"vpc" validate:"required"` -} + // The resource group for this VPC. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// Constants associated with the ShareMountTarget.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a mount -// target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// -// The enumerated access control mode values for this property may expand in the future. When processing this property, -// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which -// the unexpected access control mode was encountered. -const ( - ShareMountTargetAccessControlModeSecurityGroupConst = "security_group" - ShareMountTargetAccessControlModeVPCConst = "vpc" -) + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// Constants associated with the ShareMountTarget.LifecycleState property. -// The lifecycle state of the mount target. + // The status of this VPC. + Status *string `json:"status" validate:"required"` +} + +// Constants associated with the VPC.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. const ( - ShareMountTargetLifecycleStateDeletingConst = "deleting" - ShareMountTargetLifecycleStateFailedConst = "failed" - ShareMountTargetLifecycleStatePendingConst = "pending" - ShareMountTargetLifecycleStateStableConst = "stable" - ShareMountTargetLifecycleStateSuspendedConst = "suspended" - ShareMountTargetLifecycleStateUpdatingConst = "updating" - ShareMountTargetLifecycleStateWaitingConst = "waiting" + VPCHealthStateDegradedConst = "degraded" + VPCHealthStateFaultedConst = "faulted" + VPCHealthStateInapplicableConst = "inapplicable" + VPCHealthStateOkConst = "ok" ) -// Constants associated with the ShareMountTarget.ResourceType property. +// Constants associated with the VPC.ResourceType property. // The resource type. const ( - ShareMountTargetResourceTypeShareMountTargetConst = "share_mount_target" + VPCResourceTypeVPCConst = "vpc" ) -// Constants associated with the ShareMountTarget.TransitEncryption property. -// The transit encryption mode for this share mount target: -// - `none`: Not encrypted in transit -// - `user_managed`: Encrypted in transit using an instance identity certificate -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. +// Constants associated with the VPC.Status property. +// The status of this VPC. const ( - ShareMountTargetTransitEncryptionNoneConst = "none" - ShareMountTargetTransitEncryptionUserManagedConst = "user_managed" + VPCStatusAvailableConst = "available" + VPCStatusDeletingConst = "deleting" + VPCStatusFailedConst = "failed" + VPCStatusPendingConst = "pending" ) -// UnmarshalShareMountTarget unmarshals an instance of ShareMountTarget from the specified map of raw messages. -func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTarget) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) +// UnmarshalVPC unmarshals an instance of VPC from the specified map of raw messages. +func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPC) + err = core.UnmarshalPrimitive(m, "classic_access", &obj.ClassicAccess) if err != nil { return } @@ -66852,47 +78316,59 @@ func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "cse_source_ips", &obj.CseSourceIps, UnmarshalVpccseSourceIP) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalModel(m, "default_network_acl", &obj.DefaultNetworkACL, UnmarshalNetworkACLReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mount_path", &obj.MountPath) + err = core.UnmarshalModel(m, "default_routing_table", &obj.DefaultRoutingTable, UnmarshalRoutingTableReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "default_security_group", &obj.DefaultSecurityGroup, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdns) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPCHealthReason) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } @@ -66900,29 +78376,53 @@ func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) return } -// ShareMountTargetCollection : ShareMountTargetCollection struct -type ShareMountTargetCollection struct { +// VpccseSourceIP : VpccseSourceIP struct +type VpccseSourceIP struct { + // The cloud service endpoint source IP address for this zone. + IP *IP `json:"ip" validate:"required"` + + // The zone this cloud service endpoint source IP resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// UnmarshalVpccseSourceIP unmarshals an instance of VpccseSourceIP from the specified map of raw messages. +func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpccseSourceIP) + err = core.UnmarshalModel(m, "ip", &obj.IP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCCollection : VPCCollection struct +type VPCCollection struct { // A link to the first page of resources. - First *ShareMountTargetCollectionFirst `json:"first" validate:"required"` + First *VPCCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of share mount targets. - MountTargets []ShareMountTarget `json:"mount_targets" validate:"required"` - // A link to the next page of resources. This property is present for all pages // except the last page. - Next *ShareMountTargetCollectionNext `json:"next,omitempty"` + Next *VPCCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` + + // Collection of VPCs. + Vpcs []VPC `json:"vpcs" validate:"required"` } -// UnmarshalShareMountTargetCollection unmarshals an instance of ShareMountTargetCollection from the specified map of raw messages. -func UnmarshalShareMountTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareMountTargetCollectionFirst) +// UnmarshalVPCCollection unmarshals an instance of VPCCollection from the specified map of raw messages. +func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPCCollectionFirst) if err != nil { return } @@ -66930,15 +78430,15 @@ func UnmarshalShareMountTargetCollection(m map[string]json.RawMessage, result in if err != nil { return } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTarget) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPCCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareMountTargetCollectionNext) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "vpcs", &obj.Vpcs, UnmarshalVPC) if err != nil { return } @@ -66947,7 +78447,7 @@ func UnmarshalShareMountTargetCollection(m map[string]json.RawMessage, result in } // Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareMountTargetCollection) GetNextStart() (*string, error) { +func (resp *VPCCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -66958,15 +78458,15 @@ func (resp *ShareMountTargetCollection) GetNextStart() (*string, error) { return start, nil } -// ShareMountTargetCollectionFirst : A link to the first page of resources. -type ShareMountTargetCollectionFirst struct { +// VPCCollectionFirst : A link to the first page of resources. +type VPCCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalShareMountTargetCollectionFirst unmarshals an instance of ShareMountTargetCollectionFirst from the specified map of raw messages. -func UnmarshalShareMountTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollectionFirst) +// UnmarshalVPCCollectionFirst unmarshals an instance of VPCCollectionFirst from the specified map of raw messages. +func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -66975,15 +78475,15 @@ func UnmarshalShareMountTargetCollectionFirst(m map[string]json.RawMessage, resu return } -// ShareMountTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareMountTargetCollectionNext struct { +// VPCCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPCCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalShareMountTargetCollectionNext unmarshals an instance of ShareMountTargetCollectionNext from the specified map of raw messages. -func UnmarshalShareMountTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollectionNext) +// UnmarshalVPCCollectionNext unmarshals an instance of VPCCollectionNext from the specified map of raw messages. +func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -66992,157 +78492,30 @@ func UnmarshalShareMountTargetCollectionNext(m map[string]json.RawMessage, resul return } -// ShareMountTargetPatch : ShareMountTargetPatch struct -type ShareMountTargetPatch struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` -} - -// UnmarshalShareMountTargetPatch unmarshals an instance of ShareMountTargetPatch from the specified map of raw messages. -func UnmarshalShareMountTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ShareMountTargetPatch -func (shareMountTargetPatch *ShareMountTargetPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(shareMountTargetPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ShareMountTargetPrototype : ShareMountTargetPrototype struct -// Models which "extend" this model: -// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup -// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC -type ShareMountTargetPrototype struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface,omitempty"` - - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc,omitempty"` -} - -// Constants associated with the ShareMountTargetPrototype.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeTransitEncryptionUserManagedConst = "user_managed" -) - -func (*ShareMountTargetPrototype) isaShareMountTargetPrototype() bool { - return true -} - -type ShareMountTargetPrototypeIntf interface { - isaShareMountTargetPrototype() bool -} - -// UnmarshalShareMountTargetPrototype unmarshals an instance of ShareMountTargetPrototype from the specified map of raw messages. -func UnmarshalShareMountTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetReference : ShareMountTargetReference struct -type ShareMountTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` +// Vpcdns : The DNS configuration for this VPC. +type Vpcdns struct { + // Indicates whether this VPC is enabled as a DNS name resolution hub. + EnableHub *bool `json:"enable_hub" validate:"required"` - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` + // The number of DNS resolution bindings for this VPC. + ResolutionBindingCount *int64 `json:"resolution_binding_count" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The DNS resolver configuration for the VPC. + Resolver VpcdnsResolverIntf `json:"resolver" validate:"required"` } -// Constants associated with the ShareMountTargetReference.ResourceType property. -// The resource type. -const ( - ShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" -) - -// UnmarshalShareMountTargetReference unmarshals an instance of ShareMountTargetReference from the specified map of raw messages. -func UnmarshalShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalVpcdns unmarshals an instance of Vpcdns from the specified map of raw messages. +func UnmarshalVpcdns(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Vpcdns) + err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "resolution_binding_count", &obj.ResolutionBindingCount) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ShareMountTargetReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalShareMountTargetReferenceDeleted unmarshals an instance of ShareMountTargetReferenceDeleted from the specified map of raw messages. -func UnmarshalShareMountTargetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolver) if err != nil { return } @@ -67150,67 +78523,27 @@ func UnmarshalShareMountTargetReferenceDeleted(m map[string]json.RawMessage, res return } -// ShareMountTargetVirtualNetworkInterfacePrototype : ShareMountTargetVirtualNetworkInterfacePrototype struct -// Models which "extend" this model: -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext -type ShareMountTargetVirtualNetworkInterfacePrototype struct { - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. +// VpcdnsPatch : The DNS configuration for this VPC. +type VpcdnsPatch struct { + // Indicates whether this VPC is enabled as a DNS name resolution hub. // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // Updating the value to `true` requires `allow_dns_resolution_binding` to be `true` for all endpoint gateways residing + // in this VPC. // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // share's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototype) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} + // Changing the value requires `dns.resolution_binding_count` to be zero. + EnableHub *bool `json:"enable_hub,omitempty"` -type ShareMountTargetVirtualNetworkInterfacePrototypeIntf interface { - isaShareMountTargetVirtualNetworkInterfacePrototype() bool + Resolver *VpcdnsResolverPatch `json:"resolver,omitempty"` } -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototype unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) +// UnmarshalVpcdnsPatch unmarshals an instance of VpcdnsPatch from the specified map of raw messages. +func UnmarshalVpcdnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsPatch) + err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPatch) if err != nil { return } @@ -67218,165 +78551,25 @@ func UnmarshalShareMountTargetVirtualNetworkInterfacePrototype(m map[string]json return } -// SharePatch : SharePatch struct -type SharePatch struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // For this property to be changed, the share must have no mount targets and - // `replication_role` must be `none`. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The maximum input/output operations per second (IOPS) for the file share. The value must be in the range supported - // by the share's size. - // - // For this property to be changed, the share `lifecycle_state` must be `stable`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this share. The name must not be used by another share in the region. - Name *string `json:"name,omitempty"` - - // The profile to use for this file share. - // - // The requested profile must be in the same `family`. - Profile ShareProfileIdentityIntf `json:"profile,omitempty"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - // - // For this property to be changed, the share `replication_role` must be `replica`. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - - // The size of the file share rounded up to the next gigabyte. The value must not be less than the share's current - // size, and must not exceed the maximum supported by the share's profile and IOPS. - // - // For this property to be changed, the share `lifecycle_state` must be `stable`. - Size *int64 `json:"size,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` -} - -// Constants associated with the SharePatch.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// VpcdnsPrototype : The DNS configuration for this VPC. // -// For this property to be changed, the share must have no mount targets and -// `replication_role` must be `none`. -const ( - SharePatchAccessControlModeSecurityGroupConst = "security_group" - SharePatchAccessControlModeVPCConst = "vpc" -) - -// UnmarshalSharePatch unmarshals an instance of SharePatch from the specified map of raw messages. -func UnmarshalSharePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePatch) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SharePatch -func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(sharePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ShareProfile : ShareProfile struct -type ShareProfile struct { - // The permitted capacity range (in gigabytes) for a share with this profile. - Capacity ShareProfileCapacityIntf `json:"capacity" validate:"required"` - - // The product family this share profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this share profile. - Href *string `json:"href" validate:"required"` - - // The permitted IOPS range for a share with this profile. - Iops ShareProfileIopsIntf `json:"iops" validate:"required"` - - // The globally unique name for this share profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ShareProfile.Family property. -// The product family this share profile belongs to. -const ( - ShareProfileFamilyDefinedPerformanceConst = "defined_performance" -) - -// Constants associated with the ShareProfile.ResourceType property. -// The resource type. -const ( - ShareProfileResourceTypeShareProfileConst = "share_profile" -) - -// UnmarshalShareProfile unmarshals an instance of ShareProfile from the specified map of raw messages. -func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfile) - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalShareProfileCapacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "iops", &obj.Iops, UnmarshalShareProfileIops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint gateways within this VPC, +// and hosts on the internet. +type VpcdnsPrototype struct { + // Indicates whether this VPC is enabled as a DNS name resolution hub. + EnableHub *bool `json:"enable_hub,omitempty"` + + Resolver VpcdnsResolverPrototypeIntf `json:"resolver,omitempty"` +} + +// UnmarshalVpcdnsPrototype unmarshals an instance of VpcdnsPrototype from the specified map of raw messages. +func UnmarshalVpcdnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsPrototype) + err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPrototype) if err != nil { return } @@ -67384,77 +78577,88 @@ func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (er return } -// ShareProfileCapacity : ShareProfileCapacity struct -// Models which "extend" this model: -// - ShareProfileCapacityFixed -// - ShareProfileCapacityRange -// - ShareProfileCapacityEnum -// - ShareProfileCapacityDependentRange -type ShareProfileCapacity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// VpcdnsResolutionBinding : VpcdnsResolutionBinding struct +type VpcdnsResolutionBinding struct { + // The date and time that the DNS resolution binding was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The endpoint gateways that have `allow_dns_resolution_binding` set to `true` and reside in the VPC that has + // `dns.enable_hub` set to `false`. + // + // The endpoint gateways may be remote and therefore may not be directly retrievable. + EndpointGateways []EndpointGatewayReferenceRemote `json:"endpoint_gateways" validate:"required"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The URL for this DNS resolution binding. + Href *string `json:"href" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The unique identifier for this DNS resolution binding. + ID *string `json:"id" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The lifecycle state of the DNS resolution binding. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC. + Name *string `json:"name" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The VPC bound to for DNS resolution. + // + // The VPC may be remote and therefore may not be directly retrievable. + VPC *VPCReferenceRemote `json:"vpc" validate:"required"` } -// Constants associated with the ShareProfileCapacity.Type property. -// The type for this profile field. +// Constants associated with the VpcdnsResolutionBinding.LifecycleState property. +// The lifecycle state of the DNS resolution binding. const ( - ShareProfileCapacityTypeFixedConst = "fixed" + VpcdnsResolutionBindingLifecycleStateDeletingConst = "deleting" + VpcdnsResolutionBindingLifecycleStateFailedConst = "failed" + VpcdnsResolutionBindingLifecycleStatePendingConst = "pending" + VpcdnsResolutionBindingLifecycleStateStableConst = "stable" + VpcdnsResolutionBindingLifecycleStateSuspendedConst = "suspended" + VpcdnsResolutionBindingLifecycleStateUpdatingConst = "updating" + VpcdnsResolutionBindingLifecycleStateWaitingConst = "waiting" ) -func (*ShareProfileCapacity) isaShareProfileCapacity() bool { - return true -} - -type ShareProfileCapacityIntf interface { - isaShareProfileCapacity() bool -} +// Constants associated with the VpcdnsResolutionBinding.ResourceType property. +// The resource type. +const ( + VpcdnsResolutionBindingResourceTypeVPCDnsResolutionBindingConst = "vpc_dns_resolution_binding" +) -// UnmarshalShareProfileCapacity unmarshals an instance of ShareProfileCapacity from the specified map of raw messages. -func UnmarshalShareProfileCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalVpcdnsResolutionBinding unmarshals an instance of VpcdnsResolutionBinding from the specified map of raw messages. +func UnmarshalVpcdnsResolutionBinding(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolutionBinding) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGatewayReferenceRemote) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceRemote) if err != nil { return } @@ -67462,41 +78666,41 @@ func UnmarshalShareProfileCapacity(m map[string]json.RawMessage, result interfac return } -// ShareProfileCollection : ShareProfileCollection struct -type ShareProfileCollection struct { +// VpcdnsResolutionBindingCollection : VpcdnsResolutionBindingCollection struct +type VpcdnsResolutionBindingCollection struct { + // Collection of DNS resolution bindings for this VPC. + DnsResolutionBindings []VpcdnsResolutionBinding `json:"dns_resolution_bindings" validate:"required"` + // A link to the first page of resources. - First *ShareProfileCollectionFirst `json:"first" validate:"required"` + First *VpcdnsResolutionBindingCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *ShareProfileCollectionNext `json:"next,omitempty"` - - // Collection of share profiles. - Profiles []ShareProfile `json:"profiles" validate:"required"` + Next *VpcdnsResolutionBindingCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalShareProfileCollection unmarshals an instance of ShareProfileCollection from the specified map of raw messages. -func UnmarshalShareProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareProfileCollectionFirst) +// UnmarshalVpcdnsResolutionBindingCollection unmarshals an instance of VpcdnsResolutionBindingCollection from the specified map of raw messages. +func UnmarshalVpcdnsResolutionBindingCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolutionBindingCollection) + err = core.UnmarshalModel(m, "dns_resolution_bindings", &obj.DnsResolutionBindings, UnmarshalVpcdnsResolutionBinding) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVpcdnsResolutionBindingCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalShareProfile) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVpcdnsResolutionBindingCollectionNext) if err != nil { return } @@ -67509,7 +78713,7 @@ func UnmarshalShareProfileCollection(m map[string]json.RawMessage, result interf } // Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareProfileCollection) GetNextStart() (*string, error) { +func (resp *VpcdnsResolutionBindingCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -67520,16 +78724,16 @@ func (resp *ShareProfileCollection) GetNextStart() (*string, error) { return start, nil } -// ShareProfileCollectionFirst : A link to the first page of resources. -type ShareProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// VpcdnsResolutionBindingPatch : VpcdnsResolutionBindingPatch struct +type VpcdnsResolutionBindingPatch struct { + // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. + Name *string `json:"name,omitempty"` } -// UnmarshalShareProfileCollectionFirst unmarshals an instance of ShareProfileCollectionFirst from the specified map of raw messages. -func UnmarshalShareProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVpcdnsResolutionBindingPatch unmarshals an instance of VpcdnsResolutionBindingPatch from the specified map of raw messages. +func UnmarshalVpcdnsResolutionBindingPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolutionBindingPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -67537,16 +78741,139 @@ func UnmarshalShareProfileCollectionFirst(m map[string]json.RawMessage, result i return } -// ShareProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// AsPatch returns a generic map representation of the VpcdnsResolutionBindingPatch +func (vpcdnsResolutionBindingPatch *VpcdnsResolutionBindingPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpcdnsResolutionBindingPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// UnmarshalShareProfileCollectionNext unmarshals an instance of ShareProfileCollectionNext from the specified map of raw messages. -func UnmarshalShareProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// VpcdnsResolver : VpcdnsResolver struct +// Models which "extend" this model: +// - VpcdnsResolverTypeDelegated +// - VpcdnsResolverTypeManual +// - VpcdnsResolverTypeSystem +type VpcdnsResolver struct { + // The DNS servers for this VPC. The servers are populated: + // + // - by the system when `dns.resolver.type` is `system` + // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` + // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. + Servers []DnsServer `json:"servers" validate:"required"` + + // The type of the DNS resolver used for the VPC. + // + // - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC + // specified in `dns.resolver.vpc`. + // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. + // - `system`: DNS server addresses are provided by the system. + Type *string `json:"type" validate:"required"` + + // The VPC whose DNS resolver provides the DNS server addresses for this VPC. + // + // The VPC may be remote and therefore may not be directly retrievable. + VPC *VPCReferenceDnsResolverContext `json:"vpc,omitempty"` + + // The manually specified DNS servers for this VPC. + // + // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the + // affinity for that zone first, followed by the unique DNS servers from other zones. + // + // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + ManualServers []DnsServer `json:"manual_servers,omitempty"` + + // The configuration of the system DNS resolver for this VPC. + // + // - `custom_resolver`: A custom DNS resolver is configured for this VPC. + // + // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when + // the VPC has either or both of the following: + // + // - at least one endpoint gateway residing in it + // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it + // + // - `default`: The provider default DNS resolvers are configured for this VPC. + // + // This system DNS resolver configuration is used when the VPC has: + // + // - no custom DNS resolver configured for it, and + // - no endpoint gateways residing in it, and + // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. + Configuration *string `json:"configuration,omitempty"` +} + +// Constants associated with the VpcdnsResolver.Type property. +// The type of the DNS resolver used for the VPC. +// +// - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC +// specified in `dns.resolver.vpc`. +// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. +// - `system`: DNS server addresses are provided by the system. +const ( + VpcdnsResolverTypeDelegatedConst = "delegated" + VpcdnsResolverTypeManualConst = "manual" + VpcdnsResolverTypeSystemConst = "system" +) + +// Constants associated with the VpcdnsResolver.Configuration property. +// The configuration of the system DNS resolver for this VPC. +// +// - `custom_resolver`: A custom DNS resolver is configured for this VPC. +// +// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when +// the VPC has either or both of the following: +// +// - at least one endpoint gateway residing in it +// +// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it +// +// - `default`: The provider default DNS resolvers are configured for this VPC. +// +// This system DNS resolver configuration is used when the VPC has: +// +// - no custom DNS resolver configured for it, and +// - no endpoint gateways residing in it, and +// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. +const ( + VpcdnsResolverConfigurationCustomResolverConst = "custom_resolver" + VpcdnsResolverConfigurationDefaultConst = "default" + VpcdnsResolverConfigurationPrivateResolverConst = "private_resolver" +) + +func (*VpcdnsResolver) isaVpcdnsResolver() bool { + return true +} + +type VpcdnsResolverIntf interface { + isaVpcdnsResolver() bool +} + +// UnmarshalVpcdnsResolver unmarshals an instance of VpcdnsResolver from the specified map of raw messages. +func UnmarshalVpcdnsResolver(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolver) + err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) if err != nil { return } @@ -67554,77 +78881,276 @@ func UnmarshalShareProfileCollectionNext(m map[string]json.RawMessage, result in return } -// ShareProfileIops : ShareProfileIops struct -// Models which "extend" this model: -// - ShareProfileIopsFixed -// - ShareProfileIopsRange -// - ShareProfileIopsEnum -// - ShareProfileIopsDependentRange -type ShareProfileIops struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// VpcdnsResolverPatch : VpcdnsResolverPatch struct +type VpcdnsResolverPatch struct { + // The DNS servers to use for this VPC, replacing any existing servers. All the DNS servers must either: + // + // - have a unique `zone_affinity`, or + // - not have a `zone_affinity`. + // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + // + // `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is `manual`. + ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The type of the DNS resolver to use. + // + // - `delegated`: DNS server addresses will be provided by the resolver for the VPC + // specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be + // `false`. + // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. + // - `system`: DNS server addresses will be provided by the system and depend on the + // configuration. + // + // Updating from `manual` requires `dns.resolver.manual_servers` to be specified as + // `null`. + // + // Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. + // + // Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. + Type *string `json:"type,omitempty"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured + // with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in + // one of this VPC's DNS resolution bindings. + // + // Specify `null` to remove an existing VPC. + // + // This property must be set if and only if `dns.resolver.type` is `delegated`. + VPC VpcdnsResolverVPCPatchIntf `json:"vpc,omitempty"` +} - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// Constants associated with the VpcdnsResolverPatch.Type property. +// The type of the DNS resolver to use. +// +// - `delegated`: DNS server addresses will be provided by the resolver for the VPC +// specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be +// `false`. +// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. +// - `system`: DNS server addresses will be provided by the system and depend on the +// configuration. +// +// Updating from `manual` requires `dns.resolver.manual_servers` to be specified as +// `null`. +// +// Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. +// +// Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. +const ( + VpcdnsResolverPatchTypeDelegatedConst = "delegated" + VpcdnsResolverPatchTypeManualConst = "manual" + VpcdnsResolverPatchTypeSystemConst = "system" +) - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// UnmarshalVpcdnsResolverPatch unmarshals an instance of VpcdnsResolverPatch from the specified map of raw messages. +func UnmarshalVpcdnsResolverPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverPatch) + err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVpcdnsResolverVPCPatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` +// VpcdnsResolverPrototype : VpcdnsResolverPrototype struct +// Models which "extend" this model: +// - VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype +// - VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype +type VpcdnsResolverPrototype struct { + // The type of the DNS resolver to use. + // + // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. + // - `system`: DNS server addresses will be provided by the system and depend on the + // configuration. + Type *string `json:"type,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The DNS servers to use for this VPC. All the DNS servers must either: + // + // - have a unique `zone_affinity`, or + // - not have a `zone_affinity`. + // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` } -// Constants associated with the ShareProfileIops.Type property. -// The type for this profile field. +// Constants associated with the VpcdnsResolverPrototype.Type property. +// The type of the DNS resolver to use. +// +// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. +// - `system`: DNS server addresses will be provided by the system and depend on the +// configuration. const ( - ShareProfileIopsTypeFixedConst = "fixed" + VpcdnsResolverPrototypeTypeManualConst = "manual" + VpcdnsResolverPrototypeTypeSystemConst = "system" ) -func (*ShareProfileIops) isaShareProfileIops() bool { +func (*VpcdnsResolverPrototype) isaVpcdnsResolverPrototype() bool { return true } -type ShareProfileIopsIntf interface { - isaShareProfileIops() bool +type VpcdnsResolverPrototypeIntf interface { + isaVpcdnsResolverPrototype() bool } -// UnmarshalShareProfileIops unmarshals an instance of ShareProfileIops from the specified map of raw messages. -func UnmarshalShareProfileIops(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIops) +// UnmarshalVpcdnsResolverPrototype unmarshals an instance of VpcdnsResolverPrototype from the specified map of raw messages. +func UnmarshalVpcdnsResolverPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverPrototype) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VpcdnsResolverVPCPatch : The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured with a [DNS +// Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in one of this VPC's DNS resolution +// bindings. +// +// Specify `null` to remove an existing VPC. +// +// This property must be set if and only if `dns.resolver.type` is `delegated`. +// Models which "extend" this model: +// - VpcdnsResolverVPCPatchVPCIdentityByID +// - VpcdnsResolverVPCPatchVPCIdentityByCRN +// - VpcdnsResolverVPCPatchVPCIdentityByHref +type VpcdnsResolverVPCPatch struct { + // The unique identifier for this VPC. + ID *string `json:"id,omitempty"` + + // The CRN for this VPC. + CRN *string `json:"crn,omitempty"` + + // The URL for this VPC. + Href *string `json:"href,omitempty"` +} + +func (*VpcdnsResolverVPCPatch) isaVpcdnsResolverVPCPatch() bool { + return true +} + +type VpcdnsResolverVPCPatchIntf interface { + isaVpcdnsResolverVPCPatch() bool +} + +// UnmarshalVpcdnsResolverVPCPatch unmarshals an instance of VpcdnsResolverVPCPatch from the specified map of raw messages. +func UnmarshalVpcdnsResolverVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverVPCPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCHealthReason : VPCHealthReason struct +type VPCHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPCHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPCHealthReasonCodeDnsResolutionBindingFailedConst = "dns_resolution_binding_failed" + VPCHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPCHealthReason unmarshals an instance of VPCHealthReason from the specified map of raw messages. +func UnmarshalVPCHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCIdentity : Identifies a VPC by a unique property. +// Models which "extend" this model: +// - VPCIdentityByID +// - VPCIdentityByCRN +// - VPCIdentityByHref +type VPCIdentity struct { + // The unique identifier for this VPC. + ID *string `json:"id,omitempty"` + + // The CRN for this VPC. + CRN *string `json:"crn,omitempty"` + + // The URL for this VPC. + Href *string `json:"href,omitempty"` +} + +func (*VPCIdentity) isaVPCIdentity() bool { + return true +} + +type VPCIdentityIntf interface { + isaVPCIdentity() bool +} + +// UnmarshalVPCIdentity unmarshals an instance of VPCIdentity from the specified map of raw messages. +func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -67632,34 +79158,23 @@ func UnmarshalShareProfileIops(m map[string]json.RawMessage, result interface{}) return } -// ShareProfileIdentity : Identifies a share profile by a unique property. -// Models which "extend" this model: -// - ShareProfileIdentityByName -// - ShareProfileIdentityByHref -type ShareProfileIdentity struct { - // The globally unique name for this share profile. - Name *string `json:"name,omitempty"` - - // The URL for this share profile. - Href *string `json:"href,omitempty"` -} - -func (*ShareProfileIdentity) isaShareProfileIdentity() bool { - return true -} +// VPCPatch : VPCPatch struct +type VPCPatch struct { + // The DNS configuration for this VPC. + Dns *VpcdnsPatch `json:"dns,omitempty"` -type ShareProfileIdentityIntf interface { - isaShareProfileIdentity() bool + // The name for this VPC. The name must not be used by another VPC in the region. + Name *string `json:"name,omitempty"` } -// UnmarshalShareProfileIdentity unmarshals an instance of ShareProfileIdentity from the specified map of raw messages. -func UnmarshalShareProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalVPCPatch unmarshals an instance of VPCPatch from the specified map of raw messages. +func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCPatch) + err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdnsPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -67667,31 +79182,63 @@ func UnmarshalShareProfileIdentity(m map[string]json.RawMessage, result interfac return } -// ShareProfileReference : ShareProfileReference struct -type ShareProfileReference struct { - // The URL for this share profile. +// AsPatch returns a generic map representation of the VPCPatch +func (vpcPatch *VPCPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpcPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// VPCReference : VPCReference struct +type VPCReference struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this VPC. Href *string `json:"href" validate:"required"` - // The globally unique name for this share profile. + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` + + // The name for this VPC. The name is unique across all VPCs in the region. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ShareProfileReference.ResourceType property. +// Constants associated with the VPCReference.ResourceType property. // The resource type. const ( - ShareProfileReferenceResourceTypeShareProfileConst = "share_profile" + VPCReferenceResourceTypeVPCConst = "vpc" ) -// UnmarshalShareProfileReference unmarshals an instance of ShareProfileReference from the specified map of raw messages. -func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileReference) +// UnmarshalVPCReference unmarshals an instance of VPCReference from the specified map of raw messages. +func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -67704,110 +79251,56 @@ func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interfa return } -// SharePrototype : SharePrototype struct -// Models which "extend" this model: -// - SharePrototypeShareBySize -// - SharePrototypeShareBySourceShare -type SharePrototype struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - // Configuration for a replica file share to create and associate with this file share. If - // unspecified, a replica may be subsequently added by creating a new file share with a - // `source_share` referencing this file share. - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the - // source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. Mount targets for this share - // require a virtual network interface. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // Mount targets for this share require a VPC. - AccessControlMode *string `json:"access_control_mode,omitempty"` +// VPCReferenceDnsResolverContext : A VPC whose DNS resolver is delegated to provide DNS servers for this VPC. +// +// The VPC may be remote and therefore may not be directly retrievable. +type VPCReferenceDnsResolverContext struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` - // The root key to use to wrap the data encryption key for the share. - // - // If unspecified, the `encryption` type for the share will be `provider_managed`. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPCReferenceDnsResolverContextDeleted `json:"deleted,omitempty"` - // The owner assigned to the file share at creation. Subsequent changes to the owner - // must be performed by a client that has mounted the file share. - InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` + // The URL for this VPC. + Href *string `json:"href" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size,omitempty"` + // The name for this VPC. The name is unique across all VPCs in the region. + Name *string `json:"name" validate:"required"` - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *VPCRemote `json:"remote,omitempty"` - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. - SourceShare ShareIdentityIntf `json:"source_share,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the SharePrototype.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. Mount targets for this share -// require a virtual network interface. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// Mount targets for this share require a VPC. +// Constants associated with the VPCReferenceDnsResolverContext.ResourceType property. +// The resource type. const ( - SharePrototypeAccessControlModeSecurityGroupConst = "security_group" - SharePrototypeAccessControlModeVPCConst = "vpc" + VPCReferenceDnsResolverContextResourceTypeVPCConst = "vpc" ) -func (*SharePrototype) isaSharePrototype() bool { - return true -} - -type SharePrototypeIntf interface { - isaSharePrototype() bool -} - -// UnmarshalSharePrototype unmarshals an instance of SharePrototype from the specified map of raw messages. -func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototype) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +// UnmarshalVPCReferenceDnsResolverContext unmarshals an instance of VPCReferenceDnsResolverContext from the specified map of raw messages. +func UnmarshalVPCReferenceDnsResolverContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReferenceDnsResolverContext) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDnsResolverContextDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -67815,47 +79308,133 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) if err != nil { return } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VPCReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalVPCReferenceDeleted unmarshals an instance of VPCReferenceDeleted from the specified map of raw messages. +func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCReferenceDnsResolverContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VPCReferenceDnsResolverContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalVPCReferenceDnsResolverContextDeleted unmarshals an instance of VPCReferenceDnsResolverContextDeleted from the specified map of raw messages. +func UnmarshalVPCReferenceDnsResolverContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReferenceDnsResolverContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCReferenceRemote : VPCReferenceRemote struct +type VPCReferenceRemote struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` + + // The URL for this VPC. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` + + // The name for this VPC. The name is unique across all VPCs in the region. + Name *string `json:"name" validate:"required"` + + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *VPCRemote `json:"remote,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the VPCReferenceRemote.ResourceType property. +// The resource type. +const ( + VPCReferenceRemoteResourceTypeVPCConst = "vpc" +) + +// UnmarshalVPCReferenceRemote unmarshals an instance of VPCReferenceRemote from the specified map of raw messages. +func UnmarshalVPCReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReferenceRemote) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) if err != nil { return } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type VPCRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // account, and identifies the owning account. + Account *AccountReference `json:"account,omitempty"` + + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` +} + +// UnmarshalVPCRemote unmarshals an instance of VPCRemote from the specified map of raw messages. +func UnmarshalVPCRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCRemote) + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) if err != nil { return } @@ -67863,66 +79442,166 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( return } -// SharePrototypeShareContext : Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be -// subsequently added by creating a new file share with a -// `source_share` referencing this file share. -type SharePrototypeShareContext struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` +// VPNGateway : VPNGateway struct +// Models which "extend" this model: +// - VPNGatewayRouteMode +// - VPNGatewayPolicyMode +type VPNGateway struct { + // Connections for this VPN gateway. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - // The mount targets for this replica file share. Each mount target must be in a unique VPC. + // The date and time that this VPN gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` + + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) // - // A replica's mount targets must be mounted read-only. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` + // The VPN gateway's canonical URL. + Href *string `json:"href" validate:"required"` - // The cron specification for the file share replication schedule. + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` + + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - // The resource group to use. If unspecified, the resource group from - // the source share will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` + // Collection of VPN gateway members. + Members []VPNGatewayMember `json:"members" validate:"required"` - // The zone this replica file share will reside in. - // - // Must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource group for this VPN gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The VPC this VPN gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // Route mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -// NewSharePrototypeShareContext : Instantiate SharePrototypeShareContext (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string, zone ZoneIdentityIntf) (_model *SharePrototypeShareContext, err error) { - _model = &SharePrototypeShareContext{ - Profile: profile, - ReplicationCronSpec: core.StringPtr(replicationCronSpec), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the VPNGateway.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNGatewayHealthStateDegradedConst = "degraded" + VPNGatewayHealthStateFaultedConst = "faulted" + VPNGatewayHealthStateInapplicableConst = "inapplicable" + VPNGatewayHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGateway.LifecycleState property. +// The lifecycle state of the VPN gateway. +const ( + VPNGatewayLifecycleStateDeletingConst = "deleting" + VPNGatewayLifecycleStateFailedConst = "failed" + VPNGatewayLifecycleStatePendingConst = "pending" + VPNGatewayLifecycleStateStableConst = "stable" + VPNGatewayLifecycleStateSuspendedConst = "suspended" + VPNGatewayLifecycleStateUpdatingConst = "updating" + VPNGatewayLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGateway.ResourceType property. +// The resource type. +const ( + VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" +) + +// Constants associated with the VPNGateway.Mode property. +// Route mode VPN gateway. +const ( + VPNGatewayModeRouteConst = "route" +) + +func (*VPNGateway) isaVPNGateway() bool { + return true +} + +type VPNGatewayIntf interface { + isaVPNGateway() bool } -// UnmarshalSharePrototypeShareContext unmarshals an instance of SharePrototypeShareContext from the specified map of raw messages. -func UnmarshalSharePrototypeShareContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareContext) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +// UnmarshalVPNGateway unmarshals an instance of VPNGateway from the specified map of raw messages. +func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGateway) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { return } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) if err != nil { return } @@ -67930,23 +79609,23 @@ func UnmarshalSharePrototypeShareContext(m map[string]json.RawMessage, result in if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -67954,58 +79633,45 @@ func UnmarshalSharePrototypeShareContext(m map[string]json.RawMessage, result in return } -// ShareReference : ShareReference struct -type ShareReference struct { - // The CRN for this file share. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareReferenceDeleted `json:"deleted,omitempty"` +// VPNGatewayCollection : VPNGatewayCollection struct +type VPNGatewayCollection struct { + // A link to the first page of resources. + First *VPNGatewayCollectionFirst `json:"first" validate:"required"` - // The URL for this file share. - Href *string `json:"href" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The unique identifier for this file share. - ID *string `json:"id" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPNGatewayCollectionNext `json:"next,omitempty"` - // The name for this share. The name is unique across all shares in the region. - Name *string `json:"name" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Collection of VPN gateways. + VPNGateways []VPNGatewayIntf `json:"vpn_gateways" validate:"required"` } -// Constants associated with the ShareReference.ResourceType property. -// The resource type. -const ( - ShareReferenceResourceTypeShareConst = "share" -) - -// UnmarshalShareReference unmarshals an instance of ShareReference from the specified map of raw messages. -func UnmarshalShareReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareReferenceDeleted) +// UnmarshalVPNGatewayCollection unmarshals an instance of VPNGatewayCollection from the specified map of raw messages. +func UnmarshalVPNGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNGatewayCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNGatewayCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpn_gateways", &obj.VPNGateways, UnmarshalVPNGateway) if err != nil { return } @@ -68013,17 +79679,28 @@ func UnmarshalShareReference(m map[string]json.RawMessage, result interface{}) ( return } -// ShareReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ShareReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNGatewayCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UnmarshalShareReferenceDeleted unmarshals an instance of ShareReferenceDeleted from the specified map of raw messages. -func UnmarshalShareReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// VPNGatewayCollectionFirst : A link to the first page of resources. +type VPNGatewayCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalVPNGatewayCollectionFirst unmarshals an instance of VPNGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -68031,38 +79708,16 @@ func UnmarshalShareReferenceDeleted(m map[string]json.RawMessage, result interfa return } -// ShareReplicationStatusReason : ShareReplicationStatusReason struct -type ShareReplicationStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +// VPNGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPNGatewayCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// Constants associated with the ShareReplicationStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ShareReplicationStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" - ShareReplicationStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" - ShareReplicationStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" -) - -// UnmarshalShareReplicationStatusReason unmarshals an instance of ShareReplicationStatusReason from the specified map of raw messages. -func UnmarshalShareReplicationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReplicationStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalVPNGatewayCollectionNext unmarshals an instance of VPNGatewayCollectionNext from the specified map of raw messages. +func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -68070,137 +79725,137 @@ func UnmarshalShareReplicationStatusReason(m map[string]json.RawMessage, result return } -// Snapshot : Snapshot struct -type Snapshot struct { - // If present, the backup policy plan which created this snapshot. - BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` - - // Indicates if a boot volume attachment can be created with a volume created from this snapshot. - Bootable *bool `json:"bootable" validate:"required"` - - // The date and time the data capture for this snapshot was completed. - // - // If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots - // created before 1 January 2022. - CapturedAt *strfmt.DateTime `json:"captured_at,omitempty"` - - // Clones for this snapshot. - Clones []SnapshotClone `json:"clones" validate:"required"` +// VPNGatewayConnection : VPNGatewayConnection struct +// Models which "extend" this model: +// - VPNGatewayConnectionStaticRouteMode +// - VPNGatewayConnectionPolicyMode +type VPNGatewayConnection struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` - // The copies of this snapshot. - Copies []SnapshotCopiesItem `json:"copies" validate:"required"` + // The authentication mode. Only `psk` is currently supported. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` - // The date and time that this snapshot was created. + // The date and time that this VPN gateway connection was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` - - // Indicates whether this snapshot can be deleted. This value will always be `true`. - // Deprecated: this field is deprecated and may be removed in a future release. - Deletable *bool `json:"deletable" validate:"required"` - - // The type of encryption used on the source volume. - Encryption *string `json:"encryption" validate:"required"` - - // The root key used to wrap the data encryption key for the source volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - // The URL for this snapshot. + // The VPN connection's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this snapshot. + // The unique identifier for this VPN gateway connection. ID *string `json:"id" validate:"required"` - // The lifecycle state of this snapshot. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The IKE policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - // The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the - // capacity of the `source_volume`. - MinimumCapacity *int64 `json:"minimum_capacity" validate:"required"` + // The IPsec policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - // The name for this snapshot. The name is unique across all snapshots in the region. + // The mode of the VPN gateway. + Mode *string `json:"mode" validate:"required"` + + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. Name *string `json:"name" validate:"required"` - // The operating system included in this snapshot. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` - // The resource group for this snapshot. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The [service tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with `is.snapshot:` associated with - // this snapshot. - ServiceTags []string `json:"service_tags" validate:"required"` + // The status of a VPN gateway connection. + Status *string `json:"status" validate:"required"` - // The size of this snapshot rounded up to the next gigabyte. - Size *int64 `json:"size" validate:"required"` + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - // If present, the image from which the data on this snapshot was most directly - // provisioned. - SourceImage *ImageReference `json:"source_image,omitempty"` + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` - // If present, the source snapshot this snapshot was created from. - SourceSnapshot *SnapshotSourceSnapshot `json:"source_snapshot,omitempty"` + // The VPN tunnel configuration for this VPN gateway connection (in static route mode). + Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels,omitempty"` - // The source volume this snapshot was created from (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - SourceVolume *VolumeReference `json:"source_volume" validate:"required"` + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags" validate:"required"` + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` } -// Constants associated with the Snapshot.Encryption property. -// The type of encryption used on the source volume. +// Constants associated with the VPNGatewayConnection.AuthenticationMode property. +// The authentication mode. Only `psk` is currently supported. const ( - SnapshotEncryptionProviderManagedConst = "provider_managed" - SnapshotEncryptionUserManagedConst = "user_managed" + VPNGatewayConnectionAuthenticationModePskConst = "psk" ) -// Constants associated with the Snapshot.LifecycleState property. -// The lifecycle state of this snapshot. +// Constants associated with the VPNGatewayConnection.Mode property. +// The mode of the VPN gateway. const ( - SnapshotLifecycleStateDeletingConst = "deleting" - SnapshotLifecycleStateFailedConst = "failed" - SnapshotLifecycleStatePendingConst = "pending" - SnapshotLifecycleStateStableConst = "stable" - SnapshotLifecycleStateSuspendedConst = "suspended" - SnapshotLifecycleStateUpdatingConst = "updating" - SnapshotLifecycleStateWaitingConst = "waiting" + VPNGatewayConnectionModePolicyConst = "policy" + VPNGatewayConnectionModeRouteConst = "route" ) -// Constants associated with the Snapshot.ResourceType property. +// Constants associated with the VPNGatewayConnection.ResourceType property. // The resource type. const ( - SnapshotResourceTypeSnapshotConst = "snapshot" + VPNGatewayConnectionResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" ) -// UnmarshalSnapshot unmarshals an instance of Snapshot from the specified map of raw messages. -func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Snapshot) - err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bootable", &obj.Bootable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "captured_at", &obj.CapturedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) +// Constants associated with the VPNGatewayConnection.Status property. +// The status of a VPN gateway connection. +const ( + VPNGatewayConnectionStatusDownConst = "down" + VPNGatewayConnectionStatusUpConst = "up" +) + +// Constants associated with the VPNGatewayConnection.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionRoutingProtocolNoneConst = "none" +) + +func (*VPNGatewayConnection) isaVPNGatewayConnection() bool { + return true +} + +type VPNGatewayConnectionIntf interface { + isaVPNGatewayConnection() bool +} + +// UnmarshalVPNGatewayConnection unmarshals an instance of VPNGatewayConnection from the specified map of raw messages. +func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnection) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalModel(m, "copies", &obj.Copies, UnmarshalSnapshotCopiesItem) + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) if err != nil { return } @@ -68208,19 +79863,7 @@ func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "deletable", &obj.Deletable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) if err != nil { return } @@ -68232,201 +79875,72 @@ func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "minimum_capacity", &obj.MinimumCapacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_tags", &obj.ServiceTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotSourceSnapshot) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotClone : SnapshotClone struct -type SnapshotClone struct { - // Indicates whether this snapshot clone is available for use. - Available *bool `json:"available" validate:"required"` - - // The date and time that this snapshot clone was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The zone this snapshot clone resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalSnapshotClone unmarshals an instance of SnapshotClone from the specified map of raw messages. -func UnmarshalSnapshotClone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotClone) - err = core.UnmarshalPrimitive(m, "available", &obj.Available) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCloneCollection : SnapshotCloneCollection struct -type SnapshotCloneCollection struct { - // Collection of snapshot clones. - Clones []SnapshotClone `json:"clones" validate:"required"` -} - -// UnmarshalSnapshotCloneCollection unmarshals an instance of SnapshotCloneCollection from the specified map of raw messages. -func UnmarshalSnapshotCloneCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCloneCollection) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotClonePrototype : SnapshotClonePrototype struct -type SnapshotClonePrototype struct { - // The zone this snapshot clone will reside in. Must be in the same region as the - // snapshot. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewSnapshotClonePrototype : Instantiate SnapshotClonePrototype (Generic Model Constructor) -func (*VpcV1) NewSnapshotClonePrototype(zone ZoneIdentityIntf) (_model *SnapshotClonePrototype, err error) { - _model = &SnapshotClonePrototype{ - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalSnapshotClonePrototype unmarshals an instance of SnapshotClonePrototype from the specified map of raw messages. -func UnmarshalSnapshotClonePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotClonePrototype) - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCollection : SnapshotCollection struct -type SnapshotCollection struct { - // A link to the first page of resources. - First *SnapshotCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SnapshotCollectionNext `json:"next,omitempty"` - - // Collection of snapshots. - Snapshots []Snapshot `json:"snapshots" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSnapshotCollection unmarshals an instance of SnapshotCollection from the specified map of raw messages. -func UnmarshalSnapshotCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotCollectionFirst) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotCollectionNext) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) if err != nil { return } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshot) + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SnapshotCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + if err != nil { + return } - return start, nil + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SnapshotCollectionFirst : A link to the first page of resources. -type SnapshotCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// VPNGatewayConnectionCollection : Collection of VPN gateway connections in a VPN gateway. +type VPNGatewayConnectionCollection struct { + // Array of VPN gateway connections. + Connections []VPNGatewayConnectionIntf `json:"connections" validate:"required"` } -// UnmarshalSnapshotCollectionFirst unmarshals an instance of SnapshotCollectionFirst from the specified map of raw messages. -func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVPNGatewayConnectionCollection unmarshals an instance of VPNGatewayConnectionCollection from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionCollection) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -68434,16 +79948,39 @@ func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result inter return } -// SnapshotCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SnapshotCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// VPNGatewayConnectionDpd : The Dead Peer Detection settings. +type VPNGatewayConnectionDpd struct { + // Dead Peer Detection actions. + Action *string `json:"action" validate:"required"` + + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval" validate:"required"` + + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout" validate:"required"` } -// UnmarshalSnapshotCollectionNext unmarshals an instance of SnapshotCollectionNext from the specified map of raw messages. -func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the VPNGatewayConnectionDpd.Action property. +// Dead Peer Detection actions. +const ( + VPNGatewayConnectionDpdActionClearConst = "clear" + VPNGatewayConnectionDpdActionHoldConst = "hold" + VPNGatewayConnectionDpdActionNoneConst = "none" + VPNGatewayConnectionDpdActionRestartConst = "restart" +) + +// UnmarshalVPNGatewayConnectionDpd unmarshals an instance of VPNGatewayConnectionDpd from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpd) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) if err != nil { return } @@ -68451,66 +79988,151 @@ func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interf return } -// SnapshotCopiesItem : SnapshotCopiesItem struct -type SnapshotCopiesItem struct { - // The CRN for the copied snapshot. - CRN *string `json:"crn" validate:"required"` +// VPNGatewayConnectionDpdPatch : The Dead Peer Detection settings. +type VPNGatewayConnectionDpdPatch struct { + // Dead Peer Detection actions. + Action *string `json:"action,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval,omitempty"` - // The URL for the copied snapshot. - Href *string `json:"href" validate:"required"` + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout,omitempty"` +} - // The unique identifier for the copied snapshot. - ID *string `json:"id" validate:"required"` +// Constants associated with the VPNGatewayConnectionDpdPatch.Action property. +// Dead Peer Detection actions. +const ( + VPNGatewayConnectionDpdPatchActionClearConst = "clear" + VPNGatewayConnectionDpdPatchActionHoldConst = "hold" + VPNGatewayConnectionDpdPatchActionNoneConst = "none" + VPNGatewayConnectionDpdPatchActionRestartConst = "restart" +) - // The name for the copied snapshot. - Name *string `json:"name" validate:"required"` +// UnmarshalVPNGatewayConnectionDpdPatch unmarshals an instance of VPNGatewayConnectionDpdPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpdPatch) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` +// VPNGatewayConnectionDpdPrototype : The Dead Peer Detection settings. +type VPNGatewayConnectionDpdPrototype struct { + // Dead Peer Detection actions. + Action *string `json:"action,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval,omitempty"` + + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout,omitempty"` } -// Constants associated with the SnapshotCopiesItem.ResourceType property. -// The resource type. +// Constants associated with the VPNGatewayConnectionDpdPrototype.Action property. +// Dead Peer Detection actions. const ( - SnapshotCopiesItemResourceTypeSnapshotConst = "snapshot" + VPNGatewayConnectionDpdPrototypeActionClearConst = "clear" + VPNGatewayConnectionDpdPrototypeActionHoldConst = "hold" + VPNGatewayConnectionDpdPrototypeActionNoneConst = "none" + VPNGatewayConnectionDpdPrototypeActionRestartConst = "restart" ) -// UnmarshalSnapshotCopiesItem unmarshals an instance of SnapshotCopiesItem from the specified map of raw messages. -func UnmarshalSnapshotCopiesItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCopiesItem) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVPNGatewayConnectionDpdPrototype unmarshals an instance of VPNGatewayConnectionDpdPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpdPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIkePolicyPatch : The IKE policy to use. Specify `null` to remove any existing policy, [resulting in +// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). +// Models which "extend" this model: +// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID +// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref +type VPNGatewayConnectionIkePolicyPatch struct { + // The unique identifier for this IKE policy. + ID *string `json:"id,omitempty"` + + // The IKE policy's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*VPNGatewayConnectionIkePolicyPatch) isaVPNGatewayConnectionIkePolicyPatch() bool { + return true +} + +type VPNGatewayConnectionIkePolicyPatchIntf interface { + isaVPNGatewayConnectionIkePolicyPatch() bool +} + +// UnmarshalVPNGatewayConnectionIkePolicyPatch unmarshals an instance of VPNGatewayConnectionIkePolicyPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPatch) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIkePolicyPrototype : The IKE policy to use. If unspecified, [auto-negotiation will be +// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). +// Models which "extend" this model: +// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID +// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref +type VPNGatewayConnectionIkePolicyPrototype struct { + // The unique identifier for this IKE policy. + ID *string `json:"id,omitempty"` + + // The IKE policy's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*VPNGatewayConnectionIkePolicyPrototype) isaVPNGatewayConnectionIkePolicyPrototype() bool { + return true +} + +type VPNGatewayConnectionIkePolicyPrototypeIntf interface { + isaVPNGatewayConnectionIkePolicyPrototype() bool +} + +// UnmarshalVPNGatewayConnectionIkePolicyPrototype unmarshals an instance of VPNGatewayConnectionIkePolicyPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -68518,41 +80140,34 @@ func UnmarshalSnapshotCopiesItem(m map[string]json.RawMessage, result interface{ return } -// SnapshotIdentity : Identifies a snapshot by a unique property. +// VPNGatewayConnectionIPsecPolicyPatch : The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in +// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). // Models which "extend" this model: -// - SnapshotIdentityByID -// - SnapshotIdentityByCRN -// - SnapshotIdentityByHref -type SnapshotIdentity struct { - // The unique identifier for this snapshot. +// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID +// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref +type VPNGatewayConnectionIPsecPolicyPatch struct { + // The unique identifier for this IPsec policy. ID *string `json:"id,omitempty"` - // The CRN of this snapshot. - CRN *string `json:"crn,omitempty"` - - // The URL for this snapshot. + // The IPsec policy's canonical URL. Href *string `json:"href,omitempty"` } -func (*SnapshotIdentity) isaSnapshotIdentity() bool { +func (*VPNGatewayConnectionIPsecPolicyPatch) isaVPNGatewayConnectionIPsecPolicyPatch() bool { return true } -type SnapshotIdentityIntf interface { - isaSnapshotIdentity() bool +type VPNGatewayConnectionIPsecPolicyPatchIntf interface { + isaVPNGatewayConnectionIPsecPolicyPatch() bool } -// UnmarshalSnapshotIdentity unmarshals an instance of SnapshotIdentity from the specified map of raw messages. -func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentity) +// UnmarshalVPNGatewayConnectionIPsecPolicyPatch unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPatch) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -68561,23 +80176,35 @@ func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) return } -// SnapshotPatch : SnapshotPatch struct -type SnapshotPatch struct { - // The name for this snapshot. The name must not be used by another snapshot in the region. - Name *string `json:"name,omitempty"` +// VPNGatewayConnectionIPsecPolicyPrototype : The IPsec policy to use. If unspecified, [auto-negotiation will be +// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). +// Models which "extend" this model: +// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID +// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref +type VPNGatewayConnectionIPsecPolicyPrototype struct { + // The unique identifier for this IPsec policy. + ID *string `json:"id,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` + // The IPsec policy's canonical URL. + Href *string `json:"href,omitempty"` } -// UnmarshalSnapshotPatch unmarshals an instance of SnapshotPatch from the specified map of raw messages. -func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*VPNGatewayConnectionIPsecPolicyPrototype) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { + return true +} + +type VPNGatewayConnectionIPsecPolicyPrototypeIntf interface { + isaVPNGatewayConnectionIPsecPolicyPrototype() bool +} + +// UnmarshalVPNGatewayConnectionIPsecPolicyPrototype unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -68585,90 +80212,90 @@ func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (e return } -// AsPatch returns a generic map representation of the SnapshotPatch -func (snapshotPatch *SnapshotPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(snapshotPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// VPNGatewayConnectionLocalCIDRs : VPNGatewayConnectionLocalCIDRs struct +type VPNGatewayConnectionLocalCIDRs struct { + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` +} + +// UnmarshalVPNGatewayConnectionLocalCIDRs unmarshals an instance of VPNGatewayConnectionLocalCIDRs from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionLocalCIDRs) + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SnapshotPrototype : SnapshotPrototype struct -// Models which "extend" this model: -// - SnapshotPrototypeSnapshotBySourceVolume -// - SnapshotPrototypeSnapshotBySourceSnapshot -type SnapshotPrototype struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` +// VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct +type VPNGatewayConnectionPatch struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The IKE policy to use. Specify `null` to remove any existing policy, [resulting in + // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` + // The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in + // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. + Name *string `json:"name,omitempty"` - // The root key to use to wrap the data encryption key for this snapshot. - // - // A key must be specified if and only if the source snapshot has an `encryption` type of - // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify - // a key in the same region as the new snapshot, and use the same encryption key for all - // snapshots using the same source volume. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address,omitempty"` - // The source snapshot (in another region) to create this snapshot from. - // The specified snapshot must not already be the source of another snapshot in this - // region. - SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot,omitempty"` -} + // The pre-shared key. + Psk *string `json:"psk,omitempty"` -func (*SnapshotPrototype) isaSnapshotPrototype() bool { - return true + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` } -type SnapshotPrototypeIntf interface { - isaSnapshotPrototype() bool -} +// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" +) -// UnmarshalSnapshotPrototype unmarshals an instance of SnapshotPrototype from the specified map of raw messages. -func UnmarshalSnapshotPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototype) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) +// UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPatch) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) if err != nil { return } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return } @@ -68676,54 +80303,102 @@ func UnmarshalSnapshotPrototype(m map[string]json.RawMessage, result interface{} return } -// SnapshotReference : SnapshotReference struct -type SnapshotReference struct { - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` +// AsPatch returns a generic map representation of the VPNGatewayConnectionPatch +func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpnGatewayConnectionPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` +// VPNGatewayConnectionPeerCIDRs : VPNGatewayConnectionPeerCIDRs struct +type VPNGatewayConnectionPeerCIDRs struct { + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` +} - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` +// UnmarshalVPNGatewayConnectionPeerCIDRs unmarshals an instance of VPNGatewayConnectionPeerCIDRs from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerCIDRs) + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` +// VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct +// Models which "extend" this model: +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype +type VPNGatewayConnectionPrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` - // The name for this snapshot. The name is unique across all snapshots in the region. - Name *string `json:"name" validate:"required"` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` + // The IKE policy to use. If unspecified, [auto-negotiation will be + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The IPsec policy to use. If unspecified, [auto-negotiation will be + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` + + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` + + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` + + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` + + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` } -// Constants associated with the SnapshotReference.ResourceType property. -// The resource type. +// Constants associated with the VPNGatewayConnectionPrototype.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. const ( - SnapshotReferenceResourceTypeSnapshotConst = "snapshot" + VPNGatewayConnectionPrototypeRoutingProtocolNoneConst = "none" ) -// UnmarshalSnapshotReference unmarshals an instance of SnapshotReference from the specified map of raw messages. -func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +func (*VPNGatewayConnectionPrototype) isaVPNGatewayConnectionPrototype() bool { + return true +} + +type VPNGatewayConnectionPrototypeIntf interface { + isaVPNGatewayConnectionPrototype() bool +} + +// UnmarshalVPNGatewayConnectionPrototype unmarshals an instance of VPNGatewayConnectionPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) if err != nil { return } @@ -68731,48 +80406,23 @@ func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{} if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SnapshotReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSnapshotReferenceDeleted unmarshals an instance of SnapshotReferenceDeleted from the specified map of raw messages. -func UnmarshalSnapshotReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type SnapshotRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalSnapshotRemote unmarshals an instance of SnapshotRemote from the specified map of raw messages. -func UnmarshalSnapshotRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) if err != nil { return } @@ -68780,46 +80430,35 @@ func UnmarshalSnapshotRemote(m map[string]json.RawMessage, result interface{}) ( return } -// SnapshotSourceSnapshot : If present, the source snapshot this snapshot was created from. -type SnapshotSourceSnapshot struct { - // The CRN of the source snapshot. - CRN *string `json:"crn" validate:"required"` - +// VPNGatewayConnectionReference : VPNGatewayConnectionReference struct +type VPNGatewayConnectionReference struct { // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` + Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - // The URL for the source snapshot. + // The VPN connection's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for the source snapshot. + // The unique identifier for this VPN gateway connection. ID *string `json:"id" validate:"required"` - // The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region. + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. Name *string `json:"name" validate:"required"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the SnapshotSourceSnapshot.ResourceType property. +// Constants associated with the VPNGatewayConnectionReference.ResourceType property. // The resource type. const ( - SnapshotSourceSnapshotResourceTypeSnapshotConst = "snapshot" + VPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" ) -// UnmarshalSnapshotSourceSnapshot unmarshals an instance of SnapshotSourceSnapshot from the specified map of raw messages. -func UnmarshalSnapshotSourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotSourceSnapshot) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) +// UnmarshalVPNGatewayConnectionReference unmarshals an instance of VPNGatewayConnectionReference from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) if err != nil { return } @@ -68835,10 +80474,6 @@ func UnmarshalSnapshotSourceSnapshot(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return @@ -68847,230 +80482,235 @@ func UnmarshalSnapshotSourceSnapshot(m map[string]json.RawMessage, result interf return } -// StartBareMetalServerOptions : The StartBareMetalServer options. -type StartBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewStartBareMetalServerOptions : Instantiate StartBareMetalServerOptions -func (*VpcV1) NewStartBareMetalServerOptions(id string) *StartBareMetalServerOptions { - return &StartBareMetalServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *StartBareMetalServerOptions) SetID(id string) *StartBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *StartBareMetalServerOptions) SetHeaders(param map[string]string) *StartBareMetalServerOptions { - options.Headers = param - return options -} - -// StopBareMetalServerOptions : The StopBareMetalServer options. -type StopBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The type of stop operation: - // - `soft`: signal running operating system to quiesce and shutdown cleanly - // - `hard`: immediately stop the server. - Type *string `json:"type" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// VPNGatewayConnectionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VPNGatewayConnectionReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// Constants associated with the StopBareMetalServerOptions.Type property. -// The type of stop operation: -// - `soft`: signal running operating system to quiesce and shutdown cleanly -// - `hard`: immediately stop the server. -const ( - StopBareMetalServerOptionsTypeHardConst = "hard" - StopBareMetalServerOptionsTypeSoftConst = "soft" -) - -// NewStopBareMetalServerOptions : Instantiate StopBareMetalServerOptions -func (*VpcV1) NewStopBareMetalServerOptions(id string, typeVar string) *StopBareMetalServerOptions { - return &StopBareMetalServerOptions{ - ID: core.StringPtr(id), - Type: core.StringPtr(typeVar), +// UnmarshalVPNGatewayConnectionReferenceDeleted unmarshals an instance of VPNGatewayConnectionReferenceDeleted from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *StopBareMetalServerOptions) SetID(id string) *StopBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetType : Allow user to set Type -func (_options *StopBareMetalServerOptions) SetType(typeVar string) *StopBareMetalServerOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *StopBareMetalServerOptions) SetHeaders(param map[string]string) *StopBareMetalServerOptions { - options.Headers = param - return options -} - -// Subnet : Subnet struct -type Subnet struct { - // The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the - // provider. - AvailableIpv4AddressCount *int64 `json:"available_ipv4_address_count" validate:"required"` - - // The date and time that the subnet was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` - - // The URL for this subnet. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` - - // The IP version(s) supported by this subnet. - IPVersion *string `json:"ip_version" validate:"required"` - - // The IPv4 range of the subnet, expressed in CIDR format. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` - - // The name for this subnet. The name is unique across all subnets in the VPC. - Name *string `json:"name" validate:"required"` - - // The network ACL for this subnet. - NetworkACL *NetworkACLReference `json:"network_acl" validate:"required"` - - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway *PublicGatewayReference `json:"public_gateway,omitempty"` - - // The resource group for this subnet. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The routing table for this subnet. - RoutingTable *RoutingTableReference `json:"routing_table" validate:"required"` +// VPNGatewayConnectionStaticRouteModeTunnel : VPNGatewayConnectionStaticRouteModeTunnel struct +type VPNGatewayConnectionStaticRouteModeTunnel struct { + // The IP address of the VPN gateway member in which the tunnel resides. + PublicIP *IP `json:"public_ip" validate:"required"` - // The status of the subnet. + // The status of the VPN Tunnel. Status *string `json:"status" validate:"required"` - // The total number of IPv4 addresses in this subnet. + // The reasons for the current VPN gateway connection tunnels status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) // - // Note: This is calculated as 2(32 - prefix length). For example, the prefix length `/24` gives:
- // 2(32 - 24) = 28 = 256 addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` - - // The VPC this subnet resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this subnet resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` } -// Constants associated with the Subnet.IPVersion property. -// The IP version(s) supported by this subnet. -const ( - SubnetIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the Subnet.ResourceType property. -// The resource type. -const ( - SubnetResourceTypeSubnetConst = "subnet" -) - -// Constants associated with the Subnet.Status property. -// The status of the subnet. +// Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. +// The status of the VPN Tunnel. const ( - SubnetStatusAvailableConst = "available" - SubnetStatusDeletingConst = "deleting" - SubnetStatusFailedConst = "failed" - SubnetStatusPendingConst = "pending" + VPNGatewayConnectionStaticRouteModeTunnelStatusDownConst = "down" + VPNGatewayConnectionStaticRouteModeTunnelStatusUpConst = "up" ) -// UnmarshalSubnet unmarshals an instance of Subnet from the specified map of raw messages. -func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Subnet) - err = core.UnmarshalPrimitive(m, "available_ipv4_address_count", &obj.AvailableIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVPNGatewayConnectionStaticRouteModeTunnel unmarshals an instance of VPNGatewayConnectionStaticRouteModeTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionStaticRouteModeTunnel) + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionStatusReason : VPNGatewayConnectionStatusReason struct +type VPNGatewayConnectionStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway connection's status. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + VPNGatewayConnectionStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" + VPNGatewayConnectionStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" + VPNGatewayConnectionStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" + VPNGatewayConnectionStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" + VPNGatewayConnectionStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayConnectionStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" + VPNGatewayConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayConnectionStatusReason unmarshals an instance of VPNGatewayConnectionStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct +type VPNGatewayConnectionTunnelStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway connection tunnel's status. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionTunnelStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + VPNGatewayConnectionTunnelStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" + VPNGatewayConnectionTunnelStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayConnectionTunnelStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" + VPNGatewayConnectionTunnelStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayConnectionTunnelStatusReason unmarshals an instance of VPNGatewayConnectionTunnelStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnelStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnelStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayReference) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayHealthReason : VPNGatewayHealthReason struct +type VPNGatewayHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNGatewayHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" + VPNGatewayHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNGatewayHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNGatewayHealthReason unmarshals an instance of VPNGatewayHealthReason from the specified map of raw messages. +func UnmarshalVPNGatewayHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableReference) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayLifecycleReason : VPNGatewayLifecycleReason struct +type VPNGatewayLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNGatewayLifecycleReason unmarshals an instance of VPNGatewayLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -69078,45 +80718,113 @@ func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err erro return } -// SubnetCollection : SubnetCollection struct -type SubnetCollection struct { - // A link to the first page of resources. - First *SubnetCollectionFirst `json:"first" validate:"required"` +// VPNGatewayMember : VPNGatewayMember struct +type VPNGatewayMember struct { + // The reasons for the current VPN gateway member health_state (if any): + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayMemberHealthReason `json:"health_reasons" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SubnetCollectionNext `json:"next,omitempty"` + // The reasons for the current VPN gateway member lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayMemberLifecycleReason `json:"lifecycle_reasons" validate:"required"` - // Collection of subnets. - Subnets []Subnet `json:"subnets" validate:"required"` + // The lifecycle state of the VPN gateway member. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The reserved IP address assigned to the VPN gateway member. + // + // This property will be present only when the VPN gateway status is `available`. + PrivateIP *ReservedIPReference `json:"private_ip" validate:"required"` + + // The public IP address assigned to the VPN gateway member. + PublicIP *IP `json:"public_ip" validate:"required"` + + // The high availability role assigned to the VPN gateway member. + Role *string `json:"role" validate:"required"` } -// UnmarshalSubnetCollection unmarshals an instance of SubnetCollection from the specified map of raw messages. -func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSubnetCollectionFirst) +// Constants associated with the VPNGatewayMember.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNGatewayMemberHealthStateDegradedConst = "degraded" + VPNGatewayMemberHealthStateFaultedConst = "faulted" + VPNGatewayMemberHealthStateInapplicableConst = "inapplicable" + VPNGatewayMemberHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGatewayMember.LifecycleState property. +// The lifecycle state of the VPN gateway member. +const ( + VPNGatewayMemberLifecycleStateDeletingConst = "deleting" + VPNGatewayMemberLifecycleStateFailedConst = "failed" + VPNGatewayMemberLifecycleStatePendingConst = "pending" + VPNGatewayMemberLifecycleStateStableConst = "stable" + VPNGatewayMemberLifecycleStateSuspendedConst = "suspended" + VPNGatewayMemberLifecycleStateUpdatingConst = "updating" + VPNGatewayMemberLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayMember.Role property. +// The high availability role assigned to the VPN gateway member. +const ( + VPNGatewayMemberRoleActiveConst = "active" + VPNGatewayMemberRoleStandbyConst = "standby" +) + +// UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. +func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMember) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayMemberHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayMemberLifecycleReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSubnetCollectionNext) + err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnet) + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "role", &obj.Role) if err != nil { return } @@ -69124,45 +80832,37 @@ func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SubnetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} +// VPNGatewayMemberHealthReason : VPNGatewayMemberHealthReason struct +type VPNGatewayMemberHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` -// SubnetCollectionFirst : A link to the first page of resources. -type SubnetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` } -// UnmarshalSubnetCollectionFirst unmarshals an instance of SubnetCollectionFirst from the specified map of raw messages. -func UnmarshalSubnetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the VPNGatewayMemberHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNGatewayMemberHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNGatewayMemberHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNGatewayMemberHealthReason unmarshals an instance of VPNGatewayMemberHealthReason from the specified map of raw messages. +func UnmarshalVPNGatewayMemberHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMemberHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SubnetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSubnetCollectionNext unmarshals an instance of SubnetCollectionNext from the specified map of raw messages. -func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -69170,42 +80870,36 @@ func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interfac return } -// SubnetIdentity : Identifies a subnet by a unique property. -// Models which "extend" this model: -// - SubnetIdentityByID -// - SubnetIdentityByCRN -// - SubnetIdentityByHref -type SubnetIdentity struct { - // The unique identifier for this subnet. - ID *string `json:"id,omitempty"` - - // The CRN for this subnet. - CRN *string `json:"crn,omitempty"` +// VPNGatewayMemberLifecycleReason : VPNGatewayMemberLifecycleReason struct +type VPNGatewayMemberLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` - // The URL for this subnet. - Href *string `json:"href,omitempty"` -} + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` -func (*SubnetIdentity) isaSubnetIdentity() bool { - return true + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` } -type SubnetIdentityIntf interface { - isaSubnetIdentity() bool -} +// Constants associated with the VPNGatewayMemberLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNGatewayMemberLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) -// UnmarshalSubnetIdentity unmarshals an instance of SubnetIdentity from the specified map of raw messages. -func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVPNGatewayMemberLifecycleReason unmarshals an instance of VPNGatewayMemberLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMemberLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -69213,157 +80907,83 @@ func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) ( return } -// SubnetPatch : SubnetPatch struct -type SubnetPatch struct { - // The name for this subnet. The name must not be used by another subnet in the VPC. +// VPNGatewayPatch : VPNGatewayPatch struct +type VPNGatewayPatch struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway SubnetPublicGatewayPatchIntf `json:"public_gateway,omitempty"` - - // The routing table to use for this subnet. The routing table properties - // `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` } -// UnmarshalSubnetPatch unmarshals an instance of SubnetPatch from the specified map of raw messages. -func UnmarshalSubnetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPatch) +// UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. +func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalSubnetPublicGatewayPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// AsPatch returns a generic map representation of the SubnetPatch -func (subnetPatch *SubnetPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the VPNGatewayPatch +func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(subnetPatch) + jsonData, err = json.Marshal(vpnGatewayPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// SubnetPrototype : SubnetPrototype struct +// VPNGatewayPrototype : VPNGatewayPrototype struct // Models which "extend" this model: -// - SubnetPrototypeSubnetByTotalCount -// - SubnetPrototypeSubnetByCIDR -type SubnetPrototype struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. +// - VPNGatewayPrototypeVPNGatewayRouteModePrototype +// - VPNGatewayPrototypeVPNGatewayPolicyModePrototype +type VPNGatewayPrototype struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. If - // unspecified, the subnet will not be attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` - // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The routing table to use for this subnet. If unspecified, the default routing table - // for the VPC is used. The routing table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` - - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the - // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count,omitempty"` - - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // Identifies a subnet by a unique property. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` - // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of - // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix - // that contains the subnet's IPv4 CIDR. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block,omitempty"` + // Route mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -// Constants associated with the SubnetPrototype.IPVersion property. -// The IP version(s) to support for this subnet. +// Constants associated with the VPNGatewayPrototype.Mode property. +// Route mode VPN gateway. const ( - SubnetPrototypeIPVersionIpv4Const = "ipv4" + VPNGatewayPrototypeModeRouteConst = "route" ) -func (*SubnetPrototype) isaSubnetPrototype() bool { +func (*VPNGatewayPrototype) isaVPNGatewayPrototype() bool { return true } -type SubnetPrototypeIntf interface { - isaSubnetPrototype() bool +type VPNGatewayPrototypeIntf interface { + isaVPNGatewayPrototype() bool } -// UnmarshalSubnetPrototype unmarshals an instance of SubnetPrototype from the specified map of raw messages. -func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototype) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } +// UnmarshalVPNGatewayPrototype unmarshals an instance of VPNGatewayPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototype) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) - if err != nil { - return - } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -69371,42 +80991,17 @@ func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) return } -// SubnetPublicGatewayPatch : The public gateway to use for internet-bound traffic for this subnet. -// Models which "extend" this model: -// - SubnetPublicGatewayPatchPublicGatewayIdentityByID -// - SubnetPublicGatewayPatchPublicGatewayIdentityByCRN -// - SubnetPublicGatewayPatchPublicGatewayIdentityByHref -type SubnetPublicGatewayPatch struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href,omitempty"` -} - -func (*SubnetPublicGatewayPatch) isaSubnetPublicGatewayPatch() bool { - return true -} - -type SubnetPublicGatewayPatchIntf interface { - isaSubnetPublicGatewayPatch() bool +// VPNGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VPNGatewayReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalSubnetPublicGatewayPatch unmarshals an instance of SubnetPublicGatewayPatch from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVPNGatewayReferenceDeleted unmarshals an instance of VPNGatewayReferenceDeleted from the specified map of raw messages. +func UnmarshalVPNGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -69414,42 +81009,210 @@ func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result inte return } -// SubnetReference : SubnetReference struct -type SubnetReference struct { - // The CRN for this subnet. +// VPNServer : VPNServer struct +type VPNServer struct { + // The certificate instance for this VPN server. + Certificate *CertificateInstanceReference `json:"certificate" validate:"required"` + + // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified + // methods. + ClientAuthentication []VPNServerAuthenticationIntf `json:"client_authentication" validate:"required"` + + // Indicates whether disconnected VPN clients will be automatically deleted after + // `client_auto_delete_timeout` hours have passed. At present, this is always `true`, but may be modifiable in the + // future. + ClientAutoDelete *bool `json:"client_auto_delete" validate:"required"` + + // If `client_auto_delete` is `true`, the hours after which disconnected VPN clients will be automatically deleted. If + // the value is `0`, disconnected VPN clients will be deleted immediately. This value may be modifiable in the future. + ClientAutoDeleteTimeout *int64 `json:"client_auto_delete_timeout" validate:"required"` + + // The DNS server addresses that will be provided to VPN clients that are connected to this VPN server. + ClientDnsServerIps []IP `json:"client_dns_server_ips" validate:"required"` + + // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not + // disconnect idle clients. + ClientIdleTimeout *int64 `json:"client_idle_timeout" validate:"required"` + + // The VPN client IPv4 address pool, expressed in CIDR format. + ClientIPPool *string `json:"client_ip_pool" validate:"required"` + + // The date and time that the VPN server was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this VPN server. CRN *string `json:"crn" validate:"required"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` + // Indicates whether the split tunneling is enabled on this VPN server. + EnableSplitTunneling *bool `json:"enable_split_tunneling" validate:"required"` - // The URL for this subnet. + // The reasons for the current VPN server health_state (if any): + // - `cannot_access_client_certificate`: VPN server's client certificate is inaccessible + // (verify certificate exists and that IAM policies grant `VPN server for VPC` access + // to `Secrets Manager`) + // - `cannot_access_server_certificate`: VPN server's server certificate is inaccessible + // (verify certificate exists and that IAM policies grant `VPN server for VPC` access + // to `Secrets Manager`) + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNServerHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + + // Fully qualified domain name assigned to this VPN server. + Hostname *string `json:"hostname" validate:"required"` + + // The URL for this VPN server. Href *string `json:"href" validate:"required"` - // The unique identifier for this subnet. + // The unique identifier for this VPN server. ID *string `json:"id" validate:"required"` - // The name for this subnet. The name is unique across all subnets in the VPC. + // The reasons for the current VPN server lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN server. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this VPN server. The name is unique across all VPN servers in the VPC. Name *string `json:"name" validate:"required"` + // The port number used by this VPN server. + Port *int64 `json:"port" validate:"required"` + + // The reserved IPs bound to this VPN server. + PrivateIps []ReservedIPReference `json:"private_ips" validate:"required"` + + // The transport protocol used by this VPN server. + Protocol *string `json:"protocol" validate:"required"` + + // The resource group for this VPN server. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The security groups targeting this VPN server. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // The subnets this VPN server is provisioned in. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The VPC this VPN server resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// Constants associated with the SubnetReference.ResourceType property. +// Constants associated with the VPNServer.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNServerHealthStateDegradedConst = "degraded" + VPNServerHealthStateFaultedConst = "faulted" + VPNServerHealthStateInapplicableConst = "inapplicable" + VPNServerHealthStateOkConst = "ok" +) + +// Constants associated with the VPNServer.LifecycleState property. +// The lifecycle state of the VPN server. +const ( + VPNServerLifecycleStateDeletingConst = "deleting" + VPNServerLifecycleStateFailedConst = "failed" + VPNServerLifecycleStatePendingConst = "pending" + VPNServerLifecycleStateStableConst = "stable" + VPNServerLifecycleStateSuspendedConst = "suspended" + VPNServerLifecycleStateUpdatingConst = "updating" + VPNServerLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNServer.Protocol property. +// The transport protocol used by this VPN server. +const ( + VPNServerProtocolTCPConst = "tcp" + VPNServerProtocolUDPConst = "udp" +) + +// Constants associated with the VPNServer.ResourceType property. // The resource type. const ( - SubnetReferenceResourceTypeSubnetConst = "subnet" + VPNServerResourceTypeVPNServerConst = "vpn_server" ) -// UnmarshalSubnetReference unmarshals an instance of SubnetReference from the specified map of raw messages. -func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReference) +// UnmarshalVPNServer unmarshals an instance of VPNServer from the specified map of raw messages. +func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServer) + err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthentication) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_auto_delete", &obj.ClientAutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_auto_delete_timeout", &obj.ClientAutoDeleteTimeout) + if err != nil { + return + } + err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) + err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) if err != nil { return } @@ -69461,101 +81224,47 @@ func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SubnetReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSubnetReferenceDeleted unmarshals an instance of SubnetReferenceDeleted from the specified map of raw messages. -func UnmarshalSubnetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileIdentity : Identifies a trusted profile by a unique property. -// Models which "extend" this model: -// - TrustedProfileIdentityTrustedProfileByID -// - TrustedProfileIdentityTrustedProfileByCRN -type TrustedProfileIdentity struct { - // The unique identifier for this trusted profile. - ID *string `json:"id,omitempty"` - - // The CRN for this trusted profile. - CRN *string `json:"crn,omitempty"` -} - -func (*TrustedProfileIdentity) isaTrustedProfileIdentity() bool { - return true -} - -type TrustedProfileIdentityIntf interface { - isaTrustedProfileIdentity() bool -} - -// UnmarshalTrustedProfileIdentity unmarshals an instance of TrustedProfileIdentity from the specified map of raw messages. -func UnmarshalTrustedProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileReference : TrustedProfileReference struct -type TrustedProfileReference struct { - // The CRN for this trusted profile. - CRN *string `json:"crn" validate:"required"` - - // The unique identifier for this trusted profile. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the TrustedProfileReference.ResourceType property. -// The resource type. -const ( - TrustedProfileReferenceResourceTypeTrustedProfileConst = "trusted_profile" -) - -// UnmarshalTrustedProfileReference unmarshals an instance of TrustedProfileReference from the specified map of raw messages. -func UnmarshalTrustedProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -69563,2179 +81272,3009 @@ func UnmarshalTrustedProfileReference(m map[string]json.RawMessage, result inter return } -// UnsetSubnetPublicGatewayOptions : The UnsetSubnetPublicGateway options. -type UnsetSubnetPublicGatewayOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUnsetSubnetPublicGatewayOptions : Instantiate UnsetSubnetPublicGatewayOptions -func (*VpcV1) NewUnsetSubnetPublicGatewayOptions(id string) *UnsetSubnetPublicGatewayOptions { - return &UnsetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *UnsetSubnetPublicGatewayOptions) SetID(id string) *UnsetSubnetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UnsetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *UnsetSubnetPublicGatewayOptions { - options.Headers = param - return options -} - -// UpdateBackupPolicyOptions : The UpdateBackupPolicy options. -type UpdateBackupPolicyOptions struct { - // The backup policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The backup policy patch. - BackupPolicyPatch map[string]interface{} `json:"BackupPolicy_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// VPNServerAuthentication : An authentication method for this VPN server. +// Models which "extend" this model: +// - VPNServerAuthenticationByUsername +// - VPNServerAuthenticationByCertificate +type VPNServerAuthentication struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` -// NewUpdateBackupPolicyOptions : Instantiate UpdateBackupPolicyOptions -func (*VpcV1) NewUpdateBackupPolicyOptions(id string, backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { - return &UpdateBackupPolicyOptions{ - ID: core.StringPtr(id), - BackupPolicyPatch: backupPolicyPatch, - } -} + // The type of identity provider to be used by VPN client. + IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` -// SetID : Allow user to set ID -func (_options *UpdateBackupPolicyOptions) SetID(id string) *UpdateBackupPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The certificate instance used for the VPN client certificate authority (CA). + ClientCa *CertificateInstanceReference `json:"client_ca,omitempty"` -// SetBackupPolicyPatch : Allow user to set BackupPolicyPatch -func (_options *UpdateBackupPolicyOptions) SetBackupPolicyPatch(backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { - _options.BackupPolicyPatch = backupPolicyPatch - return _options + // The certificate revocation list contents, encoded in PEM format. + Crl *string `json:"crl,omitempty"` } -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateBackupPolicyOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} +// Constants associated with the VPNServerAuthentication.Method property. +// The type of authentication. +const ( + VPNServerAuthenticationMethodCertificateConst = "certificate" + VPNServerAuthenticationMethodUsernameConst = "username" +) -// SetHeaders : Allow user to set Headers -func (options *UpdateBackupPolicyOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyOptions { - options.Headers = param - return options +func (*VPNServerAuthentication) isaVPNServerAuthentication() bool { + return true } -// UpdateBackupPolicyPlanOptions : The UpdateBackupPolicyPlan options. -type UpdateBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. - ID *string `json:"id" validate:"required,ne="` - - // The backup policy plan patch. - BackupPolicyPlanPatch map[string]interface{} `json:"BackupPolicyPlan_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNServerAuthenticationIntf interface { + isaVPNServerAuthentication() bool } -// NewUpdateBackupPolicyPlanOptions : Instantiate UpdateBackupPolicyPlanOptions -func (*VpcV1) NewUpdateBackupPolicyPlanOptions(backupPolicyID string, id string, backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { - return &UpdateBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), - BackupPolicyPlanPatch: backupPolicyPlanPatch, +// UnmarshalVPNServerAuthentication unmarshals an instance of VPNServerAuthentication from the specified map of raw messages. +func UnmarshalVPNServerAuthentication(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthentication) + err = core.UnmarshalPrimitive(m, "method", &obj.Method) + if err != nil { + return } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *UpdateBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBackupPolicyPlanOptions) SetID(id string) *UpdateBackupPolicyPlanOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBackupPolicyPlanPatch : Allow user to set BackupPolicyPlanPatch -func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyPlanPatch(backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { - _options.BackupPolicyPlanPatch = backupPolicyPlanPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyPlanOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyPlanOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerDiskOptions : The UpdateBareMetalServerDisk options. -type UpdateBareMetalServerDiskOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server disk patch. - BareMetalServerDiskPatch map[string]interface{} `json:"BareMetalServerDisk_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerDiskOptions : Instantiate UpdateBareMetalServerDiskOptions -func (*VpcV1) NewUpdateBareMetalServerDiskOptions(bareMetalServerID string, id string, bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { - return &UpdateBareMetalServerDiskOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - BareMetalServerDiskPatch: bareMetalServerDiskPatch, + err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) + if err != nil { + return } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerDiskOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerDiskOptions) SetID(id string) *UpdateBareMetalServerDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerDiskPatch : Allow user to set BareMetalServerDiskPatch -func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerDiskPatch(bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { - _options.BareMetalServerDiskPatch = bareMetalServerDiskPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerDiskOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerDiskOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerNetworkInterfaceOptions : The UpdateBareMetalServerNetworkInterface options. -type UpdateBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server network interface patch. - BareMetalServerNetworkInterfacePatch map[string]interface{} `json:"BareMetalServerNetworkInterface_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerNetworkInterfaceOptions : Instantiate UpdateBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewUpdateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string, bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { - return &UpdateBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - BareMetalServerNetworkInterfacePatch: bareMetalServerNetworkInterfacePatch, + err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) + if err != nil { + return } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetID(id string) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerNetworkInterfacePatch : Allow user to set BareMetalServerNetworkInterfacePatch -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerOptions : The UpdateBareMetalServer options. -type UpdateBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server patch. - BareMetalServerPatch map[string]interface{} `json:"BareMetalServer_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerOptions : Instantiate UpdateBareMetalServerOptions -func (*VpcV1) NewUpdateBareMetalServerOptions(id string, bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { - return &UpdateBareMetalServerOptions{ - ID: core.StringPtr(id), - BareMetalServerPatch: bareMetalServerPatch, + err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerOptions) SetID(id string) *UpdateBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options +// VPNServerAuthenticationByUsernameIDProvider : The type of identity provider to be used by VPN client. +// Models which "extend" this model: +// - VPNServerAuthenticationByUsernameIDProviderByIam +type VPNServerAuthenticationByUsernameIDProvider struct { + // The type of identity provider to be used by the VPN client. + // - `iam`: IBM identity and access management + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + ProviderType *string `json:"provider_type,omitempty"` } -// SetBareMetalServerPatch : Allow user to set BareMetalServerPatch -func (_options *UpdateBareMetalServerOptions) SetBareMetalServerPatch(bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { - _options.BareMetalServerPatch = bareMetalServerPatch - return _options -} +// Constants associated with the VPNServerAuthenticationByUsernameIDProvider.ProviderType property. +// The type of identity provider to be used by the VPN client. +// - `iam`: IBM identity and access management +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + VPNServerAuthenticationByUsernameIDProviderProviderTypeIamConst = "iam" +) -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerOptions { - options.Headers = param - return options +func (*VPNServerAuthenticationByUsernameIDProvider) isaVPNServerAuthenticationByUsernameIDProvider() bool { + return true } -// UpdateDedicatedHostDiskOptions : The UpdateDedicatedHostDisk options. -type UpdateDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // The dedicated host disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // The dedicated host disk patch. - DedicatedHostDiskPatch map[string]interface{} `json:"DedicatedHostDisk_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNServerAuthenticationByUsernameIDProviderIntf interface { + isaVPNServerAuthenticationByUsernameIDProvider() bool } -// NewUpdateDedicatedHostDiskOptions : Instantiate UpdateDedicatedHostDiskOptions -func (*VpcV1) NewUpdateDedicatedHostDiskOptions(dedicatedHostID string, id string, dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - return &UpdateDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), - DedicatedHostDiskPatch: dedicatedHostDiskPatch, +// UnmarshalVPNServerAuthenticationByUsernameIDProvider unmarshals an instance of VPNServerAuthenticationByUsernameIDProvider from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationByUsernameIDProvider(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationByUsernameIDProvider) + err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} +// VPNServerAuthenticationPrototype : An authentication method for this VPN server. +// Models which "extend" this model: +// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype +// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype +type VPNServerAuthenticationPrototype struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostDiskOptions) SetID(id string) *UpdateDedicatedHostDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The type of identity provider to be used by VPN client. + IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` -// SetDedicatedHostDiskPatch : Allow user to set DedicatedHostDiskPatch -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostDiskPatch(dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostDiskPatch = dedicatedHostDiskPatch - return _options -} + // The certificate instance to use for the VPN client certificate authority (CA). + ClientCa CertificateInstanceIdentityIntf `json:"client_ca,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostDiskOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostDiskOptions { - options.Headers = param - return options + // The certificate revocation list contents, encoded in PEM format. + Crl *string `json:"crl,omitempty"` } -// UpdateDedicatedHostGroupOptions : The UpdateDedicatedHostGroup options. -type UpdateDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The dedicated host group patch. - DedicatedHostGroupPatch map[string]interface{} `json:"DedicatedHostGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the VPNServerAuthenticationPrototype.Method property. +// The type of authentication. +const ( + VPNServerAuthenticationPrototypeMethodCertificateConst = "certificate" + VPNServerAuthenticationPrototypeMethodUsernameConst = "username" +) -// NewUpdateDedicatedHostGroupOptions : Instantiate UpdateDedicatedHostGroupOptions -func (*VpcV1) NewUpdateDedicatedHostGroupOptions(id string, dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - return &UpdateDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - DedicatedHostGroupPatch: dedicatedHostGroupPatch, - } +func (*VPNServerAuthenticationPrototype) isaVPNServerAuthenticationPrototype() bool { + return true } -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostGroupOptions) SetID(id string) *UpdateDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) - return _options +type VPNServerAuthenticationPrototypeIntf interface { + isaVPNServerAuthenticationPrototype() bool } -// SetDedicatedHostGroupPatch : Allow user to set DedicatedHostGroupPatch -func (_options *UpdateDedicatedHostGroupOptions) SetDedicatedHostGroupPatch(dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - _options.DedicatedHostGroupPatch = dedicatedHostGroupPatch - return _options +// UnmarshalVPNServerAuthenticationPrototype unmarshals an instance of VPNServerAuthenticationPrototype from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "method", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'method': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'method' not found in JSON object") + return + } + if discValue == "certificate" { + err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) + } else if discValue == "username" { + err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'method': %s", discValue) + } + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostGroupOptions { - options.Headers = param - return options -} +// VPNServerClient : VPNServerClient struct +type VPNServerClient struct { + // The IP address assigned to this VPN client from `client_ip_pool`. + ClientIP *IP `json:"client_ip" validate:"required"` -// UpdateDedicatedHostOptions : The UpdateDedicatedHost options. -type UpdateDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` + // The common name of client certificate that the VPN client provided when connecting to the server. + // + // This property will be present only when the `certificate` client authentication method is enabled on the VPN server. + CommonName *string `json:"common_name,omitempty"` - // The dedicated host patch. - DedicatedHostPatch map[string]interface{} `json:"DedicatedHost_patch" validate:"required"` + // The date and time that the VPN client was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The date and time that the VPN client was disconnected. + // + // This property will be present only when the client `status` is `disconnected`. + DisconnectedAt *strfmt.DateTime `json:"disconnected_at,omitempty"` -// NewUpdateDedicatedHostOptions : Instantiate UpdateDedicatedHostOptions -func (*VpcV1) NewUpdateDedicatedHostOptions(id string, dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - return &UpdateDedicatedHostOptions{ - ID: core.StringPtr(id), - DedicatedHostPatch: dedicatedHostPatch, - } -} + // The URL for this VPN client. + Href *string `json:"href" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostOptions) SetID(id string) *UpdateDedicatedHostOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The unique identifier for this VPN client. + ID *string `json:"id" validate:"required"` -// SetDedicatedHostPatch : Allow user to set DedicatedHostPatch -func (_options *UpdateDedicatedHostOptions) SetDedicatedHostPatch(dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - _options.DedicatedHostPatch = dedicatedHostPatch - return _options -} + // The remote IP address of this VPN client. + RemoteIP *IP `json:"remote_ip" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostOptions { - options.Headers = param - return options -} + // The remote port of this VPN client. + RemotePort *int64 `json:"remote_port" validate:"required"` -// UpdateEndpointGatewayOptions : The UpdateEndpointGateway options. -type UpdateEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The endpoint gateway patch. - EndpointGatewayPatch map[string]interface{} `json:"EndpointGateway_patch" validate:"required"` + // The status of the VPN client: + // - `connected`: the VPN client is `connected` to this VPN server. + // - `disconnected`: the VPN client is `disconnected` from this VPN server. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The username that this VPN client provided when connecting to the VPN server. + // + // This property will be present only when the `username` client authentication method is enabled on the VPN server. + Username *string `json:"username,omitempty"` } -// NewUpdateEndpointGatewayOptions : Instantiate UpdateEndpointGatewayOptions -func (*VpcV1) NewUpdateEndpointGatewayOptions(id string, endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - return &UpdateEndpointGatewayOptions{ - ID: core.StringPtr(id), - EndpointGatewayPatch: endpointGatewayPatch, - } -} +// Constants associated with the VPNServerClient.ResourceType property. +// The resource type. +const ( + VPNServerClientResourceTypeVPNServerClientConst = "vpn_server_client" +) -// SetID : Allow user to set ID -func (_options *UpdateEndpointGatewayOptions) SetID(id string) *UpdateEndpointGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the VPNServerClient.Status property. +// The status of the VPN client: +// - `connected`: the VPN client is `connected` to this VPN server. +// - `disconnected`: the VPN client is `disconnected` from this VPN server. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the +// unexpected property value was encountered. +const ( + VPNServerClientStatusConnectedConst = "connected" + VPNServerClientStatusDisconnectedConst = "disconnected" +) -// SetEndpointGatewayPatch : Allow user to set EndpointGatewayPatch -func (_options *UpdateEndpointGatewayOptions) SetEndpointGatewayPatch(endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - _options.EndpointGatewayPatch = endpointGatewayPatch - return _options +// UnmarshalVPNServerClient unmarshals an instance of VPNServerClient from the specified map of raw messages. +func UnmarshalVPNServerClient(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerClient) + err = core.UnmarshalModel(m, "client_ip", &obj.ClientIP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "common_name", &obj.CommonName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "disconnected_at", &obj.DisconnectedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote_ip", &obj.RemoteIP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "remote_port", &obj.RemotePort) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "username", &obj.Username) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayOptions { - options.Headers = param - return options -} +// VPNServerClientCollection : VPNServerClientCollection struct +type VPNServerClientCollection struct { + // Collection of VPN clients. + Clients []VPNServerClient `json:"clients" validate:"required"` -// UpdateFloatingIPOptions : The UpdateFloatingIP options. -type UpdateFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + // A link to the first page of resources. + First *VPNServerClientCollectionFirst `json:"first" validate:"required"` - // The floating IP patch. - FloatingIPPatch map[string]interface{} `json:"FloatingIP_patch" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPNServerClientCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewUpdateFloatingIPOptions : Instantiate UpdateFloatingIPOptions -func (*VpcV1) NewUpdateFloatingIPOptions(id string, floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - return &UpdateFloatingIPOptions{ - ID: core.StringPtr(id), - FloatingIPPatch: floatingIPPatch, +// UnmarshalVPNServerClientCollection unmarshals an instance of VPNServerClientCollection from the specified map of raw messages. +func UnmarshalVPNServerClientCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerClientCollection) + err = core.UnmarshalModel(m, "clients", &obj.Clients, UnmarshalVPNServerClient) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerClientCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerClientCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateFloatingIPOptions) SetID(id string) *UpdateFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNServerClientCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetFloatingIPPatch : Allow user to set FloatingIPPatch -func (_options *UpdateFloatingIPOptions) SetFloatingIPPatch(floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - _options.FloatingIPPatch = floatingIPPatch - return _options +// VPNServerClientCollectionFirst : A link to the first page of resources. +type VPNServerClientCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateFloatingIPOptions) SetHeaders(param map[string]string) *UpdateFloatingIPOptions { - options.Headers = param - return options +// UnmarshalVPNServerClientCollectionFirst unmarshals an instance of VPNServerClientCollectionFirst from the specified map of raw messages. +func UnmarshalVPNServerClientCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerClientCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateFlowLogCollectorOptions : The UpdateFlowLogCollector options. -type UpdateFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` - - // The flow log collector patch. - FlowLogCollectorPatch map[string]interface{} `json:"FlowLogCollector_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// VPNServerClientCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPNServerClientCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewUpdateFlowLogCollectorOptions : Instantiate UpdateFlowLogCollectorOptions -func (*VpcV1) NewUpdateFlowLogCollectorOptions(id string, flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - return &UpdateFlowLogCollectorOptions{ - ID: core.StringPtr(id), - FlowLogCollectorPatch: flowLogCollectorPatch, +// UnmarshalVPNServerClientCollectionNext unmarshals an instance of VPNServerClientCollectionNext from the specified map of raw messages. +func UnmarshalVPNServerClientCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerClientCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateFlowLogCollectorOptions) SetID(id string) *UpdateFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetFlowLogCollectorPatch : Allow user to set FlowLogCollectorPatch -func (_options *UpdateFlowLogCollectorOptions) SetFlowLogCollectorPatch(flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - _options.FlowLogCollectorPatch = flowLogCollectorPatch - return _options -} +// VPNServerCollection : VPNServerCollection struct +type VPNServerCollection struct { + // A link to the first page of resources. + First *VPNServerCollectionFirst `json:"first" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateFlowLogCollectorOptions) SetHeaders(param map[string]string) *UpdateFlowLogCollectorOptions { - options.Headers = param - return options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// UpdateIkePolicyOptions : The UpdateIkePolicy options. -type UpdateIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPNServerCollectionNext `json:"next,omitempty"` - // The IKE policy patch. - IkePolicyPatch map[string]interface{} `json:"IkePolicy_patch" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Collection of VPN servers. + VPNServers []VPNServer `json:"vpn_servers" validate:"required"` } -// NewUpdateIkePolicyOptions : Instantiate UpdateIkePolicyOptions -func (*VpcV1) NewUpdateIkePolicyOptions(id string, ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - return &UpdateIkePolicyOptions{ - ID: core.StringPtr(id), - IkePolicyPatch: ikePolicyPatch, +// UnmarshalVPNServerCollection unmarshals an instance of VPNServerCollection from the specified map of raw messages. +func UnmarshalVPNServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpn_servers", &obj.VPNServers, UnmarshalVPNServer) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateIkePolicyOptions) SetID(id string) *UpdateIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNServerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetIkePolicyPatch : Allow user to set IkePolicyPatch -func (_options *UpdateIkePolicyOptions) SetIkePolicyPatch(ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - _options.IkePolicyPatch = ikePolicyPatch - return _options +// VPNServerCollectionFirst : A link to the first page of resources. +type VPNServerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateIkePolicyOptions) SetHeaders(param map[string]string) *UpdateIkePolicyOptions { - options.Headers = param - return options +// UnmarshalVPNServerCollectionFirst unmarshals an instance of VPNServerCollectionFirst from the specified map of raw messages. +func UnmarshalVPNServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateImageExportJobOptions : The UpdateImageExportJob options. -type UpdateImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The image export job identifier. - ID *string `json:"id" validate:"required,ne="` - - // The image export job patch. - ImageExportJobPatch map[string]interface{} `json:"ImageExportJob_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// VPNServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPNServerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewUpdateImageExportJobOptions : Instantiate UpdateImageExportJobOptions -func (*VpcV1) NewUpdateImageExportJobOptions(imageID string, id string, imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { - return &UpdateImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), - ImageExportJobPatch: imageExportJobPatch, +// UnmarshalVPNServerCollectionNext unmarshals an instance of VPNServerCollectionNext from the specified map of raw messages. +func UnmarshalVPNServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetImageID : Allow user to set ImageID -func (_options *UpdateImageExportJobOptions) SetImageID(imageID string) *UpdateImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} +// VPNServerHealthReason : VPNServerHealthReason struct +type VPNServerHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateImageExportJobOptions) SetID(id string) *UpdateImageExportJobOptions { - _options.ID = core.StringPtr(id) - return _options -} + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` -// SetImageExportJobPatch : Allow user to set ImageExportJobPatch -func (_options *UpdateImageExportJobOptions) SetImageExportJobPatch(imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { - _options.ImageExportJobPatch = imageExportJobPatch - return _options + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateImageExportJobOptions) SetHeaders(param map[string]string) *UpdateImageExportJobOptions { - options.Headers = param - return options +// Constants associated with the VPNServerHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNServerHealthReasonCodeCannotAccessClientCertificateConst = "cannot_access_client_certificate" + VPNServerHealthReasonCodeCannotAccessServerCertificateConst = "cannot_access_server_certificate" + VPNServerHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" + VPNServerHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" + VPNServerHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNServerHealthReason unmarshals an instance of VPNServerHealthReason from the specified map of raw messages. +func UnmarshalVPNServerHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateImageOptions : The UpdateImage options. -type UpdateImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` +// VPNServerLifecycleReason : VPNServerLifecycleReason struct +type VPNServerLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` - // The image patch. - ImagePatch map[string]interface{} `json:"Image_patch" validate:"required"` + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` } -// NewUpdateImageOptions : Instantiate UpdateImageOptions -func (*VpcV1) NewUpdateImageOptions(id string, imagePatch map[string]interface{}) *UpdateImageOptions { - return &UpdateImageOptions{ - ID: core.StringPtr(id), - ImagePatch: imagePatch, +// Constants associated with the VPNServerLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNServerLifecycleReason unmarshals an instance of VPNServerLifecycleReason from the specified map of raw messages. +func UnmarshalVPNServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateImageOptions) SetID(id string) *UpdateImageOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNServerPatch : VPNServerPatch struct +type VPNServerPatch struct { + // The certificate instance for this VPN server. + Certificate CertificateInstanceIdentityIntf `json:"certificate,omitempty"` -// SetImagePatch : Allow user to set ImagePatch -func (_options *UpdateImageOptions) SetImagePatch(imagePatch map[string]interface{}) *UpdateImageOptions { - _options.ImagePatch = imagePatch - return _options -} + // The authentication methods to use to authenticate VPN client on this VPN server + // (replacing any existing methods). + ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication,omitempty"` + + // The DNS server addresses that will be provided to VPN clients connected to this VPN server (replacing any existing + // addresses). + ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` + + // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not + // disconnect idle clients. + ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateImageOptions) SetHeaders(param map[string]string) *UpdateImageOptions { - options.Headers = param - return options -} + // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address + // prefixes in the VPC or any of the following reserved address ranges: + // - `127.0.0.0/8` (IPv4 loopback addresses) + // - `161.26.0.0/16` (IBM services) + // - `166.8.0.0/14` (Cloud Service Endpoints) + // - `169.254.0.0/16` (IPv4 link-local addresses) + // - `224.0.0.0/4` (IPv4 multicast addresses) + // + // The prefix length of the client IP address pool's CIDR must be between + // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses + // that are required to enable the maximum number of concurrent connections is recommended. + ClientIPPool *string `json:"client_ip_pool,omitempty"` -// UpdateInstanceDiskOptions : The UpdateInstanceDisk options. -type UpdateInstanceDiskOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // Indicates whether the split tunneling is enabled on this VPN server. + EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` - // The instance disk identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this VPN server. The name must not be used by another VPN server in the VPC. + Name *string `json:"name,omitempty"` - // The instance disk patch. - InstanceDiskPatch map[string]interface{} `json:"InstanceDisk_patch" validate:"required"` + // The port number used by this VPN server. + Port *int64 `json:"port,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The transport protocol used by this VPN server. + Protocol *string `json:"protocol,omitempty"` -// NewUpdateInstanceDiskOptions : Instantiate UpdateInstanceDiskOptions -func (*VpcV1) NewUpdateInstanceDiskOptions(instanceID string, id string, instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - return &UpdateInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - InstanceDiskPatch: instanceDiskPatch, - } + // The subnets to provision this VPN server in (replacing the existing subnets). + Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` } -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceDiskOptions) SetInstanceID(instanceID string) *UpdateInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// Constants associated with the VPNServerPatch.Protocol property. +// The transport protocol used by this VPN server. +const ( + VPNServerPatchProtocolTCPConst = "tcp" + VPNServerPatchProtocolUDPConst = "udp" +) + +// UnmarshalVPNServerPatch unmarshals an instance of VPNServerPatch from the specified map of raw messages. +func UnmarshalVPNServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerPatch) + err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthenticationPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateInstanceDiskOptions) SetID(id string) *UpdateInstanceDiskOptions { - _options.ID = core.StringPtr(id) - return _options +// AsPatch returns a generic map representation of the VPNServerPatch +func (vpnServerPatch *VPNServerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpnServerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetInstanceDiskPatch : Allow user to set InstanceDiskPatch -func (_options *UpdateInstanceDiskOptions) SetInstanceDiskPatch(instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - _options.InstanceDiskPatch = instanceDiskPatch - return _options +// VPNServerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VPNServerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceDiskOptions) SetHeaders(param map[string]string) *UpdateInstanceDiskOptions { - options.Headers = param - return options +// UnmarshalVPNServerReferenceDeleted unmarshals an instance of VPNServerReferenceDeleted from the specified map of raw messages. +func UnmarshalVPNServerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateInstanceGroupManagerActionOptions : The UpdateInstanceGroupManagerAction options. -type UpdateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// VPNServerRoute : VPNServerRoute struct +type VPNServerRoute struct { + // The action to perform with a packet matching the VPN route: + // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. + // - `deliver`: deliver the packet into the VPC. + // - `drop`: drop the packet + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The date and time that the VPN route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` + // The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will + // be dropped. + Destination *string `json:"destination" validate:"required"` - // The instance group manager action patch. - InstanceGroupManagerActionPatch map[string]interface{} `json:"InstanceGroupManagerAction_patch" validate:"required"` + // The reasons for the current VPN server route health_state (if any): + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNServerRouteHealthReason `json:"health_reasons" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` -// NewUpdateInstanceGroupManagerActionOptions : Instantiate UpdateInstanceGroupManagerActionOptions -func (*VpcV1) NewUpdateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - return &UpdateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerActionPatch: instanceGroupManagerActionPatch, - } -} + // The URL for this VPN route. + Href *string `json:"href" validate:"required"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The unique identifier for this VPN route. + ID *string `json:"id" validate:"required"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} + // The reasons for the current VPN server route lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNServerRouteLifecycleReason `json:"lifecycle_reasons" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerActionOptions) SetID(id string) *UpdateInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The lifecycle state of the VPN route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// SetInstanceGroupManagerActionPatch : Allow user to set InstanceGroupManagerActionPatch -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPatch(instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch - return _options -} + // The name for this VPN route. The name is unique across all routes for a VPN server. + Name *string `json:"name" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerActionOptions { - options.Headers = param - return options + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UpdateInstanceGroupManagerOptions : The UpdateInstanceGroupManager options. -type UpdateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// Constants associated with the VPNServerRoute.Action property. +// The action to perform with a packet matching the VPN route: +// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. +// - `deliver`: deliver the packet into the VPC. +// - `drop`: drop the packet +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the +// unexpected property value was encountered. +const ( + VPNServerRouteActionDeliverConst = "deliver" + VPNServerRouteActionDropConst = "drop" + VPNServerRouteActionTranslateConst = "translate" +) - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the VPNServerRoute.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNServerRouteHealthStateDegradedConst = "degraded" + VPNServerRouteHealthStateFaultedConst = "faulted" + VPNServerRouteHealthStateInapplicableConst = "inapplicable" + VPNServerRouteHealthStateOkConst = "ok" +) - // The instance group manager patch. - InstanceGroupManagerPatch map[string]interface{} `json:"InstanceGroupManager_patch" validate:"required"` +// Constants associated with the VPNServerRoute.LifecycleState property. +// The lifecycle state of the VPN route. +const ( + VPNServerRouteLifecycleStateDeletingConst = "deleting" + VPNServerRouteLifecycleStateFailedConst = "failed" + VPNServerRouteLifecycleStatePendingConst = "pending" + VPNServerRouteLifecycleStateStableConst = "stable" + VPNServerRouteLifecycleStateSuspendedConst = "suspended" + VPNServerRouteLifecycleStateUpdatingConst = "updating" + VPNServerRouteLifecycleStateWaitingConst = "waiting" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the VPNServerRoute.ResourceType property. +// The resource type. +const ( + VPNServerRouteResourceTypeVPNServerRouteConst = "vpn_server_route" +) -// NewUpdateInstanceGroupManagerOptions : Instantiate UpdateInstanceGroupManagerOptions -func (*VpcV1) NewUpdateInstanceGroupManagerOptions(instanceGroupID string, id string, instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - return &UpdateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupManagerPatch: instanceGroupManagerPatch, +// UnmarshalVPNServerRoute unmarshals an instance of VPNServerRoute from the specified map of raw messages. +func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRoute) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerRouteHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerRouteLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerOptions) SetID(id string) *UpdateInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupManagerPatch : Allow user to set InstanceGroupManagerPatch -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupManagerPatch(instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPatch = instanceGroupManagerPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerOptions { - options.Headers = param - return options -} +// VPNServerRouteCollection : VPNServerRouteCollection struct +type VPNServerRouteCollection struct { + // A link to the first page of resources. + First *VPNServerRouteCollectionFirst `json:"first" validate:"required"` -// UpdateInstanceGroupManagerPolicyOptions : The UpdateInstanceGroupManagerPolicy options. -type UpdateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPNServerRouteCollectionNext `json:"next,omitempty"` - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` + // Collection of VPN routes. + Routes []VPNServerRoute `json:"routes" validate:"required"` - // The instance group manager policy patch. - InstanceGroupManagerPolicyPatch map[string]interface{} `json:"InstanceGroupManagerPolicy_patch" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalVPNServerRouteCollection unmarshals an instance of VPNServerRouteCollection from the specified map of raw messages. +func UnmarshalVPNServerRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerRouteCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerRouteCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalVPNServerRoute) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewUpdateInstanceGroupManagerPolicyOptions : Instantiate UpdateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - return &UpdateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerPolicyPatch: instanceGroupManagerPolicyPatch, +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNServerRouteCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// VPNServerRouteCollectionFirst : A link to the first page of resources. +type VPNServerRouteCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// UnmarshalVPNServerRouteCollectionFirst unmarshals an instance of VPNServerRouteCollectionFirst from the specified map of raw messages. +func UnmarshalVPNServerRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetID(id string) *UpdateInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// VPNServerRouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPNServerRouteCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetInstanceGroupManagerPolicyPatch : Allow user to set InstanceGroupManagerPolicyPatch -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatch - return _options +// UnmarshalVPNServerRouteCollectionNext unmarshals an instance of VPNServerRouteCollectionNext from the specified map of raw messages. +func UnmarshalVPNServerRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerPolicyOptions { - options.Headers = param - return options +// VPNServerRouteHealthReason : VPNServerRouteHealthReason struct +type VPNServerRouteHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` } -// UpdateInstanceGroupMembershipOptions : The UpdateInstanceGroupMembership options. -type UpdateInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// Constants associated with the VPNServerRouteHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VPNServerRouteHealthReasonCodeInternalErrorConst = "internal_error" +) + +// UnmarshalVPNServerRouteHealthReason unmarshals an instance of VPNServerRouteHealthReason from the specified map of raw messages. +func UnmarshalVPNServerRouteHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` +// VPNServerRouteLifecycleReason : VPNServerRouteLifecycleReason struct +type VPNServerRouteLifecycleReason struct { + // A snake case string succinctly identifying the reason for this lifecycle state. + Code *string `json:"code" validate:"required"` - // The instance group membership patch. - InstanceGroupMembershipPatch map[string]interface{} `json:"InstanceGroupMembership_patch" validate:"required"` + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` } -// NewUpdateInstanceGroupMembershipOptions : Instantiate UpdateInstanceGroupMembershipOptions -func (*VpcV1) NewUpdateInstanceGroupMembershipOptions(instanceGroupID string, id string, instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - return &UpdateInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupMembershipPatch: instanceGroupMembershipPatch, +// Constants associated with the VPNServerRouteLifecycleReason.Code property. +// A snake case string succinctly identifying the reason for this lifecycle state. +const ( + VPNServerRouteLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNServerRouteLifecycleReason unmarshals an instance of VPNServerRouteLifecycleReason from the specified map of raw messages. +func UnmarshalVPNServerRouteLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRouteLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// VPNServerRoutePatch : VPNServerRoutePatch struct +type VPNServerRoutePatch struct { + // The name for this VPN server route. The name must not be used by another route for the VPN server. + Name *string `json:"name,omitempty"` } -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupMembershipOptions) SetID(id string) *UpdateInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVPNServerRoutePatch unmarshals an instance of VPNServerRoutePatch from the specified map of raw messages. +func UnmarshalVPNServerRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerRoutePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupMembershipPatch : Allow user to set InstanceGroupMembershipPatch -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupMembershipPatch(instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupMembershipPatch = instanceGroupMembershipPatch - return _options +// AsPatch returns a generic map representation of the VPNServerRoutePatch +func (vpnServerRoutePatch *VPNServerRoutePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpnServerRoutePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupMembershipOptions { - options.Headers = param - return options -} +// VirtualNetworkInterface : VirtualNetworkInterface struct +type VirtualNetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` -// UpdateInstanceGroupOptions : The UpdateInstanceGroup options. -type UpdateInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The instance group patch. - InstanceGroupPatch map[string]interface{} `json:"InstanceGroup_patch" validate:"required"` + // The date and time that the virtual network interface was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` -// NewUpdateInstanceGroupOptions : Instantiate UpdateInstanceGroupOptions -func (*VpcV1) NewUpdateInstanceGroupOptions(id string, instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - return &UpdateInstanceGroupOptions{ - ID: core.StringPtr(id), - InstanceGroupPatch: instanceGroupPatch, - } -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupOptions) SetID(id string) *UpdateInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` -// SetInstanceGroupPatch : Allow user to set InstanceGroupPatch -func (_options *UpdateInstanceGroupOptions) SetInstanceGroupPatch(instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - _options.InstanceGroupPatch = instanceGroupPatch - return _options -} + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupOptions { - options.Headers = param - return options -} + // The reserved IPs bound to this virtual network interface. + // + // May be empty when `lifecycle_state` is `pending`. + Ips []ReservedIPReference `json:"ips" validate:"required"` -// UpdateInstanceNetworkInterfaceOptions : The UpdateInstanceNetworkInterface options. -type UpdateInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The lifecycle state of the virtual network interface. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The instance network interface identifier. - ID *string `json:"id" validate:"required,ne="` + // The MAC address of the virtual network interface. May be absent if `lifecycle_state` is `pending`. + MacAddress *string `json:"mac_address,omitempty"` - // The instance network interface patch. - NetworkInterfacePatch map[string]interface{} `json:"NetworkInterface_patch" validate:"required"` + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The reserved IP for this virtual network interface. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` -// NewUpdateInstanceNetworkInterfaceOptions : Instantiate UpdateInstanceNetworkInterfaceOptions -func (*VpcV1) NewUpdateInstanceNetworkInterfaceOptions(instanceID string, id string, networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - return &UpdateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - NetworkInterfacePatch: networkInterfacePatch, - } -} + // The resource group for this virtual network interface. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetID(id string) *UpdateInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The security groups for this virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// SetNetworkInterfacePatch : Allow user to set NetworkInterfacePatch -func (_options *UpdateInstanceNetworkInterfaceOptions) SetNetworkInterfacePatch(networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - _options.NetworkInterfacePatch = networkInterfacePatch - return _options -} + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} + // The target of this virtual network interface. + // + // If absent, this virtual network interface is not attached to a target. + Target VirtualNetworkInterfaceTargetIntf `json:"target,omitempty"` -// UpdateInstanceOptions : The UpdateInstance options. -type UpdateInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` + // The VPC this virtual network interface resides in. + VPC *VPCReference `json:"vpc" validate:"required"` - // The instance patch. - InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` + // The zone this virtual network interface resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` +// Constants associated with the VirtualNetworkInterface.LifecycleState property. +// The lifecycle state of the virtual network interface. +const ( + VirtualNetworkInterfaceLifecycleStateDeletingConst = "deleting" + VirtualNetworkInterfaceLifecycleStateFailedConst = "failed" + VirtualNetworkInterfaceLifecycleStatePendingConst = "pending" + VirtualNetworkInterfaceLifecycleStateStableConst = "stable" + VirtualNetworkInterfaceLifecycleStateSuspendedConst = "suspended" + VirtualNetworkInterfaceLifecycleStateUpdatingConst = "updating" + VirtualNetworkInterfaceLifecycleStateWaitingConst = "waiting" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the VirtualNetworkInterface.ResourceType property. +// The resource type. +const ( + VirtualNetworkInterfaceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" +) -// NewUpdateInstanceOptions : Instantiate UpdateInstanceOptions -func (*VpcV1) NewUpdateInstanceOptions(id string, instancePatch map[string]interface{}) *UpdateInstanceOptions { - return &UpdateInstanceOptions{ - ID: core.StringPtr(id), - InstancePatch: instancePatch, +// UnmarshalVirtualNetworkInterface unmarshals an instance of VirtualNetworkInterface from the specified map of raw messages. +func UnmarshalVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterface) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalVirtualNetworkInterfaceTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateInstanceOptions) SetID(id string) *UpdateInstanceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstancePatch : Allow user to set InstancePatch -func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string]interface{}) *UpdateInstanceOptions { - _options.InstancePatch = instancePatch - return _options -} +// VirtualNetworkInterfaceCollection : VirtualNetworkInterfaceCollection struct +type VirtualNetworkInterfaceCollection struct { + // A link to the first page of resources. + First *VirtualNetworkInterfaceCollectionFirst `json:"first" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateInstanceOptions) SetIfMatch(ifMatch string) *UpdateInstanceOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { - options.Headers = param - return options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VirtualNetworkInterfaceCollectionNext `json:"next,omitempty"` -// UpdateInstanceTemplateOptions : The UpdateInstanceTemplate options. -type UpdateInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` - // The instance template patch. - InstanceTemplatePatch map[string]interface{} `json:"InstanceTemplate_patch" validate:"required"` + // Collection of virtual network interfaces. + VirtualNetworkInterfaces []VirtualNetworkInterface `json:"virtual_network_interfaces" validate:"required"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalVirtualNetworkInterfaceCollection unmarshals an instance of VirtualNetworkInterfaceCollection from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVirtualNetworkInterfaceCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVirtualNetworkInterfaceCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interfaces", &obj.VirtualNetworkInterfaces, UnmarshalVirtualNetworkInterface) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewUpdateInstanceTemplateOptions : Instantiate UpdateInstanceTemplateOptions -func (*VpcV1) NewUpdateInstanceTemplateOptions(id string, instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - return &UpdateInstanceTemplateOptions{ - ID: core.StringPtr(id), - InstanceTemplatePatch: instanceTemplatePatch, +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VirtualNetworkInterfaceCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err } + return start, nil } -// SetID : Allow user to set ID -func (_options *UpdateInstanceTemplateOptions) SetID(id string) *UpdateInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options +// VirtualNetworkInterfaceCollectionFirst : A link to the first page of resources. +type VirtualNetworkInterfaceCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetInstanceTemplatePatch : Allow user to set InstanceTemplatePatch -func (_options *UpdateInstanceTemplateOptions) SetInstanceTemplatePatch(instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - _options.InstanceTemplatePatch = instanceTemplatePatch - return _options +// UnmarshalVirtualNetworkInterfaceCollectionFirst unmarshals an instance of VirtualNetworkInterfaceCollectionFirst from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceTemplateOptions) SetHeaders(param map[string]string) *UpdateInstanceTemplateOptions { - options.Headers = param - return options +// VirtualNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VirtualNetworkInterfaceCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UpdateInstanceVolumeAttachmentOptions : The UpdateInstanceVolumeAttachment options. -type UpdateInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UnmarshalVirtualNetworkInterfaceCollectionNext unmarshals an instance of VirtualNetworkInterfaceCollectionNext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` +// VirtualNetworkInterfaceIPPrototype : VirtualNetworkInterfaceIPPrototype struct +// Models which "extend" this model: +// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext +// - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext +type VirtualNetworkInterfaceIPPrototype struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` - // The volume attachment patch. - VolumeAttachmentPatch map[string]interface{} `json:"VolumeAttachment_patch" validate:"required"` + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` -// NewUpdateInstanceVolumeAttachmentOptions : Instantiate UpdateInstanceVolumeAttachmentOptions -func (*VpcV1) NewUpdateInstanceVolumeAttachmentOptions(instanceID string, id string, volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - return &UpdateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - VolumeAttachmentPatch: volumeAttachmentPatch, - } -} + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` } -// SetID : Allow user to set ID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetID(id string) *UpdateInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options +func (*VirtualNetworkInterfaceIPPrototype) isaVirtualNetworkInterfaceIPPrototype() bool { + return true } -// SetVolumeAttachmentPatch : Allow user to set VolumeAttachmentPatch -func (_options *UpdateInstanceVolumeAttachmentOptions) SetVolumeAttachmentPatch(volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - _options.VolumeAttachmentPatch = volumeAttachmentPatch - return _options +type VirtualNetworkInterfaceIPPrototypeIntf interface { + isaVirtualNetworkInterfaceIPPrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceVolumeAttachmentOptions { - options.Headers = param - return options +// UnmarshalVirtualNetworkInterfaceIPPrototype unmarshals an instance of VirtualNetworkInterfaceIPPrototype from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateIpsecPolicyOptions : The UpdateIpsecPolicy options. -type UpdateIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` +// VirtualNetworkInterfacePatch : VirtualNetworkInterfacePatch struct +type VirtualNetworkInterfacePatch struct { + // Indicates whether source IP spoofing is allowed on this interface. + // + // Must be `false` if `target` is a file share mount target. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The IPsec policy patch. - IPsecPolicyPatch map[string]interface{} `json:"IPsecPolicy_patch" validate:"required"` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. Must be `false` if the virtual network interface is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // region. Names beginning with `ibm-` are reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` } -// NewUpdateIpsecPolicyOptions : Instantiate UpdateIpsecPolicyOptions -func (*VpcV1) NewUpdateIpsecPolicyOptions(id string, iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - return &UpdateIpsecPolicyOptions{ - ID: core.StringPtr(id), - IPsecPolicyPatch: iPsecPolicyPatch, +// UnmarshalVirtualNetworkInterfacePatch unmarshals an instance of VirtualNetworkInterfacePatch from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfacePatch) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateIpsecPolicyOptions) SetID(id string) *UpdateIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// AsPatch returns a generic map representation of the VirtualNetworkInterfacePatch +func (virtualNetworkInterfacePatch *VirtualNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(virtualNetworkInterfacePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetIPsecPolicyPatch : Allow user to set IPsecPolicyPatch -func (_options *UpdateIpsecPolicyOptions) SetIPsecPolicyPatch(iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - _options.IPsecPolicyPatch = iPsecPolicyPatch - return _options -} +// VirtualNetworkInterfacePrimaryIPPrototype : VirtualNetworkInterfacePrimaryIPPrototype struct +// Models which "extend" this model: +// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext +// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext +type VirtualNetworkInterfacePrimaryIPPrototype struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateIpsecPolicyOptions) SetHeaders(param map[string]string) *UpdateIpsecPolicyOptions { - options.Headers = param - return options -} + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` -// UpdateKeyOptions : The UpdateKey options. -type UpdateKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` - // The key patch. - KeyPatch map[string]interface{} `json:"Key_patch" validate:"required"` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` } -// NewUpdateKeyOptions : Instantiate UpdateKeyOptions -func (*VpcV1) NewUpdateKeyOptions(id string, keyPatch map[string]interface{}) *UpdateKeyOptions { - return &UpdateKeyOptions{ - ID: core.StringPtr(id), - KeyPatch: keyPatch, - } +func (*VirtualNetworkInterfacePrimaryIPPrototype) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { + return true } -// SetID : Allow user to set ID -func (_options *UpdateKeyOptions) SetID(id string) *UpdateKeyOptions { - _options.ID = core.StringPtr(id) - return _options +type VirtualNetworkInterfacePrimaryIPPrototypeIntf interface { + isaVirtualNetworkInterfacePrimaryIPPrototype() bool } -// SetKeyPatch : Allow user to set KeyPatch -func (_options *UpdateKeyOptions) SetKeyPatch(keyPatch map[string]interface{}) *UpdateKeyOptions { - _options.KeyPatch = keyPatch - return _options +// UnmarshalVirtualNetworkInterfacePrimaryIPPrototype unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototype from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfacePrimaryIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfacePrimaryIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateKeyOptions) SetHeaders(param map[string]string) *UpdateKeyOptions { - options.Headers = param - return options -} +// VirtualNetworkInterfaceReferenceAttachmentContext : VirtualNetworkInterfaceReferenceAttachmentContext struct +type VirtualNetworkInterfaceReferenceAttachmentContext struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` -// UpdateLoadBalancerListenerOptions : The UpdateLoadBalancerListener options. -type UpdateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` - // The load balancer listener patch. - LoadBalancerListenerPatch map[string]interface{} `json:"LoadBalancerListener_patch" validate:"required"` + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewUpdateLoadBalancerListenerOptions : Instantiate UpdateLoadBalancerListenerOptions -func (*VpcV1) NewUpdateLoadBalancerListenerOptions(loadBalancerID string, id string, loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - return &UpdateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerListenerPatch: loadBalancerListenerPatch, +// Constants associated with the VirtualNetworkInterfaceReferenceAttachmentContext.ResourceType property. +// The resource type. +const ( + VirtualNetworkInterfaceReferenceAttachmentContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" +) + +// UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext unmarshals an instance of VirtualNetworkInterfaceReferenceAttachmentContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceReferenceAttachmentContext) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// VirtualNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VirtualNetworkInterfaceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerOptions) SetID(id string) *UpdateLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVirtualNetworkInterfaceReferenceDeleted unmarshals an instance of VirtualNetworkInterfaceReferenceDeleted from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerListenerPatch : Allow user to set LoadBalancerListenerPatch -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerListenerPatch(loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerListenerPatch = loadBalancerListenerPatch - return _options -} +// VirtualNetworkInterfaceTarget : A virtual network interface target. +// +// The resource types that can be virtual network interface targets are expected to expand in the future. When iterating +// over virtual network interface targets, do not assume that every target resource will be from a known set of resource +// types. Optionally halt processing and surface an error, or bypass resources of unrecognized types. +// Models which "extend" this model: +// - VirtualNetworkInterfaceTargetShareMountTargetReference +// - VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext +// - VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext +type VirtualNetworkInterfaceTarget struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerOptions { - options.Headers = param - return options -} + // The URL for this share mount target. + Href *string `json:"href,omitempty"` -// UpdateLoadBalancerListenerPolicyOptions : The UpdateLoadBalancerListenerPolicy options. -type UpdateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The unique identifier for this share mount target. + ID *string `json:"id,omitempty"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The name for this share mount target. The name is unique across all mount targets for the file share. + Name *string `json:"name,omitempty"` - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} - // The listener policy patch. - LoadBalancerListenerPolicyPatch map[string]interface{} `json:"LoadBalancerListenerPolicy_patch" validate:"required"` +// Constants associated with the VirtualNetworkInterfaceTarget.ResourceType property. +// The resource type. +const ( + VirtualNetworkInterfaceTargetResourceTypeShareMountTargetConst = "share_mount_target" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*VirtualNetworkInterfaceTarget) isaVirtualNetworkInterfaceTarget() bool { + return true } -// NewUpdateLoadBalancerListenerPolicyOptions : Instantiate UpdateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string, loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - return &UpdateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyPatch: loadBalancerListenerPolicyPatch, - } +type VirtualNetworkInterfaceTargetIntf interface { + isaVirtualNetworkInterfaceTarget() bool } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// UnmarshalVirtualNetworkInterfaceTarget unmarshals an instance of VirtualNetworkInterfaceTarget from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} +// Volume : Volume struct +type Volume struct { + // Indicates whether a running virtual server instance has an attachment to this volume. + Active *bool `json:"active" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The attachment state of the volume + // - `unattached`: Not attached to any virtual server instances + // - `attached`: Attached to a virtual server instance (even if the instance is stopped) + // - `unusable`: Not able to be attached to any virtual server instances. + AttachmentState *string `json:"attachment_state" validate:"required"` -// SetLoadBalancerListenerPolicyPatch : Allow user to set LoadBalancerListenerPolicyPatch -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch - return _options -} + // The maximum bandwidth (in megabits per second) for the volume. + Bandwidth *int64 `json:"bandwidth" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} + // Indicates whether this volume is performing an operation that must be serialized. This must be `false` to perform an + // operation that is specified to require serialization. + Busy *bool `json:"busy" validate:"required"` -// UpdateLoadBalancerListenerPolicyRuleOptions : The UpdateLoadBalancerListenerPolicyRule options. -type UpdateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity" validate:"required"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The date and time that the volume was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The type of encryption used on the volume. + Encryption *string `json:"encryption" validate:"required"` - // The listener policy rule patch. - LoadBalancerListenerPolicyRulePatch map[string]interface{} `json:"LoadBalancerListenerPolicyRule_patch" validate:"required"` + // The root key used to wrap the data encryption key for the volume. + // + // This property will be present for volumes with an `encryption` type of + // `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The reasons for the current `health_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VolumeHealthReason `json:"health_reasons" validate:"required"` -// NewUpdateLoadBalancerListenerPolicyRuleOptions : Instantiate UpdateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string, loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - return &UpdateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyRulePatch: loadBalancerListenerPolicyRulePatch, - } -} + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The URL for this volume. + Href *string `json:"href" validate:"required"` -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} + // The unique identifier for this volume. + ID *string `json:"id" validate:"required"` -// SetPolicyID : Allow user to set PolicyID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} + // The maximum I/O operations per second (IOPS) for this volume. + Iops *int64 `json:"iops" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The name for this volume. The name is unique across all volumes in the region. + Name *string `json:"name" validate:"required"` -// SetLoadBalancerListenerPolicyRulePatch : Allow user to set LoadBalancerListenerPolicyRulePatch -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch - return _options -} + // The operating system associated with this volume. If absent, this volume was not + // created from an image, or the image did not include an operating system. + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for + // this volume. + Profile *VolumeProfileReference `json:"profile" validate:"required"` -// UpdateLoadBalancerOptions : The UpdateLoadBalancer options. -type UpdateLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group for this volume. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The load balancer patch. - LoadBalancerPatch map[string]interface{} `json:"LoadBalancer_patch" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // The image from which this volume was created (this may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + // If absent, this volume was not created from an image. + SourceImage *ImageReference `json:"source_image,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The snapshot from which this volume was cloned. + SourceSnapshot *SnapshotReference `json:"source_snapshot,omitempty"` -// NewUpdateLoadBalancerOptions : Instantiate UpdateLoadBalancerOptions -func (*VpcV1) NewUpdateLoadBalancerOptions(id string, loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - return &UpdateLoadBalancerOptions{ - ID: core.StringPtr(id), - LoadBalancerPatch: loadBalancerPatch, - } -} + // The status of the volume. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerOptions) SetID(id string) *UpdateLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VolumeStatusReason `json:"status_reasons" validate:"required"` -// SetLoadBalancerPatch : Allow user to set LoadBalancerPatch -func (_options *UpdateLoadBalancerOptions) SetLoadBalancerPatch(loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - _options.LoadBalancerPatch = loadBalancerPatch - return _options -} + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateLoadBalancerOptions) SetIfMatch(ifMatch string) *UpdateLoadBalancerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // The volume attachments for this volume. + VolumeAttachments []VolumeAttachmentReferenceVolumeContext `json:"volume_attachments" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerOptions { - options.Headers = param - return options + // The zone this volume resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// UpdateLoadBalancerPoolMemberOptions : The UpdateLoadBalancerPoolMember options. -type UpdateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` +// Constants associated with the Volume.AttachmentState property. +// The attachment state of the volume +// - `unattached`: Not attached to any virtual server instances +// - `attached`: Attached to a virtual server instance (even if the instance is stopped) +// - `unusable`: Not able to be attached to any virtual server instances. +const ( + VolumeAttachmentStateAttachedConst = "attached" + VolumeAttachmentStateUnattachedConst = "unattached" + VolumeAttachmentStateUnusableConst = "unusable" +) - // The member identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the Volume.Encryption property. +// The type of encryption used on the volume. +const ( + VolumeEncryptionProviderManagedConst = "provider_managed" + VolumeEncryptionUserManagedConst = "user_managed" +) - // The load balancer pool member patch. - LoadBalancerPoolMemberPatch map[string]interface{} `json:"LoadBalancerPoolMember_patch" validate:"required"` +// Constants associated with the Volume.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VolumeHealthStateDegradedConst = "degraded" + VolumeHealthStateFaultedConst = "faulted" + VolumeHealthStateInapplicableConst = "inapplicable" + VolumeHealthStateOkConst = "ok" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the Volume.ResourceType property. +// The resource type. +const ( + VolumeResourceTypeVolumeConst = "volume" +) -// NewUpdateLoadBalancerPoolMemberOptions : Instantiate UpdateLoadBalancerPoolMemberOptions -func (*VpcV1) NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string, loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - return &UpdateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - LoadBalancerPoolMemberPatch: loadBalancerPoolMemberPatch, +// Constants associated with the Volume.Status property. +// The status of the volume. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected +// property value was encountered. +const ( + VolumeStatusAvailableConst = "available" + VolumeStatusFailedConst = "failed" + VolumeStatusPendingConst = "pending" + VolumeStatusPendingDeletionConst = "pending_deletion" + VolumeStatusUnusableConst = "unusable" + VolumeStatusUpdatingConst = "updating" +) + +// UnmarshalVolume unmarshals an instance of Volume from the specified map of raw messages. +func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Volume) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "attachment_state", &obj.AttachmentState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "busy", &obj.Busy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVolumeHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeStatusReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceVolumeContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// VolumeAttachment : VolumeAttachment struct +type VolumeAttachment struct { + // The maximum bandwidth (in megabits per second) for the volume when attached to this instance. This may be lower than + // the volume bandwidth depending on the configuration of the instance. + Bandwidth *int64 `json:"bandwidth" validate:"required"` -// SetPoolID : Allow user to set PoolID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *UpdateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} + // The date and time that the volume was attached. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetID(id string) *UpdateLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` -// SetLoadBalancerPoolMemberPatch : Allow user to set LoadBalancerPoolMemberPatch -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerPoolMemberPatch(loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch - return _options -} + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} + // The URL for this volume attachment. + Href *string `json:"href" validate:"required"` -// UpdateLoadBalancerPoolOptions : The UpdateLoadBalancerPool options. -type UpdateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The unique identifier for this volume attachment. + ID *string `json:"id" validate:"required"` - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this volume attachment. The name is unique across all volume attachments on the instance. + Name *string `json:"name" validate:"required"` - // The load balancer pool patch. - LoadBalancerPoolPatch map[string]interface{} `json:"LoadBalancerPool_patch" validate:"required"` + // The status of this volume attachment. + Status *string `json:"status" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The type of volume attachment. + Type *string `json:"type" validate:"required"` -// NewUpdateLoadBalancerPoolOptions : Instantiate UpdateLoadBalancerPoolOptions -func (*VpcV1) NewUpdateLoadBalancerPoolOptions(loadBalancerID string, id string, loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - return &UpdateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerPoolPatch: loadBalancerPoolPatch, - } + // The attached volume. + // + // This property will be absent if the volume has not yet been provisioned. + Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// Constants associated with the VolumeAttachment.Status property. +// The status of this volume attachment. +const ( + VolumeAttachmentStatusAttachedConst = "attached" + VolumeAttachmentStatusAttachingConst = "attaching" + VolumeAttachmentStatusDeletingConst = "deleting" + VolumeAttachmentStatusDetachingConst = "detaching" +) -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolOptions) SetID(id string) *UpdateLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the VolumeAttachment.Type property. +// The type of volume attachment. +const ( + VolumeAttachmentTypeBootConst = "boot" + VolumeAttachmentTypeDataConst = "data" +) -// SetLoadBalancerPoolPatch : Allow user to set LoadBalancerPoolPatch -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerPoolPatch(loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerPoolPatch = loadBalancerPoolPatch - return _options +// UnmarshalVolumeAttachment unmarshals an instance of VolumeAttachment from the specified map of raw messages. +func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachment) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolOptions { - options.Headers = param - return options +// VolumeAttachmentCollection : VolumeAttachmentCollection struct +type VolumeAttachmentCollection struct { + // Collection of volume attachments. + VolumeAttachments []VolumeAttachment `json:"volume_attachments" validate:"required"` } -// UpdateNetworkACLOptions : The UpdateNetworkACL options. -type UpdateNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` - - // The network ACL patch. - NetworkACLPatch map[string]interface{} `json:"NetworkACL_patch" validate:"required"` +// UnmarshalVolumeAttachmentCollection unmarshals an instance of VolumeAttachmentCollection from the specified map of raw messages. +func UnmarshalVolumeAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentCollection) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachment) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Allows users to set headers on API requests - Headers map[string]string +// VolumeAttachmentDevice : VolumeAttachmentDevice struct +type VolumeAttachmentDevice struct { + // A unique identifier for the device which is exposed to the instance operating system. + ID *string `json:"id,omitempty"` } -// NewUpdateNetworkACLOptions : Instantiate UpdateNetworkACLOptions -func (*VpcV1) NewUpdateNetworkACLOptions(id string, networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - return &UpdateNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLPatch: networkACLPatch, +// UnmarshalVolumeAttachmentDevice unmarshals an instance of VolumeAttachmentDevice from the specified map of raw messages. +func UnmarshalVolumeAttachmentDevice(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentDevice) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLOptions) SetID(id string) *UpdateNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VolumeAttachmentPatch : VolumeAttachmentPatch struct +type VolumeAttachmentPatch struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` -// SetNetworkACLPatch : Allow user to set NetworkACLPatch -func (_options *UpdateNetworkACLOptions) SetNetworkACLPatch(networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - _options.NetworkACLPatch = networkACLPatch - return _options + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. + Name *string `json:"name,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLOptions) SetHeaders(param map[string]string) *UpdateNetworkACLOptions { - options.Headers = param - return options +// UnmarshalVolumeAttachmentPatch unmarshals an instance of VolumeAttachmentPatch from the specified map of raw messages. +func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPatch) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateNetworkACLRuleOptions : The UpdateNetworkACLRule options. -type UpdateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` +// AsPatch returns a generic map representation of the VolumeAttachmentPatch +func (volumeAttachmentPatch *VolumeAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(volumeAttachmentPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` +// VolumeAttachmentPrototype : VolumeAttachmentPrototype struct +type VolumeAttachmentPrototype struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - // The network ACL rule patch. - NetworkACLRulePatch map[string]interface{} `json:"NetworkACLRule_patch" validate:"required"` + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // An existing volume to attach to the instance, or a prototype object for a new volume. + Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` } -// NewUpdateNetworkACLRuleOptions : Instantiate UpdateNetworkACLRuleOptions -func (*VpcV1) NewUpdateNetworkACLRuleOptions(networkACLID string, id string, networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - return &UpdateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - NetworkACLRulePatch: networkACLRulePatch, +// NewVolumeAttachmentPrototype : Instantiate VolumeAttachmentPrototype (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototype(volume VolumeAttachmentPrototypeVolumeIntf) (_model *VolumeAttachmentPrototype, err error) { + _model = &VolumeAttachmentPrototype{ + Volume: volume, } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *UpdateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options +// UnmarshalVolumeAttachmentPrototype unmarshals an instance of VolumeAttachmentPrototype from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentPrototypeVolume) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLRuleOptions) SetID(id string) *UpdateNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VolumeAttachmentPrototypeInstanceByImageContext : VolumeAttachmentPrototypeInstanceByImageContext struct +type VolumeAttachmentPrototypeInstanceByImageContext struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` -// SetNetworkACLRulePatch : Allow user to set NetworkACLRulePatch -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLRulePatch(networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - _options.NetworkACLRulePatch = networkACLRulePatch - return _options -} + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLRuleOptions) SetHeaders(param map[string]string) *UpdateNetworkACLRuleOptions { - options.Headers = param - return options + // A prototype object for a new volume. + Volume *VolumePrototypeInstanceByImageContext `json:"volume" validate:"required"` } -// UpdatePlacementGroupOptions : The UpdatePlacementGroup options. -type UpdatePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The placement group patch. - PlacementGroupPatch map[string]interface{} `json:"PlacementGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// NewVolumeAttachmentPrototypeInstanceByImageContext : Instantiate VolumeAttachmentPrototypeInstanceByImageContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByImageContext(volume *VolumePrototypeInstanceByImageContext) (_model *VolumeAttachmentPrototypeInstanceByImageContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceByImageContext{ + Volume: volume, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// NewUpdatePlacementGroupOptions : Instantiate UpdatePlacementGroupOptions -func (*VpcV1) NewUpdatePlacementGroupOptions(id string, placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - return &UpdatePlacementGroupOptions{ - ID: core.StringPtr(id), - PlacementGroupPatch: placementGroupPatch, +// UnmarshalVolumeAttachmentPrototypeInstanceByImageContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByImageContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceByImageContext) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdatePlacementGroupOptions) SetID(id string) *UpdatePlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options +// VolumeAttachmentPrototypeInstanceBySourceSnapshotContext : VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct +type VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // A prototype object for a new volume from a snapshot. + Volume *VolumePrototypeInstanceBySourceSnapshotContext `json:"volume" validate:"required"` } -// SetPlacementGroupPatch : Allow user to set PlacementGroupPatch -func (_options *UpdatePlacementGroupOptions) SetPlacementGroupPatch(placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - _options.PlacementGroupPatch = placementGroupPatch - return _options +// NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext : Instantiate VolumeAttachmentPrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume *VolumePrototypeInstanceBySourceSnapshotContext) (_model *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceBySourceSnapshotContext{ + Volume: volume, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetHeaders : Allow user to set Headers -func (options *UpdatePlacementGroupOptions) SetHeaders(param map[string]string) *UpdatePlacementGroupOptions { - options.Headers = param - return options +// UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceBySourceSnapshotContext) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdatePublicGatewayOptions : The UpdatePublicGateway options. -type UpdatePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` +// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct +type VolumeAttachmentPrototypeInstanceByVolumeContext struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - // The public gateway patch. - PublicGatewayPatch map[string]interface{} `json:"PublicGateway_patch" validate:"required"` + // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // An existing volume to attach. + Volume VolumeIdentityIntf `json:"volume" validate:"required"` } -// NewUpdatePublicGatewayOptions : Instantiate UpdatePublicGatewayOptions -func (*VpcV1) NewUpdatePublicGatewayOptions(id string, publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - return &UpdatePublicGatewayOptions{ - ID: core.StringPtr(id), - PublicGatewayPatch: publicGatewayPatch, +// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeIdentityIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ + Volume: volume, } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetID : Allow user to set ID -func (_options *UpdatePublicGatewayOptions) SetID(id string) *UpdatePublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPublicGatewayPatch : Allow user to set PublicGatewayPatch -func (_options *UpdatePublicGatewayOptions) SetPublicGatewayPatch(publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - _options.PublicGatewayPatch = publicGatewayPatch - return _options +// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) *UpdatePublicGatewayOptions { - options.Headers = param - return options -} +// VolumeAttachmentPrototypeVolume : An existing volume to attach to the instance, or a prototype object for a new volume. +// Models which "extend" this model: +// - VolumeAttachmentPrototypeVolumeVolumeIdentity +// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext +type VolumeAttachmentPrototypeVolume struct { + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` -// UpdateReservationOptions : The UpdateReservation options. -type UpdateReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` - // The reservation patch. - ReservationPatch map[string]interface{} `json:"Reservation_patch" validate:"required"` + // The URL for this volume. + Href *string `json:"href,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` -// NewUpdateReservationOptions : Instantiate UpdateReservationOptions -func (*VpcV1) NewUpdateReservationOptions(id string, reservationPatch map[string]interface{}) *UpdateReservationOptions { - return &UpdateReservationOptions{ - ID: core.StringPtr(id), - ReservationPatch: reservationPatch, - } -} + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetID : Allow user to set ID -func (_options *UpdateReservationOptions) SetID(id string) *UpdateReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + // use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` -// SetReservationPatch : Allow user to set ReservationPatch -func (_options *UpdateReservationOptions) SetReservationPatch(reservationPatch map[string]interface{}) *UpdateReservationOptions { - _options.ReservationPatch = reservationPatch - return _options -} + // The resource group to use for this volume. If unspecified, the instance's resource + // group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateReservationOptions) SetHeaders(param map[string]string) *UpdateReservationOptions { - options.Headers = param - return options -} + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` -// UpdateSecurityGroupOptions : The UpdateSecurityGroup options. -type UpdateSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` - // The security group patch. - SecurityGroupPatch map[string]interface{} `json:"SecurityGroup_patch" validate:"required"` + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` } -// NewUpdateSecurityGroupOptions : Instantiate UpdateSecurityGroupOptions -func (*VpcV1) NewUpdateSecurityGroupOptions(id string, securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - return &UpdateSecurityGroupOptions{ - ID: core.StringPtr(id), - SecurityGroupPatch: securityGroupPatch, - } +func (*VolumeAttachmentPrototypeVolume) isaVolumeAttachmentPrototypeVolume() bool { + return true } -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupOptions) SetID(id string) *UpdateSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options +type VolumeAttachmentPrototypeVolumeIntf interface { + isaVolumeAttachmentPrototypeVolume() bool } -// SetSecurityGroupPatch : Allow user to set SecurityGroupPatch -func (_options *UpdateSecurityGroupOptions) SetSecurityGroupPatch(securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - _options.SecurityGroupPatch = securityGroupPatch - return _options +// UnmarshalVolumeAttachmentPrototypeVolume unmarshals an instance of VolumeAttachmentPrototypeVolume from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeVolume) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupOptions { - options.Headers = param - return options -} +// VolumeAttachmentReferenceInstanceContext : VolumeAttachmentReferenceInstanceContext struct +type VolumeAttachmentReferenceInstanceContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeAttachmentReferenceInstanceContextDeleted `json:"deleted,omitempty"` -// UpdateSecurityGroupRuleOptions : The UpdateSecurityGroupRule options. -type UpdateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this volume attachment. + Href *string `json:"href" validate:"required"` - // The security group rule patch. - SecurityGroupRulePatch map[string]interface{} `json:"SecurityGroupRule_patch" validate:"required"` + // The unique identifier for this volume attachment. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this volume attachment. The name is unique across all volume attachments on the instance. + Name *string `json:"name" validate:"required"` + + // The attached volume. + // + // This property will be absent if the volume has not yet been provisioned. + Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` } -// NewUpdateSecurityGroupRuleOptions : Instantiate UpdateSecurityGroupRuleOptions -func (*VpcV1) NewUpdateSecurityGroupRuleOptions(securityGroupID string, id string, securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - return &UpdateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - SecurityGroupRulePatch: securityGroupRulePatch, +// UnmarshalVolumeAttachmentReferenceInstanceContext unmarshals an instance of VolumeAttachmentReferenceInstanceContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceInstanceContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceInstanceContextDeleted) + if err != nil { + return + } + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options +// VolumeAttachmentReferenceInstanceContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VolumeAttachmentReferenceInstanceContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupRuleOptions) SetID(id string) *UpdateSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVolumeAttachmentReferenceInstanceContextDeleted unmarshals an instance of VolumeAttachmentReferenceInstanceContextDeleted from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceInstanceContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupRulePatch : Allow user to set SecurityGroupRulePatch -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupRulePatch(securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupRulePatch = securityGroupRulePatch - return _options -} +// VolumeAttachmentReferenceVolumeContext : VolumeAttachmentReferenceVolumeContext struct +type VolumeAttachmentReferenceVolumeContext struct { + // Indicates whether deleting the instance will also delete the attached volume. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupRuleOptions { - options.Headers = param - return options -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeAttachmentReferenceVolumeContextDeleted `json:"deleted,omitempty"` -// UpdateShareMountTargetOptions : The UpdateShareMountTarget options. -type UpdateShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this volume attachment. + Href *string `json:"href" validate:"required"` - // The share mount target patch. - ShareMountTargetPatch map[string]interface{} `json:"ShareMountTarget_patch" validate:"required"` + // The unique identifier for this volume attachment. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The attached instance. + Instance *InstanceReference `json:"instance" validate:"required"` + + // The name for this volume attachment. The name is unique across all volume attachments on the instance. + Name *string `json:"name" validate:"required"` + + // The type of volume attachment. + Type *string `json:"type" validate:"required"` } -// NewUpdateShareMountTargetOptions : Instantiate UpdateShareMountTargetOptions -func (*VpcV1) NewUpdateShareMountTargetOptions(shareID string, id string, shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { - return &UpdateShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - ShareMountTargetPatch: shareMountTargetPatch, +// Constants associated with the VolumeAttachmentReferenceVolumeContext.Type property. +// The type of volume attachment. +const ( + VolumeAttachmentReferenceVolumeContextTypeBootConst = "boot" + VolumeAttachmentReferenceVolumeContextTypeDataConst = "data" +) + +// UnmarshalVolumeAttachmentReferenceVolumeContext unmarshals an instance of VolumeAttachmentReferenceVolumeContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceVolumeContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceVolumeContextDeleted) + if err != nil { + return + } + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetShareID : Allow user to set ShareID -func (_options *UpdateShareMountTargetOptions) SetShareID(shareID string) *UpdateShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options +// VolumeAttachmentReferenceVolumeContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VolumeAttachmentReferenceVolumeContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateShareMountTargetOptions) SetID(id string) *UpdateShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVolumeAttachmentReferenceVolumeContextDeleted unmarshals an instance of VolumeAttachmentReferenceVolumeContextDeleted from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceVolumeContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetShareMountTargetPatch : Allow user to set ShareMountTargetPatch -func (_options *UpdateShareMountTargetOptions) SetShareMountTargetPatch(shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { - _options.ShareMountTargetPatch = shareMountTargetPatch - return _options -} +// VolumeCollection : VolumeCollection struct +type VolumeCollection struct { + // A link to the first page of resources. + First *VolumeCollectionFirst `json:"first" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateShareMountTargetOptions) SetHeaders(param map[string]string) *UpdateShareMountTargetOptions { - options.Headers = param - return options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// UpdateShareOptions : The UpdateShare options. -type UpdateShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VolumeCollectionNext `json:"next,omitempty"` - // The file share patch. - SharePatch map[string]interface{} `json:"Share_patch" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // Collection of volumes. + Volumes []Volume `json:"volumes" validate:"required"` +} - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalVolumeCollection unmarshals an instance of VolumeCollection from the specified map of raw messages. +func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volumes", &obj.Volumes, UnmarshalVolume) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewUpdateShareOptions : Instantiate UpdateShareOptions -func (*VpcV1) NewUpdateShareOptions(id string, sharePatch map[string]interface{}) *UpdateShareOptions { - return &UpdateShareOptions{ - ID: core.StringPtr(id), - SharePatch: sharePatch, +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VolumeCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err } + return start, nil } -// SetID : Allow user to set ID -func (_options *UpdateShareOptions) SetID(id string) *UpdateShareOptions { - _options.ID = core.StringPtr(id) - return _options +// VolumeCollectionFirst : A link to the first page of resources. +type VolumeCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetSharePatch : Allow user to set SharePatch -func (_options *UpdateShareOptions) SetSharePatch(sharePatch map[string]interface{}) *UpdateShareOptions { - _options.SharePatch = sharePatch - return _options +// UnmarshalVolumeCollectionFirst unmarshals an instance of VolumeCollectionFirst from the specified map of raw messages. +func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateShareOptions) SetIfMatch(ifMatch string) *UpdateShareOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// VolumeCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VolumeCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateShareOptions) SetHeaders(param map[string]string) *UpdateShareOptions { - options.Headers = param - return options +// UnmarshalVolumeCollectionNext unmarshals an instance of VolumeCollectionNext from the specified map of raw messages. +func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateSnapshotOptions : The UpdateSnapshot options. -type UpdateSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The snapshot patch. - SnapshotPatch map[string]interface{} `json:"Snapshot_patch" validate:"required"` +// VolumeHealthReason : VolumeHealthReason struct +type VolumeHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` } -// NewUpdateSnapshotOptions : Instantiate UpdateSnapshotOptions -func (*VpcV1) NewUpdateSnapshotOptions(id string, snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - return &UpdateSnapshotOptions{ - ID: core.StringPtr(id), - SnapshotPatch: snapshotPatch, +// Constants associated with the VolumeHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + VolumeHealthReasonCodeInitializingFromSnapshotConst = "initializing_from_snapshot" +) + +// UnmarshalVolumeHealthReason unmarshals an instance of VolumeHealthReason from the specified map of raw messages. +func UnmarshalVolumeHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateSnapshotOptions) SetID(id string) *UpdateSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options +// VolumeIdentity : Identifies a volume by a unique property. +// Models which "extend" this model: +// - VolumeIdentityByID +// - VolumeIdentityByCRN +// - VolumeIdentityByHref +type VolumeIdentity struct { + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` + + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` + + // The URL for this volume. + Href *string `json:"href,omitempty"` } -// SetSnapshotPatch : Allow user to set SnapshotPatch -func (_options *UpdateSnapshotOptions) SetSnapshotPatch(snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - _options.SnapshotPatch = snapshotPatch - return _options +func (*VolumeIdentity) isaVolumeIdentity() bool { + return true } -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateSnapshotOptions) SetIfMatch(ifMatch string) *UpdateSnapshotOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +type VolumeIdentityIntf interface { + isaVolumeIdentity() bool } -// SetHeaders : Allow user to set Headers -func (options *UpdateSnapshotOptions) SetHeaders(param map[string]string) *UpdateSnapshotOptions { - options.Headers = param - return options +// UnmarshalVolumeIdentity unmarshals an instance of VolumeIdentity from the specified map of raw messages. +func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateSubnetOptions : The UpdateSubnet options. -type UpdateSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` +// VolumePatch : VolumePatch struct +type VolumePatch struct { + // The capacity to use for the volume (in gigabytes). The volume must be attached to a running virtual server instance, + // and the specified value must not be less than the current capacity. Additionally, if the volume is attached as a + // boot volume, the maximum value is 250 gigabytes. + // + // The minimum and maximum capacity limits for creating or updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` - // The subnet patch. - SubnetPatch map[string]interface{} `json:"Subnet_patch" validate:"required"` + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. + Iops *int64 `json:"iops,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this volume. The name must not be used by another volume in the region. + Name *string `json:"name,omitempty"` + + // The profile to use for this volume. The requested profile must be in the same + // `family` as the current profile. The volume must be attached as a data volume to + // a running virtual server instance, and must have a `capacity` within the range + // supported by the specified profile. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` } -// NewUpdateSubnetOptions : Instantiate UpdateSubnetOptions -func (*VpcV1) NewUpdateSubnetOptions(id string, subnetPatch map[string]interface{}) *UpdateSubnetOptions { - return &UpdateSubnetOptions{ - ID: core.StringPtr(id), - SubnetPatch: subnetPatch, +// UnmarshalVolumePatch unmarshals an instance of VolumePatch from the specified map of raw messages. +func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePatch) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateSubnetOptions) SetID(id string) *UpdateSubnetOptions { - _options.ID = core.StringPtr(id) - return _options +// AsPatch returns a generic map representation of the VolumePatch +func (volumePatch *VolumePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(volumePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetSubnetPatch : Allow user to set SubnetPatch -func (_options *UpdateSubnetOptions) SetSubnetPatch(subnetPatch map[string]interface{}) *UpdateSubnetOptions { - _options.SubnetPatch = subnetPatch - return _options +// VolumeProfile : VolumeProfile struct +type VolumeProfile struct { + // The product family this volume profile belongs to. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the + // unexpected property value was encountered. + Family *string `json:"family" validate:"required"` + + // The URL for this volume profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this volume profile. + Name *string `json:"name" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetOptions) SetHeaders(param map[string]string) *UpdateSubnetOptions { - options.Headers = param - return options +// Constants associated with the VolumeProfile.Family property. +// The product family this volume profile belongs to. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the +// unexpected property value was encountered. +const ( + VolumeProfileFamilyCustomConst = "custom" + VolumeProfileFamilyTieredConst = "tiered" +) + +// UnmarshalVolumeProfile unmarshals an instance of VolumeProfile from the specified map of raw messages. +func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfile) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateSubnetReservedIPOptions : The UpdateSubnetReservedIP options. -type UpdateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` +// VolumeProfileCollection : VolumeProfileCollection struct +type VolumeProfileCollection struct { + // A link to the first page of resources. + First *VolumeProfileCollectionFirst `json:"first" validate:"required"` - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The reserved IP patch. - ReservedIPPatch map[string]interface{} `json:"ReservedIP_patch" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VolumeProfileCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // Collection of volume profiles. + Profiles []VolumeProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewUpdateSubnetReservedIPOptions : Instantiate UpdateSubnetReservedIPOptions -func (*VpcV1) NewUpdateSubnetReservedIPOptions(subnetID string, id string, reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - return &UpdateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - ReservedIPPatch: reservedIPPatch, +// UnmarshalVolumeProfileCollection unmarshals an instance of VolumeProfileCollection from the specified map of raw messages. +func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeProfileCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalVolumeProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSubnetID : Allow user to set SubnetID -func (_options *UpdateSubnetReservedIPOptions) SetSubnetID(subnetID string) *UpdateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VolumeProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *UpdateSubnetReservedIPOptions) SetID(id string) *UpdateSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options +// VolumeProfileCollectionFirst : A link to the first page of resources. +type VolumeProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetReservedIPPatch : Allow user to set ReservedIPPatch -func (_options *UpdateSubnetReservedIPOptions) SetReservedIPPatch(reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - _options.ReservedIPPatch = reservedIPPatch - return _options +// UnmarshalVolumeProfileCollectionFirst unmarshals an instance of VolumeProfileCollectionFirst from the specified map of raw messages. +func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string) *UpdateSubnetReservedIPOptions { - options.Headers = param - return options +// VolumeProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VolumeProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UpdateVPCRouteResponse : UpdateVPCRouteResponse struct -type UpdateVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` +// UnmarshalVolumeProfileCollectionNext unmarshals an instance of VolumeProfileCollectionNext from the specified map of raw messages. +func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// VolumeProfileIdentity : Identifies a volume profile by a unique property. +// Models which "extend" this model: +// - VolumeProfileIdentityByName +// - VolumeProfileIdentityByHref +type VolumeProfileIdentity struct { + // The globally unique name for this volume profile. + Name *string `json:"name,omitempty"` - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` + // The URL for this volume profile. + Href *string `json:"href,omitempty"` +} - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` +func (*VolumeProfileIdentity) isaVolumeProfileIdentity() bool { + return true +} - // The URL for this route. - Href *string `json:"href" validate:"required"` +type VolumeProfileIdentityIntf interface { + isaVolumeProfileIdentity() bool +} - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` +// UnmarshalVolumeProfileIdentity unmarshals an instance of VolumeProfileIdentity from the specified map of raw messages. +func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// VolumeProfileReference : VolumeProfileReference struct +type VolumeProfileReference struct { + // The URL for this volume profile. + Href *string `json:"href" validate:"required"` - // The name for this route. The name is unique across all routes in the routing table. + // The globally unique name for this volume profile. Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the UpdateVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - UpdateVPCRouteResponseActionDelegateConst = "delegate" - UpdateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - UpdateVPCRouteResponseActionDeliverConst = "deliver" - UpdateVPCRouteResponseActionDropConst = "drop" -) - -// Constants associated with the UpdateVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - UpdateVPCRouteResponseLifecycleStateDeletingConst = "deleting" - UpdateVPCRouteResponseLifecycleStateFailedConst = "failed" - UpdateVPCRouteResponseLifecycleStatePendingConst = "pending" - UpdateVPCRouteResponseLifecycleStateStableConst = "stable" - UpdateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - UpdateVPCRouteResponseLifecycleStateUpdatingConst = "updating" - UpdateVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the UpdateVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - UpdateVPCRouteResponseOriginServiceConst = "service" - UpdateVPCRouteResponseOriginUserConst = "user" -) - -// UnmarshalUpdateVPCRouteResponse unmarshals an instance of UpdateVPCRouteResponse from the specified map of raw messages. -func UnmarshalUpdateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(UpdateVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalVolumeProfileReference unmarshals an instance of VolumeProfileReference from the specified map of raw messages. +func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumePrototype : VolumePrototype struct +// Models which "extend" this model: +// - VolumePrototypeVolumeByCapacity +// - VolumePrototypeVolumeBySourceSnapshot +type VolumePrototype struct { + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` + + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + // use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this volume will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` +} + +func (*VolumePrototype) isaVolumePrototype() bool { + return true +} + +type VolumePrototypeIntf interface { + isaVolumePrototype() bool +} + +// UnmarshalVolumePrototype unmarshals an instance of VolumePrototype from the specified map of raw messages. +func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototype) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -71743,606 +84282,859 @@ func UnmarshalUpdateVPCRouteResponse(m map[string]json.RawMessage, result interf return } -// UpdateVirtualNetworkInterfaceOptions : The UpdateVirtualNetworkInterface options. -type UpdateVirtualNetworkInterfaceOptions struct { - // The virtual network interface identifier. - ID *string `json:"id" validate:"required,ne="` +// VolumePrototypeInstanceByImageContext : VolumePrototypeInstanceByImageContext struct +type VolumePrototypeInstanceByImageContext struct { + // The capacity to use for the volume (in gigabytes). Must be at least the image's + // `minimum_provisioned_size`. The maximum value may increase in the future. + // + // If unspecified, the capacity will be the image's `minimum_provisioned_size`. + Capacity *int64 `json:"capacity,omitempty"` - // The virtual network interface patch. - VirtualNetworkInterfacePatch map[string]interface{} `json:"VirtualNetworkInterface_patch" validate:"required"` + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` -// NewUpdateVirtualNetworkInterfaceOptions : Instantiate UpdateVirtualNetworkInterfaceOptions -func (*VpcV1) NewUpdateVirtualNetworkInterfaceOptions(id string, virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { - return &UpdateVirtualNetworkInterfaceOptions{ - ID: core.StringPtr(id), - VirtualNetworkInterfacePatch: virtualNetworkInterfacePatch, - } -} + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetID : Allow user to set ID -func (_options *UpdateVirtualNetworkInterfaceOptions) SetID(id string) *UpdateVirtualNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + // use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` -// SetVirtualNetworkInterfacePatch : Allow user to set VirtualNetworkInterfacePatch -func (_options *UpdateVirtualNetworkInterfaceOptions) SetVirtualNetworkInterfacePatch(virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { - _options.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatch - return _options -} + // The resource group to use for this volume. If unspecified, the instance's resource + // group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateVirtualNetworkInterfaceOptions { - options.Headers = param - return options + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` } -// UpdateVolumeOptions : The UpdateVolume options. -type UpdateVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // The volume patch. - VolumePatch map[string]interface{} `json:"Volume_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// NewVolumePrototypeInstanceByImageContext : Instantiate VolumePrototypeInstanceByImageContext (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeInstanceByImageContext(profile VolumeProfileIdentityIntf) (_model *VolumePrototypeInstanceByImageContext, err error) { + _model = &VolumePrototypeInstanceByImageContext{ + Profile: profile, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// NewUpdateVolumeOptions : Instantiate UpdateVolumeOptions -func (*VpcV1) NewUpdateVolumeOptions(id string, volumePatch map[string]interface{}) *UpdateVolumeOptions { - return &UpdateVolumeOptions{ - ID: core.StringPtr(id), - VolumePatch: volumePatch, +// UnmarshalVolumePrototypeInstanceByImageContext unmarshals an instance of VolumePrototypeInstanceByImageContext from the specified map of raw messages. +func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateVolumeOptions) SetID(id string) *UpdateVolumeOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VolumePrototypeInstanceBySourceSnapshotContext : VolumePrototypeInstanceBySourceSnapshotContext struct +type VolumePrototypeInstanceBySourceSnapshotContext struct { + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. + // + // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. + Capacity *int64 `json:"capacity,omitempty"` -// SetVolumePatch : Allow user to set VolumePatch -func (_options *UpdateVolumeOptions) SetVolumePatch(volumePatch map[string]interface{}) *UpdateVolumeOptions { - _options.VolumePatch = volumePatch - return _options -} + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVolumeOptions) SetIfMatch(ifMatch string) *UpdateVolumeOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVolumeOptions) SetHeaders(param map[string]string) *UpdateVolumeOptions { - options.Headers = param - return options -} + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// UpdateVPCAddressPrefixOptions : The UpdateVPCAddressPrefix options. -type UpdateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + // use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group to use for this volume. If unspecified, the instance's resource + // group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The prefix patch. - AddressPrefixPatch map[string]interface{} `json:"AddressPrefix_patch" validate:"required"` + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` } -// NewUpdateVPCAddressPrefixOptions : Instantiate UpdateVPCAddressPrefixOptions -func (*VpcV1) NewUpdateVPCAddressPrefixOptions(vpcID string, id string, addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - return &UpdateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - AddressPrefixPatch: addressPrefixPatch, +// NewVolumePrototypeInstanceBySourceSnapshotContext : Instantiate VolumePrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeInstanceBySourceSnapshotContext(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeInstanceBySourceSnapshotContext, err error) { + _model = &VolumePrototypeInstanceBySourceSnapshotContext{ + Profile: profile, + SourceSnapshot: sourceSnapshot, } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCAddressPrefixOptions) SetVPCID(vpcID string) *UpdateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// UnmarshalVolumePrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumePrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. +func UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateVPCAddressPrefixOptions) SetID(id string) *UpdateVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VolumeReference : VolumeReference struct +type VolumeReference struct { + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` -// SetAddressPrefixPatch : Allow user to set AddressPrefixPatch -func (_options *UpdateVPCAddressPrefixOptions) SetAddressPrefixPatch(addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - _options.AddressPrefixPatch = addressPrefixPatch - return _options -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *UpdateVPCAddressPrefixOptions { - options.Headers = param - return options -} + // The URL for this volume. + Href *string `json:"href" validate:"required"` -// UpdateVPCDnsResolutionBindingOptions : The UpdateVPCDnsResolutionBinding options. -type UpdateVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // The unique identifier for this volume. + ID *string `json:"id" validate:"required"` - // The DNS resolution binding identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this volume. The name is unique across all volumes in the region. + Name *string `json:"name" validate:"required"` - // The DNS resolution binding patch. - VpcdnsResolutionBindingPatch map[string]interface{} `json:"VpcdnsResolutionBinding_patch" validate:"required"` + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *VolumeRemote `json:"remote,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewUpdateVPCDnsResolutionBindingOptions : Instantiate UpdateVPCDnsResolutionBindingOptions -func (*VpcV1) NewUpdateVPCDnsResolutionBindingOptions(vpcID string, id string, vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { - return &UpdateVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - VpcdnsResolutionBindingPatch: vpcdnsResolutionBindingPatch, +// Constants associated with the VolumeReference.ResourceType property. +// The resource type. +const ( + VolumeReferenceResourceTypeVolumeConst = "volume" +) + +// UnmarshalVolumeReference unmarshals an instance of VolumeReference from the specified map of raw messages. +func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *UpdateVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// VolumeReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VolumeReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateVPCDnsResolutionBindingOptions) SetID(id string) *UpdateVPCDnsResolutionBindingOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVolumeReferenceDeleted unmarshals an instance of VolumeReferenceDeleted from the specified map of raw messages. +func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVpcdnsResolutionBindingPatch : Allow user to set VpcdnsResolutionBindingPatch -func (_options *UpdateVPCDnsResolutionBindingOptions) SetVpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { - _options.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatch - return _options -} +// VolumeReferenceVolumeAttachmentContext : VolumeReferenceVolumeAttachmentContext struct +type VolumeReferenceVolumeAttachmentContext struct { + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *UpdateVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeReferenceVolumeAttachmentContextDeleted `json:"deleted,omitempty"` -// UpdateVPCOptions : The UpdateVPC options. -type UpdateVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this volume. + Href *string `json:"href" validate:"required"` - // The VPC patch. - VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` + // The unique identifier for this volume. + ID *string `json:"id" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // The name for this volume. The name is unique across all volumes in the region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewUpdateVPCOptions : Instantiate UpdateVPCOptions -func (*VpcV1) NewUpdateVPCOptions(id string, vpcPatch map[string]interface{}) *UpdateVPCOptions { - return &UpdateVPCOptions{ - ID: core.StringPtr(id), - VPCPatch: vpcPatch, - } -} +// Constants associated with the VolumeReferenceVolumeAttachmentContext.ResourceType property. +// The resource type. +const ( + VolumeReferenceVolumeAttachmentContextResourceTypeVolumeConst = "volume" +) -// SetID : Allow user to set ID -func (_options *UpdateVPCOptions) SetID(id string) *UpdateVPCOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVolumeReferenceVolumeAttachmentContext unmarshals an instance of VolumeReferenceVolumeAttachmentContext from the specified map of raw messages. +func UnmarshalVolumeReferenceVolumeAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReferenceVolumeAttachmentContext) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceVolumeAttachmentContextDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCPatch : Allow user to set VPCPatch -func (_options *UpdateVPCOptions) SetVPCPatch(vpcPatch map[string]interface{}) *UpdateVPCOptions { - _options.VPCPatch = vpcPatch - return _options +// VolumeReferenceVolumeAttachmentContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type VolumeReferenceVolumeAttachmentContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPCOptions) SetIfMatch(ifMatch string) *UpdateVPCOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// UnmarshalVolumeReferenceVolumeAttachmentContextDeleted unmarshals an instance of VolumeReferenceVolumeAttachmentContextDeleted from the specified map of raw messages. +func UnmarshalVolumeReferenceVolumeAttachmentContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReferenceVolumeAttachmentContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCOptions) SetHeaders(param map[string]string) *UpdateVPCOptions { - options.Headers = param - return options +// VolumeRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not +// be directly retrievable. +type VolumeRemote struct { + // If present, this property indicates that the referenced resource is remote to this + // region, and identifies the native region. + Region *RegionReference `json:"region,omitempty"` } -// UpdateVPCRouteOptions : The UpdateVPCRoute options. -type UpdateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// UnmarshalVolumeRemote unmarshals an instance of VolumeRemote from the specified map of raw messages. +func UnmarshalVolumeRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeRemote) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The route identifier. - ID *string `json:"id" validate:"required,ne="` +// VolumeStatusReason : VolumeStatusReason struct +type VolumeStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` - // The route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// NewUpdateVPCRouteOptions : Instantiate UpdateVPCRouteOptions -func (*VpcV1) NewUpdateVPCRouteOptions(vpcID string, id string, routePatch map[string]interface{}) *UpdateVPCRouteOptions { - return &UpdateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutePatch: routePatch, +// Constants associated with the VolumeStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + VolumeStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" +) + +// UnmarshalVolumeStatusReason unmarshals an instance of VolumeStatusReason from the specified map of raw messages. +func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRouteOptions) SetVPCID(vpcID string) *UpdateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// VpcdnsResolutionBindingCollectionFirst : A link to the first page of resources. +type VpcdnsResolutionBindingCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateVPCRouteOptions) SetID(id string) *UpdateVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVpcdnsResolutionBindingCollectionFirst unmarshals an instance of VpcdnsResolutionBindingCollectionFirst from the specified map of raw messages. +func UnmarshalVpcdnsResolutionBindingCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolutionBindingCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRouteOptions { - _options.RoutePatch = routePatch - return _options +// VpcdnsResolutionBindingCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VpcdnsResolutionBindingCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRouteOptions { - options.Headers = param - return options +// UnmarshalVpcdnsResolutionBindingCollectionNext unmarshals an instance of VpcdnsResolutionBindingCollectionNext from the specified map of raw messages. +func UnmarshalVpcdnsResolutionBindingCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolutionBindingCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateVPCRoutingTableOptions : The UpdateVPCRoutingTable options. -type UpdateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` +// Zone : Zone struct +type Zone struct { + // The URL for this zone. + Href *string `json:"href" validate:"required"` - // The routing table patch. - RoutingTablePatch map[string]interface{} `json:"RoutingTable_patch" validate:"required"` + // The globally unique name for this zone. + Name *string `json:"name" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // The region this zone resides in. + Region *RegionReference `json:"region" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The availability status of this zone. + Status *string `json:"status" validate:"required"` } -// NewUpdateVPCRoutingTableOptions : Instantiate UpdateVPCRoutingTableOptions -func (*VpcV1) NewUpdateVPCRoutingTableOptions(vpcID string, id string, routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - return &UpdateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutingTablePatch: routingTablePatch, +// Constants associated with the Zone.Status property. +// The availability status of this zone. +const ( + ZoneStatusAvailableConst = "available" + ZoneStatusImpairedConst = "impaired" + ZoneStatusUnavailableConst = "unavailable" +) + +// UnmarshalZone unmarshals an instance of Zone from the specified map of raw messages. +func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Zone) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// ZoneCollection : ZoneCollection struct +type ZoneCollection struct { + // Collection of zones. + Zones []Zone `json:"zones" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableOptions) SetID(id string) *UpdateVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalZoneCollection unmarshals an instance of ZoneCollection from the specified map of raw messages. +func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneCollection) + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZone) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoutingTablePatch : Allow user to set RoutingTablePatch -func (_options *UpdateVPCRoutingTableOptions) SetRoutingTablePatch(routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - _options.RoutingTablePatch = routingTablePatch - return _options -} +// ZoneIdentity : Identifies a zone by a unique property. +// Models which "extend" this model: +// - ZoneIdentityByName +// - ZoneIdentityByHref +type ZoneIdentity struct { + // The globally unique name for this zone. + Name *string `json:"name,omitempty"` -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPCRoutingTableOptions) SetIfMatch(ifMatch string) *UpdateVPCRoutingTableOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options + // The URL for this zone. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableOptions { - options.Headers = param - return options +func (*ZoneIdentity) isaZoneIdentity() bool { + return true } -// UpdateVPCRoutingTableRouteOptions : The UpdateVPCRoutingTableRoute options. -type UpdateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // The VPC routing table route identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPC route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type ZoneIdentityIntf interface { + isaZoneIdentity() bool } -// NewUpdateVPCRoutingTableRouteOptions : Instantiate UpdateVPCRoutingTableRouteOptions -func (*VpcV1) NewUpdateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string, routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - return &UpdateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), - RoutePatch: routePatch, +// UnmarshalZoneIdentity unmarshals an instance of ZoneIdentity from the specified map of raw messages. +func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *UpdateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} +// ZoneReference : ZoneReference struct +type ZoneReference struct { + // The URL for this zone. + Href *string `json:"href" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableRouteOptions) SetID(id string) *UpdateVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) - return _options + // The globally unique name for this zone. + Name *string `json:"name" validate:"required"` } -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - _options.RoutePatch = routePatch - return _options +// UnmarshalZoneReference unmarshals an instance of ZoneReference from the specified map of raw messages. +func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableRouteOptions { - options.Headers = param - return options -} +// BackupPolicyJobSourceInstanceReference : BackupPolicyJobSourceInstanceReference struct +// This model "extends" BackupPolicyJobSource +type BackupPolicyJobSourceInstanceReference struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` -// UpdateVPNGatewayConnectionOptions : The UpdateVPNGatewayConnection options. -type UpdateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` - // The VPN gateway connection patch. - VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. + Name *string `json:"name" validate:"required"` } -// NewUpdateVPNGatewayConnectionOptions : Instantiate UpdateVPNGatewayConnectionOptions -func (*VpcV1) NewUpdateVPNGatewayConnectionOptions(vpnGatewayID string, id string, vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - return &UpdateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - VPNGatewayConnectionPatch: vpnGatewayConnectionPatch, - } +func (*BackupPolicyJobSourceInstanceReference) isaBackupPolicyJobSource() bool { + return true } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +// UnmarshalBackupPolicyJobSourceInstanceReference unmarshals an instance of BackupPolicyJobSourceInstanceReference from the specified map of raw messages. +func UnmarshalBackupPolicyJobSourceInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobSourceInstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayConnectionOptions) SetID(id string) *UpdateVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) - return _options -} +// BackupPolicyJobSourceVolumeReference : BackupPolicyJobSourceVolumeReference struct +// This model "extends" BackupPolicyJobSource +type BackupPolicyJobSourceVolumeReference struct { + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` -// SetVPNGatewayConnectionPatch : Allow user to set VPNGatewayConnectionPatch -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch(vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch - return _options -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { - options.Headers = param - return options -} + // The URL for this volume. + Href *string `json:"href" validate:"required"` -// UpdateVPNGatewayOptions : The UpdateVPNGateway options. -type UpdateVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this volume. + ID *string `json:"id" validate:"required"` - // The VPN gateway patch. - VPNGatewayPatch map[string]interface{} `json:"VPNGateway_patch" validate:"required"` + // The name for this volume. The name is unique across all volumes in the region. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // If present, this property indicates that the resource associated with this reference + // is remote and therefore may not be directly retrievable. + Remote *VolumeRemote `json:"remote,omitempty"` -// NewUpdateVPNGatewayOptions : Instantiate UpdateVPNGatewayOptions -func (*VpcV1) NewUpdateVPNGatewayOptions(id string, vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - return &UpdateVPNGatewayOptions{ - ID: core.StringPtr(id), - VPNGatewayPatch: vpnGatewayPatch, - } + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayOptions) SetID(id string) *UpdateVPNGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the BackupPolicyJobSourceVolumeReference.ResourceType property. +// The resource type. +const ( + BackupPolicyJobSourceVolumeReferenceResourceTypeVolumeConst = "volume" +) -// SetVPNGatewayPatch : Allow user to set VPNGatewayPatch -func (_options *UpdateVPNGatewayOptions) SetVPNGatewayPatch(vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - _options.VPNGatewayPatch = vpnGatewayPatch - return _options +func (*BackupPolicyJobSourceVolumeReference) isaBackupPolicyJobSource() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayOptions { - options.Headers = param - return options +// UnmarshalBackupPolicyJobSourceVolumeReference unmarshals an instance of BackupPolicyJobSourceVolumeReference from the specified map of raw messages. +func UnmarshalBackupPolicyJobSourceVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobSourceVolumeReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateVPNServerOptions : The UpdateVPNServer options. -type UpdateVPNServerOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN server patch. - VPNServerPatch map[string]interface{} `json:"VPNServer_patch" validate:"required"` +// BackupPolicyMatchResourceTypeInstance : BackupPolicyMatchResourceTypeInstance struct +// This model "extends" BackupPolicy +type BackupPolicyMatchResourceTypeInstance struct { + // The date and time that the backup policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` + // The CRN for this backup policy. + CRN *string `json:"crn" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The reasons for the current `health_state` (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` -// NewUpdateVPNServerOptions : Instantiate UpdateVPNServerOptions -func (*VpcV1) NewUpdateVPNServerOptions(id string, vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { - return &UpdateVPNServerOptions{ - ID: core.StringPtr(id), - VPNServerPatch: vpnServerPatch, - } -} + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateVPNServerOptions) SetID(id string) *UpdateVPNServerOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The URL for this backup policy. + Href *string `json:"href" validate:"required"` -// SetVPNServerPatch : Allow user to set VPNServerPatch -func (_options *UpdateVPNServerOptions) SetVPNServerPatch(vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { - _options.VPNServerPatch = vpnServerPatch - return _options -} + // The unique identifier for this backup policy. + ID *string `json:"id" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPNServerOptions) SetIfMatch(ifMatch string) *UpdateVPNServerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // The date and time that the most recent job for this backup policy completed. + // + // If absent, no job has yet completed for this backup policy. + LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNServerOptions) SetHeaders(param map[string]string) *UpdateVPNServerOptions { - options.Headers = param - return options -} + // The lifecycle state of the backup policy. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// UpdateVPNServerRouteOptions : The UpdateVPNServerRoute options. -type UpdateVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` + // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will + // be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` - // The VPN route identifier. - ID *string `json:"id" validate:"required,ne="` + // The name for this backup policy. The name is unique across all backup policies in the region. + Name *string `json:"name" validate:"required"` - // The VPN route patch. - VPNServerRoutePatch map[string]interface{} `json:"VPNServerRoute_patch" validate:"required"` + // The plans for the backup policy. + Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource group for this backup policy. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// NewUpdateVPNServerRouteOptions : Instantiate UpdateVPNServerRouteOptions -func (*VpcV1) NewUpdateVPNServerRouteOptions(vpnServerID string, id string, vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { - return &UpdateVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - VPNServerRoutePatch: vpnServerRoutePatch, - } -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// SetVPNServerID : Allow user to set VPNServerID -func (_options *UpdateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *UpdateVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} + Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateVPNServerRouteOptions) SetID(id string) *UpdateVPNServerRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The included content for backups created using this policy: + // - `boot_volume`: Include the instance's boot volume. + // - `data_volumes`: Include the instance's data volumes. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the + // unexpected property value was encountered. + IncludedContent []string `json:"included_content" validate:"required"` -// SetVPNServerRoutePatch : Allow user to set VPNServerRoutePatch -func (_options *UpdateVPNServerRouteOptions) SetVPNServerRoutePatch(vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { - _options.VPNServerRoutePatch = vpnServerRoutePatch - return _options + // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the + // unexpected property value was encountered. + MatchResourceType *string `json:"match_resource_type" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNServerRouteOptions) SetHeaders(param map[string]string) *UpdateVPNServerRouteOptions { - options.Headers = param - return options -} +// Constants associated with the BackupPolicyMatchResourceTypeInstance.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + BackupPolicyMatchResourceTypeInstanceHealthStateDegradedConst = "degraded" + BackupPolicyMatchResourceTypeInstanceHealthStateFaultedConst = "faulted" + BackupPolicyMatchResourceTypeInstanceHealthStateInapplicableConst = "inapplicable" + BackupPolicyMatchResourceTypeInstanceHealthStateOkConst = "ok" +) -// Vcpu : The VCPU configuration. -type Vcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` +// Constants associated with the BackupPolicyMatchResourceTypeInstance.LifecycleState property. +// The lifecycle state of the backup policy. +const ( + BackupPolicyMatchResourceTypeInstanceLifecycleStateDeletingConst = "deleting" + BackupPolicyMatchResourceTypeInstanceLifecycleStateFailedConst = "failed" + BackupPolicyMatchResourceTypeInstanceLifecycleStatePendingConst = "pending" + BackupPolicyMatchResourceTypeInstanceLifecycleStateStableConst = "stable" + BackupPolicyMatchResourceTypeInstanceLifecycleStateSuspendedConst = "suspended" + BackupPolicyMatchResourceTypeInstanceLifecycleStateUpdatingConst = "updating" + BackupPolicyMatchResourceTypeInstanceLifecycleStateWaitingConst = "waiting" +) - // The number of VCPUs assigned. - Count *int64 `json:"count" validate:"required"` +// Constants associated with the BackupPolicyMatchResourceTypeInstance.ResourceType property. +// The resource type. +const ( + BackupPolicyMatchResourceTypeInstanceResourceTypeBackupPolicyConst = "backup_policy" +) - // The VCPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` +// Constants associated with the BackupPolicyMatchResourceTypeInstance.IncludedContent property. +// An item to include. +const ( + BackupPolicyMatchResourceTypeInstanceIncludedContentBootVolumeConst = "boot_volume" + BackupPolicyMatchResourceTypeInstanceIncludedContentDataVolumesConst = "data_volumes" +) + +// Constants associated with the BackupPolicyMatchResourceTypeInstance.MatchResourceType property. +// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected +// property value was encountered. +const ( + BackupPolicyMatchResourceTypeInstanceMatchResourceTypeInstanceConst = "instance" +) + +func (*BackupPolicyMatchResourceTypeInstance) isaBackupPolicy() bool { + return true } -// UnmarshalVcpu unmarshals an instance of Vcpu from the specified map of raw messages. -func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Vcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) +// UnmarshalBackupPolicyMatchResourceTypeInstance unmarshals an instance of BackupPolicyMatchResourceTypeInstance from the specified map of raw messages. +func UnmarshalBackupPolicyMatchResourceTypeInstance(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyMatchResourceTypeInstance) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { return } @@ -72350,43 +85142,21 @@ func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) return } -// VPC : VPC struct -type VPC struct { - // Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private - // network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected - // in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access" validate:"required"` - - // The date and time that the VPC was created. +// BackupPolicyMatchResourceTypeVolume : BackupPolicyMatchResourceTypeVolume struct +// This model "extends" BackupPolicy +type BackupPolicyMatchResourceTypeVolume struct { + // The date and time that the backup policy was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this VPC. + // The CRN for this backup policy. CRN *string `json:"crn" validate:"required"` - // The CSE ([Cloud Service Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) source IP - // addresses for the VPC. The VPC will have one CSE source IP address per zone. - CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` - - // The default network ACL to use for subnets created in this VPC. - DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` - - // The default routing table to use for subnets created in this VPC. - DefaultRoutingTable *RoutingTableReference `json:"default_routing_table" validate:"required"` - - // The default security group for this VPC. Resources created in this VPC that allow - // a security group to be optionally specified will use this security group by - // default. - DefaultSecurityGroup *SecurityGroupReference `json:"default_security_group" validate:"required"` - - // The DNS configuration for this VPC. - Dns *Vpcdns `json:"dns" validate:"required"` - // The reasons for the current `health_state` (if any). // // The enumerated reason code values for this property will expand in the future. When processing this property, check // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the // unexpected reason code was encountered. - HealthReasons []VPCHealthReason `json:"health_reasons" validate:"required"` + HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` // The health of this resource. // - `ok`: No abnormal behavior detected @@ -72397,26 +85167,48 @@ type VPC struct { // have this state. HealthState *string `json:"health_state" validate:"required"` - // The URL for this VPC. + // The URL for this backup policy. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPC. + // The unique identifier for this backup policy. ID *string `json:"id" validate:"required"` - // The name for this VPC. The name is unique across all VPCs in the region. + // The date and time that the most recent job for this backup policy completed. + // + // If absent, no job has yet completed for this backup policy. + LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` + + // The lifecycle state of the backup policy. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will + // be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` + + // The name for this backup policy. The name is unique across all backup policies in the region. Name *string `json:"name" validate:"required"` - // The resource group for this VPC. + // The plans for the backup policy. + Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` + + // The resource group for this backup policy. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of this VPC. - Status *string `json:"status" validate:"required"` + Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` + + // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the + // unexpected property value was encountered. + MatchResourceType *string `json:"match_resource_type" validate:"required"` } -// Constants associated with the VPC.HealthState property. +// Constants associated with the BackupPolicyMatchResourceTypeVolume.HealthState property. // The health of this resource. // - `ok`: No abnormal behavior detected // - `degraded`: Experiencing compromised performance, capacity, or connectivity @@ -72425,34 +85217,48 @@ type VPC struct { // state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this // state. const ( - VPCHealthStateDegradedConst = "degraded" - VPCHealthStateFaultedConst = "faulted" - VPCHealthStateInapplicableConst = "inapplicable" - VPCHealthStateOkConst = "ok" + BackupPolicyMatchResourceTypeVolumeHealthStateDegradedConst = "degraded" + BackupPolicyMatchResourceTypeVolumeHealthStateFaultedConst = "faulted" + BackupPolicyMatchResourceTypeVolumeHealthStateInapplicableConst = "inapplicable" + BackupPolicyMatchResourceTypeVolumeHealthStateOkConst = "ok" ) -// Constants associated with the VPC.ResourceType property. +// Constants associated with the BackupPolicyMatchResourceTypeVolume.LifecycleState property. +// The lifecycle state of the backup policy. +const ( + BackupPolicyMatchResourceTypeVolumeLifecycleStateDeletingConst = "deleting" + BackupPolicyMatchResourceTypeVolumeLifecycleStateFailedConst = "failed" + BackupPolicyMatchResourceTypeVolumeLifecycleStatePendingConst = "pending" + BackupPolicyMatchResourceTypeVolumeLifecycleStateStableConst = "stable" + BackupPolicyMatchResourceTypeVolumeLifecycleStateSuspendedConst = "suspended" + BackupPolicyMatchResourceTypeVolumeLifecycleStateUpdatingConst = "updating" + BackupPolicyMatchResourceTypeVolumeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the BackupPolicyMatchResourceTypeVolume.ResourceType property. // The resource type. const ( - VPCResourceTypeVPCConst = "vpc" + BackupPolicyMatchResourceTypeVolumeResourceTypeBackupPolicyConst = "backup_policy" ) -// Constants associated with the VPC.Status property. -// The status of this VPC. +// Constants associated with the BackupPolicyMatchResourceTypeVolume.MatchResourceType property. +// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected +// property value was encountered. const ( - VPCStatusAvailableConst = "available" - VPCStatusDeletingConst = "deleting" - VPCStatusFailedConst = "failed" - VPCStatusPendingConst = "pending" + BackupPolicyMatchResourceTypeVolumeMatchResourceTypeVolumeConst = "volume" ) -// UnmarshalVPC unmarshals an instance of VPC from the specified map of raw messages. -func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPC) - err = core.UnmarshalPrimitive(m, "classic_access", &obj.ClassicAccess) - if err != nil { - return - } +func (*BackupPolicyMatchResourceTypeVolume) isaBackupPolicy() bool { + return true +} + +// UnmarshalBackupPolicyMatchResourceTypeVolume unmarshals an instance of BackupPolicyMatchResourceTypeVolume from the specified map of raw messages. +func UnmarshalBackupPolicyMatchResourceTypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyMatchResourceTypeVolume) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -72461,55 +85267,55 @@ func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) if err != nil { return } - err = core.UnmarshalModel(m, "cse_source_ips", &obj.CseSourceIps, UnmarshalVpccseSourceIP) + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) if err != nil { return } - err = core.UnmarshalModel(m, "default_network_acl", &obj.DefaultNetworkACL, UnmarshalNetworkACLReference) + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { return } - err = core.UnmarshalModel(m, "default_routing_table", &obj.DefaultRoutingTable, UnmarshalRoutingTableReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "default_security_group", &obj.DefaultSecurityGroup, UnmarshalSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdns) + err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) if err != nil { return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPCHealthReason) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { return } @@ -72517,23 +85323,90 @@ func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) return } -// VpccseSourceIP : VpccseSourceIP struct -type VpccseSourceIP struct { - // The cloud service endpoint source IP address for this zone. - IP *IP `json:"ip" validate:"required"` +// BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype : BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype struct +// This model "extends" BackupPolicyPrototype +type BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype struct { + // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type + // will be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` - // The zone this cloud service endpoint source IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The prototype objects for backup plans to be created for this backup policy. + Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` + + // The included content for backups created using this policy: + // - `boot_volume`: Include the instance's boot volume. + // - `data_volumes`: Include the instance's data volumes. + IncludedContent []string `json:"included_content,omitempty"` + + // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + MatchResourceType *string `json:"match_resource_type" validate:"required"` } -// UnmarshalVpccseSourceIP unmarshals an instance of VpccseSourceIP from the specified map of raw messages. -func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpccseSourceIP) - err = core.UnmarshalModel(m, "ip", &obj.IP, UnmarshalIP) +// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.IncludedContent property. +// An item to include. +const ( + BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeIncludedContentBootVolumeConst = "boot_volume" + BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeIncludedContentDataVolumesConst = "data_volumes" +) + +// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.MatchResourceType property. +// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. +const ( + BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeMatchResourceTypeInstanceConst = "instance" +) + +// NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype : Instantiate BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(matchUserTags []string, matchResourceType string) (_model *BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype, err error) { + _model = &BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype{ + MatchUserTags: matchUserTags, + MatchResourceType: core.StringPtr(matchResourceType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype) isaBackupPolicyPrototype() bool { + return true +} + +// UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype unmarshals an instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype) + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { return } @@ -72541,45 +85414,74 @@ func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) ( return } -// VPCCollection : VPCCollection struct -type VPCCollection struct { - // A link to the first page of resources. - First *VPCCollectionFirst `json:"first" validate:"required"` +// BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype : BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype struct +// This model "extends" BackupPolicyPrototype +type BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype struct { + // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type + // will be subject to the backup policy. + MatchUserTags []string `json:"match_user_tags" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPCCollectionNext `json:"next,omitempty"` + // The prototype objects for backup plans to be created for this backup policy. + Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // Collection of VPCs. - Vpcs []VPC `json:"vpcs" validate:"required"` + Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` + + // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag + // will be subject to the backup policy. + MatchResourceType *string `json:"match_resource_type" validate:"required"` } -// UnmarshalVPCCollection unmarshals an instance of VPCCollection from the specified map of raw messages. -func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPCCollectionFirst) +// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.MatchResourceType property. +// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag +// will be subject to the backup policy. +const ( + BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototypeMatchResourceTypeVolumeConst = "volume" +) + +// NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype : Instantiate BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(matchUserTags []string, matchResourceType string) (_model *BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype, err error) { + _model = &BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype{ + MatchUserTags: matchUserTags, + MatchResourceType: core.StringPtr(matchResourceType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype) isaBackupPolicyPrototype() bool { + return true +} + +// UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype unmarshals an instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype from the specified map of raw messages. +func UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype) + err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPCCollectionNext) + err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "vpcs", &obj.Vpcs, UnmarshalVPC) + err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) if err != nil { return } @@ -72587,45 +85489,32 @@ func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (e return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPCCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// BackupPolicyScopePrototypeEnterpriseIdentity : Identifies an enterprise by a unique property. +// Models which "extend" this model: +// - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN +// This model "extends" BackupPolicyScopePrototype +type BackupPolicyScopePrototypeEnterpriseIdentity struct { + // The CRN for this enterprise. + CRN *string `json:"crn,omitempty"` } -// VPCCollectionFirst : A link to the first page of resources. -type VPCCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { + return true } -// UnmarshalVPCCollectionFirst unmarshals an instance of VPCCollectionFirst from the specified map of raw messages. -func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +type BackupPolicyScopePrototypeEnterpriseIdentityIntf interface { + BackupPolicyScopePrototypeIntf + isaBackupPolicyScopePrototypeEnterpriseIdentity() bool } -// VPCCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPCCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototype() bool { + return true } -// UnmarshalVPCCollectionNext unmarshals an instance of VPCCollectionNext from the specified map of raw messages. -func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentity from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototypeEnterpriseIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -72633,58 +85522,34 @@ func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{} return } -// Vpcdns : The DNS configuration for this VPC. -type Vpcdns struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - EnableHub *bool `json:"enable_hub" validate:"required"` - - // The number of DNS resolution bindings for this VPC. - ResolutionBindingCount *int64 `json:"resolution_binding_count" validate:"required"` - - // The DNS resolver configuration for the VPC. - Resolver VpcdnsResolverIntf `json:"resolver" validate:"required"` -} +// BackupPolicyScopeAccountReference : BackupPolicyScopeAccountReference struct +// This model "extends" BackupPolicyScope +type BackupPolicyScopeAccountReference struct { + // The unique identifier for this account. + ID *string `json:"id" validate:"required"` -// UnmarshalVpcdns unmarshals an instance of Vpcdns from the specified map of raw messages. -func UnmarshalVpcdns(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Vpcdns) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resolution_binding_count", &obj.ResolutionBindingCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolver) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// VpcdnsPatch : The DNS configuration for this VPC. -type VpcdnsPatch struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - // - // Updating the value to `true` requires `allow_dns_resolution_binding` to be `true` for all endpoint gateways residing - // in this VPC. - // - // Changing the value requires `dns.resolution_binding_count` to be zero. - EnableHub *bool `json:"enable_hub,omitempty"` +// Constants associated with the BackupPolicyScopeAccountReference.ResourceType property. +// The resource type. +const ( + BackupPolicyScopeAccountReferenceResourceTypeAccountConst = "account" +) - Resolver *VpcdnsResolverPatch `json:"resolver,omitempty"` +func (*BackupPolicyScopeAccountReference) isaBackupPolicyScope() bool { + return true } -// UnmarshalVpcdnsPatch unmarshals an instance of VpcdnsPatch from the specified map of raw messages. -func UnmarshalVpcdnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsPatch) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) +// UnmarshalBackupPolicyScopeAccountReference unmarshals an instance of BackupPolicyScopeAccountReference from the specified map of raw messages. +func UnmarshalBackupPolicyScopeAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopeAccountReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPatch) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -72692,25 +85557,41 @@ func UnmarshalVpcdnsPatch(m map[string]json.RawMessage, result interface{}) (err return } -// VpcdnsPrototype : The DNS configuration for this VPC. -// -// If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint gateways within this VPC, -// and hosts on the internet. -type VpcdnsPrototype struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - EnableHub *bool `json:"enable_hub,omitempty"` +// BackupPolicyScopeEnterpriseReference : BackupPolicyScopeEnterpriseReference struct +// This model "extends" BackupPolicyScope +type BackupPolicyScopeEnterpriseReference struct { + // The CRN for this enterprise. + CRN *string `json:"crn" validate:"required"` + + // The unique identifier for this enterprise. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} - Resolver VpcdnsResolverPrototypeIntf `json:"resolver,omitempty"` +// Constants associated with the BackupPolicyScopeEnterpriseReference.ResourceType property. +// The resource type. +const ( + BackupPolicyScopeEnterpriseReferenceResourceTypeEnterpriseConst = "enterprise" +) + +func (*BackupPolicyScopeEnterpriseReference) isaBackupPolicyScope() bool { + return true } -// UnmarshalVpcdnsPrototype unmarshals an instance of VpcdnsPrototype from the specified map of raw messages. -func UnmarshalVpcdnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsPrototype) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) +// UnmarshalBackupPolicyScopeEnterpriseReference unmarshals an instance of BackupPolicyScopeEnterpriseReference from the specified map of raw messages. +func UnmarshalBackupPolicyScopeEnterpriseReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopeEnterpriseReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -72718,64 +85599,40 @@ func UnmarshalVpcdnsPrototype(m map[string]json.RawMessage, result interface{}) return } -// VpcdnsResolutionBinding : VpcdnsResolutionBinding struct -type VpcdnsResolutionBinding struct { - // The date and time that the DNS resolution binding was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The endpoint gateways that have `allow_dns_resolution_binding` set to `true` and reside in the VPC that has - // `dns.enable_hub` set to `false`. - // - // The endpoint gateways may be remote and therefore may not be directly retrievable. - EndpointGateways []EndpointGatewayReferenceRemote `json:"endpoint_gateways" validate:"required"` +// BareMetalServerBootTargetBareMetalServerDiskReference : BareMetalServerBootTargetBareMetalServerDiskReference struct +// This model "extends" BareMetalServerBootTarget +type BareMetalServerBootTargetBareMetalServerDiskReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - // The URL for this DNS resolution binding. + // The URL for this bare metal server disk. Href *string `json:"href" validate:"required"` - // The unique identifier for this DNS resolution binding. + // The unique identifier for this bare metal server disk. ID *string `json:"id" validate:"required"` - // The lifecycle state of the DNS resolution binding. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC. + // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - - // The VPC bound to for DNS resolution. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceRemote `json:"vpc" validate:"required"` } -// Constants associated with the VpcdnsResolutionBinding.LifecycleState property. -// The lifecycle state of the DNS resolution binding. -const ( - VpcdnsResolutionBindingLifecycleStateDeletingConst = "deleting" - VpcdnsResolutionBindingLifecycleStateFailedConst = "failed" - VpcdnsResolutionBindingLifecycleStatePendingConst = "pending" - VpcdnsResolutionBindingLifecycleStateStableConst = "stable" - VpcdnsResolutionBindingLifecycleStateSuspendedConst = "suspended" - VpcdnsResolutionBindingLifecycleStateUpdatingConst = "updating" - VpcdnsResolutionBindingLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VpcdnsResolutionBinding.ResourceType property. +// Constants associated with the BareMetalServerBootTargetBareMetalServerDiskReference.ResourceType property. // The resource type. const ( - VpcdnsResolutionBindingResourceTypeVPCDnsResolutionBindingConst = "vpc_dns_resolution_binding" + BareMetalServerBootTargetBareMetalServerDiskReferenceResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" ) -// UnmarshalVpcdnsResolutionBinding unmarshals an instance of VpcdnsResolutionBinding from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBinding(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBinding) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGatewayReferenceRemote) +func (*BareMetalServerBootTargetBareMetalServerDiskReference) isaBareMetalServerBootTarget() bool { + return true +} + +// UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference unmarshals an instance of BareMetalServerBootTargetBareMetalServerDiskReference from the specified map of raw messages. +func UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerBootTargetBareMetalServerDiskReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) if err != nil { return } @@ -72787,10 +85644,6 @@ func UnmarshalVpcdnsResolutionBinding(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -72799,53 +85652,52 @@ func UnmarshalVpcdnsResolutionBinding(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceRemote) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VpcdnsResolutionBindingCollection : VpcdnsResolutionBindingCollection struct -type VpcdnsResolutionBindingCollection struct { - // Collection of DNS resolution bindings for this VPC. - DnsResolutionBindings []VpcdnsResolutionBinding `json:"dns_resolution_bindings" validate:"required"` +// BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount : BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct +// This model "extends" BareMetalServerInitializationUserAccount +type BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct { + // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` - // A link to the first page of resources. - First *VpcdnsResolutionBindingCollectionFirst `json:"first" validate:"required"` + // The public SSH key used to encrypt the password. + EncryptionKey *KeyReference `json:"encryption_key" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VpcdnsResolutionBindingCollectionNext `json:"next,omitempty"` + // The username for the account created at initialization. + Username *string `json:"username" validate:"required"` +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// Constants associated with the BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.ResourceType property. +// The resource type. +const ( + BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccountResourceTypeHostUserAccountConst = "host_user_account" +) + +func (*BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) isaBareMetalServerInitializationUserAccount() bool { + return true } -// UnmarshalVpcdnsResolutionBindingCollection unmarshals an instance of VpcdnsResolutionBindingCollection from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollection) - err = core.UnmarshalModel(m, "dns_resolution_bindings", &obj.DnsResolutionBindings, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVpcdnsResolutionBindingCollectionFirst) +// UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount unmarshals an instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVpcdnsResolutionBindingCollectionNext) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "username", &obj.Username) if err != nil { return } @@ -72853,246 +85705,129 @@ func UnmarshalVpcdnsResolutionBindingCollection(m map[string]json.RawMessage, re return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VpcdnsResolutionBindingCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} +// BareMetalServerNetworkAttachmentByPci : BareMetalServerNetworkAttachmentByPci struct +// This model "extends" BareMetalServerNetworkAttachment +type BareMetalServerNetworkAttachmentByPci struct { + // The date and time that the bare metal server network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// VpcdnsResolutionBindingPatch : VpcdnsResolutionBindingPatch struct -type VpcdnsResolutionBindingPatch struct { - // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. - Name *string `json:"name,omitempty"` -} + // The URL for this bare metal server network attachment. + Href *string `json:"href" validate:"required"` -// UnmarshalVpcdnsResolutionBindingPatch unmarshals an instance of VpcdnsResolutionBindingPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The unique identifier for this bare metal server network attachment. + ID *string `json:"id" validate:"required"` -// AsPatch returns a generic map representation of the VpcdnsResolutionBindingPatch -func (vpcdnsResolutionBindingPatch *VpcdnsResolutionBindingPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpcdnsResolutionBindingPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} + // The lifecycle state of the bare metal server network attachment. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// VpcdnsResolver : VpcdnsResolver struct -// Models which "extend" this model: -// - VpcdnsResolverTypeDelegated -// - VpcdnsResolverTypeManual -// - VpcdnsResolverTypeSystem -type VpcdnsResolver struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` + // The name for this bare metal server network attachment. The name is unique across all network attachments for the + // bare metal server. + Name *string `json:"name" validate:"required"` - // The type of the DNS resolver used for the VPC. - // - // - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC - // specified in `dns.resolver.vpc`. - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses are provided by the system. + // The port speed for this bare metal server network attachment in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + // The primary IP address of the virtual network interface for the bare metal server network attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the bare metal server network attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The bare metal server network attachment type. Type *string `json:"type" validate:"required"` - // The VPC whose DNS resolver provides the DNS server addresses for this VPC. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceDnsResolverContext `json:"vpc,omitempty"` + // The virtual network interface for this bare metal server network attachment. + VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` - // The manually specified DNS servers for this VPC. - // - // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the - // affinity for that zone first, followed by the unique DNS servers from other zones. - // - // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServer `json:"manual_servers,omitempty"` + // The VLAN IDs allowed for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` - // The configuration of the system DNS resolver for this VPC. - // - // - `custom_resolver`: A custom DNS resolver is configured for this VPC. - // - // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when - // the VPC has either or both of the following: - // - // - at least one endpoint gateway residing in it - // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it - // - // - `default`: The provider default DNS resolvers are configured for this VPC. - // - // This system DNS resolver configuration is used when the VPC has: - // - // - no custom DNS resolver configured for it, and - // - no endpoint gateways residing in it, and - // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. - Configuration *string `json:"configuration,omitempty"` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + InterfaceType *string `json:"interface_type" validate:"required"` } -// Constants associated with the VpcdnsResolver.Type property. -// The type of the DNS resolver used for the VPC. -// -// - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC -// specified in `dns.resolver.vpc`. -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses are provided by the system. +// Constants associated with the BareMetalServerNetworkAttachmentByPci.LifecycleState property. +// The lifecycle state of the bare metal server network attachment. const ( - VpcdnsResolverTypeDelegatedConst = "delegated" - VpcdnsResolverTypeManualConst = "manual" - VpcdnsResolverTypeSystemConst = "system" + BareMetalServerNetworkAttachmentByPciLifecycleStateDeletingConst = "deleting" + BareMetalServerNetworkAttachmentByPciLifecycleStateFailedConst = "failed" + BareMetalServerNetworkAttachmentByPciLifecycleStatePendingConst = "pending" + BareMetalServerNetworkAttachmentByPciLifecycleStateStableConst = "stable" + BareMetalServerNetworkAttachmentByPciLifecycleStateSuspendedConst = "suspended" + BareMetalServerNetworkAttachmentByPciLifecycleStateUpdatingConst = "updating" + BareMetalServerNetworkAttachmentByPciLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the VpcdnsResolver.Configuration property. -// The configuration of the system DNS resolver for this VPC. -// -// - `custom_resolver`: A custom DNS resolver is configured for this VPC. -// -// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when -// the VPC has either or both of the following: -// -// - at least one endpoint gateway residing in it -// -// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it -// -// - `default`: The provider default DNS resolvers are configured for this VPC. -// -// This system DNS resolver configuration is used when the VPC has: -// -// - no custom DNS resolver configured for it, and -// - no endpoint gateways residing in it, and -// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. +// Constants associated with the BareMetalServerNetworkAttachmentByPci.ResourceType property. +// The resource type. const ( - VpcdnsResolverConfigurationCustomResolverConst = "custom_resolver" - VpcdnsResolverConfigurationDefaultConst = "default" - VpcdnsResolverConfigurationPrivateResolverConst = "private_resolver" + BareMetalServerNetworkAttachmentByPciResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" ) -func (*VpcdnsResolver) isaVpcdnsResolver() bool { - return true -} +// Constants associated with the BareMetalServerNetworkAttachmentByPci.Type property. +// The bare metal server network attachment type. +const ( + BareMetalServerNetworkAttachmentByPciTypePrimaryConst = "primary" + BareMetalServerNetworkAttachmentByPciTypeSecondaryConst = "secondary" +) -type VpcdnsResolverIntf interface { - isaVpcdnsResolver() bool +// Constants associated with the BareMetalServerNetworkAttachmentByPci.InterfaceType property. +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +const ( + BareMetalServerNetworkAttachmentByPciInterfaceTypePciConst = "pci" +) + +func (*BareMetalServerNetworkAttachmentByPci) isaBareMetalServerNetworkAttachment() bool { + return true } -// UnmarshalVpcdnsResolver unmarshals an instance of VpcdnsResolver from the specified map of raw messages. -func UnmarshalVpcdnsResolver(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolver) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) +// UnmarshalBareMetalServerNetworkAttachmentByPci unmarshals an instance of BareMetalServerNetworkAttachmentByPci from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentByPci(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentByPci) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPatch : VpcdnsResolverPatch struct -type VpcdnsResolverPatch struct { - // The DNS servers to use for this VPC, replacing any existing servers. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. - // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. - // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - // - // `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is `manual`. - ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` - - // The type of the DNS resolver to use. - // - // - `delegated`: DNS server addresses will be provided by the resolver for the VPC - // specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be - // `false`. - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses will be provided by the system and depend on the - // configuration. - // - // Updating from `manual` requires `dns.resolver.manual_servers` to be specified as - // `null`. - // - // Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. - // - // Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. - Type *string `json:"type,omitempty"` - - // The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured - // with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in - // one of this VPC's DNS resolution bindings. - // - // Specify `null` to remove an existing VPC. - // - // This property must be set if and only if `dns.resolver.type` is `delegated`. - VPC VpcdnsResolverVPCPatchIntf `json:"vpc,omitempty"` -} - -// Constants associated with the VpcdnsResolverPatch.Type property. -// The type of the DNS resolver to use. -// -// - `delegated`: DNS server addresses will be provided by the resolver for the VPC -// specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be -// `false`. -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses will be provided by the system and depend on the -// configuration. -// -// Updating from `manual` requires `dns.resolver.manual_servers` to be specified as -// `null`. -// -// Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. -// -// Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. -const ( - VpcdnsResolverPatchTypeDelegatedConst = "delegated" - VpcdnsResolverPatchTypeManualConst = "manual" - VpcdnsResolverPatchTypeSystemConst = "system" -) - -// UnmarshalVpcdnsResolverPatch unmarshals an instance of VpcdnsResolverPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolverPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPatch) - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } @@ -73100,7 +85835,15 @@ func UnmarshalVpcdnsResolverPatch(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVpcdnsResolverVPCPatch) + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -73108,147 +85851,158 @@ func UnmarshalVpcdnsResolverPatch(m map[string]json.RawMessage, result interface return } -// VpcdnsResolverPrototype : VpcdnsResolverPrototype struct -// Models which "extend" this model: -// - VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype -// - VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype -type VpcdnsResolverPrototype struct { - // The type of the DNS resolver to use. - // - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses will be provided by the system and depend on the - // configuration. - Type *string `json:"type,omitempty"` +// BareMetalServerNetworkAttachmentByVlan : BareMetalServerNetworkAttachmentByVlan struct +// This model "extends" BareMetalServerNetworkAttachment +type BareMetalServerNetworkAttachmentByVlan struct { + // The date and time that the bare metal server network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The DNS servers to use for this VPC. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. + // The URL for this bare metal server network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this bare metal server network attachment. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the bare metal server network attachment. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this bare metal server network attachment. The name is unique across all network attachments for the + // bare metal server. + Name *string `json:"name" validate:"required"` + + // The port speed for this bare metal server network attachment in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + // The primary IP address of the virtual network interface for the bare metal server network attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The subnet of the virtual network interface for the bare metal server network attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The bare metal server network attachment type. + Type *string `json:"type" validate:"required"` + + // The virtual network interface for this bare metal server network attachment. + VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` + + // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for + // network attachments with an `interface_type` of `vlan`. // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network attachment will be automatically deleted from this bare metal server and a new network attachment with + // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for + // this network attachment will be automatically be attached to the new network attachment. // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` -} - -// Constants associated with the VpcdnsResolverPrototype.Type property. -// The type of the DNS resolver to use. -// -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses will be provided by the system and depend on the -// configuration. -const ( - VpcdnsResolverPrototypeTypeManualConst = "manual" - VpcdnsResolverPrototypeTypeSystemConst = "system" -) + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including + // this network attachment's `vlan`. + AllowToFloat *bool `json:"allow_to_float" validate:"required"` -func (*VpcdnsResolverPrototype) isaVpcdnsResolverPrototype() bool { - return true -} + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + InterfaceType *string `json:"interface_type" validate:"required"` -type VpcdnsResolverPrototypeIntf interface { - isaVpcdnsResolverPrototype() bool + // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. + Vlan *int64 `json:"vlan" validate:"required"` } -// UnmarshalVpcdnsResolverPrototype unmarshals an instance of VpcdnsResolverPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototype) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the BareMetalServerNetworkAttachmentByVlan.LifecycleState property. +// The lifecycle state of the bare metal server network attachment. +const ( + BareMetalServerNetworkAttachmentByVlanLifecycleStateDeletingConst = "deleting" + BareMetalServerNetworkAttachmentByVlanLifecycleStateFailedConst = "failed" + BareMetalServerNetworkAttachmentByVlanLifecycleStatePendingConst = "pending" + BareMetalServerNetworkAttachmentByVlanLifecycleStateStableConst = "stable" + BareMetalServerNetworkAttachmentByVlanLifecycleStateSuspendedConst = "suspended" + BareMetalServerNetworkAttachmentByVlanLifecycleStateUpdatingConst = "updating" + BareMetalServerNetworkAttachmentByVlanLifecycleStateWaitingConst = "waiting" +) -// VpcdnsResolverVPCPatch : The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured with a [DNS -// Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in one of this VPC's DNS resolution -// bindings. -// -// Specify `null` to remove an existing VPC. -// -// This property must be set if and only if `dns.resolver.type` is `delegated`. -// Models which "extend" this model: -// - VpcdnsResolverVPCPatchVPCIdentityByID -// - VpcdnsResolverVPCPatchVPCIdentityByCRN -// - VpcdnsResolverVPCPatchVPCIdentityByHref -type VpcdnsResolverVPCPatch struct { - // The unique identifier for this VPC. - ID *string `json:"id,omitempty"` +// Constants associated with the BareMetalServerNetworkAttachmentByVlan.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkAttachmentByVlanResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" +) - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` +// Constants associated with the BareMetalServerNetworkAttachmentByVlan.Type property. +// The bare metal server network attachment type. +const ( + BareMetalServerNetworkAttachmentByVlanTypePrimaryConst = "primary" + BareMetalServerNetworkAttachmentByVlanTypeSecondaryConst = "secondary" +) - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} +// Constants associated with the BareMetalServerNetworkAttachmentByVlan.InterfaceType property. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +const ( + BareMetalServerNetworkAttachmentByVlanInterfaceTypeVlanConst = "vlan" +) -func (*VpcdnsResolverVPCPatch) isaVpcdnsResolverVPCPatch() bool { +func (*BareMetalServerNetworkAttachmentByVlan) isaBareMetalServerNetworkAttachment() bool { return true } -type VpcdnsResolverVPCPatchIntf interface { - isaVpcdnsResolverVPCPatch() bool -} - -// UnmarshalVpcdnsResolverVPCPatch unmarshals an instance of VpcdnsResolverVPCPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatch) +// UnmarshalBareMetalServerNetworkAttachmentByVlan unmarshals an instance of BareMetalServerNetworkAttachmentByVlan from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentByVlan(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentByVlan) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCHealthReason : VPCHealthReason struct -type VPCHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPCHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPCHealthReasonCodeDnsResolutionBindingFailedConst = "dns_resolution_binding_failed" - VPCHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPCHealthReason unmarshals an instance of VPCHealthReason from the specified map of raw messages. -func UnmarshalVPCHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -73256,42 +86010,48 @@ func UnmarshalVPCHealthReason(m map[string]json.RawMessage, result interface{}) return } -// VPCIdentity : Identifies a VPC by a unique property. +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. // Models which "extend" this model: -// - VPCIdentityByID -// - VPCIdentityByCRN -// - VPCIdentityByHref -type VPCIdentity struct { - // The unique identifier for this VPC. +// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. + // The URL for this virtual network interface. Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -func (*VPCIdentity) isaVPCIdentity() bool { +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -type VPCIdentityIntf interface { - isaVPCIdentity() bool +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityIntf interface { + BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf + isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool } -// UnmarshalVPCIdentity unmarshals an instance of VPCIdentity from the specified map of raw messages. -func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentity) +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -73299,84 +86059,89 @@ func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err return } -// VPCPatch : VPCPatch struct -type VPCPatch struct { - // The DNS configuration for this VPC. - Dns *VpcdnsPatch `json:"dns,omitempty"` - - // The name for this VPC. The name must not be used by another VPC in the region. - Name *string `json:"name,omitempty"` -} +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext : The virtual network interface for this target. +// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// UnmarshalVPCPatch unmarshals an instance of VPCPatch from the specified map of raw messages. -func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCPatch) - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdnsPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` -// AsPatch returns a generic map representation of the VPCPatch -func (vpcPatch *VPCPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpcPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` -// VPCReference : VPCReference struct -type VPCReference struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` - // The URL for this VPC. - Href *string `json:"href" validate:"required"` + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` + // The resource group to use for this virtual network interface. If unspecified, the + // bare metal server's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } -// Constants associated with the VPCReference.ResourceType property. -// The resource type. -const ( - VPCReferenceResourceTypeVPCConst = "vpc" -) +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} -// UnmarshalVPCReference unmarshals an instance of VPCReference from the specified map of raw messages. -func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) if err != nil { return } @@ -73384,7 +86149,19 @@ func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } @@ -73392,68 +86169,68 @@ func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (er return } -// VPCReferenceDnsResolverContext : A VPC whose DNS resolver is delegated to provide DNS servers for this VPC. -// -// The VPC may be remote and therefore may not be directly retrievable. -type VPCReferenceDnsResolverContext struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDnsResolverContextDeleted `json:"deleted,omitempty"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` +// BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype : BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype struct +// This model "extends" BareMetalServerNetworkAttachmentPrototype +type BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype struct { + // The name for this bare metal server network attachment. Names must be unique within the bare metal server the + // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` + VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VPCRemote `json:"remote,omitempty"` + // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type" validate:"required"` } -// Constants associated with the VPCReferenceDnsResolverContext.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype.InterfaceType property. +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( - VPCReferenceDnsResolverContextResourceTypeVPCConst = "vpc" + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototypeInterfaceTypePciConst = "pci" ) -// UnmarshalVPCReferenceDnsResolverContext unmarshals an instance of VPCReferenceDnsResolverContext from the specified map of raw messages. -func UnmarshalVPCReferenceDnsResolverContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDnsResolverContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDnsResolverContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype : Instantiate BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf, interfaceType string) (_model *BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype, err error) { + _model = &BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype{ + VirtualNetworkInterface: virtualNetworkInterface, + InterfaceType: core.StringPtr(interfaceType), } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { + return true +} + +// UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -73461,35 +86238,80 @@ func UnmarshalVPCReferenceDnsResolverContext(m map[string]json.RawMessage, resul return } -// VPCReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPCReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype : BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype struct +// This model "extends" BareMetalServerNetworkAttachmentPrototype +type BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype struct { + // The name for this bare metal server network attachment. Names must be unique within the bare metal server the + // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` + + // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for + // network attachments with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network attachment will be automatically deleted from this bare metal server and a new network attachment with + // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for + // this network attachment will be automatically be attached to the new network attachment. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including + // this network attachment's `vlan`. + AllowToFloat *bool `json:"allow_to_float,omitempty"` + + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + InterfaceType *string `json:"interface_type" validate:"required"` + + // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. + Vlan *int64 `json:"vlan" validate:"required"` } -// UnmarshalVPCReferenceDeleted unmarshals an instance of VPCReferenceDeleted from the specified map of raw messages. -func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// Constants associated with the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype.InterfaceType property. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +const ( + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototypeInterfaceTypeVlanConst = "vlan" +) + +// NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype : Instantiate BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf, interfaceType string, vlan int64) (_model *BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype, err error) { + _model = &BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype{ + VirtualNetworkInterface: virtualNetworkInterface, + InterfaceType: core.StringPtr(interfaceType), + Vlan: core.Int64Ptr(vlan), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// VPCReferenceDnsResolverContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPCReferenceDnsResolverContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +func (*BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { + return true } -// UnmarshalVPCReferenceDnsResolverContextDeleted unmarshals an instance of VPCReferenceDnsResolverContextDeleted from the specified map of raw messages. -func UnmarshalVPCReferenceDnsResolverContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDnsResolverContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -73497,38 +86319,182 @@ func UnmarshalVPCReferenceDnsResolverContextDeleted(m map[string]json.RawMessage return } -// VPCReferenceRemote : VPCReferenceRemote struct -type VPCReferenceRemote struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` +// BareMetalServerNetworkInterfaceByHiperSocket : BareMetalServerNetworkInterfaceByHiperSocket struct +// This model "extends" BareMetalServerNetworkInterface +type BareMetalServerNetworkInterfaceByHiperSocket struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The URL for this VPC. + // The date and time that the bare metal server network interface was created. + // + // If this bare metal server has network attachments, this network interface was created as a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` + + // The floating IPs associated with this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` + + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPC. + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - // The name for this VPC. The name is unique across all VPCs in the region. + // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value + // will be an empty string. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. + MacAddress *string `json:"mac_address" validate:"required"` + + // The name for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VPCRemote `json:"remote,omitempty"` + // The bare metal server network interface port speed in Mbps. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The security groups targeting this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // The status of the bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a read-only representation of its + // corresponding network attachment and its attached virtual network interface, and the status is [computed from + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + Status *string `json:"status" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The bare metal server network interface type. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. + Type *string `json:"type" validate:"required"` + + // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + // within a `s390x` based system. + InterfaceType *string `json:"interface_type" validate:"required"` } -// Constants associated with the VPCReferenceRemote.ResourceType property. +// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.ResourceType property. // The resource type. const ( - VPCReferenceRemoteResourceTypeVPCConst = "vpc" + BareMetalServerNetworkInterfaceByHiperSocketResourceTypeNetworkInterfaceConst = "network_interface" ) -// UnmarshalVPCReferenceRemote unmarshals an instance of VPCReferenceRemote from the specified map of raw messages. -func UnmarshalVPCReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceRemote) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Status property. +// The status of the bare metal server network interface. +// +// If this bare metal server has network attachments, this network interface is a read-only representation of its +// corresponding network attachment and its attached virtual network interface, and the status is [computed from +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). +const ( + BareMetalServerNetworkInterfaceByHiperSocketStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceByHiperSocketStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceByHiperSocketStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceByHiperSocketStatusPendingConst = "pending" +) + +// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Type property. +// The bare metal server network interface type. +// +// If this bare metal server has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. +const ( + BareMetalServerNetworkInterfaceByHiperSocketTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceByHiperSocketTypeSecondaryConst = "secondary" +) + +// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.InterfaceType property. +// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity +// within a `s390x` based system. +const ( + BareMetalServerNetworkInterfaceByHiperSocketInterfaceTypeHipersocketConst = "hipersocket" +) + +func (*BareMetalServerNetworkInterfaceByHiperSocket) isaBareMetalServerNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkInterfaceByHiperSocket unmarshals an instance of BareMetalServerNetworkInterfaceByHiperSocket from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceByHiperSocket(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceByHiperSocket) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } @@ -73540,11 +86506,19 @@ func UnmarshalVPCReferenceRemote(m map[string]json.RawMessage, result interface{ if err != nil { return } + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } @@ -73552,30 +86526,23 @@ func UnmarshalVPCReferenceRemote(m map[string]json.RawMessage, result interface{ if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type VPCRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` - - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalVPCRemote unmarshals an instance of VPCRemote from the specified map of raw messages. -func UnmarshalVPCRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -73583,130 +86550,184 @@ func UnmarshalVPCRemote(m map[string]json.RawMessage, result interface{}) (err e return } -// VPNGateway : VPNGateway struct -// Models which "extend" this model: -// - VPNGatewayRouteMode -// - VPNGatewayPolicyMode -type VPNGateway struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` +// BareMetalServerNetworkInterfaceByPci : BareMetalServerNetworkInterfaceByPci struct +// This model "extends" BareMetalServerNetworkInterface +type BareMetalServerNetworkInterfaceByPci struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The date and time that this VPN gateway was created. + // The date and time that the bare metal server network interface was created. + // + // If this bare metal server has network attachments, this network interface was created as a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` + // The floating IPs associated with this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - // The VPN gateway's canonical URL. + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN gateway. + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) + // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value + // will be an empty string. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. + MacAddress *string `json:"mac_address" validate:"required"` - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + // The name for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The bare metal server network interface port speed in Mbps. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + // The security groups targeting this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // The status of the bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a read-only representation of its + // corresponding network attachment and its attached virtual network interface, and the status is [computed from + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + Status *string `json:"status" validate:"required"` + + // The associated subnet. Subnet *SubnetReference `json:"subnet" validate:"required"` - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The bare metal server network interface type. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. + Type *string `json:"type" validate:"required"` - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` + // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. + AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` + + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI interface + // - Cannot directly use an IEEE 802.1Q tag. + InterfaceType *string `json:"interface_type" validate:"required"` } -// Constants associated with the VPNGateway.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.ResourceType property. +// The resource type. const ( - VPNGatewayHealthStateDegradedConst = "degraded" - VPNGatewayHealthStateFaultedConst = "faulted" - VPNGatewayHealthStateInapplicableConst = "inapplicable" - VPNGatewayHealthStateOkConst = "ok" + BareMetalServerNetworkInterfaceByPciResourceTypeNetworkInterfaceConst = "network_interface" ) -// Constants associated with the VPNGateway.LifecycleState property. -// The lifecycle state of the VPN gateway. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.Status property. +// The status of the bare metal server network interface. +// +// If this bare metal server has network attachments, this network interface is a read-only representation of its +// corresponding network attachment and its attached virtual network interface, and the status is [computed from +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( - VPNGatewayLifecycleStateDeletingConst = "deleting" - VPNGatewayLifecycleStateFailedConst = "failed" - VPNGatewayLifecycleStatePendingConst = "pending" - VPNGatewayLifecycleStateStableConst = "stable" - VPNGatewayLifecycleStateSuspendedConst = "suspended" - VPNGatewayLifecycleStateUpdatingConst = "updating" - VPNGatewayLifecycleStateWaitingConst = "waiting" + BareMetalServerNetworkInterfaceByPciStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceByPciStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceByPciStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceByPciStatusPendingConst = "pending" ) -// Constants associated with the VPNGateway.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.Type property. +// The bare metal server network interface type. +// +// If this bare metal server has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( - VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" + BareMetalServerNetworkInterfaceByPciTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceByPciTypeSecondaryConst = "secondary" ) -// Constants associated with the VPNGateway.Mode property. -// Route mode VPN gateway. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.InterfaceType property. +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI interface +// - Cannot directly use an IEEE 802.1Q tag. const ( - VPNGatewayModeRouteConst = "route" + BareMetalServerNetworkInterfaceByPciInterfaceTypePciConst = "pci" ) -func (*VPNGateway) isaVPNGateway() bool { +func (*BareMetalServerNetworkInterfaceByPci) isaBareMetalServerNetworkInterface() bool { return true } -type VPNGatewayIntf interface { - isaVPNGateway() bool -} - -// UnmarshalVPNGateway unmarshals an instance of VPNGateway from the specified map of raw messages. -func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGateway) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) +// UnmarshalBareMetalServerNetworkInterfaceByPci unmarshals an instance of BareMetalServerNetworkInterfaceByPci from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceByPci(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceByPci) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } @@ -73714,15 +86735,11 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } @@ -73734,15 +86751,7 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) if err != nil { return } @@ -73750,115 +86759,39 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayCollection : VPNGatewayCollection struct -type VPNGatewayCollection struct { - // A link to the first page of resources. - First *VPNGatewayCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNGatewayCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of VPN gateways. - VPNGateways []VPNGatewayIntf `json:"vpn_gateways" validate:"required"` -} - -// UnmarshalVPNGatewayCollection unmarshals an instance of VPNGatewayCollection from the specified map of raw messages. -func UnmarshalVPNGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalModel(m, "vpn_gateways", &obj.VPNGateways, UnmarshalVPNGateway) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNGatewayCollectionFirst : A link to the first page of resources. -type VPNGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNGatewayCollectionFirst unmarshals an instance of VPNGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNGatewayCollectionNext unmarshals an instance of VPNGatewayCollectionNext from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -73866,302 +86799,269 @@ func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result inte return } -// VPNGatewayConnection : VPNGatewayConnection struct -// Models which "extend" this model: -// - VPNGatewayConnectionStaticRouteMode -// - VPNGatewayConnectionPolicyMode -type VPNGatewayConnection struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` +// BareMetalServerNetworkInterfaceByVlan : BareMetalServerNetworkInterfaceByVlan struct +// This model "extends" BareMetalServerNetworkInterface +type BareMetalServerNetworkInterfaceByVlan struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The date and time that this VPN gateway connection was created. + // The date and time that the bare metal server network interface was created. + // + // If this bare metal server has network attachments, this network interface was created as a [read-only + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - // The VPN connection's canonical URL. + // The floating IPs associated with this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. + FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` + + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN gateway connection. + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` + // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value + // will be an empty string. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. + MacAddress *string `json:"mac_address" validate:"required"` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + // The name for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` + // The bare metal server network interface port speed in Mbps. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. + PortSpeed *int64 `json:"port_speed" validate:"required"` - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` + // The security groups targeting this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) + // The status of the bare metal server network interface. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + // If this bare metal server has network attachments, this network interface is a read-only representation of its + // corresponding network attachment and its attached virtual network interface, and the status is [computed from + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + Status *string `json:"status" validate:"required"` - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` - // The VPN tunnel configuration for this VPN gateway connection (in static route mode). - Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels,omitempty"` + // The bare metal server network interface type. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. + Type *string `json:"type" validate:"required"` - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` -// Constants associated with the VPNGatewayConnection.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionAuthenticationModePskConst = "psk" -) + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. + Vlan *int64 `json:"vlan" validate:"required"` +} -// Constants associated with the VPNGatewayConnection.Mode property. -// The mode of the VPN gateway. +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.ResourceType property. +// The resource type. const ( - VPNGatewayConnectionModePolicyConst = "policy" - VPNGatewayConnectionModeRouteConst = "route" + BareMetalServerNetworkInterfaceByVlanResourceTypeNetworkInterfaceConst = "network_interface" ) -// Constants associated with the VPNGatewayConnection.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Status property. +// The status of the bare metal server network interface. +// +// If this bare metal server has network attachments, this network interface is a read-only representation of its +// corresponding network attachment and its attached virtual network interface, and the status is [computed from +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( - VPNGatewayConnectionResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" + BareMetalServerNetworkInterfaceByVlanStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceByVlanStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceByVlanStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceByVlanStatusPendingConst = "pending" ) -// Constants associated with the VPNGatewayConnection.Status property. -// The status of a VPN gateway connection. +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Type property. +// The bare metal server network interface type. +// +// If this bare metal server has network attachments, this network interface is a +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( - VPNGatewayConnectionStatusDownConst = "down" - VPNGatewayConnectionStatusUpConst = "up" + BareMetalServerNetworkInterfaceByVlanTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceByVlanTypeSecondaryConst = "secondary" ) -// Constants associated with the VPNGatewayConnection.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.InterfaceType property. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. const ( - VPNGatewayConnectionRoutingProtocolNoneConst = "none" + BareMetalServerNetworkInterfaceByVlanInterfaceTypeVlanConst = "vlan" ) -func (*VPNGatewayConnection) isaVPNGatewayConnection() bool { +func (*BareMetalServerNetworkInterfaceByVlan) isaBareMetalServerNetworkInterface() bool { return true } -type VPNGatewayConnectionIntf interface { - isaVPNGatewayConnection() bool -} - -// UnmarshalVPNGatewayConnection unmarshals an instance of VPNGatewayConnection from the specified map of raw messages. -func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnection) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) +// UnmarshalBareMetalServerNetworkInterfaceByVlan unmarshals an instance of BareMetalServerNetworkInterfaceByVlan from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceByVlan) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionCollection : Collection of VPN gateway connections in a VPN gateway. -type VPNGatewayConnectionCollection struct { - // Array of VPN gateway connections. - Connections []VPNGatewayConnectionIntf `json:"connections" validate:"required"` -} - -// UnmarshalVPNGatewayConnectionCollection unmarshals an instance of VPNGatewayConnectionCollection from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionCollection) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnection) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionDpd : The Dead Peer Detection settings. -type VPNGatewayConnectionDpd struct { - // Dead Peer Detection actions. - Action *string `json:"action" validate:"required"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval" validate:"required"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionDpd.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdActionClearConst = "clear" - VPNGatewayConnectionDpdActionHoldConst = "hold" - VPNGatewayConnectionDpdActionNoneConst = "none" - VPNGatewayConnectionDpdActionRestartConst = "restart" -) - -// UnmarshalVPNGatewayConnectionDpd unmarshals an instance of VPNGatewayConnectionDpd from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpd) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionDpdPatch : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPatch struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionDpdPatch.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPatchActionClearConst = "clear" - VPNGatewayConnectionDpdPatchActionHoldConst = "hold" - VPNGatewayConnectionDpdPatchActionNoneConst = "none" - VPNGatewayConnectionDpdPatchActionRestartConst = "restart" -) - -// UnmarshalVPNGatewayConnectionDpdPatch unmarshals an instance of VPNGatewayConnectionDpdPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) + err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -74169,200 +87069,108 @@ func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionDpdPrototype : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPrototype struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` +// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct +// This model "extends" BareMetalServerNetworkInterfacePrototype +type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` -// Constants associated with the VPNGatewayConnectionDpdPrototype.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPrototypeActionClearConst = "clear" - VPNGatewayConnectionDpdPrototypeActionHoldConst = "hold" - VPNGatewayConnectionDpdPrototypeActionNoneConst = "none" - VPNGatewayConnectionDpdPrototypeActionRestartConst = "restart" -) + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// UnmarshalVPNGatewayConnectionDpdPrototype unmarshals an instance of VPNGatewayConnectionDpdPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing + // reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare + // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically + // selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` -// VPNGatewayConnectionIkePolicyPatch : The IKE policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). -// Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPatch struct { - // The unique identifier for this IKE policy. - ID *string `json:"id,omitempty"` + // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security + // group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The IKE policy's canonical URL. - Href *string `json:"href,omitempty"` -} + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -func (*VPNGatewayConnectionIkePolicyPatch) isaVPNGatewayConnectionIkePolicyPatch() bool { - return true + // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity + // within a `s390x` based system. + // - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + InterfaceType *string `json:"interface_type" validate:"required"` } -type VPNGatewayConnectionIkePolicyPatchIntf interface { - isaVPNGatewayConnectionIkePolicyPatch() bool -} +// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.InterfaceType property. +// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity +// within a `s390x` based system. +// - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. +const ( + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeInterfaceTypeHipersocketConst = "hipersocket" +) -// UnmarshalVPNGatewayConnectionIkePolicyPatch unmarshals an instance of VPNGatewayConnectionIkePolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype, err error) { + _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype{ + Subnet: subnet, + InterfaceType: core.StringPtr(interfaceType), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// VPNGatewayConnectionIkePolicyPrototype : The IKE policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). -// Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPrototype struct { - // The unique identifier for this IKE policy. - ID *string `json:"id,omitempty"` - - // The IKE policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIkePolicyPrototype) isaVPNGatewayConnectionIkePolicyPrototype() bool { +func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { return true } -type VPNGatewayConnectionIkePolicyPrototypeIntf interface { - isaVPNGatewayConnectionIkePolicyPrototype() bool -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototype unmarshals an instance of VPNGatewayConnectionIkePolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatch : The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPatch struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIPsecPolicyPatch) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -type VPNGatewayConnectionIPsecPolicyPatchIntf interface { - isaVPNGatewayConnectionIPsecPolicyPatch() bool -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatch unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototype : The IPsec policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPrototype struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIPsecPolicyPrototype) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -type VPNGatewayConnectionIPsecPolicyPrototypeIntf interface { - isaVPNGatewayConnectionIPsecPolicyPrototype() bool -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototype unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionLocalCIDRs : VPNGatewayConnectionLocalCIDRs struct -type VPNGatewayConnectionLocalCIDRs struct { - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` -} - -// UnmarshalVPNGatewayConnectionLocalCIDRs unmarshals an instance of VPNGatewayConnectionLocalCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionLocalCIDRs) - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -74370,110 +87178,121 @@ func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, resul return } -// VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct -// Models which "extend" this model: -// - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch -type VPNGatewayConnectionPatch struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` +// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct +// This model "extends" BareMetalServerNetworkInterfacePrototype +type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // The IKE policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` + // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing + // reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare + // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically + // selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. - Name *string `json:"name,omitempty"` + // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security + // group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address,omitempty"` + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - // The pre-shared key. - Psk *string `json:"psk,omitempty"` + // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI interface + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type" validate:"required"` } -// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. +// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.InterfaceType property. +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI interface +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( - VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypePciConst = "pci" ) -func (*VPNGatewayConnectionPatch) isaVPNGatewayConnectionPatch() bool { - return true +// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype, err error) { + _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{ + Subnet: subnet, + InterfaceType: core.StringPtr(interfaceType), + } + err = core.ValidateStruct(_model, "required parameters") + return } -type VPNGatewayConnectionPatchIntf interface { - isaVPNGatewayConnectionPatch() bool +func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true } -// UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPatch) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) +// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNGatewayConnectionPatch -func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayConnectionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNGatewayConnectionPeerCIDRs : VPNGatewayConnectionPeerCIDRs struct -type VPNGatewayConnectionPeerCIDRs struct { - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} - -// UnmarshalVPNGatewayConnectionPeerCIDRs unmarshals an instance of VPNGatewayConnectionPeerCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerCIDRs) - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -74481,99 +87300,148 @@ func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct -// Models which "extend" this model: -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype -type VPNGatewayConnectionPrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - // The IKE policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` +// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct +// This model "extends" BareMetalServerNetworkInterfacePrototype +type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct { + // Indicates whether source IP spoofing is allowed on this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The IPsec policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the bare metal server network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - `interface_type` must not be `hipersocket`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // The name for this bare metal server network interface. The name must not be used by another network interface on the + // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` + // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing + // reserved IP, or a prototype object for a new reserved IP. + // + // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare + // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically + // selected and reserved. + PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` + // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security + // group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for + // network interfaces with an `interface_type` of `vlan`. + // + // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, + // the network interface will be automatically deleted from this bare metal server and a new network interface with the + // same `id`, `name` and `vlan` will be created on the other bare metal server. + // + // For the data path to float, the other bare metal server must be in the same + // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including + // this network interface's `vlan`. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1Q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type" validate:"required"` - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` + // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. + Vlan *int64 `json:"vlan" validate:"required"` } -// Constants associated with the VPNGatewayConnectionPrototype.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. +// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.InterfaceType property. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1Q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( - VPNGatewayConnectionPrototypeRoutingProtocolNoneConst = "none" + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeInterfaceTypeVlanConst = "vlan" ) -func (*VPNGatewayConnectionPrototype) isaVPNGatewayConnectionPrototype() bool { - return true +// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(subnet SubnetIdentityIntf, interfaceType string, vlan int64) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype, err error) { + _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{ + Subnet: subnet, + InterfaceType: core.StringPtr(interfaceType), + Vlan: core.Int64Ptr(vlan), + } + err = core.ValidateStruct(_model, "required parameters") + return } -type VPNGatewayConnectionPrototypeIntf interface { - isaVPNGatewayConnectionPrototype() bool +func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true } -// UnmarshalVPNGatewayConnectionPrototype unmarshals an instance of VPNGatewayConnectionPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) +// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -74581,51 +87449,67 @@ func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionReference : VPNGatewayConnectionReference struct -type VPNGatewayConnectionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` +// BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype : BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype struct +// This model "extends" BareMetalServerPrimaryNetworkAttachmentPrototype +type BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype struct { + // The name for this bare metal server network attachment. Names must be unique within the bare metal server the + // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` + VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` + // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the PCI attachment + // - Cannot directly use an IEEE 802.1Q tag. + // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + InterfaceType *string `json:"interface_type,omitempty"` } -// Constants associated with the VPNGatewayConnectionReference.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype.InterfaceType property. +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the PCI attachment +// - Cannot directly use an IEEE 802.1Q tag. +// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. const ( - VPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" + BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototypeInterfaceTypePciConst = "pci" ) -// UnmarshalVPNGatewayConnectionReference unmarshals an instance of VPNGatewayConnectionReference from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) - if err != nil { - return +// NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype : Instantiate BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) (_model *BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype, err error) { + _model = &BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype{ + VirtualNetworkInterface: virtualNetworkInterface, } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype) isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool { + return true +} + +// UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype unmarshals an instance of BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -74633,17 +87517,28 @@ func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNGatewayConnectionReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// BareMetalServerProfileBandwidthDependent : The total bandwidth shared across the bare metal server network attachments or bare metal server network interfaces +// of a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVPNGatewayConnectionReferenceDeleted unmarshals an instance of VPNGatewayConnectionReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// Constants associated with the BareMetalServerProfileBandwidthDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileBandwidthDependent) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthDependent unmarshals an instance of BareMetalServerProfileBandwidthDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -74651,55 +87546,42 @@ func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, return } -// VPNGatewayConnectionStaticRouteModeTunnel : VPNGatewayConnectionStaticRouteModeTunnel struct -type VPNGatewayConnectionStaticRouteModeTunnel struct { - // The IP address of the VPN gateway member in which the tunnel resides. - PublicIP *IP `json:"public_ip" validate:"required"` +// BareMetalServerProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the bare metal server network attachments +// or bare metal server network interfaces of a bare metal server with this profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The status of the VPN Tunnel. - Status *string `json:"status" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The reasons for the current VPN gateway connection tunnels status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. -// The status of the VPN Tunnel. +// Constants associated with the BareMetalServerProfileBandwidthEnum.Type property. +// The type for this profile field. const ( - VPNGatewayConnectionStaticRouteModeTunnelStatusDownConst = "down" - VPNGatewayConnectionStaticRouteModeTunnelStatusUpConst = "up" + BareMetalServerProfileBandwidthEnumTypeEnumConst = "enum" ) -// UnmarshalVPNGatewayConnectionStaticRouteModeTunnel unmarshals an instance of VPNGatewayConnectionStaticRouteModeTunnel from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStaticRouteModeTunnel) - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) +func (*BareMetalServerProfileBandwidthEnum) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthEnum unmarshals an instance of BareMetalServerProfileBandwidthEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -74707,42 +87589,35 @@ func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMes return } -// VPNGatewayConnectionStatusReason : VPNGatewayConnectionStatusReason struct -type VPNGatewayConnectionStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this VPN gateway connection's status. - Message *string `json:"message" validate:"required"` +// BareMetalServerProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the bare metal server network attachments or bare metal +// server network interfaces of a bare metal server with this profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// Constants associated with the VPNGatewayConnectionStatusReason.Code property. -// A snake case string succinctly identifying the status reason. +// Constants associated with the BareMetalServerProfileBandwidthFixed.Type property. +// The type for this profile field. const ( - VPNGatewayConnectionStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" - VPNGatewayConnectionStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" - VPNGatewayConnectionStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" - VPNGatewayConnectionStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" - VPNGatewayConnectionStatusReasonCodeInternalErrorConst = "internal_error" - VPNGatewayConnectionStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" - VPNGatewayConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" + BareMetalServerProfileBandwidthFixedTypeFixedConst = "fixed" ) -// UnmarshalVPNGatewayConnectionStatusReason unmarshals an instance of VPNGatewayConnectionStatusReason from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) +func (*BareMetalServerProfileBandwidthFixed) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthFixed unmarshals an instance of BareMetalServerProfileBandwidthFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -74750,42 +87625,56 @@ func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, res return } -// VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct -type VPNGatewayConnectionTunnelStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// BareMetalServerProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network attachments or network +// interfaces of a bare metal server with this profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // An explanation of the reason for this VPN gateway connection tunnel's status. - Message *string `json:"message" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNGatewayConnectionTunnelStatusReason.Code property. -// A snake case string succinctly identifying the status reason. +// Constants associated with the BareMetalServerProfileBandwidthRange.Type property. +// The type for this profile field. const ( - VPNGatewayConnectionTunnelStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" - VPNGatewayConnectionTunnelStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeInternalErrorConst = "internal_error" - VPNGatewayConnectionTunnelStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodePeerNotRespondingConst = "peer_not_responding" + BareMetalServerProfileBandwidthRangeTypeRangeConst = "range" ) -// UnmarshalVPNGatewayConnectionTunnelStatusReason unmarshals an instance of VPNGatewayConnectionTunnelStatusReason from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionTunnelStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionTunnelStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +func (*BareMetalServerProfileBandwidthRange) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthRange unmarshals an instance of BareMetalServerProfileBandwidthRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -74793,38 +87682,69 @@ func UnmarshalVPNGatewayConnectionTunnelStatusReason(m map[string]json.RawMessag return } -// VPNGatewayHealthReason : VPNGatewayHealthReason struct -type VPNGatewayHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` +// BareMetalServerProfileCpuCoreCountDependent : The CPU core count for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` +// Constants associated with the BareMetalServerProfileCpuCoreCountDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuCoreCountDependentTypeDependentConst = "dependent" +) - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` +func (*BareMetalServerProfileCpuCoreCountDependent) isaBareMetalServerProfileCpuCoreCount() bool { + return true } -// Constants associated with the VPNGatewayHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. +// UnmarshalBareMetalServerProfileCpuCoreCountDependent unmarshals an instance of BareMetalServerProfileCpuCoreCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileCpuCoreCountEnum : The permitted values for CPU cores for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileCpuCoreCountEnum.Type property. +// The type for this profile field. const ( - VPNGatewayHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" - VPNGatewayHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNGatewayHealthReasonCodeInternalErrorConst = "internal_error" + BareMetalServerProfileCpuCoreCountEnumTypeEnumConst = "enum" ) -// UnmarshalVPNGatewayHealthReason unmarshals an instance of VPNGatewayHealthReason from the specified map of raw messages. -func UnmarshalVPNGatewayHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +func (*BareMetalServerProfileCpuCoreCountEnum) isaBareMetalServerProfileCpuCoreCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuCoreCountEnum unmarshals an instance of BareMetalServerProfileCpuCoreCountEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -74832,36 +87752,34 @@ func UnmarshalVPNGatewayHealthReason(m map[string]json.RawMessage, result interf return } -// VPNGatewayLifecycleReason : VPNGatewayLifecycleReason struct -type VPNGatewayLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` +// BareMetalServerProfileCpuCoreCountFixed : The CPU core count for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// Constants associated with the VPNGatewayLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. +// Constants associated with the BareMetalServerProfileCpuCoreCountFixed.Type property. +// The type for this profile field. const ( - VPNGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" + BareMetalServerProfileCpuCoreCountFixedTypeFixedConst = "fixed" ) -// UnmarshalVPNGatewayLifecycleReason unmarshals an instance of VPNGatewayLifecycleReason from the specified map of raw messages. -func UnmarshalVPNGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) +func (*BareMetalServerProfileCpuCoreCountFixed) isaBareMetalServerProfileCpuCoreCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuCoreCountFixed unmarshals an instance of BareMetalServerProfileCpuCoreCountFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -74869,113 +87787,55 @@ func UnmarshalVPNGatewayLifecycleReason(m map[string]json.RawMessage, result int return } -// VPNGatewayMember : VPNGatewayMember struct -type VPNGatewayMember struct { - // The reasons for the current VPN gateway member health_state (if any): - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayMemberHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The reasons for the current VPN gateway member lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayMemberLifecycleReason `json:"lifecycle_reasons" validate:"required"` +// BareMetalServerProfileCpuCoreCountRange : The permitted range for the number of CPU cores for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The lifecycle state of the VPN gateway member. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The reserved IP address assigned to the VPN gateway member. - // - // This property will be present only when the VPN gateway status is `available`. - PrivateIP *ReservedIPReference `json:"private_ip" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The public IP address assigned to the VPN gateway member. - PublicIP *IP `json:"public_ip" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // The high availability role assigned to the VPN gateway member. - Role *string `json:"role" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNGatewayMember.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayMemberHealthStateDegradedConst = "degraded" - VPNGatewayMemberHealthStateFaultedConst = "faulted" - VPNGatewayMemberHealthStateInapplicableConst = "inapplicable" - VPNGatewayMemberHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGatewayMember.LifecycleState property. -// The lifecycle state of the VPN gateway member. -const ( - VPNGatewayMemberLifecycleStateDeletingConst = "deleting" - VPNGatewayMemberLifecycleStateFailedConst = "failed" - VPNGatewayMemberLifecycleStatePendingConst = "pending" - VPNGatewayMemberLifecycleStateStableConst = "stable" - VPNGatewayMemberLifecycleStateSuspendedConst = "suspended" - VPNGatewayMemberLifecycleStateUpdatingConst = "updating" - VPNGatewayMemberLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGatewayMember.Role property. -// The high availability role assigned to the VPN gateway member. +// Constants associated with the BareMetalServerProfileCpuCoreCountRange.Type property. +// The type for this profile field. const ( - VPNGatewayMemberRoleActiveConst = "active" - VPNGatewayMemberRoleStandbyConst = "standby" + BareMetalServerProfileCpuCoreCountRangeTypeRangeConst = "range" ) -// UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. -func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMember) - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayMemberHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayMemberLifecycleReason) +func (*BareMetalServerProfileCpuCoreCountRange) isaBareMetalServerProfileCpuCoreCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuCoreCountRange unmarshals an instance of BareMetalServerProfileCpuCoreCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalReservedIPReference) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "role", &obj.Role) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -74983,37 +87843,27 @@ func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) return } -// VPNGatewayMemberHealthReason : VPNGatewayMemberHealthReason struct -type VPNGatewayMemberHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` +// BareMetalServerProfileCpuSocketCountDependent : The CPU socket count for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNGatewayMemberHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. +// Constants associated with the BareMetalServerProfileCpuSocketCountDependent.Type property. +// The type for this profile field. const ( - VPNGatewayMemberHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNGatewayMemberHealthReasonCodeInternalErrorConst = "internal_error" + BareMetalServerProfileCpuSocketCountDependentTypeDependentConst = "dependent" ) -// UnmarshalVPNGatewayMemberHealthReason unmarshals an instance of VPNGatewayMemberHealthReason from the specified map of raw messages. -func UnmarshalVPNGatewayMemberHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMemberHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +func (*BareMetalServerProfileCpuSocketCountDependent) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountDependent unmarshals an instance of BareMetalServerProfileCpuSocketCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75021,36 +87871,41 @@ func UnmarshalVPNGatewayMemberHealthReason(m map[string]json.RawMessage, result return } -// VPNGatewayMemberLifecycleReason : VPNGatewayMemberLifecycleReason struct -type VPNGatewayMemberLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` +// BareMetalServerProfileCpuSocketCountEnum : The permitted values for CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VPNGatewayMemberLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. +// Constants associated with the BareMetalServerProfileCpuSocketCountEnum.Type property. +// The type for this profile field. const ( - VPNGatewayMemberLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" + BareMetalServerProfileCpuSocketCountEnumTypeEnumConst = "enum" ) -// UnmarshalVPNGatewayMemberLifecycleReason unmarshals an instance of VPNGatewayMemberLifecycleReason from the specified map of raw messages. -func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMemberLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +func (*BareMetalServerProfileCpuSocketCountEnum) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountEnum unmarshals an instance of BareMetalServerProfileCpuSocketCountEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -75058,16 +87913,34 @@ func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, resu return } -// VPNGatewayPatch : VPNGatewayPatch struct -type VPNGatewayPatch struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. - Name *string `json:"name,omitempty"` +// BareMetalServerProfileCpuSocketCountFixed : The number of CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. -func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// Constants associated with the BareMetalServerProfileCpuSocketCountFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuSocketCountFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileCpuSocketCountFixed) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountFixed unmarshals an instance of BareMetalServerProfileCpuSocketCountFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -75075,66 +87948,55 @@ func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the VPNGatewayPatch -func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// BareMetalServerProfileCpuSocketCountRange : The permitted range for the number of CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// VPNGatewayPrototype : VPNGatewayPrototype struct -// Models which "extend" this model: -// - VPNGatewayPrototypeVPNGatewayRouteModePrototype -// - VPNGatewayPrototypeVPNGatewayPolicyModePrototype -type VPNGatewayPrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // Identifies a subnet by a unique property. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNGatewayPrototype.Mode property. -// Route mode VPN gateway. +// Constants associated with the BareMetalServerProfileCpuSocketCountRange.Type property. +// The type for this profile field. const ( - VPNGatewayPrototypeModeRouteConst = "route" + BareMetalServerProfileCpuSocketCountRangeTypeRangeConst = "range" ) -func (*VPNGatewayPrototype) isaVPNGatewayPrototype() bool { +func (*BareMetalServerProfileCpuSocketCountRange) isaBareMetalServerProfileCpuSocketCount() bool { return true } -type VPNGatewayPrototypeIntf interface { - isaVPNGatewayPrototype() bool -} - -// UnmarshalVPNGatewayPrototype unmarshals an instance of VPNGatewayPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerProfileCpuSocketCountRange unmarshals an instance of BareMetalServerProfileCpuSocketCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75142,17 +88004,28 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface return } -// VPNGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// BareMetalServerProfileDiskQuantityDependent : The number of disks of this configuration for a bare metal server with this profile depends on its bare metal server +// configuration. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVPNGatewayReferenceDeleted unmarshals an instance of VPNGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// Constants associated with the BareMetalServerProfileDiskQuantityDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileDiskQuantityDependent) isaBareMetalServerProfileDiskQuantity() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskQuantityDependent unmarshals an instance of BareMetalServerProfileDiskQuantityDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75160,262 +88033,76 @@ func UnmarshalVPNGatewayReferenceDeleted(m map[string]json.RawMessage, result in return } -// VPNServer : VPNServer struct -type VPNServer struct { - // The certificate instance for this VPN server. - Certificate *CertificateInstanceReference `json:"certificate" validate:"required"` - - // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified - // methods. - ClientAuthentication []VPNServerAuthenticationIntf `json:"client_authentication" validate:"required"` - - // Indicates whether disconnected VPN clients will be automatically deleted after - // `client_auto_delete_timeout` hours have passed. At present, this is always `true`, but may be modifiable in the - // future. - ClientAutoDelete *bool `json:"client_auto_delete" validate:"required"` - - // If `client_auto_delete` is `true`, the hours after which disconnected VPN clients will be automatically deleted. If - // the value is `0`, disconnected VPN clients will be deleted immediately. This value may be modifiable in the future. - ClientAutoDeleteTimeout *int64 `json:"client_auto_delete_timeout" validate:"required"` - - // The DNS server addresses that will be provided to VPN clients that are connected to this VPN server. - ClientDnsServerIps []IP `json:"client_dns_server_ips" validate:"required"` - - // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not - // disconnect idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout" validate:"required"` - - // The VPN client IPv4 address pool, expressed in CIDR format. - ClientIPPool *string `json:"client_ip_pool" validate:"required"` - - // The date and time that the VPN server was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling" validate:"required"` - - // The reasons for the current VPN server health_state (if any): - // - `cannot_access_client_certificate`: VPN server's client certificate is inaccessible - // (verify certificate exists and that IAM policies grant `VPN server for VPC` access to - // `Secrets Manager`) - // - `cannot_access_server_certificate`: VPN server's server certificate is inaccessible - // (verify certificate exists and that IAM policies grant `VPN server for VPC` access to - // `Secrets Manager`) - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNServerHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // Fully qualified domain name assigned to this VPN server. - Hostname *string `json:"hostname" validate:"required"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN server lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN server. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The port number used by this VPN server. - Port *int64 `json:"port" validate:"required"` - - // The reserved IPs bound to this VPN server. - PrivateIps []ReservedIPReference `json:"private_ips" validate:"required"` - - // The transport protocol used by this VPN server. - Protocol *string `json:"protocol" validate:"required"` - - // The resource group for this VPN server. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this VPN server. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` +// BareMetalServerProfileDiskQuantityEnum : The permitted the number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The subnets this VPN server is provisioned in. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The VPC this VPN server resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VPNServer.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNServerHealthStateDegradedConst = "degraded" - VPNServerHealthStateFaultedConst = "faulted" - VPNServerHealthStateInapplicableConst = "inapplicable" - VPNServerHealthStateOkConst = "ok" -) - -// Constants associated with the VPNServer.LifecycleState property. -// The lifecycle state of the VPN server. -const ( - VPNServerLifecycleStateDeletingConst = "deleting" - VPNServerLifecycleStateFailedConst = "failed" - VPNServerLifecycleStatePendingConst = "pending" - VPNServerLifecycleStateStableConst = "stable" - VPNServerLifecycleStateSuspendedConst = "suspended" - VPNServerLifecycleStateUpdatingConst = "updating" - VPNServerLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNServer.Protocol property. -// The transport protocol used by this VPN server. +// Constants associated with the BareMetalServerProfileDiskQuantityEnum.Type property. +// The type for this profile field. const ( - VPNServerProtocolTCPConst = "tcp" - VPNServerProtocolUDPConst = "udp" + BareMetalServerProfileDiskQuantityEnumTypeEnumConst = "enum" ) -// Constants associated with the VPNServer.ResourceType property. -// The resource type. -const ( - VPNServerResourceTypeVPNServerConst = "vpn_server" -) +func (*BareMetalServerProfileDiskQuantityEnum) isaBareMetalServerProfileDiskQuantity() bool { + return true +} -// UnmarshalVPNServer unmarshals an instance of VPNServer from the specified map of raw messages. -func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServer) - err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthentication) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_auto_delete", &obj.ClientAutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_auto_delete_timeout", &obj.ClientAutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) +// UnmarshalBareMetalServerProfileDiskQuantityEnum unmarshals an instance of BareMetalServerProfileDiskQuantityEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileDiskQuantityFixed : The number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileDiskQuantityFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileDiskQuantityFixed) isaBareMetalServerProfileDiskQuantity() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskQuantityFixed unmarshals an instance of BareMetalServerProfileDiskQuantityFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -75423,55 +88110,55 @@ func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err e return } -// VPNServerAuthentication : An authentication method for this VPN server. -// Models which "extend" this model: -// - VPNServerAuthenticationByUsername -// - VPNServerAuthenticationByCertificate -type VPNServerAuthentication struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` +// BareMetalServerProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The certificate instance used for the VPN client certificate authority (CA). - ClientCa *CertificateInstanceReference `json:"client_ca,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNServerAuthentication.Method property. -// The type of authentication. +// Constants associated with the BareMetalServerProfileDiskQuantityRange.Type property. +// The type for this profile field. const ( - VPNServerAuthenticationMethodCertificateConst = "certificate" - VPNServerAuthenticationMethodUsernameConst = "username" + BareMetalServerProfileDiskQuantityRangeTypeRangeConst = "range" ) -func (*VPNServerAuthentication) isaVPNServerAuthentication() bool { +func (*BareMetalServerProfileDiskQuantityRange) isaBareMetalServerProfileDiskQuantity() bool { return true } -type VPNServerAuthenticationIntf interface { - isaVPNServerAuthentication() bool -} - -// UnmarshalVPNServerAuthentication unmarshals an instance of VPNServerAuthentication from the specified map of raw messages. -func UnmarshalVPNServerAuthentication(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthentication) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) +// UnmarshalBareMetalServerProfileDiskQuantityRange unmarshals an instance of BareMetalServerProfileDiskQuantityRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75479,42 +88166,28 @@ func UnmarshalVPNServerAuthentication(m map[string]json.RawMessage, result inter return } -// VPNServerAuthenticationByUsernameIDProvider : The type of identity provider to be used by VPN client. -// Models which "extend" this model: -// - VPNServerAuthenticationByUsernameIDProviderByIam -type VPNServerAuthenticationByUsernameIDProvider struct { - // The type of identity provider to be used by the VPN client. - // - `iam`: IBM identity and access management - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - ProviderType *string `json:"provider_type,omitempty"` +// BareMetalServerProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for a bare metal server with this profile depends on its bare +// metal server configuration. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNServerAuthenticationByUsernameIDProvider.ProviderType property. -// The type of identity provider to be used by the VPN client. -// - `iam`: IBM identity and access management -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. +// Constants associated with the BareMetalServerProfileDiskSizeDependent.Type property. +// The type for this profile field. const ( - VPNServerAuthenticationByUsernameIDProviderProviderTypeIamConst = "iam" + BareMetalServerProfileDiskSizeDependentTypeDependentConst = "dependent" ) -func (*VPNServerAuthenticationByUsernameIDProvider) isaVPNServerAuthenticationByUsernameIDProvider() bool { +func (*BareMetalServerProfileDiskSizeDependent) isaBareMetalServerProfileDiskSize() bool { return true } -type VPNServerAuthenticationByUsernameIDProviderIntf interface { - isaVPNServerAuthenticationByUsernameIDProvider() bool -} - -// UnmarshalVPNServerAuthenticationByUsernameIDProvider unmarshals an instance of VPNServerAuthenticationByUsernameIDProvider from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsernameIDProvider(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsernameIDProvider) - err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) +// UnmarshalBareMetalServerProfileDiskSizeDependent unmarshals an instance of BareMetalServerProfileDiskSizeDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75522,173 +88195,223 @@ func UnmarshalVPNServerAuthenticationByUsernameIDProvider(m map[string]json.RawM return } -// VPNServerAuthenticationPrototype : An authentication method for this VPN server. -// Models which "extend" this model: -// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype -// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype -type VPNServerAuthenticationPrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` +// BareMetalServerProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The certificate instance to use for the VPN client certificate authority (CA). - ClientCa CertificateInstanceIdentityIntf `json:"client_ca,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VPNServerAuthenticationPrototype.Method property. -// The type of authentication. +// Constants associated with the BareMetalServerProfileDiskSizeEnum.Type property. +// The type for this profile field. const ( - VPNServerAuthenticationPrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeMethodUsernameConst = "username" + BareMetalServerProfileDiskSizeEnumTypeEnumConst = "enum" ) -func (*VPNServerAuthenticationPrototype) isaVPNServerAuthenticationPrototype() bool { +func (*BareMetalServerProfileDiskSizeEnum) isaBareMetalServerProfileDiskSize() bool { return true } -type VPNServerAuthenticationPrototypeIntf interface { - isaVPNServerAuthenticationPrototype() bool -} - -// UnmarshalVPNServerAuthenticationPrototype unmarshals an instance of VPNServerAuthenticationPrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "method", &discValue) +// UnmarshalBareMetalServerProfileDiskSizeEnum unmarshals an instance of BareMetalServerProfileDiskSizeEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'method': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'method' not found in JSON object") + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { return } - if discValue == "certificate" { - err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) - } else if discValue == "username" { - err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'method': %s", discValue) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VPNServerClient : VPNServerClient struct -type VPNServerClient struct { - // The IP address assigned to this VPN client from `client_ip_pool`. - ClientIP *IP `json:"client_ip" validate:"required"` - - // The common name of client certificate that the VPN client provided when connecting to the server. - // - // This property will be present only when the `certificate` client authentication method is enabled on the VPN server. - CommonName *string `json:"common_name,omitempty"` +// BareMetalServerProfileDiskSizeFixed : The size of the disk in GB (gigabytes). +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The date and time that the VPN client was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} - // The date and time that the VPN client was disconnected. - // - // This property will be present only when the client `status` is `disconnected`. - DisconnectedAt *strfmt.DateTime `json:"disconnected_at,omitempty"` +// Constants associated with the BareMetalServerProfileDiskSizeFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeFixedTypeFixedConst = "fixed" +) - // The URL for this VPN client. - Href *string `json:"href" validate:"required"` +func (*BareMetalServerProfileDiskSizeFixed) isaBareMetalServerProfileDiskSize() bool { + return true +} - // The unique identifier for this VPN client. - ID *string `json:"id" validate:"required"` +// UnmarshalBareMetalServerProfileDiskSizeFixed unmarshals an instance of BareMetalServerProfileDiskSizeFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The remote IP address of this VPN client. - RemoteIP *IP `json:"remote_ip" validate:"required"` +// BareMetalServerProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for a bare metal server with this +// profile. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The remote port of this VPN client. - RemotePort *int64 `json:"remote_port" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The status of the VPN client: - // - `connected`: the VPN client is `connected` to this VPN server. - // - `disconnected`: the VPN client is `disconnected` from this VPN server. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // The username that this VPN client provided when connecting to the VPN server. - // - // This property will be present only when the `username` client authentication method is enabled on the VPN server. - Username *string `json:"username,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNServerClient.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerProfileDiskSizeRange.Type property. +// The type for this profile field. const ( - VPNServerClientResourceTypeVPNServerClientConst = "vpn_server_client" + BareMetalServerProfileDiskSizeRangeTypeRangeConst = "range" ) -// Constants associated with the VPNServerClient.Status property. -// The status of the VPN client: -// - `connected`: the VPN client is `connected` to this VPN server. -// - `disconnected`: the VPN client is `disconnected` from this VPN server. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the -// unexpected property value was encountered. -const ( - VPNServerClientStatusConnectedConst = "connected" - VPNServerClientStatusDisconnectedConst = "disconnected" -) +func (*BareMetalServerProfileDiskSizeRange) isaBareMetalServerProfileDiskSize() bool { + return true +} -// UnmarshalVPNServerClient unmarshals an instance of VPNServerClient from the specified map of raw messages. -func UnmarshalVPNServerClient(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClient) - err = core.UnmarshalModel(m, "client_ip", &obj.ClientIP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "common_name", &obj.CommonName) +// UnmarshalBareMetalServerProfileDiskSizeRange unmarshals an instance of BareMetalServerProfileDiskSizeRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "disconnected_at", &obj.DisconnectedAt) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "remote_ip", &obj.RemoteIP, UnmarshalIP) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileIdentityByHref : BareMetalServerProfileIdentityByHref struct +// This model "extends" BareMetalServerProfileIdentity +type BareMetalServerProfileIdentityByHref struct { + // The URL for this bare metal server profile. + Href *string `json:"href" validate:"required"` +} + +// NewBareMetalServerProfileIdentityByHref : Instantiate BareMetalServerProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerProfileIdentityByHref(href string) (_model *BareMetalServerProfileIdentityByHref, err error) { + _model = &BareMetalServerProfileIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "remote_port", &obj.RemotePort) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerProfileIdentityByHref) isaBareMetalServerProfileIdentity() bool { + return true +} + +// UnmarshalBareMetalServerProfileIdentityByHref unmarshals an instance of BareMetalServerProfileIdentityByHref from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileIdentityByName : BareMetalServerProfileIdentityByName struct +// This model "extends" BareMetalServerProfileIdentity +type BareMetalServerProfileIdentityByName struct { + // The name for this bare metal server profile. + Name *string `json:"name" validate:"required"` +} + +// NewBareMetalServerProfileIdentityByName : Instantiate BareMetalServerProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerProfileIdentityByName(name string) (_model *BareMetalServerProfileIdentityByName, err error) { + _model = &BareMetalServerProfileIdentityByName{ + Name: core.StringPtr(name), } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerProfileIdentityByName) isaBareMetalServerProfileIdentity() bool { + return true +} + +// UnmarshalBareMetalServerProfileIdentityByName unmarshals an instance of BareMetalServerProfileIdentityByName from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileMemoryDependent : The memory value for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileMemoryDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileMemoryDependent) isaBareMetalServerProfileMemory() bool { + return true +} + +// UnmarshalBareMetalServerProfileMemoryDependent unmarshals an instance of BareMetalServerProfileMemoryDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75696,45 +88419,41 @@ func UnmarshalVPNServerClient(m map[string]json.RawMessage, result interface{}) return } -// VPNServerClientCollection : VPNServerClientCollection struct -type VPNServerClientCollection struct { - // Collection of VPN clients. - Clients []VPNServerClient `json:"clients" validate:"required"` +// BareMetalServerProfileMemoryEnum : The permitted memory values (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // A link to the first page of resources. - First *VPNServerClientCollectionFirst `json:"first" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerClientCollectionNext `json:"next,omitempty"` +// Constants associated with the BareMetalServerProfileMemoryEnum.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryEnumTypeEnumConst = "enum" +) - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +func (*BareMetalServerProfileMemoryEnum) isaBareMetalServerProfileMemory() bool { + return true } -// UnmarshalVPNServerClientCollection unmarshals an instance of VPNServerClientCollection from the specified map of raw messages. -func UnmarshalVPNServerClientCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollection) - err = core.UnmarshalModel(m, "clients", &obj.Clients, UnmarshalVPNServerClient) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerClientCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// UnmarshalBareMetalServerProfileMemoryEnum unmarshals an instance of BareMetalServerProfileMemoryEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerClientCollectionNext) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -75742,45 +88461,34 @@ func UnmarshalVPNServerClientCollection(m map[string]json.RawMessage, result int return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerClientCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// BareMetalServerProfileMemoryFixed : The memory (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// VPNServerClientCollectionFirst : A link to the first page of resources. -type VPNServerClientCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// Constants associated with the BareMetalServerProfileMemoryFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileMemoryFixed) isaBareMetalServerProfileMemory() bool { + return true } -// UnmarshalVPNServerClientCollectionFirst unmarshals an instance of VPNServerClientCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerClientCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBareMetalServerProfileMemoryFixed unmarshals an instance of BareMetalServerProfileMemoryFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerClientCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerClientCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerClientCollectionNext unmarshals an instance of VPNServerClientCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerClientCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -75788,45 +88496,55 @@ func UnmarshalVPNServerClientCollectionNext(m map[string]json.RawMessage, result return } -// VPNServerCollection : VPNServerCollection struct -type VPNServerCollection struct { - // A link to the first page of resources. - First *VPNServerCollectionFirst `json:"first" validate:"required"` +// BareMetalServerProfileMemoryRange : The permitted memory range (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerCollectionNext `json:"next,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileMemoryRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryRangeTypeRangeConst = "range" +) - // Collection of VPN servers. - VPNServers []VPNServer `json:"vpn_servers" validate:"required"` +func (*BareMetalServerProfileMemoryRange) isaBareMetalServerProfileMemory() bool { + return true } -// UnmarshalVPNServerCollection unmarshals an instance of VPNServerCollection from the specified map of raw messages. -func UnmarshalVPNServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerCollectionFirst) +// UnmarshalBareMetalServerProfileMemoryRange unmarshals an instance of BareMetalServerProfileMemoryRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerCollectionNext) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalModel(m, "vpn_servers", &obj.VPNServers, UnmarshalVPNServer) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75834,45 +88552,28 @@ func UnmarshalVPNServerCollection(m map[string]json.RawMessage, result interface return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNServerCollectionFirst : A link to the first page of resources. -type VPNServerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// BareMetalServerProfileNetworkAttachmentCountDependent : The number of network attachments supported on a bare metal server with this profile is dependent on its +// configuration. +// This model "extends" BareMetalServerProfileNetworkAttachmentCount +type BareMetalServerProfileNetworkAttachmentCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVPNServerCollectionFirst unmarshals an instance of VPNServerCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the BareMetalServerProfileNetworkAttachmentCountDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileNetworkAttachmentCountDependentTypeDependentConst = "dependent" +) -// VPNServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*BareMetalServerProfileNetworkAttachmentCountDependent) isaBareMetalServerProfileNetworkAttachmentCount() bool { + return true } -// UnmarshalVPNServerCollectionNext unmarshals an instance of VPNServerCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBareMetalServerProfileNetworkAttachmentCountDependent unmarshals an instance of BareMetalServerProfileNetworkAttachmentCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkAttachmentCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkAttachmentCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75880,40 +88581,41 @@ func UnmarshalVPNServerCollectionNext(m map[string]json.RawMessage, result inter return } -// VPNServerHealthReason : VPNServerHealthReason struct -type VPNServerHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` +// BareMetalServerProfileNetworkAttachmentCountRange : The number of network attachments supported on a bare metal server with this profile. +// This model "extends" BareMetalServerProfileNetworkAttachmentCount +type BareMetalServerProfileNetworkAttachmentCountRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNServerHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. +// Constants associated with the BareMetalServerProfileNetworkAttachmentCountRange.Type property. +// The type for this profile field. const ( - VPNServerHealthReasonCodeCannotAccessClientCertificateConst = "cannot_access_client_certificate" - VPNServerHealthReasonCodeCannotAccessServerCertificateConst = "cannot_access_server_certificate" - VPNServerHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" - VPNServerHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNServerHealthReasonCodeInternalErrorConst = "internal_error" + BareMetalServerProfileNetworkAttachmentCountRangeTypeRangeConst = "range" ) -// UnmarshalVPNServerHealthReason unmarshals an instance of VPNServerHealthReason from the specified map of raw messages. -func UnmarshalVPNServerHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +func (*BareMetalServerProfileNetworkAttachmentCountRange) isaBareMetalServerProfileNetworkAttachmentCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileNetworkAttachmentCountRange unmarshals an instance of BareMetalServerProfileNetworkAttachmentCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkAttachmentCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkAttachmentCountRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75921,36 +88623,70 @@ func UnmarshalVPNServerHealthReason(m map[string]json.RawMessage, result interfa return } -// VPNServerLifecycleReason : VPNServerLifecycleReason struct -type VPNServerLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` +// BareMetalServerProfileNetworkInterfaceCountDependent : The number of bare metal server network interfaces supported on a bare metal server with this profile is dependent on +// its configuration. +// This model "extends" BareMetalServerProfileNetworkInterfaceCount +type BareMetalServerProfileNetworkInterfaceCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` +// Constants associated with the BareMetalServerProfileNetworkInterfaceCountDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" +) - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` +func (*BareMetalServerProfileNetworkInterfaceCountDependent) isaBareMetalServerProfileNetworkInterfaceCount() bool { + return true } -// Constants associated with the VPNServerLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. +// UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkInterfaceCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileNetworkInterfaceCountRange : The number of bare metal server network interfaces supported on a bare metal server with this profile. +// This model "extends" BareMetalServerProfileNetworkInterfaceCount +type BareMetalServerProfileNetworkInterfaceCountRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileNetworkInterfaceCountRange.Type property. +// The type for this profile field. const ( - VPNServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" + BareMetalServerProfileNetworkInterfaceCountRangeTypeRangeConst = "range" ) -// UnmarshalVPNServerLifecycleReason unmarshals an instance of VPNServerLifecycleReason from the specified map of raw messages. -func UnmarshalVPNServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +func (*BareMetalServerProfileNetworkInterfaceCountRange) isaBareMetalServerProfileNetworkInterfaceCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileNetworkInterfaceCountRange unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileNetworkInterfaceCountRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -75958,127 +88694,97 @@ func UnmarshalVPNServerLifecycleReason(m map[string]json.RawMessage, result inte return } -// VPNServerPatch : VPNServerPatch struct -type VPNServerPatch struct { - // The certificate instance for this VPN server. - Certificate CertificateInstanceIdentityIntf `json:"certificate,omitempty"` +// BareMetalServerPrototypeBareMetalServerByNetworkAttachment : BareMetalServerPrototypeBareMetalServerByNetworkAttachment struct +// This model "extends" BareMetalServerPrototype +type BareMetalServerPrototypeBareMetalServerByNetworkAttachment struct { + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to + // boot. + EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - // The authentication methods to use to authenticate VPN client on this VPN server - // (replacing any existing methods). - ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication,omitempty"` + Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - // The DNS server addresses that will be provided to VPN clients connected to this VPN server (replacing any existing - // addresses). - ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` + // The name for this bare metal server. The name must not be used by another bare metal server in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` - // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not - // disconnect idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) to use for this bare metal + // server. + Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` - // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) - // - // The prefix length of the client IP address pool's CIDR must be between - // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses - // that are required to enable the maximum number of concurrent connections is recommended. - ClientIPPool *string `json:"client_ip_pool,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` + TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - // The name for this VPN server. The name must not be used by another VPN server in the VPC. - Name *string `json:"name,omitempty"` + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The port number used by this VPN server. - Port *int64 `json:"port,omitempty"` + // The zone this bare metal server will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The transport protocol used by this VPN server. - Protocol *string `json:"protocol,omitempty"` + // The additional network attachments to create for the bare metal server. + NetworkAttachments []BareMetalServerNetworkAttachmentPrototypeIntf `json:"network_attachments,omitempty"` - // The subnets to provision this VPN server in (replacing the existing subnets). - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` + // The primary network attachment to create for the bare metal server. + PrimaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf `json:"primary_network_attachment" validate:"required"` } -// Constants associated with the VPNServerPatch.Protocol property. -// The transport protocol used by this VPN server. -const ( - VPNServerPatchProtocolTCPConst = "tcp" - VPNServerPatchProtocolUDPConst = "udp" -) - -// UnmarshalVPNServerPatch unmarshals an instance of VPNServerPatch from the specified map of raw messages. -func UnmarshalVPNServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerPatch) - err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceIdentity) - if err != nil { - return +// NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment : Instantiate BareMetalServerPrototypeBareMetalServerByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment(initialization *BareMetalServerInitializationPrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf) (_model *BareMetalServerPrototypeBareMetalServerByNetworkAttachment, err error) { + _model = &BareMetalServerPrototypeBareMetalServerByNetworkAttachment{ + Initialization: initialization, + Profile: profile, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } - err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthenticationPrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerPrototypeBareMetalServerByNetworkAttachment) isaBareMetalServerPrototype() bool { + return true +} + +// UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment unmarshals an instance of BareMetalServerPrototypeBareMetalServerByNetworkAttachment from the specified map of raw messages. +func UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrototypeBareMetalServerByNetworkAttachment) + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) if err != nil { return } - err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) + err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNServerPatch -func (vpnServerPatch *VPNServerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnServerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNServerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNServerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPNServerReferenceDeleted unmarshals an instance of VPNServerReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNServerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype) if err != nil { return } @@ -76086,159 +88792,223 @@ func UnmarshalVPNServerReferenceDeleted(m map[string]json.RawMessage, result int return } -// VPNServerRoute : VPNServerRoute struct -type VPNServerRoute struct { - // The action to perform with a packet matching the VPN route: - // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. - // - `deliver`: deliver the packet into the VPC. - // - `drop`: drop the packet - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // The date and time that the VPN route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// BareMetalServerPrototypeBareMetalServerByNetworkInterface : BareMetalServerPrototypeBareMetalServerByNetworkInterface struct +// This model "extends" BareMetalServerPrototype +type BareMetalServerPrototypeBareMetalServerByNetworkInterface struct { + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to + // boot. + EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - // The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will - // be dropped. - Destination *string `json:"destination" validate:"required"` + Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - // The reasons for the current VPN server route health_state (if any): - // - `internal_error`: Internal error (contact IBM support) + // The name for this bare metal server. The name must not be used by another bare metal server in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNServerRouteHealthReason `json:"health_reasons" validate:"required"` + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) to use for this bare metal + // server. + Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` - // The URL for this VPN route. - Href *string `json:"href" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The unique identifier for this VPN route. - ID *string `json:"id" validate:"required"` + TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - // The reasons for the current VPN server route lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNServerRouteLifecycleReason `json:"lifecycle_reasons" validate:"required"` + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The lifecycle state of the VPN route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The zone this bare metal server will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The name for this VPN route. The name is unique across all routes for a VPN server. - Name *string `json:"name" validate:"required"` + // The additional bare metal server network interfaces to create. + NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The primary bare metal server network interface to create. + PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -// Constants associated with the VPNServerRoute.Action property. -// The action to perform with a packet matching the VPN route: -// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. -// - `deliver`: deliver the packet into the VPC. -// - `drop`: drop the packet -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the -// unexpected property value was encountered. -const ( - VPNServerRouteActionDeliverConst = "deliver" - VPNServerRouteActionDropConst = "drop" - VPNServerRouteActionTranslateConst = "translate" -) - -// Constants associated with the VPNServerRoute.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNServerRouteHealthStateDegradedConst = "degraded" - VPNServerRouteHealthStateFaultedConst = "faulted" - VPNServerRouteHealthStateInapplicableConst = "inapplicable" - VPNServerRouteHealthStateOkConst = "ok" -) - -// Constants associated with the VPNServerRoute.LifecycleState property. -// The lifecycle state of the VPN route. -const ( - VPNServerRouteLifecycleStateDeletingConst = "deleting" - VPNServerRouteLifecycleStateFailedConst = "failed" - VPNServerRouteLifecycleStatePendingConst = "pending" - VPNServerRouteLifecycleStateStableConst = "stable" - VPNServerRouteLifecycleStateSuspendedConst = "suspended" - VPNServerRouteLifecycleStateUpdatingConst = "updating" - VPNServerRouteLifecycleStateWaitingConst = "waiting" -) +// NewBareMetalServerPrototypeBareMetalServerByNetworkInterface : Instantiate BareMetalServerPrototypeBareMetalServerByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerPrototypeBareMetalServerByNetworkInterface(initialization *BareMetalServerInitializationPrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype) (_model *BareMetalServerPrototypeBareMetalServerByNetworkInterface, err error) { + _model = &BareMetalServerPrototypeBareMetalServerByNetworkInterface{ + Initialization: initialization, + Profile: profile, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the VPNServerRoute.ResourceType property. -// The resource type. -const ( - VPNServerRouteResourceTypeVPNServerRouteConst = "vpn_server_route" -) +func (*BareMetalServerPrototypeBareMetalServerByNetworkInterface) isaBareMetalServerPrototype() bool { + return true +} -// UnmarshalVPNServerRoute unmarshals an instance of VPNServerRoute from the specified map of raw messages. -func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRoute) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface unmarshals an instance of BareMetalServerPrototypeBareMetalServerByNetworkInterface from the specified map of raw messages. +func UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrototypeBareMetalServerByNetworkInterface) + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerRouteHealthReason) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerRouteLifecycleReason) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CatalogOfferingIdentityCatalogOfferingByCRN : CatalogOfferingIdentityCatalogOfferingByCRN struct +// This model "extends" CatalogOfferingIdentity +type CatalogOfferingIdentityCatalogOfferingByCRN struct { + // The CRN for this + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + CRN *string `json:"crn" validate:"required"` +} + +// NewCatalogOfferingIdentityCatalogOfferingByCRN : Instantiate CatalogOfferingIdentityCatalogOfferingByCRN (Generic Model Constructor) +func (*VpcV1) NewCatalogOfferingIdentityCatalogOfferingByCRN(crn string) (_model *CatalogOfferingIdentityCatalogOfferingByCRN, err error) { + _model = &CatalogOfferingIdentityCatalogOfferingByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*CatalogOfferingIdentityCatalogOfferingByCRN) isaCatalogOfferingIdentity() bool { + return true +} + +// UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN unmarshals an instance of CatalogOfferingIdentityCatalogOfferingByCRN from the specified map of raw messages. +func UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CatalogOfferingIdentityCatalogOfferingByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct +// This model "extends" CatalogOfferingVersionIdentity +type CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct { + // The CRN for this version of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. + CRN *string `json:"crn" validate:"required"` +} + +// NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : Instantiate CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN (Generic Model Constructor) +func (*VpcV1) NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(crn string) (_model *CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN, err error) { + _model = &CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) isaCatalogOfferingVersionIdentity() bool { + return true +} + +// UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN unmarshals an instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN from the specified map of raw messages. +func UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CertificateInstanceIdentityByCRN : CertificateInstanceIdentityByCRN struct +// This model "extends" CertificateInstanceIdentity +type CertificateInstanceIdentityByCRN struct { + // The CRN for this certificate instance. + CRN *string `json:"crn" validate:"required"` +} + +// NewCertificateInstanceIdentityByCRN : Instantiate CertificateInstanceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewCertificateInstanceIdentityByCRN(crn string) (_model *CertificateInstanceIdentityByCRN, err error) { + _model = &CertificateInstanceIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*CertificateInstanceIdentityByCRN) isaCertificateInstanceIdentity() bool { + return true +} + +// UnmarshalCertificateInstanceIdentityByCRN unmarshals an instance of CertificateInstanceIdentityByCRN from the specified map of raw messages. +func UnmarshalCertificateInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CertificateInstanceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CloudObjectStorageBucketIdentityByCRN : CloudObjectStorageBucketIdentityByCRN struct +// This model "extends" CloudObjectStorageBucketIdentity +type CloudObjectStorageBucketIdentityByCRN struct { + // The CRN of this Cloud Object Storage bucket. + CRN *string `json:"crn" validate:"required"` +} + +// NewCloudObjectStorageBucketIdentityByCRN : Instantiate CloudObjectStorageBucketIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewCloudObjectStorageBucketIdentityByCRN(crn string) (_model *CloudObjectStorageBucketIdentityByCRN, err error) { + _model = &CloudObjectStorageBucketIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*CloudObjectStorageBucketIdentityByCRN) isaCloudObjectStorageBucketIdentity() bool { + return true +} + +// UnmarshalCloudObjectStorageBucketIdentityByCRN unmarshals an instance of CloudObjectStorageBucketIdentityByCRN from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -76246,45 +89016,91 @@ func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) ( return } -// VPNServerRouteCollection : VPNServerRouteCollection struct -type VPNServerRouteCollection struct { - // A link to the first page of resources. - First *VPNServerRouteCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerRouteCollectionNext `json:"next,omitempty"` +// CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct +// This model "extends" CloudObjectStorageBucketIdentity +type CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` +} - // Collection of VPN routes. - Routes []VPNServerRoute `json:"routes" validate:"required"` +// NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) +func (*VpcV1) NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { + _model = &CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +func (*CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaCloudObjectStorageBucketIdentity() bool { + return true } -// UnmarshalVPNServerRouteCollection unmarshals an instance of VPNServerRouteCollection from the specified map of raw messages. -func UnmarshalVPNServerRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerRouteCollectionFirst) +// UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DnsInstanceIdentityByCRN : DnsInstanceIdentityByCRN struct +// This model "extends" DnsInstanceIdentity +type DnsInstanceIdentityByCRN struct { + // The CRN for this DNS instance. + CRN *string `json:"crn" validate:"required"` +} + +// NewDnsInstanceIdentityByCRN : Instantiate DnsInstanceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewDnsInstanceIdentityByCRN(crn string) (_model *DnsInstanceIdentityByCRN, err error) { + _model = &DnsInstanceIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerRouteCollectionNext) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DnsInstanceIdentityByCRN) isaDnsInstanceIdentity() bool { + return true +} + +// UnmarshalDnsInstanceIdentityByCRN unmarshals an instance of DnsInstanceIdentityByCRN from the specified map of raw messages. +func UnmarshalDnsInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsInstanceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalVPNServerRoute) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DnsZoneIdentityByID : DnsZoneIdentityByID struct +// This model "extends" DnsZoneIdentity +type DnsZoneIdentityByID struct { + ID *string `json:"id" validate:"required"` +} + +// NewDnsZoneIdentityByID : Instantiate DnsZoneIdentityByID (Generic Model Constructor) +func (*VpcV1) NewDnsZoneIdentityByID(id string) (_model *DnsZoneIdentityByID, err error) { + _model = &DnsZoneIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DnsZoneIdentityByID) isaDnsZoneIdentity() bool { + return true +} + +// UnmarshalDnsZoneIdentityByID unmarshals an instance of DnsZoneIdentityByID from the specified map of raw messages. +func UnmarshalDnsZoneIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsZoneIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -76292,28 +89108,30 @@ func UnmarshalVPNServerRouteCollection(m map[string]json.RawMessage, result inte return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerRouteCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// DedicatedHostGroupIdentityByCRN : DedicatedHostGroupIdentityByCRN struct +// This model "extends" DedicatedHostGroupIdentity +type DedicatedHostGroupIdentityByCRN struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` +} + +// NewDedicatedHostGroupIdentityByCRN : Instantiate DedicatedHostGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostGroupIdentityByCRN(crn string) (_model *DedicatedHostGroupIdentityByCRN, err error) { + _model = &DedicatedHostGroupIdentityByCRN{ + CRN: core.StringPtr(crn), } - return start, nil + err = core.ValidateStruct(_model, "required parameters") + return } -// VPNServerRouteCollectionFirst : A link to the first page of resources. -type VPNServerRouteCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*DedicatedHostGroupIdentityByCRN) isaDedicatedHostGroupIdentity() bool { + return true } -// UnmarshalVPNServerRouteCollectionFirst unmarshals an instance of VPNServerRouteCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalDedicatedHostGroupIdentityByCRN unmarshals an instance of DedicatedHostGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -76321,15 +89139,29 @@ func UnmarshalVPNServerRouteCollectionFirst(m map[string]json.RawMessage, result return } -// VPNServerRouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerRouteCollectionNext struct { - // The URL for a page of resources. +// DedicatedHostGroupIdentityByHref : DedicatedHostGroupIdentityByHref struct +// This model "extends" DedicatedHostGroupIdentity +type DedicatedHostGroupIdentityByHref struct { + // The URL for this dedicated host group. Href *string `json:"href" validate:"required"` } -// UnmarshalVPNServerRouteCollectionNext unmarshals an instance of VPNServerRouteCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollectionNext) +// NewDedicatedHostGroupIdentityByHref : Instantiate DedicatedHostGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostGroupIdentityByHref(href string) (_model *DedicatedHostGroupIdentityByHref, err error) { + _model = &DedicatedHostGroupIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DedicatedHostGroupIdentityByHref) isaDedicatedHostGroupIdentity() bool { + return true +} + +// UnmarshalDedicatedHostGroupIdentityByHref unmarshals an instance of DedicatedHostGroupIdentityByHref from the specified map of raw messages. +func UnmarshalDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -76338,36 +89170,30 @@ func UnmarshalVPNServerRouteCollectionNext(m map[string]json.RawMessage, result return } -// VPNServerRouteHealthReason : VPNServerRouteHealthReason struct -type VPNServerRouteHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` +// DedicatedHostGroupIdentityByID : DedicatedHostGroupIdentityByID struct +// This model "extends" DedicatedHostGroupIdentity +type DedicatedHostGroupIdentityByID struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` +} - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` +// NewDedicatedHostGroupIdentityByID : Instantiate DedicatedHostGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostGroupIdentityByID(id string) (_model *DedicatedHostGroupIdentityByID, err error) { + _model = &DedicatedHostGroupIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the VPNServerRouteHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPNServerRouteHealthReasonCodeInternalErrorConst = "internal_error" -) +func (*DedicatedHostGroupIdentityByID) isaDedicatedHostGroupIdentity() bool { + return true +} -// UnmarshalVPNServerRouteHealthReason unmarshals an instance of VPNServerRouteHealthReason from the specified map of raw messages. -func UnmarshalVPNServerRouteHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalDedicatedHostGroupIdentityByID unmarshals an instance of DedicatedHostGroupIdentityByID from the specified map of raw messages. +func UnmarshalDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -76375,36 +89201,30 @@ func UnmarshalVPNServerRouteHealthReason(m map[string]json.RawMessage, result in return } -// VPNServerRouteLifecycleReason : VPNServerRouteLifecycleReason struct -type VPNServerRouteLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` +// DedicatedHostProfileIdentityByHref : DedicatedHostProfileIdentityByHref struct +// This model "extends" DedicatedHostProfileIdentity +type DedicatedHostProfileIdentityByHref struct { + // The URL for this dedicated host profile. + Href *string `json:"href" validate:"required"` +} - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` +// NewDedicatedHostProfileIdentityByHref : Instantiate DedicatedHostProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostProfileIdentityByHref(href string) (_model *DedicatedHostProfileIdentityByHref, err error) { + _model = &DedicatedHostProfileIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the VPNServerRouteLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - VPNServerRouteLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) +func (*DedicatedHostProfileIdentityByHref) isaDedicatedHostProfileIdentity() bool { + return true +} -// UnmarshalVPNServerRouteLifecycleReason unmarshals an instance of VPNServerRouteLifecycleReason from the specified map of raw messages. -func UnmarshalVPNServerRouteLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalDedicatedHostProfileIdentityByHref unmarshals an instance of DedicatedHostProfileIdentityByHref from the specified map of raw messages. +func UnmarshalDedicatedHostProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -76412,15 +89232,29 @@ func UnmarshalVPNServerRouteLifecycleReason(m map[string]json.RawMessage, result return } -// VPNServerRoutePatch : VPNServerRoutePatch struct -type VPNServerRoutePatch struct { - // The name for this VPN server route. The name must not be used by another route for the VPN server. - Name *string `json:"name,omitempty"` +// DedicatedHostProfileIdentityByName : DedicatedHostProfileIdentityByName struct +// This model "extends" DedicatedHostProfileIdentity +type DedicatedHostProfileIdentityByName struct { + // The globally unique name for this dedicated host profile. + Name *string `json:"name" validate:"required"` } -// UnmarshalVPNServerRoutePatch unmarshals an instance of VPNServerRoutePatch from the specified map of raw messages. -func UnmarshalVPNServerRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRoutePatch) +// NewDedicatedHostProfileIdentityByName : Instantiate DedicatedHostProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostProfileIdentityByName(name string) (_model *DedicatedHostProfileIdentityByName, err error) { + _model = &DedicatedHostProfileIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DedicatedHostProfileIdentityByName) isaDedicatedHostProfileIdentity() bool { + return true +} + +// UnmarshalDedicatedHostProfileIdentityByName unmarshals an instance of DedicatedHostProfileIdentityByName from the specified map of raw messages. +func UnmarshalDedicatedHostProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -76429,145 +89263,104 @@ func UnmarshalVPNServerRoutePatch(m map[string]json.RawMessage, result interface return } -// AsPatch returns a generic map representation of the VPNServerRoutePatch -func (vpnServerRoutePatch *VPNServerRoutePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnServerRoutePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// DedicatedHostProfileMemoryDependent : The memory value for a dedicated host with this profile depends on its configuration. +// This model "extends" DedicatedHostProfileMemory +type DedicatedHostProfileMemoryDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// VirtualNetworkInterface : VirtualNetworkInterface struct -type VirtualNetworkInterface struct { - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the virtual network interface was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the virtual network interface. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The reserved IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource group for this virtual network interface. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// Constants associated with the DedicatedHostProfileMemoryDependent.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileMemoryDependentTypeDependentConst = "dependent" +) - // The security groups for this virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` +func (*DedicatedHostProfileMemoryDependent) isaDedicatedHostProfileMemory() bool { + return true +} - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` +// UnmarshalDedicatedHostProfileMemoryDependent unmarshals an instance of DedicatedHostProfileMemoryDependent from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemoryDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The target of this virtual network interface. - // - // If absent, this virtual network interface is not attached to a target. - Target VirtualNetworkInterfaceTargetIntf `json:"target,omitempty"` +// DedicatedHostProfileMemoryEnum : The permitted memory values (in gibibytes) for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileMemory +type DedicatedHostProfileMemoryEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The VPC this virtual network interface resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The zone this virtual network interface resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VirtualNetworkInterface.LifecycleState property. -// The lifecycle state of the virtual network interface. +// Constants associated with the DedicatedHostProfileMemoryEnum.Type property. +// The type for this profile field. const ( - VirtualNetworkInterfaceLifecycleStateDeletingConst = "deleting" - VirtualNetworkInterfaceLifecycleStateFailedConst = "failed" - VirtualNetworkInterfaceLifecycleStatePendingConst = "pending" - VirtualNetworkInterfaceLifecycleStateStableConst = "stable" - VirtualNetworkInterfaceLifecycleStateSuspendedConst = "suspended" - VirtualNetworkInterfaceLifecycleStateUpdatingConst = "updating" - VirtualNetworkInterfaceLifecycleStateWaitingConst = "waiting" + DedicatedHostProfileMemoryEnumTypeEnumConst = "enum" ) -// Constants associated with the VirtualNetworkInterface.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) +func (*DedicatedHostProfileMemoryEnum) isaDedicatedHostProfileMemory() bool { + return true +} -// UnmarshalVirtualNetworkInterface unmarshals an instance of VirtualNetworkInterface from the specified map of raw messages. -func UnmarshalVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterface) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) +// UnmarshalDedicatedHostProfileMemoryEnum unmarshals an instance of DedicatedHostProfileMemoryEnum from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemoryEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalVirtualNetworkInterfaceTarget) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostProfileMemoryFixed : The memory (in gibibytes) for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileMemory +type DedicatedHostProfileMemoryFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the DedicatedHostProfileMemoryFixed.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileMemoryFixedTypeFixedConst = "fixed" +) + +func (*DedicatedHostProfileMemoryFixed) isaDedicatedHostProfileMemory() bool { + return true +} + +// UnmarshalDedicatedHostProfileMemoryFixed unmarshals an instance of DedicatedHostProfileMemoryFixed from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemoryFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -76575,45 +89368,55 @@ func UnmarshalVirtualNetworkInterface(m map[string]json.RawMessage, result inter return } -// VirtualNetworkInterfaceCollection : VirtualNetworkInterfaceCollection struct -type VirtualNetworkInterfaceCollection struct { - // A link to the first page of resources. - First *VirtualNetworkInterfaceCollectionFirst `json:"first" validate:"required"` +// DedicatedHostProfileMemoryRange : The permitted memory range (in gibibytes) for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileMemory +type DedicatedHostProfileMemoryRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VirtualNetworkInterfaceCollectionNext `json:"next,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// Constants associated with the DedicatedHostProfileMemoryRange.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileMemoryRangeTypeRangeConst = "range" +) - // Collection of virtual network interfaces. - VirtualNetworkInterfaces []VirtualNetworkInterface `json:"virtual_network_interfaces" validate:"required"` +func (*DedicatedHostProfileMemoryRange) isaDedicatedHostProfileMemory() bool { + return true } -// UnmarshalVirtualNetworkInterfaceCollection unmarshals an instance of VirtualNetworkInterfaceCollection from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVirtualNetworkInterfaceCollectionFirst) +// UnmarshalDedicatedHostProfileMemoryRange unmarshals an instance of DedicatedHostProfileMemoryRange from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemoryRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVirtualNetworkInterfaceCollectionNext) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalModel(m, "virtual_network_interfaces", &obj.VirtualNetworkInterfaces, UnmarshalVirtualNetworkInterface) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -76621,45 +89424,27 @@ func UnmarshalVirtualNetworkInterfaceCollection(m map[string]json.RawMessage, re return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VirtualNetworkInterfaceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VirtualNetworkInterfaceCollectionFirst : A link to the first page of resources. -type VirtualNetworkInterfaceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// DedicatedHostProfileSocketDependent : The CPU socket count for a dedicated host with this profile depends on its configuration. +// This model "extends" DedicatedHostProfileSocket +type DedicatedHostProfileSocketDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVirtualNetworkInterfaceCollectionFirst unmarshals an instance of VirtualNetworkInterfaceCollectionFirst from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the DedicatedHostProfileSocketDependent.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileSocketDependentTypeDependentConst = "dependent" +) -// VirtualNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VirtualNetworkInterfaceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*DedicatedHostProfileSocketDependent) isaDedicatedHostProfileSocket() bool { + return true } -// UnmarshalVirtualNetworkInterfaceCollectionNext unmarshals an instance of VirtualNetworkInterfaceCollectionNext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalDedicatedHostProfileSocketDependent unmarshals an instance of DedicatedHostProfileSocketDependent from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocketDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocketDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -76667,87 +89452,76 @@ func UnmarshalVirtualNetworkInterfaceCollectionNext(m map[string]json.RawMessage return } -// VirtualNetworkInterfacePatch : VirtualNetworkInterfacePatch struct -type VirtualNetworkInterfacePatch struct { - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name,omitempty"` -} +// DedicatedHostProfileSocketEnum : The permitted values for CPU socket count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileSocket +type DedicatedHostProfileSocketEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// UnmarshalVirtualNetworkInterfacePatch unmarshals an instance of VirtualNetworkInterfacePatch from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// AsPatch returns a generic map representation of the VirtualNetworkInterfacePatch -func (virtualNetworkInterfacePatch *VirtualNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(virtualNetworkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// VirtualNetworkInterfacePrimaryIPPrototype : VirtualNetworkInterfacePrimaryIPPrototype struct -// Models which "extend" this model: -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext -type VirtualNetworkInterfacePrimaryIPPrototype struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} +// Constants associated with the DedicatedHostProfileSocketEnum.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileSocketEnumTypeEnumConst = "enum" +) -func (*VirtualNetworkInterfacePrimaryIPPrototype) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { +func (*DedicatedHostProfileSocketEnum) isaDedicatedHostProfileSocket() bool { return true } -type VirtualNetworkInterfacePrimaryIPPrototypeIntf interface { - isaVirtualNetworkInterfacePrimaryIPPrototype() bool -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototype unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototype from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalDedicatedHostProfileSocketEnum unmarshals an instance of DedicatedHostProfileSocketEnum from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocketEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocketEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostProfileSocketFixed : The CPU socket count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileSocket +type DedicatedHostProfileSocketFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the DedicatedHostProfileSocketFixed.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileSocketFixedTypeFixedConst = "fixed" +) + +func (*DedicatedHostProfileSocketFixed) isaDedicatedHostProfileSocket() bool { + return true +} + +// UnmarshalDedicatedHostProfileSocketFixed unmarshals an instance of DedicatedHostProfileSocketFixed from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocketFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocketFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -76755,50 +89529,55 @@ func UnmarshalVirtualNetworkInterfacePrimaryIPPrototype(m map[string]json.RawMes return } -// VirtualNetworkInterfaceReferenceAttachmentContext : VirtualNetworkInterfaceReferenceAttachmentContext struct -type VirtualNetworkInterfaceReferenceAttachmentContext struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` +// DedicatedHostProfileSocketRange : The permitted range for CPU socket count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileSocket +type DedicatedHostProfileSocketRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VirtualNetworkInterfaceReferenceAttachmentContext.ResourceType property. -// The resource type. +// Constants associated with the DedicatedHostProfileSocketRange.Type property. +// The type for this profile field. const ( - VirtualNetworkInterfaceReferenceAttachmentContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" + DedicatedHostProfileSocketRangeTypeRangeConst = "range" ) -// UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext unmarshals an instance of VirtualNetworkInterfaceReferenceAttachmentContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceAttachmentContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +func (*DedicatedHostProfileSocketRange) isaDedicatedHostProfileSocket() bool { + return true +} + +// UnmarshalDedicatedHostProfileSocketRange unmarshals an instance of DedicatedHostProfileSocketRange from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocketRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocketRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -76806,17 +89585,27 @@ func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]jso return } -// VirtualNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VirtualNetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// DedicatedHostProfileVcpuDependent : The VCPU count for a dedicated host with this profile depends on its configuration. +// This model "extends" DedicatedHostProfileVcpu +type DedicatedHostProfileVcpuDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVirtualNetworkInterfaceReferenceDeleted unmarshals an instance of VirtualNetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// Constants associated with the DedicatedHostProfileVcpuDependent.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuDependentTypeDependentConst = "dependent" +) + +func (*DedicatedHostProfileVcpuDependent) isaDedicatedHostProfileVcpu() bool { + return true +} + +// UnmarshalDedicatedHostProfileVcpuDependent unmarshals an instance of DedicatedHostProfileVcpuDependent from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -76824,65 +89613,76 @@ func UnmarshalVirtualNetworkInterfaceReferenceDeleted(m map[string]json.RawMessa return } -// VirtualNetworkInterfaceTarget : A virtual network interface target. -// -// The resource types that can be virtual network interface targets are expected to expand in the future. When iterating -// over virtual network interface targets, do not assume that every target resource will be from a known set of resource -// types. Optionally halt processing and surface an error, or bypass resources of unrecognized types. -// Models which "extend" this model: -// - VirtualNetworkInterfaceTargetShareMountTargetReference -type VirtualNetworkInterfaceTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href,omitempty"` - - // The unique identifier for this share mount target. - ID *string `json:"id,omitempty"` +// DedicatedHostProfileVcpuEnum : The permitted values for VCPU count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileVcpu +type DedicatedHostProfileVcpuEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VirtualNetworkInterfaceTarget.ResourceType property. -// The resource type. +// Constants associated with the DedicatedHostProfileVcpuEnum.Type property. +// The type for this profile field. const ( - VirtualNetworkInterfaceTargetResourceTypeShareMountTargetConst = "share_mount_target" + DedicatedHostProfileVcpuEnumTypeEnumConst = "enum" ) -func (*VirtualNetworkInterfaceTarget) isaVirtualNetworkInterfaceTarget() bool { +func (*DedicatedHostProfileVcpuEnum) isaDedicatedHostProfileVcpu() bool { return true } -type VirtualNetworkInterfaceTargetIntf interface { - isaVirtualNetworkInterfaceTarget() bool -} - -// UnmarshalVirtualNetworkInterfaceTarget unmarshals an instance of VirtualNetworkInterfaceTarget from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) +// UnmarshalDedicatedHostProfileVcpuEnum unmarshals an instance of DedicatedHostProfileVcpuEnum from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostProfileVcpuFixed : The VCPU count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileVcpu +type DedicatedHostProfileVcpuFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the DedicatedHostProfileVcpuFixed.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuFixedTypeFixedConst = "fixed" +) + +func (*DedicatedHostProfileVcpuFixed) isaDedicatedHostProfileVcpu() bool { + return true +} + +// UnmarshalDedicatedHostProfileVcpuFixed unmarshals an instance of DedicatedHostProfileVcpuFixed from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -76890,275 +89690,359 @@ func UnmarshalVirtualNetworkInterfaceTarget(m map[string]json.RawMessage, result return } -// Volume : Volume struct -type Volume struct { - // Indicates whether a running virtual server instance has an attachment to this volume. - Active *bool `json:"active" validate:"required"` - - // The attachment state of the volume - // - `unattached`: Not attached to any virtual server instances - // - `attached`: Attached to a virtual server instance (even if the instance is stopped) - // - `unusable`: Not able to be attached to any virtual server instances. - AttachmentState *string `json:"attachment_state" validate:"required"` - - // The maximum bandwidth (in megabits per second) for the volume. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // Indicates whether this volume is performing an operation that must be serialized. This must be `false` to perform an - // operation that is specified to require serialization. - Busy *bool `json:"busy" validate:"required"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` - - // The date and time that the volume was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // The type of encryption used on the volume. - Encryption *string `json:"encryption" validate:"required"` - - // The root key used to wrap the data encryption key for the volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VolumeHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this volume. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` - - // The maximum I/O operations per second (IOPS) for this volume. - Iops *int64 `json:"iops" validate:"required"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` - - // The operating system associated with this volume. If absent, this volume was not - // created from an image, or the image did not include an operating system. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for - // this volume. - Profile *VolumeProfileReference `json:"profile" validate:"required"` - - // The resource group for this volume. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The image from which this volume was created (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this volume was not created from an image. - SourceImage *ImageReference `json:"source_image,omitempty"` - - // The snapshot from which this volume was cloned. - SourceSnapshot *SnapshotReference `json:"source_snapshot,omitempty"` - - // The status of the volume. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VolumeStatusReason `json:"status_reasons" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags" validate:"required"` - - // The volume attachments for this volume. - VolumeAttachments []VolumeAttachmentReferenceVolumeContext `json:"volume_attachments" validate:"required"` - - // The zone this volume resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} +// DedicatedHostProfileVcpuRange : The permitted range for VCPU count for a dedicated host with this profile. +// This model "extends" DedicatedHostProfileVcpu +type DedicatedHostProfileVcpuRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// Constants associated with the Volume.AttachmentState property. -// The attachment state of the volume -// - `unattached`: Not attached to any virtual server instances -// - `attached`: Attached to a virtual server instance (even if the instance is stopped) -// - `unusable`: Not able to be attached to any virtual server instances. -const ( - VolumeAttachmentStateAttachedConst = "attached" - VolumeAttachmentStateUnattachedConst = "unattached" - VolumeAttachmentStateUnusableConst = "unusable" -) + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` -// Constants associated with the Volume.Encryption property. -// The type of encryption used on the volume. -const ( - VolumeEncryptionProviderManagedConst = "provider_managed" - VolumeEncryptionUserManagedConst = "user_managed" -) + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` -// Constants associated with the Volume.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VolumeHealthStateDegradedConst = "degraded" - VolumeHealthStateFaultedConst = "faulted" - VolumeHealthStateInapplicableConst = "inapplicable" - VolumeHealthStateOkConst = "ok" -) + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` -// Constants associated with the Volume.ResourceType property. -// The resource type. -const ( - VolumeResourceTypeVolumeConst = "volume" -) + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} -// Constants associated with the Volume.Status property. -// The status of the volume. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected -// property value was encountered. +// Constants associated with the DedicatedHostProfileVcpuRange.Type property. +// The type for this profile field. const ( - VolumeStatusAvailableConst = "available" - VolumeStatusFailedConst = "failed" - VolumeStatusPendingConst = "pending" - VolumeStatusPendingDeletionConst = "pending_deletion" - VolumeStatusUnusableConst = "unusable" - VolumeStatusUpdatingConst = "updating" + DedicatedHostProfileVcpuRangeTypeRangeConst = "range" ) -// UnmarshalVolume unmarshals an instance of Volume from the specified map of raw messages. -func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Volume) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) +func (*DedicatedHostProfileVcpuRange) isaDedicatedHostProfileVcpu() bool { + return true +} + +// UnmarshalDedicatedHostProfileVcpuRange unmarshals an instance of DedicatedHostProfileVcpuRange from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "attachment_state", &obj.AttachmentState) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "busy", &obj.Busy) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostPrototypeDedicatedHostByGroup : DedicatedHostPrototypeDedicatedHostByGroup struct +// This model "extends" DedicatedHostPrototype +type DedicatedHostPrototypeDedicatedHostByGroup struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` + + // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. + Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The dedicated host group for this dedicated host. + Group DedicatedHostGroupIdentityIntf `json:"group" validate:"required"` +} + +// NewDedicatedHostPrototypeDedicatedHostByGroup : Instantiate DedicatedHostPrototypeDedicatedHostByGroup (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByGroup(profile DedicatedHostProfileIdentityIntf, group DedicatedHostGroupIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByGroup, err error) { + _model = &DedicatedHostPrototypeDedicatedHostByGroup{ + Profile: profile, + Group: group, } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DedicatedHostPrototypeDedicatedHostByGroup) isaDedicatedHostPrototype() bool { + return true +} + +// UnmarshalDedicatedHostPrototypeDedicatedHostByGroup unmarshals an instance of DedicatedHostPrototypeDedicatedHostByGroup from the specified map of raw messages. +func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPrototypeDedicatedHostByGroup) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) if err != nil { return } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVolumeHealthReason) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostPrototypeDedicatedHostByZone : DedicatedHostPrototypeDedicatedHostByZone struct +// This model "extends" DedicatedHostPrototype +type DedicatedHostPrototypeDedicatedHostByZone struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` + + // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. + Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + Group *DedicatedHostGroupPrototypeDedicatedHostByZoneContext `json:"group,omitempty"` + + // The zone this dedicated host will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} + +// NewDedicatedHostPrototypeDedicatedHostByZone : Instantiate DedicatedHostPrototypeDedicatedHostByZone (Generic Model Constructor) +func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByZone(profile DedicatedHostProfileIdentityIntf, zone ZoneIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByZone, err error) { + _model = &DedicatedHostPrototypeDedicatedHostByZone{ + Profile: profile, + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*DedicatedHostPrototypeDedicatedHostByZone) isaDedicatedHostPrototype() bool { + return true +} + +// UnmarshalDedicatedHostPrototypeDedicatedHostByZone unmarshals an instance of DedicatedHostPrototypeDedicatedHostByZone from the specified map of raw messages. +func UnmarshalDedicatedHostPrototypeDedicatedHostByZone(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPrototypeDedicatedHostByZone) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileReference) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EncryptionKeyIdentityByCRN : EncryptionKeyIdentityByCRN struct +// This model "extends" EncryptionKeyIdentity +type EncryptionKeyIdentityByCRN struct { + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + CRN *string `json:"crn" validate:"required"` +} + +// NewEncryptionKeyIdentityByCRN : Instantiate EncryptionKeyIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewEncryptionKeyIdentityByCRN(crn string) (_model *EncryptionKeyIdentityByCRN, err error) { + _model = &EncryptionKeyIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*EncryptionKeyIdentityByCRN) isaEncryptionKeyIdentity() bool { + return true +} + +// UnmarshalEncryptionKeyIdentityByCRN unmarshals an instance of EncryptionKeyIdentityByCRN from the specified map of raw messages. +func UnmarshalEncryptionKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EncryptionKeyIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayReservedIPReservedIPIdentity : Identifies a reserved IP by a unique property. +// Models which "extend" this model: +// - EndpointGatewayReservedIPReservedIPIdentityByID +// - EndpointGatewayReservedIPReservedIPIdentityByHref +// This model "extends" EndpointGatewayReservedIP +type EndpointGatewayReservedIPReservedIPIdentity struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` + + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} + +func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIPReservedIPIdentity() bool { + return true +} + +type EndpointGatewayReservedIPReservedIPIdentityIntf interface { + EndpointGatewayReservedIPIntf + isaEndpointGatewayReservedIPReservedIPIdentity() bool +} + +func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIP() bool { + return true +} + +// UnmarshalEndpointGatewayReservedIPReservedIPIdentity unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentity from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIPReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIPReservedIPIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayReservedIPReservedIPPrototypeTargetContext : EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct +// This model "extends" EndpointGatewayReservedIP +type EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct { + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` + + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The subnet in which to create this reserved IP. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` +} + +// NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext : Instantiate EndpointGatewayReservedIPReservedIPPrototypeTargetContext (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext(subnet SubnetIdentityIntf) (_model *EndpointGatewayReservedIPReservedIPPrototypeTargetContext, err error) { + _model = &EndpointGatewayReservedIPReservedIPPrototypeTargetContext{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*EndpointGatewayReservedIPReservedIPPrototypeTargetContext) isaEndpointGatewayReservedIP() bool { + return true +} + +// UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext unmarshals an instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIPReservedIPPrototypeTargetContext) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeStatusReason) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceVolumeContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayTargetPrototypeProviderCloudServiceIdentity : EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct +// Models which "extend" this model: +// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN +// This model "extends" EndpointGatewayTargetPrototype +type EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` + + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn,omitempty"` +} + +// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.ResourceType property. +// The type of target for this endpoint gateway. +const ( + EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" +) + +func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { + return true +} + +type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityIntf interface { + EndpointGatewayTargetPrototypeIntf + isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool +} + +func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototype() bool { + return true +} + +// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentity from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -77166,100 +90050,215 @@ func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err erro return } -// VolumeAttachment : VolumeAttachment struct -type VolumeAttachment struct { - // The maximum bandwidth (in megabits per second) for the volume when attached to this instance. This may be lower than - // the volume bandwidth depending on the configuration of the instance. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // The date and time that the volume was attached. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity : EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct +// Models which "extend" this model: +// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName +// This model "extends" EndpointGatewayTargetPrototype +type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name,omitempty"` +} - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` +// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.ResourceType property. +// The type of target for this endpoint gateway. +const ( + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" +) - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` +func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { + return true +} - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` +type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityIntf interface { + EndpointGatewayTargetPrototypeIntf + isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool +} - // The name for this volume attachment. The name is unique across all volume attachments on the instance. - Name *string `json:"name" validate:"required"` +func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototype() bool { + return true +} - // The status of this volume attachment. - Status *string `json:"status" validate:"required"` +// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The type of volume attachment. - Type *string `json:"type" validate:"required"` +// EndpointGatewayTargetProviderCloudServiceReference : EndpointGatewayTargetProviderCloudServiceReference struct +// This model "extends" EndpointGatewayTarget +type EndpointGatewayTargetProviderCloudServiceReference struct { + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn" validate:"required"` - // The attached volume. - // - // This property will be absent if the volume has not yet been provisioned. - Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` + // The type of target. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the VolumeAttachment.Status property. -// The status of this volume attachment. +// Constants associated with the EndpointGatewayTargetProviderCloudServiceReference.ResourceType property. +// The type of target. const ( - VolumeAttachmentStatusAttachedConst = "attached" - VolumeAttachmentStatusAttachingConst = "attaching" - VolumeAttachmentStatusDeletingConst = "deleting" - VolumeAttachmentStatusDetachingConst = "detaching" + EndpointGatewayTargetProviderCloudServiceReferenceResourceTypeProviderCloudServiceConst = "provider_cloud_service" ) -// Constants associated with the VolumeAttachment.Type property. -// The type of volume attachment. -const ( - VolumeAttachmentTypeBootConst = "boot" - VolumeAttachmentTypeDataConst = "data" -) +func (*EndpointGatewayTargetProviderCloudServiceReference) isaEndpointGatewayTarget() bool { + return true +} -// UnmarshalVolumeAttachment unmarshals an instance of VolumeAttachment from the specified map of raw messages. -func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachment) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) +// UnmarshalEndpointGatewayTargetProviderCloudServiceReference unmarshals an instance of EndpointGatewayTargetProviderCloudServiceReference from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetProviderCloudServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetProviderCloudServiceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayTargetProviderInfrastructureServiceReference : The name of this provider infrastructure service. +// This model "extends" EndpointGatewayTarget +type EndpointGatewayTargetProviderInfrastructureServiceReference struct { + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name" validate:"required"` + + // The type of target. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the EndpointGatewayTargetProviderInfrastructureServiceReference.ResourceType property. +// The type of target. +const ( + EndpointGatewayTargetProviderInfrastructureServiceReferenceResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" +) + +func (*EndpointGatewayTargetProviderInfrastructureServiceReference) isaEndpointGatewayTarget() bool { + return true +} + +// UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference unmarshals an instance of EndpointGatewayTargetProviderInfrastructureServiceReference from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetProviderInfrastructureServiceReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPPrototypeFloatingIPByTarget : FloatingIPPrototypeFloatingIPByTarget struct +// This model "extends" FloatingIPPrototype +type FloatingIPPrototypeFloatingIPByTarget struct { + // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The target resource to bind this floating IP to. + // + // The target resource must not already have a floating IP bound to it if the target + // resource is: + // + // - an instance network interface + // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` + // - a virtual network interface with `enable_infrastructure_nat` set to `true`. + Target FloatingIPTargetPrototypeIntf `json:"target" validate:"required"` +} + +// NewFloatingIPPrototypeFloatingIPByTarget : Instantiate FloatingIPPrototypeFloatingIPByTarget (Generic Model Constructor) +func (*VpcV1) NewFloatingIPPrototypeFloatingIPByTarget(target FloatingIPTargetPrototypeIntf) (_model *FloatingIPPrototypeFloatingIPByTarget, err error) { + _model = &FloatingIPPrototypeFloatingIPByTarget{ + Target: target, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FloatingIPPrototypeFloatingIPByTarget) isaFloatingIPPrototype() bool { + return true +} + +// UnmarshalFloatingIPPrototypeFloatingIPByTarget unmarshals an instance of FloatingIPPrototypeFloatingIPByTarget from the specified map of raw messages. +func UnmarshalFloatingIPPrototypeFloatingIPByTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPrototypeFloatingIPByTarget) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPPrototypeFloatingIPByZone : FloatingIPPrototypeFloatingIPByZone struct +// This model "extends" FloatingIPPrototype +type FloatingIPPrototypeFloatingIPByZone struct { + // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The zone this floating IP will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} + +// NewFloatingIPPrototypeFloatingIPByZone : Instantiate FloatingIPPrototypeFloatingIPByZone (Generic Model Constructor) +func (*VpcV1) NewFloatingIPPrototypeFloatingIPByZone(zone ZoneIdentityIntf) (_model *FloatingIPPrototypeFloatingIPByZone, err error) { + _model = &FloatingIPPrototypeFloatingIPByZone{ + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FloatingIPPrototypeFloatingIPByZone) isaFloatingIPPrototype() bool { + return true +} + +// UnmarshalFloatingIPPrototypeFloatingIPByZone unmarshals an instance of FloatingIPPrototypeFloatingIPByZone from the specified map of raw messages. +func UnmarshalFloatingIPPrototypeFloatingIPByZone(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPrototypeFloatingIPByZone) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -77267,57 +90266,49 @@ func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) return } -// VolumeAttachmentCollection : VolumeAttachmentCollection struct -type VolumeAttachmentCollection struct { - // Collection of volume attachments. - VolumeAttachments []VolumeAttachment `json:"volume_attachments" validate:"required"` -} +// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. +// Models which "extend" this model: +// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID +// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref +// This model "extends" FloatingIPTargetPatch +type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity struct { + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` -// UnmarshalVolumeAttachmentCollection unmarshals an instance of VolumeAttachmentCollection from the specified map of raw messages. -func UnmarshalVolumeAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentCollection) - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachment) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` } -// VolumeAttachmentDevice : VolumeAttachmentDevice struct -type VolumeAttachmentDevice struct { - // A unique identifier for the device which is exposed to the instance operating system. - ID *string `json:"id,omitempty"` +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { + return true } -// UnmarshalVolumeAttachmentDevice unmarshals an instance of VolumeAttachmentDevice from the specified map of raw messages. -func UnmarshalVolumeAttachmentDevice(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentDevice) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPatchIntf + isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool } -// VolumeAttachmentPatch : VolumeAttachmentPatch struct -type VolumeAttachmentPatch struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. - Name *string `json:"name,omitempty"` +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { + return true } -// UnmarshalVolumeAttachmentPatch unmarshals an instance of VolumeAttachmentPatch from the specified map of raw messages. -func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPatch) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) +// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -77325,50 +90316,49 @@ func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interfa return } -// AsPatch returns a generic map representation of the VolumeAttachmentPatch -func (volumeAttachmentPatch *VolumeAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumeAttachmentPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// FloatingIPTargetPatchNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. +// Models which "extend" this model: +// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID +// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref +// This model "extends" FloatingIPTargetPatch +type FloatingIPTargetPatchNetworkInterfaceIdentity struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` -// VolumeAttachmentPrototype : VolumeAttachmentPrototype struct -type VolumeAttachmentPrototype struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` +} - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { + return true +} - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` +type FloatingIPTargetPatchNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPatchIntf + isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool } -// NewVolumeAttachmentPrototype : Instantiate VolumeAttachmentPrototype (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototype(volume VolumeAttachmentPrototypeVolumeIntf) (_model *VolumeAttachmentPrototype, err error) { - _model = &VolumeAttachmentPrototype{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { + return true } -// UnmarshalVolumeAttachmentPrototype unmarshals an instance of VolumeAttachmentPrototype from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototype) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentPrototypeVolume) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -77376,40 +90366,48 @@ func UnmarshalVolumeAttachmentPrototype(m map[string]json.RawMessage, result int return } -// VolumeAttachmentPrototypeInstanceByImageContext : VolumeAttachmentPrototypeInstanceByImageContext struct -type VolumeAttachmentPrototypeInstanceByImageContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` +// FloatingIPTargetPatchVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. +// Models which "extend" this model: +// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" FloatingIPTargetPatch +type FloatingIPTargetPatchVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` - // A prototype object for a new volume. - Volume *VolumePrototypeInstanceByImageContext `json:"volume" validate:"required"` + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -// NewVolumeAttachmentPrototypeInstanceByImageContext : Instantiate VolumeAttachmentPrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByImageContext(volume *VolumePrototypeInstanceByImageContext) (_model *VolumeAttachmentPrototypeInstanceByImageContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByImageContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { + return true } -// UnmarshalVolumeAttachmentPrototypeInstanceByImageContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) +type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPatchIntf + isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool +} + +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { + return true +} + +// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -77417,40 +90415,49 @@ func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json. return } -// VolumeAttachmentPrototypeInstanceBySourceSnapshotContext : VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct -type VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` +// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. +// Models which "extend" this model: +// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID +// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref +// This model "extends" FloatingIPTargetPrototype +type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity struct { + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` +} - // A prototype object for a new volume from a snapshot. - Volume *VolumePrototypeInstanceBySourceSnapshotContext `json:"volume" validate:"required"` +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { + return true } -// NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext : Instantiate VolumeAttachmentPrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume *VolumePrototypeInstanceBySourceSnapshotContext) (_model *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceBySourceSnapshotContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return +type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPrototypeIntf + isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool } -// UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { + return true +} + +// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -77458,40 +90465,49 @@ func UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(m map[str return } -// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct -type VolumeAttachmentPrototypeInstanceByVolumeContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` +// FloatingIPTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. +// Models which "extend" this model: +// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID +// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref +// This model "extends" FloatingIPTargetPrototype +type FloatingIPTargetPrototypeNetworkInterfaceIdentity struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` +} - // An existing volume to attach. - Volume VolumeIdentityIntf `json:"volume" validate:"required"` +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { + return true } -// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeIdentityIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return +type FloatingIPTargetPrototypeNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPrototypeIntf + isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool } -// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { + return true +} + +// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -77499,104 +90515,120 @@ func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json return } -// VolumeAttachmentPrototypeVolume : An existing volume to attach to the instance, or a prototype object for a new volume. +// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. // Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumeIdentity -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext -type VolumeAttachmentPrototypeVolume struct { - // The unique identifier for this volume. +// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" FloatingIPTargetPrototype +type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. + // The URL for this virtual network interface. Href *string `json:"href,omitempty"` - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -func (*VolumeAttachmentPrototypeVolume) isaVolumeAttachmentPrototypeVolume() bool { +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { return true } -type VolumeAttachmentPrototypeVolumeIntf interface { - isaVolumeAttachmentPrototypeVolume() bool +type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { + FloatingIPTargetPrototypeIntf + isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool } -// UnmarshalVolumeAttachmentPrototypeVolume unmarshals an instance of VolumeAttachmentPrototypeVolume from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolume) +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { + return true +} + +// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPTargetBareMetalServerNetworkInterfaceReference : FloatingIPTargetBareMetalServerNetworkInterfaceReference struct +// This model "extends" FloatingIPTarget +type FloatingIPTargetBareMetalServerNetworkInterfaceReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this bare metal server network interface. + Name *string `json:"name" validate:"required"` + + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the FloatingIPTargetBareMetalServerNetworkInterfaceReference.ResourceType property. +// The resource type. +const ( + FloatingIPTargetBareMetalServerNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*FloatingIPTargetBareMetalServerNetworkInterfaceReference) isaFloatingIPTarget() bool { + return true +} + +// UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference unmarshals an instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference from the specified map of raw messages. +func UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetBareMetalServerNetworkInterfaceReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -77604,40 +90636,51 @@ func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, resu return } -// VolumeAttachmentReferenceInstanceContext : VolumeAttachmentReferenceInstanceContext struct -type VolumeAttachmentReferenceInstanceContext struct { +// FloatingIPTargetNetworkInterfaceReference : FloatingIPTargetNetworkInterfaceReference struct +// This model "extends" FloatingIPTarget +type FloatingIPTargetNetworkInterfaceReference struct { // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *VolumeAttachmentReferenceInstanceContextDeleted `json:"deleted,omitempty"` + Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - // Information about how the volume is exposed to the instance operating system. + // The URL for this instance network interface. // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this volume attachment. + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - // The name for this volume attachment. The name is unique across all volume attachments on the instance. + // The name for this instance network interface. Name *string `json:"name" validate:"required"` - // The attached volume. - // - // This property will be absent if the volume has not yet been provisioned. - Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalVolumeAttachmentReferenceInstanceContext unmarshals an instance of VolumeAttachmentReferenceInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceInstanceContextDeleted) - if err != nil { - return - } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) +// Constants associated with the FloatingIPTargetNetworkInterfaceReference.ResourceType property. +// The resource type. +const ( + FloatingIPTargetNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*FloatingIPTargetNetworkInterfaceReference) isaFloatingIPTarget() bool { + return true +} + +// UnmarshalFloatingIPTargetNetworkInterfaceReference unmarshals an instance of FloatingIPTargetNetworkInterfaceReference from the specified map of raw messages. +func UnmarshalFloatingIPTargetNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetNetworkInterfaceReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) if err != nil { return } @@ -77653,25 +90696,11 @@ func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMess if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceInstanceContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeAttachmentReferenceInstanceContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceInstanceContextDeleted unmarshals an instance of VolumeAttachmentReferenceInstanceContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -77679,55 +90708,47 @@ func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json. return } -// VolumeAttachmentReferenceVolumeContext : VolumeAttachmentReferenceVolumeContext struct -type VolumeAttachmentReferenceVolumeContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` +// FloatingIPTargetPublicGatewayReference : FloatingIPTargetPublicGatewayReference struct +// This model "extends" FloatingIPTarget +type FloatingIPTargetPublicGatewayReference struct { + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *VolumeAttachmentReferenceVolumeContextDeleted `json:"deleted,omitempty"` - - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` + Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - // The URL for this volume attachment. + // The URL for this public gateway. Href *string `json:"href" validate:"required"` - // The unique identifier for this volume attachment. + // The unique identifier for this public gateway. ID *string `json:"id" validate:"required"` - // The attached instance. - Instance *InstanceReference `json:"instance" validate:"required"` - - // The name for this volume attachment. The name is unique across all volume attachments on the instance. + // The name for this public gateway. The name is unique across all public gateways in the VPC. Name *string `json:"name" validate:"required"` - // The type of volume attachment. - Type *string `json:"type" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the VolumeAttachmentReferenceVolumeContext.Type property. -// The type of volume attachment. +// Constants associated with the FloatingIPTargetPublicGatewayReference.ResourceType property. +// The resource type. const ( - VolumeAttachmentReferenceVolumeContextTypeBootConst = "boot" - VolumeAttachmentReferenceVolumeContextTypeDataConst = "data" + FloatingIPTargetPublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" ) -// UnmarshalVolumeAttachmentReferenceVolumeContext unmarshals an instance of VolumeAttachmentReferenceVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceVolumeContextDeleted) +func (*FloatingIPTargetPublicGatewayReference) isaFloatingIPTarget() bool { + return true +} + +// UnmarshalFloatingIPTargetPublicGatewayReference unmarshals an instance of FloatingIPTargetPublicGatewayReference from the specified map of raw messages. +func UnmarshalFloatingIPTargetPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPublicGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) if err != nil { return } @@ -77739,15 +90760,11 @@ func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessag if err != nil { return } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -77755,146 +90772,77 @@ func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessag return } -// VolumeAttachmentReferenceVolumeContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeAttachmentReferenceVolumeContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} +// FloatingIPTargetVirtualNetworkInterfaceReference : FloatingIPTargetVirtualNetworkInterfaceReference struct +// This model "extends" FloatingIPTarget +type FloatingIPTargetVirtualNetworkInterfaceReference struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` -// UnmarshalVolumeAttachmentReferenceVolumeContextDeleted unmarshals an instance of VolumeAttachmentReferenceVolumeContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VirtualNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` -// VolumeCollection : VolumeCollection struct -type VolumeCollection struct { - // A link to the first page of resources. - First *VolumeCollectionFirst `json:"first" validate:"required"` + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeCollectionNext `json:"next,omitempty"` + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + Name *string `json:"name" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The primary IP for this virtual network interface. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - // Collection of volumes. - Volumes []Volume `json:"volumes" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -// UnmarshalVolumeCollection unmarshals an instance of VolumeCollection from the specified map of raw messages. -func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeCollectionNext) +// Constants associated with the FloatingIPTargetVirtualNetworkInterfaceReference.ResourceType property. +// The resource type. +const ( + FloatingIPTargetVirtualNetworkInterfaceReferenceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" +) + +func (*FloatingIPTargetVirtualNetworkInterfaceReference) isaFloatingIPTarget() bool { + return true +} + +// UnmarshalFloatingIPTargetVirtualNetworkInterfaceReference unmarshals an instance of FloatingIPTargetVirtualNetworkInterfaceReference from the specified map of raw messages. +func UnmarshalFloatingIPTargetVirtualNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetVirtualNetworkInterfaceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "volumes", &obj.Volumes, UnmarshalVolume) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VolumeCollectionFirst : A link to the first page of resources. -type VolumeCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeCollectionFirst unmarshals an instance of VolumeCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeCollectionNext unmarshals an instance of VolumeCollectionNext from the specified map of raw messages. -func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeHealthReason : VolumeHealthReason struct -type VolumeHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VolumeHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VolumeHealthReasonCodeInitializingFromSnapshotConst = "initializing_from_snapshot" -) - -// UnmarshalVolumeHealthReason unmarshals an instance of VolumeHealthReason from the specified map of raw messages. -func UnmarshalVolumeHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } @@ -77902,33 +90850,39 @@ func UnmarshalVolumeHealthReason(m map[string]json.RawMessage, result interface{ return } -// VolumeIdentity : Identifies a volume by a unique property. +// FlowLogCollectorTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. // Models which "extend" this model: -// - VolumeIdentityByID -// - VolumeIdentityByCRN -// - VolumeIdentityByHref -type VolumeIdentity struct { - // The unique identifier for this volume. +// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID +// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN +// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeInstanceIdentity struct { + // The unique identifier for this virtual server instance. ID *string `json:"id,omitempty"` - // The CRN for this volume. + // The CRN for this virtual server instance. CRN *string `json:"crn,omitempty"` - // The URL for this volume. + // The URL for this virtual server instance. Href *string `json:"href,omitempty"` } -func (*VolumeIdentity) isaVolumeIdentity() bool { +func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { return true } -type VolumeIdentityIntf interface { - isaVolumeIdentity() bool +type FlowLogCollectorTargetPrototypeInstanceIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool } -// UnmarshalVolumeIdentity unmarshals an instance of VolumeIdentity from the specified map of raw messages. -func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentity) +func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -77945,52 +90899,40 @@ func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) ( return } -// VolumePatch : VolumePatch struct -type VolumePatch struct { - // The capacity to use for the volume (in gigabytes). The volume must be attached to a running virtual server instance, - // and the specified value must not be less than the current capacity. Additionally, if the volume is attached as a - // boot volume, the maximum value is 250 gigabytes. - // - // The minimum and maximum capacity limits for creating or updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` +// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity : Identifies an instance network attachment by a unique property. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID +// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity struct { + // The unique identifier for this instance network attachment. + ID *string `json:"id,omitempty"` - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. - Iops *int64 `json:"iops,omitempty"` + // The URL for this instance network attachment. + Href *string `json:"href,omitempty"` +} - // The name for this volume. The name must not be used by another volume in the region. - Name *string `json:"name,omitempty"` +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { + return true +} - // The profile to use for this volume. The requested profile must be in the same - // `family` as the current profile. The volume must be attached as a data volume to - // a running virtual server instance, and must have a `capacity` within the range - // supported by the specified profile. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` +type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool +} - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true } -// UnmarshalVolumePatch unmarshals an instance of VolumePatch from the specified map of raw messages. -func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePatch) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) +// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -77998,47 +90940,45 @@ func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err return } -// AsPatch returns a generic map representation of the VolumePatch -func (volumePatch *VolumePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID +// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id,omitempty"` -// VolumeProfile : VolumeProfile struct -type VolumeProfile struct { - // The product family this volume profile belongs to. + // The URL for this instance network interface. // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the - // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href,omitempty"` +} - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { + return true +} - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` +type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool } -// Constants associated with the VolumeProfile.Family property. -// The product family this volume profile belongs to. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the -// unexpected property value was encountered. -const ( - VolumeProfileFamilyCustomConst = "custom" - VolumeProfileFamilyTieredConst = "tiered" -) +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true +} -// UnmarshalVolumeProfile unmarshals an instance of VolumeProfile from the specified map of raw messages. -func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) +// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -78046,53 +90986,52 @@ func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VolumeProfileCollection : VolumeProfileCollection struct -type VolumeProfileCollection struct { - // A link to the first page of resources. - First *VolumeProfileCollectionFirst `json:"first" validate:"required"` +// FlowLogCollectorTargetPrototypeSubnetIdentity : Identifies a subnet by a unique property. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID +// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN +// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeSubnetIdentity struct { + // The unique identifier for this subnet. + ID *string `json:"id,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The CRN for this subnet. + CRN *string `json:"crn,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeProfileCollectionNext `json:"next,omitempty"` + // The URL for this subnet. + Href *string `json:"href,omitempty"` +} - // Collection of volume profiles. - Profiles []VolumeProfile `json:"profiles" validate:"required"` +func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { + return true +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +type FlowLogCollectorTargetPrototypeSubnetIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool } -// UnmarshalVolumeProfileCollection unmarshals an instance of VolumeProfileCollection from the specified map of raw messages. -func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeProfileCollectionNext) +func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeSubnetIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalVolumeProfile) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -78100,44 +91039,47 @@ func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result inter return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// FlowLogCollectorTargetPrototypeVPCIdentity : Identifies a VPC by a unique property. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID +// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN +// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeVPCIdentity struct { + // The unique identifier for this VPC. + ID *string `json:"id,omitempty"` + + // The CRN for this VPC. + CRN *string `json:"crn,omitempty"` + + // The URL for this VPC. + Href *string `json:"href,omitempty"` } -// VolumeProfileCollectionFirst : A link to the first page of resources. -type VolumeProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { + return true } -// UnmarshalVolumeProfileCollectionFirst unmarshals an instance of VolumeProfileCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +type FlowLogCollectorTargetPrototypeVPCIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeVPCIdentity() bool } -// VolumeProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true } -// UnmarshalVolumeProfileCollectionNext unmarshals an instance of VolumeProfileCollectionNext from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionNext) +// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVPCIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -78146,58 +91088,48 @@ func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result i return } -// VolumeProfileIdentity : Identifies a volume profile by a unique property. +// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. // Models which "extend" this model: -// - VolumeProfileIdentityByName -// - VolumeProfileIdentityByHref -type VolumeProfileIdentity struct { - // The globally unique name for this volume profile. - Name *string `json:"name,omitempty"` +// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" FlowLogCollectorTargetPrototype +type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` - // The URL for this volume profile. + // The URL for this virtual network interface. Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -func (*VolumeProfileIdentity) isaVolumeProfileIdentity() bool { +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { return true } -type VolumeProfileIdentityIntf interface { - isaVolumeProfileIdentity() bool +type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { + FlowLogCollectorTargetPrototypeIntf + isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool } -// UnmarshalVolumeProfileIdentity unmarshals an instance of VolumeProfileIdentity from the specified map of raw messages. -func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileReference : VolumeProfileReference struct -type VolumeProfileReference struct { - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalVolumeProfileReference unmarshals an instance of VolumeProfileReference from the specified map of raw messages. -func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -78205,58 +91137,55 @@ func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interf return } -// VolumePrototype : VolumePrototype struct -// Models which "extend" this model: -// - VolumePrototypeVolumeByCapacity -// - VolumePrototypeVolumeBySourceSnapshot -type VolumePrototype struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// FlowLogCollectorTargetInstanceNetworkAttachmentReference : FlowLogCollectorTargetInstanceNetworkAttachmentReference struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetInstanceNetworkAttachmentReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The URL for this instance network attachment. + Href *string `json:"href" validate:"required"` - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The unique identifier for this instance network attachment. + ID *string `json:"id" validate:"required"` - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` + // The name for this instance network attachment. The name is unique across all network attachments for the instance. + Name *string `json:"name" validate:"required"` - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // The primary IP address of the virtual network interface for the instance network + // attachment. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -func (*VolumePrototype) isaVolumePrototype() bool { - return true + // The subnet of the virtual network interface for the instance network attachment. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -type VolumePrototypeIntf interface { - isaVolumePrototype() bool +// Constants associated with the FlowLogCollectorTargetInstanceNetworkAttachmentReference.ResourceType property. +// The resource type. +const ( + FlowLogCollectorTargetInstanceNetworkAttachmentReferenceResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" +) + +func (*FlowLogCollectorTargetInstanceNetworkAttachmentReference) isaFlowLogCollectorTarget() bool { + return true } -// UnmarshalVolumePrototype unmarshals an instance of VolumePrototype from the specified map of raw messages. -func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototype) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +// UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference unmarshals an instance of FlowLogCollectorTargetInstanceNetworkAttachmentReference from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetInstanceNetworkAttachmentReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceNetworkAttachmentReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -78264,31 +91193,66 @@ func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetInstanceReference : FlowLogCollectorTargetInstanceReference struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetInstanceReference struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` + + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. + Name *string `json:"name" validate:"required"` +} + +func (*FlowLogCollectorTargetInstanceReference) isaFlowLogCollectorTarget() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetInstanceReference unmarshals an instance of FlowLogCollectorTargetInstanceReference from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetInstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -78296,60 +91260,57 @@ func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) return } -// VolumePrototypeInstanceByImageContext : VolumePrototypeInstanceByImageContext struct -type VolumePrototypeInstanceByImageContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the image's - // `minimum_provisioned_size`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the image's `minimum_provisioned_size`. - Capacity *int64 `json:"capacity,omitempty"` +// FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext : FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - // The root key to use to wrap the data encryption key for the volume. + // The URL for this instance network interface. // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The name for this instance network interface. + Name *string `json:"name" validate:"required"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewVolumePrototypeInstanceByImageContext : Instantiate VolumePrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeInstanceByImageContext(profile VolumeProfileIdentityIntf) (_model *VolumePrototypeInstanceByImageContext, err error) { - _model = &VolumePrototypeInstanceByImageContext{ - Profile: profile, - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.ResourceType property. +// The resource type. +const ( + FlowLogCollectorTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) isaFlowLogCollectorTarget() bool { + return true } -// UnmarshalVolumePrototypeInstanceByImageContext unmarshals an instance of VolumePrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) +// UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -78357,15 +91318,7 @@ func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -78373,84 +91326,63 @@ func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage return } -// VolumePrototypeInstanceBySourceSnapshotContext : VolumePrototypeInstanceBySourceSnapshotContext struct -type VolumePrototypeInstanceBySourceSnapshotContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// FlowLogCollectorTargetSubnetReference : FlowLogCollectorTargetSubnetReference struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetSubnetReference struct { + // The CRN for this subnet. + CRN *string `json:"crn" validate:"required"` - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The URL for this subnet. + Href *string `json:"href" validate:"required"` - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The unique identifier for this subnet. + ID *string `json:"id" validate:"required"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` + // The name for this subnet. The name is unique across all subnets in the VPC. + Name *string `json:"name" validate:"required"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewVolumePrototypeInstanceBySourceSnapshotContext : Instantiate VolumePrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeInstanceBySourceSnapshotContext(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeInstanceBySourceSnapshotContext, err error) { - _model = &VolumePrototypeInstanceBySourceSnapshotContext{ - Profile: profile, - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the FlowLogCollectorTargetSubnetReference.ResourceType property. +// The resource type. +const ( + FlowLogCollectorTargetSubnetReferenceResourceTypeSubnetConst = "subnet" +) + +func (*FlowLogCollectorTargetSubnetReference) isaFlowLogCollectorTarget() bool { + return true } -// UnmarshalVolumePrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumePrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. -func UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeInstanceBySourceSnapshotContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +// UnmarshalFlowLogCollectorTargetSubnetReference unmarshals an instance of FlowLogCollectorTargetSubnetReference from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetSubnetReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -78458,46 +91390,47 @@ func UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(m map[string]json.R return } -// VolumeReference : VolumeReference struct -type VolumeReference struct { - // The CRN for this volume. +// FlowLogCollectorTargetVPCReference : FlowLogCollectorTargetVPCReference struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetVPCReference struct { + // The CRN for this VPC. CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` + Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` - // The URL for this volume. + // The URL for this VPC. Href *string `json:"href" validate:"required"` - // The unique identifier for this volume. + // The unique identifier for this VPC. ID *string `json:"id" validate:"required"` - // The name for this volume. The name is unique across all volumes in the region. + // The name for this VPC. The name is unique across all VPCs in the region. Name *string `json:"name" validate:"required"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the VolumeReference.ResourceType property. +// Constants associated with the FlowLogCollectorTargetVPCReference.ResourceType property. // The resource type. const ( - VolumeReferenceResourceTypeVolumeConst = "volume" + FlowLogCollectorTargetVPCReferenceResourceTypeVPCConst = "vpc" ) -// UnmarshalVolumeReference unmarshals an instance of VolumeReference from the specified map of raw messages. -func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReference) +func (*FlowLogCollectorTargetVPCReference) isaFlowLogCollectorTarget() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetVPCReference unmarshals an instance of FlowLogCollectorTargetVPCReference from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetVPCReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) if err != nil { return } @@ -78513,10 +91446,6 @@ func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return @@ -78525,63 +91454,42 @@ func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) return } -// VolumeReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeReferenceDeleted unmarshals an instance of VolumeReferenceDeleted from the specified map of raw messages. -func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeReferenceVolumeAttachmentContext : VolumeReferenceVolumeAttachmentContext struct -type VolumeReferenceVolumeAttachmentContext struct { - // The CRN for this volume. +// FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext : FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext struct +// This model "extends" FlowLogCollectorTarget +type FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext struct { + // The CRN for this virtual network interface. CRN *string `json:"crn" validate:"required"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceVolumeAttachmentContextDeleted `json:"deleted,omitempty"` - - // The URL for this volume. + // The URL for this virtual network interface. Href *string `json:"href" validate:"required"` - // The unique identifier for this volume. + // The unique identifier for this virtual network interface. ID *string `json:"id" validate:"required"` - // The name for this volume. The name is unique across all volumes in the region. + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the VolumeReferenceVolumeAttachmentContext.ResourceType property. +// Constants associated with the FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext.ResourceType property. // The resource type. const ( - VolumeReferenceVolumeAttachmentContextResourceTypeVolumeConst = "volume" + FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" ) -// UnmarshalVolumeReferenceVolumeAttachmentContext unmarshals an instance of VolumeReferenceVolumeAttachmentContext from the specified map of raw messages. -func UnmarshalVolumeReferenceVolumeAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceVolumeAttachmentContext) +func (*FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext) isaFlowLogCollectorTarget() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext unmarshals an instance of FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceVolumeAttachmentContextDeleted) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -78602,36 +91510,30 @@ func UnmarshalVolumeReferenceVolumeAttachmentContext(m map[string]json.RawMessag return } -// VolumeReferenceVolumeAttachmentContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeReferenceVolumeAttachmentContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// ImageIdentityByCRN : ImageIdentityByCRN struct +// This model "extends" ImageIdentity +type ImageIdentityByCRN struct { + // The CRN for this image. + CRN *string `json:"crn" validate:"required"` } -// UnmarshalVolumeReferenceVolumeAttachmentContextDeleted unmarshals an instance of VolumeReferenceVolumeAttachmentContextDeleted from the specified map of raw messages. -func UnmarshalVolumeReferenceVolumeAttachmentContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceVolumeAttachmentContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewImageIdentityByCRN : Instantiate ImageIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewImageIdentityByCRN(crn string) (_model *ImageIdentityByCRN, err error) { + _model = &ImageIdentityByCRN{ + CRN: core.StringPtr(crn), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// VolumeRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type VolumeRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` +func (*ImageIdentityByCRN) isaImageIdentity() bool { + return true } -// UnmarshalVolumeRemote unmarshals an instance of VolumeRemote from the specified map of raw messages. -func UnmarshalVolumeRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) +// UnmarshalImageIdentityByCRN unmarshals an instance of ImageIdentityByCRN from the specified map of raw messages. +func UnmarshalImageIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -78639,36 +91541,30 @@ func UnmarshalVolumeRemote(m map[string]json.RawMessage, result interface{}) (er return } -// VolumeStatusReason : VolumeStatusReason struct -type VolumeStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` +// ImageIdentityByHref : ImageIdentityByHref struct +// This model "extends" ImageIdentity +type ImageIdentityByHref struct { + // The URL for this image. + Href *string `json:"href" validate:"required"` +} - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +// NewImageIdentityByHref : Instantiate ImageIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewImageIdentityByHref(href string) (_model *ImageIdentityByHref, err error) { + _model = &ImageIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the VolumeStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - VolumeStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" -) +func (*ImageIdentityByHref) isaImageIdentity() bool { + return true +} -// UnmarshalVolumeStatusReason unmarshals an instance of VolumeStatusReason from the specified map of raw messages. -func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalImageIdentityByHref unmarshals an instance of ImageIdentityByHref from the specified map of raw messages. +func UnmarshalImageIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -78676,33 +91572,30 @@ func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{ return } -// VpcdnsResolutionBindingCollectionFirst : A link to the first page of resources. -type VpcdnsResolutionBindingCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// ImageIdentityByID : ImageIdentityByID struct +// This model "extends" ImageIdentity +type ImageIdentityByID struct { + // The unique identifier for this image. + ID *string `json:"id" validate:"required"` } -// UnmarshalVpcdnsResolutionBindingCollectionFirst unmarshals an instance of VpcdnsResolutionBindingCollectionFirst from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewImageIdentityByID : Instantiate ImageIdentityByID (Generic Model Constructor) +func (*VpcV1) NewImageIdentityByID(id string) (_model *ImageIdentityByID, err error) { + _model = &ImageIdentityByID{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// VpcdnsResolutionBindingCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VpcdnsResolutionBindingCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +func (*ImageIdentityByID) isaImageIdentity() bool { + return true } -// UnmarshalVpcdnsResolutionBindingCollectionNext unmarshals an instance of VpcdnsResolutionBindingCollectionNext from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalImageIdentityByID unmarshals an instance of ImageIdentityByID from the specified map of raw messages. +func UnmarshalImageIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -78710,33 +91603,83 @@ func UnmarshalVpcdnsResolutionBindingCollectionNext(m map[string]json.RawMessage return } -// Zone : Zone struct -type Zone struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` +// ImagePrototypeImageByFile : ImagePrototypeImageByFile struct +// This model "extends" ImagePrototype +type ImagePrototypeImageByFile struct { + // The deprecation date and time to set for this image. + // + // The date and time must not be in the past, and must be earlier than `obsolescence_at` + // (if `obsolescence_at` is set). + // + // If unspecified, no deprecation date and time will be set. + // + // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + // transition to `deprecated` upon its successful creation (or + // `obsolete` if the obsolescence date and time was also reached). + DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` + // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are + // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The region this zone resides in. - Region *RegionReference `json:"region" validate:"required"` + // The obsolescence date and time to set for this image. + // + // The date and time must not be in the past, and must be later than `deprecation_at` (if + // `deprecation_at` is set). + // + // If unspecified, no obsolescence date and time will be set. + // + // If the obsolescence date and time is reached while the image has a status of + // `pending`, the image's status will transition to `obsolete` upon its successful creation. + ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - // The availability status of this zone. - Status *string `json:"status" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. + // + // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be + // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the + // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + + // The root key that was used to wrap the data key (which is ultimately represented as + // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes + // created from this image (unless an alternate `encryption_key` is specified at volume + // creation). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The file from which to create the image. + File *ImageFilePrototype `json:"file" validate:"required"` + + // The [supported operating + // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this + // image. + OperatingSystem OperatingSystemIdentityIntf `json:"operating_system" validate:"required"` +} + +// NewImagePrototypeImageByFile : Instantiate ImagePrototypeImageByFile (Generic Model Constructor) +func (*VpcV1) NewImagePrototypeImageByFile(file *ImageFilePrototype, operatingSystem OperatingSystemIdentityIntf) (_model *ImagePrototypeImageByFile, err error) { + _model = &ImagePrototypeImageByFile{ + File: file, + OperatingSystem: operatingSystem, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the Zone.Status property. -// The availability status of this zone. -const ( - ZoneStatusAvailableConst = "available" - ZoneStatusImpairedConst = "impaired" - ZoneStatusUnavailableConst = "unavailable" -) +func (*ImagePrototypeImageByFile) isaImagePrototype() bool { + return true +} -// UnmarshalZone unmarshals an instance of Zone from the specified map of raw messages. -func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Zone) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalImagePrototypeImageByFile unmarshals an instance of ImagePrototypeImageByFile from the specified map of raw messages. +func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePrototypeImageByFile) + err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) if err != nil { return } @@ -78744,87 +91687,27 @@ func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) if err != nil { return } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneCollection : ZoneCollection struct -type ZoneCollection struct { - // Collection of zones. - Zones []Zone `json:"zones" validate:"required"` -} - -// UnmarshalZoneCollection unmarshals an instance of ZoneCollection from the specified map of raw messages. -func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneCollection) - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZone) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentity : Identifies a zone by a unique property. -// Models which "extend" this model: -// - ZoneIdentityByName -// - ZoneIdentityByHref -type ZoneIdentity struct { - // The globally unique name for this zone. - Name *string `json:"name,omitempty"` - - // The URL for this zone. - Href *string `json:"href,omitempty"` -} - -func (*ZoneIdentity) isaZoneIdentity() bool { - return true -} - -type ZoneIdentityIntf interface { - isaZoneIdentity() bool -} - -// UnmarshalZoneIdentity unmarshals an instance of ZoneIdentity from the specified map of raw messages. -func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneReference : ZoneReference struct -type ZoneReference struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalZoneReference unmarshals an instance of ZoneReference from the specified map of raw messages. -func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) if err != nil { return } @@ -78832,71 +91715,90 @@ func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (e return } -// BackupPolicyJobSourceVolumeReference : BackupPolicyJobSourceVolumeReference struct -// This model "extends" BackupPolicyJobSource -type BackupPolicyJobSourceVolumeReference struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` +// ImagePrototypeImageBySourceVolume : ImagePrototypeImageBySourceVolume struct +// This model "extends" ImagePrototype +type ImagePrototypeImageBySourceVolume struct { + // The deprecation date and time to set for this image. + // + // The date and time must not be in the past, and must be earlier than `obsolescence_at` + // (if `obsolescence_at` is set). + // + // If unspecified, no deprecation date and time will be set. + // + // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + // transition to `deprecated` upon its successful creation (or + // `obsolete` if the obsolescence date and time was also reached). + DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - // The URL for this volume. - Href *string `json:"href" validate:"required"` + // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are + // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` + // The obsolescence date and time to set for this image. + // + // The date and time must not be in the past, and must be later than `deprecation_at` (if + // `deprecation_at` is set). + // + // If unspecified, no obsolescence date and time will be set. + // + // If the obsolescence date and time is reached while the image has a status of + // `pending`, the image's status will transition to `obsolete` upon its successful creation. + ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` + // The root key used to wrap the system-generated data encryption key for the image. + // + // If unspecified, the root key from `source_volume` will be used. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The volume from which to create the image. The specified volume must: + // - Have an `operating_system`, which will be used to populate this image's + // operating system information. + // - Not be `active` or `busy`. + // + // During image creation, the specified volume may briefly become `busy`. + SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` } -// Constants associated with the BackupPolicyJobSourceVolumeReference.ResourceType property. -// The resource type. -const ( - BackupPolicyJobSourceVolumeReferenceResourceTypeVolumeConst = "volume" -) +// NewImagePrototypeImageBySourceVolume : Instantiate ImagePrototypeImageBySourceVolume (Generic Model Constructor) +func (*VpcV1) NewImagePrototypeImageBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *ImagePrototypeImageBySourceVolume, err error) { + _model = &ImagePrototypeImageBySourceVolume{ + SourceVolume: sourceVolume, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*BackupPolicyJobSourceVolumeReference) isaBackupPolicyJobSource() bool { +func (*ImagePrototypeImageBySourceVolume) isaImagePrototype() bool { return true } -// UnmarshalBackupPolicyJobSourceVolumeReference unmarshals an instance of BackupPolicyJobSourceVolumeReference from the specified map of raw messages. -func UnmarshalBackupPolicyJobSourceVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobSourceVolumeReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) +// UnmarshalImagePrototypeImageBySourceVolume unmarshals an instance of ImagePrototypeImageBySourceVolume from the specified map of raw messages. +func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePrototypeImageBySourceVolume) + err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) if err != nil { return } @@ -78904,32 +91806,31 @@ func UnmarshalBackupPolicyJobSourceVolumeReference(m map[string]json.RawMessage, return } -// BackupPolicyScopePrototypeEnterpriseIdentity : Identifies an enterprise by a unique property. -// Models which "extend" this model: -// - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN -// This model "extends" BackupPolicyScopePrototype -type BackupPolicyScopePrototypeEnterpriseIdentity struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` -} - -func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { - return true +// InstanceCatalogOfferingPrototypeCatalogOfferingByOffering : InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct +// This model "extends" InstanceCatalogOfferingPrototype +type InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct { + // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering by a unique property. + Offering CatalogOfferingIdentityIntf `json:"offering" validate:"required"` } -type BackupPolicyScopePrototypeEnterpriseIdentityIntf interface { - BackupPolicyScopePrototypeIntf - isaBackupPolicyScopePrototypeEnterpriseIdentity() bool +// NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByOffering (Generic Model Constructor) +func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(offering CatalogOfferingIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByOffering, err error) { + _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByOffering{ + Offering: offering, + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototype() bool { +func (*InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) isaInstanceCatalogOfferingPrototype() bool { return true } -// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentity from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototypeEnterpriseIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering from the specified map of raw messages. +func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) + err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) if err != nil { return } @@ -78937,34 +91838,32 @@ func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(m map[string]json.Raw return } -// BackupPolicyScopeAccountReference : BackupPolicyScopeAccountReference struct -// This model "extends" BackupPolicyScope -type BackupPolicyScopeAccountReference struct { - // The unique identifier for this account. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// InstanceCatalogOfferingPrototypeCatalogOfferingByVersion : InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct +// This model "extends" InstanceCatalogOfferingPrototype +type InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct { + // Identifies a version of a + // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a + // unique property. + Version CatalogOfferingVersionIdentityIntf `json:"version" validate:"required"` } -// Constants associated with the BackupPolicyScopeAccountReference.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeAccountReferenceResourceTypeAccountConst = "account" -) +// NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByVersion (Generic Model Constructor) +func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(version CatalogOfferingVersionIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByVersion, err error) { + _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByVersion{ + Version: version, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*BackupPolicyScopeAccountReference) isaBackupPolicyScope() bool { +func (*InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) isaInstanceCatalogOfferingPrototype() bool { return true } -// UnmarshalBackupPolicyScopeAccountReference unmarshals an instance of BackupPolicyScopeAccountReference from the specified map of raw messages. -func UnmarshalBackupPolicyScopeAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopeAccountReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion from the specified map of raw messages. +func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) + err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) if err != nil { return } @@ -78972,41 +91871,61 @@ func UnmarshalBackupPolicyScopeAccountReference(m map[string]json.RawMessage, re return } -// BackupPolicyScopeEnterpriseReference : BackupPolicyScopeEnterpriseReference struct -// This model "extends" BackupPolicyScope -type BackupPolicyScopeEnterpriseReference struct { - // The CRN for this enterprise. - CRN *string `json:"crn" validate:"required"` +// InstanceGroupManagerActionPrototypeScheduledActionPrototype : InstanceGroupManagerActionPrototypeScheduledActionPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec +// This model "extends" InstanceGroupManagerActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this enterprise. - ID *string `json:"id" validate:"required"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` } -// Constants associated with the BackupPolicyScopeEnterpriseReference.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeEnterpriseReferenceResourceTypeEnterpriseConst = "enterprise" -) +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { + return true +} -func (*BackupPolicyScopeEnterpriseReference) isaBackupPolicyScope() bool { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf interface { + InstanceGroupManagerActionPrototypeIntf + isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototype() bool { return true } -// UnmarshalBackupPolicyScopeEnterpriseReference unmarshals an instance of BackupPolicyScopeEnterpriseReference from the specified map of raw messages. -func UnmarshalBackupPolicyScopeEnterpriseReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopeEnterpriseReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } @@ -79014,40 +91933,120 @@ func UnmarshalBackupPolicyScopeEnterpriseReference(m map[string]json.RawMessage, return } -// BareMetalServerBootTargetBareMetalServerDiskReference : BareMetalServerBootTargetBareMetalServerDiskReference struct -// This model "extends" BareMetalServerBootTarget -type BareMetalServerBootTargetBareMetalServerDiskReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` +// InstanceGroupManagerActionScheduledAction : InstanceGroupManagerActionScheduledAction struct +// Models which "extend" this model: +// - InstanceGroupManagerActionScheduledActionGroupTarget +// - InstanceGroupManagerActionScheduledActionManagerTarget +// This model "extends" InstanceGroupManagerAction +type InstanceGroupManagerActionScheduledAction struct { + // Indicates whether this scheduled action will be automatically deleted after it has completed and + // `auto_delete_timeout` hours have passed. At present, this is always + // `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The URL for this bare metal server disk. + // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically + // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the + // future. + AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` + + // The date and time that the instance group manager action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance group manager action. Href *string `json:"href" validate:"required"` - // The unique identifier for this bare metal server disk. + // The unique identifier for this instance group manager action. ID *string `json:"id" validate:"required"` - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. + // The name for this instance group manager action. The name is unique across all actions for the instance group + // manager. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance group action + // - `active`: Action is ready to be run + // - `completed`: Action was completed successfully + // - `failed`: Action could not be completed successfully + // - `incompatible`: Action parameters are not compatible with the group or manager + // - `omitted`: Action was not applied because this action's manager was disabled. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group manager action was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of action for the instance group. + ActionType *string `json:"action_type" validate:"required"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + // The date and time the scheduled action was last applied. If absent, the action has never been applied. + LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + + // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run + // time. + NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + + Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` } -// Constants associated with the BareMetalServerBootTargetBareMetalServerDiskReference.ResourceType property. +// Constants associated with the InstanceGroupManagerActionScheduledAction.ResourceType property. // The resource type. const ( - BareMetalServerBootTargetBareMetalServerDiskReferenceResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" + InstanceGroupManagerActionScheduledActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" ) -func (*BareMetalServerBootTargetBareMetalServerDiskReference) isaBareMetalServerBootTarget() bool { +// Constants associated with the InstanceGroupManagerActionScheduledAction.Status property. +// The status of the instance group action +// - `active`: Action is ready to be run +// - `completed`: Action was completed successfully +// - `failed`: Action could not be completed successfully +// - `incompatible`: Action parameters are not compatible with the group or manager +// - `omitted`: Action was not applied because this action's manager was disabled. +const ( + InstanceGroupManagerActionScheduledActionStatusActiveConst = "active" + InstanceGroupManagerActionScheduledActionStatusCompletedConst = "completed" + InstanceGroupManagerActionScheduledActionStatusFailedConst = "failed" + InstanceGroupManagerActionScheduledActionStatusIncompatibleConst = "incompatible" + InstanceGroupManagerActionScheduledActionStatusOmittedConst = "omitted" +) + +// Constants associated with the InstanceGroupManagerActionScheduledAction.ActionType property. +// The type of action for the instance group. +const ( + InstanceGroupManagerActionScheduledActionActionTypeScheduledConst = "scheduled" +) + +func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerActionScheduledAction() bool { return true } -// UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference unmarshals an instance of BareMetalServerBootTargetBareMetalServerDiskReference from the specified map of raw messages. -func UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerBootTargetBareMetalServerDiskReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) +type InstanceGroupManagerActionScheduledActionIntf interface { + InstanceGroupManagerActionIntf + isaInstanceGroupManagerActionScheduledAction() bool +} + +func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerAction() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionScheduledAction unmarshals an instance of InstanceGroupManagerActionScheduledAction from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionScheduledAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionScheduledAction) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -79067,217 +92066,210 @@ func UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference(m map[string if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount : BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct -// This model "extends" BareMetalServerInitializationUserAccount -type BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct { - // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` - - // The public SSH key used to encrypt the password. - EncryptionKey *KeyReference `json:"encryption_key" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The username for the account created at initialization. - Username *string `json:"username" validate:"required"` -} - -// Constants associated with the BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.ResourceType property. -// The resource type. -const ( - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccountResourceTypeHostUserAccountConst = "host_user_account" -) - -func (*BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) isaBareMetalServerInitializationUserAccount() bool { - return true -} - -// UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount unmarshals an instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceByHiperSocket : BareMetalServerNetworkInterfaceByHiperSocket struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByHiperSocket struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` + err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The date and time that the bare metal server network interface was created. +// InstanceGroupManagerAutoScale : InstanceGroupManagerAutoScale struct +// This model "extends" InstanceGroupManager +type InstanceGroupManagerAutoScale struct { + // The date and time that the instance group manager was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. + // The URL for this instance group manager. Href *string `json:"href" validate:"required"` - // The unique identifier for this bare metal server network interface. + // The unique identifier for this instance group manager. ID *string `json:"id" validate:"required"` - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - MacAddress *string `json:"mac_address" validate:"required"` + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled" validate:"required"` - // The name for this bare metal server network interface. + // The name for this instance group manager. The name is unique across all managers for the instance group. Name *string `json:"name" validate:"required"` - // The bare metal server network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + // The date and time that the instance group manager was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window" validate:"required"` - // The security groups targeting this bare metal server network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown" validate:"required"` - // The status of the bare metal server network interface. - Status *string `json:"status" validate:"required"` + // The type of instance group manager. + ManagerType *string `json:"manager_type" validate:"required"` - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` - // The bare metal server network interface type. - Type *string `json:"type" validate:"required"` + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count" validate:"required"` - // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - InterfaceType *string `json:"interface_type" validate:"required"` + // The policies of the instance group manager. + Policies []InstanceGroupManagerPolicyReference `json:"policies" validate:"required"` } -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByHiperSocketResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Status property. -// The status of the bare metal server network interface. -const ( - BareMetalServerNetworkInterfaceByHiperSocketStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByHiperSocketStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByHiperSocketStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByHiperSocketStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Type property. -// The bare metal server network interface type. -const ( - BareMetalServerNetworkInterfaceByHiperSocketTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByHiperSocketTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.InterfaceType property. -// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. +// Constants associated with the InstanceGroupManagerAutoScale.ManagerType property. +// The type of instance group manager. const ( - BareMetalServerNetworkInterfaceByHiperSocketInterfaceTypeHipersocketConst = "hipersocket" + InstanceGroupManagerAutoScaleManagerTypeAutoscaleConst = "autoscale" ) -func (*BareMetalServerNetworkInterfaceByHiperSocket) isaBareMetalServerNetworkInterface() bool { +func (*InstanceGroupManagerAutoScale) isaInstanceGroupManager() bool { return true } -// UnmarshalBareMetalServerNetworkInterfaceByHiperSocket unmarshals an instance of BareMetalServerNetworkInterfaceByHiperSocket from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByHiperSocket(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByHiperSocket) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +// UnmarshalInstanceGroupManagerAutoScale unmarshals an instance of InstanceGroupManagerAutoScale from the specified map of raw messages. +func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerAutoScale) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct +// This model "extends" InstanceGroupManagerPolicyPrototype +type InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct { + // The name for this instance group manager policy. The name must not be used by another policy for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The type of metric to be evaluated. + MetricType *string `json:"metric_type" validate:"required"` + + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value" validate:"required"` + + // The type of policy for the instance group. + PolicyType *string `json:"policy_type" validate:"required"` +} + +// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkOutConst = "network_out" +) + +// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.PolicyType property. +// The type of policy for the instance group. +const ( + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypePolicyTypeTargetConst = "target" +) + +// NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : Instantiate InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(metricType string, metricValue int64, policyType string) (_model *InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype, err error) { + _model = &InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype{ + MetricType: core.StringPtr(metricType), + MetricValue: core.Int64Ptr(metricValue), + PolicyType: core.StringPtr(policyType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) if err != nil { return } @@ -79285,177 +92277,167 @@ func UnmarshalBareMetalServerNetworkInterfaceByHiperSocket(m map[string]json.Raw return } -// BareMetalServerNetworkInterfaceByPci : BareMetalServerNetworkInterfaceByPci struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByPci struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. +// InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy : InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct +// This model "extends" InstanceGroupManagerPolicy +type InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct { + // The date and time that the instance group manager policy was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. + // The URL for this instance group manager policy. Href *string `json:"href" validate:"required"` - // The unique identifier for this bare metal server network interface. + // The unique identifier for this instance group manager policy. ID *string `json:"id" validate:"required"` - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. + // The name for this instance group manager policy. The name is unique across all policies for the instance group + // manager. Name *string `json:"name" validate:"required"` - // The bare metal server network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The date and time that the instance group manager policy was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // The bare metal server network interface type. - Type *string `json:"type" validate:"required"` + // The type of metric to be evaluated. + MetricType *string `json:"metric_type" validate:"required"` - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value" validate:"required"` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - InterfaceType *string `json:"interface_type" validate:"required"` + // The type of policy for the instance group. + PolicyType *string `json:"policy_type" validate:"required"` } -// Constants associated with the BareMetalServerNetworkInterfaceByPci.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByPciResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.Status property. -// The status of the bare metal server network interface. -const ( - BareMetalServerNetworkInterfaceByPciStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByPciStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByPciStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByPciStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.Type property. -// The bare metal server network interface type. +// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.MetricType property. +// The type of metric to be evaluated. const ( - BareMetalServerNetworkInterfaceByPciTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByPciTypeSecondaryConst = "secondary" + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkOutConst = "network_out" ) -// Constants associated with the BareMetalServerNetworkInterfaceByPci.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. +// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.PolicyType property. +// The type of policy for the instance group. const ( - BareMetalServerNetworkInterfaceByPciInterfaceTypePciConst = "pci" + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyPolicyTypeTargetConst = "target" ) -func (*BareMetalServerNetworkInterfaceByPci) isaBareMetalServerNetworkInterface() bool { +func (*InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) isaInstanceGroupManagerPolicy() bool { return true } -// UnmarshalBareMetalServerNetworkInterfaceByPci unmarshals an instance of BareMetalServerNetworkInterfaceByPci from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByPci(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByPci) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } +// UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy unmarshals an instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct +// This model "extends" InstanceGroupManagerPrototype +type InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct { + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` + + // The name for this instance group manager. The name must not be used by another manager for the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` + + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` + + // The type of instance group manager. + ManagerType *string `json:"manager_type" validate:"required"` + + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +} + +// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.ManagerType property. +// The type of instance group manager. +const ( + InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototypeManagerTypeAutoscaleConst = "autoscale" +) + +// NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(managerType string, maxMembershipCount int64) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype, err error) { + _model = &InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype{ + ManagerType: core.StringPtr(managerType), + MaxMembershipCount: core.Int64Ptr(maxMembershipCount), } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) isaInstanceGroupManagerPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) if err != nil { return } @@ -79463,140 +92445,103 @@ func UnmarshalBareMetalServerNetworkInterfaceByPci(m map[string]json.RawMessage, return } -// BareMetalServerNetworkInterfaceByVlan : BareMetalServerNetworkInterfaceByVlan struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByVlan struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - MacAddress *string `json:"mac_address" validate:"required"` +// InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct +// This model "extends" InstanceGroupManagerPrototype +type InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct { + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` + // The name for this instance group manager. The name must not be used by another manager for the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The bare metal server network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` + // The type of instance group manager. + ManagerType *string `json:"manager_type" validate:"required"` +} - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` +// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.ManagerType property. +// The type of instance group manager. +const ( + InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototypeManagerTypeScheduledConst = "scheduled" +) - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(managerType string) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype, err error) { + _model = &InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype{ + ManagerType: core.StringPtr(managerType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The security groups targeting this bare metal server network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` +func (*InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) isaInstanceGroupManagerPrototype() bool { + return true +} - // The status of the bare metal server network interface. - Status *string `json:"status" validate:"required"` +// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` +// InstanceGroupManagerScheduled : InstanceGroupManagerScheduled struct +// This model "extends" InstanceGroupManager +type InstanceGroupManagerScheduled struct { + // The date and time that the instance group manager was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The bare metal server network interface type. - Type *string `json:"type" validate:"required"` + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - InterfaceType *string `json:"interface_type" validate:"required"` + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled" validate:"required"` - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - Vlan *int64 `json:"vlan" validate:"required"` -} + // The name for this instance group manager. The name is unique across all managers for the instance group. + Name *string `json:"name" validate:"required"` -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByVlanResourceTypeNetworkInterfaceConst = "network_interface" -) + // The date and time that the instance group manager was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Status property. -// The status of the bare metal server network interface. -const ( - BareMetalServerNetworkInterfaceByVlanStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByVlanStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByVlanStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByVlanStatusPendingConst = "pending" -) + // The actions of the instance group manager. + Actions []InstanceGroupManagerActionReference `json:"actions" validate:"required"` -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Type property. -// The bare metal server network interface type. -const ( - BareMetalServerNetworkInterfaceByVlanTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByVlanTypeSecondaryConst = "secondary" -) + // The type of instance group manager. + ManagerType *string `json:"manager_type" validate:"required"` +} -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. +// Constants associated with the InstanceGroupManagerScheduled.ManagerType property. +// The type of instance group manager. const ( - BareMetalServerNetworkInterfaceByVlanInterfaceTypeVlanConst = "vlan" + InstanceGroupManagerScheduledManagerTypeScheduledConst = "scheduled" ) -func (*BareMetalServerNetworkInterfaceByVlan) isaBareMetalServerNetworkInterface() bool { +func (*InstanceGroupManagerScheduled) isaInstanceGroupManager() bool { return true } -// UnmarshalBareMetalServerNetworkInterfaceByVlan unmarshals an instance of BareMetalServerNetworkInterfaceByVlan from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByVlan) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } +// UnmarshalInstanceGroupManagerScheduled unmarshals an instance of InstanceGroupManagerScheduled from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduled(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduled) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -79605,7 +92550,7 @@ func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) if err != nil { return } @@ -79613,43 +92558,73 @@ func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerScheduledActionManagerAutoScale : InstanceGroupManagerScheduledActionManagerAutoScale struct +// This model "extends" InstanceGroupManagerScheduledActionManager +type InstanceGroupManagerScheduledActionManagerAutoScale struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager. The name is unique across all managers for the instance group. + Name *string `json:"name" validate:"required"` + + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +} + +func (*InstanceGroupManagerScheduledActionManagerAutoScale) isaInstanceGroupManagerScheduledActionManager() bool { + return true +} + +// UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale unmarshals an instance of InstanceGroupManagerScheduledActionManagerAutoScale from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerAutoScale) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) if err != nil { return } @@ -79657,98 +92632,105 @@ func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage return } -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` +// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype : The auto scale manager to update, and one or more properties to be updated. Either `id` or `href` must be specified, +// in addition to at least one of `min_membership_count` and +// `max_membership_count`. +// Models which "extend" this model: +// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID +// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref +// This model "extends" InstanceGroupManagerScheduledActionManagerPrototype +type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The unique identifier for this instance group manager. + ID *string `json:"id,omitempty"` - // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. - InterfaceType *string `json:"interface_type" validate:"required"` + // The URL for this instance group manager. + Href *string `json:"href,omitempty"` } -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.InterfaceType property. -// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeInterfaceTypeHipersocketConst = "hipersocket" -) +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { + return true +} -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - } - err = core.ValidateStruct(_model, "required parameters") - return +type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeIntf interface { + InstanceGroupManagerScheduledActionManagerPrototypeIntf + isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool } -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { return true } -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. +// Models which "extend" this model: +// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterface +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` + + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` +} + +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { + return true +} + +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityIntf interface { + InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf + isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool +} + +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -79756,111 +92738,109 @@ func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInte return } -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext : The virtual network interface for this target. +// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterface +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` + // If `true`: // - The VPC infrastructure performs any needed NAT operations. // - `floating_ips` must not have more than one floating IP. // // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, + // - Packets are passed unchanged to/from the virtual network interface, // allowing the workload to perform any needed NAT operations. // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` -} + // The resource group to use for this virtual network interface. If unspecified, the + // virtual server instance's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypePciConst = "pci" -) + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { return true } -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext) err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } @@ -79868,128 +92848,159 @@ func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInte return } -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - Vlan *int64 `json:"vlan" validate:"required"` +// InstancePatchProfileInstanceProfileIdentityByHref : InstancePatchProfileInstanceProfileIdentityByHref struct +// This model "extends" InstancePatchProfile +type InstancePatchProfileInstanceProfileIdentityByHref struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` } -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeInterfaceTypeVlanConst = "vlan" -) - -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(subnet SubnetIdentityIntf, interfaceType string, vlan int64) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - Vlan: core.Int64Ptr(vlan), +// NewInstancePatchProfileInstanceProfileIdentityByHref : Instantiate InstancePatchProfileInstanceProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByHref(href string) (_model *InstancePatchProfileInstanceProfileIdentityByHref, err error) { + _model = &InstancePatchProfileInstanceProfileIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { +func (*InstancePatchProfileInstanceProfileIdentityByHref) isaInstancePatchProfile() bool { return true } -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +// UnmarshalInstancePatchProfileInstanceProfileIdentityByHref unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePatchProfileInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatchProfileInstanceProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePatchProfileInstanceProfileIdentityByName : InstancePatchProfileInstanceProfileIdentityByName struct +// This model "extends" InstancePatchProfile +type InstancePatchProfileInstanceProfileIdentityByName struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` +} + +// NewInstancePatchProfileInstanceProfileIdentityByName : Instantiate InstancePatchProfileInstanceProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByName(name string) (_model *InstancePatchProfileInstanceProfileIdentityByName, err error) { + _model = &InstancePatchProfileInstanceProfileIdentityByName{ + Name: core.StringPtr(name), } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePatchProfileInstanceProfileIdentityByName) isaInstancePatchProfile() bool { + return true +} + +// UnmarshalInstancePatchProfileInstanceProfileIdentityByName unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByName from the specified map of raw messages. +func UnmarshalInstancePatchProfileInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatchProfileInstanceProfileIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref +// This model "extends" InstancePlacementTargetPatch +type InstancePlacementTargetPatchDedicatedHostGroupIdentity struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +type InstancePlacementTargetPatchDedicatedHostGroupIdentityIntf interface { + InstancePlacementTargetPatchIntf + isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostIdentity : Identifies a dedicated host by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref +// This model "extends" InstancePlacementTargetPatch +type InstancePlacementTargetPatchDedicatedHostIdentity struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { + return true +} + +type InstancePlacementTargetPatchDedicatedHostIdentityIntf interface { + InstancePlacementTargetPatchIntf + isaInstancePlacementTargetPatchDedicatedHostIdentity() bool +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -79997,28 +93008,48 @@ func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInte return } -// BareMetalServerProfileBandwidthDependent : The total bandwidth shared across the bare metal server network interfaces of a bare metal server with this profile -// depends on its configuration. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// InstancePlacementTargetPrototypeDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID +// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN +// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref +// This model "extends" InstancePlacementTargetPrototype +type InstancePlacementTargetPrototypeDedicatedHostGroupIdentity struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` } -// Constants associated with the BareMetalServerProfileBandwidthDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthDependentTypeDependentConst = "dependent" -) +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { + return true +} -func (*BareMetalServerProfileBandwidthDependent) isaBareMetalServerProfileBandwidth() bool { +type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityIntf interface { + InstancePlacementTargetPrototypeIntf + isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool +} + +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototype() bool { return true } -// UnmarshalBareMetalServerProfileBandwidthDependent unmarshals an instance of BareMetalServerProfileBandwidthDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -80026,42 +93057,48 @@ func UnmarshalBareMetalServerProfileBandwidthDependent(m map[string]json.RawMess return } -// BareMetalServerProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the bare metal server network interfaces -// of a bare metal server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstancePlacementTargetPrototypeDedicatedHostIdentity : Identifies a dedicated host by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID +// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN +// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref +// This model "extends" InstancePlacementTargetPrototype +type InstancePlacementTargetPrototypeDedicatedHostIdentity struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` } -// Constants associated with the BareMetalServerProfileBandwidthEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthEnumTypeEnumConst = "enum" -) +func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { + return true +} -func (*BareMetalServerProfileBandwidthEnum) isaBareMetalServerProfileBandwidth() bool { +type InstancePlacementTargetPrototypeDedicatedHostIdentityIntf interface { + InstancePlacementTargetPrototypeIntf + isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool +} + +func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototype() bool { return true } -// UnmarshalBareMetalServerProfileBandwidthEnum unmarshals an instance of BareMetalServerProfileBandwidthEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -80069,35 +93106,48 @@ func UnmarshalBareMetalServerProfileBandwidthEnum(m map[string]json.RawMessage, return } -// BareMetalServerProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the bare metal server network interfaces of a bare metal -// server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// InstancePlacementTargetPrototypePlacementGroupIdentity : Identifies a placement group by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID +// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN +// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref +// This model "extends" InstancePlacementTargetPrototype +type InstancePlacementTargetPrototypePlacementGroupIdentity struct { + // The unique identifier for this placement group. + ID *string `json:"id,omitempty"` - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` + // The CRN for this placement group. + CRN *string `json:"crn,omitempty"` + + // The URL for this placement group. + Href *string `json:"href,omitempty"` } -// Constants associated with the BareMetalServerProfileBandwidthFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthFixedTypeFixedConst = "fixed" -) +func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { + return true +} -func (*BareMetalServerProfileBandwidthFixed) isaBareMetalServerProfileBandwidth() bool { +type InstancePlacementTargetPrototypePlacementGroupIdentityIntf interface { + InstancePlacementTargetPrototypeIntf + isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool +} + +func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototype() bool { return true } -// UnmarshalBareMetalServerProfileBandwidthFixed unmarshals an instance of BareMetalServerProfileBandwidthFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypePlacementGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -80105,84 +93155,63 @@ func UnmarshalBareMetalServerProfileBandwidthFixed(m map[string]json.RawMessage, return } -// BareMetalServerProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the bare metal server network interfaces -// of a bare metal server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstancePlacementTargetDedicatedHostGroupReference : InstancePlacementTargetDedicatedHostGroupReference struct +// This model "extends" InstancePlacementTarget +type InstancePlacementTargetDedicatedHostGroupReference struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the BareMetalServerProfileBandwidthRange.Type property. -// The type for this profile field. +// Constants associated with the InstancePlacementTargetDedicatedHostGroupReference.ResourceType property. +// The resource type. const ( - BareMetalServerProfileBandwidthRangeTypeRangeConst = "range" + InstancePlacementTargetDedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" ) -func (*BareMetalServerProfileBandwidthRange) isaBareMetalServerProfileBandwidth() bool { +func (*InstancePlacementTargetDedicatedHostGroupReference) isaInstancePlacementTarget() bool { return true } -// UnmarshalBareMetalServerProfileBandwidthRange unmarshals an instance of BareMetalServerProfileBandwidthRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstancePlacementTargetDedicatedHostGroupReference unmarshals an instance of InstancePlacementTargetDedicatedHostGroupReference from the specified map of raw messages. +func UnmarshalInstancePlacementTargetDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetDedicatedHostGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountDependent : The CPU core count for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileCpuCoreCountDependent) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountDependent unmarshals an instance of BareMetalServerProfileCpuCoreCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -80190,76 +93219,63 @@ func UnmarshalBareMetalServerProfileCpuCoreCountDependent(m map[string]json.RawM return } -// BareMetalServerProfileCpuCoreCountEnum : The permitted values for CPU cores for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstancePlacementTargetDedicatedHostReference : InstancePlacementTargetDedicatedHostReference struct +// This model "extends" InstancePlacementTarget +type InstancePlacementTargetDedicatedHostReference struct { + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` + + // The name for this dedicated host. The name is unique across all dedicated hosts in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuCoreCountEnum.Type property. -// The type for this profile field. +// Constants associated with the InstancePlacementTargetDedicatedHostReference.ResourceType property. +// The resource type. const ( - BareMetalServerProfileCpuCoreCountEnumTypeEnumConst = "enum" + InstancePlacementTargetDedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" ) -func (*BareMetalServerProfileCpuCoreCountEnum) isaBareMetalServerProfileCpuCoreCount() bool { +func (*InstancePlacementTargetDedicatedHostReference) isaInstancePlacementTarget() bool { return true } -// UnmarshalBareMetalServerProfileCpuCoreCountEnum unmarshals an instance of BareMetalServerProfileCpuCoreCountEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstancePlacementTargetDedicatedHostReference unmarshals an instance of InstancePlacementTargetDedicatedHostReference from the specified map of raw messages. +func UnmarshalInstancePlacementTargetDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetDedicatedHostReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountFixed : The CPU core count for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileCpuCoreCountFixed) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountFixed unmarshals an instance of BareMetalServerProfileCpuCoreCountFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -80267,55 +93283,63 @@ func UnmarshalBareMetalServerProfileCpuCoreCountFixed(m map[string]json.RawMessa return } -// BareMetalServerProfileCpuCoreCountRange : The permitted range for the number of CPU cores for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstancePlacementTargetPlacementGroupReference : InstancePlacementTargetPlacementGroupReference struct +// This model "extends" InstancePlacementTarget +type InstancePlacementTargetPlacementGroupReference struct { + // The CRN for this placement group. + CRN *string `json:"crn" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *PlacementGroupReferenceDeleted `json:"deleted,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // The URL for this placement group. + Href *string `json:"href" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The unique identifier for this placement group. + ID *string `json:"id" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The name for this placement group. The name is unique across all placement groups in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuCoreCountRange.Type property. -// The type for this profile field. +// Constants associated with the InstancePlacementTargetPlacementGroupReference.ResourceType property. +// The resource type. const ( - BareMetalServerProfileCpuCoreCountRangeTypeRangeConst = "range" + InstancePlacementTargetPlacementGroupReferenceResourceTypePlacementGroupConst = "placement_group" ) -func (*BareMetalServerProfileCpuCoreCountRange) isaBareMetalServerProfileCpuCoreCount() bool { +func (*InstancePlacementTargetPlacementGroupReference) isaInstancePlacementTarget() bool { return true } -// UnmarshalBareMetalServerProfileCpuCoreCountRange unmarshals an instance of BareMetalServerProfileCpuCoreCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstancePlacementTargetPlacementGroupReference unmarshals an instance of InstancePlacementTargetPlacementGroupReference from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPlacementGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPlacementGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPlacementGroupReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -80323,26 +93347,27 @@ func UnmarshalBareMetalServerProfileCpuCoreCountRange(m map[string]json.RawMessa return } -// BareMetalServerProfileCpuSocketCountDependent : The CPU socket count for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountDependent struct { +// InstanceProfileBandwidthDependent : The total bandwidth shared across the network attachments or network interfaces and storage volumes of an instance +// with this profile depends on its configuration. +// This model "extends" InstanceProfileBandwidth +type InstanceProfileBandwidthDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuSocketCountDependent.Type property. +// Constants associated with the InstanceProfileBandwidthDependent.Type property. // The type for this profile field. const ( - BareMetalServerProfileCpuSocketCountDependentTypeDependentConst = "dependent" + InstanceProfileBandwidthDependentTypeDependentConst = "dependent" ) -func (*BareMetalServerProfileCpuSocketCountDependent) isaBareMetalServerProfileCpuSocketCount() bool { +func (*InstanceProfileBandwidthDependent) isaInstanceProfileBandwidth() bool { return true } -// UnmarshalBareMetalServerProfileCpuSocketCountDependent unmarshals an instance of BareMetalServerProfileCpuSocketCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountDependent) +// UnmarshalInstanceProfileBandwidthDependent unmarshals an instance of InstanceProfileBandwidthDependent from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidthDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80351,9 +93376,10 @@ func UnmarshalBareMetalServerProfileCpuSocketCountDependent(m map[string]json.Ra return } -// BareMetalServerProfileCpuSocketCountEnum : The permitted values for CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountEnum struct { +// InstanceProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the network attachments or network +// interfaces and storage volumes of an instance with this profile. +// This model "extends" InstanceProfileBandwidth +type InstanceProfileBandwidthEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80364,19 +93390,19 @@ type BareMetalServerProfileCpuSocketCountEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuSocketCountEnum.Type property. +// Constants associated with the InstanceProfileBandwidthEnum.Type property. // The type for this profile field. const ( - BareMetalServerProfileCpuSocketCountEnumTypeEnumConst = "enum" + InstanceProfileBandwidthEnumTypeEnumConst = "enum" ) -func (*BareMetalServerProfileCpuSocketCountEnum) isaBareMetalServerProfileCpuSocketCount() bool { +func (*InstanceProfileBandwidthEnum) isaInstanceProfileBandwidth() bool { return true } -// UnmarshalBareMetalServerProfileCpuSocketCountEnum unmarshals an instance of BareMetalServerProfileCpuSocketCountEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountEnum) +// UnmarshalInstanceProfileBandwidthEnum unmarshals an instance of InstanceProfileBandwidthEnum from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidthEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80393,9 +93419,10 @@ func UnmarshalBareMetalServerProfileCpuSocketCountEnum(m map[string]json.RawMess return } -// BareMetalServerProfileCpuSocketCountFixed : The number of CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountFixed struct { +// InstanceProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the network attachments or network interfaces and storage +// volumes of an instance with this profile. +// This model "extends" InstanceProfileBandwidth +type InstanceProfileBandwidthFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -80403,19 +93430,19 @@ type BareMetalServerProfileCpuSocketCountFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuSocketCountFixed.Type property. +// Constants associated with the InstanceProfileBandwidthFixed.Type property. // The type for this profile field. const ( - BareMetalServerProfileCpuSocketCountFixedTypeFixedConst = "fixed" + InstanceProfileBandwidthFixedTypeFixedConst = "fixed" ) -func (*BareMetalServerProfileCpuSocketCountFixed) isaBareMetalServerProfileCpuSocketCount() bool { +func (*InstanceProfileBandwidthFixed) isaInstanceProfileBandwidth() bool { return true } -// UnmarshalBareMetalServerProfileCpuSocketCountFixed unmarshals an instance of BareMetalServerProfileCpuSocketCountFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountFixed) +// UnmarshalInstanceProfileBandwidthFixed unmarshals an instance of InstanceProfileBandwidthFixed from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidthFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80428,9 +93455,10 @@ func UnmarshalBareMetalServerProfileCpuSocketCountFixed(m map[string]json.RawMes return } -// BareMetalServerProfileCpuSocketCountRange : The permitted range for the number of CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountRange struct { +// InstanceProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network attachments or network +// interfaces and storage volumes of an instance with this profile. +// This model "extends" InstanceProfileBandwidth +type InstanceProfileBandwidthRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80447,19 +93475,19 @@ type BareMetalServerProfileCpuSocketCountRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileCpuSocketCountRange.Type property. +// Constants associated with the InstanceProfileBandwidthRange.Type property. // The type for this profile field. const ( - BareMetalServerProfileCpuSocketCountRangeTypeRangeConst = "range" + InstanceProfileBandwidthRangeTypeRangeConst = "range" ) -func (*BareMetalServerProfileCpuSocketCountRange) isaBareMetalServerProfileCpuSocketCount() bool { +func (*InstanceProfileBandwidthRange) isaInstanceProfileBandwidth() bool { return true } -// UnmarshalBareMetalServerProfileCpuSocketCountRange unmarshals an instance of BareMetalServerProfileCpuSocketCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountRange) +// UnmarshalInstanceProfileBandwidthRange unmarshals an instance of InstanceProfileBandwidthRange from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidthRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80484,27 +93512,26 @@ func UnmarshalBareMetalServerProfileCpuSocketCountRange(m map[string]json.RawMes return } -// BareMetalServerProfileDiskQuantityDependent : The number of disks of this configuration for a bare metal server with this profile depends on its bare metal server -// configuration. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityDependent struct { +// InstanceProfileDiskQuantityDependent : The number of disks of this configuration for an instance with this profile depends on its instance configuration. +// This model "extends" InstanceProfileDiskQuantity +type InstanceProfileDiskQuantityDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskQuantityDependent.Type property. +// Constants associated with the InstanceProfileDiskQuantityDependent.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskQuantityDependentTypeDependentConst = "dependent" + InstanceProfileDiskQuantityDependentTypeDependentConst = "dependent" ) -func (*BareMetalServerProfileDiskQuantityDependent) isaBareMetalServerProfileDiskQuantity() bool { +func (*InstanceProfileDiskQuantityDependent) isaInstanceProfileDiskQuantity() bool { return true } -// UnmarshalBareMetalServerProfileDiskQuantityDependent unmarshals an instance of BareMetalServerProfileDiskQuantityDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityDependent) +// UnmarshalInstanceProfileDiskQuantityDependent unmarshals an instance of InstanceProfileDiskQuantityDependent from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantityDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80513,9 +93540,9 @@ func UnmarshalBareMetalServerProfileDiskQuantityDependent(m map[string]json.RawM return } -// BareMetalServerProfileDiskQuantityEnum : The permitted the number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityEnum struct { +// InstanceProfileDiskQuantityEnum : The permitted the number of disks of this configuration for an instance with this profile. +// This model "extends" InstanceProfileDiskQuantity +type InstanceProfileDiskQuantityEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80526,19 +93553,19 @@ type BareMetalServerProfileDiskQuantityEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskQuantityEnum.Type property. +// Constants associated with the InstanceProfileDiskQuantityEnum.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskQuantityEnumTypeEnumConst = "enum" + InstanceProfileDiskQuantityEnumTypeEnumConst = "enum" ) -func (*BareMetalServerProfileDiskQuantityEnum) isaBareMetalServerProfileDiskQuantity() bool { +func (*InstanceProfileDiskQuantityEnum) isaInstanceProfileDiskQuantity() bool { return true } -// UnmarshalBareMetalServerProfileDiskQuantityEnum unmarshals an instance of BareMetalServerProfileDiskQuantityEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityEnum) +// UnmarshalInstanceProfileDiskQuantityEnum unmarshals an instance of InstanceProfileDiskQuantityEnum from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantityEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80555,9 +93582,9 @@ func UnmarshalBareMetalServerProfileDiskQuantityEnum(m map[string]json.RawMessag return } -// BareMetalServerProfileDiskQuantityFixed : The number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityFixed struct { +// InstanceProfileDiskQuantityFixed : The number of disks of this configuration for an instance with this profile. +// This model "extends" InstanceProfileDiskQuantity +type InstanceProfileDiskQuantityFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -80565,19 +93592,19 @@ type BareMetalServerProfileDiskQuantityFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskQuantityFixed.Type property. +// Constants associated with the InstanceProfileDiskQuantityFixed.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskQuantityFixedTypeFixedConst = "fixed" + InstanceProfileDiskQuantityFixedTypeFixedConst = "fixed" ) -func (*BareMetalServerProfileDiskQuantityFixed) isaBareMetalServerProfileDiskQuantity() bool { +func (*InstanceProfileDiskQuantityFixed) isaInstanceProfileDiskQuantity() bool { return true } -// UnmarshalBareMetalServerProfileDiskQuantityFixed unmarshals an instance of BareMetalServerProfileDiskQuantityFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityFixed) +// UnmarshalInstanceProfileDiskQuantityFixed unmarshals an instance of InstanceProfileDiskQuantityFixed from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantityFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80590,9 +93617,9 @@ func UnmarshalBareMetalServerProfileDiskQuantityFixed(m map[string]json.RawMessa return } -// BareMetalServerProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityRange struct { +// InstanceProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for an instance with this profile. +// This model "extends" InstanceProfileDiskQuantity +type InstanceProfileDiskQuantityRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80609,19 +93636,19 @@ type BareMetalServerProfileDiskQuantityRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskQuantityRange.Type property. +// Constants associated with the InstanceProfileDiskQuantityRange.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskQuantityRangeTypeRangeConst = "range" + InstanceProfileDiskQuantityRangeTypeRangeConst = "range" ) -func (*BareMetalServerProfileDiskQuantityRange) isaBareMetalServerProfileDiskQuantity() bool { +func (*InstanceProfileDiskQuantityRange) isaInstanceProfileDiskQuantity() bool { return true } -// UnmarshalBareMetalServerProfileDiskQuantityRange unmarshals an instance of BareMetalServerProfileDiskQuantityRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityRange) +// UnmarshalInstanceProfileDiskQuantityRange unmarshals an instance of InstanceProfileDiskQuantityRange from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantityRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80646,27 +93673,27 @@ func UnmarshalBareMetalServerProfileDiskQuantityRange(m map[string]json.RawMessa return } -// BareMetalServerProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for a bare metal server with this profile depends on its bare -// metal server configuration. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeDependent struct { +// InstanceProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for an instance with this profile depends on its instance +// configuration. +// This model "extends" InstanceProfileDiskSize +type InstanceProfileDiskSizeDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskSizeDependent.Type property. +// Constants associated with the InstanceProfileDiskSizeDependent.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskSizeDependentTypeDependentConst = "dependent" + InstanceProfileDiskSizeDependentTypeDependentConst = "dependent" ) -func (*BareMetalServerProfileDiskSizeDependent) isaBareMetalServerProfileDiskSize() bool { +func (*InstanceProfileDiskSizeDependent) isaInstanceProfileDiskSize() bool { return true } -// UnmarshalBareMetalServerProfileDiskSizeDependent unmarshals an instance of BareMetalServerProfileDiskSizeDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeDependent) +// UnmarshalInstanceProfileDiskSizeDependent unmarshals an instance of InstanceProfileDiskSizeDependent from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSizeDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80675,9 +93702,9 @@ func UnmarshalBareMetalServerProfileDiskSizeDependent(m map[string]json.RawMessa return } -// BareMetalServerProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeEnum struct { +// InstanceProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for an instance with this profile. +// This model "extends" InstanceProfileDiskSize +type InstanceProfileDiskSizeEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80688,19 +93715,19 @@ type BareMetalServerProfileDiskSizeEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskSizeEnum.Type property. +// Constants associated with the InstanceProfileDiskSizeEnum.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskSizeEnumTypeEnumConst = "enum" + InstanceProfileDiskSizeEnumTypeEnumConst = "enum" ) -func (*BareMetalServerProfileDiskSizeEnum) isaBareMetalServerProfileDiskSize() bool { +func (*InstanceProfileDiskSizeEnum) isaInstanceProfileDiskSize() bool { return true } -// UnmarshalBareMetalServerProfileDiskSizeEnum unmarshals an instance of BareMetalServerProfileDiskSizeEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeEnum) +// UnmarshalInstanceProfileDiskSizeEnum unmarshals an instance of InstanceProfileDiskSizeEnum from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSizeEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80717,9 +93744,9 @@ func UnmarshalBareMetalServerProfileDiskSizeEnum(m map[string]json.RawMessage, r return } -// BareMetalServerProfileDiskSizeFixed : The size of the disk in GB (gigabytes). -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeFixed struct { +// InstanceProfileDiskSizeFixed : The size of the disk in GB (gigabytes). +// This model "extends" InstanceProfileDiskSize +type InstanceProfileDiskSizeFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -80727,19 +93754,19 @@ type BareMetalServerProfileDiskSizeFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskSizeFixed.Type property. +// Constants associated with the InstanceProfileDiskSizeFixed.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskSizeFixedTypeFixedConst = "fixed" + InstanceProfileDiskSizeFixedTypeFixedConst = "fixed" ) -func (*BareMetalServerProfileDiskSizeFixed) isaBareMetalServerProfileDiskSize() bool { +func (*InstanceProfileDiskSizeFixed) isaInstanceProfileDiskSize() bool { return true } -// UnmarshalBareMetalServerProfileDiskSizeFixed unmarshals an instance of BareMetalServerProfileDiskSizeFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeFixed) +// UnmarshalInstanceProfileDiskSizeFixed unmarshals an instance of InstanceProfileDiskSizeFixed from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSizeFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80752,10 +93779,9 @@ func UnmarshalBareMetalServerProfileDiskSizeFixed(m map[string]json.RawMessage, return } -// BareMetalServerProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for a bare metal server with this -// profile. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeRange struct { +// InstanceProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for an instance with this profile. +// This model "extends" InstanceProfileDiskSize +type InstanceProfileDiskSizeRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80772,19 +93798,19 @@ type BareMetalServerProfileDiskSizeRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileDiskSizeRange.Type property. +// Constants associated with the InstanceProfileDiskSizeRange.Type property. // The type for this profile field. const ( - BareMetalServerProfileDiskSizeRangeTypeRangeConst = "range" + InstanceProfileDiskSizeRangeTypeRangeConst = "range" ) -func (*BareMetalServerProfileDiskSizeRange) isaBareMetalServerProfileDiskSize() bool { +func (*InstanceProfileDiskSizeRange) isaInstanceProfileDiskSize() bool { return true } -// UnmarshalBareMetalServerProfileDiskSizeRange unmarshals an instance of BareMetalServerProfileDiskSizeRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeRange) +// UnmarshalInstanceProfileDiskSizeRange unmarshals an instance of InstanceProfileDiskSizeRange from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSizeRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80809,30 +93835,27 @@ func UnmarshalBareMetalServerProfileDiskSizeRange(m map[string]json.RawMessage, return } -// BareMetalServerProfileIdentityByHref : BareMetalServerProfileIdentityByHref struct -// This model "extends" BareMetalServerProfileIdentity -type BareMetalServerProfileIdentityByHref struct { - // The URL for this bare metal server profile. - Href *string `json:"href" validate:"required"` +// InstanceProfileGpuDependent : The GPU count for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileGpu +type InstanceProfileGpuDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// NewBareMetalServerProfileIdentityByHref : Instantiate BareMetalServerProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerProfileIdentityByHref(href string) (_model *BareMetalServerProfileIdentityByHref, err error) { - _model = &BareMetalServerProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the InstanceProfileGpuDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuDependentTypeDependentConst = "dependent" +) -func (*BareMetalServerProfileIdentityByHref) isaBareMetalServerProfileIdentity() bool { +func (*InstanceProfileGpuDependent) isaInstanceProfileGpu() bool { return true } -// UnmarshalBareMetalServerProfileIdentityByHref unmarshals an instance of BareMetalServerProfileIdentityByHref from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalInstanceProfileGpuDependent unmarshals an instance of InstanceProfileGpuDependent from the specified map of raw messages. +func UnmarshalInstanceProfileGpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -80840,30 +93863,76 @@ func UnmarshalBareMetalServerProfileIdentityByHref(m map[string]json.RawMessage, return } -// BareMetalServerProfileIdentityByName : BareMetalServerProfileIdentityByName struct -// This model "extends" BareMetalServerProfileIdentity -type BareMetalServerProfileIdentityByName struct { - // The name for this bare metal server profile. - Name *string `json:"name" validate:"required"` +// InstanceProfileGpuEnum : The permitted GPU count values for an instance with this profile. +// This model "extends" InstanceProfileGpu +type InstanceProfileGpuEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// NewBareMetalServerProfileIdentityByName : Instantiate BareMetalServerProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerProfileIdentityByName(name string) (_model *BareMetalServerProfileIdentityByName, err error) { - _model = &BareMetalServerProfileIdentityByName{ - Name: core.StringPtr(name), +// Constants associated with the InstanceProfileGpuEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuEnumTypeEnumConst = "enum" +) + +func (*InstanceProfileGpuEnum) isaInstanceProfileGpu() bool { + return true +} + +// UnmarshalInstanceProfileGpuEnum unmarshals an instance of InstanceProfileGpuEnum from the specified map of raw messages. +func UnmarshalInstanceProfileGpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*BareMetalServerProfileIdentityByName) isaBareMetalServerProfileIdentity() bool { +// InstanceProfileGpuFixed : The GPU count for an instance with this profile. +// This model "extends" InstanceProfileGpu +type InstanceProfileGpuFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileGpuFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfileGpuFixed) isaInstanceProfileGpu() bool { return true } -// UnmarshalBareMetalServerProfileIdentityByName unmarshals an instance of BareMetalServerProfileIdentityByName from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalInstanceProfileGpuFixed unmarshals an instance of InstanceProfileGpuFixed from the specified map of raw messages. +func UnmarshalInstanceProfileGpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -80871,26 +93940,26 @@ func UnmarshalBareMetalServerProfileIdentityByName(m map[string]json.RawMessage, return } -// BareMetalServerProfileMemoryDependent : The memory value for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryDependent struct { +// InstanceProfileGpuMemoryDependent : The overall GPU memory value for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileGpuMemory +type InstanceProfileGpuMemoryDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileMemoryDependent.Type property. +// Constants associated with the InstanceProfileGpuMemoryDependent.Type property. // The type for this profile field. const ( - BareMetalServerProfileMemoryDependentTypeDependentConst = "dependent" + InstanceProfileGpuMemoryDependentTypeDependentConst = "dependent" ) -func (*BareMetalServerProfileMemoryDependent) isaBareMetalServerProfileMemory() bool { +func (*InstanceProfileGpuMemoryDependent) isaInstanceProfileGpuMemory() bool { return true } -// UnmarshalBareMetalServerProfileMemoryDependent unmarshals an instance of BareMetalServerProfileMemoryDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryDependent) +// UnmarshalInstanceProfileGpuMemoryDependent unmarshals an instance of InstanceProfileGpuMemoryDependent from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemoryDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80899,9 +93968,9 @@ func UnmarshalBareMetalServerProfileMemoryDependent(m map[string]json.RawMessage return } -// BareMetalServerProfileMemoryEnum : The permitted memory values (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryEnum struct { +// InstanceProfileGpuMemoryEnum : The permitted overall GPU memory values in GiB (gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileGpuMemory +type InstanceProfileGpuMemoryEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80912,19 +93981,19 @@ type BareMetalServerProfileMemoryEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the BareMetalServerProfileMemoryEnum.Type property. +// Constants associated with the InstanceProfileGpuMemoryEnum.Type property. // The type for this profile field. const ( - BareMetalServerProfileMemoryEnumTypeEnumConst = "enum" + InstanceProfileGpuMemoryEnumTypeEnumConst = "enum" ) -func (*BareMetalServerProfileMemoryEnum) isaBareMetalServerProfileMemory() bool { +func (*InstanceProfileGpuMemoryEnum) isaInstanceProfileGpuMemory() bool { return true } -// UnmarshalBareMetalServerProfileMemoryEnum unmarshals an instance of BareMetalServerProfileMemoryEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryEnum) +// UnmarshalInstanceProfileGpuMemoryEnum unmarshals an instance of InstanceProfileGpuMemoryEnum from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemoryEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -80941,9 +94010,9 @@ func UnmarshalBareMetalServerProfileMemoryEnum(m map[string]json.RawMessage, res return } -// BareMetalServerProfileMemoryFixed : The memory (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryFixed struct { +// InstanceProfileGpuMemoryFixed : The overall GPU memory in GiB (gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileGpuMemory +type InstanceProfileGpuMemoryFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -80951,19 +94020,19 @@ type BareMetalServerProfileMemoryFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the BareMetalServerProfileMemoryFixed.Type property. +// Constants associated with the InstanceProfileGpuMemoryFixed.Type property. // The type for this profile field. const ( - BareMetalServerProfileMemoryFixedTypeFixedConst = "fixed" + InstanceProfileGpuMemoryFixedTypeFixedConst = "fixed" ) -func (*BareMetalServerProfileMemoryFixed) isaBareMetalServerProfileMemory() bool { +func (*InstanceProfileGpuMemoryFixed) isaInstanceProfileGpuMemory() bool { return true } -// UnmarshalBareMetalServerProfileMemoryFixed unmarshals an instance of BareMetalServerProfileMemoryFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryFixed) +// UnmarshalInstanceProfileGpuMemoryFixed unmarshals an instance of InstanceProfileGpuMemoryFixed from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemoryFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -80976,9 +94045,9 @@ func UnmarshalBareMetalServerProfileMemoryFixed(m map[string]json.RawMessage, re return } -// BareMetalServerProfileMemoryRange : The permitted memory range (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryRange struct { +// InstanceProfileGpuMemoryRange : The permitted overall GPU memory range in GiB (gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileGpuMemory +type InstanceProfileGpuMemoryRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -80995,19 +94064,19 @@ type BareMetalServerProfileMemoryRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileMemoryRange.Type property. +// Constants associated with the InstanceProfileGpuMemoryRange.Type property. // The type for this profile field. const ( - BareMetalServerProfileMemoryRangeTypeRangeConst = "range" + InstanceProfileGpuMemoryRangeTypeRangeConst = "range" ) -func (*BareMetalServerProfileMemoryRange) isaBareMetalServerProfileMemory() bool { +func (*InstanceProfileGpuMemoryRange) isaInstanceProfileGpuMemory() bool { return true } -// UnmarshalBareMetalServerProfileMemoryRange unmarshals an instance of BareMetalServerProfileMemoryRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryRange) +// UnmarshalInstanceProfileGpuMemoryRange unmarshals an instance of InstanceProfileGpuMemoryRange from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemoryRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -81032,227 +94101,55 @@ func UnmarshalBareMetalServerProfileMemoryRange(m map[string]json.RawMessage, re return } -// BareMetalServerProfileNetworkInterfaceCountDependent : The number of bare metal server network interfaces supported on a bare metal server with this profile is dependent on -// its configuration. -// This model "extends" BareMetalServerProfileNetworkInterfaceCount -type BareMetalServerProfileNetworkInterfaceCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileNetworkInterfaceCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileNetworkInterfaceCountDependent) isaBareMetalServerProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// InstanceProfileGpuRange : The permitted GPU count range for an instance with this profile. +// This model "extends" InstanceProfileGpu +type InstanceProfileGpuRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// BareMetalServerProfileNetworkInterfaceCountRange : The number of bare metal server network interfaces supported on a bare metal server with this profile. -// This model "extends" BareMetalServerProfileNetworkInterfaceCount -type BareMetalServerProfileNetworkInterfaceCountRange struct { // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + Max *int64 `json:"max" validate:"required"` // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the BareMetalServerProfileNetworkInterfaceCountRange.Type property. +// Constants associated with the InstanceProfileGpuRange.Type property. // The type for this profile field. const ( - BareMetalServerProfileNetworkInterfaceCountRangeTypeRangeConst = "range" + InstanceProfileGpuRangeTypeRangeConst = "range" ) -func (*BareMetalServerProfileNetworkInterfaceCountRange) isaBareMetalServerProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkInterfaceCountRange unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingIdentityCatalogOfferingByCRN : CatalogOfferingIdentityCatalogOfferingByCRN struct -// This model "extends" CatalogOfferingIdentity -type CatalogOfferingIdentityCatalogOfferingByCRN struct { - // The CRN for this - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} - -// NewCatalogOfferingIdentityCatalogOfferingByCRN : Instantiate CatalogOfferingIdentityCatalogOfferingByCRN (Generic Model Constructor) -func (*VpcV1) NewCatalogOfferingIdentityCatalogOfferingByCRN(crn string) (_model *CatalogOfferingIdentityCatalogOfferingByCRN, err error) { - _model = &CatalogOfferingIdentityCatalogOfferingByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CatalogOfferingIdentityCatalogOfferingByCRN) isaCatalogOfferingIdentity() bool { +func (*InstanceProfileGpuRange) isaInstanceProfileGpu() bool { return true } -// UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN unmarshals an instance of CatalogOfferingIdentityCatalogOfferingByCRN from the specified map of raw messages. -func UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingIdentityCatalogOfferingByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceProfileGpuRange unmarshals an instance of InstanceProfileGpuRange from the specified map of raw messages. +func UnmarshalInstanceProfileGpuRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct -// This model "extends" CatalogOfferingVersionIdentity -type CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} - -// NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : Instantiate CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN (Generic Model Constructor) -func (*VpcV1) NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(crn string) (_model *CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN, err error) { - _model = &CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) isaCatalogOfferingVersionIdentity() bool { - return true -} - -// UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN unmarshals an instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CertificateInstanceIdentityByCRN : CertificateInstanceIdentityByCRN struct -// This model "extends" CertificateInstanceIdentity -type CertificateInstanceIdentityByCRN struct { - // The CRN for this certificate instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewCertificateInstanceIdentityByCRN : Instantiate CertificateInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewCertificateInstanceIdentityByCRN(crn string) (_model *CertificateInstanceIdentityByCRN, err error) { - _model = &CertificateInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CertificateInstanceIdentityByCRN) isaCertificateInstanceIdentity() bool { - return true -} - -// UnmarshalCertificateInstanceIdentityByCRN unmarshals an instance of CertificateInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalCertificateInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketIdentityByCRN : CloudObjectStorageBucketIdentityByCRN struct -// This model "extends" CloudObjectStorageBucketIdentity -type CloudObjectStorageBucketIdentityByCRN struct { - // The CRN of this Cloud Object Storage bucket. - CRN *string `json:"crn" validate:"required"` -} - -// NewCloudObjectStorageBucketIdentityByCRN : Instantiate CloudObjectStorageBucketIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewCloudObjectStorageBucketIdentityByCRN(crn string) (_model *CloudObjectStorageBucketIdentityByCRN, err error) { - _model = &CloudObjectStorageBucketIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CloudObjectStorageBucketIdentityByCRN) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalCloudObjectStorageBucketIdentityByCRN unmarshals an instance of CloudObjectStorageBucketIdentityByCRN from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct -// This model "extends" CloudObjectStorageBucketIdentity -type CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) -func (*VpcV1) NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { - _model = &CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -81260,30 +94157,30 @@ func UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityBy return } -// DnsInstanceIdentityByCRN : DnsInstanceIdentityByCRN struct -// This model "extends" DnsInstanceIdentity -type DnsInstanceIdentityByCRN struct { - // The CRN for this DNS instance. - CRN *string `json:"crn" validate:"required"` +// InstanceProfileIdentityByHref : InstanceProfileIdentityByHref struct +// This model "extends" InstanceProfileIdentity +type InstanceProfileIdentityByHref struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` } -// NewDnsInstanceIdentityByCRN : Instantiate DnsInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewDnsInstanceIdentityByCRN(crn string) (_model *DnsInstanceIdentityByCRN, err error) { - _model = &DnsInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), +// NewInstanceProfileIdentityByHref : Instantiate InstanceProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstanceProfileIdentityByHref(href string) (_model *InstanceProfileIdentityByHref, err error) { + _model = &InstanceProfileIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*DnsInstanceIdentityByCRN) isaDnsInstanceIdentity() bool { +func (*InstanceProfileIdentityByHref) isaInstanceProfileIdentity() bool { return true } -// UnmarshalDnsInstanceIdentityByCRN unmarshals an instance of DnsInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalDnsInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceProfileIdentityByHref unmarshals an instance of InstanceProfileIdentityByHref from the specified map of raw messages. +func UnmarshalInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -81291,29 +94188,30 @@ func UnmarshalDnsInstanceIdentityByCRN(m map[string]json.RawMessage, result inte return } -// DnsZoneIdentityByID : DnsZoneIdentityByID struct -// This model "extends" DnsZoneIdentity -type DnsZoneIdentityByID struct { - ID *string `json:"id" validate:"required"` +// InstanceProfileIdentityByName : InstanceProfileIdentityByName struct +// This model "extends" InstanceProfileIdentity +type InstanceProfileIdentityByName struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` } -// NewDnsZoneIdentityByID : Instantiate DnsZoneIdentityByID (Generic Model Constructor) -func (*VpcV1) NewDnsZoneIdentityByID(id string) (_model *DnsZoneIdentityByID, err error) { - _model = &DnsZoneIdentityByID{ - ID: core.StringPtr(id), +// NewInstanceProfileIdentityByName : Instantiate InstanceProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewInstanceProfileIdentityByName(name string) (_model *InstanceProfileIdentityByName, err error) { + _model = &InstanceProfileIdentityByName{ + Name: core.StringPtr(name), } err = core.ValidateStruct(_model, "required parameters") return } -func (*DnsZoneIdentityByID) isaDnsZoneIdentity() bool { +func (*InstanceProfileIdentityByName) isaInstanceProfileIdentity() bool { return true } -// UnmarshalDnsZoneIdentityByID unmarshals an instance of DnsZoneIdentityByID from the specified map of raw messages. -func UnmarshalDnsZoneIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceProfileIdentityByName unmarshals an instance of InstanceProfileIdentityByName from the specified map of raw messages. +func UnmarshalInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -81321,30 +94219,27 @@ func UnmarshalDnsZoneIdentityByID(m map[string]json.RawMessage, result interface return } -// DedicatedHostGroupIdentityByCRN : DedicatedHostGroupIdentityByCRN struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` +// InstanceProfileMemoryDependent : The memory value for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileMemory +type InstanceProfileMemoryDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// NewDedicatedHostGroupIdentityByCRN : Instantiate DedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByCRN(crn string) (_model *DedicatedHostGroupIdentityByCRN, err error) { - _model = &DedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the InstanceProfileMemoryDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryDependentTypeDependentConst = "dependent" +) -func (*DedicatedHostGroupIdentityByCRN) isaDedicatedHostGroupIdentity() bool { +func (*InstanceProfileMemoryDependent) isaInstanceProfileMemory() bool { return true } -// UnmarshalDedicatedHostGroupIdentityByCRN unmarshals an instance of DedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceProfileMemoryDependent unmarshals an instance of InstanceProfileMemoryDependent from the specified map of raw messages. +func UnmarshalInstanceProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemoryDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -81352,30 +94247,41 @@ func UnmarshalDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, resu return } -// DedicatedHostGroupIdentityByHref : DedicatedHostGroupIdentityByHref struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} +// InstanceProfileMemoryEnum : The permitted memory values (in gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileMemory +type InstanceProfileMemoryEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// NewDedicatedHostGroupIdentityByHref : Instantiate DedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByHref(href string) (_model *DedicatedHostGroupIdentityByHref, err error) { - _model = &DedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -func (*DedicatedHostGroupIdentityByHref) isaDedicatedHostGroupIdentity() bool { +// Constants associated with the InstanceProfileMemoryEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryEnumTypeEnumConst = "enum" +) + +func (*InstanceProfileMemoryEnum) isaInstanceProfileMemory() bool { return true } -// UnmarshalDedicatedHostGroupIdentityByHref unmarshals an instance of DedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalInstanceProfileMemoryEnum unmarshals an instance of InstanceProfileMemoryEnum from the specified map of raw messages. +func UnmarshalInstanceProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemoryEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -81383,30 +94289,34 @@ func UnmarshalDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, res return } -// DedicatedHostGroupIdentityByID : DedicatedHostGroupIdentityByID struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} +// InstanceProfileMemoryFixed : The memory (in gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileMemory +type InstanceProfileMemoryFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// NewDedicatedHostGroupIdentityByID : Instantiate DedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByID(id string) (_model *DedicatedHostGroupIdentityByID, err error) { - _model = &DedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -func (*DedicatedHostGroupIdentityByID) isaDedicatedHostGroupIdentity() bool { +// Constants associated with the InstanceProfileMemoryFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfileMemoryFixed) isaInstanceProfileMemory() bool { return true } -// UnmarshalDedicatedHostGroupIdentityByID unmarshals an instance of DedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceProfileMemoryFixed unmarshals an instance of InstanceProfileMemoryFixed from the specified map of raw messages. +func UnmarshalInstanceProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemoryFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -81414,30 +94324,55 @@ func UnmarshalDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, resul return } -// DedicatedHostProfileIdentityByHref : DedicatedHostProfileIdentityByHref struct -// This model "extends" DedicatedHostProfileIdentity -type DedicatedHostProfileIdentityByHref struct { - // The URL for this dedicated host profile. - Href *string `json:"href" validate:"required"` -} +// InstanceProfileMemoryRange : The permitted memory range (in gibibytes) for an instance with this profile. +// This model "extends" InstanceProfileMemory +type InstanceProfileMemoryRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` -// NewDedicatedHostProfileIdentityByHref : Instantiate DedicatedHostProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostProfileIdentityByHref(href string) (_model *DedicatedHostProfileIdentityByHref, err error) { - _model = &DedicatedHostProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -func (*DedicatedHostProfileIdentityByHref) isaDedicatedHostProfileIdentity() bool { +// Constants associated with the InstanceProfileMemoryRange.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryRangeTypeRangeConst = "range" +) + +func (*InstanceProfileMemoryRange) isaInstanceProfileMemory() bool { return true } -// UnmarshalDedicatedHostProfileIdentityByHref unmarshals an instance of DedicatedHostProfileIdentityByHref from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalInstanceProfileMemoryRange unmarshals an instance of InstanceProfileMemoryRange from the specified map of raw messages. +func UnmarshalInstanceProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemoryRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -81445,30 +94380,63 @@ func UnmarshalDedicatedHostProfileIdentityByHref(m map[string]json.RawMessage, r return } -// DedicatedHostProfileIdentityByName : DedicatedHostProfileIdentityByName struct -// This model "extends" DedicatedHostProfileIdentity -type DedicatedHostProfileIdentityByName struct { - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` +// InstanceProfileNumaCountDependent : The total number of NUMA nodes for an instance with this profile depends on its configuration and the capacity +// constraints within the zone. +// This model "extends" InstanceProfileNumaCount +type InstanceProfileNumaCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// NewDedicatedHostProfileIdentityByName : Instantiate DedicatedHostProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostProfileIdentityByName(name string) (_model *DedicatedHostProfileIdentityByName, err error) { - _model = &DedicatedHostProfileIdentityByName{ - Name: core.StringPtr(name), +// Constants associated with the InstanceProfileNumaCountDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountDependentTypeDependentConst = "dependent" +) + +func (*InstanceProfileNumaCountDependent) isaInstanceProfileNumaCount() bool { + return true +} + +// UnmarshalInstanceProfileNumaCountDependent unmarshals an instance of InstanceProfileNumaCountDependent from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*DedicatedHostProfileIdentityByName) isaDedicatedHostProfileIdentity() bool { +// InstanceProfileNumaCountFixed : The total number of NUMA nodes for an instance with this profile. +// This model "extends" InstanceProfileNumaCount +type InstanceProfileNumaCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileNumaCountFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileNumaCountFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfileNumaCountFixed) isaInstanceProfileNumaCount() bool { return true } -// UnmarshalDedicatedHostProfileIdentityByName unmarshals an instance of DedicatedHostProfileIdentityByName from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalInstanceProfileNumaCountFixed unmarshals an instance of InstanceProfileNumaCountFixed from the specified map of raw messages. +func UnmarshalInstanceProfileNumaCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNumaCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -81476,26 +94444,26 @@ func UnmarshalDedicatedHostProfileIdentityByName(m map[string]json.RawMessage, r return } -// DedicatedHostProfileMemoryDependent : The memory value for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryDependent struct { +// InstanceProfileNetworkAttachmentCountDependent : The number of network attachments supported on an instance with this profile is dependent on its configuration. +// This model "extends" InstanceProfileNetworkAttachmentCount +type InstanceProfileNetworkAttachmentCountDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileMemoryDependent.Type property. +// Constants associated with the InstanceProfileNetworkAttachmentCountDependent.Type property. // The type for this profile field. const ( - DedicatedHostProfileMemoryDependentTypeDependentConst = "dependent" + InstanceProfileNetworkAttachmentCountDependentTypeDependentConst = "dependent" ) -func (*DedicatedHostProfileMemoryDependent) isaDedicatedHostProfileMemory() bool { +func (*InstanceProfileNetworkAttachmentCountDependent) isaInstanceProfileNetworkAttachmentCount() bool { return true } -// UnmarshalDedicatedHostProfileMemoryDependent unmarshals an instance of DedicatedHostProfileMemoryDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryDependent) +// UnmarshalInstanceProfileNetworkAttachmentCountDependent unmarshals an instance of InstanceProfileNetworkAttachmentCountDependent from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkAttachmentCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkAttachmentCountDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -81504,41 +94472,41 @@ func UnmarshalDedicatedHostProfileMemoryDependent(m map[string]json.RawMessage, return } -// DedicatedHostProfileMemoryEnum : The permitted memory values (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstanceProfileNetworkAttachmentCountRange : The number of network attachments supported on an instance with this profile. +// This model "extends" InstanceProfileNetworkAttachmentCount +type InstanceProfileNetworkAttachmentCountRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` } -// Constants associated with the DedicatedHostProfileMemoryEnum.Type property. +// Constants associated with the InstanceProfileNetworkAttachmentCountRange.Type property. // The type for this profile field. const ( - DedicatedHostProfileMemoryEnumTypeEnumConst = "enum" + InstanceProfileNetworkAttachmentCountRangeTypeRangeConst = "range" ) -func (*DedicatedHostProfileMemoryEnum) isaDedicatedHostProfileMemory() bool { +func (*InstanceProfileNetworkAttachmentCountRange) isaInstanceProfileNetworkAttachmentCount() bool { return true } -// UnmarshalDedicatedHostProfileMemoryEnum unmarshals an instance of DedicatedHostProfileMemoryEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstanceProfileNetworkAttachmentCountRange unmarshals an instance of InstanceProfileNetworkAttachmentCountRange from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkAttachmentCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkAttachmentCountRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -81546,117 +94514,159 @@ func UnmarshalDedicatedHostProfileMemoryEnum(m map[string]json.RawMessage, resul return } -// DedicatedHostProfileMemoryFixed : The memory (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryFixed struct { +// InstanceProfileNetworkInterfaceCountDependent : The number of network interfaces supported on an instance with this profile is dependent on its configuration. +// This model "extends" InstanceProfileNetworkInterfaceCount +type InstanceProfileNetworkInterfaceCountDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` } -// Constants associated with the DedicatedHostProfileMemoryFixed.Type property. +// Constants associated with the InstanceProfileNetworkInterfaceCountDependent.Type property. // The type for this profile field. const ( - DedicatedHostProfileMemoryFixedTypeFixedConst = "fixed" + InstanceProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" ) -func (*DedicatedHostProfileMemoryFixed) isaDedicatedHostProfileMemory() bool { +func (*InstanceProfileNetworkInterfaceCountDependent) isaInstanceProfileNetworkInterfaceCount() bool { return true } -// UnmarshalDedicatedHostProfileMemoryFixed unmarshals an instance of DedicatedHostProfileMemoryFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryFixed) +// UnmarshalInstanceProfileNetworkInterfaceCountDependent unmarshals an instance of InstanceProfileNetworkInterfaceCountDependent from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkInterfaceCountDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// DedicatedHostProfileMemoryRange : The permitted memory range (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - +// InstanceProfileNetworkInterfaceCountRange : The number of network interfaces supported on an instance with this profile. +// This model "extends" InstanceProfileNetworkInterfaceCount +type InstanceProfileNetworkInterfaceCountRange struct { // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` + Max *int64 `json:"max,omitempty"` // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + Min *int64 `json:"min,omitempty"` // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileMemoryRange.Type property. +// Constants associated with the InstanceProfileNetworkInterfaceCountRange.Type property. // The type for this profile field. const ( - DedicatedHostProfileMemoryRangeTypeRangeConst = "range" + InstanceProfileNetworkInterfaceCountRangeTypeRangeConst = "range" ) -func (*DedicatedHostProfileMemoryRange) isaDedicatedHostProfileMemory() bool { +func (*InstanceProfileNetworkInterfaceCountRange) isaInstanceProfileNetworkInterfaceCount() bool { return true } -// UnmarshalDedicatedHostProfileMemoryRange unmarshals an instance of DedicatedHostProfileMemoryRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalInstanceProfileNetworkInterfaceCountRange unmarshals an instance of InstanceProfileNetworkInterfaceCountRange from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkInterfaceCountRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfilePortSpeedDependent : The port speed of each network interface of an instance with this profile depends on its configuration. +// This model "extends" InstanceProfilePortSpeed +type InstanceProfilePortSpeedDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the InstanceProfilePortSpeedDependent.Type property. +// The type for this profile field. +const ( + InstanceProfilePortSpeedDependentTypeDependentConst = "dependent" +) + +func (*InstanceProfilePortSpeedDependent) isaInstanceProfilePortSpeed() bool { + return true +} + +// UnmarshalInstanceProfilePortSpeedDependent unmarshals an instance of InstanceProfilePortSpeedDependent from the specified map of raw messages. +func UnmarshalInstanceProfilePortSpeedDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfilePortSpeedDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfilePortSpeedFixed : The maximum speed (in megabits per second) of each network interface of an instance with this profile. +// This model "extends" InstanceProfilePortSpeed +type InstanceProfilePortSpeedFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfilePortSpeedFixed.Type property. +// The type for this profile field. +const ( + InstanceProfilePortSpeedFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfilePortSpeedFixed) isaInstanceProfilePortSpeed() bool { + return true +} + +// UnmarshalInstanceProfilePortSpeedFixed unmarshals an instance of InstanceProfilePortSpeedFixed from the specified map of raw messages. +func UnmarshalInstanceProfilePortSpeedFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfilePortSpeedFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// DedicatedHostProfileSocketDependent : The CPU socket count for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketDependent struct { +// InstanceProfileVcpuDependent : The VCPU count for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileVcpu +type InstanceProfileVcpuDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileSocketDependent.Type property. +// Constants associated with the InstanceProfileVcpuDependent.Type property. // The type for this profile field. const ( - DedicatedHostProfileSocketDependentTypeDependentConst = "dependent" + InstanceProfileVcpuDependentTypeDependentConst = "dependent" ) -func (*DedicatedHostProfileSocketDependent) isaDedicatedHostProfileSocket() bool { +func (*InstanceProfileVcpuDependent) isaInstanceProfileVcpu() bool { return true } -// UnmarshalDedicatedHostProfileSocketDependent unmarshals an instance of DedicatedHostProfileSocketDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketDependent) +// UnmarshalInstanceProfileVcpuDependent unmarshals an instance of InstanceProfileVcpuDependent from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -81665,9 +94675,9 @@ func UnmarshalDedicatedHostProfileSocketDependent(m map[string]json.RawMessage, return } -// DedicatedHostProfileSocketEnum : The permitted values for CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketEnum struct { +// InstanceProfileVcpuEnum : The permitted values for VCPU count for an instance with this profile. +// This model "extends" InstanceProfileVcpu +type InstanceProfileVcpuEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -81678,19 +94688,19 @@ type DedicatedHostProfileSocketEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the DedicatedHostProfileSocketEnum.Type property. +// Constants associated with the InstanceProfileVcpuEnum.Type property. // The type for this profile field. const ( - DedicatedHostProfileSocketEnumTypeEnumConst = "enum" + InstanceProfileVcpuEnumTypeEnumConst = "enum" ) -func (*DedicatedHostProfileSocketEnum) isaDedicatedHostProfileSocket() bool { +func (*InstanceProfileVcpuEnum) isaInstanceProfileVcpu() bool { return true } -// UnmarshalDedicatedHostProfileSocketEnum unmarshals an instance of DedicatedHostProfileSocketEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketEnum) +// UnmarshalInstanceProfileVcpuEnum unmarshals an instance of InstanceProfileVcpuEnum from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -81707,9 +94717,9 @@ func UnmarshalDedicatedHostProfileSocketEnum(m map[string]json.RawMessage, resul return } -// DedicatedHostProfileSocketFixed : The CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketFixed struct { +// InstanceProfileVcpuFixed : The VCPU count for an instance with this profile. +// This model "extends" InstanceProfileVcpu +type InstanceProfileVcpuFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -81717,19 +94727,19 @@ type DedicatedHostProfileSocketFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the DedicatedHostProfileSocketFixed.Type property. +// Constants associated with the InstanceProfileVcpuFixed.Type property. // The type for this profile field. const ( - DedicatedHostProfileSocketFixedTypeFixedConst = "fixed" + InstanceProfileVcpuFixedTypeFixedConst = "fixed" ) -func (*DedicatedHostProfileSocketFixed) isaDedicatedHostProfileSocket() bool { +func (*InstanceProfileVcpuFixed) isaInstanceProfileVcpu() bool { return true } -// UnmarshalDedicatedHostProfileSocketFixed unmarshals an instance of DedicatedHostProfileSocketFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketFixed) +// UnmarshalInstanceProfileVcpuFixed unmarshals an instance of InstanceProfileVcpuFixed from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -81742,9 +94752,9 @@ func UnmarshalDedicatedHostProfileSocketFixed(m map[string]json.RawMessage, resu return } -// DedicatedHostProfileSocketRange : The permitted range for CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketRange struct { +// InstanceProfileVcpuRange : The permitted range for VCPU count for an instance with this profile. +// This model "extends" InstanceProfileVcpu +type InstanceProfileVcpuRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -81761,19 +94771,19 @@ type DedicatedHostProfileSocketRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileSocketRange.Type property. +// Constants associated with the InstanceProfileVcpuRange.Type property. // The type for this profile field. const ( - DedicatedHostProfileSocketRangeTypeRangeConst = "range" + InstanceProfileVcpuRangeTypeRangeConst = "range" ) -func (*DedicatedHostProfileSocketRange) isaDedicatedHostProfileSocket() bool { +func (*InstanceProfileVcpuRange) isaInstanceProfileVcpu() bool { return true } -// UnmarshalDedicatedHostProfileSocketRange unmarshals an instance of DedicatedHostProfileSocketRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketRange) +// UnmarshalInstanceProfileVcpuRange unmarshals an instance of InstanceProfileVcpuRange from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -81798,26 +94808,27 @@ func UnmarshalDedicatedHostProfileSocketRange(m map[string]json.RawMessage, resu return } -// DedicatedHostProfileVcpuDependent : The VCPU count for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuDependent struct { +// InstanceProfileVolumeBandwidthDependent : The storage bandwidth shared across the storage volumes of an instance with this profile depends on its +// configuration. +// This model "extends" InstanceProfileVolumeBandwidth +type InstanceProfileVolumeBandwidthDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileVcpuDependent.Type property. +// Constants associated with the InstanceProfileVolumeBandwidthDependent.Type property. // The type for this profile field. const ( - DedicatedHostProfileVcpuDependentTypeDependentConst = "dependent" + InstanceProfileVolumeBandwidthDependentTypeDependentConst = "dependent" ) -func (*DedicatedHostProfileVcpuDependent) isaDedicatedHostProfileVcpu() bool { +func (*InstanceProfileVolumeBandwidthDependent) isaInstanceProfileVolumeBandwidth() bool { return true } -// UnmarshalDedicatedHostProfileVcpuDependent unmarshals an instance of DedicatedHostProfileVcpuDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuDependent) +// UnmarshalInstanceProfileVolumeBandwidthDependent unmarshals an instance of InstanceProfileVolumeBandwidthDependent from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -81826,9 +94837,10 @@ func UnmarshalDedicatedHostProfileVcpuDependent(m map[string]json.RawMessage, re return } -// DedicatedHostProfileVcpuEnum : The permitted values for VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuEnum struct { +// InstanceProfileVolumeBandwidthEnum : The permitted storage bandwidth values (in megabits per second) shared across the storage volumes of an instance with +// this profile. +// This model "extends" InstanceProfileVolumeBandwidth +type InstanceProfileVolumeBandwidthEnum struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -81839,19 +94851,19 @@ type DedicatedHostProfileVcpuEnum struct { Values []int64 `json:"values" validate:"required"` } -// Constants associated with the DedicatedHostProfileVcpuEnum.Type property. +// Constants associated with the InstanceProfileVolumeBandwidthEnum.Type property. // The type for this profile field. const ( - DedicatedHostProfileVcpuEnumTypeEnumConst = "enum" + InstanceProfileVolumeBandwidthEnumTypeEnumConst = "enum" ) -func (*DedicatedHostProfileVcpuEnum) isaDedicatedHostProfileVcpu() bool { +func (*InstanceProfileVolumeBandwidthEnum) isaInstanceProfileVolumeBandwidth() bool { return true } -// UnmarshalDedicatedHostProfileVcpuEnum unmarshals an instance of DedicatedHostProfileVcpuEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuEnum) +// UnmarshalInstanceProfileVolumeBandwidthEnum unmarshals an instance of InstanceProfileVolumeBandwidthEnum from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthEnum) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -81868,9 +94880,9 @@ func UnmarshalDedicatedHostProfileVcpuEnum(m map[string]json.RawMessage, result return } -// DedicatedHostProfileVcpuFixed : The VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuFixed struct { +// InstanceProfileVolumeBandwidthFixed : The storage bandwidth (in megabits per second) shared across the storage volumes of an instance with this profile. +// This model "extends" InstanceProfileVolumeBandwidth +type InstanceProfileVolumeBandwidthFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -81878,19 +94890,19 @@ type DedicatedHostProfileVcpuFixed struct { Value *int64 `json:"value" validate:"required"` } -// Constants associated with the DedicatedHostProfileVcpuFixed.Type property. +// Constants associated with the InstanceProfileVolumeBandwidthFixed.Type property. // The type for this profile field. const ( - DedicatedHostProfileVcpuFixedTypeFixedConst = "fixed" + InstanceProfileVolumeBandwidthFixedTypeFixedConst = "fixed" ) -func (*DedicatedHostProfileVcpuFixed) isaDedicatedHostProfileVcpu() bool { +func (*InstanceProfileVolumeBandwidthFixed) isaInstanceProfileVolumeBandwidth() bool { return true } -// UnmarshalDedicatedHostProfileVcpuFixed unmarshals an instance of DedicatedHostProfileVcpuFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuFixed) +// UnmarshalInstanceProfileVolumeBandwidthFixed unmarshals an instance of InstanceProfileVolumeBandwidthFixed from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -81903,9 +94915,10 @@ func UnmarshalDedicatedHostProfileVcpuFixed(m map[string]json.RawMessage, result return } -// DedicatedHostProfileVcpuRange : The permitted range for VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuRange struct { +// InstanceProfileVolumeBandwidthRange : The permitted storage bandwidth range (in megabits per second) shared across the storage volumes of an instance with +// this profile. +// This model "extends" InstanceProfileVolumeBandwidth +type InstanceProfileVolumeBandwidthRange struct { // The default value for this profile field. Default *int64 `json:"default" validate:"required"` @@ -81922,19 +94935,19 @@ type DedicatedHostProfileVcpuRange struct { Type *string `json:"type" validate:"required"` } -// Constants associated with the DedicatedHostProfileVcpuRange.Type property. +// Constants associated with the InstanceProfileVolumeBandwidthRange.Type property. // The type for this profile field. const ( - DedicatedHostProfileVcpuRangeTypeRangeConst = "range" + InstanceProfileVolumeBandwidthRangeTypeRangeConst = "range" ) -func (*DedicatedHostProfileVcpuRange) isaDedicatedHostProfileVcpu() bool { +func (*InstanceProfileVolumeBandwidthRange) isaInstanceProfileVolumeBandwidth() bool { return true } -// UnmarshalDedicatedHostProfileVcpuRange unmarshals an instance of DedicatedHostProfileVcpuRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuRange) +// UnmarshalInstanceProfileVolumeBandwidthRange unmarshals an instance of InstanceProfileVolumeBandwidthRange from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthRange) err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return @@ -81959,43 +94972,134 @@ func UnmarshalDedicatedHostProfileVcpuRange(m map[string]json.RawMessage, result return } -// DedicatedHostPrototypeDedicatedHostByGroup : DedicatedHostPrototypeDedicatedHostByGroup struct -// This model "extends" DedicatedHostPrototype -type DedicatedHostPrototypeDedicatedHostByGroup struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// InstancePrototypeInstanceByCatalogOffering : Create an instance by using a catalog offering. +// Models which "extend" this model: +// - InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment +// - InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface +// This model "extends" InstancePrototype +type InstancePrototypeInstanceByCatalogOffering struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The dedicated host group for this dedicated host. - Group DedicatedHostGroupIdentityIntf `json:"group" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// NewDedicatedHostPrototypeDedicatedHostByGroup : Instantiate DedicatedHostPrototypeDedicatedHostByGroup (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByGroup(profile DedicatedHostProfileIdentityIntf, group DedicatedHostGroupIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByGroup, err error) { - _model = &DedicatedHostPrototypeDedicatedHostByGroup{ - Profile: profile, - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototypeInstanceByCatalogOffering() bool { + return true } -func (*DedicatedHostPrototypeDedicatedHostByGroup) isaDedicatedHostPrototype() bool { +type InstancePrototypeInstanceByCatalogOfferingIntf interface { + InstancePrototypeIntf + isaInstancePrototypeInstanceByCatalogOffering() bool +} + +func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototype() bool { return true } -// UnmarshalDedicatedHostPrototypeDedicatedHostByGroup unmarshals an instance of DedicatedHostPrototypeDedicatedHostByGroup from the specified map of raw messages. -func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototypeDedicatedHostByGroup) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) +// UnmarshalInstancePrototypeInstanceByCatalogOffering unmarshals an instance of InstancePrototypeInstanceByCatalogOffering from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByCatalogOffering) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -82003,7 +95107,15 @@ func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMe if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -82011,7 +95123,47 @@ func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMe if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -82019,45 +95171,316 @@ func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMe return } -// DedicatedHostPrototypeDedicatedHostByZone : DedicatedHostPrototypeDedicatedHostByZone struct -// This model "extends" DedicatedHostPrototype -type DedicatedHostPrototypeDedicatedHostByZone struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// InstancePrototypeInstanceByImage : Create an instance by using an image. +// Models which "extend" this model: +// - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment +// - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface +// This model "extends" InstancePrototype +type InstancePrototypeInstanceByImage struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - Group *DedicatedHostGroupPrototypeDedicatedHostByZoneContext `json:"group,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The zone this dedicated host will reside in. + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` + + // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// NewDedicatedHostPrototypeDedicatedHostByZone : Instantiate DedicatedHostPrototypeDedicatedHostByZone (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByZone(profile DedicatedHostProfileIdentityIntf, zone ZoneIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByZone, err error) { - _model = &DedicatedHostPrototypeDedicatedHostByZone{ - Profile: profile, - Zone: zone, +func (*InstancePrototypeInstanceByImage) isaInstancePrototypeInstanceByImage() bool { + return true +} + +type InstancePrototypeInstanceByImageIntf interface { + InstancePrototypeIntf + isaInstancePrototypeInstanceByImage() bool +} + +func (*InstancePrototypeInstanceByImage) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByImage unmarshals an instance of InstancePrototypeInstanceByImage from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByImage) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*DedicatedHostPrototypeDedicatedHostByZone) isaDedicatedHostPrototype() bool { +// InstancePrototypeInstanceBySourceSnapshot : Create an instance by using a snapshot. +// Models which "extend" this model: +// - InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment +// - InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface +// This model "extends" InstancePrototype +type InstancePrototypeInstanceBySourceSnapshot struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` +} + +func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototypeInstanceBySourceSnapshot() bool { + return true +} + +type InstancePrototypeInstanceBySourceSnapshotIntf interface { + InstancePrototypeIntf + isaInstancePrototypeInstanceBySourceSnapshot() bool +} + +func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototype() bool { return true } -// UnmarshalDedicatedHostPrototypeDedicatedHostByZone unmarshals an instance of DedicatedHostPrototypeDedicatedHostByZone from the specified map of raw messages. -func UnmarshalDedicatedHostPrototypeDedicatedHostByZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototypeDedicatedHostByZone) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) +// UnmarshalInstancePrototypeInstanceBySourceSnapshot unmarshals an instance of InstancePrototypeInstanceBySourceSnapshot from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceBySourceSnapshot) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -82065,150 +95488,59 @@ func UnmarshalDedicatedHostPrototypeDedicatedHostByZone(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EncryptionKeyIdentityByCRN : EncryptionKeyIdentityByCRN struct -// This model "extends" EncryptionKeyIdentity -type EncryptionKeyIdentityByCRN struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn" validate:"required"` -} - -// NewEncryptionKeyIdentityByCRN : Instantiate EncryptionKeyIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewEncryptionKeyIdentityByCRN(crn string) (_model *EncryptionKeyIdentityByCRN, err error) { - _model = &EncryptionKeyIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EncryptionKeyIdentityByCRN) isaEncryptionKeyIdentity() bool { - return true -} - -// UnmarshalEncryptionKeyIdentityByCRN unmarshals an instance of EncryptionKeyIdentityByCRN from the specified map of raw messages. -func UnmarshalEncryptionKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPIdentity : Identifies a reserved IP by a unique property. -// Models which "extend" this model: -// - EndpointGatewayReservedIPReservedIPIdentityByID -// - EndpointGatewayReservedIPReservedIPIdentityByHref -// This model "extends" EndpointGatewayReservedIP -type EndpointGatewayReservedIPReservedIPIdentity struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} - -type EndpointGatewayReservedIPReservedIPIdentityIntf interface { - EndpointGatewayReservedIPIntf - isaEndpointGatewayReservedIPReservedIPIdentity() bool -} - -func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPIdentity unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPPrototypeTargetContext : EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct -// This model "extends" EndpointGatewayReservedIP -type EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The subnet in which to create this reserved IP. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -} - -// NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext : Instantiate EndpointGatewayReservedIPReservedIPPrototypeTargetContext (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext(subnet SubnetIdentityIntf) (_model *EndpointGatewayReservedIPReservedIPPrototypeTargetContext, err error) { - _model = &EndpointGatewayReservedIPReservedIPPrototypeTargetContext{ - Subnet: subnet, + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayReservedIPReservedIPPrototypeTargetContext) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext unmarshals an instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPPrototypeTargetContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -82216,208 +95548,160 @@ func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[st return } -// EndpointGatewayTargetPrototypeProviderCloudServiceIdentity : EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN -// This model "extends" EndpointGatewayTargetPrototype -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` +// InstancePrototypeInstanceBySourceTemplate : Create an instance by using an instance template. +// +// The `primary_network_attachment` and `network_attachments` properties may only be specified if +// `primary_network_attachment` is specified in the source template. +// +// The `primary_network_interface` and `network_interfaces` properties may only be specified if +// `primary_network_interface` is specified in the source template. +// This model "extends" InstancePrototype +type InstancePrototypeInstanceBySourceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { - return true -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityIntf interface { - EndpointGatewayTargetPrototypeIntf - isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool -} + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototype() bool { - return true -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity : EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName -// This model "extends" EndpointGatewayTargetPrototype -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` -} + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { - return true + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering version to use when provisioning this virtual server instance. + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account, subject to + // IAM policies. + // + // If specified, `image` must not be specified, and `source_template` must not have + // `image` specified. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityIntf interface { - EndpointGatewayTargetPrototypeIntf - isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool +// NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { + _model = &InstancePrototypeInstanceBySourceTemplate{ + SourceTemplate: sourceTemplate, + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototype() bool { +func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { return true } -// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalInstancePrototypeInstanceBySourceTemplate unmarshals an instance of InstancePrototypeInstanceBySourceTemplate from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceBySourceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetProviderCloudServiceReference : EndpointGatewayTargetProviderCloudServiceReference struct -// This model "extends" EndpointGatewayTarget -type EndpointGatewayTargetProviderCloudServiceReference struct { - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn" validate:"required"` - - // The type of target. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetProviderCloudServiceReference.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetProviderCloudServiceReferenceResourceTypeProviderCloudServiceConst = "provider_cloud_service" -) - -func (*EndpointGatewayTargetProviderCloudServiceReference) isaEndpointGatewayTarget() bool { - return true -} - -// UnmarshalEndpointGatewayTargetProviderCloudServiceReference unmarshals an instance of EndpointGatewayTargetProviderCloudServiceReference from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetProviderCloudServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetProviderCloudServiceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetProviderInfrastructureServiceReference : The name of this provider infrastructure service. -// This model "extends" EndpointGatewayTarget -type EndpointGatewayTargetProviderInfrastructureServiceReference struct { - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name" validate:"required"` - - // The type of target. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetProviderInfrastructureServiceReference.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetProviderInfrastructureServiceReferenceResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -func (*EndpointGatewayTargetProviderInfrastructureServiceReference) isaEndpointGatewayTarget() bool { - return true -} - -// UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference unmarshals an instance of EndpointGatewayTargetProviderInfrastructureServiceReference from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetProviderInfrastructureServiceReference) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPPrototypeFloatingIPByTarget : FloatingIPPrototypeFloatingIPByTarget struct -// This model "extends" FloatingIPPrototype -type FloatingIPPrototypeFloatingIPByTarget struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The target resource to bind this floating IP to. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true`. - Target FloatingIPTargetPrototypeIntf `json:"target" validate:"required"` -} - -// NewFloatingIPPrototypeFloatingIPByTarget : Instantiate FloatingIPPrototypeFloatingIPByTarget (Generic Model Constructor) -func (*VpcV1) NewFloatingIPPrototypeFloatingIPByTarget(target FloatingIPTargetPrototypeIntf) (_model *FloatingIPPrototypeFloatingIPByTarget, err error) { - _model = &FloatingIPPrototypeFloatingIPByTarget{ - Target: target, + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPPrototypeFloatingIPByTarget) isaFloatingIPPrototype() bool { - return true -} - -// UnmarshalFloatingIPPrototypeFloatingIPByTarget unmarshals an instance of FloatingIPPrototypeFloatingIPByTarget from the specified map of raw messages. -func UnmarshalFloatingIPPrototypeFloatingIPByTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototypeFloatingIPByTarget) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -82425,175 +95709,55 @@ func UnmarshalFloatingIPPrototypeFloatingIPByTarget(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPPrototypeFloatingIPByZone : FloatingIPPrototypeFloatingIPByZone struct -// This model "extends" FloatingIPPrototype -type FloatingIPPrototypeFloatingIPByZone struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The zone this floating IP will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewFloatingIPPrototypeFloatingIPByZone : Instantiate FloatingIPPrototypeFloatingIPByZone (Generic Model Constructor) -func (*VpcV1) NewFloatingIPPrototypeFloatingIPByZone(zone ZoneIdentityIntf) (_model *FloatingIPPrototypeFloatingIPByZone, err error) { - _model = &FloatingIPPrototypeFloatingIPByZone{ - Zone: zone, + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPPrototypeFloatingIPByZone) isaFloatingIPPrototype() bool { - return true -} - -// UnmarshalFloatingIPPrototypeFloatingIPByZone unmarshals an instance of FloatingIPPrototypeFloatingIPByZone from the specified map of raw messages. -func UnmarshalFloatingIPPrototypeFloatingIPByZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototypeFloatingIPByZone) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPatch -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPatchIntf - isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPatch -type FloatingIPTargetPatchNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPatchNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPatchIntf - isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPrototype -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPrototypeIntf - isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -82601,91 +95765,124 @@ func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(m return } -// FloatingIPTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. +// InstancePrototypeInstanceByVolume : Create an instance by using a boot volume. // Models which "extend" this model: -// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPrototype -type FloatingIPTargetPrototypeNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` +// - InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment +// - InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface +// This model "extends" InstancePrototype +type InstancePrototypeInstanceByVolume struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -type FloatingIPTargetPrototypeNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPrototypeIntf - isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { - return true -} + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// FloatingIPTargetBareMetalServerNetworkInterfaceReference : FloatingIPTargetBareMetalServerNetworkInterfaceReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetBareMetalServerNetworkInterfaceReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// Constants associated with the FloatingIPTargetBareMetalServerNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetBareMetalServerNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) +func (*InstancePrototypeInstanceByVolume) isaInstancePrototypeInstanceByVolume() bool { + return true +} -func (*FloatingIPTargetBareMetalServerNetworkInterfaceReference) isaFloatingIPTarget() bool { +type InstancePrototypeInstanceByVolumeIntf interface { + InstancePrototypeIntf + isaInstancePrototypeInstanceByVolume() bool +} + +func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { return true } -// UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference unmarshals an instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetBareMetalServerNetworkInterfaceReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted) +// UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByVolume) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -82693,138 +95890,59 @@ func UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference(m map[str if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetNetworkInterfaceReference : FloatingIPTargetNetworkInterfaceReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetNetworkInterfaceReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FloatingIPTargetNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FloatingIPTargetNetworkInterfaceReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetNetworkInterfaceReference unmarshals an instance of FloatingIPTargetNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetNetworkInterfaceReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPublicGatewayReference : FloatingIPTargetPublicGatewayReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetPublicGatewayReference struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` - - // The name for this public gateway. The name is unique across all public gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FloatingIPTargetPublicGatewayReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetPublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" -) - -func (*FloatingIPTargetPublicGatewayReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetPublicGatewayReference unmarshals an instance of FloatingIPTargetPublicGatewayReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPublicGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -82832,295 +95950,289 @@ func UnmarshalFloatingIPTargetPublicGatewayReference(m map[string]json.RawMessag return } -// FlowLogCollectorTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeInstanceIdentity struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true +// InstanceTemplateIdentityByCRN : InstanceTemplateIdentityByCRN struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByCRN struct { + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` } -type FlowLogCollectorTargetPrototypeInstanceIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool +// NewInstanceTemplateIdentityByCRN : Instantiate InstanceTemplateIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByCRN(crn string) (_model *InstanceTemplateIdentityByCRN, err error) { + _model = &InstanceTemplateIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototype() bool { +func (*InstanceTemplateIdentityByCRN) isaInstanceTemplateIdentity() bool { return true } -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } +// UnmarshalInstanceTemplateIdentityByCRN unmarshals an instance of InstanceTemplateIdentityByCRN from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - ID *string `json:"id,omitempty"` +// InstanceTemplateIdentityByHref : InstanceTemplateIdentityByHref struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByHref struct { + // The URL for this instance template. + Href *string `json:"href" validate:"required"` +} - // The URL for this instance network interface. - Href *string `json:"href,omitempty"` +// NewInstanceTemplateIdentityByHref : Instantiate InstanceTemplateIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByHref(href string) (_model *InstanceTemplateIdentityByHref, err error) { + _model = &InstanceTemplateIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { +func (*InstanceTemplateIdentityByHref) isaInstanceTemplateIdentity() bool { return true } -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool +// UnmarshalInstanceTemplateIdentityByHref unmarshals an instance of InstanceTemplateIdentityByHref from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototype() bool { +// InstanceTemplateIdentityByID : InstanceTemplateIdentityByID struct +// This model "extends" InstanceTemplateIdentity +type InstanceTemplateIdentityByID struct { + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` +} + +// NewInstanceTemplateIdentityByID : Instantiate InstanceTemplateIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplateIdentityByID(id string) (_model *InstanceTemplateIdentityByID, err error) { + _model = &InstanceTemplateIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceTemplateIdentityByID) isaInstanceTemplateIdentity() bool { return true } -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) +// UnmarshalInstanceTemplateIdentityByID unmarshals an instance of InstanceTemplateIdentityByID from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// FlowLogCollectorTargetPrototypeSubnetIdentity : Identifies a subnet by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeSubnetIdentity struct { - // The unique identifier for this subnet. - ID *string `json:"id,omitempty"` +// InstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Create an instance template that creates instances by using a catalog offering. +// Models which "extend" this model: +// - InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment +// - InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface +// This model "extends" InstanceTemplatePrototype +type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The CRN for this subnet. - CRN *string `json:"crn,omitempty"` + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - // The URL for this subnet. - Href *string `json:"href,omitempty"` + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { return true } -type FlowLogCollectorTargetPrototypeSubnetIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool +type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingIntf interface { + InstanceTemplatePrototypeIntf + isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool } -func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentity : Identifies a VPC by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeVPCIdentity struct { - // The unique identifier for this VPC. - ID *string `json:"id,omitempty"` - - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeVPCIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeVPCIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetInstanceReference : FlowLogCollectorTargetInstanceReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetInstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -func (*FlowLogCollectorTargetInstanceReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetInstanceReference unmarshals an instance of FlowLogCollectorTargetInstanceReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext : FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -83128,55 +96240,125 @@ func UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(m map return } -// FlowLogCollectorTargetSubnetReference : FlowLogCollectorTargetSubnetReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetSubnetReference struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` +// InstanceTemplatePrototypeInstanceTemplateByImage : Create an instance template that creates instances by using an image. +// Models which "extend" this model: +// - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment +// - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface +// This model "extends" InstanceTemplatePrototype +type InstanceTemplatePrototypeInstanceTemplateByImage struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The URL for this subnet. - Href *string `json:"href" validate:"required"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The name for this subnet. The name is unique across all subnets in the VPC. - Name *string `json:"name" validate:"required"` + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// Constants associated with the FlowLogCollectorTargetSubnetReference.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetSubnetReferenceResourceTypeSubnetConst = "subnet" -) +func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { + return true +} -func (*FlowLogCollectorTargetSubnetReference) isaFlowLogCollectorTarget() bool { +type InstanceTemplatePrototypeInstanceTemplateByImageIntf interface { + InstanceTemplatePrototypeIntf + isaInstanceTemplatePrototypeInstanceTemplateByImage() bool +} + +func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalFlowLogCollectorTargetSubnetReference unmarshals an instance of FlowLogCollectorTargetSubnetReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetSubnetReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -83184,164 +96366,63 @@ func UnmarshalFlowLogCollectorTargetSubnetReference(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetVPCReference : FlowLogCollectorTargetVPCReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetVPCReference struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetVPCReference.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetVPCReferenceResourceTypeVPCConst = "vpc" -) - -func (*FlowLogCollectorTargetVPCReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetVPCReference unmarshals an instance of FlowLogCollectorTargetVPCReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetVPCReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByCRN : ImageIdentityByCRN struct -// This model "extends" ImageIdentity -type ImageIdentityByCRN struct { - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` -} - -// NewImageIdentityByCRN : Instantiate ImageIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByCRN(crn string) (_model *ImageIdentityByCRN, err error) { - _model = &ImageIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByCRN) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByCRN unmarshals an instance of ImageIdentityByCRN from the specified map of raw messages. -func UnmarshalImageIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByHref : ImageIdentityByHref struct -// This model "extends" ImageIdentity -type ImageIdentityByHref struct { - // The URL for this image. - Href *string `json:"href" validate:"required"` -} - -// NewImageIdentityByHref : Instantiate ImageIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByHref(href string) (_model *ImageIdentityByHref, err error) { - _model = &ImageIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByHref) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByHref unmarshals an instance of ImageIdentityByHref from the specified map of raw messages. -func UnmarshalImageIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByID : ImageIdentityByID struct -// This model "extends" ImageIdentity -type ImageIdentityByID struct { - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` -} - -// NewImageIdentityByID : Instantiate ImageIdentityByID (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByID(id string) (_model *ImageIdentityByID, err error) { - _model = &ImageIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByID) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByID unmarshals an instance of ImageIdentityByID from the specified map of raw messages. -func UnmarshalImageIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -83349,83 +96430,122 @@ func UnmarshalImageIdentityByID(m map[string]json.RawMessage, result interface{} return } -// ImagePrototypeImageByFile : ImagePrototypeImageByFile struct -// This model "extends" ImagePrototype -type ImagePrototypeImageByFile struct { - // The deprecation date and time to set for this image. +// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Create an instance template that creates instances by using a snapshot. +// Models which "extend" this model: +// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment +// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface +// This model "extends" InstanceTemplatePrototype +type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. // - // If unspecified, no deprecation date and time will be set. + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). + // The placement restrictions to use for the virtual server instance. // - // If unspecified, no obsolescence date and time will be set. + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. - // - // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be - // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the - // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The root key that was used to wrap the data key (which is ultimately represented as - // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes - // created from this image (unless an alternate `encryption_key` is specified at volume - // creation). + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. // - // If unspecified, the imported image is treated as unencrypted. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The file from which to create the image. - File *ImageFilePrototype `json:"file" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The [supported operating - // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this - // image. - OperatingSystem OperatingSystemIdentityIntf `json:"operating_system" validate:"required"` + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// NewImagePrototypeImageByFile : Instantiate ImagePrototypeImageByFile (Generic Model Constructor) -func (*VpcV1) NewImagePrototypeImageByFile(file *ImageFilePrototype, operatingSystem OperatingSystemIdentityIntf) (_model *ImagePrototypeImageByFile, err error) { - _model = &ImagePrototypeImageByFile{ - File: file, - OperatingSystem: operatingSystem, - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { + return true } -func (*ImagePrototypeImageByFile) isaImagePrototype() bool { +type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotIntf interface { + InstanceTemplatePrototypeIntf + isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool +} + +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalImagePrototypeImageByFile unmarshals an instance of ImagePrototypeImageByFile from the specified map of raw messages. -func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototypeImageByFile) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -83433,7 +96553,15 @@ func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -83441,19 +96569,43 @@ func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -83461,70 +96613,136 @@ func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result int return } -// ImagePrototypeImageBySourceVolume : ImagePrototypeImageBySourceVolume struct -// This model "extends" ImagePrototype -type ImagePrototypeImageBySourceVolume struct { - // The deprecation date and time to set for this image. +// InstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Create an instance template from an existing instance template. +// This model "extends" InstanceTemplatePrototype +type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. // - // If unspecified, no deprecation date and time will be set. + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). + // The placement restrictions to use for the virtual server instance. // - // If unspecified, no obsolescence date and time will be set. + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The root key used to wrap the system-generated data encryption key for the image. + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. // - // If unspecified, the root key from `source_volume` will be used. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The volume from which to create the image. The specified volume must: - // - Have an `operating_system`, which will be used to populate this image's - // operating system information. - // - Not be `active` or `busy`. + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + // offering version to use when provisioning this virtual server instance. + // If an offering is specified, the latest version of that offering will be used. // - // During image creation, the specified volume may briefly become `busy`. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` + // The specified offering or offering version may be in a different account, subject to + // IAM policies. + // + // If specified, `image` must not be specified, and `source_template` must not have + // `image` specified. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } -// NewImagePrototypeImageBySourceVolume : Instantiate ImagePrototypeImageBySourceVolume (Generic Model Constructor) -func (*VpcV1) NewImagePrototypeImageBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *ImagePrototypeImageBySourceVolume, err error) { - _model = &ImagePrototypeImageBySourceVolume{ - SourceVolume: sourceVolume, +// NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceTemplate (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceTemplate, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateBySourceTemplate{ + SourceTemplate: sourceTemplate, } err = core.ValidateStruct(_model, "required parameters") return } -func (*ImagePrototypeImageBySourceVolume) isaImagePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalImagePrototypeImageBySourceVolume unmarshals an instance of ImagePrototypeImageBySourceVolume from the specified map of raw messages. -func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototypeImageBySourceVolume) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -83532,7 +96750,15 @@ func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -83540,138 +96766,55 @@ func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOfferingPrototypeCatalogOfferingByOffering : InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct -// This model "extends" InstanceCatalogOfferingPrototype -type InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct { - // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering by a unique property. - Offering CatalogOfferingIdentityIntf `json:"offering" validate:"required"` -} - -// NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByOffering (Generic Model Constructor) -func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(offering CatalogOfferingIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByOffering, err error) { - _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByOffering{ - Offering: offering, + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) isaInstanceCatalogOfferingPrototype() bool { - return true -} - -// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) - err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOfferingPrototypeCatalogOfferingByVersion : InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct -// This model "extends" InstanceCatalogOfferingPrototype -type InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct { - // Identifies a version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a - // unique property. - Version CatalogOfferingVersionIdentityIntf `json:"version" validate:"required"` -} - -// NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByVersion (Generic Model Constructor) -func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(version CatalogOfferingVersionIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByVersion, err error) { - _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByVersion{ - Version: version, + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) isaInstanceCatalogOfferingPrototype() bool { - return true -} - -// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototype : InstanceGroupManagerActionPrototypeScheduledActionPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -// This model "extends" InstanceGroupManagerActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf interface { - InstanceGroupManagerActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -83679,120 +96822,144 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[ return } -// InstanceGroupManagerActionScheduledAction : InstanceGroupManagerActionScheduledAction struct +// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext : Create an instance by using a catalog offering. // Models which "extend" this model: -// - InstanceGroupManagerActionScheduledActionGroupTarget -// - InstanceGroupManagerActionScheduledActionManagerTarget -// This model "extends" InstanceGroupManagerAction -type InstanceGroupManagerActionScheduledAction struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` +// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment +// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface +// This model "extends" InstanceTemplate +type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The date and time that the instance group manager action was created. + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this instance group manager action. + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance group manager action. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. Name *string `json:"name" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + // or offering version to use when provisioning this virtual server instance. + // + // If an offering is specified, the latest version of that offering will be used. + // + // The specified offering or offering version may be in a different account in the same + // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject + // to IAM policies. + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// Constants associated with the InstanceGroupManagerActionScheduledAction.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// Constants associated with the InstanceGroupManagerActionScheduledAction.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionStatusOmittedConst = "omitted" -) - -// Constants associated with the InstanceGroupManagerActionScheduledAction.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionActionTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerActionScheduledAction() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } -type InstanceGroupManagerActionScheduledActionIntf interface { - InstanceGroupManagerActionIntf - isaInstanceGroupManagerActionScheduledAction() bool +type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIntf interface { + InstanceTemplateIntf + isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool } -func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerAction() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerActionScheduledAction unmarshals an instance of InstanceGroupManagerActionScheduledAction from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledAction) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) +// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } @@ -83804,43 +96971,75 @@ func UnmarshalInstanceGroupManagerActionScheduledAction(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -83848,63 +97047,140 @@ func UnmarshalInstanceGroupManagerActionScheduledAction(m map[string]json.RawMes return } -// InstanceGroupManagerAutoScale : InstanceGroupManagerAutoScale struct -// This model "extends" InstanceGroupManager -type InstanceGroupManagerAutoScale struct { - // The date and time that the instance group manager was created. +// InstanceTemplateInstanceByImageInstanceTemplateContext : Create an instance by using an image. +// Models which "extend" this model: +// - InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment +// - InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface +// This model "extends" InstanceTemplate +type InstanceTemplateInstanceByImageInstanceTemplateContext struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this instance group manager. + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance group manager. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The name for this instance group manager. The name is unique across all managers for the instance group. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. Name *string `json:"name" validate:"required"` - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The policies of the instance group manager. - Policies []InstanceGroupManagerPolicyReference `json:"policies" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// Constants associated with the InstanceGroupManagerAutoScale.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerAutoScaleManagerTypeAutoscaleConst = "autoscale" -) +func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { + return true +} -func (*InstanceGroupManagerAutoScale) isaInstanceGroupManager() bool { +type InstanceTemplateInstanceByImageInstanceTemplateContextIntf interface { + InstanceTemplateIntf + isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool +} + +func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerAutoScale unmarshals an instance of InstanceGroupManagerAutoScale from the specified map of raw messages. -func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerAutoScale) +// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContext from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByImageInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -83913,7 +97189,11 @@ func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result if err != nil { return } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -83921,101 +97201,63 @@ func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result if err != nil { return } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct -// This model "extends" InstanceGroupManagerPolicyPrototype -type InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct { - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type" validate:"required"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value" validate:"required"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypePolicyTypeTargetConst = "target" -) - -// NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : Instantiate InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(metricType string, metricValue int64, policyType string) (_model *InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype, err error) { - _model = &InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype{ - MetricType: core.StringPtr(metricType), - MetricValue: core.Int64Ptr(metricValue), - PolicyType: core.StringPtr(policyType), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -84023,86 +97265,210 @@ func UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolic return } -// InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy : InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct -// This model "extends" InstanceGroupManagerPolicy -type InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct { - // The date and time that the instance group manager policy was created. +// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext : Create an instance by using a snapshot. +// Models which "extend" this model: +// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment +// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface +// This model "extends" InstanceTemplate +type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this instance group manager policy. + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance group manager policy. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. Name *string `json:"name" validate:"required"` - // The date and time that the instance group manager policy was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The type of metric to be evaluated. - MetricType *string `json:"metric_type" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The type of policy for the instance group. - PolicyType *string `json:"policy_type" validate:"required"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } -// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkOutConst = "network_out" -) +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { + return true +} -// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyPolicyTypeTargetConst = "target" -) +type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIntf interface { + InstanceTemplateIntf + isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool +} -func (*InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) isaInstanceGroupManagerPolicy() bool { +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy unmarshals an instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) +// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -84110,80 +97476,124 @@ func UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(m map[s return } -// InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct -// This model "extends" InstanceGroupManagerPrototype -type InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// KeyIdentityByCRN : KeyIdentityByCRN struct +// This model "extends" KeyIdentity +type KeyIdentityByCRN struct { + // The CRN for this key. + CRN *string `json:"crn" validate:"required"` } -// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototypeManagerTypeAutoscaleConst = "autoscale" -) - -// NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(managerType string, maxMembershipCount int64) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype, err error) { - _model = &InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype{ - ManagerType: core.StringPtr(managerType), - MaxMembershipCount: core.Int64Ptr(maxMembershipCount), +// NewKeyIdentityByCRN : Instantiate KeyIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewKeyIdentityByCRN(crn string) (_model *KeyIdentityByCRN, err error) { + _model = &KeyIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) isaInstanceGroupManagerPrototype() bool { +func (*KeyIdentityByCRN) isaKeyIdentity() bool { return true } -// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) +// UnmarshalKeyIdentityByCRN unmarshals an instance of KeyIdentityByCRN from the specified map of raw messages. +func UnmarshalKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyIdentityByFingerprint : KeyIdentityByFingerprint struct +// This model "extends" KeyIdentity +type KeyIdentityByFingerprint struct { + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint" validate:"required"` +} + +// NewKeyIdentityByFingerprint : Instantiate KeyIdentityByFingerprint (Generic Model Constructor) +func (*VpcV1) NewKeyIdentityByFingerprint(fingerprint string) (_model *KeyIdentityByFingerprint, err error) { + _model = &KeyIdentityByFingerprint{ + Fingerprint: core.StringPtr(fingerprint), } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*KeyIdentityByFingerprint) isaKeyIdentity() bool { + return true +} + +// UnmarshalKeyIdentityByFingerprint unmarshals an instance of KeyIdentityByFingerprint from the specified map of raw messages. +func UnmarshalKeyIdentityByFingerprint(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentityByFingerprint) + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyIdentityByHref : KeyIdentityByHref struct +// This model "extends" KeyIdentity +type KeyIdentityByHref struct { + // The URL for this key. + Href *string `json:"href" validate:"required"` +} + +// NewKeyIdentityByHref : Instantiate KeyIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewKeyIdentityByHref(href string) (_model *KeyIdentityByHref, err error) { + _model = &KeyIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*KeyIdentityByHref) isaKeyIdentity() bool { + return true +} + +// UnmarshalKeyIdentityByHref unmarshals an instance of KeyIdentityByHref from the specified map of raw messages. +func UnmarshalKeyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// KeyIdentityByID : KeyIdentityByID struct +// This model "extends" KeyIdentity +type KeyIdentityByID struct { + // The unique identifier for this key. + ID *string `json:"id" validate:"required"` +} + +// NewKeyIdentityByID : Instantiate KeyIdentityByID (Generic Model Constructor) +func (*VpcV1) NewKeyIdentityByID(id string) (_model *KeyIdentityByID, err error) { + _model = &KeyIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*KeyIdentityByID) isaKeyIdentity() bool { + return true +} + +// UnmarshalKeyIdentityByID unmarshals an instance of KeyIdentityByID from the specified map of raw messages. +func UnmarshalKeyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -84191,128 +97601,185 @@ func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototyp return } -// InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct -// This model "extends" InstanceGroupManagerPrototype -type InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` +// LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct +// This model "extends" LegacyCloudObjectStorageBucketIdentity +type LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` } -// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototypeManagerTypeScheduledConst = "scheduled" -) - -// NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(managerType string) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype, err error) { - _model = &InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype{ - ManagerType: core.StringPtr(managerType), +// NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) +func (*VpcV1) NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { + _model = &LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ + Name: core.StringPtr(name), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) isaInstanceGroupManagerPrototype() bool { +func (*LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaLegacyCloudObjectStorageBucketIdentity() bool { return true } -// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } +// UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceGroupManagerScheduled : InstanceGroupManagerScheduled struct -// This model "extends" InstanceGroupManager -type InstanceGroupManagerScheduled struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` +// LoadBalancerIdentityByCRN : LoadBalancerIdentityByCRN struct +// This model "extends" LoadBalancerIdentity +type LoadBalancerIdentityByCRN struct { + // The load balancer's CRN. + CRN *string `json:"crn" validate:"required"` +} - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` +// NewLoadBalancerIdentityByCRN : Instantiate LoadBalancerIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerIdentityByCRN(crn string) (_model *LoadBalancerIdentityByCRN, err error) { + _model = &LoadBalancerIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +func (*LoadBalancerIdentityByCRN) isaLoadBalancerIdentity() bool { + return true +} - // The actions of the instance group manager. - Actions []InstanceGroupManagerActionReference `json:"actions" validate:"required"` +// UnmarshalLoadBalancerIdentityByCRN unmarshals an instance of LoadBalancerIdentityByCRN from the specified map of raw messages. +func UnmarshalLoadBalancerIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` +// LoadBalancerIdentityByHref : LoadBalancerIdentityByHref struct +// This model "extends" LoadBalancerIdentity +type LoadBalancerIdentityByHref struct { + // The load balancer's canonical URL. + Href *string `json:"href" validate:"required"` } -// Constants associated with the InstanceGroupManagerScheduled.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerScheduledManagerTypeScheduledConst = "scheduled" -) +// NewLoadBalancerIdentityByHref : Instantiate LoadBalancerIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerIdentityByHref(href string) (_model *LoadBalancerIdentityByHref, err error) { + _model = &LoadBalancerIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceGroupManagerScheduled) isaInstanceGroupManager() bool { +func (*LoadBalancerIdentityByHref) isaLoadBalancerIdentity() bool { return true } -// UnmarshalInstanceGroupManagerScheduled unmarshals an instance of InstanceGroupManagerScheduled from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduled(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduled) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } +// UnmarshalLoadBalancerIdentityByHref unmarshals an instance of LoadBalancerIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerIdentityByID : LoadBalancerIdentityByID struct +// This model "extends" LoadBalancerIdentity +type LoadBalancerIdentityByID struct { + // The unique identifier for this load balancer. + ID *string `json:"id" validate:"required"` +} + +// NewLoadBalancerIdentityByID : Instantiate LoadBalancerIdentityByID (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerIdentityByID(id string) (_model *LoadBalancerIdentityByID, err error) { + _model = &LoadBalancerIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerIdentityByID) isaLoadBalancerIdentity() bool { + return true +} + +// UnmarshalLoadBalancerIdentityByID unmarshals an instance of LoadBalancerIdentityByID from the specified map of raw messages. +func UnmarshalLoadBalancerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerIdentityByHref : LoadBalancerListenerIdentityByHref struct +// This model "extends" LoadBalancerListenerIdentity +type LoadBalancerListenerIdentityByHref struct { + // The listener's canonical URL. + Href *string `json:"href" validate:"required"` +} + +// NewLoadBalancerListenerIdentityByHref : Instantiate LoadBalancerListenerIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerIdentityByHref(href string) (_model *LoadBalancerListenerIdentityByHref, err error) { + _model = &LoadBalancerListenerIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerListenerIdentityByHref) isaLoadBalancerListenerIdentity() bool { + return true +} + +// UnmarshalLoadBalancerListenerIdentityByHref unmarshals an instance of LoadBalancerListenerIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerListenerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerIdentityByID : LoadBalancerListenerIdentityByID struct +// This model "extends" LoadBalancerListenerIdentity +type LoadBalancerListenerIdentityByID struct { + // The unique identifier for this load balancer listener. + ID *string `json:"id" validate:"required"` +} + +// NewLoadBalancerListenerIdentityByID : Instantiate LoadBalancerListenerIdentityByID (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerIdentityByID(id string) (_model *LoadBalancerListenerIdentityByID, err error) { + _model = &LoadBalancerListenerIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerListenerIdentityByID) isaLoadBalancerListenerIdentity() bool { + return true +} + +// UnmarshalLoadBalancerListenerIdentityByID unmarshals an instance of LoadBalancerListenerIdentityByID from the specified map of raw messages. +func UnmarshalLoadBalancerListenerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -84320,57 +97787,64 @@ func UnmarshalInstanceGroupManagerScheduled(m map[string]json.RawMessage, result return } -// InstanceGroupManagerScheduledActionManagerAutoScale : InstanceGroupManagerScheduledActionManagerAutoScale struct -// This model "extends" InstanceGroupManagerScheduledActionManager -type InstanceGroupManagerScheduledActionManagerAutoScale struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` +// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct +// This model "extends" LoadBalancerListenerPolicyTargetPatch +type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -func (*InstanceGroupManagerScheduledActionManagerAutoScale) isaInstanceGroupManagerScheduledActionManager() bool { +func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { return true } -// UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale unmarshals an instance of InstanceGroupManagerScheduledActionManagerAutoScale from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerAutoScale) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct +// This model "extends" LoadBalancerListenerPolicyTargetPatch +type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` +} + +func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { + return true +} + +// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + err = core.UnmarshalPrimitive(m, "url", &obj.URL) if err != nil { return } @@ -84378,51 +97852,35 @@ func UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale(m map[string]j return } -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype : The auto scale manager to update, and one or more properties to be updated. Either `id` or `href` must be specified, -// in addition to at least one of `min_membership_count` and -// `max_membership_count`. +// LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. // Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The unique identifier for this instance group manager. +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref +// This model "extends" LoadBalancerListenerPolicyTargetPatch +type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity struct { + // The unique identifier for this load balancer pool. ID *string `json:"id,omitempty"` - // The URL for this instance group manager. + // The pool's canonical URL. Href *string `json:"href,omitempty"` } -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { +func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool { return true } -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeIntf interface { - InstanceGroupManagerScheduledActionManagerPrototypeIntf - isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool +type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityIntf interface { + LoadBalancerListenerPolicyTargetPatchIntf + isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool } -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { +func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatch() bool { return true } -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } +// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -84435,30 +97893,45 @@ func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScaleProtot return } -// InstancePatchProfileInstanceProfileIdentityByHref : InstancePatchProfileInstanceProfileIdentityByHref struct -// This model "extends" InstancePatchProfile -type InstancePatchProfileInstanceProfileIdentityByHref struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` +// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct +// This model "extends" LoadBalancerListenerPolicyTargetPrototype +type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -// NewInstancePatchProfileInstanceProfileIdentityByHref : Instantiate InstancePatchProfileInstanceProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByHref(href string) (_model *InstancePatchProfileInstanceProfileIdentityByHref, err error) { - _model = &InstancePatchProfileInstanceProfileIdentityByHref{ - Href: core.StringPtr(href), +// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype, err error) { + _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype{ + HTTPStatusCode: core.Int64Ptr(httpStatusCode), + Listener: listener, } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePatchProfileInstanceProfileIdentityByHref) isaInstancePatchProfile() bool { +func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { return true } -// UnmarshalInstancePatchProfileInstanceProfileIdentityByHref unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePatchProfileInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfileInstanceProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } @@ -84466,30 +97939,38 @@ func UnmarshalInstancePatchProfileInstanceProfileIdentityByHref(m map[string]jso return } -// InstancePatchProfileInstanceProfileIdentityByName : InstancePatchProfileInstanceProfileIdentityByName struct -// This model "extends" InstancePatchProfile -type InstancePatchProfileInstanceProfileIdentityByName struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` +// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct +// This model "extends" LoadBalancerListenerPolicyTargetPrototype +type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` + + // The redirect target URL. + URL *string `json:"url" validate:"required"` } -// NewInstancePatchProfileInstanceProfileIdentityByName : Instantiate InstancePatchProfileInstanceProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByName(name string) (_model *InstancePatchProfileInstanceProfileIdentityByName, err error) { - _model = &InstancePatchProfileInstanceProfileIdentityByName{ - Name: core.StringPtr(name), +// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(httpStatusCode int64, url string) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype, err error) { + _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype{ + HTTPStatusCode: core.Int64Ptr(httpStatusCode), + URL: core.StringPtr(url), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePatchProfileInstanceProfileIdentityByName) isaInstancePatchProfile() bool { +func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { return true } -// UnmarshalInstancePatchProfileInstanceProfileIdentityByName unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByName from the specified map of raw messages. -func UnmarshalInstancePatchProfileInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfileInstanceProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) if err != nil { return } @@ -84497,47 +97978,39 @@ func UnmarshalInstancePatchProfileInstanceProfileIdentityByName(m map[string]jso return } -// InstancePlacementTargetPatchDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. // Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref -// This model "extends" InstancePlacementTargetPatch -type InstancePlacementTargetPatchDedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref +// This model "extends" LoadBalancerListenerPolicyTargetPrototype +type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity struct { + // The unique identifier for this load balancer pool. ID *string `json:"id,omitempty"` - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host group. + // The pool's canonical URL. Href *string `json:"href,omitempty"` } -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { +func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool { return true } -type InstancePlacementTargetPatchDedicatedHostGroupIdentityIntf interface { - InstancePlacementTargetPatchIntf - isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool +type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityIntf interface { + LoadBalancerListenerPolicyTargetPrototypeIntf + isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool } -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatch() bool { +func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototype() bool { return true } -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentity) +// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -84546,48 +98019,34 @@ func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(m map[strin return } -// InstancePlacementTargetPatchDedicatedHostIdentity : Identifies a dedicated host by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref -// This model "extends" InstancePlacementTargetPatch -type InstancePlacementTargetPatchDedicatedHostIdentity struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} +// LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect : LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct +// This model "extends" LoadBalancerListenerPolicyTarget +type LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` -func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} + Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` -type InstancePlacementTargetPatchDedicatedHostIdentityIntf interface { - InstancePlacementTargetPatchIntf - isaInstancePlacementTargetPatchDedicatedHostIdentity() bool + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` } -func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatch() bool { +func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) isaLoadBalancerListenerPolicyTarget() bool { return true } -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) if err != nil { return } @@ -84595,48 +98054,72 @@ func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(m map[string]jso return } -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` +// LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL : LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct +// This model "extends" LoadBalancerListenerPolicyTarget +type LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` + // The redirect target URL. + URL *string `json:"url" validate:"required"` } -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { +func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) isaLoadBalancerListenerPolicyTarget() bool { return true } -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool +// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototype() bool { +// LoadBalancerListenerPolicyTargetLoadBalancerPoolReference : LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct +// This model "extends" LoadBalancerListenerPolicyTarget +type LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer pool. + ID *string `json:"id" validate:"required"` + + // The name for this load balancer pool. The name is unique across all pools for the load balancer. + Name *string `json:"name" validate:"required"` +} + +func (*LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) isaLoadBalancerListenerPolicyTarget() bool { return true } -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -84644,48 +98127,96 @@ func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity(m map[s return } -// InstancePlacementTargetPrototypeDedicatedHostIdentity : Identifies a dedicated host by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypeDedicatedHostIdentity struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` +// LoadBalancerPoolIdentityByHref : LoadBalancerPoolIdentityByHref struct +// This model "extends" LoadBalancerPoolIdentity +type LoadBalancerPoolIdentityByHref struct { + // The pool's canonical URL. + Href *string `json:"href" validate:"required"` +} - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` +// NewLoadBalancerPoolIdentityByHref : Instantiate LoadBalancerPoolIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolIdentityByHref(href string) (_model *LoadBalancerPoolIdentityByHref, err error) { + _model = &LoadBalancerPoolIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { +func (*LoadBalancerPoolIdentityByHref) isaLoadBalancerPoolIdentity() bool { return true } -type InstancePlacementTargetPrototypeDedicatedHostIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool +// UnmarshalLoadBalancerPoolIdentityByHref unmarshals an instance of LoadBalancerPoolIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototype() bool { +// LoadBalancerPoolIdentityByID : LoadBalancerPoolIdentityByID struct +// This model "extends" LoadBalancerPoolIdentity +type LoadBalancerPoolIdentityByID struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id" validate:"required"` +} + +// NewLoadBalancerPoolIdentityByID : Instantiate LoadBalancerPoolIdentityByID (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolIdentityByID(id string) (_model *LoadBalancerPoolIdentityByID, err error) { + _model = &LoadBalancerPoolIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerPoolIdentityByID) isaLoadBalancerPoolIdentity() bool { return true } -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentity) +// UnmarshalLoadBalancerPoolIdentityByID unmarshals an instance of LoadBalancerPoolIdentityByID from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPoolMemberTargetPrototypeIP : LoadBalancerPoolMemberTargetPrototypeIP struct +// This model "extends" LoadBalancerPoolMemberTargetPrototype +type LoadBalancerPoolMemberTargetPrototypeIP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} + +// NewLoadBalancerPoolMemberTargetPrototypeIP : Instantiate LoadBalancerPoolMemberTargetPrototypeIP (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeIP(address string) (_model *LoadBalancerPoolMemberTargetPrototypeIP, err error) { + _model = &LoadBalancerPoolMemberTargetPrototypeIP{ + Address: core.StringPtr(address), } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerPoolMemberTargetPrototypeIP) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeIP unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -84693,39 +98224,39 @@ func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity(m map[string return } -// InstancePlacementTargetPrototypePlacementGroupIdentity : Identifies a placement group by a unique property. +// LoadBalancerPoolMemberTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. // Models which "extend" this model: -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypePlacementGroupIdentity struct { - // The unique identifier for this placement group. +// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID +// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN +// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref +// This model "extends" LoadBalancerPoolMemberTargetPrototype +type LoadBalancerPoolMemberTargetPrototypeInstanceIdentity struct { + // The unique identifier for this virtual server instance. ID *string `json:"id,omitempty"` - // The CRN for this placement group. + // The CRN for this virtual server instance. CRN *string `json:"crn,omitempty"` - // The URL for this placement group. + // The URL for this virtual server instance. Href *string `json:"href,omitempty"` } -func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { +func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { return true } -type InstancePlacementTargetPrototypePlacementGroupIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool +type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityIntf interface { + LoadBalancerPoolMemberTargetPrototypeIntf + isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool } -func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototype() bool { +func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototype() bool { return true } -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentity) +// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -84742,63 +98273,25 @@ func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity(m map[strin return } -// InstancePlacementTargetDedicatedHostGroupReference : InstancePlacementTargetDedicatedHostGroupReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetDedicatedHostGroupReference struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// LoadBalancerPoolMemberTargetIP : LoadBalancerPoolMemberTargetIP struct +// This model "extends" LoadBalancerPoolMemberTarget +type LoadBalancerPoolMemberTargetIP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` } -// Constants associated with the InstancePlacementTargetDedicatedHostGroupReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetDedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -func (*InstancePlacementTargetDedicatedHostGroupReference) isaInstancePlacementTarget() bool { +func (*LoadBalancerPoolMemberTargetIP) isaLoadBalancerPoolMemberTarget() bool { return true } -// UnmarshalInstancePlacementTargetDedicatedHostGroupReference unmarshals an instance of InstancePlacementTargetDedicatedHostGroupReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetDedicatedHostGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalLoadBalancerPoolMemberTargetIP unmarshals an instance of LoadBalancerPoolMemberTargetIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -84806,47 +98299,38 @@ func UnmarshalInstancePlacementTargetDedicatedHostGroupReference(m map[string]js return } -// InstancePlacementTargetDedicatedHostReference : InstancePlacementTargetDedicatedHostReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetDedicatedHostReference struct { - // The CRN for this dedicated host. +// LoadBalancerPoolMemberTargetInstanceReference : LoadBalancerPoolMemberTargetInstanceReference struct +// This model "extends" LoadBalancerPoolMemberTarget +type LoadBalancerPoolMemberTargetInstanceReference struct { + // The CRN for this virtual server instance. CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. - Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - // The URL for this dedicated host. + // The URL for this virtual server instance. Href *string `json:"href" validate:"required"` - // The unique identifier for this dedicated host. + // The unique identifier for this virtual server instance. ID *string `json:"id" validate:"required"` - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. + // The name for this virtual server instance. The name is unique across all virtual server instances in the region. Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the InstancePlacementTargetDedicatedHostReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetDedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" -) - -func (*InstancePlacementTargetDedicatedHostReference) isaInstancePlacementTarget() bool { +func (*LoadBalancerPoolMemberTargetInstanceReference) isaLoadBalancerPoolMemberTarget() bool { return true } -// UnmarshalInstancePlacementTargetDedicatedHostReference unmarshals an instance of InstancePlacementTargetDedicatedHostReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetDedicatedHostReference) +// UnmarshalLoadBalancerPoolMemberTargetInstanceReference unmarshals an instance of LoadBalancerPoolMemberTargetInstanceReference from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetInstanceReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) if err != nil { return } @@ -84862,99 +98346,92 @@ func UnmarshalInstancePlacementTargetDedicatedHostReference(m map[string]json.Ra if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstancePlacementTargetPlacementGroupReference : InstancePlacementTargetPlacementGroupReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetPlacementGroupReference struct { - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *PlacementGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this placement group. +// LoadBalancerProfileIdentityByHref : LoadBalancerProfileIdentityByHref struct +// This model "extends" LoadBalancerProfileIdentity +type LoadBalancerProfileIdentityByHref struct { + // The URL for this load balancer profile. Href *string `json:"href" validate:"required"` - - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` - - // The name for this placement group. The name is unique across all placement groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the InstancePlacementTargetPlacementGroupReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetPlacementGroupReferenceResourceTypePlacementGroupConst = "placement_group" -) - -func (*InstancePlacementTargetPlacementGroupReference) isaInstancePlacementTarget() bool { - return true +// NewLoadBalancerProfileIdentityByHref : Instantiate LoadBalancerProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerProfileIdentityByHref(href string) (_model *LoadBalancerProfileIdentityByHref, err error) { + _model = &LoadBalancerProfileIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalInstancePlacementTargetPlacementGroupReference unmarshals an instance of InstancePlacementTargetPlacementGroupReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPlacementGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPlacementGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPlacementGroupReferenceDeleted) - if err != nil { - return - } +func (*LoadBalancerProfileIdentityByHref) isaLoadBalancerProfileIdentity() bool { + return true +} + +// UnmarshalLoadBalancerProfileIdentityByHref unmarshals an instance of LoadBalancerProfileIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerProfileIdentityByName : LoadBalancerProfileIdentityByName struct +// This model "extends" LoadBalancerProfileIdentity +type LoadBalancerProfileIdentityByName struct { + // The globally unique name for this load balancer profile. + Name *string `json:"name" validate:"required"` +} + +// NewLoadBalancerProfileIdentityByName : Instantiate LoadBalancerProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerProfileIdentityByName(name string) (_model *LoadBalancerProfileIdentityByName, err error) { + _model = &LoadBalancerProfileIdentityByName{ + Name: core.StringPtr(name), } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LoadBalancerProfileIdentityByName) isaLoadBalancerProfileIdentity() bool { + return true +} + +// UnmarshalLoadBalancerProfileIdentityByName unmarshals an instance of LoadBalancerProfileIdentityByName from the specified map of raw messages. +func UnmarshalLoadBalancerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceProfileBandwidthDependent : The total bandwidth shared across the network interfaces and storage volumes of an instance with this profile depends -// on its configuration. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthDependent struct { +// LoadBalancerProfileInstanceGroupsSupportedDependent : The instance groups support for a load balancer with this profile depends on its configuration. +// This model "extends" LoadBalancerProfileInstanceGroupsSupported +type LoadBalancerProfileInstanceGroupsSupportedDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the InstanceProfileBandwidthDependent.Type property. +// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedDependent.Type property. // The type for this profile field. const ( - InstanceProfileBandwidthDependentTypeDependentConst = "dependent" + LoadBalancerProfileInstanceGroupsSupportedDependentTypeDependentConst = "dependent" ) -func (*InstanceProfileBandwidthDependent) isaInstanceProfileBandwidth() bool { +func (*LoadBalancerProfileInstanceGroupsSupportedDependent) isaLoadBalancerProfileInstanceGroupsSupported() bool { return true } -// UnmarshalInstanceProfileBandwidthDependent unmarshals an instance of InstanceProfileBandwidthDependent from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthDependent) +// UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedDependent from the specified map of raw messages. +func UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileInstanceGroupsSupportedDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -84963,42 +98440,34 @@ func UnmarshalInstanceProfileBandwidthDependent(m map[string]json.RawMessage, re return } -// InstanceProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the network interfaces and storage -// volumes of an instance with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - +// LoadBalancerProfileInstanceGroupsSupportedFixed : The instance groups support for a load balancer with this profile. +// This model "extends" LoadBalancerProfileInstanceGroupsSupported +type LoadBalancerProfileInstanceGroupsSupportedFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The value for this profile field. + Value *bool `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileBandwidthEnum.Type property. +// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedFixed.Type property. // The type for this profile field. const ( - InstanceProfileBandwidthEnumTypeEnumConst = "enum" + LoadBalancerProfileInstanceGroupsSupportedFixedTypeFixedConst = "fixed" ) -func (*InstanceProfileBandwidthEnum) isaInstanceProfileBandwidth() bool { +func (*LoadBalancerProfileInstanceGroupsSupportedFixed) isaLoadBalancerProfileInstanceGroupsSupported() bool { return true } -// UnmarshalInstanceProfileBandwidthEnum unmarshals an instance of InstanceProfileBandwidthEnum from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } +// UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedFixed from the specified map of raw messages. +func UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileInstanceGroupsSupportedFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -85006,92 +98475,62 @@ func UnmarshalInstanceProfileBandwidthEnum(m map[string]json.RawMessage, result return } -// InstanceProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the network interfaces and storage volumes of an instance -// with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthFixed struct { +// LoadBalancerProfileRouteModeSupportedDependent : The route mode support for a load balancer with this profile depends on its configuration. +// This model "extends" LoadBalancerProfileRouteModeSupported +type LoadBalancerProfileRouteModeSupportedDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileBandwidthFixed.Type property. +// Constants associated with the LoadBalancerProfileRouteModeSupportedDependent.Type property. // The type for this profile field. const ( - InstanceProfileBandwidthFixedTypeFixedConst = "fixed" + LoadBalancerProfileRouteModeSupportedDependentTypeDependentConst = "dependent" ) -func (*InstanceProfileBandwidthFixed) isaInstanceProfileBandwidth() bool { +func (*LoadBalancerProfileRouteModeSupportedDependent) isaLoadBalancerProfileRouteModeSupported() bool { return true } -// UnmarshalInstanceProfileBandwidthFixed unmarshals an instance of InstanceProfileBandwidthFixed from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthFixed) +// UnmarshalLoadBalancerProfileRouteModeSupportedDependent unmarshals an instance of LoadBalancerProfileRouteModeSupportedDependent from the specified map of raw messages. +func UnmarshalLoadBalancerProfileRouteModeSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileRouteModeSupportedDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network interfaces and storage volumes -// of an instance with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - +// LoadBalancerProfileRouteModeSupportedFixed : The route mode support for a load balancer with this profile. +// This model "extends" LoadBalancerProfileRouteModeSupported +type LoadBalancerProfileRouteModeSupportedFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *bool `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileBandwidthRange.Type property. +// Constants associated with the LoadBalancerProfileRouteModeSupportedFixed.Type property. // The type for this profile field. const ( - InstanceProfileBandwidthRangeTypeRangeConst = "range" + LoadBalancerProfileRouteModeSupportedFixedTypeFixedConst = "fixed" ) -func (*InstanceProfileBandwidthRange) isaInstanceProfileBandwidth() bool { +func (*LoadBalancerProfileRouteModeSupportedFixed) isaLoadBalancerProfileRouteModeSupported() bool { return true } -// UnmarshalInstanceProfileBandwidthRange unmarshals an instance of InstanceProfileBandwidthRange from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) +// UnmarshalLoadBalancerProfileRouteModeSupportedFixed unmarshals an instance of LoadBalancerProfileRouteModeSupportedFixed from the specified map of raw messages. +func UnmarshalLoadBalancerProfileRouteModeSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileRouteModeSupportedFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -85099,26 +98538,26 @@ func UnmarshalInstanceProfileBandwidthRange(m map[string]json.RawMessage, result return } -// InstanceProfileDiskQuantityDependent : The number of disks of this configuration for an instance with this profile depends on its instance configuration. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityDependent struct { +// LoadBalancerProfileSecurityGroupsSupportedDependent : The security group support for a load balancer with this profile depends on its configuration. +// This model "extends" LoadBalancerProfileSecurityGroupsSupported +type LoadBalancerProfileSecurityGroupsSupportedDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the InstanceProfileDiskQuantityDependent.Type property. +// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedDependent.Type property. // The type for this profile field. const ( - InstanceProfileDiskQuantityDependentTypeDependentConst = "dependent" + LoadBalancerProfileSecurityGroupsSupportedDependentTypeDependentConst = "dependent" ) -func (*InstanceProfileDiskQuantityDependent) isaInstanceProfileDiskQuantity() bool { +func (*LoadBalancerProfileSecurityGroupsSupportedDependent) isaLoadBalancerProfileSecurityGroupsSupported() bool { return true } -// UnmarshalInstanceProfileDiskQuantityDependent unmarshals an instance of InstanceProfileDiskQuantityDependent from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityDependent) +// UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedDependent from the specified map of raw messages. +func UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileSecurityGroupsSupportedDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -85127,41 +98566,34 @@ func UnmarshalInstanceProfileDiskQuantityDependent(m map[string]json.RawMessage, return } -// InstanceProfileDiskQuantityEnum : The permitted the number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - +// LoadBalancerProfileSecurityGroupsSupportedFixed : The security group support for a load balancer with this profile. +// This model "extends" LoadBalancerProfileSecurityGroupsSupported +type LoadBalancerProfileSecurityGroupsSupportedFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The value for this profile field. + Value *bool `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileDiskQuantityEnum.Type property. +// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedFixed.Type property. // The type for this profile field. const ( - InstanceProfileDiskQuantityEnumTypeEnumConst = "enum" + LoadBalancerProfileSecurityGroupsSupportedFixedTypeFixedConst = "fixed" ) -func (*InstanceProfileDiskQuantityEnum) isaInstanceProfileDiskQuantity() bool { +func (*LoadBalancerProfileSecurityGroupsSupportedFixed) isaLoadBalancerProfileSecurityGroupsSupported() bool { return true } -// UnmarshalInstanceProfileDiskQuantityEnum unmarshals an instance of InstanceProfileDiskQuantityEnum from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } +// UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedFixed from the specified map of raw messages. +func UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileSecurityGroupsSupportedFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -85169,90 +98601,62 @@ func UnmarshalInstanceProfileDiskQuantityEnum(m map[string]json.RawMessage, resu return } -// InstanceProfileDiskQuantityFixed : The number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityFixed struct { +// LoadBalancerProfileUDPSupportedDependent : The UDP support for a load balancer with this profile depends on its configuration. +// This model "extends" LoadBalancerProfileUDPSupported +type LoadBalancerProfileUDPSupportedDependent struct { // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileDiskQuantityFixed.Type property. +// Constants associated with the LoadBalancerProfileUDPSupportedDependent.Type property. // The type for this profile field. const ( - InstanceProfileDiskQuantityFixedTypeFixedConst = "fixed" + LoadBalancerProfileUDPSupportedDependentTypeDependentConst = "dependent" ) -func (*InstanceProfileDiskQuantityFixed) isaInstanceProfileDiskQuantity() bool { +func (*LoadBalancerProfileUDPSupportedDependent) isaLoadBalancerProfileUDPSupported() bool { return true } -// UnmarshalInstanceProfileDiskQuantityFixed unmarshals an instance of InstanceProfileDiskQuantityFixed from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityFixed) +// UnmarshalLoadBalancerProfileUDPSupportedDependent unmarshals an instance of LoadBalancerProfileUDPSupportedDependent from the specified map of raw messages. +func UnmarshalLoadBalancerProfileUDPSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileUDPSupportedDependent) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - +// LoadBalancerProfileUDPSupportedFixed : The UDP support for a load balancer with this profile. +// This model "extends" LoadBalancerProfileUDPSupported +type LoadBalancerProfileUDPSupportedFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *bool `json:"value" validate:"required"` } -// Constants associated with the InstanceProfileDiskQuantityRange.Type property. +// Constants associated with the LoadBalancerProfileUDPSupportedFixed.Type property. // The type for this profile field. const ( - InstanceProfileDiskQuantityRangeTypeRangeConst = "range" + LoadBalancerProfileUDPSupportedFixedTypeFixedConst = "fixed" ) -func (*InstanceProfileDiskQuantityRange) isaInstanceProfileDiskQuantity() bool { +func (*LoadBalancerProfileUDPSupportedFixed) isaLoadBalancerProfileUDPSupported() bool { return true } -// UnmarshalInstanceProfileDiskQuantityRange unmarshals an instance of InstanceProfileDiskQuantityRange from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) +// UnmarshalLoadBalancerProfileUDPSupportedFixed unmarshals an instance of LoadBalancerProfileUDPSupportedFixed from the specified map of raw messages. +func UnmarshalLoadBalancerProfileUDPSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileUDPSupportedFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -85260,28 +98664,30 @@ func UnmarshalInstanceProfileDiskQuantityRange(m map[string]json.RawMessage, res return } -// InstanceProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for an instance with this profile depends on its instance -// configuration. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// NetworkACLIdentityByCRN : NetworkACLIdentityByCRN struct +// This model "extends" NetworkACLIdentity +type NetworkACLIdentityByCRN struct { + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` } -// Constants associated with the InstanceProfileDiskSizeDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeDependentTypeDependentConst = "dependent" -) +// NewNetworkACLIdentityByCRN : Instantiate NetworkACLIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewNetworkACLIdentityByCRN(crn string) (_model *NetworkACLIdentityByCRN, err error) { + _model = &NetworkACLIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileDiskSizeDependent) isaInstanceProfileDiskSize() bool { +func (*NetworkACLIdentityByCRN) isaNetworkACLIdentity() bool { return true } -// UnmarshalInstanceProfileDiskSizeDependent unmarshals an instance of InstanceProfileDiskSizeDependent from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLIdentityByCRN unmarshals an instance of NetworkACLIdentityByCRN from the specified map of raw messages. +func UnmarshalNetworkACLIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -85289,41 +98695,30 @@ func UnmarshalInstanceProfileDiskSizeDependent(m map[string]json.RawMessage, res return } -// InstanceProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` +// NetworkACLIdentityByHref : NetworkACLIdentityByHref struct +// This model "extends" NetworkACLIdentity +type NetworkACLIdentityByHref struct { + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` } -// Constants associated with the InstanceProfileDiskSizeEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeEnumTypeEnumConst = "enum" -) +// NewNetworkACLIdentityByHref : Instantiate NetworkACLIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewNetworkACLIdentityByHref(href string) (_model *NetworkACLIdentityByHref, err error) { + _model = &NetworkACLIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileDiskSizeEnum) isaInstanceProfileDiskSize() bool { +func (*NetworkACLIdentityByHref) isaNetworkACLIdentity() bool { return true } -// UnmarshalInstanceProfileDiskSizeEnum unmarshals an instance of InstanceProfileDiskSizeEnum from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) +// UnmarshalNetworkACLIdentityByHref unmarshals an instance of NetworkACLIdentityByHref from the specified map of raw messages. +func UnmarshalNetworkACLIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -85331,34 +98726,30 @@ func UnmarshalInstanceProfileDiskSizeEnum(m map[string]json.RawMessage, result i return } -// InstanceProfileDiskSizeFixed : The size of the disk in GB (gigabytes). -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +// NetworkACLIdentityByID : NetworkACLIdentityByID struct +// This model "extends" NetworkACLIdentity +type NetworkACLIdentityByID struct { + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` } -// Constants associated with the InstanceProfileDiskSizeFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeFixedTypeFixedConst = "fixed" -) +// NewNetworkACLIdentityByID : Instantiate NetworkACLIdentityByID (Generic Model Constructor) +func (*VpcV1) NewNetworkACLIdentityByID(id string) (_model *NetworkACLIdentityByID, err error) { + _model = &NetworkACLIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileDiskSizeFixed) isaInstanceProfileDiskSize() bool { +func (*NetworkACLIdentityByID) isaNetworkACLIdentity() bool { return true } -// UnmarshalInstanceProfileDiskSizeFixed unmarshals an instance of InstanceProfileDiskSizeFixed from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalNetworkACLIdentityByID unmarshals an instance of NetworkACLIdentityByID from the specified map of raw messages. +func UnmarshalNetworkACLIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -85366,55 +98757,52 @@ func UnmarshalInstanceProfileDiskSizeFixed(m map[string]json.RawMessage, result return } -// InstanceProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for an instance with this profile. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` +// NetworkACLPrototypeNetworkACLByRules : NetworkACLPrototypeNetworkACLByRules struct +// This model "extends" NetworkACLPrototype +type NetworkACLPrototypeNetworkACLByRules struct { + // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The VPC this network ACL will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, + // resulting in all traffic being denied. + Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` } -// Constants associated with the InstanceProfileDiskSizeRange.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeRangeTypeRangeConst = "range" -) +// NewNetworkACLPrototypeNetworkACLByRules : Instantiate NetworkACLPrototypeNetworkACLByRules (Generic Model Constructor) +func (*VpcV1) NewNetworkACLPrototypeNetworkACLByRules(vpc VPCIdentityIntf) (_model *NetworkACLPrototypeNetworkACLByRules, err error) { + _model = &NetworkACLPrototypeNetworkACLByRules{ + VPC: vpc, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileDiskSizeRange) isaInstanceProfileDiskSize() bool { +func (*NetworkACLPrototypeNetworkACLByRules) isaNetworkACLPrototype() bool { return true } -// UnmarshalInstanceProfileDiskSizeRange unmarshals an instance of InstanceProfileDiskSizeRange from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalNetworkACLPrototypeNetworkACLByRules unmarshals an instance of NetworkACLPrototypeNetworkACLByRules from the specified map of raw messages. +func UnmarshalNetworkACLPrototypeNetworkACLByRules(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPrototypeNetworkACLByRules) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) if err != nil { return } @@ -85422,69 +98810,52 @@ func UnmarshalInstanceProfileDiskSizeRange(m map[string]json.RawMessage, result return } -// InstanceProfileGpuDependent : The GPU count for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} +// NetworkACLPrototypeNetworkACLBySourceNetworkACL : NetworkACLPrototypeNetworkACLBySourceNetworkACL struct +// This model "extends" NetworkACLPrototype +type NetworkACLPrototypeNetworkACLBySourceNetworkACL struct { + // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// Constants associated with the InstanceProfileGpuDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuDependentTypeDependentConst = "dependent" -) + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -func (*InstanceProfileGpuDependent) isaInstanceProfileGpu() bool { - return true -} + // The VPC this network ACL will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` -// UnmarshalInstanceProfileGpuDependent unmarshals an instance of InstanceProfileGpuDependent from the specified map of raw messages. -func UnmarshalInstanceProfileGpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Network ACL to copy rules from. + SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl" validate:"required"` } -// InstanceProfileGpuEnum : The permitted GPU count values for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` +// NewNetworkACLPrototypeNetworkACLBySourceNetworkACL : Instantiate NetworkACLPrototypeNetworkACLBySourceNetworkACL (Generic Model Constructor) +func (*VpcV1) NewNetworkACLPrototypeNetworkACLBySourceNetworkACL(vpc VPCIdentityIntf, sourceNetworkACL NetworkACLIdentityIntf) (_model *NetworkACLPrototypeNetworkACLBySourceNetworkACL, err error) { + _model = &NetworkACLPrototypeNetworkACLBySourceNetworkACL{ + VPC: vpc, + SourceNetworkACL: sourceNetworkACL, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the InstanceProfileGpuEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileGpuEnum) isaInstanceProfileGpu() bool { +func (*NetworkACLPrototypeNetworkACLBySourceNetworkACL) isaNetworkACLPrototype() bool { return true } -// UnmarshalInstanceProfileGpuEnum unmarshals an instance of InstanceProfileGpuEnum from the specified map of raw messages. -func UnmarshalInstanceProfileGpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL unmarshals an instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL from the specified map of raw messages. +func UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPrototypeNetworkACLBySourceNetworkACL) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } @@ -85492,34 +98863,30 @@ func UnmarshalInstanceProfileGpuEnum(m map[string]json.RawMessage, result interf return } -// InstanceProfileGpuFixed : The GPU count for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct +// This model "extends" NetworkACLRuleBeforePatch +type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct { + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` } -// Constants associated with the InstanceProfileGpuFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuFixedTypeFixedConst = "fixed" -) +// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref, err error) { + _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileGpuFixed) isaInstanceProfileGpu() bool { +func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePatch() bool { return true } -// UnmarshalInstanceProfileGpuFixed unmarshals an instance of InstanceProfileGpuFixed from the specified map of raw messages. -func UnmarshalInstanceProfileGpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -85527,27 +98894,30 @@ func UnmarshalInstanceProfileGpuFixed(m map[string]json.RawMessage, result inter return } -// InstanceProfileGpuMemoryDependent : The overall GPU memory value for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct +// This model "extends" NetworkACLRuleBeforePatch +type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` } -// Constants associated with the InstanceProfileGpuMemoryDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryDependentTypeDependentConst = "dependent" -) +// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID, err error) { + _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileGpuMemoryDependent) isaInstanceProfileGpuMemory() bool { +func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePatch() bool { return true } -// UnmarshalInstanceProfileGpuMemoryDependent unmarshals an instance of InstanceProfileGpuMemoryDependent from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -85555,41 +98925,30 @@ func UnmarshalInstanceProfileGpuMemoryDependent(m map[string]json.RawMessage, re return } -// InstanceProfileGpuMemoryEnum : The permitted overall GPU memory values in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` +// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct +// This model "extends" NetworkACLRuleBeforePrototype +type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct { + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` } -// Constants associated with the InstanceProfileGpuMemoryEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryEnumTypeEnumConst = "enum" -) +// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref, err error) { + _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileGpuMemoryEnum) isaInstanceProfileGpuMemory() bool { +func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePrototype() bool { return true } -// UnmarshalInstanceProfileGpuMemoryEnum unmarshals an instance of InstanceProfileGpuMemoryEnum from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) +// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -85597,34 +98956,30 @@ func UnmarshalInstanceProfileGpuMemoryEnum(m map[string]json.RawMessage, result return } -// InstanceProfileGpuMemoryFixed : The overall GPU memory in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct +// This model "extends" NetworkACLRuleBeforePrototype +type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` } -// Constants associated with the InstanceProfileGpuMemoryFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryFixedTypeFixedConst = "fixed" -) +// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID, err error) { + _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*InstanceProfileGpuMemoryFixed) isaInstanceProfileGpuMemory() bool { +func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePrototype() bool { return true } -// UnmarshalInstanceProfileGpuMemoryFixed unmarshals an instance of InstanceProfileGpuMemoryFixed from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -85632,111 +98987,118 @@ func UnmarshalInstanceProfileGpuMemoryFixed(m map[string]json.RawMessage, result return } -// InstanceProfileGpuMemoryRange : The permitted overall GPU memory range in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// NetworkACLRuleItemNetworkACLRuleProtocolAll : NetworkACLRuleItemNetworkACLRuleProtocolAll struct +// This model "extends" NetworkACLRuleItem +type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` + // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the + // collection. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the InstanceProfileGpuMemoryRange.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Action property. +// The action to perform for a packet matching the rule. const ( - InstanceProfileGpuMemoryRangeTypeRangeConst = "range" + NetworkACLRuleItemNetworkACLRuleProtocolAllActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolAllActionDenyConst = "deny" ) -func (*InstanceProfileGpuMemoryRange) isaInstanceProfileGpuMemory() bool { +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolAllProtocolAllConst = "all" +) + +func (*NetworkACLRuleItemNetworkACLRuleProtocolAll) isaNetworkACLRuleItem() bool { return true } -// UnmarshalInstanceProfileGpuMemoryRange unmarshals an instance of InstanceProfileGpuMemoryRange from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolAll from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolAll) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuRange : The permitted GPU count range for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuRange.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuRangeTypeRangeConst = "range" -) - -func (*InstanceProfileGpuRange) isaInstanceProfileGpu() bool { - return true -} - -// UnmarshalInstanceProfileGpuRange unmarshals an instance of InstanceProfileGpuRange from the specified map of raw messages. -func UnmarshalInstanceProfileGpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -85744,166 +99106,136 @@ func UnmarshalInstanceProfileGpuRange(m map[string]json.RawMessage, result inter return } -// InstanceProfileIdentityByHref : InstanceProfileIdentityByHref struct -// This model "extends" InstanceProfileIdentity -type InstanceProfileIdentityByHref struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` -} +// NetworkACLRuleItemNetworkACLRuleProtocolIcmp : NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct +// This model "extends" NetworkACLRuleItem +type NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// NewInstanceProfileIdentityByHref : Instantiate InstanceProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceProfileIdentityByHref(href string) (_model *InstanceProfileIdentityByHref, err error) { - _model = &InstanceProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the + // collection. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` -func (*InstanceProfileIdentityByHref) isaInstanceProfileIdentity() bool { - return true -} + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// UnmarshalInstanceProfileIdentityByHref unmarshals an instance of InstanceProfileIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` -// InstanceProfileIdentityByName : InstanceProfileIdentityByName struct -// This model "extends" InstanceProfileIdentity -type InstanceProfileIdentityByName struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// NewInstanceProfileIdentityByName : Instantiate InstanceProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewInstanceProfileIdentityByName(name string) (_model *InstanceProfileIdentityByName, err error) { - _model = &InstanceProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` -func (*InstanceProfileIdentityByName) isaInstanceProfileIdentity() bool { - return true -} + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` -// UnmarshalInstanceProfileIdentityByName unmarshals an instance of InstanceProfileIdentityByName from the specified map of raw messages. -func UnmarshalInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` -// InstanceProfileMemoryDependent : The memory value for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` -// Constants associated with the InstanceProfileMemoryDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryDependentTypeDependentConst = "dependent" -) + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` -func (*InstanceProfileMemoryDependent) isaInstanceProfileMemory() bool { - return true -} + // The ICMP traffic code to match. + // + // If absent, all codes are matched. + Code *int64 `json:"code,omitempty"` -// UnmarshalInstanceProfileMemoryDependent unmarshals an instance of InstanceProfileMemoryDependent from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The ICMP traffic type to match. + // + // If absent, all types are matched. + Type *int64 `json:"type,omitempty"` } -// InstanceProfileMemoryEnum : The permitted memory values (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionDenyConst = "deny" +) - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" +) - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" +) -// Constants associated with the InstanceProfileMemoryEnum.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Protocol property. +// The protocol to enforce. const ( - InstanceProfileMemoryEnumTypeEnumConst = "enum" + NetworkACLRuleItemNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" ) -func (*InstanceProfileMemoryEnum) isaInstanceProfileMemory() bool { +func (*NetworkACLRuleItemNetworkACLRuleProtocolIcmp) isaNetworkACLRuleItem() bool { return true } -// UnmarshalInstanceProfileMemoryEnum unmarshals an instance of InstanceProfileMemoryEnum from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolIcmp from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolIcmp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemoryFixed : The memory (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileMemoryFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileMemoryFixed) isaInstanceProfileMemory() bool { - return true -} - -// UnmarshalInstanceProfileMemoryFixed unmarshals an instance of InstanceProfileMemoryFixed from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -85911,119 +99243,147 @@ func UnmarshalInstanceProfileMemoryFixed(m map[string]json.RawMessage, result in return } -// InstanceProfileMemoryRange : The permitted memory range (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// NetworkACLRuleItemNetworkACLRuleProtocolTcpudp : NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct +// This model "extends" NetworkACLRuleItem +type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` + // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the + // collection. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` + + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` + + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max" validate:"required"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min" validate:"required"` } -// Constants associated with the InstanceProfileMemoryRange.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Action property. +// The action to perform for a packet matching the rule. const ( - InstanceProfileMemoryRangeTypeRangeConst = "range" + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" ) -func (*InstanceProfileMemoryRange) isaInstanceProfileMemory() bool { +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" + NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" +) + +func (*NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) isaNetworkACLRuleItem() bool { return true } -// UnmarshalInstanceProfileMemoryRange unmarshals an instance of InstanceProfileMemoryRange from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolTcpudp from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNumaCountDependent : The total number of NUMA nodes for an instance with this profile depends on its configuration and the capacity -// constraints within the zone. -// This model "extends" InstanceProfileNumaCount -type InstanceProfileNumaCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNumaCountDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileNumaCountDependent) isaInstanceProfileNumaCount() bool { - return true -} - -// UnmarshalInstanceProfileNumaCountDependent unmarshals an instance of InstanceProfileNumaCountDependent from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNumaCountFixed : The total number of NUMA nodes for an instance with this profile. -// This model "extends" InstanceProfileNumaCount -type InstanceProfileNumaCountFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileNumaCountFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileNumaCountFixed) isaInstanceProfileNumaCount() bool { - return true -} - -// UnmarshalInstanceProfileNumaCountFixed unmarshals an instance of InstanceProfileNumaCountFixed from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCountFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) if err != nil { return } @@ -86031,132 +99391,103 @@ func UnmarshalInstanceProfileNumaCountFixed(m map[string]json.RawMessage, result return } -// InstanceProfileNetworkInterfaceCountDependent : The number of network interfaces supported on an instance with this profile is dependent on its configuration. -// This model "extends" InstanceProfileNetworkInterfaceCount -type InstanceProfileNetworkInterfaceCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct +// This model "extends" NetworkACLRulePrototypeNetworkACLContext +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// Constants associated with the InstanceProfileNetworkInterfaceCountDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" -) + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` -func (*InstanceProfileNetworkInterfaceCountDependent) isaInstanceProfileNetworkInterfaceCount() bool { - return true -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// UnmarshalInstanceProfileNetworkInterfaceCountDependent unmarshals an instance of InstanceProfileNetworkInterfaceCountDependent from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` -// InstanceProfileNetworkInterfaceCountRange : The number of network interfaces supported on an instance with this profile. -// This model "extends" InstanceProfileNetworkInterfaceCount -type InstanceProfileNetworkInterfaceCountRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the InstanceProfileNetworkInterfaceCountRange.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Action property. +// The action to perform for a packet matching the rule. const ( - InstanceProfileNetworkInterfaceCountRangeTypeRangeConst = "range" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" ) -func (*InstanceProfileNetworkInterfaceCountRange) isaInstanceProfileNetworkInterfaceCount() bool { +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" +) + +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { return true } -// UnmarshalInstanceProfileNetworkInterfaceCountRange unmarshals an instance of InstanceProfileNetworkInterfaceCountRange from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfilePortSpeedDependent : The port speed of each network interface of an instance with this profile depends on its configuration. -// This model "extends" InstanceProfilePortSpeed -type InstanceProfilePortSpeedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfilePortSpeedDependent.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfilePortSpeedDependent) isaInstanceProfilePortSpeed() bool { - return true -} - -// UnmarshalInstanceProfilePortSpeedDependent unmarshals an instance of InstanceProfilePortSpeedDependent from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfilePortSpeedFixed : The maximum speed (in megabits per second) of each network interface of an instance with this profile. -// This model "extends" InstanceProfilePortSpeed -type InstanceProfilePortSpeedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfilePortSpeedFixed.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfilePortSpeedFixed) isaInstanceProfilePortSpeed() bool { - return true -} - -// UnmarshalInstanceProfilePortSpeedFixed unmarshals an instance of InstanceProfilePortSpeedFixed from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -86164,156 +99495,117 @@ func UnmarshalInstanceProfilePortSpeedFixed(m map[string]json.RawMessage, result return } -// InstanceProfileVcpuDependent : The VCPU count for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct +// This model "extends" NetworkACLRulePrototypeNetworkACLContext +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// Constants associated with the InstanceProfileVcpuDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuDependentTypeDependentConst = "dependent" -) + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` -func (*InstanceProfileVcpuDependent) isaInstanceProfileVcpu() bool { - return true -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// UnmarshalInstanceProfileVcpuDependent unmarshals an instance of InstanceProfileVcpuDependent from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` -// InstanceProfileVcpuEnum : The permitted values for VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The ICMP traffic code to match. + // + // If specified, `type` must also be specified. If unspecified, all codes are matched. + Code *int64 `json:"code,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The ICMP traffic type to match. + // + // If unspecified, all types are matched. + Type *int64 `json:"type,omitempty"` } -// Constants associated with the InstanceProfileVcpuEnum.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Action property. +// The action to perform for a packet matching the rule. const ( - InstanceProfileVcpuEnumTypeEnumConst = "enum" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" ) -func (*InstanceProfileVcpuEnum) isaInstanceProfileVcpu() bool { - return true -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" +) -// UnmarshalInstanceProfileVcpuEnum unmarshals an instance of InstanceProfileVcpuEnum from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" +) -// InstanceProfileVcpuFixed : The VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" +) - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the InstanceProfileVcpuFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileVcpuFixed) isaInstanceProfileVcpu() bool { +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { return true } -// UnmarshalInstanceProfileVcpuFixed unmarshals an instance of InstanceProfileVcpuFixed from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuRange : The permitted range for VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuRange.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuRangeTypeRangeConst = "range" -) - -func (*InstanceProfileVcpuRange) isaInstanceProfileVcpu() bool { - return true -} - -// UnmarshalInstanceProfileVcpuRange unmarshals an instance of InstanceProfileVcpuRange from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -86325,163 +99617,132 @@ func UnmarshalInstanceProfileVcpuRange(m map[string]json.RawMessage, result inte return } -// InstanceProfileVolumeBandwidthDependent : The storage bandwidth shared across the storage volumes of an instance with this profile depends on its -// configuration. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct +// This model "extends" NetworkACLRulePrototypeNetworkACLContext +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` -// Constants associated with the InstanceProfileVolumeBandwidthDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthDependentTypeDependentConst = "dependent" -) + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` -func (*InstanceProfileVolumeBandwidthDependent) isaInstanceProfileVolumeBandwidth() bool { - return true -} + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` -// UnmarshalInstanceProfileVolumeBandwidthDependent unmarshals an instance of InstanceProfileVolumeBandwidthDependent from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` -// InstanceProfileVolumeBandwidthEnum : The permitted storage bandwidth values (in megabits per second) shared across the storage volumes of an instance with -// this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` } -// Constants associated with the InstanceProfileVolumeBandwidthEnum.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Action property. +// The action to perform for a packet matching the rule. const ( - InstanceProfileVolumeBandwidthEnumTypeEnumConst = "enum" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" ) -func (*InstanceProfileVolumeBandwidthEnum) isaInstanceProfileVolumeBandwidth() bool { +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" +) + +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { return true } -// UnmarshalInstanceProfileVolumeBandwidthEnum unmarshals an instance of InstanceProfileVolumeBandwidthEnum from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthFixed : The storage bandwidth (in megabits per second) shared across the storage volumes of an instance with this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileVolumeBandwidthFixed) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthFixed unmarshals an instance of InstanceProfileVolumeBandwidthFixed from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthRange : The permitted storage bandwidth range (in megabits per second) shared across the storage volumes of an instance with -// this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthRange.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthRangeTypeRangeConst = "range" -) - -func (*InstanceProfileVolumeBandwidthRange) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthRange unmarshals an instance of InstanceProfileVolumeBandwidthRange from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) if err != nil { return } @@ -86489,182 +99750,237 @@ func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, return } -// InstancePrototypeInstanceByCatalogOffering : Create an instance by using a catalog offering. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByCatalogOffering struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` +// NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct +// This model "extends" NetworkACLRulePrototype +type NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` +} - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" +) - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" +) - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" +) - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" +) -// NewInstancePrototypeInstanceByCatalogOffering : Instantiate InstancePrototypeInstanceByCatalogOffering (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByCatalogOffering(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByCatalogOffering, err error) { - _model = &InstancePrototypeInstanceByCatalogOffering{ - CatalogOffering: catalogOffering, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototype() bool { +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototype() bool { return true } -// UnmarshalInstancePrototypeInstanceByCatalogOffering unmarshals an instance of InstancePrototypeInstanceByCatalogOffering from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByCatalogOffering) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct +// This model "extends" NetworkACLRulePrototype +type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` + + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` + + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` + + // The ICMP traffic code to match. + // + // If specified, `type` must also be specified. If unspecified, all codes are matched. + Code *int64 `json:"code,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The ICMP traffic type to match. + // + // If unspecified, all types are matched. + Type *int64 `json:"type,omitempty"` +} + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" +) + +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototype() bool { + return true +} + +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -86672,119 +99988,110 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe return } -// InstancePrototypeInstanceByImage : Create an instance by using an image. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByImage struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` +// NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct +// This model "extends" NetworkACLRulePrototype +type NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + // The IP version for this rule. + IPVersion *string `json:"ip_version,omitempty"` - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` +} - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" +) - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" +) - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" +) - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" + NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" +) -// NewInstancePrototypeInstanceByImage : Instantiate InstancePrototypeInstanceByImage (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByImage(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByImage, err error) { - _model = &InstancePrototypeInstanceByImage{ - Image: image, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePrototypeInstanceByImage) isaInstancePrototype() bool { +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototype() bool { return true } -// UnmarshalInstancePrototypeInstanceByImage unmarshals an instance of InstancePrototypeInstanceByImage from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByImage) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } @@ -86792,55 +100099,145 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRuleNetworkACLRuleProtocolAll : NetworkACLRuleNetworkACLRuleProtocolAll struct +// This model "extends" NetworkACLRule +type NetworkACLRuleNetworkACLRuleProtocolAll struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` + + // The rule that this rule is immediately before. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` + + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolAllActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolAllActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleNetworkACLRuleProtocolAllProtocolAllConst = "all" +) + +func (*NetworkACLRuleNetworkACLRuleProtocolAll) isaNetworkACLRule() bool { + return true +} + +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolAll from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolAll) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -86848,168 +100245,135 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res return } -// InstancePrototypeInstanceBySourceSnapshot : Create an instance by using a snapshot. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceBySourceSnapshot struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` +// NetworkACLRuleNetworkACLRuleProtocolIcmp : NetworkACLRuleNetworkACLRuleProtocolIcmp struct +// This model "extends" NetworkACLRule +type NetworkACLRuleNetworkACLRuleProtocolIcmp struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The rule that this rule is immediately before. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // The ICMP traffic code to match. + // + // If absent, all codes are matched. + Code *int64 `json:"code,omitempty"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The VPC this virtual server instance will reside in. + // The ICMP traffic type to match. // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + // If absent, all types are matched. + Type *int64 `json:"type,omitempty"` +} - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmpActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolIcmpActionDenyConst = "deny" +) - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" +) - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" +) -// NewInstancePrototypeInstanceBySourceSnapshot : Instantiate InstancePrototypeInstanceBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshot(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceBySourceSnapshot, err error) { - _model = &InstancePrototypeInstanceBySourceSnapshot{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" +) -func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototype() bool { +func (*NetworkACLRuleNetworkACLRuleProtocolIcmp) isaNetworkACLRule() bool { return true } -// UnmarshalInstancePrototypeInstanceBySourceSnapshot unmarshals an instance of InstancePrototypeInstanceBySourceSnapshot from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceSnapshot) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolIcmp from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolIcmp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -87017,198 +100381,228 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes return } -// InstancePrototypeInstanceBySourceTemplate : Create an instance by using an instance template. -// -// The `primary_network_interface` and `network_interfaces` properties may only be specified if -// `primary_network_interface` is specified in the source template. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceBySourceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` +// NetworkACLRuleNetworkACLRuleProtocolTcpudp : NetworkACLRuleNetworkACLRuleProtocolTcpudp struct +// This model "extends" NetworkACLRule +type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { + // The action to perform for a packet matching the rule. + Action *string `json:"action" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + // The rule that this rule is immediately before. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + Destination *string `json:"destination" validate:"required"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + Source *string `json:"source" validate:"required"` - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min" validate:"required"` } -// NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { - _model = &InstancePrototypeInstanceBySourceTemplate{ - SourceTemplate: sourceTemplate, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" +) -func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Protocol property. +// The protocol to enforce. +const ( + NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" + NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" +) + +func (*NetworkACLRuleNetworkACLRuleProtocolTcpudp) isaNetworkACLRule() bool { return true } -// UnmarshalInstancePrototypeInstanceBySourceTemplate unmarshals an instance of InstancePrototypeInstanceBySourceTemplate from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolTcpudp from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolTcpudp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkInterfaceIPPrototypeReservedIPIdentity : Identifies a reserved IP by a unique property. +// Models which "extend" this model: +// - NetworkInterfaceIPPrototypeReservedIPIdentityByID +// - NetworkInterfaceIPPrototypeReservedIPIdentityByHref +// This model "extends" NetworkInterfaceIPPrototype +type NetworkInterfaceIPPrototypeReservedIPIdentity struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` + + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} + +func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool { + return true +} + +type NetworkInterfaceIPPrototypeReservedIPIdentityIntf interface { + NetworkInterfaceIPPrototypeIntf + isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool +} + +func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototype() bool { + return true +} + +// UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPIdentity from the specified map of raw messages. +func UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceIPPrototypeReservedIPIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext : NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct +// This model "extends" NetworkInterfaceIPPrototype +type NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct { + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` + + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` +} + +func (*NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) isaNetworkInterfaceIPPrototype() bool { + return true +} + +// UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -87216,168 +100610,304 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes return } -// InstancePrototypeInstanceByVolume : Create an instance by using a boot volume. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByVolume struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` +// OperatingSystemIdentityByHref : OperatingSystemIdentityByHref struct +// This model "extends" OperatingSystemIdentity +type OperatingSystemIdentityByHref struct { + // The URL for this operating system. + Href *string `json:"href" validate:"required"` +} - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` +// NewOperatingSystemIdentityByHref : Instantiate OperatingSystemIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewOperatingSystemIdentityByHref(href string) (_model *OperatingSystemIdentityByHref, err error) { + _model = &OperatingSystemIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` +func (*OperatingSystemIdentityByHref) isaOperatingSystemIdentity() bool { + return true +} - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` +// UnmarshalOperatingSystemIdentityByHref unmarshals an instance of OperatingSystemIdentityByHref from the specified map of raw messages. +func UnmarshalOperatingSystemIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// OperatingSystemIdentityByName : OperatingSystemIdentityByName struct +// This model "extends" OperatingSystemIdentity +type OperatingSystemIdentityByName struct { + // The globally unique name for this operating system. + Name *string `json:"name" validate:"required"` +} - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` +// NewOperatingSystemIdentityByName : Instantiate OperatingSystemIdentityByName (Generic Model Constructor) +func (*VpcV1) NewOperatingSystemIdentityByName(name string) (_model *OperatingSystemIdentityByName, err error) { + _model = &OperatingSystemIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` +func (*OperatingSystemIdentityByName) isaOperatingSystemIdentity() bool { + return true +} - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` +// UnmarshalOperatingSystemIdentityByName unmarshals an instance of OperatingSystemIdentityByName from the specified map of raw messages. +func UnmarshalOperatingSystemIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` +// PublicGatewayFloatingIPPrototypeFloatingIPIdentity : Identifies a floating IP by a unique property. +// Models which "extend" this model: +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress +// This model "extends" PublicGatewayFloatingIPPrototype +type PublicGatewayFloatingIPPrototypeFloatingIPIdentity struct { + // The unique identifier for this floating IP. + ID *string `json:"id,omitempty"` - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + // The CRN for this floating IP. + CRN *string `json:"crn,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The URL for this floating IP. + Href *string `json:"href,omitempty"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + // The globally unique IP address. + Address *string `json:"address,omitempty"` +} - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` +func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { + return true } -// NewInstancePrototypeInstanceByVolume : Instantiate InstancePrototypeInstanceByVolume (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolume(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByVolume, err error) { - _model = &InstancePrototypeInstanceByVolume{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return +type PublicGatewayFloatingIPPrototypeFloatingIPIdentityIntf interface { + PublicGatewayFloatingIPPrototypeIntf + isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool } -func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { +func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototype() bool { return true } -// UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByVolume) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentity from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext : PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct +// This model "extends" PublicGatewayFloatingIPPrototype +type PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct { + // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +} + +func (*PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) isaPublicGatewayFloatingIPPrototype() bool { + return true +} + +// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayIdentityPublicGatewayIdentityByCRN : PublicGatewayIdentityPublicGatewayIdentityByCRN struct +// This model "extends" PublicGatewayIdentity +type PublicGatewayIdentityPublicGatewayIdentityByCRN struct { + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` +} + +// NewPublicGatewayIdentityPublicGatewayIdentityByCRN : Instantiate PublicGatewayIdentityPublicGatewayIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByCRN(crn string) (_model *PublicGatewayIdentityPublicGatewayIdentityByCRN, err error) { + _model = &PublicGatewayIdentityPublicGatewayIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*PublicGatewayIdentityPublicGatewayIdentityByCRN) isaPublicGatewayIdentity() bool { + return true +} + +// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByCRN from the specified map of raw messages. +func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayIdentityPublicGatewayIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayIdentityPublicGatewayIdentityByHref : PublicGatewayIdentityPublicGatewayIdentityByHref struct +// This model "extends" PublicGatewayIdentity +type PublicGatewayIdentityPublicGatewayIdentityByHref struct { + // The URL for this public gateway. + Href *string `json:"href" validate:"required"` +} + +// NewPublicGatewayIdentityPublicGatewayIdentityByHref : Instantiate PublicGatewayIdentityPublicGatewayIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByHref(href string) (_model *PublicGatewayIdentityPublicGatewayIdentityByHref, err error) { + _model = &PublicGatewayIdentityPublicGatewayIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*PublicGatewayIdentityPublicGatewayIdentityByHref) isaPublicGatewayIdentity() bool { + return true +} + +// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByHref from the specified map of raw messages. +func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayIdentityPublicGatewayIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayIdentityPublicGatewayIdentityByID : PublicGatewayIdentityPublicGatewayIdentityByID struct +// This model "extends" PublicGatewayIdentity +type PublicGatewayIdentityPublicGatewayIdentityByID struct { + // The unique identifier for this public gateway. + ID *string `json:"id" validate:"required"` +} + +// NewPublicGatewayIdentityPublicGatewayIdentityByID : Instantiate PublicGatewayIdentityPublicGatewayIdentityByID (Generic Model Constructor) +func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByID(id string) (_model *PublicGatewayIdentityPublicGatewayIdentityByID, err error) { + _model = &PublicGatewayIdentityPublicGatewayIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*PublicGatewayIdentityPublicGatewayIdentityByID) isaPublicGatewayIdentity() bool { + return true +} + +// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByID from the specified map of raw messages. +func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayIdentityPublicGatewayIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RegionIdentityByHref : RegionIdentityByHref struct +// This model "extends" RegionIdentity +type RegionIdentityByHref struct { + // The URL for this region. + Href *string `json:"href" validate:"required"` +} + +// NewRegionIdentityByHref : Instantiate RegionIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewRegionIdentityByHref(href string) (_model *RegionIdentityByHref, err error) { + _model = &RegionIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*RegionIdentityByHref) isaRegionIdentity() bool { + return true +} + +// UnmarshalRegionIdentityByHref unmarshals an instance of RegionIdentityByHref from the specified map of raw messages. +func UnmarshalRegionIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RegionIdentityByName : RegionIdentityByName struct +// This model "extends" RegionIdentity +type RegionIdentityByName struct { + // The globally unique name for this region. + Name *string `json:"name" validate:"required"` +} + +// NewRegionIdentityByName : Instantiate RegionIdentityByName (Generic Model Constructor) +func (*VpcV1) NewRegionIdentityByName(name string) (_model *RegionIdentityByName, err error) { + _model = &RegionIdentityByName{ + Name: core.StringPtr(name), } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*RegionIdentityByName) isaRegionIdentity() bool { + return true +} + +// UnmarshalRegionIdentityByName unmarshals an instance of RegionIdentityByName from the specified map of raw messages. +func UnmarshalRegionIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -87385,29 +100915,29 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re return } -// InstanceTemplateIdentityByCRN : InstanceTemplateIdentityByCRN struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByCRN struct { - // The CRN for this instance template. +// ReservationIdentityByCRN : ReservationIdentityByCRN struct +// This model "extends" ReservationIdentity +type ReservationIdentityByCRN struct { + // The CRN for this reservation. CRN *string `json:"crn" validate:"required"` } -// NewInstanceTemplateIdentityByCRN : Instantiate InstanceTemplateIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByCRN(crn string) (_model *InstanceTemplateIdentityByCRN, err error) { - _model = &InstanceTemplateIdentityByCRN{ +// NewReservationIdentityByCRN : Instantiate ReservationIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByCRN(crn string) (_model *ReservationIdentityByCRN, err error) { + _model = &ReservationIdentityByCRN{ CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstanceTemplateIdentityByCRN) isaInstanceTemplateIdentity() bool { +func (*ReservationIdentityByCRN) isaReservationIdentity() bool { return true } -// UnmarshalInstanceTemplateIdentityByCRN unmarshals an instance of InstanceTemplateIdentityByCRN from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByCRN) +// UnmarshalReservationIdentityByCRN unmarshals an instance of ReservationIdentityByCRN from the specified map of raw messages. +func UnmarshalReservationIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -87416,29 +100946,29 @@ func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result return } -// InstanceTemplateIdentityByHref : InstanceTemplateIdentityByHref struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByHref struct { - // The URL for this instance template. +// ReservationIdentityByHref : ReservationIdentityByHref struct +// This model "extends" ReservationIdentity +type ReservationIdentityByHref struct { + // The URL for this reservation. Href *string `json:"href" validate:"required"` } -// NewInstanceTemplateIdentityByHref : Instantiate InstanceTemplateIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByHref(href string) (_model *InstanceTemplateIdentityByHref, err error) { - _model = &InstanceTemplateIdentityByHref{ +// NewReservationIdentityByHref : Instantiate ReservationIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByHref(href string) (_model *ReservationIdentityByHref, err error) { + _model = &ReservationIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstanceTemplateIdentityByHref) isaInstanceTemplateIdentity() bool { +func (*ReservationIdentityByHref) isaReservationIdentity() bool { return true } -// UnmarshalInstanceTemplateIdentityByHref unmarshals an instance of InstanceTemplateIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByHref) +// UnmarshalReservationIdentityByHref unmarshals an instance of ReservationIdentityByHref from the specified map of raw messages. +func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -87447,29 +100977,29 @@ func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, resul return } -// InstanceTemplateIdentityByID : InstanceTemplateIdentityByID struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByID struct { - // The unique identifier for this instance template. +// ReservationIdentityByID : ReservationIdentityByID struct +// This model "extends" ReservationIdentity +type ReservationIdentityByID struct { + // The unique identifier for this reservation. ID *string `json:"id" validate:"required"` } -// NewInstanceTemplateIdentityByID : Instantiate InstanceTemplateIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByID(id string) (_model *InstanceTemplateIdentityByID, err error) { - _model = &InstanceTemplateIdentityByID{ +// NewReservationIdentityByID : Instantiate ReservationIdentityByID (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByID(id string) (_model *ReservationIdentityByID, err error) { + _model = &ReservationIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstanceTemplateIdentityByID) isaInstanceTemplateIdentity() bool { +func (*ReservationIdentityByID) isaReservationIdentity() bool { return true } -// UnmarshalInstanceTemplateIdentityByID unmarshals an instance of InstanceTemplateIdentityByID from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByID) +// UnmarshalReservationIdentityByID unmarshals an instance of ReservationIdentityByID from the specified map of raw messages. +func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -87478,124 +101008,33 @@ func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result return } -// InstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Create an instance template that creates instances by using a catalog offering. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// ReservationProfileInstanceProfileReference : ReservationProfileInstanceProfileReference struct +// This model "extends" ReservationProfile +type ReservationProfileInstanceProfileReference struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOffering (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOffering, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOffering{ - CatalogOffering: catalogOffering, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the ReservationProfileInstanceProfileReference.ResourceType property. +// The resource type. +const ( + ReservationProfileInstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" +) -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototype() bool { +func (*ReservationProfileInstanceProfileReference) isaReservationProfile() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) +// UnmarshalReservationProfileInstanceProfileReference unmarshals an instance of ReservationProfileInstanceProfileReference from the specified map of raw messages. +func UnmarshalReservationProfileInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfileInstanceProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -87603,55 +101042,171 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetPrototypeEndpointGatewayIdentity : ReservedIPTargetPrototypeEndpointGatewayIdentity struct +// Models which "extend" this model: +// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID +// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN +// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref +// This model "extends" ReservedIPTargetPrototype +type ReservedIPTargetPrototypeEndpointGatewayIdentity struct { + // The unique identifier for this endpoint gateway. + ID *string `json:"id,omitempty"` + + // The CRN for this endpoint gateway. + CRN *string `json:"crn,omitempty"` + + // The URL for this endpoint gateway. + Href *string `json:"href,omitempty"` +} + +func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { + return true +} + +type ReservedIPTargetPrototypeEndpointGatewayIdentityIntf interface { + ReservedIPTargetPrototypeIntf + isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool +} + +func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototype() bool { + return true +} + +// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentity from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. +// Models which "extend" this model: +// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" ReservedIPTargetPrototype +type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` + + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { + ReservedIPTargetPrototypeIntf + isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaReservedIPTargetPrototype() bool { + return true +} + +// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext : ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` + + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this bare metal server network interface. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. +// The resource type. +const ( + ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. +func UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -87659,117 +101214,55 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s return } -// InstanceTemplatePrototypeInstanceTemplateByImage : Create an instance template that creates instances by using an image. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByImage struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` +// ReservedIPTargetEndpointGatewayReference : ReservedIPTargetEndpointGatewayReference struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetEndpointGatewayReference struct { + // The CRN for this endpoint gateway. + CRN *string `json:"crn" validate:"required"` - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` + // The URL for this endpoint gateway. + Href *string `json:"href" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The unique identifier for this endpoint gateway. + ID *string `json:"id" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. + Name *string `json:"name" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateByImage : Instantiate InstanceTemplatePrototypeInstanceTemplateByImage (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImage(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateByImage, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByImage{ - Image: image, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the ReservedIPTargetEndpointGatewayReference.ResourceType property. +// The resource type. +const ( + ReservedIPTargetEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" +) -func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototype() bool { +func (*ReservedIPTargetEndpointGatewayReference) isaReservedIPTarget() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalReservedIPTargetEndpointGatewayReference unmarshals an instance of ReservedIPTargetEndpointGatewayReference from the specified map of raw messages. +func UnmarshalReservedIPTargetEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetEndpointGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -87777,55 +101270,180 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetGenericResourceReference : Identifying information for a resource that is not native to the VPC API. +// This model "extends" ReservedIPTarget +type ReservedIPTargetGenericResourceReference struct { + // The CRN for the resource. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *GenericResourceReferenceDeleted `json:"deleted,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetGenericResourceReference.ResourceType property. +// The resource type. +const ( + ReservedIPTargetGenericResourceReferenceResourceTypeCloudResourceConst = "cloud_resource" +) + +func (*ReservedIPTargetGenericResourceReference) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetGenericResourceReference unmarshals an instance of ReservedIPTargetGenericResourceReference from the specified map of raw messages. +func UnmarshalReservedIPTargetGenericResourceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetGenericResourceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalGenericResourceReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetLoadBalancerReference : ReservedIPTargetLoadBalancerReference struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetLoadBalancerReference struct { + // The load balancer's CRN. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` + + // The load balancer's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer. + ID *string `json:"id" validate:"required"` + + // The name for this load balancer. The name is unique across all load balancers in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetLoadBalancerReference.ResourceType property. +// The resource type. +const ( + ReservedIPTargetLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" +) + +func (*ReservedIPTargetLoadBalancerReference) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetLoadBalancerReference unmarshals an instance of ReservedIPTargetLoadBalancerReference from the specified map of raw messages. +func UnmarshalReservedIPTargetLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetLoadBalancerReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetNetworkInterfaceReferenceTargetContext : ReservedIPTargetNetworkInterfaceReferenceTargetContext struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetNetworkInterfaceReferenceTargetContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` + + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this instance network interface. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetNetworkInterfaceReferenceTargetContext.ResourceType property. +// The resource type. +const ( + ReservedIPTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*ReservedIPTargetNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. +func UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetNetworkInterfaceReferenceTargetContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -87833,114 +101451,55 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json return } -// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Create an instance template that creates instances by using a snapshot. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` +// ReservedIPTargetVPNGatewayReference : ReservedIPTargetVPNGatewayReference struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetVPNGatewayReference struct { + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + // The VPN gateway's canonical URL. + Href *string `json:"href" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + Name *string `json:"name" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the ReservedIPTargetVPNGatewayReference.ResourceType property. +// The resource type. +const ( + ReservedIPTargetVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" +) -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototype() bool { +func (*ReservedIPTargetVPNGatewayReference) isaReservedIPTarget() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalReservedIPTargetVPNGatewayReference unmarshals an instance of ReservedIPTargetVPNGatewayReference from the specified map of raw messages. +func UnmarshalReservedIPTargetVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetVPNGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -87948,51 +101507,127 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetVPNServerReference : ReservedIPTargetVPNServerReference struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetVPNServerReference struct { + // The CRN for this VPN server. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this VPN server. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPN server. + ID *string `json:"id" validate:"required"` + + // The name for this VPN server. The name is unique across all VPN servers in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetVPNServerReference.ResourceType property. +// The resource type. +const ( + ReservedIPTargetVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" +) + +func (*ReservedIPTargetVPNServerReference) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetVPNServerReference unmarshals an instance of ReservedIPTargetVPNServerReference from the specified map of raw messages. +func UnmarshalReservedIPTargetVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetVPNServerReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext : ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct +// This model "extends" ReservedIPTarget +type ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` + + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` + + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.ResourceType property. +// The resource type. +const ( + ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" +) + +func (*ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) isaReservedIPTarget() bool { + return true +} + +// UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext unmarshals an instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext from the specified map of raw messages. +func UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -88000,129 +101635,86 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st return } -// InstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Create an instance template from an existing instance template. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` +// ResourceGroupIdentityByID : ResourceGroupIdentityByID struct +// This model "extends" ResourceGroupIdentity +type ResourceGroupIdentityByID struct { + // The unique identifier for this resource group. + ID *string `json:"id" validate:"required"` +} - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` +// NewResourceGroupIdentityByID : Instantiate ResourceGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewResourceGroupIdentityByID(id string) (_model *ResourceGroupIdentityByID, err error) { + _model = &ResourceGroupIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` +func (*ResourceGroupIdentityByID) isaResourceGroupIdentity() bool { + return true +} - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` +// UnmarshalResourceGroupIdentityByID unmarshals an instance of ResourceGroupIdentityByID from the specified map of raw messages. +func UnmarshalResourceGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` +// RouteCreatorVPNGatewayReference : RouteCreatorVPNGatewayReference struct +// This model "extends" RouteCreator +type RouteCreatorVPNGatewayReference struct { + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The VPN gateway's canonical URL. + Href *string `json:"href" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + Name *string `json:"name" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceTemplate (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceTemplate, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceTemplate{ - SourceTemplate: sourceTemplate, - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// Constants associated with the RouteCreatorVPNGatewayReference.ResourceType property. +// The resource type. +const ( + RouteCreatorVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" +) -func (*InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) isaInstanceTemplatePrototype() bool { +func (*RouteCreatorVPNGatewayReference) isaRouteCreator() bool { return true } -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalRouteCreatorVPNGatewayReference unmarshals an instance of RouteCreatorVPNGatewayReference from the specified map of raw messages. +func UnmarshalRouteCreatorVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCreatorVPNGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -88130,63 +101722,71 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCreatorVPNServerReference : RouteCreatorVPNServerReference struct +// This model "extends" RouteCreator +type RouteCreatorVPNServerReference struct { + // The CRN for this VPN server. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this VPN server. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPN server. + ID *string `json:"id" validate:"required"` + + // The name for this VPN server. The name is unique across all VPN servers in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the RouteCreatorVPNServerReference.ResourceType property. +// The resource type. +const ( + RouteCreatorVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" +) + +func (*RouteCreatorVPNServerReference) isaRouteCreator() bool { + return true +} + +// UnmarshalRouteCreatorVPNServerReference unmarshals an instance of RouteCreatorVPNServerReference from the specified map of raw messages. +func UnmarshalRouteCreatorVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCreatorVPNServerReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -88194,197 +101794,476 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st return } -// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext : Create an instance by using a catalog offering. -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance +// RouteNextHopIP : RouteNextHopIP struct +// This model "extends" RouteNextHop +type RouteNextHopIP struct { + // The IP address. // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} - // The URL for this instance template. - Href *string `json:"href" validate:"required"` +func (*RouteNextHopIP) isaRouteNextHop() bool { + return true +} - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` +// UnmarshalRouteNextHopIP unmarshals an instance of RouteNextHopIP from the specified map of raw messages. +func UnmarshalRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. +// RouteNextHopPatchRouteNextHopIP : RouteNextHopPatchRouteNextHopIP struct +// Models which "extend" this model: +// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP +// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP +// This model "extends" RouteNextHopPatch +type RouteNextHopPatchRouteNextHopIP struct { + // The sentinel IP address (`0.0.0.0`). // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` +} - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` +func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatchRouteNextHopIP() bool { + return true +} - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` +type RouteNextHopPatchRouteNextHopIPIntf interface { + RouteNextHopPatchIntf + isaRouteNextHopPatchRouteNextHopIP() bool +} - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` +func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatch() bool { + return true +} - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` +// UnmarshalRouteNextHopPatchRouteNextHopIP unmarshals an instance of RouteNextHopPatchRouteNextHopIP from the specified map of raw messages. +func UnmarshalRouteNextHopPatchRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopPatchRouteNextHopIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` +// RouteNextHopPatchVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. +// Models which "extend" this model: +// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID +// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref +// This model "extends" RouteNextHopPatch +type RouteNextHopPatchVPNGatewayConnectionIdentity struct { + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` +} - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` +func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool { + return true +} - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` +type RouteNextHopPatchVPNGatewayConnectionIdentityIntf interface { + RouteNextHopPatchIntf + isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool +} - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` +func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatch() bool { + return true +} - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` +// UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity unmarshals an instance of RouteNextHopPatchVPNGatewayConnectionIdentity from the specified map of raw messages. +func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopPatchVPNGatewayConnectionIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` +// RouteNextHopVPNGatewayConnectionReference : RouteNextHopVPNGatewayConnectionReference struct +// This model "extends" RouteNextHop +type RouteNextHopVPNGatewayConnectionReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + // The VPN connection's canonical URL. + Href *string `json:"href" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id" validate:"required"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + Name *string `json:"name" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplate() bool { +// Constants associated with the RouteNextHopVPNGatewayConnectionReference.ResourceType property. +// The resource type. +const ( + RouteNextHopVPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) + +func (*RouteNextHopVPNGatewayConnectionReference) isaRouteNextHop() bool { return true } -// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) +// UnmarshalRouteNextHopVPNGatewayConnectionReference unmarshals an instance of RouteNextHopVPNGatewayConnectionReference from the specified map of raw messages. +func UnmarshalRouteNextHopVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopVPNGatewayConnectionReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP : RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct +// Models which "extend" this model: +// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP +// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP +// This model "extends" RoutePrototypeNextHop +type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct { + // The sentinel IP address (`0.0.0.0`). + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` +} + +func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool { + return true +} + +type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPIntf interface { + RoutePrototypeNextHopIntf + isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool +} + +func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHop() bool { + return true +} + +// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP from the specified map of raw messages. +func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. +// Models which "extend" this model: +// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID +// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref +// This model "extends" RoutePrototypeNextHop +type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity struct { + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` + + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool { + return true +} + +type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityIntf interface { + RoutePrototypeNextHopIntf + isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool +} + +func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHop() bool { + return true +} + +// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity from the specified map of raw messages. +func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoutingTableIdentityByHref : RoutingTableIdentityByHref struct +// This model "extends" RoutingTableIdentity +type RoutingTableIdentityByHref struct { + // The URL for this routing table. + Href *string `json:"href" validate:"required"` +} + +// NewRoutingTableIdentityByHref : Instantiate RoutingTableIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewRoutingTableIdentityByHref(href string) (_model *RoutingTableIdentityByHref, err error) { + _model = &RoutingTableIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*RoutingTableIdentityByHref) isaRoutingTableIdentity() bool { + return true +} + +// UnmarshalRoutingTableIdentityByHref unmarshals an instance of RoutingTableIdentityByHref from the specified map of raw messages. +func UnmarshalRoutingTableIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoutingTableIdentityByID : RoutingTableIdentityByID struct +// This model "extends" RoutingTableIdentity +type RoutingTableIdentityByID struct { + // The unique identifier for this routing table. + ID *string `json:"id" validate:"required"` +} + +// NewRoutingTableIdentityByID : Instantiate RoutingTableIdentityByID (Generic Model Constructor) +func (*VpcV1) NewRoutingTableIdentityByID(id string) (_model *RoutingTableIdentityByID, err error) { + _model = &RoutingTableIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*RoutingTableIdentityByID) isaRoutingTableIdentity() bool { + return true +} + +// UnmarshalRoutingTableIdentityByID unmarshals an instance of RoutingTableIdentityByID from the specified map of raw messages. +func UnmarshalRoutingTableIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupIdentityByCRN : SecurityGroupIdentityByCRN struct +// This model "extends" SecurityGroupIdentity +type SecurityGroupIdentityByCRN struct { + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` +} + +// NewSecurityGroupIdentityByCRN : Instantiate SecurityGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupIdentityByCRN(crn string) (_model *SecurityGroupIdentityByCRN, err error) { + _model = &SecurityGroupIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupIdentityByCRN) isaSecurityGroupIdentity() bool { + return true +} + +// UnmarshalSecurityGroupIdentityByCRN unmarshals an instance of SecurityGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalSecurityGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupIdentityByHref : SecurityGroupIdentityByHref struct +// This model "extends" SecurityGroupIdentity +type SecurityGroupIdentityByHref struct { + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` +} + +// NewSecurityGroupIdentityByHref : Instantiate SecurityGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupIdentityByHref(href string) (_model *SecurityGroupIdentityByHref, err error) { + _model = &SecurityGroupIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupIdentityByHref) isaSecurityGroupIdentity() bool { + return true +} + +// UnmarshalSecurityGroupIdentityByHref unmarshals an instance of SecurityGroupIdentityByHref from the specified map of raw messages. +func UnmarshalSecurityGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupIdentityByID : SecurityGroupIdentityByID struct +// This model "extends" SecurityGroupIdentity +type SecurityGroupIdentityByID struct { + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` +} + +// NewSecurityGroupIdentityByID : Instantiate SecurityGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupIdentityByID(id string) (_model *SecurityGroupIdentityByID, err error) { + _model = &SecurityGroupIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupIdentityByID) isaSecurityGroupIdentity() bool { + return true +} + +// UnmarshalSecurityGroupIdentityByID unmarshals an instance of SecurityGroupIdentityByID from the specified map of raw messages. +func UnmarshalSecurityGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The remote IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group within the VPC. + // + // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + // (or to any destination, for outbound rules). + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` +} + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllProtocolAllConst = "all" +) + +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) isaSecurityGroupRulePrototype() bool { + return true +} + +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) if err != nil { return } @@ -88392,190 +102271,98 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m return } -// InstanceTemplateInstanceByImageInstanceTemplateContext : Create an instance by using an image. -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceByImageInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp struct { + // The ICMP traffic code to allow. // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` + // If specified, `type` must also be specified. If unspecified, all codes are allowed. + Code *int64 `json:"code,omitempty"` - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // The remote IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group within the VPC. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + // (or to any destination, for outbound rules). + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` - // The VPC this virtual server instance will reside in. + // The ICMP traffic type to allow. // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // If unspecified, all types are allowed. + Type *int64 `json:"type,omitempty"` +} - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" +) - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" +) - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" +) - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplate() bool { +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) isaSecurityGroupRulePrototype() bool { return true } -// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByImageInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -88583,183 +102370,221 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin return } -// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext : Create an instance by using a snapshot. -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. +// +// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are +// allowed for the protocol. When both have the same value, that single destination port is allowed. +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` - // The placement restrictions to use for the virtual server instance. + // The inclusive upper bound of TCP/UDP destination port range. // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // If specified, `port_min` must also be specified, and must not be larger. If unspecified, + // `port_min` must also be unspecified, allowing traffic on all destination ports. + PortMax *int64 `json:"port_max,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // The inclusive lower bound of TCP/UDP destination port range // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` + // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be + // unspecified, allowing traffic on all destination ports. + PortMin *int64 `json:"port_min,omitempty"` - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` - // The VPC this virtual server instance will reside in. + // The remote IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group within the VPC. // - // If specified, it must match the VPC for the subnets of the instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source + // (or to any destination, for outbound rules). + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` +} - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" +) - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" +) - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" +) - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplate() bool { +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRulePrototype() bool { return true } -// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { return } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleRemotePatchCIDR : SecurityGroupRuleRemotePatchCIDR struct +// This model "extends" SecurityGroupRuleRemotePatch +type SecurityGroupRuleRemotePatchCIDR struct { + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block" validate:"required"` +} + +// NewSecurityGroupRuleRemotePatchCIDR : Instantiate SecurityGroupRuleRemotePatchCIDR (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePatchCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePatchCIDR, err error) { + _model = &SecurityGroupRuleRemotePatchCIDR{ + CIDRBlock: core.StringPtr(cidrBlock), } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupRuleRemotePatchCIDR) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePatchCIDR unmarshals an instance of SecurityGroupRuleRemotePatchCIDR from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatchCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatchCIDR) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleRemotePatchIP : SecurityGroupRuleRemotePatchIP struct +// This model "extends" SecurityGroupRuleRemotePatch +type SecurityGroupRuleRemotePatchIP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} + +// NewSecurityGroupRuleRemotePatchIP : Instantiate SecurityGroupRuleRemotePatchIP (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePatchIP(address string) (_model *SecurityGroupRuleRemotePatchIP, err error) { + _model = &SecurityGroupRuleRemotePatchIP{ + Address: core.StringPtr(address), } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SecurityGroupRuleRemotePatchIP) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePatchIP unmarshals an instance of SecurityGroupRuleRemotePatchIP from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatchIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatchIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleRemotePatchSecurityGroupIdentity : Identifies a security group by a unique property. +// Models which "extend" this model: +// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID +// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN +// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref +// This model "extends" SecurityGroupRuleRemotePatch +type SecurityGroupRuleRemotePatchSecurityGroupIdentity struct { + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` + + // The security group's CRN. + CRN *string `json:"crn,omitempty"` + + // The security group's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { + return true +} + +type SecurityGroupRuleRemotePatchSecurityGroupIdentityIntf interface { + SecurityGroupRuleRemotePatchIntf + isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool +} + +func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentity from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -88767,30 +102592,32 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m return } -// KeyIdentityByCRN : KeyIdentityByCRN struct -// This model "extends" KeyIdentity -type KeyIdentityByCRN struct { - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` +// SecurityGroupRuleRemotePrototypeCIDR : SecurityGroupRuleRemotePrototypeCIDR struct +// This model "extends" SecurityGroupRuleRemotePrototype +type SecurityGroupRuleRemotePrototypeCIDR struct { + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block" validate:"required"` } -// NewKeyIdentityByCRN : Instantiate KeyIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByCRN(crn string) (_model *KeyIdentityByCRN, err error) { - _model = &KeyIdentityByCRN{ - CRN: core.StringPtr(crn), +// NewSecurityGroupRuleRemotePrototypeCIDR : Instantiate SecurityGroupRuleRemotePrototypeCIDR (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePrototypeCIDR, err error) { + _model = &SecurityGroupRuleRemotePrototypeCIDR{ + CIDRBlock: core.StringPtr(cidrBlock), } err = core.ValidateStruct(_model, "required parameters") return } -func (*KeyIdentityByCRN) isaKeyIdentity() bool { +func (*SecurityGroupRuleRemotePrototypeCIDR) isaSecurityGroupRuleRemotePrototype() bool { return true } -// UnmarshalKeyIdentityByCRN unmarshals an instance of KeyIdentityByCRN from the specified map of raw messages. -func UnmarshalKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalSecurityGroupRuleRemotePrototypeCIDR unmarshals an instance of SecurityGroupRuleRemotePrototypeCIDR from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeCIDR) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } @@ -88798,31 +102625,34 @@ func UnmarshalKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) return } -// KeyIdentityByFingerprint : KeyIdentityByFingerprint struct -// This model "extends" KeyIdentity -type KeyIdentityByFingerprint struct { - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` +// SecurityGroupRuleRemotePrototypeIP : SecurityGroupRuleRemotePrototypeIP struct +// This model "extends" SecurityGroupRuleRemotePrototype +type SecurityGroupRuleRemotePrototypeIP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` } -// NewKeyIdentityByFingerprint : Instantiate KeyIdentityByFingerprint (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByFingerprint(fingerprint string) (_model *KeyIdentityByFingerprint, err error) { - _model = &KeyIdentityByFingerprint{ - Fingerprint: core.StringPtr(fingerprint), +// NewSecurityGroupRuleRemotePrototypeIP : Instantiate SecurityGroupRuleRemotePrototypeIP (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePrototypeIP(address string) (_model *SecurityGroupRuleRemotePrototypeIP, err error) { + _model = &SecurityGroupRuleRemotePrototypeIP{ + Address: core.StringPtr(address), } err = core.ValidateStruct(_model, "required parameters") return } -func (*KeyIdentityByFingerprint) isaKeyIdentity() bool { +func (*SecurityGroupRuleRemotePrototypeIP) isaSecurityGroupRuleRemotePrototype() bool { return true } -// UnmarshalKeyIdentityByFingerprint unmarshals an instance of KeyIdentityByFingerprint from the specified map of raw messages. -func UnmarshalKeyIdentityByFingerprint(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByFingerprint) - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) +// UnmarshalSecurityGroupRuleRemotePrototypeIP unmarshals an instance of SecurityGroupRuleRemotePrototypeIP from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -88830,29 +102660,47 @@ func UnmarshalKeyIdentityByFingerprint(m map[string]json.RawMessage, result inte return } -// KeyIdentityByHref : KeyIdentityByHref struct -// This model "extends" KeyIdentity -type KeyIdentityByHref struct { - // The URL for this key. - Href *string `json:"href" validate:"required"` +// SecurityGroupRuleRemotePrototypeSecurityGroupIdentity : Identifies a security group by a unique property. +// Models which "extend" this model: +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref +// This model "extends" SecurityGroupRuleRemotePrototype +type SecurityGroupRuleRemotePrototypeSecurityGroupIdentity struct { + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` + + // The security group's CRN. + CRN *string `json:"crn,omitempty"` + + // The security group's canonical URL. + Href *string `json:"href,omitempty"` } -// NewKeyIdentityByHref : Instantiate KeyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByHref(href string) (_model *KeyIdentityByHref, err error) { - _model = &KeyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { + return true } -func (*KeyIdentityByHref) isaKeyIdentity() bool { +type SecurityGroupRuleRemotePrototypeSecurityGroupIdentityIntf interface { + SecurityGroupRuleRemotePrototypeIntf + isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool +} + +func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototype() bool { return true } -// UnmarshalKeyIdentityByHref unmarshals an instance of KeyIdentityByHref from the specified map of raw messages. -func UnmarshalKeyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByHref) +// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentity from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -88861,30 +102709,49 @@ func UnmarshalKeyIdentityByHref(m map[string]json.RawMessage, result interface{} return } -// KeyIdentityByID : KeyIdentityByID struct -// This model "extends" KeyIdentity -type KeyIdentityByID struct { - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` +// SecurityGroupRuleRemoteCIDR : SecurityGroupRuleRemoteCIDR struct +// This model "extends" SecurityGroupRuleRemote +type SecurityGroupRuleRemoteCIDR struct { + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block" validate:"required"` } -// NewKeyIdentityByID : Instantiate KeyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByID(id string) (_model *KeyIdentityByID, err error) { - _model = &KeyIdentityByID{ - ID: core.StringPtr(id), +func (*SecurityGroupRuleRemoteCIDR) isaSecurityGroupRuleRemote() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemoteCIDR unmarshals an instance of SecurityGroupRuleRemoteCIDR from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemoteCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemoteCIDR) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*KeyIdentityByID) isaKeyIdentity() bool { +// SecurityGroupRuleRemoteIP : SecurityGroupRuleRemoteIP struct +// This model "extends" SecurityGroupRuleRemote +type SecurityGroupRuleRemoteIP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} + +func (*SecurityGroupRuleRemoteIP) isaSecurityGroupRuleRemote() bool { return true } -// UnmarshalKeyIdentityByID unmarshals an instance of KeyIdentityByID from the specified map of raw messages. -func UnmarshalKeyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSecurityGroupRuleRemoteIP unmarshals an instance of SecurityGroupRuleRemoteIP from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemoteIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemoteIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -88892,29 +102759,49 @@ func UnmarshalKeyIdentityByID(m map[string]json.RawMessage, result interface{}) return } -// LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct -// This model "extends" LegacyCloudObjectStorageBucketIdentity -type LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} +// SecurityGroupRuleRemoteSecurityGroupReference : SecurityGroupRuleRemoteSecurityGroupReference struct +// This model "extends" SecurityGroupRuleRemote +type SecurityGroupRuleRemoteSecurityGroupReference struct { + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` -// NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { - _model = &LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` + + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` + + // The name for this security group. The name is unique across all security groups for the VPC. + Name *string `json:"name" validate:"required"` } -func (*LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaLegacyCloudObjectStorageBucketIdentity() bool { +func (*SecurityGroupRuleRemoteSecurityGroupReference) isaSecurityGroupRuleRemote() bool { return true } -// UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) +// UnmarshalSecurityGroupRuleRemoteSecurityGroupReference unmarshals an instance of SecurityGroupRuleRemoteSecurityGroupReference from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemoteSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemoteSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -88923,30 +102810,78 @@ func UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIden return } -// LoadBalancerIdentityByCRN : LoadBalancerIdentityByCRN struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByCRN struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` -} +// SecurityGroupRuleSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. +// This model "extends" SecurityGroupRule +type SecurityGroupRuleSecurityGroupRuleProtocolAll struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` -// NewLoadBalancerIdentityByCRN : Instantiate LoadBalancerIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByCRN(crn string) (_model *LoadBalancerIdentityByCRN, err error) { - _model = &LoadBalancerIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` } -func (*LoadBalancerIdentityByCRN) isaLoadBalancerIdentity() bool { +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" + SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolAllProtocolAllConst = "all" +) + +func (*SecurityGroupRuleSecurityGroupRuleProtocolAll) isaSecurityGroupRule() bool { return true } -// UnmarshalLoadBalancerIdentityByCRN unmarshals an instance of LoadBalancerIdentityByCRN from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolAll from the specified map of raw messages. +func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleSecurityGroupRuleProtocolAll) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -88954,61 +102889,189 @@ func UnmarshalLoadBalancerIdentityByCRN(m map[string]json.RawMessage, result int return } -// LoadBalancerIdentityByHref : LoadBalancerIdentityByHref struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByHref struct { - // The load balancer's canonical URL. +// SecurityGroupRuleSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. +// This model "extends" SecurityGroupRule +type SecurityGroupRuleSecurityGroupRuleProtocolIcmp struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` + + // The URL for this security group rule. Href *string `json:"href" validate:"required"` -} -// NewLoadBalancerIdentityByHref : Instantiate LoadBalancerIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByHref(href string) (_model *LoadBalancerIdentityByHref, err error) { - _model = &LoadBalancerIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The ICMP traffic code to allow. If absent, all codes are allowed. + Code *int64 `json:"code,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The ICMP traffic type to allow. If absent, all types are allowed. + Type *int64 `json:"type,omitempty"` } -func (*LoadBalancerIdentityByHref) isaLoadBalancerIdentity() bool { +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" + SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" +) + +func (*SecurityGroupRuleSecurityGroupRuleProtocolIcmp) isaSecurityGroupRule() bool { return true } -// UnmarshalLoadBalancerIdentityByHref unmarshals an instance of LoadBalancerIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByHref) +// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolIcmp from the specified map of raw messages. +func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleSecurityGroupRuleProtocolIcmp) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerIdentityByID : LoadBalancerIdentityByID struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByID struct { - // The unique identifier for this load balancer. +// SecurityGroupRuleSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. +// +// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are +// allowed for the protocol. When both have the same value, that single destination port is allowed. +// This model "extends" SecurityGroupRule +type SecurityGroupRuleSecurityGroupRuleProtocolTcpudp struct { + // The direction of traffic to enforce. + Direction *string `json:"direction" validate:"required"` + + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group rule. ID *string `json:"id" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The inclusive upper bound of TCP/UDP destination port range. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + PortMin *int64 `json:"port_min,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` } -// NewLoadBalancerIdentityByID : Instantiate LoadBalancerIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByID(id string) (_model *LoadBalancerIdentityByID, err error) { - _model = &LoadBalancerIdentityByID{ - ID: core.StringPtr(id), +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Direction property. +// The direction of traffic to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Protocol property. +// The protocol to enforce. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" +) + +func (*SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRule() bool { + return true +} + +// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. +func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerIdentityByID) isaLoadBalancerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerIdentityByID unmarshals an instance of LoadBalancerIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } @@ -89016,126 +103079,193 @@ func UnmarshalLoadBalancerIdentityByID(m map[string]json.RawMessage, result inte return } -// LoadBalancerListenerIdentityByHref : LoadBalancerListenerIdentityByHref struct -// This model "extends" LoadBalancerListenerIdentity -type LoadBalancerListenerIdentityByHref struct { - // The listener's canonical URL. +// SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` + + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` -} -// NewLoadBalancerListenerIdentityByHref : Instantiate LoadBalancerListenerIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerIdentityByHref(href string) (_model *LoadBalancerListenerIdentityByHref, err error) { - _model = &LoadBalancerListenerIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` + + // The name for this bare metal server network interface. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*LoadBalancerListenerIdentityByHref) isaLoadBalancerListenerIdentity() bool { +// Constants associated with the SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerIdentityByHref unmarshals an instance of LoadBalancerListenerIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentityByHref) +// UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerIdentityByID : LoadBalancerListenerIdentityByID struct -// This model "extends" LoadBalancerListenerIdentity -type LoadBalancerListenerIdentityByID struct { - // The unique identifier for this load balancer listener. +// SecurityGroupTargetReferenceEndpointGatewayReference : SecurityGroupTargetReferenceEndpointGatewayReference struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceEndpointGatewayReference struct { + // The CRN for this endpoint gateway. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this endpoint gateway. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this endpoint gateway. ID *string `json:"id" validate:"required"` -} -// NewLoadBalancerListenerIdentityByID : Instantiate LoadBalancerListenerIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerIdentityByID(id string) (_model *LoadBalancerListenerIdentityByID, err error) { - _model = &LoadBalancerListenerIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*LoadBalancerListenerIdentityByID) isaLoadBalancerListenerIdentity() bool { +// Constants associated with the SecurityGroupTargetReferenceEndpointGatewayReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" +) + +func (*SecurityGroupTargetReferenceEndpointGatewayReference) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerIdentityByID unmarshals an instance of LoadBalancerListenerIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentityByID) +// UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference unmarshals an instance of SecurityGroupTargetReferenceEndpointGatewayReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceEndpointGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` +// SecurityGroupTargetReferenceLoadBalancerReference : SecurityGroupTargetReferenceLoadBalancerReference struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceLoadBalancerReference struct { + // The load balancer's CRN. + CRN *string `json:"crn" validate:"required"` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The load balancer's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer. + ID *string `json:"id" validate:"required"` + + // The name for this load balancer. The name is unique across all load balancers in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { +// Constants associated with the SecurityGroupTargetReferenceLoadBalancerReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" +) + +func (*SecurityGroupTargetReferenceLoadBalancerReference) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) +// UnmarshalSecurityGroupTargetReferenceLoadBalancerReference unmarshals an instance of SecurityGroupTargetReferenceLoadBalancerReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceLoadBalancerReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -89143,36 +103273,49 @@ func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRed return } -// LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` +// SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool { - return true -} + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityIntf interface { - LoadBalancerListenerPolicyTargetPatchIntf - isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool + // The name for this instance network interface. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatch() bool { +// Constants associated with the SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } @@ -89180,88 +103323,79 @@ func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(m ma if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` +// SecurityGroupTargetReferenceVPNServerReference : SecurityGroupTargetReferenceVPNServerReference struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceVPNServerReference struct { + // The CRN for this VPN server. + CRN *string `json:"crn" validate:"required"` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} + // The URL for this VPN server. + Href *string `json:"href" validate:"required"` -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - Listener: listener, - } - err = core.ValidateStruct(_model, "required parameters") - return + // The unique identifier for this VPN server. + ID *string `json:"id" validate:"required"` + + // The name for this VPN server. The name is unique across all VPN servers in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { +// Constants associated with the SecurityGroupTargetReferenceVPNServerReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" +) + +func (*SecurityGroupTargetReferenceVPNServerReference) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) +// UnmarshalSecurityGroupTargetReferenceVPNServerReference unmarshals an instance of SecurityGroupTargetReferenceVPNServerReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceVPNServerReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // The redirect target URL. - URL *string `json:"url" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(httpStatusCode int64, url string) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - URL: core.StringPtr(url), + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -89269,36 +103403,53 @@ func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolic return } -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` +// SecurityGroupTargetReferenceVirtualNetworkInterfaceReference : SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct +// This model "extends" SecurityGroupTargetReference +type SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *VirtualNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool { - return true -} + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityIntf interface { - LoadBalancerListenerPolicyTargetPrototypeIntf - isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` + + // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + Name *string `json:"name" validate:"required"` + + // The primary IP for this virtual network interface. + PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototype() bool { +// Constants associated with the SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceVirtualNetworkInterfaceReferenceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" +) + +func (*SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) isaSecurityGroupTargetReference() bool { return true } -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference unmarshals an instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceDeleted) if err != nil { return } @@ -89306,67 +103457,23 @@ func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity( if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect : LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL : LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // The redirect target URL. - URL *string `json:"url" validate:"required"` -} - -func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } @@ -89374,43 +103481,30 @@ func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirect return } -// LoadBalancerListenerPolicyTargetLoadBalancerPoolReference : LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` +// ShareIdentityByCRN : ShareIdentityByCRN struct +// This model "extends" ShareIdentity +type ShareIdentityByCRN struct { + // The CRN for this file share. + CRN *string `json:"crn" validate:"required"` +} - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` +// NewShareIdentityByCRN : Instantiate ShareIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewShareIdentityByCRN(crn string) (_model *ShareIdentityByCRN, err error) { + _model = &ShareIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) isaLoadBalancerListenerPolicyTarget() bool { +func (*ShareIdentityByCRN) isaShareIdentity() bool { return true } -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalShareIdentityByCRN unmarshals an instance of ShareIdentityByCRN from the specified map of raw messages. +func UnmarshalShareIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -89418,29 +103512,29 @@ func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference(m map[st return } -// LoadBalancerPoolIdentityByHref : LoadBalancerPoolIdentityByHref struct -// This model "extends" LoadBalancerPoolIdentity -type LoadBalancerPoolIdentityByHref struct { - // The pool's canonical URL. +// ShareIdentityByHref : ShareIdentityByHref struct +// This model "extends" ShareIdentity +type ShareIdentityByHref struct { + // The URL for this file share. Href *string `json:"href" validate:"required"` } -// NewLoadBalancerPoolIdentityByHref : Instantiate LoadBalancerPoolIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByHref(href string) (_model *LoadBalancerPoolIdentityByHref, err error) { - _model = &LoadBalancerPoolIdentityByHref{ +// NewShareIdentityByHref : Instantiate ShareIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewShareIdentityByHref(href string) (_model *ShareIdentityByHref, err error) { + _model = &ShareIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*LoadBalancerPoolIdentityByHref) isaLoadBalancerPoolIdentity() bool { +func (*ShareIdentityByHref) isaShareIdentity() bool { return true } -// UnmarshalLoadBalancerPoolIdentityByHref unmarshals an instance of LoadBalancerPoolIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByHref) +// UnmarshalShareIdentityByHref unmarshals an instance of ShareIdentityByHref from the specified map of raw messages. +func UnmarshalShareIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -89449,29 +103543,29 @@ func UnmarshalLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, resul return } -// LoadBalancerPoolIdentityByID : LoadBalancerPoolIdentityByID struct -// This model "extends" LoadBalancerPoolIdentity -type LoadBalancerPoolIdentityByID struct { - // The unique identifier for this load balancer pool. +// ShareIdentityByID : ShareIdentityByID struct +// This model "extends" ShareIdentity +type ShareIdentityByID struct { + // The unique identifier for this file share. ID *string `json:"id" validate:"required"` } -// NewLoadBalancerPoolIdentityByID : Instantiate LoadBalancerPoolIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByID(id string) (_model *LoadBalancerPoolIdentityByID, err error) { - _model = &LoadBalancerPoolIdentityByID{ +// NewShareIdentityByID : Instantiate ShareIdentityByID (Generic Model Constructor) +func (*VpcV1) NewShareIdentityByID(id string) (_model *ShareIdentityByID, err error) { + _model = &ShareIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*LoadBalancerPoolIdentityByID) isaLoadBalancerPoolIdentity() bool { +func (*ShareIdentityByID) isaShareIdentity() bool { return true } -// UnmarshalLoadBalancerPoolIdentityByID unmarshals an instance of LoadBalancerPoolIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByID) +// UnmarshalShareIdentityByID unmarshals an instance of ShareIdentityByID from the specified map of raw messages. +func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -89480,34 +103574,66 @@ func UnmarshalLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result return } -// LoadBalancerPoolMemberTargetPrototypeIP : LoadBalancerPoolMemberTargetPrototypeIP struct -// This model "extends" LoadBalancerPoolMemberTargetPrototype -type LoadBalancerPoolMemberTargetPrototypeIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : The virtual network interface for this share mount target. The virtual network interface must: +// +// - have `allow_ip_spoofing` set to `false` +// - have `enable_infrastructure_nat` set to `true` +// - not be in the same VPC as an existing mount target for this share +// - not have `ips` other than the `primary_ip` address +// +// If an existing virtual network interface is specified, it must not have a floating IP bound to it, and it must not be +// the target of a flow log collector. +// +// Required if the share's `access_control_mode` is `security_group`. +// This model "extends" ShareMountTargetPrototype +type ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup struct { + // The name for this share mount target. The name must not be used by another mount target for the file share. + Name *string `json:"name,omitempty"` + + // The transit encryption mode to use for this share mount target: + // - `none`: Not encrypted in transit. + // - `user_managed`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + TransitEncryption *string `json:"transit_encryption,omitempty"` + + VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface" validate:"required"` } -// NewLoadBalancerPoolMemberTargetPrototypeIP : Instantiate LoadBalancerPoolMemberTargetPrototypeIP (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeIP(address string) (_model *LoadBalancerPoolMemberTargetPrototypeIP, err error) { - _model = &LoadBalancerPoolMemberTargetPrototypeIP{ - Address: core.StringPtr(address), +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.TransitEncryption property. +// The transit encryption mode to use for this share mount target: +// - `none`: Not encrypted in transit. +// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionUserManagedConst = "user_managed" +) + +// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup (Generic Model Constructor) +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { + _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup{ + VirtualNetworkInterface: virtualNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") return } -func (*LoadBalancerPoolMemberTargetPrototypeIP) isaLoadBalancerPoolMemberTargetPrototype() bool { +func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) isaShareMountTargetPrototype() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetPrototypeIP unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup from the specified map of raw messages. +func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) if err != nil { return } @@ -89515,48 +103641,60 @@ func UnmarshalLoadBalancerPoolMemberTargetPrototypeIP(m map[string]json.RawMessa return } -// LoadBalancerPoolMemberTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. -// Models which "extend" this model: -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref -// This model "extends" LoadBalancerPoolMemberTargetPrototype -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentity struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` +// ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : The VPC in which clients can mount the file share using this mount target. The VPC must not be used by another mount +// target for this share. +// +// Required if the share's `access_control_mode` is `vpc`. +// This model "extends" ShareMountTargetPrototype +type ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC struct { + // The name for this share mount target. The name must not be used by another mount target for the file share. + Name *string `json:"name,omitempty"` - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` + // The transit encryption mode to use for this share mount target: + // - `none`: Not encrypted in transit. + // - `user_managed`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + TransitEncryption *string `json:"transit_encryption,omitempty"` - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` + // Identifies a VPC by a unique property. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` } -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { - return true -} +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.TransitEncryption property. +// The transit encryption mode to use for this share mount target: +// - `none`: Not encrypted in transit. +// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionUserManagedConst = "user_managed" +) -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityIntf interface { - LoadBalancerPoolMemberTargetPrototypeIntf - isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool +// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC (Generic Model Constructor) +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { + _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC{ + VPC: vpc, + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototype() bool { +func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) isaShareMountTargetPrototype() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC from the specified map of raw messages. +func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } @@ -89564,25 +103702,48 @@ func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity(m map[string return } -// LoadBalancerPoolMemberTargetIP : LoadBalancerPoolMemberTargetIP struct -// This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. +// Models which "extend" this model: +// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID +// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref +// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN +// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototype +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id,omitempty"` + + // The URL for this virtual network interface. + Href *string `json:"href,omitempty"` + + // The CRN for this virtual network interface. + CRN *string `json:"crn,omitempty"` } -func (*LoadBalancerPoolMemberTargetIP) isaLoadBalancerPoolMemberTarget() bool { +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetIP unmarshals an instance of LoadBalancerPoolMemberTargetIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityIntf interface { + ShareMountTargetVirtualNetworkInterfacePrototypeIntf + isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -89590,46 +103751,89 @@ func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, resul return } -// LoadBalancerPoolMemberTargetInstanceReference : LoadBalancerPoolMemberTargetInstanceReference struct -// This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetInstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` +// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext : The virtual network interface for this target. +// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototype +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext struct { + // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on + // this interface. If `true`, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` + // Indicates whether this virtual network interface will be automatically deleted when + // `target` is deleted. + AutoDelete *bool `json:"auto_delete,omitempty"` - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - `floating_ips` must not have more than one floating IP. + // + // If `false`: + // - Packets are passed unchanged to/from the virtual network interface, + // allowing the workload to perform any needed NAT operations. + // - `allow_ip_spoofing` must be `false`. + // - Can only be attached to a `target` with a `resource_type` of + // `bare_metal_server_network_attachment`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` + // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or + // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the + // primary IP's subnet. + // + // If reserved IP identities are provided, the specified reserved IPs must be unbound. + // + // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network + // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet + // will be automatically selected and reserved. + Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` + // The name for this virtual network interface. The name must not be used by another virtual network interface in the + // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are + // reserved for provider-owned resources, and are not allowed. + Name *string `json:"name,omitempty"` + + // The primary IP address to bind to the virtual network interface. May be either a + // reserved IP identity, or a reserved IP prototype object which will be used to create a + // new reserved IP. + // + // If a reserved IP identity is provided, the specified reserved IP must be unbound. + // + // If a reserved IP prototype object with an address is provided, the address must be + // available on the virtual network interface's subnet. If no address is specified, + // an available address on the subnet will be automatically selected and reserved. + PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` + + // The resource group to use for this virtual network interface. If unspecified, the + // share's resource group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC + // for the subnet is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + + // The associated subnet. Required if `primary_ip` does not specify a reserved IP + // identity. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } -func (*LoadBalancerPoolMemberTargetInstanceReference) isaLoadBalancerPoolMemberTarget() bool { +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetInstanceReference unmarshals an instance of LoadBalancerPoolMemberTargetInstanceReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) if err != nil { return } @@ -89637,65 +103841,19 @@ func UnmarshalLoadBalancerPoolMemberTargetInstanceReference(m map[string]json.Ra if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileIdentityByHref : LoadBalancerProfileIdentityByHref struct -// This model "extends" LoadBalancerProfileIdentity -type LoadBalancerProfileIdentityByHref struct { - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerProfileIdentityByHref : Instantiate LoadBalancerProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerProfileIdentityByHref(href string) (_model *LoadBalancerProfileIdentityByHref, err error) { - _model = &LoadBalancerProfileIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerProfileIdentityByHref) isaLoadBalancerProfileIdentity() bool { - return true -} - -// UnmarshalLoadBalancerProfileIdentityByHref unmarshals an instance of LoadBalancerProfileIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileIdentityByName : LoadBalancerProfileIdentityByName struct -// This model "extends" LoadBalancerProfileIdentity -type LoadBalancerProfileIdentityByName struct { - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` -} - -// NewLoadBalancerProfileIdentityByName : Instantiate LoadBalancerProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerProfileIdentityByName(name string) (_model *LoadBalancerProfileIdentityByName, err error) { - _model = &LoadBalancerProfileIdentityByName{ - Name: core.StringPtr(name), + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerProfileIdentityByName) isaLoadBalancerProfileIdentity() bool { - return true -} - -// UnmarshalLoadBalancerProfileIdentityByName unmarshals an instance of LoadBalancerProfileIdentityByName from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } @@ -89703,26 +103861,48 @@ func UnmarshalLoadBalancerProfileIdentityByName(m map[string]json.RawMessage, re return } -// LoadBalancerProfileInstanceGroupsSupportedDependent : The instance groups support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileInstanceGroupsSupported -type LoadBalancerProfileInstanceGroupsSupportedDependent struct { +// ShareProfileCapacityDependentRange : The permitted total capacity (in gigabytes) of a share with this profile depends on its configuration. +// This model "extends" ShareProfileCapacity +type ShareProfileCapacityDependentRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedDependent.Type property. +// Constants associated with the ShareProfileCapacityDependentRange.Type property. // The type for this profile field. const ( - LoadBalancerProfileInstanceGroupsSupportedDependentTypeDependentConst = "dependent" + ShareProfileCapacityDependentRangeTypeDependentConst = "dependent" + ShareProfileCapacityDependentRangeTypeDependentRangeConst = "dependent_range" ) -func (*LoadBalancerProfileInstanceGroupsSupportedDependent) isaLoadBalancerProfileInstanceGroupsSupported() bool { +func (*ShareProfileCapacityDependentRange) isaShareProfileCapacity() bool { return true } -// UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupportedDependent) +// UnmarshalShareProfileCapacityDependentRange unmarshals an instance of ShareProfileCapacityDependentRange from the specified map of raw messages. +func UnmarshalShareProfileCapacityDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCapacityDependentRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -89731,34 +103911,41 @@ func UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent(m map[string]j return } -// LoadBalancerProfileInstanceGroupsSupportedFixed : The instance groups support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileInstanceGroupsSupported -type LoadBalancerProfileInstanceGroupsSupportedFixed struct { +// ShareProfileCapacityEnum : The permitted total capacities (in gigabytes) of a share with this profile. +// This model "extends" ShareProfileCapacity +type ShareProfileCapacityEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` - // The value for this profile field. - Value *bool `json:"value" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedFixed.Type property. +// Constants associated with the ShareProfileCapacityEnum.Type property. // The type for this profile field. const ( - LoadBalancerProfileInstanceGroupsSupportedFixedTypeFixedConst = "fixed" + ShareProfileCapacityEnumTypeEnumConst = "enum" ) -func (*LoadBalancerProfileInstanceGroupsSupportedFixed) isaLoadBalancerProfileInstanceGroupsSupported() bool { +func (*ShareProfileCapacityEnum) isaShareProfileCapacity() bool { return true } -// UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupportedFixed) +// UnmarshalShareProfileCapacityEnum unmarshals an instance of ShareProfileCapacityEnum from the specified map of raw messages. +func UnmarshalShareProfileCapacityEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCapacityEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -89766,62 +103953,90 @@ func UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed(m map[string]json. return } -// LoadBalancerProfileRouteModeSupportedDependent : The route mode support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileRouteModeSupported -type LoadBalancerProfileRouteModeSupportedDependent struct { +// ShareProfileCapacityFixed : The permitted total capacity (in gigabytes) of a share with this profile is fixed. +// This model "extends" ShareProfileCapacity +type ShareProfileCapacityFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// Constants associated with the LoadBalancerProfileRouteModeSupportedDependent.Type property. +// Constants associated with the ShareProfileCapacityFixed.Type property. // The type for this profile field. const ( - LoadBalancerProfileRouteModeSupportedDependentTypeDependentConst = "dependent" + ShareProfileCapacityFixedTypeFixedConst = "fixed" ) -func (*LoadBalancerProfileRouteModeSupportedDependent) isaLoadBalancerProfileRouteModeSupported() bool { +func (*ShareProfileCapacityFixed) isaShareProfileCapacity() bool { return true } -// UnmarshalLoadBalancerProfileRouteModeSupportedDependent unmarshals an instance of LoadBalancerProfileRouteModeSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupportedDependent) +// UnmarshalShareProfileCapacityFixed unmarshals an instance of ShareProfileCapacityFixed from the specified map of raw messages. +func UnmarshalShareProfileCapacityFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCapacityFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerProfileRouteModeSupportedFixed : The route mode support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileRouteModeSupported -type LoadBalancerProfileRouteModeSupportedFixed struct { +// ShareProfileCapacityRange : The permitted total capacity range (in gigabytes) of a share with this profile. +// This model "extends" ShareProfileCapacity +type ShareProfileCapacityRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` } -// Constants associated with the LoadBalancerProfileRouteModeSupportedFixed.Type property. +// Constants associated with the ShareProfileCapacityRange.Type property. // The type for this profile field. const ( - LoadBalancerProfileRouteModeSupportedFixedTypeFixedConst = "fixed" + ShareProfileCapacityRangeTypeRangeConst = "range" ) -func (*LoadBalancerProfileRouteModeSupportedFixed) isaLoadBalancerProfileRouteModeSupported() bool { +func (*ShareProfileCapacityRange) isaShareProfileCapacity() bool { return true } -// UnmarshalLoadBalancerProfileRouteModeSupportedFixed unmarshals an instance of LoadBalancerProfileRouteModeSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalShareProfileCapacityRange unmarshals an instance of ShareProfileCapacityRange from the specified map of raw messages. +func UnmarshalShareProfileCapacityRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileCapacityRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -89829,26 +104044,48 @@ func UnmarshalLoadBalancerProfileRouteModeSupportedFixed(m map[string]json.RawMe return } -// LoadBalancerProfileSecurityGroupsSupportedDependent : The security group support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileSecurityGroupsSupported -type LoadBalancerProfileSecurityGroupsSupportedDependent struct { +// ShareProfileIopsDependentRange : The permitted IOPS range of a share with this profile depends on its configuration. +// This model "extends" ShareProfileIops +type ShareProfileIopsDependentRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` } -// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedDependent.Type property. +// Constants associated with the ShareProfileIopsDependentRange.Type property. // The type for this profile field. const ( - LoadBalancerProfileSecurityGroupsSupportedDependentTypeDependentConst = "dependent" + ShareProfileIopsDependentRangeTypeDependentConst = "dependent" + ShareProfileIopsDependentRangeTypeDependentRangeConst = "dependent_range" ) -func (*LoadBalancerProfileSecurityGroupsSupportedDependent) isaLoadBalancerProfileSecurityGroupsSupported() bool { +func (*ShareProfileIopsDependentRange) isaShareProfileIops() bool { return true } -// UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupportedDependent) +// UnmarshalShareProfileIopsDependentRange unmarshals an instance of ShareProfileIopsDependentRange from the specified map of raw messages. +func UnmarshalShareProfileIopsDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIopsDependentRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return @@ -89857,34 +104094,41 @@ func UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent(m map[string]j return } -// LoadBalancerProfileSecurityGroupsSupportedFixed : The security group support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileSecurityGroupsSupported -type LoadBalancerProfileSecurityGroupsSupportedFixed struct { +// ShareProfileIopsEnum : The permitted IOPS values of a share with this profile. +// This model "extends" ShareProfileIops +type ShareProfileIopsEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` - // The value for this profile field. - Value *bool `json:"value" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedFixed.Type property. +// Constants associated with the ShareProfileIopsEnum.Type property. // The type for this profile field. const ( - LoadBalancerProfileSecurityGroupsSupportedFixedTypeFixedConst = "fixed" + ShareProfileIopsEnumTypeEnumConst = "enum" ) -func (*LoadBalancerProfileSecurityGroupsSupportedFixed) isaLoadBalancerProfileSecurityGroupsSupported() bool { +func (*ShareProfileIopsEnum) isaShareProfileIops() bool { return true } -// UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupportedFixed) +// UnmarshalShareProfileIopsEnum unmarshals an instance of ShareProfileIopsEnum from the specified map of raw messages. +func UnmarshalShareProfileIopsEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIopsEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -89892,93 +104136,90 @@ func UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed(m map[string]json. return } -// LoadBalancerProfileUDPSupportedDependent : The UDP support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileUDPSupported -type LoadBalancerProfileUDPSupportedDependent struct { +// ShareProfileIopsFixed : The permitted IOPS of a share with this profile is fixed. +// This model "extends" ShareProfileIops +type ShareProfileIopsFixed struct { // The type for this profile field. Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// Constants associated with the LoadBalancerProfileUDPSupportedDependent.Type property. +// Constants associated with the ShareProfileIopsFixed.Type property. // The type for this profile field. const ( - LoadBalancerProfileUDPSupportedDependentTypeDependentConst = "dependent" + ShareProfileIopsFixedTypeFixedConst = "fixed" ) -func (*LoadBalancerProfileUDPSupportedDependent) isaLoadBalancerProfileUDPSupported() bool { +func (*ShareProfileIopsFixed) isaShareProfileIops() bool { return true } -// UnmarshalLoadBalancerProfileUDPSupportedDependent unmarshals an instance of LoadBalancerProfileUDPSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupportedDependent) +// UnmarshalShareProfileIopsFixed unmarshals an instance of ShareProfileIopsFixed from the specified map of raw messages. +func UnmarshalShareProfileIopsFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIopsFixed) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerProfileUDPSupportedFixed : The UDP support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileUDPSupported -type LoadBalancerProfileUDPSupportedFixed struct { +// ShareProfileIopsRange : The permitted IOPS range of a share with this profile. +// This model "extends" ShareProfileIops +type ShareProfileIopsRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + // The type for this profile field. Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` } -// Constants associated with the LoadBalancerProfileUDPSupportedFixed.Type property. +// Constants associated with the ShareProfileIopsRange.Type property. // The type for this profile field. const ( - LoadBalancerProfileUDPSupportedFixedTypeFixedConst = "fixed" + ShareProfileIopsRangeTypeRangeConst = "range" ) -func (*LoadBalancerProfileUDPSupportedFixed) isaLoadBalancerProfileUDPSupported() bool { +func (*ShareProfileIopsRange) isaShareProfileIops() bool { return true } -// UnmarshalLoadBalancerProfileUDPSupportedFixed unmarshals an instance of LoadBalancerProfileUDPSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalShareProfileIopsRange unmarshals an instance of ShareProfileIopsRange from the specified map of raw messages. +func UnmarshalShareProfileIopsRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIopsRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentityByCRN : NetworkACLIdentityByCRN struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByCRN struct { - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` -} - -// NewNetworkACLIdentityByCRN : Instantiate NetworkACLIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByCRN(crn string) (_model *NetworkACLIdentityByCRN, err error) { - _model = &NetworkACLIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLIdentityByCRN) isaNetworkACLIdentity() bool { - return true -} - -// UnmarshalNetworkACLIdentityByCRN unmarshals an instance of NetworkACLIdentityByCRN from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -89986,29 +104227,29 @@ func UnmarshalNetworkACLIdentityByCRN(m map[string]json.RawMessage, result inter return } -// NetworkACLIdentityByHref : NetworkACLIdentityByHref struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByHref struct { - // The URL for this network ACL. +// ShareProfileIdentityByHref : ShareProfileIdentityByHref struct +// This model "extends" ShareProfileIdentity +type ShareProfileIdentityByHref struct { + // The URL for this share profile. Href *string `json:"href" validate:"required"` } -// NewNetworkACLIdentityByHref : Instantiate NetworkACLIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByHref(href string) (_model *NetworkACLIdentityByHref, err error) { - _model = &NetworkACLIdentityByHref{ +// NewShareProfileIdentityByHref : Instantiate ShareProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewShareProfileIdentityByHref(href string) (_model *ShareProfileIdentityByHref, err error) { + _model = &ShareProfileIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLIdentityByHref) isaNetworkACLIdentity() bool { +func (*ShareProfileIdentityByHref) isaShareProfileIdentity() bool { return true } -// UnmarshalNetworkACLIdentityByHref unmarshals an instance of NetworkACLIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByHref) +// UnmarshalShareProfileIdentityByHref unmarshals an instance of ShareProfileIdentityByHref from the specified map of raw messages. +func UnmarshalShareProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -90017,30 +104258,30 @@ func UnmarshalNetworkACLIdentityByHref(m map[string]json.RawMessage, result inte return } -// NetworkACLIdentityByID : NetworkACLIdentityByID struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByID struct { - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` +// ShareProfileIdentityByName : ShareProfileIdentityByName struct +// This model "extends" ShareProfileIdentity +type ShareProfileIdentityByName struct { + // The globally unique name for this share profile. + Name *string `json:"name" validate:"required"` } -// NewNetworkACLIdentityByID : Instantiate NetworkACLIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByID(id string) (_model *NetworkACLIdentityByID, err error) { - _model = &NetworkACLIdentityByID{ - ID: core.StringPtr(id), +// NewShareProfileIdentityByName : Instantiate ShareProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewShareProfileIdentityByName(name string) (_model *ShareProfileIdentityByName, err error) { + _model = &ShareProfileIdentityByName{ + Name: core.StringPtr(name), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLIdentityByID) isaNetworkACLIdentity() bool { +func (*ShareProfileIdentityByName) isaShareProfileIdentity() bool { return true } -// UnmarshalNetworkACLIdentityByID unmarshals an instance of NetworkACLIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalShareProfileIdentityByName unmarshals an instance of ShareProfileIdentityByName from the specified map of raw messages. +func UnmarshalShareProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -90048,52 +104289,142 @@ func UnmarshalNetworkACLIdentityByID(m map[string]json.RawMessage, result interf return } -// NetworkACLPrototypeNetworkACLByRules : NetworkACLPrototypeNetworkACLByRules struct -// This model "extends" NetworkACLPrototype -type NetworkACLPrototypeNetworkACLByRules struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. +// SharePrototypeShareBySize : Create a file share by size. +// This model "extends" SharePrototype +type SharePrototypeShareBySize struct { + // The maximum input/output operations per second (IOPS) for the file share. The share must be in the + // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // + // In addition, each client accessing the share will be restricted to 48,000 IOPS. + Iops *int64 `json:"iops,omitempty"` + + // The mount targets for the file share. Each mount target must be in a unique VPC. + MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` + + // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be + // a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The + // profile must support the share's specified IOPS and size. + Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this file share will reside in. + // + // For a replica share, this must be a different zone in the same region as the source share. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The access control mode for the share: + // + // - `security_group`: The security groups on the virtual network interface for a + // mount target control access to the mount target. Mount targets for this share + // require a virtual network interface. + // - `vpc`: All clients in the VPC for a mount target have access to the mount target. + // Mount targets for this share require a VPC. + AccessControlMode *string `json:"access_control_mode,omitempty"` + + // The root key to use to wrap the data encryption key for the share. + // + // If unspecified, the `encryption` type for the share will be `provider_managed`. + // + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The owner assigned to the file share at creation. Subsequent changes to the owner + // must be performed by a client that has mounted the file share. + InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The size of the file share rounded up to the next gigabyte. + // + // The maximum size for a share may increase in the future. + Size *int64 `json:"size" validate:"required"` } -// NewNetworkACLPrototypeNetworkACLByRules : Instantiate NetworkACLPrototypeNetworkACLByRules (Generic Model Constructor) -func (*VpcV1) NewNetworkACLPrototypeNetworkACLByRules(vpc VPCIdentityIntf) (_model *NetworkACLPrototypeNetworkACLByRules, err error) { - _model = &NetworkACLPrototypeNetworkACLByRules{ - VPC: vpc, +// Constants associated with the SharePrototypeShareBySize.AccessControlMode property. +// The access control mode for the share: +// +// - `security_group`: The security groups on the virtual network interface for a +// mount target control access to the mount target. Mount targets for this share +// require a virtual network interface. +// - `vpc`: All clients in the VPC for a mount target have access to the mount target. +// Mount targets for this share require a VPC. +const ( + SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" + SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" +) + +// NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) +func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { + _model = &SharePrototypeShareBySize{ + Profile: profile, + Zone: zone, + Size: core.Int64Ptr(size), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLPrototypeNetworkACLByRules) isaNetworkACLPrototype() bool { +func (*SharePrototypeShareBySize) isaSharePrototype() bool { return true } -// UnmarshalNetworkACLPrototypeNetworkACLByRules unmarshals an instance of NetworkACLPrototypeNetworkACLByRules from the specified map of raw messages. -func UnmarshalNetworkACLPrototypeNetworkACLByRules(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototypeNetworkACLByRules) +// UnmarshalSharePrototypeShareBySize unmarshals an instance of SharePrototypeShareBySize from the specified map of raw messages. +func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePrototypeShareBySize) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } @@ -90101,52 +104432,120 @@ func UnmarshalNetworkACLPrototypeNetworkACLByRules(m map[string]json.RawMessage, return } -// NetworkACLPrototypeNetworkACLBySourceNetworkACL : NetworkACLPrototypeNetworkACLBySourceNetworkACL struct -// This model "extends" NetworkACLPrototype -type NetworkACLPrototypeNetworkACLBySourceNetworkACL struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. +// SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for `initial_owner`, +// `access_control_mode`, `encryption_key` and `size` will be inherited from `source_share`. +// This model "extends" SharePrototype +type SharePrototypeShareBySourceShare struct { + // The maximum input/output operations per second (IOPS) for the file share. The share must be in the + // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. + // + // In addition, each client accessing the share will be restricted to 48,000 IOPS. + Iops *int64 `json:"iops,omitempty"` + + // The mount targets for the file share. Each mount target must be in a unique VPC. + MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` + + // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be + // a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The + // profile must support the share's specified IOPS and size. + Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - // Network ACL to copy rules from. - SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl" validate:"required"` + // Tags for this resource. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this file share will reside in. + // + // For a replica share, this must be a different zone in the same region as the source share. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The root key to use to wrap the data encryption key for the share. + // + // This property must be specified if the `source_share` is in a different region and has + // an `encryption` type of `user_managed`, and must not be specified otherwise (its value + // will be inherited from `source_share`). + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The cron specification for the file share replication schedule. + // + // Replication of a share can be scheduled to occur at most once per hour. + ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` + + // The resource group to use. If unspecified, the resource group from + // the source share will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The source file share for this replica file share. The specified file share must not + // already have a replica, and must not be a replica. If source file share is specified + // by CRN, it may be in an [associated partner + // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). + SourceShare ShareIdentityIntf `json:"source_share" validate:"required"` } -// NewNetworkACLPrototypeNetworkACLBySourceNetworkACL : Instantiate NetworkACLPrototypeNetworkACLBySourceNetworkACL (Generic Model Constructor) -func (*VpcV1) NewNetworkACLPrototypeNetworkACLBySourceNetworkACL(vpc VPCIdentityIntf, sourceNetworkACL NetworkACLIdentityIntf) (_model *NetworkACLPrototypeNetworkACLBySourceNetworkACL, err error) { - _model = &NetworkACLPrototypeNetworkACLBySourceNetworkACL{ - VPC: vpc, - SourceNetworkACL: sourceNetworkACL, +// NewSharePrototypeShareBySourceShare : Instantiate SharePrototypeShareBySourceShare (Generic Model Constructor) +func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { + _model = &SharePrototypeShareBySourceShare{ + Profile: profile, + Zone: zone, + ReplicationCronSpec: core.StringPtr(replicationCronSpec), + SourceShare: sourceShare, } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLPrototypeNetworkACLBySourceNetworkACL) isaNetworkACLPrototype() bool { +func (*SharePrototypeShareBySourceShare) isaSharePrototype() bool { return true } -// UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL unmarshals an instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL from the specified map of raw messages. -func UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototypeNetworkACLBySourceNetworkACL) +// UnmarshalSharePrototypeShareBySourceShare unmarshals an instance of SharePrototypeShareBySourceShare from the specified map of raw messages. +func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SharePrototypeShareBySourceShare) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) if err != nil { return } - err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) if err != nil { return } @@ -90154,30 +104553,54 @@ func UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL(m map[string]json. return } -// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct -// This model "extends" NetworkACLRuleBeforePatch -type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct { - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` +// SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots : SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots struct +// This model "extends" SnapshotConsistencyGroupPrototype +type SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots struct { + // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. + DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` + + // The name for this snapshot consistency group. The name must be unique across all snapshot consistency groups in the + // region. + // + // If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The data-consistent member snapshots to create. All snapshots must specify a + // `source_volume` attached to the same virtual server instance. + Snapshots []SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem `json:"snapshots" validate:"required"` } -// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref, err error) { - _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref{ - Href: core.StringPtr(href), +// NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots : Instantiate SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots (Generic Model Constructor) +func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(snapshots []SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) (_model *SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots, err error) { + _model = &SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots{ + Snapshots: snapshots, } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePatch() bool { +func (*SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots) isaSnapshotConsistencyGroupPrototype() bool { return true } -// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots from the specified map of raw messages. +func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots) + err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) if err != nil { return } @@ -90185,30 +104608,30 @@ func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(m map[string return } -// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct -// This model "extends" NetworkACLRuleBeforePatch -type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` +// SnapshotIdentityByCRN : SnapshotIdentityByCRN struct +// This model "extends" SnapshotIdentity +type SnapshotIdentityByCRN struct { + // The CRN of this snapshot. + CRN *string `json:"crn" validate:"required"` } -// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID, err error) { - _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID{ - ID: core.StringPtr(id), +// NewSnapshotIdentityByCRN : Instantiate SnapshotIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewSnapshotIdentityByCRN(crn string) (_model *SnapshotIdentityByCRN, err error) { + _model = &SnapshotIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePatch() bool { +func (*SnapshotIdentityByCRN) isaSnapshotIdentity() bool { return true } -// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSnapshotIdentityByCRN unmarshals an instance of SnapshotIdentityByCRN from the specified map of raw messages. +func UnmarshalSnapshotIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -90216,29 +104639,29 @@ func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(m map[string]j return } -// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct -// This model "extends" NetworkACLRuleBeforePrototype -type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct { - // The URL for this network ACL rule. +// SnapshotIdentityByHref : SnapshotIdentityByHref struct +// This model "extends" SnapshotIdentity +type SnapshotIdentityByHref struct { + // The URL for this snapshot. Href *string `json:"href" validate:"required"` } -// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref, err error) { - _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref{ +// NewSnapshotIdentityByHref : Instantiate SnapshotIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewSnapshotIdentityByHref(href string) (_model *SnapshotIdentityByHref, err error) { + _model = &SnapshotIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePrototype() bool { +func (*SnapshotIdentityByHref) isaSnapshotIdentity() bool { return true } -// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) +// UnmarshalSnapshotIdentityByHref unmarshals an instance of SnapshotIdentityByHref from the specified map of raw messages. +func UnmarshalSnapshotIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -90247,29 +104670,29 @@ func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(m map[st return } -// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct -// This model "extends" NetworkACLRuleBeforePrototype -type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct { - // The unique identifier for this network ACL rule. +// SnapshotIdentityByID : SnapshotIdentityByID struct +// This model "extends" SnapshotIdentity +type SnapshotIdentityByID struct { + // The unique identifier for this snapshot. ID *string `json:"id" validate:"required"` } -// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID, err error) { - _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID{ +// NewSnapshotIdentityByID : Instantiate SnapshotIdentityByID (Generic Model Constructor) +func (*VpcV1) NewSnapshotIdentityByID(id string) (_model *SnapshotIdentityByID, err error) { + _model = &SnapshotIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePrototype() bool { +func (*SnapshotIdentityByID) isaSnapshotIdentity() bool { return true } -// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) +// UnmarshalSnapshotIdentityByID unmarshals an instance of SnapshotIdentityByID from the specified map of raw messages. +func UnmarshalSnapshotIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -90278,118 +104701,74 @@ func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(m map[stri return } -// NetworkACLRuleItemNetworkACLRuleProtocolAll : NetworkACLRuleItemNetworkACLRuleProtocolAll struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` +// SnapshotPrototypeSnapshotBySourceSnapshot : SnapshotPrototypeSnapshotBySourceSnapshot struct +// This model "extends" SnapshotPrototype +type SnapshotPrototypeSnapshotBySourceSnapshot struct { + // Clones to create for this snapshot. + Clones []SnapshotClonePrototype `json:"clones,omitempty"` - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` + // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The root key to use to wrap the data encryption key for this snapshot. + // + // A key must be specified if and only if the source snapshot has an `encryption` type of + // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify + // a key in the same region as the new snapshot, and use the same encryption key for all + // snapshots using the same source volume. + // + // The specified key may be in a different account, subject to IAM policies. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The source snapshot (in another region) to create this snapshot from. + // The specified snapshot must not already be the source of another snapshot in this + // region. + SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot" validate:"required"` } -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolAllActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllProtocolAllConst = "all" -) +// NewSnapshotPrototypeSnapshotBySourceSnapshot : Instantiate SnapshotPrototypeSnapshotBySourceSnapshot (Generic Model Constructor) +func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceSnapshot(sourceSnapshot *SnapshotIdentityByCRN) (_model *SnapshotPrototypeSnapshotBySourceSnapshot, err error) { + _model = &SnapshotPrototypeSnapshotBySourceSnapshot{ + SourceSnapshot: sourceSnapshot, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*NetworkACLRuleItemNetworkACLRuleProtocolAll) isaNetworkACLRuleItem() bool { +func (*SnapshotPrototypeSnapshotBySourceSnapshot) isaSnapshotPrototype() bool { return true } -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot unmarshals an instance of SnapshotPrototypeSnapshotBySourceSnapshot from the specified map of raw messages. +func UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotPrototypeSnapshotBySourceSnapshot) + err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) if err != nil { return } @@ -90397,116 +104776,42 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll(m map[string]json.RawM return } -// NetworkACLRuleItemNetworkACLRuleProtocolIcmp : NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` +// SnapshotPrototypeSnapshotBySourceVolume : SnapshotPrototypeSnapshotBySourceVolume struct +// This model "extends" SnapshotPrototype +type SnapshotPrototypeSnapshotBySourceVolume struct { + // Clones to create for this snapshot. + Clones []SnapshotClonePrototype `json:"clones,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. + UserTags []string `json:"user_tags,omitempty"` - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` + // The volume to create this snapshot from. + SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` } -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" -) +// NewSnapshotPrototypeSnapshotBySourceVolume : Instantiate SnapshotPrototypeSnapshotBySourceVolume (Generic Model Constructor) +func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *SnapshotPrototypeSnapshotBySourceVolume, err error) { + _model = &SnapshotPrototypeSnapshotBySourceVolume{ + SourceVolume: sourceVolume, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*NetworkACLRuleItemNetworkACLRuleProtocolIcmp) isaNetworkACLRuleItem() bool { +func (*SnapshotPrototypeSnapshotBySourceVolume) isaSnapshotPrototype() bool { return true } -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) +// UnmarshalSnapshotPrototypeSnapshotBySourceVolume unmarshals an instance of SnapshotPrototypeSnapshotBySourceVolume from the specified map of raw messages. +func UnmarshalSnapshotPrototypeSnapshotBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotPrototypeSnapshotBySourceVolume) + err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) if err != nil { return } @@ -90514,19 +104819,46 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.Raw if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SubnetIdentityByCRN : SubnetIdentityByCRN struct +// This model "extends" SubnetIdentity +type SubnetIdentityByCRN struct { + // The CRN for this subnet. + CRN *string `json:"crn" validate:"required"` +} + +// NewSubnetIdentityByCRN : Instantiate SubnetIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewSubnetIdentityByCRN(crn string) (_model *SubnetIdentityByCRN, err error) { + _model = &SubnetIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SubnetIdentityByCRN) isaSubnetIdentity() bool { + return true +} + +// UnmarshalSubnetIdentityByCRN unmarshals an instance of SubnetIdentityByCRN from the specified map of raw messages. +func UnmarshalSubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -90534,147 +104866,163 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.Raw return } -// NetworkACLRuleItemNetworkACLRuleProtocolTcpudp : NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SubnetIdentityByHref : SubnetIdentityByHref struct +// This model "extends" SubnetIdentity +type SubnetIdentityByHref struct { + // The URL for this subnet. + Href *string `json:"href" validate:"required"` +} - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` +// NewSubnetIdentityByHref : Instantiate SubnetIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewSubnetIdentityByHref(href string) (_model *SubnetIdentityByHref, err error) { + _model = &SubnetIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` +func (*SubnetIdentityByHref) isaSubnetIdentity() bool { + return true +} - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` +// UnmarshalSubnetIdentityByHref unmarshals an instance of SubnetIdentityByHref from the specified map of raw messages. +func UnmarshalSubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The unique identifier for this network ACL rule. +// SubnetIdentityByID : SubnetIdentityByID struct +// This model "extends" SubnetIdentity +type SubnetIdentityByID struct { + // The unique identifier for this subnet. ID *string `json:"id" validate:"required"` +} - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` +// NewSubnetIdentityByID : Instantiate SubnetIdentityByID (Generic Model Constructor) +func (*VpcV1) NewSubnetIdentityByID(id string) (_model *SubnetIdentityByID, err error) { + _model = &SubnetIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` +func (*SubnetIdentityByID) isaSubnetIdentity() bool { + return true +} - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` +// UnmarshalSubnetIdentityByID unmarshals an instance of SubnetIdentityByID from the specified map of raw messages. +func UnmarshalSubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` +// SubnetPrototypeSubnetByCIDR : SubnetPrototypeSubnetByCIDR struct +// This model "extends" SubnetPrototype +type SubnetPrototypeSubnetByCIDR struct { + // The IP version(s) to support for this subnet. + IPVersion *string `json:"ip_version,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a + // hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max" validate:"required"` + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min" validate:"required"` -} + // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be + // attached to a public gateway. + PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" -) + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) + // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing + // table properties `route_direct_link_ingress`, + // `route_internet_ingress`, `route_transit_gateway_ingress`, and + // `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) + // The VPC the subnet will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" -) + // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` + // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing + // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of + // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix + // that contains the subnet's IPv4 CIDR. + Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` -func (*NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) isaNetworkACLRuleItem() bool { - return true + // The zone this subnet will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } - -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + +// Constants associated with the SubnetPrototypeSubnetByCIDR.IPVersion property. +// The IP version(s) to support for this subnet. +const ( + SubnetPrototypeSubnetByCIDRIPVersionIpv4Const = "ipv4" +) + +// NewSubnetPrototypeSubnetByCIDR : Instantiate SubnetPrototypeSubnetByCIDR (Generic Model Constructor) +func (*VpcV1) NewSubnetPrototypeSubnetByCIDR(vpc VPCIdentityIntf, ipv4CIDRBlock string) (_model *SubnetPrototypeSubnetByCIDR, err error) { + _model = &SubnetPrototypeSubnetByCIDR{ + VPC: vpc, + Ipv4CIDRBlock: core.StringPtr(ipv4CIDRBlock), } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*SubnetPrototypeSubnetByCIDR) isaSubnetPrototype() bool { + return true +} + +// UnmarshalSubnetPrototypeSubnetByCIDR unmarshals an instance of SubnetPrototypeSubnetByCIDR from the specified map of raw messages. +func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPrototypeSubnetByCIDR) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -90682,103 +105030,99 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp(m map[string]json.R return } -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. +// SubnetPrototypeSubnetByTotalCount : SubnetPrototypeSubnetByTotalCount struct +// This model "extends" SubnetPrototype +type SubnetPrototypeSubnetByTotalCount struct { + // The IP version(s) to support for this subnet. IPVersion *string `json:"ip_version,omitempty"` - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a + // hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} + // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be + // attached to a public gateway. + PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" -) + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" -) + // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing + // table properties `route_direct_link_ingress`, + // `route_internet_ingress`, `route_transit_gateway_ingress`, and + // `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" -) + // The VPC the subnet will reside in. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Protocol property. -// The protocol to enforce. + // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the + // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. + TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` + + // The zone this subnet will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` +} + +// Constants associated with the SubnetPrototypeSubnetByTotalCount.IPVersion property. +// The IP version(s) to support for this subnet. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" + SubnetPrototypeSubnetByTotalCountIPVersionIpv4Const = "ipv4" ) -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), +// NewSubnetPrototypeSubnetByTotalCount : Instantiate SubnetPrototypeSubnetByTotalCount (Generic Model Constructor) +func (*VpcV1) NewSubnetPrototypeSubnetByTotalCount(vpc VPCIdentityIntf, totalIpv4AddressCount int64, zone ZoneIdentityIntf) (_model *SubnetPrototypeSubnetByTotalCount, err error) { + _model = &SubnetPrototypeSubnetByTotalCount{ + VPC: vpc, + TotalIpv4AddressCount: core.Int64Ptr(totalIpv4AddressCount), + Zone: zone, } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { +func (*SubnetPrototypeSubnetByTotalCount) isaSubnetPrototype() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalSubnetPrototypeSubnetByTotalCount unmarshals an instance of SubnetPrototypeSubnetByTotalCount from the specified map of raw messages. +func UnmarshalSubnetPrototypeSubnetByTotalCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPrototypeSubnetByTotalCount) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } @@ -90786,117 +105130,206 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllP return } -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// SubnetPublicGatewayPatchPublicGatewayIdentityByCRN : SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct +// This model "extends" SubnetPublicGatewayPatch +type SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct { + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` +} - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` +// NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(crn string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByCRN, err error) { + _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` +func (*SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) isaSubnetPublicGatewayPatch() bool { + return true +} - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` +// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByCRN from the specified map of raw messages. +func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` +// SubnetPublicGatewayPatchPublicGatewayIdentityByHref : SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct +// This model "extends" SubnetPublicGatewayPatch +type SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct { + // The URL for this public gateway. + Href *string `json:"href" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" -) +// NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref(href string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByHref, err error) { + _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" -) +func (*SubnetPublicGatewayPatchPublicGatewayIdentityByHref) isaSubnetPublicGatewayPatch() bool { + return true +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" -) +// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByHref from the specified map of raw messages. +func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" -) +// SubnetPublicGatewayPatchPublicGatewayIdentityByID : SubnetPublicGatewayPatchPublicGatewayIdentityByID struct +// This model "extends" SubnetPublicGatewayPatch +type SubnetPublicGatewayPatchPublicGatewayIdentityByID struct { + // The unique identifier for this public gateway. + ID *string `json:"id" validate:"required"` +} -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), +// NewSubnetPublicGatewayPatchPublicGatewayIdentityByID : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByID (Generic Model Constructor) +func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByID(id string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByID, err error) { + _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { +func (*SubnetPublicGatewayPatchPublicGatewayIdentityByID) isaSubnetPublicGatewayPatch() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) +// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByID from the specified map of raw messages. +func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TrustedProfileIdentityTrustedProfileByCRN : TrustedProfileIdentityTrustedProfileByCRN struct +// This model "extends" TrustedProfileIdentity +type TrustedProfileIdentityTrustedProfileByCRN struct { + // The CRN for this trusted profile. + CRN *string `json:"crn" validate:"required"` +} + +// NewTrustedProfileIdentityTrustedProfileByCRN : Instantiate TrustedProfileIdentityTrustedProfileByCRN (Generic Model Constructor) +func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByCRN(crn string) (_model *TrustedProfileIdentityTrustedProfileByCRN, err error) { + _model = &TrustedProfileIdentityTrustedProfileByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*TrustedProfileIdentityTrustedProfileByCRN) isaTrustedProfileIdentity() bool { + return true +} + +// UnmarshalTrustedProfileIdentityTrustedProfileByCRN unmarshals an instance of TrustedProfileIdentityTrustedProfileByCRN from the specified map of raw messages. +func UnmarshalTrustedProfileIdentityTrustedProfileByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentityTrustedProfileByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TrustedProfileIdentityTrustedProfileByID : TrustedProfileIdentityTrustedProfileByID struct +// This model "extends" TrustedProfileIdentity +type TrustedProfileIdentityTrustedProfileByID struct { + // The unique identifier for this trusted profile. + ID *string `json:"id" validate:"required"` +} + +// NewTrustedProfileIdentityTrustedProfileByID : Instantiate TrustedProfileIdentityTrustedProfileByID (Generic Model Constructor) +func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByID(id string) (_model *TrustedProfileIdentityTrustedProfileByID, err error) { + _model = &TrustedProfileIdentityTrustedProfileByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*TrustedProfileIdentityTrustedProfileByID) isaTrustedProfileIdentity() bool { + return true +} + +// UnmarshalTrustedProfileIdentityTrustedProfileByID unmarshals an instance of TrustedProfileIdentityTrustedProfileByID from the specified map of raw messages. +func UnmarshalTrustedProfileIdentityTrustedProfileByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentityTrustedProfileByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Manually specify the DNS server addresses for this VPC. +// This model "extends" VpcdnsResolverPrototype +type VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype struct { + // The DNS servers to use for this VPC. All the DNS servers must either: + // + // - have a unique `zone_affinity`, or + // - not have a `zone_affinity`. + // + // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP + // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS + // server first, followed by unique DNS servers from other zones if available. + // + // If `zone_affinity` is not specified, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + ManualServers []DnsServerPrototype `json:"manual_servers" validate:"required"` + + // The type of the DNS resolver to use. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype.Type property. +// The type of the DNS resolver to use. +const ( + VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototypeTypeManualConst = "manual" +) + +// NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Instantiate VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype (Generic Model Constructor) +func (*VpcV1) NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(manualServers []DnsServerPrototype, typeVar string) (_model *VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype, err error) { + _model = &VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype{ + ManualServers: manualServers, + Type: core.StringPtr(typeVar), } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) isaVpcdnsResolverPrototype() bool { + return true +} + +// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype from the specified map of raw messages. +func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) + err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) if err != nil { return } @@ -90908,132 +105341,218 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp return } -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` +// VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype : The system will provide DNS server addresses for this VPC. The system-provided DNS server addresses depend on whether +// any endpoint gateways reside in the VPC, and whether a +// [DNS Services](https://cloud.ibm.com/docs/dns-svcs) instance is configured for the VPC. +// This model "extends" VpcdnsResolverPrototype +type VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype struct { + // The type of the DNS resolver to use. + Type *string `json:"type,omitempty"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. +// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype.Type property. +// The type of the DNS resolver to use. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" + VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototypeTypeSystemConst = "system" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" -) +func (*VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) isaVpcdnsResolverPrototype() bool { + return true +} -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), +// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype from the specified map of raw messages. +func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { +// VpcdnsResolverTypeDelegated : The DNS server addresses are delegated to the DNS resolver of another VPC. +// This model "extends" VpcdnsResolver +type VpcdnsResolverTypeDelegated struct { + // The DNS servers for this VPC. The servers are populated: + // + // - by the system when `dns.resolver.type` is `system` + // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` + // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. + Servers []DnsServer `json:"servers" validate:"required"` + + // The type of the DNS resolver used for the VPC. + Type *string `json:"type" validate:"required"` + + // The VPC whose DNS resolver provides the DNS server addresses for this VPC. + // + // The VPC may be remote and therefore may not be directly retrievable. + VPC *VPCReferenceDnsResolverContext `json:"vpc" validate:"required"` +} + +// Constants associated with the VpcdnsResolverTypeDelegated.Type property. +// The type of the DNS resolver used for the VPC. +const ( + VpcdnsResolverTypeDelegatedTypeDelegatedConst = "delegated" +) + +func (*VpcdnsResolverTypeDelegated) isaVpcdnsResolver() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) +// UnmarshalVpcdnsResolverTypeDelegated unmarshals an instance of VpcdnsResolverTypeDelegated from the specified map of raw messages. +func UnmarshalVpcdnsResolverTypeDelegated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverTypeDelegated) + err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VpcdnsResolverTypeManual : The DNS server addresses are manually specified. +// This model "extends" VpcdnsResolver +type VpcdnsResolverTypeManual struct { + // The DNS servers for this VPC. The servers are populated: + // + // - by the system when `dns.resolver.type` is `system` + // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` + // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. + Servers []DnsServer `json:"servers" validate:"required"` + + // The manually specified DNS servers for this VPC. + // + // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the + // affinity for that zone first, followed by the unique DNS servers from other zones. + // + // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server + // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS + // servers in the order specified. + ManualServers []DnsServer `json:"manual_servers" validate:"required"` + + // The type of the DNS resolver used for the VPC. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the VpcdnsResolverTypeManual.Type property. +// The type of the DNS resolver used for the VPC. +const ( + VpcdnsResolverTypeManualTypeManualConst = "manual" +) + +func (*VpcdnsResolverTypeManual) isaVpcdnsResolver() bool { + return true +} + +// UnmarshalVpcdnsResolverTypeManual unmarshals an instance of VpcdnsResolverTypeManual from the specified map of raw messages. +func UnmarshalVpcdnsResolverTypeManual(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverTypeManual) + err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VpcdnsResolverTypeSystem : The DNS server addresses are provided by the system and depend on the configuration. +// This model "extends" VpcdnsResolver +type VpcdnsResolverTypeSystem struct { + // The DNS servers for this VPC. The servers are populated: + // + // - by the system when `dns.resolver.type` is `system` + // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` + // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. + Servers []DnsServer `json:"servers" validate:"required"` + + // The configuration of the system DNS resolver for this VPC. + // + // - `custom_resolver`: A custom DNS resolver is configured for this VPC. + // + // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when + // the VPC has either or both of the following: + // + // - at least one endpoint gateway residing in it + // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it + // + // - `default`: The provider default DNS resolvers are configured for this VPC. + // + // This system DNS resolver configuration is used when the VPC has: + // + // - no custom DNS resolver configured for it, and + // - no endpoint gateways residing in it, and + // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. + Configuration *string `json:"configuration" validate:"required"` + + // The type of the DNS resolver used for the VPC. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the VpcdnsResolverTypeSystem.Configuration property. +// The configuration of the system DNS resolver for this VPC. +// +// - `custom_resolver`: A custom DNS resolver is configured for this VPC. +// +// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when +// the VPC has either or both of the following: +// +// - at least one endpoint gateway residing in it +// +// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it +// +// - `default`: The provider default DNS resolvers are configured for this VPC. +// +// This system DNS resolver configuration is used when the VPC has: +// +// - no custom DNS resolver configured for it, and +// - no endpoint gateways residing in it, and +// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. +const ( + VpcdnsResolverTypeSystemConfigurationCustomResolverConst = "custom_resolver" + VpcdnsResolverTypeSystemConfigurationDefaultConst = "default" + VpcdnsResolverTypeSystemConfigurationPrivateResolverConst = "private_resolver" +) + +// Constants associated with the VpcdnsResolverTypeSystem.Type property. +// The type of the DNS resolver used for the VPC. +const ( + VpcdnsResolverTypeSystemTypeSystemConst = "system" +) + +func (*VpcdnsResolverTypeSystem) isaVpcdnsResolver() bool { + return true +} + +// UnmarshalVpcdnsResolverTypeSystem unmarshals an instance of VpcdnsResolverTypeSystem from the specified map of raw messages. +func UnmarshalVpcdnsResolverTypeSystem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverTypeSystem) + err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -91041,109 +105560,185 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpu return } -// NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` +// VpcdnsResolverVPCPatchVPCIdentityByCRN : VpcdnsResolverVPCPatchVPCIdentityByCRN struct +// This model "extends" VpcdnsResolverVPCPatch +type VpcdnsResolverVPCPatchVPCIdentityByCRN struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` +} - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` +// NewVpcdnsResolverVPCPatchVPCIdentityByCRN : Instantiate VpcdnsResolverVPCPatchVPCIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByCRN(crn string) (_model *VpcdnsResolverVPCPatchVPCIdentityByCRN, err error) { + _model = &VpcdnsResolverVPCPatchVPCIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +func (*VpcdnsResolverVPCPatchVPCIdentityByCRN) isaVpcdnsResolverVPCPatch() bool { + return true +} - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` +// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByCRN from the specified map of raw messages. +func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverVPCPatchVPCIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` +// VpcdnsResolverVPCPatchVPCIdentityByHref : VpcdnsResolverVPCPatchVPCIdentityByHref struct +// This model "extends" VpcdnsResolverVPCPatch +type VpcdnsResolverVPCPatchVPCIdentityByHref struct { + // The URL for this VPC. + Href *string `json:"href" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" -) +// NewVpcdnsResolverVPCPatchVPCIdentityByHref : Instantiate VpcdnsResolverVPCPatchVPCIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByHref(href string) (_model *VpcdnsResolverVPCPatchVPCIdentityByHref, err error) { + _model = &VpcdnsResolverVPCPatchVPCIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" -) +func (*VpcdnsResolverVPCPatchVPCIdentityByHref) isaVpcdnsResolverVPCPatch() bool { + return true +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" -) +// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByHref from the specified map of raw messages. +func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverVPCPatchVPCIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" -) +// VpcdnsResolverVPCPatchVPCIdentityByID : VpcdnsResolverVPCPatchVPCIdentityByID struct +// This model "extends" VpcdnsResolverVPCPatch +type VpcdnsResolverVPCPatchVPCIdentityByID struct { + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` +} -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), +// NewVpcdnsResolverVPCPatchVPCIdentityByID : Instantiate VpcdnsResolverVPCPatchVPCIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByID(id string) (_model *VpcdnsResolverVPCPatchVPCIdentityByID, err error) { + _model = &VpcdnsResolverVPCPatchVPCIdentityByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototype() bool { +func (*VpcdnsResolverVPCPatchVPCIdentityByID) isaVpcdnsResolverVPCPatch() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) +// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByID from the specified map of raw messages. +func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpcdnsResolverVPCPatchVPCIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCIdentityByCRN : VPCIdentityByCRN struct +// This model "extends" VPCIdentity +type VPCIdentityByCRN struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` +} + +// NewVPCIdentityByCRN : Instantiate VPCIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewVPCIdentityByCRN(crn string) (_model *VPCIdentityByCRN, err error) { + _model = &VPCIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPCIdentityByCRN) isaVPCIdentity() bool { + return true +} + +// UnmarshalVPCIdentityByCRN unmarshals an instance of VPCIdentityByCRN from the specified map of raw messages. +func UnmarshalVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCIdentityByHref : VPCIdentityByHref struct +// This model "extends" VPCIdentity +type VPCIdentityByHref struct { + // The URL for this VPC. + Href *string `json:"href" validate:"required"` +} + +// NewVPCIdentityByHref : Instantiate VPCIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVPCIdentityByHref(href string) (_model *VPCIdentityByHref, err error) { + _model = &VPCIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPCIdentityByHref) isaVPCIdentity() bool { + return true +} + +// UnmarshalVPCIdentityByHref unmarshals an instance of VPCIdentityByHref from the specified map of raw messages. +func UnmarshalVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPCIdentityByID : VPCIdentityByID struct +// This model "extends" VPCIdentity +type VPCIdentityByID struct { + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` +} + +// NewVPCIdentityByID : Instantiate VPCIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVPCIdentityByID(id string) (_model *VPCIdentityByID, err error) { + _model = &VPCIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPCIdentityByID) isaVPCIdentity() bool { + return true +} + +// UnmarshalVPCIdentityByID unmarshals an instance of VPCIdentityByID from the specified map of raw messages. +func UnmarshalVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -91151,127 +105746,247 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[st return } -// NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` +// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct +// This model "extends" VPNGatewayConnectionIkePolicyPatch +type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct { + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` +} - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` +// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref, err error) { + _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` +func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPatch() bool { + return true +} - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` +// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct +// This model "extends" VPNGatewayConnectionIkePolicyPatch +type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct { + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` +} - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` +// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID, err error) { + _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` +func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPatch() bool { + return true +} - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` +// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` +// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct +// This model "extends" VPNGatewayConnectionIkePolicyPrototype +type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct { + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" -) +// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref, err error) { + _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" -) +func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPrototype() bool { + return true +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" -) +// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" -) +// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct +// This model "extends" VPNGatewayConnectionIkePolicyPrototype +type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct { + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` +} -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), +// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID, err error) { + _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototype() bool { +func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPrototype() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) +// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct +// This model "extends" VPNGatewayConnectionIPsecPolicyPatch +type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct { + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` +} + +// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref, err error) { + _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct +// This model "extends" VPNGatewayConnectionIPsecPolicyPatch +type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct { + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` +} + +// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID, err error) { + _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct +// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype +type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct { + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` +} + +// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref, err error) { + _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct +// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype +type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct { + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` +} + +// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID, err error) { + _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -91279,110 +105994,146 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[s return } -// NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` +// VPNGatewayConnectionPolicyMode : VPNGatewayConnectionPolicyMode struct +// This model "extends" VPNGatewayConnection +type VPNGatewayConnectionPolicyMode struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` + // The authentication mode. Only `psk` is currently supported. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` + // The date and time that this VPN gateway connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` + // The VPN connection's canonical URL. + Href *string `json:"href" validate:"required"` - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id" validate:"required"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The IKE policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + // The IPsec policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + // The mode of the VPN gateway. + Mode *string `json:"mode" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + Name *string `json:"name" validate:"required"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of a VPN gateway connection. + Status *string `json:"status" validate:"required"` + + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs" validate:"required"` + + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Action property. -// The action to perform for a packet matching the rule. +// Constants associated with the VPNGatewayConnectionPolicyMode.AuthenticationMode property. +// The authentication mode. Only `psk` is currently supported. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" + VPNGatewayConnectionPolicyModeAuthenticationModePskConst = "psk" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Direction property. -// The direction of traffic to match. +// Constants associated with the VPNGatewayConnectionPolicyMode.Mode property. +// The mode of the VPN gateway. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" + VPNGatewayConnectionPolicyModeModePolicyConst = "policy" + VPNGatewayConnectionPolicyModeModeRouteConst = "route" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. +// Constants associated with the VPNGatewayConnectionPolicyMode.ResourceType property. +// The resource type. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" + VPNGatewayConnectionPolicyModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Protocol property. -// The protocol to enforce. +// Constants associated with the VPNGatewayConnectionPolicyMode.Status property. +// The status of a VPN gateway connection. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" + VPNGatewayConnectionPolicyModeStatusDownConst = "down" + VPNGatewayConnectionPolicyModeStatusUpConst = "up" ) -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototype() bool { +func (*VPNGatewayConnectionPolicyMode) isaVPNGatewayConnection() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalVPNGatewayConnectionPolicyMode unmarshals an instance of VPNGatewayConnectionPolicyMode from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPolicyMode) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -91390,27 +106141,31 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) if err != nil { return } @@ -91418,117 +106173,87 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map return } -// NetworkACLRuleNetworkACLRuleProtocolAll : NetworkACLRuleNetworkACLRuleProtocolAll struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolAll struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct +// This model "extends" VPNGatewayConnectionPrototype +type VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs" validate:"required"` } -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolAllActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllProtocolAllConst = "all" -) +// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(peerAddress string, psk string, localCIDRs []string, peerCIDRs []string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype, err error) { + _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype{ + PeerAddress: core.StringPtr(peerAddress), + Psk: core.StringPtr(psk), + LocalCIDRs: localCIDRs, + PeerCIDRs: peerCIDRs, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*NetworkACLRuleNetworkACLRuleProtocolAll) isaNetworkACLRule() bool { +func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) isaVPNGatewayConnectionPrototype() bool { return true } -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) if err != nil { return } @@ -91536,115 +106261,68 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll(m map[string]json.RawMessa return } -// NetworkACLRuleNetworkACLRuleProtocolIcmp : NetworkACLRuleNetworkACLRuleProtocolIcmp struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolIcmp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` +// VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct +// This model "extends" VPNGatewayConnectionPrototype +type VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` -} + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolIcmpActionDenyConst = "deny" -) + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" -) + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` +} -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.IPVersion property. -// The IP version for this rule. +// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" + VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototypeRoutingProtocolNoneConst = "none" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" -) +// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(peerAddress string, psk string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype, err error) { + _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype{ + PeerAddress: core.StringPtr(peerAddress), + Psk: core.StringPtr(psk), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*NetworkACLRuleNetworkACLRuleProtocolIcmp) isaNetworkACLRule() bool { +func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) isaVPNGatewayConnectionPrototype() bool { return true } -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) +// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) if err != nil { return } @@ -91652,19 +106330,15 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMess if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) if err != nil { return } @@ -91672,94 +106346,124 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMess return } -// NetworkACLRuleNetworkACLRuleProtocolTcpudp : NetworkACLRuleNetworkACLRuleProtocolTcpudp struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` +// VPNGatewayConnectionStaticRouteMode : VPNGatewayConnectionStaticRouteMode struct +// This model "extends" VPNGatewayConnection +type VPNGatewayConnectionStaticRouteMode struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` + // The authentication mode. Only `psk` is currently supported. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` - // The date and time that the rule was created. + // The date and time that this VPN gateway connection was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - // The URL for this network ACL rule. + // The VPN connection's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this network ACL rule. + // The unique identifier for this VPN gateway connection. ID *string `json:"id" validate:"required"` - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` + // The IKE policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - // The name for this network ACL rule. The name is unique across all rules for the network ACL. + // The IPsec policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` + + // The mode of the VPN gateway. + Mode *string `json:"mode" validate:"required"` + + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. Name *string `json:"name" validate:"required"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The status of a VPN gateway connection. + Status *string `json:"status" validate:"required"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max" validate:"required"` + // The reasons for the current VPN gateway connection status (if any): + // - `cannot_authenticate_connection`: Failed to authenticate a connection because of + // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) + // - `internal_error`: Internal error (contact IBM support) + // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check + // the IKE policies on both sides of the VPN) + // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and + // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE + // V1 configuration) + // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE + // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) + // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable + // (check the IPsec policies on both sides of the VPN) + // - `peer_not_responding`: No response from peer (check network ACL configuration, peer + // availability, and on-premise firewall configuration) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min" validate:"required"` + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol" validate:"required"` + + // The VPN tunnel configuration for this VPN gateway connection (in static route mode). + Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels" validate:"required"` } -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Action property. -// The action to perform for a packet matching the rule. +// Constants associated with the VPNGatewayConnectionStaticRouteMode.AuthenticationMode property. +// The authentication mode. Only `psk` is currently supported. const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" + VPNGatewayConnectionStaticRouteModeAuthenticationModePskConst = "psk" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Direction property. -// The direction of traffic to match. +// Constants associated with the VPNGatewayConnectionStaticRouteMode.Mode property. +// The mode of the VPN gateway. const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" + VPNGatewayConnectionStaticRouteModeModePolicyConst = "policy" + VPNGatewayConnectionStaticRouteModeModeRouteConst = "route" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.IPVersion property. -// The IP version for this rule. +// Constants associated with the VPNGatewayConnectionStaticRouteMode.ResourceType property. +// The resource type. const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" + VPNGatewayConnectionStaticRouteModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. +// Constants associated with the VPNGatewayConnectionStaticRouteMode.Status property. +// The status of a VPN gateway connection. const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" - NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" + VPNGatewayConnectionStaticRouteModeStatusDownConst = "down" + VPNGatewayConnectionStaticRouteModeStatusUpConst = "up" ) -func (*NetworkACLRuleNetworkACLRuleProtocolTcpudp) isaNetworkACLRule() bool { +// Constants associated with the VPNGatewayConnectionStaticRouteMode.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionStaticRouteModeRoutingProtocolNoneConst = "none" +) + +func (*VPNGatewayConnectionStaticRouteMode) isaVPNGatewayConnection() bool { return true } -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalVPNGatewayConnectionStaticRouteMode unmarshals an instance of VPNGatewayConnectionStaticRouteMode from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionStaticRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionStaticRouteMode) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { return } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) if err != nil { return } @@ -91767,23 +106471,27 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMe if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -91791,27 +106499,31 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMe if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) if err != nil { return } @@ -91819,200 +106531,184 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMe return } -// NetworkInterfaceIPPrototypeReservedIPIdentity : Identifies a reserved IP by a unique property. -// Models which "extend" this model: -// - NetworkInterfaceIPPrototypeReservedIPIdentityByID -// - NetworkInterfaceIPPrototypeReservedIPIdentityByHref -// This model "extends" NetworkInterfaceIPPrototype -type NetworkInterfaceIPPrototypeReservedIPIdentity struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` +// VPNGatewayPolicyMode : VPNGatewayPolicyMode struct +// This model "extends" VPNGateway +type VPNGatewayPolicyMode struct { + // Connections for this VPN gateway. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} + // The date and time that this VPN gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool { - return true -} + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` -type NetworkInterfaceIPPrototypeReservedIPIdentityIntf interface { - NetworkInterfaceIPPrototypeIntf - isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool -} + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` -func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototype() bool { - return true -} + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` -// UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPIdentity from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The VPN gateway's canonical URL. + Href *string `json:"href" validate:"required"` -// NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext : NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct -// This model "extends" NetworkInterfaceIPPrototype -type NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` + + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` + // Collection of VPN gateway members. + Members []VPNGatewayMember `json:"members" validate:"required"` + + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource group for this VPN gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The VPC this VPN gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // Policy mode VPN gateway. + Mode *string `json:"mode" validate:"required"` } -func (*NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) isaNetworkInterfaceIPPrototype() bool { +// Constants associated with the VPNGatewayPolicyMode.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNGatewayPolicyModeHealthStateDegradedConst = "degraded" + VPNGatewayPolicyModeHealthStateFaultedConst = "faulted" + VPNGatewayPolicyModeHealthStateInapplicableConst = "inapplicable" + VPNGatewayPolicyModeHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGatewayPolicyMode.LifecycleState property. +// The lifecycle state of the VPN gateway. +const ( + VPNGatewayPolicyModeLifecycleStateDeletingConst = "deleting" + VPNGatewayPolicyModeLifecycleStateFailedConst = "failed" + VPNGatewayPolicyModeLifecycleStatePendingConst = "pending" + VPNGatewayPolicyModeLifecycleStateStableConst = "stable" + VPNGatewayPolicyModeLifecycleStateSuspendedConst = "suspended" + VPNGatewayPolicyModeLifecycleStateUpdatingConst = "updating" + VPNGatewayPolicyModeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayPolicyMode.ResourceType property. +// The resource type. +const ( + VPNGatewayPolicyModeResourceTypeVPNGatewayConst = "vpn_gateway" +) + +// Constants associated with the VPNGatewayPolicyMode.Mode property. +// Policy mode VPN gateway. +const ( + VPNGatewayPolicyModeModePolicyConst = "policy" +) + +func (*VPNGatewayPolicyMode) isaVPNGateway() bool { return true } -// UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalVPNGatewayPolicyMode unmarshals an instance of VPNGatewayPolicyMode from the specified map of raw messages. +func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPolicyMode) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemIdentityByHref : OperatingSystemIdentityByHref struct -// This model "extends" OperatingSystemIdentity -type OperatingSystemIdentityByHref struct { - // The URL for this operating system. - Href *string `json:"href" validate:"required"` -} - -// NewOperatingSystemIdentityByHref : Instantiate OperatingSystemIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewOperatingSystemIdentityByHref(href string) (_model *OperatingSystemIdentityByHref, err error) { - _model = &OperatingSystemIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*OperatingSystemIdentityByHref) isaOperatingSystemIdentity() bool { - return true -} - -// UnmarshalOperatingSystemIdentityByHref unmarshals an instance of OperatingSystemIdentityByHref from the specified map of raw messages. -func UnmarshalOperatingSystemIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemIdentityByName : OperatingSystemIdentityByName struct -// This model "extends" OperatingSystemIdentity -type OperatingSystemIdentityByName struct { - // The globally unique name for this operating system. - Name *string `json:"name" validate:"required"` -} - -// NewOperatingSystemIdentityByName : Instantiate OperatingSystemIdentityByName (Generic Model Constructor) -func (*VpcV1) NewOperatingSystemIdentityByName(name string) (_model *OperatingSystemIdentityByName, err error) { - _model = &OperatingSystemIdentityByName{ - Name: core.StringPtr(name), + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*OperatingSystemIdentityByName) isaOperatingSystemIdentity() bool { - return true -} - -// UnmarshalOperatingSystemIdentityByName unmarshals an instance of OperatingSystemIdentityByName from the specified map of raw messages. -func UnmarshalOperatingSystemIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentity : Identifies a floating IP by a unique property. -// Models which "extend" this model: -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress -// This model "extends" PublicGatewayFloatingIPPrototype -type PublicGatewayFloatingIPPrototypeFloatingIPIdentity struct { - // The unique identifier for this floating IP. - ID *string `json:"id,omitempty"` - - // The CRN for this floating IP. - CRN *string `json:"crn,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href,omitempty"` - - // The globally unique IP address. - Address *string `json:"address,omitempty"` -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityIntf interface { - PublicGatewayFloatingIPPrototypeIntf - isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentity from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -92020,25 +106716,43 @@ func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity(m map[string]js return } -// PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext : PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct -// This model "extends" PublicGatewayFloatingIPPrototype -type PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. +// VPNGatewayPrototypeVPNGatewayPolicyModePrototype : VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct +// This model "extends" VPNGatewayPrototype +type VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // Policy mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -func (*PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) isaPublicGatewayFloatingIPPrototype() bool { +// Constants associated with the VPNGatewayPrototypeVPNGatewayPolicyModePrototype.Mode property. +// Policy mode VPN gateway. +const ( + VPNGatewayPrototypeVPNGatewayPolicyModePrototypeModePolicyConst = "policy" +) + +// NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayPolicyModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayPolicyModePrototype, err error) { + _model = &VPNGatewayPrototypeVPNGatewayPolicyModePrototype{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNGatewayPrototypeVPNGatewayPolicyModePrototype) isaVPNGatewayPrototype() bool { return true } -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) +// UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototypeVPNGatewayPolicyModePrototype) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -92047,34 +106761,11 @@ func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(m if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayIdentityPublicGatewayIdentityByCRN : PublicGatewayIdentityPublicGatewayIdentityByCRN struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByCRN struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` -} - -// NewPublicGatewayIdentityPublicGatewayIdentityByCRN : Instantiate PublicGatewayIdentityPublicGatewayIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByCRN(crn string) (_model *PublicGatewayIdentityPublicGatewayIdentityByCRN, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayIdentityPublicGatewayIdentityByCRN) isaPublicGatewayIdentity() bool { - return true -} - -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByCRN from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -92082,61 +106773,56 @@ func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN(m map[string]json. return } -// PublicGatewayIdentityPublicGatewayIdentityByHref : PublicGatewayIdentityPublicGatewayIdentityByHref struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByHref struct { - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` -} +// VPNGatewayPrototypeVPNGatewayRouteModePrototype : VPNGatewayPrototypeVPNGatewayRouteModePrototype struct +// This model "extends" VPNGatewayPrototype +type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// NewPublicGatewayIdentityPublicGatewayIdentityByHref : Instantiate PublicGatewayIdentityPublicGatewayIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByHref(href string) (_model *PublicGatewayIdentityPublicGatewayIdentityByHref, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -func (*PublicGatewayIdentityPublicGatewayIdentityByHref) isaPublicGatewayIdentity() bool { - return true -} + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByHref from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Route mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -// PublicGatewayIdentityPublicGatewayIdentityByID : PublicGatewayIdentityPublicGatewayIdentityByID struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByID struct { - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` -} +// Constants associated with the VPNGatewayPrototypeVPNGatewayRouteModePrototype.Mode property. +// Route mode VPN gateway. +const ( + VPNGatewayPrototypeVPNGatewayRouteModePrototypeModeRouteConst = "route" +) -// NewPublicGatewayIdentityPublicGatewayIdentityByID : Instantiate PublicGatewayIdentityPublicGatewayIdentityByID (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByID(id string) (_model *PublicGatewayIdentityPublicGatewayIdentityByID, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByID{ - ID: core.StringPtr(id), +// NewVPNGatewayPrototypeVPNGatewayRouteModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayRouteModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayRouteModePrototype, err error) { + _model = &VPNGatewayPrototypeVPNGatewayRouteModePrototype{ + Subnet: subnet, } err = core.ValidateStruct(_model, "required parameters") return } -func (*PublicGatewayIdentityPublicGatewayIdentityByID) isaPublicGatewayIdentity() bool { +func (*VPNGatewayPrototypeVPNGatewayRouteModePrototype) isaVPNGatewayPrototype() bool { return true } -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByID from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototypeVPNGatewayRouteModePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -92144,123 +106830,227 @@ func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID(m map[string]json.R return } -// RegionIdentityByHref : RegionIdentityByHref struct -// This model "extends" RegionIdentity -type RegionIdentityByHref struct { - // The URL for this region. +// VPNGatewayRouteMode : VPNGatewayRouteMode struct +// This model "extends" VPNGateway +type VPNGatewayRouteMode struct { + // Connections for this VPN gateway. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` + + // The date and time that this VPN gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` + + // The reasons for the current VPN gateway health_state (if any): + // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) + // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's + // subnet) + // - `internal_error`: Internal error (contact IBM support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + + // The VPN gateway's canonical URL. Href *string `json:"href" validate:"required"` -} -// NewRegionIdentityByHref : Instantiate RegionIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRegionIdentityByHref(href string) (_model *RegionIdentityByHref, err error) { - _model = &RegionIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` -func (*RegionIdentityByHref) isaRegionIdentity() bool { - return true -} + // The reasons for the current VPN gateway lifecycle_state (if any): + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` -// UnmarshalRegionIdentityByHref unmarshals an instance of RegionIdentityByHref from the specified map of raw messages. -func UnmarshalRegionIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// RegionIdentityByName : RegionIdentityByName struct -// This model "extends" RegionIdentity -type RegionIdentityByName struct { - // The globally unique name for this region. + // Collection of VPN gateway members. + Members []VPNGatewayMember `json:"members" validate:"required"` + + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. Name *string `json:"name" validate:"required"` -} -// NewRegionIdentityByName : Instantiate RegionIdentityByName (Generic Model Constructor) -func (*VpcV1) NewRegionIdentityByName(name string) (_model *RegionIdentityByName, err error) { - _model = &RegionIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The resource group for this VPN gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -func (*RegionIdentityByName) isaRegionIdentity() bool { - return true -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// UnmarshalRegionIdentityByName unmarshals an instance of RegionIdentityByName from the specified map of raw messages. -func UnmarshalRegionIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + Subnet *SubnetReference `json:"subnet" validate:"required"` -// ReservationIdentityByCRN : ReservationIdentityByCRN struct -// This model "extends" ReservationIdentity -type ReservationIdentityByCRN struct { - // The CRN for this reservation. - CRN *string `json:"crn" validate:"required"` -} + // The VPC this VPN gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` -// NewReservationIdentityByCRN : Instantiate ReservationIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByCRN(crn string) (_model *ReservationIdentityByCRN, err error) { - _model = &ReservationIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return + // Route mode VPN gateway. + Mode *string `json:"mode" validate:"required"` } -func (*ReservationIdentityByCRN) isaReservationIdentity() bool { +// Constants associated with the VPNGatewayRouteMode.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + VPNGatewayRouteModeHealthStateDegradedConst = "degraded" + VPNGatewayRouteModeHealthStateFaultedConst = "faulted" + VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" + VPNGatewayRouteModeHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGatewayRouteMode.LifecycleState property. +// The lifecycle state of the VPN gateway. +const ( + VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" + VPNGatewayRouteModeLifecycleStateFailedConst = "failed" + VPNGatewayRouteModeLifecycleStatePendingConst = "pending" + VPNGatewayRouteModeLifecycleStateStableConst = "stable" + VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" + VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" + VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayRouteMode.ResourceType property. +// The resource type. +const ( + VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" +) + +// Constants associated with the VPNGatewayRouteMode.Mode property. +// Route mode VPN gateway. +const ( + VPNGatewayRouteModeModeRouteConst = "route" +) + +func (*VPNGatewayRouteMode) isaVPNGateway() bool { return true } -// UnmarshalReservationIdentityByCRN unmarshals an instance of ReservationIdentityByCRN from the specified map of raw messages. -func UnmarshalReservationIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByCRN) +// UnmarshalVPNGatewayRouteMode unmarshals an instance of VPNGatewayRouteMode from the specified map of raw messages. +func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayRouteMode) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ReservationIdentityByHref : ReservationIdentityByHref struct -// This model "extends" ReservationIdentity -type ReservationIdentityByHref struct { - // The URL for this reservation. - Href *string `json:"href" validate:"required"` -} +// VPNServerAuthenticationByCertificate : VPNServerAuthenticationByCertificate struct +// This model "extends" VPNServerAuthentication +type VPNServerAuthenticationByCertificate struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` -// NewReservationIdentityByHref : Instantiate ReservationIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByHref(href string) (_model *ReservationIdentityByHref, err error) { - _model = &ReservationIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The certificate instance used for the VPN client certificate authority (CA). + ClientCa *CertificateInstanceReference `json:"client_ca" validate:"required"` + + // The certificate revocation list contents, encoded in PEM format. + Crl *string `json:"crl,omitempty"` } -func (*ReservationIdentityByHref) isaReservationIdentity() bool { +// Constants associated with the VPNServerAuthenticationByCertificate.Method property. +// The type of authentication. +const ( + VPNServerAuthenticationByCertificateMethodCertificateConst = "certificate" + VPNServerAuthenticationByCertificateMethodUsernameConst = "username" +) + +func (*VPNServerAuthenticationByCertificate) isaVPNServerAuthentication() bool { return true } -// UnmarshalReservationIdentityByHref unmarshals an instance of ReservationIdentityByHref from the specified map of raw messages. -func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVPNServerAuthenticationByCertificate unmarshals an instance of VPNServerAuthenticationByCertificate from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationByCertificate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationByCertificate) + err = core.UnmarshalPrimitive(m, "method", &obj.Method) + if err != nil { + return + } + err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) if err != nil { return } @@ -92268,30 +107058,35 @@ func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result int return } -// ReservationIdentityByID : ReservationIdentityByID struct -// This model "extends" ReservationIdentity -type ReservationIdentityByID struct { - // The unique identifier for this reservation. - ID *string `json:"id" validate:"required"` -} +// VPNServerAuthenticationByUsername : VPNServerAuthenticationByUsername struct +// This model "extends" VPNServerAuthentication +type VPNServerAuthenticationByUsername struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` -// NewReservationIdentityByID : Instantiate ReservationIdentityByID (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByID(id string) (_model *ReservationIdentityByID, err error) { - _model = &ReservationIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The type of identity provider to be used by VPN client. + IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` } -func (*ReservationIdentityByID) isaReservationIdentity() bool { +// Constants associated with the VPNServerAuthenticationByUsername.Method property. +// The type of authentication. +const ( + VPNServerAuthenticationByUsernameMethodCertificateConst = "certificate" + VPNServerAuthenticationByUsernameMethodUsernameConst = "username" +) + +func (*VPNServerAuthenticationByUsername) isaVPNServerAuthentication() bool { return true } -// UnmarshalReservationIdentityByID unmarshals an instance of ReservationIdentityByID from the specified map of raw messages. -func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVPNServerAuthenticationByUsername unmarshals an instance of VPNServerAuthenticationByUsername from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationByUsername(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationByUsername) + err = core.UnmarshalPrimitive(m, "method", &obj.Method) + if err != nil { + return + } + err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) if err != nil { return } @@ -92299,41 +107094,46 @@ func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result inter return } -// ReservationProfileInstanceProfileReference : ReservationProfileInstanceProfileReference struct -// This model "extends" ReservationProfile -type ReservationProfileInstanceProfileReference struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` +// VPNServerAuthenticationByUsernameIDProviderByIam : VPNServerAuthenticationByUsernameIDProviderByIam struct +// This model "extends" VPNServerAuthenticationByUsernameIDProvider +type VPNServerAuthenticationByUsernameIDProviderByIam struct { + // The type of identity provider to be used by the VPN client. + // - `iam`: IBM identity and access management + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + ProviderType *string `json:"provider_type" validate:"required"` +} - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` +// Constants associated with the VPNServerAuthenticationByUsernameIDProviderByIam.ProviderType property. +// The type of identity provider to be used by the VPN client. +// - `iam`: IBM identity and access management +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + VPNServerAuthenticationByUsernameIDProviderByIamProviderTypeIamConst = "iam" +) - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewVPNServerAuthenticationByUsernameIDProviderByIam : Instantiate VPNServerAuthenticationByUsernameIDProviderByIam (Generic Model Constructor) +func (*VpcV1) NewVPNServerAuthenticationByUsernameIDProviderByIam(providerType string) (_model *VPNServerAuthenticationByUsernameIDProviderByIam, err error) { + _model = &VPNServerAuthenticationByUsernameIDProviderByIam{ + ProviderType: core.StringPtr(providerType), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the ReservationProfileInstanceProfileReference.ResourceType property. -// The resource type. -const ( - ReservationProfileInstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" -) - -func (*ReservationProfileInstanceProfileReference) isaReservationProfile() bool { +func (*VPNServerAuthenticationByUsernameIDProviderByIam) isaVPNServerAuthenticationByUsernameIDProvider() bool { return true } -// UnmarshalReservationProfileInstanceProfileReference unmarshals an instance of ReservationProfileInstanceProfileReference from the specified map of raw messages. -func UnmarshalReservationProfileInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfileInstanceProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam unmarshals an instance of VPNServerAuthenticationByUsernameIDProviderByIam from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationByUsernameIDProviderByIam) + err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) if err != nil { return } @@ -92341,48 +107141,52 @@ func UnmarshalReservationProfileInstanceProfileReference(m map[string]json.RawMe return } -// ReservedIPTargetPrototypeEndpointGatewayIdentity : ReservedIPTargetPrototypeEndpointGatewayIdentity struct -// Models which "extend" this model: -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref -// This model "extends" ReservedIPTargetPrototype -type ReservedIPTargetPrototypeEndpointGatewayIdentity struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` +// VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct +// This model "extends" VPNServerAuthenticationPrototype +type VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` + // The certificate instance to use for the VPN client certificate authority (CA). + ClientCa CertificateInstanceIdentityIntf `json:"client_ca" validate:"required"` - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` + // The certificate revocation list contents, encoded in PEM format. + Crl *string `json:"crl,omitempty"` } -func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { - return true -} +// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.Method property. +// The type of authentication. +const ( + VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodCertificateConst = "certificate" + VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodUsernameConst = "username" +) -type ReservedIPTargetPrototypeEndpointGatewayIdentityIntf interface { - ReservedIPTargetPrototypeIntf - isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool +// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(method string, clientCa CertificateInstanceIdentityIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype, err error) { + _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype{ + Method: core.StringPtr(method), + ClientCa: clientCa, + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototype() bool { +func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) isaVPNServerAuthenticationPrototype() bool { return true } -// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentity from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) + err = core.UnmarshalPrimitive(m, "method", &obj.Method) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) if err != nil { return } @@ -92390,56 +107194,45 @@ func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity(m map[string]json return } -// ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext : ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` +// VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct +// This model "extends" VPNServerAuthenticationPrototype +type VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct { + // The type of authentication. + Method *string `json:"method" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The type of identity provider to be used by VPN client. + IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` } -// Constants associated with the ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. +// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Method property. +// The type of authentication. const ( - ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodCertificateConst = "certificate" + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodUsernameConst = "username" ) -func (*ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { +// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(method string, identityProvider VPNServerAuthenticationByUsernameIDProviderIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype, err error) { + _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype{ + Method: core.StringPtr(method), + IdentityProvider: identityProvider, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) isaVPNServerAuthenticationPrototype() bool { return true } -// UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype from the specified map of raw messages. +func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) + err = core.UnmarshalPrimitive(m, "method", &obj.Method) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) if err != nil { return } @@ -92447,63 +107240,41 @@ func UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetCont return } -// ReservedIPTargetEndpointGatewayReference : ReservedIPTargetEndpointGatewayReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetEndpointGatewayReference struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` +// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext : Identifies a reserved IP by a unique property. The reserved IP must be currently unbound and in the primary IP's +// subnet. +// Models which "extend" this model: +// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID +// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref +// This model "extends" VirtualNetworkInterfaceIPPrototype +type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { + return true } -// Constants associated with the ReservedIPTargetEndpointGatewayReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" -) +type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextIntf interface { + VirtualNetworkInterfaceIPPrototypeIntf + isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool +} -func (*ReservedIPTargetEndpointGatewayReference) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototype() bool { return true } -// UnmarshalReservedIPTargetEndpointGatewayReference unmarshals an instance of ReservedIPTargetEndpointGatewayReference from the specified map of raw messages. -func UnmarshalReservedIPTargetEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetEndpointGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -92511,42 +107282,40 @@ func UnmarshalReservedIPTargetEndpointGatewayReference(m map[string]json.RawMess return } -// ReservedIPTargetGenericResourceReference : Identifying information for a resource that is not native to the VPC API. -// This model "extends" ReservedIPTarget -type ReservedIPTargetGenericResourceReference struct { - // The CRN for the resource. - CRN *string `json:"crn" validate:"required"` +// VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext : The prototype for a new reserved IP. Must be in the primary IP's subnet. +// This model "extends" VirtualNetworkInterfaceIPPrototype +type VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext struct { + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *GenericResourceReferenceDeleted `json:"deleted,omitempty"` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` } -// Constants associated with the ReservedIPTargetGenericResourceReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetGenericResourceReferenceResourceTypeCloudResourceConst = "cloud_resource" -) - -func (*ReservedIPTargetGenericResourceReference) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototype() bool { return true } -// UnmarshalReservedIPTargetGenericResourceReference unmarshals an instance of ReservedIPTargetGenericResourceReference from the specified map of raw messages. -func UnmarshalReservedIPTargetGenericResourceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetGenericResourceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalGenericResourceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -92554,63 +107323,41 @@ func UnmarshalReservedIPTargetGenericResourceReference(m map[string]json.RawMess return } -// ReservedIPTargetLoadBalancerReference : ReservedIPTargetLoadBalancerReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetLoadBalancerReference struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` - - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer. - ID *string `json:"id" validate:"required"` +// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext : Identifies a reserved IP by a unique property. Required if `subnet` is not specified. The reserved IP must be +// currently unbound. +// Models which "extend" this model: +// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID +// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref +// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype +type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` - // The name for this load balancer. The name is unique across all load balancers in the VPC. - Name *string `json:"name" validate:"required"` + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool { + return true } -// Constants associated with the ReservedIPTargetLoadBalancerReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" -) +type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextIntf interface { + VirtualNetworkInterfacePrimaryIPPrototypeIntf + isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool +} -func (*ReservedIPTargetLoadBalancerReference) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { return true } -// UnmarshalReservedIPTargetLoadBalancerReference unmarshals an instance of ReservedIPTargetLoadBalancerReference from the specified map of raw messages. -func UnmarshalReservedIPTargetLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetLoadBalancerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -92618,48 +107365,36 @@ func UnmarshalReservedIPTargetLoadBalancerReference(m map[string]json.RawMessage return } -// ReservedIPTargetNetworkInterfaceReferenceTargetContext : ReservedIPTargetNetworkInterfaceReferenceTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` +// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext : The prototype for a new reserved IP. Requires `subnet` to be specified. +// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype +type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext struct { + // The IP address to reserve, which must not already be reserved on the subnet. + // + // If unspecified, an available address on the subnet will automatically be selected. + Address *string `json:"address,omitempty"` - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with + // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated + // list of randomly-selected words. + Name *string `json:"name,omitempty"` } -// Constants associated with the ReservedIPTargetNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - ReservedIPTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*ReservedIPTargetNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { return true } -// UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } @@ -92667,58 +107402,40 @@ func UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext(m map[strin if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ReservedIPTargetVPNGatewayReference : ReservedIPTargetVPNGatewayReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVPNGatewayReference struct { - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The VPN gateway's canonical URL. +// VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext : VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct +// This model "extends" VirtualNetworkInterfaceTarget +type VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct { + // The URL for this bare metal server network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN gateway. + // The unique identifier for this bare metal server network attachment. ID *string `json:"id" validate:"required"` - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + // The name for this bare metal server network attachment. The name is unique across all network attachments for the + // bare metal server. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ReservedIPTargetVPNGatewayReference.ResourceType property. +// Constants associated with the VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext.ResourceType property. // The resource type. const ( - ReservedIPTargetVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" + VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContextResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" ) -func (*ReservedIPTargetVPNGatewayReference) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext) isaVirtualNetworkInterfaceTarget() bool { return true } -// UnmarshalReservedIPTargetVPNGatewayReference unmarshals an instance of ReservedIPTargetVPNGatewayReference from the specified map of raw messages. -func UnmarshalReservedIPTargetVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVPNGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } +// UnmarshalVirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext unmarshals an instance of VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -92739,50 +107456,35 @@ func UnmarshalReservedIPTargetVPNGatewayReference(m map[string]json.RawMessage, return } -// ReservedIPTargetVPNServerReference : ReservedIPTargetVPNServerReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPN server. +// VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext : VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct +// This model "extends" VirtualNetworkInterfaceTarget +type VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct { + // The URL for this instance network attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN server. + // The unique identifier for this instance network attachment. ID *string `json:"id" validate:"required"` - // The name for this VPN server. The name is unique across all VPN servers in the VPC. + // The name for this instance network attachment. The name is unique across all network attachments for the instance. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ReservedIPTargetVPNServerReference.ResourceType property. +// Constants associated with the VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext.ResourceType property. // The resource type. const ( - ReservedIPTargetVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" + VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContextResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" ) -func (*ReservedIPTargetVPNServerReference) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext) isaVirtualNetworkInterfaceTarget() bool { return true } -// UnmarshalReservedIPTargetVPNServerReference unmarshals an instance of ReservedIPTargetVPNServerReference from the specified map of raw messages. -func UnmarshalReservedIPTargetVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) - if err != nil { - return - } +// UnmarshalVirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext unmarshals an instance of VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -92803,39 +107505,40 @@ func UnmarshalReservedIPTargetVPNServerReference(m map[string]json.RawMessage, r return } -// ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext : ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` +// VirtualNetworkInterfaceTargetShareMountTargetReference : VirtualNetworkInterfaceTargetShareMountTargetReference struct +// This model "extends" VirtualNetworkInterfaceTarget +type VirtualNetworkInterfaceTargetShareMountTargetReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - // The URL for this virtual network interface. + // The URL for this share mount target. Href *string `json:"href" validate:"required"` - // The unique identifier for this virtual network interface. + // The unique identifier for this share mount target. ID *string `json:"id" validate:"required"` - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. + // The name for this share mount target. The name is unique across all mount targets for the file share. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.ResourceType property. +// Constants associated with the VirtualNetworkInterfaceTargetShareMountTargetReference.ResourceType property. // The resource type. const ( - ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" + VirtualNetworkInterfaceTargetShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" ) -func (*ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) isaReservedIPTarget() bool { +func (*VirtualNetworkInterfaceTargetShareMountTargetReference) isaVirtualNetworkInterfaceTarget() bool { return true } -// UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext unmarshals an instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference unmarshals an instance of VirtualNetworkInterfaceTargetShareMountTargetReference from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceTargetShareMountTargetReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) if err != nil { return } @@ -92859,94 +107562,48 @@ func UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetCo return } -// ResourceGroupIdentityByID : ResourceGroupIdentityByID struct -// This model "extends" ResourceGroupIdentity -type ResourceGroupIdentityByID struct { - // The unique identifier for this resource group. - ID *string `json:"id" validate:"required"` -} - -// NewResourceGroupIdentityByID : Instantiate ResourceGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewResourceGroupIdentityByID(id string) (_model *ResourceGroupIdentityByID, err error) { - _model = &ResourceGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// VolumeAttachmentPrototypeVolumeVolumeIdentity : Identifies a volume by a unique property. +// Models which "extend" this model: +// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID +// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN +// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref +// This model "extends" VolumeAttachmentPrototypeVolume +type VolumeAttachmentPrototypeVolumeVolumeIdentity struct { + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` -func (*ResourceGroupIdentityByID) isaResourceGroupIdentity() bool { - return true -} + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` -// UnmarshalResourceGroupIdentityByID unmarshals an instance of ResourceGroupIdentityByID from the specified map of raw messages. -func UnmarshalResourceGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The URL for this volume. + Href *string `json:"href,omitempty"` } -// RouteCreatorVPNGatewayReference : RouteCreatorVPNGatewayReference struct -// This model "extends" RouteCreator -type RouteCreatorVPNGatewayReference struct { - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { + return true } -// Constants associated with the RouteCreatorVPNGatewayReference.ResourceType property. -// The resource type. -const ( - RouteCreatorVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" -) +type VolumeAttachmentPrototypeVolumeVolumeIdentityIntf interface { + VolumeAttachmentPrototypeVolumeIntf + isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool +} -func (*RouteCreatorVPNGatewayReference) isaRouteCreator() bool { +func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolume() bool { return true } -// UnmarshalRouteCreatorVPNGatewayReference unmarshals an instance of RouteCreatorVPNGatewayReference from the specified map of raw messages. -func UnmarshalRouteCreatorVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreatorVPNGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentity from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -92954,63 +107611,89 @@ func UnmarshalRouteCreatorVPNGatewayReference(m map[string]json.RawMessage, resu return } -// RouteCreatorVPNServerReference : RouteCreatorVPNServerReference struct -// This model "extends" RouteCreator -type RouteCreatorVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` +// VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext : VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct +// Models which "extend" this model: +// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity +// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot +// This model "extends" VolumeAttachmentPrototypeVolume +type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct { + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + // use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` + // The resource group to use for this volume. If unspecified, the instance's resource + // group will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` } -// Constants associated with the RouteCreatorVPNServerReference.ResourceType property. -// The resource type. -const ( - RouteCreatorVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" -) +func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool { + return true +} -func (*RouteCreatorVPNServerReference) isaRouteCreator() bool { +type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextIntf interface { + VolumeAttachmentPrototypeVolumeIntf + isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool +} + +func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolume() bool { return true } -// UnmarshalRouteCreatorVPNServerReference unmarshals an instance of RouteCreatorVPNServerReference from the specified map of raw messages. -func UnmarshalRouteCreatorVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreatorVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -93018,25 +107701,30 @@ func UnmarshalRouteCreatorVPNServerReference(m map[string]json.RawMessage, resul return } -// RouteNextHopIP : RouteNextHopIP struct -// This model "extends" RouteNextHop -type RouteNextHopIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// VolumeIdentityByCRN : VolumeIdentityByCRN struct +// This model "extends" VolumeIdentity +type VolumeIdentityByCRN struct { + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` } -func (*RouteNextHopIP) isaRouteNextHop() bool { +// NewVolumeIdentityByCRN : Instantiate VolumeIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewVolumeIdentityByCRN(crn string) (_model *VolumeIdentityByCRN, err error) { + _model = &VolumeIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VolumeIdentityByCRN) isaVolumeIdentity() bool { return true } -// UnmarshalRouteNextHopIP unmarshals an instance of RouteNextHopIP from the specified map of raw messages. -func UnmarshalRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalVolumeIdentityByCRN unmarshals an instance of VolumeIdentityByCRN from the specified map of raw messages. +func UnmarshalVolumeIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -93044,37 +107732,30 @@ func UnmarshalRouteNextHopIP(m map[string]json.RawMessage, result interface{}) ( return } -// RouteNextHopPatchRouteNextHopIP : RouteNextHopPatchRouteNextHopIP struct -// Models which "extend" this model: -// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP -// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP -// This model "extends" RouteNextHopPatch -type RouteNextHopPatchRouteNextHopIP struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} - -func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatchRouteNextHopIP() bool { - return true +// VolumeIdentityByHref : VolumeIdentityByHref struct +// This model "extends" VolumeIdentity +type VolumeIdentityByHref struct { + // The URL for this volume. + Href *string `json:"href" validate:"required"` } -type RouteNextHopPatchRouteNextHopIPIntf interface { - RouteNextHopPatchIntf - isaRouteNextHopPatchRouteNextHopIP() bool +// NewVolumeIdentityByHref : Instantiate VolumeIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVolumeIdentityByHref(href string) (_model *VolumeIdentityByHref, err error) { + _model = &VolumeIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatch() bool { +func (*VolumeIdentityByHref) isaVolumeIdentity() bool { return true } -// UnmarshalRouteNextHopPatchRouteNextHopIP unmarshals an instance of RouteNextHopPatchRouteNextHopIP from the specified map of raw messages. -func UnmarshalRouteNextHopPatchRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchRouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalVolumeIdentityByHref unmarshals an instance of VolumeIdentityByHref from the specified map of raw messages. +func UnmarshalVolumeIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -93082,40 +107763,92 @@ func UnmarshalRouteNextHopPatchRouteNextHopIP(m map[string]json.RawMessage, resu return } -// RouteNextHopPatchVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. -// Models which "extend" this model: -// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID -// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref -// This model "extends" RouteNextHopPatch -type RouteNextHopPatchVPNGatewayConnectionIdentity struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` +// VolumeIdentityByID : VolumeIdentityByID struct +// This model "extends" VolumeIdentity +type VolumeIdentityByID struct { + // The unique identifier for this volume. + ID *string `json:"id" validate:"required"` +} - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` +// NewVolumeIdentityByID : Instantiate VolumeIdentityByID (Generic Model Constructor) +func (*VpcV1) NewVolumeIdentityByID(id string) (_model *VolumeIdentityByID, err error) { + _model = &VolumeIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool { +func (*VolumeIdentityByID) isaVolumeIdentity() bool { return true } -type RouteNextHopPatchVPNGatewayConnectionIdentityIntf interface { - RouteNextHopPatchIntf - isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool +// UnmarshalVolumeIdentityByID unmarshals an instance of VolumeIdentityByID from the specified map of raw messages. +func UnmarshalVolumeIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatch() bool { +// VolumeProfileIdentityByHref : VolumeProfileIdentityByHref struct +// This model "extends" VolumeProfileIdentity +type VolumeProfileIdentityByHref struct { + // The URL for this volume profile. + Href *string `json:"href" validate:"required"` +} + +// NewVolumeProfileIdentityByHref : Instantiate VolumeProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewVolumeProfileIdentityByHref(href string) (_model *VolumeProfileIdentityByHref, err error) { + _model = &VolumeProfileIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VolumeProfileIdentityByHref) isaVolumeProfileIdentity() bool { return true } -// UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity unmarshals an instance of RouteNextHopPatchVPNGatewayConnectionIdentity from the specified map of raw messages. -func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchVPNGatewayConnectionIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVolumeProfileIdentityByHref unmarshals an instance of VolumeProfileIdentityByHref from the specified map of raw messages. +func UnmarshalVolumeProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeProfileIdentityByName : VolumeProfileIdentityByName struct +// This model "extends" VolumeProfileIdentity +type VolumeProfileIdentityByName struct { + // The globally unique name for this volume profile. + Name *string `json:"name" validate:"required"` +} + +// NewVolumeProfileIdentityByName : Instantiate VolumeProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewVolumeProfileIdentityByName(name string) (_model *VolumeProfileIdentityByName, err error) { + _model = &VolumeProfileIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VolumeProfileIdentityByName) isaVolumeProfileIdentity() bool { + return true +} + +// UnmarshalVolumeProfileIdentityByName unmarshals an instance of VolumeProfileIdentityByName from the specified map of raw messages. +func UnmarshalVolumeProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -93123,56 +107856,85 @@ func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity(m map[string]json.Ra return } -// RouteNextHopVPNGatewayConnectionReference : RouteNextHopVPNGatewayConnectionReference struct -// This model "extends" RouteNextHop -type RouteNextHopVPNGatewayConnectionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` +// VolumePrototypeVolumeByCapacity : VolumePrototypeVolumeByCapacity struct +// This model "extends" VolumePrototype +type VolumePrototypeVolumeByCapacity struct { + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this volume will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity" validate:"required"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` } -// Constants associated with the RouteNextHopVPNGatewayConnectionReference.ResourceType property. -// The resource type. -const ( - RouteNextHopVPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) +// NewVolumePrototypeVolumeByCapacity : Instantiate VolumePrototypeVolumeByCapacity (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeVolumeByCapacity(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, capacity int64) (_model *VolumePrototypeVolumeByCapacity, err error) { + _model = &VolumePrototypeVolumeByCapacity{ + Profile: profile, + Zone: zone, + Capacity: core.Int64Ptr(capacity), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*RouteNextHopVPNGatewayConnectionReference) isaRouteNextHop() bool { +func (*VolumePrototypeVolumeByCapacity) isaVolumePrototype() bool { return true } -// UnmarshalRouteNextHopVPNGatewayConnectionReference unmarshals an instance of RouteNextHopVPNGatewayConnectionReference from the specified map of raw messages. -func UnmarshalRouteNextHopVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopVPNGatewayConnectionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) +// UnmarshalVolumePrototypeVolumeByCapacity unmarshals an instance of VolumePrototypeVolumeByCapacity from the specified map of raw messages. +func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeVolumeByCapacity) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } @@ -93180,37 +107942,94 @@ func UnmarshalRouteNextHopVPNGatewayConnectionReference(m map[string]json.RawMes return } -// RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP : RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP -// This model "extends" RoutePrototypeNextHop -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct { - // The sentinel IP address (`0.0.0.0`). +// VolumePrototypeVolumeBySourceSnapshot : VolumePrototypeVolumeBySourceSnapshot struct +// This model "extends" VolumePrototype +type VolumePrototypeVolumeBySourceSnapshot struct { + // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` + + // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. + UserTags []string `json:"user_tags,omitempty"` + + // The zone this volume will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} + // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. + Capacity *int64 `json:"capacity,omitempty"` -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool { - return true + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` } -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPIntf interface { - RoutePrototypeNextHopIntf - isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool +// NewVolumePrototypeVolumeBySourceSnapshot : Instantiate VolumePrototypeVolumeBySourceSnapshot (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeVolumeBySourceSnapshot(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeVolumeBySourceSnapshot, err error) { + _model = &VolumePrototypeVolumeBySourceSnapshot{ + Profile: profile, + Zone: zone, + SourceSnapshot: sourceSnapshot, + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHop() bool { +func (*VolumePrototypeVolumeBySourceSnapshot) isaVolumePrototype() bool { return true } -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalVolumePrototypeVolumeBySourceSnapshot unmarshals an instance of VolumePrototypeVolumeBySourceSnapshot from the specified map of raw messages. +func UnmarshalVolumePrototypeVolumeBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeVolumeBySourceSnapshot) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -93218,39 +108037,29 @@ func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(m map[str return } -// RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref -// This model "extends" RoutePrototypeNextHop -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool { - return true +// ZoneIdentityByHref : ZoneIdentityByHref struct +// This model "extends" ZoneIdentity +type ZoneIdentityByHref struct { + // The URL for this zone. + Href *string `json:"href" validate:"required"` } -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityIntf interface { - RoutePrototypeNextHopIntf - isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool +// NewZoneIdentityByHref : Instantiate ZoneIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewZoneIdentityByHref(href string) (_model *ZoneIdentityByHref, err error) { + _model = &ZoneIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHop() bool { +func (*ZoneIdentityByHref) isaZoneIdentity() bool { return true } -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } +// UnmarshalZoneIdentityByHref unmarshals an instance of ZoneIdentityByHref from the specified map of raw messages. +func UnmarshalZoneIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -93259,30 +108068,30 @@ func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIden return } -// RoutingTableIdentityByHref : RoutingTableIdentityByHref struct -// This model "extends" RoutingTableIdentity -type RoutingTableIdentityByHref struct { - // The URL for this routing table. - Href *string `json:"href" validate:"required"` +// ZoneIdentityByName : ZoneIdentityByName struct +// This model "extends" ZoneIdentity +type ZoneIdentityByName struct { + // The globally unique name for this zone. + Name *string `json:"name" validate:"required"` } -// NewRoutingTableIdentityByHref : Instantiate RoutingTableIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRoutingTableIdentityByHref(href string) (_model *RoutingTableIdentityByHref, err error) { - _model = &RoutingTableIdentityByHref{ - Href: core.StringPtr(href), +// NewZoneIdentityByName : Instantiate ZoneIdentityByName (Generic Model Constructor) +func (*VpcV1) NewZoneIdentityByName(name string) (_model *ZoneIdentityByName, err error) { + _model = &ZoneIdentityByName{ + Name: core.StringPtr(name), } err = core.ValidateStruct(_model, "required parameters") return } -func (*RoutingTableIdentityByHref) isaRoutingTableIdentity() bool { +func (*ZoneIdentityByName) isaZoneIdentity() bool { return true } -// UnmarshalRoutingTableIdentityByHref unmarshals an instance of RoutingTableIdentityByHref from the specified map of raw messages. -func UnmarshalRoutingTableIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalZoneIdentityByName unmarshals an instance of ZoneIdentityByName from the specified map of raw messages. +func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -93290,30 +108099,34 @@ func UnmarshalRoutingTableIdentityByHref(m map[string]json.RawMessage, result in return } -// RoutingTableIdentityByID : RoutingTableIdentityByID struct -// This model "extends" RoutingTableIdentity -type RoutingTableIdentityByID struct { - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` +// BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct +// This model "extends" BackupPolicyScopePrototypeEnterpriseIdentity +type BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct { + // The CRN for this enterprise. + CRN *string `json:"crn" validate:"required"` } -// NewRoutingTableIdentityByID : Instantiate RoutingTableIdentityByID (Generic Model Constructor) -func (*VpcV1) NewRoutingTableIdentityByID(id string) (_model *RoutingTableIdentityByID, err error) { - _model = &RoutingTableIdentityByID{ - ID: core.StringPtr(id), +// NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : Instantiate BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(crn string) (_model *BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN, err error) { + _model = &BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*RoutingTableIdentityByID) isaRoutingTableIdentity() bool { +func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { return true } -// UnmarshalRoutingTableIdentityByID unmarshals an instance of RoutingTableIdentityByID from the specified map of raw messages. -func UnmarshalRoutingTableIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototype() bool { + return true +} + +// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN from the specified map of raw messages. +func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -93321,29 +108134,33 @@ func UnmarshalRoutingTableIdentityByID(m map[string]json.RawMessage, result inte return } -// SecurityGroupIdentityByCRN : SecurityGroupIdentityByCRN struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByCRN struct { - // The security group's CRN. +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. CRN *string `json:"crn" validate:"required"` } -// NewSecurityGroupIdentityByCRN : Instantiate SecurityGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByCRN(crn string) (_model *SecurityGroupIdentityByCRN, err error) { - _model = &SecurityGroupIdentityByCRN{ +// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupIdentityByCRN) isaSecurityGroupIdentity() bool { +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupIdentityByCRN unmarshals an instance of SecurityGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByCRN) +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -93352,29 +108169,33 @@ func UnmarshalSecurityGroupIdentityByCRN(m map[string]json.RawMessage, result in return } -// SecurityGroupIdentityByHref : SecurityGroupIdentityByHref struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByHref struct { - // The security group's canonical URL. +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. Href *string `json:"href" validate:"required"` } -// NewSecurityGroupIdentityByHref : Instantiate SecurityGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByHref(href string) (_model *SecurityGroupIdentityByHref, err error) { - _model = &SecurityGroupIdentityByHref{ +// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupIdentityByHref) isaSecurityGroupIdentity() bool { +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupIdentityByHref unmarshals an instance of SecurityGroupIdentityByHref from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByHref) +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -93383,29 +108204,33 @@ func UnmarshalSecurityGroupIdentityByHref(m map[string]json.RawMessage, result i return } -// SecurityGroupIdentityByID : SecurityGroupIdentityByID struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByID struct { - // The unique identifier for this security group. +// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. ID *string `json:"id" validate:"required"` } -// NewSecurityGroupIdentityByID : Instantiate SecurityGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByID(id string) (_model *SecurityGroupIdentityByID, err error) { - _model = &SecurityGroupIdentityByID{ +// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupIdentityByID) isaSecurityGroupIdentity() bool { +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupIdentityByID unmarshals an instance of SecurityGroupIdentityByID from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByID) +func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -93414,80 +108239,34 @@ func UnmarshalSecurityGroupIdentityByID(m map[string]json.RawMessage, result int return } -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` +// EndpointGatewayReservedIPReservedIPIdentityByHref : EndpointGatewayReservedIPReservedIPIdentityByHref struct +// This model "extends" EndpointGatewayReservedIPReservedIPIdentity +type EndpointGatewayReservedIPReservedIPIdentityByHref struct { + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` } -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllProtocolAllConst = "all" -) - -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), +// NewEndpointGatewayReservedIPReservedIPIdentityByHref : Instantiate EndpointGatewayReservedIPReservedIPIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByHref(href string) (_model *EndpointGatewayReservedIPReservedIPIdentityByHref, err error) { + _model = &EndpointGatewayReservedIPReservedIPIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) isaSecurityGroupRulePrototype() bool { +func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIPReservedIPIdentity() bool { return true } -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) +func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIP() bool { + return true +} + +// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByHref from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIPReservedIPIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -93495,98 +108274,84 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(m map[strin return } -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp struct { - // The ICMP traffic code to allow. - // - // If specified, `type` must also be specified. If unspecified, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` +// EndpointGatewayReservedIPReservedIPIdentityByID : EndpointGatewayReservedIPReservedIPIdentityByID struct +// This model "extends" EndpointGatewayReservedIPReservedIPIdentity +type EndpointGatewayReservedIPReservedIPIdentityByID struct { + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` +} - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` +// NewEndpointGatewayReservedIPReservedIPIdentityByID : Instantiate EndpointGatewayReservedIPReservedIPIdentityByID (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByID(id string) (_model *EndpointGatewayReservedIPReservedIPIdentityByID, err error) { + _model = &EndpointGatewayReservedIPReservedIPIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` +func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIPReservedIPIdentity() bool { + return true +} - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` +func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIP() bool { + return true +} - // The ICMP traffic type to allow. - // - // If unspecified, all types are allowed. - Type *int64 `json:"type,omitempty"` +// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByID from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIPReservedIPIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" -) +// EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct +// This model "extends" EndpointGatewayTargetPrototypeProviderCloudServiceIdentity +type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn" validate:"required"` +} -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Protocol property. -// The protocol to enforce. +// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.ResourceType property. +// The type of target for this endpoint gateway. const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" + EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" ) -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), +// NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : Instantiate EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(resourceType string, crn string) (_model *EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN, err error) { + _model = &EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN{ + ResourceType: core.StringPtr(resourceType), + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) isaSecurityGroupRulePrototype() bool { +func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { return true } -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) +func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototype() bool { + return true +} + +// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -93594,104 +108359,50 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(m map[stri return } -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. -// -// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are -// allowed for the protocol. When both have the same value, that single destination port is allowed. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - // - // If specified, `port_min` must also be specified, and must not be larger. If unspecified, - // `port_min` must also be unspecified, allowing traffic on all destination ports. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range - // - // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be - // unspecified, allowing traffic on all destination ports. - PortMin *int64 `json:"port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` +// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : The name of this provider infrastructure service. +// This model "extends" EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity +type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name" validate:"required"` } -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. +// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.ResourceType property. +// The type of target for this endpoint gateway. const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" ) -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), +// NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : Instantiate EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(resourceType string, name string) (_model *EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName, err error) { + _model = &EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName{ + ResourceType: core.StringPtr(resourceType), + Name: core.StringPtr(name), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRulePrototype() bool { +func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { return true } -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) +func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototype() bool { + return true +} + +// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -93699,32 +108410,38 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[st return } -// SecurityGroupRuleRemotePatchCIDR : SecurityGroupRuleRemotePatchCIDR struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` +// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity +type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` } -// NewSecurityGroupRuleRemotePatchCIDR : Instantiate SecurityGroupRuleRemotePatchCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePatchCIDR, err error) { - _model = &SecurityGroupRuleRemotePatchCIDR{ - CIDRBlock: core.StringPtr(cidrBlock), +// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRuleRemotePatchCIDR) isaSecurityGroupRuleRemotePatch() bool { +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupRuleRemotePatchCIDR unmarshals an instance of SecurityGroupRuleRemotePatchCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { + return true +} + +// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -93732,34 +108449,39 @@ func UnmarshalSecurityGroupRuleRemotePatchCIDR(m map[string]json.RawMessage, res return } -// SecurityGroupRuleRemotePatchIP : SecurityGroupRuleRemotePatchIP struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchIP struct { - // The IP address. +// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity +type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { + // The unique identifier for this bare metal server network interface. // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` } -// NewSecurityGroupRuleRemotePatchIP : Instantiate SecurityGroupRuleRemotePatchIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchIP(address string) (_model *SecurityGroupRuleRemotePatchIP, err error) { - _model = &SecurityGroupRuleRemotePatchIP{ - Address: core.StringPtr(address), +// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRuleRemotePatchIP) isaSecurityGroupRuleRemotePatch() bool { +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupRuleRemotePatchIP unmarshals an instance of SecurityGroupRuleRemotePatchIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { + return true +} + +// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -93767,47 +108489,37 @@ func UnmarshalSecurityGroupRuleRemotePatchIP(m map[string]json.RawMessage, resul return } -// SecurityGroupRuleRemotePatchSecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchSecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` +// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity +type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. + Href *string `json:"href" validate:"required"` } -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { - return true +// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -type SecurityGroupRuleRemotePatchSecurityGroupIdentityIntf interface { - SecurityGroupRuleRemotePatchIntf - isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool +func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { + return true } -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatch() bool { +func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { return true } -// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -93816,32 +108528,39 @@ func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity(m map[string]jso return } -// SecurityGroupRuleRemotePrototypeCIDR : SecurityGroupRuleRemotePrototypeCIDR struct -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` +// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity +type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. + ID *string `json:"id" validate:"required"` } -// NewSecurityGroupRuleRemotePrototypeCIDR : Instantiate SecurityGroupRuleRemotePrototypeCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePrototypeCIDR, err error) { - _model = &SecurityGroupRuleRemotePrototypeCIDR{ - CIDRBlock: core.StringPtr(cidrBlock), +// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRuleRemotePrototypeCIDR) isaSecurityGroupRuleRemotePrototype() bool { +func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupRuleRemotePrototypeCIDR unmarshals an instance of SecurityGroupRuleRemotePrototypeCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) +func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { + return true +} + +// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -93849,34 +108568,34 @@ func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, return } -// SecurityGroupRuleRemotePrototypeIP : SecurityGroupRuleRemotePrototypeIP struct -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity +type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` } -// NewSecurityGroupRuleRemotePrototypeIP : Instantiate SecurityGroupRuleRemotePrototypeIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeIP(address string) (_model *SecurityGroupRuleRemotePrototypeIP, err error) { - _model = &SecurityGroupRuleRemotePrototypeIP{ - Address: core.StringPtr(address), +// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SecurityGroupRuleRemotePrototypeIP) isaSecurityGroupRuleRemotePrototype() bool { +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSecurityGroupRuleRemotePrototypeIP unmarshals an instance of SecurityGroupRuleRemotePrototypeIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPatch() bool { + return true +} + +// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -93884,47 +108603,33 @@ func UnmarshalSecurityGroupRuleRemotePrototypeIP(m map[string]json.RawMessage, r return } -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` +// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity +type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` } -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true +// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentityIntf interface { - SecurityGroupRuleRemotePrototypeIntf - isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { + return true } -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototype() bool { +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { return true } -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -93933,49 +108638,34 @@ func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string return } -// SecurityGroupRuleRemoteCIDR : SecurityGroupRuleRemoteCIDR struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` -} - -func (*SecurityGroupRuleRemoteCIDR) isaSecurityGroupRuleRemote() bool { - return true +// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity +type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` } -// UnmarshalSecurityGroupRuleRemoteCIDR unmarshals an instance of SecurityGroupRuleRemoteCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return +// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// SecurityGroupRuleRemoteIP : SecurityGroupRuleRemoteIP struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { + return true } -func (*SecurityGroupRuleRemoteIP) isaSecurityGroupRuleRemote() bool { +func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { return true } -// UnmarshalSecurityGroupRuleRemoteIP unmarshals an instance of SecurityGroupRuleRemoteIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -93983,319 +108673,192 @@ func UnmarshalSecurityGroupRuleRemoteIP(m map[string]json.RawMessage, result int return } -// SecurityGroupRuleRemoteSecurityGroupReference : SecurityGroupRuleRemoteSecurityGroupReference struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteSecurityGroupReference struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. +// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity +type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { + // The URL for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` +} - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` +// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { + return true } -func (*SecurityGroupRuleRemoteSecurityGroupReference) isaSecurityGroupRuleRemote() bool { +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { return true } -// UnmarshalSecurityGroupRuleRemoteSecurityGroupReference unmarshals an instance of SecurityGroupRuleRemoteSecurityGroupReference from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteSecurityGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupRuleSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolAll struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. +// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity +type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { + // The unique identifier for this bare metal server network interface. + // + // If this bare metal server has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" -) +// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllProtocolAllConst = "all" -) +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupRuleSecurityGroupRuleProtocolAll) isaSecurityGroupRule() bool { +func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { return true } -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupRuleSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolIcmp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. +// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity +type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { + // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The ICMP traffic code to allow. If absent, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to allow. If absent, all types are allowed. - Type *int64 `json:"type,omitempty"` } -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) +// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" -) +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupRuleSecurityGroupRuleProtocolIcmp) isaSecurityGroupRule() bool { +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { return true } -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupRuleSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. -// -// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are -// allowed for the protocol. When both have the same value, that single destination port is allowed. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolTcpudp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. +// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity +type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - PortMin *int64 `json:"port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) +// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" -) +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRule() bool { +func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { return true } -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity +type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` +} + +// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPrototype() bool { + return true +} + +// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -94303,56 +108866,69 @@ func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp(m map[string]json return } -// SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. +// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity +type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. Href *string `json:"href" validate:"required"` +} - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } +// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity +type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` +} + +// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { + return true +} + +// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -94360,127 +108936,174 @@ func UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferen return } -// SecurityGroupTargetReferenceEndpointGatewayReference : SecurityGroupTargetReferenceEndpointGatewayReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceEndpointGatewayReference struct { - // The CRN for this endpoint gateway. +// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct +// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity +type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct { + // The CRN for this virtual server instance. CRN *string `json:"crn" validate:"required"` +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN, err error) { + _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceEndpointGatewayReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" -) +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceEndpointGatewayReference) isaSecurityGroupTargetReference() bool { +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference unmarshals an instance of SecurityGroupTargetReferenceEndpointGatewayReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceEndpointGatewayReference) +// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity +type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct { + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref{ + Href: core.StringPtr(href), } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupTargetReferenceLoadBalancerReference : SecurityGroupTargetReferenceLoadBalancerReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceLoadBalancerReference struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` - - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer. +// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity +type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct { + // The unique identifier for this virtual server instance. ID *string `json:"id" validate:"required"` +} - // The name for this load balancer. The name is unique across all load balancers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceLoadBalancerReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" -) +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceLoadBalancerReference) isaSecurityGroupTargetReference() bool { +func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceLoadBalancerReference unmarshals an instance of SecurityGroupTargetReferenceLoadBalancerReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceLoadBalancerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref : FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity +type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref struct { + // The URL for this instance network attachment. + Href *string `json:"href" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref{ + Href: core.StringPtr(href), } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID : FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity +type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID struct { + // The unique identifier for this instance network attachment. + ID *string `json:"id" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID : Instantiate FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -94488,198 +109111,183 @@ func UnmarshalSecurityGroupTargetReferenceLoadBalancerReference(m map[string]jso return } -// SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - +// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity +type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { // The URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` +} - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } +// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupTargetReferenceVPNServerReference : SecurityGroupTargetReferenceVPNServerReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. +// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity +type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { + // The unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` +} - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceVPNServerReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" -) +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceVPNServerReference) isaSecurityGroupTargetReference() bool { +func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceVPNServerReference unmarshals an instance of SecurityGroupTargetReferenceVPNServerReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } +// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupTargetReferenceVirtualNetworkInterfaceReference : SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct { - // The CRN for this virtual network interface. +// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct +// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity +type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct { + // The CRN for this subnet. CRN *string `json:"crn" validate:"required"` +} - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VirtualNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The primary IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` +// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN, err error) { + _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceVirtualNetworkInterfaceReferenceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { + return true +} -func (*SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) isaSecurityGroupTargetReference() bool { +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { return true } -// UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference unmarshals an instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) +// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceDeleted) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity +type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct { + // The URL for this subnet. + Href *string `json:"href" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref{ + Href: core.StringPtr(href), } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity +type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct { + // The unique identifier for this subnet. + ID *string `json:"id" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -94687,29 +109295,33 @@ func UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference(m map return } -// ShareIdentityByCRN : ShareIdentityByCRN struct -// This model "extends" ShareIdentity -type ShareIdentityByCRN struct { - // The CRN for this file share. +// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct +// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity +type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct { + // The CRN for this VPC. CRN *string `json:"crn" validate:"required"` } -// NewShareIdentityByCRN : Instantiate ShareIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByCRN(crn string) (_model *ShareIdentityByCRN, err error) { - _model = &ShareIdentityByCRN{ +// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN, err error) { + _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN{ CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareIdentityByCRN) isaShareIdentity() bool { +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { return true } -// UnmarshalShareIdentityByCRN unmarshals an instance of ShareIdentityByCRN from the specified map of raw messages. -func UnmarshalShareIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByCRN) +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -94718,29 +109330,33 @@ func UnmarshalShareIdentityByCRN(m map[string]json.RawMessage, result interface{ return } -// ShareIdentityByHref : ShareIdentityByHref struct -// This model "extends" ShareIdentity -type ShareIdentityByHref struct { - // The URL for this file share. +// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity +type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct { + // The URL for this VPC. Href *string `json:"href" validate:"required"` } -// NewShareIdentityByHref : Instantiate ShareIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByHref(href string) (_model *ShareIdentityByHref, err error) { - _model = &ShareIdentityByHref{ +// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareIdentityByHref) isaShareIdentity() bool { +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { return true } -// UnmarshalShareIdentityByHref unmarshals an instance of ShareIdentityByHref from the specified map of raw messages. -func UnmarshalShareIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByHref) +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -94749,29 +109365,33 @@ func UnmarshalShareIdentityByHref(m map[string]json.RawMessage, result interface return } -// ShareIdentityByID : ShareIdentityByID struct -// This model "extends" ShareIdentity -type ShareIdentityByID struct { - // The unique identifier for this file share. +// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity +type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct { + // The unique identifier for this VPC. ID *string `json:"id" validate:"required"` } -// NewShareIdentityByID : Instantiate ShareIdentityByID (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByID(id string) (_model *ShareIdentityByID, err error) { - _model = &ShareIdentityByID{ +// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareIdentityByID) isaShareIdentity() bool { +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { return true } -// UnmarshalShareIdentityByID unmarshals an instance of ShareIdentityByID from the specified map of raw messages. -func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByID) +func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -94780,59 +109400,34 @@ func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{} return } -// ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : The virtual network interface for this share mount target. The virtual network interface's VPC must not be used by a -// virtual network interface for another mount target for this share. -// -// Required if the share's `access_control_mode` is `security_group`. -// This model "extends" ShareMountTargetPrototype -type ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface" validate:"required"` +// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity +type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` } -// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionUserManagedConst = "user_managed" -) - -// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { - _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup{ - VirtualNetworkInterface: virtualNetworkInterface, +// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) isaShareMountTargetPrototype() bool { +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup from the specified map of raw messages. -func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -94840,60 +109435,69 @@ func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecuri return } -// ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : The VPC in which clients can mount the file share using this mount target. The VPC must not be used by another mount -// target for this share. -// -// Required if the share's `access_control_mode` is `vpc`. -// This model "extends" ShareMountTargetPrototype -type ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` +// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity +type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` } -// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionUserManagedConst = "user_managed" -) - -// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { - _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC{ - VPC: vpc, +// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) isaShareMountTargetPrototype() bool { +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC from the specified map of raw messages. -func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity +type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` +} + +// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { + return true +} + +// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -94901,62 +109505,58 @@ func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m return } -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext : The virtual network interface for this target. -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototype -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext struct { - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct +// Models which "extend" this model: +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` - // The resource group to use for this virtual network interface. If unspecified, the - // share's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` +} - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { + return true } -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecIntf interface { + InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf + isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) if err != nil { return } @@ -94964,49 +109564,57 @@ func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInte return } -// ShareProfileCapacityDependentRange : The permitted total capacity (in gigabytes) of a share with this profile depends on its configuration. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityDependentRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct +// Models which "extend" this model: +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` } -// Constants associated with the ShareProfileCapacityDependentRange.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityDependentRangeTypeDependentConst = "dependent" - ShareProfileCapacityDependentRangeTypeDependentRangeConst = "dependent_range" -) +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { + return true +} -func (*ShareProfileCapacityDependentRange) isaShareProfileCapacity() bool { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtIntf interface { + InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf + isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -// UnmarshalShareProfileCapacityDependentRange unmarshals an instance of ShareProfileCapacityDependentRange from the specified map of raw messages. -func UnmarshalShareProfileCapacityDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityDependentRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) if err != nil { return } @@ -95014,132 +109622,154 @@ func UnmarshalShareProfileCapacityDependentRange(m map[string]json.RawMessage, r return } -// ShareProfileCapacityEnum : The permitted total capacities (in gigabytes) of a share with this profile. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` +// InstanceGroupManagerActionScheduledActionGroupTarget : InstanceGroupManagerActionScheduledActionGroupTarget struct +// This model "extends" InstanceGroupManagerActionScheduledAction +type InstanceGroupManagerActionScheduledActionGroupTarget struct { + // Indicates whether this scheduled action will be automatically deleted after it has completed and + // `auto_delete_timeout` hours have passed. At present, this is always + // `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically + // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the + // future. + AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` + // The date and time that the instance group manager action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance group manager action. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager action. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager action. The name is unique across all actions for the instance group + // manager. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance group action + // - `active`: Action is ready to be run + // - `completed`: Action was completed successfully + // - `failed`: Action could not be completed successfully + // - `incompatible`: Action parameters are not compatible with the group or manager + // - `omitted`: Action was not applied because this action's manager was disabled. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group manager action was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of action for the instance group. + ActionType *string `json:"action_type" validate:"required"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + // The date and time the scheduled action was last applied. If absent, the action has never been applied. + LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + + // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run + // time. + NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + + Group *InstanceGroupManagerScheduledActionGroup `json:"group" validate:"required"` } -// Constants associated with the ShareProfileCapacityEnum.Type property. -// The type for this profile field. +// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ResourceType property. +// The resource type. const ( - ShareProfileCapacityEnumTypeEnumConst = "enum" + InstanceGroupManagerActionScheduledActionGroupTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" ) -func (*ShareProfileCapacityEnum) isaShareProfileCapacity() bool { +// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.Status property. +// The status of the instance group action +// - `active`: Action is ready to be run +// - `completed`: Action was completed successfully +// - `failed`: Action could not be completed successfully +// - `incompatible`: Action parameters are not compatible with the group or manager +// - `omitted`: Action was not applied because this action's manager was disabled. +const ( + InstanceGroupManagerActionScheduledActionGroupTargetStatusActiveConst = "active" + InstanceGroupManagerActionScheduledActionGroupTargetStatusCompletedConst = "completed" + InstanceGroupManagerActionScheduledActionGroupTargetStatusFailedConst = "failed" + InstanceGroupManagerActionScheduledActionGroupTargetStatusIncompatibleConst = "incompatible" + InstanceGroupManagerActionScheduledActionGroupTargetStatusOmittedConst = "omitted" +) + +// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ActionType property. +// The type of action for the instance group. +const ( + InstanceGroupManagerActionScheduledActionGroupTargetActionTypeScheduledConst = "scheduled" +) + +func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerActionScheduledAction() bool { return true } -// UnmarshalShareProfileCapacityEnum unmarshals an instance of ShareProfileCapacityEnum from the specified map of raw messages. -func UnmarshalShareProfileCapacityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerAction() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionGroupTarget from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionScheduledActionGroupTarget) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityFixed : The permitted total capacity (in gigabytes) of a share with this profile is fixed. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityFixed.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityFixedTypeFixedConst = "fixed" -) - -func (*ShareProfileCapacityFixed) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityFixed unmarshals an instance of ShareProfileCapacityFixed from the specified map of raw messages. -func UnmarshalShareProfileCapacityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityRange : The permitted total capacity range (in gigabytes) of a share with this profile. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityRange.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityRangeTypeRangeConst = "range" -) - -func (*ShareProfileCapacityRange) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityRange unmarshals an instance of ShareProfileCapacityRange from the specified map of raw messages. -func UnmarshalShareProfileCapacityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) if err != nil { return } @@ -95147,182 +109777,154 @@ func UnmarshalShareProfileCapacityRange(m map[string]json.RawMessage, result int return } -// ShareProfileIopsDependentRange : The permitted IOPS range of a share with this profile depends on its configuration. -// This model "extends" ShareProfileIops -type ShareProfileIopsDependentRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` +// InstanceGroupManagerActionScheduledActionManagerTarget : InstanceGroupManagerActionScheduledActionManagerTarget struct +// This model "extends" InstanceGroupManagerActionScheduledAction +type InstanceGroupManagerActionScheduledActionManagerTarget struct { + // Indicates whether this scheduled action will be automatically deleted after it has completed and + // `auto_delete_timeout` hours have passed. At present, this is always + // `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` + // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically + // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the + // future. + AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` + // The date and time that the instance group manager action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The URL for this instance group manager action. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager action. + ID *string `json:"id" validate:"required"` + + // The name for this instance group manager action. The name is unique across all actions for the instance group + // manager. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance group action + // - `active`: Action is ready to be run + // - `completed`: Action was completed successfully + // - `failed`: Action could not be completed successfully + // - `incompatible`: Action parameters are not compatible with the group or manager + // - `omitted`: Action was not applied because this action's manager was disabled. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group manager action was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of action for the instance group. + ActionType *string `json:"action_type" validate:"required"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + // The date and time the scheduled action was last applied. If absent, the action has never been applied. + LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + + // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run + // time. + NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager" validate:"required"` } -// Constants associated with the ShareProfileIopsDependentRange.Type property. -// The type for this profile field. +// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ResourceType property. +// The resource type. const ( - ShareProfileIopsDependentRangeTypeDependentConst = "dependent" - ShareProfileIopsDependentRangeTypeDependentRangeConst = "dependent_range" + InstanceGroupManagerActionScheduledActionManagerTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" ) -func (*ShareProfileIopsDependentRange) isaShareProfileIops() bool { +// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.Status property. +// The status of the instance group action +// - `active`: Action is ready to be run +// - `completed`: Action was completed successfully +// - `failed`: Action could not be completed successfully +// - `incompatible`: Action parameters are not compatible with the group or manager +// - `omitted`: Action was not applied because this action's manager was disabled. +const ( + InstanceGroupManagerActionScheduledActionManagerTargetStatusActiveConst = "active" + InstanceGroupManagerActionScheduledActionManagerTargetStatusCompletedConst = "completed" + InstanceGroupManagerActionScheduledActionManagerTargetStatusFailedConst = "failed" + InstanceGroupManagerActionScheduledActionManagerTargetStatusIncompatibleConst = "incompatible" + InstanceGroupManagerActionScheduledActionManagerTargetStatusOmittedConst = "omitted" +) + +// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ActionType property. +// The type of action for the instance group. +const ( + InstanceGroupManagerActionScheduledActionManagerTargetActionTypeScheduledConst = "scheduled" +) + +func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerActionScheduledAction() bool { return true } -// UnmarshalShareProfileIopsDependentRange unmarshals an instance of ShareProfileIopsDependentRange from the specified map of raw messages. -func UnmarshalShareProfileIopsDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsDependentRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) +func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerAction() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionManagerTarget from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionScheduledActionManagerTarget) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsEnum : The permitted IOPS values of a share with this profile. -// This model "extends" ShareProfileIops -type ShareProfileIopsEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the ShareProfileIopsEnum.Type property. -// The type for this profile field. -const ( - ShareProfileIopsEnumTypeEnumConst = "enum" -) - -func (*ShareProfileIopsEnum) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsEnum unmarshals an instance of ShareProfileIopsEnum from the specified map of raw messages. -func UnmarshalShareProfileIopsEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsFixed : The permitted IOPS of a share with this profile is fixed. -// This model "extends" ShareProfileIops -type ShareProfileIopsFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the ShareProfileIopsFixed.Type property. -// The type for this profile field. -const ( - ShareProfileIopsFixedTypeFixedConst = "fixed" -) - -func (*ShareProfileIopsFixed) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsFixed unmarshals an instance of ShareProfileIopsFixed from the specified map of raw messages. -func UnmarshalShareProfileIopsFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsRange : The permitted IOPS range of a share with this profile. -// This model "extends" ShareProfileIops -type ShareProfileIopsRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileIopsRange.Type property. -// The type for this profile field. -const ( - ShareProfileIopsRangeTypeRangeConst = "range" -) - -func (*ShareProfileIopsRange) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsRange unmarshals an instance of ShareProfileIopsRange from the specified map of raw messages. -func UnmarshalShareProfileIopsRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) if err != nil { return } @@ -95330,29 +109932,47 @@ func UnmarshalShareProfileIopsRange(m map[string]json.RawMessage, result interfa return } -// ShareProfileIdentityByHref : ShareProfileIdentityByHref struct -// This model "extends" ShareProfileIdentity -type ShareProfileIdentityByHref struct { - // The URL for this share profile. +// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct +// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype +type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The URL for this instance group manager. Href *string `json:"href" validate:"required"` } -// NewShareProfileIdentityByHref : Instantiate ShareProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewShareProfileIdentityByHref(href string) (_model *ShareProfileIdentityByHref, err error) { - _model = &ShareProfileIdentityByHref{ +// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(href string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref, err error) { + _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareProfileIdentityByHref) isaShareProfileIdentity() bool { +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { return true } -// UnmarshalShareProfileIdentityByHref unmarshals an instance of ShareProfileIdentityByHref from the specified map of raw messages. -func UnmarshalShareProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentityByHref) +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -95361,30 +109981,48 @@ func UnmarshalShareProfileIdentityByHref(m map[string]json.RawMessage, result in return } -// ShareProfileIdentityByName : ShareProfileIdentityByName struct -// This model "extends" ShareProfileIdentity -type ShareProfileIdentityByName struct { - // The globally unique name for this share profile. - Name *string `json:"name" validate:"required"` +// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct +// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype +type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` } -// NewShareProfileIdentityByName : Instantiate ShareProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewShareProfileIdentityByName(name string) (_model *ShareProfileIdentityByName, err error) { - _model = &ShareProfileIdentityByName{ - Name: core.StringPtr(name), +// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(id string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID, err error) { + _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID{ + ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*ShareProfileIdentityByName) isaShareProfileIdentity() bool { +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { return true } -// UnmarshalShareProfileIdentityByName unmarshals an instance of ShareProfileIdentityByName from the specified map of raw messages. -func UnmarshalShareProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -95392,142 +110030,34 @@ func UnmarshalShareProfileIdentityByName(m map[string]json.RawMessage, result in return } -// SharePrototypeShareBySize : Create a file share by size. -// This model "extends" SharePrototype -type SharePrototypeShareBySize struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The - // profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. Mount targets for this share - // require a virtual network interface. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // Mount targets for this share require a VPC. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The root key to use to wrap the data encryption key for the share. - // - // If unspecified, the `encryption` type for the share will be `provider_managed`. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The owner assigned to the file share at creation. Subsequent changes to the owner - // must be performed by a client that has mounted the file share. - InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size" validate:"required"` +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` } -// Constants associated with the SharePrototypeShareBySize.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. Mount targets for this share -// require a virtual network interface. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// Mount targets for this share require a VPC. -const ( - SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" - SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" -) - -// NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { - _model = &SharePrototypeShareBySize{ - Profile: profile, - Zone: zone, - Size: core.Int64Ptr(size), +// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SharePrototypeShareBySize) isaSharePrototype() bool { +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSharePrototypeShareBySize unmarshals an instance of SharePrototypeShareBySize from the specified map of raw messages. -func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareBySize) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -95535,107 +110065,174 @@ func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result int return } -// SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for `access_control_mode`, -// `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. -// This model "extends" SharePrototype -type SharePrototypeShareBySourceShare struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The - // profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` - - // The resource group to use. If unspecified, the resource group from - // the source share will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. - SourceShare ShareIdentityIntf `json:"source_share" validate:"required"` +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` } -// NewSharePrototypeShareBySourceShare : Instantiate SharePrototypeShareBySourceShare (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { - _model = &SharePrototypeShareBySourceShare{ - Profile: profile, - Zone: zone, - ReplicationCronSpec: core.StringPtr(replicationCronSpec), - SourceShare: sourceShare, +// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SharePrototypeShareBySourceShare) isaSharePrototype() bool { +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { return true } -// UnmarshalSharePrototypeShareBySourceShare unmarshals an instance of SharePrototypeShareBySourceShare from the specified map of raw messages. -func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareBySourceShare) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity +type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` +} + +// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { + return true +} + +// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ + CRN: core.StringPtr(crn), } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -95643,29 +110240,33 @@ func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, res return } -// SnapshotIdentityByCRN : SnapshotIdentityByCRN struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByCRN struct { - // The CRN of this snapshot. +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct { + // The CRN for this dedicated host. CRN *string `json:"crn" validate:"required"` } -// NewSnapshotIdentityByCRN : Instantiate SnapshotIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByCRN(crn string) (_model *SnapshotIdentityByCRN, err error) { - _model = &SnapshotIdentityByCRN{ +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN{ CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SnapshotIdentityByCRN) isaSnapshotIdentity() bool { +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { return true } -// UnmarshalSnapshotIdentityByCRN unmarshals an instance of SnapshotIdentityByCRN from the specified map of raw messages. -func UnmarshalSnapshotIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByCRN) +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -95674,29 +110275,33 @@ func UnmarshalSnapshotIdentityByCRN(m map[string]json.RawMessage, result interfa return } -// SnapshotIdentityByHref : SnapshotIdentityByHref struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByHref struct { - // The URL for this snapshot. +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct { + // The URL for this dedicated host. Href *string `json:"href" validate:"required"` } -// NewSnapshotIdentityByHref : Instantiate SnapshotIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByHref(href string) (_model *SnapshotIdentityByHref, err error) { - _model = &SnapshotIdentityByHref{ +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SnapshotIdentityByHref) isaSnapshotIdentity() bool { +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { return true } -// UnmarshalSnapshotIdentityByHref unmarshals an instance of SnapshotIdentityByHref from the specified map of raw messages. -func UnmarshalSnapshotIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByHref) +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -95705,29 +110310,33 @@ func UnmarshalSnapshotIdentityByHref(m map[string]json.RawMessage, result interf return } -// SnapshotIdentityByID : SnapshotIdentityByID struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByID struct { - // The unique identifier for this snapshot. +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct { + // The unique identifier for this dedicated host. ID *string `json:"id" validate:"required"` } -// NewSnapshotIdentityByID : Instantiate SnapshotIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByID(id string) (_model *SnapshotIdentityByID, err error) { - _model = &SnapshotIdentityByID{ +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SnapshotIdentityByID) isaSnapshotIdentity() bool { +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { return true } -// UnmarshalSnapshotIdentityByID unmarshals an instance of SnapshotIdentityByID from the specified map of raw messages. -func UnmarshalSnapshotIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByID) +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -95736,74 +110345,69 @@ func UnmarshalSnapshotIdentityByID(m map[string]json.RawMessage, result interfac return } -// SnapshotPrototypeSnapshotBySourceSnapshot : SnapshotPrototypeSnapshotBySourceSnapshot struct -// This model "extends" SnapshotPrototype -type SnapshotPrototypeSnapshotBySourceSnapshot struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` +// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity +type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` +} - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { + return true +} - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { + return true +} - // The root key to use to wrap the data encryption key for this snapshot. - // - // A key must be specified if and only if the source snapshot has an `encryption` type of - // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify - // a key in the same region as the new snapshot, and use the same encryption key for all - // snapshots using the same source volume. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The source snapshot (in another region) to create this snapshot from. - // The specified snapshot must not already be the source of another snapshot in this - // region. - SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot" validate:"required"` +// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity +type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` } -// NewSnapshotPrototypeSnapshotBySourceSnapshot : Instantiate SnapshotPrototypeSnapshotBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceSnapshot(sourceSnapshot *SnapshotIdentityByCRN) (_model *SnapshotPrototypeSnapshotBySourceSnapshot, err error) { - _model = &SnapshotPrototypeSnapshotBySourceSnapshot{ - SourceSnapshot: sourceSnapshot, +// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ + Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SnapshotPrototypeSnapshotBySourceSnapshot) isaSnapshotPrototype() bool { +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { return true } -// UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot unmarshals an instance of SnapshotPrototypeSnapshotBySourceSnapshot from the specified map of raw messages. -func UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototypeSnapshotBySourceSnapshot) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -95811,58 +110415,139 @@ func UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot(m map[string]json.RawMes return } -// SnapshotPrototypeSnapshotBySourceVolume : SnapshotPrototypeSnapshotBySourceVolume struct -// This model "extends" SnapshotPrototype -type SnapshotPrototypeSnapshotBySourceVolume struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` +// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity +type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` +} - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { + return true +} - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` +func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { + return true +} - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewSnapshotPrototypeSnapshotBySourceVolume : Instantiate SnapshotPrototypeSnapshotBySourceVolume (Generic Model Constructor) -func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *SnapshotPrototypeSnapshotBySourceVolume, err error) { - _model = &SnapshotPrototypeSnapshotBySourceVolume{ - SourceVolume: sourceVolume, +// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity +type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct { + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` +} + +// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN{ + CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SnapshotPrototypeSnapshotBySourceVolume) isaSnapshotPrototype() bool { +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { return true } -// UnmarshalSnapshotPrototypeSnapshotBySourceVolume unmarshals an instance of SnapshotPrototypeSnapshotBySourceVolume from the specified map of raw messages. -func UnmarshalSnapshotPrototypeSnapshotBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototypeSnapshotBySourceVolume) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity +type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct { + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` +} + +// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref{ + Href: core.StringPtr(href), } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { + return true +} + +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct +// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity +type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct { + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` +} + +// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID, err error) { + _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID{ + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { + return true +} + +func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -95870,29 +110555,33 @@ func UnmarshalSnapshotPrototypeSnapshotBySourceVolume(m map[string]json.RawMessa return } -// SubnetIdentityByCRN : SubnetIdentityByCRN struct -// This model "extends" SubnetIdentity -type SubnetIdentityByCRN struct { - // The CRN for this subnet. +// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct +// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity +type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct { + // The CRN for this placement group. CRN *string `json:"crn" validate:"required"` } -// NewSubnetIdentityByCRN : Instantiate SubnetIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByCRN(crn string) (_model *SubnetIdentityByCRN, err error) { - _model = &SubnetIdentityByCRN{ +// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN, err error) { + _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN{ CRN: core.StringPtr(crn), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SubnetIdentityByCRN) isaSubnetIdentity() bool { +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { return true } -// UnmarshalSubnetIdentityByCRN unmarshals an instance of SubnetIdentityByCRN from the specified map of raw messages. -func UnmarshalSubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByCRN) +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return @@ -95901,29 +110590,33 @@ func UnmarshalSubnetIdentityByCRN(m map[string]json.RawMessage, result interface return } -// SubnetIdentityByHref : SubnetIdentityByHref struct -// This model "extends" SubnetIdentity -type SubnetIdentityByHref struct { - // The URL for this subnet. +// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct +// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity +type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct { + // The URL for this placement group. Href *string `json:"href" validate:"required"` } -// NewSubnetIdentityByHref : Instantiate SubnetIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByHref(href string) (_model *SubnetIdentityByHref, err error) { - _model = &SubnetIdentityByHref{ +// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref, err error) { + _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref{ Href: core.StringPtr(href), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SubnetIdentityByHref) isaSubnetIdentity() bool { +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { return true } -// UnmarshalSubnetIdentityByHref unmarshals an instance of SubnetIdentityByHref from the specified map of raw messages. -func UnmarshalSubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByHref) +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -95932,29 +110625,33 @@ func UnmarshalSubnetIdentityByHref(m map[string]json.RawMessage, result interfac return } -// SubnetIdentityByID : SubnetIdentityByID struct -// This model "extends" SubnetIdentity -type SubnetIdentityByID struct { - // The unique identifier for this subnet. +// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct +// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity +type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct { + // The unique identifier for this placement group. ID *string `json:"id" validate:"required"` } -// NewSubnetIdentityByID : Instantiate SubnetIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByID(id string) (_model *SubnetIdentityByID, err error) { - _model = &SubnetIdentityByID{ +// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID, err error) { + _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID{ ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") return } -func (*SubnetIdentityByID) isaSubnetIdentity() bool { +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { return true } -// UnmarshalSubnetIdentityByID unmarshals an instance of SubnetIdentityByID from the specified map of raw messages. -func UnmarshalSubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByID) +func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { + return true +} + +// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -95963,69 +110660,123 @@ func UnmarshalSubnetIdentityByID(m map[string]json.RawMessage, result interface{ return } -// SubnetPrototypeSubnetByCIDR : SubnetPrototypeSubnetByCIDR struct -// This model "extends" SubnetPrototype -type SubnetPrototypeSubnetByCIDR struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` +// InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct +// This model "extends" InstancePrototypeInstanceByCatalogOffering +type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be - // attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing - // table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` - // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of - // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix - // that contains the subnet's IPv4 CIDR. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// Constants associated with the SubnetPrototypeSubnetByCIDR.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeSubnetByCIDRIPVersionIpv4Const = "ipv4" -) + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// NewSubnetPrototypeSubnetByCIDR : Instantiate SubnetPrototypeSubnetByCIDR (Generic Model Constructor) -func (*VpcV1) NewSubnetPrototypeSubnetByCIDR(vpc VPCIdentityIntf, ipv4CIDRBlock string) (_model *SubnetPrototypeSubnetByCIDR, err error) { - _model = &SubnetPrototypeSubnetByCIDR{ - VPC: vpc, - Ipv4CIDRBlock: core.StringPtr(ipv4CIDRBlock), + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` +} + +// NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { + _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment{ + CatalogOffering: catalogOffering, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } err = core.ValidateStruct(_model, "required parameters") return } -func (*SubnetPrototypeSubnetByCIDR) isaSubnetPrototype() bool { +func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) isaInstancePrototypeInstanceByCatalogOffering() bool { return true } -// UnmarshalSubnetPrototypeSubnetByCIDR unmarshals an instance of SubnetPrototypeSubnetByCIDR from the specified map of raw messages. -func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototypeSubnetByCIDR) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) +func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -96033,11 +110784,15 @@ func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result i if err != nil { return } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -96045,7 +110800,15 @@ func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result i if err != nil { return } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } @@ -96053,7 +110816,11 @@ func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result i if err != nil { return } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } @@ -96061,71 +110828,135 @@ func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result i if err != nil { return } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SubnetPrototypeSubnetByTotalCount : SubnetPrototypeSubnetByTotalCount struct -// This model "extends" SubnetPrototype -type SubnetPrototypeSubnetByTotalCount struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` +// InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct +// This model "extends" InstancePrototypeInstanceByCatalogOffering +type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be - // attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing - // table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the - // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The zone this subnet will reside in. + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + + // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} -// Constants associated with the SubnetPrototypeSubnetByTotalCount.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeSubnetByTotalCountIPVersionIpv4Const = "ipv4" -) + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// NewSubnetPrototypeSubnetByTotalCount : Instantiate SubnetPrototypeSubnetByTotalCount (Generic Model Constructor) -func (*VpcV1) NewSubnetPrototypeSubnetByTotalCount(vpc VPCIdentityIntf, totalIpv4AddressCount int64, zone ZoneIdentityIntf) (_model *SubnetPrototypeSubnetByTotalCount, err error) { - _model = &SubnetPrototypeSubnetByTotalCount{ - VPC: vpc, - TotalIpv4AddressCount: core.Int64Ptr(totalIpv4AddressCount), - Zone: zone, + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +} + +// NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface, err error) { + _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface{ + CatalogOffering: catalogOffering, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") return } -func (*SubnetPrototypeSubnetByTotalCount) isaSubnetPrototype() bool { +func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) isaInstancePrototypeInstanceByCatalogOffering() bool { return true } -// UnmarshalSubnetPrototypeSubnetByTotalCount unmarshals an instance of SubnetPrototypeSubnetByTotalCount from the specified map of raw messages. -func UnmarshalSubnetPrototypeSubnetByTotalCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototypeSubnetByTotalCount) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) +func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -96133,11 +110964,15 @@ func UnmarshalSubnetPrototypeSubnetByTotalCount(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -96145,81 +110980,39 @@ func UnmarshalSubnetPrototypeSubnetByTotalCount(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatchPublicGatewayIdentityByCRN : SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` -} - -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(crn string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByCRN, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) isaSubnetPublicGatewayPatch() bool { - return true -} - -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByCRN from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatchPublicGatewayIdentityByHref : SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct { - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` -} - -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref(href string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByHref, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByHref) isaSubnetPublicGatewayPatch() bool { - return true -} - -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByHref from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -96227,460 +111020,180 @@ func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref(m map[string]j return } -// SubnetPublicGatewayPatchPublicGatewayIdentityByID : SubnetPublicGatewayPatchPublicGatewayIdentityByID struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByID struct { - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` -} +// InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct +// This model "extends" InstancePrototypeInstanceByImage +type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByID : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByID(id string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByID, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByID) isaSubnetPublicGatewayPatch() bool { - return true -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByID from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// TrustedProfileIdentityTrustedProfileByCRN : TrustedProfileIdentityTrustedProfileByCRN struct -// This model "extends" TrustedProfileIdentity -type TrustedProfileIdentityTrustedProfileByCRN struct { - // The CRN for this trusted profile. - CRN *string `json:"crn" validate:"required"` -} + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` -// NewTrustedProfileIdentityTrustedProfileByCRN : Instantiate TrustedProfileIdentityTrustedProfileByCRN (Generic Model Constructor) -func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByCRN(crn string) (_model *TrustedProfileIdentityTrustedProfileByCRN, err error) { - _model = &TrustedProfileIdentityTrustedProfileByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -func (*TrustedProfileIdentityTrustedProfileByCRN) isaTrustedProfileIdentity() bool { - return true -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// UnmarshalTrustedProfileIdentityTrustedProfileByCRN unmarshals an instance of TrustedProfileIdentityTrustedProfileByCRN from the specified map of raw messages. -func UnmarshalTrustedProfileIdentityTrustedProfileByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentityTrustedProfileByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` -// TrustedProfileIdentityTrustedProfileByID : TrustedProfileIdentityTrustedProfileByID struct -// This model "extends" TrustedProfileIdentity -type TrustedProfileIdentityTrustedProfileByID struct { - // The unique identifier for this trusted profile. - ID *string `json:"id" validate:"required"` -} + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// NewTrustedProfileIdentityTrustedProfileByID : Instantiate TrustedProfileIdentityTrustedProfileByID (Generic Model Constructor) -func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByID(id string) (_model *TrustedProfileIdentityTrustedProfileByID, err error) { - _model = &TrustedProfileIdentityTrustedProfileByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -func (*TrustedProfileIdentityTrustedProfileByID) isaTrustedProfileIdentity() bool { - return true -} + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` -// UnmarshalTrustedProfileIdentityTrustedProfileByID unmarshals an instance of TrustedProfileIdentityTrustedProfileByID from the specified map of raw messages. -func UnmarshalTrustedProfileIdentityTrustedProfileByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentityTrustedProfileByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Manually specify the DNS server addresses for this VPC. -// This model "extends" VpcdnsResolverPrototype -type VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype struct { - // The DNS servers to use for this VPC. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. - // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. + // The VPC this virtual server instance will reside in. // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServerPrototype `json:"manual_servers" validate:"required"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The type of the DNS resolver to use. - Type *string `json:"type" validate:"required"` -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype.Type property. -// The type of the DNS resolver to use. -const ( - VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototypeTypeManualConst = "manual" -) + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` -// NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Instantiate VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(manualServers []DnsServerPrototype, typeVar string) (_model *VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype, err error) { - _model = &VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype{ - ManualServers: manualServers, - Type: core.StringPtr(typeVar), + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` +} + +// NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { + _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment{ + Image: image, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) isaVpcdnsResolverPrototype() bool { +func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) isaInstancePrototypeInstanceByImage() bool { return true } -// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) +func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype : The system will provide DNS server addresses for this VPC. The system-provided DNS server addresses depend on whether -// any endpoint gateways reside in the VPC, and whether a -// [DNS Services](https://cloud.ibm.com/docs/dns-svcs) instance is configured for the VPC. -// This model "extends" VpcdnsResolverPrototype -type VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype struct { - // The type of the DNS resolver to use. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype.Type property. -// The type of the DNS resolver to use. -const ( - VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototypeTypeSystemConst = "system" -) - -func (*VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) isaVpcdnsResolverPrototype() bool { - return true -} - -// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeDelegated : The DNS server addresses are delegated to the DNS resolver of another VPC. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeDelegated struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` - - // The VPC whose DNS resolver provides the DNS server addresses for this VPC. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceDnsResolverContext `json:"vpc" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeDelegated.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeDelegatedTypeDelegatedConst = "delegated" -) - -func (*VpcdnsResolverTypeDelegated) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeDelegated unmarshals an instance of VpcdnsResolverTypeDelegated from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeDelegated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeDelegated) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeManual : The DNS server addresses are manually specified. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeManual struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The manually specified DNS servers for this VPC. - // - // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the - // affinity for that zone first, followed by the unique DNS servers from other zones. - // - // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServer `json:"manual_servers" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeManual.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeManualTypeManualConst = "manual" -) - -func (*VpcdnsResolverTypeManual) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeManual unmarshals an instance of VpcdnsResolverTypeManual from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeManual(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeManual) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeSystem : The DNS server addresses are provided by the system and depend on the configuration. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeSystem struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The configuration of the system DNS resolver for this VPC. - // - // - `custom_resolver`: A custom DNS resolver is configured for this VPC. - // - // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when - // the VPC has either or both of the following: - // - // - at least one endpoint gateway residing in it - // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it - // - // - `default`: The provider default DNS resolvers are configured for this VPC. - // - // This system DNS resolver configuration is used when the VPC has: - // - // - no custom DNS resolver configured for it, and - // - no endpoint gateways residing in it, and - // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. - Configuration *string `json:"configuration" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeSystem.Configuration property. -// The configuration of the system DNS resolver for this VPC. -// -// - `custom_resolver`: A custom DNS resolver is configured for this VPC. -// -// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when -// the VPC has either or both of the following: -// -// - at least one endpoint gateway residing in it -// -// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it -// -// - `default`: The provider default DNS resolvers are configured for this VPC. -// -// This system DNS resolver configuration is used when the VPC has: -// -// - no custom DNS resolver configured for it, and -// - no endpoint gateways residing in it, and -// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. -const ( - VpcdnsResolverTypeSystemConfigurationCustomResolverConst = "custom_resolver" - VpcdnsResolverTypeSystemConfigurationDefaultConst = "default" - VpcdnsResolverTypeSystemConfigurationPrivateResolverConst = "private_resolver" -) - -// Constants associated with the VpcdnsResolverTypeSystem.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeSystemTypeSystemConst = "system" -) - -func (*VpcdnsResolverTypeSystem) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeSystem unmarshals an instance of VpcdnsResolverTypeSystem from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeSystem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeSystem) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByCRN : VpcdnsResolverVPCPatchVPCIdentityByCRN struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByCRN : Instantiate VpcdnsResolverVPCPatchVPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByCRN(crn string) (_model *VpcdnsResolverVPCPatchVPCIdentityByCRN, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByCRN) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByCRN from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByHref : VpcdnsResolverVPCPatchVPCIdentityByHref struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByHref : Instantiate VpcdnsResolverVPCPatchVPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByHref(href string) (_model *VpcdnsResolverVPCPatchVPCIdentityByHref, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByHref) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByHref from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByID : VpcdnsResolverVPCPatchVPCIdentityByID struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByID struct { - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByID : Instantiate VpcdnsResolverVPCPatchVPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByID(id string) (_model *VpcdnsResolverVPCPatchVPCIdentityByID, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByID) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByID from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -96688,340 +111201,180 @@ func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID(m map[string]json.RawMessage return } -// VPCIdentityByCRN : VPCIdentityByCRN struct -// This model "extends" VPCIdentity -type VPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewVPCIdentityByCRN : Instantiate VPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByCRN(crn string) (_model *VPCIdentityByCRN, err error) { - _model = &VPCIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct +// This model "extends" InstancePrototypeInstanceByImage +type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` -func (*VPCIdentityByCRN) isaVPCIdentity() bool { - return true -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// UnmarshalVPCIdentityByCRN unmarshals an instance of VPCIdentityByCRN from the specified map of raw messages. -func UnmarshalVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -// VPCIdentityByHref : VPCIdentityByHref struct -// This model "extends" VPCIdentity -type VPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// NewVPCIdentityByHref : Instantiate VPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByHref(href string) (_model *VPCIdentityByHref, err error) { - _model = &VPCIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` -func (*VPCIdentityByHref) isaVPCIdentity() bool { - return true -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// UnmarshalVPCIdentityByHref unmarshals an instance of VPCIdentityByHref from the specified map of raw messages. -func UnmarshalVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// VPCIdentityByID : VPCIdentityByID struct -// This model "extends" VPCIdentity -type VPCIdentityByID struct { - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` -} + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` -// NewVPCIdentityByID : Instantiate VPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByID(id string) (_model *VPCIdentityByID, err error) { - _model = &VPCIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -func (*VPCIdentityByID) isaVPCIdentity() bool { - return true -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -// UnmarshalVPCIdentityByID unmarshals an instance of VPCIdentityByID from the specified map of raw messages. -func UnmarshalVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` -// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIkePolicyPatch -type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct { - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` -} + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPatch() bool { - return true -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` -// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIkePolicyPatch -type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct { - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID{ - ID: core.StringPtr(id), +// NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface, err error) { + _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface{ + Image: image, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPatch() bool { +func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) isaInstancePrototypeInstanceByImage() bool { return true } -// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIkePolicyPrototype -type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct { - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIkePolicyPrototype -type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct { - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPatch -type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct { - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPatch -type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype -type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct { - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype -type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -97029,57 +111382,121 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m return } -// VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch : VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch struct -// This model "extends" VPNGatewayConnectionPatch -type VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` +// InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct +// This model "extends" InstancePrototypeInstanceBySourceSnapshot +type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address,omitempty"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The pre-shared key. - Psk *string `json:"psk,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -// Constants associated with the VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatchRoutingProtocolNoneConst = "none" -) +// NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { + _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) isaVPNGatewayConnectionPatch() bool { +func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) isaInstancePrototypeInstanceBySourceSnapshot() bool { return true } -// UnmarshalVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch unmarshals an instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) +func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -97087,204 +111504,225 @@ func UnmarshalVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch( if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch -func (vpnGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch *VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VPNGatewayConnectionPolicyMode : VPNGatewayConnectionPolicyMode struct -// This model "extends" VPNGatewayConnection -type VPNGatewayConnectionPolicyMode struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` - - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct +// This model "extends" InstancePrototypeInstanceBySourceSnapshot +type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) + // The VPC this virtual server instance will reside in. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs" validate:"required"` -} + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// Constants associated with the VPNGatewayConnectionPolicyMode.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionPolicyModeAuthenticationModePskConst = "psk" -) + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// Constants associated with the VPNGatewayConnectionPolicyMode.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionPolicyModeModePolicyConst = "policy" - VPNGatewayConnectionPolicyModeModeRouteConst = "route" -) + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +} -// Constants associated with the VPNGatewayConnectionPolicyMode.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionPolicyModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) +// NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface, err error) { + _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the VPNGatewayConnectionPolicyMode.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionPolicyModeStatusDownConst = "down" - VPNGatewayConnectionPolicyModeStatusUpConst = "up" -) +func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) isaInstancePrototypeInstanceBySourceSnapshot() bool { + return true +} -func (*VPNGatewayConnectionPolicyMode) isaVPNGatewayConnection() bool { +func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) isaInstancePrototype() bool { return true } -// UnmarshalVPNGatewayConnectionPolicyMode unmarshals an instance of VPNGatewayConnectionPolicyMode from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPolicyMode) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) +// UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -97292,67 +111730,121 @@ func UnmarshalVPNGatewayConnectionPolicyMode(m map[string]json.RawMessage, resul return } -// VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct -// This model "extends" VPNGatewayConnectionPrototype -type VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` +// InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct +// This model "extends" InstancePrototypeInstanceByVolume +type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. Name *string `json:"name,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(peerAddress string, psk string, localCIDRs []string, peerCIDRs []string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype, err error) { - _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype{ - PeerAddress: core.StringPtr(peerAddress), - Psk: core.StringPtr(psk), - LocalCIDRs: localCIDRs, - PeerCIDRs: peerCIDRs, +// NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { + _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) isaVPNGatewayConnectionPrototype() bool { +func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) isaInstancePrototypeInstanceByVolume() bool { return true } -// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) +func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) isaInstancePrototype() bool { + return true +} + +// UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -97360,104 +111852,51 @@ func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototy if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct -// This model "extends" VPNGatewayConnectionPrototype -type VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototypeRoutingProtocolNoneConst = "none" -) - -// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(peerAddress string, psk string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype, err error) { - _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype{ - PeerAddress: core.StringPtr(peerAddress), - Psk: core.StringPtr(psk), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) isaVPNGatewayConnectionPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -97465,184 +111904,173 @@ func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePr return } -// VPNGatewayConnectionStaticRouteMode : VPNGatewayConnectionStaticRouteMode struct -// This model "extends" VPNGatewayConnection -type VPNGatewayConnectionStaticRouteMode struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` - - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct +// This model "extends" InstancePrototypeInstanceByVolume +type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` + // The name for this virtual server instance. The name must not be used by another virtual server instance in the + // region. If unspecified, the name will be a hyphenated list of randomly-selected words. + // + // The system hostname will be based on this name. + Name *string `json:"name,omitempty"` - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) + // The VPC this virtual server instance will reside in. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol" validate:"required"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The VPN tunnel configuration for this VPN gateway connection (in static route mode). - Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels" validate:"required"` -} + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` -// Constants associated with the VPNGatewayConnectionStaticRouteMode.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionStaticRouteModeAuthenticationModePskConst = "psk" -) + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// Constants associated with the VPNGatewayConnectionStaticRouteMode.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionStaticRouteModeModePolicyConst = "policy" - VPNGatewayConnectionStaticRouteModeModeRouteConst = "route" -) + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// Constants associated with the VPNGatewayConnectionStaticRouteMode.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionStaticRouteModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +} -// Constants associated with the VPNGatewayConnectionStaticRouteMode.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionStaticRouteModeStatusDownConst = "down" - VPNGatewayConnectionStaticRouteModeStatusUpConst = "up" -) +// NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface, err error) { + _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the VPNGatewayConnectionStaticRouteMode.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionStaticRouteModeRoutingProtocolNoneConst = "none" -) +func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) isaInstancePrototypeInstanceByVolume() bool { + return true +} -func (*VPNGatewayConnectionStaticRouteMode) isaVPNGatewayConnection() bool { +func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) isaInstancePrototype() bool { return true } -// UnmarshalVPNGatewayConnectionStaticRouteMode unmarshals an instance of VPNGatewayConnectionStaticRouteMode from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStaticRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStaticRouteMode) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) +// UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -97650,160 +112078,121 @@ func UnmarshalVPNGatewayConnectionStaticRouteMode(m map[string]json.RawMessage, return } -// VPNGatewayPolicyMode : VPNGatewayPolicyMode struct -// This model "extends" VPNGateway -type VPNGatewayPolicyMode struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering +type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - // Policy mode VPN gateway. - Mode *string `json:"mode" validate:"required"` -} + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// Constants associated with the VPNGatewayPolicyMode.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayPolicyModeHealthStateDegradedConst = "degraded" - VPNGatewayPolicyModeHealthStateFaultedConst = "faulted" - VPNGatewayPolicyModeHealthStateInapplicableConst = "inapplicable" - VPNGatewayPolicyModeHealthStateOkConst = "ok" -) + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` -// Constants associated with the VPNGatewayPolicyMode.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayPolicyModeLifecycleStateDeletingConst = "deleting" - VPNGatewayPolicyModeLifecycleStateFailedConst = "failed" - VPNGatewayPolicyModeLifecycleStatePendingConst = "pending" - VPNGatewayPolicyModeLifecycleStateStableConst = "stable" - VPNGatewayPolicyModeLifecycleStateSuspendedConst = "suspended" - VPNGatewayPolicyModeLifecycleStateUpdatingConst = "updating" - VPNGatewayPolicyModeLifecycleStateWaitingConst = "waiting" -) + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` +} -// Constants associated with the VPNGatewayPolicyMode.ResourceType property. -// The resource type. -const ( - VPNGatewayPolicyModeResourceTypeVPNGatewayConst = "vpn_gateway" -) +// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment{ + CatalogOffering: catalogOffering, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// Constants associated with the VPNGatewayPolicyMode.Mode property. -// Policy mode VPN gateway. -const ( - VPNGatewayPolicyModeModePolicyConst = "policy" -) +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { + return true +} -func (*VPNGatewayPolicyMode) isaVPNGateway() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalVPNGatewayPolicyMode unmarshals an instance of VPNGatewayPolicyMode from the specified map of raw messages. -func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPolicyMode) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -97811,137 +112200,55 @@ func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayPolicyModePrototype : VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Policy mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayPolicyModePrototype.Mode property. -// Policy mode VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayPolicyModePrototypeModePolicyConst = "policy" -) - -// NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayPolicyModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayPolicyModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayPolicyModePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayPrototypeVPNGatewayPolicyModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayPolicyModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayRouteModePrototype : VPNGatewayPrototypeVPNGatewayRouteModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayRouteModePrototype.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayRouteModePrototypeModeRouteConst = "route" -) - -// NewVPNGatewayPrototypeVPNGatewayRouteModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayRouteModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayRouteModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayRouteModePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayPrototypeVPNGatewayRouteModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayRouteModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -97949,227 +112256,177 @@ func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json. return } -// VPNGatewayRouteMode : VPNGatewayRouteMode struct -// This model "extends" VPNGateway -type VPNGatewayRouteMode struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering +type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - // Route mode VPN gateway. - Mode *string `json:"mode" validate:"required"` -} + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` -// Constants associated with the VPNGatewayRouteMode.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayRouteModeHealthStateDegradedConst = "degraded" - VPNGatewayRouteModeHealthStateFaultedConst = "faulted" - VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" - VPNGatewayRouteModeHealthStateOkConst = "ok" -) + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// Constants associated with the VPNGatewayRouteMode.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" - VPNGatewayRouteModeLifecycleStateFailedConst = "failed" - VPNGatewayRouteModeLifecycleStatePendingConst = "pending" - VPNGatewayRouteModeLifecycleStateStableConst = "stable" - VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" - VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" - VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" -) + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// Constants associated with the VPNGatewayRouteMode.ResourceType property. -// The resource type. -const ( - VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" -) + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +} -// Constants associated with the VPNGatewayRouteMode.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayRouteModeModeRouteConst = "route" -) +// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface{ + CatalogOffering: catalogOffering, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return +} -func (*VPNGatewayRouteMode) isaVPNGateway() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { return true } -// UnmarshalVPNGatewayRouteMode unmarshals an instance of VPNGatewayRouteMode from the specified map of raw messages. -func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayRouteMode) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { + return true +} + +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationByCertificate : VPNServerAuthenticationByCertificate struct -// This model "extends" VPNServerAuthentication -type VPNServerAuthenticationByCertificate struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The certificate instance used for the VPN client certificate authority (CA). - ClientCa *CertificateInstanceReference `json:"client_ca" validate:"required"` - - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` -} - -// Constants associated with the VPNServerAuthenticationByCertificate.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationByCertificateMethodCertificateConst = "certificate" - VPNServerAuthenticationByCertificateMethodUsernameConst = "username" -) - -func (*VPNServerAuthenticationByCertificate) isaVPNServerAuthentication() bool { - return true -} - -// UnmarshalVPNServerAuthenticationByCertificate unmarshals an instance of VPNServerAuthenticationByCertificate from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByCertificate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByCertificate) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -98177,370 +112434,178 @@ func UnmarshalVPNServerAuthenticationByCertificate(m map[string]json.RawMessage, return } -// VPNServerAuthenticationByUsername : VPNServerAuthenticationByUsername struct -// This model "extends" VPNServerAuthentication -type VPNServerAuthenticationByUsername struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` +// InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage +type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// Constants associated with the VPNServerAuthenticationByUsername.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationByUsernameMethodCertificateConst = "certificate" - VPNServerAuthenticationByUsernameMethodUsernameConst = "username" -) + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -func (*VPNServerAuthenticationByUsername) isaVPNServerAuthentication() bool { - return true -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// UnmarshalVPNServerAuthenticationByUsername unmarshals an instance of VPNServerAuthenticationByUsername from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsername(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsername) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// VPNServerAuthenticationByUsernameIDProviderByIam : VPNServerAuthenticationByUsernameIDProviderByIam struct -// This model "extends" VPNServerAuthenticationByUsernameIDProvider -type VPNServerAuthenticationByUsernameIDProviderByIam struct { - // The type of identity provider to be used by the VPN client. - // - `iam`: IBM identity and access management + // The placement restrictions to use for the virtual server instance. // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - ProviderType *string `json:"provider_type" validate:"required"` -} + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// Constants associated with the VPNServerAuthenticationByUsernameIDProviderByIam.ProviderType property. -// The type of identity provider to be used by the VPN client. -// - `iam`: IBM identity and access management -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - VPNServerAuthenticationByUsernameIDProviderByIamProviderTypeIamConst = "iam" -) + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// NewVPNServerAuthenticationByUsernameIDProviderByIam : Instantiate VPNServerAuthenticationByUsernameIDProviderByIam (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationByUsernameIDProviderByIam(providerType string) (_model *VPNServerAuthenticationByUsernameIDProviderByIam, err error) { - _model = &VPNServerAuthenticationByUsernameIDProviderByIam{ - ProviderType: core.StringPtr(providerType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -func (*VPNServerAuthenticationByUsernameIDProviderByIam) isaVPNServerAuthenticationByUsernameIDProvider() bool { - return true -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam unmarshals an instance of VPNServerAuthenticationByUsernameIDProviderByIam from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsernameIDProviderByIam) - err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` -// VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct -// This model "extends" VPNServerAuthenticationPrototype -type VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The certificate instance to use for the VPN client certificate authority (CA). - ClientCa CertificateInstanceIdentityIntf `json:"client_ca" validate:"required"` + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodUsernameConst = "username" -) - -// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(method string, clientCa CertificateInstanceIdentityIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype, err error) { - _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype{ - Method: core.StringPtr(method), - ClientCa: clientCa, +// NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment{ + Image: image, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) isaVPNServerAuthenticationPrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { return true } -// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) +func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { + return true +} + +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceIdentity) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct -// This model "extends" VPNServerAuthenticationPrototype -type VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` -} - -// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodUsernameConst = "username" -) - -// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(method string, identityProvider VPNServerAuthenticationByUsernameIDProviderIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype, err error) { - _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype{ - Method: core.StringPtr(method), - IdentityProvider: identityProvider, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) isaVPNServerAuthenticationPrototype() bool { - return true -} - -// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext : Identifies a reserved IP by a unique property. Required if `subnet` is not specified. The reserved IP must be -// currently unbound. -// Models which "extend" this model: -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool { - return true -} - -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextIntf interface { - VirtualNetworkInterfacePrimaryIPPrototypeIntf - isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext : The prototype for a new reserved IP. Requires `subnet` to be specified. -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceTargetShareMountTargetReference : VirtualNetworkInterfaceTargetShareMountTargetReference struct -// This model "extends" VirtualNetworkInterfaceTarget -type VirtualNetworkInterfaceTargetShareMountTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` - - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterfaceTargetShareMountTargetReference.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceTargetShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" -) - -func (*VirtualNetworkInterfaceTargetShareMountTargetReference) isaVirtualNetworkInterfaceTarget() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference unmarshals an instance of VirtualNetworkInterfaceTargetShareMountTargetReference from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTargetShareMountTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumeIdentity : Identifies a volume by a unique property. -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref -// This model "extends" VolumeAttachmentPrototypeVolume -type VolumeAttachmentPrototypeVolumeVolumeIdentity struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { - return true -} - -type VolumeAttachmentPrototypeVolumeVolumeIdentityIntf interface { - VolumeAttachmentPrototypeVolumeIntf - isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentity from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -98548,244 +112613,178 @@ func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity(m map[string]json.Ra return } -// VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext : VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot -// This model "extends" VolumeAttachmentPrototypeVolume -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage +type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The root key to use to wrap the data encryption key for the volume. + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool { - return true +// NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface{ + Image: image, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, + } + err = core.ValidateStruct(_model, "required parameters") + return } -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextIntf interface { - VolumeAttachmentPrototypeVolumeIntf - isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool +func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { + return true } -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolume() bool { +func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { return true } -// UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByCRN : VolumeIdentityByCRN struct -// This model "extends" VolumeIdentity -type VolumeIdentityByCRN struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` -} - -// NewVolumeIdentityByCRN : Instantiate VolumeIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByCRN(crn string) (_model *VolumeIdentityByCRN, err error) { - _model = &VolumeIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByCRN) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByCRN unmarshals an instance of VolumeIdentityByCRN from the specified map of raw messages. -func UnmarshalVolumeIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByHref : VolumeIdentityByHref struct -// This model "extends" VolumeIdentity -type VolumeIdentityByHref struct { - // The URL for this volume. - Href *string `json:"href" validate:"required"` -} - -// NewVolumeIdentityByHref : Instantiate VolumeIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByHref(href string) (_model *VolumeIdentityByHref, err error) { - _model = &VolumeIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByHref) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByHref unmarshals an instance of VolumeIdentityByHref from the specified map of raw messages. -func UnmarshalVolumeIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByID : VolumeIdentityByID struct -// This model "extends" VolumeIdentity -type VolumeIdentityByID struct { - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` -} - -// NewVolumeIdentityByID : Instantiate VolumeIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByID(id string) (_model *VolumeIdentityByID, err error) { - _model = &VolumeIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByID) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByID unmarshals an instance of VolumeIdentityByID from the specified map of raw messages. -func UnmarshalVolumeIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileIdentityByHref : VolumeProfileIdentityByHref struct -// This model "extends" VolumeProfileIdentity -type VolumeProfileIdentityByHref struct { - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` -} - -// NewVolumeProfileIdentityByHref : Instantiate VolumeProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVolumeProfileIdentityByHref(href string) (_model *VolumeProfileIdentityByHref, err error) { - _model = &VolumeProfileIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeProfileIdentityByHref) isaVolumeProfileIdentity() bool { - return true -} - -// UnmarshalVolumeProfileIdentityByHref unmarshals an instance of VolumeProfileIdentityByHref from the specified map of raw messages. -func UnmarshalVolumeProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileIdentityByName : VolumeProfileIdentityByName struct -// This model "extends" VolumeProfileIdentity -type VolumeProfileIdentityByName struct { - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` -} - -// NewVolumeProfileIdentityByName : Instantiate VolumeProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewVolumeProfileIdentityByName(name string) (_model *VolumeProfileIdentityByName, err error) { - _model = &VolumeProfileIdentityByName{ - Name: core.StringPtr(name), + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeProfileIdentityByName) isaVolumeProfileIdentity() bool { - return true -} - -// UnmarshalVolumeProfileIdentityByName unmarshals an instance of VolumeProfileIdentityByName from the specified map of raw messages. -func UnmarshalVolumeProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -98793,57 +112792,119 @@ func UnmarshalVolumeProfileIdentityByName(m map[string]json.RawMessage, result i return } -// VolumePrototypeVolumeByCapacity : VolumePrototypeVolumeByCapacity struct -// This model "extends" VolumePrototype -type VolumePrototypeVolumeByCapacity struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot +type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The root key to use to wrap the data encryption key for the volume. + // The VPC this virtual server instance will reside in. // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -// NewVolumePrototypeVolumeByCapacity : Instantiate VolumePrototypeVolumeByCapacity (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeVolumeByCapacity(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, capacity int64) (_model *VolumePrototypeVolumeByCapacity, err error) { - _model = &VolumePrototypeVolumeByCapacity{ - Profile: profile, - Zone: zone, - Capacity: core.Int64Ptr(capacity), +// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkAttachment: primaryNetworkAttachment, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VolumePrototypeVolumeByCapacity) isaVolumePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { return true } -// UnmarshalVolumePrototypeVolumeByCapacity unmarshals an instance of VolumePrototypeVolumeByCapacity from the specified map of raw messages. -func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeVolumeByCapacity) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { + return true +} + +// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -98851,7 +112912,15 @@ func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, resu if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } @@ -98859,7 +112928,23 @@ func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, resu if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } @@ -98867,11 +112952,11 @@ func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, resu if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -98879,62 +112964,119 @@ func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, resu return } -// VolumePrototypeVolumeBySourceSnapshot : VolumePrototypeVolumeBySourceSnapshot struct -// This model "extends" VolumePrototype -type VolumePrototypeVolumeBySourceSnapshot struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct +// This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot +type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name must not be used by another instance template in the region. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - // The root key to use to wrap the data encryption key for the volume. + // The VPC this virtual server instance will reside in. // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -// NewVolumePrototypeVolumeBySourceSnapshot : Instantiate VolumePrototypeVolumeBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeVolumeBySourceSnapshot(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeVolumeBySourceSnapshot, err error) { - _model = &VolumePrototypeVolumeBySourceSnapshot{ - Profile: profile, - Zone: zone, - SourceSnapshot: sourceSnapshot, +// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface, err error) { + _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface{ + BootVolumeAttachment: bootVolumeAttachment, + Zone: zone, + PrimaryNetworkInterface: primaryNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") return } -func (*VolumePrototypeVolumeBySourceSnapshot) isaVolumePrototype() bool { +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { return true } -// UnmarshalVolumePrototypeVolumeBySourceSnapshot unmarshals an instance of VolumePrototypeVolumeBySourceSnapshot from the specified map of raw messages. -func UnmarshalVolumePrototypeVolumeBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeVolumeBySourceSnapshot) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) +func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { + return true +} + +// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } @@ -98942,93 +113084,51 @@ func UnmarshalVolumePrototypeVolumeBySourceSnapshot(m map[string]json.RawMessage if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentityByHref : ZoneIdentityByHref struct -// This model "extends" ZoneIdentity -type ZoneIdentityByHref struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` -} - -// NewZoneIdentityByHref : Instantiate ZoneIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewZoneIdentityByHref(href string) (_model *ZoneIdentityByHref, err error) { - _model = &ZoneIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ZoneIdentityByHref) isaZoneIdentity() bool { - return true -} - -// UnmarshalZoneIdentityByHref unmarshals an instance of ZoneIdentityByHref from the specified map of raw messages. -func UnmarshalZoneIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentityByName : ZoneIdentityByName struct -// This model "extends" ZoneIdentity -type ZoneIdentityByName struct { - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` -} - -// NewZoneIdentityByName : Instantiate ZoneIdentityByName (Generic Model Constructor) -func (*VpcV1) NewZoneIdentityByName(name string) (_model *ZoneIdentityByName, err error) { - _model = &ZoneIdentityByName{ - Name: core.StringPtr(name), + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ZoneIdentityByName) isaZoneIdentity() bool { - return true -} - -// UnmarshalZoneIdentityByName unmarshals an instance of ZoneIdentityByName from the specified map of raw messages. -func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -99036,150 +113136,114 @@ func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{ return } -// BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct -// This model "extends" BackupPolicyScopePrototypeEnterpriseIdentity -type BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct { - // The CRN for this enterprise. - CRN *string `json:"crn" validate:"required"` -} - -// NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : Instantiate BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(crn string) (_model *BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN, err error) { - _model = &BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext +type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` -func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { - return true -} + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototype() bool { - return true -} + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` -// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// EndpointGatewayReservedIPReservedIPIdentityByHref : EndpointGatewayReservedIPReservedIPIdentityByHref struct -// This model "extends" EndpointGatewayReservedIPReservedIPIdentity -type EndpointGatewayReservedIPReservedIPIdentityByHref struct { - // The URL for this reserved IP. + // The URL for this instance template. Href *string `json:"href" validate:"required"` -} -// NewEndpointGatewayReservedIPReservedIPIdentityByHref : Instantiate EndpointGatewayReservedIPReservedIPIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByHref(href string) (_model *EndpointGatewayReservedIPReservedIPIdentityByHref, err error) { - _model = &EndpointGatewayReservedIPReservedIPIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` -func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIP() bool { - return true -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByHref from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` -// EndpointGatewayReservedIPReservedIPIdentityByID : EndpointGatewayReservedIPReservedIPIdentityByID struct -// This model "extends" EndpointGatewayReservedIPReservedIPIdentity -type EndpointGatewayReservedIPReservedIPIdentityByID struct { - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// NewEndpointGatewayReservedIPReservedIPIdentityByID : Instantiate EndpointGatewayReservedIPReservedIPIdentityByID (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByID(id string) (_model *EndpointGatewayReservedIPReservedIPIdentityByID, err error) { - _model = &EndpointGatewayReservedIPReservedIPIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` -func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIP() bool { - return true -} + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByID from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` + + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct -// This model "extends" EndpointGatewayTargetPrototypeProviderCloudServiceIdentity -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn" validate:"required"` -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` -// NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : Instantiate EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(resourceType string, crn string) (_model *EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN, err error) { - _model = &EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN{ - ResourceType: core.StringPtr(resourceType), - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototype() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { return true } -// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -99187,334 +113251,79 @@ func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProvider if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : The name of this provider infrastructure service. -// This model "extends" EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -// NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : Instantiate EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(resourceType string, name string) (_model *EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName, err error) { - _model = &EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName{ - ResourceType: core.StringPtr(resourceType), - Name: core.StringPtr(name), + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { - return true -} - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototype() bool { - return true -} - -// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity -type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity -type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { - // The URL for this bare metal server network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { - // The unique identifier for this bare metal server network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity -type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity -type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -99522,314 +113331,194 @@ func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceI return } -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} +// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct +// This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext +type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct { - // The URL for this virtual server instance. + // The URL for this instance template. Href *string `json:"href" validate:"required"` -} -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - Href *string `json:"href" validate:"required"` -} + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} + CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - ID *string `json:"id" validate:"required"` -} + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { +func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { return true } -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct { - // The URL for this subnet. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct { - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -99837,186 +113526,195 @@ func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(m map[s return } -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} +// InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext +type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The URL for this instance template. + Href *string `json:"href" validate:"required"` -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct { - // The unique identifier for this VPC. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` -} -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` + + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { +func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototype() bool { +func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -100024,110 +113722,123 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt return } -// InstanceGroupManagerActionScheduledActionGroupTarget : InstanceGroupManagerActionScheduledActionGroupTarget struct -// This model "extends" InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerActionScheduledActionGroupTarget struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` +// InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct +// This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext +type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The date and time that the instance group manager action was created. + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this instance group manager action. + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance group manager action. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. Name *string `json:"name" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - Group *InstanceGroupManagerScheduledActionGroup `json:"group" validate:"required"` -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionGroupTargetStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionGroupTargetStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionGroupTargetStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionGroupTargetStatusOmittedConst = "omitted" -) + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image" validate:"required"` -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetActionTypeScheduledConst = "scheduled" -) + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerActionScheduledAction() bool { + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` +} + +func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } -func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerAction() bool { +func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionGroupTarget from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledActionGroupTarget) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) +// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } @@ -100139,39 +113850,67 @@ func UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget(m map[string] if err != nil { return } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -100179,106 +113918,111 @@ func UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget(m map[string] return } -// InstanceGroupManagerActionScheduledActionManagerTarget : InstanceGroupManagerActionScheduledActionManagerTarget struct -// This model "extends" InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerActionScheduledActionManagerTarget struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` +// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct +// This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext +type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - // The date and time that the instance group manager action was created. + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this instance group manager action. + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` + + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + + // The URL for this instance template. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance group manager action. + // The unique identifier for this instance template. ID *string `json:"id" validate:"required"` - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` + + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + + // The name for this instance template. The name is unique across all instance templates in the region. Name *string `json:"name" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager" validate:"required"` -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionManagerTargetStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionManagerTargetStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionManagerTargetStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionManagerTargetStatusOmittedConst = "omitted" -) + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetActionTypeScheduledConst = "scheduled" -) + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` -func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerActionScheduledAction() bool { + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` +} + +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } -func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerAction() bool { +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { return true } -// UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionManagerTarget from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledActionManagerTarget) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) +// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { return } @@ -100286,250 +114030,83 @@ func UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget(m map[strin if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(href string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref, err error) { - _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { - return true -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` -} - -// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(id string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID, err error) { - _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { - return true -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } @@ -100537,419 +114114,202 @@ func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHos return } -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct { - // The CRN for this dedicated host. +// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct +// This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext +type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` + + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this instance template. CRN *string `json:"crn" validate:"required"` -} -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} + // The URL for this instance template. + Href *string `json:"href" validate:"required"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatch() bool { - return true -} + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` -} + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The name for this instance template. The name is unique across all instance templates in the region. + Name *string `json:"name" validate:"required"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} + // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatch() bool { - return true -} + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. + // + // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct { - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` -} + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} + // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server + // instance. + UserData *string `json:"user_data,omitempty"` -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatch() bool { - return true -} + // The additional volume attachments to create for the virtual server instance. + VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The VPC this virtual server instance will reside in. + // + // If specified, it must match the VPC for the subnets of the instance network attachments or instance network + // interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` -} + // The boot volume attachment to create for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return + // The additional network attachments to create for the virtual server instance. + NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` + + // The primary network attachment to create for the virtual server instance. + PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` } -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { +func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { return true } -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) +// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. +func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct { - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct { - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN{ - CRN: core.StringPtr(crn), + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct { - // The URL for this placement group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref{ - Href: core.StringPtr(href), + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct { - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID{ - ID: core.StringPtr(id), + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -101517,6 +114877,111 @@ func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIde return } +// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity +type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` +} + +// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaReservedIPTargetPrototype() bool { + return true +} + +// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity +type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` +} + +// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaReservedIPTargetPrototype() bool { + return true +} + +// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity +type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` +} + +// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaReservedIPTargetPrototype() bool { + return true +} + +// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP : RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP struct // This model "extends" RouteNextHopPatchRouteNextHopIP type RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP struct { @@ -102031,6 +115496,181 @@ func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroup return } +// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct +// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { + // The CRN for this virtual network interface. + CRN *string `json:"crn" validate:"required"` +} + +// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { + _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct +// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { + // The URL for this virtual network interface. + Href *string `json:"href" validate:"required"` +} + +// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { + _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct +// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity +type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { + // The unique identifier for this virtual network interface. + ID *string `json:"id" validate:"required"` +} + +// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) +func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { + _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { + return true +} + +func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. +func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref : VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref struct +// This model "extends" VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext +type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref struct { + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` +} + +// NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref : Instantiate VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref (Generic Model Constructor) +func (*VpcV1) NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(href string) (_model *VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref, err error) { + _model = &VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { + return true +} + +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) isaVirtualNetworkInterfaceIPPrototype() bool { + return true +} + +// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID : VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID struct +// This model "extends" VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext +type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID struct { + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` +} + +// NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID : Instantiate VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID (Generic Model Constructor) +func (*VpcV1) NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(id string) (_model *VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID, err error) { + _model = &VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { + return true +} + +func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) isaVirtualNetworkInterfaceIPPrototype() bool { + return true +} + +// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID from the specified map of raw messages. +func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref : VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref struct // This model "extends" VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref struct { @@ -102595,91 +116235,6 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt return } -// VpcsPager can be used to simplify the use of the "ListVpcs" method. -type VpcsPager struct { - hasNext bool - options *ListVpcsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVpcsPager returns a new VpcsPager instance. -func (vpc *VpcV1) NewVpcsPager(options *ListVpcsOptions) (pager *VpcsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVpcsOptions = *options - pager = &VpcsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VpcsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VpcsPager) GetNextWithContext(ctx context.Context) (page []VPC, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVpcsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Vpcs - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VpcsPager) GetAllWithContext(ctx context.Context) (allItems []VPC, err error) { - for pager.HasNext() { - var nextPage []VPC - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VpcsPager) GetNext() (page []VPC, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VpcsPager) GetAll() (allItems []VPC, err error) { - return pager.GetAllWithContext(context.Background()) -} - // VPCAddressPrefixesPager can be used to simplify the use of the "ListVPCAddressPrefixes" method. type VPCAddressPrefixesPager struct { hasNext bool @@ -102935,25 +116490,25 @@ func (pager *VPCRoutesPager) GetAll() (allItems []RouteCollectionVPCContextRoute return pager.GetAllWithContext(context.Background()) } -// VPCRoutingTablesPager can be used to simplify the use of the "ListVPCRoutingTables" method. -type VPCRoutingTablesPager struct { +// VPCRoutingTableRoutesPager can be used to simplify the use of the "ListVPCRoutingTableRoutes" method. +type VPCRoutingTableRoutesPager struct { hasNext bool - options *ListVPCRoutingTablesOptions + options *ListVPCRoutingTableRoutesOptions client *VpcV1 pageContext struct { next *string } } -// NewVPCRoutingTablesPager returns a new VPCRoutingTablesPager instance. -func (vpc *VpcV1) NewVPCRoutingTablesPager(options *ListVPCRoutingTablesOptions) (pager *VPCRoutingTablesPager, err error) { +// NewVPCRoutingTableRoutesPager returns a new VPCRoutingTableRoutesPager instance. +func (vpc *VpcV1) NewVPCRoutingTableRoutesPager(options *ListVPCRoutingTableRoutesOptions) (pager *VPCRoutingTableRoutesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVPCRoutingTablesOptions = *options - pager = &VPCRoutingTablesPager{ + var optionsCopy ListVPCRoutingTableRoutesOptions = *options + pager = &VPCRoutingTableRoutesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -102962,19 +116517,19 @@ func (vpc *VpcV1) NewVPCRoutingTablesPager(options *ListVPCRoutingTablesOptions) } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCRoutingTablesPager) HasNext() bool { +func (pager *VPCRoutingTableRoutesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCRoutingTablesPager) GetNextWithContext(ctx context.Context) (page []RoutingTable, err error) { +func (pager *VPCRoutingTableRoutesPager) GetNextWithContext(ctx context.Context) (page []Route, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVPCRoutingTablesWithContext(ctx, pager.options) + result, _, err := pager.client.ListVPCRoutingTableRoutesWithContext(ctx, pager.options) if err != nil { return } @@ -102991,16 +116546,16 @@ func (pager *VPCRoutingTablesPager) GetNextWithContext(ctx context.Context) (pag } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.RoutingTables + page = result.Routes return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VPCRoutingTablesPager) GetAllWithContext(ctx context.Context) (allItems []RoutingTable, err error) { +func (pager *VPCRoutingTableRoutesPager) GetAllWithContext(ctx context.Context) (allItems []Route, err error) { for pager.HasNext() { - var nextPage []RoutingTable + var nextPage []Route nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -103011,34 +116566,34 @@ func (pager *VPCRoutingTablesPager) GetAllWithContext(ctx context.Context) (allI } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTablesPager) GetNext() (page []RoutingTable, err error) { +func (pager *VPCRoutingTableRoutesPager) GetNext() (page []Route, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTablesPager) GetAll() (allItems []RoutingTable, err error) { +func (pager *VPCRoutingTableRoutesPager) GetAll() (allItems []Route, err error) { return pager.GetAllWithContext(context.Background()) } -// VPCRoutingTableRoutesPager can be used to simplify the use of the "ListVPCRoutingTableRoutes" method. -type VPCRoutingTableRoutesPager struct { +// VPCRoutingTablesPager can be used to simplify the use of the "ListVPCRoutingTables" method. +type VPCRoutingTablesPager struct { hasNext bool - options *ListVPCRoutingTableRoutesOptions + options *ListVPCRoutingTablesOptions client *VpcV1 pageContext struct { next *string } } -// NewVPCRoutingTableRoutesPager returns a new VPCRoutingTableRoutesPager instance. -func (vpc *VpcV1) NewVPCRoutingTableRoutesPager(options *ListVPCRoutingTableRoutesOptions) (pager *VPCRoutingTableRoutesPager, err error) { +// NewVPCRoutingTablesPager returns a new VPCRoutingTablesPager instance. +func (vpc *VpcV1) NewVPCRoutingTablesPager(options *ListVPCRoutingTablesOptions) (pager *VPCRoutingTablesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVPCRoutingTableRoutesOptions = *options - pager = &VPCRoutingTableRoutesPager{ + var optionsCopy ListVPCRoutingTablesOptions = *options + pager = &VPCRoutingTablesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -103047,19 +116602,19 @@ func (vpc *VpcV1) NewVPCRoutingTableRoutesPager(options *ListVPCRoutingTableRout } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCRoutingTableRoutesPager) HasNext() bool { +func (pager *VPCRoutingTablesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCRoutingTableRoutesPager) GetNextWithContext(ctx context.Context) (page []Route, err error) { +func (pager *VPCRoutingTablesPager) GetNextWithContext(ctx context.Context) (page []RoutingTable, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVPCRoutingTableRoutesWithContext(ctx, pager.options) + result, _, err := pager.client.ListVPCRoutingTablesWithContext(ctx, pager.options) if err != nil { return } @@ -103076,16 +116631,16 @@ func (pager *VPCRoutingTableRoutesPager) GetNextWithContext(ctx context.Context) } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Routes + page = result.RoutingTables return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VPCRoutingTableRoutesPager) GetAllWithContext(ctx context.Context) (allItems []Route, err error) { +func (pager *VPCRoutingTablesPager) GetAllWithContext(ctx context.Context) (allItems []RoutingTable, err error) { for pager.HasNext() { - var nextPage []Route + var nextPage []RoutingTable nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -103096,34 +116651,34 @@ func (pager *VPCRoutingTableRoutesPager) GetAllWithContext(ctx context.Context) } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTableRoutesPager) GetNext() (page []Route, err error) { +func (pager *VPCRoutingTablesPager) GetNext() (page []RoutingTable, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTableRoutesPager) GetAll() (allItems []Route, err error) { +func (pager *VPCRoutingTablesPager) GetAll() (allItems []RoutingTable, err error) { return pager.GetAllWithContext(context.Background()) } -// SubnetsPager can be used to simplify the use of the "ListSubnets" method. -type SubnetsPager struct { +// VpcsPager can be used to simplify the use of the "ListVpcs" method. +type VpcsPager struct { hasNext bool - options *ListSubnetsOptions + options *ListVpcsOptions client *VpcV1 pageContext struct { next *string } } -// NewSubnetsPager returns a new SubnetsPager instance. -func (vpc *VpcV1) NewSubnetsPager(options *ListSubnetsOptions) (pager *SubnetsPager, err error) { +// NewVpcsPager returns a new VpcsPager instance. +func (vpc *VpcV1) NewVpcsPager(options *ListVpcsOptions) (pager *VpcsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListSubnetsOptions = *options - pager = &SubnetsPager{ + var optionsCopy ListVpcsOptions = *options + pager = &VpcsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -103132,19 +116687,19 @@ func (vpc *VpcV1) NewSubnetsPager(options *ListSubnetsOptions) (pager *SubnetsPa } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *SubnetsPager) HasNext() bool { +func (pager *VpcsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *SubnetsPager) GetNextWithContext(ctx context.Context) (page []Subnet, err error) { +func (pager *VpcsPager) GetNextWithContext(ctx context.Context) (page []VPC, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListSubnetsWithContext(ctx, pager.options) + result, _, err := pager.client.ListVpcsWithContext(ctx, pager.options) if err != nil { return } @@ -103161,16 +116716,16 @@ func (pager *SubnetsPager) GetNextWithContext(ctx context.Context) (page []Subne } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Subnets + page = result.Vpcs return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *SubnetsPager) GetAllWithContext(ctx context.Context) (allItems []Subnet, err error) { +func (pager *VpcsPager) GetAllWithContext(ctx context.Context) (allItems []VPC, err error) { for pager.HasNext() { - var nextPage []Subnet + var nextPage []VPC nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -103181,12 +116736,12 @@ func (pager *SubnetsPager) GetAllWithContext(ctx context.Context) (allItems []Su } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SubnetsPager) GetNext() (page []Subnet, err error) { +func (pager *VpcsPager) GetNext() (page []VPC, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SubnetsPager) GetAll() (allItems []Subnet, err error) { +func (pager *VpcsPager) GetAll() (allItems []VPC, err error) { return pager.GetAllWithContext(context.Background()) } @@ -103275,6 +116830,91 @@ func (pager *SubnetReservedIpsPager) GetAll() (allItems []ReservedIP, err error) return pager.GetAllWithContext(context.Background()) } +// SubnetsPager can be used to simplify the use of the "ListSubnets" method. +type SubnetsPager struct { + hasNext bool + options *ListSubnetsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewSubnetsPager returns a new SubnetsPager instance. +func (vpc *VpcV1) NewSubnetsPager(options *ListSubnetsOptions) (pager *SubnetsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListSubnetsOptions = *options + pager = &SubnetsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *SubnetsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *SubnetsPager) GetNextWithContext(ctx context.Context) (page []Subnet, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListSubnetsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Subnets + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *SubnetsPager) GetAllWithContext(ctx context.Context) (allItems []Subnet, err error) { + for pager.HasNext() { + var nextPage []Subnet + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *SubnetsPager) GetNext() (page []Subnet, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *SubnetsPager) GetAll() (allItems []Subnet, err error) { + return pager.GetAllWithContext(context.Background()) +} + // ImagesPager can be used to simplify the use of the "ListImages" method. type ImagesPager struct { hasNext bool @@ -103530,6 +117170,91 @@ func (pager *KeysPager) GetAll() (allItems []Key, err error) { return pager.GetAllWithContext(context.Background()) } +// InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "ListInstanceNetworkInterfaceIps" method. +type InstanceNetworkInterfaceIpsPager struct { + hasNext bool + options *ListInstanceNetworkInterfaceIpsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewInstanceNetworkInterfaceIpsPager returns a new InstanceNetworkInterfaceIpsPager instance. +func (vpc *VpcV1) NewInstanceNetworkInterfaceIpsPager(options *ListInstanceNetworkInterfaceIpsOptions) (pager *InstanceNetworkInterfaceIpsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListInstanceNetworkInterfaceIpsOptions = *options + pager = &InstanceNetworkInterfaceIpsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *InstanceNetworkInterfaceIpsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *InstanceNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListInstanceNetworkInterfaceIpsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Ips + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *InstanceNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { + for pager.HasNext() { + var nextPage []ReservedIP + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *InstanceNetworkInterfaceIpsPager) GetNext() (page []ReservedIP, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *InstanceNetworkInterfaceIpsPager) GetAll() (allItems []ReservedIP, err error) { + return pager.GetAllWithContext(context.Background()) +} + // InstancesPager can be used to simplify the use of the "ListInstances" method. type InstancesPager struct { hasNext bool @@ -103615,25 +117340,25 @@ func (pager *InstancesPager) GetAll() (allItems []Instance, err error) { return pager.GetAllWithContext(context.Background()) } -// InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "ListInstanceNetworkInterfaceIps" method. -type InstanceNetworkInterfaceIpsPager struct { +// InstanceGroupManagerActionsPager can be used to simplify the use of the "ListInstanceGroupManagerActions" method. +type InstanceGroupManagerActionsPager struct { hasNext bool - options *ListInstanceNetworkInterfaceIpsOptions + options *ListInstanceGroupManagerActionsOptions client *VpcV1 pageContext struct { next *string } } -// NewInstanceNetworkInterfaceIpsPager returns a new InstanceNetworkInterfaceIpsPager instance. -func (vpc *VpcV1) NewInstanceNetworkInterfaceIpsPager(options *ListInstanceNetworkInterfaceIpsOptions) (pager *InstanceNetworkInterfaceIpsPager, err error) { +// NewInstanceGroupManagerActionsPager returns a new InstanceGroupManagerActionsPager instance. +func (vpc *VpcV1) NewInstanceGroupManagerActionsPager(options *ListInstanceGroupManagerActionsOptions) (pager *InstanceGroupManagerActionsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListInstanceNetworkInterfaceIpsOptions = *options - pager = &InstanceNetworkInterfaceIpsPager{ + var optionsCopy ListInstanceGroupManagerActionsOptions = *options + pager = &InstanceGroupManagerActionsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -103642,19 +117367,19 @@ func (vpc *VpcV1) NewInstanceNetworkInterfaceIpsPager(options *ListInstanceNetwo } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceNetworkInterfaceIpsPager) HasNext() bool { +func (pager *InstanceGroupManagerActionsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { +func (pager *InstanceGroupManagerActionsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerActionIntf, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListInstanceNetworkInterfaceIpsWithContext(ctx, pager.options) + result, _, err := pager.client.ListInstanceGroupManagerActionsWithContext(ctx, pager.options) if err != nil { return } @@ -103671,16 +117396,16 @@ func (pager *InstanceNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Co } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Ips + page = result.Actions return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *InstanceNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { +func (pager *InstanceGroupManagerActionsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerActionIntf, err error) { for pager.HasNext() { - var nextPage []ReservedIP + var nextPage []InstanceGroupManagerActionIntf nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -103691,34 +117416,34 @@ func (pager *InstanceNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Con } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceNetworkInterfaceIpsPager) GetNext() (page []ReservedIP, err error) { +func (pager *InstanceGroupManagerActionsPager) GetNext() (page []InstanceGroupManagerActionIntf, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceNetworkInterfaceIpsPager) GetAll() (allItems []ReservedIP, err error) { +func (pager *InstanceGroupManagerActionsPager) GetAll() (allItems []InstanceGroupManagerActionIntf, err error) { return pager.GetAllWithContext(context.Background()) } -// InstanceGroupsPager can be used to simplify the use of the "ListInstanceGroups" method. -type InstanceGroupsPager struct { +// InstanceGroupManagerPoliciesPager can be used to simplify the use of the "ListInstanceGroupManagerPolicies" method. +type InstanceGroupManagerPoliciesPager struct { hasNext bool - options *ListInstanceGroupsOptions + options *ListInstanceGroupManagerPoliciesOptions client *VpcV1 pageContext struct { next *string } } -// NewInstanceGroupsPager returns a new InstanceGroupsPager instance. -func (vpc *VpcV1) NewInstanceGroupsPager(options *ListInstanceGroupsOptions) (pager *InstanceGroupsPager, err error) { +// NewInstanceGroupManagerPoliciesPager returns a new InstanceGroupManagerPoliciesPager instance. +func (vpc *VpcV1) NewInstanceGroupManagerPoliciesPager(options *ListInstanceGroupManagerPoliciesOptions) (pager *InstanceGroupManagerPoliciesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListInstanceGroupsOptions = *options - pager = &InstanceGroupsPager{ + var optionsCopy ListInstanceGroupManagerPoliciesOptions = *options + pager = &InstanceGroupManagerPoliciesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -103727,19 +117452,19 @@ func (vpc *VpcV1) NewInstanceGroupsPager(options *ListInstanceGroupsOptions) (pa } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupsPager) HasNext() bool { +func (pager *InstanceGroupManagerPoliciesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroup, err error) { +func (pager *InstanceGroupManagerPoliciesPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerPolicyIntf, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListInstanceGroupsWithContext(ctx, pager.options) + result, _, err := pager.client.ListInstanceGroupManagerPoliciesWithContext(ctx, pager.options) if err != nil { return } @@ -103756,16 +117481,16 @@ func (pager *InstanceGroupsPager) GetNextWithContext(ctx context.Context) (page } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.InstanceGroups + page = result.Policies return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *InstanceGroupsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroup, err error) { +func (pager *InstanceGroupManagerPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerPolicyIntf, err error) { for pager.HasNext() { - var nextPage []InstanceGroup + var nextPage []InstanceGroupManagerPolicyIntf nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -103776,12 +117501,12 @@ func (pager *InstanceGroupsPager) GetAllWithContext(ctx context.Context) (allIte } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupsPager) GetNext() (page []InstanceGroup, err error) { +func (pager *InstanceGroupManagerPoliciesPager) GetNext() (page []InstanceGroupManagerPolicyIntf, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupsPager) GetAll() (allItems []InstanceGroup, err error) { +func (pager *InstanceGroupManagerPoliciesPager) GetAll() (allItems []InstanceGroupManagerPolicyIntf, err error) { return pager.GetAllWithContext(context.Background()) } @@ -103870,110 +117595,25 @@ func (pager *InstanceGroupManagersPager) GetAll() (allItems []InstanceGroupManag return pager.GetAllWithContext(context.Background()) } -// InstanceGroupManagerActionsPager can be used to simplify the use of the "ListInstanceGroupManagerActions" method. -type InstanceGroupManagerActionsPager struct { - hasNext bool - options *ListInstanceGroupManagerActionsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupManagerActionsPager returns a new InstanceGroupManagerActionsPager instance. -func (vpc *VpcV1) NewInstanceGroupManagerActionsPager(options *ListInstanceGroupManagerActionsOptions) (pager *InstanceGroupManagerActionsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupManagerActionsOptions = *options - pager = &InstanceGroupManagerActionsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupManagerActionsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupManagerActionsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerActionIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupManagerActionsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Actions - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupManagerActionsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerActionIntf, err error) { - for pager.HasNext() { - var nextPage []InstanceGroupManagerActionIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerActionsPager) GetNext() (page []InstanceGroupManagerActionIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerActionsPager) GetAll() (allItems []InstanceGroupManagerActionIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupManagerPoliciesPager can be used to simplify the use of the "ListInstanceGroupManagerPolicies" method. -type InstanceGroupManagerPoliciesPager struct { +// InstanceGroupMembershipsPager can be used to simplify the use of the "ListInstanceGroupMemberships" method. +type InstanceGroupMembershipsPager struct { hasNext bool - options *ListInstanceGroupManagerPoliciesOptions + options *ListInstanceGroupMembershipsOptions client *VpcV1 pageContext struct { next *string } } -// NewInstanceGroupManagerPoliciesPager returns a new InstanceGroupManagerPoliciesPager instance. -func (vpc *VpcV1) NewInstanceGroupManagerPoliciesPager(options *ListInstanceGroupManagerPoliciesOptions) (pager *InstanceGroupManagerPoliciesPager, err error) { +// NewInstanceGroupMembershipsPager returns a new InstanceGroupMembershipsPager instance. +func (vpc *VpcV1) NewInstanceGroupMembershipsPager(options *ListInstanceGroupMembershipsOptions) (pager *InstanceGroupMembershipsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListInstanceGroupManagerPoliciesOptions = *options - pager = &InstanceGroupManagerPoliciesPager{ + var optionsCopy ListInstanceGroupMembershipsOptions = *options + pager = &InstanceGroupMembershipsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -103982,19 +117622,19 @@ func (vpc *VpcV1) NewInstanceGroupManagerPoliciesPager(options *ListInstanceGrou } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupManagerPoliciesPager) HasNext() bool { +func (pager *InstanceGroupMembershipsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupManagerPoliciesPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerPolicyIntf, err error) { +func (pager *InstanceGroupMembershipsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupMembership, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListInstanceGroupManagerPoliciesWithContext(ctx, pager.options) + result, _, err := pager.client.ListInstanceGroupMembershipsWithContext(ctx, pager.options) if err != nil { return } @@ -104011,16 +117651,16 @@ func (pager *InstanceGroupManagerPoliciesPager) GetNextWithContext(ctx context.C } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Policies + page = result.Memberships return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *InstanceGroupManagerPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerPolicyIntf, err error) { +func (pager *InstanceGroupMembershipsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupMembership, err error) { for pager.HasNext() { - var nextPage []InstanceGroupManagerPolicyIntf + var nextPage []InstanceGroupMembership nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104031,34 +117671,34 @@ func (pager *InstanceGroupManagerPoliciesPager) GetAllWithContext(ctx context.Co } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerPoliciesPager) GetNext() (page []InstanceGroupManagerPolicyIntf, err error) { +func (pager *InstanceGroupMembershipsPager) GetNext() (page []InstanceGroupMembership, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerPoliciesPager) GetAll() (allItems []InstanceGroupManagerPolicyIntf, err error) { +func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMembership, err error) { return pager.GetAllWithContext(context.Background()) } -// InstanceGroupMembershipsPager can be used to simplify the use of the "ListInstanceGroupMemberships" method. -type InstanceGroupMembershipsPager struct { +// InstanceGroupsPager can be used to simplify the use of the "ListInstanceGroups" method. +type InstanceGroupsPager struct { hasNext bool - options *ListInstanceGroupMembershipsOptions + options *ListInstanceGroupsOptions client *VpcV1 pageContext struct { next *string } } -// NewInstanceGroupMembershipsPager returns a new InstanceGroupMembershipsPager instance. -func (vpc *VpcV1) NewInstanceGroupMembershipsPager(options *ListInstanceGroupMembershipsOptions) (pager *InstanceGroupMembershipsPager, err error) { +// NewInstanceGroupsPager returns a new InstanceGroupsPager instance. +func (vpc *VpcV1) NewInstanceGroupsPager(options *ListInstanceGroupsOptions) (pager *InstanceGroupsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListInstanceGroupMembershipsOptions = *options - pager = &InstanceGroupMembershipsPager{ + var optionsCopy ListInstanceGroupsOptions = *options + pager = &InstanceGroupsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -104067,19 +117707,19 @@ func (vpc *VpcV1) NewInstanceGroupMembershipsPager(options *ListInstanceGroupMem } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupMembershipsPager) HasNext() bool { +func (pager *InstanceGroupsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupMembershipsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupMembership, err error) { +func (pager *InstanceGroupsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroup, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListInstanceGroupMembershipsWithContext(ctx, pager.options) + result, _, err := pager.client.ListInstanceGroupsWithContext(ctx, pager.options) if err != nil { return } @@ -104096,16 +117736,16 @@ func (pager *InstanceGroupMembershipsPager) GetNextWithContext(ctx context.Conte } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Memberships + page = result.InstanceGroups return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *InstanceGroupMembershipsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupMembership, err error) { +func (pager *InstanceGroupsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroup, err error) { for pager.HasNext() { - var nextPage []InstanceGroupMembership + var nextPage []InstanceGroup nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104116,12 +117756,12 @@ func (pager *InstanceGroupMembershipsPager) GetAllWithContext(ctx context.Contex } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupMembershipsPager) GetNext() (page []InstanceGroupMembership, err error) { +func (pager *InstanceGroupsPager) GetNext() (page []InstanceGroup, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMembership, err error) { +func (pager *InstanceGroupsPager) GetAll() (allItems []InstanceGroup, err error) { return pager.GetAllWithContext(context.Background()) } @@ -104497,7 +118137,7 @@ func (pager *BackupPoliciesPager) HasNext() bool { } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *BackupPoliciesPager) GetNextWithContext(ctx context.Context) (page []BackupPolicy, err error) { +func (pager *BackupPoliciesPager) GetNextWithContext(ctx context.Context) (page []BackupPolicyIntf, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } @@ -104528,9 +118168,9 @@ func (pager *BackupPoliciesPager) GetNextWithContext(ctx context.Context) (page // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *BackupPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []BackupPolicy, err error) { +func (pager *BackupPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []BackupPolicyIntf, err error) { for pager.HasNext() { - var nextPage []BackupPolicy + var nextPage []BackupPolicyIntf nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104541,12 +118181,12 @@ func (pager *BackupPoliciesPager) GetAllWithContext(ctx context.Context) (allIte } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BackupPoliciesPager) GetNext() (page []BackupPolicy, err error) { +func (pager *BackupPoliciesPager) GetNext() (page []BackupPolicyIntf, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BackupPoliciesPager) GetAll() (allItems []BackupPolicy, err error) { +func (pager *BackupPoliciesPager) GetAll() (allItems []BackupPolicyIntf, err error) { return pager.GetAllWithContext(context.Background()) } @@ -104720,25 +118360,25 @@ func (pager *PlacementGroupsPager) GetAll() (allItems []PlacementGroup, err erro return pager.GetAllWithContext(context.Background()) } -// BareMetalServerProfilesPager can be used to simplify the use of the "ListBareMetalServerProfiles" method. -type BareMetalServerProfilesPager struct { +// BareMetalServerNetworkAttachmentsPager can be used to simplify the use of the "ListBareMetalServerNetworkAttachments" method. +type BareMetalServerNetworkAttachmentsPager struct { hasNext bool - options *ListBareMetalServerProfilesOptions + options *ListBareMetalServerNetworkAttachmentsOptions client *VpcV1 pageContext struct { next *string } } -// NewBareMetalServerProfilesPager returns a new BareMetalServerProfilesPager instance. -func (vpc *VpcV1) NewBareMetalServerProfilesPager(options *ListBareMetalServerProfilesOptions) (pager *BareMetalServerProfilesPager, err error) { +// NewBareMetalServerNetworkAttachmentsPager returns a new BareMetalServerNetworkAttachmentsPager instance. +func (vpc *VpcV1) NewBareMetalServerNetworkAttachmentsPager(options *ListBareMetalServerNetworkAttachmentsOptions) (pager *BareMetalServerNetworkAttachmentsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListBareMetalServerProfilesOptions = *options - pager = &BareMetalServerProfilesPager{ + var optionsCopy ListBareMetalServerNetworkAttachmentsOptions = *options + pager = &BareMetalServerNetworkAttachmentsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -104747,19 +118387,19 @@ func (vpc *VpcV1) NewBareMetalServerProfilesPager(options *ListBareMetalServerPr } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServerProfilesPager) HasNext() bool { +func (pager *BareMetalServerNetworkAttachmentsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServerProfilesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerProfile, err error) { +func (pager *BareMetalServerNetworkAttachmentsPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerNetworkAttachmentIntf, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListBareMetalServerProfilesWithContext(ctx, pager.options) + result, _, err := pager.client.ListBareMetalServerNetworkAttachmentsWithContext(ctx, pager.options) if err != nil { return } @@ -104776,16 +118416,16 @@ func (pager *BareMetalServerProfilesPager) GetNextWithContext(ctx context.Contex } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles + page = result.NetworkAttachments return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *BareMetalServerProfilesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerProfile, err error) { +func (pager *BareMetalServerNetworkAttachmentsPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerNetworkAttachmentIntf, err error) { for pager.HasNext() { - var nextPage []BareMetalServerProfile + var nextPage []BareMetalServerNetworkAttachmentIntf nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104796,34 +118436,34 @@ func (pager *BareMetalServerProfilesPager) GetAllWithContext(ctx context.Context } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerProfilesPager) GetNext() (page []BareMetalServerProfile, err error) { +func (pager *BareMetalServerNetworkAttachmentsPager) GetNext() (page []BareMetalServerNetworkAttachmentIntf, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerProfilesPager) GetAll() (allItems []BareMetalServerProfile, err error) { +func (pager *BareMetalServerNetworkAttachmentsPager) GetAll() (allItems []BareMetalServerNetworkAttachmentIntf, err error) { return pager.GetAllWithContext(context.Background()) } -// BareMetalServersPager can be used to simplify the use of the "ListBareMetalServers" method. -type BareMetalServersPager struct { +// BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "ListBareMetalServerNetworkInterfaces" method. +type BareMetalServerNetworkInterfacesPager struct { hasNext bool - options *ListBareMetalServersOptions + options *ListBareMetalServerNetworkInterfacesOptions client *VpcV1 pageContext struct { next *string } } -// NewBareMetalServersPager returns a new BareMetalServersPager instance. -func (vpc *VpcV1) NewBareMetalServersPager(options *ListBareMetalServersOptions) (pager *BareMetalServersPager, err error) { +// NewBareMetalServerNetworkInterfacesPager returns a new BareMetalServerNetworkInterfacesPager instance. +func (vpc *VpcV1) NewBareMetalServerNetworkInterfacesPager(options *ListBareMetalServerNetworkInterfacesOptions) (pager *BareMetalServerNetworkInterfacesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListBareMetalServersOptions = *options - pager = &BareMetalServersPager{ + var optionsCopy ListBareMetalServerNetworkInterfacesOptions = *options + pager = &BareMetalServerNetworkInterfacesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -104832,19 +118472,19 @@ func (vpc *VpcV1) NewBareMetalServersPager(options *ListBareMetalServersOptions) } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServersPager) HasNext() bool { +func (pager *BareMetalServerNetworkInterfacesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServersPager) GetNextWithContext(ctx context.Context) (page []BareMetalServer, err error) { +func (pager *BareMetalServerNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerNetworkInterfaceIntf, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListBareMetalServersWithContext(ctx, pager.options) + result, _, err := pager.client.ListBareMetalServerNetworkInterfacesWithContext(ctx, pager.options) if err != nil { return } @@ -104861,16 +118501,16 @@ func (pager *BareMetalServersPager) GetNextWithContext(ctx context.Context) (pag } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.BareMetalServers + page = result.NetworkInterfaces return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *BareMetalServersPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServer, err error) { +func (pager *BareMetalServerNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerNetworkInterfaceIntf, err error) { for pager.HasNext() { - var nextPage []BareMetalServer + var nextPage []BareMetalServerNetworkInterfaceIntf nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104881,34 +118521,34 @@ func (pager *BareMetalServersPager) GetAllWithContext(ctx context.Context) (allI } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServersPager) GetNext() (page []BareMetalServer, err error) { +func (pager *BareMetalServerNetworkInterfacesPager) GetNext() (page []BareMetalServerNetworkInterfaceIntf, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServersPager) GetAll() (allItems []BareMetalServer, err error) { +func (pager *BareMetalServerNetworkInterfacesPager) GetAll() (allItems []BareMetalServerNetworkInterfaceIntf, err error) { return pager.GetAllWithContext(context.Background()) } -// BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "ListBareMetalServerNetworkInterfaces" method. -type BareMetalServerNetworkInterfacesPager struct { +// BareMetalServerProfilesPager can be used to simplify the use of the "ListBareMetalServerProfiles" method. +type BareMetalServerProfilesPager struct { hasNext bool - options *ListBareMetalServerNetworkInterfacesOptions + options *ListBareMetalServerProfilesOptions client *VpcV1 pageContext struct { next *string } } -// NewBareMetalServerNetworkInterfacesPager returns a new BareMetalServerNetworkInterfacesPager instance. -func (vpc *VpcV1) NewBareMetalServerNetworkInterfacesPager(options *ListBareMetalServerNetworkInterfacesOptions) (pager *BareMetalServerNetworkInterfacesPager, err error) { +// NewBareMetalServerProfilesPager returns a new BareMetalServerProfilesPager instance. +func (vpc *VpcV1) NewBareMetalServerProfilesPager(options *ListBareMetalServerProfilesOptions) (pager *BareMetalServerProfilesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListBareMetalServerNetworkInterfacesOptions = *options - pager = &BareMetalServerNetworkInterfacesPager{ + var optionsCopy ListBareMetalServerProfilesOptions = *options + pager = &BareMetalServerProfilesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -104917,19 +118557,19 @@ func (vpc *VpcV1) NewBareMetalServerNetworkInterfacesPager(options *ListBareMeta } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServerNetworkInterfacesPager) HasNext() bool { +func (pager *BareMetalServerProfilesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServerNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerNetworkInterfaceIntf, err error) { +func (pager *BareMetalServerProfilesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerProfile, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListBareMetalServerNetworkInterfacesWithContext(ctx, pager.options) + result, _, err := pager.client.ListBareMetalServerProfilesWithContext(ctx, pager.options) if err != nil { return } @@ -104946,16 +118586,16 @@ func (pager *BareMetalServerNetworkInterfacesPager) GetNextWithContext(ctx conte } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.NetworkInterfaces + page = result.Profiles return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *BareMetalServerNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerNetworkInterfaceIntf, err error) { +func (pager *BareMetalServerProfilesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerProfile, err error) { for pager.HasNext() { - var nextPage []BareMetalServerNetworkInterfaceIntf + var nextPage []BareMetalServerProfile nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -104966,12 +118606,97 @@ func (pager *BareMetalServerNetworkInterfacesPager) GetAllWithContext(ctx contex } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkInterfacesPager) GetNext() (page []BareMetalServerNetworkInterfaceIntf, err error) { +func (pager *BareMetalServerProfilesPager) GetNext() (page []BareMetalServerProfile, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkInterfacesPager) GetAll() (allItems []BareMetalServerNetworkInterfaceIntf, err error) { +func (pager *BareMetalServerProfilesPager) GetAll() (allItems []BareMetalServerProfile, err error) { + return pager.GetAllWithContext(context.Background()) +} + +// BareMetalServersPager can be used to simplify the use of the "ListBareMetalServers" method. +type BareMetalServersPager struct { + hasNext bool + options *ListBareMetalServersOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewBareMetalServersPager returns a new BareMetalServersPager instance. +func (vpc *VpcV1) NewBareMetalServersPager(options *ListBareMetalServersOptions) (pager *BareMetalServersPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListBareMetalServersOptions = *options + pager = &BareMetalServersPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *BareMetalServersPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *BareMetalServersPager) GetNextWithContext(ctx context.Context) (page []BareMetalServer, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListBareMetalServersWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.BareMetalServers + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *BareMetalServersPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServer, err error) { + for pager.HasNext() { + var nextPage []BareMetalServer + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *BareMetalServersPager) GetNext() (page []BareMetalServer, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *BareMetalServersPager) GetAll() (allItems []BareMetalServer, err error) { return pager.GetAllWithContext(context.Background()) } @@ -105145,6 +118870,91 @@ func (pager *VolumesPager) GetAll() (allItems []Volume, err error) { return pager.GetAllWithContext(context.Background()) } +// SnapshotConsistencyGroupsPager can be used to simplify the use of the "ListSnapshotConsistencyGroups" method. +type SnapshotConsistencyGroupsPager struct { + hasNext bool + options *ListSnapshotConsistencyGroupsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewSnapshotConsistencyGroupsPager returns a new SnapshotConsistencyGroupsPager instance. +func (vpc *VpcV1) NewSnapshotConsistencyGroupsPager(options *ListSnapshotConsistencyGroupsOptions) (pager *SnapshotConsistencyGroupsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListSnapshotConsistencyGroupsOptions = *options + pager = &SnapshotConsistencyGroupsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *SnapshotConsistencyGroupsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *SnapshotConsistencyGroupsPager) GetNextWithContext(ctx context.Context) (page []SnapshotConsistencyGroup, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListSnapshotConsistencyGroupsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.SnapshotConsistencyGroups + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *SnapshotConsistencyGroupsPager) GetAllWithContext(ctx context.Context) (allItems []SnapshotConsistencyGroup, err error) { + for pager.HasNext() { + var nextPage []SnapshotConsistencyGroup + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *SnapshotConsistencyGroupsPager) GetNext() (page []SnapshotConsistencyGroup, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *SnapshotConsistencyGroupsPager) GetAll() (allItems []SnapshotConsistencyGroup, err error) { + return pager.GetAllWithContext(context.Background()) +} + // SnapshotsPager can be used to simplify the use of the "ListSnapshots" method. type SnapshotsPager struct { hasNext bool @@ -105230,6 +119040,91 @@ func (pager *SnapshotsPager) GetAll() (allItems []Snapshot, err error) { return pager.GetAllWithContext(context.Background()) } +// ShareMountTargetsPager can be used to simplify the use of the "ListShareMountTargets" method. +type ShareMountTargetsPager struct { + hasNext bool + options *ListShareMountTargetsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewShareMountTargetsPager returns a new ShareMountTargetsPager instance. +func (vpc *VpcV1) NewShareMountTargetsPager(options *ListShareMountTargetsOptions) (pager *ShareMountTargetsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListShareMountTargetsOptions = *options + pager = &ShareMountTargetsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *ShareMountTargetsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *ShareMountTargetsPager) GetNextWithContext(ctx context.Context) (page []ShareMountTarget, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListShareMountTargetsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.MountTargets + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *ShareMountTargetsPager) GetAllWithContext(ctx context.Context) (allItems []ShareMountTarget, err error) { + for pager.HasNext() { + var nextPage []ShareMountTarget + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *ShareMountTargetsPager) GetNext() (page []ShareMountTarget, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *ShareMountTargetsPager) GetAll() (allItems []ShareMountTarget, err error) { + return pager.GetAllWithContext(context.Background()) +} + // ShareProfilesPager can be used to simplify the use of the "ListShareProfiles" method. type ShareProfilesPager struct { hasNext bool @@ -105400,25 +119295,25 @@ func (pager *SharesPager) GetAll() (allItems []Share, err error) { return pager.GetAllWithContext(context.Background()) } -// ShareMountTargetsPager can be used to simplify the use of the "ListShareMountTargets" method. -type ShareMountTargetsPager struct { +// NetworkInterfaceFloatingIpsPager can be used to simplify the use of the "ListNetworkInterfaceFloatingIps" method. +type NetworkInterfaceFloatingIpsPager struct { hasNext bool - options *ListShareMountTargetsOptions + options *ListNetworkInterfaceFloatingIpsOptions client *VpcV1 pageContext struct { next *string } } -// NewShareMountTargetsPager returns a new ShareMountTargetsPager instance. -func (vpc *VpcV1) NewShareMountTargetsPager(options *ListShareMountTargetsOptions) (pager *ShareMountTargetsPager, err error) { +// NewNetworkInterfaceFloatingIpsPager returns a new NetworkInterfaceFloatingIpsPager instance. +func (vpc *VpcV1) NewNetworkInterfaceFloatingIpsPager(options *ListNetworkInterfaceFloatingIpsOptions) (pager *NetworkInterfaceFloatingIpsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListShareMountTargetsOptions = *options - pager = &ShareMountTargetsPager{ + var optionsCopy ListNetworkInterfaceFloatingIpsOptions = *options + pager = &NetworkInterfaceFloatingIpsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105427,19 +119322,19 @@ func (vpc *VpcV1) NewShareMountTargetsPager(options *ListShareMountTargetsOption } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *ShareMountTargetsPager) HasNext() bool { +func (pager *NetworkInterfaceFloatingIpsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *ShareMountTargetsPager) GetNextWithContext(ctx context.Context) (page []ShareMountTarget, err error) { +func (pager *NetworkInterfaceFloatingIpsPager) GetNextWithContext(ctx context.Context) (page []FloatingIPReference, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListShareMountTargetsWithContext(ctx, pager.options) + result, _, err := pager.client.ListNetworkInterfaceFloatingIpsWithContext(ctx, pager.options) if err != nil { return } @@ -105456,16 +119351,16 @@ func (pager *ShareMountTargetsPager) GetNextWithContext(ctx context.Context) (pa } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.MountTargets + page = result.FloatingIps return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *ShareMountTargetsPager) GetAllWithContext(ctx context.Context) (allItems []ShareMountTarget, err error) { +func (pager *NetworkInterfaceFloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems []FloatingIPReference, err error) { for pager.HasNext() { - var nextPage []ShareMountTarget + var nextPage []FloatingIPReference nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105476,34 +119371,34 @@ func (pager *ShareMountTargetsPager) GetAllWithContext(ctx context.Context) (all } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *ShareMountTargetsPager) GetNext() (page []ShareMountTarget, err error) { +func (pager *NetworkInterfaceFloatingIpsPager) GetNext() (page []FloatingIPReference, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *ShareMountTargetsPager) GetAll() (allItems []ShareMountTarget, err error) { +func (pager *NetworkInterfaceFloatingIpsPager) GetAll() (allItems []FloatingIPReference, err error) { return pager.GetAllWithContext(context.Background()) } -// VirtualNetworkInterfacesPager can be used to simplify the use of the "ListVirtualNetworkInterfaces" method. -type VirtualNetworkInterfacesPager struct { +// VirtualNetworkInterfaceIpsPager can be used to simplify the use of the "ListVirtualNetworkInterfaceIps" method. +type VirtualNetworkInterfaceIpsPager struct { hasNext bool - options *ListVirtualNetworkInterfacesOptions + options *ListVirtualNetworkInterfaceIpsOptions client *VpcV1 pageContext struct { next *string } } -// NewVirtualNetworkInterfacesPager returns a new VirtualNetworkInterfacesPager instance. -func (vpc *VpcV1) NewVirtualNetworkInterfacesPager(options *ListVirtualNetworkInterfacesOptions) (pager *VirtualNetworkInterfacesPager, err error) { +// NewVirtualNetworkInterfaceIpsPager returns a new VirtualNetworkInterfaceIpsPager instance. +func (vpc *VpcV1) NewVirtualNetworkInterfaceIpsPager(options *ListVirtualNetworkInterfaceIpsOptions) (pager *VirtualNetworkInterfaceIpsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVirtualNetworkInterfacesOptions = *options - pager = &VirtualNetworkInterfacesPager{ + var optionsCopy ListVirtualNetworkInterfaceIpsOptions = *options + pager = &VirtualNetworkInterfaceIpsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105512,19 +119407,19 @@ func (vpc *VpcV1) NewVirtualNetworkInterfacesPager(options *ListVirtualNetworkIn } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VirtualNetworkInterfacesPager) HasNext() bool { +func (pager *VirtualNetworkInterfaceIpsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VirtualNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []VirtualNetworkInterface, err error) { +func (pager *VirtualNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIPReference, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVirtualNetworkInterfacesWithContext(ctx, pager.options) + result, _, err := pager.client.ListVirtualNetworkInterfaceIpsWithContext(ctx, pager.options) if err != nil { return } @@ -105541,16 +119436,16 @@ func (pager *VirtualNetworkInterfacesPager) GetNextWithContext(ctx context.Conte } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.VirtualNetworkInterfaces + page = result.Ips return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VirtualNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []VirtualNetworkInterface, err error) { +func (pager *VirtualNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIPReference, err error) { for pager.HasNext() { - var nextPage []VirtualNetworkInterface + var nextPage []ReservedIPReference nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105561,34 +119456,34 @@ func (pager *VirtualNetworkInterfacesPager) GetAllWithContext(ctx context.Contex } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfacesPager) GetNext() (page []VirtualNetworkInterface, err error) { +func (pager *VirtualNetworkInterfaceIpsPager) GetNext() (page []ReservedIPReference, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfacesPager) GetAll() (allItems []VirtualNetworkInterface, err error) { +func (pager *VirtualNetworkInterfaceIpsPager) GetAll() (allItems []ReservedIPReference, err error) { return pager.GetAllWithContext(context.Background()) } -// PublicGatewaysPager can be used to simplify the use of the "ListPublicGateways" method. -type PublicGatewaysPager struct { +// VirtualNetworkInterfacesPager can be used to simplify the use of the "ListVirtualNetworkInterfaces" method. +type VirtualNetworkInterfacesPager struct { hasNext bool - options *ListPublicGatewaysOptions + options *ListVirtualNetworkInterfacesOptions client *VpcV1 pageContext struct { next *string } } -// NewPublicGatewaysPager returns a new PublicGatewaysPager instance. -func (vpc *VpcV1) NewPublicGatewaysPager(options *ListPublicGatewaysOptions) (pager *PublicGatewaysPager, err error) { +// NewVirtualNetworkInterfacesPager returns a new VirtualNetworkInterfacesPager instance. +func (vpc *VpcV1) NewVirtualNetworkInterfacesPager(options *ListVirtualNetworkInterfacesOptions) (pager *VirtualNetworkInterfacesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListPublicGatewaysOptions = *options - pager = &PublicGatewaysPager{ + var optionsCopy ListVirtualNetworkInterfacesOptions = *options + pager = &VirtualNetworkInterfacesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105597,19 +119492,19 @@ func (vpc *VpcV1) NewPublicGatewaysPager(options *ListPublicGatewaysOptions) (pa } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *PublicGatewaysPager) HasNext() bool { +func (pager *VirtualNetworkInterfacesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *PublicGatewaysPager) GetNextWithContext(ctx context.Context) (page []PublicGateway, err error) { +func (pager *VirtualNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []VirtualNetworkInterface, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListPublicGatewaysWithContext(ctx, pager.options) + result, _, err := pager.client.ListVirtualNetworkInterfacesWithContext(ctx, pager.options) if err != nil { return } @@ -105626,16 +119521,16 @@ func (pager *PublicGatewaysPager) GetNextWithContext(ctx context.Context) (page } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.PublicGateways + page = result.VirtualNetworkInterfaces return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *PublicGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []PublicGateway, err error) { +func (pager *VirtualNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []VirtualNetworkInterface, err error) { for pager.HasNext() { - var nextPage []PublicGateway + var nextPage []VirtualNetworkInterface nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105646,34 +119541,34 @@ func (pager *PublicGatewaysPager) GetAllWithContext(ctx context.Context) (allIte } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *PublicGatewaysPager) GetNext() (page []PublicGateway, err error) { +func (pager *VirtualNetworkInterfacesPager) GetNext() (page []VirtualNetworkInterface, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *PublicGatewaysPager) GetAll() (allItems []PublicGateway, err error) { +func (pager *VirtualNetworkInterfacesPager) GetAll() (allItems []VirtualNetworkInterface, err error) { return pager.GetAllWithContext(context.Background()) } -// FloatingIpsPager can be used to simplify the use of the "ListFloatingIps" method. -type FloatingIpsPager struct { +// PublicGatewaysPager can be used to simplify the use of the "ListPublicGateways" method. +type PublicGatewaysPager struct { hasNext bool - options *ListFloatingIpsOptions + options *ListPublicGatewaysOptions client *VpcV1 pageContext struct { next *string } } -// NewFloatingIpsPager returns a new FloatingIpsPager instance. -func (vpc *VpcV1) NewFloatingIpsPager(options *ListFloatingIpsOptions) (pager *FloatingIpsPager, err error) { +// NewPublicGatewaysPager returns a new PublicGatewaysPager instance. +func (vpc *VpcV1) NewPublicGatewaysPager(options *ListPublicGatewaysOptions) (pager *PublicGatewaysPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListFloatingIpsOptions = *options - pager = &FloatingIpsPager{ + var optionsCopy ListPublicGatewaysOptions = *options + pager = &PublicGatewaysPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105682,19 +119577,19 @@ func (vpc *VpcV1) NewFloatingIpsPager(options *ListFloatingIpsOptions) (pager *F } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *FloatingIpsPager) HasNext() bool { +func (pager *PublicGatewaysPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *FloatingIpsPager) GetNextWithContext(ctx context.Context) (page []FloatingIP, err error) { +func (pager *PublicGatewaysPager) GetNextWithContext(ctx context.Context) (page []PublicGateway, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListFloatingIpsWithContext(ctx, pager.options) + result, _, err := pager.client.ListPublicGatewaysWithContext(ctx, pager.options) if err != nil { return } @@ -105711,16 +119606,16 @@ func (pager *FloatingIpsPager) GetNextWithContext(ctx context.Context) (page []F } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.FloatingIps + page = result.PublicGateways return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *FloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems []FloatingIP, err error) { +func (pager *PublicGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []PublicGateway, err error) { for pager.HasNext() { - var nextPage []FloatingIP + var nextPage []PublicGateway nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105731,34 +119626,34 @@ func (pager *FloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *FloatingIpsPager) GetNext() (page []FloatingIP, err error) { +func (pager *PublicGatewaysPager) GetNext() (page []PublicGateway, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *FloatingIpsPager) GetAll() (allItems []FloatingIP, err error) { +func (pager *PublicGatewaysPager) GetAll() (allItems []PublicGateway, err error) { return pager.GetAllWithContext(context.Background()) } -// NetworkAclsPager can be used to simplify the use of the "ListNetworkAcls" method. -type NetworkAclsPager struct { +// FloatingIpsPager can be used to simplify the use of the "ListFloatingIps" method. +type FloatingIpsPager struct { hasNext bool - options *ListNetworkAclsOptions + options *ListFloatingIpsOptions client *VpcV1 pageContext struct { next *string } } -// NewNetworkAclsPager returns a new NetworkAclsPager instance. -func (vpc *VpcV1) NewNetworkAclsPager(options *ListNetworkAclsOptions) (pager *NetworkAclsPager, err error) { +// NewFloatingIpsPager returns a new FloatingIpsPager instance. +func (vpc *VpcV1) NewFloatingIpsPager(options *ListFloatingIpsOptions) (pager *FloatingIpsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListNetworkAclsOptions = *options - pager = &NetworkAclsPager{ + var optionsCopy ListFloatingIpsOptions = *options + pager = &FloatingIpsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105767,19 +119662,19 @@ func (vpc *VpcV1) NewNetworkAclsPager(options *ListNetworkAclsOptions) (pager *N } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *NetworkAclsPager) HasNext() bool { +func (pager *FloatingIpsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *NetworkAclsPager) GetNextWithContext(ctx context.Context) (page []NetworkACL, err error) { +func (pager *FloatingIpsPager) GetNextWithContext(ctx context.Context) (page []FloatingIP, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListNetworkAclsWithContext(ctx, pager.options) + result, _, err := pager.client.ListFloatingIpsWithContext(ctx, pager.options) if err != nil { return } @@ -105796,16 +119691,16 @@ func (pager *NetworkAclsPager) GetNextWithContext(ctx context.Context) (page []N } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.NetworkAcls + page = result.FloatingIps return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *NetworkAclsPager) GetAllWithContext(ctx context.Context) (allItems []NetworkACL, err error) { +func (pager *FloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems []FloatingIP, err error) { for pager.HasNext() { - var nextPage []NetworkACL + var nextPage []FloatingIP nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105816,12 +119711,12 @@ func (pager *NetworkAclsPager) GetAllWithContext(ctx context.Context) (allItems } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *NetworkAclsPager) GetNext() (page []NetworkACL, err error) { +func (pager *FloatingIpsPager) GetNext() (page []FloatingIP, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *NetworkAclsPager) GetAll() (allItems []NetworkACL, err error) { +func (pager *FloatingIpsPager) GetAll() (allItems []FloatingIP, err error) { return pager.GetAllWithContext(context.Background()) } @@ -105910,25 +119805,25 @@ func (pager *NetworkACLRulesPager) GetAll() (allItems []NetworkACLRuleItemIntf, return pager.GetAllWithContext(context.Background()) } -// SecurityGroupsPager can be used to simplify the use of the "ListSecurityGroups" method. -type SecurityGroupsPager struct { +// NetworkAclsPager can be used to simplify the use of the "ListNetworkAcls" method. +type NetworkAclsPager struct { hasNext bool - options *ListSecurityGroupsOptions + options *ListNetworkAclsOptions client *VpcV1 pageContext struct { next *string } } -// NewSecurityGroupsPager returns a new SecurityGroupsPager instance. -func (vpc *VpcV1) NewSecurityGroupsPager(options *ListSecurityGroupsOptions) (pager *SecurityGroupsPager, err error) { +// NewNetworkAclsPager returns a new NetworkAclsPager instance. +func (vpc *VpcV1) NewNetworkAclsPager(options *ListNetworkAclsOptions) (pager *NetworkAclsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListSecurityGroupsOptions = *options - pager = &SecurityGroupsPager{ + var optionsCopy ListNetworkAclsOptions = *options + pager = &NetworkAclsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -105937,19 +119832,19 @@ func (vpc *VpcV1) NewSecurityGroupsPager(options *ListSecurityGroupsOptions) (pa } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *SecurityGroupsPager) HasNext() bool { +func (pager *NetworkAclsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *SecurityGroupsPager) GetNextWithContext(ctx context.Context) (page []SecurityGroup, err error) { +func (pager *NetworkAclsPager) GetNextWithContext(ctx context.Context) (page []NetworkACL, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListSecurityGroupsWithContext(ctx, pager.options) + result, _, err := pager.client.ListNetworkAclsWithContext(ctx, pager.options) if err != nil { return } @@ -105966,16 +119861,16 @@ func (pager *SecurityGroupsPager) GetNextWithContext(ctx context.Context) (page } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.SecurityGroups + page = result.NetworkAcls return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *SecurityGroupsPager) GetAllWithContext(ctx context.Context) (allItems []SecurityGroup, err error) { +func (pager *NetworkAclsPager) GetAllWithContext(ctx context.Context) (allItems []NetworkACL, err error) { for pager.HasNext() { - var nextPage []SecurityGroup + var nextPage []NetworkACL nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -105986,12 +119881,12 @@ func (pager *SecurityGroupsPager) GetAllWithContext(ctx context.Context) (allIte } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupsPager) GetNext() (page []SecurityGroup, err error) { +func (pager *NetworkAclsPager) GetNext() (page []NetworkACL, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupsPager) GetAll() (allItems []SecurityGroup, err error) { +func (pager *NetworkAclsPager) GetAll() (allItems []NetworkACL, err error) { return pager.GetAllWithContext(context.Background()) } @@ -106080,6 +119975,91 @@ func (pager *SecurityGroupTargetsPager) GetAll() (allItems []SecurityGroupTarget return pager.GetAllWithContext(context.Background()) } +// SecurityGroupsPager can be used to simplify the use of the "ListSecurityGroups" method. +type SecurityGroupsPager struct { + hasNext bool + options *ListSecurityGroupsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewSecurityGroupsPager returns a new SecurityGroupsPager instance. +func (vpc *VpcV1) NewSecurityGroupsPager(options *ListSecurityGroupsOptions) (pager *SecurityGroupsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListSecurityGroupsOptions = *options + pager = &SecurityGroupsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *SecurityGroupsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *SecurityGroupsPager) GetNextWithContext(ctx context.Context) (page []SecurityGroup, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListSecurityGroupsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.SecurityGroups + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *SecurityGroupsPager) GetAllWithContext(ctx context.Context) (allItems []SecurityGroup, err error) { + for pager.HasNext() { + var nextPage []SecurityGroup + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *SecurityGroupsPager) GetNext() (page []SecurityGroup, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *SecurityGroupsPager) GetAll() (allItems []SecurityGroup, err error) { + return pager.GetAllWithContext(context.Background()) +} + // IkePoliciesPager can be used to simplify the use of the "ListIkePolicies" method. type IkePoliciesPager struct { hasNext bool @@ -106335,25 +120315,25 @@ func (pager *VPNGatewaysPager) GetAll() (allItems []VPNGatewayIntf, err error) { return pager.GetAllWithContext(context.Background()) } -// VPNServersPager can be used to simplify the use of the "ListVPNServers" method. -type VPNServersPager struct { +// VPNServerClientsPager can be used to simplify the use of the "ListVPNServerClients" method. +type VPNServerClientsPager struct { hasNext bool - options *ListVPNServersOptions + options *ListVPNServerClientsOptions client *VpcV1 pageContext struct { next *string } } -// NewVPNServersPager returns a new VPNServersPager instance. -func (vpc *VpcV1) NewVPNServersPager(options *ListVPNServersOptions) (pager *VPNServersPager, err error) { +// NewVPNServerClientsPager returns a new VPNServerClientsPager instance. +func (vpc *VpcV1) NewVPNServerClientsPager(options *ListVPNServerClientsOptions) (pager *VPNServerClientsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVPNServersOptions = *options - pager = &VPNServersPager{ + var optionsCopy ListVPNServerClientsOptions = *options + pager = &VPNServerClientsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -106362,19 +120342,19 @@ func (vpc *VpcV1) NewVPNServersPager(options *ListVPNServersOptions) (pager *VPN } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServersPager) HasNext() bool { +func (pager *VPNServerClientsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServersPager) GetNextWithContext(ctx context.Context) (page []VPNServer, err error) { +func (pager *VPNServerClientsPager) GetNextWithContext(ctx context.Context) (page []VPNServerClient, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVPNServersWithContext(ctx, pager.options) + result, _, err := pager.client.ListVPNServerClientsWithContext(ctx, pager.options) if err != nil { return } @@ -106391,16 +120371,16 @@ func (pager *VPNServersPager) GetNextWithContext(ctx context.Context) (page []VP } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.VPNServers + page = result.Clients return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VPNServersPager) GetAllWithContext(ctx context.Context) (allItems []VPNServer, err error) { +func (pager *VPNServerClientsPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerClient, err error) { for pager.HasNext() { - var nextPage []VPNServer + var nextPage []VPNServerClient nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -106411,34 +120391,34 @@ func (pager *VPNServersPager) GetAllWithContext(ctx context.Context) (allItems [ } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServersPager) GetNext() (page []VPNServer, err error) { +func (pager *VPNServerClientsPager) GetNext() (page []VPNServerClient, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServersPager) GetAll() (allItems []VPNServer, err error) { +func (pager *VPNServerClientsPager) GetAll() (allItems []VPNServerClient, err error) { return pager.GetAllWithContext(context.Background()) } -// VPNServerClientsPager can be used to simplify the use of the "ListVPNServerClients" method. -type VPNServerClientsPager struct { +// VPNServerRoutesPager can be used to simplify the use of the "ListVPNServerRoutes" method. +type VPNServerRoutesPager struct { hasNext bool - options *ListVPNServerClientsOptions + options *ListVPNServerRoutesOptions client *VpcV1 pageContext struct { next *string } } -// NewVPNServerClientsPager returns a new VPNServerClientsPager instance. -func (vpc *VpcV1) NewVPNServerClientsPager(options *ListVPNServerClientsOptions) (pager *VPNServerClientsPager, err error) { +// NewVPNServerRoutesPager returns a new VPNServerRoutesPager instance. +func (vpc *VpcV1) NewVPNServerRoutesPager(options *ListVPNServerRoutesOptions) (pager *VPNServerRoutesPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVPNServerClientsOptions = *options - pager = &VPNServerClientsPager{ + var optionsCopy ListVPNServerRoutesOptions = *options + pager = &VPNServerRoutesPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -106447,19 +120427,19 @@ func (vpc *VpcV1) NewVPNServerClientsPager(options *ListVPNServerClientsOptions) } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServerClientsPager) HasNext() bool { +func (pager *VPNServerRoutesPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServerClientsPager) GetNextWithContext(ctx context.Context) (page []VPNServerClient, err error) { +func (pager *VPNServerRoutesPager) GetNextWithContext(ctx context.Context) (page []VPNServerRoute, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVPNServerClientsWithContext(ctx, pager.options) + result, _, err := pager.client.ListVPNServerRoutesWithContext(ctx, pager.options) if err != nil { return } @@ -106476,16 +120456,16 @@ func (pager *VPNServerClientsPager) GetNextWithContext(ctx context.Context) (pag } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Clients + page = result.Routes return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VPNServerClientsPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerClient, err error) { +func (pager *VPNServerRoutesPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerRoute, err error) { for pager.HasNext() { - var nextPage []VPNServerClient + var nextPage []VPNServerRoute nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -106496,34 +120476,34 @@ func (pager *VPNServerClientsPager) GetAllWithContext(ctx context.Context) (allI } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerClientsPager) GetNext() (page []VPNServerClient, err error) { +func (pager *VPNServerRoutesPager) GetNext() (page []VPNServerRoute, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerClientsPager) GetAll() (allItems []VPNServerClient, err error) { +func (pager *VPNServerRoutesPager) GetAll() (allItems []VPNServerRoute, err error) { return pager.GetAllWithContext(context.Background()) } -// VPNServerRoutesPager can be used to simplify the use of the "ListVPNServerRoutes" method. -type VPNServerRoutesPager struct { +// VPNServersPager can be used to simplify the use of the "ListVPNServers" method. +type VPNServersPager struct { hasNext bool - options *ListVPNServerRoutesOptions + options *ListVPNServersOptions client *VpcV1 pageContext struct { next *string } } -// NewVPNServerRoutesPager returns a new VPNServerRoutesPager instance. -func (vpc *VpcV1) NewVPNServerRoutesPager(options *ListVPNServerRoutesOptions) (pager *VPNServerRoutesPager, err error) { +// NewVPNServersPager returns a new VPNServersPager instance. +func (vpc *VpcV1) NewVPNServersPager(options *ListVPNServersOptions) (pager *VPNServersPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListVPNServerRoutesOptions = *options - pager = &VPNServerRoutesPager{ + var optionsCopy ListVPNServersOptions = *options + pager = &VPNServersPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -106532,19 +120512,19 @@ func (vpc *VpcV1) NewVPNServerRoutesPager(options *ListVPNServerRoutesOptions) ( } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServerRoutesPager) HasNext() bool { +func (pager *VPNServersPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServerRoutesPager) GetNextWithContext(ctx context.Context) (page []VPNServerRoute, err error) { +func (pager *VPNServersPager) GetNextWithContext(ctx context.Context) (page []VPNServer, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListVPNServerRoutesWithContext(ctx, pager.options) + result, _, err := pager.client.ListVPNServersWithContext(ctx, pager.options) if err != nil { return } @@ -106561,16 +120541,16 @@ func (pager *VPNServerRoutesPager) GetNextWithContext(ctx context.Context) (page } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Routes + page = result.VPNServers return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *VPNServerRoutesPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerRoute, err error) { +func (pager *VPNServersPager) GetAllWithContext(ctx context.Context) (allItems []VPNServer, err error) { for pager.HasNext() { - var nextPage []VPNServerRoute + var nextPage []VPNServer nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -106581,12 +120561,12 @@ func (pager *VPNServerRoutesPager) GetAllWithContext(ctx context.Context) (allIt } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerRoutesPager) GetNext() (page []VPNServerRoute, err error) { +func (pager *VPNServersPager) GetNext() (page []VPNServer, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerRoutesPager) GetAll() (allItems []VPNServerRoute, err error) { +func (pager *VPNServersPager) GetAll() (allItems []VPNServer, err error) { return pager.GetAllWithContext(context.Background()) } @@ -106760,25 +120740,25 @@ func (pager *LoadBalancersPager) GetAll() (allItems []LoadBalancer, err error) { return pager.GetAllWithContext(context.Background()) } -// EndpointGatewaysPager can be used to simplify the use of the "ListEndpointGateways" method. -type EndpointGatewaysPager struct { +// EndpointGatewayIpsPager can be used to simplify the use of the "ListEndpointGatewayIps" method. +type EndpointGatewayIpsPager struct { hasNext bool - options *ListEndpointGatewaysOptions + options *ListEndpointGatewayIpsOptions client *VpcV1 pageContext struct { next *string } } -// NewEndpointGatewaysPager returns a new EndpointGatewaysPager instance. -func (vpc *VpcV1) NewEndpointGatewaysPager(options *ListEndpointGatewaysOptions) (pager *EndpointGatewaysPager, err error) { +// NewEndpointGatewayIpsPager returns a new EndpointGatewayIpsPager instance. +func (vpc *VpcV1) NewEndpointGatewayIpsPager(options *ListEndpointGatewayIpsOptions) (pager *EndpointGatewayIpsPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListEndpointGatewaysOptions = *options - pager = &EndpointGatewaysPager{ + var optionsCopy ListEndpointGatewayIpsOptions = *options + pager = &EndpointGatewayIpsPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -106787,19 +120767,19 @@ func (vpc *VpcV1) NewEndpointGatewaysPager(options *ListEndpointGatewaysOptions) } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *EndpointGatewaysPager) HasNext() bool { +func (pager *EndpointGatewayIpsPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *EndpointGatewaysPager) GetNextWithContext(ctx context.Context) (page []EndpointGateway, err error) { +func (pager *EndpointGatewayIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListEndpointGatewaysWithContext(ctx, pager.options) + result, _, err := pager.client.ListEndpointGatewayIpsWithContext(ctx, pager.options) if err != nil { return } @@ -106816,16 +120796,16 @@ func (pager *EndpointGatewaysPager) GetNextWithContext(ctx context.Context) (pag } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.EndpointGateways + page = result.Ips return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *EndpointGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []EndpointGateway, err error) { +func (pager *EndpointGatewayIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { for pager.HasNext() { - var nextPage []EndpointGateway + var nextPage []ReservedIP nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -106836,34 +120816,34 @@ func (pager *EndpointGatewaysPager) GetAllWithContext(ctx context.Context) (allI } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewaysPager) GetNext() (page []EndpointGateway, err error) { +func (pager *EndpointGatewayIpsPager) GetNext() (page []ReservedIP, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewaysPager) GetAll() (allItems []EndpointGateway, err error) { +func (pager *EndpointGatewayIpsPager) GetAll() (allItems []ReservedIP, err error) { return pager.GetAllWithContext(context.Background()) } -// EndpointGatewayIpsPager can be used to simplify the use of the "ListEndpointGatewayIps" method. -type EndpointGatewayIpsPager struct { +// EndpointGatewaysPager can be used to simplify the use of the "ListEndpointGateways" method. +type EndpointGatewaysPager struct { hasNext bool - options *ListEndpointGatewayIpsOptions + options *ListEndpointGatewaysOptions client *VpcV1 pageContext struct { next *string } } -// NewEndpointGatewayIpsPager returns a new EndpointGatewayIpsPager instance. -func (vpc *VpcV1) NewEndpointGatewayIpsPager(options *ListEndpointGatewayIpsOptions) (pager *EndpointGatewayIpsPager, err error) { +// NewEndpointGatewaysPager returns a new EndpointGatewaysPager instance. +func (vpc *VpcV1) NewEndpointGatewaysPager(options *ListEndpointGatewaysOptions) (pager *EndpointGatewaysPager, err error) { if options.Start != nil && *options.Start != "" { err = fmt.Errorf("the 'options.Start' field should not be set") return } - var optionsCopy ListEndpointGatewayIpsOptions = *options - pager = &EndpointGatewayIpsPager{ + var optionsCopy ListEndpointGatewaysOptions = *options + pager = &EndpointGatewaysPager{ hasNext: true, options: &optionsCopy, client: vpc, @@ -106872,19 +120852,19 @@ func (vpc *VpcV1) NewEndpointGatewayIpsPager(options *ListEndpointGatewayIpsOpti } // HasNext returns true if there are potentially more results to be retrieved. -func (pager *EndpointGatewayIpsPager) HasNext() bool { +func (pager *EndpointGatewaysPager) HasNext() bool { return pager.hasNext } // GetNextWithContext returns the next page of results using the specified Context. -func (pager *EndpointGatewayIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { +func (pager *EndpointGatewaysPager) GetNextWithContext(ctx context.Context) (page []EndpointGateway, err error) { if !pager.HasNext() { return nil, fmt.Errorf("no more results available") } pager.options.Start = pager.pageContext.next - result, _, err := pager.client.ListEndpointGatewayIpsWithContext(ctx, pager.options) + result, _, err := pager.client.ListEndpointGatewaysWithContext(ctx, pager.options) if err != nil { return } @@ -106901,16 +120881,16 @@ func (pager *EndpointGatewayIpsPager) GetNextWithContext(ctx context.Context) (p } pager.pageContext.next = next pager.hasNext = (pager.pageContext.next != nil) - page = result.Ips + page = result.EndpointGateways return } // GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly // until all pages of results have been retrieved. -func (pager *EndpointGatewayIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { +func (pager *EndpointGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []EndpointGateway, err error) { for pager.HasNext() { - var nextPage []ReservedIP + var nextPage []EndpointGateway nextPage, err = pager.GetNextWithContext(ctx) if err != nil { return @@ -106921,12 +120901,12 @@ func (pager *EndpointGatewayIpsPager) GetAllWithContext(ctx context.Context) (al } // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewayIpsPager) GetNext() (page []ReservedIP, err error) { +func (pager *EndpointGatewaysPager) GetNext() (page []EndpointGateway, err error) { return pager.GetNextWithContext(context.Background()) } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewayIpsPager) GetAll() (allItems []ReservedIP, err error) { +func (pager *EndpointGatewaysPager) GetAll() (allItems []EndpointGateway, err error) { return pager.GetAllWithContext(context.Background()) } diff --git a/go.sum b/go.sum index 9b6a3445fb..ee3f1764f8 100644 --- a/go.sum +++ b/go.sum @@ -1266,6 +1266,7 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= @@ -1281,6 +1282,7 @@ github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJK github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= From 98450ad806962251e40626c5ab45506c2d3efc06 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:41:05 +0530 Subject: [PATCH 16/17] feature(reservations): support for instance reservations --- common/github.com/vpc-go-sdk/LICENSE | 201 - .../github.com/vpc-go-sdk/common/headers.go | 67 - .../github.com/vpc-go-sdk/common/version.go | 4 - common/github.com/vpc-go-sdk/go.mod | 12 - common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go | 120996 --------------- go.mod | 12 +- go.sum | 18 + .../vpc/data_source_ibm_is_reservation.go | 2 +- .../vpc/data_source_ibm_is_reservations.go | 2 +- .../vpc/resource_ibm_is_reservation.go | 2 +- .../resource_ibm_is_reservation_activate.go | 2 +- 11 files changed, 31 insertions(+), 121287 deletions(-) delete mode 100644 common/github.com/vpc-go-sdk/LICENSE delete mode 100644 common/github.com/vpc-go-sdk/common/headers.go delete mode 100644 common/github.com/vpc-go-sdk/common/version.go delete mode 100644 common/github.com/vpc-go-sdk/go.mod delete mode 100644 common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go diff --git a/common/github.com/vpc-go-sdk/LICENSE b/common/github.com/vpc-go-sdk/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/common/github.com/vpc-go-sdk/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/common/github.com/vpc-go-sdk/common/headers.go b/common/github.com/vpc-go-sdk/common/headers.go deleted file mode 100644 index 87cc2bfcd9..0000000000 --- a/common/github.com/vpc-go-sdk/common/headers.go +++ /dev/null @@ -1,67 +0,0 @@ -package common - -import ( - "fmt" - "runtime" - - "github.com/google/uuid" -) - -const ( - HEADER_NAME_USER_AGENT = "User-Agent" - - SDK_NAME = "vpc-go-sdk" - - X_CORRELATION_ID = "X-Correlation-Id" - - X_REQUEST_ID = "X-Request-Id" -) - -// GetSdkHeaders - returns the set of SDK-specific headers to be included in an outgoing request. -// -// This function is invoked by generated service methods (i.e. methods which implement the REST API operations -// defined within the API definition). The purpose of this function is to give the SDK implementor the opportunity -// to provide SDK-specific HTTP headers that will be sent with an outgoing REST API request. -// This function is invoked for each invocation of a generated service method, -// so the set of HTTP headers could be request-specific. -// As an optimization, if your SDK will be returning the same set of HTTP headers for each invocation of this -// function, it is recommended that you initialize the returned map just once (perhaps by using -// lazy initialization) and simply return it each time the function is invoked, instead of building it each time -// as in the example below. -// -// Parameters: -// -// serviceName - the name of the service as defined in the API definition (e.g. "MyService1") -// serviceVersion - the version of the service as defined in the API definition (e.g. "V1") -// operationId - the operationId as defined in the API definition (e.g. getContext) -// -// Returns: -// -// a Map which contains the set of headers to be included in the REST API request -func GetSdkHeaders(serviceName string, serviceVersion string, operationId string) map[string]string { - sdkHeaders := make(map[string]string) - - sdkHeaders[HEADER_NAME_USER_AGENT] = GetUserAgentInfo() - sdkHeaders[X_CORRELATION_ID] = GetNewXCorrelationID() - sdkHeaders[X_REQUEST_ID] = GetNewXRequestID() - - return sdkHeaders -} - -var UserAgent string = fmt.Sprintf("%s-%s %s", SDK_NAME, Version, GetSystemInfo()) - -func GetUserAgentInfo() string { - return UserAgent -} -func GetNewXCorrelationID() string { - return uuid.New().String() -} -func GetNewXRequestID() string { - return uuid.New().String() -} - -var systemInfo = fmt.Sprintf("(arch=%s; os=%s; go.version=%s)", runtime.GOARCH, runtime.GOOS, runtime.Version()) - -func GetSystemInfo() string { - return systemInfo -} diff --git a/common/github.com/vpc-go-sdk/common/version.go b/common/github.com/vpc-go-sdk/common/version.go deleted file mode 100644 index 436114bc2b..0000000000 --- a/common/github.com/vpc-go-sdk/common/version.go +++ /dev/null @@ -1,4 +0,0 @@ -package common - -// Version of the SDK -const Version = "0.43.0" diff --git a/common/github.com/vpc-go-sdk/go.mod b/common/github.com/vpc-go-sdk/go.mod deleted file mode 100644 index 08e5a48e29..0000000000 --- a/common/github.com/vpc-go-sdk/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.ibm.com/ibmcloud/vpc-go-sdk - -go 1.16 - -require ( - github.com/IBM/go-sdk-core/v5 v5.10.2 - github.com/IBM/vpc-go-sdk v0.47.0 - github.com/go-openapi/strfmt v0.21.3 - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.20.0 - github.com/stretchr/testify v1.8.0 -) diff --git a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go deleted file mode 100644 index de8c5eeb1c..0000000000 --- a/common/github.com/vpc-go-sdk/vpcv1/vpc_v1.go +++ /dev/null @@ -1,120996 +0,0 @@ -/** - * (C) Copyright IBM Corp. 2024. - * - * 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. - */ - -/* - * IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 - */ - -// Package vpcv1 : Operations and models for the VpcV1 service -package vpcv1 - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "reflect" - "strings" - "time" - - "github.com/IBM/go-sdk-core/v5/core" - common "github.com/IBM/vpc-go-sdk/common" - "github.com/go-openapi/strfmt" -) - -// VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual -// server instances, along with subnets, volumes, load balancers, and more. -// -// API Version: 2023-12-05 -type VpcV1 struct { - Service *core.BaseService - - // The infrastructure generation. For the API behavior documented here, specify - // `2`. - generation *int64 - - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` - // and `2024-01-23`. - Version *string -} - -// DefaultServiceURL is the default URL to make service requests to. -const DefaultServiceURL = "https://au-syd.iaas.cloud.ibm.com/v1" - -// DefaultServiceName is the default key used to find external configuration information. -const DefaultServiceName = "vpc" - -// VpcV1Options : Service options -type VpcV1Options struct { - ServiceName string - URL string - Authenticator core.Authenticator - - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` - // and `2024-01-23`. - Version *string -} - -// NewVpcV1UsingExternalConfig : constructs an instance of VpcV1 with passed in options and external configuration. -func NewVpcV1UsingExternalConfig(options *VpcV1Options) (vpc *VpcV1, err error) { - if options.ServiceName == "" { - options.ServiceName = DefaultServiceName - } - - if options.Authenticator == nil { - options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) - if err != nil { - return - } - } - - vpc, err = NewVpcV1(options) - if err != nil { - return - } - - err = vpc.Service.ConfigureService(options.ServiceName) - if err != nil { - return - } - - if options.URL != "" { - err = vpc.Service.SetServiceURL(options.URL) - } - return -} - -// NewVpcV1 : constructs an instance of VpcV1 with passed in options. -func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { - serviceOptions := &core.ServiceOptions{ - URL: DefaultServiceURL, - Authenticator: options.Authenticator, - } - - err = core.ValidateStruct(options, "options") - if err != nil { - return - } - - baseService, err := core.NewBaseService(serviceOptions) - if err != nil { - return - } - - if options.URL != "" { - err = baseService.SetServiceURL(options.URL) - if err != nil { - return - } - } - if options.Version == nil { - options.Version = core.StringPtr("2023-11-16") - } - - service = &VpcV1{ - Service: baseService, - generation: core.Int64Ptr(2), - Version: options.Version, - } - - return -} - -// GetServiceURLForRegion returns the service URL to be used for the specified region -func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") -} - -// Clone makes a copy of "vpc" suitable for processing requests. -func (vpc *VpcV1) Clone() *VpcV1 { - if core.IsNil(vpc) { - return nil - } - clone := *vpc - clone.Service = vpc.Service.Clone() - return &clone -} - -// SetServiceURL sets the service URL -func (vpc *VpcV1) SetServiceURL(url string) error { - return vpc.Service.SetServiceURL(url) -} - -// GetServiceURL returns the service URL -func (vpc *VpcV1) GetServiceURL() string { - return vpc.Service.GetServiceURL() -} - -// SetDefaultHeaders sets HTTP headers to be sent in every request -func (vpc *VpcV1) SetDefaultHeaders(headers http.Header) { - vpc.Service.SetDefaultHeaders(headers) -} - -// SetEnableGzipCompression sets the service's EnableGzipCompression field -func (vpc *VpcV1) SetEnableGzipCompression(enableGzip bool) { - vpc.Service.SetEnableGzipCompression(enableGzip) -} - -// GetEnableGzipCompression returns the service's EnableGzipCompression field -func (vpc *VpcV1) GetEnableGzipCompression() bool { - return vpc.Service.GetEnableGzipCompression() -} - -// EnableRetries enables automatic retries for requests invoked for this service instance. -// If either parameter is specified as 0, then a default value is used instead. -func (vpc *VpcV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration) { - vpc.Service.EnableRetries(maxRetries, maxRetryInterval) -} - -// DisableRetries disables automatic retries for requests invoked for this service instance. -func (vpc *VpcV1) DisableRetries() { - vpc.Service.DisableRetries() -} - -// CreateVPC : Create a VPC -// This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a -// retrieved VPC, and contains the information necessary to create the new VPC. -func (vpc *VpcV1) CreateVPC(createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.CreateVPCWithContext(context.Background(), createVPCOptions) -} - -// CreateVPCWithContext is an alternate form of the CreateVPC method which supports a Context parameter -func (vpc *VpcV1) CreateVPCWithContext(ctx context.Context, createVPCOptions *CreateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(createVPCOptions, "createVPCOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createVPCOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPC") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCOptions.AddressPrefixManagement != nil { - body["address_prefix_management"] = createVPCOptions.AddressPrefixManagement - } - if createVPCOptions.ClassicAccess != nil { - body["classic_access"] = createVPCOptions.ClassicAccess - } - if createVPCOptions.Dns != nil { - body["dns"] = createVPCOptions.Dns - } - if createVPCOptions.Name != nil { - body["name"] = createVPCOptions.Name - } - if createVPCOptions.ResourceGroup != nil { - body["resource_group"] = createVPCOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPCAddressPrefix : Create an address prefix for a VPC -// This request creates a new prefix from a prefix prototype object. The prototype object is structured in the same way -// as a retrieved prefix, and contains the information necessary to create the new prefix. -func (vpc *VpcV1) CreateVPCAddressPrefix(createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.CreateVPCAddressPrefixWithContext(context.Background(), createVPCAddressPrefixOptions) -} - -// CreateVPCAddressPrefixWithContext is an alternate form of the CreateVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) CreateVPCAddressPrefixWithContext(ctx context.Context, createVPCAddressPrefixOptions *CreateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCAddressPrefixOptions, "createVPCAddressPrefixOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *createVPCAddressPrefixOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPCAddressPrefixOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCAddressPrefix") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCAddressPrefixOptions.CIDR != nil { - body["cidr"] = createVPCAddressPrefixOptions.CIDR - } - if createVPCAddressPrefixOptions.Zone != nil { - body["zone"] = createVPCAddressPrefixOptions.Zone - } - if createVPCAddressPrefixOptions.IsDefault != nil { - body["is_default"] = createVPCAddressPrefixOptions.IsDefault - } - if createVPCAddressPrefixOptions.Name != nil { - body["name"] = createVPCAddressPrefixOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPCDnsResolutionBinding : Create a DNS resolution binding -// This request creates a new DNS resolution binding from a DNS resolution binding prototype object. The prototype -// object is structured in the same way as a retrieved DNS resolution binding, and contains the information necessary to -// create the new DNS resolution binding. -// -// For this request to succeed, `dns.enable_hub` must be `false` for the VPC specified by the identifier in the URL, and -// the VPC must not already have a DNS resolution binding. -// -// See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-hub-spoke-model) for more information. -func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.CreateVPCDnsResolutionBindingWithContext(context.Background(), createVPCDnsResolutionBindingOptions) -} - -// CreateVPCDnsResolutionBindingWithContext is an alternate form of the CreateVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) CreateVPCDnsResolutionBindingWithContext(ctx context.Context, createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCDnsResolutionBindingOptions, "createVPCDnsResolutionBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *createVPCDnsResolutionBindingOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPCDnsResolutionBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCDnsResolutionBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCDnsResolutionBindingOptions.VPC != nil { - body["vpc"] = createVPCDnsResolutionBindingOptions.VPC - } - if createVPCDnsResolutionBindingOptions.Name != nil { - body["name"] = createVPCDnsResolutionBindingOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPCRoute : Create a route in a VPC's default routing table -// This request creates a new route in the VPC's default routing table. The route prototype object is structured in the -// same way as a retrieved route, and contains the information necessary to create the new route. The request will fail -// if the new route will cause a loop. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRoute(createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRouteWithContext(context.Background(), createVPCRouteOptions) -} - -// CreateVPCRouteWithContext is an alternate form of the CreateVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) CreateVPCRouteWithContext(ctx context.Context, createVPCRouteOptions *CreateVPCRouteOptions) (result *CreateVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: CreateVPCRoute") - err = core.ValidateNotNil(createVPCRouteOptions, "createVPCRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCRouteOptions, "createVPCRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *createVPCRouteOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPCRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCRouteOptions.Destination != nil { - body["destination"] = createVPCRouteOptions.Destination - } - if createVPCRouteOptions.Zone != nil { - body["zone"] = createVPCRouteOptions.Zone - } - if createVPCRouteOptions.Action != nil { - body["action"] = createVPCRouteOptions.Action - } - if createVPCRouteOptions.Advertise != nil { - body["advertise"] = createVPCRouteOptions.Advertise - } - if createVPCRouteOptions.Name != nil { - body["name"] = createVPCRouteOptions.Name - } - if createVPCRouteOptions.NextHop != nil { - body["next_hop"] = createVPCRouteOptions.NextHop - } - if createVPCRouteOptions.Priority != nil { - body["priority"] = createVPCRouteOptions.Priority - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCreateVPCRouteResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPCRoutingTable : Create a routing table for a VPC -// This request creates a routing table from a routing table prototype object. The prototype object is structured in the -// same way as a retrieved routing table, and contains the information necessary to create the new routing table. -func (vpc *VpcV1) CreateVPCRoutingTable(createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRoutingTableWithContext(context.Background(), createVPCRoutingTableOptions) -} - -// CreateVPCRoutingTableWithContext is an alternate form of the CreateVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) CreateVPCRoutingTableWithContext(ctx context.Context, createVPCRoutingTableOptions *CreateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCRoutingTableOptions, "createVPCRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCRoutingTableOptions, "createVPCRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *createVPCRoutingTableOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPCRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCRoutingTableOptions.AcceptRoutesFrom != nil { - body["accept_routes_from"] = createVPCRoutingTableOptions.AcceptRoutesFrom - } - if createVPCRoutingTableOptions.AdvertiseRoutesTo != nil { - body["advertise_routes_to"] = createVPCRoutingTableOptions.AdvertiseRoutesTo - } - if createVPCRoutingTableOptions.Name != nil { - body["name"] = createVPCRoutingTableOptions.Name - } - if createVPCRoutingTableOptions.RouteDirectLinkIngress != nil { - body["route_direct_link_ingress"] = createVPCRoutingTableOptions.RouteDirectLinkIngress - } - if createVPCRoutingTableOptions.RouteInternetIngress != nil { - body["route_internet_ingress"] = createVPCRoutingTableOptions.RouteInternetIngress - } - if createVPCRoutingTableOptions.RouteTransitGatewayIngress != nil { - body["route_transit_gateway_ingress"] = createVPCRoutingTableOptions.RouteTransitGatewayIngress - } - if createVPCRoutingTableOptions.RouteVPCZoneIngress != nil { - body["route_vpc_zone_ingress"] = createVPCRoutingTableOptions.RouteVPCZoneIngress - } - if createVPCRoutingTableOptions.Routes != nil { - body["routes"] = createVPCRoutingTableOptions.Routes - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPCRoutingTableRoute : Create a route in a VPC routing table -// This request creates a new VPC route from a VPC route prototype object. The prototype object is structured in the -// same way as a retrieved VPC route and contains the information necessary to create the route. -func (vpc *VpcV1) CreateVPCRoutingTableRoute(createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.CreateVPCRoutingTableRouteWithContext(context.Background(), createVPCRoutingTableRouteOptions) -} - -// CreateVPCRoutingTableRouteWithContext is an alternate form of the CreateVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) CreateVPCRoutingTableRouteWithContext(ctx context.Context, createVPCRoutingTableRouteOptions *CreateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPCRoutingTableRouteOptions, "createVPCRoutingTableRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *createVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *createVPCRoutingTableRouteOptions.RoutingTableID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPCRoutingTableRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPCRoutingTableRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPCRoutingTableRouteOptions.Destination != nil { - body["destination"] = createVPCRoutingTableRouteOptions.Destination - } - if createVPCRoutingTableRouteOptions.Zone != nil { - body["zone"] = createVPCRoutingTableRouteOptions.Zone - } - if createVPCRoutingTableRouteOptions.Action != nil { - body["action"] = createVPCRoutingTableRouteOptions.Action - } - if createVPCRoutingTableRouteOptions.Advertise != nil { - body["advertise"] = createVPCRoutingTableRouteOptions.Advertise - } - if createVPCRoutingTableRouteOptions.Name != nil { - body["name"] = createVPCRoutingTableRouteOptions.Name - } - if createVPCRoutingTableRouteOptions.NextHop != nil { - body["next_hop"] = createVPCRoutingTableRouteOptions.NextHop - } - if createVPCRoutingTableRouteOptions.Priority != nil { - body["priority"] = createVPCRoutingTableRouteOptions.Priority - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteVPC : Delete a VPC -// This request deletes a VPC. This operation cannot be reversed. -// -// For this request to succeed: -// - Instances, subnets, public gateways, and endpoint gateways must not reside in this VPC -// - The VPC must not be providing DNS resolution for any other VPCs -// - If `dns.enable_hub` is `true`, `dns.resolution_binding_count` must be zero -// -// All security groups and network ACLs associated with the VPC are automatically deleted. All flow log collectors with -// `auto_delete` set to `true` targeting the VPC or any resource in the VPC are automatically deleted. -func (vpc *VpcV1) DeleteVPC(deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCWithContext(context.Background(), deleteVPCOptions) -} - -// DeleteVPCWithContext is an alternate form of the DeleteVPC method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCWithContext(ctx context.Context, deleteVPCOptions *DeleteVPCOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCOptions, "deleteVPCOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCOptions, "deleteVPCOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteVPCOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPC") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteVPCOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPCAddressPrefix : Delete an address prefix -// This request deletes a prefix. This operation cannot be reversed. The request will fail if any subnets use addresses -// from this prefix. -func (vpc *VpcV1) DeleteVPCAddressPrefix(deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCAddressPrefixWithContext(context.Background(), deleteVPCAddressPrefixOptions) -} - -// DeleteVPCAddressPrefixWithContext is an alternate form of the DeleteVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCAddressPrefixWithContext(ctx context.Context, deleteVPCAddressPrefixOptions *DeleteVPCAddressPrefixOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCAddressPrefixOptions, "deleteVPCAddressPrefixOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCAddressPrefixOptions.VPCID, - "id": *deleteVPCAddressPrefixOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCAddressPrefixOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCAddressPrefix") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPCDnsResolutionBinding : Delete a DNS resolution binding -// This request deletes a DNS resolution binding. This operation cannot be reversed. -// -// For this request to succeed, the VPC specified by the identifier in the URL must not have -// `dns.resolver.type` set to `delegated`. -func (vpc *VpcV1) DeleteVPCDnsResolutionBinding(deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.DeleteVPCDnsResolutionBindingWithContext(context.Background(), deleteVPCDnsResolutionBindingOptions) -} - -// DeleteVPCDnsResolutionBindingWithContext is an alternate form of the DeleteVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCDnsResolutionBindingWithContext(ctx context.Context, deleteVPCDnsResolutionBindingOptions *DeleteVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCDnsResolutionBindingOptions, "deleteVPCDnsResolutionBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCDnsResolutionBindingOptions.VPCID, - "id": *deleteVPCDnsResolutionBindingOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCDnsResolutionBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCDnsResolutionBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteVPCRoute : Delete a VPC route -// This request deletes a route. This operation cannot be reversed. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) DeleteVPCRoute(deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRouteWithContext(context.Background(), deleteVPCRouteOptions) -} - -// DeleteVPCRouteWithContext is an alternate form of the DeleteVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) DeleteVPCRouteWithContext(ctx context.Context, deleteVPCRouteOptions *DeleteVPCRouteOptions) (response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: DeleteVPCRoute") - err = core.ValidateNotNil(deleteVPCRouteOptions, "deleteVPCRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCRouteOptions, "deleteVPCRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRouteOptions.VPCID, - "id": *deleteVPCRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPCRoutingTable : Delete a VPC routing table -// This request deletes a routing table. A routing table cannot be deleted if it is associated with any subnets in the -// VPC. Additionally, a VPC's default routing table cannot be deleted. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPCRoutingTable(deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRoutingTableWithContext(context.Background(), deleteVPCRoutingTableOptions) -} - -// DeleteVPCRoutingTableWithContext is an alternate form of the DeleteVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCRoutingTableWithContext(ctx context.Context, deleteVPCRoutingTableOptions *DeleteVPCRoutingTableOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCRoutingTableOptions, "deleteVPCRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRoutingTableOptions.VPCID, - "id": *deleteVPCRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteVPCRoutingTableOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPCRoutingTableOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPCRoutingTableRoute : Delete a VPC routing table route -// This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are -// allowed to be deleted. -func (vpc *VpcV1) DeleteVPCRoutingTableRoute(deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPCRoutingTableRouteWithContext(context.Background(), deleteVPCRoutingTableRouteOptions) -} - -// DeleteVPCRoutingTableRouteWithContext is an alternate form of the DeleteVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) DeleteVPCRoutingTableRouteWithContext(ctx context.Context, deleteVPCRoutingTableRouteOptions *DeleteVPCRoutingTableRouteOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPCRoutingTableRouteOptions, "deleteVPCRoutingTableRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *deleteVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *deleteVPCRoutingTableRouteOptions.RoutingTableID, - "id": *deleteVPCRoutingTableRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPCRoutingTableRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPCRoutingTableRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetVPC : Retrieve a VPC -// This request retrieves a single VPC specified by the identifier in the URL. -func (vpc *VpcV1) GetVPC(getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.GetVPCWithContext(context.Background(), getVPCOptions) -} - -// GetVPCWithContext is an alternate form of the GetVPC method which supports a Context parameter -func (vpc *VpcV1) GetVPCWithContext(ctx context.Context, getVPCOptions *GetVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCOptions, "getVPCOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCOptions, "getVPCOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPCOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPC") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCAddressPrefix : Retrieve an address prefix -// This request retrieves a single prefix specified by the identifier in the URL. -func (vpc *VpcV1) GetVPCAddressPrefix(getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.GetVPCAddressPrefixWithContext(context.Background(), getVPCAddressPrefixOptions) -} - -// GetVPCAddressPrefixWithContext is an alternate form of the GetVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) GetVPCAddressPrefixWithContext(ctx context.Context, getVPCAddressPrefixOptions *GetVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCAddressPrefixOptions, "getVPCAddressPrefixOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCAddressPrefixOptions.VPCID, - "id": *getVPCAddressPrefixOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCAddressPrefixOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCAddressPrefix") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCDefaultNetworkACL : Retrieve a VPC's default network ACL -// This request retrieves the default network ACL for the VPC specified by the identifier in the URL. The default -// network ACL is applied to any new subnets in the VPC which do not specify a network ACL. -func (vpc *VpcV1) GetVPCDefaultNetworkACL(getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultNetworkACLWithContext(context.Background(), getVPCDefaultNetworkACLOptions) -} - -// GetVPCDefaultNetworkACLWithContext is an alternate form of the GetVPCDefaultNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultNetworkACLWithContext(ctx context.Context, getVPCDefaultNetworkACLOptions *GetVPCDefaultNetworkACLOptions) (result *DefaultNetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCDefaultNetworkACLOptions, "getVPCDefaultNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPCDefaultNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_network_acl`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCDefaultNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCDefaultRoutingTable : Retrieve a VPC's default routing table -// This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default -// routing table is associated with any subnets in the VPC which have not been explicitly associated with another -// routing table. -func (vpc *VpcV1) GetVPCDefaultRoutingTable(getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultRoutingTableWithContext(context.Background(), getVPCDefaultRoutingTableOptions) -} - -// GetVPCDefaultRoutingTableWithContext is an alternate form of the GetVPCDefaultRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultRoutingTableWithContext(ctx context.Context, getVPCDefaultRoutingTableOptions *GetVPCDefaultRoutingTableOptions) (result *DefaultRoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCDefaultRoutingTableOptions, "getVPCDefaultRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPCDefaultRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_routing_table`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCDefaultRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCDefaultSecurityGroup : Retrieve a VPC's default security group -// This request retrieves the default security group for the VPC specified by the identifier in the URL. Resources -// created in this VPC that allow a security group to be optionally specified will use this security group by default. -func (vpc *VpcV1) GetVPCDefaultSecurityGroup(getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { - return vpc.GetVPCDefaultSecurityGroupWithContext(context.Background(), getVPCDefaultSecurityGroupOptions) -} - -// GetVPCDefaultSecurityGroupWithContext is an alternate form of the GetVPCDefaultSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) GetVPCDefaultSecurityGroupWithContext(ctx context.Context, getVPCDefaultSecurityGroupOptions *GetVPCDefaultSecurityGroupOptions) (result *DefaultSecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCDefaultSecurityGroupOptions, "getVPCDefaultSecurityGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPCDefaultSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}/default_security_group`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCDefaultSecurityGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDefaultSecurityGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDefaultSecurityGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCDnsResolutionBinding : Retrieve a DNS resolution binding -// This request retrieves a single DNS resolution binding specified by the identifier in the URL. -func (vpc *VpcV1) GetVPCDnsResolutionBinding(getVPCDnsResolutionBindingOptions *GetVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.GetVPCDnsResolutionBindingWithContext(context.Background(), getVPCDnsResolutionBindingOptions) -} - -// GetVPCDnsResolutionBindingWithContext is an alternate form of the GetVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) GetVPCDnsResolutionBindingWithContext(ctx context.Context, getVPCDnsResolutionBindingOptions *GetVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCDnsResolutionBindingOptions, "getVPCDnsResolutionBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCDnsResolutionBindingOptions, "getVPCDnsResolutionBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCDnsResolutionBindingOptions.VPCID, - "id": *getVPCDnsResolutionBindingOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCDnsResolutionBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCDnsResolutionBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCRoute : Retrieve a VPC route -// This request retrieves a single route specified by the identifier in the URL. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRoute(getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.GetVPCRouteWithContext(context.Background(), getVPCRouteOptions) -} - -// GetVPCRouteWithContext is an alternate form of the GetVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) GetVPCRouteWithContext(ctx context.Context, getVPCRouteOptions *GetVPCRouteOptions) (result *GetVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: GetVPCRoute") - err = core.ValidateNotNil(getVPCRouteOptions, "getVPCRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCRouteOptions, "getVPCRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCRouteOptions.VPCID, - "id": *getVPCRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetVPCRouteResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCRoutingTable : Retrieve a VPC routing table -// This request retrieves a single routing table specified by the identifier in the URL. -func (vpc *VpcV1) GetVPCRoutingTable(getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetVPCRoutingTableWithContext(context.Background(), getVPCRoutingTableOptions) -} - -// GetVPCRoutingTableWithContext is an alternate form of the GetVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetVPCRoutingTableWithContext(ctx context.Context, getVPCRoutingTableOptions *GetVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCRoutingTableOptions, "getVPCRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCRoutingTableOptions, "getVPCRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCRoutingTableOptions.VPCID, - "id": *getVPCRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPCRoutingTableRoute : Retrieve a VPC routing table route -// This request retrieves a single VPC route specified by the identifier in the URL path. -func (vpc *VpcV1) GetVPCRoutingTableRoute(getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.GetVPCRoutingTableRouteWithContext(context.Background(), getVPCRoutingTableRouteOptions) -} - -// GetVPCRoutingTableRouteWithContext is an alternate form of the GetVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) GetVPCRoutingTableRouteWithContext(ctx context.Context, getVPCRoutingTableRouteOptions *GetVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPCRoutingTableRouteOptions, "getVPCRoutingTableRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *getVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *getVPCRoutingTableRouteOptions.RoutingTableID, - "id": *getVPCRoutingTableRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPCRoutingTableRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPCRoutingTableRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPCAddressPrefixes : List all address prefixes for a VPC -// This request lists all address pool prefixes for a VPC. -func (vpc *VpcV1) ListVPCAddressPrefixes(listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCAddressPrefixesWithContext(context.Background(), listVPCAddressPrefixesOptions) -} - -// ListVPCAddressPrefixesWithContext is an alternate form of the ListVPCAddressPrefixes method which supports a Context parameter -func (vpc *VpcV1) ListVPCAddressPrefixesWithContext(ctx context.Context, listVPCAddressPrefixesOptions *ListVPCAddressPrefixesOptions) (result *AddressPrefixCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPCAddressPrefixesOptions, "listVPCAddressPrefixesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *listVPCAddressPrefixesOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPCAddressPrefixesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCAddressPrefixes") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCAddressPrefixesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCAddressPrefixesOptions.Start)) - } - if listVPCAddressPrefixesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCAddressPrefixesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefixCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPCDnsResolutionBindings : List all DNS resolution bindings for a VPC -// This request lists all DNS resolution bindings for a VPC. A DNS resolution binding represents an association with -// another VPC for centralizing DNS name resolution. -// -// If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there is -// one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using -// `allow_dns_resolution_binding`) the hub VPC to centralize resolution of their DNS names. -// -// If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub -// VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using -// `allow_dns_resolution_binding`) its hub VPC to centralize resolution of their DNS names. -// -// To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC -// by setting `dns.resolver.type` to `delegate`. -// -// The bindings will be sorted by their `created_at` property values, with newest bindings first. Bindings with -// identical `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCDnsResolutionBindingsWithContext(context.Background(), listVPCDnsResolutionBindingsOptions) -} - -// ListVPCDnsResolutionBindingsWithContext is an alternate form of the ListVPCDnsResolutionBindings method which supports a Context parameter -func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPCDnsResolutionBindingsOptions, "listVPCDnsResolutionBindingsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *listVPCDnsResolutionBindingsOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPCDnsResolutionBindingsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCDnsResolutionBindings") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCDnsResolutionBindingsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Sort)) - } - if listVPCDnsResolutionBindingsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Start)) - } - if listVPCDnsResolutionBindingsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Limit)) - } - if listVPCDnsResolutionBindingsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.Name)) - } - if listVPCDnsResolutionBindingsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCCRN)) - } - if listVPCDnsResolutionBindingsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.VPCName)) - } - if listVPCDnsResolutionBindingsOptions.AccountID != nil { - builder.AddQuery("account.id", fmt.Sprint(*listVPCDnsResolutionBindingsOptions.AccountID)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBindingCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPCRoutes : List all routes in a VPC's default routing table -// This request lists all routes in the VPC's default routing table. Each route is zone-specific and directs any packets -// matching its destination CIDR block to a `next_hop` IP address. The most specific route matching a packet's -// destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) ListVPCRoutes(listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { - return vpc.ListVPCRoutesWithContext(context.Background(), listVPCRoutesOptions) -} - -// ListVPCRoutesWithContext is an alternate form of the ListVPCRoutes method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) ListVPCRoutesWithContext(ctx context.Context, listVPCRoutesOptions *ListVPCRoutesOptions) (result *RouteCollectionVPCContext, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: ListVPCRoutes") - err = core.ValidateNotNil(listVPCRoutesOptions, "listVPCRoutesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPCRoutesOptions, "listVPCRoutesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *listVPCRoutesOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPCRoutesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutes") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCRoutesOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listVPCRoutesOptions.ZoneName)) - } - if listVPCRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCRoutesOptions.Start)) - } - if listVPCRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCRoutesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollectionVPCContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPCRoutingTableRoutes : List all routes in a VPC routing table -// This request lists all routes in a VPC routing table. If subnets are associated with this routing table, delivery of -// packets sent on a subnet is performed according to the action of the most specific matching route in the table -// (provided the subnet and route are in the same zone). If multiple equally-specific routes exist, the route with the -// highest priority will be used. If two matching routes have the same destination and priority, traffic will be -// distributed between them. If no routes match, delivery will be controlled by the system's built-in routes. -func (vpc *VpcV1) ListVPCRoutingTableRoutes(listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCRoutingTableRoutesWithContext(context.Background(), listVPCRoutingTableRoutesOptions) -} - -// ListVPCRoutingTableRoutesWithContext is an alternate form of the ListVPCRoutingTableRoutes method which supports a Context parameter -func (vpc *VpcV1) ListVPCRoutingTableRoutesWithContext(ctx context.Context, listVPCRoutingTableRoutesOptions *ListVPCRoutingTableRoutesOptions) (result *RouteCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPCRoutingTableRoutesOptions, "listVPCRoutingTableRoutesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *listVPCRoutingTableRoutesOptions.VPCID, - "routing_table_id": *listVPCRoutingTableRoutesOptions.RoutingTableID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPCRoutingTableRoutesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutingTableRoutes") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCRoutingTableRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Start)) - } - if listVPCRoutingTableRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCRoutingTableRoutesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPCRoutingTables : List all routing tables for a VPC -// This request lists all routing tables for a VPC. Each subnet in a VPC is associated with a routing table, which -// controls delivery of packets sent on that subnet according to the action of the most specific matching route in the -// table. If multiple equally-specific routes exist, traffic will be distributed across them. If no routes match, -// delivery will be controlled by the system's built-in routes. -func (vpc *VpcV1) ListVPCRoutingTables(listVPCRoutingTablesOptions *ListVPCRoutingTablesOptions) (result *RoutingTableCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPCRoutingTablesWithContext(context.Background(), listVPCRoutingTablesOptions) -} - -// ListVPCRoutingTablesWithContext is an alternate form of the ListVPCRoutingTables method which supports a Context parameter -func (vpc *VpcV1) ListVPCRoutingTablesWithContext(ctx context.Context, listVPCRoutingTablesOptions *ListVPCRoutingTablesOptions) (result *RoutingTableCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPCRoutingTablesOptions, "listVPCRoutingTablesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPCRoutingTablesOptions, "listVPCRoutingTablesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *listVPCRoutingTablesOptions.VPCID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPCRoutingTablesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPCRoutingTables") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPCRoutingTablesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPCRoutingTablesOptions.Start)) - } - if listVPCRoutingTablesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPCRoutingTablesOptions.Limit)) - } - if listVPCRoutingTablesOptions.IsDefault != nil { - builder.AddQuery("is_default", fmt.Sprint(*listVPCRoutingTablesOptions.IsDefault)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTableCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVpcs : List all VPCs -// This request lists all VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical -// isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC -// can contain resources in multiple zones in a region. -func (vpc *VpcV1) ListVpcs(listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { - return vpc.ListVpcsWithContext(context.Background(), listVpcsOptions) -} - -// ListVpcsWithContext is an alternate form of the ListVpcs method which supports a Context parameter -func (vpc *VpcV1) ListVpcsWithContext(ctx context.Context, listVpcsOptions *ListVpcsOptions) (result *VPCCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVpcsOptions, "listVpcsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVpcsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVpcs") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVpcsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVpcsOptions.Start)) - } - if listVpcsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVpcsOptions.Limit)) - } - if listVpcsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVpcsOptions.ResourceGroupID)) - } - if listVpcsOptions.ClassicAccess != nil { - builder.AddQuery("classic_access", fmt.Sprint(*listVpcsOptions.ClassicAccess)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPCCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPC : Update a VPC -// This request updates a VPC with the information provided in a VPC patch object. The patch object is structured in the -// same way as a retrieved VPC and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateVPC(updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCWithContext(context.Background(), updateVPCOptions) -} - -// UpdateVPCWithContext is an alternate form of the UpdateVPC method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCWithContext(ctx context.Context, updateVPCOptions *UpdateVPCOptions) (result *VPC, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCOptions, "updateVPCOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCOptions, "updateVPCOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateVPCOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPC") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPCOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPCOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCOptions.VPCPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPC) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPCAddressPrefix : Update an address prefix -// This request updates a prefix with the information in a provided prefix patch. The prefix patch object is structured -// in the same way as a retrieved prefix and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPCAddressPrefix(updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCAddressPrefixWithContext(context.Background(), updateVPCAddressPrefixOptions) -} - -// UpdateVPCAddressPrefixWithContext is an alternate form of the UpdateVPCAddressPrefix method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateVPCAddressPrefixOptions *UpdateVPCAddressPrefixOptions) (result *AddressPrefix, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCAddressPrefixOptions, "updateVPCAddressPrefixOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCAddressPrefixOptions.VPCID, - "id": *updateVPCAddressPrefixOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/address_prefixes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCAddressPrefixOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCAddressPrefix") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCAddressPrefixOptions.AddressPrefixPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAddressPrefix) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPCDnsResolutionBinding : Update a DNS resolution binding -// This request updates a DNS resolution binding with the information in a provided DNS resolution binding patch. The -// DNS resolution binding patch object is structured in the same way as a retrieved DNS resolution binding and contains -// only the information to be updated. -func (vpc *VpcV1) UpdateVPCDnsResolutionBinding(updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCDnsResolutionBindingWithContext(context.Background(), updateVPCDnsResolutionBindingOptions) -} - -// UpdateVPCDnsResolutionBindingWithContext is an alternate form of the UpdateVPCDnsResolutionBinding method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCDnsResolutionBindingWithContext(ctx context.Context, updateVPCDnsResolutionBindingOptions *UpdateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCDnsResolutionBindingOptions, "updateVPCDnsResolutionBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCDnsResolutionBindingOptions.VPCID, - "id": *updateVPCDnsResolutionBindingOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/dns_resolution_bindings/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCDnsResolutionBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCDnsResolutionBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCDnsResolutionBindingOptions.VpcdnsResolutionBindingPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPCRoute : Update a VPC route -// This request updates a route with the information in a provided route patch. The route patch object is structured in -// the same way as a retrieved route and contains only the information to be updated. -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRoute(updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRouteWithContext(context.Background(), updateVPCRouteOptions) -} - -// UpdateVPCRouteWithContext is an alternate form of the UpdateVPCRoute method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (vpc *VpcV1) UpdateVPCRouteWithContext(ctx context.Context, updateVPCRouteOptions *UpdateVPCRouteOptions) (result *UpdateVPCRouteResponse, response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: UpdateVPCRoute") - err = core.ValidateNotNil(updateVPCRouteOptions, "updateVPCRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCRouteOptions, "updateVPCRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRouteOptions.VPCID, - "id": *updateVPCRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCRouteOptions.RoutePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalUpdateVPCRouteResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPCRoutingTable : Update a VPC routing table -// This request updates a routing table with the information in a provided routing table patch. The patch object is -// structured in the same way as a retrieved table and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPCRoutingTable(updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRoutingTableWithContext(context.Background(), updateVPCRoutingTableOptions) -} - -// UpdateVPCRoutingTableWithContext is an alternate form of the UpdateVPCRoutingTable method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCRoutingTableWithContext(ctx context.Context, updateVPCRoutingTableOptions *UpdateVPCRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCRoutingTableOptions, "updateVPCRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRoutingTableOptions.VPCID, - "id": *updateVPCRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPCRoutingTableOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPCRoutingTableOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCRoutingTableOptions.RoutingTablePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPCRoutingTableRoute : Update a VPC routing table route -// This request updates a VPC route with the information provided in a route patch object. The patch object is -// structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only VPC -// routes with an `origin` of `user` are allowed to be updated. -func (vpc *VpcV1) UpdateVPCRoutingTableRoute(updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - return vpc.UpdateVPCRoutingTableRouteWithContext(context.Background(), updateVPCRoutingTableRouteOptions) -} - -// UpdateVPCRoutingTableRouteWithContext is an alternate form of the UpdateVPCRoutingTableRoute method which supports a Context parameter -func (vpc *VpcV1) UpdateVPCRoutingTableRouteWithContext(ctx context.Context, updateVPCRoutingTableRouteOptions *UpdateVPCRoutingTableRouteOptions) (result *Route, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPCRoutingTableRouteOptions, "updateVPCRoutingTableRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpc_id": *updateVPCRoutingTableRouteOptions.VPCID, - "routing_table_id": *updateVPCRoutingTableRouteOptions.RoutingTableID, - "id": *updateVPCRoutingTableRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPCRoutingTableRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPCRoutingTableRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPCRoutingTableRouteOptions.RoutePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSubnet : Create a subnet -// This request creates a new subnet from a subnet prototype object. The prototype object is structured in the same way -// as a retrieved subnet, and contains the information necessary to create the new subnet. For this request to succeed, -// the prototype's CIDR block must not overlap with an existing subnet in the VPC. -func (vpc *VpcV1) CreateSubnet(createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - return vpc.CreateSubnetWithContext(context.Background(), createSubnetOptions) -} - -// CreateSubnetWithContext is an alternate form of the CreateSubnet method which supports a Context parameter -func (vpc *VpcV1) CreateSubnetWithContext(ctx context.Context, createSubnetOptions *CreateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSubnetOptions, "createSubnetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSubnetOptions, "createSubnetOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createSubnetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnet") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createSubnetOptions.SubnetPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSubnetReservedIP : Reserve an IP in a subnet -// This request reserves an IP address in a subnet. If the provided prototype object includes an `address`, the address -// must not already be reserved. -func (vpc *VpcV1) CreateSubnetReservedIP(createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.CreateSubnetReservedIPWithContext(context.Background(), createSubnetReservedIPOptions) -} - -// CreateSubnetReservedIPWithContext is an alternate form of the CreateSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) CreateSubnetReservedIPWithContext(ctx context.Context, createSubnetReservedIPOptions *CreateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSubnetReservedIPOptions, "createSubnetReservedIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSubnetReservedIPOptions, "createSubnetReservedIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *createSubnetReservedIPOptions.SubnetID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createSubnetReservedIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSubnetReservedIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createSubnetReservedIPOptions.Address != nil { - body["address"] = createSubnetReservedIPOptions.Address - } - if createSubnetReservedIPOptions.AutoDelete != nil { - body["auto_delete"] = createSubnetReservedIPOptions.AutoDelete - } - if createSubnetReservedIPOptions.Name != nil { - body["name"] = createSubnetReservedIPOptions.Name - } - if createSubnetReservedIPOptions.Target != nil { - body["target"] = createSubnetReservedIPOptions.Target - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteSubnet : Delete a subnet -// This request deletes a subnet. This operation cannot be reversed. For this request to succeed, the subnet must not be -// referenced by any bare metal server network interfaces, instance network interfaces, virtual network interfaces, VPN -// gateways, or load balancers. A delete operation automatically detaches the subnet from any network ACLs, public -// gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to `true` targeting the subnet or any -// resource in the subnet are automatically deleted. -func (vpc *VpcV1) DeleteSubnet(deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSubnetWithContext(context.Background(), deleteSubnetOptions) -} - -// DeleteSubnetWithContext is an alternate form of the DeleteSubnet method which supports a Context parameter -func (vpc *VpcV1) DeleteSubnetWithContext(ctx context.Context, deleteSubnetOptions *DeleteSubnetOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSubnetOptions, "deleteSubnetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSubnetOptions, "deleteSubnetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteSubnetOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSubnetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnet") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteSubnetReservedIP : Delete a reserved IP -// This request releases a reserved IP. This operation cannot be reversed. -// -// For this request to succeed, the reserved IP must not be required by another resource, such as a bare metal server -// network interface, instance network interface or virtual network interface for which it is the primary IP. A -// provider-owned reserved IP is not allowed to be deleted. -func (vpc *VpcV1) DeleteSubnetReservedIP(deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSubnetReservedIPWithContext(context.Background(), deleteSubnetReservedIPOptions) -} - -// DeleteSubnetReservedIPWithContext is an alternate form of the DeleteSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) DeleteSubnetReservedIPWithContext(ctx context.Context, deleteSubnetReservedIPOptions *DeleteSubnetReservedIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSubnetReservedIPOptions, "deleteSubnetReservedIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *deleteSubnetReservedIPOptions.SubnetID, - "id": *deleteSubnetReservedIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSubnetReservedIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSubnetReservedIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetSubnet : Retrieve a subnet -// This request retrieves a single subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnet(getSubnetOptions *GetSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - return vpc.GetSubnetWithContext(context.Background(), getSubnetOptions) -} - -// GetSubnetWithContext is an alternate form of the GetSubnet method which supports a Context parameter -func (vpc *VpcV1) GetSubnetWithContext(ctx context.Context, getSubnetOptions *GetSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetOptions, "getSubnetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSubnetOptions, "getSubnetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSubnetOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSubnetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnet") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSubnetNetworkACL : Retrieve a subnet's attached network ACL -// This request retrieves the network ACL attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetNetworkACL(getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetSubnetNetworkACLWithContext(context.Background(), getSubnetNetworkACLOptions) -} - -// GetSubnetNetworkACLWithContext is an alternate form of the GetSubnetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetSubnetNetworkACLWithContext(ctx context.Context, getSubnetNetworkACLOptions *GetSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSubnetNetworkACLOptions, "getSubnetNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSubnetNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSubnetNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSubnetPublicGateway : Retrieve a subnet's attached public gateway -// This request retrieves the public gateway attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetPublicGateway(getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.GetSubnetPublicGatewayWithContext(context.Background(), getSubnetPublicGatewayOptions) -} - -// GetSubnetPublicGatewayWithContext is an alternate form of the GetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) GetSubnetPublicGatewayWithContext(ctx context.Context, getSubnetPublicGatewayOptions *GetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSubnetPublicGatewayOptions, "getSubnetPublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSubnetPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSubnetPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetPublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSubnetReservedIP : Retrieve a reserved IP -// This request retrieves a single reserved IP specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetReservedIP(getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetSubnetReservedIPWithContext(context.Background(), getSubnetReservedIPOptions) -} - -// GetSubnetReservedIPWithContext is an alternate form of the GetSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) GetSubnetReservedIPWithContext(ctx context.Context, getSubnetReservedIPOptions *GetSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetReservedIPOptions, "getSubnetReservedIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSubnetReservedIPOptions, "getSubnetReservedIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *getSubnetReservedIPOptions.SubnetID, - "id": *getSubnetReservedIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSubnetReservedIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetReservedIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSubnetRoutingTable : Retrieve a subnet's attached routing table -// This request retrieves the routing table attached to the subnet specified by the identifier in the URL. -func (vpc *VpcV1) GetSubnetRoutingTable(getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.GetSubnetRoutingTableWithContext(context.Background(), getSubnetRoutingTableOptions) -} - -// GetSubnetRoutingTableWithContext is an alternate form of the GetSubnetRoutingTable method which supports a Context parameter -func (vpc *VpcV1) GetSubnetRoutingTableWithContext(ctx context.Context, getSubnetRoutingTableOptions *GetSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSubnetRoutingTableOptions, "getSubnetRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSubnetRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/routing_table`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSubnetRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSubnetRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSubnetReservedIps : List all reserved IPs in a subnet -// This request lists all reserved IPs in a subnet. A reserved IP resource will exist for every address in the subnet -// which is not available for use. -func (vpc *VpcV1) ListSubnetReservedIps(listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { - return vpc.ListSubnetReservedIpsWithContext(context.Background(), listSubnetReservedIpsOptions) -} - -// ListSubnetReservedIpsWithContext is an alternate form of the ListSubnetReservedIps method which supports a Context parameter -func (vpc *VpcV1) ListSubnetReservedIpsWithContext(ctx context.Context, listSubnetReservedIpsOptions *ListSubnetReservedIpsOptions) (result *ReservedIPCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSubnetReservedIpsOptions, "listSubnetReservedIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *listSubnetReservedIpsOptions.SubnetID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listSubnetReservedIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnetReservedIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSubnetReservedIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSubnetReservedIpsOptions.Start)) - } - if listSubnetReservedIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSubnetReservedIpsOptions.Limit)) - } - if listSubnetReservedIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSubnetReservedIpsOptions.Sort)) - } - if listSubnetReservedIpsOptions.TargetID != nil { - builder.AddQuery("target.id", fmt.Sprint(*listSubnetReservedIpsOptions.TargetID)) - } - if listSubnetReservedIpsOptions.TargetCRN != nil { - builder.AddQuery("target.crn", fmt.Sprint(*listSubnetReservedIpsOptions.TargetCRN)) - } - if listSubnetReservedIpsOptions.TargetName != nil { - builder.AddQuery("target.name", fmt.Sprint(*listSubnetReservedIpsOptions.TargetName)) - } - if listSubnetReservedIpsOptions.TargetResourceType != nil { - builder.AddQuery("target.resource_type", fmt.Sprint(*listSubnetReservedIpsOptions.TargetResourceType)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSubnets : List all subnets -// This request lists all subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block -// notation. Each subnet is within a particular zone and cannot span multiple zones or regions. -func (vpc *VpcV1) ListSubnets(listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { - return vpc.ListSubnetsWithContext(context.Background(), listSubnetsOptions) -} - -// ListSubnetsWithContext is an alternate form of the ListSubnets method which supports a Context parameter -func (vpc *VpcV1) ListSubnetsWithContext(ctx context.Context, listSubnetsOptions *ListSubnetsOptions) (result *SubnetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSubnetsOptions, "listSubnetsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listSubnetsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSubnets") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSubnetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSubnetsOptions.Start)) - } - if listSubnetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSubnetsOptions.Limit)) - } - if listSubnetsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSubnetsOptions.ResourceGroupID)) - } - if listSubnetsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listSubnetsOptions.ZoneName)) - } - if listSubnetsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listSubnetsOptions.VPCID)) - } - if listSubnetsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listSubnetsOptions.VPCCRN)) - } - if listSubnetsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listSubnetsOptions.VPCName)) - } - if listSubnetsOptions.RoutingTableID != nil { - builder.AddQuery("routing_table.id", fmt.Sprint(*listSubnetsOptions.RoutingTableID)) - } - if listSubnetsOptions.RoutingTableName != nil { - builder.AddQuery("routing_table.name", fmt.Sprint(*listSubnetsOptions.RoutingTableName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnetCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ReplaceSubnetNetworkACL : Replace the network ACL for a subnet -// This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. -func (vpc *VpcV1) ReplaceSubnetNetworkACL(replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.ReplaceSubnetNetworkACLWithContext(context.Background(), replaceSubnetNetworkACLOptions) -} - -// ReplaceSubnetNetworkACLWithContext is an alternate form of the ReplaceSubnetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) ReplaceSubnetNetworkACLWithContext(ctx context.Context, replaceSubnetNetworkACLOptions *ReplaceSubnetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(replaceSubnetNetworkACLOptions, "replaceSubnetNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *replaceSubnetNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/network_acl`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range replaceSubnetNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceSubnetNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(replaceSubnetNetworkACLOptions.NetworkACLIdentity) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ReplaceSubnetRoutingTable : Replace the routing table for a subnet -// This request replaces the existing routing table for a subnet with the routing table specified in the request body. -// -// For this request to succeed, the routing table `route_direct_link_ingress`, -// `route_internet_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. -func (vpc *VpcV1) ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - return vpc.ReplaceSubnetRoutingTableWithContext(context.Background(), replaceSubnetRoutingTableOptions) -} - -// ReplaceSubnetRoutingTableWithContext is an alternate form of the ReplaceSubnetRoutingTable method which supports a Context parameter -func (vpc *VpcV1) ReplaceSubnetRoutingTableWithContext(ctx context.Context, replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceSubnetRoutingTableOptions, "replaceSubnetRoutingTableOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(replaceSubnetRoutingTableOptions, "replaceSubnetRoutingTableOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *replaceSubnetRoutingTableOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/routing_table`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range replaceSubnetRoutingTableOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceSubnetRoutingTable") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(replaceSubnetRoutingTableOptions.RoutingTableIdentity) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoutingTable) - if err != nil { - return - } - response.Result = result - } - - return -} - -// SetSubnetPublicGateway : Attach a public gateway to a subnet -// This request attaches the public gateway, specified in the request body, to the subnet specified by the subnet -// identifier in the URL. The public gateway must have the same VPC and zone as the subnet. -func (vpc *VpcV1) SetSubnetPublicGateway(setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.SetSubnetPublicGatewayWithContext(context.Background(), setSubnetPublicGatewayOptions) -} - -// SetSubnetPublicGatewayWithContext is an alternate form of the SetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) SetSubnetPublicGatewayWithContext(ctx context.Context, setSubnetPublicGatewayOptions *SetSubnetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(setSubnetPublicGatewayOptions, "setSubnetPublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *setSubnetPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range setSubnetPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "SetSubnetPublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(setSubnetPublicGatewayOptions.PublicGatewayIdentity) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UnsetSubnetPublicGateway : Detach a public gateway from a subnet -// This request detaches the public gateway from the subnet specified by the subnet identifier in the URL. -func (vpc *VpcV1) UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.UnsetSubnetPublicGatewayWithContext(context.Background(), unsetSubnetPublicGatewayOptions) -} - -// UnsetSubnetPublicGatewayWithContext is an alternate form of the UnsetSubnetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) UnsetSubnetPublicGatewayWithContext(ctx context.Context, unsetSubnetPublicGatewayOptions *UnsetSubnetPublicGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(unsetSubnetPublicGatewayOptions, "unsetSubnetPublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *unsetSubnetPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}/public_gateway`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range unsetSubnetPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UnsetSubnetPublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateSubnet : Update a subnet -// This request updates a subnet with the information in a provided subnet patch. The subnet patch object is structured -// in the same way as a retrieved subnet and contains only the information to be updated. -func (vpc *VpcV1) UpdateSubnet(updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - return vpc.UpdateSubnetWithContext(context.Background(), updateSubnetOptions) -} - -// UpdateSubnetWithContext is an alternate form of the UpdateSubnet method which supports a Context parameter -func (vpc *VpcV1) UpdateSubnetWithContext(ctx context.Context, updateSubnetOptions *UpdateSubnetOptions) (result *Subnet, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSubnetOptions, "updateSubnetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSubnetOptions, "updateSubnetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateSubnetOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSubnetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSubnet") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSubnetOptions.SubnetPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSubnet) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateSubnetReservedIP : Update a reserved IP -// This request updates a reserved IP with the information in a provided reserved IP patch. The reserved IP patch object -// is structured in the same way as a retrieved reserved IP and contains only the information to be updated. -// -// A provider-owned reserved IP is not allowed to be updated. -func (vpc *VpcV1) UpdateSubnetReservedIP(updateSubnetReservedIPOptions *UpdateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.UpdateSubnetReservedIPWithContext(context.Background(), updateSubnetReservedIPOptions) -} - -// UpdateSubnetReservedIPWithContext is an alternate form of the UpdateSubnetReservedIP method which supports a Context parameter -func (vpc *VpcV1) UpdateSubnetReservedIPWithContext(ctx context.Context, updateSubnetReservedIPOptions *UpdateSubnetReservedIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSubnetReservedIPOptions, "updateSubnetReservedIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSubnetReservedIPOptions, "updateSubnetReservedIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "subnet_id": *updateSubnetReservedIPOptions.SubnetID, - "id": *updateSubnetReservedIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/subnets/{subnet_id}/reserved_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSubnetReservedIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSubnetReservedIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSubnetReservedIPOptions.ReservedIPPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateImage : Create an image -// This request creates a new image from an image prototype object. The prototype object is structured in the same way -// as a retrieved image, and contains the information necessary to create the new image. If an image is being imported, -// a URL to the image file on object storage must be specified. If an image is being created from an existing volume, -// that volume must be specified. -func (vpc *VpcV1) CreateImage(createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.CreateImageWithContext(context.Background(), createImageOptions) -} - -// CreateImageWithContext is an alternate form of the CreateImage method which supports a Context parameter -func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions *CreateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createImageOptions, "createImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createImageOptions, "createImageOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createImageOptions.ImagePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateImageExportJob : Create an image export job -// This request creates and queues a new export job for the image specified in the URL using the image export job -// prototype object. The image must be owned by the account and be in the `available`, `deprecated`, `obsolete`, or -// `unusable` state. The prototype object is structured in the same way as a retrieved image export job, and contains -// the information necessary to create and queue the new image export job. -func (vpc *VpcV1) CreateImageExportJob(createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.CreateImageExportJobWithContext(context.Background(), createImageExportJobOptions) -} - -// CreateImageExportJobWithContext is an alternate form of the CreateImageExportJob method which supports a Context parameter -func (vpc *VpcV1) CreateImageExportJobWithContext(ctx context.Context, createImageExportJobOptions *CreateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createImageExportJobOptions, "createImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createImageExportJobOptions, "createImageExportJobOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "image_id": *createImageExportJobOptions.ImageID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createImageExportJobOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateImageExportJob") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createImageExportJobOptions.StorageBucket != nil { - body["storage_bucket"] = createImageExportJobOptions.StorageBucket - } - if createImageExportJobOptions.Format != nil { - body["format"] = createImageExportJobOptions.Format - } - if createImageExportJobOptions.Name != nil { - body["name"] = createImageExportJobOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteImage : Delete an image -// This request deletes an image. Any active image export jobs will be completed first. This operation cannot be -// reversed. A system-provided image is not allowed to be deleted. Additionally, an image cannot be deleted if it: -// - has a `status` of `deleting` -// - has a `status` of `pending` with a `status_reasons` code of `image_request_in_progress` -// - has `catalog_offering.managed` set to `true`. -func (vpc *VpcV1) DeleteImage(deleteImageOptions *DeleteImageOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteImageWithContext(context.Background(), deleteImageOptions) -} - -// DeleteImageWithContext is an alternate form of the DeleteImage method which supports a Context parameter -func (vpc *VpcV1) DeleteImageWithContext(ctx context.Context, deleteImageOptions *DeleteImageOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteImageOptions, "deleteImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteImageOptions, "deleteImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteImageExportJob : Delete an image export job -// This request deletes an image export job. This operation cannot be reversed. If the job has not completed, the job -// will be canceled, and the incomplete exported image object deleted. If the job has completed, the exported image -// object will not be deleted. -func (vpc *VpcV1) DeleteImageExportJob(deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteImageExportJobWithContext(context.Background(), deleteImageExportJobOptions) -} - -// DeleteImageExportJobWithContext is an alternate form of the DeleteImageExportJob method which supports a Context parameter -func (vpc *VpcV1) DeleteImageExportJobWithContext(ctx context.Context, deleteImageExportJobOptions *DeleteImageExportJobOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteImageExportJobOptions, "deleteImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteImageExportJobOptions, "deleteImageExportJobOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "image_id": *deleteImageExportJobOptions.ImageID, - "id": *deleteImageExportJobOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteImageExportJobOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteImageExportJob") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeprecateImage : Deprecate an image -// This request deprecates an image, resulting in its `status` becoming `deprecated` and -// `deprecation_at` being set to the current date and time. -// -// The image must: -// - have a `status` of `available` -// - have `catalog_offering.managed` set to `false` -// - not have `deprecation_at` set -// -// The image must not have `deprecation_at` set, must have `catalog_offering.managed` set to -// `false`, and must have a `status` of `available`. -// -// A system-provided image is not allowed to be deprecated. -func (vpc *VpcV1) DeprecateImage(deprecateImageOptions *DeprecateImageOptions) (response *core.DetailedResponse, err error) { - return vpc.DeprecateImageWithContext(context.Background(), deprecateImageOptions) -} - -// DeprecateImageWithContext is an alternate form of the DeprecateImage method which supports a Context parameter -func (vpc *VpcV1) DeprecateImageWithContext(ctx context.Context, deprecateImageOptions *DeprecateImageOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deprecateImageOptions, "deprecateImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deprecateImageOptions, "deprecateImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deprecateImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}/deprecate`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deprecateImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeprecateImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetImage : Retrieve an image -// This request retrieves a single image specified by the identifier in the URL. -func (vpc *VpcV1) GetImage(getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.GetImageWithContext(context.Background(), getImageOptions) -} - -// GetImageWithContext is an alternate form of the GetImage method which supports a Context parameter -func (vpc *VpcV1) GetImageWithContext(ctx context.Context, getImageOptions *GetImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getImageOptions, "getImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getImageOptions, "getImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetImageExportJob : Retrieve an image export job -// This request retrieves a single image export job specified by the identifier in the URL. -func (vpc *VpcV1) GetImageExportJob(getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.GetImageExportJobWithContext(context.Background(), getImageExportJobOptions) -} - -// GetImageExportJobWithContext is an alternate form of the GetImageExportJob method which supports a Context parameter -func (vpc *VpcV1) GetImageExportJobWithContext(ctx context.Context, getImageExportJobOptions *GetImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getImageExportJobOptions, "getImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getImageExportJobOptions, "getImageExportJobOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "image_id": *getImageExportJobOptions.ImageID, - "id": *getImageExportJobOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getImageExportJobOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetImageExportJob") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetOperatingSystem : Retrieve an operating system -// This request retrieves a single operating system specified by the name in the URL. -func (vpc *VpcV1) GetOperatingSystem(getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { - return vpc.GetOperatingSystemWithContext(context.Background(), getOperatingSystemOptions) -} - -// GetOperatingSystemWithContext is an alternate form of the GetOperatingSystem method which supports a Context parameter -func (vpc *VpcV1) GetOperatingSystemWithContext(ctx context.Context, getOperatingSystemOptions *GetOperatingSystemOptions) (result *OperatingSystem, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getOperatingSystemOptions, "getOperatingSystemOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getOperatingSystemOptions, "getOperatingSystemOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getOperatingSystemOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getOperatingSystemOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetOperatingSystem") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystem) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListImageExportJobs : List all image export jobs -// This request lists all export jobs for an image. Each job tracks the exporting of the image to another location, such -// as a bucket within cloud object storage. -// -// The jobs will be sorted by their `created_at` property values, with newest jobs first. Jobs with identical -// `created_at` property values will in turn be sorted by ascending -// `name` property values. -func (vpc *VpcV1) ListImageExportJobs(listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListImageExportJobsWithContext(context.Background(), listImageExportJobsOptions) -} - -// ListImageExportJobsWithContext is an alternate form of the ListImageExportJobs method which supports a Context parameter -func (vpc *VpcV1) ListImageExportJobsWithContext(ctx context.Context, listImageExportJobsOptions *ListImageExportJobsOptions) (result *ImageExportJobUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listImageExportJobsOptions, "listImageExportJobsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listImageExportJobsOptions, "listImageExportJobsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "image_id": *listImageExportJobsOptions.ImageID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listImageExportJobsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImageExportJobs") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listImageExportJobsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listImageExportJobsOptions.Name)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJobUnpaginatedCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListImages : List all images -// This request lists all images available in the region. An image provides source data for a volume. Images are either -// system-provided, or created from another source, such as importing from Cloud Object Storage. -func (vpc *VpcV1) ListImages(listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { - return vpc.ListImagesWithContext(context.Background(), listImagesOptions) -} - -// ListImagesWithContext is an alternate form of the ListImages method which supports a Context parameter -func (vpc *VpcV1) ListImagesWithContext(ctx context.Context, listImagesOptions *ListImagesOptions) (result *ImageCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listImagesOptions, "listImagesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listImagesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListImages") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listImagesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listImagesOptions.Start)) - } - if listImagesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listImagesOptions.Limit)) - } - if listImagesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listImagesOptions.ResourceGroupID)) - } - if listImagesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listImagesOptions.Name)) - } - if listImagesOptions.Status != nil { - builder.AddQuery("status", strings.Join(listImagesOptions.Status, ",")) - } - if listImagesOptions.Visibility != nil { - builder.AddQuery("visibility", fmt.Sprint(*listImagesOptions.Visibility)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListOperatingSystems : List all operating systems -// This request lists all operating systems in the region. -func (vpc *VpcV1) ListOperatingSystems(listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { - return vpc.ListOperatingSystemsWithContext(context.Background(), listOperatingSystemsOptions) -} - -// ListOperatingSystemsWithContext is an alternate form of the ListOperatingSystems method which supports a Context parameter -func (vpc *VpcV1) ListOperatingSystemsWithContext(ctx context.Context, listOperatingSystemsOptions *ListOperatingSystemsOptions) (result *OperatingSystemCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listOperatingSystemsOptions, "listOperatingSystemsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/operating_systems`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listOperatingSystemsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListOperatingSystems") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listOperatingSystemsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listOperatingSystemsOptions.Start)) - } - if listOperatingSystemsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listOperatingSystemsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOperatingSystemCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ObsoleteImage : Obsolete an image -// This request obsoletes an image, resulting in its `status` becoming `obsolete` and -// `obsolescence_at` being set to the current date and time. -// -// The image must: -// - have a `status` of `available` or `deprecated` -// - have `catalog_offering.managed` set to `false` -// - not have `deprecation_at` set in the future -// - not have `obsolescence_at` set -// -// A system-provided image is not allowed to be obsoleted. -func (vpc *VpcV1) ObsoleteImage(obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { - return vpc.ObsoleteImageWithContext(context.Background(), obsoleteImageOptions) -} - -// ObsoleteImageWithContext is an alternate form of the ObsoleteImage method which supports a Context parameter -func (vpc *VpcV1) ObsoleteImageWithContext(ctx context.Context, obsoleteImageOptions *ObsoleteImageOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(obsoleteImageOptions, "obsoleteImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(obsoleteImageOptions, "obsoleteImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *obsoleteImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}/obsolete`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range obsoleteImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ObsoleteImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateImage : Update an image -// This request updates an image with the information in a provided image patch. The image patch object is structured in -// the same way as a retrieved image and contains only the information to be updated. A system-provided image is not -// allowed to be updated. An image with a `status` of `deleting` cannot be updated. -func (vpc *VpcV1) UpdateImage(updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - return vpc.UpdateImageWithContext(context.Background(), updateImageOptions) -} - -// UpdateImageWithContext is an alternate form of the UpdateImage method which supports a Context parameter -func (vpc *VpcV1) UpdateImageWithContext(ctx context.Context, updateImageOptions *UpdateImageOptions) (result *Image, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateImageOptions, "updateImageOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateImageOptions, "updateImageOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateImageOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateImageOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImage") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateImageOptions.ImagePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImage) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateImageExportJob : Update an image export job -// This request updates an image export job with the information in a provided image export job patch. The image export -// job patch object is structured in the same way as a retrieved image export job and contains only the information to -// be updated. -func (vpc *VpcV1) UpdateImageExportJob(updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - return vpc.UpdateImageExportJobWithContext(context.Background(), updateImageExportJobOptions) -} - -// UpdateImageExportJobWithContext is an alternate form of the UpdateImageExportJob method which supports a Context parameter -func (vpc *VpcV1) UpdateImageExportJobWithContext(ctx context.Context, updateImageExportJobOptions *UpdateImageExportJobOptions) (result *ImageExportJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateImageExportJobOptions, "updateImageExportJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateImageExportJobOptions, "updateImageExportJobOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "image_id": *updateImageExportJobOptions.ImageID, - "id": *updateImageExportJobOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/images/{image_id}/export_jobs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateImageExportJobOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateImageExportJob") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateImageExportJobOptions.ImageExportJobPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalImageExportJob) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateKey : Create a key -// This request creates a new SSH key from an key prototype object. The prototype object is structured in the same way -// as a retrieved key, and contains the information necessary to create the new key. The public key value must be -// provided. -func (vpc *VpcV1) CreateKey(createKeyOptions *CreateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - return vpc.CreateKeyWithContext(context.Background(), createKeyOptions) -} - -// CreateKeyWithContext is an alternate form of the CreateKey method which supports a Context parameter -func (vpc *VpcV1) CreateKeyWithContext(ctx context.Context, createKeyOptions *CreateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createKeyOptions, "createKeyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createKeyOptions, "createKeyOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createKeyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateKey") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createKeyOptions.PublicKey != nil { - body["public_key"] = createKeyOptions.PublicKey - } - if createKeyOptions.Name != nil { - body["name"] = createKeyOptions.Name - } - if createKeyOptions.ResourceGroup != nil { - body["resource_group"] = createKeyOptions.ResourceGroup - } - if createKeyOptions.Type != nil { - body["type"] = createKeyOptions.Type - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKey) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteKey : Delete a key -// This request deletes a key. This operation cannot be reversed. -func (vpc *VpcV1) DeleteKey(deleteKeyOptions *DeleteKeyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteKeyWithContext(context.Background(), deleteKeyOptions) -} - -// DeleteKeyWithContext is an alternate form of the DeleteKey method which supports a Context parameter -func (vpc *VpcV1) DeleteKeyWithContext(ctx context.Context, deleteKeyOptions *DeleteKeyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteKeyOptions, "deleteKeyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteKeyOptions, "deleteKeyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteKeyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteKeyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteKey") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetKey : Retrieve a key -// This request retrieves a single key specified by the identifier in the URL. -func (vpc *VpcV1) GetKey(getKeyOptions *GetKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - return vpc.GetKeyWithContext(context.Background(), getKeyOptions) -} - -// GetKeyWithContext is an alternate form of the GetKey method which supports a Context parameter -func (vpc *VpcV1) GetKeyWithContext(ctx context.Context, getKeyOptions *GetKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getKeyOptions, "getKeyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getKeyOptions, "getKeyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getKeyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getKeyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetKey") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKey) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListKeys : List all keys -// This request lists all keys in the region. A key contains a public SSH key which may be installed on instances when -// they are created. Private keys are not stored. -func (vpc *VpcV1) ListKeys(listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { - return vpc.ListKeysWithContext(context.Background(), listKeysOptions) -} - -// ListKeysWithContext is an alternate form of the ListKeys method which supports a Context parameter -func (vpc *VpcV1) ListKeysWithContext(ctx context.Context, listKeysOptions *ListKeysOptions) (result *KeyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listKeysOptions, "listKeysOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listKeysOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListKeys") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listKeysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listKeysOptions.Start)) - } - if listKeysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listKeysOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKeyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateKey : Update a key -// This request updates a key's name. -func (vpc *VpcV1) UpdateKey(updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - return vpc.UpdateKeyWithContext(context.Background(), updateKeyOptions) -} - -// UpdateKeyWithContext is an alternate form of the UpdateKey method which supports a Context parameter -func (vpc *VpcV1) UpdateKeyWithContext(ctx context.Context, updateKeyOptions *UpdateKeyOptions) (result *Key, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateKeyOptions, "updateKeyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateKeyOptions, "updateKeyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateKeyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/keys/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateKeyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateKey") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateKeyOptions.KeyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalKey) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddInstanceNetworkInterfaceFloatingIP : Associate a floating IP with an instance network interface -// This request associates the specified floating IP with the specified instance network interface, replacing any -// existing association. -// -// The existing floating IP must: -// - not be required by another resource, such as a public gateway -// - be in the same `zone` as the instance -// -// A request body is not required, and if provided, is ignored. -func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIP(addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.AddInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), addInstanceNetworkInterfaceFloatingIPOptions) -} - -// AddInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the AddInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) AddInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, addInstanceNetworkInterfaceFloatingIPOptions *AddInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addInstanceNetworkInterfaceFloatingIPOptions, "addInstanceNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *addInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *addInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *addInstanceNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addInstanceNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddInstanceNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstance : Create an instance -// This request provisions a new instance from an instance prototype object. The prototype object is structured in the -// same way as a retrieved instance, and contains the information necessary to provision the new instance. The instance -// is automatically started. -func (vpc *VpcV1) CreateInstance(createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceWithContext(context.Background(), createInstanceOptions) -} - -// CreateInstanceWithContext is an alternate form of the CreateInstance method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceWithContext(ctx context.Context, createInstanceOptions *CreateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceOptions, "createInstanceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceOptions, "createInstanceOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstance") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createInstanceOptions.InstancePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceAction : Create an instance action -// This request creates a new action which will be queued up to run as soon as any pending or running actions have -// completed. -func (vpc *VpcV1) CreateInstanceAction(createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceActionWithContext(context.Background(), createInstanceActionOptions) -} - -// CreateInstanceActionWithContext is an alternate form of the CreateInstanceAction method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceActionWithContext(ctx context.Context, createInstanceActionOptions *CreateInstanceActionOptions) (result *InstanceAction, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceActionOptions, "createInstanceActionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceActionOptions, "createInstanceActionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *createInstanceActionOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/actions`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceActionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceAction") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceActionOptions.Type != nil { - body["type"] = createInstanceActionOptions.Type - } - if createInstanceActionOptions.Force != nil { - body["force"] = createInstanceActionOptions.Force - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceAction) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceConsoleAccessToken : Create a console access token for an instance -// This request creates a new single-use console access token for an instance. All console configuration is provided at -// token create time, and the token is subsequently used in the `access_token` query parameter for the WebSocket -// request. The access token is only valid for a short period of time, and a maximum of one token is valid for a given -// instance at a time. -func (vpc *VpcV1) CreateInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceConsoleAccessTokenWithContext(context.Background(), createInstanceConsoleAccessTokenOptions) -} - -// CreateInstanceConsoleAccessTokenWithContext is an alternate form of the CreateInstanceConsoleAccessToken method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceConsoleAccessTokenWithContext(ctx context.Context, createInstanceConsoleAccessTokenOptions *CreateInstanceConsoleAccessTokenOptions) (result *InstanceConsoleAccessToken, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceConsoleAccessTokenOptions, "createInstanceConsoleAccessTokenOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *createInstanceConsoleAccessTokenOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/console_access_token`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceConsoleAccessTokenOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceConsoleAccessToken") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceConsoleAccessTokenOptions.ConsoleType != nil { - body["console_type"] = createInstanceConsoleAccessTokenOptions.ConsoleType - } - if createInstanceConsoleAccessTokenOptions.Force != nil { - body["force"] = createInstanceConsoleAccessTokenOptions.Force - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceConsoleAccessToken) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceNetworkAttachment : Create a network attachment on an instance -// This request creates a new instance network attachment from an instance network attachment prototype object. The -// prototype object is structured in the same way as a retrieved instance network attachment, and contains the -// information necessary to create the new instance network attachment. -func (vpc *VpcV1) CreateInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceNetworkAttachmentWithContext(context.Background(), createInstanceNetworkAttachmentOptions) -} - -// CreateInstanceNetworkAttachmentWithContext is an alternate form of the CreateInstanceNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceNetworkAttachmentWithContext(ctx context.Context, createInstanceNetworkAttachmentOptions *CreateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceNetworkAttachmentOptions, "createInstanceNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceNetworkAttachmentOptions, "createInstanceNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *createInstanceNetworkAttachmentOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceNetworkAttachmentOptions.VirtualNetworkInterface != nil { - body["virtual_network_interface"] = createInstanceNetworkAttachmentOptions.VirtualNetworkInterface - } - if createInstanceNetworkAttachmentOptions.Name != nil { - body["name"] = createInstanceNetworkAttachmentOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceNetworkInterface : Create a network interface on an instance -// This request creates a new instance network interface from an instance network interface prototype object. The -// prototype object is structured in the same way as a retrieved instance network interface, and contains the -// information necessary to create the new instance network interface. Any subnet in the instance's VPC may be -// specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. -// -// If this instance has network attachments, each network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. -func (vpc *VpcV1) CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceNetworkInterfaceWithContext(context.Background(), createInstanceNetworkInterfaceOptions) -} - -// CreateInstanceNetworkInterfaceWithContext is an alternate form of the CreateInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceNetworkInterfaceOptions, "createInstanceNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *createInstanceNetworkInterfaceOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceNetworkInterfaceOptions.Subnet != nil { - body["subnet"] = createInstanceNetworkInterfaceOptions.Subnet - } - if createInstanceNetworkInterfaceOptions.AllowIPSpoofing != nil { - body["allow_ip_spoofing"] = createInstanceNetworkInterfaceOptions.AllowIPSpoofing - } - if createInstanceNetworkInterfaceOptions.Name != nil { - body["name"] = createInstanceNetworkInterfaceOptions.Name - } - if createInstanceNetworkInterfaceOptions.PrimaryIP != nil { - body["primary_ip"] = createInstanceNetworkInterfaceOptions.PrimaryIP - } - if createInstanceNetworkInterfaceOptions.SecurityGroups != nil { - body["security_groups"] = createInstanceNetworkInterfaceOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceTemplate : Create an instance template -// This request creates a new instance template. The prototype object is structured in the same way as a retrieved -// instance template, and contains the information necessary to provision a new instance from the template. -// -// If a `source_template` is specified in the prototype object, its contents are copied into the new template prior to -// copying any other properties provided in the prototype object. -func (vpc *VpcV1) CreateInstanceTemplate(createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceTemplateWithContext(context.Background(), createInstanceTemplateOptions) -} - -// CreateInstanceTemplateWithContext is an alternate form of the CreateInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceTemplateWithContext(ctx context.Context, createInstanceTemplateOptions *CreateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceTemplateOptions, "createInstanceTemplateOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceTemplateOptions, "createInstanceTemplateOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceTemplateOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceTemplate") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createInstanceTemplateOptions.InstanceTemplatePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceVolumeAttachment : Create a volume attachment on an instance -// This request creates a new volume attachment from a volume attachment prototype object, connecting a volume to an -// instance. For this request to succeed, the specified volume must not be busy. The prototype object is structured in -// the same way as a retrieved volume attachment, and contains the information necessary to create the new volume -// attachment. -func (vpc *VpcV1) CreateInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceVolumeAttachmentWithContext(context.Background(), createInstanceVolumeAttachmentOptions) -} - -// CreateInstanceVolumeAttachmentWithContext is an alternate form of the CreateInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceVolumeAttachmentWithContext(ctx context.Context, createInstanceVolumeAttachmentOptions *CreateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceVolumeAttachmentOptions, "createInstanceVolumeAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *createInstanceVolumeAttachmentOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceVolumeAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceVolumeAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceVolumeAttachmentOptions.Volume != nil { - body["volume"] = createInstanceVolumeAttachmentOptions.Volume - } - if createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete != nil { - body["delete_volume_on_instance_delete"] = createInstanceVolumeAttachmentOptions.DeleteVolumeOnInstanceDelete - } - if createInstanceVolumeAttachmentOptions.Name != nil { - body["name"] = createInstanceVolumeAttachmentOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteInstance : Delete an instance -// This request deletes an instance. This operation cannot be reversed. Any floating IPs associated with instance -// network interfaces are implicitly disassociated. All virtual network interfaces with `auto_delete` set to `true` -// targeting instance network attachments on the instance are automatically deleted. All flow log collectors with -// `auto_delete` set to `true` targeting the instance, the instance network attachments, the instance network -// interfaces, or the automatically deleted virtual network interfaces are automatically deleted. -func (vpc *VpcV1) DeleteInstance(deleteInstanceOptions *DeleteInstanceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceWithContext(context.Background(), deleteInstanceOptions) -} - -// DeleteInstanceWithContext is an alternate form of the DeleteInstance method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceWithContext(ctx context.Context, deleteInstanceOptions *DeleteInstanceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceOptions, "deleteInstanceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceOptions, "deleteInstanceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteInstanceOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstance") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteInstanceOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteInstanceOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceNetworkAttachment : Delete an instance network attachment -// This request deletes an instance network attachment. This operation cannot be reversed. Any floating IPs associated -// with the instance network attachment are implicitly disassociated. All flow log collectors with `auto_delete` set to -// `true` targeting the instance network attachment are automatically deleted. The primary instance network attachment -// is not allowed to be deleted. -func (vpc *VpcV1) DeleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptions *DeleteInstanceNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceNetworkAttachmentWithContext(context.Background(), deleteInstanceNetworkAttachmentOptions) -} - -// DeleteInstanceNetworkAttachmentWithContext is an alternate form of the DeleteInstanceNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceNetworkAttachmentWithContext(ctx context.Context, deleteInstanceNetworkAttachmentOptions *DeleteInstanceNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceNetworkAttachmentOptions, "deleteInstanceNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceNetworkAttachmentOptions, "deleteInstanceNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *deleteInstanceNetworkAttachmentOptions.InstanceID, - "id": *deleteInstanceNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceNetworkInterface : Delete an instance network interface -// This request deletes an instance network interface. This operation cannot be reversed. Any floating IPs associated -// with the instance network interface are implicitly disassociated. All flow log collectors with `auto_delete` set to -// `true` targeting the instance network interface are automatically deleted. The primary instance network interface is -// not allowed to be deleted. -// -// If this instance has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and is not allowed to be deleted. -func (vpc *VpcV1) DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceNetworkInterfaceWithContext(context.Background(), deleteInstanceNetworkInterfaceOptions) -} - -// DeleteInstanceNetworkInterfaceWithContext is an alternate form of the DeleteInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceNetworkInterfaceWithContext(ctx context.Context, deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceNetworkInterfaceOptions, "deleteInstanceNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *deleteInstanceNetworkInterfaceOptions.InstanceID, - "id": *deleteInstanceNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceTemplate : Delete an instance template -// This request deletes the instance template. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceTemplate(deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceTemplateWithContext(context.Background(), deleteInstanceTemplateOptions) -} - -// DeleteInstanceTemplateWithContext is an alternate form of the DeleteInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceTemplateWithContext(ctx context.Context, deleteInstanceTemplateOptions *DeleteInstanceTemplateOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceTemplateOptions, "deleteInstanceTemplateOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteInstanceTemplateOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceTemplateOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceTemplate") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceVolumeAttachment : Delete a volume attachment -// This request deletes a volume attachment. This operation cannot be reversed, but a new volume attachment may -// subsequently be created for the volume. For this request to succeed, the volume must not be busy. -func (vpc *VpcV1) DeleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceVolumeAttachmentWithContext(context.Background(), deleteInstanceVolumeAttachmentOptions) -} - -// DeleteInstanceVolumeAttachmentWithContext is an alternate form of the DeleteInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceVolumeAttachmentWithContext(ctx context.Context, deleteInstanceVolumeAttachmentOptions *DeleteInstanceVolumeAttachmentOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceVolumeAttachmentOptions, "deleteInstanceVolumeAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *deleteInstanceVolumeAttachmentOptions.InstanceID, - "id": *deleteInstanceVolumeAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceVolumeAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceVolumeAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetInstance : Retrieve an instance -// This request retrieves a single instance specified by the identifier in the URL. -func (vpc *VpcV1) GetInstance(getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.GetInstanceWithContext(context.Background(), getInstanceOptions) -} - -// GetInstanceWithContext is an alternate form of the GetInstance method which supports a Context parameter -func (vpc *VpcV1) GetInstanceWithContext(ctx context.Context, getInstanceOptions *GetInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceOptions, "getInstanceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceOptions, "getInstanceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getInstanceOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstance") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceDisk : Retrieve an instance disk -// This request retrieves a single instance disk specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceDisk(getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - return vpc.GetInstanceDiskWithContext(context.Background(), getInstanceDiskOptions) -} - -// GetInstanceDiskWithContext is an alternate form of the GetInstanceDisk method which supports a Context parameter -func (vpc *VpcV1) GetInstanceDiskWithContext(ctx context.Context, getInstanceDiskOptions *GetInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceDiskOptions, "getInstanceDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceDiskOptions, "getInstanceDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceDiskOptions.InstanceID, - "id": *getInstanceDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceInitialization : Retrieve initialization configuration for an instance -// This request retrieves configuration used to initialize the instance, such as SSH keys and the Windows administrator -// password. These can subsequently be changed on the instance and therefore may not be current. -func (vpc *VpcV1) GetInstanceInitialization(getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { - return vpc.GetInstanceInitializationWithContext(context.Background(), getInstanceInitializationOptions) -} - -// GetInstanceInitializationWithContext is an alternate form of the GetInstanceInitialization method which supports a Context parameter -func (vpc *VpcV1) GetInstanceInitializationWithContext(ctx context.Context, getInstanceInitializationOptions *GetInstanceInitializationOptions) (result *InstanceInitialization, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceInitializationOptions, "getInstanceInitializationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceInitializationOptions, "getInstanceInitializationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getInstanceInitializationOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}/initialization`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceInitializationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceInitialization") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceInitialization) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceNetworkAttachment : Retrieve an instance network attachment -// This request retrieves a single instance network attachment specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkAttachmentWithContext(context.Background(), getInstanceNetworkAttachmentOptions) -} - -// GetInstanceNetworkAttachmentWithContext is an alternate form of the GetInstanceNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkAttachmentWithContext(ctx context.Context, getInstanceNetworkAttachmentOptions *GetInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkAttachmentOptions, "getInstanceNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceNetworkAttachmentOptions, "getInstanceNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkAttachmentOptions.InstanceID, - "id": *getInstanceNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceNetworkInterface : Retrieve an instance network interface -// This request retrieves a single instance network interface specified by the identifier in the URL. -// -// If this instance has network attachments, the retrieved network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface. -func (vpc *VpcV1) GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceWithContext(context.Background(), getInstanceNetworkInterfaceOptions) -} - -// GetInstanceNetworkInterfaceWithContext is an alternate form of the GetInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceNetworkInterfaceOptions, "getInstanceNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceOptions.InstanceID, - "id": *getInstanceNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceNetworkInterfaceFloatingIP : Retrieve associated floating IP -// This request retrieves a specified floating IP address if it is associated with the instance network interface and -// instance specified in the URL. -func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIP(getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), getInstanceNetworkInterfaceFloatingIPOptions) -} - -// GetInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the GetInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, getInstanceNetworkInterfaceFloatingIPOptions *GetInstanceNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceNetworkInterfaceFloatingIPOptions, "getInstanceNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *getInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *getInstanceNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceNetworkInterfaceIP : Retrieve the primary reserved IP -// This request retrieves the primary reserved IP for an instance network interface. -func (vpc *VpcV1) GetInstanceNetworkInterfaceIP(getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetInstanceNetworkInterfaceIPWithContext(context.Background(), getInstanceNetworkInterfaceIPOptions) -} - -// GetInstanceNetworkInterfaceIPWithContext is an alternate form of the GetInstanceNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) GetInstanceNetworkInterfaceIPWithContext(ctx context.Context, getInstanceNetworkInterfaceIPOptions *GetInstanceNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceNetworkInterfaceIPOptions, "getInstanceNetworkInterfaceIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceNetworkInterfaceIPOptions.InstanceID, - "network_interface_id": *getInstanceNetworkInterfaceIPOptions.NetworkInterfaceID, - "id": *getInstanceNetworkInterfaceIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceNetworkInterfaceIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceNetworkInterfaceIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceProfile : Retrieve an instance profile -// This request retrieves a single instance profile specified by the name in the URL. -func (vpc *VpcV1) GetInstanceProfile(getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { - return vpc.GetInstanceProfileWithContext(context.Background(), getInstanceProfileOptions) -} - -// GetInstanceProfileWithContext is an alternate form of the GetInstanceProfile method which supports a Context parameter -func (vpc *VpcV1) GetInstanceProfileWithContext(ctx context.Context, getInstanceProfileOptions *GetInstanceProfileOptions) (result *InstanceProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceProfileOptions, "getInstanceProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceProfileOptions, "getInstanceProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getInstanceProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceTemplate : Retrieve an instance template -// This request retrieves a single instance template specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceTemplate(getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceTemplateWithContext(context.Background(), getInstanceTemplateOptions) -} - -// GetInstanceTemplateWithContext is an alternate form of the GetInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) GetInstanceTemplateWithContext(ctx context.Context, getInstanceTemplateOptions *GetInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceTemplateOptions, "getInstanceTemplateOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceTemplateOptions, "getInstanceTemplateOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getInstanceTemplateOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceTemplateOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceTemplate") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceVolumeAttachment : Retrieve a volume attachment -// This request retrieves a single volume attachment specified by the identifier in the URL. -func (vpc *VpcV1) GetInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.GetInstanceVolumeAttachmentWithContext(context.Background(), getInstanceVolumeAttachmentOptions) -} - -// GetInstanceVolumeAttachmentWithContext is an alternate form of the GetInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) GetInstanceVolumeAttachmentWithContext(ctx context.Context, getInstanceVolumeAttachmentOptions *GetInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceVolumeAttachmentOptions, "getInstanceVolumeAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *getInstanceVolumeAttachmentOptions.InstanceID, - "id": *getInstanceVolumeAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceVolumeAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceVolumeAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceDisks : List all disks on an instance -// This request lists all disks on an instance. A disk is a block device that is locally attached to the instance's -// physical host and is also referred to as instance storage. By default, the listed disks are sorted by their -// `created_at` property values, with the newest disk first. -func (vpc *VpcV1) ListInstanceDisks(listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceDisksWithContext(context.Background(), listInstanceDisksOptions) -} - -// ListInstanceDisksWithContext is an alternate form of the ListInstanceDisks method which supports a Context parameter -func (vpc *VpcV1) ListInstanceDisksWithContext(ctx context.Context, listInstanceDisksOptions *ListInstanceDisksOptions) (result *InstanceDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceDisksOptions, "listInstanceDisksOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceDisksOptions, "listInstanceDisksOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceDisksOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceDisksOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceDisks") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDiskCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceNetworkAttachments : List all network attachments on an instance -// This request lists all network attachments on an instance. A network attachment represents a device on the instance -// to which a virtual network interface is attached. -// -// The network attachments will be sorted by their `created_at` property values, with newest network attachments first. -// Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` property -// values. -func (vpc *VpcV1) ListInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions) (result *InstanceNetworkAttachmentCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkAttachmentsWithContext(context.Background(), listInstanceNetworkAttachmentsOptions) -} - -// ListInstanceNetworkAttachmentsWithContext is an alternate form of the ListInstanceNetworkAttachments method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkAttachmentsWithContext(ctx context.Context, listInstanceNetworkAttachmentsOptions *ListInstanceNetworkAttachmentsOptions) (result *InstanceNetworkAttachmentCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkAttachmentsOptions, "listInstanceNetworkAttachmentsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceNetworkAttachmentsOptions, "listInstanceNetworkAttachmentsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkAttachmentsOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceNetworkAttachmentsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkAttachments") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachmentCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceNetworkInterfaceFloatingIps : List all floating IPs associated with an instance network interface -// This request lists all floating IPs associated with an instance network interface. -func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkInterfaceFloatingIpsWithContext(context.Background(), listInstanceNetworkInterfaceFloatingIpsOptions) -} - -// ListInstanceNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListInstanceNetworkInterfaceFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listInstanceNetworkInterfaceFloatingIpsOptions *ListInstanceNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceNetworkInterfaceFloatingIpsOptions, "listInstanceNetworkInterfaceFloatingIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkInterfaceFloatingIpsOptions.InstanceID, - "network_interface_id": *listInstanceNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceNetworkInterfaceFloatingIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaceFloatingIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceNetworkInterfaceIps : List the primary reserved IP for an instance network interface -// This request lists the primary reserved IP for an instance network interface. -func (vpc *VpcV1) ListInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions *ListInstanceNetworkInterfaceIpsOptions) (result *ReservedIPCollectionInstanceNetworkInterfaceContext, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkInterfaceIpsWithContext(context.Background(), listInstanceNetworkInterfaceIpsOptions) -} - -// ListInstanceNetworkInterfaceIpsWithContext is an alternate form of the ListInstanceNetworkInterfaceIps method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkInterfaceIpsWithContext(ctx context.Context, listInstanceNetworkInterfaceIpsOptions *ListInstanceNetworkInterfaceIpsOptions) (result *ReservedIPCollectionInstanceNetworkInterfaceContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkInterfaceIpsOptions, "listInstanceNetworkInterfaceIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceNetworkInterfaceIpsOptions, "listInstanceNetworkInterfaceIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkInterfaceIpsOptions.InstanceID, - "network_interface_id": *listInstanceNetworkInterfaceIpsOptions.NetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceNetworkInterfaceIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaceIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceNetworkInterfaceIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceNetworkInterfaceIpsOptions.Start)) - } - if listInstanceNetworkInterfaceIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceNetworkInterfaceIpsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceNetworkInterfaces : List all network interfaces on an instance -// This request lists all network interfaces on an instance. An instance network interface is an abstract representation -// of a network device and attaches an instance to a single subnet. Each network interface on an instance can attach to -// any subnet in the zone, including subnets that are already attached to the instance. Multiple network interfaces on -// the instance may also attach to the same subnet. -// -// If this instance has network attachments, each returned network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface. -func (vpc *VpcV1) ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceNetworkInterfacesWithContext(context.Background(), listInstanceNetworkInterfacesOptions) -} - -// ListInstanceNetworkInterfacesWithContext is an alternate form of the ListInstanceNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceNetworkInterfacesOptions, "listInstanceNetworkInterfacesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceNetworkInterfacesOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceNetworkInterfacesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceNetworkInterfaces") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterfaceUnpaginatedCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceProfiles : List all instance profiles -// This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the -// region. An instance profile specifies the performance characteristics and pricing model for an instance. -func (vpc *VpcV1) ListInstanceProfiles(listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceProfilesWithContext(context.Background(), listInstanceProfilesOptions) -} - -// ListInstanceProfilesWithContext is an alternate form of the ListInstanceProfiles method which supports a Context parameter -func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInstanceProfilesOptions *ListInstanceProfilesOptions) (result *InstanceProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceProfilesOptions, "listInstanceProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceTemplates : List all instance templates -// This request lists all instance templates in the region. -func (vpc *VpcV1) ListInstanceTemplates(listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceTemplatesWithContext(context.Background(), listInstanceTemplatesOptions) -} - -// ListInstanceTemplatesWithContext is an alternate form of the ListInstanceTemplates method which supports a Context parameter -func (vpc *VpcV1) ListInstanceTemplatesWithContext(ctx context.Context, listInstanceTemplatesOptions *ListInstanceTemplatesOptions) (result *InstanceTemplateCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceTemplatesOptions, "listInstanceTemplatesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceTemplatesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceTemplates") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplateCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceVolumeAttachments : List all volumes attachments on an instance -// This request lists all volume attachments on an instance. A volume attachment connects a volume to an instance. Each -// instance may have many volume attachments but each volume attachment connects exactly one instance to exactly one -// volume. -func (vpc *VpcV1) ListInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions *ListInstanceVolumeAttachmentsOptions) (result *VolumeAttachmentCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceVolumeAttachmentsWithContext(context.Background(), listInstanceVolumeAttachmentsOptions) -} - -// ListInstanceVolumeAttachmentsWithContext is an alternate form of the ListInstanceVolumeAttachments method which supports a Context parameter -func (vpc *VpcV1) ListInstanceVolumeAttachmentsWithContext(ctx context.Context, listInstanceVolumeAttachmentsOptions *ListInstanceVolumeAttachmentsOptions) (result *VolumeAttachmentCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceVolumeAttachmentsOptions, "listInstanceVolumeAttachmentsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceVolumeAttachmentsOptions, "listInstanceVolumeAttachmentsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *listInstanceVolumeAttachmentsOptions.InstanceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceVolumeAttachmentsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceVolumeAttachments") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachmentCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstances : List all instances -// This request lists all instances in the region. -func (vpc *VpcV1) ListInstances(listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstancesWithContext(context.Background(), listInstancesOptions) -} - -// ListInstancesWithContext is an alternate form of the ListInstances method which supports a Context parameter -func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOptions *ListInstancesOptions) (result *InstanceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstancesOptions, "listInstancesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listInstancesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstances") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstancesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstancesOptions.Start)) - } - if listInstancesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstancesOptions.Limit)) - } - if listInstancesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listInstancesOptions.ResourceGroupID)) - } - if listInstancesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listInstancesOptions.Name)) - } - if listInstancesOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listInstancesOptions.VPCID)) - } - if listInstancesOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listInstancesOptions.VPCCRN)) - } - if listInstancesOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listInstancesOptions.VPCName)) - } - if listInstancesOptions.DedicatedHostID != nil { - builder.AddQuery("dedicated_host.id", fmt.Sprint(*listInstancesOptions.DedicatedHostID)) - } - if listInstancesOptions.DedicatedHostCRN != nil { - builder.AddQuery("dedicated_host.crn", fmt.Sprint(*listInstancesOptions.DedicatedHostCRN)) - } - if listInstancesOptions.DedicatedHostName != nil { - builder.AddQuery("dedicated_host.name", fmt.Sprint(*listInstancesOptions.DedicatedHostName)) - } - if listInstancesOptions.PlacementGroupID != nil { - builder.AddQuery("placement_group.id", fmt.Sprint(*listInstancesOptions.PlacementGroupID)) - } - if listInstancesOptions.PlacementGroupCRN != nil { - builder.AddQuery("placement_group.crn", fmt.Sprint(*listInstancesOptions.PlacementGroupCRN)) - } - if listInstancesOptions.PlacementGroupName != nil { - builder.AddQuery("placement_group.name", fmt.Sprint(*listInstancesOptions.PlacementGroupName)) - } - if listInstancesOptions.ReservationID != nil { - builder.AddQuery("reservation.id", fmt.Sprint(*listInstancesOptions.ReservationID)) - } - if listInstancesOptions.ReservationCRN != nil { - builder.AddQuery("reservation.crn", fmt.Sprint(*listInstancesOptions.ReservationCRN)) - } - if listInstancesOptions.ReservationName != nil { - builder.AddQuery("reservation.name", fmt.Sprint(*listInstancesOptions.ReservationName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// RemoveInstanceNetworkInterfaceFloatingIP : Disassociate a floating IP from an instance network interface -// This request disassociates the specified floating IP from the specified instance network interface. -func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIP(removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveInstanceNetworkInterfaceFloatingIPWithContext(context.Background(), removeInstanceNetworkInterfaceFloatingIPOptions) -} - -// RemoveInstanceNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveInstanceNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) RemoveInstanceNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeInstanceNetworkInterfaceFloatingIPOptions *RemoveInstanceNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeInstanceNetworkInterfaceFloatingIPOptions, "removeInstanceNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *removeInstanceNetworkInterfaceFloatingIPOptions.InstanceID, - "network_interface_id": *removeInstanceNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *removeInstanceNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeInstanceNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveInstanceNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateInstance : Update an instance -// This request updates an instance with the information in a provided instance patch. The instance patch object is -// structured in the same way as a retrieved instance and contains only the information to be updated. -func (vpc *VpcV1) UpdateInstance(updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceWithContext(context.Background(), updateInstanceOptions) -} - -// UpdateInstanceWithContext is an alternate form of the UpdateInstance method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceOptions *UpdateInstanceOptions) (result *Instance, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceOptions, "updateInstanceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceOptions, "updateInstanceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateInstanceOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstance") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateInstanceOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceOptions.InstancePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstance) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceDisk : Update an instance disk -// This request updates the instance disk with the information in a provided patch. -func (vpc *VpcV1) UpdateInstanceDisk(updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceDiskWithContext(context.Background(), updateInstanceDiskOptions) -} - -// UpdateInstanceDiskWithContext is an alternate form of the UpdateInstanceDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceDiskWithContext(ctx context.Context, updateInstanceDiskOptions *UpdateInstanceDiskOptions) (result *InstanceDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceDiskOptions, "updateInstanceDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceDiskOptions, "updateInstanceDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *updateInstanceDiskOptions.InstanceID, - "id": *updateInstanceDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceDiskOptions.InstanceDiskPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceNetworkAttachment : Update an instance network attachment -// This request updates an instance network attachment with the information provided in an instance network interface -// patch object. The instance network attachment patch object is structured in the same way as a retrieved instance -// network attachment and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceNetworkAttachmentWithContext(context.Background(), updateInstanceNetworkAttachmentOptions) -} - -// UpdateInstanceNetworkAttachmentWithContext is an alternate form of the UpdateInstanceNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceNetworkAttachmentWithContext(ctx context.Context, updateInstanceNetworkAttachmentOptions *UpdateInstanceNetworkAttachmentOptions) (result *InstanceNetworkAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceNetworkAttachmentOptions, "updateInstanceNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceNetworkAttachmentOptions, "updateInstanceNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *updateInstanceNetworkAttachmentOptions.InstanceID, - "id": *updateInstanceNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceNetworkAttachmentOptions.InstanceNetworkAttachmentPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceNetworkInterface : Update an instance network interface -// This request updates an instance network interface with the information provided in an instance network interface -// patch object. The instance network interface patch object is structured in the same way as a retrieved instance -// network interface and needs to contain only the information to be updated. -// -// If this instance has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and is not allowed to be updated. -func (vpc *VpcV1) UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceNetworkInterfaceWithContext(context.Background(), updateInstanceNetworkInterfaceOptions) -} - -// UpdateInstanceNetworkInterfaceWithContext is an alternate form of the UpdateInstanceNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceNetworkInterfaceWithContext(ctx context.Context, updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceNetworkInterfaceOptions, "updateInstanceNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *updateInstanceNetworkInterfaceOptions.InstanceID, - "id": *updateInstanceNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceNetworkInterfaceOptions.NetworkInterfacePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceTemplate : Update an instance template -// This request updates an instance template with the information provided in the instance template patch. The instance -// template patch object is structured in the same way as a retrieved instance template and contains only the -// information to be updated. -func (vpc *VpcV1) UpdateInstanceTemplate(updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceTemplateWithContext(context.Background(), updateInstanceTemplateOptions) -} - -// UpdateInstanceTemplateWithContext is an alternate form of the UpdateInstanceTemplate method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceTemplateWithContext(ctx context.Context, updateInstanceTemplateOptions *UpdateInstanceTemplateOptions) (result InstanceTemplateIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceTemplateOptions, "updateInstanceTemplateOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceTemplateOptions, "updateInstanceTemplateOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateInstanceTemplateOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance/templates/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceTemplateOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceTemplate") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceTemplateOptions.InstanceTemplatePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceTemplate) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceVolumeAttachment : Update a volume attachment -// This request updates a volume attachment with the information provided in a volume attachment patch object. The -// volume attachment patch object is structured in the same way as a retrieved volume attachment and needs to contain -// only the information to be updated. -func (vpc *VpcV1) UpdateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceVolumeAttachmentWithContext(context.Background(), updateInstanceVolumeAttachmentOptions) -} - -// UpdateInstanceVolumeAttachmentWithContext is an alternate form of the UpdateInstanceVolumeAttachment method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceVolumeAttachmentWithContext(ctx context.Context, updateInstanceVolumeAttachmentOptions *UpdateInstanceVolumeAttachmentOptions) (result *VolumeAttachment, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceVolumeAttachmentOptions, "updateInstanceVolumeAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_id": *updateInstanceVolumeAttachmentOptions.InstanceID, - "id": *updateInstanceVolumeAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instances/{instance_id}/volume_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceVolumeAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceVolumeAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceVolumeAttachmentOptions.VolumeAttachmentPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceGroup : Create an instance group -// This request creates a new instance group. -func (vpc *VpcV1) CreateInstanceGroup(createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupWithContext(context.Background(), createInstanceGroupOptions) -} - -// CreateInstanceGroupWithContext is an alternate form of the CreateInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupWithContext(ctx context.Context, createInstanceGroupOptions *CreateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupOptions, "createInstanceGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceGroupOptions, "createInstanceGroupOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createInstanceGroupOptions.InstanceTemplate != nil { - body["instance_template"] = createInstanceGroupOptions.InstanceTemplate - } - if createInstanceGroupOptions.Subnets != nil { - body["subnets"] = createInstanceGroupOptions.Subnets - } - if createInstanceGroupOptions.ApplicationPort != nil { - body["application_port"] = createInstanceGroupOptions.ApplicationPort - } - if createInstanceGroupOptions.LoadBalancer != nil { - body["load_balancer"] = createInstanceGroupOptions.LoadBalancer - } - if createInstanceGroupOptions.LoadBalancerPool != nil { - body["load_balancer_pool"] = createInstanceGroupOptions.LoadBalancerPool - } - if createInstanceGroupOptions.MembershipCount != nil { - body["membership_count"] = createInstanceGroupOptions.MembershipCount - } - if createInstanceGroupOptions.Name != nil { - body["name"] = createInstanceGroupOptions.Name - } - if createInstanceGroupOptions.ResourceGroup != nil { - body["resource_group"] = createInstanceGroupOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceGroupManager : Create a manager for an instance group -// This request creates a new instance group manager. -func (vpc *VpcV1) CreateInstanceGroupManager(createInstanceGroupManagerOptions *CreateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupManagerWithContext(context.Background(), createInstanceGroupManagerOptions) -} - -// CreateInstanceGroupManagerWithContext is an alternate form of the CreateInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupManagerWithContext(ctx context.Context, createInstanceGroupManagerOptions *CreateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupManagerOptions, "createInstanceGroupManagerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceGroupManagerOptions, "createInstanceGroupManagerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *createInstanceGroupManagerOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceGroupManagerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManager") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createInstanceGroupManagerOptions.InstanceGroupManagerPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceGroupManagerAction : Create an instance group manager action -// This request creates a new instance group manager action. -func (vpc *VpcV1) CreateInstanceGroupManagerAction(createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupManagerActionWithContext(context.Background(), createInstanceGroupManagerActionOptions) -} - -// CreateInstanceGroupManagerActionWithContext is an alternate form of the CreateInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupManagerActionWithContext(ctx context.Context, createInstanceGroupManagerActionOptions *CreateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceGroupManagerActionOptions, "createInstanceGroupManagerActionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *createInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *createInstanceGroupManagerActionOptions.InstanceGroupManagerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceGroupManagerActionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerAction") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createInstanceGroupManagerActionOptions.InstanceGroupManagerActionPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateInstanceGroupManagerPolicy : Create a policy for an instance group manager -// This request creates a new instance group manager policy. -func (vpc *VpcV1) CreateInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.CreateInstanceGroupManagerPolicyWithContext(context.Background(), createInstanceGroupManagerPolicyOptions) -} - -// CreateInstanceGroupManagerPolicyWithContext is an alternate form of the CreateInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateInstanceGroupManagerPolicyWithContext(ctx context.Context, createInstanceGroupManagerPolicyOptions *CreateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createInstanceGroupManagerPolicyOptions, "createInstanceGroupManagerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *createInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createInstanceGroupManagerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateInstanceGroupManagerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteInstanceGroup : Delete an instance group -// This request deletes an instance group. This operation cannot be reversed. Any instances associated with the group -// will be deleted. -func (vpc *VpcV1) DeleteInstanceGroup(deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupWithContext(context.Background(), deleteInstanceGroupOptions) -} - -// DeleteInstanceGroupWithContext is an alternate form of the DeleteInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupWithContext(ctx context.Context, deleteInstanceGroupOptions *DeleteInstanceGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupOptions, "deleteInstanceGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupOptions, "deleteInstanceGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteInstanceGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupLoadBalancer : Delete an instance group load balancer -// This request unbinds the instance group from the load balancer pool, and deletes the load balancer pool members. -func (vpc *VpcV1) DeleteInstanceGroupLoadBalancer(deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupLoadBalancerWithContext(context.Background(), deleteInstanceGroupLoadBalancerOptions) -} - -// DeleteInstanceGroupLoadBalancerWithContext is an alternate form of the DeleteInstanceGroupLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupLoadBalancerWithContext(ctx context.Context, deleteInstanceGroupLoadBalancerOptions *DeleteInstanceGroupLoadBalancerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupLoadBalancerOptions, "deleteInstanceGroupLoadBalancerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupLoadBalancerOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/load_balancer`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupManager : Delete an instance group manager -// This request deletes an instance group manager. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceGroupManager(deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupManagerWithContext(context.Background(), deleteInstanceGroupManagerOptions) -} - -// DeleteInstanceGroupManagerWithContext is an alternate form of the DeleteInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupManagerWithContext(ctx context.Context, deleteInstanceGroupManagerOptions *DeleteInstanceGroupManagerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupManagerOptions, "deleteInstanceGroupManagerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupManagerOptions.InstanceGroupID, - "id": *deleteInstanceGroupManagerOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupManagerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManager") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupManagerAction : Delete specified instance group manager action -// This request deletes an instance group manager action. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceGroupManagerAction(deleteInstanceGroupManagerActionOptions *DeleteInstanceGroupManagerActionOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupManagerActionWithContext(context.Background(), deleteInstanceGroupManagerActionOptions) -} - -// DeleteInstanceGroupManagerActionWithContext is an alternate form of the DeleteInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupManagerActionWithContext(ctx context.Context, deleteInstanceGroupManagerActionOptions *DeleteInstanceGroupManagerActionOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupManagerActionOptions, "deleteInstanceGroupManagerActionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupManagerActionOptions, "deleteInstanceGroupManagerActionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *deleteInstanceGroupManagerActionOptions.InstanceGroupManagerID, - "id": *deleteInstanceGroupManagerActionOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupManagerActionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManagerAction") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupManagerPolicy : Delete an instance group manager policy -// This request deletes an instance group manager policy. This operation cannot be reversed. -func (vpc *VpcV1) DeleteInstanceGroupManagerPolicy(deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupManagerPolicyWithContext(context.Background(), deleteInstanceGroupManagerPolicyOptions) -} - -// DeleteInstanceGroupManagerPolicyWithContext is an alternate form of the DeleteInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupManagerPolicyWithContext(ctx context.Context, deleteInstanceGroupManagerPolicyOptions *DeleteInstanceGroupManagerPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupManagerPolicyOptions, "deleteInstanceGroupManagerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *deleteInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - "id": *deleteInstanceGroupManagerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupManagerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupManagerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupMembership : Delete an instance group membership -// This request deletes a memberships of an instance group. This operation cannot be reversed. reversed. If the -// membership has `delete_instance_on_membership_delete` set to `true`, the instance will also be deleted. -func (vpc *VpcV1) DeleteInstanceGroupMembership(deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupMembershipWithContext(context.Background(), deleteInstanceGroupMembershipOptions) -} - -// DeleteInstanceGroupMembershipWithContext is an alternate form of the DeleteInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupMembershipWithContext(ctx context.Context, deleteInstanceGroupMembershipOptions *DeleteInstanceGroupMembershipOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupMembershipOptions, "deleteInstanceGroupMembershipOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupMembershipOptions.InstanceGroupID, - "id": *deleteInstanceGroupMembershipOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupMembershipOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMembership") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteInstanceGroupMemberships : Delete all memberships from an instance group -// This request deletes all memberships of an instance group. This operation cannot be reversed. reversed. Any -// memberships that have `delete_instance_on_membership_delete` set to `true` will also have their instances deleted. -func (vpc *VpcV1) DeleteInstanceGroupMemberships(deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteInstanceGroupMembershipsWithContext(context.Background(), deleteInstanceGroupMembershipsOptions) -} - -// DeleteInstanceGroupMembershipsWithContext is an alternate form of the DeleteInstanceGroupMemberships method which supports a Context parameter -func (vpc *VpcV1) DeleteInstanceGroupMembershipsWithContext(ctx context.Context, deleteInstanceGroupMembershipsOptions *DeleteInstanceGroupMembershipsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteInstanceGroupMembershipsOptions, "deleteInstanceGroupMembershipsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *deleteInstanceGroupMembershipsOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteInstanceGroupMembershipsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteInstanceGroupMemberships") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetInstanceGroup : Retrieve an instance group -// This request retrieves a single instance group specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroup(getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupWithContext(context.Background(), getInstanceGroupOptions) -} - -// GetInstanceGroupWithContext is an alternate form of the GetInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupWithContext(ctx context.Context, getInstanceGroupOptions *GetInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupOptions, "getInstanceGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupOptions, "getInstanceGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getInstanceGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceGroupManager : Retrieve an instance group manager -// This request retrieves a single instance group manager specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupManager(getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupManagerWithContext(context.Background(), getInstanceGroupManagerOptions) -} - -// GetInstanceGroupManagerWithContext is an alternate form of the GetInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupManagerWithContext(ctx context.Context, getInstanceGroupManagerOptions *GetInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupManagerOptions, "getInstanceGroupManagerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupManagerOptions.InstanceGroupID, - "id": *getInstanceGroupManagerOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceGroupManagerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManager") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceGroupManagerAction : Retrieve specified instance group manager action -// This request retrieves a single instance group manager action specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupManagerAction(getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupManagerActionWithContext(context.Background(), getInstanceGroupManagerActionOptions) -} - -// GetInstanceGroupManagerActionWithContext is an alternate form of the GetInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupManagerActionWithContext(ctx context.Context, getInstanceGroupManagerActionOptions *GetInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupManagerActionOptions, "getInstanceGroupManagerActionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *getInstanceGroupManagerActionOptions.InstanceGroupManagerID, - "id": *getInstanceGroupManagerActionOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceGroupManagerActionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManagerAction") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceGroupManagerPolicy : Retrieve an instance group manager policy -// This request retrieves a single instance group manager policy specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions *GetInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupManagerPolicyWithContext(context.Background(), getInstanceGroupManagerPolicyOptions) -} - -// GetInstanceGroupManagerPolicyWithContext is an alternate form of the GetInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupManagerPolicyWithContext(ctx context.Context, getInstanceGroupManagerPolicyOptions *GetInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupManagerPolicyOptions, "getInstanceGroupManagerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupManagerPolicyOptions, "getInstanceGroupManagerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *getInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - "id": *getInstanceGroupManagerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceGroupManagerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupManagerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetInstanceGroupMembership : Retrieve an instance group membership -// This request retrieves a single instance group membership specified by identifier in the URL. -func (vpc *VpcV1) GetInstanceGroupMembership(getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - return vpc.GetInstanceGroupMembershipWithContext(context.Background(), getInstanceGroupMembershipOptions) -} - -// GetInstanceGroupMembershipWithContext is an alternate form of the GetInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) GetInstanceGroupMembershipWithContext(ctx context.Context, getInstanceGroupMembershipOptions *GetInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getInstanceGroupMembershipOptions, "getInstanceGroupMembershipOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *getInstanceGroupMembershipOptions.InstanceGroupID, - "id": *getInstanceGroupMembershipOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getInstanceGroupMembershipOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetInstanceGroupMembership") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceGroupManagerActions : List all actions for an instance group manager -// This request lists all instance group actions for an instance group manager. -func (vpc *VpcV1) ListInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagerActionsWithContext(context.Background(), listInstanceGroupManagerActionsOptions) -} - -// ListInstanceGroupManagerActionsWithContext is an alternate form of the ListInstanceGroupManagerActions method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagerActionsWithContext(ctx context.Context, listInstanceGroupManagerActionsOptions *ListInstanceGroupManagerActionsOptions) (result *InstanceGroupManagerActionsCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceGroupManagerActionsOptions, "listInstanceGroupManagerActionsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagerActionsOptions.InstanceGroupID, - "instance_group_manager_id": *listInstanceGroupManagerActionsOptions.InstanceGroupManagerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceGroupManagerActionsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerActions") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagerActionsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Start)) - } - if listInstanceGroupManagerActionsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerActionsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerActionsCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceGroupManagerPolicies : List all policies for an instance group manager -// This request lists all policies for an instance group manager. -func (vpc *VpcV1) ListInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagerPoliciesWithContext(context.Background(), listInstanceGroupManagerPoliciesOptions) -} - -// ListInstanceGroupManagerPoliciesWithContext is an alternate form of the ListInstanceGroupManagerPolicies method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagerPoliciesWithContext(ctx context.Context, listInstanceGroupManagerPoliciesOptions *ListInstanceGroupManagerPoliciesOptions) (result *InstanceGroupManagerPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceGroupManagerPoliciesOptions, "listInstanceGroupManagerPoliciesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupID, - "instance_group_manager_id": *listInstanceGroupManagerPoliciesOptions.InstanceGroupManagerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceGroupManagerPoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagerPolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagerPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Start)) - } - if listInstanceGroupManagerPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagerPoliciesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceGroupManagers : List all managers for an instance group -// This request lists all managers for an instance group. -func (vpc *VpcV1) ListInstanceGroupManagers(listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupManagersWithContext(context.Background(), listInstanceGroupManagersOptions) -} - -// ListInstanceGroupManagersWithContext is an alternate form of the ListInstanceGroupManagers method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupManagersWithContext(ctx context.Context, listInstanceGroupManagersOptions *ListInstanceGroupManagersOptions) (result *InstanceGroupManagerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceGroupManagersOptions, "listInstanceGroupManagersOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupManagersOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceGroupManagersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupManagers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupManagersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupManagersOptions.Start)) - } - if listInstanceGroupManagersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupManagersOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceGroupMemberships : List all memberships for an instance group -// This request lists all instance group memberships for an instance group. -func (vpc *VpcV1) ListInstanceGroupMemberships(listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupMembershipsWithContext(context.Background(), listInstanceGroupMembershipsOptions) -} - -// ListInstanceGroupMembershipsWithContext is an alternate form of the ListInstanceGroupMemberships method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupMembershipsWithContext(ctx context.Context, listInstanceGroupMembershipsOptions *ListInstanceGroupMembershipsOptions) (result *InstanceGroupMembershipCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listInstanceGroupMembershipsOptions, "listInstanceGroupMembershipsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *listInstanceGroupMembershipsOptions.InstanceGroupID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceGroupMembershipsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroupMemberships") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupMembershipsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupMembershipsOptions.Start)) - } - if listInstanceGroupMembershipsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupMembershipsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembershipCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListInstanceGroups : List all instance groups -// This request lists all instance groups in the region. -func (vpc *VpcV1) ListInstanceGroups(listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListInstanceGroupsWithContext(context.Background(), listInstanceGroupsOptions) -} - -// ListInstanceGroupsWithContext is an alternate form of the ListInstanceGroups method which supports a Context parameter -func (vpc *VpcV1) ListInstanceGroupsWithContext(ctx context.Context, listInstanceGroupsOptions *ListInstanceGroupsOptions) (result *InstanceGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listInstanceGroupsOptions, "listInstanceGroupsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listInstanceGroupsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListInstanceGroups") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listInstanceGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listInstanceGroupsOptions.Start)) - } - if listInstanceGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listInstanceGroupsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceGroup : Update an instance group -// This request updates an instance group with the information provided instance group patch. The instance group patch -// object is structured in the same way as a retrieved instance group and contains only the information to be updated. -func (vpc *VpcV1) UpdateInstanceGroup(updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupWithContext(context.Background(), updateInstanceGroupOptions) -} - -// UpdateInstanceGroupWithContext is an alternate form of the UpdateInstanceGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupWithContext(ctx context.Context, updateInstanceGroupOptions *UpdateInstanceGroupOptions) (result *InstanceGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupOptions, "updateInstanceGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupOptions, "updateInstanceGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateInstanceGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupOptions.InstanceGroupPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceGroupManager : Update an instance group manager -// This request updates an instance group manager with the information provided instance group manager patch. -func (vpc *VpcV1) UpdateInstanceGroupManager(updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerWithContext(context.Background(), updateInstanceGroupManagerOptions) -} - -// UpdateInstanceGroupManagerWithContext is an alternate form of the UpdateInstanceGroupManager method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerWithContext(ctx context.Context, updateInstanceGroupManagerOptions *UpdateInstanceGroupManagerOptions) (result InstanceGroupManagerIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupManagerOptions, "updateInstanceGroupManagerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerOptions.InstanceGroupID, - "id": *updateInstanceGroupManagerOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceGroupManagerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManager") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerOptions.InstanceGroupManagerPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManager) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceGroupManagerAction : Update specified instance group manager action -// This request updates an instance group manager action. -func (vpc *VpcV1) UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerActionWithContext(context.Background(), updateInstanceGroupManagerActionOptions) -} - -// UpdateInstanceGroupManagerActionWithContext is an alternate form of the UpdateInstanceGroupManagerAction method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerActionWithContext(ctx context.Context, updateInstanceGroupManagerActionOptions *UpdateInstanceGroupManagerActionOptions) (result InstanceGroupManagerActionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupManagerActionOptions, "updateInstanceGroupManagerActionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerActionOptions.InstanceGroupID, - "instance_group_manager_id": *updateInstanceGroupManagerActionOptions.InstanceGroupManagerID, - "id": *updateInstanceGroupManagerActionOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceGroupManagerActionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerAction") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerActionOptions.InstanceGroupManagerActionPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceGroupManagerPolicy : Update an instance group manager policy -// This request updates an instance group manager policy. -func (vpc *VpcV1) UpdateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupManagerPolicyWithContext(context.Background(), updateInstanceGroupManagerPolicyOptions) -} - -// UpdateInstanceGroupManagerPolicyWithContext is an alternate form of the UpdateInstanceGroupManagerPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupManagerPolicyWithContext(ctx context.Context, updateInstanceGroupManagerPolicyOptions *UpdateInstanceGroupManagerPolicyOptions) (result InstanceGroupManagerPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupManagerPolicyOptions, "updateInstanceGroupManagerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupID, - "instance_group_manager_id": *updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerID, - "id": *updateInstanceGroupManagerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceGroupManagerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupManagerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerPolicyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateInstanceGroupMembership : Update an instance group membership -// This request updates an instance group membership with the information provided instance group membership patch. -func (vpc *VpcV1) UpdateInstanceGroupMembership(updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - return vpc.UpdateInstanceGroupMembershipWithContext(context.Background(), updateInstanceGroupMembershipOptions) -} - -// UpdateInstanceGroupMembershipWithContext is an alternate form of the UpdateInstanceGroupMembership method which supports a Context parameter -func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, updateInstanceGroupMembershipOptions *UpdateInstanceGroupMembershipOptions) (result *InstanceGroupMembership, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateInstanceGroupMembershipOptions, "updateInstanceGroupMembershipOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "instance_group_id": *updateInstanceGroupMembershipOptions.InstanceGroupID, - "id": *updateInstanceGroupMembershipOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/instance_groups/{instance_group_id}/memberships/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateInstanceGroupMembershipOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateInstanceGroupMembership") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateInstanceGroupMembershipOptions.InstanceGroupMembershipPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalInstanceGroupMembership) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ActivateReservation : Activate a reservation -// This request activates a reservation. For this request to succeed, the reservation status must be `inactive`. -func (vpc *VpcV1) ActivateReservation(activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { - return vpc.ActivateReservationWithContext(context.Background(), activateReservationOptions) -} - -// ActivateReservationWithContext is an alternate form of the ActivateReservation method which supports a Context parameter -func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(activateReservationOptions, "activateReservationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(activateReservationOptions, "activateReservationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *activateReservationOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range activateReservationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ActivateReservation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// CreateReservation : Create a reservation -// This request creates a new reservation from a reservation prototype object. The prototype object is structured in the -// same way as a retrieved reservation, and contains the information necessary to create the new reservation. -func (vpc *VpcV1) CreateReservation(createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.CreateReservationWithContext(context.Background(), createReservationOptions) -} - -// CreateReservationWithContext is an alternate form of the CreateReservation method which supports a Context parameter -func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createReservationOptions, "createReservationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createReservationOptions, "createReservationOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createReservationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateReservation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createReservationOptions.Capacity != nil { - body["capacity"] = createReservationOptions.Capacity - } - if createReservationOptions.CommittedUse != nil { - body["committed_use"] = createReservationOptions.CommittedUse - } - if createReservationOptions.Profile != nil { - body["profile"] = createReservationOptions.Profile - } - if createReservationOptions.Zone != nil { - body["zone"] = createReservationOptions.Zone - } - if createReservationOptions.AffinityPolicy != nil { - body["affinity_policy"] = createReservationOptions.AffinityPolicy - } - if createReservationOptions.Name != nil { - body["name"] = createReservationOptions.Name - } - if createReservationOptions.ResourceGroup != nil { - body["resource_group"] = createReservationOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteReservation : Delete a reservation -// This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are -// not allowed to be deleted. -func (vpc *VpcV1) DeleteReservation(deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.DeleteReservationWithContext(context.Background(), deleteReservationOptions) -} - -// DeleteReservationWithContext is an alternate form of the DeleteReservation method which supports a Context parameter -func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteReservationOptions, "deleteReservationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteReservationOptions, "deleteReservationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteReservationOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteReservationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteReservation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetReservation : Retrieve a reservation -// This request retrieves a single reservation specified by identifier in the URL. -func (vpc *VpcV1) GetReservation(getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.GetReservationWithContext(context.Background(), getReservationOptions) -} - -// GetReservationWithContext is an alternate form of the GetReservation method which supports a Context parameter -func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getReservationOptions, "getReservationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getReservationOptions, "getReservationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getReservationOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getReservationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetReservation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListReservations : List all reservations -// This request lists all reservations in the region. A reservation provides reserved capacity for a specified profile -// in a specified zone. A reservation can also include a long-term committed use discount. -// -// The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations -// with identical `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListReservations(listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { - return vpc.ListReservationsWithContext(context.Background(), listReservationsOptions) -} - -// ListReservationsWithContext is an alternate form of the ListReservations method which supports a Context parameter -func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listReservationsOptions, "listReservationsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listReservationsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListReservations") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listReservationsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listReservationsOptions.Start)) - } - if listReservationsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listReservationsOptions.Limit)) - } - if listReservationsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listReservationsOptions.Name)) - } - if listReservationsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listReservationsOptions.ResourceGroupID)) - } - if listReservationsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listReservationsOptions.ZoneName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservationCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateReservation : Update a reservation -// This request updates a reservation with the information provided in a reservation patch object. The patch object is -// structured in the same way as a retrieved reservation and needs to contain only the information to be updated. -func (vpc *VpcV1) UpdateReservation(updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - return vpc.UpdateReservationWithContext(context.Background(), updateReservationOptions) -} - -// UpdateReservationWithContext is an alternate form of the UpdateReservation method which supports a Context parameter -func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateReservationOptions, "updateReservationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateReservationOptions, "updateReservationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateReservationOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateReservationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateReservation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateReservationOptions.ReservationPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateDedicatedHost : Create a dedicated host -// This request creates a new dedicated host. -func (vpc *VpcV1) CreateDedicatedHost(createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.CreateDedicatedHostWithContext(context.Background(), createDedicatedHostOptions) -} - -// CreateDedicatedHostWithContext is an alternate form of the CreateDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) CreateDedicatedHostWithContext(ctx context.Context, createDedicatedHostOptions *CreateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createDedicatedHostOptions, "createDedicatedHostOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createDedicatedHostOptions, "createDedicatedHostOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createDedicatedHostOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHost") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createDedicatedHostOptions.DedicatedHostPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateDedicatedHostGroup : Create a dedicated host group -// This request creates a new dedicated host group. -func (vpc *VpcV1) CreateDedicatedHostGroup(createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.CreateDedicatedHostGroupWithContext(context.Background(), createDedicatedHostGroupOptions) -} - -// CreateDedicatedHostGroupWithContext is an alternate form of the CreateDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) CreateDedicatedHostGroupWithContext(ctx context.Context, createDedicatedHostGroupOptions *CreateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createDedicatedHostGroupOptions, "createDedicatedHostGroupOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createDedicatedHostGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateDedicatedHostGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createDedicatedHostGroupOptions.Class != nil { - body["class"] = createDedicatedHostGroupOptions.Class - } - if createDedicatedHostGroupOptions.Family != nil { - body["family"] = createDedicatedHostGroupOptions.Family - } - if createDedicatedHostGroupOptions.Zone != nil { - body["zone"] = createDedicatedHostGroupOptions.Zone - } - if createDedicatedHostGroupOptions.Name != nil { - body["name"] = createDedicatedHostGroupOptions.Name - } - if createDedicatedHostGroupOptions.ResourceGroup != nil { - body["resource_group"] = createDedicatedHostGroupOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteDedicatedHost : Delete a dedicated host -// This request deletes a dedicated host. -func (vpc *VpcV1) DeleteDedicatedHost(deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteDedicatedHostWithContext(context.Background(), deleteDedicatedHostOptions) -} - -// DeleteDedicatedHostWithContext is an alternate form of the DeleteDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) DeleteDedicatedHostWithContext(ctx context.Context, deleteDedicatedHostOptions *DeleteDedicatedHostOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteDedicatedHostOptions, "deleteDedicatedHostOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteDedicatedHostOptions, "deleteDedicatedHostOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteDedicatedHostOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteDedicatedHostOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHost") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteDedicatedHostGroup : Delete a dedicated host group -// This request deletes a dedicated host group. -func (vpc *VpcV1) DeleteDedicatedHostGroup(deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteDedicatedHostGroupWithContext(context.Background(), deleteDedicatedHostGroupOptions) -} - -// DeleteDedicatedHostGroupWithContext is an alternate form of the DeleteDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteDedicatedHostGroupWithContext(ctx context.Context, deleteDedicatedHostGroupOptions *DeleteDedicatedHostGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteDedicatedHostGroupOptions, "deleteDedicatedHostGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteDedicatedHostGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteDedicatedHostGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteDedicatedHostGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetDedicatedHost : Retrieve a dedicated host -// This request retrieves a single dedicated host specified by the identifiers in the URL. -func (vpc *VpcV1) GetDedicatedHost(getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostWithContext(context.Background(), getDedicatedHostOptions) -} - -// GetDedicatedHostWithContext is an alternate form of the GetDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostWithContext(ctx context.Context, getDedicatedHostOptions *GetDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostOptions, "getDedicatedHostOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getDedicatedHostOptions, "getDedicatedHostOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getDedicatedHostOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getDedicatedHostOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHost") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetDedicatedHostDisk : Retrieve a dedicated host disk -// This request retrieves a single dedicated host disk specified by the identifier in the URL. -func (vpc *VpcV1) GetDedicatedHostDisk(getDedicatedHostDiskOptions *GetDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostDiskWithContext(context.Background(), getDedicatedHostDiskOptions) -} - -// GetDedicatedHostDiskWithContext is an alternate form of the GetDedicatedHostDisk method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostDiskWithContext(ctx context.Context, getDedicatedHostDiskOptions *GetDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostDiskOptions, "getDedicatedHostDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getDedicatedHostDiskOptions, "getDedicatedHostDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "dedicated_host_id": *getDedicatedHostDiskOptions.DedicatedHostID, - "id": *getDedicatedHostDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getDedicatedHostDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetDedicatedHostGroup : Retrieve a dedicated host group -// This request retrieves a single dedicated host group specified by the identifier in the URL. -func (vpc *VpcV1) GetDedicatedHostGroup(getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostGroupWithContext(context.Background(), getDedicatedHostGroupOptions) -} - -// GetDedicatedHostGroupWithContext is an alternate form of the GetDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostGroupWithContext(ctx context.Context, getDedicatedHostGroupOptions *GetDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getDedicatedHostGroupOptions, "getDedicatedHostGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getDedicatedHostGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getDedicatedHostGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetDedicatedHostProfile : Retrieve a dedicated host profile -// This request retrieves a single dedicated host profile specified by the name in the URL. -func (vpc *VpcV1) GetDedicatedHostProfile(getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { - return vpc.GetDedicatedHostProfileWithContext(context.Background(), getDedicatedHostProfileOptions) -} - -// GetDedicatedHostProfileWithContext is an alternate form of the GetDedicatedHostProfile method which supports a Context parameter -func (vpc *VpcV1) GetDedicatedHostProfileWithContext(ctx context.Context, getDedicatedHostProfileOptions *GetDedicatedHostProfileOptions) (result *DedicatedHostProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getDedicatedHostProfileOptions, "getDedicatedHostProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getDedicatedHostProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getDedicatedHostProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetDedicatedHostProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListDedicatedHostDisks : List all disks on a dedicated host -// This request lists all disks on a dedicated host. A disk is a physical device that is locally attached to the -// compute node. By default, the listed disks are sorted by their -// `created_at` property values, with the newest disk first. -func (vpc *VpcV1) ListDedicatedHostDisks(listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostDisksWithContext(context.Background(), listDedicatedHostDisksOptions) -} - -// ListDedicatedHostDisksWithContext is an alternate form of the ListDedicatedHostDisks method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostDisksWithContext(ctx context.Context, listDedicatedHostDisksOptions *ListDedicatedHostDisksOptions) (result *DedicatedHostDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listDedicatedHostDisksOptions, "listDedicatedHostDisksOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "dedicated_host_id": *listDedicatedHostDisksOptions.DedicatedHostID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listDedicatedHostDisksOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostDisks") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDiskCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListDedicatedHostGroups : List all dedicated host groups -// This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for -// placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. -func (vpc *VpcV1) ListDedicatedHostGroups(listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostGroupsWithContext(context.Background(), listDedicatedHostGroupsOptions) -} - -// ListDedicatedHostGroupsWithContext is an alternate form of the ListDedicatedHostGroups method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostGroupsWithContext(ctx context.Context, listDedicatedHostGroupsOptions *ListDedicatedHostGroupsOptions) (result *DedicatedHostGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostGroupsOptions, "listDedicatedHostGroupsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listDedicatedHostGroupsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostGroups") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostGroupsOptions.Start)) - } - if listDedicatedHostGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostGroupsOptions.Limit)) - } - if listDedicatedHostGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostGroupsOptions.ResourceGroupID)) - } - if listDedicatedHostGroupsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostGroupsOptions.ZoneName)) - } - if listDedicatedHostGroupsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listDedicatedHostGroupsOptions.Name)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroupCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListDedicatedHostProfiles : List all dedicated host profiles -// This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in -// the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. -func (vpc *VpcV1) ListDedicatedHostProfiles(listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostProfilesWithContext(context.Background(), listDedicatedHostProfilesOptions) -} - -// ListDedicatedHostProfilesWithContext is an alternate form of the ListDedicatedHostProfiles method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostProfilesWithContext(ctx context.Context, listDedicatedHostProfilesOptions *ListDedicatedHostProfilesOptions) (result *DedicatedHostProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostProfilesOptions, "listDedicatedHostProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listDedicatedHostProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHostProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostProfilesOptions.Start)) - } - if listDedicatedHostProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostProfilesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListDedicatedHosts : List all dedicated hosts -// This request lists all dedicated hosts in the region. -func (vpc *VpcV1) ListDedicatedHosts(listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { - return vpc.ListDedicatedHostsWithContext(context.Background(), listDedicatedHostsOptions) -} - -// ListDedicatedHostsWithContext is an alternate form of the ListDedicatedHosts method which supports a Context parameter -func (vpc *VpcV1) ListDedicatedHostsWithContext(ctx context.Context, listDedicatedHostsOptions *ListDedicatedHostsOptions) (result *DedicatedHostCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listDedicatedHostsOptions, "listDedicatedHostsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listDedicatedHostsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListDedicatedHosts") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listDedicatedHostsOptions.DedicatedHostGroupID != nil { - builder.AddQuery("dedicated_host_group.id", fmt.Sprint(*listDedicatedHostsOptions.DedicatedHostGroupID)) - } - if listDedicatedHostsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listDedicatedHostsOptions.Start)) - } - if listDedicatedHostsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listDedicatedHostsOptions.Limit)) - } - if listDedicatedHostsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listDedicatedHostsOptions.ResourceGroupID)) - } - if listDedicatedHostsOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listDedicatedHostsOptions.ZoneName)) - } - if listDedicatedHostsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listDedicatedHostsOptions.Name)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateDedicatedHost : Update a dedicated host -// This request updates a dedicated host with the information in a provided dedicated host patch. The dedicated host -// patch object is structured in the same way as a retrieved dedicated host and contains only the information to be -// updated. -func (vpc *VpcV1) UpdateDedicatedHost(updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostWithContext(context.Background(), updateDedicatedHostOptions) -} - -// UpdateDedicatedHostWithContext is an alternate form of the UpdateDedicatedHost method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostWithContext(ctx context.Context, updateDedicatedHostOptions *UpdateDedicatedHostOptions) (result *DedicatedHost, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostOptions, "updateDedicatedHostOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateDedicatedHostOptions, "updateDedicatedHostOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateDedicatedHostOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateDedicatedHostOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHost") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateDedicatedHostOptions.DedicatedHostPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHost) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateDedicatedHostDisk : Update a dedicated host disk -// This request updates the dedicated host disk with the information in a provided patch. -func (vpc *VpcV1) UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostDiskWithContext(context.Background(), updateDedicatedHostDiskOptions) -} - -// UpdateDedicatedHostDiskWithContext is an alternate form of the UpdateDedicatedHostDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostDiskWithContext(ctx context.Context, updateDedicatedHostDiskOptions *UpdateDedicatedHostDiskOptions) (result *DedicatedHostDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateDedicatedHostDiskOptions, "updateDedicatedHostDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "dedicated_host_id": *updateDedicatedHostDiskOptions.DedicatedHostID, - "id": *updateDedicatedHostDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_hosts/{dedicated_host_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateDedicatedHostDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateDedicatedHostDiskOptions.DedicatedHostDiskPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateDedicatedHostGroup : Update a dedicated host group -// This request updates a dedicated host group with the information in a provided dedicated host group patch. The -// dedicated host group patch object is structured in the same way as a retrieved dedicated host group and contains only -// the information to be updated. -func (vpc *VpcV1) UpdateDedicatedHostGroup(updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateDedicatedHostGroupWithContext(context.Background(), updateDedicatedHostGroupOptions) -} - -// UpdateDedicatedHostGroupWithContext is an alternate form of the UpdateDedicatedHostGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateDedicatedHostGroupWithContext(ctx context.Context, updateDedicatedHostGroupOptions *UpdateDedicatedHostGroupOptions) (result *DedicatedHostGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateDedicatedHostGroupOptions, "updateDedicatedHostGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateDedicatedHostGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/dedicated_host/groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateDedicatedHostGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateDedicatedHostGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateDedicatedHostGroupOptions.DedicatedHostGroupPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBackupPolicy : Create a backup policy -// This request creates a new backup policy from a backup policy prototype object. The prototype object is structured in -// the same way as a retrieved backup policy, and contains the information necessary to create the new backup policy. -func (vpc *VpcV1) CreateBackupPolicy(createBackupPolicyOptions *CreateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.CreateBackupPolicyWithContext(context.Background(), createBackupPolicyOptions) -} - -// CreateBackupPolicyWithContext is an alternate form of the CreateBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateBackupPolicyWithContext(ctx context.Context, createBackupPolicyOptions *CreateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBackupPolicyOptions, "createBackupPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBackupPolicyOptions, "createBackupPolicyOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createBackupPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBackupPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createBackupPolicyOptions.BackupPolicyPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBackupPolicyPlan : Create a plan for a backup policy -// This request creates a new backup policy plan from a backup policy plan prototype object. The prototype object is -// structured in the same way as a retrieved backup policy plan, and contains the information necessary to create the -// new backup policy plan. -// -// Backups created by this plan will use the resource group of the source being backed up. -// -// Backups created by this plan will use the plan's name truncated to 46 characters, followed by a unique 16-character -// suffix. -func (vpc *VpcV1) CreateBackupPolicyPlan(createBackupPolicyPlanOptions *CreateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.CreateBackupPolicyPlanWithContext(context.Background(), createBackupPolicyPlanOptions) -} - -// CreateBackupPolicyPlanWithContext is an alternate form of the CreateBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) CreateBackupPolicyPlanWithContext(ctx context.Context, createBackupPolicyPlanOptions *CreateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBackupPolicyPlanOptions, "createBackupPolicyPlanOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBackupPolicyPlanOptions, "createBackupPolicyPlanOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *createBackupPolicyPlanOptions.BackupPolicyID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createBackupPolicyPlanOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBackupPolicyPlan") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createBackupPolicyPlanOptions.CronSpec != nil { - body["cron_spec"] = createBackupPolicyPlanOptions.CronSpec - } - if createBackupPolicyPlanOptions.Active != nil { - body["active"] = createBackupPolicyPlanOptions.Active - } - if createBackupPolicyPlanOptions.AttachUserTags != nil { - body["attach_user_tags"] = createBackupPolicyPlanOptions.AttachUserTags - } - if createBackupPolicyPlanOptions.ClonePolicy != nil { - body["clone_policy"] = createBackupPolicyPlanOptions.ClonePolicy - } - if createBackupPolicyPlanOptions.CopyUserTags != nil { - body["copy_user_tags"] = createBackupPolicyPlanOptions.CopyUserTags - } - if createBackupPolicyPlanOptions.DeletionTrigger != nil { - body["deletion_trigger"] = createBackupPolicyPlanOptions.DeletionTrigger - } - if createBackupPolicyPlanOptions.Name != nil { - body["name"] = createBackupPolicyPlanOptions.Name - } - if createBackupPolicyPlanOptions.RemoteRegionPolicies != nil { - body["remote_region_policies"] = createBackupPolicyPlanOptions.RemoteRegionPolicies - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteBackupPolicy : Delete a backup policy -// This request deletes a backup policy. This operation cannot be reversed. -// -// If the request is accepted, the backup policy `status` will be set to `deleting`. Once deletion processing completes, -// the backup policy will no longer be retrievable. -func (vpc *VpcV1) DeleteBackupPolicy(deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.DeleteBackupPolicyWithContext(context.Background(), deleteBackupPolicyOptions) -} - -// DeleteBackupPolicyWithContext is an alternate form of the DeleteBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteBackupPolicyWithContext(ctx context.Context, deleteBackupPolicyOptions *DeleteBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBackupPolicyOptions, "deleteBackupPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteBackupPolicyOptions, "deleteBackupPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteBackupPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteBackupPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - if deleteBackupPolicyOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteBackupPolicyPlan : Delete a backup policy plan -// This request deletes a backup policy plan. This operation cannot be reversed. Any backups that have been created by -// the plan will remain but will no longer be subject to the plan's deletion trigger. Any running jobs associated with -// the plan will run to completion before the plan is deleted. -// -// If the request is accepted, the backup policy plan `status` will be set to `deleting`. Once deletion processing -// completes, the backup policy plan will no longer be retrievable. -func (vpc *VpcV1) DeleteBackupPolicyPlan(deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.DeleteBackupPolicyPlanWithContext(context.Background(), deleteBackupPolicyPlanOptions) -} - -// DeleteBackupPolicyPlanWithContext is an alternate form of the DeleteBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) DeleteBackupPolicyPlanWithContext(ctx context.Context, deleteBackupPolicyPlanOptions *DeleteBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteBackupPolicyPlanOptions, "deleteBackupPolicyPlanOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *deleteBackupPolicyPlanOptions.BackupPolicyID, - "id": *deleteBackupPolicyPlanOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteBackupPolicyPlanOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBackupPolicyPlan") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - if deleteBackupPolicyPlanOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteBackupPolicyPlanOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBackupPolicy : Retrieve a backup policy -// This request retrieves a single backup policy specified by the identifier in the URL. -func (vpc *VpcV1) GetBackupPolicy(getBackupPolicyOptions *GetBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.GetBackupPolicyWithContext(context.Background(), getBackupPolicyOptions) -} - -// GetBackupPolicyWithContext is an alternate form of the GetBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) GetBackupPolicyWithContext(ctx context.Context, getBackupPolicyOptions *GetBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBackupPolicyOptions, "getBackupPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBackupPolicyOptions, "getBackupPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getBackupPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBackupPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBackupPolicyJob : Retrieve a backup policy job -// This request retrieves a single backup policy job specified by the identifier in the URL. -func (vpc *VpcV1) GetBackupPolicyJob(getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { - return vpc.GetBackupPolicyJobWithContext(context.Background(), getBackupPolicyJobOptions) -} - -// GetBackupPolicyJobWithContext is an alternate form of the GetBackupPolicyJob method which supports a Context parameter -func (vpc *VpcV1) GetBackupPolicyJobWithContext(ctx context.Context, getBackupPolicyJobOptions *GetBackupPolicyJobOptions) (result *BackupPolicyJob, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBackupPolicyJobOptions, "getBackupPolicyJobOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBackupPolicyJobOptions, "getBackupPolicyJobOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *getBackupPolicyJobOptions.BackupPolicyID, - "id": *getBackupPolicyJobOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBackupPolicyJobOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicyJob") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJob) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBackupPolicyPlan : Retrieve a backup policy plan -// This request retrieves a single backup policy plan specified by the identifier in the URL. -func (vpc *VpcV1) GetBackupPolicyPlan(getBackupPolicyPlanOptions *GetBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.GetBackupPolicyPlanWithContext(context.Background(), getBackupPolicyPlanOptions) -} - -// GetBackupPolicyPlanWithContext is an alternate form of the GetBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) GetBackupPolicyPlanWithContext(ctx context.Context, getBackupPolicyPlanOptions *GetBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBackupPolicyPlanOptions, "getBackupPolicyPlanOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBackupPolicyPlanOptions, "getBackupPolicyPlanOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *getBackupPolicyPlanOptions.BackupPolicyID, - "id": *getBackupPolicyPlanOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBackupPolicyPlanOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBackupPolicyPlan") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBackupPolicies : List all backup policies -// This request lists all backup policies in the region. Backup policies control which sources are selected for backup -// and include a set of backup policy plans that provide the backup schedules and deletion triggers. -func (vpc *VpcV1) ListBackupPolicies(listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPoliciesWithContext(context.Background(), listBackupPoliciesOptions) -} - -// ListBackupPoliciesWithContext is an alternate form of the ListBackupPolicies method which supports a Context parameter -func (vpc *VpcV1) ListBackupPoliciesWithContext(ctx context.Context, listBackupPoliciesOptions *ListBackupPoliciesOptions) (result *BackupPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBackupPoliciesOptions, "listBackupPoliciesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listBackupPoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBackupPoliciesOptions.Start)) - } - if listBackupPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBackupPoliciesOptions.Limit)) - } - if listBackupPoliciesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listBackupPoliciesOptions.ResourceGroupID)) - } - if listBackupPoliciesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBackupPoliciesOptions.Name)) - } - if listBackupPoliciesOptions.Tag != nil { - builder.AddQuery("tag", fmt.Sprint(*listBackupPoliciesOptions.Tag)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBackupPolicyJobs : List all jobs for a backup policy -// This request retrieves all jobs for a backup policy. A backup job represents the execution of a backup policy plan -// for a resource matching the policy's criteria. -func (vpc *VpcV1) ListBackupPolicyJobs(listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPolicyJobsWithContext(context.Background(), listBackupPolicyJobsOptions) -} - -// ListBackupPolicyJobsWithContext is an alternate form of the ListBackupPolicyJobs method which supports a Context parameter -func (vpc *VpcV1) ListBackupPolicyJobsWithContext(ctx context.Context, listBackupPolicyJobsOptions *ListBackupPolicyJobsOptions) (result *BackupPolicyJobCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBackupPolicyJobsOptions, "listBackupPolicyJobsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *listBackupPolicyJobsOptions.BackupPolicyID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/jobs`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBackupPolicyJobsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyJobs") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPolicyJobsOptions.Status != nil { - builder.AddQuery("status", fmt.Sprint(*listBackupPolicyJobsOptions.Status)) - } - if listBackupPolicyJobsOptions.BackupPolicyPlanID != nil { - builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listBackupPolicyJobsOptions.BackupPolicyPlanID)) - } - if listBackupPolicyJobsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBackupPolicyJobsOptions.Start)) - } - if listBackupPolicyJobsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBackupPolicyJobsOptions.Limit)) - } - if listBackupPolicyJobsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listBackupPolicyJobsOptions.Sort)) - } - if listBackupPolicyJobsOptions.SourceID != nil { - builder.AddQuery("source.id", fmt.Sprint(*listBackupPolicyJobsOptions.SourceID)) - } - if listBackupPolicyJobsOptions.TargetSnapshotsID != nil { - builder.AddQuery("target_snapshots[].id", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsID)) - } - if listBackupPolicyJobsOptions.TargetSnapshotsCRN != nil { - builder.AddQuery("target_snapshots[].crn", fmt.Sprint(*listBackupPolicyJobsOptions.TargetSnapshotsCRN)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyJobCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBackupPolicyPlans : List all plans for a backup policy -// This request retrieves all plans for a backup policy. Backup plans provide the backup schedule and deletion triggers. -func (vpc *VpcV1) ListBackupPolicyPlans(listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { - return vpc.ListBackupPolicyPlansWithContext(context.Background(), listBackupPolicyPlansOptions) -} - -// ListBackupPolicyPlansWithContext is an alternate form of the ListBackupPolicyPlans method which supports a Context parameter -func (vpc *VpcV1) ListBackupPolicyPlansWithContext(ctx context.Context, listBackupPolicyPlansOptions *ListBackupPolicyPlansOptions) (result *BackupPolicyPlanCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBackupPolicyPlansOptions, "listBackupPolicyPlansOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *listBackupPolicyPlansOptions.BackupPolicyID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBackupPolicyPlansOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBackupPolicyPlans") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBackupPolicyPlansOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBackupPolicyPlansOptions.Name)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlanCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateBackupPolicy : Update a backup policy -// This request updates a backup policy with the information in a provided backup policy patch. The backup policy patch -// object is structured in the same way as a retrieved backup policy and contains only the information to be updated. -func (vpc *VpcV1) UpdateBackupPolicy(updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateBackupPolicyWithContext(context.Background(), updateBackupPolicyOptions) -} - -// UpdateBackupPolicyWithContext is an alternate form of the UpdateBackupPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateBackupPolicyWithContext(ctx context.Context, updateBackupPolicyOptions *UpdateBackupPolicyOptions) (result BackupPolicyIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBackupPolicyOptions, "updateBackupPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBackupPolicyOptions, "updateBackupPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateBackupPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBackupPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBackupPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateBackupPolicyOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateBackupPolicyOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBackupPolicyOptions.BackupPolicyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateBackupPolicyPlan : Update a backup policy plan -// This request updates a backup policy plan with the information in a provided plan patch. The plan patch object is -// structured in the same way as a retrieved backup policy plan and can contains only the information to be updated. -func (vpc *VpcV1) UpdateBackupPolicyPlan(updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - return vpc.UpdateBackupPolicyPlanWithContext(context.Background(), updateBackupPolicyPlanOptions) -} - -// UpdateBackupPolicyPlanWithContext is an alternate form of the UpdateBackupPolicyPlan method which supports a Context parameter -func (vpc *VpcV1) UpdateBackupPolicyPlanWithContext(ctx context.Context, updateBackupPolicyPlanOptions *UpdateBackupPolicyPlanOptions) (result *BackupPolicyPlan, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBackupPolicyPlanOptions, "updateBackupPolicyPlanOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "backup_policy_id": *updateBackupPolicyPlanOptions.BackupPolicyID, - "id": *updateBackupPolicyPlanOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/backup_policies/{backup_policy_id}/plans/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBackupPolicyPlanOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBackupPolicyPlan") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateBackupPolicyPlanOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateBackupPolicyPlanOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBackupPolicyPlanOptions.BackupPolicyPlanPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreatePlacementGroup : Create a placement group -// This request creates a new placement group. -func (vpc *VpcV1) CreatePlacementGroup(createPlacementGroupOptions *CreatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - return vpc.CreatePlacementGroupWithContext(context.Background(), createPlacementGroupOptions) -} - -// CreatePlacementGroupWithContext is an alternate form of the CreatePlacementGroup method which supports a Context parameter -func (vpc *VpcV1) CreatePlacementGroupWithContext(ctx context.Context, createPlacementGroupOptions *CreatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createPlacementGroupOptions, "createPlacementGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createPlacementGroupOptions, "createPlacementGroupOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createPlacementGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePlacementGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createPlacementGroupOptions.Strategy != nil { - body["strategy"] = createPlacementGroupOptions.Strategy - } - if createPlacementGroupOptions.Name != nil { - body["name"] = createPlacementGroupOptions.Name - } - if createPlacementGroupOptions.ResourceGroup != nil { - body["resource_group"] = createPlacementGroupOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeletePlacementGroup : Delete a placement group -// This request deletes a placement group. This operation cannot be reversed. For this request to succeed, the placement -// group must not be associated with an instance. -func (vpc *VpcV1) DeletePlacementGroup(deletePlacementGroupOptions *DeletePlacementGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeletePlacementGroupWithContext(context.Background(), deletePlacementGroupOptions) -} - -// DeletePlacementGroupWithContext is an alternate form of the DeletePlacementGroup method which supports a Context parameter -func (vpc *VpcV1) DeletePlacementGroupWithContext(ctx context.Context, deletePlacementGroupOptions *DeletePlacementGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deletePlacementGroupOptions, "deletePlacementGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deletePlacementGroupOptions, "deletePlacementGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deletePlacementGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deletePlacementGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePlacementGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetPlacementGroup : Retrieve a placement group -// This request retrieves a single placement group specified by identifier in the URL. -func (vpc *VpcV1) GetPlacementGroup(getPlacementGroupOptions *GetPlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - return vpc.GetPlacementGroupWithContext(context.Background(), getPlacementGroupOptions) -} - -// GetPlacementGroupWithContext is an alternate form of the GetPlacementGroup method which supports a Context parameter -func (vpc *VpcV1) GetPlacementGroupWithContext(ctx context.Context, getPlacementGroupOptions *GetPlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getPlacementGroupOptions, "getPlacementGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getPlacementGroupOptions, "getPlacementGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getPlacementGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getPlacementGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPlacementGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListPlacementGroups : List all placement groups -// This request lists all placement groups in the region. -func (vpc *VpcV1) ListPlacementGroups(listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListPlacementGroupsWithContext(context.Background(), listPlacementGroupsOptions) -} - -// ListPlacementGroupsWithContext is an alternate form of the ListPlacementGroups method which supports a Context parameter -func (vpc *VpcV1) ListPlacementGroupsWithContext(ctx context.Context, listPlacementGroupsOptions *ListPlacementGroupsOptions) (result *PlacementGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listPlacementGroupsOptions, "listPlacementGroupsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listPlacementGroupsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPlacementGroups") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listPlacementGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listPlacementGroupsOptions.Start)) - } - if listPlacementGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listPlacementGroupsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroupCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdatePlacementGroup : Update a placement group -// This request updates a placement group with the information provided placement group patch. The placement group patch -// object is structured in the same way as a retrieved placement group and contains only the information to be updated. -func (vpc *VpcV1) UpdatePlacementGroup(updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - return vpc.UpdatePlacementGroupWithContext(context.Background(), updatePlacementGroupOptions) -} - -// UpdatePlacementGroupWithContext is an alternate form of the UpdatePlacementGroup method which supports a Context parameter -func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePlacementGroupOptions *UpdatePlacementGroupOptions) (result *PlacementGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updatePlacementGroupOptions, "updatePlacementGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updatePlacementGroupOptions, "updatePlacementGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updatePlacementGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/placement_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updatePlacementGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePlacementGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updatePlacementGroupOptions.PlacementGroupPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPlacementGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddBareMetalServerNetworkInterfaceFloatingIP : Associate a floating IP with a bare metal server network interface -// This request associates the specified floating IP with the specified bare metal server network interface. If -// `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If `enable_infrastructure_nat` -// is `true`, this replaces any existing association. -// -// The existing floating IP must: -// - not be required by another resource, such as a public gateway -// - be in the same `zone` as the bare metal server -// -// A request body is not required, and if provided, is ignored. -func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), addBareMetalServerNetworkInterfaceFloatingIPOptions) -} - -// AddBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the AddBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddBareMetalServerNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBareMetalServer : Create a bare metal server -// This request provisions a new bare metal server from a prototype object. The prototype object is structured in the -// same way as a retrieved bare metal server, and contains the information necessary to provision the new bare metal -// server. The bare metal server is automatically started. -func (vpc *VpcV1) CreateBareMetalServer(createBareMetalServerOptions *CreateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - return vpc.CreateBareMetalServerWithContext(context.Background(), createBareMetalServerOptions) -} - -// CreateBareMetalServerWithContext is an alternate form of the CreateBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) CreateBareMetalServerWithContext(ctx context.Context, createBareMetalServerOptions *CreateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBareMetalServerOptions, "createBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBareMetalServerOptions, "createBareMetalServerOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createBareMetalServerOptions.BareMetalServerPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBareMetalServerConsoleAccessToken : Create a console access token for a bare metal server -// This request creates a new single-use console access token for a bare metal server. All console configuration is -// provided at token create time, and the token is subsequently used in the `access_token` query parameter for the -// WebSocket request. The access token is only valid for a short period of time, and a maximum of one token is valid -// for a given bare metal server at a time. -func (vpc *VpcV1) CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions) (result *BareMetalServerConsoleAccessToken, response *core.DetailedResponse, err error) { - return vpc.CreateBareMetalServerConsoleAccessTokenWithContext(context.Background(), createBareMetalServerConsoleAccessTokenOptions) -} - -// CreateBareMetalServerConsoleAccessTokenWithContext is an alternate form of the CreateBareMetalServerConsoleAccessToken method which supports a Context parameter -func (vpc *VpcV1) CreateBareMetalServerConsoleAccessTokenWithContext(ctx context.Context, createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions) (result *BareMetalServerConsoleAccessToken, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBareMetalServerConsoleAccessTokenOptions, "createBareMetalServerConsoleAccessTokenOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBareMetalServerConsoleAccessTokenOptions, "createBareMetalServerConsoleAccessTokenOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *createBareMetalServerConsoleAccessTokenOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/console_access_token`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createBareMetalServerConsoleAccessTokenOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerConsoleAccessToken") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createBareMetalServerConsoleAccessTokenOptions.ConsoleType != nil { - body["console_type"] = createBareMetalServerConsoleAccessTokenOptions.ConsoleType - } - if createBareMetalServerConsoleAccessTokenOptions.Force != nil { - body["force"] = createBareMetalServerConsoleAccessTokenOptions.Force - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerConsoleAccessToken) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBareMetalServerNetworkAttachment : Create a network attachment on a bare metal server -// This request creates a new bare metal server network attachment from a bare metal server network attachment prototype -// object. The prototype object is structured in the same way as a retrieved bare metal server network attachment, and -// contains the information necessary to create the new bare metal server network attachment. -func (vpc *VpcV1) CreateBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - return vpc.CreateBareMetalServerNetworkAttachmentWithContext(context.Background(), createBareMetalServerNetworkAttachmentOptions) -} - -// CreateBareMetalServerNetworkAttachmentWithContext is an alternate form of the CreateBareMetalServerNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) CreateBareMetalServerNetworkAttachmentWithContext(ctx context.Context, createBareMetalServerNetworkAttachmentOptions *CreateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBareMetalServerNetworkAttachmentOptions, "createBareMetalServerNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBareMetalServerNetworkAttachmentOptions, "createBareMetalServerNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *createBareMetalServerNetworkAttachmentOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createBareMetalServerNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkAttachmentOptions.BareMetalServerNetworkAttachmentPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateBareMetalServerNetworkInterface : Create a network interface on a bare metal server -// This request creates a new bare metal server network interface from a bare metal server network interface prototype -// object. The prototype object is structured in the same way as a retrieved bare metal server network interface, and -// contains the information necessary to create the new bare metal server network interface. Any subnet in the bare -// metal server's VPC may be specified, even if it is already attached to another bare metal server network interface. -// Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. -// -// If this bare metal server has network attachments, each network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. -func (vpc *VpcV1) CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.CreateBareMetalServerNetworkInterfaceWithContext(context.Background(), createBareMetalServerNetworkInterfaceOptions) -} - -// CreateBareMetalServerNetworkInterfaceWithContext is an alternate form of the CreateBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *createBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createBareMetalServerNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteBareMetalServer : Delete a bare metal server -// This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the -// bare metal server network interfaces are implicitly disassociated. -func (vpc *VpcV1) DeleteBareMetalServer(deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteBareMetalServerWithContext(context.Background(), deleteBareMetalServerOptions) -} - -// DeleteBareMetalServerWithContext is an alternate form of the DeleteBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) DeleteBareMetalServerWithContext(ctx context.Context, deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBareMetalServerOptions, "deleteBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteBareMetalServerOptions, "deleteBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteBareMetalServerNetworkAttachment : Delete a bare metal server network attachment -// This request deletes a bare metal server network attachment. This operation cannot be reversed. Any floating IPs -// associated with the bare metal server network attachment are implicitly disassociated. -// -// The bare metal server's primary network attachment cannot be deleted. -func (vpc *VpcV1) DeleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptions *DeleteBareMetalServerNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteBareMetalServerNetworkAttachmentWithContext(context.Background(), deleteBareMetalServerNetworkAttachmentOptions) -} - -// DeleteBareMetalServerNetworkAttachmentWithContext is an alternate form of the DeleteBareMetalServerNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) DeleteBareMetalServerNetworkAttachmentWithContext(ctx context.Context, deleteBareMetalServerNetworkAttachmentOptions *DeleteBareMetalServerNetworkAttachmentOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBareMetalServerNetworkAttachmentOptions, "deleteBareMetalServerNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteBareMetalServerNetworkAttachmentOptions, "deleteBareMetalServerNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *deleteBareMetalServerNetworkAttachmentOptions.BareMetalServerID, - "id": *deleteBareMetalServerNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteBareMetalServerNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServerNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteBareMetalServerNetworkInterface : Delete a bare metal server network interface -// This request deletes a bare metal server network interface. This operation cannot be reversed. Any floating IPs -// associated with the bare metal server network interface are implicitly disassociated. The primary bare metal server -// network interface is not allowed to be deleted. -// -// If this bare metal server has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and is not allowed to be deleted. -func (vpc *VpcV1) DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteBareMetalServerNetworkInterfaceWithContext(context.Background(), deleteBareMetalServerNetworkInterfaceOptions) -} - -// DeleteBareMetalServerNetworkInterfaceWithContext is an alternate form of the DeleteBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) DeleteBareMetalServerNetworkInterfaceWithContext(ctx context.Context, deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteBareMetalServerNetworkInterfaceOptions, "deleteBareMetalServerNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteBareMetalServerNetworkInterfaceOptions, "deleteBareMetalServerNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *deleteBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - "id": *deleteBareMetalServerNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteBareMetalServerNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServerNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetBareMetalServer : Retrieve a bare metal server -// This request retrieves a single bare metal server specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerWithContext(context.Background(), getBareMetalServerOptions) -} - -// GetBareMetalServerWithContext is an alternate form of the GetBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerOptions, "getBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerOptions, "getBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerDisk : Retrieve a bare metal server disk -// This request retrieves a single disk specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerDiskWithContext(context.Background(), getBareMetalServerDiskOptions) -} - -// GetBareMetalServerDiskWithContext is an alternate form of the GetBareMetalServerDisk method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerDiskOptions.BareMetalServerID, - "id": *getBareMetalServerDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerInitialization : Retrieve initialization configuration for a bare metal server -// This request retrieves configuration used to initialize the bare metal server, such as the image used, SSH keys, and -// any configured usernames and passwords. These can subsequently be changed on the server and therefore may not be -// current. -func (vpc *VpcV1) GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerInitializationWithContext(context.Background(), getBareMetalServerInitializationOptions) -} - -// GetBareMetalServerInitializationWithContext is an alternate form of the GetBareMetalServerInitialization method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Context, getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getBareMetalServerInitializationOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/initialization`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerInitializationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerInitialization") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerInitialization) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerNetworkAttachment : Retrieve a bare metal server network attachment -// This request retrieves a single bare metal server network attachment specified by the identifier in the URL. -func (vpc *VpcV1) GetBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkAttachmentWithContext(context.Background(), getBareMetalServerNetworkAttachmentOptions) -} - -// GetBareMetalServerNetworkAttachmentWithContext is an alternate form of the GetBareMetalServerNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkAttachmentWithContext(ctx context.Context, getBareMetalServerNetworkAttachmentOptions *GetBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkAttachmentOptions, "getBareMetalServerNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerNetworkAttachmentOptions, "getBareMetalServerNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkAttachmentOptions.BareMetalServerID, - "id": *getBareMetalServerNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerNetworkInterface : Retrieve a bare metal server network interface -// This request retrieves a single bare metal server network interface specified by the identifier in the URL. -// -// If this bare metal server has network attachments, the retrieved network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface. -func (vpc *VpcV1) GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceWithContext(context.Background(), getBareMetalServerNetworkInterfaceOptions) -} - -// GetBareMetalServerNetworkInterfaceWithContext is an alternate form of the GetBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - "id": *getBareMetalServerNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerNetworkInterfaceFloatingIP : Retrieve associated floating IP -// This request retrieves a specified floating IP if it is associated with the bare metal server network interface -// specified in the URL. -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceFloatingIPOptions) -} - -// GetBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerNetworkInterfaceIP : Retrieve the primary reserved IP -// This request retrieves the primary reserved IP for a bare metal server network interface. -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIP(getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerNetworkInterfaceIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceIPOptions) -} - -// GetBareMetalServerNetworkInterfaceIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceIPOptions *GetBareMetalServerNetworkInterfaceIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerNetworkInterfaceIPOptions, "getBareMetalServerNetworkInterfaceIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *getBareMetalServerNetworkInterfaceIPOptions.BareMetalServerID, - "network_interface_id": *getBareMetalServerNetworkInterfaceIPOptions.NetworkInterfaceID, - "id": *getBareMetalServerNetworkInterfaceIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerNetworkInterfaceIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetBareMetalServerProfile : Retrieve a bare metal server profile -// This request retrieves a single bare metal server profile specified by the name in the URL. -func (vpc *VpcV1) GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { - return vpc.GetBareMetalServerProfileWithContext(context.Background(), getBareMetalServerProfileOptions) -} - -// GetBareMetalServerProfileWithContext is an alternate form of the GetBareMetalServerProfile method which supports a Context parameter -func (vpc *VpcV1) GetBareMetalServerProfileWithContext(ctx context.Context, getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getBareMetalServerProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getBareMetalServerProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerDisks : List all disks on a bare metal server -// This request lists all disks on a bare metal server. A disk is a block device that is locally attached to the -// physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest disk -// first. -func (vpc *VpcV1) ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerDisksWithContext(context.Background(), listBareMetalServerDisksOptions) -} - -// ListBareMetalServerDisksWithContext is an alternate form of the ListBareMetalServerDisks method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerDisksWithContext(ctx context.Context, listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerDisksOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerDisksOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerDisks") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDiskCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerNetworkAttachments : List all network attachments on a bare metal server -// This request lists all network attachments on a bare metal server. A bare metal server network attachment is an -// abstract representation of a network device and attaches a bare metal server to a single subnet. Each network -// interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached to -// the bare metal server. -// -// The network attachments will be sorted by their `created_at` property values, with newest network attachments first. -// Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` property -// values. -func (vpc *VpcV1) ListBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions) (result *BareMetalServerNetworkAttachmentCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkAttachmentsWithContext(context.Background(), listBareMetalServerNetworkAttachmentsOptions) -} - -// ListBareMetalServerNetworkAttachmentsWithContext is an alternate form of the ListBareMetalServerNetworkAttachments method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkAttachmentsWithContext(ctx context.Context, listBareMetalServerNetworkAttachmentsOptions *ListBareMetalServerNetworkAttachmentsOptions) (result *BareMetalServerNetworkAttachmentCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkAttachmentsOptions, "listBareMetalServerNetworkAttachmentsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBareMetalServerNetworkAttachmentsOptions, "listBareMetalServerNetworkAttachmentsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkAttachmentsOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerNetworkAttachmentsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkAttachments") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServerNetworkAttachmentsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkAttachmentsOptions.Start)) - } - if listBareMetalServerNetworkAttachmentsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkAttachmentsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachmentCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerNetworkInterfaceFloatingIps : List all floating IPs associated with a bare metal server network interface -// This request lists all floating IPs associated with a bare metal server network interface. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceFloatingIpsOptions) -} - -// ListBareMetalServerNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.BareMetalServerID, - "network_interface_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerNetworkInterfaceFloatingIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceFloatingIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerNetworkInterfaceIps : List the primary reserved IP for a bare metal server network interface -// This request lists the primary reserved IP for a bare metal server network interface. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfaceIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceIpsOptions) -} - -// ListBareMetalServerNetworkInterfaceIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceIps method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceIpsOptions *ListBareMetalServerNetworkInterfaceIpsOptions) (result *ReservedIPCollectionBareMetalServerNetworkInterfaceContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBareMetalServerNetworkInterfaceIpsOptions, "listBareMetalServerNetworkInterfaceIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfaceIpsOptions.BareMetalServerID, - "network_interface_id": *listBareMetalServerNetworkInterfaceIpsOptions.NetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerNetworkInterfaceIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerNetworkInterfaces : List all network interfaces on a bare metal server -// This request lists all network interfaces on a bare metal server. A bare metal server network interface is an -// abstract representation of a network device and attaches a bare metal server to a single subnet. Each network -// interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached to -// the bare metal server. -// -// If this bare metal server has network attachments, each returned network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface. -func (vpc *VpcV1) ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerNetworkInterfacesWithContext(context.Background(), listBareMetalServerNetworkInterfacesOptions) -} - -// ListBareMetalServerNetworkInterfacesWithContext is an alternate form of the ListBareMetalServerNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerNetworkInterfacesWithContext(ctx context.Context, listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *listBareMetalServerNetworkInterfacesOptions.BareMetalServerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerNetworkInterfacesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaces") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServerNetworkInterfacesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Start)) - } - if listBareMetalServerNetworkInterfacesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterfaceCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServerProfiles : List all bare metal server profiles -// This request lists all [bare metal server -// profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare metal -// server profile specifies the performance characteristics and pricing model for a bare metal server. -func (vpc *VpcV1) ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServerProfilesWithContext(context.Background(), listBareMetalServerProfilesOptions) -} - -// ListBareMetalServerProfilesWithContext is an alternate form of the ListBareMetalServerProfiles method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBareMetalServerProfilesOptions, "listBareMetalServerProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServerProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServerProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServerProfilesOptions.Start)) - } - if listBareMetalServerProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerProfilesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListBareMetalServers : List all bare metal servers -// This request lists all bare metal servers in the region. -func (vpc *VpcV1) ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { - return vpc.ListBareMetalServersWithContext(context.Background(), listBareMetalServersOptions) -} - -// ListBareMetalServersWithContext is an alternate form of the ListBareMetalServers method which supports a Context parameter -func (vpc *VpcV1) ListBareMetalServersWithContext(ctx context.Context, listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listBareMetalServersOptions, "listBareMetalServersOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listBareMetalServersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listBareMetalServersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listBareMetalServersOptions.Start)) - } - if listBareMetalServersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listBareMetalServersOptions.Limit)) - } - if listBareMetalServersOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listBareMetalServersOptions.ResourceGroupID)) - } - if listBareMetalServersOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listBareMetalServersOptions.Name)) - } - if listBareMetalServersOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listBareMetalServersOptions.VPCID)) - } - if listBareMetalServersOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listBareMetalServersOptions.VPCCRN)) - } - if listBareMetalServersOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listBareMetalServersOptions.VPCName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// RemoveBareMetalServerNetworkInterfaceFloatingIP : Disassociate a floating IP from a bare metal server network interface -// This request disassociates the specified floating IP from the specified bare metal server network interface. -func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), removeBareMetalServerNetworkInterfaceFloatingIPOptions) -} - -// RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, - "network_interface_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, - "id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveBareMetalServerNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// RestartBareMetalServer : Restart a bare metal server -// This request restarts a bare metal server. It will run immediately regardless of the state of the server. -func (vpc *VpcV1) RestartBareMetalServer(restartBareMetalServerOptions *RestartBareMetalServerOptions) (response *core.DetailedResponse, err error) { - return vpc.RestartBareMetalServerWithContext(context.Background(), restartBareMetalServerOptions) -} - -// RestartBareMetalServerWithContext is an alternate form of the RestartBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) RestartBareMetalServerWithContext(ctx context.Context, restartBareMetalServerOptions *RestartBareMetalServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(restartBareMetalServerOptions, "restartBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(restartBareMetalServerOptions, "restartBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *restartBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/restart`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range restartBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RestartBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// StartBareMetalServer : Start a bare metal server -// This request starts a bare metal server. It will run immediately provided the server is stopped. -func (vpc *VpcV1) StartBareMetalServer(startBareMetalServerOptions *StartBareMetalServerOptions) (response *core.DetailedResponse, err error) { - return vpc.StartBareMetalServerWithContext(context.Background(), startBareMetalServerOptions) -} - -// StartBareMetalServerWithContext is an alternate form of the StartBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) StartBareMetalServerWithContext(ctx context.Context, startBareMetalServerOptions *StartBareMetalServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(startBareMetalServerOptions, "startBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(startBareMetalServerOptions, "startBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *startBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/start`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range startBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "StartBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// StopBareMetalServer : Stop a bare metal server -// This request stops a bare metal server. It will run immediately provided the server is running. Note: A soft stop may -// not complete as it relies on the operating system to perform the operation. -func (vpc *VpcV1) StopBareMetalServer(stopBareMetalServerOptions *StopBareMetalServerOptions) (response *core.DetailedResponse, err error) { - return vpc.StopBareMetalServerWithContext(context.Background(), stopBareMetalServerOptions) -} - -// StopBareMetalServerWithContext is an alternate form of the StopBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) StopBareMetalServerWithContext(ctx context.Context, stopBareMetalServerOptions *StopBareMetalServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(stopBareMetalServerOptions, "stopBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(stopBareMetalServerOptions, "stopBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *stopBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/stop`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range stopBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "StopBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if stopBareMetalServerOptions.Type != nil { - body["type"] = stopBareMetalServerOptions.Type - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateBareMetalServer : Update a bare metal server -// This request updates a bare metal server with the information in a provided patch. The bare metal server patch object -// is structured in the same way as a retrieved bare metal server and contains only the information to be updated. -func (vpc *VpcV1) UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerWithContext(context.Background(), updateBareMetalServerOptions) -} - -// UpdateBareMetalServerWithContext is an alternate form of the UpdateBareMetalServer method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerOptions, "updateBareMetalServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBareMetalServerOptions, "updateBareMetalServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateBareMetalServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBareMetalServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBareMetalServerOptions.BareMetalServerPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateBareMetalServerDisk : Update a bare metal server disk -// This request updates the bare metal server disk with the information in a provided patch. -func (vpc *VpcV1) UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerDiskWithContext(context.Background(), updateBareMetalServerDiskOptions) -} - -// UpdateBareMetalServerDiskWithContext is an alternate form of the UpdateBareMetalServerDisk method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *updateBareMetalServerDiskOptions.BareMetalServerID, - "id": *updateBareMetalServerDiskOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBareMetalServerDiskOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerDisk") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBareMetalServerDiskOptions.BareMetalServerDiskPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateBareMetalServerNetworkAttachment : Update a bare metal server network attachment -// This request updates a bare metal server network attachment with the information provided in a bare metal server -// network attachment patch object. The bare metal server network attachment patch object is structured in the same way -// as a retrieved bare metal server network attachment and contains only the information to be updated. -func (vpc *VpcV1) UpdateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerNetworkAttachmentWithContext(context.Background(), updateBareMetalServerNetworkAttachmentOptions) -} - -// UpdateBareMetalServerNetworkAttachmentWithContext is an alternate form of the UpdateBareMetalServerNetworkAttachment method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerNetworkAttachmentWithContext(ctx context.Context, updateBareMetalServerNetworkAttachmentOptions *UpdateBareMetalServerNetworkAttachmentOptions) (result BareMetalServerNetworkAttachmentIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerNetworkAttachmentOptions, "updateBareMetalServerNetworkAttachmentOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBareMetalServerNetworkAttachmentOptions, "updateBareMetalServerNetworkAttachmentOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *updateBareMetalServerNetworkAttachmentOptions.BareMetalServerID, - "id": *updateBareMetalServerNetworkAttachmentOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBareMetalServerNetworkAttachmentOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkAttachment") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkAttachmentOptions.BareMetalServerNetworkAttachmentPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkAttachment) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateBareMetalServerNetworkInterface : Update a bare metal server network interface -// This request updates a bare metal server network interface with the information provided in a bare metal server -// network interface patch object. The bare metal server network interface patch object is structured in the same way as -// a retrieved bare metal server network interface and needs to contain only the information to be updated. -// -// If this bare metal server has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and is not allowed to be updated. -func (vpc *VpcV1) UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateBareMetalServerNetworkInterfaceWithContext(context.Background(), updateBareMetalServerNetworkInterfaceOptions) -} - -// UpdateBareMetalServerNetworkInterfaceWithContext is an alternate form of the UpdateBareMetalServerNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "bare_metal_server_id": *updateBareMetalServerNetworkInterfaceOptions.BareMetalServerID, - "id": *updateBareMetalServerNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateBareMetalServerNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVolume : Create a volume -// This request creates a new volume from a volume prototype object. The prototype object is structured in the same way -// as a retrieved volume, and contains the information necessary to create the new volume. -func (vpc *VpcV1) CreateVolume(createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.CreateVolumeWithContext(context.Background(), createVolumeOptions) -} - -// CreateVolumeWithContext is an alternate form of the CreateVolume method which supports a Context parameter -func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVolumeOptions, "createVolumeOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVolumeOptions, "createVolumeOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createVolumeOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVolume") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createVolumeOptions.VolumePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteVolume : Delete a volume -// This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not be -// attached to any instances. -func (vpc *VpcV1) DeleteVolume(deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVolumeWithContext(context.Background(), deleteVolumeOptions) -} - -// DeleteVolumeWithContext is an alternate form of the DeleteVolume method which supports a Context parameter -func (vpc *VpcV1) DeleteVolumeWithContext(ctx context.Context, deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVolumeOptions, "deleteVolumeOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVolumeOptions, "deleteVolumeOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteVolumeOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVolumeOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVolume") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteVolumeOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVolumeOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetVolume : Retrieve a volume -// This request retrieves a single volume specified by the identifier in the URL. -func (vpc *VpcV1) GetVolume(getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.GetVolumeWithContext(context.Background(), getVolumeOptions) -} - -// GetVolumeWithContext is an alternate form of the GetVolume method which supports a Context parameter -func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVolumeOptions, "getVolumeOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVolumeOptions, "getVolumeOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVolumeOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVolumeOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolume") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVolumeProfile : Retrieve a volume profile -// This request retrieves a single volume profile specified by the name in the URL. -func (vpc *VpcV1) GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - return vpc.GetVolumeProfileWithContext(context.Background(), getVolumeProfileOptions) -} - -// GetVolumeProfileWithContext is an alternate form of the GetVolumeProfile method which supports a Context parameter -func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVolumeProfileOptions, "getVolumeProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVolumeProfileOptions, "getVolumeProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getVolumeProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVolumeProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVolumeProfiles : List all volume profiles -// This request lists all [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available -// in the region. A volume profile specifies the performance characteristics and pricing model for a volume. -func (vpc *VpcV1) ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumeProfilesWithContext(context.Background(), listVolumeProfilesOptions) -} - -// ListVolumeProfilesWithContext is an alternate form of the ListVolumeProfiles method which supports a Context parameter -func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumeProfilesOptions, "listVolumeProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVolumeProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumeProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumeProfilesOptions.Start)) - } - if listVolumeProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumeProfilesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVolumes : List all volumes -// This request lists all volumes in the region. Volumes are network-connected block storage devices that may be -// attached to one or more instances in the same region. -func (vpc *VpcV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumesWithContext(context.Background(), listVolumesOptions) -} - -// ListVolumesWithContext is an alternate form of the ListVolumes method which supports a Context parameter -func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumesOptions, "listVolumesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVolumesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumes") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumesOptions.Start)) - } - if listVolumesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumesOptions.Limit)) - } - if listVolumesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVolumesOptions.Name)) - } - if listVolumesOptions.AttachmentState != nil { - builder.AddQuery("attachment_state", fmt.Sprint(*listVolumesOptions.AttachmentState)) - } - if listVolumesOptions.Encryption != nil { - builder.AddQuery("encryption", fmt.Sprint(*listVolumesOptions.Encryption)) - } - if listVolumesOptions.OperatingSystemFamily != nil { - builder.AddQuery("operating_system.family", fmt.Sprint(*listVolumesOptions.OperatingSystemFamily)) - } - if listVolumesOptions.OperatingSystemArchitecture != nil { - builder.AddQuery("operating_system.architecture", fmt.Sprint(*listVolumesOptions.OperatingSystemArchitecture)) - } - if listVolumesOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listVolumesOptions.ZoneName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVolume : Update a volume -// This request updates a volume with the information in a provided volume patch. The volume patch object is structured -// in the same way as a retrieved volume and contains only the information to be updated. -func (vpc *VpcV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.UpdateVolumeWithContext(context.Background(), updateVolumeOptions) -} - -// UpdateVolumeWithContext is an alternate form of the UpdateVolume method which supports a Context parameter -func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVolumeOptions, "updateVolumeOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVolumeOptions, "updateVolumeOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateVolumeOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVolumeOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolume") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVolumeOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVolumeOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVolumeOptions.VolumePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSnapshot : Create a snapshot -// This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same -// way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. -func (vpc *VpcV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotWithContext(context.Background(), createSnapshotOptions) -} - -// CreateSnapshotWithContext is an alternate form of the CreateSnapshot method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotOptions, "createSnapshotOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSnapshotOptions, "createSnapshotOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createSnapshotOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshot") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createSnapshotOptions.SnapshotPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSnapshotClone : Create a clone for a snapshot -// This request creates a new clone for a snapshot in the specified zone. A request body is not required, and if -// provided, is ignored. If the snapshot already has a clone in the zone, it is returned. -func (vpc *VpcV1) CreateSnapshotClone(createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotCloneWithContext(context.Background(), createSnapshotCloneOptions) -} - -// CreateSnapshotCloneWithContext is an alternate form of the CreateSnapshotClone method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotCloneWithContext(ctx context.Context, createSnapshotCloneOptions *CreateSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotCloneOptions, "createSnapshotCloneOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSnapshotCloneOptions, "createSnapshotCloneOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *createSnapshotCloneOptions.ID, - "zone_name": *createSnapshotCloneOptions.ZoneName, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createSnapshotCloneOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshotClone") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSnapshotConsistencyGroup : Create a snapshot consistency group -// This request creates a new snapshot consistency group from a snapshot consistency group object. The prototype object -// is structured in the same way as a retrieved consistency group, and contains the information necessary to provision -// the new snapshot consistency group. -func (vpc *VpcV1) CreateSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotConsistencyGroupWithContext(context.Background(), createSnapshotConsistencyGroupOptions) -} - -// CreateSnapshotConsistencyGroupWithContext is an alternate form of the CreateSnapshotConsistencyGroup method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotConsistencyGroupWithContext(ctx context.Context, createSnapshotConsistencyGroupOptions *CreateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotConsistencyGroupOptions, "createSnapshotConsistencyGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSnapshotConsistencyGroupOptions, "createSnapshotConsistencyGroupOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createSnapshotConsistencyGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshotConsistencyGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createSnapshotConsistencyGroupOptions.SnapshotConsistencyGroupPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteSnapshot : Delete a snapshot -// This request deletes a snapshot. This operation cannot be reversed. -func (vpc *VpcV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotWithContext(context.Background(), deleteSnapshotOptions) -} - -// DeleteSnapshotWithContext is an alternate form of the DeleteSnapshot method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotOptions, "deleteSnapshotOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSnapshotOptions, "deleteSnapshotOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteSnapshotOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSnapshotOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshot") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteSnapshotOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteSnapshotOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteSnapshotClone : Delete a snapshot clone -// This request deletes a snapshot clone. This operation cannot be reversed, but an equivalent clone may be recreated -// from the snapshot. -func (vpc *VpcV1) DeleteSnapshotClone(deleteSnapshotCloneOptions *DeleteSnapshotCloneOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotCloneWithContext(context.Background(), deleteSnapshotCloneOptions) -} - -// DeleteSnapshotCloneWithContext is an alternate form of the DeleteSnapshotClone method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotCloneWithContext(ctx context.Context, deleteSnapshotCloneOptions *DeleteSnapshotCloneOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotCloneOptions, "deleteSnapshotCloneOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSnapshotCloneOptions, "deleteSnapshotCloneOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteSnapshotCloneOptions.ID, - "zone_name": *deleteSnapshotCloneOptions.ZoneName, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSnapshotCloneOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshotClone") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteSnapshotConsistencyGroup : Delete a snapshot consistency group -// This request deletes snapshot consistency group. This operation cannot be reversed. If the -// `delete_snapshots_on_delete` property is `true`, all snapshots in the consistency group will also be deleted. -func (vpc *VpcV1) DeleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotConsistencyGroupWithContext(context.Background(), deleteSnapshotConsistencyGroupOptions) -} - -// DeleteSnapshotConsistencyGroupWithContext is an alternate form of the DeleteSnapshotConsistencyGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotConsistencyGroupWithContext(ctx context.Context, deleteSnapshotConsistencyGroupOptions *DeleteSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotConsistencyGroupOptions, "deleteSnapshotConsistencyGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSnapshotConsistencyGroupOptions, "deleteSnapshotConsistencyGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteSnapshotConsistencyGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSnapshotConsistencyGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshotConsistencyGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteSnapshots : Delete a filtered collection of snapshots -// This request deletes all snapshots created from a specific source volume. -func (vpc *VpcV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotsWithContext(context.Background(), deleteSnapshotsOptions) -} - -// DeleteSnapshotsWithContext is an alternate form of the DeleteSnapshots method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotsOptions, "deleteSnapshotsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSnapshotsOptions, "deleteSnapshotsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) - if err != nil { - return - } - - for headerName, headerValue := range deleteSnapshotsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshots") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - builder.AddQuery("source_volume.id", fmt.Sprint(*deleteSnapshotsOptions.SourceVolumeID)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetSnapshot : Retrieve a snapshot -// This request retrieves a single snapshot specified by the identifier in the URL. -func (vpc *VpcV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotWithContext(context.Background(), getSnapshotOptions) -} - -// GetSnapshotWithContext is an alternate form of the GetSnapshot method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotOptions, "getSnapshotOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSnapshotOptions, "getSnapshotOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSnapshotOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSnapshotOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshot") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSnapshotClone : Retrieve a snapshot clone -// This request retrieves a single clone specified by the snapshot identifier and zone name in the URL. -func (vpc *VpcV1) GetSnapshotClone(getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotCloneWithContext(context.Background(), getSnapshotCloneOptions) -} - -// GetSnapshotCloneWithContext is an alternate form of the GetSnapshotClone method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotCloneWithContext(ctx context.Context, getSnapshotCloneOptions *GetSnapshotCloneOptions) (result *SnapshotClone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotCloneOptions, "getSnapshotCloneOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSnapshotCloneOptions, "getSnapshotCloneOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSnapshotCloneOptions.ID, - "zone_name": *getSnapshotCloneOptions.ZoneName, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones/{zone_name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSnapshotCloneOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshotClone") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotClone) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSnapshotConsistencyGroup : Retrieve a snapshot consistency group -// This request retrieves a single snapshot consistency group specified by the identifier in the URL. -func (vpc *VpcV1) GetSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotConsistencyGroupWithContext(context.Background(), getSnapshotConsistencyGroupOptions) -} - -// GetSnapshotConsistencyGroupWithContext is an alternate form of the GetSnapshotConsistencyGroup method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotConsistencyGroupWithContext(ctx context.Context, getSnapshotConsistencyGroupOptions *GetSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotConsistencyGroupOptions, "getSnapshotConsistencyGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSnapshotConsistencyGroupOptions, "getSnapshotConsistencyGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSnapshotConsistencyGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSnapshotConsistencyGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshotConsistencyGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSnapshotClones : List all clones for a snapshot -// This request lists all clones for a snapshot. Use a clone to quickly restore a snapshot within the clone's zone. -func (vpc *VpcV1) ListSnapshotClones(listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotClonesWithContext(context.Background(), listSnapshotClonesOptions) -} - -// ListSnapshotClonesWithContext is an alternate form of the ListSnapshotClones method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotClonesWithContext(ctx context.Context, listSnapshotClonesOptions *ListSnapshotClonesOptions) (result *SnapshotCloneCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSnapshotClonesOptions, "listSnapshotClonesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSnapshotClonesOptions, "listSnapshotClonesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *listSnapshotClonesOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}/clones`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listSnapshotClonesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshotClones") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCloneCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSnapshotConsistencyGroups : List all snapshot consistency groups -// This request lists all snapshot consistency groups in the region. A snapshot consistency group is a collection of -// individual snapshots taken at the same time. -func (vpc *VpcV1) ListSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions) (result *SnapshotConsistencyGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotConsistencyGroupsWithContext(context.Background(), listSnapshotConsistencyGroupsOptions) -} - -// ListSnapshotConsistencyGroupsWithContext is an alternate form of the ListSnapshotConsistencyGroups method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotConsistencyGroupsWithContext(ctx context.Context, listSnapshotConsistencyGroupsOptions *ListSnapshotConsistencyGroupsOptions) (result *SnapshotConsistencyGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSnapshotConsistencyGroupsOptions, "listSnapshotConsistencyGroupsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listSnapshotConsistencyGroupsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshotConsistencyGroups") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSnapshotConsistencyGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Start)) - } - if listSnapshotConsistencyGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Limit)) - } - if listSnapshotConsistencyGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.ResourceGroupID)) - } - if listSnapshotConsistencyGroupsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Name)) - } - if listSnapshotConsistencyGroupsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.Sort)) - } - if listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID != nil { - builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroupCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSnapshots : List all snapshots -// This request lists all snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is -// created. -func (vpc *VpcV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotsWithContext(context.Background(), listSnapshotsOptions) -} - -// ListSnapshotsWithContext is an alternate form of the ListSnapshots method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSnapshotsOptions, "listSnapshotsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listSnapshotsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshots") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSnapshotsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSnapshotsOptions.Start)) - } - if listSnapshotsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSnapshotsOptions.Limit)) - } - if listSnapshotsOptions.Tag != nil { - builder.AddQuery("tag", fmt.Sprint(*listSnapshotsOptions.Tag)) - } - if listSnapshotsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotsOptions.ResourceGroupID)) - } - if listSnapshotsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSnapshotsOptions.Name)) - } - if listSnapshotsOptions.SourceVolumeID != nil { - builder.AddQuery("source_volume.id", fmt.Sprint(*listSnapshotsOptions.SourceVolumeID)) - } - if listSnapshotsOptions.SourceVolumeCRN != nil { - builder.AddQuery("source_volume.crn", fmt.Sprint(*listSnapshotsOptions.SourceVolumeCRN)) - } - if listSnapshotsOptions.SourceImageID != nil { - builder.AddQuery("source_image.id", fmt.Sprint(*listSnapshotsOptions.SourceImageID)) - } - if listSnapshotsOptions.SourceImageCRN != nil { - builder.AddQuery("source_image.crn", fmt.Sprint(*listSnapshotsOptions.SourceImageCRN)) - } - if listSnapshotsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSnapshotsOptions.Sort)) - } - if listSnapshotsOptions.BackupPolicyPlanID != nil { - builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotsOptions.BackupPolicyPlanID)) - } - if listSnapshotsOptions.CopiesID != nil { - builder.AddQuery("copies[].id", fmt.Sprint(*listSnapshotsOptions.CopiesID)) - } - if listSnapshotsOptions.CopiesName != nil { - builder.AddQuery("copies[].name", fmt.Sprint(*listSnapshotsOptions.CopiesName)) - } - if listSnapshotsOptions.CopiesCRN != nil { - builder.AddQuery("copies[].crn", fmt.Sprint(*listSnapshotsOptions.CopiesCRN)) - } - if listSnapshotsOptions.CopiesRemoteRegionName != nil { - builder.AddQuery("copies[].remote.region.name", fmt.Sprint(*listSnapshotsOptions.CopiesRemoteRegionName)) - } - if listSnapshotsOptions.SourceSnapshotID != nil { - builder.AddQuery("source_snapshot.id", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotID)) - } - if listSnapshotsOptions.SourceSnapshotRemoteRegionName != nil { - builder.AddQuery("source_snapshot.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceSnapshotRemoteRegionName)) - } - if listSnapshotsOptions.SourceVolumeRemoteRegionName != nil { - builder.AddQuery("source_volume.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceVolumeRemoteRegionName)) - } - if listSnapshotsOptions.SourceImageRemoteRegionName != nil { - builder.AddQuery("source_image.remote.region.name", fmt.Sprint(*listSnapshotsOptions.SourceImageRemoteRegionName)) - } - if listSnapshotsOptions.ClonesZoneName != nil { - builder.AddQuery("clones[].zone.name", fmt.Sprint(*listSnapshotsOptions.ClonesZoneName)) - } - if listSnapshotsOptions.SnapshotConsistencyGroupID != nil { - builder.AddQuery("snapshot_consistency_group.id", fmt.Sprint(*listSnapshotsOptions.SnapshotConsistencyGroupID)) - } - if listSnapshotsOptions.SnapshotConsistencyGroupCRN != nil { - builder.AddQuery("snapshot_consistency_group.crn", fmt.Sprint(*listSnapshotsOptions.SnapshotConsistencyGroupCRN)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateSnapshot : Update a snapshot -// This request updates a snapshot with the information in a provided snapshot patch. The snapshot consistency group -// patch object is structured in the same way as a retrieved snapshot and contains only the information to be updated. -func (vpc *VpcV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.UpdateSnapshotWithContext(context.Background(), updateSnapshotOptions) -} - -// UpdateSnapshotWithContext is an alternate form of the UpdateSnapshot method which supports a Context parameter -func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSnapshotOptions, "updateSnapshotOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSnapshotOptions, "updateSnapshotOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateSnapshotOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSnapshotOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshot") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateSnapshotOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateSnapshotOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSnapshotOptions.SnapshotPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateSnapshotConsistencyGroup : Update a snapshot consistency group -// This request updates a snapshot consistency group with the information in a provided snapshot consistency group -// patch. The snapshot consistency group patch object is structured in the same way as a retrieved snapshot consistency -// group and contains only the information to be updated. -func (vpc *VpcV1) UpdateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateSnapshotConsistencyGroupWithContext(context.Background(), updateSnapshotConsistencyGroupOptions) -} - -// UpdateSnapshotConsistencyGroupWithContext is an alternate form of the UpdateSnapshotConsistencyGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateSnapshotConsistencyGroupWithContext(ctx context.Context, updateSnapshotConsistencyGroupOptions *UpdateSnapshotConsistencyGroupOptions) (result *SnapshotConsistencyGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSnapshotConsistencyGroupOptions, "updateSnapshotConsistencyGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSnapshotConsistencyGroupOptions, "updateSnapshotConsistencyGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateSnapshotConsistencyGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshot_consistency_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSnapshotConsistencyGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshotConsistencyGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateSnapshotConsistencyGroupOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateSnapshotConsistencyGroupOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSnapshotConsistencyGroupOptions.SnapshotConsistencyGroupPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotConsistencyGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateShare : Create a file share -// This request provisions new file shares from a share prototype object. The new file shares can be a standalone share, -// a replica share, or both a source and replica share. -// -// The prototype object is structured in the same way as a retrieved share, and contains the information necessary to -// provision the new file shares. -func (vpc *VpcV1) CreateShare(createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.CreateShareWithContext(context.Background(), createShareOptions) -} - -// CreateShareWithContext is an alternate form of the CreateShare method which supports a Context parameter -func (vpc *VpcV1) CreateShareWithContext(ctx context.Context, createShareOptions *CreateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createShareOptions, "createShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createShareOptions, "createShareOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createShareOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateShare") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createShareOptions.SharePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateShareMountTarget : Create a mount target for a file share -// This request creates a new share mount target from a share mount target prototype object. -// -// The prototype object is structured in the same way as a retrieved share mount target, and contains the information -// necessary to provision the new file share mount target. -func (vpc *VpcV1) CreateShareMountTarget(createShareMountTargetOptions *CreateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.CreateShareMountTargetWithContext(context.Background(), createShareMountTargetOptions) -} - -// CreateShareMountTargetWithContext is an alternate form of the CreateShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) CreateShareMountTargetWithContext(ctx context.Context, createShareMountTargetOptions *CreateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createShareMountTargetOptions, "createShareMountTargetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createShareMountTargetOptions, "createShareMountTargetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *createShareMountTargetOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createShareMountTargetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateShareMountTarget") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createShareMountTargetOptions.ShareMountTargetPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteShare : Delete a file share -// This request deletes a share. This operation cannot be reversed. A share cannot be deleted if it: -// - has share mount targets -// - has a `lifecycle_state` of `updating` -// - has a replication operation in progress -// -// If the request is accepted, the share `lifecycle_state` will be set to `deleting`. Once deletion processing -// completes, it will no longer be retrievable. -func (vpc *VpcV1) DeleteShare(deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.DeleteShareWithContext(context.Background(), deleteShareOptions) -} - -// DeleteShareWithContext is an alternate form of the DeleteShare method which supports a Context parameter -func (vpc *VpcV1) DeleteShareWithContext(ctx context.Context, deleteShareOptions *DeleteShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareOptions, "deleteShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteShareOptions, "deleteShareOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteShareOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteShareOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShare") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - if deleteShareOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteShareOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteShareMountTarget : Delete a share mount target -// This request deletes a share mount target. This operation cannot be reversed. -// -// If the request is accepted, the share mount target `lifecycle_state` will be set to -// `deleting`. Once deletion processing completes, it will no longer be retrievable. -func (vpc *VpcV1) DeleteShareMountTarget(deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.DeleteShareMountTargetWithContext(context.Background(), deleteShareMountTargetOptions) -} - -// DeleteShareMountTargetWithContext is an alternate form of the DeleteShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) DeleteShareMountTargetWithContext(ctx context.Context, deleteShareMountTargetOptions *DeleteShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareMountTargetOptions, "deleteShareMountTargetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteShareMountTargetOptions, "deleteShareMountTargetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *deleteShareMountTargetOptions.ShareID, - "id": *deleteShareMountTargetOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteShareMountTargetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareMountTarget") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteShareSource : Split the source file share from a replica share -// This request removes the replication relationship between a source share and the replica share specified by the -// identifier in the URL. The replication relationship cannot be removed if a source share or the replica share has a -// `lifecycle_state` of `updating`, or has a replication operation in progress. -// -// This operation cannot be reversed. -func (vpc *VpcV1) DeleteShareSource(deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteShareSourceWithContext(context.Background(), deleteShareSourceOptions) -} - -// DeleteShareSourceWithContext is an alternate form of the DeleteShareSource method which supports a Context parameter -func (vpc *VpcV1) DeleteShareSourceWithContext(ctx context.Context, deleteShareSourceOptions *DeleteShareSourceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteShareSourceOptions, "deleteShareSourceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteShareSourceOptions, "deleteShareSourceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *deleteShareSourceOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteShareSourceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteShareSource") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// FailoverShare : Failover to replica file share -// This request triggers a failover to the replica file share specified by the identifier in the URL. The failover -// cannot be started if a source share or the replica share has a `lifecycle_state` of `updating`, or has a replication -// operation in progress. -// -// If `fallback_policy` is specified as `split`, and the request is accepted but the failover operation cannot be -// performed, a split will be triggered. -func (vpc *VpcV1) FailoverShare(failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { - return vpc.FailoverShareWithContext(context.Background(), failoverShareOptions) -} - -// FailoverShareWithContext is an alternate form of the FailoverShare method which supports a Context parameter -func (vpc *VpcV1) FailoverShareWithContext(ctx context.Context, failoverShareOptions *FailoverShareOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(failoverShareOptions, "failoverShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(failoverShareOptions, "failoverShareOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *failoverShareOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/failover`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range failoverShareOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "FailoverShare") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if failoverShareOptions.FallbackPolicy != nil { - body["fallback_policy"] = failoverShareOptions.FallbackPolicy - } - if failoverShareOptions.Timeout != nil { - body["timeout"] = failoverShareOptions.Timeout - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetShare : Retrieve a file share -// This request retrieves a single file share specified by the identifier in the URL. -func (vpc *VpcV1) GetShare(getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.GetShareWithContext(context.Background(), getShareOptions) -} - -// GetShareWithContext is an alternate form of the GetShare method which supports a Context parameter -func (vpc *VpcV1) GetShareWithContext(ctx context.Context, getShareOptions *GetShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareOptions, "getShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getShareOptions, "getShareOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getShareOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getShareOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShare") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetShareMountTarget : Retrieve a share mount target -// This request retrieves a single share mount target specified by the identifier in the URL. -func (vpc *VpcV1) GetShareMountTarget(getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.GetShareMountTargetWithContext(context.Background(), getShareMountTargetOptions) -} - -// GetShareMountTargetWithContext is an alternate form of the GetShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) GetShareMountTargetWithContext(ctx context.Context, getShareMountTargetOptions *GetShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareMountTargetOptions, "getShareMountTargetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getShareMountTargetOptions, "getShareMountTargetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *getShareMountTargetOptions.ShareID, - "id": *getShareMountTargetOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getShareMountTargetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareMountTarget") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetShareProfile : Retrieve a file share profile -// This request retrieves a single file share profile specified by the name in the URL. -func (vpc *VpcV1) GetShareProfile(getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { - return vpc.GetShareProfileWithContext(context.Background(), getShareProfileOptions) -} - -// GetShareProfileWithContext is an alternate form of the GetShareProfile method which supports a Context parameter -func (vpc *VpcV1) GetShareProfileWithContext(ctx context.Context, getShareProfileOptions *GetShareProfileOptions) (result *ShareProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareProfileOptions, "getShareProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getShareProfileOptions, "getShareProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getShareProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getShareProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetShareSource : Retrieve the source file share for a replica file share -// This request retrieves the source file share associated with the replica file share specified by the identifier in -// the URL. -func (vpc *VpcV1) GetShareSource(getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { - return vpc.GetShareSourceWithContext(context.Background(), getShareSourceOptions) -} - -// GetShareSourceWithContext is an alternate form of the GetShareSource method which supports a Context parameter -func (vpc *VpcV1) GetShareSourceWithContext(ctx context.Context, getShareSourceOptions *GetShareSourceOptions) (result *ShareReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getShareSourceOptions, "getShareSourceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getShareSourceOptions, "getShareSourceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *getShareSourceOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/source`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getShareSourceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetShareSource") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListShareMountTargets : List all mount targets for a file share -// This request retrieves all share mount targets for a file share. A share mount target is a network endpoint at which -// a file share may be mounted. The file share can be mounted by clients in the same VPC and zone after creating share -// mount targets. -// -// The share mount targets will be sorted by their `created_at` property values, with newest targets first. -func (vpc *VpcV1) ListShareMountTargets(listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { - return vpc.ListShareMountTargetsWithContext(context.Background(), listShareMountTargetsOptions) -} - -// ListShareMountTargetsWithContext is an alternate form of the ListShareMountTargets method which supports a Context parameter -func (vpc *VpcV1) ListShareMountTargetsWithContext(ctx context.Context, listShareMountTargetsOptions *ListShareMountTargetsOptions) (result *ShareMountTargetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listShareMountTargetsOptions, "listShareMountTargetsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listShareMountTargetsOptions, "listShareMountTargetsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *listShareMountTargetsOptions.ShareID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listShareMountTargetsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareMountTargets") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listShareMountTargetsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listShareMountTargetsOptions.Name)) - } - if listShareMountTargetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listShareMountTargetsOptions.Start)) - } - if listShareMountTargetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listShareMountTargetsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTargetCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListShareProfiles : List all file share profiles -// This request lists all [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) -// available in the region. A file share profile specifies the performance characteristics and pricing model for a file -// share. -func (vpc *VpcV1) ListShareProfiles(listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListShareProfilesWithContext(context.Background(), listShareProfilesOptions) -} - -// ListShareProfilesWithContext is an alternate form of the ListShareProfiles method which supports a Context parameter -func (vpc *VpcV1) ListShareProfilesWithContext(ctx context.Context, listShareProfilesOptions *ListShareProfilesOptions) (result *ShareProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listShareProfilesOptions, "listShareProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/share/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listShareProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShareProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listShareProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listShareProfilesOptions.Start)) - } - if listShareProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listShareProfilesOptions.Limit)) - } - if listShareProfilesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listShareProfilesOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListShares : List all file shares -// This request lists all file shares in the region. -func (vpc *VpcV1) ListShares(listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { - return vpc.ListSharesWithContext(context.Background(), listSharesOptions) -} - -// ListSharesWithContext is an alternate form of the ListShares method which supports a Context parameter -func (vpc *VpcV1) ListSharesWithContext(ctx context.Context, listSharesOptions *ListSharesOptions) (result *ShareCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSharesOptions, "listSharesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listSharesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListShares") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSharesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSharesOptions.Start)) - } - if listSharesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSharesOptions.Limit)) - } - if listSharesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSharesOptions.ResourceGroupID)) - } - if listSharesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSharesOptions.Name)) - } - if listSharesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSharesOptions.Sort)) - } - if listSharesOptions.ReplicationRole != nil { - builder.AddQuery("replication_role", fmt.Sprint(*listSharesOptions.ReplicationRole)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateShare : Update a file share -// This request updates a share with the information in a provided share patch. The share patch object is structured in -// the same way as a retrieved share and contains only the information to be updated. -func (vpc *VpcV1) UpdateShare(updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - return vpc.UpdateShareWithContext(context.Background(), updateShareOptions) -} - -// UpdateShareWithContext is an alternate form of the UpdateShare method which supports a Context parameter -func (vpc *VpcV1) UpdateShareWithContext(ctx context.Context, updateShareOptions *UpdateShareOptions) (result *Share, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateShareOptions, "updateShareOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateShareOptions, "updateShareOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateShareOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateShareOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShare") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateShareOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateShareOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateShareOptions.SharePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShare) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateShareMountTarget : Update a share mount target -// This request updates a share mount target with the information provided in a share mount target patch object. The -// share mount target patch object is structured in the same way as a retrieved share mount target and needs to contain -// only the information to be updated. -func (vpc *VpcV1) UpdateShareMountTarget(updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - return vpc.UpdateShareMountTargetWithContext(context.Background(), updateShareMountTargetOptions) -} - -// UpdateShareMountTargetWithContext is an alternate form of the UpdateShareMountTarget method which supports a Context parameter -func (vpc *VpcV1) UpdateShareMountTargetWithContext(ctx context.Context, updateShareMountTargetOptions *UpdateShareMountTargetOptions) (result *ShareMountTarget, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateShareMountTargetOptions, "updateShareMountTargetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateShareMountTargetOptions, "updateShareMountTargetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "share_id": *updateShareMountTargetOptions.ShareID, - "id": *updateShareMountTargetOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/shares/{share_id}/mount_targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateShareMountTargetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateShareMountTarget") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateShareMountTargetOptions.ShareMountTargetPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalShareMountTarget) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetRegion : Retrieve a region -// This request retrieves a single region specified by the name in the URL. -func (vpc *VpcV1) GetRegion(getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - return vpc.GetRegionWithContext(context.Background(), getRegionOptions) -} - -// GetRegionWithContext is an alternate form of the GetRegion method which supports a Context parameter -func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionOptions, "getRegionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getRegionOptions, "getRegionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getRegionOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getRegionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegion") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegion) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetRegionZone : Retrieve a zone -// This request retrieves a single zone specified by the region and zone names in the URL. -func (vpc *VpcV1) GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - return vpc.GetRegionZoneWithContext(context.Background(), getRegionZoneOptions) -} - -// GetRegionZoneWithContext is an alternate form of the GetRegionZone method which supports a Context parameter -func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionZoneOptions, "getRegionZoneOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getRegionZoneOptions, "getRegionZoneOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "region_name": *getRegionZoneOptions.RegionName, - "name": *getRegionZoneOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getRegionZoneOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegionZone") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZone) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListRegionZones : List all zones in a region -// This request lists all zones in a region. Zones represent logically-isolated data centers with high-bandwidth and -// low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. -func (vpc *VpcV1) ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionZonesWithContext(context.Background(), listRegionZonesOptions) -} - -// ListRegionZonesWithContext is an alternate form of the ListRegionZones method which supports a Context parameter -func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listRegionZonesOptions, "listRegionZonesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listRegionZonesOptions, "listRegionZonesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "region_name": *listRegionZonesOptions.RegionName, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listRegionZonesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegionZones") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZoneCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListRegions : List all regions -// This request lists all regions. Each region is a separate geographic area that contains multiple isolated zones. -// Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other zones -// in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault isolation -// available. Resources deployed within a single region also benefit from the low latency afforded by geographic -// proximity. -func (vpc *VpcV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionsWithContext(context.Background(), listRegionsOptions) -} - -// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter -func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listRegionsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegions") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddNetworkInterfaceFloatingIP : Add an association between a floating IP and a virtual network interface -// This request adds an association between the specified floating IP and the specified virtual network interface. -// -// If the virtual network interface has `enable_infrastructure_nat` set to `true`, no more than one floating IP can be -// associated, and network address translation is performed between the floating IP address and the virtual network -// interface's `primary_ip` address. -// -// If the virtual network interface has `enable_infrastructure_nat` set to `false`, packets are passed unchanged to/from -// the virtual network interface. -// -// The floating IP must: -// - be in the same `zone` as the virtual network interface -// - not currently be associated with another resource -// -// The virtual network interface's `target` must not currently be a file share mount target. -// -// A request body is not required, and if provided, is ignored. -func (vpc *VpcV1) AddNetworkInterfaceFloatingIP(addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { - return vpc.AddNetworkInterfaceFloatingIPWithContext(context.Background(), addNetworkInterfaceFloatingIPOptions) -} - -// AddNetworkInterfaceFloatingIPWithContext is an alternate form of the AddNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) AddNetworkInterfaceFloatingIPWithContext(ctx context.Context, addNetworkInterfaceFloatingIPOptions *AddNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addNetworkInterfaceFloatingIPOptions, "addNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addNetworkInterfaceFloatingIPOptions, "addNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *addNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, - "id": *addNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddVirtualNetworkInterfaceIP : Bind a reserved IP to a virtual network interface -// This request binds the specified reserved IP to the specified virtual network interface. -// -// The reserved IP must currently be unbound and in the primary IP's subnet. The virtual network interface's `target` -// must not currently be a file share mount target. -func (vpc *VpcV1) AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { - return vpc.AddVirtualNetworkInterfaceIPWithContext(context.Background(), addVirtualNetworkInterfaceIPOptions) -} - -// AddVirtualNetworkInterfaceIPWithContext is an alternate form of the AddVirtualNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) AddVirtualNetworkInterfaceIPWithContext(ctx context.Context, addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVirtualNetworkInterfaceIPOptions, "addVirtualNetworkInterfaceIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addVirtualNetworkInterfaceIPOptions, "addVirtualNetworkInterfaceIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *addVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, - "id": *addVirtualNetworkInterfaceIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addVirtualNetworkInterfaceIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVirtualNetworkInterfaceIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVirtualNetworkInterface : Create a virtual network interface -// This request creates a new virtual network interface from a virtual network interface prototype object. The prototype -// object is structured in the same way as a retrieved virtual network interface, and contains the information necessary -// to create the new virtual network interface. -func (vpc *VpcV1) CreateVirtualNetworkInterface(createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - return vpc.CreateVirtualNetworkInterfaceWithContext(context.Background(), createVirtualNetworkInterfaceOptions) -} - -// CreateVirtualNetworkInterfaceWithContext is an alternate form of the CreateVirtualNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) CreateVirtualNetworkInterfaceWithContext(ctx context.Context, createVirtualNetworkInterfaceOptions *CreateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVirtualNetworkInterfaceOptions, "createVirtualNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVirtualNetworkInterfaceOptions, "createVirtualNetworkInterfaceOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createVirtualNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVirtualNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVirtualNetworkInterfaceOptions.AllowIPSpoofing != nil { - body["allow_ip_spoofing"] = createVirtualNetworkInterfaceOptions.AllowIPSpoofing - } - if createVirtualNetworkInterfaceOptions.AutoDelete != nil { - body["auto_delete"] = createVirtualNetworkInterfaceOptions.AutoDelete - } - if createVirtualNetworkInterfaceOptions.EnableInfrastructureNat != nil { - body["enable_infrastructure_nat"] = createVirtualNetworkInterfaceOptions.EnableInfrastructureNat - } - if createVirtualNetworkInterfaceOptions.Ips != nil { - body["ips"] = createVirtualNetworkInterfaceOptions.Ips - } - if createVirtualNetworkInterfaceOptions.Name != nil { - body["name"] = createVirtualNetworkInterfaceOptions.Name - } - if createVirtualNetworkInterfaceOptions.PrimaryIP != nil { - body["primary_ip"] = createVirtualNetworkInterfaceOptions.PrimaryIP - } - if createVirtualNetworkInterfaceOptions.ResourceGroup != nil { - body["resource_group"] = createVirtualNetworkInterfaceOptions.ResourceGroup - } - if createVirtualNetworkInterfaceOptions.SecurityGroups != nil { - body["security_groups"] = createVirtualNetworkInterfaceOptions.SecurityGroups - } - if createVirtualNetworkInterfaceOptions.Subnet != nil { - body["subnet"] = createVirtualNetworkInterfaceOptions.Subnet - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteVirtualNetworkInterfaces : Delete a virtual network interface -// This request deletes a virtual network interface. This operation cannot be reversed. For this request to succeed, the -// virtual network interface must not be required by another resource, such as the primary network attachment for an -// instance. -func (vpc *VpcV1) DeleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVirtualNetworkInterfacesWithContext(context.Background(), deleteVirtualNetworkInterfacesOptions) -} - -// DeleteVirtualNetworkInterfacesWithContext is an alternate form of the DeleteVirtualNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) DeleteVirtualNetworkInterfacesWithContext(ctx context.Context, deleteVirtualNetworkInterfacesOptions *DeleteVirtualNetworkInterfacesOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVirtualNetworkInterfacesOptions, "deleteVirtualNetworkInterfacesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVirtualNetworkInterfacesOptions, "deleteVirtualNetworkInterfacesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteVirtualNetworkInterfacesOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVirtualNetworkInterfacesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVirtualNetworkInterfaces") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetNetworkInterfaceFloatingIP : Retrieve associated floating IP -// This request retrieves a specified floating IP if it is associated with the virtual network interface specified in -// the URL. -func (vpc *VpcV1) GetNetworkInterfaceFloatingIP(getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { - return vpc.GetNetworkInterfaceFloatingIPWithContext(context.Background(), getNetworkInterfaceFloatingIPOptions) -} - -// GetNetworkInterfaceFloatingIPWithContext is an alternate form of the GetNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetNetworkInterfaceFloatingIPWithContext(ctx context.Context, getNetworkInterfaceFloatingIPOptions *GetNetworkInterfaceFloatingIPOptions) (result *FloatingIPReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkInterfaceFloatingIPOptions, "getNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getNetworkInterfaceFloatingIPOptions, "getNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *getNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, - "id": *getNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVirtualNetworkInterface : Retrieve a virtual network interface -// This request retrieves a single virtual network interface specified by the identifier in the URL. -func (vpc *VpcV1) GetVirtualNetworkInterface(getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - return vpc.GetVirtualNetworkInterfaceWithContext(context.Background(), getVirtualNetworkInterfaceOptions) -} - -// GetVirtualNetworkInterfaceWithContext is an alternate form of the GetVirtualNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetVirtualNetworkInterfaceWithContext(ctx context.Context, getVirtualNetworkInterfaceOptions *GetVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVirtualNetworkInterfaceOptions, "getVirtualNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVirtualNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVirtualNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVirtualNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVirtualNetworkInterfaceIP : Retrieve bound reserved IP -// This request retrieves the specified reserved IP address if it is bound to the virtual network interface specified in -// the URL. -func (vpc *VpcV1) GetVirtualNetworkInterfaceIP(getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { - return vpc.GetVirtualNetworkInterfaceIPWithContext(context.Background(), getVirtualNetworkInterfaceIPOptions) -} - -// GetVirtualNetworkInterfaceIPWithContext is an alternate form of the GetVirtualNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) GetVirtualNetworkInterfaceIPWithContext(ctx context.Context, getVirtualNetworkInterfaceIPOptions *GetVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVirtualNetworkInterfaceIPOptions, "getVirtualNetworkInterfaceIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVirtualNetworkInterfaceIPOptions, "getVirtualNetworkInterfaceIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *getVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, - "id": *getVirtualNetworkInterfaceIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVirtualNetworkInterfaceIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVirtualNetworkInterfaceIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListNetworkInterfaceFloatingIps : List all floating IPs associated with a virtual network interface -// This request lists all floating IPs associated with a virtual network interface. -func (vpc *VpcV1) ListNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions) (result *FloatingIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { - return vpc.ListNetworkInterfaceFloatingIpsWithContext(context.Background(), listNetworkInterfaceFloatingIpsOptions) -} - -// ListNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListNetworkInterfaceFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listNetworkInterfaceFloatingIpsOptions *ListNetworkInterfaceFloatingIpsOptions) (result *FloatingIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listNetworkInterfaceFloatingIpsOptions, "listNetworkInterfaceFloatingIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listNetworkInterfaceFloatingIpsOptions, "listNetworkInterfaceFloatingIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *listNetworkInterfaceFloatingIpsOptions.VirtualNetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listNetworkInterfaceFloatingIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkInterfaceFloatingIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkInterfaceFloatingIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Start)) - } - if listNetworkInterfaceFloatingIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Limit)) - } - if listNetworkInterfaceFloatingIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listNetworkInterfaceFloatingIpsOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVirtualNetworkInterfaceIps : List all reserved IPs bound to a virtual network interface -// This request lists all reserved IPs bound to a virtual network interface. -func (vpc *VpcV1) ListVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions) (result *ReservedIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { - return vpc.ListVirtualNetworkInterfaceIpsWithContext(context.Background(), listVirtualNetworkInterfaceIpsOptions) -} - -// ListVirtualNetworkInterfaceIpsWithContext is an alternate form of the ListVirtualNetworkInterfaceIps method which supports a Context parameter -func (vpc *VpcV1) ListVirtualNetworkInterfaceIpsWithContext(ctx context.Context, listVirtualNetworkInterfaceIpsOptions *ListVirtualNetworkInterfaceIpsOptions) (result *ReservedIPCollectionVirtualNetworkInterfaceContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVirtualNetworkInterfaceIpsOptions, "listVirtualNetworkInterfaceIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVirtualNetworkInterfaceIpsOptions, "listVirtualNetworkInterfaceIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *listVirtualNetworkInterfaceIpsOptions.VirtualNetworkInterfaceID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVirtualNetworkInterfaceIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVirtualNetworkInterfaceIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVirtualNetworkInterfaceIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Start)) - } - if listVirtualNetworkInterfaceIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Limit)) - } - if listVirtualNetworkInterfaceIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVirtualNetworkInterfaceIpsOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVirtualNetworkInterfaces : List all virtual network interfaces -// This request lists all virtual network interfaces in the region. A virtual network interface is a logical abstraction -// of a virtual network interface in a subnet, and may be attached to a target resource. -// -// The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network -// interfaces first. Virtual network interfaces with identical -// `created_at` property values will in turn be sorted by ascending `name` property values. -func (vpc *VpcV1) ListVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - return vpc.ListVirtualNetworkInterfacesWithContext(context.Background(), listVirtualNetworkInterfacesOptions) -} - -// ListVirtualNetworkInterfacesWithContext is an alternate form of the ListVirtualNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListVirtualNetworkInterfacesWithContext(ctx context.Context, listVirtualNetworkInterfacesOptions *ListVirtualNetworkInterfacesOptions) (result *VirtualNetworkInterfaceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVirtualNetworkInterfacesOptions, "listVirtualNetworkInterfacesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVirtualNetworkInterfacesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVirtualNetworkInterfaces") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVirtualNetworkInterfacesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Start)) - } - if listVirtualNetworkInterfacesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVirtualNetworkInterfacesOptions.Limit)) - } - if listVirtualNetworkInterfacesOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVirtualNetworkInterfacesOptions.ResourceGroupID)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterfaceCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// RemoveNetworkInterfaceFloatingIP : Disassociate a floating IP from a virtual network interface -// This request disassociates the specified floating IP from the specified virtual network interface. -func (vpc *VpcV1) RemoveNetworkInterfaceFloatingIP(removeNetworkInterfaceFloatingIPOptions *RemoveNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveNetworkInterfaceFloatingIPWithContext(context.Background(), removeNetworkInterfaceFloatingIPOptions) -} - -// RemoveNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveNetworkInterfaceFloatingIP method which supports a Context parameter -func (vpc *VpcV1) RemoveNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeNetworkInterfaceFloatingIPOptions *RemoveNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeNetworkInterfaceFloatingIPOptions, "removeNetworkInterfaceFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeNetworkInterfaceFloatingIPOptions, "removeNetworkInterfaceFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *removeNetworkInterfaceFloatingIPOptions.VirtualNetworkInterfaceID, - "id": *removeNetworkInterfaceFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeNetworkInterfaceFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveNetworkInterfaceFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// RemoveVirtualNetworkInterfaceIP : Unbind a reserved IP from a virtual network interface -// This request unbinds the specified reserved IP from the specified virtual network interface. If the reserved IP has -// `auto_delete` set to `true`, the reserved IP will be deleted. -// -// The reserved IP for the `primary_ip` cannot be unbound. -func (vpc *VpcV1) RemoveVirtualNetworkInterfaceIP(removeVirtualNetworkInterfaceIPOptions *RemoveVirtualNetworkInterfaceIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVirtualNetworkInterfaceIPWithContext(context.Background(), removeVirtualNetworkInterfaceIPOptions) -} - -// RemoveVirtualNetworkInterfaceIPWithContext is an alternate form of the RemoveVirtualNetworkInterfaceIP method which supports a Context parameter -func (vpc *VpcV1) RemoveVirtualNetworkInterfaceIPWithContext(ctx context.Context, removeVirtualNetworkInterfaceIPOptions *RemoveVirtualNetworkInterfaceIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVirtualNetworkInterfaceIPOptions, "removeVirtualNetworkInterfaceIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeVirtualNetworkInterfaceIPOptions, "removeVirtualNetworkInterfaceIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "virtual_network_interface_id": *removeVirtualNetworkInterfaceIPOptions.VirtualNetworkInterfaceID, - "id": *removeVirtualNetworkInterfaceIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeVirtualNetworkInterfaceIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVirtualNetworkInterfaceIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateVirtualNetworkInterface : Update a virtual network interface -// This request updates a virtual network interface with the information in a provided virtual network interface patch. -// The virtual network interface patch object is structured in the same way as a retrieved virtual network interface and -// contains only the information to be updated. -func (vpc *VpcV1) UpdateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - return vpc.UpdateVirtualNetworkInterfaceWithContext(context.Background(), updateVirtualNetworkInterfaceOptions) -} - -// UpdateVirtualNetworkInterfaceWithContext is an alternate form of the UpdateVirtualNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, updateVirtualNetworkInterfaceOptions *UpdateVirtualNetworkInterfaceOptions) (result *VirtualNetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVirtualNetworkInterfaceOptions, "updateVirtualNetworkInterfaceOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateVirtualNetworkInterfaceOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/virtual_network_interfaces/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVirtualNetworkInterfaceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVirtualNetworkInterface") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVirtualNetworkInterfaceOptions.VirtualNetworkInterfacePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVirtualNetworkInterface) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreatePublicGateway : Create a public gateway -// This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must -// not already have a public gateway in the specified zone. -// -// If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound to -// the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway must -// be explicitly attached to each subnet it will provide connectivity for. -func (vpc *VpcV1) CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.CreatePublicGatewayWithContext(context.Background(), createPublicGatewayOptions) -} - -// CreatePublicGatewayWithContext is an alternate form of the CreatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createPublicGatewayOptions, "createPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createPublicGatewayOptions, "createPublicGatewayOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createPublicGatewayOptions.VPC != nil { - body["vpc"] = createPublicGatewayOptions.VPC - } - if createPublicGatewayOptions.Zone != nil { - body["zone"] = createPublicGatewayOptions.Zone - } - if createPublicGatewayOptions.FloatingIP != nil { - body["floating_ip"] = createPublicGatewayOptions.FloatingIP - } - if createPublicGatewayOptions.Name != nil { - body["name"] = createPublicGatewayOptions.Name - } - if createPublicGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createPublicGatewayOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeletePublicGateway : Delete a public gateway -// This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public -// gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the -// floating IP was created when the public gateway was created, it will be deleted. -func (vpc *VpcV1) DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeletePublicGatewayWithContext(context.Background(), deletePublicGatewayOptions) -} - -// DeletePublicGatewayWithContext is an alternate form of the DeletePublicGateway method which supports a Context parameter -func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deletePublicGatewayOptions, "deletePublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deletePublicGatewayOptions, "deletePublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deletePublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deletePublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetPublicGateway : Retrieve a public gateway -// This request retrieves a single public gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.GetPublicGatewayWithContext(context.Background(), getPublicGatewayOptions) -} - -// GetPublicGatewayWithContext is an alternate form of the GetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getPublicGatewayOptions, "getPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getPublicGatewayOptions, "getPublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListPublicGateways : List all public gateways -// This request lists all public gateways in the region. A public gateway is a virtual network device associated with a -// VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the -// same zone only. -func (vpc *VpcV1) ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListPublicGatewaysWithContext(context.Background(), listPublicGatewaysOptions) -} - -// ListPublicGatewaysWithContext is an alternate form of the ListPublicGateways method which supports a Context parameter -func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listPublicGatewaysOptions, "listPublicGatewaysOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listPublicGatewaysOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPublicGateways") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listPublicGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listPublicGatewaysOptions.Start)) - } - if listPublicGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listPublicGatewaysOptions.Limit)) - } - if listPublicGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listPublicGatewaysOptions.ResourceGroupID)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGatewayCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdatePublicGateway : Update a public gateway -// This request updates a public gateway's name. -func (vpc *VpcV1) UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.UpdatePublicGatewayWithContext(context.Background(), updatePublicGatewayOptions) -} - -// UpdatePublicGatewayWithContext is an alternate form of the UpdatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updatePublicGatewayOptions, "updatePublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updatePublicGatewayOptions, "updatePublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updatePublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updatePublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updatePublicGatewayOptions.PublicGatewayPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateFloatingIP : Reserve a floating IP -// This request reserves a new floating IP. -func (vpc *VpcV1) CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.CreateFloatingIPWithContext(context.Background(), createFloatingIPOptions) -} - -// CreateFloatingIPWithContext is an alternate form of the CreateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFloatingIPOptions, "createFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createFloatingIPOptions, "createFloatingIPOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createFloatingIPOptions.FloatingIPPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteFloatingIP : Delete a floating IP -// This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this -// request to succeed, the floating IP must not be required by another resource, such as a public gateway. -func (vpc *VpcV1) DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFloatingIPWithContext(context.Background(), deleteFloatingIPOptions) -} - -// DeleteFloatingIPWithContext is an alternate form of the DeleteFloatingIP method which supports a Context parameter -func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFloatingIPOptions, "deleteFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteFloatingIPOptions, "deleteFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetFloatingIP : Retrieve a floating IP -// This request retrieves a single floating IP specified by the identifier in the URL. -func (vpc *VpcV1) GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetFloatingIPWithContext(context.Background(), getFloatingIPOptions) -} - -// GetFloatingIPWithContext is an alternate form of the GetFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFloatingIPOptions, "getFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getFloatingIPOptions, "getFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListFloatingIps : List all floating IPs -// This request lists all floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet -// to an instance. -func (vpc *VpcV1) ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - return vpc.ListFloatingIpsWithContext(context.Background(), listFloatingIpsOptions) -} - -// ListFloatingIpsWithContext is an alternate form of the ListFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFloatingIpsOptions, "listFloatingIpsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listFloatingIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFloatingIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFloatingIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFloatingIpsOptions.Start)) - } - if listFloatingIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFloatingIpsOptions.Limit)) - } - if listFloatingIpsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFloatingIpsOptions.ResourceGroupID)) - } - if listFloatingIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listFloatingIpsOptions.Sort)) - } - if listFloatingIpsOptions.TargetID != nil { - builder.AddQuery("target.id", fmt.Sprint(*listFloatingIpsOptions.TargetID)) - } - if listFloatingIpsOptions.TargetCRN != nil { - builder.AddQuery("target.crn", fmt.Sprint(*listFloatingIpsOptions.TargetCRN)) - } - if listFloatingIpsOptions.TargetName != nil { - builder.AddQuery("target.name", fmt.Sprint(*listFloatingIpsOptions.TargetName)) - } - if listFloatingIpsOptions.TargetResourceType != nil { - builder.AddQuery("target.resource_type", fmt.Sprint(*listFloatingIpsOptions.TargetResourceType)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateFloatingIP : Update a floating IP -// This request updates a floating IP's name and/or target. -func (vpc *VpcV1) UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.UpdateFloatingIPWithContext(context.Background(), updateFloatingIPOptions) -} - -// UpdateFloatingIPWithContext is an alternate form of the UpdateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFloatingIPOptions, "updateFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateFloatingIPOptions, "updateFloatingIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateFloatingIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateFloatingIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFloatingIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateFloatingIPOptions.FloatingIPPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateNetworkACL : Create a network ACL -// This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is -// structured in the same way as a retrieved network ACL, and contains the information necessary to create the new -// network ACL. -func (vpc *VpcV1) CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLWithContext(context.Background(), createNetworkACLOptions) -} - -// CreateNetworkACLWithContext is an alternate form of the CreateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createNetworkACLOptions, "createNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createNetworkACLOptions, "createNetworkACLOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createNetworkACLOptions.NetworkACLPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateNetworkACLRule : Create a rule for a network ACL -// This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the -// same way as a retrieved rule, and contains the information necessary to create the new rule. -func (vpc *VpcV1) CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLRuleWithContext(context.Background(), createNetworkACLRuleOptions) -} - -// CreateNetworkACLRuleWithContext is an alternate form of the CreateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createNetworkACLRuleOptions, "createNetworkACLRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createNetworkACLRuleOptions, "createNetworkACLRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "network_acl_id": *createNetworkACLRuleOptions.NetworkACLID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createNetworkACLRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACLRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createNetworkACLRuleOptions.NetworkACLRulePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteNetworkACL : Delete a network ACL -// This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL -// must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. -func (vpc *VpcV1) DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLWithContext(context.Background(), deleteNetworkACLOptions) -} - -// DeleteNetworkACLWithContext is an alternate form of the DeleteNetworkACL method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLOptions, "deleteNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteNetworkACLOptions, "deleteNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteNetworkACLRule : Delete a network ACL rule -// This request deletes a rule. This operation cannot be reversed. -func (vpc *VpcV1) DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLRuleWithContext(context.Background(), deleteNetworkACLRuleOptions) -} - -// DeleteNetworkACLRuleWithContext is an alternate form of the DeleteNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "network_acl_id": *deleteNetworkACLRuleOptions.NetworkACLID, - "id": *deleteNetworkACLRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteNetworkACLRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACLRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetNetworkACL : Retrieve a network ACL -// This request retrieves a single network ACL specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLWithContext(context.Background(), getNetworkACLOptions) -} - -// GetNetworkACLWithContext is an alternate form of the GetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLOptions, "getNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getNetworkACLOptions, "getNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetNetworkACLRule : Retrieve a network ACL rule -// This request retrieves a single rule specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLRuleWithContext(context.Background(), getNetworkACLRuleOptions) -} - -// GetNetworkACLRuleWithContext is an alternate form of the GetNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLRuleOptions, "getNetworkACLRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getNetworkACLRuleOptions, "getNetworkACLRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "network_acl_id": *getNetworkACLRuleOptions.NetworkACLID, - "id": *getNetworkACLRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getNetworkACLRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACLRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListNetworkACLRules : List all rules for a network ACL -// This request lists all rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and -// a destination CIDR block over a particular protocol and port range. -func (vpc *VpcV1) ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkACLRulesWithContext(context.Background(), listNetworkACLRulesOptions) -} - -// ListNetworkACLRulesWithContext is an alternate form of the ListNetworkACLRules method which supports a Context parameter -func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listNetworkACLRulesOptions, "listNetworkACLRulesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listNetworkACLRulesOptions, "listNetworkACLRulesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "network_acl_id": *listNetworkACLRulesOptions.NetworkACLID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listNetworkACLRulesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkACLRules") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkACLRulesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkACLRulesOptions.Start)) - } - if listNetworkACLRulesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkACLRulesOptions.Limit)) - } - if listNetworkACLRulesOptions.Direction != nil { - builder.AddQuery("direction", fmt.Sprint(*listNetworkACLRulesOptions.Direction)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRuleCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListNetworkAcls : List all network ACLs -// This request lists all network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules -// for all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that -// reverse traffic in response to allowed traffic is not automatically permitted. -func (vpc *VpcV1) ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkAclsWithContext(context.Background(), listNetworkAclsOptions) -} - -// ListNetworkAclsWithContext is an alternate form of the ListNetworkAcls method which supports a Context parameter -func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listNetworkAclsOptions, "listNetworkAclsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listNetworkAclsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkAcls") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkAclsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkAclsOptions.Start)) - } - if listNetworkAclsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkAclsOptions.Limit)) - } - if listNetworkAclsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listNetworkAclsOptions.ResourceGroupID)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateNetworkACL : Update a network ACL -// This request updates a network ACL's name. -func (vpc *VpcV1) UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLWithContext(context.Background(), updateNetworkACLOptions) -} - -// UpdateNetworkACLWithContext is an alternate form of the UpdateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLOptions, "updateNetworkACLOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateNetworkACLOptions, "updateNetworkACLOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateNetworkACLOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateNetworkACLOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACL") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateNetworkACLOptions.NetworkACLPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateNetworkACLRule : Update a network ACL rule -// This request updates a rule with the information in a provided rule patch. The rule patch object contains only the -// information to be updated. The request will fail if the information is not applicable to the rule's protocol. -func (vpc *VpcV1) UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLRuleWithContext(context.Background(), updateNetworkACLRuleOptions) -} - -// UpdateNetworkACLRuleWithContext is an alternate form of the UpdateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "network_acl_id": *updateNetworkACLRuleOptions.NetworkACLID, - "id": *updateNetworkACLRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateNetworkACLRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACLRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateNetworkACLRuleOptions.NetworkACLRulePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSecurityGroup : Create a security group -// This request creates a new security group from a security group prototype object. The prototype object is structured -// in the same way as a retrieved security group, and contains the information necessary to create the new security -// group. If security group rules are included in the prototype object, those rules will be added to the security group. -// Each security group is scoped to one VPC. Only resources in that VPC can be added to the security group. -func (vpc *VpcV1) CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupWithContext(context.Background(), createSecurityGroupOptions) -} - -// CreateSecurityGroupWithContext is an alternate form of the CreateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupOptions, "createSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSecurityGroupOptions, "createSecurityGroupOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createSecurityGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createSecurityGroupOptions.VPC != nil { - body["vpc"] = createSecurityGroupOptions.VPC - } - if createSecurityGroupOptions.Name != nil { - body["name"] = createSecurityGroupOptions.Name - } - if createSecurityGroupOptions.ResourceGroup != nil { - body["resource_group"] = createSecurityGroupOptions.ResourceGroup - } - if createSecurityGroupOptions.Rules != nil { - body["rules"] = createSecurityGroupOptions.Rules - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSecurityGroupRule : Create a rule for a security group -// This request creates a new security group rule from a security group rule prototype object. The prototype object is -// structured in the same way as a retrieved security group rule and contains the information necessary to create the -// rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in the -// security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, such -// that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP traffic -// on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. -func (vpc *VpcV1) CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupRuleWithContext(context.Background(), createSecurityGroupRuleOptions) -} - -// CreateSecurityGroupRuleWithContext is an alternate form of the CreateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupRuleOptions.SecurityGroupID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createSecurityGroupRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createSecurityGroupRuleOptions.SecurityGroupRulePrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateSecurityGroupTargetBinding : Add a target to a security group -// This request adds a resource to an existing security group. The specified target identifier can be: -// -// - A bare metal server network interface identifier -// - A virtual network interface identifier -// - A VPN server identifier -// - A load balancer identifier -// - An endpoint gateway identifier -// - An instance network interface identifier -// -// When a target is added to a security group, the security group rules are applied to the target. A request body is not -// required, and if provided, is ignored. -func (vpc *VpcV1) CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupTargetBindingWithContext(context.Background(), createSecurityGroupTargetBindingOptions) -} - -// CreateSecurityGroupTargetBindingWithContext is an alternate form of the CreateSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Context, createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *createSecurityGroupTargetBindingOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createSecurityGroupTargetBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupTargetBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteSecurityGroup : Delete a security group -// This request deletes a security group. A security group cannot be deleted if it is referenced by any security group -// targets or rules. Additionally, a VPC's default security group cannot be deleted. This operation cannot be reversed. -func (vpc *VpcV1) DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupWithContext(context.Background(), deleteSecurityGroupOptions) -} - -// DeleteSecurityGroupWithContext is an alternate form of the DeleteSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupOptions, "deleteSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSecurityGroupOptions, "deleteSecurityGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSecurityGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteSecurityGroupRule : Delete a security group rule -// This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will -// not end existing connections allowed by that rule. -func (vpc *VpcV1) DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupRuleWithContext(context.Background(), deleteSecurityGroupRuleOptions) -} - -// DeleteSecurityGroupRuleWithContext is an alternate form of the DeleteSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupRuleOptions.SecurityGroupID, - "id": *deleteSecurityGroupRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSecurityGroupRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteSecurityGroupTargetBinding : Remove a target from a security group -// This request removes a target from a security group. For this request to succeed, the target must be attached to at -// least one other security group. The specified target identifier can be: -// -// - A bare metal server network interface identifier -// - A virtual network interface identifier -// - A VPN server identifier -// - A load balancer identifier -// - An endpoint gateway identifier -// - An instance network interface identifier -// -// Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing -// connections are not affected. -func (vpc *VpcV1) DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupTargetBindingWithContext(context.Background(), deleteSecurityGroupTargetBindingOptions) -} - -// DeleteSecurityGroupTargetBindingWithContext is an alternate form of the DeleteSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Context, deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *deleteSecurityGroupTargetBindingOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteSecurityGroupTargetBindingOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupTargetBinding") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetSecurityGroup : Retrieve a security group -// This request retrieves a single security group specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupWithContext(context.Background(), getSecurityGroupOptions) -} - -// GetSecurityGroupWithContext is an alternate form of the GetSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupOptions, "getSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSecurityGroupOptions, "getSecurityGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSecurityGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSecurityGroupRule : Retrieve a security group rule -// This request retrieves a single security group rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupRuleWithContext(context.Background(), getSecurityGroupRuleOptions) -} - -// GetSecurityGroupRuleWithContext is an alternate form of the GetSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupRuleOptions.SecurityGroupID, - "id": *getSecurityGroupRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSecurityGroupRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetSecurityGroupTarget : Retrieve a security group target -// This request retrieves a single target specified by the identifier in the URL path. The target must be an existing -// target of the security group. -func (vpc *VpcV1) GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupTargetWithContext(context.Background(), getSecurityGroupTargetOptions) -} - -// GetSecurityGroupTargetWithContext is an alternate form of the GetSecurityGroupTarget method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupTargetOptions.SecurityGroupID, - "id": *getSecurityGroupTargetOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSecurityGroupTargetOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupTarget") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSecurityGroupRules : List all rules in a security group -// This request lists all rules in a security group. These rules define what traffic the security group permits. -// Security group rules are stateful, such that reverse traffic in response to allowed traffic is automatically -// permitted. -func (vpc *VpcV1) ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupRulesWithContext(context.Background(), listSecurityGroupRulesOptions) -} - -// ListSecurityGroupRulesWithContext is an alternate form of the ListSecurityGroupRules method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupRulesOptions.SecurityGroupID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listSecurityGroupRulesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupRules") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRuleCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSecurityGroupTargets : List all targets associated with a security group -// This request lists all targets associated with a security group, to which the rules in the security group are -// applied. -func (vpc *VpcV1) ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupTargetsWithContext(context.Background(), listSecurityGroupTargetsOptions) -} - -// ListSecurityGroupTargetsWithContext is an alternate form of the ListSecurityGroupTargets method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupTargetsOptions.SecurityGroupID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listSecurityGroupTargetsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupTargets") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupTargetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupTargetsOptions.Start)) - } - if listSecurityGroupTargetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupTargetsOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListSecurityGroups : List all security groups -// This request lists all security groups in the region. Security groups provide a way to apply IP filtering rules to -// instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to security -// groups define which traffic the security group permits. Security group rules are stateful such that reverse traffic -// in response to allowed traffic is automatically permitted. -func (vpc *VpcV1) ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupsWithContext(context.Background(), listSecurityGroupsOptions) -} - -// ListSecurityGroupsWithContext is an alternate form of the ListSecurityGroups method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSecurityGroupsOptions, "listSecurityGroupsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listSecurityGroupsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroups") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupsOptions.Start)) - } - if listSecurityGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupsOptions.Limit)) - } - if listSecurityGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSecurityGroupsOptions.ResourceGroupID)) - } - if listSecurityGroupsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listSecurityGroupsOptions.VPCID)) - } - if listSecurityGroupsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listSecurityGroupsOptions.VPCCRN)) - } - if listSecurityGroupsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listSecurityGroupsOptions.VPCName)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateSecurityGroup : Update a security group -// This request updates a security group with the information provided in a security group patch object. The security -// group patch object is structured in the same way as a retrieved security group and contains only the information to -// be updated. -func (vpc *VpcV1) UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupWithContext(context.Background(), updateSecurityGroupOptions) -} - -// UpdateSecurityGroupWithContext is an alternate form of the UpdateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupOptions, "updateSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSecurityGroupOptions, "updateSecurityGroupOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSecurityGroupOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroup") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSecurityGroupOptions.SecurityGroupPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateSecurityGroupRule : Update a security group rule -// This request updates a security group rule with the information in a provided rule patch object. The rule patch -// object contains only the information to be updated. The request will fail if the information is not applicable to the -// rule's protocol. -func (vpc *VpcV1) UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupRuleWithContext(context.Background(), updateSecurityGroupRuleOptions) -} - -// UpdateSecurityGroupRuleWithContext is an alternate form of the UpdateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "security_group_id": *updateSecurityGroupRuleOptions.SecurityGroupID, - "id": *updateSecurityGroupRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateSecurityGroupRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroupRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSecurityGroupRuleOptions.SecurityGroupRulePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddVPNGatewayConnectionLocalCIDR : Set a local CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified -// CIDR already exists. A request body is not required, and if provided, is ignored. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDR(addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionLocalCIDRWithContext(context.Background(), addVPNGatewayConnectionLocalCIDROptions) -} - -// AddVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the AddVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addVPNGatewayConnectionLocalCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionLocalCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// AddVPNGatewayConnectionPeerCIDR : Set a peer CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the specified -// CIDR already exists. A request body is not required, and if provided, is ignored. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDR(addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionPeerCIDRWithContext(context.Background(), addVPNGatewayConnectionPeerCIDROptions) -} - -// AddVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the AddVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionPeerCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addVPNGatewayConnectionPeerCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionPeerCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// CheckVPNGatewayConnectionLocalCIDR : Check if the specified local CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDR(checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionLocalCIDRWithContext(context.Background(), checkVPNGatewayConnectionLocalCIDROptions) -} - -// CheckVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range checkVPNGatewayConnectionLocalCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionLocalCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// CheckVPNGatewayConnectionPeerCIDR : Check if the specified peer CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDR(checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionPeerCIDRWithContext(context.Background(), checkVPNGatewayConnectionPeerCIDROptions) -} - -// CheckVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionPeerCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range checkVPNGatewayConnectionPeerCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionPeerCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// CreateIkePolicy : Create an IKE policy -// This request creates a new IKE policy. -func (vpc *VpcV1) CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIkePolicyWithContext(context.Background(), createIkePolicyOptions) -} - -// CreateIkePolicyWithContext is an alternate form of the CreateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIkePolicyOptions, "createIkePolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createIkePolicyOptions, "createIkePolicyOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createIkePolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIkePolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createIkePolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm - } - if createIkePolicyOptions.DhGroup != nil { - body["dh_group"] = createIkePolicyOptions.DhGroup - } - if createIkePolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm - } - if createIkePolicyOptions.IkeVersion != nil { - body["ike_version"] = createIkePolicyOptions.IkeVersion - } - if createIkePolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIkePolicyOptions.KeyLifetime - } - if createIkePolicyOptions.Name != nil { - body["name"] = createIkePolicyOptions.Name - } - if createIkePolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIkePolicyOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateIpsecPolicy : Create an IPsec policy -// This request creates a new IPsec policy. -func (vpc *VpcV1) CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIpsecPolicyWithContext(context.Background(), createIpsecPolicyOptions) -} - -// CreateIpsecPolicyWithContext is an alternate form of the CreateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIpsecPolicyOptions, "createIpsecPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createIpsecPolicyOptions, "createIpsecPolicyOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createIpsecPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIpsecPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm - } - if createIpsecPolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm - } - if createIpsecPolicyOptions.Pfs != nil { - body["pfs"] = createIpsecPolicyOptions.Pfs - } - if createIpsecPolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime - } - if createIpsecPolicyOptions.Name != nil { - body["name"] = createIpsecPolicyOptions.Name - } - if createIpsecPolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIpsecPolicyOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPNGateway : Create a VPN gateway -// This request creates a new VPN gateway. -func (vpc *VpcV1) CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayWithContext(context.Background(), createVPNGatewayOptions) -} - -// CreateVPNGatewayWithContext is an alternate form of the CreateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayOptions, "createVPNGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPNGatewayOptions, "createVPNGatewayOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createVPNGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createVPNGatewayOptions.VPNGatewayPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPNGatewayConnection : Create a connection for a VPN gateway -// This request creates a new VPN gateway connection. -func (vpc *VpcV1) CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayConnectionWithContext(context.Background(), createVPNGatewayConnectionOptions) -} - -// CreateVPNGatewayConnectionWithContext is an alternate form of the CreateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *createVPNGatewayConnectionOptions.VPNGatewayID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPNGatewayConnectionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGatewayConnection") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(createVPNGatewayConnectionOptions.VPNGatewayConnectionPrototype) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteIkePolicy : Delete an IKE policy -// This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not be -// any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIkePolicyWithContext(context.Background(), deleteIkePolicyOptions) -} - -// DeleteIkePolicyWithContext is an alternate form of the DeleteIkePolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIkePolicyOptions, "deleteIkePolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteIkePolicyOptions, "deleteIkePolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteIkePolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteIkePolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIkePolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteIpsecPolicy : Delete an IPsec policy -// This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must not -// be any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIpsecPolicyWithContext(context.Background(), deleteIpsecPolicyOptions) -} - -// DeleteIpsecPolicyWithContext is an alternate form of the DeleteIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteIpsecPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteIpsecPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIpsecPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPNGateway : Delete a VPN gateway -// This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway -// must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as a -// next hop. -func (vpc *VpcV1) DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayWithContext(context.Background(), deleteVPNGatewayOptions) -} - -// DeleteVPNGatewayWithContext is an alternate form of the DeleteVPNGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayOptions, "deleteVPNGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNGatewayOptions, "deleteVPNGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteVPNGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPNGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPNGatewayConnection : Delete a VPN gateway connection -// This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, there -// must not be VPC routes using this VPN connection as a next hop. -func (vpc *VpcV1) DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayConnectionWithContext(context.Background(), deleteVPNGatewayConnectionOptions) -} - -// DeleteVPNGatewayConnectionWithContext is an alternate form of the DeleteVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *deleteVPNGatewayConnectionOptions.VPNGatewayID, - "id": *deleteVPNGatewayConnectionOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGatewayConnection") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetIkePolicy : Retrieve an IKE policy -// This request retrieves a single IKE policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.GetIkePolicyWithContext(context.Background(), getIkePolicyOptions) -} - -// GetIkePolicyWithContext is an alternate form of the GetIkePolicy method which supports a Context parameter -func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIkePolicyOptions, "getIkePolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getIkePolicyOptions, "getIkePolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getIkePolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getIkePolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIkePolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetIpsecPolicy : Retrieve an IPsec policy -// This request retrieves a single IPsec policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.GetIpsecPolicyWithContext(context.Background(), getIpsecPolicyOptions) -} - -// GetIpsecPolicyWithContext is an alternate form of the GetIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIpsecPolicyOptions, "getIpsecPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getIpsecPolicyOptions, "getIpsecPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getIpsecPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getIpsecPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIpsecPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPNGateway : Retrieve a VPN gateway -// This request retrieves a single VPN gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayWithContext(context.Background(), getVPNGatewayOptions) -} - -// GetVPNGatewayWithContext is an alternate form of the GetVPNGateway method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayOptions, "getVPNGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNGatewayOptions, "getVPNGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPNGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPNGatewayConnection : Retrieve a VPN gateway connection -// This request retrieves a single VPN gateway connection specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayConnectionWithContext(context.Background(), getVPNGatewayConnectionOptions) -} - -// GetVPNGatewayConnectionWithContext is an alternate form of the GetVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *getVPNGatewayConnectionOptions.VPNGatewayID, - "id": *getVPNGatewayConnectionOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNGatewayConnectionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayConnection") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListIkePolicies : List all IKE policies -// This request lists all IKE policies in the region. -func (vpc *VpcV1) ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePoliciesWithContext(context.Background(), listIkePoliciesOptions) -} - -// ListIkePoliciesWithContext is an alternate form of the ListIkePolicies method which supports a Context parameter -func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIkePoliciesOptions, "listIkePoliciesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listIkePoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIkePoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIkePoliciesOptions.Start)) - } - if listIkePoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIkePoliciesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListIkePolicyConnections : List all VPN gateway connections that use a specified IKE policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePolicyConnectionsWithContext(context.Background(), listIkePolicyConnectionsOptions) -} - -// ListIkePolicyConnectionsWithContext is an alternate form of the ListIkePolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *listIkePolicyConnectionsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}/connections`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listIkePolicyConnectionsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicyConnections") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListIpsecPolicies : List all IPsec policies -// This request lists all IPsec policies in the region. -func (vpc *VpcV1) ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPoliciesWithContext(context.Background(), listIpsecPoliciesOptions) -} - -// ListIpsecPoliciesWithContext is an alternate form of the ListIpsecPolicies method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIpsecPoliciesOptions, "listIpsecPoliciesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listIpsecPoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIpsecPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIpsecPoliciesOptions.Start)) - } - if listIpsecPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIpsecPoliciesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListIpsecPolicyConnections : List all VPN gateway connections that use a specified IPsec policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPolicyConnectionsWithContext(context.Background(), listIpsecPolicyConnectionsOptions) -} - -// ListIpsecPolicyConnectionsWithContext is an alternate form of the ListIpsecPolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *listIpsecPolicyConnectionsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}/connections`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listIpsecPolicyConnectionsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicyConnections") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNGatewayConnectionLocalCIDRs : List all local CIDRs for a VPN gateway connection -// This request lists all local CIDRs for a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRs(listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionLocalCIDRsWithContext(context.Background(), listVPNGatewayConnectionLocalCIDRsOptions) -} - -// ListVPNGatewayConnectionLocalCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionLocalCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionLocalCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionLocalCIDRsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPNGatewayConnectionLocalCIDRsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionLocalCIDRs") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionLocalCIDRs) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNGatewayConnectionPeerCIDRs : List all peer CIDRs for a VPN gateway connection -// This request lists all peer CIDRs for a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRs(listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionPeerCIDRsWithContext(context.Background(), listVPNGatewayConnectionPeerCIDRsOptions) -} - -// ListVPNGatewayConnectionPeerCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionPeerCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionPeerCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionPeerCIDRsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPNGatewayConnectionPeerCIDRsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionPeerCIDRs") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionPeerCIDRs) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNGatewayConnections : List all connections of a VPN gateway -// This request lists all connections of a VPN gateway. -func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionsWithContext(context.Background(), listVPNGatewayConnectionsOptions) -} - -// ListVPNGatewayConnectionsWithContext is an alternate form of the ListVPNGatewayConnections method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionsOptions.VPNGatewayID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPNGatewayConnectionsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnections") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewayConnectionsOptions.Status != nil { - builder.AddQuery("status", fmt.Sprint(*listVPNGatewayConnectionsOptions.Status)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNGateways : List all VPN gateways -// This request lists all VPN gateways in the region. -func (vpc *VpcV1) ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewaysWithContext(context.Background(), listVPNGatewaysOptions) -} - -// ListVPNGatewaysWithContext is an alternate form of the ListVPNGateways method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVPNGatewaysOptions, "listVPNGatewaysOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVPNGatewaysOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGateways") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNGatewaysOptions.Start)) - } - if listVPNGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNGatewaysOptions.Limit)) - } - if listVPNGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNGatewaysOptions.ResourceGroupID)) - } - if listVPNGatewaysOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNGatewaysOptions.Sort)) - } - if listVPNGatewaysOptions.Mode != nil { - builder.AddQuery("mode", fmt.Sprint(*listVPNGatewaysOptions.Mode)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// RemoveVPNGatewayConnectionLocalCIDR : Remove a local CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDR(removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionLocalCIDRWithContext(context.Background(), removeVPNGatewayConnectionLocalCIDROptions) -} - -// RemoveVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeVPNGatewayConnectionLocalCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionLocalCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// RemoveVPNGatewayConnectionPeerCIDR : Remove a peer CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -// -// This request is only supported for policy mode VPN gateways. -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDR(removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionPeerCIDRWithContext(context.Background(), removeVPNGatewayConnectionPeerCIDROptions) -} - -// RemoveVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionPeerCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeVPNGatewayConnectionPeerCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionPeerCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateIkePolicy : Update an IKE policy -// This request updates the properties of an existing IKE policy. -func (vpc *VpcV1) UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIkePolicyWithContext(context.Background(), updateIkePolicyOptions) -} - -// UpdateIkePolicyWithContext is an alternate form of the UpdateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIkePolicyOptions, "updateIkePolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateIkePolicyOptions, "updateIkePolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateIkePolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateIkePolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIkePolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateIkePolicyOptions.IkePolicyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateIpsecPolicy : Update an IPsec policy -// This request updates the properties of an existing IPsec policy. -func (vpc *VpcV1) UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIpsecPolicyWithContext(context.Background(), updateIpsecPolicyOptions) -} - -// UpdateIpsecPolicyWithContext is an alternate form of the UpdateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIpsecPolicyOptions, "updateIpsecPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateIpsecPolicyOptions, "updateIpsecPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateIpsecPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateIpsecPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIpsecPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateIpsecPolicyOptions.IPsecPolicyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPNGateway : Update a VPN gateway -// This request updates the properties of an existing VPN gateway. -func (vpc *VpcV1) UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayWithContext(context.Background(), updateVPNGatewayOptions) -} - -// UpdateVPNGatewayWithContext is an alternate form of the UpdateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayOptions, "updateVPNGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPNGatewayOptions, "updateVPNGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateVPNGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPNGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPNGatewayOptions.VPNGatewayPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPNGatewayConnection : Update a VPN gateway connection -// This request updates the properties of an existing VPN gateway connection. -func (vpc *VpcV1) UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayConnectionWithContext(context.Background(), updateVPNGatewayConnectionOptions) -} - -// UpdateVPNGatewayConnectionWithContext is an alternate form of the UpdateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *updateVPNGatewayConnectionOptions.VPNGatewayID, - "id": *updateVPNGatewayConnectionOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPNGatewayConnectionOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGatewayConnection") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPNGatewayConnectionOptions.VPNGatewayConnectionPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPNServer : Create a VPN server -// This request creates a new VPN server. -func (vpc *VpcV1) CreateVPNServer(createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.CreateVPNServerWithContext(context.Background(), createVPNServerOptions) -} - -// CreateVPNServerWithContext is an alternate form of the CreateVPNServer method which supports a Context parameter -func (vpc *VpcV1) CreateVPNServerWithContext(ctx context.Context, createVPNServerOptions *CreateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNServerOptions, "createVPNServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPNServerOptions, "createVPNServerOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createVPNServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPNServerOptions.Certificate != nil { - body["certificate"] = createVPNServerOptions.Certificate - } - if createVPNServerOptions.ClientAuthentication != nil { - body["client_authentication"] = createVPNServerOptions.ClientAuthentication - } - if createVPNServerOptions.ClientIPPool != nil { - body["client_ip_pool"] = createVPNServerOptions.ClientIPPool - } - if createVPNServerOptions.Subnets != nil { - body["subnets"] = createVPNServerOptions.Subnets - } - if createVPNServerOptions.ClientDnsServerIps != nil { - body["client_dns_server_ips"] = createVPNServerOptions.ClientDnsServerIps - } - if createVPNServerOptions.ClientIdleTimeout != nil { - body["client_idle_timeout"] = createVPNServerOptions.ClientIdleTimeout - } - if createVPNServerOptions.EnableSplitTunneling != nil { - body["enable_split_tunneling"] = createVPNServerOptions.EnableSplitTunneling - } - if createVPNServerOptions.Name != nil { - body["name"] = createVPNServerOptions.Name - } - if createVPNServerOptions.Port != nil { - body["port"] = createVPNServerOptions.Port - } - if createVPNServerOptions.Protocol != nil { - body["protocol"] = createVPNServerOptions.Protocol - } - if createVPNServerOptions.ResourceGroup != nil { - body["resource_group"] = createVPNServerOptions.ResourceGroup - } - if createVPNServerOptions.SecurityGroups != nil { - body["security_groups"] = createVPNServerOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateVPNServerRoute : Create a VPN route for a VPN server -// This request creates a new VPN route in the VPN server. All VPN routes are provided to the VPN client when the -// connection is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN -// route matching their specified destinations. All VPN routes must be unique within the VPN server. destination of the -// packet. -func (vpc *VpcV1) CreateVPNServerRoute(createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.CreateVPNServerRouteWithContext(context.Background(), createVPNServerRouteOptions) -} - -// CreateVPNServerRouteWithContext is an alternate form of the CreateVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) CreateVPNServerRouteWithContext(ctx context.Context, createVPNServerRouteOptions *CreateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNServerRouteOptions, "createVPNServerRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createVPNServerRouteOptions, "createVPNServerRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *createVPNServerRouteOptions.VPNServerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createVPNServerRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNServerRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createVPNServerRouteOptions.Destination != nil { - body["destination"] = createVPNServerRouteOptions.Destination - } - if createVPNServerRouteOptions.Action != nil { - body["action"] = createVPNServerRouteOptions.Action - } - if createVPNServerRouteOptions.Name != nil { - body["name"] = createVPNServerRouteOptions.Name - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteVPNServer : Delete a VPN server -// This request deletes a VPN server. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPNServer(deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerWithContext(context.Background(), deleteVPNServerOptions) -} - -// DeleteVPNServerWithContext is an alternate form of the DeleteVPNServer method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerWithContext(ctx context.Context, deleteVPNServerOptions *DeleteVPNServerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerOptions, "deleteVPNServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNServerOptions, "deleteVPNServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteVPNServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPNServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteVPNServerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteVPNServerOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPNServerClient : Delete a VPN client -// This request disconnects and deletes the VPN client from the VPN server. The VPN client may reconnect unless its -// authentication permissions for the configured authentication methods (such as its client certificate) have been -// revoked. -func (vpc *VpcV1) DeleteVPNServerClient(deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerClientWithContext(context.Background(), deleteVPNServerClientOptions) -} - -// DeleteVPNServerClientWithContext is an alternate form of the DeleteVPNServerClient method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerClientWithContext(ctx context.Context, deleteVPNServerClientOptions *DeleteVPNServerClientOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerClientOptions, "deleteVPNServerClientOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNServerClientOptions, "deleteVPNServerClientOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *deleteVPNServerClientOptions.VPNServerID, - "id": *deleteVPNServerClientOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPNServerClientOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerClient") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteVPNServerRoute : Delete a VPN route -// This request deletes a VPN route. This operation cannot be reversed. -func (vpc *VpcV1) DeleteVPNServerRoute(deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNServerRouteWithContext(context.Background(), deleteVPNServerRouteOptions) -} - -// DeleteVPNServerRouteWithContext is an alternate form of the DeleteVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNServerRouteWithContext(ctx context.Context, deleteVPNServerRouteOptions *DeleteVPNServerRouteOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteVPNServerRouteOptions, "deleteVPNServerRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *deleteVPNServerRouteOptions.VPNServerID, - "id": *deleteVPNServerRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteVPNServerRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNServerRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DisconnectVPNClient : Disconnect a VPN client -// This request disconnects the specified VPN client, and deletes the client according to the VPN server's auto-deletion -// policy. The VPN client may reconnect unless its authentication permissions for the configured authentication methods -// (such as its client certificate) have been revoked. -func (vpc *VpcV1) DisconnectVPNClient(disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { - return vpc.DisconnectVPNClientWithContext(context.Background(), disconnectVPNClientOptions) -} - -// DisconnectVPNClientWithContext is an alternate form of the DisconnectVPNClient method which supports a Context parameter -func (vpc *VpcV1) DisconnectVPNClientWithContext(ctx context.Context, disconnectVPNClientOptions *DisconnectVPNClientOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(disconnectVPNClientOptions, "disconnectVPNClientOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(disconnectVPNClientOptions, "disconnectVPNClientOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *disconnectVPNClientOptions.VPNServerID, - "id": *disconnectVPNClientOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}/disconnect`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range disconnectVPNClientOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DisconnectVPNClient") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetVPNServer : Retrieve a VPN server -// This request retrieves a single VPN server specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServer(getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerWithContext(context.Background(), getVPNServerOptions) -} - -// GetVPNServerWithContext is an alternate form of the GetVPNServer method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerWithContext(ctx context.Context, getVPNServerOptions *GetVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerOptions, "getVPNServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNServerOptions, "getVPNServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPNServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPNServerClient : Retrieve a VPN client -// This request retrieves a single VPN client specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServerClient(getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerClientWithContext(context.Background(), getVPNServerClientOptions) -} - -// GetVPNServerClientWithContext is an alternate form of the GetVPNServerClient method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerClientWithContext(ctx context.Context, getVPNServerClientOptions *GetVPNServerClientOptions) (result *VPNServerClient, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerClientOptions, "getVPNServerClientOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNServerClientOptions, "getVPNServerClientOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *getVPNServerClientOptions.VPNServerID, - "id": *getVPNServerClientOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNServerClientOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClient") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClient) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetVPNServerClientConfiguration : Retrieve client configuration -// This request retrieves OpenVPN client configuration on a single VPN server specified by the identifier in the URL. -// This configuration includes directives compatible with OpenVPN releases 2.4 and 2.5. -func (vpc *VpcV1) GetVPNServerClientConfiguration(getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerClientConfigurationWithContext(context.Background(), getVPNServerClientConfigurationOptions) -} - -// GetVPNServerClientConfigurationWithContext is an alternate form of the GetVPNServerClientConfiguration method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerClientConfigurationWithContext(ctx context.Context, getVPNServerClientConfigurationOptions *GetVPNServerClientConfigurationOptions) (result *string, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNServerClientConfigurationOptions, "getVPNServerClientConfigurationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getVPNServerClientConfigurationOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}/client_configuration`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNServerClientConfigurationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerClientConfiguration") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "text/plain") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, &result) - - return -} - -// GetVPNServerRoute : Retrieve a VPN route -// This request retrieves a single VPN route specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNServerRoute(getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.GetVPNServerRouteWithContext(context.Background(), getVPNServerRouteOptions) -} - -// GetVPNServerRouteWithContext is an alternate form of the GetVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) GetVPNServerRouteWithContext(ctx context.Context, getVPNServerRouteOptions *GetVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNServerRouteOptions, "getVPNServerRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getVPNServerRouteOptions, "getVPNServerRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *getVPNServerRouteOptions.VPNServerID, - "id": *getVPNServerRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getVPNServerRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNServerRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNServerClients : List all VPN clients for a VPN server -// This request retrieves all connected VPN clients, and any disconnected VPN clients that the VPN server has not yet -// deleted based on its auto-deletion policy. -func (vpc *VpcV1) ListVPNServerClients(listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServerClientsWithContext(context.Background(), listVPNServerClientsOptions) -} - -// ListVPNServerClientsWithContext is an alternate form of the ListVPNServerClients method which supports a Context parameter -func (vpc *VpcV1) ListVPNServerClientsWithContext(ctx context.Context, listVPNServerClientsOptions *ListVPNServerClientsOptions) (result *VPNServerClientCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNServerClientsOptions, "listVPNServerClientsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPNServerClientsOptions, "listVPNServerClientsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *listVPNServerClientsOptions.VPNServerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/clients`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPNServerClientsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerClients") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServerClientsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServerClientsOptions.Start)) - } - if listVPNServerClientsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServerClientsOptions.Limit)) - } - if listVPNServerClientsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServerClientsOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerClientCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNServerRoutes : List all VPN routes for a VPN server -// This request lists all VPN routes in a VPN server. All VPN routes are provided to the VPN client when the connection -// is established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN route -// matching their specified destinations. All VPN routes must be unique within the VPN server. -func (vpc *VpcV1) ListVPNServerRoutes(listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServerRoutesWithContext(context.Background(), listVPNServerRoutesOptions) -} - -// ListVPNServerRoutesWithContext is an alternate form of the ListVPNServerRoutes method which supports a Context parameter -func (vpc *VpcV1) ListVPNServerRoutesWithContext(ctx context.Context, listVPNServerRoutesOptions *ListVPNServerRoutesOptions) (result *VPNServerRouteCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNServerRoutesOptions, "listVPNServerRoutesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listVPNServerRoutesOptions, "listVPNServerRoutesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *listVPNServerRoutesOptions.VPNServerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listVPNServerRoutesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServerRoutes") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServerRoutesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServerRoutesOptions.Start)) - } - if listVPNServerRoutesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServerRoutesOptions.Limit)) - } - if listVPNServerRoutesOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServerRoutesOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRouteCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListVPNServers : List all VPN servers -// This request lists all VPN servers. -func (vpc *VpcV1) ListVPNServers(listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNServersWithContext(context.Background(), listVPNServersOptions) -} - -// ListVPNServersWithContext is an alternate form of the ListVPNServers method which supports a Context parameter -func (vpc *VpcV1) ListVPNServersWithContext(ctx context.Context, listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVPNServersOptions, "listVPNServersOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listVPNServersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNServers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNServersOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVPNServersOptions.Name)) - } - if listVPNServersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNServersOptions.Start)) - } - if listVPNServersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNServersOptions.Limit)) - } - if listVPNServersOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNServersOptions.ResourceGroupID)) - } - if listVPNServersOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listVPNServersOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPNServer : Update a VPN server -// This request updates the properties of an existing VPN server. Any property changes will cause all connected VPN -// clients are disconnected from this VPN server except for the name change. -func (vpc *VpcV1) UpdateVPNServer(updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNServerWithContext(context.Background(), updateVPNServerOptions) -} - -// UpdateVPNServerWithContext is an alternate form of the UpdateVPNServer method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNServerWithContext(ctx context.Context, updateVPNServerOptions *UpdateVPNServerOptions) (result *VPNServer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNServerOptions, "updateVPNServerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPNServerOptions, "updateVPNServerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateVPNServerOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPNServerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateVPNServerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateVPNServerOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPNServerOptions.VPNServerPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateVPNServerRoute : Update a VPN route -// This request updates a VPN route with the information in a provided VPN route patch. The VPN route patch object is -// structured in the same way as a retrieved VPN route and contains only the information to be updated. -func (vpc *VpcV1) UpdateVPNServerRoute(updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNServerRouteWithContext(context.Background(), updateVPNServerRouteOptions) -} - -// UpdateVPNServerRouteWithContext is an alternate form of the UpdateVPNServerRoute method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPNServerRouteOptions *UpdateVPNServerRouteOptions) (result *VPNServerRoute, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNServerRouteOptions, "updateVPNServerRouteOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateVPNServerRouteOptions, "updateVPNServerRouteOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_server_id": *updateVPNServerRouteOptions.VPNServerID, - "id": *updateVPNServerRouteOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_servers/{vpn_server_id}/routes/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateVPNServerRouteOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNServerRoute") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateVPNServerRouteOptions.VPNServerRoutePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNServerRoute) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancer : Create a load balancer -// This request creates and provisions a new load balancer. -func (vpc *VpcV1) CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerWithContext(context.Background(), createLoadBalancerOptions) -} - -// CreateLoadBalancerWithContext is an alternate form of the CreateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerOptions, "createLoadBalancerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerOptions, "createLoadBalancerOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerOptions.IsPublic != nil { - body["is_public"] = createLoadBalancerOptions.IsPublic - } - if createLoadBalancerOptions.Subnets != nil { - body["subnets"] = createLoadBalancerOptions.Subnets - } - if createLoadBalancerOptions.Dns != nil { - body["dns"] = createLoadBalancerOptions.Dns - } - if createLoadBalancerOptions.Listeners != nil { - body["listeners"] = createLoadBalancerOptions.Listeners - } - if createLoadBalancerOptions.Logging != nil { - body["logging"] = createLoadBalancerOptions.Logging - } - if createLoadBalancerOptions.Name != nil { - body["name"] = createLoadBalancerOptions.Name - } - if createLoadBalancerOptions.Pools != nil { - body["pools"] = createLoadBalancerOptions.Pools - } - if createLoadBalancerOptions.Profile != nil { - body["profile"] = createLoadBalancerOptions.Profile - } - if createLoadBalancerOptions.ResourceGroup != nil { - body["resource_group"] = createLoadBalancerOptions.ResourceGroup - } - if createLoadBalancerOptions.RouteMode != nil { - body["route_mode"] = createLoadBalancerOptions.RouteMode - } - if createLoadBalancerOptions.SecurityGroups != nil { - body["security_groups"] = createLoadBalancerOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancerListener : Create a listener for a load balancer -// This request creates a new listener for a load balancer. -func (vpc *VpcV1) CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerWithContext(context.Background(), createLoadBalancerListenerOptions) -} - -// CreateLoadBalancerListenerWithContext is an alternate form of the CreateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerOptions.LoadBalancerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerListenerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListener") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerListenerOptions.Protocol != nil { - body["protocol"] = createLoadBalancerListenerOptions.Protocol - } - if createLoadBalancerListenerOptions.AcceptProxyProtocol != nil { - body["accept_proxy_protocol"] = createLoadBalancerListenerOptions.AcceptProxyProtocol - } - if createLoadBalancerListenerOptions.CertificateInstance != nil { - body["certificate_instance"] = createLoadBalancerListenerOptions.CertificateInstance - } - if createLoadBalancerListenerOptions.ConnectionLimit != nil { - body["connection_limit"] = createLoadBalancerListenerOptions.ConnectionLimit - } - if createLoadBalancerListenerOptions.DefaultPool != nil { - body["default_pool"] = createLoadBalancerListenerOptions.DefaultPool - } - if createLoadBalancerListenerOptions.HTTPSRedirect != nil { - body["https_redirect"] = createLoadBalancerListenerOptions.HTTPSRedirect - } - if createLoadBalancerListenerOptions.IdleConnectionTimeout != nil { - body["idle_connection_timeout"] = createLoadBalancerListenerOptions.IdleConnectionTimeout - } - if createLoadBalancerListenerOptions.Policies != nil { - body["policies"] = createLoadBalancerListenerOptions.Policies - } - if createLoadBalancerListenerOptions.Port != nil { - body["port"] = createLoadBalancerListenerOptions.Port - } - if createLoadBalancerListenerOptions.PortMax != nil { - body["port_max"] = createLoadBalancerListenerOptions.PortMax - } - if createLoadBalancerListenerOptions.PortMin != nil { - body["port_min"] = createLoadBalancerListenerOptions.PortMin - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancerListenerPolicy : Create a policy for a load balancer listener -// Creates a new policy for a load balancer listener. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyWithContext(context.Background(), createLoadBalancerListenerPolicyOptions) -} - -// CreateLoadBalancerListenerPolicyWithContext is an alternate form of the CreateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Context, createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyOptions.ListenerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerListenerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyOptions.Action != nil { - body["action"] = createLoadBalancerListenerPolicyOptions.Action - } - if createLoadBalancerListenerPolicyOptions.Priority != nil { - body["priority"] = createLoadBalancerListenerPolicyOptions.Priority - } - if createLoadBalancerListenerPolicyOptions.Name != nil { - body["name"] = createLoadBalancerListenerPolicyOptions.Name - } - if createLoadBalancerListenerPolicyOptions.Rules != nil { - body["rules"] = createLoadBalancerListenerPolicyOptions.Rules - } - if createLoadBalancerListenerPolicyOptions.Target != nil { - body["target"] = createLoadBalancerListenerPolicyOptions.Target - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancerListenerPolicyRule : Create a rule for a load balancer listener policy -// Creates a new rule for the load balancer listener policy. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyRuleWithContext(context.Background(), createLoadBalancerListenerPolicyRuleOptions) -} - -// CreateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the CreateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *createLoadBalancerListenerPolicyRuleOptions.PolicyID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerListenerPolicyRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicyRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyRuleOptions.Condition != nil { - body["condition"] = createLoadBalancerListenerPolicyRuleOptions.Condition - } - if createLoadBalancerListenerPolicyRuleOptions.Type != nil { - body["type"] = createLoadBalancerListenerPolicyRuleOptions.Type - } - if createLoadBalancerListenerPolicyRuleOptions.Value != nil { - body["value"] = createLoadBalancerListenerPolicyRuleOptions.Value - } - if createLoadBalancerListenerPolicyRuleOptions.Field != nil { - body["field"] = createLoadBalancerListenerPolicyRuleOptions.Field - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancerPool : Create a load balancer pool -// This request creates a new pool from a pool prototype object. -func (vpc *VpcV1) CreateLoadBalancerPool(createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerPoolWithContext(context.Background(), createLoadBalancerPoolOptions) -} - -// CreateLoadBalancerPoolWithContext is an alternate form of the CreateLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerPoolWithContext(ctx context.Context, createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerPoolOptions.LoadBalancerID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerPoolOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPool") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerPoolOptions.Algorithm != nil { - body["algorithm"] = createLoadBalancerPoolOptions.Algorithm - } - if createLoadBalancerPoolOptions.HealthMonitor != nil { - body["health_monitor"] = createLoadBalancerPoolOptions.HealthMonitor - } - if createLoadBalancerPoolOptions.Protocol != nil { - body["protocol"] = createLoadBalancerPoolOptions.Protocol - } - if createLoadBalancerPoolOptions.Members != nil { - body["members"] = createLoadBalancerPoolOptions.Members - } - if createLoadBalancerPoolOptions.Name != nil { - body["name"] = createLoadBalancerPoolOptions.Name - } - if createLoadBalancerPoolOptions.ProxyProtocol != nil { - body["proxy_protocol"] = createLoadBalancerPoolOptions.ProxyProtocol - } - if createLoadBalancerPoolOptions.SessionPersistence != nil { - body["session_persistence"] = createLoadBalancerPoolOptions.SessionPersistence - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateLoadBalancerPoolMember : Create a member in a load balancer pool -// This request creates a new member and adds the member to the pool. -func (vpc *VpcV1) CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerPoolMemberWithContext(context.Background(), createLoadBalancerPoolMemberOptions) -} - -// CreateLoadBalancerPoolMemberWithContext is an alternate form of the CreateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *createLoadBalancerPoolMemberOptions.PoolID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range createLoadBalancerPoolMemberOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPoolMember") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createLoadBalancerPoolMemberOptions.Port != nil { - body["port"] = createLoadBalancerPoolMemberOptions.Port - } - if createLoadBalancerPoolMemberOptions.Target != nil { - body["target"] = createLoadBalancerPoolMemberOptions.Target - } - if createLoadBalancerPoolMemberOptions.Weight != nil { - body["weight"] = createLoadBalancerPoolMemberOptions.Weight - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteLoadBalancer : Delete a load balancer -// This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its -// `provisioning_status` is `delete_pending` or it is referenced by a resource. -func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) -} - -// DeleteLoadBalancerWithContext is an alternate form of the DeleteLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerOptions, "deleteLoadBalancerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerOptions, "deleteLoadBalancerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteLoadBalancerOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - if deleteLoadBalancerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*deleteLoadBalancerOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteLoadBalancerListener : Delete a load balancer listener -// This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, the -// listener must not be the target of another load balancer listener. -func (vpc *VpcV1) DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerWithContext(context.Background(), deleteLoadBalancerListenerOptions) -} - -// DeleteLoadBalancerListenerWithContext is an alternate form of the DeleteLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerOptions.LoadBalancerID, - "id": *deleteLoadBalancerListenerOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerListenerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListener") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteLoadBalancerListenerPolicy : Delete a load balancer listener policy -// Deletes a policy of the load balancer listener. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyWithContext(context.Background(), deleteLoadBalancerListenerPolicyOptions) -} - -// DeleteLoadBalancerListenerPolicyWithContext is an alternate form of the DeleteLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyOptions.ListenerID, - "id": *deleteLoadBalancerListenerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerListenerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteLoadBalancerListenerPolicyRule : Delete a load balancer listener policy rule -// Deletes a rule from the load balancer listener policy. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyRuleWithContext(context.Background(), deleteLoadBalancerListenerPolicyRuleOptions) -} - -// DeleteLoadBalancerListenerPolicyRuleWithContext is an alternate form of the DeleteLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *deleteLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *deleteLoadBalancerListenerPolicyRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerListenerPolicyRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicyRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteLoadBalancerPool : Delete a load balancer pool -// This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the -// default pool for any listener in the load balancer. -func (vpc *VpcV1) DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerPoolWithContext(context.Background(), deleteLoadBalancerPoolOptions) -} - -// DeleteLoadBalancerPoolWithContext is an alternate form of the DeleteLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerPoolOptions.LoadBalancerID, - "id": *deleteLoadBalancerPoolOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerPoolOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPool") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// DeleteLoadBalancerPoolMember : Delete a load balancer pool member -// This request deletes a member from the pool. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerPoolMemberWithContext(context.Background(), deleteLoadBalancerPoolMemberOptions) -} - -// DeleteLoadBalancerPoolMemberWithContext is an alternate form of the DeleteLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerPoolMemberWithContext(ctx context.Context, deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *deleteLoadBalancerPoolMemberOptions.PoolID, - "id": *deleteLoadBalancerPoolMemberOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteLoadBalancerPoolMemberOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPoolMember") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetLoadBalancer : Retrieve a load balancer -// This request retrieves a single load balancer specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerWithContext(context.Background(), getLoadBalancerOptions) -} - -// GetLoadBalancerWithContext is an alternate form of the GetLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerOptions, "getLoadBalancerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerOptions, "getLoadBalancerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getLoadBalancerOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerListener : Retrieve a load balancer listener -// This request retrieves a single listener specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerWithContext(context.Background(), getLoadBalancerListenerOptions) -} - -// GetLoadBalancerListenerWithContext is an alternate form of the GetLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerOptions.LoadBalancerID, - "id": *getLoadBalancerListenerOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerListenerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListener") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerListenerPolicy : Retrieve a load balancer listener policy -// Retrieve a single policy specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyWithContext(context.Background(), getLoadBalancerListenerPolicyOptions) -} - -// GetLoadBalancerListenerPolicyWithContext is an alternate form of the GetLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyOptions.ListenerID, - "id": *getLoadBalancerListenerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerListenerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerListenerPolicyRule : Retrieve a load balancer listener policy rule -// Retrieves a single rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyRuleWithContext(context.Background(), getLoadBalancerListenerPolicyRuleOptions) -} - -// GetLoadBalancerListenerPolicyRuleWithContext is an alternate form of the GetLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *getLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *getLoadBalancerListenerPolicyRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerListenerPolicyRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicyRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerPool : Retrieve a load balancer pool -// This request retrieves a single pool specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolWithContext(context.Background(), getLoadBalancerPoolOptions) -} - -// GetLoadBalancerPoolWithContext is an alternate form of the GetLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolOptions.LoadBalancerID, - "id": *getLoadBalancerPoolOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerPoolOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPool") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerPoolMember : Retrieve a load balancer pool member -// This request retrieves a single member specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolMemberWithContext(context.Background(), getLoadBalancerPoolMemberOptions) -} - -// GetLoadBalancerPoolMemberWithContext is an alternate form of the GetLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *getLoadBalancerPoolMemberOptions.PoolID, - "id": *getLoadBalancerPoolMemberOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerPoolMemberOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPoolMember") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerProfile : Retrieve a load balancer profile -// This request retrieves a load balancer profile specified by the name in the URL. -func (vpc *VpcV1) GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerProfileWithContext(context.Background(), getLoadBalancerProfileOptions) -} - -// GetLoadBalancerProfileWithContext is an alternate form of the GetLoadBalancerProfile method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "name": *getLoadBalancerProfileOptions.Name, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles/{name}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerProfileOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerProfile") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfile) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLoadBalancerStatistics : List all statistics of a load balancer -// This request lists statistics of a load balancer. -func (vpc *VpcV1) GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerStatisticsWithContext(context.Background(), getLoadBalancerStatisticsOptions) -} - -// GetLoadBalancerStatisticsWithContext is an alternate form of the GetLoadBalancerStatistics method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getLoadBalancerStatisticsOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}/statistics`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLoadBalancerStatisticsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerStatistics") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerStatistics) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerListenerPolicies : List all policies for a load balancer listener -// This request lists all policies for a load balancer listener. -func (vpc *VpcV1) ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPoliciesWithContext(context.Background(), listLoadBalancerListenerPoliciesOptions) -} - -// ListLoadBalancerListenerPoliciesWithContext is an alternate form of the ListLoadBalancerListenerPolicies method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Context, listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPoliciesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPoliciesOptions.ListenerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerListenerPoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerListenerPolicyRules : List all rules of a load balancer listener policy -// This request lists all rules of a load balancer listener policy. -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPolicyRulesWithContext(context.Background(), listLoadBalancerListenerPolicyRulesOptions) -} - -// ListLoadBalancerListenerPolicyRulesWithContext is an alternate form of the ListLoadBalancerListenerPolicyRules method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Context, listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPolicyRulesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPolicyRulesOptions.ListenerID, - "policy_id": *listLoadBalancerListenerPolicyRulesOptions.PolicyID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerListenerPolicyRulesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicyRules") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRuleCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerListeners : List all listeners for a load balancer -// This request lists all listeners for a load balancer. -func (vpc *VpcV1) ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenersWithContext(context.Background(), listLoadBalancerListenersOptions) -} - -// ListLoadBalancerListenersWithContext is an alternate form of the ListLoadBalancerListeners method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenersOptions.LoadBalancerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerListenersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListeners") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerPoolMembers : List all members of a load balancer pool -// This request lists all members of a load balancer pool. -func (vpc *VpcV1) ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolMembersWithContext(context.Background(), listLoadBalancerPoolMembersOptions) -} - -// ListLoadBalancerPoolMembersWithContext is an alternate form of the ListLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *listLoadBalancerPoolMembersOptions.PoolID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerPoolMembersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPoolMembers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerPools : List all pools of a load balancer -// This request lists all pools of a load balancer. -func (vpc *VpcV1) ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolsWithContext(context.Background(), listLoadBalancerPoolsOptions) -} - -// ListLoadBalancerPoolsWithContext is an alternate form of the ListLoadBalancerPools method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolsOptions.LoadBalancerID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerPoolsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPools") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancerProfiles : List all load balancer profiles -// This request lists all load balancer profiles available in the region. A load balancer profile specifies the -// performance characteristics and pricing model for a load balancer. -func (vpc *VpcV1) ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerProfilesWithContext(context.Background(), listLoadBalancerProfilesOptions) -} - -// ListLoadBalancerProfilesWithContext is an alternate form of the ListLoadBalancerProfiles method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancerProfilesOptions, "listLoadBalancerProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancerProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancerProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancerProfilesOptions.Start)) - } - if listLoadBalancerProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancerProfilesOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfileCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLoadBalancers : List all load balancers -// This request lists all load balancers in the region. -func (vpc *VpcV1) ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancersWithContext(context.Background(), listLoadBalancersOptions) -} - -// ListLoadBalancersWithContext is an alternate form of the ListLoadBalancers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancersOptions, "listLoadBalancersOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listLoadBalancersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancersOptions.Start)) - } - if listLoadBalancersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancersOptions.Limit)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ReplaceLoadBalancerPoolMembers : Replace load balancer pool members -// This request replaces the existing members of the load balancer pool with new members created from the collection of -// member prototype objects. -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ReplaceLoadBalancerPoolMembersWithContext(context.Background(), replaceLoadBalancerPoolMembersOptions) -} - -// ReplaceLoadBalancerPoolMembersWithContext is an alternate form of the ReplaceLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *replaceLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *replaceLoadBalancerPoolMembersOptions.PoolID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range replaceLoadBalancerPoolMembersOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceLoadBalancerPoolMembers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if replaceLoadBalancerPoolMembersOptions.Members != nil { - body["members"] = replaceLoadBalancerPoolMembersOptions.Members - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancer : Update a load balancer -// This request updates a load balancer with the information in a provided load balancer patch. The load balancer patch -// object is structured in the same way as a retrieved load balancer and contains only the information to be updated. A -// load balancer can only be updated if its `provisioning_status` is `active`. -func (vpc *VpcV1) UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerWithContext(context.Background(), updateLoadBalancerOptions) -} - -// UpdateLoadBalancerWithContext is an alternate form of the UpdateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerOptions, "updateLoadBalancerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerOptions, "updateLoadBalancerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateLoadBalancerOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancer") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - if updateLoadBalancerOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateLoadBalancerOptions.IfMatch)) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerOptions.LoadBalancerPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancerListener : Update a load balancer listener -// This request updates a load balancer listener from a listener patch. -func (vpc *VpcV1) UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerWithContext(context.Background(), updateLoadBalancerListenerOptions) -} - -// UpdateLoadBalancerListenerWithContext is an alternate form of the UpdateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerOptions.LoadBalancerID, - "id": *updateLoadBalancerListenerOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerListenerOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListener") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerOptions.LoadBalancerListenerPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancerListenerPolicy : Update a load balancer listener policy -// Updates a policy from a policy patch. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyWithContext(context.Background(), updateLoadBalancerListenerPolicyOptions) -} - -// UpdateLoadBalancerListenerPolicyWithContext is an alternate form of the UpdateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Context, updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyOptions.ListenerID, - "id": *updateLoadBalancerListenerPolicyOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerListenerPolicyOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicy") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyOptions.LoadBalancerListenerPolicyPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancerListenerPolicyRule : Update a load balancer listener policy rule -// Updates a rule of the load balancer listener policy. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyRuleWithContext(context.Background(), updateLoadBalancerListenerPolicyRuleOptions) -} - -// UpdateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the UpdateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *updateLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *updateLoadBalancerListenerPolicyRuleOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerListenerPolicyRuleOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicyRule") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerListenerPolicyRulePatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancerPool : Update a load balancer pool -// This request updates a load balancer pool from a pool patch. -func (vpc *VpcV1) UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolWithContext(context.Background(), updateLoadBalancerPoolOptions) -} - -// UpdateLoadBalancerPoolWithContext is an alternate form of the UpdateLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolOptions.LoadBalancerID, - "id": *updateLoadBalancerPoolOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerPoolOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPool") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolOptions.LoadBalancerPoolPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateLoadBalancerPoolMember : Update a load balancer pool member -// This request updates an existing member from a member patch. -func (vpc *VpcV1) UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolMemberWithContext(context.Background(), updateLoadBalancerPoolMemberOptions) -} - -// UpdateLoadBalancerPoolMemberWithContext is an alternate form of the UpdateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *updateLoadBalancerPoolMemberOptions.PoolID, - "id": *updateLoadBalancerPoolMemberOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateLoadBalancerPoolMemberOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPoolMember") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolMemberOptions.LoadBalancerPoolMemberPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AddEndpointGatewayIP : Bind a reserved IP to an endpoint gateway -// This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: -// -// - must currently be unbound, or not required by its target -// - must not be in the same zone as any other reserved IP bound to the endpoint gateway. -func (vpc *VpcV1) AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.AddEndpointGatewayIPWithContext(context.Background(), addEndpointGatewayIPOptions) -} - -// AddEndpointGatewayIPWithContext is an alternate form of the AddEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "endpoint_gateway_id": *addEndpointGatewayIPOptions.EndpointGatewayID, - "id": *addEndpointGatewayIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range addEndpointGatewayIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddEndpointGatewayIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateEndpointGateway : Create an endpoint gateway -// This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target -// outside the VPC. -func (vpc *VpcV1) CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.CreateEndpointGatewayWithContext(context.Background(), createEndpointGatewayOptions) -} - -// CreateEndpointGatewayWithContext is an alternate form of the CreateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createEndpointGatewayOptions, "createEndpointGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createEndpointGatewayOptions, "createEndpointGatewayOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createEndpointGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createEndpointGatewayOptions.Target != nil { - body["target"] = createEndpointGatewayOptions.Target - } - if createEndpointGatewayOptions.VPC != nil { - body["vpc"] = createEndpointGatewayOptions.VPC - } - if createEndpointGatewayOptions.AllowDnsResolutionBinding != nil { - body["allow_dns_resolution_binding"] = createEndpointGatewayOptions.AllowDnsResolutionBinding - } - if createEndpointGatewayOptions.Ips != nil { - body["ips"] = createEndpointGatewayOptions.Ips - } - if createEndpointGatewayOptions.Name != nil { - body["name"] = createEndpointGatewayOptions.Name - } - if createEndpointGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createEndpointGatewayOptions.ResourceGroup - } - if createEndpointGatewayOptions.SecurityGroups != nil { - body["security_groups"] = createEndpointGatewayOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteEndpointGateway : Delete an endpoint gateway -// This request deletes an endpoint gateway. This operation cannot be reversed. -// -// Reserved IPs that were bound to the endpoint gateway will be released if their -// `auto_delete` property is set to true. -func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) -} - -// DeleteEndpointGatewayWithContext is an alternate form of the DeleteEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteEndpointGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteEndpointGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetEndpointGateway : Retrieve an endpoint gateway -// This request retrieves a single endpoint gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayWithContext(context.Background(), getEndpointGatewayOptions) -} - -// GetEndpointGatewayWithContext is an alternate form of the GetEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayOptions, "getEndpointGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getEndpointGatewayOptions, "getEndpointGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getEndpointGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getEndpointGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetEndpointGatewayIP : Retrieve a reserved IP bound to an endpoint gateway -// This request retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the URL. -func (vpc *VpcV1) GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayIPWithContext(context.Background(), getEndpointGatewayIPOptions) -} - -// GetEndpointGatewayIPWithContext is an alternate form of the GetEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "endpoint_gateway_id": *getEndpointGatewayIPOptions.EndpointGatewayID, - "id": *getEndpointGatewayIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getEndpointGatewayIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListEndpointGatewayIps : List all reserved IPs bound to an endpoint gateway -// This request lists all reserved IPs bound to an endpoint gateway. -func (vpc *VpcV1) ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewayIpsWithContext(context.Background(), listEndpointGatewayIpsOptions) -} - -// ListEndpointGatewayIpsWithContext is an alternate form of the ListEndpointGatewayIps method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "endpoint_gateway_id": *listEndpointGatewayIpsOptions.EndpointGatewayID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range listEndpointGatewayIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewayIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayIpsOptions.Start)) - } - if listEndpointGatewayIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayIpsOptions.Limit)) - } - if listEndpointGatewayIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listEndpointGatewayIpsOptions.Sort)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionEndpointGatewayContext) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListEndpointGateways : List all endpoint gateways -// This request lists all endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to -// a target outside the VPC. -func (vpc *VpcV1) ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewaysWithContext(context.Background(), listEndpointGatewaysOptions) -} - -// ListEndpointGatewaysWithContext is an alternate form of the ListEndpointGateways method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listEndpointGatewaysOptions, "listEndpointGatewaysOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listEndpointGatewaysOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGateways") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewaysOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) - } - if listEndpointGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewaysOptions.Start)) - } - if listEndpointGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewaysOptions.Limit)) - } - if listEndpointGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listEndpointGatewaysOptions.ResourceGroupID)) - } - if listEndpointGatewaysOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listEndpointGatewaysOptions.VPCID)) - } - if listEndpointGatewaysOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listEndpointGatewaysOptions.VPCCRN)) - } - if listEndpointGatewaysOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listEndpointGatewaysOptions.VPCName)) - } - if listEndpointGatewaysOptions.AllowDnsResolutionBinding != nil { - builder.AddQuery("allow_dns_resolution_binding", fmt.Sprint(*listEndpointGatewaysOptions.AllowDnsResolutionBinding)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// RemoveEndpointGatewayIP : Unbind a reserved IP from an endpoint gateway -// This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has -// `auto_delete` set to `true`, the reserved IP will be deleted. -func (vpc *VpcV1) RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveEndpointGatewayIPWithContext(context.Background(), removeEndpointGatewayIPOptions) -} - -// RemoveEndpointGatewayIPWithContext is an alternate form of the RemoveEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "endpoint_gateway_id": *removeEndpointGatewayIPOptions.EndpointGatewayID, - "id": *removeEndpointGatewayIPOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range removeEndpointGatewayIPOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveEndpointGatewayIP") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// UpdateEndpointGateway : Update an endpoint gateway -// This request updates an endpoint gateway's name. -func (vpc *VpcV1) UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.UpdateEndpointGatewayWithContext(context.Background(), updateEndpointGatewayOptions) -} - -// UpdateEndpointGatewayWithContext is an alternate form of the UpdateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateEndpointGatewayOptions, "updateEndpointGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateEndpointGatewayOptions, "updateEndpointGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateEndpointGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateEndpointGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateEndpointGatewayOptions.EndpointGatewayPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateFlowLogCollector : Create a flow log collector -// This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype -// object is structured in the same way as a retrieved flow log collector, and contains the information necessary to -// create and start the new flow log collector. -func (vpc *VpcV1) CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.CreateFlowLogCollectorWithContext(context.Background(), createFlowLogCollectorOptions) -} - -// CreateFlowLogCollectorWithContext is an alternate form of the CreateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFlowLogCollectorOptions, "createFlowLogCollectorOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createFlowLogCollectorOptions, "createFlowLogCollectorOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) - if err != nil { - return - } - - for headerName, headerValue := range createFlowLogCollectorOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFlowLogCollector") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if createFlowLogCollectorOptions.StorageBucket != nil { - body["storage_bucket"] = createFlowLogCollectorOptions.StorageBucket - } - if createFlowLogCollectorOptions.Target != nil { - body["target"] = createFlowLogCollectorOptions.Target - } - if createFlowLogCollectorOptions.Active != nil { - body["active"] = createFlowLogCollectorOptions.Active - } - if createFlowLogCollectorOptions.Name != nil { - body["name"] = createFlowLogCollectorOptions.Name - } - if createFlowLogCollectorOptions.ResourceGroup != nil { - body["resource_group"] = createFlowLogCollectorOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteFlowLogCollector : Delete a flow log collector -// This request stops and deletes a flow log collector. This operation cannot be reversed. -// -// Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. -func (vpc *VpcV1) DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFlowLogCollectorWithContext(context.Background(), deleteFlowLogCollectorOptions) -} - -// DeleteFlowLogCollectorWithContext is an alternate form of the DeleteFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteFlowLogCollectorOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteFlowLogCollectorOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFlowLogCollector") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetFlowLogCollector : Retrieve a flow log collector -// This request retrieves a single flow log collector specified by the identifier in the URL. -func (vpc *VpcV1) GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.GetFlowLogCollectorWithContext(context.Background(), getFlowLogCollectorOptions) -} - -// GetFlowLogCollectorWithContext is an alternate form of the GetFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFlowLogCollectorOptions, "getFlowLogCollectorOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getFlowLogCollectorOptions, "getFlowLogCollectorOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getFlowLogCollectorOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getFlowLogCollectorOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFlowLogCollector") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListFlowLogCollectors : List all flow log collectors -// This request lists all flow log collectors in the region. A flow log collector summarizes data sent over the instance -// network interfaces and instance network attachments contained within its target. -func (vpc *VpcV1) ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - return vpc.ListFlowLogCollectorsWithContext(context.Background(), listFlowLogCollectorsOptions) -} - -// ListFlowLogCollectorsWithContext is an alternate form of the ListFlowLogCollectors method which supports a Context parameter -func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFlowLogCollectorsOptions, "listFlowLogCollectorsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listFlowLogCollectorsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFlowLogCollectors") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFlowLogCollectorsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFlowLogCollectorsOptions.Start)) - } - if listFlowLogCollectorsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFlowLogCollectorsOptions.Limit)) - } - if listFlowLogCollectorsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFlowLogCollectorsOptions.ResourceGroupID)) - } - if listFlowLogCollectorsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listFlowLogCollectorsOptions.Name)) - } - if listFlowLogCollectorsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listFlowLogCollectorsOptions.VPCID)) - } - if listFlowLogCollectorsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listFlowLogCollectorsOptions.VPCCRN)) - } - if listFlowLogCollectorsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listFlowLogCollectorsOptions.VPCName)) - } - if listFlowLogCollectorsOptions.TargetID != nil { - builder.AddQuery("target.id", fmt.Sprint(*listFlowLogCollectorsOptions.TargetID)) - } - if listFlowLogCollectorsOptions.TargetResourceType != nil { - builder.AddQuery("target.resource_type", fmt.Sprint(*listFlowLogCollectorsOptions.TargetResourceType)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollectorCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// UpdateFlowLogCollector : Update a flow log collector -// This request updates a flow log collector with the information in a provided flow log collector patch. The flow log -// collector patch object is structured in the same way as a retrieved flow log collector and contains only the -// information to be updated. -func (vpc *VpcV1) UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.UpdateFlowLogCollectorWithContext(context.Background(), updateFlowLogCollectorOptions) -} - -// UpdateFlowLogCollectorWithContext is an alternate form of the UpdateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *updateFlowLogCollectorOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range updateFlowLogCollectorOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFlowLogCollector") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateFlowLogCollectorOptions.FlowLogCollectorPatch) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AccountReference : AccountReference struct -type AccountReference struct { - // The unique identifier for this account. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the AccountReference.ResourceType property. -// The resource type. -const ( - AccountReferenceResourceTypeAccountConst = "account" -) - -// UnmarshalAccountReference unmarshals an instance of AccountReference from the specified map of raw messages. -func UnmarshalAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ActivateReservationOptions : The ActivateReservation options. -type ActivateReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewActivateReservationOptions : Instantiate ActivateReservationOptions -func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { - return &ActivateReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { - options.Headers = param - return options -} - -// AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. -type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate AddBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - return &AddBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// AddEndpointGatewayIPOptions : The AddEndpointGatewayIP options. -type AddEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddEndpointGatewayIPOptions : Instantiate AddEndpointGatewayIPOptions -func (*VpcV1) NewAddEndpointGatewayIPOptions(endpointGatewayID string, id string) *AddEndpointGatewayIPOptions { - return &AddEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), - } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *AddEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *AddEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddEndpointGatewayIPOptions) SetID(id string) *AddEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddEndpointGatewayIPOptions) SetHeaders(param map[string]string) *AddEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// AddInstanceNetworkInterfaceFloatingIPOptions : The AddInstanceNetworkInterfaceFloatingIP options. -type AddInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddInstanceNetworkInterfaceFloatingIPOptions : Instantiate AddInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - return &AddInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// AddNetworkInterfaceFloatingIPOptions : The AddNetworkInterfaceFloatingIP options. -type AddNetworkInterfaceFloatingIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddNetworkInterfaceFloatingIPOptions : Instantiate AddNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *AddNetworkInterfaceFloatingIPOptions { - return &AddNetworkInterfaceFloatingIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *AddNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *AddNetworkInterfaceFloatingIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddNetworkInterfaceFloatingIPOptions) SetID(id string) *AddNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// AddVirtualNetworkInterfaceIPOptions : The AddVirtualNetworkInterfaceIP options. -type AddVirtualNetworkInterfaceIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddVirtualNetworkInterfaceIPOptions : Instantiate AddVirtualNetworkInterfaceIPOptions -func (*VpcV1) NewAddVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *AddVirtualNetworkInterfaceIPOptions { - return &AddVirtualNetworkInterfaceIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *AddVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *AddVirtualNetworkInterfaceIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddVirtualNetworkInterfaceIPOptions) SetID(id string) *AddVirtualNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *AddVirtualNetworkInterfaceIPOptions { - options.Headers = param - return options -} - -// AddVPNGatewayConnectionLocalCIDROptions : The AddVPNGatewayConnectionLocalCIDR options. -type AddVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddVPNGatewayConnectionLocalCIDROptions : Instantiate AddVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - return &AddVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetID(id string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} - -// AddVPNGatewayConnectionPeerCIDROptions : The AddVPNGatewayConnectionPeerCIDR options. -type AddVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddVPNGatewayConnectionPeerCIDROptions : Instantiate AddVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - return &AddVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetID(id string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} - -// AddressPrefix : AddressPrefix struct -type AddressPrefix struct { - // The CIDR block for this prefix. - CIDR *string `json:"cidr" validate:"required"` - - // The date and time that the prefix was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // Indicates whether subnets exist with addresses from this prefix. - HasSubnets *bool `json:"has_subnets" validate:"required"` - - // The URL for this address prefix. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this address prefix. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically - // created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected - // words, but may be changed. - IsDefault *bool `json:"is_default" validate:"required"` - - // The name for this address prefix. The name must not be used by another address prefix for the VPC. - Name *string `json:"name" validate:"required"` - - // The zone this address prefix resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalAddressPrefix unmarshals an instance of AddressPrefix from the specified map of raw messages. -func UnmarshalAddressPrefix(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefix) - err = core.UnmarshalPrimitive(m, "cidr", &obj.CIDR) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "has_subnets", &obj.HasSubnets) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AddressPrefixCollection : AddressPrefixCollection struct -type AddressPrefixCollection struct { - // Collection of address prefixes. - AddressPrefixes []AddressPrefix `json:"address_prefixes" validate:"required"` - - // A link to the first page of resources. - First *AddressPrefixCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *AddressPrefixCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalAddressPrefixCollection unmarshals an instance of AddressPrefixCollection from the specified map of raw messages. -func UnmarshalAddressPrefixCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollection) - err = core.UnmarshalModel(m, "address_prefixes", &obj.AddressPrefixes, UnmarshalAddressPrefix) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalAddressPrefixCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalAddressPrefixCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *AddressPrefixCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// AddressPrefixCollectionFirst : A link to the first page of resources. -type AddressPrefixCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalAddressPrefixCollectionFirst unmarshals an instance of AddressPrefixCollectionFirst from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AddressPrefixCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type AddressPrefixCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalAddressPrefixCollectionNext unmarshals an instance of AddressPrefixCollectionNext from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AddressPrefixPatch : AddressPrefixPatch struct -type AddressPrefixPatch struct { - // Indicates whether this is the default prefix for this zone in this VPC. Updating to true makes this prefix the - // default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. - // Updating to false removes the default prefix for this zone in this VPC. - IsDefault *bool `json:"is_default,omitempty"` - - // The name for this address prefix. The name must not be used by another address prefix for the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalAddressPrefixPatch unmarshals an instance of AddressPrefixPatch from the specified map of raw messages. -func UnmarshalAddressPrefixPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixPatch) - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the AddressPrefixPatch -func (addressPrefixPatch *AddressPrefixPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(addressPrefixPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BackupPolicy : BackupPolicy struct -// Models which "extend" this model: -// - BackupPolicyMatchResourceTypeInstance -// - BackupPolicyMatchResourceTypeVolume -type BackupPolicy struct { - // The date and time that the backup policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this backup policy. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this backup policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy. - ID *string `json:"id" validate:"required"` - - // The date and time that the most recent job for this backup policy completed. - // - // If absent, no job has yet completed for this backup policy. - LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` - - // The lifecycle state of the backup policy. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - MatchResourceType *string `json:"match_resource_type" validate:"required"` - - // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will - // be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name is unique across all backup policies in the region. - Name *string `json:"name" validate:"required"` - - // The plans for the backup policy. - Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` - - // The resource group for this backup policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The scope for this backup policy. - Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` - - // The included content for backups created using this policy: - // - `boot_volume`: Include the instance's boot volume. - // - `data_volumes`: Include the instance's data volumes. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - IncludedContent []string `json:"included_content,omitempty"` -} - -// Constants associated with the BackupPolicy.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - BackupPolicyHealthStateDegradedConst = "degraded" - BackupPolicyHealthStateFaultedConst = "faulted" - BackupPolicyHealthStateInapplicableConst = "inapplicable" - BackupPolicyHealthStateOkConst = "ok" -) - -// Constants associated with the BackupPolicy.LifecycleState property. -// The lifecycle state of the backup policy. -const ( - BackupPolicyLifecycleStateDeletingConst = "deleting" - BackupPolicyLifecycleStateFailedConst = "failed" - BackupPolicyLifecycleStatePendingConst = "pending" - BackupPolicyLifecycleStateStableConst = "stable" - BackupPolicyLifecycleStateSuspendedConst = "suspended" - BackupPolicyLifecycleStateUpdatingConst = "updating" - BackupPolicyLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicy.MatchResourceType property. -// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected -// property value was encountered. -const ( - BackupPolicyMatchResourceTypeInstanceConst = "instance" - BackupPolicyMatchResourceTypeVolumeConst = "volume" -) - -// Constants associated with the BackupPolicy.ResourceType property. -// The resource type. -const ( - BackupPolicyResourceTypeBackupPolicyConst = "backup_policy" -) - -// Constants associated with the BackupPolicy.IncludedContent property. -// An item to include. -const ( - BackupPolicyIncludedContentBootVolumeConst = "boot_volume" - BackupPolicyIncludedContentDataVolumesConst = "data_volumes" -) - -func (*BackupPolicy) isaBackupPolicy() bool { - return true -} - -type BackupPolicyIntf interface { - isaBackupPolicy() bool -} - -// UnmarshalBackupPolicy unmarshals an instance of BackupPolicy from the specified map of raw messages. -func UnmarshalBackupPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyCollection : BackupPolicyCollection struct -type BackupPolicyCollection struct { - // Collection of backup policies. - BackupPolicies []BackupPolicyIntf `json:"backup_policies" validate:"required"` - - // A link to the first page of resources. - First *BackupPolicyCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BackupPolicyCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBackupPolicyCollection unmarshals an instance of BackupPolicyCollection from the specified map of raw messages. -func UnmarshalBackupPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollection) - err = core.UnmarshalModel(m, "backup_policies", &obj.BackupPolicies, UnmarshalBackupPolicy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BackupPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BackupPolicyCollectionFirst : A link to the first page of resources. -type BackupPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBackupPolicyCollectionFirst unmarshals an instance of BackupPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalBackupPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BackupPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBackupPolicyCollectionNext unmarshals an instance of BackupPolicyCollectionNext from the specified map of raw messages. -func UnmarshalBackupPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyHealthReason : BackupPolicyHealthReason struct -type BackupPolicyHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BackupPolicyHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - BackupPolicyHealthReasonCodeMissingServiceAuthorizationPoliciesConst = "missing_service_authorization_policies" -) - -// UnmarshalBackupPolicyHealthReason unmarshals an instance of BackupPolicyHealthReason from the specified map of raw messages. -func UnmarshalBackupPolicyHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJob : BackupPolicyJob struct -type BackupPolicyJob struct { - // Indicates whether this backup policy job will be automatically deleted after it completes. At present, this is - // always `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, the days after completion that this backup policy job will be deleted. This value may be - // modifiable in the future. - AutoDeleteAfter *int64 `json:"auto_delete_after" validate:"required"` - - // The backup policy plan operated this backup policy job (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan" validate:"required"` - - // The date and time that the backup policy job was completed. - // - // If absent, the backup policy job has not yet completed. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the backup policy job was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this backup policy job. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy job. - ID *string `json:"id" validate:"required"` - - // The type of backup policy job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the - // unexpected property value was encountered. - JobType *string `json:"job_type" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The source this backup was created from (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - Source BackupPolicyJobSourceIntf `json:"source" validate:"required"` - - // The status of the backup policy job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []BackupPolicyJobStatusReason `json:"status_reasons" validate:"required"` - - // The snapshots operated on by this backup policy job (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - TargetSnapshots []SnapshotReference `json:"target_snapshots" validate:"required"` -} - -// Constants associated with the BackupPolicyJob.JobType property. -// The type of backup policy job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the -// unexpected property value was encountered. -const ( - BackupPolicyJobJobTypeCreationConst = "creation" - BackupPolicyJobJobTypeDeletionConst = "deletion" -) - -// Constants associated with the BackupPolicyJob.ResourceType property. -// The resource type. -const ( - BackupPolicyJobResourceTypeBackupPolicyJobConst = "backup_policy_job" -) - -// Constants associated with the BackupPolicyJob.Status property. -// The status of the backup policy job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy job on which the -// unexpected property value was encountered. -const ( - BackupPolicyJobStatusFailedConst = "failed" - BackupPolicyJobStatusRunningConst = "running" - BackupPolicyJobStatusSucceededConst = "succeeded" -) - -// UnmarshalBackupPolicyJob unmarshals an instance of BackupPolicyJob from the specified map of raw messages. -func UnmarshalBackupPolicyJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJob) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_after", &obj.AutoDeleteAfter) - if err != nil { - return - } - err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source", &obj.Source, UnmarshalBackupPolicyJobSource) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBackupPolicyJobStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target_snapshots", &obj.TargetSnapshots, UnmarshalSnapshotReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobCollection : BackupPolicyJobCollection struct -type BackupPolicyJobCollection struct { - // A link to the first page of resources. - First *BackupPolicyJobCollectionFirst `json:"first" validate:"required"` - - // Collection of backup policy jobs. - Jobs []BackupPolicyJob `json:"jobs" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BackupPolicyJobCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBackupPolicyJobCollection unmarshals an instance of BackupPolicyJobCollection from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBackupPolicyJobCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "jobs", &obj.Jobs, UnmarshalBackupPolicyJob) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBackupPolicyJobCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BackupPolicyJobCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BackupPolicyJobCollectionFirst : A link to the first page of resources. -type BackupPolicyJobCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBackupPolicyJobCollectionFirst unmarshals an instance of BackupPolicyJobCollectionFirst from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BackupPolicyJobCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBackupPolicyJobCollectionNext unmarshals an instance of BackupPolicyJobCollectionNext from the specified map of raw messages. -func UnmarshalBackupPolicyJobCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobSource : The source this backup was created from (may be -// [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). -// Models which "extend" this model: -// - BackupPolicyJobSourceVolumeReference -// - BackupPolicyJobSourceInstanceReference -type BackupPolicyJobSource struct { - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` - - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name,omitempty"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the BackupPolicyJobSource.ResourceType property. -// The resource type. -const ( - BackupPolicyJobSourceResourceTypeVolumeConst = "volume" -) - -func (*BackupPolicyJobSource) isaBackupPolicyJobSource() bool { - return true -} - -type BackupPolicyJobSourceIntf interface { - isaBackupPolicyJobSource() bool -} - -// UnmarshalBackupPolicyJobSource unmarshals an instance of BackupPolicyJobSource from the specified map of raw messages. -func UnmarshalBackupPolicyJobSource(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobSource) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobStatusReason : BackupPolicyJobStatusReason struct -type BackupPolicyJobStatusReason struct { - // A snake case string succinctly identifying the status reason: - // - `internal_error`: Internal error (contact IBM support) - // - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state - // - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached - // - `source_volume_busy`: The source volume has `busy` set (after multiple retries). - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BackupPolicyJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason: -// - `internal_error`: Internal error (contact IBM support) -// - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle state -// - `snapshot_volume_limit`: The snapshot limit for the source volume has been reached -// - `source_volume_busy`: The source volume has `busy` set (after multiple retries). -const ( - BackupPolicyJobStatusReasonCodeInternalErrorConst = "internal_error" - BackupPolicyJobStatusReasonCodeSnapshotPendingConst = "snapshot_pending" - BackupPolicyJobStatusReasonCodeSnapshotVolumeLimitConst = "snapshot_volume_limit" - BackupPolicyJobStatusReasonCodeSourceVolumeBusyConst = "source_volume_busy" -) - -// UnmarshalBackupPolicyJobStatusReason unmarshals an instance of BackupPolicyJobStatusReason from the specified map of raw messages. -func UnmarshalBackupPolicyJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPatch : BackupPolicyPatch struct -type BackupPolicyPatch struct { - // The included content for backups created using this policy: - // - `boot_volume`: Include the instance's boot volume. - // - `data_volumes`: Include the instance's data volumes. - IncludedContent []string `json:"included_content,omitempty"` - - // The user tags this backup policy will apply to (replacing any existing tags). Resources that have both a matching - // user tag and a matching type will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags,omitempty"` - - // The name for this backup policy. The name must not be used by another backup policy in the region. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the BackupPolicyPatch.IncludedContent property. -// An item to include. -const ( - BackupPolicyPatchIncludedContentBootVolumeConst = "boot_volume" - BackupPolicyPatchIncludedContentDataVolumesConst = "data_volumes" -) - -// UnmarshalBackupPolicyPatch unmarshals an instance of BackupPolicyPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPatch) - err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BackupPolicyPatch -func (backupPolicyPatch *BackupPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(backupPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BackupPolicyPlan : BackupPolicyPlan struct -type BackupPolicyPlan struct { - // Indicates whether the plan is active. - Active *bool `json:"active" validate:"required"` - - // The user tags to attach to backups (snapshots) created by this plan. - AttachUserTags []string `json:"attach_user_tags" validate:"required"` - - ClonePolicy *BackupPolicyPlanClonePolicy `json:"clone_policy" validate:"required"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags" validate:"required"` - - // The date and time that the backup policy plan was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` - - DeletionTrigger *BackupPolicyPlanDeletionTrigger `json:"deletion_trigger" validate:"required"` - - // The URL for this backup policy plan. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy plan. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of this backup policy plan. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this backup policy plan. The name is unique across all plans in the backup policy. - Name *string `json:"name" validate:"required"` - - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicy `json:"remote_region_policies" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyPlan.LifecycleState property. -// The lifecycle state of this backup policy plan. -const ( - BackupPolicyPlanLifecycleStateDeletingConst = "deleting" - BackupPolicyPlanLifecycleStateFailedConst = "failed" - BackupPolicyPlanLifecycleStatePendingConst = "pending" - BackupPolicyPlanLifecycleStateStableConst = "stable" - BackupPolicyPlanLifecycleStateSuspendedConst = "suspended" - BackupPolicyPlanLifecycleStateUpdatingConst = "updating" - BackupPolicyPlanLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicyPlan.ResourceType property. -// The resource type. -const ( - BackupPolicyPlanResourceTypeBackupPolicyPlanConst = "backup_policy_plan" -) - -// UnmarshalBackupPolicyPlan unmarshals an instance of BackupPolicyPlan from the specified map of raw messages. -func UnmarshalBackupPolicyPlan(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlan) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTrigger) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanClonePolicy : BackupPolicyPlanClonePolicy struct -type BackupPolicyPlanClonePolicy struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots" validate:"required"` - - // The zone this backup policy plan will create snapshot clones in. - Zones []ZoneReference `json:"zones" validate:"required"` -} - -// UnmarshalBackupPolicyPlanClonePolicy unmarshals an instance of BackupPolicyPlanClonePolicy from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicy) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanClonePolicyPatch : BackupPolicyPlanClonePolicyPatch struct -type BackupPolicyPlanClonePolicyPatch struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots,omitempty"` - - // The zones this backup policy plan will create snapshot clones in. Updating this value does not change the clones for - // snapshots that have already been created by this plan. - Zones []ZoneIdentityIntf `json:"zones,omitempty"` -} - -// UnmarshalBackupPolicyPlanClonePolicyPatch unmarshals an instance of BackupPolicyPlanClonePolicyPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicyPatch) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanClonePolicyPrototype : BackupPolicyPlanClonePolicyPrototype struct -type BackupPolicyPlanClonePolicyPrototype struct { - // The maximum number of recent snapshots (per source) that will keep clones. - MaxSnapshots *int64 `json:"max_snapshots,omitempty"` - - // The zone this backup policy plan will create snapshot clones in. - Zones []ZoneIdentityIntf `json:"zones" validate:"required"` -} - -// NewBackupPolicyPlanClonePolicyPrototype : Instantiate BackupPolicyPlanClonePolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanClonePolicyPrototype(zones []ZoneIdentityIntf) (_model *BackupPolicyPlanClonePolicyPrototype, err error) { - _model = &BackupPolicyPlanClonePolicyPrototype{ - Zones: zones, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBackupPolicyPlanClonePolicyPrototype unmarshals an instance of BackupPolicyPlanClonePolicyPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanClonePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanClonePolicyPrototype) - err = core.UnmarshalPrimitive(m, "max_snapshots", &obj.MaxSnapshots) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanCollection : BackupPolicyPlanCollection struct -type BackupPolicyPlanCollection struct { - // Collection of backup policy plans. - Plans []BackupPolicyPlan `json:"plans" validate:"required"` -} - -// UnmarshalBackupPolicyPlanCollection unmarshals an instance of BackupPolicyPlanCollection from the specified map of raw messages. -func UnmarshalBackupPolicyPlanCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanCollection) - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanDeletionTrigger : BackupPolicyPlanDeletionTrigger struct -type BackupPolicyPlanDeletionTrigger struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after" validate:"required"` - - // The maximum number of recent backups to keep. If absent, there is no maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` -} - -// UnmarshalBackupPolicyPlanDeletionTrigger unmarshals an instance of BackupPolicyPlanDeletionTrigger from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTrigger(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTrigger) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanDeletionTriggerPatch : BackupPolicyPlanDeletionTriggerPatch struct -type BackupPolicyPlanDeletionTriggerPatch struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after,omitempty"` - - // The maximum number of recent backups to keep. Specify `null` to remove any existing maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` -} - -// UnmarshalBackupPolicyPlanDeletionTriggerPatch unmarshals an instance of BackupPolicyPlanDeletionTriggerPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTriggerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTriggerPatch) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanDeletionTriggerPrototype : BackupPolicyPlanDeletionTriggerPrototype struct -type BackupPolicyPlanDeletionTriggerPrototype struct { - // The maximum number of days to keep each backup after creation. - DeleteAfter *int64 `json:"delete_after,omitempty"` - - // The maximum number of recent backups to keep. If unspecified, there will be no maximum. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` -} - -// UnmarshalBackupPolicyPlanDeletionTriggerPrototype unmarshals an instance of BackupPolicyPlanDeletionTriggerPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanDeletionTriggerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanDeletionTriggerPrototype) - err = core.UnmarshalPrimitive(m, "delete_after", &obj.DeleteAfter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanPatch : BackupPolicyPlanPatch struct -type BackupPolicyPlanPatch struct { - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` - - // The user tags to attach to backups (snapshots) created by this plan. Updating this value does not change the user - // tags for backups that have already been created by this plan. - AttachUserTags []string `json:"attach_user_tags,omitempty"` - - ClonePolicy *BackupPolicyPlanClonePolicyPatch `json:"clone_policy,omitempty"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` - - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec,omitempty"` - - DeletionTrigger *BackupPolicyPlanDeletionTriggerPatch `json:"deletion_trigger,omitempty"` - - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. - Name *string `json:"name,omitempty"` - - // The policies for additional backups in remote regions (replacing any existing policies). - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` -} - -// UnmarshalBackupPolicyPlanPatch unmarshals an instance of BackupPolicyPlanPatch from the specified map of raw messages. -func UnmarshalBackupPolicyPlanPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BackupPolicyPlanPatch -func (backupPolicyPlanPatch *BackupPolicyPlanPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(backupPolicyPlanPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BackupPolicyPlanPrototype : BackupPolicyPlanPrototype struct -type BackupPolicyPlanPrototype struct { - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` - - // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. - AttachUserTags []string `json:"attach_user_tags,omitempty"` - - ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` - - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` - - DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` - - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` -} - -// NewBackupPolicyPlanPrototype : Instantiate BackupPolicyPlanPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanPrototype(cronSpec string) (_model *BackupPolicyPlanPrototype, err error) { - _model = &BackupPolicyPlanPrototype{ - CronSpec: core.StringPtr(cronSpec), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBackupPolicyPlanPrototype unmarshals an instance of BackupPolicyPlanPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanPrototype) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attach_user_tags", &obj.AttachUserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clone_policy", &obj.ClonePolicy, UnmarshalBackupPolicyPlanClonePolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "copy_user_tags", &obj.CopyUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deletion_trigger", &obj.DeletionTrigger, UnmarshalBackupPolicyPlanDeletionTriggerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_region_policies", &obj.RemoteRegionPolicies, UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanReference : BackupPolicyPlanReference struct -type BackupPolicyPlanReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BackupPolicyPlanReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this backup policy plan. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy plan. - ID *string `json:"id" validate:"required"` - - // The name for this backup policy plan. The name is unique across all plans in the backup policy. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *BackupPolicyPlanRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyPlanReference.ResourceType property. -// The resource type. -const ( - BackupPolicyPlanReferenceResourceTypeBackupPolicyPlanConst = "backup_policy_plan" -) - -// UnmarshalBackupPolicyPlanReference unmarshals an instance of BackupPolicyPlanReference from the specified map of raw messages. -func UnmarshalBackupPolicyPlanReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBackupPolicyPlanReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalBackupPolicyPlanRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BackupPolicyPlanReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBackupPolicyPlanReferenceDeleted unmarshals an instance of BackupPolicyPlanReferenceDeleted from the specified map of raw messages. -func UnmarshalBackupPolicyPlanReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type BackupPolicyPlanRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalBackupPolicyPlanRemote unmarshals an instance of BackupPolicyPlanRemote from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanRemoteRegionPolicy : BackupPolicyPlanRemoteRegionPolicy struct -type BackupPolicyPlanRemoteRegionPolicy struct { - // The region this backup policy plan will create backups in. - DeleteOverCount *int64 `json:"delete_over_count" validate:"required"` - - // The root key used to rewrap the data encryption key for the backup (snapshot). - EncryptionKey *EncryptionKeyReference `json:"encryption_key" validate:"required"` - - // The region this backup policy plan will create backups in. - Region *RegionReference `json:"region" validate:"required"` -} - -// UnmarshalBackupPolicyPlanRemoteRegionPolicy unmarshals an instance of BackupPolicyPlanRemoteRegionPolicy from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemoteRegionPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemoteRegionPolicy) - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPlanRemoteRegionPolicyPrototype : BackupPolicyPlanRemoteRegionPolicyPrototype struct -type BackupPolicyPlanRemoteRegionPolicyPrototype struct { - // The region this backup policy plan will create backups in. - DeleteOverCount *int64 `json:"delete_over_count,omitempty"` - - // The root key to use to rewrap the data encryption key for the backup (snapshot). - // - // If unspecified, the source's `encryption_key` will be used. - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The region this backup policy plan will create backups in. - Region RegionIdentityIntf `json:"region" validate:"required"` -} - -// NewBackupPolicyPlanRemoteRegionPolicyPrototype : Instantiate BackupPolicyPlanRemoteRegionPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPlanRemoteRegionPolicyPrototype(region RegionIdentityIntf) (_model *BackupPolicyPlanRemoteRegionPolicyPrototype, err error) { - _model = &BackupPolicyPlanRemoteRegionPolicyPrototype{ - Region: region, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype unmarshals an instance of BackupPolicyPlanRemoteRegionPolicyPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPlanRemoteRegionPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPlanRemoteRegionPolicyPrototype) - err = core.UnmarshalPrimitive(m, "delete_over_count", &obj.DeleteOverCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPrototype : BackupPolicyPrototype struct -// Models which "extend" this model: -// - BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype -// - BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype -type BackupPolicyPrototype struct { - // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - MatchResourceType *string `json:"match_resource_type" validate:"required"` - - // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type - // will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The prototype objects for backup plans to be created for this backup policy. - Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The scope to use for this backup policy. - // - // If unspecified, the policy will be scoped to the account. - Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` - - // The included content for backups created using this policy: - // - `boot_volume`: Include the instance's boot volume. - // - `data_volumes`: Include the instance's data volumes. - IncludedContent []string `json:"included_content,omitempty"` -} - -// Constants associated with the BackupPolicyPrototype.MatchResourceType property. -// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -const ( - BackupPolicyPrototypeMatchResourceTypeInstanceConst = "instance" - BackupPolicyPrototypeMatchResourceTypeVolumeConst = "volume" -) - -// Constants associated with the BackupPolicyPrototype.IncludedContent property. -// An item to include. -const ( - BackupPolicyPrototypeIncludedContentBootVolumeConst = "boot_volume" - BackupPolicyPrototypeIncludedContentDataVolumesConst = "data_volumes" -) - -func (*BackupPolicyPrototype) isaBackupPolicyPrototype() bool { - return true -} - -type BackupPolicyPrototypeIntf interface { - isaBackupPolicyPrototype() bool -} - -// UnmarshalBackupPolicyPrototype unmarshals an instance of BackupPolicyPrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPrototype) - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScope : The scope for this backup policy. -// Models which "extend" this model: -// - BackupPolicyScopeEnterpriseReference -// - BackupPolicyScopeAccountReference -type BackupPolicyScope struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` - - // The unique identifier for this enterprise. - ID *string `json:"id,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the BackupPolicyScope.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeResourceTypeEnterpriseConst = "enterprise" -) - -func (*BackupPolicyScope) isaBackupPolicyScope() bool { - return true -} - -type BackupPolicyScopeIntf interface { - isaBackupPolicyScope() bool -} - -// UnmarshalBackupPolicyScope unmarshals an instance of BackupPolicyScope from the specified map of raw messages. -func UnmarshalBackupPolicyScope(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScope) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScopePrototype : The scope to use for this backup policy. -// -// If unspecified, the policy will be scoped to the account. -// Models which "extend" this model: -// - BackupPolicyScopePrototypeEnterpriseIdentity -type BackupPolicyScopePrototype struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` -} - -func (*BackupPolicyScopePrototype) isaBackupPolicyScopePrototype() bool { - return true -} - -type BackupPolicyScopePrototypeIntf interface { - isaBackupPolicyScopePrototype() bool -} - -// UnmarshalBackupPolicyScopePrototype unmarshals an instance of BackupPolicyScopePrototype from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototype) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServer : BareMetalServer struct -type BareMetalServer struct { - // The total bandwidth (in megabits per second) shared across the bare metal server network attachments or bare metal - // server network interfaces. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // The possible resource types for this property are expected to expand in the future. - BootTarget BareMetalServerBootTargetIntf `json:"boot_target" validate:"required"` - - // The bare metal server CPU configuration. - Cpu *BareMetalServerCpu `json:"cpu" validate:"required"` - - // The date and time that the bare metal server was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this bare metal server. - CRN *string `json:"crn" validate:"required"` - - // The disks for this bare metal server, including any disks that are associated with the - // `boot_target`. - Disks []BareMetalServerDisk `json:"disks" validate:"required"` - - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot" validate:"required"` - - // The URL for this bare metal server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server. - ID *string `json:"id" validate:"required"` - - // The reasons for the current `lifecycle_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []BareMetalServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the bare metal server. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The amount of memory, truncated to whole gibibytes. - Memory *int64 `json:"memory" validate:"required"` - - // The name for this bare metal server. The name is unique across all bare metal servers in the region. - Name *string `json:"name" validate:"required"` - - // The network attachments for this bare metal server, including the primary network attachment. - NetworkAttachments []BareMetalServerNetworkAttachmentReference `json:"network_attachments,omitempty"` - - // The network interfaces for this bare metal server, including the primary network interface. - // - // If this bare metal server has network attachments, each network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface. - NetworkInterfaces []NetworkInterfaceBareMetalServerContextReference `json:"network_interfaces" validate:"required"` - - // The primary network attachment for this bare metal server. - PrimaryNetworkAttachment *BareMetalServerNetworkAttachmentReference `json:"primary_network_attachment,omitempty"` - - // The primary network interface for this bare metal server. - // - // If this bare metal server has network attachments, this primary network interface is - // a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - // of the primary network attachment and its attached virtual network interface. - PrimaryNetworkInterface *NetworkInterfaceBareMetalServerContextReference `json:"primary_network_interface" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - // for this bare metal server. - Profile *BareMetalServerProfileReference `json:"profile" validate:"required"` - - // The resource group for this bare metal server. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the bare metal server. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []BareMetalServerStatusReason `json:"status_reasons" validate:"required"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModule `json:"trusted_platform_module" validate:"required"` - - // The VPC this bare metal server resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this bare metal server resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the BareMetalServer.LifecycleState property. -// The lifecycle state of the bare metal server. -const ( - BareMetalServerLifecycleStateDeletingConst = "deleting" - BareMetalServerLifecycleStateFailedConst = "failed" - BareMetalServerLifecycleStatePendingConst = "pending" - BareMetalServerLifecycleStateStableConst = "stable" - BareMetalServerLifecycleStateSuspendedConst = "suspended" - BareMetalServerLifecycleStateUpdatingConst = "updating" - BareMetalServerLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BareMetalServer.ResourceType property. -// The resource type. -const ( - BareMetalServerResourceTypeBareMetalServerConst = "bare_metal_server" -) - -// Constants associated with the BareMetalServer.Status property. -// The status of the bare metal server. -const ( - BareMetalServerStatusDeletingConst = "deleting" - BareMetalServerStatusFailedConst = "failed" - BareMetalServerStatusMaintenanceConst = "maintenance" - BareMetalServerStatusPendingConst = "pending" - BareMetalServerStatusRestartingConst = "restarting" - BareMetalServerStatusRunningConst = "running" - BareMetalServerStatusStartingConst = "starting" - BareMetalServerStatusStoppedConst = "stopped" - BareMetalServerStatusStoppingConst = "stopping" -) - -// UnmarshalBareMetalServer unmarshals an instance of BareMetalServer from the specified map of raw messages. -func UnmarshalBareMetalServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServer) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_target", &obj.BootTarget, UnmarshalBareMetalServerBootTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "cpu", &obj.Cpu, UnmarshalBareMetalServerCpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalBareMetalServerLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceBareMetalServerContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerNetworkAttachmentReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceBareMetalServerContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBareMetalServerStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerBootTarget : The possible resource types for this property are expected to expand in the future. -// Models which "extend" this model: -// - BareMetalServerBootTargetBareMetalServerDiskReference -type BareMetalServerBootTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server disk. - Href *string `json:"href,omitempty"` - - // The unique identifier for this bare metal server disk. - ID *string `json:"id,omitempty"` - - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the BareMetalServerBootTarget.ResourceType property. -// The resource type. -const ( - BareMetalServerBootTargetResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" -) - -func (*BareMetalServerBootTarget) isaBareMetalServerBootTarget() bool { - return true -} - -type BareMetalServerBootTargetIntf interface { - isaBareMetalServerBootTarget() bool -} - -// UnmarshalBareMetalServerBootTarget unmarshals an instance of BareMetalServerBootTarget from the specified map of raw messages. -func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerBootTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerCpu : The bare metal server CPU configuration. -type BareMetalServerCpu struct { - // The CPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The total number of cores. - CoreCount *int64 `json:"core_count" validate:"required"` - - // The total number of CPU sockets. - SocketCount *int64 `json:"socket_count" validate:"required"` - - // The total number of hardware threads per core. - ThreadsPerCore *int64 `json:"threads_per_core" validate:"required"` -} - -// UnmarshalBareMetalServerCpu unmarshals an instance of BareMetalServerCpu from the specified map of raw messages. -func UnmarshalBareMetalServerCpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "core_count", &obj.CoreCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "threads_per_core", &obj.ThreadsPerCore) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerCollection : BareMetalServerCollection struct -type BareMetalServerCollection struct { - // Collection of bare metal servers. - BareMetalServers []BareMetalServer `json:"bare_metal_servers" validate:"required"` - - // A link to the first page of resources. - First *BareMetalServerCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BareMetalServerCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBareMetalServerCollection unmarshals an instance of BareMetalServerCollection from the specified map of raw messages. -func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollection) - err = core.UnmarshalModel(m, "bare_metal_servers", &obj.BareMetalServers, UnmarshalBareMetalServer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BareMetalServerCollectionFirst : A link to the first page of resources. -type BareMetalServerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerCollectionFirst unmarshals an instance of BareMetalServerCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerCollectionNext unmarshals an instance of BareMetalServerCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerConsoleAccessToken : The bare metal server console access token information. -type BareMetalServerConsoleAccessToken struct { - // A URL safe single-use token used to access the console WebSocket. - AccessToken *string `json:"access_token" validate:"required"` - - // The bare metal server console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` - - // The date and time that the access token was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The date and time that the access token will expire. - ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` - - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force" validate:"required"` - - // The URL to access this bare metal server console. - Href *string `json:"href" validate:"required"` -} - -// Constants associated with the BareMetalServerConsoleAccessToken.ConsoleType property. -// The bare metal server console type for which this token may be used. -const ( - BareMetalServerConsoleAccessTokenConsoleTypeSerialConst = "serial" - BareMetalServerConsoleAccessTokenConsoleTypeVncConst = "vnc" -) - -// UnmarshalBareMetalServerConsoleAccessToken unmarshals an instance of BareMetalServerConsoleAccessToken from the specified map of raw messages. -func UnmarshalBareMetalServerConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerConsoleAccessToken) - err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerDisk : BareMetalServerDisk struct -type BareMetalServerDisk struct { - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this bare metal server disk. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server disk. - ID *string `json:"id" validate:"required"` - - // The disk interface used for attaching the disk. - // - // - `fcp`: Attached using Fiber Channel Protocol - // - `sata`: Attached using Serial Advanced Technology Attachment - // - `nvme`: Attached using Non-Volatile Memory Express - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` -} - -// Constants associated with the BareMetalServerDisk.InterfaceType property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerDiskInterfaceTypeFcpConst = "fcp" - BareMetalServerDiskInterfaceTypeNvmeConst = "nvme" - BareMetalServerDiskInterfaceTypeSataConst = "sata" -) - -// Constants associated with the BareMetalServerDisk.ResourceType property. -// The resource type. -const ( - BareMetalServerDiskResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" -) - -// UnmarshalBareMetalServerDisk unmarshals an instance of BareMetalServerDisk from the specified map of raw messages. -func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDisk) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerDiskCollection : BareMetalServerDiskCollection struct -type BareMetalServerDiskCollection struct { - // Collection of the bare metal server's disks. - Disks []BareMetalServerDisk `json:"disks" validate:"required"` -} - -// UnmarshalBareMetalServerDiskCollection unmarshals an instance of BareMetalServerDiskCollection from the specified map of raw messages. -func UnmarshalBareMetalServerDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerDiskPatch : BareMetalServerDiskPatch struct -type BareMetalServerDiskPatch struct { - // The name for this bare metal server disk. The name must not be used by another disk on the bare metal server. - Name *string `json:"name,omitempty"` -} - -// UnmarshalBareMetalServerDiskPatch unmarshals an instance of BareMetalServerDiskPatch from the specified map of raw messages. -func UnmarshalBareMetalServerDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BareMetalServerDiskPatch -func (bareMetalServerDiskPatch *BareMetalServerDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerDiskReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerDiskReferenceDeleted unmarshals an instance of BareMetalServerDiskReferenceDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerDiskReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerInitialization : BareMetalServerInitialization struct -type BareMetalServerInitialization struct { - // The image the bare metal server was provisioned from. - Image *ImageReference `json:"image" validate:"required"` - - // The public SSH keys used at initialization. - Keys []KeyReference `json:"keys" validate:"required"` - - // The user accounts that are created at initialization. There can be multiple account types distinguished by the - // `resource_type` property. - UserAccounts []BareMetalServerInitializationUserAccountIntf `json:"user_accounts" validate:"required"` -} - -// UnmarshalBareMetalServerInitialization unmarshals an instance of BareMetalServerInitialization from the specified map of raw messages. -func UnmarshalBareMetalServerInitialization(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitialization) - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "user_accounts", &obj.UserAccounts, UnmarshalBareMetalServerInitializationUserAccount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerInitializationPrototype : BareMetalServerInitializationPrototype struct -type BareMetalServerInitializationPrototype struct { - // The image to be used when provisioning the bare metal server. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as - // cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the - // administrative user. - // - // For Windows images, at least one key must be specified, and one will be selected to encrypt the administrator - // password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless - // the specified image provides another means of access. - Keys []KeyIdentityIntf `json:"keys" validate:"required"` - - // User data to be made available when initializing the bare metal server. - UserData *string `json:"user_data,omitempty"` -} - -// NewBareMetalServerInitializationPrototype : Instantiate BareMetalServerInitializationPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerInitializationPrototype(image ImageIdentityIntf, keys []KeyIdentityIntf) (_model *BareMetalServerInitializationPrototype, err error) { - _model = &BareMetalServerInitializationPrototype{ - Image: image, - Keys: keys, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBareMetalServerInitializationPrototype unmarshals an instance of BareMetalServerInitializationPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationPrototype) - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerInitializationUserAccount : BareMetalServerInitializationUserAccount struct -// Models which "extend" this model: -// - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount -type BareMetalServerInitializationUserAccount struct { - // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password,omitempty"` - - // The public SSH key used to encrypt the password. - EncryptionKey *KeyReference `json:"encryption_key,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The username for the account created at initialization. - Username *string `json:"username,omitempty"` -} - -// Constants associated with the BareMetalServerInitializationUserAccount.ResourceType property. -// The resource type. -const ( - BareMetalServerInitializationUserAccountResourceTypeHostUserAccountConst = "host_user_account" -) - -func (*BareMetalServerInitializationUserAccount) isaBareMetalServerInitializationUserAccount() bool { - return true -} - -type BareMetalServerInitializationUserAccountIntf interface { - isaBareMetalServerInitializationUserAccount() bool -} - -// UnmarshalBareMetalServerInitializationUserAccount unmarshals an instance of BareMetalServerInitializationUserAccount from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationUserAccount) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerLifecycleReason : BareMetalServerLifecycleReason struct -type BareMetalServerLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BareMetalServerLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - BareMetalServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalBareMetalServerLifecycleReason unmarshals an instance of BareMetalServerLifecycleReason from the specified map of raw messages. -func UnmarshalBareMetalServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachment : BareMetalServerNetworkAttachment struct -// Models which "extend" this model: -// - BareMetalServerNetworkAttachmentByPci -// - BareMetalServerNetworkAttachmentByVlan -type BareMetalServerNetworkAttachment struct { - // The date and time that the bare metal server network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this bare metal server network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network attachment. - ID *string `json:"id" validate:"required"` - - // The network attachment's interface type: - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The lifecycle state of the bare metal server network attachment. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this bare metal server network attachment. The name is unique across all network attachments for the - // bare metal server. - Name *string `json:"name" validate:"required"` - - // The port speed for this bare metal server network attachment in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - // The primary IP address of the virtual network interface for the bare metal server - // network attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the bare metal server network - // attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network attachment type. - Type *string `json:"type" validate:"required"` - - // The virtual network interface for this bare metal server network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs allowed for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for - // network attachments with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network attachment will be automatically deleted from this bare metal server and a new network attachment with - // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for - // this network attachment will be automatically be attached to the new network attachment. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including - // this network attachment's `vlan`. - AllowToFloat *bool `json:"allow_to_float,omitempty"` - - // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. - Vlan *int64 `json:"vlan,omitempty"` -} - -// Constants associated with the BareMetalServerNetworkAttachment.InterfaceType property. -// The network attachment's interface type: -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerNetworkAttachmentInterfaceTypePciConst = "pci" - BareMetalServerNetworkAttachmentInterfaceTypeVlanConst = "vlan" -) - -// Constants associated with the BareMetalServerNetworkAttachment.LifecycleState property. -// The lifecycle state of the bare metal server network attachment. -const ( - BareMetalServerNetworkAttachmentLifecycleStateDeletingConst = "deleting" - BareMetalServerNetworkAttachmentLifecycleStateFailedConst = "failed" - BareMetalServerNetworkAttachmentLifecycleStatePendingConst = "pending" - BareMetalServerNetworkAttachmentLifecycleStateStableConst = "stable" - BareMetalServerNetworkAttachmentLifecycleStateSuspendedConst = "suspended" - BareMetalServerNetworkAttachmentLifecycleStateUpdatingConst = "updating" - BareMetalServerNetworkAttachmentLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BareMetalServerNetworkAttachment.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkAttachmentResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" -) - -// Constants associated with the BareMetalServerNetworkAttachment.Type property. -// The bare metal server network attachment type. -const ( - BareMetalServerNetworkAttachmentTypePrimaryConst = "primary" - BareMetalServerNetworkAttachmentTypeSecondaryConst = "secondary" -) - -func (*BareMetalServerNetworkAttachment) isaBareMetalServerNetworkAttachment() bool { - return true -} - -type BareMetalServerNetworkAttachmentIntf interface { - isaBareMetalServerNetworkAttachment() bool -} - -// UnmarshalBareMetalServerNetworkAttachment unmarshals an instance of BareMetalServerNetworkAttachment from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachment) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentCollection : BareMetalServerNetworkAttachmentCollection struct -type BareMetalServerNetworkAttachmentCollection struct { - // A link to the first page of resources. - First *BareMetalServerNetworkAttachmentCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of bare metal server network attachments. - NetworkAttachments []BareMetalServerNetworkAttachmentIntf `json:"network_attachments" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BareMetalServerNetworkAttachmentCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkAttachmentCollection unmarshals an instance of BareMetalServerNetworkAttachmentCollection from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkAttachmentCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachment) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkAttachmentCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerNetworkAttachmentCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BareMetalServerNetworkAttachmentCollectionFirst : A link to the first page of resources. -type BareMetalServerNetworkAttachmentCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkAttachmentCollectionFirst unmarshals an instance of BareMetalServerNetworkAttachmentCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerNetworkAttachmentCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkAttachmentCollectionNext unmarshals an instance of BareMetalServerNetworkAttachmentCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPatch : BareMetalServerNetworkAttachmentPatch struct -type BareMetalServerNetworkAttachmentPatch struct { - // The VLAN IDs to allow for `vlan` attachments using this PCI attachment, replacing any existing VLAN IDs. The - // specified values must include IDs for all `vlan` attachments currently using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // The name for this network attachment. The name must not be used by another network attachment for the bare metal - // server. - Name *string `json:"name,omitempty"` -} - -// UnmarshalBareMetalServerNetworkAttachmentPatch unmarshals an instance of BareMetalServerNetworkAttachmentPatch from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPatch) - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BareMetalServerNetworkAttachmentPatch -func (bareMetalServerNetworkAttachmentPatch *BareMetalServerNetworkAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerNetworkAttachmentPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerNetworkAttachmentPrototype : BareMetalServerNetworkAttachmentPrototype struct -// Models which "extend" this model: -// - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype -// - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype -type BareMetalServerNetworkAttachmentPrototype struct { - // The network attachment's interface type: - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The name for this bare metal server network attachment. Names must be unique within the bare metal server the - // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // A virtual network interface for the bare metal server network attachment. This can be - // specified using an existing virtual network interface, or a prototype object for a new - // virtual network interface. - // - // If an existing virtual network interface is specified, it must not be the target of a flow - // log collector. - VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for - // network attachments with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network attachment will be automatically deleted from this bare metal server and a new network attachment with - // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for - // this network attachment will be automatically be attached to the new network attachment. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including - // this network attachment's `vlan`. - AllowToFloat *bool `json:"allow_to_float,omitempty"` - - // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. - Vlan *int64 `json:"vlan,omitempty"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentPrototype.InterfaceType property. -// The network attachment's interface type: -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x` -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkAttachmentPrototypeInterfaceTypePciConst = "pci" - BareMetalServerNetworkAttachmentPrototypeInterfaceTypeVlanConst = "vlan" -) - -func (*BareMetalServerNetworkAttachmentPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { - return true -} - -type BareMetalServerNetworkAttachmentPrototypeIntf interface { - isaBareMetalServerNetworkAttachmentPrototype() bool -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototype) - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface : A virtual network interface for the bare metal server network attachment. This can be specified using an existing -// virtual network interface, or a prototype object for a new virtual network interface. -// -// If an existing virtual network interface is specified, it must not be the target of a flow log collector. -// Models which "extend" this model: -// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext -// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // bare metal server's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf interface { - isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentReference : BareMetalServerNetworkAttachmentReference struct -type BareMetalServerNetworkAttachmentReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network attachment. The name is unique across all network attachments for the - // bare metal server. - Name *string `json:"name" validate:"required"` - - // The primary IP address of the virtual network interface for the bare metal server - // network attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the bare metal server network - // attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentReference.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkAttachmentReferenceResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" -) - -// UnmarshalBareMetalServerNetworkAttachmentReference unmarshals an instance of BareMetalServerNetworkAttachmentReference from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerNetworkAttachmentReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted unmarshals an instance of BareMetalServerNetworkAttachmentReferenceDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterface : BareMetalServerNetworkInterface struct -// Models which "extend" this model: -// - BareMetalServerNetworkInterfaceByHiperSocket -// - BareMetalServerNetworkInterfaceByPci -// - BareMetalServerNetworkInterfaceByVlan -type BareMetalServerNetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. - // - // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding - // network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated - // with the attached virtual network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the interface type is that of the - // corresponding network attachment. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the - // attached virtual network interface. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding - // network attachment. - Name *string `json:"name" validate:"required"` - - // The bare metal server network interface port speed in Mbps. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the port speed is that of its - // corresponding network attachment. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the security groups are associated - // with the attached virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a read-only representation of its - // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network interface type. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the type is that of its - // corresponding network attachment. - Type *string `json:"type" validate:"required"` - - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the - // `allow_vlans` of the corresponding network attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the value of this property matches - // that of the `allow_to_float` property of the corresponding network attachment. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of - // the corresponding network attachment. - Vlan *int64 `json:"vlan,omitempty"` -} - -// Constants associated with the BareMetalServerNetworkInterface.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// -// If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the interface type is that of the -// corresponding network attachment. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerNetworkInterfaceInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerNetworkInterfaceInterfaceTypePciConst = "pci" - BareMetalServerNetworkInterfaceInterfaceTypeVlanConst = "vlan" -) - -// Constants associated with the BareMetalServerNetworkInterface.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterface.Status property. -// The status of the bare metal server network interface. -// -// If this bare metal server has network attachments, this network interface is a read-only representation of its -// corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). -const ( - BareMetalServerNetworkInterfaceStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterface.Type property. -// The bare metal server network interface type. -// -// If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the type is that of its -// corresponding network attachment. -const ( - BareMetalServerNetworkInterfaceTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceTypeSecondaryConst = "secondary" -) - -func (*BareMetalServerNetworkInterface) isaBareMetalServerNetworkInterface() bool { - return true -} - -type BareMetalServerNetworkInterfaceIntf interface { - isaBareMetalServerNetworkInterface() bool -} - -// UnmarshalBareMetalServerNetworkInterface unmarshals an instance of BareMetalServerNetworkInterface from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "interface_type", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") - return - } - if discValue == "hipersocket" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByHiperSocket) - } else if discValue == "pci" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByPci) - } else if discValue == "vlan" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByVlan) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) - } - return -} - -// BareMetalServerNetworkInterfaceCollection : BareMetalServerNetworkInterfaceCollection struct -type BareMetalServerNetworkInterfaceCollection struct { - // A link to the first page of resources. - First *BareMetalServerNetworkInterfaceCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of bare metal server network interfaces. - NetworkInterfaces []BareMetalServerNetworkInterfaceIntf `json:"network_interfaces" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BareMetalServerNetworkInterfaceCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceCollection unmarshals an instance of BareMetalServerNetworkInterfaceCollection from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkInterfaceCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkInterfaceCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerNetworkInterfaceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BareMetalServerNetworkInterfaceCollectionFirst : A link to the first page of resources. -type BareMetalServerNetworkInterfaceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceCollectionFirst unmarshals an instance of BareMetalServerNetworkInterfaceCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerNetworkInterfaceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceCollectionNext unmarshals an instance of BareMetalServerNetworkInterfaceCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfacePatch : BareMetalServerNetworkInterfacePatch struct -type BareMetalServerNetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface, replacing any existing VLAN IDs. The specified - // values must include IDs for all `vlan` interfaces currently using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. - Name *string `json:"name,omitempty"` -} - -// UnmarshalBareMetalServerNetworkInterfacePatch unmarshals an instance of BareMetalServerNetworkInterfacePatch from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BareMetalServerNetworkInterfacePatch -func (bareMetalServerNetworkInterfacePatch *BareMetalServerNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerNetworkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerNetworkInterfacePrototype : BareMetalServerNetworkInterfacePrototype struct -// Models which "extend" this model: -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype -// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype -type BareMetalServerNetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - // array of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the bare metal server network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the value of this property matches - // that of the `allow_to_float` property of the corresponding network attachment. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of - // the corresponding network attachment. - Vlan *int64 `json:"vlan,omitempty"` -} - -// Constants associated with the BareMetalServerNetworkInterfacePrototype.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x` -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its -// array of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerNetworkInterfacePrototypeInterfaceTypePciConst = "pci" - BareMetalServerNetworkInterfacePrototypeInterfaceTypeVlanConst = "vlan" -) - -func (*BareMetalServerNetworkInterfacePrototype) isaBareMetalServerNetworkInterfacePrototype() bool { - return true -} - -type BareMetalServerNetworkInterfacePrototypeIntf interface { - isaBareMetalServerNetworkInterfacePrototype() bool -} - -// UnmarshalBareMetalServerNetworkInterfacePrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "interface_type", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") - return - } - if discValue == "hipersocket" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) - } else if discValue == "pci" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) - } else if discValue == "vlan" { - err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) - } - return -} - -// BareMetalServerNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerNetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type BareMetalServerNetworkInterfaceReferenceTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPatch : BareMetalServerPatch struct -type BareMetalServerPatch struct { - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the bare metal server - // will fail to boot. - // - // For `enable_secure_boot` to be changed, the bare metal server `status` must be - // `stopped`. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - - // The name for this bare metal server. The name must not be used by another bare metal server in the region. Changing - // the name will not affect the system hostname. - Name *string `json:"name,omitempty"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePatch `json:"trusted_platform_module,omitempty"` -} - -// UnmarshalBareMetalServerPatch unmarshals an instance of BareMetalServerPatch from the specified map of raw messages. -func UnmarshalBareMetalServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPatch) - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the BareMetalServerPatch -func (bareMetalServerPatch *BareMetalServerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(bareMetalServerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// BareMetalServerPrimaryNetworkAttachmentPrototype : BareMetalServerPrimaryNetworkAttachmentPrototype struct -// Models which "extend" this model: -// - BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype -type BareMetalServerPrimaryNetworkAttachmentPrototype struct { - // The network attachment's interface type: - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type,omitempty"` - - // The name for this bare metal server network attachment. Names must be unique within the bare metal server the - // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // A virtual network interface for the bare metal server network attachment. This can be - // specified using an existing virtual network interface, or a prototype object for a new - // virtual network interface. - // - // If an existing virtual network interface is specified, it must not be the target of a flow - // log collector. - VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -} - -// Constants associated with the BareMetalServerPrimaryNetworkAttachmentPrototype.InterfaceType property. -// The network attachment's interface type: -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerPrimaryNetworkAttachmentPrototypeInterfaceTypePciConst = "pci" -) - -func (*BareMetalServerPrimaryNetworkAttachmentPrototype) isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool { - return true -} - -type BareMetalServerPrimaryNetworkAttachmentPrototypeIntf interface { - isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool -} - -// UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype unmarshals an instance of BareMetalServerPrimaryNetworkAttachmentPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrimaryNetworkAttachmentPrototype) - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPrimaryNetworkInterfacePrototype : BareMetalServerPrimaryNetworkInterfacePrototype struct -type BareMetalServerPrimaryNetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the - // `allow_vlans` of the corresponding network attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The interface type: - // - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the bare metal server network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -} - -// Constants associated with the BareMetalServerPrimaryNetworkInterfacePrototype.InterfaceType property. -// The interface type: -// - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64` -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypeHipersocketConst = "hipersocket" - BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypePciConst = "pci" -) - -// NewBareMetalServerPrimaryNetworkInterfacePrototype : Instantiate BareMetalServerPrimaryNetworkInterfacePrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerPrimaryNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *BareMetalServerPrimaryNetworkInterfacePrototype, err error) { - _model = &BareMetalServerPrimaryNetworkInterfacePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype unmarshals an instance of BareMetalServerPrimaryNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrimaryNetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfile : BareMetalServerProfile struct -type BareMetalServerProfile struct { - Bandwidth BareMetalServerProfileBandwidthIntf `json:"bandwidth" validate:"required"` - - // The console type configuration for a bare metal server with this profile. - ConsoleTypes *BareMetalServerProfileConsoleTypes `json:"console_types" validate:"required"` - - CpuArchitecture *BareMetalServerProfileCpuArchitecture `json:"cpu_architecture" validate:"required"` - - CpuCoreCount BareMetalServerProfileCpuCoreCountIntf `json:"cpu_core_count" validate:"required"` - - CpuSocketCount BareMetalServerProfileCpuSocketCountIntf `json:"cpu_socket_count" validate:"required"` - - // Collection of the bare metal server profile's disks. - Disks []BareMetalServerProfileDisk `json:"disks" validate:"required"` - - // The product family this bare metal server profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this bare metal server profile. - Href *string `json:"href" validate:"required"` - - Memory BareMetalServerProfileMemoryIntf `json:"memory" validate:"required"` - - // The name for this bare metal server profile. - Name *string `json:"name" validate:"required"` - - NetworkAttachmentCount BareMetalServerProfileNetworkAttachmentCountIntf `json:"network_attachment_count" validate:"required"` - - NetworkInterfaceCount BareMetalServerProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` - - OsArchitecture *BareMetalServerProfileOsArchitecture `json:"os_architecture" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The supported trusted platform module modes for this bare metal server profile. - SupportedTrustedPlatformModuleModes *BareMetalServerProfileSupportedTrustedPlatformModuleModes `json:"supported_trusted_platform_module_modes" validate:"required"` - - // Indicates whether this profile supports virtual network interfaces. - VirtualNetworkInterfacesSupported *BareMetalServerProfileVirtualNetworkInterfacesSupported `json:"virtual_network_interfaces_supported" validate:"required"` -} - -// Constants associated with the BareMetalServerProfile.ResourceType property. -// The resource type. -const ( - BareMetalServerProfileResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" -) - -// UnmarshalBareMetalServerProfile unmarshals an instance of BareMetalServerProfile from the specified map of raw messages. -func UnmarshalBareMetalServerProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfile) - err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalBareMetalServerProfileBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "console_types", &obj.ConsoleTypes, UnmarshalBareMetalServerProfileConsoleTypes) - if err != nil { - return - } - err = core.UnmarshalModel(m, "cpu_architecture", &obj.CpuArchitecture, UnmarshalBareMetalServerProfileCpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "cpu_core_count", &obj.CpuCoreCount, UnmarshalBareMetalServerProfileCpuCoreCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "cpu_socket_count", &obj.CpuSocketCount, UnmarshalBareMetalServerProfileCpuSocketCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerProfileDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalBareMetalServerProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachment_count", &obj.NetworkAttachmentCount, UnmarshalBareMetalServerProfileNetworkAttachmentCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalBareMetalServerProfileNetworkInterfaceCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalBareMetalServerProfileOsArchitecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_trusted_platform_module_modes", &obj.SupportedTrustedPlatformModuleModes, UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interfaces_supported", &obj.VirtualNetworkInterfacesSupported, UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidth : BareMetalServerProfileBandwidth struct -// Models which "extend" this model: -// - BareMetalServerProfileBandwidthFixed -// - BareMetalServerProfileBandwidthRange -// - BareMetalServerProfileBandwidthEnum -// - BareMetalServerProfileBandwidthDependent -type BareMetalServerProfileBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileBandwidth.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileBandwidth) isaBareMetalServerProfileBandwidth() bool { - return true -} - -type BareMetalServerProfileBandwidthIntf interface { - isaBareMetalServerProfileBandwidth() bool -} - -// UnmarshalBareMetalServerProfileBandwidth unmarshals an instance of BareMetalServerProfileBandwidth from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuArchitecture : BareMetalServerProfileCpuArchitecture struct -type BareMetalServerProfileCpuArchitecture struct { - // The default CPU architecture for a bare metal server with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The CPU architecture for a bare metal server with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuArchitecture.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuArchitectureTypeFixedConst = "fixed" -) - -// UnmarshalBareMetalServerProfileCpuArchitecture unmarshals an instance of BareMetalServerProfileCpuArchitecture from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCount : BareMetalServerProfileCpuCoreCount struct -// Models which "extend" this model: -// - BareMetalServerProfileCpuCoreCountFixed -// - BareMetalServerProfileCpuCoreCountRange -// - BareMetalServerProfileCpuCoreCountEnum -// - BareMetalServerProfileCpuCoreCountDependent -type BareMetalServerProfileCpuCoreCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCount.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileCpuCoreCount) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -type BareMetalServerProfileCpuCoreCountIntf interface { - isaBareMetalServerProfileCpuCoreCount() bool -} - -// UnmarshalBareMetalServerProfileCpuCoreCount unmarshals an instance of BareMetalServerProfileCpuCoreCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuSocketCount : BareMetalServerProfileCpuSocketCount struct -// Models which "extend" this model: -// - BareMetalServerProfileCpuSocketCountFixed -// - BareMetalServerProfileCpuSocketCountRange -// - BareMetalServerProfileCpuSocketCountEnum -// - BareMetalServerProfileCpuSocketCountDependent -type BareMetalServerProfileCpuSocketCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileCpuSocketCount.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileCpuSocketCount) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} - -type BareMetalServerProfileCpuSocketCountIntf interface { - isaBareMetalServerProfileCpuSocketCount() bool -} - -// UnmarshalBareMetalServerProfileCpuSocketCount unmarshals an instance of BareMetalServerProfileCpuSocketCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCollection : BareMetalServerProfileCollection struct -type BareMetalServerProfileCollection struct { - // A link to the first page of resources. - First *BareMetalServerProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *BareMetalServerProfileCollectionNext `json:"next,omitempty"` - - // Collection of bare metal server profiles. - Profiles []BareMetalServerProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalBareMetalServerProfileCollection unmarshals an instance of BareMetalServerProfileCollection from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalBareMetalServerProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *BareMetalServerProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// BareMetalServerProfileCollectionFirst : A link to the first page of resources. -type BareMetalServerProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerProfileCollectionFirst unmarshals an instance of BareMetalServerProfileCollectionFirst from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type BareMetalServerProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalBareMetalServerProfileCollectionNext unmarshals an instance of BareMetalServerProfileCollectionNext from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileConsoleTypes : The console type configuration for a bare metal server with this profile. -type BareMetalServerProfileConsoleTypes struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The console types for a bare metal server with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileConsoleTypes.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileConsoleTypesTypeEnumConst = "enum" -) - -// Constants associated with the BareMetalServerProfileConsoleTypes.Values property. -// A console type. -const ( - BareMetalServerProfileConsoleTypesValuesSerialConst = "serial" - BareMetalServerProfileConsoleTypesValuesVncConst = "vnc" -) - -// UnmarshalBareMetalServerProfileConsoleTypes unmarshals an instance of BareMetalServerProfileConsoleTypes from the specified map of raw messages. -func UnmarshalBareMetalServerProfileConsoleTypes(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileConsoleTypes) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDisk : Disks provided by this profile. -type BareMetalServerProfileDisk struct { - Quantity BareMetalServerProfileDiskQuantityIntf `json:"quantity" validate:"required"` - - Size BareMetalServerProfileDiskSizeIntf `json:"size" validate:"required"` - - SupportedInterfaceTypes *BareMetalServerProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` -} - -// UnmarshalBareMetalServerProfileDisk unmarshals an instance of BareMetalServerProfileDisk from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDisk) - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalBareMetalServerProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalBareMetalServerProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalBareMetalServerProfileDiskSupportedInterfaces) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskQuantity : BareMetalServerProfileDiskQuantity struct -// Models which "extend" this model: -// - BareMetalServerProfileDiskQuantityFixed -// - BareMetalServerProfileDiskQuantityRange -// - BareMetalServerProfileDiskQuantityEnum -// - BareMetalServerProfileDiskQuantityDependent -type BareMetalServerProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileDiskQuantity.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskQuantityTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileDiskQuantity) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -type BareMetalServerProfileDiskQuantityIntf interface { - isaBareMetalServerProfileDiskQuantity() bool -} - -// UnmarshalBareMetalServerProfileDiskQuantity unmarshals an instance of BareMetalServerProfileDiskQuantity from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSize : BareMetalServerProfileDiskSize struct -// Models which "extend" this model: -// - BareMetalServerProfileDiskSizeFixed -// - BareMetalServerProfileDiskSizeRange -// - BareMetalServerProfileDiskSizeEnum -// - BareMetalServerProfileDiskSizeDependent -type BareMetalServerProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileDiskSize.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileDiskSize) isaBareMetalServerProfileDiskSize() bool { - return true -} - -type BareMetalServerProfileDiskSizeIntf interface { - isaBareMetalServerProfileDiskSize() bool -} - -// UnmarshalBareMetalServerProfileDiskSize unmarshals an instance of BareMetalServerProfileDiskSize from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSupportedInterfaces : BareMetalServerProfileDiskSupportedInterfaces struct -type BareMetalServerProfileDiskSupportedInterfaces struct { - // The disk interface used for attaching the disk. - // - // - `fcp`: Attached using Fiber Channel Protocol - // - `sata`: Attached using Serial Advanced Technology Attachment - // - `nvme`: Attached using Non-Volatile Memory Express - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported disk interfaces used for attaching the disk. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Default property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileDiskSupportedInterfacesDefaultFcpConst = "fcp" - BareMetalServerProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" - BareMetalServerProfileDiskSupportedInterfacesDefaultSataConst = "sata" -) - -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSupportedInterfacesTypeEnumConst = "enum" -) - -// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Values property. -// The disk interface used for attaching the disk. -// -// - `fcp`: Attached using Fiber Channel Protocol -// - `sata`: Attached using Serial Advanced Technology Attachment -// - `nvme`: Attached using Non-Volatile Memory Express -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileDiskSupportedInterfacesValuesFcpConst = "fcp" - BareMetalServerProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" - BareMetalServerProfileDiskSupportedInterfacesValuesSataConst = "sata" -) - -// UnmarshalBareMetalServerProfileDiskSupportedInterfaces unmarshals an instance of BareMetalServerProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileIdentity : Identifies a bare metal server profile by a unique property. -// Models which "extend" this model: -// - BareMetalServerProfileIdentityByName -// - BareMetalServerProfileIdentityByHref -type BareMetalServerProfileIdentity struct { - // The name for this bare metal server profile. - Name *string `json:"name,omitempty"` - - // The URL for this bare metal server profile. - Href *string `json:"href,omitempty"` -} - -func (*BareMetalServerProfileIdentity) isaBareMetalServerProfileIdentity() bool { - return true -} - -type BareMetalServerProfileIdentityIntf interface { - isaBareMetalServerProfileIdentity() bool -} - -// UnmarshalBareMetalServerProfileIdentity unmarshals an instance of BareMetalServerProfileIdentity from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemory : BareMetalServerProfileMemory struct -// Models which "extend" this model: -// - BareMetalServerProfileMemoryFixed -// - BareMetalServerProfileMemoryRange -// - BareMetalServerProfileMemoryEnum -// - BareMetalServerProfileMemoryDependent -type BareMetalServerProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the BareMetalServerProfileMemory.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileMemoryTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileMemory) isaBareMetalServerProfileMemory() bool { - return true -} - -type BareMetalServerProfileMemoryIntf interface { - isaBareMetalServerProfileMemory() bool -} - -// UnmarshalBareMetalServerProfileMemory unmarshals an instance of BareMetalServerProfileMemory from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkAttachmentCount : BareMetalServerProfileNetworkAttachmentCount struct -// Models which "extend" this model: -// - BareMetalServerProfileNetworkAttachmentCountRange -// - BareMetalServerProfileNetworkAttachmentCountDependent -type BareMetalServerProfileNetworkAttachmentCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the BareMetalServerProfileNetworkAttachmentCount.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkAttachmentCountTypeRangeConst = "range" -) - -func (*BareMetalServerProfileNetworkAttachmentCount) isaBareMetalServerProfileNetworkAttachmentCount() bool { - return true -} - -type BareMetalServerProfileNetworkAttachmentCountIntf interface { - isaBareMetalServerProfileNetworkAttachmentCount() bool -} - -// UnmarshalBareMetalServerProfileNetworkAttachmentCount unmarshals an instance of BareMetalServerProfileNetworkAttachmentCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkAttachmentCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkAttachmentCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkInterfaceCount : BareMetalServerProfileNetworkInterfaceCount struct -// Models which "extend" this model: -// - BareMetalServerProfileNetworkInterfaceCountRange -// - BareMetalServerProfileNetworkInterfaceCountDependent -type BareMetalServerProfileNetworkInterfaceCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the BareMetalServerProfileNetworkInterfaceCount.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkInterfaceCountTypeRangeConst = "range" -) - -func (*BareMetalServerProfileNetworkInterfaceCount) isaBareMetalServerProfileNetworkInterfaceCount() bool { - return true -} - -type BareMetalServerProfileNetworkInterfaceCountIntf interface { - isaBareMetalServerProfileNetworkInterfaceCount() bool -} - -// UnmarshalBareMetalServerProfileNetworkInterfaceCount unmarshals an instance of BareMetalServerProfileNetworkInterfaceCount from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileOsArchitecture : BareMetalServerProfileOsArchitecture struct -type BareMetalServerProfileOsArchitecture struct { - // The default OS architecture for a bare metal server with this profile. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported OS architecture(s) for a bare metal server with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileOsArchitecture.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileOsArchitectureTypeEnumConst = "enum" -) - -// UnmarshalBareMetalServerProfileOsArchitecture unmarshals an instance of BareMetalServerProfileOsArchitecture from the specified map of raw messages. -func UnmarshalBareMetalServerProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileOsArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileReference : BareMetalServerProfileReference struct -type BareMetalServerProfileReference struct { - // The URL for this bare metal server profile. - Href *string `json:"href" validate:"required"` - - // The name for this bare metal server profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileReference.ResourceType property. -// The resource type. -const ( - BareMetalServerProfileReferenceResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" -) - -// UnmarshalBareMetalServerProfileReference unmarshals an instance of BareMetalServerProfileReference from the specified map of raw messages. -func UnmarshalBareMetalServerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module modes for this bare metal server profile. -type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported trusted platform module modes. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileSupportedTrustedPlatformModuleModesTypeEnumConst = "enum" -) - -// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Values property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesDisabledConst = "disabled" - BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes unmarshals an instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes from the specified map of raw messages. -func UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileSupportedTrustedPlatformModuleModes) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileVirtualNetworkInterfacesSupported : Indicates whether this profile supports virtual network interfaces. -type BareMetalServerProfileVirtualNetworkInterfacesSupported struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileVirtualNetworkInterfacesSupported.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileVirtualNetworkInterfacesSupportedTypeFixedConst = "fixed" -) - -// UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported unmarshals an instance of BareMetalServerProfileVirtualNetworkInterfacesSupported from the specified map of raw messages. -func UnmarshalBareMetalServerProfileVirtualNetworkInterfacesSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileVirtualNetworkInterfacesSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPrototype : BareMetalServerPrototype struct -// Models which "extend" this model: -// - BareMetalServerPrototypeBareMetalServerByNetworkAttachment -// - BareMetalServerPrototypeBareMetalServerByNetworkInterface -type BareMetalServerPrototype struct { - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - - Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - - // The name for this bare metal server. The name must not be used by another bare metal server in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - // to use for this bare metal server. - Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The zone this bare metal server will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the bare metal server. - NetworkAttachments []BareMetalServerNetworkAttachmentPrototypeIntf `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the bare metal server. - PrimaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf `json:"primary_network_attachment,omitempty"` - - // The additional bare metal server network interfaces to create. - NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` - - // The primary bare metal server network interface to create. - PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*BareMetalServerPrototype) isaBareMetalServerPrototype() bool { - return true -} - -type BareMetalServerPrototypeIntf interface { - isaBareMetalServerPrototype() bool -} - -// UnmarshalBareMetalServerPrototype unmarshals an instance of BareMetalServerPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrototype) - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerStatusReason : BareMetalServerStatusReason struct -type BareMetalServerStatusReason struct { - // The status reason code: - // - `cannot_start`: Failed to start due to an internal error - // - `cannot_start_capacity`: Insufficient capacity within the selected zone - // - `cannot_start_compute`: An error occurred while allocating compute resources - // - `cannot_start_ip_address`: An error occurred while allocating an IP address - // - `cannot_start_network`: An error occurred while allocating network resources. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the BareMetalServerStatusReason.Code property. -// The status reason code: -// - `cannot_start`: Failed to start due to an internal error -// - `cannot_start_capacity`: Insufficient capacity within the selected zone -// - `cannot_start_compute`: An error occurred while allocating compute resources -// - `cannot_start_ip_address`: An error occurred while allocating an IP address -// - `cannot_start_network`: An error occurred while allocating network resources. -const ( - BareMetalServerStatusReasonCodeCannotStartConst = "cannot_start" - BareMetalServerStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - BareMetalServerStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - BareMetalServerStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - BareMetalServerStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" -) - -// UnmarshalBareMetalServerStatusReason unmarshals an instance of BareMetalServerStatusReason from the specified map of raw messages. -func UnmarshalBareMetalServerStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerTrustedPlatformModule : BareMetalServerTrustedPlatformModule struct -type BareMetalServerTrustedPlatformModule struct { - // Indicates whether the trusted platform module is enabled. - Enabled *bool `json:"enabled" validate:"required"` - - // The trusted platform module (TPM) mode: - // - `disabled`: No TPM functionality - // - `tpm_2`: TPM 2.0 - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Mode *string `json:"mode" validate:"required"` - - // The supported trusted platform module modes. - SupportedModes []string `json:"supported_modes" validate:"required"` -} - -// Constants associated with the BareMetalServerTrustedPlatformModule.Mode property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerTrustedPlatformModuleModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModuleModeTpm2Const = "tpm_2" -) - -// Constants associated with the BareMetalServerTrustedPlatformModule.SupportedModes property. -// The trusted platform module (TPM) mode: -// - `disabled`: No TPM functionality -// - `tpm_2`: TPM 2.0 -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - BareMetalServerTrustedPlatformModuleSupportedModesDisabledConst = "disabled" - BareMetalServerTrustedPlatformModuleSupportedModesTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerTrustedPlatformModule unmarshals an instance of BareMetalServerTrustedPlatformModule from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModule(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModule) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "supported_modes", &obj.SupportedModes) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerTrustedPlatformModulePatch : BareMetalServerTrustedPlatformModulePatch struct -type BareMetalServerTrustedPlatformModulePatch struct { - // The trusted platform module mode to use. The specified value must be listed in the bare metal server's - // `supported_modes`. - // - // For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the BareMetalServerTrustedPlatformModulePatch.Mode property. -// The trusted platform module mode to use. The specified value must be listed in the bare metal server's -// `supported_modes`. -// -// For the trusted platform module mode to be changed, the bare metal server `status` must be `stopped`. -const ( - BareMetalServerTrustedPlatformModulePatchModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModulePatchModeTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerTrustedPlatformModulePatch unmarshals an instance of BareMetalServerTrustedPlatformModulePatch from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModulePatch) - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerTrustedPlatformModulePrototype : BareMetalServerTrustedPlatformModulePrototype struct -type BareMetalServerTrustedPlatformModulePrototype struct { - // The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's - // `supported_trusted_platform_module_modes`. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the BareMetalServerTrustedPlatformModulePrototype.Mode property. -// The trusted platform module mode to use. The specified value must be listed in the bare metal server profile's -// `supported_trusted_platform_module_modes`. -const ( - BareMetalServerTrustedPlatformModulePrototypeModeDisabledConst = "disabled" - BareMetalServerTrustedPlatformModulePrototypeModeTpm2Const = "tpm_2" -) - -// UnmarshalBareMetalServerTrustedPlatformModulePrototype unmarshals an instance of BareMetalServerTrustedPlatformModulePrototype from the specified map of raw messages. -func UnmarshalBareMetalServerTrustedPlatformModulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerTrustedPlatformModulePrototype) - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingIdentity : Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique -// property. -// Models which "extend" this model: -// - CatalogOfferingIdentityCatalogOfferingByCRN -type CatalogOfferingIdentity struct { - // The CRN for this - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn,omitempty"` -} - -func (*CatalogOfferingIdentity) isaCatalogOfferingIdentity() bool { - return true -} - -type CatalogOfferingIdentityIntf interface { - isaCatalogOfferingIdentity() bool -} - -// UnmarshalCatalogOfferingIdentity unmarshals an instance of CatalogOfferingIdentity from the specified map of raw messages. -func UnmarshalCatalogOfferingIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingVersionIdentity : Identifies a version of a -// [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique property. -// Models which "extend" this model: -// - CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN -type CatalogOfferingVersionIdentity struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn,omitempty"` -} - -func (*CatalogOfferingVersionIdentity) isaCatalogOfferingVersionIdentity() bool { - return true -} - -type CatalogOfferingVersionIdentityIntf interface { - isaCatalogOfferingVersionIdentity() bool -} - -// UnmarshalCatalogOfferingVersionIdentity unmarshals an instance of CatalogOfferingVersionIdentity from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingVersionReference : CatalogOfferingVersionReference struct -type CatalogOfferingVersionReference struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} - -// UnmarshalCatalogOfferingVersionReference unmarshals an instance of CatalogOfferingVersionReference from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CertificateInstanceIdentity : Identifies a certificate instance by a unique property. -// Models which "extend" this model: -// - CertificateInstanceIdentityByCRN -type CertificateInstanceIdentity struct { - // The CRN for this certificate instance. - CRN *string `json:"crn,omitempty"` -} - -func (*CertificateInstanceIdentity) isaCertificateInstanceIdentity() bool { - return true -} - -type CertificateInstanceIdentityIntf interface { - isaCertificateInstanceIdentity() bool -} - -// UnmarshalCertificateInstanceIdentity unmarshals an instance of CertificateInstanceIdentity from the specified map of raw messages. -func UnmarshalCertificateInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CertificateInstanceReference : CertificateInstanceReference struct -type CertificateInstanceReference struct { - // The CRN for this certificate instance. - CRN *string `json:"crn" validate:"required"` -} - -// UnmarshalCertificateInstanceReference unmarshals an instance of CertificateInstanceReference from the specified map of raw messages. -func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CheckVPNGatewayConnectionLocalCIDROptions : The CheckVPNGatewayConnectionLocalCIDR options. -type CheckVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCheckVPNGatewayConnectionLocalCIDROptions : Instantiate CheckVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - return &CheckVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetID(id string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} - -// CheckVPNGatewayConnectionPeerCIDROptions : The CheckVPNGatewayConnectionPeerCIDR options. -type CheckVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCheckVPNGatewayConnectionPeerCIDROptions : Instantiate CheckVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - return &CheckVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetID(id string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} - -// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName -// - CloudObjectStorageBucketIdentityByCRN -type CloudObjectStorageBucketIdentity struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name,omitempty"` - - // The CRN of this Cloud Object Storage bucket. - CRN *string `json:"crn,omitempty"` -} - -func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -type CloudObjectStorageBucketIdentityIntf interface { - isaCloudObjectStorageBucketIdentity() bool -} - -// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct -type CloudObjectStorageBucketReference struct { - // The CRN of this Cloud Object Storage bucket. - CRN *string `json:"crn" validate:"required"` - - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageObjectReference : CloudObjectStorageObjectReference struct -type CloudObjectStorageObjectReference struct { - // The name of this Cloud Object Storage object. Names are unique within a Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalCloudObjectStorageObjectReference unmarshals an instance of CloudObjectStorageObjectReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageObjectReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageObjectReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CreateBackupPolicyOptions : The CreateBackupPolicy options. -type CreateBackupPolicyOptions struct { - // The backup policy prototype object. - BackupPolicyPrototype BackupPolicyPrototypeIntf `json:"BackupPolicyPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateBackupPolicyOptions : Instantiate CreateBackupPolicyOptions -func (*VpcV1) NewCreateBackupPolicyOptions(backupPolicyPrototype BackupPolicyPrototypeIntf) *CreateBackupPolicyOptions { - return &CreateBackupPolicyOptions{ - BackupPolicyPrototype: backupPolicyPrototype, - } -} - -// SetBackupPolicyPrototype : Allow user to set BackupPolicyPrototype -func (_options *CreateBackupPolicyOptions) SetBackupPolicyPrototype(backupPolicyPrototype BackupPolicyPrototypeIntf) *CreateBackupPolicyOptions { - _options.BackupPolicyPrototype = backupPolicyPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBackupPolicyOptions) SetHeaders(param map[string]string) *CreateBackupPolicyOptions { - options.Headers = param - return options -} - -// CreateBackupPolicyPlanOptions : The CreateBackupPolicyPlan options. -type CreateBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The cron specification for the backup schedule. The backup policy jobs - // (which create and delete backups for this plan) will not start until this time, and may start for up to 90 minutes - // after this time. - // - // All backup schedules for plans in the same policy must be at least an hour apart. - CronSpec *string `json:"cron_spec" validate:"required"` - - // Indicates whether the plan is active. - Active *bool `json:"active,omitempty"` - - // User tags to attach to each backup (snapshot) created by this plan. If unspecified, no user tags will be attached. - AttachUserTags []string `json:"attach_user_tags,omitempty"` - - ClonePolicy *BackupPolicyPlanClonePolicyPrototype `json:"clone_policy,omitempty"` - - // Indicates whether to copy the source's user tags to the created backups (snapshots). - CopyUserTags *bool `json:"copy_user_tags,omitempty"` - - DeletionTrigger *BackupPolicyPlanDeletionTriggerPrototype `json:"deletion_trigger,omitempty"` - - // The name for this backup policy plan. The name must not be used by another plan for the backup policy. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The policies for additional backups in remote regions. - RemoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype `json:"remote_region_policies,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateBackupPolicyPlanOptions : Instantiate CreateBackupPolicyPlanOptions -func (*VpcV1) NewCreateBackupPolicyPlanOptions(backupPolicyID string, cronSpec string) *CreateBackupPolicyPlanOptions { - return &CreateBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - CronSpec: core.StringPtr(cronSpec), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *CreateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *CreateBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetCronSpec : Allow user to set CronSpec -func (_options *CreateBackupPolicyPlanOptions) SetCronSpec(cronSpec string) *CreateBackupPolicyPlanOptions { - _options.CronSpec = core.StringPtr(cronSpec) - return _options -} - -// SetActive : Allow user to set Active -func (_options *CreateBackupPolicyPlanOptions) SetActive(active bool) *CreateBackupPolicyPlanOptions { - _options.Active = core.BoolPtr(active) - return _options -} - -// SetAttachUserTags : Allow user to set AttachUserTags -func (_options *CreateBackupPolicyPlanOptions) SetAttachUserTags(attachUserTags []string) *CreateBackupPolicyPlanOptions { - _options.AttachUserTags = attachUserTags - return _options -} - -// SetClonePolicy : Allow user to set ClonePolicy -func (_options *CreateBackupPolicyPlanOptions) SetClonePolicy(clonePolicy *BackupPolicyPlanClonePolicyPrototype) *CreateBackupPolicyPlanOptions { - _options.ClonePolicy = clonePolicy - return _options -} - -// SetCopyUserTags : Allow user to set CopyUserTags -func (_options *CreateBackupPolicyPlanOptions) SetCopyUserTags(copyUserTags bool) *CreateBackupPolicyPlanOptions { - _options.CopyUserTags = core.BoolPtr(copyUserTags) - return _options -} - -// SetDeletionTrigger : Allow user to set DeletionTrigger -func (_options *CreateBackupPolicyPlanOptions) SetDeletionTrigger(deletionTrigger *BackupPolicyPlanDeletionTriggerPrototype) *CreateBackupPolicyPlanOptions { - _options.DeletionTrigger = deletionTrigger - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateBackupPolicyPlanOptions) SetName(name string) *CreateBackupPolicyPlanOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetRemoteRegionPolicies : Allow user to set RemoteRegionPolicies -func (_options *CreateBackupPolicyPlanOptions) SetRemoteRegionPolicies(remoteRegionPolicies []BackupPolicyPlanRemoteRegionPolicyPrototype) *CreateBackupPolicyPlanOptions { - _options.RemoteRegionPolicies = remoteRegionPolicies - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *CreateBackupPolicyPlanOptions { - options.Headers = param - return options -} - -// CreateBareMetalServerConsoleAccessTokenOptions : The CreateBareMetalServerConsoleAccessToken options. -type CreateBareMetalServerConsoleAccessTokenOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server console type for which this token may be used - // - // Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. - ConsoleType *string `json:"console_type" validate:"required"` - - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateBareMetalServerConsoleAccessTokenOptions.ConsoleType property. -// The bare metal server console type for which this token may be used -// -// Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. -const ( - CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" - CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" -) - -// NewCreateBareMetalServerConsoleAccessTokenOptions : Instantiate CreateBareMetalServerConsoleAccessTokenOptions -func (*VpcV1) NewCreateBareMetalServerConsoleAccessTokenOptions(bareMetalServerID string, consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { - return &CreateBareMetalServerConsoleAccessTokenOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ConsoleType: core.StringPtr(consoleType), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetConsoleType : Allow user to set ConsoleType -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.ConsoleType = core.StringPtr(consoleType) - return _options -} - -// SetForce : Allow user to set Force -func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetForce(force bool) *CreateBareMetalServerConsoleAccessTokenOptions { - _options.Force = core.BoolPtr(force) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateBareMetalServerConsoleAccessTokenOptions { - options.Headers = param - return options -} - -// CreateBareMetalServerNetworkAttachmentOptions : The CreateBareMetalServerNetworkAttachment options. -type CreateBareMetalServerNetworkAttachmentOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network attachment prototype object. - BareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf `json:"BareMetalServerNetworkAttachmentPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateBareMetalServerNetworkAttachmentOptions : Instantiate CreateBareMetalServerNetworkAttachmentOptions -func (*VpcV1) NewCreateBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, bareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf) *CreateBareMetalServerNetworkAttachmentOptions { - return &CreateBareMetalServerNetworkAttachmentOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - BareMetalServerNetworkAttachmentPrototype: bareMetalServerNetworkAttachmentPrototype, - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *CreateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetBareMetalServerNetworkAttachmentPrototype : Allow user to set BareMetalServerNetworkAttachmentPrototype -func (_options *CreateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototype BareMetalServerNetworkAttachmentPrototypeIntf) *CreateBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerNetworkAttachmentPrototype = bareMetalServerNetworkAttachmentPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkAttachmentOptions { - options.Headers = param - return options -} - -// CreateBareMetalServerNetworkInterfaceOptions : The CreateBareMetalServerNetworkInterface options. -type CreateBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface prototype object. - BareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf `json:"BareMetalServerNetworkInterfacePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateBareMetalServerNetworkInterfaceOptions : Instantiate CreateBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewCreateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { - return &CreateBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - BareMetalServerNetworkInterfacePrototype: bareMetalServerNetworkInterfacePrototype, - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetBareMetalServerNetworkInterfacePrototype : Allow user to set BareMetalServerNetworkInterfacePrototype -func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} - -// CreateBareMetalServerOptions : The CreateBareMetalServer options. -type CreateBareMetalServerOptions struct { - // The bare metal server prototype object. - BareMetalServerPrototype BareMetalServerPrototypeIntf `json:"BareMetalServerPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateBareMetalServerOptions : Instantiate CreateBareMetalServerOptions -func (*VpcV1) NewCreateBareMetalServerOptions(bareMetalServerPrototype BareMetalServerPrototypeIntf) *CreateBareMetalServerOptions { - return &CreateBareMetalServerOptions{ - BareMetalServerPrototype: bareMetalServerPrototype, - } -} - -// SetBareMetalServerPrototype : Allow user to set BareMetalServerPrototype -func (_options *CreateBareMetalServerOptions) SetBareMetalServerPrototype(bareMetalServerPrototype BareMetalServerPrototypeIntf) *CreateBareMetalServerOptions { - _options.BareMetalServerPrototype = bareMetalServerPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateBareMetalServerOptions) SetHeaders(param map[string]string) *CreateBareMetalServerOptions { - options.Headers = param - return options -} - -// CreateDedicatedHostGroupOptions : The CreateDedicatedHostGroup options. -type CreateDedicatedHostGroupOptions struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class" validate:"required"` - - // The dedicated host profile family for hosts in this group. - Family *string `json:"family" validate:"required"` - - // The zone this dedicated host group will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateDedicatedHostGroupOptions.Family property. -// The dedicated host profile family for hosts in this group. -const ( - CreateDedicatedHostGroupOptionsFamilyBalancedConst = "balanced" - CreateDedicatedHostGroupOptionsFamilyComputeConst = "compute" - CreateDedicatedHostGroupOptionsFamilyMemoryConst = "memory" -) - -// NewCreateDedicatedHostGroupOptions : Instantiate CreateDedicatedHostGroupOptions -func (*VpcV1) NewCreateDedicatedHostGroupOptions(class string, family string, zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { - return &CreateDedicatedHostGroupOptions{ - Class: core.StringPtr(class), - Family: core.StringPtr(family), - Zone: zone, - } -} - -// SetClass : Allow user to set Class -func (_options *CreateDedicatedHostGroupOptions) SetClass(class string) *CreateDedicatedHostGroupOptions { - _options.Class = core.StringPtr(class) - return _options -} - -// SetFamily : Allow user to set Family -func (_options *CreateDedicatedHostGroupOptions) SetFamily(family string) *CreateDedicatedHostGroupOptions { - _options.Family = core.StringPtr(family) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateDedicatedHostGroupOptions) SetZone(zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.Zone = zone - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateDedicatedHostGroupOptions) SetName(name string) *CreateDedicatedHostGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateDedicatedHostGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *CreateDedicatedHostGroupOptions { - options.Headers = param - return options -} - -// CreateDedicatedHostOptions : The CreateDedicatedHost options. -type CreateDedicatedHostOptions struct { - // The dedicated host prototype object. - DedicatedHostPrototype DedicatedHostPrototypeIntf `json:"DedicatedHostPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateDedicatedHostOptions : Instantiate CreateDedicatedHostOptions -func (*VpcV1) NewCreateDedicatedHostOptions(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - return &CreateDedicatedHostOptions{ - DedicatedHostPrototype: dedicatedHostPrototype, - } -} - -// SetDedicatedHostPrototype : Allow user to set DedicatedHostPrototype -func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - _options.DedicatedHostPrototype = dedicatedHostPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostOptions) SetHeaders(param map[string]string) *CreateDedicatedHostOptions { - options.Headers = param - return options -} - -// CreateEndpointGatewayOptions : The CreateEndpointGateway options. -type CreateEndpointGatewayOptions struct { - // The target to use for this endpoint gateway. Must not already be the target of another - // endpoint gateway in the VPC. - Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` - - // The VPC this endpoint gateway will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` - - // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. - Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` - - // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions -func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - return &CreateEndpointGatewayOptions{ - Target: target, - VPC: vpc, - } -} - -// SetTarget : Allow user to set Target -func (_options *CreateEndpointGatewayOptions) SetTarget(target EndpointGatewayTargetPrototypeIntf) *CreateEndpointGatewayOptions { - _options.Target = target - return _options -} - -// SetVPC : Allow user to set VPC -func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - _options.VPC = vpc - return _options -} - -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *CreateEndpointGatewayOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *CreateEndpointGatewayOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) - return _options -} - -// SetIps : Allow user to set Ips -func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { - _options.Ips = ips - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateEndpointGatewayOptions) SetName(name string) *CreateEndpointGatewayOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateEndpointGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateEndpointGatewayOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.SecurityGroups = securityGroups - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayOptions { - options.Headers = param - return options -} - -// CreateFloatingIPOptions : The CreateFloatingIP options. -type CreateFloatingIPOptions struct { - // The floating IP prototype object. - FloatingIPPrototype FloatingIPPrototypeIntf `json:"FloatingIPPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateFloatingIPOptions : Instantiate CreateFloatingIPOptions -func (*VpcV1) NewCreateFloatingIPOptions(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - return &CreateFloatingIPOptions{ - FloatingIPPrototype: floatingIPPrototype, - } -} - -// SetFloatingIPPrototype : Allow user to set FloatingIPPrototype -func (_options *CreateFloatingIPOptions) SetFloatingIPPrototype(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - _options.FloatingIPPrototype = floatingIPPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateFloatingIPOptions) SetHeaders(param map[string]string) *CreateFloatingIPOptions { - options.Headers = param - return options -} - -// CreateFlowLogCollectorOptions : The CreateFlowLogCollector options. -type CreateFlowLogCollectorOptions struct { - // The Cloud Object Storage bucket where the collected flows will be logged. - // The bucket must exist and an IAM service authorization must grant - // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - // access to the bucket. For more information, see [Creating a flow log - // collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). - StorageBucket LegacyCloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - - // The target this collector will collect flow logs for. - // - // If the target is an instance, subnet, or VPC, flow logs will not be collected for any - // instance network attachments, virtual network interfaces or instance network interfaces - // within the target that are themselves the target of a more specific flow log collector. - // - // The target must not be a virtual network interface that is attached to a bare metal server - // network attachment or to a file share mount target. - Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` - - // Indicates whether this collector will be active upon creation. - Active *bool `json:"active,omitempty"` - - // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions -func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket LegacyCloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - return &CreateFlowLogCollectorOptions{ - StorageBucket: storageBucket, - Target: target, - } -} - -// SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket LegacyCloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { - _options.StorageBucket = storageBucket - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateFlowLogCollectorOptions) SetTarget(target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - _options.Target = target - return _options -} - -// SetActive : Allow user to set Active -func (_options *CreateFlowLogCollectorOptions) SetActive(active bool) *CreateFlowLogCollectorOptions { - _options.Active = core.BoolPtr(active) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateFlowLogCollectorOptions) SetName(name string) *CreateFlowLogCollectorOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateFlowLogCollectorOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateFlowLogCollectorOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string) *CreateFlowLogCollectorOptions { - options.Headers = param - return options -} - -// CreateIkePolicyOptions : The CreateIkePolicy options. -type CreateIkePolicyOptions struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group" validate:"required"` - - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The name for this IKE policy. The name must not be used by another IKE policies in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIkePolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" - CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIkePolicyOptionsEncryptionAlgorithmAes192Const = "aes192" - CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" -) - -// NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions -func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { - return &CreateIkePolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - DhGroup: core.Int64Ptr(dhGroup), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - IkeVersion: core.Int64Ptr(ikeVersion), - } -} - -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options -} - -// SetDhGroup : Allow user to set DhGroup -func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { - _options.DhGroup = core.Int64Ptr(dhGroup) - return _options -} - -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIkePolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options -} - -// SetIkeVersion : Allow user to set IkeVersion -func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { - _options.IkeVersion = core.Int64Ptr(ikeVersion) - return _options -} - -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIkePolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIkePolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateIkePolicyOptions) SetName(name string) *CreateIkePolicyOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIkePolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIkePolicyOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateIkePolicyOptions) SetHeaders(param map[string]string) *CreateIkePolicyOptions { - options.Headers = param - return options -} - -// CreateImageExportJobOptions : The CreateImageExportJob options. -type CreateImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The Cloud Object Storage bucket to export the image to. The bucket must exist and an IAM - // service authorization must grant `Image Service for VPC` of - // `VPC Infrastructure Services` writer access to the bucket. - StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - - // The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. - Format *string `json:"format,omitempty"` - - // The name for this image export job. The name must not be used by another export job for the image. If unspecified, - // the name will be a hyphenated list of randomly-selected words prefixed with the first 16 characters of the parent - // image name. - // - // The exported image object name in Cloud Object Storage (`storage_object.name` in the response) will be based on this - // name. The object name will be unique within the bucket. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateImageExportJobOptions.Format property. -// The format to use for the exported image. If the image is encrypted, only `qcow2` is supported. -const ( - CreateImageExportJobOptionsFormatQcow2Const = "qcow2" - CreateImageExportJobOptionsFormatVhdConst = "vhd" -) - -// NewCreateImageExportJobOptions : Instantiate CreateImageExportJobOptions -func (*VpcV1) NewCreateImageExportJobOptions(imageID string, storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { - return &CreateImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - StorageBucket: storageBucket, - } -} - -// SetImageID : Allow user to set ImageID -func (_options *CreateImageExportJobOptions) SetImageID(imageID string) *CreateImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} - -// SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateImageExportJobOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateImageExportJobOptions { - _options.StorageBucket = storageBucket - return _options -} - -// SetFormat : Allow user to set Format -func (_options *CreateImageExportJobOptions) SetFormat(format string) *CreateImageExportJobOptions { - _options.Format = core.StringPtr(format) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateImageExportJobOptions) SetName(name string) *CreateImageExportJobOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateImageExportJobOptions) SetHeaders(param map[string]string) *CreateImageExportJobOptions { - options.Headers = param - return options -} - -// CreateImageOptions : The CreateImage options. -type CreateImageOptions struct { - // The image prototype object. - ImagePrototype ImagePrototypeIntf `json:"ImagePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateImageOptions : Instantiate CreateImageOptions -func (*VpcV1) NewCreateImageOptions(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - return &CreateImageOptions{ - ImagePrototype: imagePrototype, - } -} - -// SetImagePrototype : Allow user to set ImagePrototype -func (_options *CreateImageOptions) SetImagePrototype(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - _options.ImagePrototype = imagePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateImageOptions) SetHeaders(param map[string]string) *CreateImageOptions { - options.Headers = param - return options -} - -// CreateInstanceActionOptions : The CreateInstanceAction options. -type CreateInstanceActionOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The type of action. - Type *string `json:"type" validate:"required"` - - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateInstanceActionOptions.Type property. -// The type of action. -const ( - CreateInstanceActionOptionsTypeRebootConst = "reboot" - CreateInstanceActionOptionsTypeStartConst = "start" - CreateInstanceActionOptionsTypeStopConst = "stop" -) - -// NewCreateInstanceActionOptions : Instantiate CreateInstanceActionOptions -func (*VpcV1) NewCreateInstanceActionOptions(instanceID string, typeVar string) *CreateInstanceActionOptions { - return &CreateInstanceActionOptions{ - InstanceID: core.StringPtr(instanceID), - Type: core.StringPtr(typeVar), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceActionOptions) SetInstanceID(instanceID string) *CreateInstanceActionOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetType : Allow user to set Type -func (_options *CreateInstanceActionOptions) SetType(typeVar string) *CreateInstanceActionOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} - -// SetForce : Allow user to set Force -func (_options *CreateInstanceActionOptions) SetForce(force bool) *CreateInstanceActionOptions { - _options.Force = core.BoolPtr(force) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceActionOptions) SetHeaders(param map[string]string) *CreateInstanceActionOptions { - options.Headers = param - return options -} - -// CreateInstanceConsoleAccessTokenOptions : The CreateInstanceConsoleAccessToken options. -type CreateInstanceConsoleAccessTokenOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` - - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateInstanceConsoleAccessTokenOptions.ConsoleType property. -// The instance console type for which this token may be used. -const ( - CreateInstanceConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" - CreateInstanceConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" -) - -// NewCreateInstanceConsoleAccessTokenOptions : Instantiate CreateInstanceConsoleAccessTokenOptions -func (*VpcV1) NewCreateInstanceConsoleAccessTokenOptions(instanceID string, consoleType string) *CreateInstanceConsoleAccessTokenOptions { - return &CreateInstanceConsoleAccessTokenOptions{ - InstanceID: core.StringPtr(instanceID), - ConsoleType: core.StringPtr(consoleType), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceConsoleAccessTokenOptions) SetInstanceID(instanceID string) *CreateInstanceConsoleAccessTokenOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetConsoleType : Allow user to set ConsoleType -func (_options *CreateInstanceConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateInstanceConsoleAccessTokenOptions { - _options.ConsoleType = core.StringPtr(consoleType) - return _options -} - -// SetForce : Allow user to set Force -func (_options *CreateInstanceConsoleAccessTokenOptions) SetForce(force bool) *CreateInstanceConsoleAccessTokenOptions { - _options.Force = core.BoolPtr(force) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateInstanceConsoleAccessTokenOptions { - options.Headers = param - return options -} - -// CreateInstanceGroupManagerActionOptions : The CreateInstanceGroupManagerAction options. -type CreateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager action prototype object. - InstanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf `json:"InstanceGroupManagerActionPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceGroupManagerActionOptions : Instantiate CreateInstanceGroupManagerActionOptions -func (*VpcV1) NewCreateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - return &CreateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerActionPrototype: instanceGroupManagerActionPrototype, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetInstanceGroupManagerActionPrototype : Allow user to set InstanceGroupManagerActionPrototype -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerActionOptions { - options.Headers = param - return options -} - -// CreateInstanceGroupManagerOptions : The CreateInstanceGroupManager options. -type CreateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager prototype object. - InstanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf `json:"InstanceGroupManagerPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceGroupManagerOptions : Instantiate CreateInstanceGroupManagerOptions -func (*VpcV1) NewCreateInstanceGroupManagerOptions(instanceGroupID string, instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - return &CreateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerPrototype: instanceGroupManagerPrototype, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerPrototype : Allow user to set InstanceGroupManagerPrototype -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupManagerPrototype(instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPrototype = instanceGroupManagerPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerOptions { - options.Headers = param - return options -} - -// CreateInstanceGroupManagerPolicyOptions : The CreateInstanceGroupManagerPolicy options. -type CreateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy prototype object. - InstanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf `json:"InstanceGroupManagerPolicyPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceGroupManagerPolicyOptions : Instantiate CreateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - return &CreateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerPolicyPrototype: instanceGroupManagerPolicyPrototype, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetInstanceGroupManagerPolicyPrototype : Allow user to set InstanceGroupManagerPolicyPrototype -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} - -// CreateInstanceGroupOptions : The CreateInstanceGroup options. -type CreateInstanceGroupOptions struct { - // Instance template to use when creating new instances. - // - // Instance groups are not compatible with instance templates that specify `true` for - // `default_trusted_profile.auto_link`. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template" validate:"required"` - - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - - // The port to use for new load balancer pool members created by this instance group. The load balancer pool member - // will receive load balancer traffic on this port, unless the load balancer listener is using a port range. (Traffic - // received on a listener using a port range will be sent to members using the same port the listener received it on.) - // - // This port will also be used for health checks unless the port property of - // `health_monitor` property is specified. - // - // This property must be specified if and only if `load_balancer_pool` has been specified. - ApplicationPort *int64 `json:"application_port,omitempty"` - - // The load balancer associated with the specified load balancer pool. - // Required if `load_balancer_pool` is specified. The load balancer must have - // `instance_groups_supported` set to `true`. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` - - // If specified, this instance group will manage the load balancer pool. A pool member - // will be created for each instance created by this group. The specified load - // balancer pool must not be used by another instance group in the VPC. - // - // If specified, `load_balancer` and `application_port` must also be specified. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` - - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` - - // The name for this instance group. The name must not be used by another instance group in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceGroupOptions : Instantiate CreateInstanceGroupOptions -func (*VpcV1) NewCreateInstanceGroupOptions(instanceTemplate InstanceTemplateIdentityIntf, subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - return &CreateInstanceGroupOptions{ - InstanceTemplate: instanceTemplate, - Subnets: subnets, - } -} - -// SetInstanceTemplate : Allow user to set InstanceTemplate -func (_options *CreateInstanceGroupOptions) SetInstanceTemplate(instanceTemplate InstanceTemplateIdentityIntf) *CreateInstanceGroupOptions { - _options.InstanceTemplate = instanceTemplate - return _options -} - -// SetSubnets : Allow user to set Subnets -func (_options *CreateInstanceGroupOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - _options.Subnets = subnets - return _options -} - -// SetApplicationPort : Allow user to set ApplicationPort -func (_options *CreateInstanceGroupOptions) SetApplicationPort(applicationPort int64) *CreateInstanceGroupOptions { - _options.ApplicationPort = core.Int64Ptr(applicationPort) - return _options -} - -// SetLoadBalancer : Allow user to set LoadBalancer -func (_options *CreateInstanceGroupOptions) SetLoadBalancer(loadBalancer LoadBalancerIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancer = loadBalancer - return _options -} - -// SetLoadBalancerPool : Allow user to set LoadBalancerPool -func (_options *CreateInstanceGroupOptions) SetLoadBalancerPool(loadBalancerPool LoadBalancerPoolIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancerPool = loadBalancerPool - return _options -} - -// SetMembershipCount : Allow user to set MembershipCount -func (_options *CreateInstanceGroupOptions) SetMembershipCount(membershipCount int64) *CreateInstanceGroupOptions { - _options.MembershipCount = core.Int64Ptr(membershipCount) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateInstanceGroupOptions) SetName(name string) *CreateInstanceGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateInstanceGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateInstanceGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupOptions) SetHeaders(param map[string]string) *CreateInstanceGroupOptions { - options.Headers = param - return options -} - -// CreateInstanceNetworkAttachmentOptions : The CreateInstanceNetworkAttachment options. -type CreateInstanceNetworkAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // A virtual network interface for the instance network attachment. This can be specified - // using an existing virtual network interface, or a prototype object for a new virtual - // network interface. - // - // If an existing virtual network interface is specified, `enable_infrastructure_nat` must be - // `true`. - VirtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // The name for this network attachment. Names must be unique within the instance the network attachment resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceNetworkAttachmentOptions : Instantiate CreateInstanceNetworkAttachmentOptions -func (*VpcV1) NewCreateInstanceNetworkAttachmentOptions(instanceID string, virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) *CreateInstanceNetworkAttachmentOptions { - return &CreateInstanceNetworkAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - VirtualNetworkInterface: virtualNetworkInterface, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetVirtualNetworkInterface : Allow user to set VirtualNetworkInterface -func (_options *CreateInstanceNetworkAttachmentOptions) SetVirtualNetworkInterface(virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) *CreateInstanceNetworkAttachmentOptions { - _options.VirtualNetworkInterface = virtualNetworkInterface - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateInstanceNetworkAttachmentOptions) SetName(name string) *CreateInstanceNetworkAttachmentOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkAttachmentOptions { - options.Headers = param - return options -} - -// CreateInstanceNetworkInterfaceOptions : The CreateInstanceNetworkInterface options. -type CreateInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Indicates whether source IP spoofing is allowed on this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is - // used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceNetworkInterfaceOptions : Instantiate CreateInstanceNetworkInterfaceOptions -func (*VpcV1) NewCreateInstanceNetworkInterfaceOptions(instanceID string, subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - return &CreateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - Subnet: subnet, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetSubnet : Allow user to set Subnet -func (_options *CreateInstanceNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.Subnet = subnet - return _options -} - -// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing -func (_options *CreateInstanceNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateInstanceNetworkInterfaceOptions { - _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateInstanceNetworkInterfaceOptions) SetName(name string) *CreateInstanceNetworkInterfaceOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetPrimaryIP : Allow user to set PrimaryIP -func (_options *CreateInstanceNetworkInterfaceOptions) SetPrimaryIP(primaryIP NetworkInterfaceIPPrototypeIntf) *CreateInstanceNetworkInterfaceOptions { - _options.PrimaryIP = primaryIP - return _options -} - -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateInstanceNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.SecurityGroups = securityGroups - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} - -// CreateInstanceOptions : The CreateInstance options. -type CreateInstanceOptions struct { - // The instance prototype object. - InstancePrototype InstancePrototypeIntf `json:"InstancePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceOptions : Instantiate CreateInstanceOptions -func (*VpcV1) NewCreateInstanceOptions(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - return &CreateInstanceOptions{ - InstancePrototype: instancePrototype, - } -} - -// SetInstancePrototype : Allow user to set InstancePrototype -func (_options *CreateInstanceOptions) SetInstancePrototype(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - _options.InstancePrototype = instancePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceOptions) SetHeaders(param map[string]string) *CreateInstanceOptions { - options.Headers = param - return options -} - -// CreateInstanceTemplateOptions : The CreateInstanceTemplate options. -type CreateInstanceTemplateOptions struct { - // The instance template prototype object. - InstanceTemplatePrototype InstanceTemplatePrototypeIntf `json:"InstanceTemplatePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceTemplateOptions : Instantiate CreateInstanceTemplateOptions -func (*VpcV1) NewCreateInstanceTemplateOptions(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - return &CreateInstanceTemplateOptions{ - InstanceTemplatePrototype: instanceTemplatePrototype, - } -} - -// SetInstanceTemplatePrototype : Allow user to set InstanceTemplatePrototype -func (_options *CreateInstanceTemplateOptions) SetInstanceTemplatePrototype(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - _options.InstanceTemplatePrototype = instanceTemplatePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceTemplateOptions) SetHeaders(param map[string]string) *CreateInstanceTemplateOptions { - options.Headers = param - return options -} - -// CreateInstanceVolumeAttachmentOptions : The CreateInstanceVolumeAttachment options. -type CreateInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` - - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateInstanceVolumeAttachmentOptions : Instantiate CreateInstanceVolumeAttachmentOptions -func (*VpcV1) NewCreateInstanceVolumeAttachmentOptions(instanceID string, volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - return &CreateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - Volume: volume, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetVolume : Allow user to set Volume -func (_options *CreateInstanceVolumeAttachmentOptions) SetVolume(volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - _options.Volume = volume - return _options -} - -// SetDeleteVolumeOnInstanceDelete : Allow user to set DeleteVolumeOnInstanceDelete -func (_options *CreateInstanceVolumeAttachmentOptions) SetDeleteVolumeOnInstanceDelete(deleteVolumeOnInstanceDelete bool) *CreateInstanceVolumeAttachmentOptions { - _options.DeleteVolumeOnInstanceDelete = core.BoolPtr(deleteVolumeOnInstanceDelete) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateInstanceVolumeAttachmentOptions) SetName(name string) *CreateInstanceVolumeAttachmentOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} - -// CreateIpsecPolicyOptions : The CreateIpsecPolicy options. -type CreateIpsecPolicyOptions struct { - // The authentication algorithm - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The encryption algorithm - // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // Perfect Forward Secrecy. - Pfs *string `json:"pfs" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The name for this IPsec policy. The name must not be used by another IPsec policies in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - CreateIpsecPolicyOptionsAuthenticationAlgorithmDisabledConst = "disabled" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - CreateIpsecPolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes192Const = "aes192" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes256Const = "aes256" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" -) - -// Constants associated with the CreateIpsecPolicyOptions.Pfs property. -// Perfect Forward Secrecy. -const ( - CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" - CreateIpsecPolicyOptionsPfsGroup14Const = "group_14" - CreateIpsecPolicyOptionsPfsGroup15Const = "group_15" - CreateIpsecPolicyOptionsPfsGroup16Const = "group_16" - CreateIpsecPolicyOptionsPfsGroup17Const = "group_17" - CreateIpsecPolicyOptionsPfsGroup18Const = "group_18" - CreateIpsecPolicyOptionsPfsGroup19Const = "group_19" - CreateIpsecPolicyOptionsPfsGroup20Const = "group_20" - CreateIpsecPolicyOptionsPfsGroup21Const = "group_21" - CreateIpsecPolicyOptionsPfsGroup22Const = "group_22" - CreateIpsecPolicyOptionsPfsGroup23Const = "group_23" - CreateIpsecPolicyOptionsPfsGroup24Const = "group_24" - CreateIpsecPolicyOptionsPfsGroup31Const = "group_31" -) - -// NewCreateIpsecPolicyOptions : Instantiate CreateIpsecPolicyOptions -func (*VpcV1) NewCreateIpsecPolicyOptions(authenticationAlgorithm string, encryptionAlgorithm string, pfs string) *CreateIpsecPolicyOptions { - return &CreateIpsecPolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - Pfs: core.StringPtr(pfs), - } -} - -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options -} - -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options -} - -// SetPfs : Allow user to set Pfs -func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { - _options.Pfs = core.StringPtr(pfs) - return _options -} - -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIpsecPolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIpsecPolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolicyOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateIpsecPolicyOptions) SetHeaders(param map[string]string) *CreateIpsecPolicyOptions { - options.Headers = param - return options -} - -// CreateKeyOptions : The CreateKey options. -type CreateKeyOptions struct { - // A unique public SSH key to import, in OpenSSH format (consisting of three space-separated fields: the algorithm - // name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is - // imported. - // - // Keys of type `rsa` may be 2048 or 4096 bits in length, however 4096 is recommended. Keys of type `ed25519` are 256 - // bits in length. - PublicKey *string `json:"public_key" validate:"required"` - - // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The crypto-system used by this key. - Type *string `json:"type,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateKeyOptions.Type property. -// The crypto-system used by this key. -const ( - CreateKeyOptionsTypeEd25519Const = "ed25519" - CreateKeyOptionsTypeRsaConst = "rsa" -) - -// NewCreateKeyOptions : Instantiate CreateKeyOptions -func (*VpcV1) NewCreateKeyOptions(publicKey string) *CreateKeyOptions { - return &CreateKeyOptions{ - PublicKey: core.StringPtr(publicKey), - } -} - -// SetPublicKey : Allow user to set PublicKey -func (_options *CreateKeyOptions) SetPublicKey(publicKey string) *CreateKeyOptions { - _options.PublicKey = core.StringPtr(publicKey) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateKeyOptions) SetName(name string) *CreateKeyOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateKeyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateKeyOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetType : Allow user to set Type -func (_options *CreateKeyOptions) SetType(typeVar string) *CreateKeyOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateKeyOptions) SetHeaders(param map[string]string) *CreateKeyOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerListenerOptions : The CreateLoadBalancerListener options. -type CreateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // Additional restrictions: - // - If `default_pool` is set, the pool's protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and - // `https`. - // - If `https_redirect` is set, the protocol must be `http`. - Protocol *string `json:"protocol" validate:"required"` - - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` - - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` - - // The default pool for this listener. If specified, the pool must: - // - Belong to this load balancer. - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener. - // - // If unspecified, this listener will be created with no default pool, but one may be - // subsequently set. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` - - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` - - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The policy prototype objects for this listener. The load balancer must be in the - // `application` family. - Policies []LoadBalancerListenerPolicyPrototype `json:"policies,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` - - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateLoadBalancerListenerOptions.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the pool's protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and -// `https`. -// - If `https_redirect` is set, the protocol must be `http`. -const ( - CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" - CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerListenerOptionsProtocolTCPConst = "tcp" - CreateLoadBalancerListenerOptionsProtocolUDPConst = "udp" -) - -// NewCreateLoadBalancerListenerOptions : Instantiate CreateLoadBalancerListenerOptions -func (*VpcV1) NewCreateLoadBalancerListenerOptions(loadBalancerID string, protocol string) *CreateLoadBalancerListenerOptions { - return &CreateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Protocol: core.StringPtr(protocol), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerListenerOptions) SetProtocol(protocol string) *CreateLoadBalancerListenerOptions { - _options.Protocol = core.StringPtr(protocol) - return _options -} - -// SetAcceptProxyProtocol : Allow user to set AcceptProxyProtocol -func (_options *CreateLoadBalancerListenerOptions) SetAcceptProxyProtocol(acceptProxyProtocol bool) *CreateLoadBalancerListenerOptions { - _options.AcceptProxyProtocol = core.BoolPtr(acceptProxyProtocol) - return _options -} - -// SetCertificateInstance : Allow user to set CertificateInstance -func (_options *CreateLoadBalancerListenerOptions) SetCertificateInstance(certificateInstance CertificateInstanceIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.CertificateInstance = certificateInstance - return _options -} - -// SetConnectionLimit : Allow user to set ConnectionLimit -func (_options *CreateLoadBalancerListenerOptions) SetConnectionLimit(connectionLimit int64) *CreateLoadBalancerListenerOptions { - _options.ConnectionLimit = core.Int64Ptr(connectionLimit) - return _options -} - -// SetDefaultPool : Allow user to set DefaultPool -func (_options *CreateLoadBalancerListenerOptions) SetDefaultPool(defaultPool LoadBalancerPoolIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.DefaultPool = defaultPool - return _options -} - -// SetHTTPSRedirect : Allow user to set HTTPSRedirect -func (_options *CreateLoadBalancerListenerOptions) SetHTTPSRedirect(httpsRedirect *LoadBalancerListenerHTTPSRedirectPrototype) *CreateLoadBalancerListenerOptions { - _options.HTTPSRedirect = httpsRedirect - return _options -} - -// SetIdleConnectionTimeout : Allow user to set IdleConnectionTimeout -func (_options *CreateLoadBalancerListenerOptions) SetIdleConnectionTimeout(idleConnectionTimeout int64) *CreateLoadBalancerListenerOptions { - _options.IdleConnectionTimeout = core.Int64Ptr(idleConnectionTimeout) - return _options -} - -// SetPolicies : Allow user to set Policies -func (_options *CreateLoadBalancerListenerOptions) SetPolicies(policies []LoadBalancerListenerPolicyPrototype) *CreateLoadBalancerListenerOptions { - _options.Policies = policies - return _options -} - -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerListenerOptions) SetPort(port int64) *CreateLoadBalancerListenerOptions { - _options.Port = core.Int64Ptr(port) - return _options -} - -// SetPortMax : Allow user to set PortMax -func (_options *CreateLoadBalancerListenerOptions) SetPortMax(portMax int64) *CreateLoadBalancerListenerOptions { - _options.PortMax = core.Int64Ptr(portMax) - return _options -} - -// SetPortMin : Allow user to set PortMin -func (_options *CreateLoadBalancerListenerOptions) SetPortMin(portMin int64) *CreateLoadBalancerListenerOptions { - _options.PortMin = core.Int64Ptr(portMin) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerListenerPolicyOptions : The CreateLoadBalancerListenerPolicy options. -type CreateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` - - // The name for this policy. The name must not be used by another policy for the load balancer listener. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` - - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateLoadBalancerListenerPolicyOptions.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - CreateLoadBalancerListenerPolicyOptionsActionForwardConst = "forward" - CreateLoadBalancerListenerPolicyOptionsActionHTTPSRedirectConst = "https_redirect" - CreateLoadBalancerListenerPolicyOptionsActionRedirectConst = "redirect" - CreateLoadBalancerListenerPolicyOptionsActionRejectConst = "reject" -) - -// NewCreateLoadBalancerListenerPolicyOptions : Instantiate CreateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, action string, priority int64) *CreateLoadBalancerListenerPolicyOptions { - return &CreateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateLoadBalancerListenerPolicyOptions) SetAction(action string) *CreateLoadBalancerListenerPolicyOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetPriority : Allow user to set Priority -func (_options *CreateLoadBalancerListenerPolicyOptions) SetPriority(priority int64) *CreateLoadBalancerListenerPolicyOptions { - _options.Priority = core.Int64Ptr(priority) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerListenerPolicyOptions) SetName(name string) *CreateLoadBalancerListenerPolicyOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetRules : Allow user to set Rules -func (_options *CreateLoadBalancerListenerPolicyOptions) SetRules(rules []LoadBalancerListenerPolicyRulePrototype) *CreateLoadBalancerListenerPolicyOptions { - _options.Rules = rules - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerListenerPolicyOptions) SetTarget(target LoadBalancerListenerPolicyTargetPrototypeIntf) *CreateLoadBalancerListenerPolicyOptions { - _options.Target = target - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerListenerPolicyRuleOptions : The CreateLoadBalancerListenerPolicyRule options. -type CreateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Condition property. -// The condition of the rule. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsConditionContainsConst = "contains" - CreateLoadBalancerListenerPolicyRuleOptionsConditionEqualsConst = "equals" - CreateLoadBalancerListenerPolicyRuleOptionsConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsTypeBodyConst = "body" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHeaderConst = "header" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHostnameConst = "hostname" - CreateLoadBalancerListenerPolicyRuleOptionsTypePathConst = "path" - CreateLoadBalancerListenerPolicyRuleOptionsTypeQueryConst = "query" -) - -// NewCreateLoadBalancerListenerPolicyRuleOptions : Instantiate CreateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, condition string, typeVar string, value string) *CreateLoadBalancerListenerPolicyRuleOptions { - return &CreateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetCondition : Allow user to set Condition -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetCondition(condition string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Condition = core.StringPtr(condition) - return _options -} - -// SetType : Allow user to set Type -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetType(typeVar string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} - -// SetValue : Allow user to set Value -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetValue(value string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Value = core.StringPtr(value) - return _options -} - -// SetField : Allow user to set Field -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetField(field string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Field = core.StringPtr(field) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerOptions : The CreateLoadBalancer options. -type CreateLoadBalancerOptions struct { - // Indicates whether this load balancer is public. - // - // At present, if route mode is enabled, the load balancer must not be public. - IsPublic *bool `json:"is_public" validate:"required"` - - // The subnets to provision this load balancer in. The subnets must be in the same VPC. The load balancer's - // availability will depend on the availability of the zones that the subnets reside in. - // - // Load balancers in the `network` family allow only one subnet to be specified. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - - // The DNS configuration for this load balancer. - // - // If unspecified, DNS `A` records for this load balancer's `hostname` property will be added - // to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be - // added to the specified `zone`. - Dns *LoadBalancerDnsPrototype `json:"dns,omitempty"` - - // The listeners of this load balancer. - Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"` - - // The logging configuration to use for this load balancer. See [VPC Datapath - // Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging - // format, fields and permitted values. If unspecified, `datapath.active` will be `false`. - // - // To activate logging, the load balancer profile must support the specified logging type. - Logging *LoadBalancerLoggingPrototype `json:"logging,omitempty"` - - // The name for this load balancer. The name must not be used by another load balancer in the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The pools of this load balancer. - Pools []LoadBalancerPoolPrototype `json:"pools,omitempty"` - - // The profile to use for this load balancer. - // - // If unspecified, `application` will be used. - Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode,omitempty"` - - // The security groups to use for this load balancer. If unspecified, the VPC's default security group is used. - // - // The load balancer profile must support security groups. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateLoadBalancerOptions : Instantiate CreateLoadBalancerOptions -func (*VpcV1) NewCreateLoadBalancerOptions(isPublic bool, subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - return &CreateLoadBalancerOptions{ - IsPublic: core.BoolPtr(isPublic), - Subnets: subnets, - } -} - -// SetIsPublic : Allow user to set IsPublic -func (_options *CreateLoadBalancerOptions) SetIsPublic(isPublic bool) *CreateLoadBalancerOptions { - _options.IsPublic = core.BoolPtr(isPublic) - return _options -} - -// SetSubnets : Allow user to set Subnets -func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - _options.Subnets = subnets - return _options -} - -// SetDns : Allow user to set Dns -func (_options *CreateLoadBalancerOptions) SetDns(dns *LoadBalancerDnsPrototype) *CreateLoadBalancerOptions { - _options.Dns = dns - return _options -} - -// SetListeners : Allow user to set Listeners -func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions { - _options.Listeners = listeners - return _options -} - -// SetLogging : Allow user to set Logging -func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLoggingPrototype) *CreateLoadBalancerOptions { - _options.Logging = logging - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerOptions) SetName(name string) *CreateLoadBalancerOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetPools : Allow user to set Pools -func (_options *CreateLoadBalancerOptions) SetPools(pools []LoadBalancerPoolPrototype) *CreateLoadBalancerOptions { - _options.Pools = pools - return _options -} - -// SetProfile : Allow user to set Profile -func (_options *CreateLoadBalancerOptions) SetProfile(profile LoadBalancerProfileIdentityIntf) *CreateLoadBalancerOptions { - _options.Profile = profile - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateLoadBalancerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetRouteMode : Allow user to set RouteMode -func (_options *CreateLoadBalancerOptions) SetRouteMode(routeMode bool) *CreateLoadBalancerOptions { - _options.RouteMode = core.BoolPtr(routeMode) - return _options -} - -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateLoadBalancerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.SecurityGroups = securityGroups - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerPoolMemberOptions : The CreateLoadBalancerPoolMember options. -type CreateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateLoadBalancerPoolMemberOptions : Instantiate CreateLoadBalancerPoolMemberOptions -func (*VpcV1) NewCreateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - return &CreateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Port: core.Int64Ptr(port), - Target: target, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *CreateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *CreateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerPoolMemberOptions) SetPort(port int64) *CreateLoadBalancerPoolMemberOptions { - _options.Port = core.Int64Ptr(port) - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerPoolMemberOptions) SetTarget(target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - _options.Target = target - return _options -} - -// SetWeight : Allow user to set Weight -func (_options *CreateLoadBalancerPoolMemberOptions) SetWeight(weight int64) *CreateLoadBalancerPoolMemberOptions { - _options.Weight = core.Int64Ptr(weight) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} - -// CreateLoadBalancerPoolOptions : The CreateLoadBalancerPool options. -type CreateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` - - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - // `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http`, and `https`. - Protocol *string `json:"protocol" validate:"required"` - - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` - - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` - - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateLoadBalancerPoolOptions.Algorithm property. -// The load balancing algorithm. -const ( - CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst = "least_connections" - CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst = "round_robin" - CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the CreateLoadBalancerPoolOptions.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if -// `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http`, and `https`. -const ( - CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" - CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerPoolOptionsProtocolTCPConst = "tcp" - CreateLoadBalancerPoolOptionsProtocolUDPConst = "udp" -) - -// Constants associated with the CreateLoadBalancerPoolOptions.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - CreateLoadBalancerPoolOptionsProxyProtocolDisabledConst = "disabled" - CreateLoadBalancerPoolOptionsProxyProtocolV1Const = "v1" - CreateLoadBalancerPoolOptionsProxyProtocolV2Const = "v2" -) - -// NewCreateLoadBalancerPoolOptions : Instantiate CreateLoadBalancerPoolOptions -func (*VpcV1) NewCreateLoadBalancerPoolOptions(loadBalancerID string, algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) *CreateLoadBalancerPoolOptions { - return &CreateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetAlgorithm : Allow user to set Algorithm -func (_options *CreateLoadBalancerPoolOptions) SetAlgorithm(algorithm string) *CreateLoadBalancerPoolOptions { - _options.Algorithm = core.StringPtr(algorithm) - return _options -} - -// SetHealthMonitor : Allow user to set HealthMonitor -func (_options *CreateLoadBalancerPoolOptions) SetHealthMonitor(healthMonitor *LoadBalancerPoolHealthMonitorPrototype) *CreateLoadBalancerPoolOptions { - _options.HealthMonitor = healthMonitor - return _options -} - -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerPoolOptions) SetProtocol(protocol string) *CreateLoadBalancerPoolOptions { - _options.Protocol = core.StringPtr(protocol) - return _options -} - -// SetMembers : Allow user to set Members -func (_options *CreateLoadBalancerPoolOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *CreateLoadBalancerPoolOptions { - _options.Members = members - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerPoolOptions) SetName(name string) *CreateLoadBalancerPoolOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetProxyProtocol : Allow user to set ProxyProtocol -func (_options *CreateLoadBalancerPoolOptions) SetProxyProtocol(proxyProtocol string) *CreateLoadBalancerPoolOptions { - _options.ProxyProtocol = core.StringPtr(proxyProtocol) - return _options -} - -// SetSessionPersistence : Allow user to set SessionPersistence -func (_options *CreateLoadBalancerPoolOptions) SetSessionPersistence(sessionPersistence *LoadBalancerPoolSessionPersistencePrototype) *CreateLoadBalancerPoolOptions { - _options.SessionPersistence = sessionPersistence - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolOptions { - options.Headers = param - return options -} - -// CreateNetworkACLOptions : The CreateNetworkACL options. -type CreateNetworkACLOptions struct { - // The network ACL prototype object. - NetworkACLPrototype NetworkACLPrototypeIntf `json:"NetworkACLPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateNetworkACLOptions : Instantiate CreateNetworkACLOptions -func (*VpcV1) NewCreateNetworkACLOptions(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { - return &CreateNetworkACLOptions{ - NetworkACLPrototype: networkACLPrototype, - } -} - -// SetNetworkACLPrototype : Allow user to set NetworkACLPrototype -func (_options *CreateNetworkACLOptions) SetNetworkACLPrototype(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { - _options.NetworkACLPrototype = networkACLPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLOptions) SetHeaders(param map[string]string) *CreateNetworkACLOptions { - options.Headers = param - return options -} - -// CreateNetworkACLRuleOptions : The CreateNetworkACLRule options. -type CreateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The network ACL rule prototype object. - NetworkACLRulePrototype NetworkACLRulePrototypeIntf `json:"NetworkACLRulePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateNetworkACLRuleOptions : Instantiate CreateNetworkACLRuleOptions -func (*VpcV1) NewCreateNetworkACLRuleOptions(networkACLID string, networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - return &CreateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - NetworkACLRulePrototype: networkACLRulePrototype, - } -} - -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *CreateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetNetworkACLRulePrototype : Allow user to set NetworkACLRulePrototype -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLRulePrototype(networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - _options.NetworkACLRulePrototype = networkACLRulePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLRuleOptions) SetHeaders(param map[string]string) *CreateNetworkACLRuleOptions { - options.Headers = param - return options -} - -// CreatePlacementGroupOptions : The CreatePlacementGroup options. -type CreatePlacementGroupOptions struct { - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` - - // The name for this placement group. The name must not be used by another placement group in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreatePlacementGroupOptions.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. -const ( - CreatePlacementGroupOptionsStrategyHostSpreadConst = "host_spread" - CreatePlacementGroupOptionsStrategyPowerSpreadConst = "power_spread" -) - -// NewCreatePlacementGroupOptions : Instantiate CreatePlacementGroupOptions -func (*VpcV1) NewCreatePlacementGroupOptions(strategy string) *CreatePlacementGroupOptions { - return &CreatePlacementGroupOptions{ - Strategy: core.StringPtr(strategy), - } -} - -// SetStrategy : Allow user to set Strategy -func (_options *CreatePlacementGroupOptions) SetStrategy(strategy string) *CreatePlacementGroupOptions { - _options.Strategy = core.StringPtr(strategy) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreatePlacementGroupOptions) SetName(name string) *CreatePlacementGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePlacementGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePlacementGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreatePlacementGroupOptions) SetHeaders(param map[string]string) *CreatePlacementGroupOptions { - options.Headers = param - return options -} - -// CreatePublicGatewayOptions : The CreatePublicGateway options. -type CreatePublicGatewayOptions struct { - // The VPC this public gateway will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The zone this public gateway will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - FloatingIP PublicGatewayFloatingIPPrototypeIntf `json:"floating_ip,omitempty"` - - // The name for this public gateway. The name must not be used by another public gateway in the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreatePublicGatewayOptions : Instantiate CreatePublicGatewayOptions -func (*VpcV1) NewCreatePublicGatewayOptions(vpc VPCIdentityIntf, zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - return &CreatePublicGatewayOptions{ - VPC: vpc, - Zone: zone, - } -} - -// SetVPC : Allow user to set VPC -func (_options *CreatePublicGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreatePublicGatewayOptions { - _options.VPC = vpc - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreatePublicGatewayOptions) SetZone(zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - _options.Zone = zone - return _options -} - -// SetFloatingIP : Allow user to set FloatingIP -func (_options *CreatePublicGatewayOptions) SetFloatingIP(floatingIP PublicGatewayFloatingIPPrototypeIntf) *CreatePublicGatewayOptions { - _options.FloatingIP = floatingIP - return _options -} - -// SetName : Allow user to set Name -func (_options *CreatePublicGatewayOptions) SetName(name string) *CreatePublicGatewayOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePublicGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePublicGatewayOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) *CreatePublicGatewayOptions { - options.Headers = param - return options -} - -// CreateReservationOptions : The CreateReservation options. -type CreateReservationOptions struct { - // The capacity reservation configuration to use. - Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` - - // The committed use configuration to use for this reservation. - CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // reservation. - Profile *ReservationProfilePrototype `json:"profile" validate:"required"` - - // The zone to use for this reservation. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The affinity policy to use for this reservation: - // - `restricted`: The reservation must be manually requested. - AffinityPolicy *string `json:"affinity_policy,omitempty"` - - // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateReservationOptions.AffinityPolicy property. -// The affinity policy to use for this reservation: -// - `restricted`: The reservation must be manually requested. -const ( - CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" -) - -// NewCreateReservationOptions : Instantiate CreateReservationOptions -func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { - return &CreateReservationOptions{ - Capacity: capacity, - CommittedUse: committedUse, - Profile: profile, - Zone: zone, - } -} - -// SetCapacity : Allow user to set Capacity -func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { - _options.Capacity = capacity - return _options -} - -// SetCommittedUse : Allow user to set CommittedUse -func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { - _options.CommittedUse = committedUse - return _options -} - -// SetProfile : Allow user to set Profile -func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { - _options.Profile = profile - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { - _options.Zone = zone - return _options -} - -// SetAffinityPolicy : Allow user to set AffinityPolicy -func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { - _options.AffinityPolicy = core.StringPtr(affinityPolicy) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { - options.Headers = param - return options -} - -// CreateSecurityGroupOptions : The CreateSecurityGroup options. -type CreateSecurityGroupOptions struct { - // The VPC this security group will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The name for this security group. The name must not be used by another security group for the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []SecurityGroupRulePrototypeIntf `json:"rules,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSecurityGroupOptions : Instantiate CreateSecurityGroupOptions -func (*VpcV1) NewCreateSecurityGroupOptions(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - return &CreateSecurityGroupOptions{ - VPC: vpc, - } -} - -// SetVPC : Allow user to set VPC -func (_options *CreateSecurityGroupOptions) SetVPC(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - _options.VPC = vpc - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateSecurityGroupOptions) SetName(name string) *CreateSecurityGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateSecurityGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSecurityGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetRules : Allow user to set Rules -func (_options *CreateSecurityGroupOptions) SetRules(rules []SecurityGroupRulePrototypeIntf) *CreateSecurityGroupOptions { - _options.Rules = rules - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupOptions) SetHeaders(param map[string]string) *CreateSecurityGroupOptions { - options.Headers = param - return options -} - -// CreateSecurityGroupRuleOptions : The CreateSecurityGroupRule options. -type CreateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The properties of the security group rule to be created. - SecurityGroupRulePrototype SecurityGroupRulePrototypeIntf `json:"SecurityGroupRulePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSecurityGroupRuleOptions : Instantiate CreateSecurityGroupRuleOptions -func (*VpcV1) NewCreateSecurityGroupRuleOptions(securityGroupID string, securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - return &CreateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - SecurityGroupRulePrototype: securityGroupRulePrototype, - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetSecurityGroupRulePrototype : Allow user to set SecurityGroupRulePrototype -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupRulePrototype(securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupRulePrototype = securityGroupRulePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *CreateSecurityGroupRuleOptions { - options.Headers = param - return options -} - -// CreateSecurityGroupTargetBindingOptions : The CreateSecurityGroupTargetBinding options. -type CreateSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSecurityGroupTargetBindingOptions : Instantiate CreateSecurityGroupTargetBindingOptions -func (*VpcV1) NewCreateSecurityGroupTargetBindingOptions(securityGroupID string, id string) *CreateSecurityGroupTargetBindingOptions { - return &CreateSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *CreateSecurityGroupTargetBindingOptions) SetID(id string) *CreateSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *CreateSecurityGroupTargetBindingOptions { - options.Headers = param - return options -} - -// CreateShareMountTargetOptions : The CreateShareMountTarget options. -type CreateShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // The share mount target prototype object. - ShareMountTargetPrototype ShareMountTargetPrototypeIntf `json:"ShareMountTargetPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateShareMountTargetOptions : Instantiate CreateShareMountTargetOptions -func (*VpcV1) NewCreateShareMountTargetOptions(shareID string, shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { - return &CreateShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ShareMountTargetPrototype: shareMountTargetPrototype, - } -} - -// SetShareID : Allow user to set ShareID -func (_options *CreateShareMountTargetOptions) SetShareID(shareID string) *CreateShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetShareMountTargetPrototype : Allow user to set ShareMountTargetPrototype -func (_options *CreateShareMountTargetOptions) SetShareMountTargetPrototype(shareMountTargetPrototype ShareMountTargetPrototypeIntf) *CreateShareMountTargetOptions { - _options.ShareMountTargetPrototype = shareMountTargetPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateShareMountTargetOptions) SetHeaders(param map[string]string) *CreateShareMountTargetOptions { - options.Headers = param - return options -} - -// CreateShareOptions : The CreateShare options. -type CreateShareOptions struct { - // The file share prototype object. - SharePrototype SharePrototypeIntf `json:"SharePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateShareOptions : Instantiate CreateShareOptions -func (*VpcV1) NewCreateShareOptions(sharePrototype SharePrototypeIntf) *CreateShareOptions { - return &CreateShareOptions{ - SharePrototype: sharePrototype, - } -} - -// SetSharePrototype : Allow user to set SharePrototype -func (_options *CreateShareOptions) SetSharePrototype(sharePrototype SharePrototypeIntf) *CreateShareOptions { - _options.SharePrototype = sharePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateShareOptions) SetHeaders(param map[string]string) *CreateShareOptions { - options.Headers = param - return options -} - -// CreateSnapshotCloneOptions : The CreateSnapshotClone options. -type CreateSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSnapshotCloneOptions : Instantiate CreateSnapshotCloneOptions -func (*VpcV1) NewCreateSnapshotCloneOptions(id string, zoneName string) *CreateSnapshotCloneOptions { - return &CreateSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), - } -} - -// SetID : Allow user to set ID -func (_options *CreateSnapshotCloneOptions) SetID(id string) *CreateSnapshotCloneOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *CreateSnapshotCloneOptions) SetZoneName(zoneName string) *CreateSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSnapshotCloneOptions) SetHeaders(param map[string]string) *CreateSnapshotCloneOptions { - options.Headers = param - return options -} - -// CreateSnapshotConsistencyGroupOptions : The CreateSnapshotConsistencyGroup options. -type CreateSnapshotConsistencyGroupOptions struct { - // The snapshot consistency group prototype object. - SnapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf `json:"SnapshotConsistencyGroupPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSnapshotConsistencyGroupOptions : Instantiate CreateSnapshotConsistencyGroupOptions -func (*VpcV1) NewCreateSnapshotConsistencyGroupOptions(snapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf) *CreateSnapshotConsistencyGroupOptions { - return &CreateSnapshotConsistencyGroupOptions{ - SnapshotConsistencyGroupPrototype: snapshotConsistencyGroupPrototype, - } -} - -// SetSnapshotConsistencyGroupPrototype : Allow user to set SnapshotConsistencyGroupPrototype -func (_options *CreateSnapshotConsistencyGroupOptions) SetSnapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototype SnapshotConsistencyGroupPrototypeIntf) *CreateSnapshotConsistencyGroupOptions { - _options.SnapshotConsistencyGroupPrototype = snapshotConsistencyGroupPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *CreateSnapshotConsistencyGroupOptions { - options.Headers = param - return options -} - -// CreateSnapshotOptions : The CreateSnapshot options. -type CreateSnapshotOptions struct { - // The snapshot prototype object. - SnapshotPrototype SnapshotPrototypeIntf `json:"SnapshotPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSnapshotOptions : Instantiate CreateSnapshotOptions -func (*VpcV1) NewCreateSnapshotOptions(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { - return &CreateSnapshotOptions{ - SnapshotPrototype: snapshotPrototype, - } -} - -// SetSnapshotPrototype : Allow user to set SnapshotPrototype -func (_options *CreateSnapshotOptions) SetSnapshotPrototype(snapshotPrototype SnapshotPrototypeIntf) *CreateSnapshotOptions { - _options.SnapshotPrototype = snapshotPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSnapshotOptions) SetHeaders(param map[string]string) *CreateSnapshotOptions { - options.Headers = param - return options -} - -// CreateSubnetOptions : The CreateSubnet options. -type CreateSubnetOptions struct { - // The subnet prototype object. - SubnetPrototype SubnetPrototypeIntf `json:"SubnetPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSubnetOptions : Instantiate CreateSubnetOptions -func (*VpcV1) NewCreateSubnetOptions(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - return &CreateSubnetOptions{ - SubnetPrototype: subnetPrototype, - } -} - -// SetSubnetPrototype : Allow user to set SubnetPrototype -func (_options *CreateSubnetOptions) SetSubnetPrototype(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - _options.SubnetPrototype = subnetPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSubnetOptions) SetHeaders(param map[string]string) *CreateSubnetOptions { - options.Headers = param - return options -} - -// CreateSubnetReservedIPOptions : The CreateSubnetReservedIP options. -type CreateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The target to bind this reserved IP to. The target must be in the same VPC. - // - // The following targets are supported: - // - An endpoint gateway not already bound to a reserved IP in the subnet's zone. - // - A virtual network interface. - // - // If unspecified, the reserved IP will be created unbound. - Target ReservedIPTargetPrototypeIntf `json:"target,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateSubnetReservedIPOptions : Instantiate CreateSubnetReservedIPOptions -func (*VpcV1) NewCreateSubnetReservedIPOptions(subnetID string) *CreateSubnetReservedIPOptions { - return &CreateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - } -} - -// SetSubnetID : Allow user to set SubnetID -func (_options *CreateSubnetReservedIPOptions) SetSubnetID(subnetID string) *CreateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetAddress : Allow user to set Address -func (_options *CreateSubnetReservedIPOptions) SetAddress(address string) *CreateSubnetReservedIPOptions { - _options.Address = core.StringPtr(address) - return _options -} - -// SetAutoDelete : Allow user to set AutoDelete -func (_options *CreateSubnetReservedIPOptions) SetAutoDelete(autoDelete bool) *CreateSubnetReservedIPOptions { - _options.AutoDelete = core.BoolPtr(autoDelete) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateSubnetReservedIPOptions) SetName(name string) *CreateSubnetReservedIPOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateSubnetReservedIPOptions) SetTarget(target ReservedIPTargetPrototypeIntf) *CreateSubnetReservedIPOptions { - _options.Target = target - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string) *CreateSubnetReservedIPOptions { - options.Headers = param - return options -} - -// CreateVPCRouteResponse : CreateVPCRouteResponse struct -type CreateVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the CreateVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - CreateVPCRouteResponseActionDelegateConst = "delegate" - CreateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - CreateVPCRouteResponseActionDeliverConst = "deliver" - CreateVPCRouteResponseActionDropConst = "drop" -) - -// Constants associated with the CreateVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - CreateVPCRouteResponseLifecycleStateDeletingConst = "deleting" - CreateVPCRouteResponseLifecycleStateFailedConst = "failed" - CreateVPCRouteResponseLifecycleStatePendingConst = "pending" - CreateVPCRouteResponseLifecycleStateStableConst = "stable" - CreateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - CreateVPCRouteResponseLifecycleStateUpdatingConst = "updating" - CreateVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the CreateVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - CreateVPCRouteResponseOriginServiceConst = "service" - CreateVPCRouteResponseOriginUserConst = "user" -) - -// UnmarshalCreateVPCRouteResponse unmarshals an instance of CreateVPCRouteResponse from the specified map of raw messages. -func UnmarshalCreateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CreateVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CreateVirtualNetworkInterfaceOptions : The CreateVirtualNetworkInterface options. -type CreateVirtualNetworkInterfaceOptions struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. Must be `false` if the virtual network interface is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVirtualNetworkInterfaceOptions : Instantiate CreateVirtualNetworkInterfaceOptions -func (*VpcV1) NewCreateVirtualNetworkInterfaceOptions() *CreateVirtualNetworkInterfaceOptions { - return &CreateVirtualNetworkInterfaceOptions{} -} - -// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing -func (_options *CreateVirtualNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateVirtualNetworkInterfaceOptions { - _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) - return _options -} - -// SetAutoDelete : Allow user to set AutoDelete -func (_options *CreateVirtualNetworkInterfaceOptions) SetAutoDelete(autoDelete bool) *CreateVirtualNetworkInterfaceOptions { - _options.AutoDelete = core.BoolPtr(autoDelete) - return _options -} - -// SetEnableInfrastructureNat : Allow user to set EnableInfrastructureNat -func (_options *CreateVirtualNetworkInterfaceOptions) SetEnableInfrastructureNat(enableInfrastructureNat bool) *CreateVirtualNetworkInterfaceOptions { - _options.EnableInfrastructureNat = core.BoolPtr(enableInfrastructureNat) - return _options -} - -// SetIps : Allow user to set Ips -func (_options *CreateVirtualNetworkInterfaceOptions) SetIps(ips []VirtualNetworkInterfaceIPPrototypeIntf) *CreateVirtualNetworkInterfaceOptions { - _options.Ips = ips - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVirtualNetworkInterfaceOptions) SetName(name string) *CreateVirtualNetworkInterfaceOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetPrimaryIP : Allow user to set PrimaryIP -func (_options *CreateVirtualNetworkInterfaceOptions) SetPrimaryIP(primaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf) *CreateVirtualNetworkInterfaceOptions { - _options.PrimaryIP = primaryIP - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVirtualNetworkInterfaceOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVirtualNetworkInterfaceOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateVirtualNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateVirtualNetworkInterfaceOptions { - _options.SecurityGroups = securityGroups - return _options -} - -// SetSubnet : Allow user to set Subnet -func (_options *CreateVirtualNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateVirtualNetworkInterfaceOptions { - _options.Subnet = subnet - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateVirtualNetworkInterfaceOptions { - options.Headers = param - return options -} - -// CreateVolumeOptions : The CreateVolume options. -type CreateVolumeOptions struct { - // The volume prototype object. - VolumePrototype VolumePrototypeIntf `json:"VolumePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVolumeOptions : Instantiate CreateVolumeOptions -func (*VpcV1) NewCreateVolumeOptions(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - return &CreateVolumeOptions{ - VolumePrototype: volumePrototype, - } -} - -// SetVolumePrototype : Allow user to set VolumePrototype -func (_options *CreateVolumeOptions) SetVolumePrototype(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - _options.VolumePrototype = volumePrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVolumeOptions) SetHeaders(param map[string]string) *CreateVolumeOptions { - options.Headers = param - return options -} - -// CreateVPCAddressPrefixOptions : The CreateVPCAddressPrefix options. -type CreateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The IPv4 range of the address prefix, expressed in CIDR format. The range must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) - // - // The prefix length of the address prefix's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). - CIDR *string `json:"cidr" validate:"required"` - - // The zone this address prefix will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not - // have a default address prefix for this zone. - IsDefault *bool `json:"is_default,omitempty"` - - // The name for this address prefix. The name must not be used by another address prefix for the VPC. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPCAddressPrefixOptions : Instantiate CreateVPCAddressPrefixOptions -func (*VpcV1) NewCreateVPCAddressPrefixOptions(vpcID string, cidr string, zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - return &CreateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - CIDR: core.StringPtr(cidr), - Zone: zone, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCAddressPrefixOptions) SetVPCID(vpcID string) *CreateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetCIDR : Allow user to set CIDR -func (_options *CreateVPCAddressPrefixOptions) SetCIDR(cidr string) *CreateVPCAddressPrefixOptions { - _options.CIDR = core.StringPtr(cidr) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateVPCAddressPrefixOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - _options.Zone = zone - return _options -} - -// SetIsDefault : Allow user to set IsDefault -func (_options *CreateVPCAddressPrefixOptions) SetIsDefault(isDefault bool) *CreateVPCAddressPrefixOptions { - _options.IsDefault = core.BoolPtr(isDefault) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCAddressPrefixOptions) SetName(name string) *CreateVPCAddressPrefixOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *CreateVPCAddressPrefixOptions { - options.Headers = param - return options -} - -// CreateVPCDnsResolutionBindingOptions : The CreateVPCDnsResolutionBinding options. -type CreateVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // Another VPC to bind this VPC to for DNS resolution. The VPC must have - // `dns.enable_hub` set to `true`, and may be in a different account (subject to - // IAM policies). - // - // Additionally, the VPC specified in the URL (this VPC) must have `dns.enable_hub` - // set to `false` and a `dns.resolution_binding_count` of zero. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. - // If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPCDnsResolutionBindingOptions : Instantiate CreateVPCDnsResolutionBindingOptions -func (*VpcV1) NewCreateVPCDnsResolutionBindingOptions(vpcID string, vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { - return &CreateVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - VPC: vpc, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *CreateVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPC : Allow user to set VPC -func (_options *CreateVPCDnsResolutionBindingOptions) SetVPC(vpc VPCIdentityIntf) *CreateVPCDnsResolutionBindingOptions { - _options.VPC = vpc - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCDnsResolutionBindingOptions) SetName(name string) *CreateVPCDnsResolutionBindingOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *CreateVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} - -// CreateVPCOptions : The CreateVPC options. -type CreateVPCOptions struct { - // Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) - // will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default - // address prefixes. - // - // Since address prefixes are managed identically regardless of whether they were automatically created, the value is - // not preserved as a VPC property. - AddressPrefixManagement *string `json:"address_prefix_management,omitempty"` - - // Indicates whether this VPC will be connected to Classic Infrastructure. If true, this VPC's resources will have - // private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be - // connected in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access,omitempty"` - - // The DNS configuration for this VPC. - // - // If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint - // gateways within this VPC, and hosts on the internet. - Dns *VpcdnsPrototype `json:"dns,omitempty"` - - // The name for this VPC. The name must not be used by another VPC in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPCOptions.AddressPrefixManagement property. -// Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) -// will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default -// address prefixes. -// -// Since address prefixes are managed identically regardless of whether they were automatically created, the value is -// not preserved as a VPC property. -const ( - CreateVPCOptionsAddressPrefixManagementAutoConst = "auto" - CreateVPCOptionsAddressPrefixManagementManualConst = "manual" -) - -// NewCreateVPCOptions : Instantiate CreateVPCOptions -func (*VpcV1) NewCreateVPCOptions() *CreateVPCOptions { - return &CreateVPCOptions{} -} - -// SetAddressPrefixManagement : Allow user to set AddressPrefixManagement -func (_options *CreateVPCOptions) SetAddressPrefixManagement(addressPrefixManagement string) *CreateVPCOptions { - _options.AddressPrefixManagement = core.StringPtr(addressPrefixManagement) - return _options -} - -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *CreateVPCOptions) SetClassicAccess(classicAccess bool) *CreateVPCOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) - return _options -} - -// SetDns : Allow user to set Dns -func (_options *CreateVPCOptions) SetDns(dns *VpcdnsPrototype) *CreateVPCOptions { - _options.Dns = dns - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCOptions) SetName(name string) *CreateVPCOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVPCOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPCOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCOptions) SetHeaders(param map[string]string) *CreateVPCOptions { - options.Headers = param - return options -} - -// CreateVPCRouteOptions : The CreateVPCRoute options. -type CreateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The destination CIDR of the route. The host identifier in the CIDR must be zero. - // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` - - // The zone to apply the route to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - // - // All routes in a routing table with the same `destination` and `zone` must have the same - // `advertise` value. - Advertise *bool `json:"advertise,omitempty"` - - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPCRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - CreateVPCRouteOptionsActionDelegateConst = "delegate" - CreateVPCRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRouteOptionsActionDeliverConst = "deliver" - CreateVPCRouteOptionsActionDropConst = "drop" -) - -// NewCreateVPCRouteOptions : Instantiate CreateVPCRouteOptions -func (*VpcV1) NewCreateVPCRouteOptions(vpcID string, destination string, zone ZoneIdentityIntf) *CreateVPCRouteOptions { - return &CreateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - Destination: core.StringPtr(destination), - Zone: zone, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRouteOptions) SetVPCID(vpcID string) *CreateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRouteOptions) SetDestination(destination string) *CreateVPCRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateVPCRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRouteOptions { - _options.Zone = zone - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateVPCRouteOptions) SetAction(action string) *CreateVPCRouteOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetAdvertise : Allow user to set Advertise -func (_options *CreateVPCRouteOptions) SetAdvertise(advertise bool) *CreateVPCRouteOptions { - _options.Advertise = core.BoolPtr(advertise) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCRouteOptions) SetName(name string) *CreateVPCRouteOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRouteOptions { - _options.NextHop = nextHop - return _options -} - -// SetPriority : Allow user to set Priority -func (_options *CreateVPCRouteOptions) SetPriority(priority int64) *CreateVPCRouteOptions { - _options.Priority = core.Int64Ptr(priority) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRouteOptions) SetHeaders(param map[string]string) *CreateVPCRouteOptions { - options.Headers = param - return options -} - -// CreateVPCRoutingTableOptions : The CreateVPCRoutingTable options. -type CreateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The filters specifying the resources that may create routes in this routing table. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` - - // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these - // sources. - AdvertiseRoutesTo []string `json:"advertise_routes_to,omitempty"` - - // The name for this routing table. The name must not be used by another routing table in the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from [Direct - // Link](https://cloud.ibm.com/docs/dl) to this VPC. The VPC must not already have a routing table with this property - // set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from the internet. For this to - // succeed, the VPC must not already have a routing table with this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. The VPC must not already have a routing table with - // this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in - // this VPC. The VPC must not already have a routing table with this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` - - // The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created - // with no routes. - Routes []RoutePrototype `json:"routes,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPCRoutingTableOptions.AdvertiseRoutesTo property. -// An ingress source that routes can be advertised to: -// -// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) -// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). -const ( - CreateVPCRoutingTableOptionsAdvertiseRoutesToDirectLinkConst = "direct_link" - CreateVPCRoutingTableOptionsAdvertiseRoutesToTransitGatewayConst = "transit_gateway" -) - -// NewCreateVPCRoutingTableOptions : Instantiate CreateVPCRoutingTableOptions -func (*VpcV1) NewCreateVPCRoutingTableOptions(vpcID string) *CreateVPCRoutingTableOptions { - return &CreateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetAcceptRoutesFrom : Allow user to set AcceptRoutesFrom -func (_options *CreateVPCRoutingTableOptions) SetAcceptRoutesFrom(acceptRoutesFrom []ResourceFilter) *CreateVPCRoutingTableOptions { - _options.AcceptRoutesFrom = acceptRoutesFrom - return _options -} - -// SetAdvertiseRoutesTo : Allow user to set AdvertiseRoutesTo -func (_options *CreateVPCRoutingTableOptions) SetAdvertiseRoutesTo(advertiseRoutesTo []string) *CreateVPCRoutingTableOptions { - _options.AdvertiseRoutesTo = advertiseRoutesTo - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableOptions) SetName(name string) *CreateVPCRoutingTableOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetRouteDirectLinkIngress : Allow user to set RouteDirectLinkIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteDirectLinkIngress(routeDirectLinkIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteDirectLinkIngress = core.BoolPtr(routeDirectLinkIngress) - return _options -} - -// SetRouteInternetIngress : Allow user to set RouteInternetIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteInternetIngress(routeInternetIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteInternetIngress = core.BoolPtr(routeInternetIngress) - return _options -} - -// SetRouteTransitGatewayIngress : Allow user to set RouteTransitGatewayIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteTransitGatewayIngress(routeTransitGatewayIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteTransitGatewayIngress = core.BoolPtr(routeTransitGatewayIngress) - return _options -} - -// SetRouteVPCZoneIngress : Allow user to set RouteVPCZoneIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteVPCZoneIngress(routeVPCZoneIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteVPCZoneIngress = core.BoolPtr(routeVPCZoneIngress) - return _options -} - -// SetRoutes : Allow user to set Routes -func (_options *CreateVPCRoutingTableOptions) SetRoutes(routes []RoutePrototype) *CreateVPCRoutingTableOptions { - _options.Routes = routes - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableOptions { - options.Headers = param - return options -} - -// CreateVPCRoutingTableRouteOptions : The CreateVPCRoutingTableRoute options. -type CreateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // The destination CIDR of the route. The host identifier in the CIDR must be zero. - // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` - - // The zone to apply the route to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - // - // All routes in a routing table with the same `destination` and `zone` must have the same - // `advertise` value. - Advertise *bool `json:"advertise,omitempty"` - - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPCRoutingTableRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - CreateVPCRoutingTableRouteOptionsActionDelegateConst = "delegate" - CreateVPCRoutingTableRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRoutingTableRouteOptionsActionDeliverConst = "deliver" - CreateVPCRoutingTableRouteOptionsActionDropConst = "drop" -) - -// NewCreateVPCRoutingTableRouteOptions : Instantiate CreateVPCRoutingTableRouteOptions -func (*VpcV1) NewCreateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, destination string, zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - return &CreateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - Destination: core.StringPtr(destination), - Zone: zone, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *CreateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *CreateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRoutingTableRouteOptions) SetDestination(destination string) *CreateVPCRoutingTableRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateVPCRoutingTableRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - _options.Zone = zone - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateVPCRoutingTableRouteOptions) SetAction(action string) *CreateVPCRoutingTableRouteOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetAdvertise : Allow user to set Advertise -func (_options *CreateVPCRoutingTableRouteOptions) SetAdvertise(advertise bool) *CreateVPCRoutingTableRouteOptions { - _options.Advertise = core.BoolPtr(advertise) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableRouteOptions) SetName(name string) *CreateVPCRoutingTableRouteOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRoutingTableRouteOptions) SetNextHop(nextHop RoutePrototypeNextHopIntf) *CreateVPCRoutingTableRouteOptions { - _options.NextHop = nextHop - return _options -} - -// SetPriority : Allow user to set Priority -func (_options *CreateVPCRoutingTableRouteOptions) SetPriority(priority int64) *CreateVPCRoutingTableRouteOptions { - _options.Priority = core.Int64Ptr(priority) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableRouteOptions { - options.Headers = param - return options -} - -// CreateVPNGatewayConnectionOptions : The CreateVPNGatewayConnection options. -type CreateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection prototype object. - VPNGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf `json:"VPNGatewayConnectionPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPNGatewayConnectionOptions : Instantiate CreateVPNGatewayConnectionOptions -func (*VpcV1) NewCreateVPNGatewayConnectionOptions(vpnGatewayID string, vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - return &CreateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - VPNGatewayConnectionPrototype: vpnGatewayConnectionPrototype, - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetVPNGatewayConnectionPrototype : Allow user to set VPNGatewayConnectionPrototype -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *CreateVPNGatewayConnectionOptions { - options.Headers = param - return options -} - -// CreateVPNGatewayOptions : The CreateVPNGateway options. -type CreateVPNGatewayOptions struct { - // The VPN gateway prototype object. - VPNGatewayPrototype VPNGatewayPrototypeIntf `json:"VPNGatewayPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPNGatewayOptions : Instantiate CreateVPNGatewayOptions -func (*VpcV1) NewCreateVPNGatewayOptions(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - return &CreateVPNGatewayOptions{ - VPNGatewayPrototype: vpnGatewayPrototype, - } -} - -// SetVPNGatewayPrototype : Allow user to set VPNGatewayPrototype -func (_options *CreateVPNGatewayOptions) SetVPNGatewayPrototype(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - _options.VPNGatewayPrototype = vpnGatewayPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayOptions) SetHeaders(param map[string]string) *CreateVPNGatewayOptions { - options.Headers = param - return options -} - -// CreateVPNServerOptions : The CreateVPNServer options. -type CreateVPNServerOptions struct { - // The certificate instance for this VPN server. - Certificate CertificateInstanceIdentityIntf `json:"certificate" validate:"required"` - - // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified - // methods. - ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication" validate:"required"` - - // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) - // - // The prefix length of the client IP address pool's CIDR must be between - // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses - // that are required to enable the maximum number of concurrent connections is recommended. - ClientIPPool *string `json:"client_ip_pool" validate:"required"` - - // The subnets to provision this VPN server in. Use subnets in different zones for high availability. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - - // The DNS server addresses that will be provided to VPN clients connected to this VPN server. - ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` - - // The seconds a VPN client can be idle before this VPN server will disconnect it. Specify `0` to prevent the server - // from disconnecting idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` - - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` - - // The name for this VPN server. The name must not be used by another VPN server in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The port number to use for this VPN server. - Port *int64 `json:"port,omitempty"` - - // The transport protocol to use for this VPN server. - Protocol *string `json:"protocol,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this VPN server. If unspecified, the VPC's default security group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPNServerOptions.Protocol property. -// The transport protocol to use for this VPN server. -const ( - CreateVPNServerOptionsProtocolTCPConst = "tcp" - CreateVPNServerOptionsProtocolUDPConst = "udp" -) - -// NewCreateVPNServerOptions : Instantiate CreateVPNServerOptions -func (*VpcV1) NewCreateVPNServerOptions(certificate CertificateInstanceIdentityIntf, clientAuthentication []VPNServerAuthenticationPrototypeIntf, clientIPPool string, subnets []SubnetIdentityIntf) *CreateVPNServerOptions { - return &CreateVPNServerOptions{ - Certificate: certificate, - ClientAuthentication: clientAuthentication, - ClientIPPool: core.StringPtr(clientIPPool), - Subnets: subnets, - } -} - -// SetCertificate : Allow user to set Certificate -func (_options *CreateVPNServerOptions) SetCertificate(certificate CertificateInstanceIdentityIntf) *CreateVPNServerOptions { - _options.Certificate = certificate - return _options -} - -// SetClientAuthentication : Allow user to set ClientAuthentication -func (_options *CreateVPNServerOptions) SetClientAuthentication(clientAuthentication []VPNServerAuthenticationPrototypeIntf) *CreateVPNServerOptions { - _options.ClientAuthentication = clientAuthentication - return _options -} - -// SetClientIPPool : Allow user to set ClientIPPool -func (_options *CreateVPNServerOptions) SetClientIPPool(clientIPPool string) *CreateVPNServerOptions { - _options.ClientIPPool = core.StringPtr(clientIPPool) - return _options -} - -// SetSubnets : Allow user to set Subnets -func (_options *CreateVPNServerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateVPNServerOptions { - _options.Subnets = subnets - return _options -} - -// SetClientDnsServerIps : Allow user to set ClientDnsServerIps -func (_options *CreateVPNServerOptions) SetClientDnsServerIps(clientDnsServerIps []IP) *CreateVPNServerOptions { - _options.ClientDnsServerIps = clientDnsServerIps - return _options -} - -// SetClientIdleTimeout : Allow user to set ClientIdleTimeout -func (_options *CreateVPNServerOptions) SetClientIdleTimeout(clientIdleTimeout int64) *CreateVPNServerOptions { - _options.ClientIdleTimeout = core.Int64Ptr(clientIdleTimeout) - return _options -} - -// SetEnableSplitTunneling : Allow user to set EnableSplitTunneling -func (_options *CreateVPNServerOptions) SetEnableSplitTunneling(enableSplitTunneling bool) *CreateVPNServerOptions { - _options.EnableSplitTunneling = core.BoolPtr(enableSplitTunneling) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPNServerOptions) SetName(name string) *CreateVPNServerOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetPort : Allow user to set Port -func (_options *CreateVPNServerOptions) SetPort(port int64) *CreateVPNServerOptions { - _options.Port = core.Int64Ptr(port) - return _options -} - -// SetProtocol : Allow user to set Protocol -func (_options *CreateVPNServerOptions) SetProtocol(protocol string) *CreateVPNServerOptions { - _options.Protocol = core.StringPtr(protocol) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVPNServerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPNServerOptions { - _options.ResourceGroup = resourceGroup - return _options -} - -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateVPNServerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateVPNServerOptions { - _options.SecurityGroups = securityGroups - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNServerOptions) SetHeaders(param map[string]string) *CreateVPNServerOptions { - options.Headers = param - return options -} - -// CreateVPNServerRouteOptions : The CreateVPNServerRoute options. -type CreateVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The destination to use for this VPN route in the VPN server. Must be unique within the VPN server. If an incoming - // packet does not match any destination, it will be dropped. - Destination *string `json:"destination" validate:"required"` - - // The action to perform with a packet matching the VPN route: - // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver - // the packet to target. - // - `deliver`: deliver the packet to the target. - // - `drop`: drop the packet - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the - // unexpected property value was encountered. - Action *string `json:"action,omitempty"` - - // The name for this VPN server route. The name must not be used by another route for the VPN server. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the CreateVPNServerRouteOptions.Action property. -// The action to perform with a packet matching the VPN route: -// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server, then deliver the -// packet to target. -// - `deliver`: deliver the packet to the target. -// - `drop`: drop the packet -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the -// unexpected property value was encountered. -const ( - CreateVPNServerRouteOptionsActionDeliverConst = "deliver" - CreateVPNServerRouteOptionsActionDropConst = "drop" - CreateVPNServerRouteOptionsActionTranslateConst = "translate" -) - -// NewCreateVPNServerRouteOptions : Instantiate CreateVPNServerRouteOptions -func (*VpcV1) NewCreateVPNServerRouteOptions(vpnServerID string, destination string) *CreateVPNServerRouteOptions { - return &CreateVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - Destination: core.StringPtr(destination), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *CreateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *CreateVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetDestination : Allow user to set Destination -func (_options *CreateVPNServerRouteOptions) SetDestination(destination string) *CreateVPNServerRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateVPNServerRouteOptions) SetAction(action string) *CreateVPNServerRouteOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPNServerRouteOptions) SetName(name string) *CreateVPNServerRouteOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNServerRouteOptions) SetHeaders(param map[string]string) *CreateVPNServerRouteOptions { - options.Headers = param - return options -} - -// DnsInstanceIdentity : Identifies a DNS instance by a unique property. -// Models which "extend" this model: -// - DnsInstanceIdentityByCRN -type DnsInstanceIdentity struct { - // The CRN for this DNS instance. - CRN *string `json:"crn,omitempty"` -} - -func (*DnsInstanceIdentity) isaDnsInstanceIdentity() bool { - return true -} - -type DnsInstanceIdentityIntf interface { - isaDnsInstanceIdentity() bool -} - -// UnmarshalDnsInstanceIdentity unmarshals an instance of DnsInstanceIdentity from the specified map of raw messages. -func UnmarshalDnsInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsInstanceReference : DnsInstanceReference struct -type DnsInstanceReference struct { - // The CRN for this DNS instance. - CRN *string `json:"crn" validate:"required"` -} - -// UnmarshalDnsInstanceReference unmarshals an instance of DnsInstanceReference from the specified map of raw messages. -func UnmarshalDnsInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsServer : A DNS server. -type DnsServer struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // If present, DHCP configuration for this zone will have this DNS server listed first. - ZoneAffinity *ZoneReference `json:"zone_affinity,omitempty"` -} - -// UnmarshalDnsServer unmarshals an instance of DnsServer from the specified map of raw messages. -func UnmarshalDnsServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsServer) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsServerPrototype : DnsServerPrototype struct -type DnsServerPrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // DHCP configuration for the specified zone will have this DNS server listed first. - ZoneAffinity ZoneIdentityIntf `json:"zone_affinity,omitempty"` -} - -// NewDnsServerPrototype : Instantiate DnsServerPrototype (Generic Model Constructor) -func (*VpcV1) NewDnsServerPrototype(address string) (_model *DnsServerPrototype, err error) { - _model = &DnsServerPrototype{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalDnsServerPrototype unmarshals an instance of DnsServerPrototype from the specified map of raw messages. -func UnmarshalDnsServerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsServerPrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone_affinity", &obj.ZoneAffinity, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsZoneIdentity : Identifies a DNS zone by a unique property. -// Models which "extend" this model: -// - DnsZoneIdentityByID -type DnsZoneIdentity struct { - ID *string `json:"id,omitempty"` -} - -func (*DnsZoneIdentity) isaDnsZoneIdentity() bool { - return true -} - -type DnsZoneIdentityIntf interface { - isaDnsZoneIdentity() bool -} - -// UnmarshalDnsZoneIdentity unmarshals an instance of DnsZoneIdentity from the specified map of raw messages. -func UnmarshalDnsZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsZoneReference : DnsZoneReference struct -type DnsZoneReference struct { - ID *string `json:"id" validate:"required"` -} - -// UnmarshalDnsZoneReference unmarshals an instance of DnsZoneReference from the specified map of raw messages. -func UnmarshalDnsZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHost : DedicatedHost struct -type DedicatedHost struct { - // The amount of memory in gibibytes that is currently available for instances. - AvailableMemory *int64 `json:"available_memory" validate:"required"` - - // The available VCPU for the dedicated host. - AvailableVcpu *Vcpu `json:"available_vcpu" validate:"required"` - - // The date and time that the dedicated host was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` - - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` - - // The dedicated host group this dedicated host is in. - Group *DedicatedHostGroupReference `json:"group" validate:"required"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` - - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled" validate:"required"` - - // The instances that are allocated to this dedicated host. - Instances []InstanceReference `json:"instances" validate:"required"` - - // The lifecycle state of the dedicated host. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The total amount of memory in gibibytes for this host. - Memory *int64 `json:"memory" validate:"required"` - - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. - Name *string `json:"name" validate:"required"` - - // The dedicated host NUMA configuration. - Numa *DedicatedHostNuma `json:"numa" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this - // dedicated host. - Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` - - // Indicates whether this dedicated host is available for instance creation. - Provisionable *bool `json:"provisionable" validate:"required"` - - // The resource group for this dedicated host. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The total number of sockets for this host. - SocketCount *int64 `json:"socket_count" validate:"required"` - - // The administrative state of the dedicated host. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which - // the unexpected property value was encountered. - State *string `json:"state" validate:"required"` - - // The instance profiles usable by instances placed on this dedicated host. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - // The total VCPU of the dedicated host. - Vcpu *Vcpu `json:"vcpu" validate:"required"` - - // The zone this dedicated host resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the DedicatedHost.LifecycleState property. -// The lifecycle state of the dedicated host. -const ( - DedicatedHostLifecycleStateDeletingConst = "deleting" - DedicatedHostLifecycleStateFailedConst = "failed" - DedicatedHostLifecycleStatePendingConst = "pending" - DedicatedHostLifecycleStateStableConst = "stable" - DedicatedHostLifecycleStateSuspendedConst = "suspended" - DedicatedHostLifecycleStateUpdatingConst = "updating" - DedicatedHostLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DedicatedHost.ResourceType property. -// The resource type. -const ( - DedicatedHostResourceTypeDedicatedHostConst = "dedicated_host" -) - -// Constants associated with the DedicatedHost.State property. -// The administrative state of the dedicated host. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which -// the unexpected property value was encountered. -const ( - DedicatedHostStateAvailableConst = "available" - DedicatedHostStateDegradedConst = "degraded" - DedicatedHostStateMigratingConst = "migrating" - DedicatedHostStateUnavailableConst = "unavailable" -) - -// UnmarshalDedicatedHost unmarshals an instance of DedicatedHost from the specified map of raw messages. -func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHost) - err = core.UnmarshalPrimitive(m, "available_memory", &obj.AvailableMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "available_vcpu", &obj.AvailableVcpu, UnmarshalVcpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "numa", &obj.Numa, UnmarshalDedicatedHostNuma) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostCollection : DedicatedHostCollection struct -type DedicatedHostCollection struct { - // Collection of dedicated hosts. - DedicatedHosts []DedicatedHost `json:"dedicated_hosts" validate:"required"` - - // A link to the first page of resources. - First *DedicatedHostCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalDedicatedHostCollection unmarshals an instance of DedicatedHostCollection from the specified map of raw messages. -func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollection) - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHost) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// DedicatedHostCollectionFirst : A link to the first page of resources. -type DedicatedHostCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostCollectionFirst unmarshals an instance of DedicatedHostCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostCollectionNext unmarshals an instance of DedicatedHostCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostDisk : DedicatedHostDisk struct -type DedicatedHostDisk struct { - // The remaining space left for instance placement in GB (gigabytes). - Available *int64 `json:"available" validate:"required"` - - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this disk. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this disk. - ID *string `json:"id" validate:"required"` - - // Instance disks that are on this dedicated host disk. - InstanceDisks []InstanceDiskReference `json:"instance_disks" validate:"required"` - - // The disk interface used for attaching the disk - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The lifecycle state of this dedicated host disk. - LifecycleState *string `json:"lifecycle_state,omitempty"` - - // The name for this dedicated host disk. The name is unique across all disks on the dedicated host. - Name *string `json:"name" validate:"required"` - - // Indicates whether this dedicated host disk is available for instance disk creation. - Provisionable *bool `json:"provisionable" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` - - // The instance disk interfaces supported for this dedicated host disk. - SupportedInstanceInterfaceTypes []string `json:"supported_instance_interface_types" validate:"required"` -} - -// Constants associated with the DedicatedHostDisk.InterfaceType property. -// The disk interface used for attaching the disk -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostDiskInterfaceTypeNvmeConst = "nvme" -) - -// Constants associated with the DedicatedHostDisk.LifecycleState property. -// The lifecycle state of this dedicated host disk. -const ( - DedicatedHostDiskLifecycleStateDeletingConst = "deleting" - DedicatedHostDiskLifecycleStateFailedConst = "failed" - DedicatedHostDiskLifecycleStatePendingConst = "pending" - DedicatedHostDiskLifecycleStateStableConst = "stable" - DedicatedHostDiskLifecycleStateSuspendedConst = "suspended" - DedicatedHostDiskLifecycleStateUpdatingConst = "updating" - DedicatedHostDiskLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DedicatedHostDisk.ResourceType property. -// The resource type. -const ( - DedicatedHostDiskResourceTypeDedicatedHostDiskConst = "dedicated_host_disk" -) - -// Constants associated with the DedicatedHostDisk.SupportedInstanceInterfaceTypes property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostDiskSupportedInstanceInterfaceTypesNvmeConst = "nvme" - DedicatedHostDiskSupportedInstanceInterfaceTypesVirtioBlkConst = "virtio_blk" -) - -// UnmarshalDedicatedHostDisk unmarshals an instance of DedicatedHostDisk from the specified map of raw messages. -func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDisk) - err = core.UnmarshalPrimitive(m, "available", &obj.Available) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_disks", &obj.InstanceDisks, UnmarshalInstanceDiskReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostDiskCollection : DedicatedHostDiskCollection struct -type DedicatedHostDiskCollection struct { - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` -} - -// UnmarshalDedicatedHostDiskCollection unmarshals an instance of DedicatedHostDiskCollection from the specified map of raw messages. -func UnmarshalDedicatedHostDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostDiskPatch : DedicatedHostDiskPatch struct -type DedicatedHostDiskPatch struct { - // The name for this dedicated host disk. The name must not be used by another disk on the dedicated host. - Name *string `json:"name,omitempty"` -} - -// UnmarshalDedicatedHostDiskPatch unmarshals an instance of DedicatedHostDiskPatch from the specified map of raw messages. -func UnmarshalDedicatedHostDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the DedicatedHostDiskPatch -func (dedicatedHostDiskPatch *DedicatedHostDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// DedicatedHostGroup : DedicatedHostGroup struct -type DedicatedHostGroup struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class" validate:"required"` - - // The date and time that the dedicated host group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // The dedicated hosts that are in this dedicated host group. - DedicatedHosts []DedicatedHostReference `json:"dedicated_hosts" validate:"required"` - - // The dedicated host profile family for hosts in this group. - Family *string `json:"family" validate:"required"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource group for this dedicated host group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The instance profiles usable by instances placed on this dedicated host group. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - // The zone this dedicated host group resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the DedicatedHostGroup.Family property. -// The dedicated host profile family for hosts in this group. -const ( - DedicatedHostGroupFamilyBalancedConst = "balanced" - DedicatedHostGroupFamilyComputeConst = "compute" - DedicatedHostGroupFamilyMemoryConst = "memory" -) - -// Constants associated with the DedicatedHostGroup.ResourceType property. -// The resource type. -const ( - DedicatedHostGroupResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -// UnmarshalDedicatedHostGroup unmarshals an instance of DedicatedHostGroup from the specified map of raw messages. -func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroup) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHostReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupCollection : DedicatedHostGroupCollection struct -type DedicatedHostGroupCollection struct { - // A link to the first page of resources. - First *DedicatedHostGroupCollectionFirst `json:"first" validate:"required"` - - // Collection of dedicated host groups. - Groups []DedicatedHostGroup `json:"groups" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostGroupCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalDedicatedHostGroupCollection unmarshals an instance of DedicatedHostGroupCollection from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "groups", &obj.Groups, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// DedicatedHostGroupCollectionFirst : A link to the first page of resources. -type DedicatedHostGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostGroupCollectionFirst unmarshals an instance of DedicatedHostGroupCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostGroupCollectionNext unmarshals an instance of DedicatedHostGroupCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. -// Models which "extend" this model: -// - DedicatedHostGroupIdentityByID -// - DedicatedHostGroupIdentityByCRN -// - DedicatedHostGroupIdentityByHref -type DedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` -} - -func (*DedicatedHostGroupIdentity) isaDedicatedHostGroupIdentity() bool { - return true -} - -type DedicatedHostGroupIdentityIntf interface { - isaDedicatedHostGroupIdentity() bool -} - -// UnmarshalDedicatedHostGroupIdentity unmarshals an instance of DedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupPatch : DedicatedHostGroupPatch struct -type DedicatedHostGroupPatch struct { - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalDedicatedHostGroupPatch unmarshals an instance of DedicatedHostGroupPatch from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the DedicatedHostGroupPatch -func (dedicatedHostGroupPatch *DedicatedHostGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// DedicatedHostGroupPrototypeDedicatedHostByZoneContext : DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct -type DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct { - // The name for this dedicated host group. The name must not be used by another dedicated host group in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the host's resource group is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -} - -// UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext unmarshals an instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPrototypeDedicatedHostByZoneContext) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupReference : DedicatedHostGroupReference struct -type DedicatedHostGroupReference struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the DedicatedHostGroupReference.ResourceType property. -// The resource type. -const ( - DedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -// UnmarshalDedicatedHostGroupReference unmarshals an instance of DedicatedHostGroupReference from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type DedicatedHostGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalDedicatedHostGroupReferenceDeleted unmarshals an instance of DedicatedHostGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostNuma : The dedicated host NUMA configuration. -type DedicatedHostNuma struct { - // The total number of NUMA nodes for this dedicated host. - Count *int64 `json:"count" validate:"required"` - - // The NUMA nodes for this dedicated host. - Nodes []DedicatedHostNumaNode `json:"nodes" validate:"required"` -} - -// UnmarshalDedicatedHostNuma unmarshals an instance of DedicatedHostNuma from the specified map of raw messages. -func UnmarshalDedicatedHostNuma(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostNuma) - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalModel(m, "nodes", &obj.Nodes, UnmarshalDedicatedHostNumaNode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostNumaNode : The dedicated host NUMA node configuration. -type DedicatedHostNumaNode struct { - // The available VCPU for this NUMA node. - AvailableVcpu *int64 `json:"available_vcpu" validate:"required"` - - // The total VCPU capacity for this NUMA node. - Vcpu *int64 `json:"vcpu" validate:"required"` -} - -// UnmarshalDedicatedHostNumaNode unmarshals an instance of DedicatedHostNumaNode from the specified map of raw messages. -func UnmarshalDedicatedHostNumaNode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostNumaNode) - err = core.UnmarshalPrimitive(m, "available_vcpu", &obj.AvailableVcpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vcpu", &obj.Vcpu) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostPatch : DedicatedHostPatch struct -type DedicatedHostPatch struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` - - // The name for this dedicated host. The name must not be used by another dedicated host in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalDedicatedHostPatch unmarshals an instance of DedicatedHostPatch from the specified map of raw messages. -func UnmarshalDedicatedHostPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPatch) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the DedicatedHostPatch -func (dedicatedHostPatch *DedicatedHostPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// DedicatedHostProfile : DedicatedHostProfile struct -type DedicatedHostProfile struct { - // The product class this dedicated host profile belongs to. - Class *string `json:"class" validate:"required"` - - // Collection of the dedicated host profile's disks. - Disks []DedicatedHostProfileDisk `json:"disks" validate:"required"` - - // The product family this dedicated host profile belongs to - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - Memory DedicatedHostProfileMemoryIntf `json:"memory" validate:"required"` - - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` - - SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` - - // The status of the dedicated host profile: - // - `previous`: This dedicated host profile is an older revision, but remains provisionable - // and usable. - // - `current`: This profile is the latest revision. - // - // Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming - // conventions] - // (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how - // generations are defined within a dedicated host profile. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The instance profiles usable by instances placed on dedicated hosts with this profile. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - VcpuArchitecture *DedicatedHostProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` - - VcpuCount DedicatedHostProfileVcpuIntf `json:"vcpu_count" validate:"required"` - - VcpuManufacturer *DedicatedHostProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` -} - -// Constants associated with the DedicatedHostProfile.Family property. -// The product family this dedicated host profile belongs to -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileFamilyBalancedConst = "balanced" - DedicatedHostProfileFamilyComputeConst = "compute" - DedicatedHostProfileFamilyMemoryConst = "memory" -) - -// Constants associated with the DedicatedHostProfile.Status property. -// The status of the dedicated host profile: -// - `previous`: This dedicated host profile is an older revision, but remains provisionable -// and usable. -// - `current`: This profile is the latest revision. -// -// Note that revisions are indicated by the generation of a dedicated host profile. Refer to the [profile naming -// conventions] -// (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule) for information on how -// generations are defined within a dedicated host profile. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileStatusCurrentConst = "current" - DedicatedHostProfileStatusPreviousConst = "previous" -) - -// UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. -func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfile) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostProfileDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalDedicatedHostProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "socket_count", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalDedicatedHostProfileVcpuManufacturer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileCollection : DedicatedHostProfileCollection struct -type DedicatedHostProfileCollection struct { - // A link to the first page of resources. - First *DedicatedHostProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostProfileCollectionNext `json:"next,omitempty"` - - // Collection of dedicated host profiles. - Profiles []DedicatedHostProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalDedicatedHostProfileCollection unmarshals an instance of DedicatedHostProfileCollection from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalDedicatedHostProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// DedicatedHostProfileCollectionFirst : A link to the first page of resources. -type DedicatedHostProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostProfileCollectionFirst unmarshals an instance of DedicatedHostProfileCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostProfileCollectionNext unmarshals an instance of DedicatedHostProfileCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileDisk : Disks provided by this profile. -type DedicatedHostProfileDisk struct { - InterfaceType *DedicatedHostProfileDiskInterface `json:"interface_type" validate:"required"` - - // The number of disks of this type for a dedicated host with this profile. - Quantity *DedicatedHostProfileDiskQuantity `json:"quantity" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *DedicatedHostProfileDiskSize `json:"size" validate:"required"` - - SupportedInstanceInterfaceTypes *DedicatedHostProfileDiskSupportedInterfaces `json:"supported_instance_interface_types" validate:"required"` -} - -// UnmarshalDedicatedHostProfileDisk unmarshals an instance of DedicatedHostProfileDisk from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDisk) - err = core.UnmarshalModel(m, "interface_type", &obj.InterfaceType, UnmarshalDedicatedHostProfileDiskInterface) - if err != nil { - return - } - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalDedicatedHostProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalDedicatedHostProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes, UnmarshalDedicatedHostProfileDiskSupportedInterfaces) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileDiskInterface : DedicatedHostProfileDiskInterface struct -type DedicatedHostProfileDiskInterface struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The interface of the disk for a dedicated host with this profile - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileDiskInterface.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskInterfaceTypeFixedConst = "fixed" -) - -// Constants associated with the DedicatedHostProfileDiskInterface.Value property. -// The interface of the disk for a dedicated host with this profile -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileDiskInterfaceValueNvmeConst = "nvme" -) - -// UnmarshalDedicatedHostProfileDiskInterface unmarshals an instance of DedicatedHostProfileDiskInterface from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskInterface) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileDiskQuantity : The number of disks of this type for a dedicated host with this profile. -type DedicatedHostProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileDiskQuantity.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskQuantityTypeFixedConst = "fixed" -) - -// UnmarshalDedicatedHostProfileDiskQuantity unmarshals an instance of DedicatedHostProfileDiskQuantity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileDiskSize : The size of the disk in GB (gigabytes). -type DedicatedHostProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileDiskSize.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSizeTypeFixedConst = "fixed" -) - -// UnmarshalDedicatedHostProfileDiskSize unmarshals an instance of DedicatedHostProfileDiskSize from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileDiskSupportedInterfaces : DedicatedHostProfileDiskSupportedInterfaces struct -type DedicatedHostProfileDiskSupportedInterfaces struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The instance disk interfaces supported for a dedicated host with this profile. - Value []string `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSupportedInterfacesTypeFixedConst = "fixed" -) - -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Value property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileDiskSupportedInterfacesValueNvmeConst = "nvme" - DedicatedHostProfileDiskSupportedInterfacesValueVirtioBlkConst = "virtio_blk" -) - -// UnmarshalDedicatedHostProfileDiskSupportedInterfaces unmarshals an instance of DedicatedHostProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileIdentity : Identifies a dedicated host profile by a unique property. -// Models which "extend" this model: -// - DedicatedHostProfileIdentityByName -// - DedicatedHostProfileIdentityByHref -type DedicatedHostProfileIdentity struct { - // The globally unique name for this dedicated host profile. - Name *string `json:"name,omitempty"` - - // The URL for this dedicated host profile. - Href *string `json:"href,omitempty"` -} - -func (*DedicatedHostProfileIdentity) isaDedicatedHostProfileIdentity() bool { - return true -} - -type DedicatedHostProfileIdentityIntf interface { - isaDedicatedHostProfileIdentity() bool -} - -// UnmarshalDedicatedHostProfileIdentity unmarshals an instance of DedicatedHostProfileIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileMemory : DedicatedHostProfileMemory struct -// Models which "extend" this model: -// - DedicatedHostProfileMemoryFixed -// - DedicatedHostProfileMemoryRange -// - DedicatedHostProfileMemoryEnum -// - DedicatedHostProfileMemoryDependent -type DedicatedHostProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the DedicatedHostProfileMemory.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileMemory) isaDedicatedHostProfileMemory() bool { - return true -} - -type DedicatedHostProfileMemoryIntf interface { - isaDedicatedHostProfileMemory() bool -} - -// UnmarshalDedicatedHostProfileMemory unmarshals an instance of DedicatedHostProfileMemory from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileReference : DedicatedHostProfileReference struct -type DedicatedHostProfileReference struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalDedicatedHostProfileReference unmarshals an instance of DedicatedHostProfileReference from the specified map of raw messages. -func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileSocket : DedicatedHostProfileSocket struct -// Models which "extend" this model: -// - DedicatedHostProfileSocketFixed -// - DedicatedHostProfileSocketRange -// - DedicatedHostProfileSocketEnum -// - DedicatedHostProfileSocketDependent -type DedicatedHostProfileSocket struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the DedicatedHostProfileSocket.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileSocket) isaDedicatedHostProfileSocket() bool { - return true -} - -type DedicatedHostProfileSocketIntf interface { - isaDedicatedHostProfileSocket() bool -} - -// UnmarshalDedicatedHostProfileSocket unmarshals an instance of DedicatedHostProfileSocket from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocket(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocket) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpu : DedicatedHostProfileVcpu struct -// Models which "extend" this model: -// - DedicatedHostProfileVcpuFixed -// - DedicatedHostProfileVcpuRange -// - DedicatedHostProfileVcpuEnum -// - DedicatedHostProfileVcpuDependent -type DedicatedHostProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the DedicatedHostProfileVcpu.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileVcpu) isaDedicatedHostProfileVcpu() bool { - return true -} - -type DedicatedHostProfileVcpuIntf interface { - isaDedicatedHostProfileVcpu() bool -} - -// UnmarshalDedicatedHostProfileVcpu unmarshals an instance of DedicatedHostProfileVcpu from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuArchitecture : DedicatedHostProfileVcpuArchitecture struct -type DedicatedHostProfileVcpuArchitecture struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The VCPU architecture for a dedicated host with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuArchitectureTypeFixedConst = "fixed" -) - -// UnmarshalDedicatedHostProfileVcpuArchitecture unmarshals an instance of DedicatedHostProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuManufacturer : DedicatedHostProfileVcpuManufacturer struct -type DedicatedHostProfileVcpuManufacturer struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The VCPU manufacturer for a dedicated host with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuManufacturer.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuManufacturerTypeFixedConst = "fixed" -) - -// UnmarshalDedicatedHostProfileVcpuManufacturer unmarshals an instance of DedicatedHostProfileVcpuManufacturer from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuManufacturer) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostPrototype : DedicatedHostPrototype struct -// Models which "extend" this model: -// - DedicatedHostPrototypeDedicatedHostByGroup -// - DedicatedHostPrototypeDedicatedHostByZone -type DedicatedHostPrototype struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` - - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this - // dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The dedicated host group for this dedicated host. - Group DedicatedHostGroupIdentityIntf `json:"group,omitempty"` - - // The zone this dedicated host will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} - -func (*DedicatedHostPrototype) isaDedicatedHostPrototype() bool { - return true -} - -type DedicatedHostPrototypeIntf interface { - isaDedicatedHostPrototype() bool -} - -// UnmarshalDedicatedHostPrototype unmarshals an instance of DedicatedHostPrototype from the specified map of raw messages. -func UnmarshalDedicatedHostPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototype) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostReference : DedicatedHostReference struct -type DedicatedHostReference struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the DedicatedHostReference.ResourceType property. -// The resource type. -const ( - DedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" -) - -// UnmarshalDedicatedHostReference unmarshals an instance of DedicatedHostReference from the specified map of raw messages. -func UnmarshalDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type DedicatedHostReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalDedicatedHostReferenceDeleted unmarshals an instance of DedicatedHostReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DefaultNetworkACL : DefaultNetworkACL struct -type DefaultNetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` - - // The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words - // at creation, but may be changed. - Name *string `json:"name" validate:"required"` - - // The resource group for the default network ACL for a VPC. Set to the VPC's - // resource group at creation. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The ordered rules for the default network ACL for a VPC. Defaults to two rules which allow all inbound and outbound - // traffic, respectively. Rules for the default network ACL may be changed, added, or removed. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The VPC this network ACL resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalDefaultNetworkACL unmarshals an instance of DefaultNetworkACL from the specified map of raw messages. -func UnmarshalDefaultNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultNetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DefaultRoutingTable : DefaultRoutingTable struct -type DefaultRoutingTable struct { - // The filters specifying the resources that may create routes in this routing table. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - - // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these - // sources. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - AdvertiseRoutesTo []string `json:"advertise_routes_to" validate:"required"` - - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this routing table. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` - - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected - // words at creation, but may be changed. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from the internet. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` - - // The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, - // changed, or removed with a subsequent request. - Routes []RouteReference `json:"routes" validate:"required"` - - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` -} - -// Constants associated with the DefaultRoutingTable.AdvertiseRoutesTo property. -// An ingress source that routes can be advertised to: -// -// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) -// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). -const ( - DefaultRoutingTableAdvertiseRoutesToDirectLinkConst = "direct_link" - DefaultRoutingTableAdvertiseRoutesToTransitGatewayConst = "transit_gateway" -) - -// Constants associated with the DefaultRoutingTable.LifecycleState property. -// The lifecycle state of the routing table. -const ( - DefaultRoutingTableLifecycleStateDeletingConst = "deleting" - DefaultRoutingTableLifecycleStateFailedConst = "failed" - DefaultRoutingTableLifecycleStatePendingConst = "pending" - DefaultRoutingTableLifecycleStateStableConst = "stable" - DefaultRoutingTableLifecycleStateSuspendedConst = "suspended" - DefaultRoutingTableLifecycleStateUpdatingConst = "updating" - DefaultRoutingTableLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DefaultRoutingTable.ResourceType property. -// The resource type. -const ( - DefaultRoutingTableResourceTypeRoutingTableConst = "routing_table" -) - -// UnmarshalDefaultRoutingTable unmarshals an instance of DefaultRoutingTable from the specified map of raw messages. -func UnmarshalDefaultRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultRoutingTable) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DefaultSecurityGroup : DefaultSecurityGroup struct -type DefaultSecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name for the default security group for a VPC. The name will be a hyphenated list of randomly-selected words at - // creation, but may changed. - Name *string `json:"name" validate:"required"` - - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The rules for the default security group for a VPC. Defaults to allowing all outbound traffic, and allowing all - // inbound traffic from other interfaces in the VPC's default security group. Rules for the default security group may - // be changed, added or removed. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` - - // The targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` - - // The VPC this security group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalDefaultSecurityGroup unmarshals an instance of DefaultSecurityGroup from the specified map of raw messages. -func UnmarshalDefaultSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultSecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DeleteBackupPolicyOptions : The DeleteBackupPolicy options. -type DeleteBackupPolicyOptions struct { - // The backup policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteBackupPolicyOptions : Instantiate DeleteBackupPolicyOptions -func (*VpcV1) NewDeleteBackupPolicyOptions(id string) *DeleteBackupPolicyOptions { - return &DeleteBackupPolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteBackupPolicyOptions) SetID(id string) *DeleteBackupPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteBackupPolicyOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteBackupPolicyOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyOptions { - options.Headers = param - return options -} - -// DeleteBackupPolicyPlanOptions : The DeleteBackupPolicyPlan options. -type DeleteBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteBackupPolicyPlanOptions : Instantiate DeleteBackupPolicyPlanOptions -func (*VpcV1) NewDeleteBackupPolicyPlanOptions(backupPolicyID string, id string) *DeleteBackupPolicyPlanOptions { - return &DeleteBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *DeleteBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *DeleteBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteBackupPolicyPlanOptions) SetID(id string) *DeleteBackupPolicyPlanOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *DeleteBackupPolicyPlanOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteBackupPolicyPlanOptions) SetHeaders(param map[string]string) *DeleteBackupPolicyPlanOptions { - options.Headers = param - return options -} - -// DeleteBareMetalServerNetworkAttachmentOptions : The DeleteBareMetalServerNetworkAttachment options. -type DeleteBareMetalServerNetworkAttachmentOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteBareMetalServerNetworkAttachmentOptions : Instantiate DeleteBareMetalServerNetworkAttachmentOptions -func (*VpcV1) NewDeleteBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkAttachmentOptions { - return &DeleteBareMetalServerNetworkAttachmentOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *DeleteBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteBareMetalServerNetworkAttachmentOptions) SetID(id string) *DeleteBareMetalServerNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkAttachmentOptions { - options.Headers = param - return options -} - -// DeleteBareMetalServerNetworkInterfaceOptions : The DeleteBareMetalServerNetworkInterface options. -type DeleteBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteBareMetalServerNetworkInterfaceOptions : Instantiate DeleteBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewDeleteBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkInterfaceOptions { - return &DeleteBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetID(id string) *DeleteBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} - -// DeleteBareMetalServerOptions : The DeleteBareMetalServer options. -type DeleteBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteBareMetalServerOptions : Instantiate DeleteBareMetalServerOptions -func (*VpcV1) NewDeleteBareMetalServerOptions(id string) *DeleteBareMetalServerOptions { - return &DeleteBareMetalServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteBareMetalServerOptions) SetID(id string) *DeleteBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteBareMetalServerOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerOptions { - options.Headers = param - return options -} - -// DeleteDedicatedHostGroupOptions : The DeleteDedicatedHostGroup options. -type DeleteDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteDedicatedHostGroupOptions : Instantiate DeleteDedicatedHostGroupOptions -func (*VpcV1) NewDeleteDedicatedHostGroupOptions(id string) *DeleteDedicatedHostGroupOptions { - return &DeleteDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostGroupOptions) SetID(id string) *DeleteDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostGroupOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostGroupOptions { - options.Headers = param - return options -} - -// DeleteDedicatedHostOptions : The DeleteDedicatedHost options. -type DeleteDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteDedicatedHostOptions : Instantiate DeleteDedicatedHostOptions -func (*VpcV1) NewDeleteDedicatedHostOptions(id string) *DeleteDedicatedHostOptions { - return &DeleteDedicatedHostOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostOptions) SetID(id string) *DeleteDedicatedHostOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostOptions { - options.Headers = param - return options -} - -// DeleteEndpointGatewayOptions : The DeleteEndpointGateway options. -type DeleteEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteEndpointGatewayOptions : Instantiate DeleteEndpointGatewayOptions -func (*VpcV1) NewDeleteEndpointGatewayOptions(id string) *DeleteEndpointGatewayOptions { - return &DeleteEndpointGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteEndpointGatewayOptions) SetID(id string) *DeleteEndpointGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayOptions { - options.Headers = param - return options -} - -// DeleteFloatingIPOptions : The DeleteFloatingIP options. -type DeleteFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteFloatingIPOptions : Instantiate DeleteFloatingIPOptions -func (*VpcV1) NewDeleteFloatingIPOptions(id string) *DeleteFloatingIPOptions { - return &DeleteFloatingIPOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteFloatingIPOptions) SetID(id string) *DeleteFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteFloatingIPOptions) SetHeaders(param map[string]string) *DeleteFloatingIPOptions { - options.Headers = param - return options -} - -// DeleteFlowLogCollectorOptions : The DeleteFlowLogCollector options. -type DeleteFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteFlowLogCollectorOptions : Instantiate DeleteFlowLogCollectorOptions -func (*VpcV1) NewDeleteFlowLogCollectorOptions(id string) *DeleteFlowLogCollectorOptions { - return &DeleteFlowLogCollectorOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteFlowLogCollectorOptions) SetID(id string) *DeleteFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteFlowLogCollectorOptions) SetHeaders(param map[string]string) *DeleteFlowLogCollectorOptions { - options.Headers = param - return options -} - -// DeleteIkePolicyOptions : The DeleteIkePolicy options. -type DeleteIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteIkePolicyOptions : Instantiate DeleteIkePolicyOptions -func (*VpcV1) NewDeleteIkePolicyOptions(id string) *DeleteIkePolicyOptions { - return &DeleteIkePolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteIkePolicyOptions) SetID(id string) *DeleteIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteIkePolicyOptions) SetHeaders(param map[string]string) *DeleteIkePolicyOptions { - options.Headers = param - return options -} - -// DeleteImageExportJobOptions : The DeleteImageExportJob options. -type DeleteImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The image export job identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteImageExportJobOptions : Instantiate DeleteImageExportJobOptions -func (*VpcV1) NewDeleteImageExportJobOptions(imageID string, id string) *DeleteImageExportJobOptions { - return &DeleteImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), - } -} - -// SetImageID : Allow user to set ImageID -func (_options *DeleteImageExportJobOptions) SetImageID(imageID string) *DeleteImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteImageExportJobOptions) SetID(id string) *DeleteImageExportJobOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteImageExportJobOptions) SetHeaders(param map[string]string) *DeleteImageExportJobOptions { - options.Headers = param - return options -} - -// DeleteImageOptions : The DeleteImage options. -type DeleteImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteImageOptions : Instantiate DeleteImageOptions -func (*VpcV1) NewDeleteImageOptions(id string) *DeleteImageOptions { - return &DeleteImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteImageOptions) SetID(id string) *DeleteImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteImageOptions) SetHeaders(param map[string]string) *DeleteImageOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupLoadBalancerOptions : The DeleteInstanceGroupLoadBalancer options. -type DeleteInstanceGroupLoadBalancerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupLoadBalancerOptions : Instantiate DeleteInstanceGroupLoadBalancerOptions -func (*VpcV1) NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { - return &DeleteInstanceGroupLoadBalancerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupLoadBalancerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupLoadBalancerOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupManagerActionOptions : The DeleteInstanceGroupManagerAction options. -type DeleteInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupManagerActionOptions : Instantiate DeleteInstanceGroupManagerActionOptions -func (*VpcV1) NewDeleteInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerActionOptions { - return &DeleteInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerActionOptions) SetID(id string) *DeleteInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerActionOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupManagerOptions : The DeleteInstanceGroupManager options. -type DeleteInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupManagerOptions : Instantiate DeleteInstanceGroupManagerOptions -func (*VpcV1) NewDeleteInstanceGroupManagerOptions(instanceGroupID string, id string) *DeleteInstanceGroupManagerOptions { - return &DeleteInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerOptions) SetID(id string) *DeleteInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupManagerPolicyOptions : The DeleteInstanceGroupManagerPolicy options. -type DeleteInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupManagerPolicyOptions : Instantiate DeleteInstanceGroupManagerPolicyOptions -func (*VpcV1) NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerPolicyOptions { - return &DeleteInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetID(id string) *DeleteInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupMembershipOptions : The DeleteInstanceGroupMembership options. -type DeleteInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupMembershipOptions : Instantiate DeleteInstanceGroupMembershipOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipOptions(instanceGroupID string, id string) *DeleteInstanceGroupMembershipOptions { - return &DeleteInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupMembershipOptions) SetID(id string) *DeleteInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupMembershipsOptions : The DeleteInstanceGroupMemberships options. -type DeleteInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupMembershipsOptions : Instantiate DeleteInstanceGroupMembershipsOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipsOptions(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - return &DeleteInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipsOptions { - options.Headers = param - return options -} - -// DeleteInstanceGroupOptions : The DeleteInstanceGroup options. -type DeleteInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceGroupOptions : Instantiate DeleteInstanceGroupOptions -func (*VpcV1) NewDeleteInstanceGroupOptions(id string) *DeleteInstanceGroupOptions { - return &DeleteInstanceGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupOptions) SetID(id string) *DeleteInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupOptions { - options.Headers = param - return options -} - -// DeleteInstanceNetworkAttachmentOptions : The DeleteInstanceNetworkAttachment options. -type DeleteInstanceNetworkAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceNetworkAttachmentOptions : Instantiate DeleteInstanceNetworkAttachmentOptions -func (*VpcV1) NewDeleteInstanceNetworkAttachmentOptions(instanceID string, id string) *DeleteInstanceNetworkAttachmentOptions { - return &DeleteInstanceNetworkAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceNetworkAttachmentOptions) SetID(id string) *DeleteInstanceNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkAttachmentOptions { - options.Headers = param - return options -} - -// DeleteInstanceNetworkInterfaceOptions : The DeleteInstanceNetworkInterface options. -type DeleteInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceNetworkInterfaceOptions : Instantiate DeleteInstanceNetworkInterfaceOptions -func (*VpcV1) NewDeleteInstanceNetworkInterfaceOptions(instanceID string, id string) *DeleteInstanceNetworkInterfaceOptions { - return &DeleteInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetID(id string) *DeleteInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} - -// DeleteInstanceOptions : The DeleteInstance options. -type DeleteInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceOptions : Instantiate DeleteInstanceOptions -func (*VpcV1) NewDeleteInstanceOptions(id string) *DeleteInstanceOptions { - return &DeleteInstanceOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteInstanceOptions) SetIfMatch(ifMatch string) *DeleteInstanceOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { - options.Headers = param - return options -} - -// DeleteInstanceTemplateOptions : The DeleteInstanceTemplate options. -type DeleteInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceTemplateOptions : Instantiate DeleteInstanceTemplateOptions -func (*VpcV1) NewDeleteInstanceTemplateOptions(id string) *DeleteInstanceTemplateOptions { - return &DeleteInstanceTemplateOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceTemplateOptions) SetID(id string) *DeleteInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceTemplateOptions) SetHeaders(param map[string]string) *DeleteInstanceTemplateOptions { - options.Headers = param - return options -} - -// DeleteInstanceVolumeAttachmentOptions : The DeleteInstanceVolumeAttachment options. -type DeleteInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteInstanceVolumeAttachmentOptions : Instantiate DeleteInstanceVolumeAttachmentOptions -func (*VpcV1) NewDeleteInstanceVolumeAttachmentOptions(instanceID string, id string) *DeleteInstanceVolumeAttachmentOptions { - return &DeleteInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetID(id string) *DeleteInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} - -// DeleteIpsecPolicyOptions : The DeleteIpsecPolicy options. -type DeleteIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteIpsecPolicyOptions : Instantiate DeleteIpsecPolicyOptions -func (*VpcV1) NewDeleteIpsecPolicyOptions(id string) *DeleteIpsecPolicyOptions { - return &DeleteIpsecPolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteIpsecPolicyOptions) SetID(id string) *DeleteIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteIpsecPolicyOptions) SetHeaders(param map[string]string) *DeleteIpsecPolicyOptions { - options.Headers = param - return options -} - -// DeleteKeyOptions : The DeleteKey options. -type DeleteKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteKeyOptions : Instantiate DeleteKeyOptions -func (*VpcV1) NewDeleteKeyOptions(id string) *DeleteKeyOptions { - return &DeleteKeyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteKeyOptions) SetID(id string) *DeleteKeyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteKeyOptions) SetHeaders(param map[string]string) *DeleteKeyOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerListenerOptions : The DeleteLoadBalancerListener options. -type DeleteLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerListenerOptions : Instantiate DeleteLoadBalancerListenerOptions -func (*VpcV1) NewDeleteLoadBalancerListenerOptions(loadBalancerID string, id string) *DeleteLoadBalancerListenerOptions { - return &DeleteLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerOptions) SetID(id string) *DeleteLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerListenerPolicyOptions : The DeleteLoadBalancerListenerPolicy options. -type DeleteLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerListenerPolicyOptions : Instantiate DeleteLoadBalancerListenerPolicyOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *DeleteLoadBalancerListenerPolicyOptions { - return &DeleteLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerListenerPolicyRuleOptions : The DeleteLoadBalancerListenerPolicyRule options. -type DeleteLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerListenerPolicyRuleOptions : Instantiate DeleteLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - return &DeleteLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerOptions : The DeleteLoadBalancer options. -type DeleteLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerOptions : Instantiate DeleteLoadBalancerOptions -func (*VpcV1) NewDeleteLoadBalancerOptions(id string) *DeleteLoadBalancerOptions { - return &DeleteLoadBalancerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerOptions) SetID(id string) *DeleteLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteLoadBalancerOptions) SetIfMatch(ifMatch string) *DeleteLoadBalancerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerPoolMemberOptions : The DeleteLoadBalancerPoolMember options. -type DeleteLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The member identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerPoolMemberOptions : Instantiate DeleteLoadBalancerPoolMemberOptions -func (*VpcV1) NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *DeleteLoadBalancerPoolMemberOptions { - return &DeleteLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *DeleteLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetID(id string) *DeleteLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} - -// DeleteLoadBalancerPoolOptions : The DeleteLoadBalancerPool options. -type DeleteLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteLoadBalancerPoolOptions : Instantiate DeleteLoadBalancerPoolOptions -func (*VpcV1) NewDeleteLoadBalancerPoolOptions(loadBalancerID string, id string) *DeleteLoadBalancerPoolOptions { - return &DeleteLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolOptions) SetID(id string) *DeleteLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolOptions { - options.Headers = param - return options -} - -// DeleteNetworkACLOptions : The DeleteNetworkACL options. -type DeleteNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteNetworkACLOptions : Instantiate DeleteNetworkACLOptions -func (*VpcV1) NewDeleteNetworkACLOptions(id string) *DeleteNetworkACLOptions { - return &DeleteNetworkACLOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLOptions) SetID(id string) *DeleteNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLOptions) SetHeaders(param map[string]string) *DeleteNetworkACLOptions { - options.Headers = param - return options -} - -// DeleteNetworkACLRuleOptions : The DeleteNetworkACLRule options. -type DeleteNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteNetworkACLRuleOptions : Instantiate DeleteNetworkACLRuleOptions -func (*VpcV1) NewDeleteNetworkACLRuleOptions(networkACLID string, id string) *DeleteNetworkACLRuleOptions { - return &DeleteNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - } -} - -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *DeleteNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *DeleteNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLRuleOptions) SetID(id string) *DeleteNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLRuleOptions) SetHeaders(param map[string]string) *DeleteNetworkACLRuleOptions { - options.Headers = param - return options -} - -// DeletePlacementGroupOptions : The DeletePlacementGroup options. -type DeletePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeletePlacementGroupOptions : Instantiate DeletePlacementGroupOptions -func (*VpcV1) NewDeletePlacementGroupOptions(id string) *DeletePlacementGroupOptions { - return &DeletePlacementGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeletePlacementGroupOptions) SetID(id string) *DeletePlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeletePlacementGroupOptions) SetHeaders(param map[string]string) *DeletePlacementGroupOptions { - options.Headers = param - return options -} - -// DeletePublicGatewayOptions : The DeletePublicGateway options. -type DeletePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeletePublicGatewayOptions : Instantiate DeletePublicGatewayOptions -func (*VpcV1) NewDeletePublicGatewayOptions(id string) *DeletePublicGatewayOptions { - return &DeletePublicGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeletePublicGatewayOptions) SetID(id string) *DeletePublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) *DeletePublicGatewayOptions { - options.Headers = param - return options -} - -// DeleteReservationOptions : The DeleteReservation options. -type DeleteReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteReservationOptions : Instantiate DeleteReservationOptions -func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { - return &DeleteReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { - options.Headers = param - return options -} - -// DeleteSecurityGroupOptions : The DeleteSecurityGroup options. -type DeleteSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSecurityGroupOptions : Instantiate DeleteSecurityGroupOptions -func (*VpcV1) NewDeleteSecurityGroupOptions(id string) *DeleteSecurityGroupOptions { - return &DeleteSecurityGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupOptions) SetID(id string) *DeleteSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupOptions { - options.Headers = param - return options -} - -// DeleteSecurityGroupRuleOptions : The DeleteSecurityGroupRule options. -type DeleteSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSecurityGroupRuleOptions : Instantiate DeleteSecurityGroupRuleOptions -func (*VpcV1) NewDeleteSecurityGroupRuleOptions(securityGroupID string, id string) *DeleteSecurityGroupRuleOptions { - return &DeleteSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupRuleOptions) SetID(id string) *DeleteSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupRuleOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupRuleOptions { - options.Headers = param - return options -} - -// DeleteSecurityGroupTargetBindingOptions : The DeleteSecurityGroupTargetBinding options. -type DeleteSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSecurityGroupTargetBindingOptions : Instantiate DeleteSecurityGroupTargetBindingOptions -func (*VpcV1) NewDeleteSecurityGroupTargetBindingOptions(securityGroupID string, id string) *DeleteSecurityGroupTargetBindingOptions { - return &DeleteSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetID(id string) *DeleteSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupTargetBindingOptions { - options.Headers = param - return options -} - -// DeleteShareMountTargetOptions : The DeleteShareMountTarget options. -type DeleteShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteShareMountTargetOptions : Instantiate DeleteShareMountTargetOptions -func (*VpcV1) NewDeleteShareMountTargetOptions(shareID string, id string) *DeleteShareMountTargetOptions { - return &DeleteShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *DeleteShareMountTargetOptions) SetShareID(shareID string) *DeleteShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteShareMountTargetOptions) SetID(id string) *DeleteShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteShareMountTargetOptions) SetHeaders(param map[string]string) *DeleteShareMountTargetOptions { - options.Headers = param - return options -} - -// DeleteShareOptions : The DeleteShare options. -type DeleteShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteShareOptions : Instantiate DeleteShareOptions -func (*VpcV1) NewDeleteShareOptions(id string) *DeleteShareOptions { - return &DeleteShareOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteShareOptions) SetID(id string) *DeleteShareOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteShareOptions) SetIfMatch(ifMatch string) *DeleteShareOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteShareOptions) SetHeaders(param map[string]string) *DeleteShareOptions { - options.Headers = param - return options -} - -// DeleteShareSourceOptions : The DeleteShareSource options. -type DeleteShareSourceOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteShareSourceOptions : Instantiate DeleteShareSourceOptions -func (*VpcV1) NewDeleteShareSourceOptions(shareID string) *DeleteShareSourceOptions { - return &DeleteShareSourceOptions{ - ShareID: core.StringPtr(shareID), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *DeleteShareSourceOptions) SetShareID(shareID string) *DeleteShareSourceOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteShareSourceOptions) SetHeaders(param map[string]string) *DeleteShareSourceOptions { - options.Headers = param - return options -} - -// DeleteSnapshotCloneOptions : The DeleteSnapshotClone options. -type DeleteSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSnapshotCloneOptions : Instantiate DeleteSnapshotCloneOptions -func (*VpcV1) NewDeleteSnapshotCloneOptions(id string, zoneName string) *DeleteSnapshotCloneOptions { - return &DeleteSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteSnapshotCloneOptions) SetID(id string) *DeleteSnapshotCloneOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *DeleteSnapshotCloneOptions) SetZoneName(zoneName string) *DeleteSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotCloneOptions) SetHeaders(param map[string]string) *DeleteSnapshotCloneOptions { - options.Headers = param - return options -} - -// DeleteSnapshotConsistencyGroupOptions : The DeleteSnapshotConsistencyGroup options. -type DeleteSnapshotConsistencyGroupOptions struct { - // The snapshot consistency group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSnapshotConsistencyGroupOptions : Instantiate DeleteSnapshotConsistencyGroupOptions -func (*VpcV1) NewDeleteSnapshotConsistencyGroupOptions(id string) *DeleteSnapshotConsistencyGroupOptions { - return &DeleteSnapshotConsistencyGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteSnapshotConsistencyGroupOptions) SetID(id string) *DeleteSnapshotConsistencyGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *DeleteSnapshotConsistencyGroupOptions { - options.Headers = param - return options -} - -// DeleteSnapshotOptions : The DeleteSnapshot options. -type DeleteSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSnapshotOptions : Instantiate DeleteSnapshotOptions -func (*VpcV1) NewDeleteSnapshotOptions(id string) *DeleteSnapshotOptions { - return &DeleteSnapshotOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteSnapshotOptions) SetID(id string) *DeleteSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteSnapshotOptions) SetIfMatch(ifMatch string) *DeleteSnapshotOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotOptions) SetHeaders(param map[string]string) *DeleteSnapshotOptions { - options.Headers = param - return options -} - -// DeleteSnapshotsOptions : The DeleteSnapshots options. -type DeleteSnapshotsOptions struct { - // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. - SourceVolumeID *string `json:"source_volume.id" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSnapshotsOptions : Instantiate DeleteSnapshotsOptions -func (*VpcV1) NewDeleteSnapshotsOptions(sourceVolumeID string) *DeleteSnapshotsOptions { - return &DeleteSnapshotsOptions{ - SourceVolumeID: core.StringPtr(sourceVolumeID), - } -} - -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *DeleteSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *DeleteSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotsOptions) SetHeaders(param map[string]string) *DeleteSnapshotsOptions { - options.Headers = param - return options -} - -// DeleteSubnetOptions : The DeleteSubnet options. -type DeleteSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSubnetOptions : Instantiate DeleteSubnetOptions -func (*VpcV1) NewDeleteSubnetOptions(id string) *DeleteSubnetOptions { - return &DeleteSubnetOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteSubnetOptions) SetID(id string) *DeleteSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSubnetOptions) SetHeaders(param map[string]string) *DeleteSubnetOptions { - options.Headers = param - return options -} - -// DeleteSubnetReservedIPOptions : The DeleteSubnetReservedIP options. -type DeleteSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSubnetReservedIPOptions : Instantiate DeleteSubnetReservedIPOptions -func (*VpcV1) NewDeleteSubnetReservedIPOptions(subnetID string, id string) *DeleteSubnetReservedIPOptions { - return &DeleteSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - } -} - -// SetSubnetID : Allow user to set SubnetID -func (_options *DeleteSubnetReservedIPOptions) SetSubnetID(subnetID string) *DeleteSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteSubnetReservedIPOptions) SetID(id string) *DeleteSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteSubnetReservedIPOptions) SetHeaders(param map[string]string) *DeleteSubnetReservedIPOptions { - options.Headers = param - return options -} - -// DeleteVirtualNetworkInterfacesOptions : The DeleteVirtualNetworkInterfaces options. -type DeleteVirtualNetworkInterfacesOptions struct { - // The virtual network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVirtualNetworkInterfacesOptions : Instantiate DeleteVirtualNetworkInterfacesOptions -func (*VpcV1) NewDeleteVirtualNetworkInterfacesOptions(id string) *DeleteVirtualNetworkInterfacesOptions { - return &DeleteVirtualNetworkInterfacesOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteVirtualNetworkInterfacesOptions) SetID(id string) *DeleteVirtualNetworkInterfacesOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *DeleteVirtualNetworkInterfacesOptions { - options.Headers = param - return options -} - -// DeleteVolumeOptions : The DeleteVolume options. -type DeleteVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVolumeOptions : Instantiate DeleteVolumeOptions -func (*VpcV1) NewDeleteVolumeOptions(id string) *DeleteVolumeOptions { - return &DeleteVolumeOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteVolumeOptions) SetID(id string) *DeleteVolumeOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVolumeOptions) SetIfMatch(ifMatch string) *DeleteVolumeOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVolumeOptions) SetHeaders(param map[string]string) *DeleteVolumeOptions { - options.Headers = param - return options -} - -// DeleteVPCAddressPrefixOptions : The DeleteVPCAddressPrefix options. -type DeleteVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCAddressPrefixOptions : Instantiate DeleteVPCAddressPrefixOptions -func (*VpcV1) NewDeleteVPCAddressPrefixOptions(vpcID string, id string) *DeleteVPCAddressPrefixOptions { - return &DeleteVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCAddressPrefixOptions) SetVPCID(vpcID string) *DeleteVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCAddressPrefixOptions) SetID(id string) *DeleteVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCAddressPrefixOptions) SetHeaders(param map[string]string) *DeleteVPCAddressPrefixOptions { - options.Headers = param - return options -} - -// DeleteVPCDnsResolutionBindingOptions : The DeleteVPCDnsResolutionBinding options. -type DeleteVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The DNS resolution binding identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCDnsResolutionBindingOptions : Instantiate DeleteVPCDnsResolutionBindingOptions -func (*VpcV1) NewDeleteVPCDnsResolutionBindingOptions(vpcID string, id string) *DeleteVPCDnsResolutionBindingOptions { - return &DeleteVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *DeleteVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCDnsResolutionBindingOptions) SetID(id string) *DeleteVPCDnsResolutionBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *DeleteVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} - -// DeleteVPCOptions : The DeleteVPC options. -type DeleteVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCOptions : Instantiate DeleteVPCOptions -func (*VpcV1) NewDeleteVPCOptions(id string) *DeleteVPCOptions { - return &DeleteVPCOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCOptions) SetID(id string) *DeleteVPCOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPCOptions) SetIfMatch(ifMatch string) *DeleteVPCOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCOptions) SetHeaders(param map[string]string) *DeleteVPCOptions { - options.Headers = param - return options -} - -// DeleteVPCRouteOptions : The DeleteVPCRoute options. -type DeleteVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCRouteOptions : Instantiate DeleteVPCRouteOptions -func (*VpcV1) NewDeleteVPCRouteOptions(vpcID string, id string) *DeleteVPCRouteOptions { - return &DeleteVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRouteOptions) SetVPCID(vpcID string) *DeleteVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCRouteOptions) SetID(id string) *DeleteVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRouteOptions { - options.Headers = param - return options -} - -// DeleteVPCRoutingTableOptions : The DeleteVPCRoutingTable options. -type DeleteVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCRoutingTableOptions : Instantiate DeleteVPCRoutingTableOptions -func (*VpcV1) NewDeleteVPCRoutingTableOptions(vpcID string, id string) *DeleteVPCRoutingTableOptions { - return &DeleteVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableOptions) SetID(id string) *DeleteVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPCRoutingTableOptions) SetIfMatch(ifMatch string) *DeleteVPCRoutingTableOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableOptions { - options.Headers = param - return options -} - -// DeleteVPCRoutingTableRouteOptions : The DeleteVPCRoutingTableRoute options. -type DeleteVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // The VPC routing table route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPCRoutingTableRouteOptions : Instantiate DeleteVPCRoutingTableRouteOptions -func (*VpcV1) NewDeleteVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *DeleteVPCRoutingTableRouteOptions { - return &DeleteVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *DeleteVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *DeleteVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableRouteOptions) SetID(id string) *DeleteVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableRouteOptions { - options.Headers = param - return options -} - -// DeleteVPNGatewayConnectionOptions : The DeleteVPNGatewayConnection options. -type DeleteVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPNGatewayConnectionOptions : Instantiate DeleteVPNGatewayConnectionOptions -func (*VpcV1) NewDeleteVPNGatewayConnectionOptions(vpnGatewayID string, id string) *DeleteVPNGatewayConnectionOptions { - return &DeleteVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *DeleteVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *DeleteVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { - options.Headers = param - return options -} - -// DeleteVPNGatewayOptions : The DeleteVPNGateway options. -type DeleteVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPNGatewayOptions : Instantiate DeleteVPNGatewayOptions -func (*VpcV1) NewDeleteVPNGatewayOptions(id string) *DeleteVPNGatewayOptions { - return &DeleteVPNGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteVPNGatewayOptions) SetID(id string) *DeleteVPNGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayOptions { - options.Headers = param - return options -} - -// DeleteVPNServerClientOptions : The DeleteVPNServerClient options. -type DeleteVPNServerClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN client identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPNServerClientOptions : Instantiate DeleteVPNServerClientOptions -func (*VpcV1) NewDeleteVPNServerClientOptions(vpnServerID string, id string) *DeleteVPNServerClientOptions { - return &DeleteVPNServerClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DeleteVPNServerClientOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPNServerClientOptions) SetID(id string) *DeleteVPNServerClientOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerClientOptions) SetHeaders(param map[string]string) *DeleteVPNServerClientOptions { - options.Headers = param - return options -} - -// DeleteVPNServerOptions : The DeleteVPNServer options. -type DeleteVPNServerOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPNServerOptions : Instantiate DeleteVPNServerOptions -func (*VpcV1) NewDeleteVPNServerOptions(id string) *DeleteVPNServerOptions { - return &DeleteVPNServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteVPNServerOptions) SetID(id string) *DeleteVPNServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *DeleteVPNServerOptions) SetIfMatch(ifMatch string) *DeleteVPNServerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerOptions) SetHeaders(param map[string]string) *DeleteVPNServerOptions { - options.Headers = param - return options -} - -// DeleteVPNServerRouteOptions : The DeleteVPNServerRoute options. -type DeleteVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteVPNServerRouteOptions : Instantiate DeleteVPNServerRouteOptions -func (*VpcV1) NewDeleteVPNServerRouteOptions(vpnServerID string, id string) *DeleteVPNServerRouteOptions { - return &DeleteVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DeleteVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *DeleteVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DeleteVPNServerRouteOptions) SetID(id string) *DeleteVPNServerRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteVPNServerRouteOptions) SetHeaders(param map[string]string) *DeleteVPNServerRouteOptions { - options.Headers = param - return options -} - -// DeprecateImageOptions : The DeprecateImage options. -type DeprecateImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeprecateImageOptions : Instantiate DeprecateImageOptions -func (*VpcV1) NewDeprecateImageOptions(id string) *DeprecateImageOptions { - return &DeprecateImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeprecateImageOptions) SetID(id string) *DeprecateImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeprecateImageOptions) SetHeaders(param map[string]string) *DeprecateImageOptions { - options.Headers = param - return options -} - -// DisconnectVPNClientOptions : The DisconnectVPNClient options. -type DisconnectVPNClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN client identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDisconnectVPNClientOptions : Instantiate DisconnectVPNClientOptions -func (*VpcV1) NewDisconnectVPNClientOptions(vpnServerID string, id string) *DisconnectVPNClientOptions { - return &DisconnectVPNClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *DisconnectVPNClientOptions) SetVPNServerID(vpnServerID string) *DisconnectVPNClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *DisconnectVPNClientOptions) SetID(id string) *DisconnectVPNClientOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DisconnectVPNClientOptions) SetHeaders(param map[string]string) *DisconnectVPNClientOptions { - options.Headers = param - return options -} - -// EncryptionKeyIdentity : Identifies an encryption key by a unique property. -// Models which "extend" this model: -// - EncryptionKeyIdentityByCRN -type EncryptionKeyIdentity struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn,omitempty"` -} - -func (*EncryptionKeyIdentity) isaEncryptionKeyIdentity() bool { - return true -} - -type EncryptionKeyIdentityIntf interface { - isaEncryptionKeyIdentity() bool -} - -// UnmarshalEncryptionKeyIdentity unmarshals an instance of EncryptionKeyIdentity from the specified map of raw messages. -func UnmarshalEncryptionKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EncryptionKeyReference : EncryptionKeyReference struct -type EncryptionKeyReference struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn" validate:"required"` -} - -// UnmarshalEncryptionKeyReference unmarshals an instance of EncryptionKeyReference from the specified map of raw messages. -func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGateway : EndpointGateway struct -type EndpointGateway struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding" validate:"required"` - - // The date and time that the endpoint gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` - - // The reserved IPs bound to this endpoint gateway. - Ips []ReservedIPReference `json:"ips" validate:"required"` - - // The reasons for the current `lifecycle_state` (if any): - // - `dns_resolution_binding_pending`: the DNS resolution binding is being set up. - LifecycleReasons []EndpointGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the endpoint gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this endpoint gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this endpoint gateway. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The fully qualified domain name for the target service. - // Deprecated: this field is deprecated and may be removed in a future release. - ServiceEndpoint *string `json:"service_endpoint,omitempty"` - - // The fully qualified domain names for the target service. - ServiceEndpoints []string `json:"service_endpoints" validate:"required"` - - // The target for this endpoint gateway. - Target EndpointGatewayTargetIntf `json:"target" validate:"required"` - - // The VPC this endpoint gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the EndpointGateway.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - EndpointGatewayHealthStateDegradedConst = "degraded" - EndpointGatewayHealthStateFaultedConst = "faulted" - EndpointGatewayHealthStateInapplicableConst = "inapplicable" - EndpointGatewayHealthStateOkConst = "ok" -) - -// Constants associated with the EndpointGateway.LifecycleState property. -// The lifecycle state of the endpoint gateway. -const ( - EndpointGatewayLifecycleStateDeletingConst = "deleting" - EndpointGatewayLifecycleStateFailedConst = "failed" - EndpointGatewayLifecycleStatePendingConst = "pending" - EndpointGatewayLifecycleStateStableConst = "stable" - EndpointGatewayLifecycleStateSuspendedConst = "suspended" - EndpointGatewayLifecycleStateUpdatingConst = "updating" - EndpointGatewayLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the EndpointGateway.ResourceType property. -// The resource type. -const ( - EndpointGatewayResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -// UnmarshalEndpointGateway unmarshals an instance of EndpointGateway from the specified map of raw messages. -func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGateway) - err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoints", &obj.ServiceEndpoints) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayCollection : EndpointGatewayCollection struct -type EndpointGatewayCollection struct { - // Collection of endpoint gateways. - EndpointGateways []EndpointGateway `json:"endpoint_gateways" validate:"required"` - - // A link to the first page of resources. - First *EndpointGatewayCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *EndpointGatewayCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalEndpointGatewayCollection unmarshals an instance of EndpointGatewayCollection from the specified map of raw messages. -func UnmarshalEndpointGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollection) - err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGateway) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalEndpointGatewayCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalEndpointGatewayCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *EndpointGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// EndpointGatewayCollectionFirst : A link to the first page of resources. -type EndpointGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalEndpointGatewayCollectionFirst unmarshals an instance of EndpointGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type EndpointGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalEndpointGatewayCollectionNext unmarshals an instance of EndpointGatewayCollectionNext from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayLifecycleReason : EndpointGatewayLifecycleReason struct -type EndpointGatewayLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the EndpointGatewayLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - EndpointGatewayLifecycleReasonCodeDnsResolutionBindingPendingConst = "dns_resolution_binding_pending" - EndpointGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalEndpointGatewayLifecycleReason unmarshals an instance of EndpointGatewayLifecycleReason from the specified map of raw messages. -func UnmarshalEndpointGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayPatch : EndpointGatewayPatch struct -type EndpointGatewayPatch struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` - - // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalEndpointGatewayPatch unmarshals an instance of EndpointGatewayPatch from the specified map of raw messages. -func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayPatch) - err = core.UnmarshalPrimitive(m, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the EndpointGatewayPatch -func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(endpointGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// EndpointGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type EndpointGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalEndpointGatewayReferenceDeleted unmarshals an instance of EndpointGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalEndpointGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReferenceRemote : EndpointGatewayReferenceRemote struct -type EndpointGatewayReferenceRemote struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *EndpointGatewayRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the EndpointGatewayReferenceRemote.ResourceType property. -// The resource type. -const ( - EndpointGatewayReferenceRemoteResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -// UnmarshalEndpointGatewayReferenceRemote unmarshals an instance of EndpointGatewayReferenceRemote from the specified map of raw messages. -func UnmarshalEndpointGatewayReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReferenceRemote) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalEndpointGatewayRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type EndpointGatewayRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` - - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalEndpointGatewayRemote unmarshals an instance of EndpointGatewayRemote from the specified map of raw messages. -func UnmarshalEndpointGatewayRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIP : A reserved IP to bind to the endpoint gateway. This can be specified using an existing reserved IP, or a prototype -// object for a new reserved IP. The reserved IP will be bound to the endpoint gateway to function as a virtual private -// endpoint for the service. -// Models which "extend" this model: -// - EndpointGatewayReservedIPReservedIPIdentity -// - EndpointGatewayReservedIPReservedIPPrototypeTargetContext -type EndpointGatewayReservedIP struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The subnet in which to create this reserved IP. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} - -func (*EndpointGatewayReservedIP) isaEndpointGatewayReservedIP() bool { - return true -} - -type EndpointGatewayReservedIPIntf interface { - isaEndpointGatewayReservedIP() bool -} - -// UnmarshalEndpointGatewayReservedIP unmarshals an instance of EndpointGatewayReservedIP from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIP) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTarget : The target for this endpoint gateway. -// Models which "extend" this model: -// - EndpointGatewayTargetProviderCloudServiceReference -// - EndpointGatewayTargetProviderInfrastructureServiceReference -type EndpointGatewayTarget struct { - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` - - // The type of target. - ResourceType *string `json:"resource_type,omitempty"` - - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the EndpointGatewayTarget.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetResourceTypeProviderCloudServiceConst = "provider_cloud_service" -) - -func (*EndpointGatewayTarget) isaEndpointGatewayTarget() bool { - return true -} - -type EndpointGatewayTargetIntf interface { - isaEndpointGatewayTarget() bool -} - -// UnmarshalEndpointGatewayTarget unmarshals an instance of EndpointGatewayTarget from the specified map of raw messages. -func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototype : The target to use for this endpoint gateway. Must not already be the target of another endpoint gateway in the VPC. -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity -// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity -type EndpointGatewayTargetPrototype struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` - - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the EndpointGatewayTargetPrototype.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -func (*EndpointGatewayTargetPrototype) isaEndpointGatewayTargetPrototype() bool { - return true -} - -type EndpointGatewayTargetPrototypeIntf interface { - isaEndpointGatewayTargetPrototype() bool -} - -// UnmarshalEndpointGatewayTargetPrototype unmarshals an instance of EndpointGatewayTargetPrototype from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "resource_type", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'resource_type': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'resource_type' not found in JSON object") - return - } - if discValue == "provider_cloud_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity) - } else if discValue == "provider_infrastructure_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'resource_type': %s", discValue) - } - return -} - -// FailoverShareOptions : The FailoverShare options. -type FailoverShareOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // The action to take if the failover request is accepted but cannot be performed or times out: - // - `fail`: Fail the operation, resulting in the replication relationship being unchanged. - // - `split`: Split the replica from its source, resulting in two individual read-write - // file shares. Because the final sync was not completed, the replica may be - // out-of-date. This occurs in disaster recovery scenarios where the source is known to - // be unreachable. - FallbackPolicy *string `json:"fallback_policy,omitempty"` - - // The failover timeout in seconds. - // - // If the timeout is reached, the `fallback_policy` will be triggered. - Timeout *int64 `json:"timeout,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the FailoverShareOptions.FallbackPolicy property. -// The action to take if the failover request is accepted but cannot be performed or times out: -// - `fail`: Fail the operation, resulting in the replication relationship being unchanged. -// - `split`: Split the replica from its source, resulting in two individual read-write -// file shares. Because the final sync was not completed, the replica may be -// out-of-date. This occurs in disaster recovery scenarios where the source is known to -// be unreachable. -const ( - FailoverShareOptionsFallbackPolicyFailConst = "fail" - FailoverShareOptionsFallbackPolicySplitConst = "split" -) - -// NewFailoverShareOptions : Instantiate FailoverShareOptions -func (*VpcV1) NewFailoverShareOptions(shareID string) *FailoverShareOptions { - return &FailoverShareOptions{ - ShareID: core.StringPtr(shareID), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *FailoverShareOptions) SetShareID(shareID string) *FailoverShareOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetFallbackPolicy : Allow user to set FallbackPolicy -func (_options *FailoverShareOptions) SetFallbackPolicy(fallbackPolicy string) *FailoverShareOptions { - _options.FallbackPolicy = core.StringPtr(fallbackPolicy) - return _options -} - -// SetTimeout : Allow user to set Timeout -func (_options *FailoverShareOptions) SetTimeout(timeout int64) *FailoverShareOptions { - _options.Timeout = core.Int64Ptr(timeout) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *FailoverShareOptions) SetHeaders(param map[string]string) *FailoverShareOptions { - options.Headers = param - return options -} - -// FloatingIP : FloatingIP struct -type FloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The date and time that the floating IP was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` - - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` - - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` - - // The resource group for this floating IP. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The status of the floating IP. - Status *string `json:"status" validate:"required"` - - // The target of this floating IP. - Target FloatingIPTargetIntf `json:"target,omitempty"` - - // The zone this floating IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the FloatingIP.Status property. -// The status of the floating IP. -const ( - FloatingIPStatusAvailableConst = "available" - FloatingIPStatusDeletingConst = "deleting" - FloatingIPStatusFailedConst = "failed" - FloatingIPStatusPendingConst = "pending" -) - -// UnmarshalFloatingIP unmarshals an instance of FloatingIP from the specified map of raw messages. -func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPCollection : FloatingIPCollection struct -type FloatingIPCollection struct { - // A link to the first page of resources. - First *FloatingIPCollectionFirst `json:"first" validate:"required"` - - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *FloatingIPCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalFloatingIPCollection unmarshals an instance of FloatingIPCollection from the specified map of raw messages. -func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *FloatingIPCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// FloatingIPCollectionFirst : A link to the first page of resources. -type FloatingIPCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFloatingIPCollectionFirst unmarshals an instance of FloatingIPCollectionFirst from the specified map of raw messages. -func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FloatingIPCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFloatingIPCollectionNext unmarshals an instance of FloatingIPCollectionNext from the specified map of raw messages. -func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPCollectionVirtualNetworkInterfaceContext : FloatingIPCollectionVirtualNetworkInterfaceContext struct -type FloatingIPCollectionVirtualNetworkInterfaceContext struct { - // A link to the first page of resources. - First *FloatingIPCollectionVirtualNetworkInterfaceContextFirst `json:"first" validate:"required"` - - // Collection of floating IPs bound to the virtual network interface specified by the identifier in the URL. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *FloatingIPCollectionVirtualNetworkInterfaceContextNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionVirtualNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *FloatingIPCollectionVirtualNetworkInterfaceContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// FloatingIPCollectionVirtualNetworkInterfaceContextFirst : A link to the first page of resources. -type FloatingIPCollectionVirtualNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionVirtualNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPCollectionVirtualNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type FloatingIPCollectionVirtualNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext unmarshals an instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalFloatingIPCollectionVirtualNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionVirtualNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPPatch : FloatingIPPatch struct -type FloatingIPPatch struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. - Name *string `json:"name,omitempty"` - - // The target resource to bind this floating IP to, replacing any existing binding. - // The floating IP must not be required by another resource, such as a public gateway. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` - // - a virtual network interface with `enable_infrastructure_nat` set to `true` - // - // Specify `null` to remove an existing binding. - Target FloatingIPTargetPatchIntf `json:"target,omitempty"` -} - -// UnmarshalFloatingIPPatch unmarshals an instance of FloatingIPPatch from the specified map of raw messages. -func UnmarshalFloatingIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the FloatingIPPatch -func (floatingIPPatch *FloatingIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(floatingIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// FloatingIPPrototype : FloatingIPPrototype struct -// Models which "extend" this model: -// - FloatingIPPrototypeFloatingIPByZone -// - FloatingIPPrototypeFloatingIPByTarget -type FloatingIPPrototype struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The zone this floating IP will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The target resource to bind this floating IP to. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` - // - a virtual network interface with `enable_infrastructure_nat` set to `true`. - Target FloatingIPTargetPrototypeIntf `json:"target,omitempty"` -} - -func (*FloatingIPPrototype) isaFloatingIPPrototype() bool { - return true -} - -type FloatingIPPrototypeIntf interface { - isaFloatingIPPrototype() bool -} - -// UnmarshalFloatingIPPrototype unmarshals an instance of FloatingIPPrototype from the specified map of raw messages. -func UnmarshalFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPReference : FloatingIPReference struct -type FloatingIPReference struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` - - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalFloatingIPReference unmarshals an instance of FloatingIPReference from the specified map of raw messages. -func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type FloatingIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalFloatingIPReferenceDeleted unmarshals an instance of FloatingIPReferenceDeleted from the specified map of raw messages. -func UnmarshalFloatingIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTarget : The target of this floating IP. -// Models which "extend" this model: -// - FloatingIPTargetNetworkInterfaceReference -// - FloatingIPTargetBareMetalServerNetworkInterfaceReference -// - FloatingIPTargetPublicGatewayReference -// - FloatingIPTargetVirtualNetworkInterfaceReference -type FloatingIPTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The name for this instance network interface. - Name *string `json:"name,omitempty"` - - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet,omitempty"` -} - -// Constants associated with the FloatingIPTarget.ResourceType property. -// The resource type. -const ( - FloatingIPTargetResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FloatingIPTarget) isaFloatingIPTarget() bool { - return true -} - -type FloatingIPTargetIntf interface { - isaFloatingIPTarget() bool -} - -// UnmarshalFloatingIPTarget unmarshals an instance of FloatingIPTarget from the specified map of raw messages. -func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatch : The target resource to bind this floating IP to, replacing any existing binding. The floating IP must not be required -// by another resource, such as a public gateway. -// -// The target resource must not already have a floating IP bound to it if the target resource is: -// -// - an instance network interface -// - a bare metal server network interface with `enable_infrastructure_nat` set to `true` -// - a virtual network interface with `enable_infrastructure_nat` set to `true` -// -// Specify `null` to remove an existing binding. -// Models which "extend" this model: -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -// - FloatingIPTargetPatchNetworkInterfaceIdentity -// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentity -type FloatingIPTargetPatch struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*FloatingIPTargetPatch) isaFloatingIPTargetPatch() bool { - return true -} - -type FloatingIPTargetPatchIntf interface { - isaFloatingIPTargetPatch() bool -} - -// UnmarshalFloatingIPTargetPatch unmarshals an instance of FloatingIPTargetPatch from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototype : The target resource to bind this floating IP to. -// -// The target resource must not already have a floating IP bound to it if the target resource is: -// -// - an instance network interface -// - a bare metal server network interface with `enable_infrastructure_nat` set to `true` -// - a virtual network interface with `enable_infrastructure_nat` set to `true`. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -// - FloatingIPTargetPrototypeNetworkInterfaceIdentity -// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity -type FloatingIPTargetPrototype struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*FloatingIPTargetPrototype) isaFloatingIPTargetPrototype() bool { - return true -} - -type FloatingIPTargetPrototypeIntf interface { - isaFloatingIPTargetPrototype() bool -} - -// UnmarshalFloatingIPTargetPrototype unmarshals an instance of FloatingIPTargetPrototype from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPUnpaginatedCollection : FloatingIPUnpaginatedCollection struct -type FloatingIPUnpaginatedCollection struct { - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` -} - -// UnmarshalFloatingIPUnpaginatedCollection unmarshals an instance of FloatingIPUnpaginatedCollection from the specified map of raw messages. -func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPUnpaginatedCollection) - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollector : FlowLogCollector struct -type FlowLogCollector struct { - // Indicates whether this collector is active. - Active *bool `json:"active" validate:"required"` - - // Indicates whether this flow log collector will be automatically deleted when `target` is deleted. At present, this - // is always `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the flow log collector was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this flow log collector. - CRN *string `json:"crn" validate:"required"` - - // The URL for this flow log collector. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this flow log collector. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the flow log collector. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this flow log collector. The name is unique across all flow log collectors in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this flow log collector. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The Cloud Object Storage bucket where the collected flows are logged. For more - // information, see [Viewing flow log - // objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). - StorageBucket *LegacyCloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` - - // The target this collector is collecting flow logs for. - // - If the target is an instance network attachment, flow logs will be collected - // for that instance network attachment. - // - If the target is an instance network interface, flow logs will be collected - // for that instance network interface. - // - If the target is a virtual network interface, flow logs will be collected for the - // the virtual network interface's `target` resource if the resource is: - // - an instance network attachment - // - If the target is a virtual server instance, flow logs will be collected - // for all network attachments or network interfaces on that instance. - // - If the target is a subnet, flow logs will be collected - // for all instance network interfaces and virtual network interfaces - // attached to that subnet. - // - If the target is a VPC, flow logs will be collected for all instance network - // interfaces and virtual network interfaces attached to all subnets within that VPC. - // If the target is an instance, subnet, or VPC, flow logs will not be collected - // for any instance network attachments or instance network interfaces within the target - // that are themselves the target of a more specific flow log collector. - Target FlowLogCollectorTargetIntf `json:"target" validate:"required"` - - // The VPC this flow log collector resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the FlowLogCollector.LifecycleState property. -// The lifecycle state of the flow log collector. -const ( - FlowLogCollectorLifecycleStateDeletingConst = "deleting" - FlowLogCollectorLifecycleStateFailedConst = "failed" - FlowLogCollectorLifecycleStatePendingConst = "pending" - FlowLogCollectorLifecycleStateStableConst = "stable" - FlowLogCollectorLifecycleStateSuspendedConst = "suspended" - FlowLogCollectorLifecycleStateUpdatingConst = "updating" - FlowLogCollectorLifecycleStateWaitingConst = "waiting" -) - -// UnmarshalFlowLogCollector unmarshals an instance of FlowLogCollector from the specified map of raw messages. -func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollector) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalLegacyCloudObjectStorageBucketReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFlowLogCollectorTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorCollection : FlowLogCollectorCollection struct -type FlowLogCollectorCollection struct { - // A link to the first page of resources. - First *FlowLogCollectorCollectionFirst `json:"first" validate:"required"` - - // Collection of flow log collectors. - FlowLogCollectors []FlowLogCollector `json:"flow_log_collectors" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *FlowLogCollectorCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalFlowLogCollectorCollection unmarshals an instance of FlowLogCollectorCollection from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFlowLogCollectorCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "flow_log_collectors", &obj.FlowLogCollectors, UnmarshalFlowLogCollector) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFlowLogCollectorCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// FlowLogCollectorCollectionFirst : A link to the first page of resources. -type FlowLogCollectorCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFlowLogCollectorCollectionFirst unmarshals an instance of FlowLogCollectorCollectionFirst from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FlowLogCollectorCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalFlowLogCollectorCollectionNext unmarshals an instance of FlowLogCollectorCollectionNext from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorPatch : FlowLogCollectorPatch struct -type FlowLogCollectorPatch struct { - // Indicates whether this collector is active. Updating to false deactivates the collector and updating to true - // activates the collector. - Active *bool `json:"active,omitempty"` - - // The name for this flow log collector. The name must not be used by another flow log collector in the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalFlowLogCollectorPatch unmarshals an instance of FlowLogCollectorPatch from the specified map of raw messages. -func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the FlowLogCollectorPatch -func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(flowLogCollectorPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// FlowLogCollectorTarget : The target this collector is collecting flow logs for. -// - If the target is an instance network attachment, flow logs will be collected -// for that instance network attachment. -// - If the target is an instance network interface, flow logs will be collected -// for that instance network interface. -// - If the target is a virtual network interface, flow logs will be collected for the -// the virtual network interface's `target` resource if the resource is: -// - an instance network attachment -// - If the target is a virtual server instance, flow logs will be collected -// for all network attachments or network interfaces on that instance. -// - If the target is a subnet, flow logs will be collected -// for all instance network interfaces and virtual network interfaces -// attached to that subnet. -// - If the target is a VPC, flow logs will be collected for all instance network -// interfaces and virtual network interfaces attached to all subnets within that VPC. If the target is an instance, -// -// subnet, or VPC, flow logs will not be collected for any instance network attachments or instance network interfaces -// within the target that are themselves the target of a more specific flow log collector. -// Models which "extend" this model: -// - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext -// - FlowLogCollectorTargetInstanceReference -// - FlowLogCollectorTargetSubnetReference -// - FlowLogCollectorTargetVPCReference -// - FlowLogCollectorTargetInstanceNetworkAttachmentReference -// - FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext -type FlowLogCollectorTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The name for this instance network interface. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet,omitempty"` -} - -// Constants associated with the FlowLogCollectorTarget.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FlowLogCollectorTarget) isaFlowLogCollectorTarget() bool { - return true -} - -type FlowLogCollectorTargetIntf interface { - isaFlowLogCollectorTarget() bool -} - -// UnmarshalFlowLogCollectorTarget unmarshals an instance of FlowLogCollectorTarget from the specified map of raw messages. -func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototype : The target this collector will collect flow logs for. -// -// If the target is an instance, subnet, or VPC, flow logs will not be collected for any instance network attachments, -// virtual network interfaces or instance network interfaces within the target that are themselves the target of a more -// specific flow log collector. -// -// The target must not be a virtual network interface that is attached to a bare metal server network attachment or to a -// file share mount target. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -// - FlowLogCollectorTargetPrototypeInstanceIdentity -// - FlowLogCollectorTargetPrototypeSubnetIdentity -// - FlowLogCollectorTargetPrototypeVPCIdentity -// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity -// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity -type FlowLogCollectorTargetPrototype struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` -} - -func (*FlowLogCollectorTargetPrototype) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -type FlowLogCollectorTargetPrototypeIntf interface { - isaFlowLogCollectorTargetPrototype() bool -} - -// UnmarshalFlowLogCollectorTargetPrototype unmarshals an instance of FlowLogCollectorTargetPrototype from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GenericResourceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type GenericResourceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalGenericResourceReferenceDeleted unmarshals an instance of GenericResourceReferenceDeleted from the specified map of raw messages. -func UnmarshalGenericResourceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GenericResourceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetBackupPolicyJobOptions : The GetBackupPolicyJob options. -type GetBackupPolicyJobOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy job identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBackupPolicyJobOptions : Instantiate GetBackupPolicyJobOptions -func (*VpcV1) NewGetBackupPolicyJobOptions(backupPolicyID string, id string) *GetBackupPolicyJobOptions { - return &GetBackupPolicyJobOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *GetBackupPolicyJobOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyJobOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBackupPolicyJobOptions) SetID(id string) *GetBackupPolicyJobOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyJobOptions) SetHeaders(param map[string]string) *GetBackupPolicyJobOptions { - options.Headers = param - return options -} - -// GetBackupPolicyOptions : The GetBackupPolicy options. -type GetBackupPolicyOptions struct { - // The backup policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBackupPolicyOptions : Instantiate GetBackupPolicyOptions -func (*VpcV1) NewGetBackupPolicyOptions(id string) *GetBackupPolicyOptions { - return &GetBackupPolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetBackupPolicyOptions) SetID(id string) *GetBackupPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyOptions) SetHeaders(param map[string]string) *GetBackupPolicyOptions { - options.Headers = param - return options -} - -// GetBackupPolicyPlanOptions : The GetBackupPolicyPlan options. -type GetBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBackupPolicyPlanOptions : Instantiate GetBackupPolicyPlanOptions -func (*VpcV1) NewGetBackupPolicyPlanOptions(backupPolicyID string, id string) *GetBackupPolicyPlanOptions { - return &GetBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *GetBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *GetBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBackupPolicyPlanOptions) SetID(id string) *GetBackupPolicyPlanOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBackupPolicyPlanOptions) SetHeaders(param map[string]string) *GetBackupPolicyPlanOptions { - options.Headers = param - return options -} - -// GetBareMetalServerDiskOptions : The GetBareMetalServerDisk options. -type GetBareMetalServerDiskOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerDiskOptions : Instantiate GetBareMetalServerDiskOptions -func (*VpcV1) NewGetBareMetalServerDiskOptions(bareMetalServerID string, id string) *GetBareMetalServerDiskOptions { - return &GetBareMetalServerDiskOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerDiskOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerDiskOptions) SetID(id string) *GetBareMetalServerDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerDiskOptions) SetHeaders(param map[string]string) *GetBareMetalServerDiskOptions { - options.Headers = param - return options -} - -// GetBareMetalServerInitializationOptions : The GetBareMetalServerInitialization options. -type GetBareMetalServerInitializationOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerInitializationOptions : Instantiate GetBareMetalServerInitializationOptions -func (*VpcV1) NewGetBareMetalServerInitializationOptions(id string) *GetBareMetalServerInitializationOptions { - return &GetBareMetalServerInitializationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerInitializationOptions) SetID(id string) *GetBareMetalServerInitializationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerInitializationOptions) SetHeaders(param map[string]string) *GetBareMetalServerInitializationOptions { - options.Headers = param - return options -} - -// GetBareMetalServerNetworkAttachmentOptions : The GetBareMetalServerNetworkAttachment options. -type GetBareMetalServerNetworkAttachmentOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerNetworkAttachmentOptions : Instantiate GetBareMetalServerNetworkAttachmentOptions -func (*VpcV1) NewGetBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkAttachmentOptions { - return &GetBareMetalServerNetworkAttachmentOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkAttachmentOptions) SetID(id string) *GetBareMetalServerNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkAttachmentOptions { - options.Headers = param - return options -} - -// GetBareMetalServerNetworkInterfaceFloatingIPOptions : The GetBareMetalServerNetworkInterfaceFloatingIP options. -type GetBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate GetBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - return &GetBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// GetBareMetalServerNetworkInterfaceIPOptions : The GetBareMetalServerNetworkInterfaceIP options. -type GetBareMetalServerNetworkInterfaceIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerNetworkInterfaceIPOptions : Instantiate GetBareMetalServerNetworkInterfaceIPOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceIPOptions { - return &GetBareMetalServerNetworkInterfaceIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceIPOptions { - options.Headers = param - return options -} - -// GetBareMetalServerNetworkInterfaceOptions : The GetBareMetalServerNetworkInterface options. -type GetBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerNetworkInterfaceOptions : Instantiate GetBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewGetBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkInterfaceOptions { - return &GetBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *GetBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerNetworkInterfaceOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} - -// GetBareMetalServerOptions : The GetBareMetalServer options. -type GetBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerOptions : Instantiate GetBareMetalServerOptions -func (*VpcV1) NewGetBareMetalServerOptions(id string) *GetBareMetalServerOptions { - return &GetBareMetalServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetBareMetalServerOptions) SetID(id string) *GetBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerOptions) SetHeaders(param map[string]string) *GetBareMetalServerOptions { - options.Headers = param - return options -} - -// GetBareMetalServerProfileOptions : The GetBareMetalServerProfile options. -type GetBareMetalServerProfileOptions struct { - // The bare metal server profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetBareMetalServerProfileOptions : Instantiate GetBareMetalServerProfileOptions -func (*VpcV1) NewGetBareMetalServerProfileOptions(name string) *GetBareMetalServerProfileOptions { - return &GetBareMetalServerProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetBareMetalServerProfileOptions) SetName(name string) *GetBareMetalServerProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetBareMetalServerProfileOptions) SetHeaders(param map[string]string) *GetBareMetalServerProfileOptions { - options.Headers = param - return options -} - -// GetDedicatedHostDiskOptions : The GetDedicatedHostDisk options. -type GetDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // The dedicated host disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetDedicatedHostDiskOptions : Instantiate GetDedicatedHostDiskOptions -func (*VpcV1) NewGetDedicatedHostDiskOptions(dedicatedHostID string, id string) *GetDedicatedHostDiskOptions { - return &GetDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), - } -} - -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *GetDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *GetDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetDedicatedHostDiskOptions) SetID(id string) *GetDedicatedHostDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostDiskOptions) SetHeaders(param map[string]string) *GetDedicatedHostDiskOptions { - options.Headers = param - return options -} - -// GetDedicatedHostGroupOptions : The GetDedicatedHostGroup options. -type GetDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetDedicatedHostGroupOptions : Instantiate GetDedicatedHostGroupOptions -func (*VpcV1) NewGetDedicatedHostGroupOptions(id string) *GetDedicatedHostGroupOptions { - return &GetDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetDedicatedHostGroupOptions) SetID(id string) *GetDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostGroupOptions) SetHeaders(param map[string]string) *GetDedicatedHostGroupOptions { - options.Headers = param - return options -} - -// GetDedicatedHostOptions : The GetDedicatedHost options. -type GetDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetDedicatedHostOptions : Instantiate GetDedicatedHostOptions -func (*VpcV1) NewGetDedicatedHostOptions(id string) *GetDedicatedHostOptions { - return &GetDedicatedHostOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetDedicatedHostOptions) SetID(id string) *GetDedicatedHostOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostOptions) SetHeaders(param map[string]string) *GetDedicatedHostOptions { - options.Headers = param - return options -} - -// GetDedicatedHostProfileOptions : The GetDedicatedHostProfile options. -type GetDedicatedHostProfileOptions struct { - // The dedicated host profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetDedicatedHostProfileOptions : Instantiate GetDedicatedHostProfileOptions -func (*VpcV1) NewGetDedicatedHostProfileOptions(name string) *GetDedicatedHostProfileOptions { - return &GetDedicatedHostProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetDedicatedHostProfileOptions) SetName(name string) *GetDedicatedHostProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostProfileOptions) SetHeaders(param map[string]string) *GetDedicatedHostProfileOptions { - options.Headers = param - return options -} - -// GetEndpointGatewayIPOptions : The GetEndpointGatewayIP options. -type GetEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetEndpointGatewayIPOptions : Instantiate GetEndpointGatewayIPOptions -func (*VpcV1) NewGetEndpointGatewayIPOptions(endpointGatewayID string, id string) *GetEndpointGatewayIPOptions { - return &GetEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), - } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *GetEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetEndpointGatewayIPOptions) SetID(id string) *GetEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayIPOptions) SetHeaders(param map[string]string) *GetEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// GetEndpointGatewayOptions : The GetEndpointGateway options. -type GetEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetEndpointGatewayOptions : Instantiate GetEndpointGatewayOptions -func (*VpcV1) NewGetEndpointGatewayOptions(id string) *GetEndpointGatewayOptions { - return &GetEndpointGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetEndpointGatewayOptions) SetID(id string) *GetEndpointGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *GetEndpointGatewayOptions { - options.Headers = param - return options -} - -// GetFloatingIPOptions : The GetFloatingIP options. -type GetFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetFloatingIPOptions : Instantiate GetFloatingIPOptions -func (*VpcV1) NewGetFloatingIPOptions(id string) *GetFloatingIPOptions { - return &GetFloatingIPOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetFloatingIPOptions) SetID(id string) *GetFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetFloatingIPOptions) SetHeaders(param map[string]string) *GetFloatingIPOptions { - options.Headers = param - return options -} - -// GetFlowLogCollectorOptions : The GetFlowLogCollector options. -type GetFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetFlowLogCollectorOptions : Instantiate GetFlowLogCollectorOptions -func (*VpcV1) NewGetFlowLogCollectorOptions(id string) *GetFlowLogCollectorOptions { - return &GetFlowLogCollectorOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetFlowLogCollectorOptions) SetID(id string) *GetFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetFlowLogCollectorOptions) SetHeaders(param map[string]string) *GetFlowLogCollectorOptions { - options.Headers = param - return options -} - -// GetIkePolicyOptions : The GetIkePolicy options. -type GetIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetIkePolicyOptions : Instantiate GetIkePolicyOptions -func (*VpcV1) NewGetIkePolicyOptions(id string) *GetIkePolicyOptions { - return &GetIkePolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetIkePolicyOptions) SetID(id string) *GetIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetIkePolicyOptions) SetHeaders(param map[string]string) *GetIkePolicyOptions { - options.Headers = param - return options -} - -// GetImageExportJobOptions : The GetImageExportJob options. -type GetImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The image export job identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetImageExportJobOptions : Instantiate GetImageExportJobOptions -func (*VpcV1) NewGetImageExportJobOptions(imageID string, id string) *GetImageExportJobOptions { - return &GetImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), - } -} - -// SetImageID : Allow user to set ImageID -func (_options *GetImageExportJobOptions) SetImageID(imageID string) *GetImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetImageExportJobOptions) SetID(id string) *GetImageExportJobOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetImageExportJobOptions) SetHeaders(param map[string]string) *GetImageExportJobOptions { - options.Headers = param - return options -} - -// GetImageOptions : The GetImage options. -type GetImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetImageOptions : Instantiate GetImageOptions -func (*VpcV1) NewGetImageOptions(id string) *GetImageOptions { - return &GetImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetImageOptions) SetID(id string) *GetImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetImageOptions) SetHeaders(param map[string]string) *GetImageOptions { - options.Headers = param - return options -} - -// GetInstanceDiskOptions : The GetInstanceDisk options. -type GetInstanceDiskOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceDiskOptions : Instantiate GetInstanceDiskOptions -func (*VpcV1) NewGetInstanceDiskOptions(instanceID string, id string) *GetInstanceDiskOptions { - return &GetInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceDiskOptions) SetInstanceID(instanceID string) *GetInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceDiskOptions) SetID(id string) *GetInstanceDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceDiskOptions) SetHeaders(param map[string]string) *GetInstanceDiskOptions { - options.Headers = param - return options -} - -// GetInstanceGroupManagerActionOptions : The GetInstanceGroupManagerAction options. -type GetInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceGroupManagerActionOptions : Instantiate GetInstanceGroupManagerActionOptions -func (*VpcV1) NewGetInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerActionOptions { - return &GetInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerActionOptions) SetID(id string) *GetInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerActionOptions { - options.Headers = param - return options -} - -// GetInstanceGroupManagerOptions : The GetInstanceGroupManager options. -type GetInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceGroupManagerOptions : Instantiate GetInstanceGroupManagerOptions -func (*VpcV1) NewGetInstanceGroupManagerOptions(instanceGroupID string, id string) *GetInstanceGroupManagerOptions { - return &GetInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerOptions) SetID(id string) *GetInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerOptions { - options.Headers = param - return options -} - -// GetInstanceGroupManagerPolicyOptions : The GetInstanceGroupManagerPolicy options. -type GetInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceGroupManagerPolicyOptions : Instantiate GetInstanceGroupManagerPolicyOptions -func (*VpcV1) NewGetInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerPolicyOptions { - return &GetInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerPolicyOptions) SetID(id string) *GetInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} - -// GetInstanceGroupMembershipOptions : The GetInstanceGroupMembership options. -type GetInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceGroupMembershipOptions : Instantiate GetInstanceGroupMembershipOptions -func (*VpcV1) NewGetInstanceGroupMembershipOptions(instanceGroupID string, id string) *GetInstanceGroupMembershipOptions { - return &GetInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceGroupMembershipOptions) SetID(id string) *GetInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *GetInstanceGroupMembershipOptions { - options.Headers = param - return options -} - -// GetInstanceGroupOptions : The GetInstanceGroup options. -type GetInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceGroupOptions : Instantiate GetInstanceGroupOptions -func (*VpcV1) NewGetInstanceGroupOptions(id string) *GetInstanceGroupOptions { - return &GetInstanceGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetInstanceGroupOptions) SetID(id string) *GetInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupOptions) SetHeaders(param map[string]string) *GetInstanceGroupOptions { - options.Headers = param - return options -} - -// GetInstanceInitializationOptions : The GetInstanceInitialization options. -type GetInstanceInitializationOptions struct { - // The instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceInitializationOptions : Instantiate GetInstanceInitializationOptions -func (*VpcV1) NewGetInstanceInitializationOptions(id string) *GetInstanceInitializationOptions { - return &GetInstanceInitializationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetInstanceInitializationOptions) SetID(id string) *GetInstanceInitializationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceInitializationOptions) SetHeaders(param map[string]string) *GetInstanceInitializationOptions { - options.Headers = param - return options -} - -// GetInstanceNetworkAttachmentOptions : The GetInstanceNetworkAttachment options. -type GetInstanceNetworkAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceNetworkAttachmentOptions : Instantiate GetInstanceNetworkAttachmentOptions -func (*VpcV1) NewGetInstanceNetworkAttachmentOptions(instanceID string, id string) *GetInstanceNetworkAttachmentOptions { - return &GetInstanceNetworkAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceNetworkAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceNetworkAttachmentOptions) SetID(id string) *GetInstanceNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceNetworkAttachmentOptions { - options.Headers = param - return options -} - -// GetInstanceNetworkInterfaceFloatingIPOptions : The GetInstanceNetworkInterfaceFloatingIP options. -type GetInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceNetworkInterfaceFloatingIPOptions : Instantiate GetInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceFloatingIPOptions { - return &GetInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// GetInstanceNetworkInterfaceIPOptions : The GetInstanceNetworkInterfaceIP options. -type GetInstanceNetworkInterfaceIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceNetworkInterfaceIPOptions : Instantiate GetInstanceNetworkInterfaceIPOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceIPOptions { - return &GetInstanceNetworkInterfaceIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceIPOptions) SetID(id string) *GetInstanceNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceIPOptions { - options.Headers = param - return options -} - -// GetInstanceNetworkInterfaceOptions : The GetInstanceNetworkInterface options. -type GetInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceNetworkInterfaceOptions : Instantiate GetInstanceNetworkInterfaceOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceOptions(instanceID string, id string) *GetInstanceNetworkInterfaceOptions { - return &GetInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceOptions) SetID(id string) *GetInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} - -// GetInstanceOptions : The GetInstance options. -type GetInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceOptions : Instantiate GetInstanceOptions -func (*VpcV1) NewGetInstanceOptions(id string) *GetInstanceOptions { - return &GetInstanceOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetInstanceOptions) SetID(id string) *GetInstanceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceOptions) SetHeaders(param map[string]string) *GetInstanceOptions { - options.Headers = param - return options -} - -// GetInstanceProfileOptions : The GetInstanceProfile options. -type GetInstanceProfileOptions struct { - // The instance profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceProfileOptions : Instantiate GetInstanceProfileOptions -func (*VpcV1) NewGetInstanceProfileOptions(name string) *GetInstanceProfileOptions { - return &GetInstanceProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetInstanceProfileOptions) SetName(name string) *GetInstanceProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceProfileOptions) SetHeaders(param map[string]string) *GetInstanceProfileOptions { - options.Headers = param - return options -} - -// GetInstanceTemplateOptions : The GetInstanceTemplate options. -type GetInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceTemplateOptions : Instantiate GetInstanceTemplateOptions -func (*VpcV1) NewGetInstanceTemplateOptions(id string) *GetInstanceTemplateOptions { - return &GetInstanceTemplateOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetInstanceTemplateOptions) SetID(id string) *GetInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceTemplateOptions) SetHeaders(param map[string]string) *GetInstanceTemplateOptions { - options.Headers = param - return options -} - -// GetInstanceVolumeAttachmentOptions : The GetInstanceVolumeAttachment options. -type GetInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetInstanceVolumeAttachmentOptions : Instantiate GetInstanceVolumeAttachmentOptions -func (*VpcV1) NewGetInstanceVolumeAttachmentOptions(instanceID string, id string) *GetInstanceVolumeAttachmentOptions { - return &GetInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetInstanceVolumeAttachmentOptions) SetID(id string) *GetInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} - -// GetIpsecPolicyOptions : The GetIpsecPolicy options. -type GetIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetIpsecPolicyOptions : Instantiate GetIpsecPolicyOptions -func (*VpcV1) NewGetIpsecPolicyOptions(id string) *GetIpsecPolicyOptions { - return &GetIpsecPolicyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetIpsecPolicyOptions) SetID(id string) *GetIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetIpsecPolicyOptions) SetHeaders(param map[string]string) *GetIpsecPolicyOptions { - options.Headers = param - return options -} - -// GetKeyOptions : The GetKey options. -type GetKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetKeyOptions : Instantiate GetKeyOptions -func (*VpcV1) NewGetKeyOptions(id string) *GetKeyOptions { - return &GetKeyOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetKeyOptions) SetID(id string) *GetKeyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetKeyOptions) SetHeaders(param map[string]string) *GetKeyOptions { - options.Headers = param - return options -} - -// GetLoadBalancerListenerOptions : The GetLoadBalancerListener options. -type GetLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerListenerOptions : Instantiate GetLoadBalancerListenerOptions -func (*VpcV1) NewGetLoadBalancerListenerOptions(loadBalancerID string, id string) *GetLoadBalancerListenerOptions { - return &GetLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerOptions) SetID(id string) *GetLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerOptions { - options.Headers = param - return options -} - -// GetLoadBalancerListenerPolicyOptions : The GetLoadBalancerListenerPolicy options. -type GetLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerListenerPolicyOptions : Instantiate GetLoadBalancerListenerPolicyOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *GetLoadBalancerListenerPolicyOptions { - return &GetLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyOptions) SetID(id string) *GetLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} - -// GetLoadBalancerListenerPolicyRuleOptions : The GetLoadBalancerListenerPolicyRule options. -type GetLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerListenerPolicyRuleOptions : Instantiate GetLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *GetLoadBalancerListenerPolicyRuleOptions { - return &GetLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetID(id string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} - -// GetLoadBalancerOptions : The GetLoadBalancer options. -type GetLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerOptions : Instantiate GetLoadBalancerOptions -func (*VpcV1) NewGetLoadBalancerOptions(id string) *GetLoadBalancerOptions { - return &GetLoadBalancerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerOptions) SetID(id string) *GetLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerOptions) SetHeaders(param map[string]string) *GetLoadBalancerOptions { - options.Headers = param - return options -} - -// GetLoadBalancerPoolMemberOptions : The GetLoadBalancerPoolMember options. -type GetLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The member identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerPoolMemberOptions : Instantiate GetLoadBalancerPoolMemberOptions -func (*VpcV1) NewGetLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *GetLoadBalancerPoolMemberOptions { - return &GetLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *GetLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *GetLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolMemberOptions) SetID(id string) *GetLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} - -// GetLoadBalancerPoolOptions : The GetLoadBalancerPool options. -type GetLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerPoolOptions : Instantiate GetLoadBalancerPoolOptions -func (*VpcV1) NewGetLoadBalancerPoolOptions(loadBalancerID string, id string) *GetLoadBalancerPoolOptions { - return &GetLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolOptions) SetID(id string) *GetLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolOptions { - options.Headers = param - return options -} - -// GetLoadBalancerProfileOptions : The GetLoadBalancerProfile options. -type GetLoadBalancerProfileOptions struct { - // The load balancer profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerProfileOptions : Instantiate GetLoadBalancerProfileOptions -func (*VpcV1) NewGetLoadBalancerProfileOptions(name string) *GetLoadBalancerProfileOptions { - return &GetLoadBalancerProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetLoadBalancerProfileOptions) SetName(name string) *GetLoadBalancerProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerProfileOptions) SetHeaders(param map[string]string) *GetLoadBalancerProfileOptions { - options.Headers = param - return options -} - -// GetLoadBalancerStatisticsOptions : The GetLoadBalancerStatistics options. -type GetLoadBalancerStatisticsOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLoadBalancerStatisticsOptions : Instantiate GetLoadBalancerStatisticsOptions -func (*VpcV1) NewGetLoadBalancerStatisticsOptions(id string) *GetLoadBalancerStatisticsOptions { - return &GetLoadBalancerStatisticsOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetLoadBalancerStatisticsOptions) SetID(id string) *GetLoadBalancerStatisticsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerStatisticsOptions) SetHeaders(param map[string]string) *GetLoadBalancerStatisticsOptions { - options.Headers = param - return options -} - -// GetNetworkACLOptions : The GetNetworkACL options. -type GetNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetNetworkACLOptions : Instantiate GetNetworkACLOptions -func (*VpcV1) NewGetNetworkACLOptions(id string) *GetNetworkACLOptions { - return &GetNetworkACLOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetNetworkACLOptions) SetID(id string) *GetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetNetworkACLOptions) SetHeaders(param map[string]string) *GetNetworkACLOptions { - options.Headers = param - return options -} - -// GetNetworkACLRuleOptions : The GetNetworkACLRule options. -type GetNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetNetworkACLRuleOptions : Instantiate GetNetworkACLRuleOptions -func (*VpcV1) NewGetNetworkACLRuleOptions(networkACLID string, id string) *GetNetworkACLRuleOptions { - return &GetNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - } -} - -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *GetNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *GetNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetNetworkACLRuleOptions) SetID(id string) *GetNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetNetworkACLRuleOptions) SetHeaders(param map[string]string) *GetNetworkACLRuleOptions { - options.Headers = param - return options -} - -// GetNetworkInterfaceFloatingIPOptions : The GetNetworkInterfaceFloatingIP options. -type GetNetworkInterfaceFloatingIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetNetworkInterfaceFloatingIPOptions : Instantiate GetNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *GetNetworkInterfaceFloatingIPOptions { - return &GetNetworkInterfaceFloatingIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *GetNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *GetNetworkInterfaceFloatingIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetNetworkInterfaceFloatingIPOptions) SetID(id string) *GetNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// GetOperatingSystemOptions : The GetOperatingSystem options. -type GetOperatingSystemOptions struct { - // The operating system name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetOperatingSystemOptions : Instantiate GetOperatingSystemOptions -func (*VpcV1) NewGetOperatingSystemOptions(name string) *GetOperatingSystemOptions { - return &GetOperatingSystemOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetOperatingSystemOptions) SetName(name string) *GetOperatingSystemOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetOperatingSystemOptions) SetHeaders(param map[string]string) *GetOperatingSystemOptions { - options.Headers = param - return options -} - -// GetPlacementGroupOptions : The GetPlacementGroup options. -type GetPlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetPlacementGroupOptions : Instantiate GetPlacementGroupOptions -func (*VpcV1) NewGetPlacementGroupOptions(id string) *GetPlacementGroupOptions { - return &GetPlacementGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetPlacementGroupOptions) SetID(id string) *GetPlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetPlacementGroupOptions) SetHeaders(param map[string]string) *GetPlacementGroupOptions { - options.Headers = param - return options -} - -// GetPublicGatewayOptions : The GetPublicGateway options. -type GetPublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetPublicGatewayOptions : Instantiate GetPublicGatewayOptions -func (*VpcV1) NewGetPublicGatewayOptions(id string) *GetPublicGatewayOptions { - return &GetPublicGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetPublicGatewayOptions) SetID(id string) *GetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetPublicGatewayOptions) SetHeaders(param map[string]string) *GetPublicGatewayOptions { - options.Headers = param - return options -} - -// GetRegionOptions : The GetRegion options. -type GetRegionOptions struct { - // The region name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetRegionOptions : Instantiate GetRegionOptions -func (*VpcV1) NewGetRegionOptions(name string) *GetRegionOptions { - return &GetRegionOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetRegionOptions) SetName(name string) *GetRegionOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetRegionOptions) SetHeaders(param map[string]string) *GetRegionOptions { - options.Headers = param - return options -} - -// GetRegionZoneOptions : The GetRegionZone options. -type GetRegionZoneOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` - - // The zone name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetRegionZoneOptions : Instantiate GetRegionZoneOptions -func (*VpcV1) NewGetRegionZoneOptions(regionName string, name string) *GetRegionZoneOptions { - return &GetRegionZoneOptions{ - RegionName: core.StringPtr(regionName), - Name: core.StringPtr(name), - } -} - -// SetRegionName : Allow user to set RegionName -func (_options *GetRegionZoneOptions) SetRegionName(regionName string) *GetRegionZoneOptions { - _options.RegionName = core.StringPtr(regionName) - return _options -} - -// SetName : Allow user to set Name -func (_options *GetRegionZoneOptions) SetName(name string) *GetRegionZoneOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetRegionZoneOptions { - options.Headers = param - return options -} - -// GetReservationOptions : The GetReservation options. -type GetReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetReservationOptions : Instantiate GetReservationOptions -func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { - return &GetReservationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { - options.Headers = param - return options -} - -// GetSecurityGroupOptions : The GetSecurityGroup options. -type GetSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSecurityGroupOptions : Instantiate GetSecurityGroupOptions -func (*VpcV1) NewGetSecurityGroupOptions(id string) *GetSecurityGroupOptions { - return &GetSecurityGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSecurityGroupOptions) SetID(id string) *GetSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupOptions) SetHeaders(param map[string]string) *GetSecurityGroupOptions { - options.Headers = param - return options -} - -// GetSecurityGroupRuleOptions : The GetSecurityGroupRule options. -type GetSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSecurityGroupRuleOptions : Instantiate GetSecurityGroupRuleOptions -func (*VpcV1) NewGetSecurityGroupRuleOptions(securityGroupID string, id string) *GetSecurityGroupRuleOptions { - return &GetSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetSecurityGroupRuleOptions) SetID(id string) *GetSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupRuleOptions) SetHeaders(param map[string]string) *GetSecurityGroupRuleOptions { - options.Headers = param - return options -} - -// GetSecurityGroupTargetOptions : The GetSecurityGroupTarget options. -type GetSecurityGroupTargetOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSecurityGroupTargetOptions : Instantiate GetSecurityGroupTargetOptions -func (*VpcV1) NewGetSecurityGroupTargetOptions(securityGroupID string, id string) *GetSecurityGroupTargetOptions { - return &GetSecurityGroupTargetOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupTargetOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupTargetOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetSecurityGroupTargetOptions) SetID(id string) *GetSecurityGroupTargetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupTargetOptions) SetHeaders(param map[string]string) *GetSecurityGroupTargetOptions { - options.Headers = param - return options -} - -// GetShareMountTargetOptions : The GetShareMountTarget options. -type GetShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetShareMountTargetOptions : Instantiate GetShareMountTargetOptions -func (*VpcV1) NewGetShareMountTargetOptions(shareID string, id string) *GetShareMountTargetOptions { - return &GetShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *GetShareMountTargetOptions) SetShareID(shareID string) *GetShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetShareMountTargetOptions) SetID(id string) *GetShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetShareMountTargetOptions) SetHeaders(param map[string]string) *GetShareMountTargetOptions { - options.Headers = param - return options -} - -// GetShareOptions : The GetShare options. -type GetShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetShareOptions : Instantiate GetShareOptions -func (*VpcV1) NewGetShareOptions(id string) *GetShareOptions { - return &GetShareOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetShareOptions) SetID(id string) *GetShareOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetShareOptions) SetHeaders(param map[string]string) *GetShareOptions { - options.Headers = param - return options -} - -// GetShareProfileOptions : The GetShareProfile options. -type GetShareProfileOptions struct { - // The file share profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetShareProfileOptions : Instantiate GetShareProfileOptions -func (*VpcV1) NewGetShareProfileOptions(name string) *GetShareProfileOptions { - return &GetShareProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetShareProfileOptions) SetName(name string) *GetShareProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetShareProfileOptions) SetHeaders(param map[string]string) *GetShareProfileOptions { - options.Headers = param - return options -} - -// GetShareSourceOptions : The GetShareSource options. -type GetShareSourceOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetShareSourceOptions : Instantiate GetShareSourceOptions -func (*VpcV1) NewGetShareSourceOptions(shareID string) *GetShareSourceOptions { - return &GetShareSourceOptions{ - ShareID: core.StringPtr(shareID), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *GetShareSourceOptions) SetShareID(shareID string) *GetShareSourceOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetShareSourceOptions) SetHeaders(param map[string]string) *GetShareSourceOptions { - options.Headers = param - return options -} - -// GetSnapshotCloneOptions : The GetSnapshotClone options. -type GetSnapshotCloneOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The zone name. - ZoneName *string `json:"zone_name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSnapshotCloneOptions : Instantiate GetSnapshotCloneOptions -func (*VpcV1) NewGetSnapshotCloneOptions(id string, zoneName string) *GetSnapshotCloneOptions { - return &GetSnapshotCloneOptions{ - ID: core.StringPtr(id), - ZoneName: core.StringPtr(zoneName), - } -} - -// SetID : Allow user to set ID -func (_options *GetSnapshotCloneOptions) SetID(id string) *GetSnapshotCloneOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *GetSnapshotCloneOptions) SetZoneName(zoneName string) *GetSnapshotCloneOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSnapshotCloneOptions) SetHeaders(param map[string]string) *GetSnapshotCloneOptions { - options.Headers = param - return options -} - -// GetSnapshotConsistencyGroupOptions : The GetSnapshotConsistencyGroup options. -type GetSnapshotConsistencyGroupOptions struct { - // The snapshot consistency group identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSnapshotConsistencyGroupOptions : Instantiate GetSnapshotConsistencyGroupOptions -func (*VpcV1) NewGetSnapshotConsistencyGroupOptions(id string) *GetSnapshotConsistencyGroupOptions { - return &GetSnapshotConsistencyGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSnapshotConsistencyGroupOptions) SetID(id string) *GetSnapshotConsistencyGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *GetSnapshotConsistencyGroupOptions { - options.Headers = param - return options -} - -// GetSnapshotOptions : The GetSnapshot options. -type GetSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSnapshotOptions : Instantiate GetSnapshotOptions -func (*VpcV1) NewGetSnapshotOptions(id string) *GetSnapshotOptions { - return &GetSnapshotOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSnapshotOptions) SetID(id string) *GetSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSnapshotOptions) SetHeaders(param map[string]string) *GetSnapshotOptions { - options.Headers = param - return options -} - -// GetSubnetNetworkACLOptions : The GetSubnetNetworkACL options. -type GetSubnetNetworkACLOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetNetworkACLOptions : Instantiate GetSubnetNetworkACLOptions -func (*VpcV1) NewGetSubnetNetworkACLOptions(id string) *GetSubnetNetworkACLOptions { - return &GetSubnetNetworkACLOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSubnetNetworkACLOptions) SetID(id string) *GetSubnetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetNetworkACLOptions) SetHeaders(param map[string]string) *GetSubnetNetworkACLOptions { - options.Headers = param - return options -} - -// GetSubnetOptions : The GetSubnet options. -type GetSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetOptions : Instantiate GetSubnetOptions -func (*VpcV1) NewGetSubnetOptions(id string) *GetSubnetOptions { - return &GetSubnetOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSubnetOptions) SetID(id string) *GetSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetOptions) SetHeaders(param map[string]string) *GetSubnetOptions { - options.Headers = param - return options -} - -// GetSubnetPublicGatewayOptions : The GetSubnetPublicGateway options. -type GetSubnetPublicGatewayOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetPublicGatewayOptions : Instantiate GetSubnetPublicGatewayOptions -func (*VpcV1) NewGetSubnetPublicGatewayOptions(id string) *GetSubnetPublicGatewayOptions { - return &GetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSubnetPublicGatewayOptions) SetID(id string) *GetSubnetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *GetSubnetPublicGatewayOptions { - options.Headers = param - return options -} - -// GetSubnetReservedIPOptions : The GetSubnetReservedIP options. -type GetSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetReservedIPOptions : Instantiate GetSubnetReservedIPOptions -func (*VpcV1) NewGetSubnetReservedIPOptions(subnetID string, id string) *GetSubnetReservedIPOptions { - return &GetSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - } -} - -// SetSubnetID : Allow user to set SubnetID -func (_options *GetSubnetReservedIPOptions) SetSubnetID(subnetID string) *GetSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetSubnetReservedIPOptions) SetID(id string) *GetSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetReservedIPOptions) SetHeaders(param map[string]string) *GetSubnetReservedIPOptions { - options.Headers = param - return options -} - -// GetSubnetRoutingTableOptions : The GetSubnetRoutingTable options. -type GetSubnetRoutingTableOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSubnetRoutingTableOptions : Instantiate GetSubnetRoutingTableOptions -func (*VpcV1) NewGetSubnetRoutingTableOptions(id string) *GetSubnetRoutingTableOptions { - return &GetSubnetRoutingTableOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetSubnetRoutingTableOptions) SetID(id string) *GetSubnetRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) *GetSubnetRoutingTableOptions { - options.Headers = param - return options -} - -// GetVPCRouteResponse : GetVPCRouteResponse struct -type GetVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the GetVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - GetVPCRouteResponseActionDelegateConst = "delegate" - GetVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - GetVPCRouteResponseActionDeliverConst = "deliver" - GetVPCRouteResponseActionDropConst = "drop" -) - -// Constants associated with the GetVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - GetVPCRouteResponseLifecycleStateDeletingConst = "deleting" - GetVPCRouteResponseLifecycleStateFailedConst = "failed" - GetVPCRouteResponseLifecycleStatePendingConst = "pending" - GetVPCRouteResponseLifecycleStateStableConst = "stable" - GetVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - GetVPCRouteResponseLifecycleStateUpdatingConst = "updating" - GetVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the GetVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - GetVPCRouteResponseOriginServiceConst = "service" - GetVPCRouteResponseOriginUserConst = "user" -) - -// UnmarshalGetVPCRouteResponse unmarshals an instance of GetVPCRouteResponse from the specified map of raw messages. -func UnmarshalGetVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetVirtualNetworkInterfaceIPOptions : The GetVirtualNetworkInterfaceIP options. -type GetVirtualNetworkInterfaceIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVirtualNetworkInterfaceIPOptions : Instantiate GetVirtualNetworkInterfaceIPOptions -func (*VpcV1) NewGetVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *GetVirtualNetworkInterfaceIPOptions { - return &GetVirtualNetworkInterfaceIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *GetVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *GetVirtualNetworkInterfaceIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVirtualNetworkInterfaceIPOptions) SetID(id string) *GetVirtualNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *GetVirtualNetworkInterfaceIPOptions { - options.Headers = param - return options -} - -// GetVirtualNetworkInterfaceOptions : The GetVirtualNetworkInterface options. -type GetVirtualNetworkInterfaceOptions struct { - // The virtual network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVirtualNetworkInterfaceOptions : Instantiate GetVirtualNetworkInterfaceOptions -func (*VpcV1) NewGetVirtualNetworkInterfaceOptions(id string) *GetVirtualNetworkInterfaceOptions { - return &GetVirtualNetworkInterfaceOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVirtualNetworkInterfaceOptions) SetID(id string) *GetVirtualNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetVirtualNetworkInterfaceOptions { - options.Headers = param - return options -} - -// GetVolumeOptions : The GetVolume options. -type GetVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVolumeOptions : Instantiate GetVolumeOptions -func (*VpcV1) NewGetVolumeOptions(id string) *GetVolumeOptions { - return &GetVolumeOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVolumeOptions) SetID(id string) *GetVolumeOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVolumeOptions) SetHeaders(param map[string]string) *GetVolumeOptions { - options.Headers = param - return options -} - -// GetVolumeProfileOptions : The GetVolumeProfile options. -type GetVolumeProfileOptions struct { - // The volume profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVolumeProfileOptions : Instantiate GetVolumeProfileOptions -func (*VpcV1) NewGetVolumeProfileOptions(name string) *GetVolumeProfileOptions { - return &GetVolumeProfileOptions{ - Name: core.StringPtr(name), - } -} - -// SetName : Allow user to set Name -func (_options *GetVolumeProfileOptions) SetName(name string) *GetVolumeProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVolumeProfileOptions) SetHeaders(param map[string]string) *GetVolumeProfileOptions { - options.Headers = param - return options -} - -// GetVPCAddressPrefixOptions : The GetVPCAddressPrefix options. -type GetVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCAddressPrefixOptions : Instantiate GetVPCAddressPrefixOptions -func (*VpcV1) NewGetVPCAddressPrefixOptions(vpcID string, id string) *GetVPCAddressPrefixOptions { - return &GetVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCAddressPrefixOptions) SetVPCID(vpcID string) *GetVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPCAddressPrefixOptions) SetID(id string) *GetVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCAddressPrefixOptions) SetHeaders(param map[string]string) *GetVPCAddressPrefixOptions { - options.Headers = param - return options -} - -// GetVPCDefaultNetworkACLOptions : The GetVPCDefaultNetworkACL options. -type GetVPCDefaultNetworkACLOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCDefaultNetworkACLOptions : Instantiate GetVPCDefaultNetworkACLOptions -func (*VpcV1) NewGetVPCDefaultNetworkACLOptions(id string) *GetVPCDefaultNetworkACLOptions { - return &GetVPCDefaultNetworkACLOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPCDefaultNetworkACLOptions) SetID(id string) *GetVPCDefaultNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultNetworkACLOptions) SetHeaders(param map[string]string) *GetVPCDefaultNetworkACLOptions { - options.Headers = param - return options -} - -// GetVPCDefaultRoutingTableOptions : The GetVPCDefaultRoutingTable options. -type GetVPCDefaultRoutingTableOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCDefaultRoutingTableOptions : Instantiate GetVPCDefaultRoutingTableOptions -func (*VpcV1) NewGetVPCDefaultRoutingTableOptions(id string) *GetVPCDefaultRoutingTableOptions { - return &GetVPCDefaultRoutingTableOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPCDefaultRoutingTableOptions) SetID(id string) *GetVPCDefaultRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCDefaultRoutingTableOptions { - options.Headers = param - return options -} - -// GetVPCDefaultSecurityGroupOptions : The GetVPCDefaultSecurityGroup options. -type GetVPCDefaultSecurityGroupOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCDefaultSecurityGroupOptions : Instantiate GetVPCDefaultSecurityGroupOptions -func (*VpcV1) NewGetVPCDefaultSecurityGroupOptions(id string) *GetVPCDefaultSecurityGroupOptions { - return &GetVPCDefaultSecurityGroupOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPCDefaultSecurityGroupOptions) SetID(id string) *GetVPCDefaultSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultSecurityGroupOptions) SetHeaders(param map[string]string) *GetVPCDefaultSecurityGroupOptions { - options.Headers = param - return options -} - -// GetVPCDnsResolutionBindingOptions : The GetVPCDnsResolutionBinding options. -type GetVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The DNS resolution binding identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCDnsResolutionBindingOptions : Instantiate GetVPCDnsResolutionBindingOptions -func (*VpcV1) NewGetVPCDnsResolutionBindingOptions(vpcID string, id string) *GetVPCDnsResolutionBindingOptions { - return &GetVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *GetVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPCDnsResolutionBindingOptions) SetID(id string) *GetVPCDnsResolutionBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *GetVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} - -// GetVPCOptions : The GetVPC options. -type GetVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCOptions : Instantiate GetVPCOptions -func (*VpcV1) NewGetVPCOptions(id string) *GetVPCOptions { - return &GetVPCOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPCOptions) SetID(id string) *GetVPCOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCOptions) SetHeaders(param map[string]string) *GetVPCOptions { - options.Headers = param - return options -} - -// GetVPCRouteOptions : The GetVPCRoute options. -type GetVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCRouteOptions : Instantiate GetVPCRouteOptions -func (*VpcV1) NewGetVPCRouteOptions(vpcID string, id string) *GetVPCRouteOptions { - return &GetVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRouteOptions) SetVPCID(vpcID string) *GetVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPCRouteOptions) SetID(id string) *GetVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCRouteOptions) SetHeaders(param map[string]string) *GetVPCRouteOptions { - options.Headers = param - return options -} - -// GetVPCRoutingTableOptions : The GetVPCRoutingTable options. -type GetVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCRoutingTableOptions : Instantiate GetVPCRoutingTableOptions -func (*VpcV1) NewGetVPCRoutingTableOptions(vpcID string, id string) *GetVPCRoutingTableOptions { - return &GetVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableOptions) SetVPCID(vpcID string) *GetVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPCRoutingTableOptions) SetID(id string) *GetVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableOptions { - options.Headers = param - return options -} - -// GetVPCRoutingTableRouteOptions : The GetVPCRoutingTableRoute options. -type GetVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // The VPC routing table route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPCRoutingTableRouteOptions : Instantiate GetVPCRoutingTableRouteOptions -func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *GetVPCRoutingTableRouteOptions { - return &GetVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *GetVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *GetVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *GetVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPCRoutingTableRouteOptions) SetID(id string) *GetVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableRouteOptions { - options.Headers = param - return options -} - -// GetVPNGatewayConnectionOptions : The GetVPNGatewayConnection options. -type GetVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNGatewayConnectionOptions : Instantiate GetVPNGatewayConnectionOptions -func (*VpcV1) NewGetVPNGatewayConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayConnectionOptions { - return &GetVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *GetVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPNGatewayConnectionOptions) SetID(id string) *GetVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayConnectionOptions { - options.Headers = param - return options -} - -// GetVPNGatewayOptions : The GetVPNGateway options. -type GetVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNGatewayOptions : Instantiate GetVPNGatewayOptions -func (*VpcV1) NewGetVPNGatewayOptions(id string) *GetVPNGatewayOptions { - return &GetVPNGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPNGatewayOptions) SetID(id string) *GetVPNGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPNGatewayOptions { - options.Headers = param - return options -} - -// GetVPNServerClientConfigurationOptions : The GetVPNServerClientConfiguration options. -type GetVPNServerClientConfigurationOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNServerClientConfigurationOptions : Instantiate GetVPNServerClientConfigurationOptions -func (*VpcV1) NewGetVPNServerClientConfigurationOptions(id string) *GetVPNServerClientConfigurationOptions { - return &GetVPNServerClientConfigurationOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPNServerClientConfigurationOptions) SetID(id string) *GetVPNServerClientConfigurationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNServerClientConfigurationOptions) SetHeaders(param map[string]string) *GetVPNServerClientConfigurationOptions { - options.Headers = param - return options -} - -// GetVPNServerClientOptions : The GetVPNServerClient options. -type GetVPNServerClientOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN client identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNServerClientOptions : Instantiate GetVPNServerClientOptions -func (*VpcV1) NewGetVPNServerClientOptions(vpnServerID string, id string) *GetVPNServerClientOptions { - return &GetVPNServerClientOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *GetVPNServerClientOptions) SetVPNServerID(vpnServerID string) *GetVPNServerClientOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPNServerClientOptions) SetID(id string) *GetVPNServerClientOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNServerClientOptions) SetHeaders(param map[string]string) *GetVPNServerClientOptions { - options.Headers = param - return options -} - -// GetVPNServerOptions : The GetVPNServer options. -type GetVPNServerOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNServerOptions : Instantiate GetVPNServerOptions -func (*VpcV1) NewGetVPNServerOptions(id string) *GetVPNServerOptions { - return &GetVPNServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *GetVPNServerOptions) SetID(id string) *GetVPNServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNServerOptions) SetHeaders(param map[string]string) *GetVPNServerOptions { - options.Headers = param - return options -} - -// GetVPNServerRouteOptions : The GetVPNServerRoute options. -type GetVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN route identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetVPNServerRouteOptions : Instantiate GetVPNServerRouteOptions -func (*VpcV1) NewGetVPNServerRouteOptions(vpnServerID string, id string) *GetVPNServerRouteOptions { - return &GetVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *GetVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *GetVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetVPNServerRouteOptions) SetID(id string) *GetVPNServerRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetVPNServerRouteOptions) SetHeaders(param map[string]string) *GetVPNServerRouteOptions { - options.Headers = param - return options -} - -// IkePolicy : IkePolicy struct -type IkePolicy struct { - // The authentication algorithm - // - // The `md5` and `sha1` algorithms have been deprecated. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The VPN gateway connections that use this IKE policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this IKE policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The Diffie-Hellman group - // - // Groups `2` and `5` have been deprecated. - DhGroup *int64 `json:"dh_group" validate:"required"` - - // The encryption algorithm - // - // The `triple_des` algorithm has been deprecated. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` - - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` - - // The name for this IKE policy. The name is unique across all IKE policies in the region. - Name *string `json:"name" validate:"required"` - - // The IKE negotiation mode. Only `main` is supported. - NegotiationMode *string `json:"negotiation_mode" validate:"required"` - - // The resource group for this IKE policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the IkePolicy.AuthenticationAlgorithm property. -// The authentication algorithm -// -// The `md5` and `sha1` algorithms have been deprecated. -const ( - IkePolicyAuthenticationAlgorithmMd5Const = "md5" - IkePolicyAuthenticationAlgorithmSha1Const = "sha1" - IkePolicyAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyAuthenticationAlgorithmSha384Const = "sha384" - IkePolicyAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IkePolicy.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `triple_des` algorithm has been deprecated. -const ( - IkePolicyEncryptionAlgorithmAes128Const = "aes128" - IkePolicyEncryptionAlgorithmAes192Const = "aes192" - IkePolicyEncryptionAlgorithmAes256Const = "aes256" - IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" -) - -// Constants associated with the IkePolicy.NegotiationMode property. -// The IKE negotiation mode. Only `main` is supported. -const ( - IkePolicyNegotiationModeMainConst = "main" -) - -// Constants associated with the IkePolicy.ResourceType property. -// The resource type. -const ( - IkePolicyResourceTypeIkePolicyConst = "ike_policy" -) - -// UnmarshalIkePolicy unmarshals an instance of IkePolicy from the specified map of raw messages. -func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "negotiation_mode", &obj.NegotiationMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IkePolicyCollection : IkePolicyCollection struct -type IkePolicyCollection struct { - // A link to the first page of resources. - First *IkePolicyCollectionFirst `json:"first" validate:"required"` - - // Collection of IKE policies. - IkePolicies []IkePolicy `json:"ike_policies" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *IkePolicyCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalIkePolicyCollection unmarshals an instance of IkePolicyCollection from the specified map of raw messages. -func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIkePolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policies", &obj.IkePolicies, UnmarshalIkePolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIkePolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *IkePolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// IkePolicyPatch : IkePolicyPatch struct -type IkePolicyPatch struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group,omitempty"` - - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version,omitempty"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The name for this IKE policy. The name must not be used by another IKE policy in the region. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyPatchAuthenticationAlgorithmSha384Const = "sha384" - IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IkePolicyPatchEncryptionAlgorithmAes192Const = "aes192" - IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" -) - -// UnmarshalIkePolicyPatch unmarshals an instance of IkePolicyPatch from the specified map of raw messages. -func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the IkePolicyPatch -func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(ikePolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// IkePolicyReference : IkePolicyReference struct -type IkePolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *IkePolicyReferenceDeleted `json:"deleted,omitempty"` - - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` - - // The name for this IKE policy. The name is unique across all IKE policies in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the IkePolicyReference.ResourceType property. -// The resource type. -const ( - IkePolicyReferenceResourceTypeIkePolicyConst = "ike_policy" -) - -// UnmarshalIkePolicyReference unmarshals an instance of IkePolicyReference from the specified map of raw messages. -func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIkePolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IP : IP struct -type IP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewIP : Instantiate IP (Generic Model Constructor) -func (*VpcV1) NewIP(address string) (_model *IP, err error) { - _model = &IP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalIP unmarshals an instance of IP from the specified map of raw messages. -func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IPsecPolicy : IPsecPolicy struct -type IPsecPolicy struct { - // The authentication algorithm - // - // The `md5` and `sha1` algorithms have been deprecated - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The VPN gateway connections that use this IPsec policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this IPsec policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The encapsulation mode used. Only `tunnel` is supported. - EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` - - // The encryption algorithm - // - // The `triple_des` algorithm has been deprecated - // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` - - // The name for this IPsec policy. The name is unique across all IPsec policies in the region. - Name *string `json:"name" validate:"required"` - - // Perfect Forward Secrecy - // - // Groups `group_2` and `group_5` have been deprecated. - Pfs *string `json:"pfs" validate:"required"` - - // The resource group for this IPsec policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The transform protocol used. Only `esp` is supported. - TransformProtocol *string `json:"transform_protocol" validate:"required"` -} - -// Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. -// The authentication algorithm -// -// # The `md5` and `sha1` algorithms have been deprecated -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - IPsecPolicyAuthenticationAlgorithmDisabledConst = "disabled" - IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" - IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" - IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyAuthenticationAlgorithmSha384Const = "sha384" - IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IPsecPolicy.EncapsulationMode property. -// The encapsulation mode used. Only `tunnel` is supported. -const ( - IPsecPolicyEncapsulationModeTunnelConst = "tunnel" -) - -// Constants associated with the IPsecPolicy.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `triple_des` algorithm has been deprecated -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - IPsecPolicyEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - IPsecPolicyEncryptionAlgorithmAes192Const = "aes192" - IPsecPolicyEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" - IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" -) - -// Constants associated with the IPsecPolicy.Pfs property. -// Perfect Forward Secrecy -// -// Groups `group_2` and `group_5` have been deprecated. -const ( - IPsecPolicyPfsDisabledConst = "disabled" - IPsecPolicyPfsGroup14Const = "group_14" - IPsecPolicyPfsGroup15Const = "group_15" - IPsecPolicyPfsGroup16Const = "group_16" - IPsecPolicyPfsGroup17Const = "group_17" - IPsecPolicyPfsGroup18Const = "group_18" - IPsecPolicyPfsGroup19Const = "group_19" - IPsecPolicyPfsGroup2Const = "group_2" - IPsecPolicyPfsGroup20Const = "group_20" - IPsecPolicyPfsGroup21Const = "group_21" - IPsecPolicyPfsGroup22Const = "group_22" - IPsecPolicyPfsGroup23Const = "group_23" - IPsecPolicyPfsGroup24Const = "group_24" - IPsecPolicyPfsGroup31Const = "group_31" - IPsecPolicyPfsGroup5Const = "group_5" -) - -// Constants associated with the IPsecPolicy.ResourceType property. -// The resource type. -const ( - IPsecPolicyResourceTypeIpsecPolicyConst = "ipsec_policy" -) - -// Constants associated with the IPsecPolicy.TransformProtocol property. -// The transform protocol used. Only `esp` is supported. -const ( - IPsecPolicyTransformProtocolEspConst = "esp" -) - -// UnmarshalIPsecPolicy unmarshals an instance of IPsecPolicy from the specified map of raw messages. -func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encapsulation_mode", &obj.EncapsulationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transform_protocol", &obj.TransformProtocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IPsecPolicyCollection : IPsecPolicyCollection struct -type IPsecPolicyCollection struct { - // A link to the first page of resources. - First *IPsecPolicyCollectionFirst `json:"first" validate:"required"` - - // Collection of IPsec policies. - IpsecPolicies []IPsecPolicy `json:"ipsec_policies" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *IPsecPolicyCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalIPsecPolicyCollection unmarshals an instance of IPsecPolicyCollection from the specified map of raw messages. -func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIPsecPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policies", &obj.IpsecPolicies, UnmarshalIPsecPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIPsecPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// IPsecPolicyCollectionFirst : A link to the first page of resources. -type IPsecPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalIPsecPolicyCollectionFirst unmarshals an instance of IPsecPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IPsecPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IPsecPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalIPsecPolicyCollectionNext unmarshals an instance of IPsecPolicyCollectionNext from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IPsecPolicyPatch : IPsecPolicyPatch struct -type IPsecPolicyPatch struct { - // The authentication algorithm - // - // Must be `disabled` if and only if the `encryption_algorithm` is - // `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - - // The encryption algorithm - // - // The `authentication_algorithm` must be `disabled` if and only if - // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - // `aes256gcm16`. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The name for this IPsec policy. The name must not be used by another IPsec policy in the region. - Name *string `json:"name,omitempty"` - - // Perfect Forward Secrecy. - Pfs *string `json:"pfs,omitempty"` -} - -// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm -// -// Must be `disabled` if and only if the `encryption_algorithm` is -// `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. -const ( - IPsecPolicyPatchAuthenticationAlgorithmDisabledConst = "disabled" - IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyPatchAuthenticationAlgorithmSha384Const = "sha384" - IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm -// -// The `authentication_algorithm` must be `disabled` if and only if -// `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or -// `aes256gcm16`. -const ( - IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyPatchEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" - IPsecPolicyPatchEncryptionAlgorithmAes192Const = "aes192" - IPsecPolicyPatchEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" - IPsecPolicyPatchEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyPatchEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" -) - -// Constants associated with the IPsecPolicyPatch.Pfs property. -// Perfect Forward Secrecy. -const ( - IPsecPolicyPatchPfsDisabledConst = "disabled" - IPsecPolicyPatchPfsGroup14Const = "group_14" - IPsecPolicyPatchPfsGroup15Const = "group_15" - IPsecPolicyPatchPfsGroup16Const = "group_16" - IPsecPolicyPatchPfsGroup17Const = "group_17" - IPsecPolicyPatchPfsGroup18Const = "group_18" - IPsecPolicyPatchPfsGroup19Const = "group_19" - IPsecPolicyPatchPfsGroup20Const = "group_20" - IPsecPolicyPatchPfsGroup21Const = "group_21" - IPsecPolicyPatchPfsGroup22Const = "group_22" - IPsecPolicyPatchPfsGroup23Const = "group_23" - IPsecPolicyPatchPfsGroup24Const = "group_24" - IPsecPolicyPatchPfsGroup31Const = "group_31" -) - -// UnmarshalIPsecPolicyPatch unmarshals an instance of IPsecPolicyPatch from the specified map of raw messages. -func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the IPsecPolicyPatch -func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(iPsecPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// IPsecPolicyReference : IPsecPolicyReference struct -type IPsecPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *IPsecPolicyReferenceDeleted `json:"deleted,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` - - // The name for this IPsec policy. The name is unique across all IPsec policies in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the IPsecPolicyReference.ResourceType property. -// The resource type. -const ( - IPsecPolicyReferenceResourceTypeIpsecPolicyConst = "ipsec_policy" -) - -// UnmarshalIPsecPolicyReference unmarshals an instance of IPsecPolicyReference from the specified map of raw messages. -func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIPsecPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IPsecPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type IPsecPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalIPsecPolicyReferenceDeleted unmarshals an instance of IPsecPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IkePolicyCollectionFirst : A link to the first page of resources. -type IkePolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalIkePolicyCollectionFirst unmarshals an instance of IkePolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIkePolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IkePolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IkePolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalIkePolicyCollectionNext unmarshals an instance of IkePolicyCollectionNext from the specified map of raw messages. -func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// IkePolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type IkePolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalIkePolicyReferenceDeleted unmarshals an instance of IkePolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Image : Image struct -type Image struct { - CatalogOffering *ImageCatalogOffering `json:"catalog_offering" validate:"required"` - - // The date and time that the image was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` - - // The deprecation date and time (UTC) for this image. - // - // If absent, no deprecation date and time has been set. - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - - // The type of encryption used on the image. - Encryption *string `json:"encryption" validate:"required"` - - // The key that will be used to encrypt volumes created from this image (unless an - // alternate `encryption_key` is specified at volume creation). - // - // This property will be present for images with an `encryption` type of `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - - // Details for the stored image file. - File *ImageFile `json:"file" validate:"required"` - - // The URL for this image. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` - - // The minimum size (in gigabytes) of a volume onto which this image may be provisioned. - // - // This property may be absent if the image has a `status` of `pending` or `failed`. - MinimumProvisionedSize *int64 `json:"minimum_provisioned_size,omitempty"` - - // The name for this image. The name is unique across all images in the region. - Name *string `json:"name" validate:"required"` - - // The obsolescence date and time (UTC) for this image. - // - // If absent, no obsolescence date and time has been set. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - - // The operating system included in this image. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` - - // The resource group for this image. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The volume used to create this image (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this image was not created from a volume. - SourceVolume *VolumeReference `json:"source_volume,omitempty"` - - // The status of this image - // - available: image can be used (provisionable) - // - deleting: image is being deleted, and can no longer be used to provision new - // resources - // - deprecated: image is administratively slated to become `obsolete` - // - failed: image is corrupt or did not pass validation - // - obsolete: image administratively set to not be used for new resources - // - pending: image is being imported and is not yet `available` - // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any): - // - `encrypted_data_key_invalid`: image cannot be decrypted with the specified - // `encryption_key` - // - `encryption_key_deleted`: image unusable because its `encryption_key` was deleted - // - `encryption_key_disabled`: image unusable until its `encryption_key` is re-enabled - // - `image_data_corrupted`: image data is corrupt, or is not in the specified format - // - `image_provisioned_size_unsupported`: image requires a boot volume size greater - // than the maximum supported value - // - `image_request_in_progress`: image operation is in progress (such as an import from - // Cloud Object Storage) - // - `image_request_queued`: image request has been accepted but the requested - // operation has not started - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ImageStatusReason `json:"status_reasons" validate:"required"` - - // The visibility of this image. - // - `private`: Visible only to this account - // - `public`: Visible to all accounts. - Visibility *string `json:"visibility" validate:"required"` -} - -// Constants associated with the Image.Encryption property. -// The type of encryption used on the image. -const ( - ImageEncryptionNoneConst = "none" - ImageEncryptionUserManagedConst = "user_managed" -) - -// Constants associated with the Image.ResourceType property. -// The resource type. -const ( - ImageResourceTypeImageConst = "image" -) - -// Constants associated with the Image.Status property. -// The status of this image -// - available: image can be used (provisionable) -// - deleting: image is being deleted, and can no longer be used to provision new -// resources -// - deprecated: image is administratively slated to become `obsolete` -// - failed: image is corrupt or did not pass validation -// - obsolete: image administratively set to not be used for new resources -// - pending: image is being imported and is not yet `available` -// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the -// unexpected property value was encountered. -const ( - ImageStatusAvailableConst = "available" - ImageStatusDeletingConst = "deleting" - ImageStatusDeprecatedConst = "deprecated" - ImageStatusFailedConst = "failed" - ImageStatusObsoleteConst = "obsolete" - ImageStatusPendingConst = "pending" - ImageStatusUnusableConst = "unusable" -) - -// Constants associated with the Image.Visibility property. -// The visibility of this image. -// - `private`: Visible only to this account -// - `public`: Visible to all accounts. -const ( - ImageVisibilityPrivateConst = "private" - ImageVisibilityPublicConst = "public" -) - -// UnmarshalImage unmarshals an instance of Image from the specified map of raw messages. -func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Image) - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalImageCatalogOffering) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "minimum_provisioned_size", &obj.MinimumProvisionedSize) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageCatalogOffering : ImageCatalogOffering struct -type ImageCatalogOffering struct { - // Indicates whether this image is managed as part of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. If an image is managed, - // accounts in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) with access to that catalog can - // specify the image's catalog offering version CRN to provision virtual server instances using the image. - Managed *bool `json:"managed" validate:"required"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version associated with this image. - // - // If absent, this image is not associated with a cloud catalog offering. - Version *CatalogOfferingVersionReference `json:"version,omitempty"` -} - -// UnmarshalImageCatalogOffering unmarshals an instance of ImageCatalogOffering from the specified map of raw messages. -func UnmarshalImageCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCatalogOffering) - err = core.UnmarshalPrimitive(m, "managed", &obj.Managed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageCollection : ImageCollection struct -type ImageCollection struct { - // A link to the first page of resources. - First *ImageCollectionFirst `json:"first" validate:"required"` - - // Collection of images. - Images []Image `json:"images" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ImageCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalImageCollection unmarshals an instance of ImageCollection from the specified map of raw messages. -func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalImageCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "images", &obj.Images, UnmarshalImage) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalImageCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ImageCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ImageCollectionFirst : A link to the first page of resources. -type ImageCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalImageCollectionFirst unmarshals an instance of ImageCollectionFirst from the specified map of raw messages. -func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ImageCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalImageCollectionNext unmarshals an instance of ImageCollectionNext from the specified map of raw messages. -func UnmarshalImageCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageExportJob : ImageExportJob struct -type ImageExportJob struct { - // The date and time that the image export job was completed. - // - // If absent, the export job has not yet completed. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the image export job was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This - // key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto - // Services. - // - // If absent, the export job is for an unencrypted image. - EncryptedDataKey *[]byte `json:"encrypted_data_key,omitempty"` - - // The format of the exported image. - Format *string `json:"format" validate:"required"` - - // The URL for this image export job. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this image export job. - ID *string `json:"id" validate:"required"` - - // The name for this image export job. The name must not be used by another export job for the image. Changing the name - // will not affect the exported image name, - // `storage_object.name`, or `storage_href` values. - Name *string `json:"name" validate:"required"` - - // The type of resource referenced. - ResourceType *string `json:"resource_type" validate:"required"` - - // The date and time that the image export job started running. - // - // If absent, the export job has not yet started. - StartedAt *strfmt.DateTime `json:"started_at,omitempty"` - - // The status of this image export job: - // - `deleting`: Export job is being deleted - // - `failed`: Export job could not be completed successfully - // - `queued`: Export job is queued - // - `running`: Export job is in progress - // - `succeeded`: Export job was completed successfully - // - // The exported image object is automatically deleted for `failed` jobs. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ImageExportJobStatusReason `json:"status_reasons" validate:"required"` - - // The Cloud Object Storage bucket of the exported image object. - StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` - - // The Cloud Object Storage location of the exported image object. The object at this location will not exist until the - // job completes successfully. The exported image object is not managed by the IBM VPC service, and may be removed or - // replaced with a different object by any user or service with IAM authorization to the storage bucket. - StorageHref *string `json:"storage_href" validate:"required"` - - // The Cloud Object Storage object for the exported image. This object will not exist until - // the job completes successfully. The exported image object is not managed by the IBM VPC - // service, and may be removed or replaced with a different object by any user or service - // with IAM authorization to the storage bucket. - StorageObject *CloudObjectStorageObjectReference `json:"storage_object" validate:"required"` -} - -// Constants associated with the ImageExportJob.Format property. -// The format of the exported image. -const ( - ImageExportJobFormatQcow2Const = "qcow2" - ImageExportJobFormatVhdConst = "vhd" -) - -// Constants associated with the ImageExportJob.ResourceType property. -// The type of resource referenced. -const ( - ImageExportJobResourceTypeImageExportJobConst = "image_export_job" -) - -// Constants associated with the ImageExportJob.Status property. -// The status of this image export job: -// - `deleting`: Export job is being deleted -// - `failed`: Export job could not be completed successfully -// - `queued`: Export job is queued -// - `running`: Export job is in progress -// - `succeeded`: Export job was completed successfully -// -// The exported image object is automatically deleted for `failed` jobs. -const ( - ImageExportJobStatusDeletingConst = "deleting" - ImageExportJobStatusFailedConst = "failed" - ImageExportJobStatusQueuedConst = "queued" - ImageExportJobStatusRunningConst = "running" - ImageExportJobStatusSucceededConst = "succeeded" -) - -// UnmarshalImageExportJob unmarshals an instance of ImageExportJob from the specified map of raw messages. -func UnmarshalImageExportJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJob) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "format", &obj.Format) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageExportJobStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "storage_href", &obj.StorageHref) - if err != nil { - return - } - err = core.UnmarshalModel(m, "storage_object", &obj.StorageObject, UnmarshalCloudObjectStorageObjectReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageExportJobPatch : ImageExportJobPatch struct -type ImageExportJobPatch struct { - // The name for this image export job. The name must not be used by another export job for the image. Changing the name - // will not affect the exported image name, - // `storage_object.name`, or `storage_href` values. - Name *string `json:"name,omitempty"` -} - -// UnmarshalImageExportJobPatch unmarshals an instance of ImageExportJobPatch from the specified map of raw messages. -func UnmarshalImageExportJobPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ImageExportJobPatch -func (imageExportJobPatch *ImageExportJobPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(imageExportJobPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ImageExportJobStatusReason : ImageExportJobStatusReason struct -type ImageExportJobStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the ImageExportJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ImageExportJobStatusReasonCodeCannotAccessStorageBucketConst = "cannot_access_storage_bucket" - ImageExportJobStatusReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalImageExportJobStatusReason unmarshals an instance of ImageExportJobStatusReason from the specified map of raw messages. -func UnmarshalImageExportJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageExportJobUnpaginatedCollection : ImageExportJobUnpaginatedCollection struct -type ImageExportJobUnpaginatedCollection struct { - // Collection of image export jobs. - ExportJobs []ImageExportJob `json:"export_jobs" validate:"required"` -} - -// UnmarshalImageExportJobUnpaginatedCollection unmarshals an instance of ImageExportJobUnpaginatedCollection from the specified map of raw messages. -func UnmarshalImageExportJobUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageExportJobUnpaginatedCollection) - err = core.UnmarshalModel(m, "export_jobs", &obj.ExportJobs, UnmarshalImageExportJob) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFile : ImageFile struct -type ImageFile struct { - // Checksums for this image file. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Checksums *ImageFileChecksums `json:"checksums,omitempty"` - - // The size of the stored image file rounded up to the next gigabyte. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Size *int64 `json:"size,omitempty"` -} - -// UnmarshalImageFile unmarshals an instance of ImageFile from the specified map of raw messages. -func UnmarshalImageFile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFile) - err = core.UnmarshalModel(m, "checksums", &obj.Checksums, UnmarshalImageFileChecksums) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFileChecksums : ImageFileChecksums struct -type ImageFileChecksums struct { - // The SHA256 fingerprint of the image file. - Sha256 *string `json:"sha256,omitempty"` -} - -// UnmarshalImageFileChecksums unmarshals an instance of ImageFileChecksums from the specified map of raw messages. -func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFileChecksums) - err = core.UnmarshalPrimitive(m, "sha256", &obj.Sha256) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFilePrototype : ImageFilePrototype struct -type ImageFilePrototype struct { - // The Cloud Object Storage location of the image file. - // - // The image file format is specified by the file's extension, which must be either - // `qcow2` or `vhd`. - Href *string `json:"href" validate:"required"` -} - -// NewImageFilePrototype : Instantiate ImageFilePrototype (Generic Model Constructor) -func (*VpcV1) NewImageFilePrototype(href string) (_model *ImageFilePrototype, err error) { - _model = &ImageFilePrototype{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalImageFilePrototype unmarshals an instance of ImageFilePrototype from the specified map of raw messages. -func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFilePrototype) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentity : Identifies an image by a unique property. -// Models which "extend" this model: -// - ImageIdentityByID -// - ImageIdentityByCRN -// - ImageIdentityByHref -type ImageIdentity struct { - // The unique identifier for this image. - ID *string `json:"id,omitempty"` - - // The CRN for this image. - CRN *string `json:"crn,omitempty"` - - // The URL for this image. - Href *string `json:"href,omitempty"` -} - -func (*ImageIdentity) isaImageIdentity() bool { - return true -} - -type ImageIdentityIntf interface { - isaImageIdentity() bool -} - -// UnmarshalImageIdentity unmarshals an instance of ImageIdentity from the specified map of raw messages. -func UnmarshalImageIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImagePatch : ImagePatch struct -type ImagePatch struct { - // The deprecation date and time to set for this image. - // - // This cannot be set if the image has a `status` of `failed` or `deleting`, or if - // `catalog_offering.managed` is `true`. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). Additionally, if the image status is currently - // `deprecated`, the value cannot be changed (but may be removed). - // - // Specify `null` to remove an existing deprecation date and time. If the image status is currently `deprecated`, it - // will become `available`. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. - Name *string `json:"name,omitempty"` - - // The obsolescence date and time to set for this image. - // - // This cannot be set if the image has a `status` of `failed` or `deleting`, or if - // `catalog_offering.managed` is `true`. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). Additionally, if the image status is currently `obsolete`, the value cannot be changed - // (but may be removed). - // - // Specify `null` to remove an existing obsolescence date and time. If the image status is currently `obsolete`, it - // will become `deprecated` if `deprecation_at` is in the past. Otherwise, it will become `available`. - // - // If the obsolescence date and time is reached while the image has a status of `pending`, the image's status will - // transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` -} - -// UnmarshalImagePatch unmarshals an instance of ImagePatch from the specified map of raw messages. -func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePatch) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ImagePatch -func (imagePatch *ImagePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(imagePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ImagePrototype : ImagePrototype struct -// Models which "extend" this model: -// - ImagePrototypeImageByFile -// - ImagePrototypeImageBySourceVolume -type ImagePrototype struct { - // The deprecation date and time to set for this image. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). - // - // If unspecified, no deprecation date and time will be set. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). - // - // If unspecified, no obsolescence date and time will be set. - // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. - // - // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be - // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the - // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` - - // The root key that was used to wrap the data key (which is ultimately represented as - // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes - // created from this image (unless an alternate `encryption_key` is specified at volume - // creation). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The file from which to create the image. - File *ImageFilePrototype `json:"file,omitempty"` - - // The [supported operating - // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this - // image. - OperatingSystem OperatingSystemIdentityIntf `json:"operating_system,omitempty"` - - // The volume from which to create the image. The specified volume must: - // - Have an `operating_system`, which will be used to populate this image's - // operating system information. - // - Not be `active` or `busy`. - // - // During image creation, the specified volume may briefly become `busy`. - SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` -} - -func (*ImagePrototype) isaImagePrototype() bool { - return true -} - -type ImagePrototypeIntf interface { - isaImagePrototype() bool -} - -// UnmarshalImagePrototype unmarshals an instance of ImagePrototype from the specified map of raw messages. -func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototype) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageReference : ImageReference struct -type ImageReference struct { - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ImageReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this image. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` - - // The name for this image. The name is unique across all images in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *ImageRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ImageReference.ResourceType property. -// The resource type. -const ( - ImageReferenceResourceTypeImageConst = "image" -) - -// UnmarshalImageReference unmarshals an instance of ImageReference from the specified map of raw messages. -func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalImageReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalImageRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ImageReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalImageReferenceDeleted unmarshals an instance of ImageReferenceDeleted from the specified map of raw messages. -func UnmarshalImageReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type ImageRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` - - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalImageRemote unmarshals an instance of ImageRemote from the specified map of raw messages. -func UnmarshalImageRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageStatusReason : ImageStatusReason struct -type ImageStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the ImageStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ImageStatusReasonCodeEncryptedDataKeyInvalidConst = "encrypted_data_key_invalid" - ImageStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - ImageStatusReasonCodeEncryptionKeyDisabledConst = "encryption_key_disabled" - ImageStatusReasonCodeImageDataCorruptedConst = "image_data_corrupted" - ImageStatusReasonCodeImageProvisionedSizeUnsupportedConst = "image_provisioned_size_unsupported" - ImageStatusReasonCodeImageRequestInProgressConst = "image_request_in_progress" - ImageStatusReasonCodeImageRequestQueuedConst = "image_request_queued" -) - -// UnmarshalImageStatusReason unmarshals an instance of ImageStatusReason from the specified map of raw messages. -func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Instance : Instance struct -type Instance struct { - // The availability policy for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicy `json:"availability_policy" validate:"required"` - - // The total bandwidth (in megabits per second) shared across the instance network attachments or instance network - // interfaces and storage volumes of the virtual server instance. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // Boot volume attachment. - BootVolumeAttachment *VolumeAttachmentReferenceInstanceContext `json:"boot_volume_attachment" validate:"required"` - - // If present, this virtual server instance was provisioned from a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). - CatalogOffering *InstanceCatalogOffering `json:"catalog_offering,omitempty"` - - // The date and time that the virtual server instance was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, the dedicated host this virtual server instance has been placed on. - DedicatedHost *DedicatedHostReference `json:"dedicated_host,omitempty"` - - // The instance disks for this virtual server instance. - Disks []InstanceDisk `json:"disks" validate:"required"` - - // The virtual server instance GPU configuration. - Gpu *InstanceGpu `json:"gpu,omitempty"` - - // The reasons for the current instance `health_state` (if any): - // - `reservation_capacity_unavailable`: The reservation affinity pool has no - // available capacity. - // - `reservation_deleted`: The reservation affinity pool has a deleted reservation. - // - `reservation_expired`: The reservation affinity pool has an expired reservation. - // - `reservation_failed`: The reservation affinity pool has a failed reservation. - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []InstanceHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The image the virtual server instance was provisioned from. - Image *ImageReference `json:"image,omitempty"` - - // The reasons for the current `lifecycle_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []InstanceLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the virtual server instance. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The amount of memory, truncated to whole gibibytes. - Memory *int64 `json:"memory" validate:"required"` - - // The metadata service configuration. - MetadataService *InstanceMetadataService `json:"metadata_service" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` - - // The network attachments for this virtual server instance, including the primary network attachment. - NetworkAttachments []InstanceNetworkAttachmentReference `json:"network_attachments" validate:"required"` - - // The network interfaces for this instance, including the primary network interface. - // - // If this instance has network attachments, each network interface is a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface. - NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` - - // The number of NUMA nodes this virtual server instance is provisioned on. - // - // This property will be absent if the instance's `status` is not `running`. - NumaCount *int64 `json:"numa_count,omitempty"` - - // The placement restrictions for the virtual server instance. - PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` - - // The primary network attachment for this virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentReference `json:"primary_network_attachment,omitempty"` - - // The primary network interface for this virtual server instance. - // - // If this instance has network attachments, this primary network interface is a - // [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - // of the primary network attachment and its attached virtual network interface. - PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual - // server instance. - Profile *InstanceProfileReference `json:"profile" validate:"required"` - - // The reservation used by this virtual server instance. - // - // If absent, no reservation is in use. - Reservation *ReservationReference `json:"reservation,omitempty"` - - ReservationAffinity *InstanceReservationAffinity `json:"reservation_affinity" validate:"required"` - - // The resource group for this instance. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether the state of the virtual server instance permits a start request. - Startable *bool `json:"startable" validate:"required"` - - // The status of the virtual server instance. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []InstanceStatusReason `json:"status_reasons" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance network attachments or instance - // network interfaces. - TotalNetworkBandwidth *int64 `json:"total_network_bandwidth" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth" validate:"required"` - - // The virtual server instance VCPU configuration. - Vcpu *InstanceVcpu `json:"vcpu" validate:"required"` - - // The volume attachments for this virtual server instance, including the boot volume attachment. - VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` - - // The VPC this virtual server instance resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this virtual server instance resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Instance.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - InstanceHealthStateDegradedConst = "degraded" - InstanceHealthStateFaultedConst = "faulted" - InstanceHealthStateInapplicableConst = "inapplicable" - InstanceHealthStateOkConst = "ok" -) - -// Constants associated with the Instance.LifecycleState property. -// The lifecycle state of the virtual server instance. -const ( - InstanceLifecycleStateDeletingConst = "deleting" - InstanceLifecycleStateFailedConst = "failed" - InstanceLifecycleStatePendingConst = "pending" - InstanceLifecycleStateStableConst = "stable" - InstanceLifecycleStateSuspendedConst = "suspended" - InstanceLifecycleStateUpdatingConst = "updating" - InstanceLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Instance.ResourceType property. -// The resource type. -const ( - InstanceResourceTypeInstanceConst = "instance" -) - -// Constants associated with the Instance.Status property. -// The status of the virtual server instance. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the instance on which the unexpected -// property value was encountered. -const ( - InstanceStatusDeletingConst = "deleting" - InstanceStatusFailedConst = "failed" - InstanceStatusPendingConst = "pending" - InstanceStatusRestartingConst = "restarting" - InstanceStatusRunningConst = "running" - InstanceStatusStartingConst = "starting" - InstanceStatusStoppedConst = "stopped" - InstanceStatusStoppingConst = "stopping" -) - -// UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. -func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Instance) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOffering) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dedicated_host", &obj.DedicatedHost, UnmarshalDedicatedHostReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu", &obj.Gpu, UnmarshalInstanceGpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalInstanceHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalInstanceLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataService) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceInstanceContextReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "numa_count", &obj.NumaCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceInstanceContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation", &obj.Reservation, UnmarshalReservationReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "startable", &obj.Startable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalInstanceStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_network_bandwidth", &obj.TotalNetworkBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceAction : InstanceAction struct -type InstanceAction struct { - // The date and time that the action was completed. - // Deprecated: this field is deprecated and may be removed in a future release. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` - - // The URL for this instance action. - // Deprecated: this field is deprecated and may be removed in a future release. - Href *string `json:"href" validate:"required"` - - // The identifier for this instance action. - // Deprecated: this field is deprecated and may be removed in a future release. - ID *string `json:"id" validate:"required"` - - // The date and time that the action was started. - // Deprecated: this field is deprecated and may be removed in a future release. - StartedAt *strfmt.DateTime `json:"started_at,omitempty"` - - // The current status of this action. - // Deprecated: this field is deprecated and may be removed in a future release. - Status *string `json:"status" validate:"required"` - - // The type of action. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceAction.Status property. -// The current status of this action. -const ( - InstanceActionStatusCompletedConst = "completed" - InstanceActionStatusFailedConst = "failed" - InstanceActionStatusPendingConst = "pending" - InstanceActionStatusRunningConst = "running" -) - -// Constants associated with the InstanceAction.Type property. -// The type of action. -const ( - InstanceActionTypeRebootConst = "reboot" - InstanceActionTypeStartConst = "start" - InstanceActionTypeStopConst = "stop" -) - -// UnmarshalInstanceAction unmarshals an instance of InstanceAction from the specified map of raw messages. -func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAction) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceAvailabilityPolicy : InstanceAvailabilityPolicy struct -type InstanceAvailabilityPolicy struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the - // unexpected property value was encountered. - HostFailure *string `json:"host_failure" validate:"required"` -} - -// Constants associated with the InstanceAvailabilityPolicy.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the -// unexpected property value was encountered. -const ( - InstanceAvailabilityPolicyHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyHostFailureStopConst = "stop" -) - -// UnmarshalInstanceAvailabilityPolicy unmarshals an instance of InstanceAvailabilityPolicy from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicy) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceAvailabilityPolicyPatch : InstanceAvailabilityPolicyPatch struct -type InstanceAvailabilityPolicyPatch struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure. - HostFailure *string `json:"host_failure,omitempty"` -} - -// Constants associated with the InstanceAvailabilityPolicyPatch.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure. -const ( - InstanceAvailabilityPolicyPatchHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyPatchHostFailureStopConst = "stop" -) - -// UnmarshalInstanceAvailabilityPolicyPatch unmarshals an instance of InstanceAvailabilityPolicyPatch from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicyPatch) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceAvailabilityPolicyPrototype : InstanceAvailabilityPolicyPrototype struct -type InstanceAvailabilityPolicyPrototype struct { - // The action to perform if the compute host experiences a failure. - // - `restart`: Automatically restart the virtual server instance after host failure - // - `stop`: Leave the virtual server instance stopped after host failure. - HostFailure *string `json:"host_failure,omitempty"` -} - -// Constants associated with the InstanceAvailabilityPolicyPrototype.HostFailure property. -// The action to perform if the compute host experiences a failure. -// - `restart`: Automatically restart the virtual server instance after host failure -// - `stop`: Leave the virtual server instance stopped after host failure. -const ( - InstanceAvailabilityPolicyPrototypeHostFailureRestartConst = "restart" - InstanceAvailabilityPolicyPrototypeHostFailureStopConst = "stop" -) - -// UnmarshalInstanceAvailabilityPolicyPrototype unmarshals an instance of InstanceAvailabilityPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceAvailabilityPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAvailabilityPolicyPrototype) - err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOffering : InstanceCatalogOffering struct -type InstanceCatalogOffering struct { - // The catalog offering version this virtual server instance was provisioned from. - // - // The catalog offering version is not managed by the IBM VPC service, and may no longer - // exist, or may refer to a different image CRN than the `image.crn` for this virtual - // server instance. However, all images associated with a catalog offering version will - // have the same checksum, and therefore will have the same data. - Version *CatalogOfferingVersionReference `json:"version" validate:"required"` -} - -// UnmarshalInstanceCatalogOffering unmarshals an instance of InstanceCatalogOffering from the specified map of raw messages. -func UnmarshalInstanceCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOffering) - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOfferingPrototype : The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering or offering version to use -// when provisioning this virtual server instance. -// -// If an offering is specified, the latest version of that offering will be used. -// -// The specified offering or offering version may be in a different account in the same -// [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject to IAM policies. -// Models which "extend" this model: -// - InstanceCatalogOfferingPrototypeCatalogOfferingByOffering -// - InstanceCatalogOfferingPrototypeCatalogOfferingByVersion -type InstanceCatalogOfferingPrototype struct { - // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering by a unique property. - Offering CatalogOfferingIdentityIntf `json:"offering,omitempty"` - - // Identifies a version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a - // unique property. - Version CatalogOfferingVersionIdentityIntf `json:"version,omitempty"` -} - -func (*InstanceCatalogOfferingPrototype) isaInstanceCatalogOfferingPrototype() bool { - return true -} - -type InstanceCatalogOfferingPrototypeIntf interface { - isaInstanceCatalogOfferingPrototype() bool -} - -// UnmarshalInstanceCatalogOfferingPrototype unmarshals an instance of InstanceCatalogOfferingPrototype from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototype) - err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCollection : InstanceCollection struct -type InstanceCollection struct { - // A link to the first page of resources. - First *InstanceCollectionFirst `json:"first" validate:"required"` - - // Collection of virtual server instances. - Instances []Instance `json:"instances" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceCollection unmarshals an instance of InstanceCollection from the specified map of raw messages. -func UnmarshalInstanceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstance) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceCollectionFirst : A link to the first page of resources. -type InstanceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceCollectionFirst unmarshals an instance of InstanceCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceCollectionNext unmarshals an instance of InstanceCollectionNext from the specified map of raw messages. -func UnmarshalInstanceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceConsoleAccessToken : The instance console access token information. -type InstanceConsoleAccessToken struct { - // A URL safe single-use token used to access the console WebSocket. - AccessToken *string `json:"access_token" validate:"required"` - - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` - - // The date and time that the access token was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The date and time that the access token will expire. - ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` - - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force" validate:"required"` - - // The URL to access this instance console. - Href *string `json:"href" validate:"required"` -} - -// Constants associated with the InstanceConsoleAccessToken.ConsoleType property. -// The instance console type for which this token may be used. -const ( - InstanceConsoleAccessTokenConsoleTypeSerialConst = "serial" - InstanceConsoleAccessTokenConsoleTypeVncConst = "vnc" -) - -// UnmarshalInstanceConsoleAccessToken unmarshals an instance of InstanceConsoleAccessToken from the specified map of raw messages. -func UnmarshalInstanceConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceConsoleAccessToken) - err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceDefaultTrustedProfilePrototype : InstanceDefaultTrustedProfilePrototype struct -type InstanceDefaultTrustedProfilePrototype struct { - // If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. - // Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be - // automatically deleted when the instance is deleted. - AutoLink *bool `json:"auto_link,omitempty"` - - // The default IAM trusted profile to use for this virtual server instance. - Target TrustedProfileIdentityIntf `json:"target" validate:"required"` -} - -// NewInstanceDefaultTrustedProfilePrototype : Instantiate InstanceDefaultTrustedProfilePrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceDefaultTrustedProfilePrototype(target TrustedProfileIdentityIntf) (_model *InstanceDefaultTrustedProfilePrototype, err error) { - _model = &InstanceDefaultTrustedProfilePrototype{ - Target: target, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalInstanceDefaultTrustedProfilePrototype unmarshals an instance of InstanceDefaultTrustedProfilePrototype from the specified map of raw messages. -func UnmarshalInstanceDefaultTrustedProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDefaultTrustedProfilePrototype) - err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceDisk : InstanceDisk struct -type InstanceDisk struct { - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` - - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The name for this instance disk. The name is unique across all disks on the instance. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` -} - -// Constants associated with the InstanceDisk.InterfaceType property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceDiskInterfaceTypeNvmeConst = "nvme" - InstanceDiskInterfaceTypeVirtioBlkConst = "virtio_blk" -) - -// Constants associated with the InstanceDisk.ResourceType property. -// The resource type. -const ( - InstanceDiskResourceTypeInstanceDiskConst = "instance_disk" -) - -// UnmarshalInstanceDisk unmarshals an instance of InstanceDisk from the specified map of raw messages. -func UnmarshalInstanceDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDisk) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceDiskCollection : InstanceDiskCollection struct -type InstanceDiskCollection struct { - // Collection of the instance's disks. - Disks []InstanceDisk `json:"disks" validate:"required"` -} - -// UnmarshalInstanceDiskCollection unmarshals an instance of InstanceDiskCollection from the specified map of raw messages. -func UnmarshalInstanceDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceDiskPatch : InstanceDiskPatch struct -type InstanceDiskPatch struct { - // The name for this instance disk. The name must not be used by another disk on the instance. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceDiskPatch unmarshals an instance of InstanceDiskPatch from the specified map of raw messages. -func UnmarshalInstanceDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceDiskPatch -func (instanceDiskPatch *InstanceDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceDiskReference : InstanceDiskReference struct -type InstanceDiskReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceDiskReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` - - // The name for this instance disk. The name is unique across all disks on the instance. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstanceDiskReference.ResourceType property. -// The resource type. -const ( - InstanceDiskReferenceResourceTypeInstanceDiskConst = "instance_disk" -) - -// UnmarshalInstanceDiskReference unmarshals an instance of InstanceDiskReference from the specified map of raw messages. -func UnmarshalInstanceDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceDiskReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceDiskReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceDiskReferenceDeleted unmarshals an instance of InstanceDiskReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGpu : The virtual server instance GPU configuration. -type InstanceGpu struct { - // The number of GPUs assigned to the instance. - Count *int64 `json:"count" validate:"required"` - - // The GPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` - - // The overall amount of GPU memory in GiB (gibibytes). - Memory *int64 `json:"memory" validate:"required"` - - // The GPU model. - Model *string `json:"model" validate:"required"` -} - -// UnmarshalInstanceGpu unmarshals an instance of InstanceGpu from the specified map of raw messages. -func UnmarshalInstanceGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGpu) - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "model", &obj.Model) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroup : InstanceGroup struct -type InstanceGroup struct { - // The port used for new load balancer pool members created by this instance group. - // - // This property will be present if and only if `load_balancer_pool` is present. - ApplicationPort *int64 `json:"application_port,omitempty"` - - // The date and time that the instance group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` - - // The URL for this instance group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` - - // The template used to create new instances for this group. - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` - - // If present, the load balancer pool this instance group manages. A pool member will - // be created for each instance created by this group. - LoadBalancerPool *LoadBalancerPoolReference `json:"load_balancer_pool,omitempty"` - - // The managers for the instance group. - Managers []InstanceGroupManagerReference `json:"managers" validate:"required"` - - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count" validate:"required"` - - // The name for this instance group. The name is unique across all instance groups in the region. - Name *string `json:"name" validate:"required"` - - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The status of the instance group - // - `deleting`: Group is being deleted - // - `healthy`: Group has `membership_count` instances - // - `scaling`: Instances in the group are being created or deleted to reach - // `membership_count` - // - `unhealthy`: Group is unable to reach `membership_count` instances. - Status *string `json:"status" validate:"required"` - - // The subnets to use when creating new instances. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The date and time that the instance group was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The VPC the instance group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the InstanceGroup.Status property. -// The status of the instance group -// - `deleting`: Group is being deleted -// - `healthy`: Group has `membership_count` instances -// - `scaling`: Instances in the group are being created or deleted to reach -// `membership_count` -// - `unhealthy`: Group is unable to reach `membership_count` instances. -const ( - InstanceGroupStatusDeletingConst = "deleting" - InstanceGroupStatusHealthyConst = "healthy" - InstanceGroupStatusScalingConst = "scaling" - InstanceGroupStatusUnhealthyConst = "unhealthy" -) - -// UnmarshalInstanceGroup unmarshals an instance of InstanceGroup from the specified map of raw messages. -func UnmarshalInstanceGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroup) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManagerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupCollection : InstanceGroupCollection struct -type InstanceGroupCollection struct { - // A link to the first page of resources. - First *InstanceGroupCollectionFirst `json:"first" validate:"required"` - - // Collection of instance groups. - InstanceGroups []InstanceGroup `json:"instance_groups" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceGroupCollection unmarshals an instance of InstanceGroupCollection from the specified map of raw messages. -func UnmarshalInstanceGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_groups", &obj.InstanceGroups, UnmarshalInstanceGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceGroupCollectionFirst : A link to the first page of resources. -type InstanceGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupCollectionFirst unmarshals an instance of InstanceGroupCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupCollectionNext unmarshals an instance of InstanceGroupCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManager : InstanceGroupManager struct -// Models which "extend" this model: -// - InstanceGroupManagerAutoScale -// - InstanceGroupManagerScheduled -type InstanceGroupManager struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The policies of the instance group manager. - Policies []InstanceGroupManagerPolicyReference `json:"policies,omitempty"` - - // The actions of the instance group manager. - Actions []InstanceGroupManagerActionReference `json:"actions,omitempty"` -} - -// Constants associated with the InstanceGroupManager.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerManagerTypeAutoscaleConst = "autoscale" -) - -func (*InstanceGroupManager) isaInstanceGroupManager() bool { - return true -} - -type InstanceGroupManagerIntf interface { - isaInstanceGroupManager() bool -} - -// UnmarshalInstanceGroupManager unmarshals an instance of InstanceGroupManager from the specified map of raw messages. -func UnmarshalInstanceGroupManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManager) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerAction : InstanceGroupManagerAction struct -// Models which "extend" this model: -// - InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerAction struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` - - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of action for the instance group. - ActionType *string `json:"action_type,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` - - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` -} - -// Constants associated with the InstanceGroupManagerAction.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// Constants associated with the InstanceGroupManagerAction.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionStatusActiveConst = "active" - InstanceGroupManagerActionStatusCompletedConst = "completed" - InstanceGroupManagerActionStatusFailedConst = "failed" - InstanceGroupManagerActionStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionStatusOmittedConst = "omitted" -) - -// Constants associated with the InstanceGroupManagerAction.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionActionTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerAction) isaInstanceGroupManagerAction() bool { - return true -} - -type InstanceGroupManagerActionIntf interface { - isaInstanceGroupManagerAction() bool -} - -// UnmarshalInstanceGroupManagerAction unmarshals an instance of InstanceGroupManagerAction from the specified map of raw messages. -func UnmarshalInstanceGroupManagerAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerAction) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionGroupPatch : InstanceGroupManagerActionGroupPatch struct -type InstanceGroupManagerActionGroupPatch struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count,omitempty"` -} - -// UnmarshalInstanceGroupManagerActionGroupPatch unmarshals an instance of InstanceGroupManagerActionGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionGroupPatch) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionManagerPatch : InstanceGroupManagerActionManagerPatch struct -type InstanceGroupManagerActionManagerPatch struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} - -// UnmarshalInstanceGroupManagerActionManagerPatch unmarshals an instance of InstanceGroupManagerActionManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionManagerPatch) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPatch : InstanceGroupManagerActionPatch struct -type InstanceGroupManagerActionPatch struct { - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerActionGroupPatch `json:"group,omitempty"` - - Manager *InstanceGroupManagerActionManagerPatch `json:"manager,omitempty"` - - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` -} - -// UnmarshalInstanceGroupManagerActionPatch unmarshals an instance of InstanceGroupManagerActionPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPatch) - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerActionGroupPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerActionManagerPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceGroupManagerActionPatch -func (instanceGroupManagerActionPatch *InstanceGroupManagerActionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerActionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceGroupManagerActionPrototype : InstanceGroupManagerActionPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototype struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` -} - -func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -type InstanceGroupManagerActionPrototypeIntf interface { - isaInstanceGroupManagerActionPrototype() bool -} - -// UnmarshalInstanceGroupManagerActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionReference : InstanceGroupManagerActionReference struct -type InstanceGroupManagerActionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerActionReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerActionReference.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionReferenceResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// UnmarshalInstanceGroupManagerActionReference unmarshals an instance of InstanceGroupManagerActionReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerActionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerActionReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceGroupManagerActionReferenceDeleted unmarshals an instance of InstanceGroupManagerActionReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionsCollection : InstanceGroupManagerActionsCollection struct -type InstanceGroupManagerActionsCollection struct { - // Collection of instance group manager actions. - Actions []InstanceGroupManagerActionIntf `json:"actions" validate:"required"` - - // A link to the first page of resources. - First *InstanceGroupManagerActionsCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerActionsCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceGroupManagerActionsCollection unmarshals an instance of InstanceGroupManagerActionsCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollection) - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerActionsCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerActionsCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerActionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceGroupManagerActionsCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerActionsCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerActionsCollectionFirst unmarshals an instance of InstanceGroupManagerActionsCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionsCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerActionsCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerActionsCollectionNext unmarshals an instance of InstanceGroupManagerActionsCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerCollection : InstanceGroupManagerCollection struct -type InstanceGroupManagerCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of instance group managers. - Managers []InstanceGroupManagerIntf `json:"managers" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceGroupManagerCollection unmarshals an instance of InstanceGroupManagerCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManager) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceGroupManagerCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerCollectionFirst unmarshals an instance of InstanceGroupManagerCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerCollectionNext unmarshals an instance of InstanceGroupManagerCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPatch : InstanceGroupManagerPatch struct -type InstanceGroupManagerPatch struct { - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` - - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceGroupManagerPatch unmarshals an instance of InstanceGroupManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPatch) - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceGroupManagerPatch -func (instanceGroupManagerPatch *InstanceGroupManagerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceGroupManagerPolicy : InstanceGroupManagerPolicy struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy -type InstanceGroupManagerPolicy struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager policy was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` -} - -// Constants associated with the InstanceGroupManagerPolicy.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicy.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPolicyTypeTargetConst = "target" -) - -func (*InstanceGroupManagerPolicy) isaInstanceGroupManagerPolicy() bool { - return true -} - -type InstanceGroupManagerPolicyIntf interface { - isaInstanceGroupManagerPolicy() bool -} - -// UnmarshalInstanceGroupManagerPolicy unmarshals an instance of InstanceGroupManagerPolicy from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyCollection : InstanceGroupManagerPolicyCollection struct -type InstanceGroupManagerPolicyCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerPolicyCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerPolicyCollectionNext `json:"next,omitempty"` - - // Collection of instance group manager policies. - Policies []InstanceGroupManagerPolicyIntf `json:"policies" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceGroupManagerPolicyCollection unmarshals an instance of InstanceGroupManagerPolicyCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceGroupManagerPolicyCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerPolicyCollectionFirst unmarshals an instance of InstanceGroupManagerPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupManagerPolicyCollectionNext unmarshals an instance of InstanceGroupManagerPolicyCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyPatch : InstanceGroupManagerPolicyPatch struct -type InstanceGroupManagerPolicyPatch struct { - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` - - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the InstanceGroupManagerPolicyPatch.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPatchMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPatchMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPatchMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPatchMetricTypeNetworkOutConst = "network_out" -) - -// UnmarshalInstanceGroupManagerPolicyPatch unmarshals an instance of InstanceGroupManagerPolicyPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPatch) - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceGroupManagerPolicyPatch -func (instanceGroupManagerPolicyPatch *InstanceGroupManagerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceGroupManagerPolicyPrototype : InstanceGroupManagerPolicyPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype -type InstanceGroupManagerPolicyPrototype struct { - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` -} - -// Constants associated with the InstanceGroupManagerPolicyPrototype.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPrototypeMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPrototypeMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicyPrototype.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPrototypePolicyTypeTargetConst = "target" -) - -func (*InstanceGroupManagerPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { - return true -} - -type InstanceGroupManagerPolicyPrototypeIntf interface { - isaInstanceGroupManagerPolicyPrototype() bool -} - -// UnmarshalInstanceGroupManagerPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyReference : InstanceGroupManagerPolicyReference struct -type InstanceGroupManagerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerPolicyReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceGroupManagerPolicyReference unmarshals an instance of InstanceGroupManagerPolicyReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceGroupManagerPolicyReferenceDeleted unmarshals an instance of InstanceGroupManagerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPrototype : InstanceGroupManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype -// - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype -type InstanceGroupManagerPrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} - -// Constants associated with the InstanceGroupManagerPrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeManagerTypeAutoscaleConst = "autoscale" -) - -func (*InstanceGroupManagerPrototype) isaInstanceGroupManagerPrototype() bool { - return true -} - -type InstanceGroupManagerPrototypeIntf interface { - isaInstanceGroupManagerPrototype() bool -} - -// UnmarshalInstanceGroupManagerPrototype unmarshals an instance of InstanceGroupManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerReference : InstanceGroupManagerReference struct -type InstanceGroupManagerReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceGroupManagerReference unmarshals an instance of InstanceGroupManagerReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupManagerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceGroupManagerReferenceDeleted unmarshals an instance of InstanceGroupManagerReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionGroup : InstanceGroupManagerScheduledActionGroup struct -type InstanceGroupManagerScheduledActionGroup struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` -} - -// UnmarshalInstanceGroupManagerScheduledActionGroup unmarshals an instance of InstanceGroupManagerScheduledActionGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroup) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionGroupPrototype : InstanceGroupManagerScheduledActionGroupPrototype struct -type InstanceGroupManagerScheduledActionGroupPrototype struct { - // The desired number of instance group members at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` -} - -// NewInstanceGroupManagerScheduledActionGroupPrototype : Instantiate InstanceGroupManagerScheduledActionGroupPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount int64) (_model *InstanceGroupManagerScheduledActionGroupPrototype, err error) { - _model = &InstanceGroupManagerScheduledActionGroupPrototype{ - MembershipCount: core.Int64Ptr(membershipCount), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalInstanceGroupManagerScheduledActionGroupPrototype unmarshals an instance of InstanceGroupManagerScheduledActionGroupPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroupPrototype) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManager : InstanceGroupManagerScheduledActionManager struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerAutoScale -type InstanceGroupManagerScheduledActionManager struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` - - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name,omitempty"` - - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} - -func (*InstanceGroupManagerScheduledActionManager) isaInstanceGroupManagerScheduledActionManager() bool { - return true -} - -type InstanceGroupManagerScheduledActionManagerIntf interface { - isaInstanceGroupManagerScheduledActionManager() bool -} - -// UnmarshalInstanceGroupManagerScheduledActionManager unmarshals an instance of InstanceGroupManagerScheduledActionManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManager) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototype : InstanceGroupManagerScheduledActionManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototype struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` -} - -func (*InstanceGroupManagerScheduledActionManagerPrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -type InstanceGroupManagerScheduledActionManagerPrototypeIntf interface { - isaInstanceGroupManagerScheduledActionManagerPrototype() bool -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototype) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupMembership : InstanceGroupMembership struct -type InstanceGroupMembership struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If set to true, when deleting the membership the instance will also be deleted. - DeleteInstanceOnMembershipDelete *bool `json:"delete_instance_on_membership_delete" validate:"required"` - - // The URL for this instance group membership. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group membership. - ID *string `json:"id" validate:"required"` - - Instance *InstanceReference `json:"instance" validate:"required"` - - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` - - // The name for this instance group membership. The name is unique across all memberships for the instance group. - Name *string `json:"name" validate:"required"` - - PoolMember *LoadBalancerPoolMemberReference `json:"pool_member,omitempty"` - - // The status of the instance group membership - // - `deleting`: Membership is deleting dependent resources - // - `failed`: Membership was unable to maintain dependent resources - // - `healthy`: Membership is active and serving in the group - // - `pending`: Membership is waiting for dependent resources - // - `unhealthy`: Membership has unhealthy dependent resources. - Status *string `json:"status" validate:"required"` - - // The date and time that the instance group membership was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` -} - -// Constants associated with the InstanceGroupMembership.Status property. -// The status of the instance group membership -// - `deleting`: Membership is deleting dependent resources -// - `failed`: Membership was unable to maintain dependent resources -// - `healthy`: Membership is active and serving in the group -// - `pending`: Membership is waiting for dependent resources -// - `unhealthy`: Membership has unhealthy dependent resources. -const ( - InstanceGroupMembershipStatusDeletingConst = "deleting" - InstanceGroupMembershipStatusFailedConst = "failed" - InstanceGroupMembershipStatusHealthyConst = "healthy" - InstanceGroupMembershipStatusPendingConst = "pending" - InstanceGroupMembershipStatusUnhealthyConst = "unhealthy" -) - -// UnmarshalInstanceGroupMembership unmarshals an instance of InstanceGroupMembership from the specified map of raw messages. -func UnmarshalInstanceGroupMembership(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembership) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_instance_on_membership_delete", &obj.DeleteInstanceOnMembershipDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool_member", &obj.PoolMember, UnmarshalLoadBalancerPoolMemberReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupMembershipCollection : InstanceGroupMembershipCollection struct -type InstanceGroupMembershipCollection struct { - // A link to the first page of resources. - First *InstanceGroupMembershipCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of instance group memberships. - Memberships []InstanceGroupMembership `json:"memberships" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupMembershipCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceGroupMembershipCollection unmarshals an instance of InstanceGroupMembershipCollection from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupMembershipCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memberships", &obj.Memberships, UnmarshalInstanceGroupMembership) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupMembershipCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupMembershipCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// InstanceGroupMembershipCollectionFirst : A link to the first page of resources. -type InstanceGroupMembershipCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupMembershipCollectionFirst unmarshals an instance of InstanceGroupMembershipCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupMembershipCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupMembershipCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceGroupMembershipCollectionNext unmarshals an instance of InstanceGroupMembershipCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupMembershipPatch : InstanceGroupMembershipPatch struct -type InstanceGroupMembershipPatch struct { - // The name for this instance group membership. The name must not be used by another membership for the instance group - // manager. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceGroupMembershipPatch unmarshals an instance of InstanceGroupMembershipPatch from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceGroupMembershipPatch -func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupMembershipPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. -type InstanceGroupPatch struct { - // The port to use for new load balancer pool members created by this instance group. - // - // This property must be set if and only if `load_balancer_pool` has been set. - ApplicationPort *int64 `json:"application_port,omitempty"` - - // Instance template to use when creating new instances. - // - // Instance groups are not compatible with instance templates that specify `true` for - // `default_trusted_profile.auto_link`. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template,omitempty"` - - // The load balancer associated with `load_balancer_pool`. - // The load balancer must have `instance_groups_supported` set to `true`. - // - // This property must be set if and only if `load_balancer_pool` has been set. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` - - // If specified, this instance group will manage the load balancer pool. A pool member - // will be created for each instance created by this group. The specified load - // balancer pool must not be used by another instance group in the VPC. - // - // If set, `load_balancer` and `application_port` must also be set. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` - - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` - - // The name for this instance group. The name must not be used by another instance group in the region. - Name *string `json:"name,omitempty"` - - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` -} - -// UnmarshalInstanceGroupPatch unmarshals an instance of InstanceGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupPatch) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer", &obj.LoadBalancer, UnmarshalLoadBalancerIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceGroupPatch -func (instanceGroupPatch *InstanceGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceGroupReference : InstanceGroupReference struct -type InstanceGroupReference struct { - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` - - // The name for this instance group. The name is unique across all instance groups in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceGroupReference unmarshals an instance of InstanceGroupReference from the specified map of raw messages. -func UnmarshalInstanceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceGroupReferenceDeleted unmarshals an instance of InstanceGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceHealthReason : InstanceHealthReason struct -type InstanceHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the InstanceHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - InstanceHealthReasonCodeReservationCapacityUnavailableConst = "reservation_capacity_unavailable" - InstanceHealthReasonCodeReservationDeletedConst = "reservation_deleted" - InstanceHealthReasonCodeReservationExpiredConst = "reservation_expired" - InstanceHealthReasonCodeReservationFailedConst = "reservation_failed" -) - -// UnmarshalInstanceHealthReason unmarshals an instance of InstanceHealthReason from the specified map of raw messages. -func UnmarshalInstanceHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceInitialization : InstanceInitialization struct -type InstanceInitialization struct { - // The default trusted profile configuration specified at virtual server instance - // creation. If absent, no default trusted profile was specified. - DefaultTrustedProfile *InstanceInitializationDefaultTrustedProfile `json:"default_trusted_profile,omitempty"` - - // The public SSH keys used at instance initialization. - Keys []KeyReference `json:"keys" validate:"required"` - - Password *InstanceInitializationPassword `json:"password,omitempty"` -} - -// UnmarshalInstanceInitialization unmarshals an instance of InstanceInitialization from the specified map of raw messages. -func UnmarshalInstanceInitialization(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitialization) - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceInitializationDefaultTrustedProfile) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "password", &obj.Password, UnmarshalInstanceInitializationPassword) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceInitializationDefaultTrustedProfile : InstanceInitializationDefaultTrustedProfile struct -type InstanceInitializationDefaultTrustedProfile struct { - // If set to `true`, the system created a link to the specified `target` trusted profile during instance creation. - // Regardless of whether a link was created by the system or manually using the IAM Identity service, it will be - // automatically deleted when the instance is deleted. - AutoLink *bool `json:"auto_link" validate:"required"` - - // The default IAM trusted profile to use for this virtual server instance. - Target *TrustedProfileReference `json:"target" validate:"required"` -} - -// UnmarshalInstanceInitializationDefaultTrustedProfile unmarshals an instance of InstanceInitializationDefaultTrustedProfile from the specified map of raw messages. -func UnmarshalInstanceInitializationDefaultTrustedProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitializationDefaultTrustedProfile) - err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceInitializationPassword : InstanceInitializationPassword struct -type InstanceInitializationPassword struct { - // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` - - // The public SSH key used to encrypt the administrator password. - EncryptionKey *KeyIdentityByFingerprint `json:"encryption_key" validate:"required"` -} - -// UnmarshalInstanceInitializationPassword unmarshals an instance of InstanceInitializationPassword from the specified map of raw messages. -func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitializationPassword) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyIdentityByFingerprint) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceLifecycleReason : InstanceLifecycleReason struct -type InstanceLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the InstanceLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - InstanceLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalInstanceLifecycleReason unmarshals an instance of InstanceLifecycleReason from the specified map of raw messages. -func UnmarshalInstanceLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceMetadataService : The metadata service configuration. -type InstanceMetadataService struct { - // Indicates whether the metadata service endpoint is available to the virtual server instance. - Enabled *bool `json:"enabled" validate:"required"` - - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol" validate:"required"` - - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit" validate:"required"` -} - -// Constants associated with the InstanceMetadataService.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServiceProtocolHTTPConst = "http" - InstanceMetadataServiceProtocolHTTPSConst = "https" -) - -// UnmarshalInstanceMetadataService unmarshals an instance of InstanceMetadataService from the specified map of raw messages. -func UnmarshalInstanceMetadataService(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataService) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceMetadataServicePatch : The metadata service configuration. -type InstanceMetadataServicePatch struct { - // Indicates whether the metadata service endpoint will be available to the virtual server instance. - Enabled *bool `json:"enabled,omitempty"` - - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol,omitempty"` - - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` -} - -// Constants associated with the InstanceMetadataServicePatch.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServicePatchProtocolHTTPConst = "http" - InstanceMetadataServicePatchProtocolHTTPSConst = "https" -) - -// UnmarshalInstanceMetadataServicePatch unmarshals an instance of InstanceMetadataServicePatch from the specified map of raw messages. -func UnmarshalInstanceMetadataServicePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataServicePatch) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceMetadataServicePrototype : The metadata service configuration. -type InstanceMetadataServicePrototype struct { - // Indicates whether the metadata service endpoint will be available to the virtual server instance. - Enabled *bool `json:"enabled,omitempty"` - - // The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is - // enabled. - // - `http`: HTTP protocol (unencrypted) - // - `https`: HTTP Secure protocol. - Protocol *string `json:"protocol,omitempty"` - - // The hop limit (IP time to live) for IP response packets from the metadata service. Applies only when the metadata - // service is enabled. - ResponseHopLimit *int64 `json:"response_hop_limit,omitempty"` -} - -// Constants associated with the InstanceMetadataServicePrototype.Protocol property. -// The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is -// enabled. -// - `http`: HTTP protocol (unencrypted) -// - `https`: HTTP Secure protocol. -const ( - InstanceMetadataServicePrototypeProtocolHTTPConst = "http" - InstanceMetadataServicePrototypeProtocolHTTPSConst = "https" -) - -// UnmarshalInstanceMetadataServicePrototype unmarshals an instance of InstanceMetadataServicePrototype from the specified map of raw messages. -func UnmarshalInstanceMetadataServicePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceMetadataServicePrototype) - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "response_hop_limit", &obj.ResponseHopLimit) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachment : InstanceNetworkAttachment struct -type InstanceNetworkAttachment struct { - // The date and time that the instance network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network attachment. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the instance network attachment. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this instance network attachment. The name is unique across all network attachments for the instance. - Name *string `json:"name" validate:"required"` - - // The port speed for this instance network attachment in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The instance network attachment type. - Type *string `json:"type" validate:"required"` - - // The virtual network interface for this instance network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` -} - -// Constants associated with the InstanceNetworkAttachment.LifecycleState property. -// The lifecycle state of the instance network attachment. -const ( - InstanceNetworkAttachmentLifecycleStateDeletingConst = "deleting" - InstanceNetworkAttachmentLifecycleStateFailedConst = "failed" - InstanceNetworkAttachmentLifecycleStatePendingConst = "pending" - InstanceNetworkAttachmentLifecycleStateStableConst = "stable" - InstanceNetworkAttachmentLifecycleStateSuspendedConst = "suspended" - InstanceNetworkAttachmentLifecycleStateUpdatingConst = "updating" - InstanceNetworkAttachmentLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the InstanceNetworkAttachment.ResourceType property. -// The resource type. -const ( - InstanceNetworkAttachmentResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" -) - -// Constants associated with the InstanceNetworkAttachment.Type property. -// The instance network attachment type. -const ( - InstanceNetworkAttachmentTypePrimaryConst = "primary" - InstanceNetworkAttachmentTypeSecondaryConst = "secondary" -) - -// UnmarshalInstanceNetworkAttachment unmarshals an instance of InstanceNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachment) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentCollection : InstanceNetworkAttachmentCollection struct -type InstanceNetworkAttachmentCollection struct { - // Collection of instance network attachments. - NetworkAttachments []InstanceNetworkAttachment `json:"network_attachments" validate:"required"` -} - -// UnmarshalInstanceNetworkAttachmentCollection unmarshals an instance of InstanceNetworkAttachmentCollection from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentCollection) - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachment) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPatch : InstanceNetworkAttachmentPatch struct -type InstanceNetworkAttachmentPatch struct { - // The name for this network attachment. The name must not be used by another network attachment for the instance. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceNetworkAttachmentPatch unmarshals an instance of InstanceNetworkAttachmentPatch from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceNetworkAttachmentPatch -func (instanceNetworkAttachmentPatch *InstanceNetworkAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceNetworkAttachmentPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceNetworkAttachmentPrototype : InstanceNetworkAttachmentPrototype struct -type InstanceNetworkAttachmentPrototype struct { - // The name for this network attachment. Names must be unique within the instance the network attachment resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // A virtual network interface for the instance network attachment. This can be specified - // using an existing virtual network interface, or a prototype object for a new virtual - // network interface. - // - // If an existing virtual network interface is specified, `enable_infrastructure_nat` must be - // `true`. - VirtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` -} - -// NewInstanceNetworkAttachmentPrototype : Instantiate InstanceNetworkAttachmentPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceNetworkAttachmentPrototype(virtualNetworkInterface InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) (_model *InstanceNetworkAttachmentPrototype, err error) { - _model = &InstanceNetworkAttachmentPrototype{ - VirtualNetworkInterface: virtualNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalInstanceNetworkAttachmentPrototype unmarshals an instance of InstanceNetworkAttachmentPrototype from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterface : A virtual network interface for the instance network attachment. This can be specified using an existing virtual -// network interface, or a prototype object for a new virtual network interface. -// -// If an existing virtual network interface is specified, `enable_infrastructure_nat` must be -// `true`. -// Models which "extend" this model: -// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext -// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // virtual server instance's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterface) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf interface { - isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentReference : InstanceNetworkAttachmentReference struct -type InstanceNetworkAttachmentReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network attachment. The name is unique across all network attachments for the instance. - Name *string `json:"name" validate:"required"` - - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the InstanceNetworkAttachmentReference.ResourceType property. -// The resource type. -const ( - InstanceNetworkAttachmentReferenceResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" -) - -// UnmarshalInstanceNetworkAttachmentReference unmarshals an instance of InstanceNetworkAttachmentReference from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceNetworkAttachmentReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceNetworkAttachmentReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceNetworkAttachmentReferenceDeleted unmarshals an instance of InstanceNetworkAttachmentReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePatch : InstancePatch struct -type InstancePatch struct { - // The availability policy for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPatch `json:"availability_policy,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePatch `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. Changing the name will not affect the system hostname. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. For the placement - // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. - // - // If set, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` - - // The profile to use for this virtual server instance. For the profile to be changed, - // the instance `status` must be `stopping` or `stopped`. In addition, the requested - // profile must: - // - Have matching instance disk support. Any disks associated with the current profile - // will be deleted, and any disks associated with the requested profile will be - // created. - // - Be compatible with any `placement_target` constraints. For example, if the - // instance is placed on a dedicated host, the requested profile `family` must be - // the same as the dedicated host `family`. - // - Have the same `vcpu.architecture`. - // - Support the number of network attachments or network interfaces the instance - // currently has. - Profile InstancePatchProfileIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -} - -// UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. -func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatch) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstancePatchProfile) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstancePatch -func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instancePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstancePatchProfile : The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be -// `stopping` or `stopped`. In addition, the requested profile must: -// - Have matching instance disk support. Any disks associated with the current profile -// will be deleted, and any disks associated with the requested profile will be -// created. -// - Be compatible with any `placement_target` constraints. For example, if the -// instance is placed on a dedicated host, the requested profile `family` must be -// the same as the dedicated host `family`. -// - Have the same `vcpu.architecture`. -// - Support the number of network attachments or network interfaces the instance -// currently has. -// -// Models which "extend" this model: -// - InstancePatchProfileInstanceProfileIdentityByName -// - InstancePatchProfileInstanceProfileIdentityByHref -type InstancePatchProfile struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` -} - -func (*InstancePatchProfile) isaInstancePatchProfile() bool { - return true -} - -type InstancePatchProfileIntf interface { - isaInstancePatchProfile() bool -} - -// UnmarshalInstancePatchProfile unmarshals an instance of InstancePatchProfile from the specified map of raw messages. -func UnmarshalInstancePatchProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfile) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTarget : InstancePlacementTarget struct -// Models which "extend" this model: -// - InstancePlacementTargetDedicatedHostGroupReference -// - InstancePlacementTargetDedicatedHostReference -// - InstancePlacementTargetPlacementGroupReference -type InstancePlacementTarget struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the InstancePlacementTarget.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -func (*InstancePlacementTarget) isaInstancePlacementTarget() bool { - return true -} - -type InstancePlacementTargetIntf interface { - isaInstancePlacementTarget() bool -} - -// UnmarshalInstancePlacementTarget unmarshals an instance of InstancePlacementTarget from the specified map of raw messages. -func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatch : InstancePlacementTargetPatch struct -// Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostIdentity -// - InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatch struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPatch) isaInstancePlacementTargetPatch() bool { - return true -} - -type InstancePlacementTargetPatchIntf interface { - isaInstancePlacementTargetPatch() bool -} - -// UnmarshalInstancePlacementTargetPatch unmarshals an instance of InstancePlacementTargetPatch from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototype : InstancePlacementTargetPrototype struct -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostIdentity -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -// - InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototype struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPrototype) isaInstancePlacementTargetPrototype() bool { - return true -} - -type InstancePlacementTargetPrototypeIntf interface { - isaInstancePlacementTargetPrototype() bool -} - -// UnmarshalInstancePlacementTargetPrototype unmarshals an instance of InstancePlacementTargetPrototype from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfile : InstanceProfile struct -type InstanceProfile struct { - Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` - - // Collection of the instance profile's disks. - Disks []InstanceProfileDisk `json:"disks" validate:"required"` - - // The product family this virtual server instance profile belongs to. - Family *string `json:"family" validate:"required"` - - GpuCount InstanceProfileGpuIntf `json:"gpu_count,omitempty"` - - GpuManufacturer *InstanceProfileGpuManufacturer `json:"gpu_manufacturer,omitempty"` - - GpuMemory InstanceProfileGpuMemoryIntf `json:"gpu_memory,omitempty"` - - GpuModel *InstanceProfileGpuModel `json:"gpu_model,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` - - Memory InstanceProfileMemoryIntf `json:"memory" validate:"required"` - - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` - - NetworkAttachmentCount InstanceProfileNetworkAttachmentCountIntf `json:"network_attachment_count" validate:"required"` - - NetworkInterfaceCount InstanceProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` - - NumaCount InstanceProfileNumaCountIntf `json:"numa_count,omitempty"` - - OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` - - PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` - - ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the instance profile: - // - `previous`: This instance profile is an older revision, but remains provisionable and - // usable. - // - `current`: This profile is the latest revision. - // - // Note that revisions are indicated by the generation of an instance profile. Refer to the - // [profile naming conventions] - // (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how - // generations are defined within an instance profile. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` - - VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` - - VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` - - VcpuManufacturer *InstanceProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` -} - -// Constants associated with the InstanceProfile.ResourceType property. -// The resource type. -const ( - InstanceProfileResourceTypeInstanceProfileConst = "instance_profile" -) - -// Constants associated with the InstanceProfile.Status property. -// The status of the instance profile: -// - `previous`: This instance profile is an older revision, but remains provisionable and -// usable. -// - `current`: This profile is the latest revision. -// -// Note that revisions are indicated by the generation of an instance profile. Refer to the -// [profile naming conventions] -// (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule) for information on how -// generations are defined within an instance profile. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the profile on which the -// unexpected property value was encountered. -const ( - InstanceProfileStatusCurrentConst = "current" - InstanceProfileStatusPreviousConst = "previous" -) - -// UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. -func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfile) - err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceProfileDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_count", &obj.GpuCount, UnmarshalInstanceProfileGpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_manufacturer", &obj.GpuManufacturer, UnmarshalInstanceProfileGpuManufacturer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_memory", &obj.GpuMemory, UnmarshalInstanceProfileGpuMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_model", &obj.GpuModel, UnmarshalInstanceProfileGpuModel) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalInstanceProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachment_count", &obj.NetworkAttachmentCount, UnmarshalInstanceProfileNetworkAttachmentCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalInstanceProfileNetworkInterfaceCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "numa_count", &obj.NumaCount, UnmarshalInstanceProfileNumaCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "port_speed", &obj.PortSpeed, UnmarshalInstanceProfilePortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_terms", &obj.ReservationTerms, UnmarshalInstanceProfileReservationTerms) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalInstanceProfileVcpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_manufacturer", &obj.VcpuManufacturer, UnmarshalInstanceProfileVcpuManufacturer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileBandwidth : InstanceProfileBandwidth struct -// Models which "extend" this model: -// - InstanceProfileBandwidthFixed -// - InstanceProfileBandwidthRange -// - InstanceProfileBandwidthEnum -// - InstanceProfileBandwidthDependent -type InstanceProfileBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthTypeFixedConst = "fixed" -) - -func (*InstanceProfileBandwidth) isaInstanceProfileBandwidth() bool { - return true -} - -type InstanceProfileBandwidthIntf interface { - isaInstanceProfileBandwidth() bool -} - -// UnmarshalInstanceProfileBandwidth unmarshals an instance of InstanceProfileBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileCollection : InstanceProfileCollection struct -type InstanceProfileCollection struct { - // Collection of virtual server instance profiles. - Profiles []InstanceProfile `json:"profiles" validate:"required"` -} - -// UnmarshalInstanceProfileCollection unmarshals an instance of InstanceProfileCollection from the specified map of raw messages. -func UnmarshalInstanceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileCollection) - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDisk : Disks provided by this profile. -type InstanceProfileDisk struct { - Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` - - Size InstanceProfileDiskSizeIntf `json:"size" validate:"required"` - - SupportedInterfaceTypes *InstanceProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` -} - -// UnmarshalInstanceProfileDisk unmarshals an instance of InstanceProfileDisk from the specified map of raw messages. -func UnmarshalInstanceProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDisk) - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalInstanceProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalInstanceProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalInstanceProfileDiskSupportedInterfaces) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskQuantity : InstanceProfileDiskQuantity struct -// Models which "extend" this model: -// - InstanceProfileDiskQuantityFixed -// - InstanceProfileDiskQuantityRange -// - InstanceProfileDiskQuantityEnum -// - InstanceProfileDiskQuantityDependent -type InstanceProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileDiskQuantity.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskQuantityTypeFixedConst = "fixed" -) - -func (*InstanceProfileDiskQuantity) isaInstanceProfileDiskQuantity() bool { - return true -} - -type InstanceProfileDiskQuantityIntf interface { - isaInstanceProfileDiskQuantity() bool -} - -// UnmarshalInstanceProfileDiskQuantity unmarshals an instance of InstanceProfileDiskQuantity from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSize : InstanceProfileDiskSize struct -// Models which "extend" this model: -// - InstanceProfileDiskSizeFixed -// - InstanceProfileDiskSizeRange -// - InstanceProfileDiskSizeEnum -// - InstanceProfileDiskSizeDependent -type InstanceProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileDiskSize.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeTypeFixedConst = "fixed" -) - -func (*InstanceProfileDiskSize) isaInstanceProfileDiskSize() bool { - return true -} - -type InstanceProfileDiskSizeIntf interface { - isaInstanceProfileDiskSize() bool -} - -// UnmarshalInstanceProfileDiskSize unmarshals an instance of InstanceProfileDiskSize from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSupportedInterfaces : InstanceProfileDiskSupportedInterfaces struct -type InstanceProfileDiskSupportedInterfaces struct { - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported disk interfaces used for attaching the disk. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Default property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesDefaultVirtioBlkConst = "virtio_blk" -) - -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSupportedInterfacesTypeEnumConst = "enum" -) - -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Values property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesValuesVirtioBlkConst = "virtio_blk" -) - -// UnmarshalInstanceProfileDiskSupportedInterfaces unmarshals an instance of InstanceProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpu : InstanceProfileGpu struct -// Models which "extend" this model: -// - InstanceProfileGpuFixed -// - InstanceProfileGpuRange -// - InstanceProfileGpuEnum -// - InstanceProfileGpuDependent -type InstanceProfileGpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileGpu.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuTypeFixedConst = "fixed" -) - -func (*InstanceProfileGpu) isaInstanceProfileGpu() bool { - return true -} - -type InstanceProfileGpuIntf interface { - isaInstanceProfileGpu() bool -} - -// UnmarshalInstanceProfileGpu unmarshals an instance of InstanceProfileGpu from the specified map of raw messages. -func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuManufacturer : InstanceProfileGpuManufacturer struct -type InstanceProfileGpuManufacturer struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The possible GPU manufacturer(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuManufacturer.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuManufacturerTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileGpuManufacturer unmarshals an instance of InstanceProfileGpuManufacturer from the specified map of raw messages. -func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuManufacturer) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemory : InstanceProfileGpuMemory struct -// Models which "extend" this model: -// - InstanceProfileGpuMemoryFixed -// - InstanceProfileGpuMemoryRange -// - InstanceProfileGpuMemoryEnum -// - InstanceProfileGpuMemoryDependent -type InstanceProfileGpuMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileGpuMemory.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryTypeFixedConst = "fixed" -) - -func (*InstanceProfileGpuMemory) isaInstanceProfileGpuMemory() bool { - return true -} - -type InstanceProfileGpuMemoryIntf interface { - isaInstanceProfileGpuMemory() bool -} - -// UnmarshalInstanceProfileGpuMemory unmarshals an instance of InstanceProfileGpuMemory from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuModel : InstanceProfileGpuModel struct -type InstanceProfileGpuModel struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The possible GPU model(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuModel.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuModelTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileGpuModel unmarshals an instance of InstanceProfileGpuModel from the specified map of raw messages. -func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuModel) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileIdentity : Identifies an instance profile by a unique property. -// Models which "extend" this model: -// - InstanceProfileIdentityByName -// - InstanceProfileIdentityByHref -type InstanceProfileIdentity struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` -} - -func (*InstanceProfileIdentity) isaInstanceProfileIdentity() bool { - return true -} - -type InstanceProfileIdentityIntf interface { - isaInstanceProfileIdentity() bool -} - -// UnmarshalInstanceProfileIdentity unmarshals an instance of InstanceProfileIdentity from the specified map of raw messages. -func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemory : InstanceProfileMemory struct -// Models which "extend" this model: -// - InstanceProfileMemoryFixed -// - InstanceProfileMemoryRange -// - InstanceProfileMemoryEnum -// - InstanceProfileMemoryDependent -type InstanceProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileMemory.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryTypeFixedConst = "fixed" -) - -func (*InstanceProfileMemory) isaInstanceProfileMemory() bool { - return true -} - -type InstanceProfileMemoryIntf interface { - isaInstanceProfileMemory() bool -} - -// UnmarshalInstanceProfileMemory unmarshals an instance of InstanceProfileMemory from the specified map of raw messages. -func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNumaCount : InstanceProfileNumaCount struct -// Models which "extend" this model: -// - InstanceProfileNumaCountFixed -// - InstanceProfileNumaCountDependent -type InstanceProfileNumaCount struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` -} - -// Constants associated with the InstanceProfileNumaCount.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountTypeFixedConst = "fixed" -) - -func (*InstanceProfileNumaCount) isaInstanceProfileNumaCount() bool { - return true -} - -type InstanceProfileNumaCountIntf interface { - isaInstanceProfileNumaCount() bool -} - -// UnmarshalInstanceProfileNumaCount unmarshals an instance of InstanceProfileNumaCount from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCount) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkAttachmentCount : InstanceProfileNetworkAttachmentCount struct -// Models which "extend" this model: -// - InstanceProfileNetworkAttachmentCountRange -// - InstanceProfileNetworkAttachmentCountDependent -type InstanceProfileNetworkAttachmentCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the InstanceProfileNetworkAttachmentCount.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkAttachmentCountTypeRangeConst = "range" -) - -func (*InstanceProfileNetworkAttachmentCount) isaInstanceProfileNetworkAttachmentCount() bool { - return true -} - -type InstanceProfileNetworkAttachmentCountIntf interface { - isaInstanceProfileNetworkAttachmentCount() bool -} - -// UnmarshalInstanceProfileNetworkAttachmentCount unmarshals an instance of InstanceProfileNetworkAttachmentCount from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkAttachmentCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkAttachmentCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkInterfaceCount : InstanceProfileNetworkInterfaceCount struct -// Models which "extend" this model: -// - InstanceProfileNetworkInterfaceCountRange -// - InstanceProfileNetworkInterfaceCountDependent -type InstanceProfileNetworkInterfaceCount struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the InstanceProfileNetworkInterfaceCount.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkInterfaceCountTypeRangeConst = "range" -) - -func (*InstanceProfileNetworkInterfaceCount) isaInstanceProfileNetworkInterfaceCount() bool { - return true -} - -type InstanceProfileNetworkInterfaceCountIntf interface { - isaInstanceProfileNetworkInterfaceCount() bool -} - -// UnmarshalInstanceProfileNetworkInterfaceCount unmarshals an instance of InstanceProfileNetworkInterfaceCount from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCount) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileOsArchitecture : InstanceProfileOsArchitecture struct -type InstanceProfileOsArchitecture struct { - // The default OS architecture for an instance with this profile. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported OS architecture(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileOsArchitecture.Type property. -// The type for this profile field. -const ( - InstanceProfileOsArchitectureTypeEnumConst = "enum" -) - -// UnmarshalInstanceProfileOsArchitecture unmarshals an instance of InstanceProfileOsArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileOsArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfilePortSpeed : InstanceProfilePortSpeed struct -// Models which "extend" this model: -// - InstanceProfilePortSpeedFixed -// - InstanceProfilePortSpeedDependent -type InstanceProfilePortSpeed struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` -} - -// Constants associated with the InstanceProfilePortSpeed.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedTypeFixedConst = "fixed" -) - -func (*InstanceProfilePortSpeed) isaInstanceProfilePortSpeed() bool { - return true -} - -type InstanceProfilePortSpeedIntf interface { - isaInstanceProfilePortSpeed() bool -} - -// UnmarshalInstanceProfilePortSpeed unmarshals an instance of InstanceProfilePortSpeed from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileReference : InstanceProfileReference struct -type InstanceProfileReference struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstanceProfileReference.ResourceType property. -// The resource type. -const ( - InstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" -) - -// UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. -func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileReservationTerms : InstanceProfileReservationTerms struct -type InstanceProfileReservationTerms struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported committed use terms for a reservation using this profile. - Values []string `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileReservationTerms.Type property. -// The type for this profile field. -const ( - InstanceProfileReservationTermsTypeEnumConst = "enum" -) - -// Constants associated with the InstanceProfileReservationTerms.Values property. -const ( - InstanceProfileReservationTermsValuesOneYearConst = "one_year" - InstanceProfileReservationTermsValuesThreeYearConst = "three_year" -) - -// UnmarshalInstanceProfileReservationTerms unmarshals an instance of InstanceProfileReservationTerms from the specified map of raw messages. -func UnmarshalInstanceProfileReservationTerms(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileReservationTerms) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpu : InstanceProfileVcpu struct -// Models which "extend" this model: -// - InstanceProfileVcpuFixed -// - InstanceProfileVcpuRange -// - InstanceProfileVcpuEnum -// - InstanceProfileVcpuDependent -type InstanceProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileVcpu.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuTypeFixedConst = "fixed" -) - -func (*InstanceProfileVcpu) isaInstanceProfileVcpu() bool { - return true -} - -type InstanceProfileVcpuIntf interface { - isaInstanceProfileVcpu() bool -} - -// UnmarshalInstanceProfileVcpu unmarshals an instance of InstanceProfileVcpu from the specified map of raw messages. -func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuArchitecture : InstanceProfileVcpuArchitecture struct -type InstanceProfileVcpuArchitecture struct { - // The default VCPU architecture for an instance with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The VCPU architecture for an instance with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuArchitectureTypeFixedConst = "fixed" -) - -// UnmarshalInstanceProfileVcpuArchitecture unmarshals an instance of InstanceProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuManufacturer : InstanceProfileVcpuManufacturer struct -type InstanceProfileVcpuManufacturer struct { - // The default VCPU manufacturer for an instance with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The VCPU manufacturer for an instance with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuManufacturer.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuManufacturerTypeFixedConst = "fixed" -) - -// UnmarshalInstanceProfileVcpuManufacturer unmarshals an instance of InstanceProfileVcpuManufacturer from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuManufacturer) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct -// Models which "extend" this model: -// - InstanceProfileVolumeBandwidthFixed -// - InstanceProfileVolumeBandwidthRange -// - InstanceProfileVolumeBandwidthEnum -// - InstanceProfileVolumeBandwidthDependent -type InstanceProfileVolumeBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileVolumeBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthTypeFixedConst = "fixed" -) - -func (*InstanceProfileVolumeBandwidth) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -type InstanceProfileVolumeBandwidthIntf interface { - isaInstanceProfileVolumeBandwidth() bool -} - -// UnmarshalInstanceProfileVolumeBandwidth unmarshals an instance of InstanceProfileVolumeBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototype : InstancePrototype struct -// Models which "extend" this model: -// - InstancePrototypeInstanceByImage -// - InstancePrototypeInstanceByCatalogOffering -// - InstancePrototypeInstanceByVolume -// - InstancePrototypeInstanceBySourceSnapshot -// - InstancePrototypeInstanceBySourceTemplate -type InstancePrototype struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network - // attachments or instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` - - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` -} - -func (*InstancePrototype) isaInstancePrototype() bool { - return true -} - -type InstancePrototypeIntf interface { - isaInstancePrototype() bool -} - -// UnmarshalInstancePrototype unmarshals an instance of InstancePrototype from the specified map of raw messages. -func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototype) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReference : InstanceReference struct -type InstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. -func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReservationAffinity : InstanceReservationAffinity struct -type InstanceReservationAffinity struct { - // The reservation affinity policy to use for this virtual server instance: - // - `disabled`: Reservations will not be used - // - `manual`: Reservations in `pool` are available for use. - Policy *string `json:"policy" validate:"required"` - - // The pool of reservations available for use by this virtual server instance. - Pool []ReservationReference `json:"pool" validate:"required"` -} - -// Constants associated with the InstanceReservationAffinity.Policy property. -// The reservation affinity policy to use for this virtual server instance: -// - `disabled`: Reservations will not be used -// - `manual`: Reservations in `pool` are available for use. -const ( - InstanceReservationAffinityPolicyDisabledConst = "disabled" - InstanceReservationAffinityPolicyManualConst = "manual" -) - -// UnmarshalInstanceReservationAffinity unmarshals an instance of InstanceReservationAffinity from the specified map of raw messages. -func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinity) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReservationAffinityPatch : InstanceReservationAffinityPatch struct -type InstanceReservationAffinityPatch struct { - // The reservation affinity policy for this virtual server instance. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Policy *string `json:"policy,omitempty"` - - // The pool of reservations available for use by this virtual server instance, replacing the existing pool of - // reservations. - // - // Specified reservations must have a `status` of `active`, and have the same `profile` and - // `zone` as this virtual server instance. - // - // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is - // `manual`. - Pool []ReservationIdentityIntf `json:"pool,omitempty"` -} - -// Constants associated with the InstanceReservationAffinityPatch.Policy property. -// The reservation affinity policy for this virtual server instance. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" - InstanceReservationAffinityPatchPolicyManualConst = "manual" -) - -// UnmarshalInstanceReservationAffinityPatch unmarshals an instance of InstanceReservationAffinityPatch from the specified map of raw messages. -func UnmarshalInstanceReservationAffinityPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinityPatch) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceReservationAffinityPrototype : InstanceReservationAffinityPrototype struct -type InstanceReservationAffinityPrototype struct { - // The reservation affinity policy to use for this virtual server instance: - // - `disabled`: Reservations will not be used - // - `manual`: Reservations in `pool` will be available for use - // - // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. - Policy *string `json:"policy,omitempty"` - - // The pool of reservations available for use by this virtual server instance. - // - // Specified reservations must have a `status` of `active`, and have the same `profile` and - // `zone` as this virtual server instance. - // - // The pool must be empty if `policy` is `disabled`, and must not be empty if `policy` is - // `manual`. - Pool []ReservationIdentityIntf `json:"pool,omitempty"` -} - -// Constants associated with the InstanceReservationAffinityPrototype.Policy property. -// The reservation affinity policy to use for this virtual server instance: -// - `disabled`: Reservations will not be used -// - `manual`: Reservations in `pool` will be available for use -// -// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. -const ( - InstanceReservationAffinityPrototypePolicyDisabledConst = "disabled" - InstanceReservationAffinityPrototypePolicyManualConst = "manual" -) - -// UnmarshalInstanceReservationAffinityPrototype unmarshals an instance of InstanceReservationAffinityPrototype from the specified map of raw messages. -func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReservationAffinityPrototype) - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceStatusReason : InstanceStatusReason struct -type InstanceStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the InstanceStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - InstanceStatusReasonCodeCannotStartConst = "cannot_start" - InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" - InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" - InstanceStatusReasonCodeCannotStartReservationCapacityConst = "cannot_start_reservation_capacity" - InstanceStatusReasonCodeCannotStartReservationExpiredConst = "cannot_start_reservation_expired" - InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" - InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" - InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" -) - -// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. -func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplate : InstanceTemplate struct -// Models which "extend" this model: -// - InstanceTemplateInstanceByImageInstanceTemplateContext -// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext -// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext -type InstanceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network - // attachments or instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` -} - -func (*InstanceTemplate) isaInstanceTemplate() bool { - return true -} - -type InstanceTemplateIntf interface { - isaInstanceTemplate() bool -} - -// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateCollection : InstanceTemplateCollection struct -type InstanceTemplateCollection struct { - // A link to the first page of resources. - First *InstanceTemplateCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceTemplateCollectionNext `json:"next,omitempty"` - - // Collection of instance templates. - Templates []InstanceTemplateIntf `json:"templates" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalInstanceTemplateCollection unmarshals an instance of InstanceTemplateCollection from the specified map of raw messages. -func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceTemplateCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceTemplateCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalInstanceTemplate) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateCollectionFirst : A link to the first page of resources. -type InstanceTemplateCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceTemplateCollectionFirst unmarshals an instance of InstanceTemplateCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceTemplateCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalInstanceTemplateCollectionNext unmarshals an instance of InstanceTemplateCollectionNext from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentity : Identifies an instance template by a unique property. -// Models which "extend" this model: -// - InstanceTemplateIdentityByID -// - InstanceTemplateIdentityByHref -// - InstanceTemplateIdentityByCRN -type InstanceTemplateIdentity struct { - // The unique identifier for this instance template. - ID *string `json:"id,omitempty"` - - // The URL for this instance template. - Href *string `json:"href,omitempty"` - - // The CRN for this instance template. - CRN *string `json:"crn,omitempty"` -} - -func (*InstanceTemplateIdentity) isaInstanceTemplateIdentity() bool { - return true -} - -type InstanceTemplateIdentityIntf interface { - isaInstanceTemplateIdentity() bool -} - -// UnmarshalInstanceTemplateIdentity unmarshals an instance of InstanceTemplateIdentity from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePatch : InstanceTemplatePatch struct -type InstanceTemplatePatch struct { - // The name for this instance template. The name must not be used by another instance template in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalInstanceTemplatePatch unmarshals an instance of InstanceTemplatePatch from the specified map of raw messages. -func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the InstanceTemplatePatch -func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceTemplatePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// InstanceTemplatePrototype : InstanceTemplatePrototype struct -// Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceTemplateByImage -// - InstanceTemplatePrototypeInstanceTemplateBySourceTemplate -// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot -// - InstanceTemplatePrototypeInstanceTemplateByCatalogOffering -type InstanceTemplatePrototype struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not - // subsequently managed. Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - // property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The metadata service configuration. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network - // attachments or instance network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` - - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` -} - -func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { - return true -} - -type InstanceTemplatePrototypeIntf interface { - isaInstanceTemplatePrototype() bool -} - -// UnmarshalInstanceTemplatePrototype unmarshals an instance of InstanceTemplatePrototype from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototype) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateReference : InstanceTemplateReference struct -type InstanceTemplateReference struct { - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceTemplateReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalInstanceTemplateReference unmarshals an instance of InstanceTemplateReference from the specified map of raw messages. -func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceTemplateReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type InstanceTemplateReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalInstanceTemplateReferenceDeleted unmarshals an instance of InstanceTemplateReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceVcpu : The virtual server instance VCPU configuration. -type InstanceVcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The number of VCPUs assigned. - Count *int64 `json:"count" validate:"required"` - - // The VCPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` -} - -// UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. -func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceVcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Key : Key struct -type Key struct { - // The date and time that the key was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` - - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` - - // The URL for this key. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` - - // The length of this key (in bits). - Length *int64 `json:"length" validate:"required"` - - // The name for this key. The name must not be used by another key in the region. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name" validate:"required"` - - // The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. - PublicKey *string `json:"public_key" validate:"required"` - - // The resource group for this key. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The crypto-system used by this key. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the Key.Type property. -// The crypto-system used by this key. -const ( - KeyTypeEd25519Const = "ed25519" - KeyTypeRsaConst = "rsa" -) - -// UnmarshalKey unmarshals an instance of Key from the specified map of raw messages. -func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Key) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "length", &obj.Length) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "public_key", &obj.PublicKey) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyCollection : KeyCollection struct -type KeyCollection struct { - // A link to the first page of resources. - First *KeyCollectionFirst `json:"first" validate:"required"` - - // Collection of keys. - Keys []Key `json:"keys" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *KeyCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalKeyCollection unmarshals an instance of KeyCollection from the specified map of raw messages. -func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalKeyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKey) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalKeyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *KeyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// KeyCollectionFirst : A link to the first page of resources. -type KeyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalKeyCollectionFirst unmarshals an instance of KeyCollectionFirst from the specified map of raw messages. -func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type KeyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalKeyCollectionNext unmarshals an instance of KeyCollectionNext from the specified map of raw messages. -func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyIdentity : Identifies a key by a unique property. -// Models which "extend" this model: -// - KeyIdentityByID -// - KeyIdentityByCRN -// - KeyIdentityByHref -// - KeyIdentityByFingerprint -type KeyIdentity struct { - // The unique identifier for this key. - ID *string `json:"id,omitempty"` - - // The CRN for this key. - CRN *string `json:"crn,omitempty"` - - // The URL for this key. - Href *string `json:"href,omitempty"` - - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint,omitempty"` -} - -func (*KeyIdentity) isaKeyIdentity() bool { - return true -} - -type KeyIdentityIntf interface { - isaKeyIdentity() bool -} - -// UnmarshalKeyIdentity unmarshals an instance of KeyIdentity from the specified map of raw messages. -func UnmarshalKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyPatch : KeyPatch struct -type KeyPatch struct { - // The name for this key. The name must not be used by another key in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalKeyPatch unmarshals an instance of KeyPatch from the specified map of raw messages. -func UnmarshalKeyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the KeyPatch -func (keyPatch *KeyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(keyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// KeyReference : KeyReference struct -type KeyReference struct { - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *KeyReferenceDeleted `json:"deleted,omitempty"` - - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` - - // The URL for this key. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` - - // The name for this key. The name is unique across all keys in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalKeyReference unmarshals an instance of KeyReference from the specified map of raw messages. -func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalKeyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type KeyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalKeyReferenceDeleted unmarshals an instance of KeyReferenceDeleted from the specified map of raw messages. -func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LegacyCloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName -type LegacyCloudObjectStorageBucketIdentity struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name,omitempty"` -} - -func (*LegacyCloudObjectStorageBucketIdentity) isaLegacyCloudObjectStorageBucketIdentity() bool { - return true -} - -type LegacyCloudObjectStorageBucketIdentityIntf interface { - isaLegacyCloudObjectStorageBucketIdentity() bool -} - -// UnmarshalLegacyCloudObjectStorageBucketIdentity unmarshals an instance of LegacyCloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LegacyCloudObjectStorageBucketReference : LegacyCloudObjectStorageBucketReference struct -type LegacyCloudObjectStorageBucketReference struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalLegacyCloudObjectStorageBucketReference unmarshals an instance of LegacyCloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ListBackupPoliciesOptions : The ListBackupPolicies options. -type ListBackupPoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. - Tag *string `json:"tag,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBackupPoliciesOptions : Instantiate ListBackupPoliciesOptions -func (*VpcV1) NewListBackupPoliciesOptions() *ListBackupPoliciesOptions { - return &ListBackupPoliciesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListBackupPoliciesOptions) SetStart(start string) *ListBackupPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBackupPoliciesOptions) SetLimit(limit int64) *ListBackupPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListBackupPoliciesOptions) SetResourceGroupID(resourceGroupID string) *ListBackupPoliciesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListBackupPoliciesOptions) SetName(name string) *ListBackupPoliciesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetTag : Allow user to set Tag -func (_options *ListBackupPoliciesOptions) SetTag(tag string) *ListBackupPoliciesOptions { - _options.Tag = core.StringPtr(tag) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPoliciesOptions) SetHeaders(param map[string]string) *ListBackupPoliciesOptions { - options.Headers = param - return options -} - -// ListBackupPolicyJobsOptions : The ListBackupPolicyJobs options. -type ListBackupPolicyJobsOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // Filters the collection to backup policy jobs with a `status` property matching the specified value. - Status *string `json:"status,omitempty"` - - // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified - // identifier. - BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to backup policy jobs with a `source.id` property matching the specified identifier. - SourceID *string `json:"source.id,omitempty"` - - // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with an `id` property - // matching the specified identifier. - TargetSnapshotsID *string `json:"target_snapshots[].id,omitempty"` - - // Filters the collection to backup policy jobs with an item in the `target_snapshots` property with a `crn` property - // matching the specified CRN. - TargetSnapshotsCRN *string `json:"target_snapshots[].crn,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListBackupPolicyJobsOptions.Status property. -// Filters the collection to backup policy jobs with a `status` property matching the specified value. -const ( - ListBackupPolicyJobsOptionsStatusFailedConst = "failed" - ListBackupPolicyJobsOptionsStatusRunningConst = "running" - ListBackupPolicyJobsOptionsStatusSucceededConst = "succeeded" -) - -// Constants associated with the ListBackupPolicyJobsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListBackupPolicyJobsOptionsSortCreatedAtConst = "created_at" - ListBackupPolicyJobsOptionsSortNameConst = "name" -) - -// NewListBackupPolicyJobsOptions : Instantiate ListBackupPolicyJobsOptions -func (*VpcV1) NewListBackupPolicyJobsOptions(backupPolicyID string) *ListBackupPolicyJobsOptions { - return &ListBackupPolicyJobsOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyJobsOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListBackupPolicyJobsOptions) SetStatus(status string) *ListBackupPolicyJobsOptions { - _options.Status = core.StringPtr(status) - return _options -} - -// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID -func (_options *ListBackupPolicyJobsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListBackupPolicyJobsOptions { - _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListBackupPolicyJobsOptions) SetStart(start string) *ListBackupPolicyJobsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBackupPolicyJobsOptions) SetLimit(limit int64) *ListBackupPolicyJobsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListBackupPolicyJobsOptions) SetSort(sort string) *ListBackupPolicyJobsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetSourceID : Allow user to set SourceID -func (_options *ListBackupPolicyJobsOptions) SetSourceID(sourceID string) *ListBackupPolicyJobsOptions { - _options.SourceID = core.StringPtr(sourceID) - return _options -} - -// SetTargetSnapshotsID : Allow user to set TargetSnapshotsID -func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsID(targetSnapshotsID string) *ListBackupPolicyJobsOptions { - _options.TargetSnapshotsID = core.StringPtr(targetSnapshotsID) - return _options -} - -// SetTargetSnapshotsCRN : Allow user to set TargetSnapshotsCRN -func (_options *ListBackupPolicyJobsOptions) SetTargetSnapshotsCRN(targetSnapshotsCRN string) *ListBackupPolicyJobsOptions { - _options.TargetSnapshotsCRN = core.StringPtr(targetSnapshotsCRN) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPolicyJobsOptions) SetHeaders(param map[string]string) *ListBackupPolicyJobsOptions { - options.Headers = param - return options -} - -// ListBackupPolicyPlansOptions : The ListBackupPolicyPlans options. -type ListBackupPolicyPlansOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBackupPolicyPlansOptions : Instantiate ListBackupPolicyPlansOptions -func (*VpcV1) NewListBackupPolicyPlansOptions(backupPolicyID string) *ListBackupPolicyPlansOptions { - return &ListBackupPolicyPlansOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *ListBackupPolicyPlansOptions) SetBackupPolicyID(backupPolicyID string) *ListBackupPolicyPlansOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListBackupPolicyPlansOptions) SetName(name string) *ListBackupPolicyPlansOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBackupPolicyPlansOptions) SetHeaders(param map[string]string) *ListBackupPolicyPlansOptions { - options.Headers = param - return options -} - -// ListBareMetalServerDisksOptions : The ListBareMetalServerDisks options. -type ListBareMetalServerDisksOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerDisksOptions : Instantiate ListBareMetalServerDisksOptions -func (*VpcV1) NewListBareMetalServerDisksOptions(bareMetalServerID string) *ListBareMetalServerDisksOptions { - return &ListBareMetalServerDisksOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerDisksOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerDisksOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerDisksOptions) SetHeaders(param map[string]string) *ListBareMetalServerDisksOptions { - options.Headers = param - return options -} - -// ListBareMetalServerNetworkAttachmentsOptions : The ListBareMetalServerNetworkAttachments options. -type ListBareMetalServerNetworkAttachmentsOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerNetworkAttachmentsOptions : Instantiate ListBareMetalServerNetworkAttachmentsOptions -func (*VpcV1) NewListBareMetalServerNetworkAttachmentsOptions(bareMetalServerID string) *ListBareMetalServerNetworkAttachmentsOptions { - return &ListBareMetalServerNetworkAttachmentsOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkAttachmentsOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetStart(start string) *ListBareMetalServerNetworkAttachmentsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServerNetworkAttachmentsOptions) SetLimit(limit int64) *ListBareMetalServerNetworkAttachmentsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkAttachmentsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkAttachmentsOptions { - options.Headers = param - return options -} - -// ListBareMetalServerNetworkInterfaceFloatingIpsOptions : The ListBareMetalServerNetworkInterfaceFloatingIps options. -type ListBareMetalServerNetworkInterfaceFloatingIpsOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerNetworkInterfaceFloatingIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfaceFloatingIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - return &ListBareMetalServerNetworkInterfaceFloatingIpsOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} - -// ListBareMetalServerNetworkInterfaceIpsOptions : The ListBareMetalServerNetworkInterfaceIps options. -type ListBareMetalServerNetworkInterfaceIpsOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerNetworkInterfaceIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceIpsOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfaceIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - return &ListBareMetalServerNetworkInterfaceIpsOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListBareMetalServerNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceIpsOptions { - options.Headers = param - return options -} - -// ListBareMetalServerNetworkInterfacesOptions : The ListBareMetalServerNetworkInterfaces options. -type ListBareMetalServerNetworkInterfacesOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerNetworkInterfacesOptions : Instantiate ListBareMetalServerNetworkInterfacesOptions -func (*VpcV1) NewListBareMetalServerNetworkInterfacesOptions(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { - return &ListBareMetalServerNetworkInterfacesOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetStart(start string) *ListBareMetalServerNetworkInterfacesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServerNetworkInterfacesOptions) SetLimit(limit int64) *ListBareMetalServerNetworkInterfacesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfacesOptions { - options.Headers = param - return options -} - -// ListBareMetalServerProfilesOptions : The ListBareMetalServerProfiles options. -type ListBareMetalServerProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServerProfilesOptions : Instantiate ListBareMetalServerProfilesOptions -func (*VpcV1) NewListBareMetalServerProfilesOptions() *ListBareMetalServerProfilesOptions { - return &ListBareMetalServerProfilesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListBareMetalServerProfilesOptions) SetStart(start string) *ListBareMetalServerProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServerProfilesOptions) SetLimit(limit int64) *ListBareMetalServerProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServerProfilesOptions) SetHeaders(param map[string]string) *ListBareMetalServerProfilesOptions { - options.Headers = param - return options -} - -// ListBareMetalServersOptions : The ListBareMetalServers options. -type ListBareMetalServersOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListBareMetalServersOptions : Instantiate ListBareMetalServersOptions -func (*VpcV1) NewListBareMetalServersOptions() *ListBareMetalServersOptions { - return &ListBareMetalServersOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListBareMetalServersOptions) SetStart(start string) *ListBareMetalServersOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListBareMetalServersOptions) SetLimit(limit int64) *ListBareMetalServersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListBareMetalServersOptions) SetResourceGroupID(resourceGroupID string) *ListBareMetalServersOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListBareMetalServersOptions) SetName(name string) *ListBareMetalServersOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListBareMetalServersOptions) SetVPCID(vpcID string) *ListBareMetalServersOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListBareMetalServersOptions) SetVPCCRN(vpcCRN string) *ListBareMetalServersOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListBareMetalServersOptions) SetVPCName(vpcName string) *ListBareMetalServersOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListBareMetalServersOptions) SetHeaders(param map[string]string) *ListBareMetalServersOptions { - options.Headers = param - return options -} - -// ListDedicatedHostDisksOptions : The ListDedicatedHostDisks options. -type ListDedicatedHostDisksOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListDedicatedHostDisksOptions : Instantiate ListDedicatedHostDisksOptions -func (*VpcV1) NewListDedicatedHostDisksOptions(dedicatedHostID string) *ListDedicatedHostDisksOptions { - return &ListDedicatedHostDisksOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - } -} - -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListDedicatedHostDisksOptions) SetDedicatedHostID(dedicatedHostID string) *ListDedicatedHostDisksOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostDisksOptions) SetHeaders(param map[string]string) *ListDedicatedHostDisksOptions { - options.Headers = param - return options -} - -// ListDedicatedHostGroupsOptions : The ListDedicatedHostGroups options. -type ListDedicatedHostGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListDedicatedHostGroupsOptions : Instantiate ListDedicatedHostGroupsOptions -func (*VpcV1) NewListDedicatedHostGroupsOptions() *ListDedicatedHostGroupsOptions { - return &ListDedicatedHostGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostGroupsOptions) SetStart(start string) *ListDedicatedHostGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostGroupsOptions) SetLimit(limit int64) *ListDedicatedHostGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostGroupsOptions) SetZoneName(zoneName string) *ListDedicatedHostGroupsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListDedicatedHostGroupsOptions) SetName(name string) *ListDedicatedHostGroupsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostGroupsOptions) SetHeaders(param map[string]string) *ListDedicatedHostGroupsOptions { - options.Headers = param - return options -} - -// ListDedicatedHostProfilesOptions : The ListDedicatedHostProfiles options. -type ListDedicatedHostProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListDedicatedHostProfilesOptions : Instantiate ListDedicatedHostProfilesOptions -func (*VpcV1) NewListDedicatedHostProfilesOptions() *ListDedicatedHostProfilesOptions { - return &ListDedicatedHostProfilesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostProfilesOptions) SetStart(start string) *ListDedicatedHostProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostProfilesOptions) SetLimit(limit int64) *ListDedicatedHostProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostProfilesOptions) SetHeaders(param map[string]string) *ListDedicatedHostProfilesOptions { - options.Headers = param - return options -} - -// ListDedicatedHostsOptions : The ListDedicatedHosts options. -type ListDedicatedHostsOptions struct { - // Filters the collection to dedicated hosts with a `group.id` property matching the specified identifier. - DedicatedHostGroupID *string `json:"dedicated_host_group.id,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListDedicatedHostsOptions : Instantiate ListDedicatedHostsOptions -func (*VpcV1) NewListDedicatedHostsOptions() *ListDedicatedHostsOptions { - return &ListDedicatedHostsOptions{} -} - -// SetDedicatedHostGroupID : Allow user to set DedicatedHostGroupID -func (_options *ListDedicatedHostsOptions) SetDedicatedHostGroupID(dedicatedHostGroupID string) *ListDedicatedHostsOptions { - _options.DedicatedHostGroupID = core.StringPtr(dedicatedHostGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostsOptions) SetStart(start string) *ListDedicatedHostsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostsOptions) SetLimit(limit int64) *ListDedicatedHostsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostsOptions) SetZoneName(zoneName string) *ListDedicatedHostsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListDedicatedHostsOptions) SetName(name string) *ListDedicatedHostsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostsOptions) SetHeaders(param map[string]string) *ListDedicatedHostsOptions { - options.Headers = param - return options -} - -// ListEndpointGatewayIpsOptions : The ListEndpointGatewayIps options. -type ListEndpointGatewayIpsOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListEndpointGatewayIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListEndpointGatewayIpsOptionsSortAddressConst = "address" - ListEndpointGatewayIpsOptionsSortCreatedAtConst = "created_at" - ListEndpointGatewayIpsOptionsSortNameConst = "name" -) - -// NewListEndpointGatewayIpsOptions : Instantiate ListEndpointGatewayIpsOptions -func (*VpcV1) NewListEndpointGatewayIpsOptions(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - return &ListEndpointGatewayIpsOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *ListEndpointGatewayIpsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewayIpsOptions) SetStart(start string) *ListEndpointGatewayIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewayIpsOptions) SetLimit(limit int64) *ListEndpointGatewayIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListEndpointGatewayIpsOptions) SetSort(sort string) *ListEndpointGatewayIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayIpsOptions { - options.Headers = param - return options -} - -// ListEndpointGatewaysOptions : The ListEndpointGateways options. -type ListEndpointGatewaysOptions struct { - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to endpoint gateways with an `allow_dns_resolution_binding` property matching the specified - // value. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions -func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { - return &ListEndpointGatewaysOptions{} -} - -// SetName : Allow user to set Name -func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewaysOptions) SetStart(start string) *ListEndpointGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewaysOptions) SetLimit(limit int64) *ListEndpointGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListEndpointGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListEndpointGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListEndpointGatewaysOptions) SetVPCID(vpcID string) *ListEndpointGatewaysOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListEndpointGatewaysOptions) SetVPCCRN(vpcCRN string) *ListEndpointGatewaysOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListEndpointGatewaysOptions) SetVPCName(vpcName string) *ListEndpointGatewaysOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *ListEndpointGatewaysOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *ListEndpointGatewaysOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewaysOptions) SetHeaders(param map[string]string) *ListEndpointGatewaysOptions { - options.Headers = param - return options -} - -// ListFloatingIpsOptions : The ListFloatingIps options. -type ListFloatingIpsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to resources with a `target.id` property matching the specified identifier. - TargetID *string `json:"target.id,omitempty"` - - // Filters the collection to resources with a `target.crn` property matching the specified CRN. - TargetCRN *string `json:"target.crn,omitempty"` - - // Filters the collection to resources with a `target.name` property matching the exact specified name. - TargetName *string `json:"target.name,omitempty"` - - // Filters the collection to resources with a `target.resource_type` property matching the specified value. - TargetResourceType *string `json:"target.resource_type,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListFloatingIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListFloatingIpsOptionsSortCreatedAtConst = "created_at" - ListFloatingIpsOptionsSortNameConst = "name" -) - -// NewListFloatingIpsOptions : Instantiate ListFloatingIpsOptions -func (*VpcV1) NewListFloatingIpsOptions() *ListFloatingIpsOptions { - return &ListFloatingIpsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListFloatingIpsOptions) SetStart(start string) *ListFloatingIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListFloatingIpsOptions) SetLimit(limit int64) *ListFloatingIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFloatingIpsOptions) SetResourceGroupID(resourceGroupID string) *ListFloatingIpsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListFloatingIpsOptions) SetSort(sort string) *ListFloatingIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetTargetID : Allow user to set TargetID -func (_options *ListFloatingIpsOptions) SetTargetID(targetID string) *ListFloatingIpsOptions { - _options.TargetID = core.StringPtr(targetID) - return _options -} - -// SetTargetCRN : Allow user to set TargetCRN -func (_options *ListFloatingIpsOptions) SetTargetCRN(targetCRN string) *ListFloatingIpsOptions { - _options.TargetCRN = core.StringPtr(targetCRN) - return _options -} - -// SetTargetName : Allow user to set TargetName -func (_options *ListFloatingIpsOptions) SetTargetName(targetName string) *ListFloatingIpsOptions { - _options.TargetName = core.StringPtr(targetName) - return _options -} - -// SetTargetResourceType : Allow user to set TargetResourceType -func (_options *ListFloatingIpsOptions) SetTargetResourceType(targetResourceType string) *ListFloatingIpsOptions { - _options.TargetResourceType = core.StringPtr(targetResourceType) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListFloatingIpsOptions) SetHeaders(param map[string]string) *ListFloatingIpsOptions { - options.Headers = param - return options -} - -// ListFlowLogCollectorsOptions : The ListFlowLogCollectors options. -type ListFlowLogCollectorsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to resources with a `target.id` property matching the specified identifier. - TargetID *string `json:"target.id,omitempty"` - - // Filters the collection to resources with a `target.resource_type` property matching the specified value. - TargetResourceType *string `json:"target.resource_type,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListFlowLogCollectorsOptions : Instantiate ListFlowLogCollectorsOptions -func (*VpcV1) NewListFlowLogCollectorsOptions() *ListFlowLogCollectorsOptions { - return &ListFlowLogCollectorsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListFlowLogCollectorsOptions) SetStart(start string) *ListFlowLogCollectorsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListFlowLogCollectorsOptions) SetLimit(limit int64) *ListFlowLogCollectorsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFlowLogCollectorsOptions) SetResourceGroupID(resourceGroupID string) *ListFlowLogCollectorsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListFlowLogCollectorsOptions) SetName(name string) *ListFlowLogCollectorsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListFlowLogCollectorsOptions) SetVPCID(vpcID string) *ListFlowLogCollectorsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListFlowLogCollectorsOptions) SetVPCCRN(vpcCRN string) *ListFlowLogCollectorsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListFlowLogCollectorsOptions) SetVPCName(vpcName string) *ListFlowLogCollectorsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetTargetID : Allow user to set TargetID -func (_options *ListFlowLogCollectorsOptions) SetTargetID(targetID string) *ListFlowLogCollectorsOptions { - _options.TargetID = core.StringPtr(targetID) - return _options -} - -// SetTargetResourceType : Allow user to set TargetResourceType -func (_options *ListFlowLogCollectorsOptions) SetTargetResourceType(targetResourceType string) *ListFlowLogCollectorsOptions { - _options.TargetResourceType = core.StringPtr(targetResourceType) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListFlowLogCollectorsOptions) SetHeaders(param map[string]string) *ListFlowLogCollectorsOptions { - options.Headers = param - return options -} - -// ListIkePoliciesOptions : The ListIkePolicies options. -type ListIkePoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListIkePoliciesOptions : Instantiate ListIkePoliciesOptions -func (*VpcV1) NewListIkePoliciesOptions() *ListIkePoliciesOptions { - return &ListIkePoliciesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListIkePoliciesOptions) SetStart(start string) *ListIkePoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListIkePoliciesOptions) SetLimit(limit int64) *ListIkePoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListIkePoliciesOptions) SetHeaders(param map[string]string) *ListIkePoliciesOptions { - options.Headers = param - return options -} - -// ListIkePolicyConnectionsOptions : The ListIkePolicyConnections options. -type ListIkePolicyConnectionsOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListIkePolicyConnectionsOptions : Instantiate ListIkePolicyConnectionsOptions -func (*VpcV1) NewListIkePolicyConnectionsOptions(id string) *ListIkePolicyConnectionsOptions { - return &ListIkePolicyConnectionsOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ListIkePolicyConnectionsOptions) SetID(id string) *ListIkePolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListIkePolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIkePolicyConnectionsOptions { - options.Headers = param - return options -} - -// ListImageExportJobsOptions : The ListImageExportJobs options. -type ListImageExportJobsOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListImageExportJobsOptions : Instantiate ListImageExportJobsOptions -func (*VpcV1) NewListImageExportJobsOptions(imageID string) *ListImageExportJobsOptions { - return &ListImageExportJobsOptions{ - ImageID: core.StringPtr(imageID), - } -} - -// SetImageID : Allow user to set ImageID -func (_options *ListImageExportJobsOptions) SetImageID(imageID string) *ListImageExportJobsOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListImageExportJobsOptions) SetName(name string) *ListImageExportJobsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListImageExportJobsOptions) SetHeaders(param map[string]string) *ListImageExportJobsOptions { - options.Headers = param - return options -} - -// ListImagesOptions : The ListImages options. -type ListImagesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to images with a `status` property matching one of the specified comma-separated values. - Status []string `json:"status,omitempty"` - - // Filters the collection to images with a `visibility` property matching the specified value. - Visibility *string `json:"visibility,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListImagesOptions.Status property. -const ( - ListImagesOptionsStatusAvailableConst = "available" - ListImagesOptionsStatusDeletingConst = "deleting" - ListImagesOptionsStatusDeprecatedConst = "deprecated" - ListImagesOptionsStatusFailedConst = "failed" - ListImagesOptionsStatusObsoleteConst = "obsolete" - ListImagesOptionsStatusPendingConst = "pending" - ListImagesOptionsStatusUnusableConst = "unusable" -) - -// Constants associated with the ListImagesOptions.Visibility property. -// Filters the collection to images with a `visibility` property matching the specified value. -const ( - ListImagesOptionsVisibilityPrivateConst = "private" - ListImagesOptionsVisibilityPublicConst = "public" -) - -// NewListImagesOptions : Instantiate ListImagesOptions -func (*VpcV1) NewListImagesOptions() *ListImagesOptions { - return &ListImagesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListImagesOptions) SetStart(start string) *ListImagesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListImagesOptions) SetLimit(limit int64) *ListImagesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListImagesOptions) SetResourceGroupID(resourceGroupID string) *ListImagesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListImagesOptions) SetName(name string) *ListImagesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListImagesOptions) SetStatus(status []string) *ListImagesOptions { - _options.Status = status - return _options -} - -// SetVisibility : Allow user to set Visibility -func (_options *ListImagesOptions) SetVisibility(visibility string) *ListImagesOptions { - _options.Visibility = core.StringPtr(visibility) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListImagesOptions) SetHeaders(param map[string]string) *ListImagesOptions { - options.Headers = param - return options -} - -// ListInstanceDisksOptions : The ListInstanceDisks options. -type ListInstanceDisksOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceDisksOptions : Instantiate ListInstanceDisksOptions -func (*VpcV1) NewListInstanceDisksOptions(instanceID string) *ListInstanceDisksOptions { - return &ListInstanceDisksOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceDisksOptions) SetInstanceID(instanceID string) *ListInstanceDisksOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceDisksOptions) SetHeaders(param map[string]string) *ListInstanceDisksOptions { - options.Headers = param - return options -} - -// ListInstanceGroupManagerActionsOptions : The ListInstanceGroupManagerActions options. -type ListInstanceGroupManagerActionsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceGroupManagerActionsOptions : Instantiate ListInstanceGroupManagerActionsOptions -func (*VpcV1) NewListInstanceGroupManagerActionsOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - return &ListInstanceGroupManagerActionsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerActionsOptions) SetStart(start string) *ListInstanceGroupManagerActionsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerActionsOptions) SetLimit(limit int64) *ListInstanceGroupManagerActionsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerActionsOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerActionsOptions { - options.Headers = param - return options -} - -// ListInstanceGroupManagerPoliciesOptions : The ListInstanceGroupManagerPolicies options. -type ListInstanceGroupManagerPoliciesOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceGroupManagerPoliciesOptions : Instantiate ListInstanceGroupManagerPoliciesOptions -func (*VpcV1) NewListInstanceGroupManagerPoliciesOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - return &ListInstanceGroupManagerPoliciesOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerPoliciesOptions) SetStart(start string) *ListInstanceGroupManagerPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerPoliciesOptions) SetLimit(limit int64) *ListInstanceGroupManagerPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerPoliciesOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerPoliciesOptions { - options.Headers = param - return options -} - -// ListInstanceGroupManagersOptions : The ListInstanceGroupManagers options. -type ListInstanceGroupManagersOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceGroupManagersOptions : Instantiate ListInstanceGroupManagersOptions -func (*VpcV1) NewListInstanceGroupManagersOptions(instanceGroupID string) *ListInstanceGroupManagersOptions { - return &ListInstanceGroupManagersOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagersOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagersOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagersOptions) SetStart(start string) *ListInstanceGroupManagersOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagersOptions) SetLimit(limit int64) *ListInstanceGroupManagersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagersOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagersOptions { - options.Headers = param - return options -} - -// ListInstanceGroupMembershipsOptions : The ListInstanceGroupMemberships options. -type ListInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceGroupMembershipsOptions : Instantiate ListInstanceGroupMembershipsOptions -func (*VpcV1) NewListInstanceGroupMembershipsOptions(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - return &ListInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupMembershipsOptions) SetStart(start string) *ListInstanceGroupMembershipsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupMembershipsOptions) SetLimit(limit int64) *ListInstanceGroupMembershipsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *ListInstanceGroupMembershipsOptions { - options.Headers = param - return options -} - -// ListInstanceGroupsOptions : The ListInstanceGroups options. -type ListInstanceGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceGroupsOptions : Instantiate ListInstanceGroupsOptions -func (*VpcV1) NewListInstanceGroupsOptions() *ListInstanceGroupsOptions { - return &ListInstanceGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupsOptions) SetStart(start string) *ListInstanceGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupsOptions) SetLimit(limit int64) *ListInstanceGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupsOptions) SetHeaders(param map[string]string) *ListInstanceGroupsOptions { - options.Headers = param - return options -} - -// ListInstanceNetworkAttachmentsOptions : The ListInstanceNetworkAttachments options. -type ListInstanceNetworkAttachmentsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceNetworkAttachmentsOptions : Instantiate ListInstanceNetworkAttachmentsOptions -func (*VpcV1) NewListInstanceNetworkAttachmentsOptions(instanceID string) *ListInstanceNetworkAttachmentsOptions { - return &ListInstanceNetworkAttachmentsOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkAttachmentsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkAttachmentsOptions { - options.Headers = param - return options -} - -// ListInstanceNetworkInterfaceFloatingIpsOptions : The ListInstanceNetworkInterfaceFloatingIps options. -type ListInstanceNetworkInterfaceFloatingIpsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceNetworkInterfaceFloatingIpsOptions : Instantiate ListInstanceNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - return &ListInstanceNetworkInterfaceFloatingIpsOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} - -// ListInstanceNetworkInterfaceIpsOptions : The ListInstanceNetworkInterfaceIps options. -type ListInstanceNetworkInterfaceIpsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceNetworkInterfaceIpsOptions : Instantiate ListInstanceNetworkInterfaceIpsOptions -func (*VpcV1) NewListInstanceNetworkInterfaceIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { - return &ListInstanceNetworkInterfaceIpsOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceIpsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetStart(start string) *ListInstanceNetworkInterfaceIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstanceNetworkInterfaceIpsOptions) SetLimit(limit int64) *ListInstanceNetworkInterfaceIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceIpsOptions { - options.Headers = param - return options -} - -// ListInstanceNetworkInterfacesOptions : The ListInstanceNetworkInterfaces options. -type ListInstanceNetworkInterfacesOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceNetworkInterfacesOptions : Instantiate ListInstanceNetworkInterfacesOptions -func (*VpcV1) NewListInstanceNetworkInterfacesOptions(instanceID string) *ListInstanceNetworkInterfacesOptions { - return &ListInstanceNetworkInterfacesOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfacesOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfacesOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfacesOptions { - options.Headers = param - return options -} - -// ListInstanceProfilesOptions : The ListInstanceProfiles options. -type ListInstanceProfilesOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceProfilesOptions : Instantiate ListInstanceProfilesOptions -func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { - return &ListInstanceProfilesOptions{} -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { - options.Headers = param - return options -} - -// ListInstanceTemplatesOptions : The ListInstanceTemplates options. -type ListInstanceTemplatesOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceTemplatesOptions : Instantiate ListInstanceTemplatesOptions -func (*VpcV1) NewListInstanceTemplatesOptions() *ListInstanceTemplatesOptions { - return &ListInstanceTemplatesOptions{} -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceTemplatesOptions) SetHeaders(param map[string]string) *ListInstanceTemplatesOptions { - options.Headers = param - return options -} - -// ListInstanceVolumeAttachmentsOptions : The ListInstanceVolumeAttachments options. -type ListInstanceVolumeAttachmentsOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstanceVolumeAttachmentsOptions : Instantiate ListInstanceVolumeAttachmentsOptions -func (*VpcV1) NewListInstanceVolumeAttachmentsOptions(instanceID string) *ListInstanceVolumeAttachmentsOptions { - return &ListInstanceVolumeAttachmentsOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceVolumeAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceVolumeAttachmentsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstanceVolumeAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceVolumeAttachmentsOptions { - options.Headers = param - return options -} - -// ListInstancesOptions : The ListInstances options. -type ListInstancesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to instances with a `dedicated_host.id` property matching the specified identifier. - DedicatedHostID *string `json:"dedicated_host.id,omitempty"` - - // Filters the collection to instances with a `dedicated_host.crn` property matching the specified CRN. - DedicatedHostCRN *string `json:"dedicated_host.crn,omitempty"` - - // Filters the collection to instances with a `dedicated_host.name` property matching the exact specified name. - DedicatedHostName *string `json:"dedicated_host.name,omitempty"` - - // Filters the collection to instances with a `placement_target.id` property matching the specified placement group - // identifier. - PlacementGroupID *string `json:"placement_group.id,omitempty"` - - // Filters the collection to instances with a `placement_target.crn` property matching the specified placement group - // CRN. - PlacementGroupCRN *string `json:"placement_group.crn,omitempty"` - - // Filters the collection to instances with a `placement_target.name` property matching the exact specified placement - // group name. - PlacementGroupName *string `json:"placement_group.name,omitempty"` - - // Filters the collection to instances with a `reservation.id` property matching the specified identifier. - ReservationID *string `json:"reservation.id,omitempty"` - - // Filters the collection to instances with a `reservation.crn` property matching the specified CRN. - ReservationCRN *string `json:"reservation.crn,omitempty"` - - // Filters the collection to resources with a `reservation.name` property matching the exact specified name. - ReservationName *string `json:"reservation.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListInstancesOptions : Instantiate ListInstancesOptions -func (*VpcV1) NewListInstancesOptions() *ListInstancesOptions { - return &ListInstancesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListInstancesOptions) SetStart(start string) *ListInstancesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListInstancesOptions) SetLimit(limit int64) *ListInstancesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListInstancesOptions) SetResourceGroupID(resourceGroupID string) *ListInstancesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListInstancesOptions) SetVPCID(vpcID string) *ListInstancesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListInstancesOptions) SetVPCCRN(vpcCRN string) *ListInstancesOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListInstancesOptions) SetVPCName(vpcName string) *ListInstancesOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListInstancesOptions) SetDedicatedHostID(dedicatedHostID string) *ListInstancesOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetDedicatedHostCRN : Allow user to set DedicatedHostCRN -func (_options *ListInstancesOptions) SetDedicatedHostCRN(dedicatedHostCRN string) *ListInstancesOptions { - _options.DedicatedHostCRN = core.StringPtr(dedicatedHostCRN) - return _options -} - -// SetDedicatedHostName : Allow user to set DedicatedHostName -func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName string) *ListInstancesOptions { - _options.DedicatedHostName = core.StringPtr(dedicatedHostName) - return _options -} - -// SetPlacementGroupID : Allow user to set PlacementGroupID -func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { - _options.PlacementGroupID = core.StringPtr(placementGroupID) - return _options -} - -// SetPlacementGroupCRN : Allow user to set PlacementGroupCRN -func (_options *ListInstancesOptions) SetPlacementGroupCRN(placementGroupCRN string) *ListInstancesOptions { - _options.PlacementGroupCRN = core.StringPtr(placementGroupCRN) - return _options -} - -// SetPlacementGroupName : Allow user to set PlacementGroupName -func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName string) *ListInstancesOptions { - _options.PlacementGroupName = core.StringPtr(placementGroupName) - return _options -} - -// SetReservationID : Allow user to set ReservationID -func (_options *ListInstancesOptions) SetReservationID(reservationID string) *ListInstancesOptions { - _options.ReservationID = core.StringPtr(reservationID) - return _options -} - -// SetReservationCRN : Allow user to set ReservationCRN -func (_options *ListInstancesOptions) SetReservationCRN(reservationCRN string) *ListInstancesOptions { - _options.ReservationCRN = core.StringPtr(reservationCRN) - return _options -} - -// SetReservationName : Allow user to set ReservationName -func (_options *ListInstancesOptions) SetReservationName(reservationName string) *ListInstancesOptions { - _options.ReservationName = core.StringPtr(reservationName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { - options.Headers = param - return options -} - -// ListIpsecPoliciesOptions : The ListIpsecPolicies options. -type ListIpsecPoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListIpsecPoliciesOptions : Instantiate ListIpsecPoliciesOptions -func (*VpcV1) NewListIpsecPoliciesOptions() *ListIpsecPoliciesOptions { - return &ListIpsecPoliciesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListIpsecPoliciesOptions) SetStart(start string) *ListIpsecPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListIpsecPoliciesOptions) SetLimit(limit int64) *ListIpsecPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPoliciesOptions) SetHeaders(param map[string]string) *ListIpsecPoliciesOptions { - options.Headers = param - return options -} - -// ListIpsecPolicyConnectionsOptions : The ListIpsecPolicyConnections options. -type ListIpsecPolicyConnectionsOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListIpsecPolicyConnectionsOptions : Instantiate ListIpsecPolicyConnectionsOptions -func (*VpcV1) NewListIpsecPolicyConnectionsOptions(id string) *ListIpsecPolicyConnectionsOptions { - return &ListIpsecPolicyConnectionsOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ListIpsecPolicyConnectionsOptions) SetID(id string) *ListIpsecPolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIpsecPolicyConnectionsOptions { - options.Headers = param - return options -} - -// ListKeysOptions : The ListKeys options. -type ListKeysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListKeysOptions : Instantiate ListKeysOptions -func (*VpcV1) NewListKeysOptions() *ListKeysOptions { - return &ListKeysOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListKeysOptions) SetStart(start string) *ListKeysOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListKeysOptions) SetLimit(limit int64) *ListKeysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListKeysOptions) SetHeaders(param map[string]string) *ListKeysOptions { - options.Headers = param - return options -} - -// ListLoadBalancerListenerPoliciesOptions : The ListLoadBalancerListenerPolicies options. -type ListLoadBalancerListenerPoliciesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerListenerPoliciesOptions : Instantiate ListLoadBalancerListenerPoliciesOptions -func (*VpcV1) NewListLoadBalancerListenerPoliciesOptions(loadBalancerID string, listenerID string) *ListLoadBalancerListenerPoliciesOptions { - return &ListLoadBalancerListenerPoliciesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPoliciesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPoliciesOptions { - options.Headers = param - return options -} - -// ListLoadBalancerListenerPolicyRulesOptions : The ListLoadBalancerListenerPolicyRules options. -type ListLoadBalancerListenerPolicyRulesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerListenerPolicyRulesOptions : Instantiate ListLoadBalancerListenerPolicyRulesOptions -func (*VpcV1) NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID string, listenerID string, policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - return &ListLoadBalancerListenerPolicyRulesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetPolicyID(policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPolicyRulesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPolicyRulesOptions { - options.Headers = param - return options -} - -// ListLoadBalancerListenersOptions : The ListLoadBalancerListeners options. -type ListLoadBalancerListenersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerListenersOptions : Instantiate ListLoadBalancerListenersOptions -func (*VpcV1) NewListLoadBalancerListenersOptions(loadBalancerID string) *ListLoadBalancerListenersOptions { - return &ListLoadBalancerListenersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenersOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenersOptions { - options.Headers = param - return options -} - -// ListLoadBalancerPoolMembersOptions : The ListLoadBalancerPoolMembers options. -type ListLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerPoolMembersOptions : Instantiate ListLoadBalancerPoolMembersOptions -func (*VpcV1) NewListLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string) *ListLoadBalancerPoolMembersOptions { - return &ListLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *ListLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ListLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolMembersOptions { - options.Headers = param - return options -} - -// ListLoadBalancerPoolsOptions : The ListLoadBalancerPools options. -type ListLoadBalancerPoolsOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerPoolsOptions : Instantiate ListLoadBalancerPoolsOptions -func (*VpcV1) NewListLoadBalancerPoolsOptions(loadBalancerID string) *ListLoadBalancerPoolsOptions { - return &ListLoadBalancerPoolsOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolsOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolsOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolsOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolsOptions { - options.Headers = param - return options -} - -// ListLoadBalancerProfilesOptions : The ListLoadBalancerProfiles options. -type ListLoadBalancerProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancerProfilesOptions : Instantiate ListLoadBalancerProfilesOptions -func (*VpcV1) NewListLoadBalancerProfilesOptions() *ListLoadBalancerProfilesOptions { - return &ListLoadBalancerProfilesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListLoadBalancerProfilesOptions) SetStart(start string) *ListLoadBalancerProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancerProfilesOptions) SetLimit(limit int64) *ListLoadBalancerProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerProfilesOptions) SetHeaders(param map[string]string) *ListLoadBalancerProfilesOptions { - options.Headers = param - return options -} - -// ListLoadBalancersOptions : The ListLoadBalancers options. -type ListLoadBalancersOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLoadBalancersOptions : Instantiate ListLoadBalancersOptions -func (*VpcV1) NewListLoadBalancersOptions() *ListLoadBalancersOptions { - return &ListLoadBalancersOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListLoadBalancersOptions) SetStart(start string) *ListLoadBalancersOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancersOptions) SetLimit(limit int64) *ListLoadBalancersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancersOptions) SetHeaders(param map[string]string) *ListLoadBalancersOptions { - options.Headers = param - return options -} - -// ListNetworkACLRulesOptions : The ListNetworkACLRules options. -type ListNetworkACLRulesOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to rules with a `direction` property matching the specified value. - Direction *string `json:"direction,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListNetworkACLRulesOptions.Direction property. -// Filters the collection to rules with a `direction` property matching the specified value. -const ( - ListNetworkACLRulesOptionsDirectionInboundConst = "inbound" - ListNetworkACLRulesOptionsDirectionOutboundConst = "outbound" -) - -// NewListNetworkACLRulesOptions : Instantiate ListNetworkACLRulesOptions -func (*VpcV1) NewListNetworkACLRulesOptions(networkACLID string) *ListNetworkACLRulesOptions { - return &ListNetworkACLRulesOptions{ - NetworkACLID: core.StringPtr(networkACLID), - } -} - -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *ListNetworkACLRulesOptions) SetNetworkACLID(networkACLID string) *ListNetworkACLRulesOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListNetworkACLRulesOptions) SetStart(start string) *ListNetworkACLRulesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListNetworkACLRulesOptions) SetLimit(limit int64) *ListNetworkACLRulesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetDirection : Allow user to set Direction -func (_options *ListNetworkACLRulesOptions) SetDirection(direction string) *ListNetworkACLRulesOptions { - _options.Direction = core.StringPtr(direction) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListNetworkACLRulesOptions) SetHeaders(param map[string]string) *ListNetworkACLRulesOptions { - options.Headers = param - return options -} - -// ListNetworkAclsOptions : The ListNetworkAcls options. -type ListNetworkAclsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListNetworkAclsOptions : Instantiate ListNetworkAclsOptions -func (*VpcV1) NewListNetworkAclsOptions() *ListNetworkAclsOptions { - return &ListNetworkAclsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListNetworkAclsOptions) SetStart(start string) *ListNetworkAclsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListNetworkAclsOptions) SetLimit(limit int64) *ListNetworkAclsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListNetworkAclsOptions) SetResourceGroupID(resourceGroupID string) *ListNetworkAclsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListNetworkAclsOptions) SetHeaders(param map[string]string) *ListNetworkAclsOptions { - options.Headers = param - return options -} - -// ListNetworkInterfaceFloatingIpsOptions : The ListNetworkInterfaceFloatingIps options. -type ListNetworkInterfaceFloatingIpsOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value - // `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` - // property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListNetworkInterfaceFloatingIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value -// `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` -// property in ascending order. -const ( - ListNetworkInterfaceFloatingIpsOptionsSortAddressConst = "address" - ListNetworkInterfaceFloatingIpsOptionsSortNameConst = "name" -) - -// NewListNetworkInterfaceFloatingIpsOptions : Instantiate ListNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListNetworkInterfaceFloatingIpsOptions(virtualNetworkInterfaceID string) *ListNetworkInterfaceFloatingIpsOptions { - return &ListNetworkInterfaceFloatingIpsOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *ListNetworkInterfaceFloatingIpsOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *ListNetworkInterfaceFloatingIpsOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListNetworkInterfaceFloatingIpsOptions) SetStart(start string) *ListNetworkInterfaceFloatingIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListNetworkInterfaceFloatingIpsOptions) SetLimit(limit int64) *ListNetworkInterfaceFloatingIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListNetworkInterfaceFloatingIpsOptions) SetSort(sort string) *ListNetworkInterfaceFloatingIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} - -// ListOperatingSystemsOptions : The ListOperatingSystems options. -type ListOperatingSystemsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListOperatingSystemsOptions : Instantiate ListOperatingSystemsOptions -func (*VpcV1) NewListOperatingSystemsOptions() *ListOperatingSystemsOptions { - return &ListOperatingSystemsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListOperatingSystemsOptions) SetStart(start string) *ListOperatingSystemsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListOperatingSystemsOptions) SetLimit(limit int64) *ListOperatingSystemsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListOperatingSystemsOptions) SetHeaders(param map[string]string) *ListOperatingSystemsOptions { - options.Headers = param - return options -} - -// ListPlacementGroupsOptions : The ListPlacementGroups options. -type ListPlacementGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListPlacementGroupsOptions : Instantiate ListPlacementGroupsOptions -func (*VpcV1) NewListPlacementGroupsOptions() *ListPlacementGroupsOptions { - return &ListPlacementGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListPlacementGroupsOptions) SetStart(start string) *ListPlacementGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListPlacementGroupsOptions) SetLimit(limit int64) *ListPlacementGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListPlacementGroupsOptions) SetHeaders(param map[string]string) *ListPlacementGroupsOptions { - options.Headers = param - return options -} - -// ListPublicGatewaysOptions : The ListPublicGateways options. -type ListPublicGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListPublicGatewaysOptions : Instantiate ListPublicGatewaysOptions -func (*VpcV1) NewListPublicGatewaysOptions() *ListPublicGatewaysOptions { - return &ListPublicGatewaysOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListPublicGatewaysOptions) SetStart(start string) *ListPublicGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListPublicGatewaysOptions) SetLimit(limit int64) *ListPublicGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListPublicGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListPublicGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListPublicGatewaysOptions) SetHeaders(param map[string]string) *ListPublicGatewaysOptions { - options.Headers = param - return options -} - -// ListRegionZonesOptions : The ListRegionZones options. -type ListRegionZonesOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListRegionZonesOptions : Instantiate ListRegionZonesOptions -func (*VpcV1) NewListRegionZonesOptions(regionName string) *ListRegionZonesOptions { - return &ListRegionZonesOptions{ - RegionName: core.StringPtr(regionName), - } -} - -// SetRegionName : Allow user to set RegionName -func (_options *ListRegionZonesOptions) SetRegionName(regionName string) *ListRegionZonesOptions { - _options.RegionName = core.StringPtr(regionName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListRegionZonesOptions) SetHeaders(param map[string]string) *ListRegionZonesOptions { - options.Headers = param - return options -} - -// ListRegionsOptions : The ListRegions options. -type ListRegionsOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListRegionsOptions : Instantiate ListRegionsOptions -func (*VpcV1) NewListRegionsOptions() *ListRegionsOptions { - return &ListRegionsOptions{} -} - -// SetHeaders : Allow user to set Headers -func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { - options.Headers = param - return options -} - -// ListReservationsOptions : The ListReservations options. -type ListReservationsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListReservationsOptions : Instantiate ListReservationsOptions -func (*VpcV1) NewListReservationsOptions() *ListReservationsOptions { - return &ListReservationsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListReservationsOptions) SetStart(start string) *ListReservationsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListReservationsOptions) SetLimit(limit int64) *ListReservationsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListReservationsOptions) SetName(name string) *ListReservationsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListReservationsOptions) SetResourceGroupID(resourceGroupID string) *ListReservationsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListReservationsOptions) SetZoneName(zoneName string) *ListReservationsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListReservationsOptions) SetHeaders(param map[string]string) *ListReservationsOptions { - options.Headers = param - return options -} - -// ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. -type ListSecurityGroupRulesOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListSecurityGroupRulesOptions : Instantiate ListSecurityGroupRulesOptions -func (*VpcV1) NewListSecurityGroupRulesOptions(securityGroupID string) *ListSecurityGroupRulesOptions { - return &ListSecurityGroupRulesOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupRulesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupRulesOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupRulesOptions) SetHeaders(param map[string]string) *ListSecurityGroupRulesOptions { - options.Headers = param - return options -} - -// ListSecurityGroupTargetsOptions : The ListSecurityGroupTargets options. -type ListSecurityGroupTargetsOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListSecurityGroupTargetsOptions : Instantiate ListSecurityGroupTargetsOptions -func (*VpcV1) NewListSecurityGroupTargetsOptions(securityGroupID string) *ListSecurityGroupTargetsOptions { - return &ListSecurityGroupTargetsOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupTargetsOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupTargetsOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupTargetsOptions) SetStart(start string) *ListSecurityGroupTargetsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupTargetsOptions) SetLimit(limit int64) *ListSecurityGroupTargetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupTargetsOptions) SetHeaders(param map[string]string) *ListSecurityGroupTargetsOptions { - options.Headers = param - return options -} - -// ListSecurityGroupsOptions : The ListSecurityGroups options. -type ListSecurityGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListSecurityGroupsOptions : Instantiate ListSecurityGroupsOptions -func (*VpcV1) NewListSecurityGroupsOptions() *ListSecurityGroupsOptions { - return &ListSecurityGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupsOptions) SetStart(start string) *ListSecurityGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupsOptions) SetLimit(limit int64) *ListSecurityGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSecurityGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSecurityGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListSecurityGroupsOptions) SetVPCID(vpcID string) *ListSecurityGroupsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListSecurityGroupsOptions) SetVPCCRN(vpcCRN string) *ListSecurityGroupsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListSecurityGroupsOptions) SetVPCName(vpcName string) *ListSecurityGroupsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupsOptions) SetHeaders(param map[string]string) *ListSecurityGroupsOptions { - options.Headers = param - return options -} - -// ListShareMountTargetsOptions : The ListShareMountTargets options. -type ListShareMountTargetsOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListShareMountTargetsOptions : Instantiate ListShareMountTargetsOptions -func (*VpcV1) NewListShareMountTargetsOptions(shareID string) *ListShareMountTargetsOptions { - return &ListShareMountTargetsOptions{ - ShareID: core.StringPtr(shareID), - } -} - -// SetShareID : Allow user to set ShareID -func (_options *ListShareMountTargetsOptions) SetShareID(shareID string) *ListShareMountTargetsOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListShareMountTargetsOptions) SetName(name string) *ListShareMountTargetsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListShareMountTargetsOptions) SetStart(start string) *ListShareMountTargetsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListShareMountTargetsOptions) SetLimit(limit int64) *ListShareMountTargetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListShareMountTargetsOptions) SetHeaders(param map[string]string) *ListShareMountTargetsOptions { - options.Headers = param - return options -} - -// ListShareProfilesOptions : The ListShareProfiles options. -type ListShareProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListShareProfilesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListShareProfilesOptionsSortCreatedAtConst = "created_at" - ListShareProfilesOptionsSortNameConst = "name" -) - -// NewListShareProfilesOptions : Instantiate ListShareProfilesOptions -func (*VpcV1) NewListShareProfilesOptions() *ListShareProfilesOptions { - return &ListShareProfilesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListShareProfilesOptions) SetStart(start string) *ListShareProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListShareProfilesOptions) SetLimit(limit int64) *ListShareProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListShareProfilesOptions) SetSort(sort string) *ListShareProfilesOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListShareProfilesOptions) SetHeaders(param map[string]string) *ListShareProfilesOptions { - options.Headers = param - return options -} - -// ListSharesOptions : The ListShares options. -type ListSharesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to file shares with a `replication_role` property matching the specified value. - ReplicationRole *string `json:"replication_role,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListSharesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSharesOptionsSortCreatedAtConst = "created_at" - ListSharesOptionsSortNameConst = "name" -) - -// Constants associated with the ListSharesOptions.ReplicationRole property. -// Filters the collection to file shares with a `replication_role` property matching the specified value. -const ( - ListSharesOptionsReplicationRoleNoneConst = "none" - ListSharesOptionsReplicationRoleReplicaConst = "replica" - ListSharesOptionsReplicationRoleSourceConst = "source" -) - -// NewListSharesOptions : Instantiate ListSharesOptions -func (*VpcV1) NewListSharesOptions() *ListSharesOptions { - return &ListSharesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSharesOptions) SetStart(start string) *ListSharesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSharesOptions) SetLimit(limit int64) *ListSharesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSharesOptions) SetResourceGroupID(resourceGroupID string) *ListSharesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListSharesOptions) SetName(name string) *ListSharesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListSharesOptions) SetSort(sort string) *ListSharesOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetReplicationRole : Allow user to set ReplicationRole -func (_options *ListSharesOptions) SetReplicationRole(replicationRole string) *ListSharesOptions { - _options.ReplicationRole = core.StringPtr(replicationRole) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSharesOptions) SetHeaders(param map[string]string) *ListSharesOptions { - options.Headers = param - return options -} - -// ListSnapshotClonesOptions : The ListSnapshotClones options. -type ListSnapshotClonesOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListSnapshotClonesOptions : Instantiate ListSnapshotClonesOptions -func (*VpcV1) NewListSnapshotClonesOptions(id string) *ListSnapshotClonesOptions { - return &ListSnapshotClonesOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ListSnapshotClonesOptions) SetID(id string) *ListSnapshotClonesOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotClonesOptions) SetHeaders(param map[string]string) *ListSnapshotClonesOptions { - options.Headers = param - return options -} - -// ListSnapshotConsistencyGroupsOptions : The ListSnapshotConsistencyGroups options. -type ListSnapshotConsistencyGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified - // identifier. - BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListSnapshotConsistencyGroupsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSnapshotConsistencyGroupsOptionsSortCreatedAtConst = "created_at" - ListSnapshotConsistencyGroupsOptionsSortNameConst = "name" -) - -// NewListSnapshotConsistencyGroupsOptions : Instantiate ListSnapshotConsistencyGroupsOptions -func (*VpcV1) NewListSnapshotConsistencyGroupsOptions() *ListSnapshotConsistencyGroupsOptions { - return &ListSnapshotConsistencyGroupsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSnapshotConsistencyGroupsOptions) SetStart(start string) *ListSnapshotConsistencyGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSnapshotConsistencyGroupsOptions) SetLimit(limit int64) *ListSnapshotConsistencyGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSnapshotConsistencyGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotConsistencyGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListSnapshotConsistencyGroupsOptions) SetName(name string) *ListSnapshotConsistencyGroupsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListSnapshotConsistencyGroupsOptions) SetSort(sort string) *ListSnapshotConsistencyGroupsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID -func (_options *ListSnapshotConsistencyGroupsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListSnapshotConsistencyGroupsOptions { - _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotConsistencyGroupsOptions) SetHeaders(param map[string]string) *ListSnapshotConsistencyGroupsOptions { - options.Headers = param - return options -} - -// ListSnapshotsOptions : The ListSnapshots options. -type ListSnapshotsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. - Tag *string `json:"tag,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `source_volume.id` property matching the specified identifier. - SourceVolumeID *string `json:"source_volume.id,omitempty"` - - // Filters the collection to resources with a `source_volume.crn` property matching the specified CRN. - SourceVolumeCRN *string `json:"source_volume.crn,omitempty"` - - // Filters the collection to resources with a `source_image.id` property matching the specified identifier. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageID *string `json:"source_image.id,omitempty"` - - // Filters the collection to resources with a `source_image.crn` property matching the specified CRN. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageCRN *string `json:"source_image.crn,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified - // identifier. - BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` - - // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the - // specified identifier. - CopiesID *string `json:"copies[].id,omitempty"` - - // Filters the collection to snapshots with an item in the `copies` property with a `name` property matching the exact - // specified name. - CopiesName *string `json:"copies[].name,omitempty"` - - // Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the - // specified CRN. - CopiesCRN *string `json:"copies[].crn,omitempty"` - - // Filters the collection to snapshots with an item in the `copies` property with a - // `remote.region.name` property matching the exact specified name. - CopiesRemoteRegionName *string `json:"copies[].remote.region.name,omitempty"` - - // Filters the collection to resources with a `source_snapshot.id` property matching the specified identifier. - SourceSnapshotID *string `json:"source_snapshot.id,omitempty"` - - // Filters the collection to resources with a `source_snapshot.remote.region.name` property matching the exact - // specified name. - SourceSnapshotRemoteRegionName *string `json:"source_snapshot.remote.region.name,omitempty"` - - // Filters the collection to resources with a `source_volume.remote.region.name` property matching the exact specified - // name. - SourceVolumeRemoteRegionName *string `json:"source_volume.remote.region.name,omitempty"` - - // Filters the collection to resources with a `source_image.remote.region.name` property matching the exact specified - // name. - SourceImageRemoteRegionName *string `json:"source_image.remote.region.name,omitempty"` - - // Filters the collection to snapshots with an item in the `clones` property with a `zone.name` property matching the - // exact specified name. - ClonesZoneName *string `json:"clones[].zone.name,omitempty"` - - // Filters the collection to resources with a `snapshot_consistency_group.id` property matching the specified - // identifier. - SnapshotConsistencyGroupID *string `json:"snapshot_consistency_group.id,omitempty"` - - // Filters the collection to resources with a `snapshot_consistency_group.crn` property matching the specified - // identifier. - SnapshotConsistencyGroupCRN *string `json:"snapshot_consistency_group.crn,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListSnapshotsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSnapshotsOptionsSortCreatedAtConst = "created_at" - ListSnapshotsOptionsSortNameConst = "name" -) - -// NewListSnapshotsOptions : Instantiate ListSnapshotsOptions -func (*VpcV1) NewListSnapshotsOptions() *ListSnapshotsOptions { - return &ListSnapshotsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSnapshotsOptions) SetStart(start string) *ListSnapshotsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSnapshotsOptions) SetLimit(limit int64) *ListSnapshotsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetTag : Allow user to set Tag -func (_options *ListSnapshotsOptions) SetTag(tag string) *ListSnapshotsOptions { - _options.Tag = core.StringPtr(tag) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSnapshotsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListSnapshotsOptions) SetName(name string) *ListSnapshotsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *ListSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *ListSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) - return _options -} - -// SetSourceVolumeCRN : Allow user to set SourceVolumeCRN -func (_options *ListSnapshotsOptions) SetSourceVolumeCRN(sourceVolumeCRN string) *ListSnapshotsOptions { - _options.SourceVolumeCRN = core.StringPtr(sourceVolumeCRN) - return _options -} - -// SetSourceImageID : Allow user to set SourceImageID -func (_options *ListSnapshotsOptions) SetSourceImageID(sourceImageID string) *ListSnapshotsOptions { - _options.SourceImageID = core.StringPtr(sourceImageID) - return _options -} - -// SetSourceImageCRN : Allow user to set SourceImageCRN -func (_options *ListSnapshotsOptions) SetSourceImageCRN(sourceImageCRN string) *ListSnapshotsOptions { - _options.SourceImageCRN = core.StringPtr(sourceImageCRN) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListSnapshotsOptions) SetSort(sort string) *ListSnapshotsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetBackupPolicyPlanID : Allow user to set BackupPolicyPlanID -func (_options *ListSnapshotsOptions) SetBackupPolicyPlanID(backupPolicyPlanID string) *ListSnapshotsOptions { - _options.BackupPolicyPlanID = core.StringPtr(backupPolicyPlanID) - return _options -} - -// SetCopiesID : Allow user to set CopiesID -func (_options *ListSnapshotsOptions) SetCopiesID(copiesID string) *ListSnapshotsOptions { - _options.CopiesID = core.StringPtr(copiesID) - return _options -} - -// SetCopiesName : Allow user to set CopiesName -func (_options *ListSnapshotsOptions) SetCopiesName(copiesName string) *ListSnapshotsOptions { - _options.CopiesName = core.StringPtr(copiesName) - return _options -} - -// SetCopiesCRN : Allow user to set CopiesCRN -func (_options *ListSnapshotsOptions) SetCopiesCRN(copiesCRN string) *ListSnapshotsOptions { - _options.CopiesCRN = core.StringPtr(copiesCRN) - return _options -} - -// SetCopiesRemoteRegionName : Allow user to set CopiesRemoteRegionName -func (_options *ListSnapshotsOptions) SetCopiesRemoteRegionName(copiesRemoteRegionName string) *ListSnapshotsOptions { - _options.CopiesRemoteRegionName = core.StringPtr(copiesRemoteRegionName) - return _options -} - -// SetSourceSnapshotID : Allow user to set SourceSnapshotID -func (_options *ListSnapshotsOptions) SetSourceSnapshotID(sourceSnapshotID string) *ListSnapshotsOptions { - _options.SourceSnapshotID = core.StringPtr(sourceSnapshotID) - return _options -} - -// SetSourceSnapshotRemoteRegionName : Allow user to set SourceSnapshotRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceSnapshotRemoteRegionName(sourceSnapshotRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceSnapshotRemoteRegionName = core.StringPtr(sourceSnapshotRemoteRegionName) - return _options -} - -// SetSourceVolumeRemoteRegionName : Allow user to set SourceVolumeRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceVolumeRemoteRegionName(sourceVolumeRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceVolumeRemoteRegionName = core.StringPtr(sourceVolumeRemoteRegionName) - return _options -} - -// SetSourceImageRemoteRegionName : Allow user to set SourceImageRemoteRegionName -func (_options *ListSnapshotsOptions) SetSourceImageRemoteRegionName(sourceImageRemoteRegionName string) *ListSnapshotsOptions { - _options.SourceImageRemoteRegionName = core.StringPtr(sourceImageRemoteRegionName) - return _options -} - -// SetClonesZoneName : Allow user to set ClonesZoneName -func (_options *ListSnapshotsOptions) SetClonesZoneName(clonesZoneName string) *ListSnapshotsOptions { - _options.ClonesZoneName = core.StringPtr(clonesZoneName) - return _options -} - -// SetSnapshotConsistencyGroupID : Allow user to set SnapshotConsistencyGroupID -func (_options *ListSnapshotsOptions) SetSnapshotConsistencyGroupID(snapshotConsistencyGroupID string) *ListSnapshotsOptions { - _options.SnapshotConsistencyGroupID = core.StringPtr(snapshotConsistencyGroupID) - return _options -} - -// SetSnapshotConsistencyGroupCRN : Allow user to set SnapshotConsistencyGroupCRN -func (_options *ListSnapshotsOptions) SetSnapshotConsistencyGroupCRN(snapshotConsistencyGroupCRN string) *ListSnapshotsOptions { - _options.SnapshotConsistencyGroupCRN = core.StringPtr(snapshotConsistencyGroupCRN) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotsOptions) SetHeaders(param map[string]string) *ListSnapshotsOptions { - options.Headers = param - return options -} - -// ListSubnetReservedIpsOptions : The ListSubnetReservedIps options. -type ListSubnetReservedIpsOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to resources with a `target.id` property matching the specified identifier. - TargetID *string `json:"target.id,omitempty"` - - // Filters the collection to resources with a `target.crn` property matching the specified CRN. - TargetCRN *string `json:"target.crn,omitempty"` - - // Filters the collection to resources with a `target.name` property matching the exact specified name. - TargetName *string `json:"target.name,omitempty"` - - // Filters the collection to resources with a `target.resource_type` property matching the specified value. - TargetResourceType *string `json:"target.resource_type,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListSubnetReservedIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSubnetReservedIpsOptionsSortAddressConst = "address" - ListSubnetReservedIpsOptionsSortCreatedAtConst = "created_at" - ListSubnetReservedIpsOptionsSortNameConst = "name" -) - -// NewListSubnetReservedIpsOptions : Instantiate ListSubnetReservedIpsOptions -func (*VpcV1) NewListSubnetReservedIpsOptions(subnetID string) *ListSubnetReservedIpsOptions { - return &ListSubnetReservedIpsOptions{ - SubnetID: core.StringPtr(subnetID), - } -} - -// SetSubnetID : Allow user to set SubnetID -func (_options *ListSubnetReservedIpsOptions) SetSubnetID(subnetID string) *ListSubnetReservedIpsOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListSubnetReservedIpsOptions) SetStart(start string) *ListSubnetReservedIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSubnetReservedIpsOptions) SetLimit(limit int64) *ListSubnetReservedIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListSubnetReservedIpsOptions) SetSort(sort string) *ListSubnetReservedIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetTargetID : Allow user to set TargetID -func (_options *ListSubnetReservedIpsOptions) SetTargetID(targetID string) *ListSubnetReservedIpsOptions { - _options.TargetID = core.StringPtr(targetID) - return _options -} - -// SetTargetCRN : Allow user to set TargetCRN -func (_options *ListSubnetReservedIpsOptions) SetTargetCRN(targetCRN string) *ListSubnetReservedIpsOptions { - _options.TargetCRN = core.StringPtr(targetCRN) - return _options -} - -// SetTargetName : Allow user to set TargetName -func (_options *ListSubnetReservedIpsOptions) SetTargetName(targetName string) *ListSubnetReservedIpsOptions { - _options.TargetName = core.StringPtr(targetName) - return _options -} - -// SetTargetResourceType : Allow user to set TargetResourceType -func (_options *ListSubnetReservedIpsOptions) SetTargetResourceType(targetResourceType string) *ListSubnetReservedIpsOptions { - _options.TargetResourceType = core.StringPtr(targetResourceType) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSubnetReservedIpsOptions) SetHeaders(param map[string]string) *ListSubnetReservedIpsOptions { - options.Headers = param - return options -} - -// ListSubnetsOptions : The ListSubnets options. -type ListSubnetsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Filters the collection to resources with a `vpc.id` property matching the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to subnets with a `routing_table.id` property matching the specified identifier. - RoutingTableID *string `json:"routing_table.id,omitempty"` - - // Filters the collection to subnets with a `routing_table.name` property matching the exact specified name. - RoutingTableName *string `json:"routing_table.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListSubnetsOptions : Instantiate ListSubnetsOptions -func (*VpcV1) NewListSubnetsOptions() *ListSubnetsOptions { - return &ListSubnetsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSubnetsOptions) SetStart(start string) *ListSubnetsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSubnetsOptions) SetLimit(limit int64) *ListSubnetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSubnetsOptions) SetResourceGroupID(resourceGroupID string) *ListSubnetsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListSubnetsOptions) SetZoneName(zoneName string) *ListSubnetsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListSubnetsOptions) SetVPCID(vpcID string) *ListSubnetsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListSubnetsOptions) SetVPCCRN(vpcCRN string) *ListSubnetsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListSubnetsOptions) SetVPCName(vpcName string) *ListSubnetsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListSubnetsOptions) SetRoutingTableID(routingTableID string) *ListSubnetsOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetRoutingTableName : Allow user to set RoutingTableName -func (_options *ListSubnetsOptions) SetRoutingTableName(routingTableName string) *ListSubnetsOptions { - _options.RoutingTableName = core.StringPtr(routingTableName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListSubnetsOptions) SetHeaders(param map[string]string) *ListSubnetsOptions { - options.Headers = param - return options -} - -// ListVirtualNetworkInterfaceIpsOptions : The ListVirtualNetworkInterfaceIps options. -type ListVirtualNetworkInterfaceIpsOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value - // `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` - // property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVirtualNetworkInterfaceIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value -// `-name` sorts the collection by the `name` property in descending order, and the value `name` sorts it by the `name` -// property in ascending order. -const ( - ListVirtualNetworkInterfaceIpsOptionsSortAddressConst = "address" - ListVirtualNetworkInterfaceIpsOptionsSortNameConst = "name" -) - -// NewListVirtualNetworkInterfaceIpsOptions : Instantiate ListVirtualNetworkInterfaceIpsOptions -func (*VpcV1) NewListVirtualNetworkInterfaceIpsOptions(virtualNetworkInterfaceID string) *ListVirtualNetworkInterfaceIpsOptions { - return &ListVirtualNetworkInterfaceIpsOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *ListVirtualNetworkInterfaceIpsOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *ListVirtualNetworkInterfaceIpsOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVirtualNetworkInterfaceIpsOptions) SetStart(start string) *ListVirtualNetworkInterfaceIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVirtualNetworkInterfaceIpsOptions) SetLimit(limit int64) *ListVirtualNetworkInterfaceIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVirtualNetworkInterfaceIpsOptions) SetSort(sort string) *ListVirtualNetworkInterfaceIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVirtualNetworkInterfaceIpsOptions) SetHeaders(param map[string]string) *ListVirtualNetworkInterfaceIpsOptions { - options.Headers = param - return options -} - -// ListVirtualNetworkInterfacesOptions : The ListVirtualNetworkInterfaces options. -type ListVirtualNetworkInterfacesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVirtualNetworkInterfacesOptions : Instantiate ListVirtualNetworkInterfacesOptions -func (*VpcV1) NewListVirtualNetworkInterfacesOptions() *ListVirtualNetworkInterfacesOptions { - return &ListVirtualNetworkInterfacesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListVirtualNetworkInterfacesOptions) SetStart(start string) *ListVirtualNetworkInterfacesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVirtualNetworkInterfacesOptions) SetLimit(limit int64) *ListVirtualNetworkInterfacesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVirtualNetworkInterfacesOptions) SetResourceGroupID(resourceGroupID string) *ListVirtualNetworkInterfacesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListVirtualNetworkInterfacesOptions { - options.Headers = param - return options -} - -// ListVolumeProfilesOptions : The ListVolumeProfiles options. -type ListVolumeProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVolumeProfilesOptions : Instantiate ListVolumeProfilesOptions -func (*VpcV1) NewListVolumeProfilesOptions() *ListVolumeProfilesOptions { - return &ListVolumeProfilesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListVolumeProfilesOptions) SetStart(start string) *ListVolumeProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVolumeProfilesOptions) SetLimit(limit int64) *ListVolumeProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVolumeProfilesOptions) SetHeaders(param map[string]string) *ListVolumeProfilesOptions { - options.Headers = param - return options -} - -// ListVolumesOptions : The ListVolumes options. -type ListVolumesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to volumes with an `attachment_state` property matching the specified value. - AttachmentState *string `json:"attachment_state,omitempty"` - - // Filters the collection to resources with an `encryption` property matching the specified value. - Encryption *string `json:"encryption,omitempty"` - - // Filters the collection to resources with an `operating_system.family` property matching the specified operating - // system family. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // operating system or any operating system, respectively. - OperatingSystemFamily *string `json:"operating_system.family,omitempty"` - - // Filters the collection to resources with an `operating_system.architecture` property matching the specified - // operating system architecture. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // operating system or any operating system, respectively. - OperatingSystemArchitecture *string `json:"operating_system.architecture,omitempty"` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVolumesOptions.AttachmentState property. -// Filters the collection to volumes with an `attachment_state` property matching the specified value. -const ( - ListVolumesOptionsAttachmentStateAttachedConst = "attached" - ListVolumesOptionsAttachmentStateUnattachedConst = "unattached" - ListVolumesOptionsAttachmentStateUnusableConst = "unusable" -) - -// Constants associated with the ListVolumesOptions.Encryption property. -// Filters the collection to resources with an `encryption` property matching the specified value. -const ( - ListVolumesOptionsEncryptionProviderManagedConst = "provider_managed" - ListVolumesOptionsEncryptionUserManagedConst = "user_managed" -) - -// NewListVolumesOptions : Instantiate ListVolumesOptions -func (*VpcV1) NewListVolumesOptions() *ListVolumesOptions { - return &ListVolumesOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListVolumesOptions) SetStart(start string) *ListVolumesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVolumesOptions) SetLimit(limit int64) *ListVolumesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListVolumesOptions) SetName(name string) *ListVolumesOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetAttachmentState : Allow user to set AttachmentState -func (_options *ListVolumesOptions) SetAttachmentState(attachmentState string) *ListVolumesOptions { - _options.AttachmentState = core.StringPtr(attachmentState) - return _options -} - -// SetEncryption : Allow user to set Encryption -func (_options *ListVolumesOptions) SetEncryption(encryption string) *ListVolumesOptions { - _options.Encryption = core.StringPtr(encryption) - return _options -} - -// SetOperatingSystemFamily : Allow user to set OperatingSystemFamily -func (_options *ListVolumesOptions) SetOperatingSystemFamily(operatingSystemFamily string) *ListVolumesOptions { - _options.OperatingSystemFamily = core.StringPtr(operatingSystemFamily) - return _options -} - -// SetOperatingSystemArchitecture : Allow user to set OperatingSystemArchitecture -func (_options *ListVolumesOptions) SetOperatingSystemArchitecture(operatingSystemArchitecture string) *ListVolumesOptions { - _options.OperatingSystemArchitecture = core.StringPtr(operatingSystemArchitecture) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListVolumesOptions) SetZoneName(zoneName string) *ListVolumesOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVolumesOptions) SetHeaders(param map[string]string) *ListVolumesOptions { - options.Headers = param - return options -} - -// ListVPCAddressPrefixesOptions : The ListVPCAddressPrefixes options. -type ListVPCAddressPrefixesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPCAddressPrefixesOptions : Instantiate ListVPCAddressPrefixesOptions -func (*VpcV1) NewListVPCAddressPrefixesOptions(vpcID string) *ListVPCAddressPrefixesOptions { - return &ListVPCAddressPrefixesOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCAddressPrefixesOptions) SetVPCID(vpcID string) *ListVPCAddressPrefixesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCAddressPrefixesOptions) SetStart(start string) *ListVPCAddressPrefixesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCAddressPrefixesOptions) SetLimit(limit int64) *ListVPCAddressPrefixesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPCAddressPrefixesOptions) SetHeaders(param map[string]string) *ListVPCAddressPrefixesOptions { - options.Headers = param - return options -} - -// ListVPCDnsResolutionBindingsOptions : The ListVPCDnsResolutionBindings options. -type ListVPCDnsResolutionBindingsOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources with a `vpc.crn` property matching the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` - - // Filters the collection to resources with a `vpc.name` property matching the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` - - // Filters the collection to resources with a `vpc.remote.account.id` property matching the specified account - // identifier. - AccountID *string `json:"account.id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPCDnsResolutionBindingsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPCDnsResolutionBindingsOptionsSortCreatedAtConst = "created_at" - ListVPCDnsResolutionBindingsOptionsSortNameConst = "name" -) - -// NewListVPCDnsResolutionBindingsOptions : Instantiate ListVPCDnsResolutionBindingsOptions -func (*VpcV1) NewListVPCDnsResolutionBindingsOptions(vpcID string) *ListVPCDnsResolutionBindingsOptions { - return &ListVPCDnsResolutionBindingsOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCID(vpcID string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPCDnsResolutionBindingsOptions) SetSort(sort string) *ListVPCDnsResolutionBindingsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCDnsResolutionBindingsOptions) SetStart(start string) *ListVPCDnsResolutionBindingsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCDnsResolutionBindingsOptions) SetLimit(limit int64) *ListVPCDnsResolutionBindingsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListVPCDnsResolutionBindingsOptions) SetName(name string) *ListVPCDnsResolutionBindingsOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCCRN(vpcCRN string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} - -// SetVPCName : Allow user to set VPCName -func (_options *ListVPCDnsResolutionBindingsOptions) SetVPCName(vpcName string) *ListVPCDnsResolutionBindingsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} - -// SetAccountID : Allow user to set AccountID -func (_options *ListVPCDnsResolutionBindingsOptions) SetAccountID(accountID string) *ListVPCDnsResolutionBindingsOptions { - _options.AccountID = core.StringPtr(accountID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPCDnsResolutionBindingsOptions) SetHeaders(param map[string]string) *ListVPCDnsResolutionBindingsOptions { - options.Headers = param - return options -} - -// ListVPCRoutesOptions : The ListVPCRoutes options. -type ListVPCRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // Filters the collection to resources with a `zone.name` property matching the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPCRoutesOptions : Instantiate ListVPCRoutesOptions -func (*VpcV1) NewListVPCRoutesOptions(vpcID string) *ListVPCRoutesOptions { - return &ListVPCRoutesOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListVPCRoutesOptions) SetZoneName(zoneName string) *ListVPCRoutesOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutesOptions) SetStart(start string) *ListVPCRoutesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutesOptions) SetLimit(limit int64) *ListVPCRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutesOptions { - options.Headers = param - return options -} - -// ListVPCRoutingTableRoutesOptions : The ListVPCRoutingTableRoutes options. -type ListVPCRoutingTableRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPCRoutingTableRoutesOptions : Instantiate ListVPCRoutingTableRoutesOptions -func (*VpcV1) NewListVPCRoutingTableRoutesOptions(vpcID string, routingTableID string) *ListVPCRoutingTableRoutesOptions { - return &ListVPCRoutingTableRoutesOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTableRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutingTableRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListVPCRoutingTableRoutesOptions) SetRoutingTableID(routingTableID string) *ListVPCRoutingTableRoutesOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTableRoutesOptions) SetStart(start string) *ListVPCRoutingTableRoutesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTableRoutesOptions) SetLimit(limit int64) *ListVPCRoutingTableRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTableRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTableRoutesOptions { - options.Headers = param - return options -} - -// ListVPCRoutingTablesOptions : The ListVPCRoutingTables options. -type ListVPCRoutingTablesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to routing tables with an `is_default` property matching the specified value. - IsDefault *bool `json:"is_default,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPCRoutingTablesOptions : Instantiate ListVPCRoutingTablesOptions -func (*VpcV1) NewListVPCRoutingTablesOptions(vpcID string) *ListVPCRoutingTablesOptions { - return &ListVPCRoutingTablesOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTablesOptions) SetVPCID(vpcID string) *ListVPCRoutingTablesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTablesOptions) SetStart(start string) *ListVPCRoutingTablesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTablesOptions) SetLimit(limit int64) *ListVPCRoutingTablesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetIsDefault : Allow user to set IsDefault -func (_options *ListVPCRoutingTablesOptions) SetIsDefault(isDefault bool) *ListVPCRoutingTablesOptions { - _options.IsDefault = core.BoolPtr(isDefault) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTablesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTablesOptions { - options.Headers = param - return options -} - -// ListVpcsOptions : The ListVpcs options. -type ListVpcsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to VPCs with a `classic_access` property matching the specified value. - ClassicAccess *bool `json:"classic_access,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVpcsOptions : Instantiate ListVpcsOptions -func (*VpcV1) NewListVpcsOptions() *ListVpcsOptions { - return &ListVpcsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListVpcsOptions) SetStart(start string) *ListVpcsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVpcsOptions) SetLimit(limit int64) *ListVpcsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVpcsOptions) SetResourceGroupID(resourceGroupID string) *ListVpcsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *ListVpcsOptions) SetClassicAccess(classicAccess bool) *ListVpcsOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOptions { - options.Headers = param - return options -} - -// ListVPNGatewayConnectionLocalCIDRsOptions : The ListVPNGatewayConnectionLocalCIDRs options. -type ListVPNGatewayConnectionLocalCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPNGatewayConnectionLocalCIDRsOptions : Instantiate ListVPNGatewayConnectionLocalCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionLocalCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - return &ListVPNGatewayConnectionLocalCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionLocalCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionLocalCIDRsOptions { - options.Headers = param - return options -} - -// ListVPNGatewayConnectionPeerCIDRsOptions : The ListVPNGatewayConnectionPeerCIDRs options. -type ListVPNGatewayConnectionPeerCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPNGatewayConnectionPeerCIDRsOptions : Instantiate ListVPNGatewayConnectionPeerCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionPeerCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - return &ListVPNGatewayConnectionPeerCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionPeerCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionPeerCIDRsOptions { - options.Headers = param - return options -} - -// ListVPNGatewayConnectionsOptions : The ListVPNGatewayConnections options. -type ListVPNGatewayConnectionsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // Filters the collection to VPN gateway connections with a `status` property matching the specified value. - Status *string `json:"status,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPNGatewayConnectionsOptions.Status property. -// Filters the collection to VPN gateway connections with a `status` property matching the specified value. -const ( - ListVPNGatewayConnectionsOptionsStatusDownConst = "down" - ListVPNGatewayConnectionsOptionsStatusUpConst = "up" -) - -// NewListVPNGatewayConnectionsOptions : Instantiate ListVPNGatewayConnectionsOptions -func (*VpcV1) NewListVPNGatewayConnectionsOptions(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - return &ListVPNGatewayConnectionsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListVPNGatewayConnectionsOptions) SetStatus(status string) *ListVPNGatewayConnectionsOptions { - _options.Status = core.StringPtr(status) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionsOptions { - options.Headers = param - return options -} - -// ListVPNGatewaysOptions : The ListVPNGateways options. -type ListVPNGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Filters the collection to VPN gateways with a `mode` property matching the specified value. - Mode *string `json:"mode,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPNGatewaysOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPNGatewaysOptionsSortCreatedAtConst = "created_at" - ListVPNGatewaysOptionsSortNameConst = "name" -) - -// Constants associated with the ListVPNGatewaysOptions.Mode property. -// Filters the collection to VPN gateways with a `mode` property matching the specified value. -const ( - ListVPNGatewaysOptionsModePolicyConst = "policy" - ListVPNGatewaysOptionsModeRouteConst = "route" -) - -// NewListVPNGatewaysOptions : Instantiate ListVPNGatewaysOptions -func (*VpcV1) NewListVPNGatewaysOptions() *ListVPNGatewaysOptions { - return &ListVPNGatewaysOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListVPNGatewaysOptions) SetStart(start string) *ListVPNGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPNGatewaysOptions) SetLimit(limit int64) *ListVPNGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVPNGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListVPNGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPNGatewaysOptions) SetSort(sort string) *ListVPNGatewaysOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetMode : Allow user to set Mode -func (_options *ListVPNGatewaysOptions) SetMode(mode string) *ListVPNGatewaysOptions { - _options.Mode = core.StringPtr(mode) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewaysOptions) SetHeaders(param map[string]string) *ListVPNGatewaysOptions { - options.Headers = param - return options -} - -// ListVPNServerClientsOptions : The ListVPNServerClients options. -type ListVPNServerClientsOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPNServerClientsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order. -const ( - ListVPNServerClientsOptionsSortCreatedAtConst = "created_at" -) - -// NewListVPNServerClientsOptions : Instantiate ListVPNServerClientsOptions -func (*VpcV1) NewListVPNServerClientsOptions(vpnServerID string) *ListVPNServerClientsOptions { - return &ListVPNServerClientsOptions{ - VPNServerID: core.StringPtr(vpnServerID), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *ListVPNServerClientsOptions) SetVPNServerID(vpnServerID string) *ListVPNServerClientsOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPNServerClientsOptions) SetStart(start string) *ListVPNServerClientsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPNServerClientsOptions) SetLimit(limit int64) *ListVPNServerClientsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPNServerClientsOptions) SetSort(sort string) *ListVPNServerClientsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNServerClientsOptions) SetHeaders(param map[string]string) *ListVPNServerClientsOptions { - options.Headers = param - return options -} - -// ListVPNServerRoutesOptions : The ListVPNServerRoutes options. -type ListVPNServerRoutesOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPNServerRoutesOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPNServerRoutesOptionsSortCreatedAtConst = "created_at" - ListVPNServerRoutesOptionsSortNameConst = "name" -) - -// NewListVPNServerRoutesOptions : Instantiate ListVPNServerRoutesOptions -func (*VpcV1) NewListVPNServerRoutesOptions(vpnServerID string) *ListVPNServerRoutesOptions { - return &ListVPNServerRoutesOptions{ - VPNServerID: core.StringPtr(vpnServerID), - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *ListVPNServerRoutesOptions) SetVPNServerID(vpnServerID string) *ListVPNServerRoutesOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPNServerRoutesOptions) SetStart(start string) *ListVPNServerRoutesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPNServerRoutesOptions) SetLimit(limit int64) *ListVPNServerRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPNServerRoutesOptions) SetSort(sort string) *ListVPNServerRoutesOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNServerRoutesOptions) SetHeaders(param map[string]string) *ListVPNServerRoutesOptions { - options.Headers = param - return options -} - -// ListVPNServersOptions : The ListVPNServers options. -type ListVPNServersOptions struct { - // Filters the collection to resources with a `name` property matching the exact specified name. - Name *string `json:"name,omitempty"` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the ListVPNServersOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListVPNServersOptionsSortCreatedAtConst = "created_at" - ListVPNServersOptionsSortNameConst = "name" -) - -// NewListVPNServersOptions : Instantiate ListVPNServersOptions -func (*VpcV1) NewListVPNServersOptions() *ListVPNServersOptions { - return &ListVPNServersOptions{} -} - -// SetName : Allow user to set Name -func (_options *ListVPNServersOptions) SetName(name string) *ListVPNServersOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPNServersOptions) SetStart(start string) *ListVPNServersOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPNServersOptions) SetLimit(limit int64) *ListVPNServersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVPNServersOptions) SetResourceGroupID(resourceGroupID string) *ListVPNServersOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetSort : Allow user to set Sort -func (_options *ListVPNServersOptions) SetSort(sort string) *ListVPNServersOptions { - _options.Sort = core.StringPtr(sort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNServersOptions) SetHeaders(param map[string]string) *ListVPNServersOptions { - options.Headers = param - return options -} - -// LoadBalancer : LoadBalancer struct -type LoadBalancer struct { - // The date and time that this load balancer was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` - - // The DNS configuration for this load balancer. - // - // If absent, DNS `A` records for this load balancer's `hostname` property will be added to - // the public DNS zone `lb.appdomain.cloud`. - Dns *LoadBalancerDns `json:"dns,omitempty"` - - // Fully qualified domain name assigned to this load balancer. - Hostname *string `json:"hostname" validate:"required"` - - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer. - ID *string `json:"id" validate:"required"` - - // Indicates whether this load balancer supports instance groups. - InstanceGroupsSupported *bool `json:"instance_groups_supported" validate:"required"` - - // The type of this load balancer, public or private. - IsPublic *bool `json:"is_public" validate:"required"` - - // The listeners of this load balancer. - Listeners []LoadBalancerListenerReference `json:"listeners" validate:"required"` - - // The logging configuration for this load balancer. - Logging *LoadBalancerLogging `json:"logging" validate:"required"` - - // The name for this load balancer. The name is unique across all load balancers in the VPC. - Name *string `json:"name" validate:"required"` - - // The operating status of this load balancer. - OperatingStatus *string `json:"operating_status" validate:"required"` - - // The pools of this load balancer. - Pools []LoadBalancerPoolReference `json:"pools" validate:"required"` - - // The private IP addresses assigned to this load balancer. - PrivateIps []LoadBalancerPrivateIpsItem `json:"private_ips" validate:"required"` - - // The profile for this load balancer. - Profile *LoadBalancerProfileReference `json:"profile" validate:"required"` - - // The provisioning status of this load balancer: - // - // - `active`: The load balancer is running. - // - `create_pending`: The load balancer is being created. - // - `delete_pending`: The load balancer is being deleted. - // - `maintenance_pending`: The load balancer is unavailable due to an internal - // error (contact IBM support). - // - `migrate_pending`: The load balancer is migrating to the requested configuration. - // Performance may be degraded. - // - `update_pending`: The load balancer is being updated - // to the requested configuration. - // - // The enumerated values for this property are expected to expand in the future. When - // processing this property, check for and log unknown values. Optionally halt - // processing and surface the error, or bypass the load balancer on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The public IP addresses assigned to this load balancer. - // - // Applicable only for public load balancers. - PublicIps []IP `json:"public_ips" validate:"required"` - - // The resource group for this load balancer. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode" validate:"required"` - - // The security groups targeting this load balancer. - // - // If empty, all inbound and outbound traffic is allowed. - // - // Applicable only for load balancers that support security groups. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // Indicates whether this load balancer supports security groups. - SecurityGroupsSupported *bool `json:"security_groups_supported" validate:"required"` - - // The subnets this load balancer is provisioned in. The load balancer's availability depends on the availability of - // the zones that the subnets reside in. - // - // All subnets will be in the same VPC. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // Indicates whether this load balancer supports UDP. - UDPSupported *bool `json:"udp_supported" validate:"required"` -} - -// Constants associated with the LoadBalancer.OperatingStatus property. -// The operating status of this load balancer. -const ( - LoadBalancerOperatingStatusOfflineConst = "offline" - LoadBalancerOperatingStatusOnlineConst = "online" -) - -// Constants associated with the LoadBalancer.ProvisioningStatus property. -// The provisioning status of this load balancer: -// -// - `active`: The load balancer is running. -// -// - `create_pending`: The load balancer is being created. -// -// - `delete_pending`: The load balancer is being deleted. -// -// - `maintenance_pending`: The load balancer is unavailable due to an internal -// error (contact IBM support). -// -// - `migrate_pending`: The load balancer is migrating to the requested configuration. -// Performance may be degraded. -// -// - `update_pending`: The load balancer is being updated -// to the requested configuration. -// -// The enumerated values for this property are expected to expand in the future. When -// processing this property, check for and log unknown values. Optionally halt -// processing and surface the error, or bypass the load balancer on which the -// unexpected property value was encountered. -const ( - LoadBalancerProvisioningStatusActiveConst = "active" - LoadBalancerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerProvisioningStatusFailedConst = "failed" - LoadBalancerProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerProvisioningStatusMigratePendingConst = "migrate_pending" - LoadBalancerProvisioningStatusUpdatePendingConst = "update_pending" -) - -// Constants associated with the LoadBalancer.ResourceType property. -// The resource type. -const ( - LoadBalancerResourceTypeLoadBalancerConst = "load_balancer" -) - -// UnmarshalLoadBalancer unmarshals an instance of LoadBalancer from the specified map of raw messages. -func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancer) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDns) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "instance_groups_supported", &obj.InstanceGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_public", &obj.IsPublic) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "operating_status", &obj.OperatingStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalLoadBalancerPrivateIpsItem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalLoadBalancerProfileReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_ips", &obj.PublicIps, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_mode", &obj.RouteMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "security_groups_supported", &obj.SecurityGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "udp_supported", &obj.UDPSupported) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerCollection : LoadBalancerCollection struct -type LoadBalancerCollection struct { - // A link to the first page of resources. - First *LoadBalancerCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of load balancers. - LoadBalancers []LoadBalancer `json:"load_balancers" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *LoadBalancerCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalLoadBalancerCollection unmarshals an instance of LoadBalancerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancers", &obj.LoadBalancers, UnmarshalLoadBalancer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// LoadBalancerCollectionFirst : A link to the first page of resources. -type LoadBalancerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalLoadBalancerCollectionFirst unmarshals an instance of LoadBalancerCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalLoadBalancerCollectionNext unmarshals an instance of LoadBalancerCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerDns : The DNS configuration for this load balancer. -// -// If absent, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone -// `lb.appdomain.cloud`. -type LoadBalancerDns struct { - // The DNS instance associated with this load balancer. - Instance *DnsInstanceReference `json:"instance" validate:"required"` - - // The DNS zone associated with this load balancer. - Zone *DnsZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalLoadBalancerDns unmarshals an instance of LoadBalancerDns from the specified map of raw messages. -func UnmarshalLoadBalancerDns(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDns) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerDnsPatch : The DNS configuration for this load balancer. -// -// Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` records for this load balancer -// that had been added to `zone`, and add equivalent `A` records to the public DNS zone `lb.appdomain.cloud`. -type LoadBalancerDnsPatch struct { - // The DNS instance to associate with this load balancer. - // - // The specified instance may be in a different region or account, subject to IAM - // policies. - Instance DnsInstanceIdentityIntf `json:"instance,omitempty"` - - // The DNS zone to associate with this load balancer. - // - // The specified zone may be in a different region or account, subject to IAM policies. - Zone DnsZoneIdentityIntf `json:"zone,omitempty"` -} - -// UnmarshalLoadBalancerDnsPatch unmarshals an instance of LoadBalancerDnsPatch from the specified map of raw messages. -func UnmarshalLoadBalancerDnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDnsPatch) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerDnsPrototype : The DNS configuration for this load balancer. -// -// If unspecified, DNS `A` records for this load balancer's `hostname` property will be added to the public DNS zone -// `lb.appdomain.cloud`. Otherwise, those DNS `A` records will be added to the specified `zone`. -type LoadBalancerDnsPrototype struct { - // The DNS instance to associate with this load balancer. - // - // The specified instance may be in a different region or account, subject to IAM - // policies. - Instance DnsInstanceIdentityIntf `json:"instance" validate:"required"` - - // The DNS zone to associate with this load balancer. - // - // The specified zone may be in a different region or account, subject to IAM policies. - Zone DnsZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewLoadBalancerDnsPrototype : Instantiate LoadBalancerDnsPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerDnsPrototype(instance DnsInstanceIdentityIntf, zone DnsZoneIdentityIntf) (_model *LoadBalancerDnsPrototype, err error) { - _model = &LoadBalancerDnsPrototype{ - Instance: instance, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerDnsPrototype unmarshals an instance of LoadBalancerDnsPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerDnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerDnsPrototype) - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalDnsInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalDnsZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerIdentity : Identifies a load balancer by a unique property. -// Models which "extend" this model: -// - LoadBalancerIdentityByID -// - LoadBalancerIdentityByCRN -// - LoadBalancerIdentityByHref -type LoadBalancerIdentity struct { - // The unique identifier for this load balancer. - ID *string `json:"id,omitempty"` - - // The load balancer's CRN. - CRN *string `json:"crn,omitempty"` - - // The load balancer's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerIdentity) isaLoadBalancerIdentity() bool { - return true -} - -type LoadBalancerIdentityIntf interface { - isaLoadBalancerIdentity() bool -} - -// UnmarshalLoadBalancerIdentity unmarshals an instance of LoadBalancerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListener : LoadBalancerListener struct -type LoadBalancerListener struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol" validate:"required"` - - // The certificate instance used for SSL termination. - // - // If absent, this listener is not using a certificate instance. - CertificateInstance *CertificateInstanceReference `json:"certificate_instance,omitempty"` - - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit" validate:"required"` - - // The date and time that this listener was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The default pool for this listener. If absent, this listener has no default pool. - DefaultPool *LoadBalancerPoolReference `json:"default_pool,omitempty"` - - // The listener's canonical URL. - Href *string `json:"href" validate:"required"` - - // If present, the target listener that requests are redirected to. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirect `json:"https_redirect,omitempty"` - - // The unique identifier for this load balancer listener. - ID *string `json:"id" validate:"required"` - - // The idle connection timeout of the listener in seconds. This property will be present for load balancers in the - // `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The policies for this listener. - Policies []LoadBalancerListenerPolicyReference `json:"policies,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. - Port *int64 `json:"port" validate:"required"` - - // The inclusive upper bound of the range of ports used by this listener. - // - // At present, only load balancers in the `network` family support more than one port per listener. - PortMax *int64 `json:"port_max" validate:"required"` - - // The inclusive lower bound of the range of ports used by this listener. - // - // At present, only load balancers in the `network` family support more than one port per listener. - PortMin *int64 `json:"port_min" validate:"required"` - - // The listener protocol. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol" validate:"required"` - - // The provisioning status of this listener - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` -} - -// Constants associated with the LoadBalancerListener.Protocol property. -// The listener protocol. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerProtocolHTTPConst = "http" - LoadBalancerListenerProtocolHTTPSConst = "https" - LoadBalancerListenerProtocolTCPConst = "tcp" - LoadBalancerListenerProtocolUDPConst = "udp" -) - -// Constants associated with the LoadBalancerListener.ProvisioningStatus property. -// The provisioning status of this listener -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the listener on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerProvisioningStatusActiveConst = "active" - LoadBalancerListenerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerProvisioningStatusFailedConst = "failed" - LoadBalancerListenerProvisioningStatusUpdatePendingConst = "update_pending" -) - -// UnmarshalLoadBalancerListener unmarshals an instance of LoadBalancerListener from the specified map of raw messages. -func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListener) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirect) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerCollection : LoadBalancerListenerCollection struct -type LoadBalancerListenerCollection struct { - // Collection of listeners. - Listeners []LoadBalancerListener `json:"listeners" validate:"required"` -} - -// UnmarshalLoadBalancerListenerCollection unmarshals an instance of LoadBalancerListenerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerCollection) - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListener) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerHTTPSRedirect : LoadBalancerListenerHTTPSRedirect struct -type LoadBalancerListenerHTTPSRedirect struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -// UnmarshalLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerHTTPSRedirect from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirect) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerHTTPSRedirectPatch struct -type LoadBalancerListenerHTTPSRedirectPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -// UnmarshalLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerHTTPSRedirectPrototype struct -type LoadBalancerListenerHTTPSRedirectPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -// NewLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerHTTPSRedirectPrototype, err error) { - _model = &LoadBalancerListenerHTTPSRedirectPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - Listener: listener, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerIdentity : Identifies a load balancer listener by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerIdentityByID -// - LoadBalancerListenerIdentityByHref -type LoadBalancerListenerIdentity struct { - // The unique identifier for this load balancer listener. - ID *string `json:"id,omitempty"` - - // The listener's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerListenerIdentity) isaLoadBalancerListenerIdentity() bool { - return true -} - -type LoadBalancerListenerIdentityIntf interface { - isaLoadBalancerListenerIdentity() bool -} - -// UnmarshalLoadBalancerListenerIdentity unmarshals an instance of LoadBalancerListenerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPatch : LoadBalancerListenerPatch struct -type LoadBalancerListenerPatch struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` - - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` - - // The default pool for this listener. The specified pool must: - // - // - Belong to this load balancer - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener - // - // Specify `null` to remove an existing default pool. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` - - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - // - // Specify `null` to remove any existing https redirect. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPatch `json:"https_redirect,omitempty"` - - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` - - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` - - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // Additional restrictions: - // - If `default_pool` is set, the protocol cannot be changed. - // - If `https_redirect` is set, the protocol must be `http`. - // - If another listener's `https_redirect` targets this listener, the protocol must be - // `https`. - Protocol *string `json:"protocol,omitempty"` -} - -// Constants associated with the LoadBalancerListenerPatch.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the protocol cannot be changed. -// - If `https_redirect` is set, the protocol must be `http`. -// - If another listener's `https_redirect` targets this listener, the protocol must be -// `https`. -const ( - LoadBalancerListenerPatchProtocolHTTPConst = "http" - LoadBalancerListenerPatchProtocolHTTPSConst = "https" - LoadBalancerListenerPatchProtocolTCPConst = "tcp" - LoadBalancerListenerPatchProtocolUDPConst = "udp" -) - -// UnmarshalLoadBalancerListenerPatch unmarshals an instance of LoadBalancerListenerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPatch) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerListenerPatch -func (loadBalancerListenerPatch *LoadBalancerListenerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerListenerPolicy : LoadBalancerListenerPolicy struct -type LoadBalancerListenerPolicy struct { - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // The date and time that this policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The listener policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The policy's unique identifier. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer listener policy. The name is unique across all policies for the load balancer - // listener. - Name *string `json:"name" validate:"required"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` - - // The provisioning status of this policy - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The rules for this policy. - Rules []LoadBalancerListenerPolicyRuleReference `json:"rules" validate:"required"` - - // - If `action` is `forward`, the response is a `LoadBalancerPoolReference` - // - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` - // - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. - Target LoadBalancerListenerPolicyTargetIntf `json:"target,omitempty"` -} - -// Constants associated with the LoadBalancerListenerPolicy.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyActionForwardConst = "forward" - LoadBalancerListenerPolicyActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyActionRedirectConst = "redirect" - LoadBalancerListenerPolicyActionRejectConst = "reject" -) - -// Constants associated with the LoadBalancerListenerPolicy.ProvisioningStatus property. -// The provisioning status of this policy -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyProvisioningStatusUpdatePendingConst = "update_pending" -) - -// UnmarshalLoadBalancerListenerPolicy unmarshals an instance of LoadBalancerListenerPolicy from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicy) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRuleReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTarget) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyCollection : LoadBalancerListenerPolicyCollection struct -type LoadBalancerListenerPolicyCollection struct { - // Collection of policies. - Policies []LoadBalancerListenerPolicy `json:"policies" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyCollection unmarshals an instance of LoadBalancerListenerPolicyCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyCollection) - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicy) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyPatch : LoadBalancerListenerPolicyPatch struct -type LoadBalancerListenerPolicyPatch struct { - // The name for this policy. The name must not be used by another policy for the load balancer listener. - Name *string `json:"name,omitempty"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority,omitempty"` - - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPatch`. - Target LoadBalancerListenerPolicyTargetPatchIntf `json:"target,omitempty"` -} - -// UnmarshalLoadBalancerListenerPolicyPatch unmarshals an instance of LoadBalancerListenerPolicyPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyPatch -func (loadBalancerListenerPolicyPatch *LoadBalancerListenerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerListenerPolicyPrototype : LoadBalancerListenerPolicyPrototype struct -type LoadBalancerListenerPolicyPrototype struct { - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // The name for this policy. The name must not be used by another policy for the load balancer listener. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` - - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` - - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` -} - -// Constants associated with the LoadBalancerListenerPolicyPrototype.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyPrototypeActionForwardConst = "forward" - LoadBalancerListenerPolicyPrototypeActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyPrototypeActionRedirectConst = "redirect" - LoadBalancerListenerPolicyPrototypeActionRejectConst = "reject" -) - -// NewLoadBalancerListenerPolicyPrototype : Instantiate LoadBalancerListenerPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyPrototype(action string, priority int64) (_model *LoadBalancerListenerPolicyPrototype, err error) { - _model = &LoadBalancerListenerPolicyPrototype{ - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerPolicyPrototype unmarshals an instance of LoadBalancerListenerPolicyPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRulePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyReference : LoadBalancerListenerPolicyReference struct -type LoadBalancerListenerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerPolicyReferenceDeleted `json:"deleted,omitempty"` - - // The listener policy's canonical URL. - Href *string `json:"href" validate:"required"` - - // The policy's unique identifier. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer listener policy. The name is unique across all policies for the load balancer - // listener. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyReference unmarshals an instance of LoadBalancerListenerPolicyReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRule : LoadBalancerListenerPolicyRule struct -type LoadBalancerListenerPolicyRule struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The date and time that this rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // The rule's canonical URL. - Href *string `json:"href" validate:"required"` - - // The rule's unique identifier. - ID *string `json:"id" validate:"required"` - - // The provisioning status of this rule - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerListenerPolicyRule.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRuleConditionContainsConst = "contains" - LoadBalancerListenerPolicyRuleConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRuleConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRule.ProvisioningStatus property. -// The provisioning status of this rule -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the rule on which the -// unexpected property value was encountered. -const ( - LoadBalancerListenerPolicyRuleProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyRuleProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyRuleProvisioningStatusUpdatePendingConst = "update_pending" -) - -// Constants associated with the LoadBalancerListenerPolicyRule.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRuleTypeBodyConst = "body" - LoadBalancerListenerPolicyRuleTypeHeaderConst = "header" - LoadBalancerListenerPolicyRuleTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRuleTypePathConst = "path" - LoadBalancerListenerPolicyRuleTypeQueryConst = "query" -) - -// UnmarshalLoadBalancerListenerPolicyRule unmarshals an instance of LoadBalancerListenerPolicyRule from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRule) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRuleCollection : LoadBalancerListenerPolicyRuleCollection struct -type LoadBalancerListenerPolicyRuleCollection struct { - // Collection of rules. - Rules []LoadBalancerListenerPolicyRule `json:"rules" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyRuleCollection unmarshals an instance of LoadBalancerListenerPolicyRuleCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRulePatch : LoadBalancerListenerPolicyRulePatch struct -type LoadBalancerListenerPolicyRulePatch struct { - // The condition of the rule. - Condition *string `json:"condition,omitempty"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type,omitempty"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRulePatchConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePatchConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePatchConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRulePatchTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePatchTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePatchTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePatchTypePathConst = "path" - LoadBalancerListenerPolicyRulePatchTypeQueryConst = "query" -) - -// UnmarshalLoadBalancerListenerPolicyRulePatch unmarshals an instance of LoadBalancerListenerPolicyRulePatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePatch) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyRulePatch -func (loadBalancerListenerPolicyRulePatch *LoadBalancerListenerPolicyRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerListenerPolicyRulePrototype : LoadBalancerListenerPolicyRulePrototype struct -type LoadBalancerListenerPolicyRulePrototype struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` - - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` - - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRulePrototypeConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePrototypeConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePrototypeConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRulePrototypeTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePrototypeTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePrototypeTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePrototypeTypePathConst = "path" - LoadBalancerListenerPolicyRulePrototypeTypeQueryConst = "query" -) - -// NewLoadBalancerListenerPolicyRulePrototype : Instantiate LoadBalancerListenerPolicyRulePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyRulePrototype(condition string, typeVar string, value string) (_model *LoadBalancerListenerPolicyRulePrototype, err error) { - _model = &LoadBalancerListenerPolicyRulePrototype{ - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerPolicyRulePrototype unmarshals an instance of LoadBalancerListenerPolicyRulePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePrototype) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRuleReference : LoadBalancerListenerPolicyRuleReference struct -type LoadBalancerListenerPolicyRuleReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerPolicyRuleReferenceDeleted `json:"deleted,omitempty"` - - // The rule's canonical URL. - Href *string `json:"href" validate:"required"` - - // The rule's unique identifier. - ID *string `json:"id" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyRuleReference unmarshals an instance of LoadBalancerListenerPolicyRuleReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerPolicyRuleReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTarget : - If `action` is `forward`, the response is a `LoadBalancerPoolReference` -// - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` -// - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect -type LoadBalancerListenerPolicyTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name,omitempty"` - - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - Listener *LoadBalancerListenerReference `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTarget) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -type LoadBalancerListenerPolicyTargetIntf interface { - isaLoadBalancerListenerPolicyTarget() bool -} - -// UnmarshalLoadBalancerListenerPolicyTarget unmarshals an instance of LoadBalancerListenerPolicyTarget from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatch : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPatch`. -// -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch -type LoadBalancerListenerPolicyTargetPatch struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` - - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -type LoadBalancerListenerPolicyTargetPatchIntf interface { - isaLoadBalancerListenerPolicyTargetPatch() bool -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototype : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. -// -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype -type LoadBalancerListenerPolicyTargetPrototype struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` - - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -type LoadBalancerListenerPolicyTargetPrototypeIntf interface { - isaLoadBalancerListenerPolicyTargetPrototype() bool -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPrototypeLoadBalancerContext : LoadBalancerListenerPrototypeLoadBalancerContext struct -type LoadBalancerListenerPrototypeLoadBalancerContext struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance to use for SSL termination. The listener must have a - // `protocol` of `https`. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` - - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` - - // The default pool for this listener. If specified, the pool must: - // - Belong to this load balancer. - // - Have the same `protocol` as this listener, or have a compatible protocol. - // At present, the compatible protocols are `http` and `https`. - // - Not already be the `default_pool` for another listener. - // - // If unspecified, this listener will be created with no default pool, but one may be - // subsequently set. - DefaultPool *LoadBalancerPoolIdentityByName `json:"default_pool,omitempty"` - - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` - - // The idle connection timeout of the listener in seconds. Supported for load balancers in the `application` family. - IdleConnectionTimeout *int64 `json:"idle_connection_timeout,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` - - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family - // support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` - - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // Additional restrictions: - // - If `default_pool` is set, the pool's protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and - // `https`. - // - If `https_redirect` is set, the protocol must be `http`. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the LoadBalancerListenerPrototypeLoadBalancerContext.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// Additional restrictions: -// - If `default_pool` is set, the pool's protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and -// `https`. -// - If `https_redirect` is set, the protocol must be `http`. -const ( - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPConst = "http" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPSConst = "https" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolTCPConst = "tcp" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolUDPConst = "udp" -) - -// NewLoadBalancerListenerPrototypeLoadBalancerContext : Instantiate LoadBalancerListenerPrototypeLoadBalancerContext (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol string) (_model *LoadBalancerListenerPrototypeLoadBalancerContext, err error) { - _model = &LoadBalancerListenerPrototypeLoadBalancerContext{ - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext unmarshals an instance of LoadBalancerListenerPrototypeLoadBalancerContext from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPrototypeLoadBalancerContext) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentityByName) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "idle_connection_timeout", &obj.IdleConnectionTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerReference : LoadBalancerListenerReference struct -type LoadBalancerListenerReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerListenerReferenceDeleted `json:"deleted,omitempty"` - - // The listener's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer listener. - ID *string `json:"id" validate:"required"` -} - -// UnmarshalLoadBalancerListenerReference unmarshals an instance of LoadBalancerListenerReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerListenerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerListenerReferenceDeleted unmarshals an instance of LoadBalancerListenerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLogging : LoadBalancerLogging struct -type LoadBalancerLogging struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapath `json:"datapath" validate:"required"` -} - -// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages. -func UnmarshalLoadBalancerLogging(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLogging) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapath) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingDatapath : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapath struct { - // Indicates whether datapath logging is active for this load balancer. - Active *bool `json:"active" validate:"required"` -} - -// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapath) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingDatapathPatch : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapathPatch struct { - // Indicates whether datapath logging will be active for this load balancer. - Active *bool `json:"active,omitempty"` -} - -// UnmarshalLoadBalancerLoggingDatapathPatch unmarshals an instance of LoadBalancerLoggingDatapathPatch from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapathPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapathPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingDatapathPrototype : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapathPrototype struct { - // Indicates whether datapath logging will be active for this load balancer. - Active *bool `json:"active,omitempty"` -} - -// UnmarshalLoadBalancerLoggingDatapathPrototype unmarshals an instance of LoadBalancerLoggingDatapathPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapathPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapathPrototype) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingPatch : LoadBalancerLoggingPatch struct -type LoadBalancerLoggingPatch struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapathPatch `json:"datapath,omitempty"` -} - -// UnmarshalLoadBalancerLoggingPatch unmarshals an instance of LoadBalancerLoggingPatch from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingPatch) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerLoggingPrototype : LoadBalancerLoggingPrototype struct -type LoadBalancerLoggingPrototype struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"` -} - -// UnmarshalLoadBalancerLoggingPrototype unmarshals an instance of LoadBalancerLoggingPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingPrototype) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPatch : LoadBalancerPatch struct -type LoadBalancerPatch struct { - // The DNS configuration for this load balancer. - // - // Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` - // records for this load balancer that had been added to `zone`, and add equivalent `A` - // records to the public DNS zone `lb.appdomain.cloud`. - Dns *LoadBalancerDnsPatch `json:"dns,omitempty"` - - // The logging configuration to use for this load balancer. - // - // To activate logging, the load balancer profile must support the specified logging type. - Logging *LoadBalancerLoggingPatch `json:"logging,omitempty"` - - // The name for this load balancer. The name must not be used by another load balancer in the VPC. - Name *string `json:"name,omitempty"` - - // The subnets to provision this load balancer in. The load balancer's availability will depend on the availability of - // the zones that the subnets reside in. - // - // The specified subnets must be in the same VPC as the existing subnets, and will completely replace the existing - // subnets. - // - // The load balancer must be in the `application` family. - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` -} - -// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPatch) - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalLoadBalancerDnsPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLoggingPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerPatch -func (loadBalancerPatch *LoadBalancerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerPool : LoadBalancerPool struct -type LoadBalancerPool struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The date and time that this pool was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitor `json:"health_monitor" validate:"required"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` - - // The instance group that is managing this pool. - InstanceGroup *InstanceGroupReference `json:"instance_group,omitempty"` - - // The backend server members of the pool. - Members []LoadBalancerPoolMemberReference `json:"members,omitempty"` - - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` - - // The protocol for this load balancer pool. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol" validate:"required"` - - // The provisioning status of this pool - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol" validate:"required"` - - // The session persistence of this pool. - // - // The enumerated values for this property are expected to expand in the future. When - // processing this property, check for and log unknown values. Optionally halt - // processing and surface the error, or bypass the pool on which the unexpected - // property value was encountered. - SessionPersistence *LoadBalancerPoolSessionPersistence `json:"session_persistence,omitempty"` -} - -// Constants associated with the LoadBalancerPool.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the LoadBalancerPool.Protocol property. -// The protocol for this load balancer pool. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolProtocolHTTPConst = "http" - LoadBalancerPoolProtocolHTTPSConst = "https" - LoadBalancerPoolProtocolTCPConst = "tcp" - LoadBalancerPoolProtocolUDPConst = "udp" -) - -// Constants associated with the LoadBalancerPool.ProvisioningStatus property. -// The provisioning status of this pool -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolProvisioningStatusActiveConst = "active" - LoadBalancerPoolProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolProvisioningStatusFailedConst = "failed" - LoadBalancerPoolProvisioningStatusUpdatePendingConst = "update_pending" -) - -// Constants associated with the LoadBalancerPool.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - LoadBalancerPoolProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolProxyProtocolV1Const = "v1" - LoadBalancerPoolProxyProtocolV2Const = "v2" -) - -// UnmarshalLoadBalancerPool unmarshals an instance of LoadBalancerPool from the specified map of raw messages. -func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPool) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitor) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistence) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolCollection : LoadBalancerPoolCollection struct -type LoadBalancerPoolCollection struct { - // Collection of pools. - Pools []LoadBalancerPool `json:"pools" validate:"required"` -} - -// UnmarshalLoadBalancerPoolCollection unmarshals an instance of LoadBalancerPoolCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolCollection) - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPool) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct -type LoadBalancerPoolHealthMonitor struct { - // The seconds to wait between health checks. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` - - // The health check port. - // - // If present, this overrides the pool member port values. - Port *int64 `json:"port,omitempty"` - - // The seconds to wait for a response to a health check. - Timeout *int64 `json:"timeout" validate:"required"` - - // The protocol type to use for health checks. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which - // the unexpected property value was encountered. - Type *string `json:"type" validate:"required"` - - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` -} - -// Constants associated with the LoadBalancerPoolHealthMonitor.Type property. -// The protocol type to use for health checks. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which -// the unexpected property value was encountered. -const ( - LoadBalancerPoolHealthMonitorTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorTypeTCPConst = "tcp" -) - -// UnmarshalLoadBalancerPoolHealthMonitor unmarshals an instance of LoadBalancerPoolHealthMonitor from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitor) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolHealthMonitorPatch : LoadBalancerPoolHealthMonitorPatch struct -type LoadBalancerPoolHealthMonitorPatch struct { - // The seconds to wait between health checks. Must be greater than `timeout`. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` - - // The health check port. - // - // If set, this overrides the pool member port values. - // - // Specify `null` to remove an existing health check port. - Port *int64 `json:"port,omitempty"` - - // The seconds to wait for a response to a health check. Must be less than `delay`. - Timeout *int64 `json:"timeout" validate:"required"` - - // The protocol type to use for health checks. - Type *string `json:"type" validate:"required"` - - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` -} - -// Constants associated with the LoadBalancerPoolHealthMonitorPatch.Type property. -// The protocol type to use for health checks. -const ( - LoadBalancerPoolHealthMonitorPatchTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPatchTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPatchTypeTCPConst = "tcp" -) - -// NewLoadBalancerPoolHealthMonitorPatch : Instantiate LoadBalancerPoolHealthMonitorPatch (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPatch(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPatch, err error) { - _model = &LoadBalancerPoolHealthMonitorPatch{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolHealthMonitorPatch unmarshals an instance of LoadBalancerPoolHealthMonitorPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPatch) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolHealthMonitorPrototype : LoadBalancerPoolHealthMonitorPrototype struct -type LoadBalancerPoolHealthMonitorPrototype struct { - // The seconds to wait between health checks. Must be greater than `timeout`. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` - - // The health check port. - // - // If specified, this overrides the pool member port values. - Port *int64 `json:"port,omitempty"` - - // The seconds to wait for a response to a health check. Must be less than `delay`. - Timeout *int64 `json:"timeout" validate:"required"` - - // The protocol type to use for health checks. - Type *string `json:"type" validate:"required"` - - // The health check URL path. Applicable when `type` is `http` or `https`. - // - // Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` -} - -// Constants associated with the LoadBalancerPoolHealthMonitorPrototype.Type property. -// The protocol type to use for health checks. -const ( - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPrototypeTypeTCPConst = "tcp" -) - -// NewLoadBalancerPoolHealthMonitorPrototype : Instantiate LoadBalancerPoolHealthMonitorPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPrototype(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPrototype, err error) { - _model = &LoadBalancerPoolHealthMonitorPrototype{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolHealthMonitorPrototype unmarshals an instance of LoadBalancerPoolHealthMonitorPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPrototype) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerPoolIdentityByID -// - LoadBalancerPoolIdentityByHref -type LoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerPoolIdentity) isaLoadBalancerPoolIdentity() bool { - return true -} - -type LoadBalancerPoolIdentityIntf interface { - isaLoadBalancerPoolIdentity() bool -} - -// UnmarshalLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolIdentityByName : LoadBalancerPoolIdentityByName struct -type LoadBalancerPoolIdentityByName struct { - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` -} - -// NewLoadBalancerPoolIdentityByName : Instantiate LoadBalancerPoolIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByName(name string) (_model *LoadBalancerPoolIdentityByName, err error) { - _model = &LoadBalancerPoolIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolIdentityByName unmarshals an instance of LoadBalancerPoolIdentityByName from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMember : LoadBalancerPoolMember struct -type LoadBalancerPoolMember struct { - // The date and time that this member was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // Health of the server member in the pool. - Health *string `json:"health" validate:"required"` - - // The member's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool member. - ID *string `json:"id" validate:"required"` - - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - Port *int64 `json:"port" validate:"required"` - - // The provisioning status of this member - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the - // unexpected property value was encountered. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} - -// Constants associated with the LoadBalancerPoolMember.Health property. -// Health of the server member in the pool. -const ( - LoadBalancerPoolMemberHealthFaultedConst = "faulted" - LoadBalancerPoolMemberHealthOkConst = "ok" - LoadBalancerPoolMemberHealthUnknownConst = "unknown" -) - -// Constants associated with the LoadBalancerPoolMember.ProvisioningStatus property. -// The provisioning status of this member -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool member on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolMemberProvisioningStatusActiveConst = "active" - LoadBalancerPoolMemberProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolMemberProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolMemberProvisioningStatusFailedConst = "failed" - LoadBalancerPoolMemberProvisioningStatusUpdatePendingConst = "update_pending" -) - -// UnmarshalLoadBalancerPoolMember unmarshals an instance of LoadBalancerPoolMember from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMember) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health", &obj.Health) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTarget) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberCollection : LoadBalancerPoolMemberCollection struct -type LoadBalancerPoolMemberCollection struct { - // Collection of members. - Members []LoadBalancerPoolMember `json:"members" validate:"required"` -} - -// UnmarshalLoadBalancerPoolMemberCollection unmarshals an instance of LoadBalancerPoolMemberCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberCollection) - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberPatch : LoadBalancerPoolMemberPatch struct -type LoadBalancerPoolMemberPatch struct { - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port,omitempty"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target,omitempty"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} - -// UnmarshalLoadBalancerPoolMemberPatch unmarshals an instance of LoadBalancerPoolMemberPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPatch) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerPoolMemberPatch -func (loadBalancerPoolMemberPatch *LoadBalancerPoolMemberPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolMemberPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerPoolMemberPrototype : LoadBalancerPoolMemberPrototype struct -type LoadBalancerPoolMemberPrototype struct { - // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a - // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive - // the traffic on the same port the listener received it on.) - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. If the load - // balancer has route mode enabled, the member must be in a zone the load balancer has a - // subnet in. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} - -// NewLoadBalancerPoolMemberPrototype : Instantiate LoadBalancerPoolMemberPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberPrototype(port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) (_model *LoadBalancerPoolMemberPrototype, err error) { - _model = &LoadBalancerPoolMemberPrototype{ - Port: core.Int64Ptr(port), - Target: target, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolMemberPrototype unmarshals an instance of LoadBalancerPoolMemberPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPrototype) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberReference : LoadBalancerPoolMemberReference struct -type LoadBalancerPoolMemberReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolMemberReferenceDeleted `json:"deleted,omitempty"` - - // The member's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool member. - ID *string `json:"id" validate:"required"` -} - -// UnmarshalLoadBalancerPoolMemberReference unmarshals an instance of LoadBalancerPoolMemberReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolMemberReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerPoolMemberReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerPoolMemberReferenceDeleted unmarshals an instance of LoadBalancerPoolMemberReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTarget : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a -// zone the load balancer has a subnet in. -// Models which "extend" this model: -// - LoadBalancerPoolMemberTargetInstanceReference -// - LoadBalancerPoolMemberTargetIP -type LoadBalancerPoolMemberTarget struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name,omitempty"` - - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} - -func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { - return true -} - -type LoadBalancerPoolMemberTargetIntf interface { - isaLoadBalancerPoolMemberTarget() bool -} - -// UnmarshalLoadBalancerPoolMemberTarget unmarshals an instance of LoadBalancerPoolMemberTarget from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototype : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. If the load balancer has route mode enabled, the member must be in a -// zone the load balancer has a subnet in. -// Models which "extend" this model: -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -// - LoadBalancerPoolMemberTargetPrototypeIP -type LoadBalancerPoolMemberTargetPrototype struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` - - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} - -func (*LoadBalancerPoolMemberTargetPrototype) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -type LoadBalancerPoolMemberTargetPrototypeIntf interface { - isaLoadBalancerPoolMemberTargetPrototype() bool -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototype unmarshals an instance of LoadBalancerPoolMemberTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolPatch : LoadBalancerPoolPatch struct -type LoadBalancerPoolPatch struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm,omitempty"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPatch `json:"health_monitor,omitempty"` - - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. - Name *string `json:"name,omitempty"` - - // The protocol for this load balancer pool. - // - // Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http` and - // `https`. - // - // If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with - // the listener's protocol. At present, the compatible protocols are `http` and `https`. - Protocol *string `json:"protocol,omitempty"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` - - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePatch `json:"session_persistence,omitempty"` -} - -// Constants associated with the LoadBalancerPoolPatch.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolPatchAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPatchAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPatchAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the LoadBalancerPoolPatch.Protocol property. -// The protocol for this load balancer pool. -// -// Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http` and -// `https`. -// -// If this pool is associated with a load balancer listener, the specified protocol must match, or be compatible with -// the listener's protocol. At present, the compatible protocols are `http` and `https`. -const ( - LoadBalancerPoolPatchProtocolHTTPConst = "http" - LoadBalancerPoolPatchProtocolHTTPSConst = "https" - LoadBalancerPoolPatchProtocolTCPConst = "tcp" - LoadBalancerPoolPatchProtocolUDPConst = "udp" -) - -// Constants associated with the LoadBalancerPoolPatch.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - LoadBalancerPoolPatchProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPatchProxyProtocolV1Const = "v1" - LoadBalancerPoolPatchProxyProtocolV2Const = "v2" -) - -// UnmarshalLoadBalancerPoolPatch unmarshals an instance of LoadBalancerPoolPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPatch) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerPoolPatch -func (loadBalancerPoolPatch *LoadBalancerPoolPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerPoolPrototype : LoadBalancerPoolPrototype struct -type LoadBalancerPoolPrototype struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` - - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` - - // The name for this load balancer pool. The name must not be used by another pool for the load balancer. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if - // `udp_supported` is `true`). Load balancers in the - // `application` family support `tcp`, `http`, and `https`. - Protocol *string `json:"protocol" validate:"required"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` - - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` -} - -// Constants associated with the LoadBalancerPoolPrototype.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolPrototypeAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPrototypeAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPrototypeAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the LoadBalancerPoolPrototype.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if -// `udp_supported` is `true`). Load balancers in the -// `application` family support `tcp`, `http`, and `https`. -const ( - LoadBalancerPoolPrototypeProtocolHTTPConst = "http" - LoadBalancerPoolPrototypeProtocolHTTPSConst = "https" - LoadBalancerPoolPrototypeProtocolTCPConst = "tcp" - LoadBalancerPoolPrototypeProtocolUDPConst = "udp" -) - -// Constants associated with the LoadBalancerPoolPrototype.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - LoadBalancerPoolPrototypeProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPrototypeProxyProtocolV1Const = "v1" - LoadBalancerPoolPrototypeProxyProtocolV2Const = "v2" -) - -// NewLoadBalancerPoolPrototype : Instantiate LoadBalancerPoolPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolPrototype(algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) (_model *LoadBalancerPoolPrototype, err error) { - _model = &LoadBalancerPoolPrototype{ - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolPrototype unmarshals an instance of LoadBalancerPoolPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPrototype) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolReference : LoadBalancerPoolReference struct -type LoadBalancerPoolReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalLoadBalancerPoolReference unmarshals an instance of LoadBalancerPoolReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerPoolReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerPoolReferenceDeleted unmarshals an instance of LoadBalancerPoolReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolSessionPersistence : LoadBalancerPoolSessionPersistence struct -type LoadBalancerPoolSessionPersistence struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerPoolSessionPersistence.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistenceTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistenceTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistenceTypeSourceIPConst = "source_ip" -) - -// UnmarshalLoadBalancerPoolSessionPersistence unmarshals an instance of LoadBalancerPoolSessionPersistence from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistence) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolSessionPersistencePatch : The session persistence configuration. Specify `null` to remove any existing session persistence configuration. -type LoadBalancerPoolSessionPersistencePatch struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the LoadBalancerPoolSessionPersistencePatch.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistencePatchTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePatchTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePatchTypeSourceIPConst = "source_ip" -) - -// UnmarshalLoadBalancerPoolSessionPersistencePatch unmarshals an instance of LoadBalancerPoolSessionPersistencePatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePatch) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolSessionPersistencePrototype : LoadBalancerPoolSessionPersistencePrototype struct -type LoadBalancerPoolSessionPersistencePrototype struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerPoolSessionPersistencePrototype.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistencePrototypeTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeSourceIPConst = "source_ip" -) - -// NewLoadBalancerPoolSessionPersistencePrototype : Instantiate LoadBalancerPoolSessionPersistencePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolSessionPersistencePrototype(typeVar string) (_model *LoadBalancerPoolSessionPersistencePrototype, err error) { - _model = &LoadBalancerPoolSessionPersistencePrototype{ - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolSessionPersistencePrototype unmarshals an instance of LoadBalancerPoolSessionPersistencePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePrototype) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPrivateIpsItem : LoadBalancerPrivateIpsItem struct -type LoadBalancerPrivateIpsItem struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` - - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the LoadBalancerPrivateIpsItem.ResourceType property. -// The resource type. -const ( - LoadBalancerPrivateIpsItemResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) - -// UnmarshalLoadBalancerPrivateIpsItem unmarshals an instance of LoadBalancerPrivateIpsItem from the specified map of raw messages. -func UnmarshalLoadBalancerPrivateIpsItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPrivateIpsItem) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfile : LoadBalancerProfile struct -type LoadBalancerProfile struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` - - InstanceGroupsSupported LoadBalancerProfileInstanceGroupsSupportedIntf `json:"instance_groups_supported" validate:"required"` - - // Indicates which logging type(s) are supported for a load balancer with this profile. - LoggingSupported *LoadBalancerProfileLoggingSupported `json:"logging_supported" validate:"required"` - - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` - - RouteModeSupported LoadBalancerProfileRouteModeSupportedIntf `json:"route_mode_supported" validate:"required"` - - SecurityGroupsSupported LoadBalancerProfileSecurityGroupsSupportedIntf `json:"security_groups_supported" validate:"required"` - - UDPSupported LoadBalancerProfileUDPSupportedIntf `json:"udp_supported" validate:"required"` -} - -// UnmarshalLoadBalancerProfile unmarshals an instance of LoadBalancerProfile from the specified map of raw messages. -func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_groups_supported", &obj.InstanceGroupsSupported, UnmarshalLoadBalancerProfileInstanceGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "logging_supported", &obj.LoggingSupported, UnmarshalLoadBalancerProfileLoggingSupported) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "route_mode_supported", &obj.RouteModeSupported, UnmarshalLoadBalancerProfileRouteModeSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups_supported", &obj.SecurityGroupsSupported, UnmarshalLoadBalancerProfileSecurityGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "udp_supported", &obj.UDPSupported, UnmarshalLoadBalancerProfileUDPSupported) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileCollection : LoadBalancerProfileCollection struct -type LoadBalancerProfileCollection struct { - // A link to the first page of resources. - First *LoadBalancerProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *LoadBalancerProfileCollectionNext `json:"next,omitempty"` - - // Collection of load balancer profiles. - Profiles []LoadBalancerProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalLoadBalancerProfileCollection unmarshals an instance of LoadBalancerProfileCollection from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLoadBalancerProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// LoadBalancerProfileCollectionFirst : A link to the first page of resources. -type LoadBalancerProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalLoadBalancerProfileCollectionFirst unmarshals an instance of LoadBalancerProfileCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalLoadBalancerProfileCollectionNext unmarshals an instance of LoadBalancerProfileCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileIdentity : Identifies a load balancer profile by a unique property. -// Models which "extend" this model: -// - LoadBalancerProfileIdentityByName -// - LoadBalancerProfileIdentityByHref -type LoadBalancerProfileIdentity struct { - // The globally unique name for this load balancer profile. - Name *string `json:"name,omitempty"` - - // The URL for this load balancer profile. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerProfileIdentity) isaLoadBalancerProfileIdentity() bool { - return true -} - -type LoadBalancerProfileIdentityIntf interface { - isaLoadBalancerProfileIdentity() bool -} - -// UnmarshalLoadBalancerProfileIdentity unmarshals an instance of LoadBalancerProfileIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileInstanceGroupsSupported : LoadBalancerProfileInstanceGroupsSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileInstanceGroupsSupportedFixed -// - LoadBalancerProfileInstanceGroupsSupportedDependent -type LoadBalancerProfileInstanceGroupsSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileInstanceGroupsSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileInstanceGroupsSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileInstanceGroupsSupported) isaLoadBalancerProfileInstanceGroupsSupported() bool { - return true -} - -type LoadBalancerProfileInstanceGroupsSupportedIntf interface { - isaLoadBalancerProfileInstanceGroupsSupported() bool -} - -// UnmarshalLoadBalancerProfileInstanceGroupsSupported unmarshals an instance of LoadBalancerProfileInstanceGroupsSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileLoggingSupported : Indicates which logging type(s) are supported for a load balancer with this profile. -type LoadBalancerProfileLoggingSupported struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The supported logging type(s) for a load balancer with this profile. - Value []string `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileLoggingSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileLoggingSupportedTypeFixedConst = "fixed" -) - -// UnmarshalLoadBalancerProfileLoggingSupported unmarshals an instance of LoadBalancerProfileLoggingSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileLoggingSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileLoggingSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileReference : LoadBalancerProfileReference struct -type LoadBalancerProfileReference struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalLoadBalancerProfileReference unmarshals an instance of LoadBalancerProfileReference from the specified map of raw messages. -func UnmarshalLoadBalancerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileReference) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileRouteModeSupported : LoadBalancerProfileRouteModeSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileRouteModeSupportedFixed -// - LoadBalancerProfileRouteModeSupportedDependent -type LoadBalancerProfileRouteModeSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileRouteModeSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileRouteModeSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileRouteModeSupported) isaLoadBalancerProfileRouteModeSupported() bool { - return true -} - -type LoadBalancerProfileRouteModeSupportedIntf interface { - isaLoadBalancerProfileRouteModeSupported() bool -} - -// UnmarshalLoadBalancerProfileRouteModeSupported unmarshals an instance of LoadBalancerProfileRouteModeSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileSecurityGroupsSupported : LoadBalancerProfileSecurityGroupsSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileSecurityGroupsSupportedFixed -// - LoadBalancerProfileSecurityGroupsSupportedDependent -type LoadBalancerProfileSecurityGroupsSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileSecurityGroupsSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileSecurityGroupsSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileSecurityGroupsSupported) isaLoadBalancerProfileSecurityGroupsSupported() bool { - return true -} - -type LoadBalancerProfileSecurityGroupsSupportedIntf interface { - isaLoadBalancerProfileSecurityGroupsSupported() bool -} - -// UnmarshalLoadBalancerProfileSecurityGroupsSupported unmarshals an instance of LoadBalancerProfileSecurityGroupsSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileUDPSupported : LoadBalancerProfileUDPSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileUDPSupportedFixed -// - LoadBalancerProfileUDPSupportedDependent -type LoadBalancerProfileUDPSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} - -// Constants associated with the LoadBalancerProfileUDPSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileUDPSupportedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileUDPSupported) isaLoadBalancerProfileUDPSupported() bool { - return true -} - -type LoadBalancerProfileUDPSupportedIntf interface { - isaLoadBalancerProfileUDPSupported() bool -} - -// UnmarshalLoadBalancerProfileUDPSupported unmarshals an instance of LoadBalancerProfileUDPSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type LoadBalancerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerReferenceDeleted unmarshals an instance of LoadBalancerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerStatistics : LoadBalancerStatistics struct -type LoadBalancerStatistics struct { - // Number of active connections of this load balancer. - ActiveConnections *int64 `json:"active_connections" validate:"required"` - - // Current connection rate (connections per second) of this load balancer. - ConnectionRate *float32 `json:"connection_rate" validate:"required"` - - // Total number of data processed (bytes) of this load balancer within current calendar month. - DataProcessedThisMonth *int64 `json:"data_processed_this_month" validate:"required"` - - // Current throughput (Mbps) of this load balancer. - Throughput *float32 `json:"throughput" validate:"required"` -} - -// UnmarshalLoadBalancerStatistics unmarshals an instance of LoadBalancerStatistics from the specified map of raw messages. -func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerStatistics) - err = core.UnmarshalPrimitive(m, "active_connections", &obj.ActiveConnections) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_rate", &obj.ConnectionRate) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "data_processed_this_month", &obj.DataProcessedThisMonth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "throughput", &obj.Throughput) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACL : NetworkACL struct -type NetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` - - // The name for this network ACL. The name is unique across all network ACLs for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this network ACL. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The ordered rules for this network ACL. If no rules exist, all traffic will be denied. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The VPC this network ACL resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalNetworkACL unmarshals an instance of NetworkACL from the specified map of raw messages. -func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLCollection : NetworkACLCollection struct -type NetworkACLCollection struct { - // A link to the first page of resources. - First *NetworkACLCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of network ACLs. - NetworkAcls []NetworkACL `json:"network_acls" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *NetworkACLCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalNetworkACLCollection unmarshals an instance of NetworkACLCollection from the specified map of raw messages. -func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acls", &obj.NetworkAcls, UnmarshalNetworkACL) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// NetworkACLCollectionFirst : A link to the first page of resources. -type NetworkACLCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalNetworkACLCollectionFirst unmarshals an instance of NetworkACLCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalNetworkACLCollectionNext unmarshals an instance of NetworkACLCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentity : Identifies a network ACL by a unique property. -// Models which "extend" this model: -// - NetworkACLIdentityByID -// - NetworkACLIdentityByCRN -// - NetworkACLIdentityByHref -type NetworkACLIdentity struct { - // The unique identifier for this network ACL. - ID *string `json:"id,omitempty"` - - // The CRN for this network ACL. - CRN *string `json:"crn,omitempty"` - - // The URL for this network ACL. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLIdentity) isaNetworkACLIdentity() bool { - return true -} - -type NetworkACLIdentityIntf interface { - isaNetworkACLIdentity() bool -} - -// UnmarshalNetworkACLIdentity unmarshals an instance of NetworkACLIdentity from the specified map of raw messages. -func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLPatch : NetworkACLPatch struct -type NetworkACLPatch struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalNetworkACLPatch unmarshals an instance of NetworkACLPatch from the specified map of raw messages. -func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the NetworkACLPatch -func (networkACLPatch *NetworkACLPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkACLPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// NetworkACLPrototype : NetworkACLPrototype struct -// Models which "extend" this model: -// - NetworkACLPrototypeNetworkACLByRules -// - NetworkACLPrototypeNetworkACLBySourceNetworkACL -type NetworkACLPrototype struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` - - // Network ACL to copy rules from. - SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl,omitempty"` -} - -func (*NetworkACLPrototype) isaNetworkACLPrototype() bool { - return true -} - -type NetworkACLPrototypeIntf interface { - isaNetworkACLPrototype() bool -} - -// UnmarshalNetworkACLPrototype unmarshals an instance of NetworkACLPrototype from the specified map of raw messages. -func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLReference : NetworkACLReference struct -type NetworkACLReference struct { - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkACLReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` - - // The name for this network ACL. The name is unique across all network ACLs for the VPC. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalNetworkACLReference unmarshals an instance of NetworkACLReference from the specified map of raw messages. -func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkACLReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkACLReferenceDeleted unmarshals an instance of NetworkACLReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRule : NetworkACLRule struct -// Models which "extend" this model: -// - NetworkACLRuleNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleNetworkACLRuleProtocolIcmp -// - NetworkACLRuleNetworkACLRuleProtocolAll -type NetworkACLRule struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRule.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleActionAllowConst = "allow" - NetworkACLRuleActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRule.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleDirectionInboundConst = "inbound" - NetworkACLRuleDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRule.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRule.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleProtocolAllConst = "all" - NetworkACLRuleProtocolIcmpConst = "icmp" - NetworkACLRuleProtocolTCPConst = "tcp" - NetworkACLRuleProtocolUDPConst = "udp" -) - -func (*NetworkACLRule) isaNetworkACLRule() bool { - return true -} - -type NetworkACLRuleIntf interface { - isaNetworkACLRule() bool -} - -// UnmarshalNetworkACLRule unmarshals an instance of NetworkACLRule from the specified map of raw messages. -func UnmarshalNetworkACLRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// NetworkACLRuleBeforePatch : The rule to move this rule immediately before. -// -// Specify `null` to move this rule after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePatch struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLRuleBeforePatch) isaNetworkACLRuleBeforePatch() bool { - return true -} - -type NetworkACLRuleBeforePatchIntf interface { - isaNetworkACLRuleBeforePatch() bool -} - -// UnmarshalNetworkACLRuleBeforePatch unmarshals an instance of NetworkACLRuleBeforePatch from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. -// -// If unspecified, this rule will be inserted after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePrototype struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLRuleBeforePrototype) isaNetworkACLRuleBeforePrototype() bool { - return true -} - -type NetworkACLRuleBeforePrototypeIntf interface { - isaNetworkACLRuleBeforePrototype() bool -} - -// UnmarshalNetworkACLRuleBeforePrototype unmarshals an instance of NetworkACLRuleBeforePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleCollection : NetworkACLRuleCollection struct -type NetworkACLRuleCollection struct { - // A link to the first page of resources. - First *NetworkACLRuleCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *NetworkACLRuleCollectionNext `json:"next,omitempty"` - - // Ordered collection of network ACL rules. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalNetworkACLRuleCollection unmarshals an instance of NetworkACLRuleCollection from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLRuleCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLRuleCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// NetworkACLRuleCollectionFirst : A link to the first page of resources. -type NetworkACLRuleCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalNetworkACLRuleCollectionFirst unmarshals an instance of NetworkACLRuleCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLRuleCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalNetworkACLRuleCollectionNext unmarshals an instance of NetworkACLRuleCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleItem : NetworkACLRuleItem struct -// Models which "extend" this model: -// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp -// - NetworkACLRuleItemNetworkACLRuleProtocolAll -type NetworkACLRuleItem struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always - // refers to the next item in the collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRuleItem.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemActionAllowConst = "allow" - NetworkACLRuleItemActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItem.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemDirectionInboundConst = "inbound" - NetworkACLRuleItemDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItem.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItem.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemProtocolAllConst = "all" - NetworkACLRuleItemProtocolIcmpConst = "icmp" - NetworkACLRuleItemProtocolTCPConst = "tcp" - NetworkACLRuleItemProtocolUDPConst = "udp" -) - -func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { - return true -} - -type NetworkACLRuleItemIntf interface { - isaNetworkACLRuleItem() bool -} - -// UnmarshalNetworkACLRuleItem unmarshals an instance of NetworkACLRuleItem from the specified map of raw messages. -func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// NetworkACLRulePatch : NetworkACLRulePatch struct -type NetworkACLRulePatch struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action,omitempty"` - - // The rule to move this rule immediately before. - // - // Specify `null` to move this rule after all existing rules. - Before NetworkACLRuleBeforePatchIntf `json:"before,omitempty"` - - // The ICMP traffic code to match. If set, `type` must also be set. - // - // Specify `null` to remove an existing ICMP traffic code. - Code *int64 `json:"code,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The direction of traffic to match. - Direction *string `json:"direction,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic type to match. - // - // Specify `null` to remove an existing ICMP traffic type value. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePatch.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePatchActionAllowConst = "allow" - NetworkACLRulePatchActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePatch.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePatchDirectionInboundConst = "inbound" - NetworkACLRulePatchDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePatch.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePatchProtocolAllConst = "all" - NetworkACLRulePatchProtocolIcmpConst = "icmp" - NetworkACLRulePatchProtocolTCPConst = "tcp" - NetworkACLRulePatchProtocolUDPConst = "udp" -) - -// UnmarshalNetworkACLRulePatch unmarshals an instance of NetworkACLRulePatch from the specified map of raw messages. -func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the NetworkACLRulePatch -func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkACLRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// NetworkACLRulePrototype : NetworkACLRulePrototype struct -// Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype -// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype -// - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype -type NetworkACLRulePrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule to insert this rule immediately before. - // - // If unspecified, this rule will be inserted after all existing rules. - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeProtocolAllConst = "all" - NetworkACLRulePrototypeProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeProtocolUDPConst = "udp" -) - -func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { - return true -} - -type NetworkACLRulePrototypeIntf interface { - isaNetworkACLRulePrototype() bool -} - -// UnmarshalNetworkACLRulePrototype unmarshals an instance of NetworkACLRulePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct -// Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype -type NetworkACLRulePrototypeNetworkACLContext struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextProtocolAllConst = "all" - NetworkACLRulePrototypeNetworkACLContextProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeNetworkACLContextProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLContextProtocolUDPConst = "udp" -) - -func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} - -type NetworkACLRulePrototypeNetworkACLContextIntf interface { - isaNetworkACLRulePrototypeNetworkACLContext() bool -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLContext unmarshals an instance of NetworkACLRulePrototypeNetworkACLContext from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContext(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// NetworkACLRuleReference : NetworkACLRuleReference struct -type NetworkACLRuleReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkACLRuleReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalNetworkACLRuleReference unmarshals an instance of NetworkACLRuleReference from the specified map of raw messages. -func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLRuleReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkACLRuleReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkACLRuleReferenceDeleted unmarshals an instance of NetworkACLRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterface : NetworkInterface struct -type NetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the instance network interface was created. - // - // If this instance has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding - // network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The floating IPs associated with this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated - // with the attached virtual network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding - // network attachment. - Name *string `json:"name" validate:"required"` - - // The instance network interface port speed in Mbps. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the port speed is that of its - // corresponding network attachment. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the security groups are associated - // with the attached virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the instance network interface. - // - // If this instance has network attachments, this network interface is a read-only representation of its corresponding - // network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The instance network interface type. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the type is that of its - // corresponding network attachment. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the NetworkInterface.ResourceType property. -// The resource type. -const ( - NetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the NetworkInterface.Status property. -// The status of the instance network interface. -// -// If this instance has network attachments, this network interface is a read-only representation of its corresponding -// network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). -const ( - NetworkInterfaceStatusAvailableConst = "available" - NetworkInterfaceStatusDeletingConst = "deleting" - NetworkInterfaceStatusFailedConst = "failed" - NetworkInterfaceStatusPendingConst = "pending" -) - -// Constants associated with the NetworkInterface.Type property. -// The instance network interface type. -// -// If this instance has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the type is that of its -// corresponding network attachment. -const ( - NetworkInterfaceTypePrimaryConst = "primary" - NetworkInterfaceTypeSecondaryConst = "secondary" -) - -// UnmarshalNetworkInterface unmarshals an instance of NetworkInterface from the specified map of raw messages. -func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceBareMetalServerContextReference : NetworkInterfaceBareMetalServerContextReference struct -type NetworkInterfaceBareMetalServerContextReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceBareMetalServerContextReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the NetworkInterfaceBareMetalServerContextReference.ResourceType property. -// The resource type. -const ( - NetworkInterfaceBareMetalServerContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// UnmarshalNetworkInterfaceBareMetalServerContextReference unmarshals an instance of NetworkInterfaceBareMetalServerContextReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceBareMetalServerContextReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceBareMetalServerContextReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceBareMetalServerContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceBareMetalServerContextReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted unmarshals an instance of NetworkInterfaceBareMetalServerContextReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceBareMetalServerContextReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceIPPrototype : NetworkInterfaceIPPrototype struct -// Models which "extend" this model: -// - NetworkInterfaceIPPrototypeReservedIPIdentity -// - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext -type NetworkInterfaceIPPrototype struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*NetworkInterfaceIPPrototype) isaNetworkInterfaceIPPrototype() bool { - return true -} - -type NetworkInterfaceIPPrototypeIntf interface { - isaNetworkInterfaceIPPrototype() bool -} - -// UnmarshalNetworkInterfaceIPPrototype unmarshals an instance of NetworkInterfaceIPPrototype from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceInstanceContextReference : NetworkInterfaceInstanceContextReference struct -type NetworkInterfaceInstanceContextReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceInstanceContextReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the NetworkInterfaceInstanceContextReference.ResourceType property. -// The resource type. -const ( - NetworkInterfaceInstanceContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// UnmarshalNetworkInterfaceInstanceContextReference unmarshals an instance of NetworkInterfaceInstanceContextReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceInstanceContextReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceInstanceContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceInstanceContextReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceInstanceContextReferenceDeleted unmarshals an instance of NetworkInterfaceInstanceContextReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfacePatch : NetworkInterfacePatch struct -type NetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. - Name *string `json:"name,omitempty"` -} - -// UnmarshalNetworkInterfacePatch unmarshals an instance of NetworkInterfacePatch from the specified map of raw messages. -func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the NetworkInterfacePatch -func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// NetworkInterfacePrototype : NetworkInterfacePrototype struct -type NetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The name for the instance network interface. The name must not be used by another network interface on the virtual - // server instance. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an - // available address on the subnet will be automatically selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this instance network interface. If unspecified, the VPC's default security group is - // used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -} - -// NewNetworkInterfacePrototype : Instantiate NetworkInterfacePrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *NetworkInterfacePrototype, err error) { - _model = &NetworkInterfacePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalNetworkInterfacePrototype unmarshals an instance of NetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceReferenceDeleted unmarshals an instance of NetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type NetworkInterfaceReferenceTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of NetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceUnpaginatedCollection : NetworkInterfaceUnpaginatedCollection struct -type NetworkInterfaceUnpaginatedCollection struct { - // Collection of instance network interfaces. - NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` -} - -// UnmarshalNetworkInterfaceUnpaginatedCollection unmarshals an instance of NetworkInterfaceUnpaginatedCollection from the specified map of raw messages. -func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceUnpaginatedCollection) - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ObsoleteImageOptions : The ObsoleteImage options. -type ObsoleteImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewObsoleteImageOptions : Instantiate ObsoleteImageOptions -func (*VpcV1) NewObsoleteImageOptions(id string) *ObsoleteImageOptions { - return &ObsoleteImageOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *ObsoleteImageOptions) SetID(id string) *ObsoleteImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ObsoleteImageOptions) SetHeaders(param map[string]string) *ObsoleteImageOptions { - options.Headers = param - return options -} - -// OperatingSystem : OperatingSystem struct -type OperatingSystem struct { - // The operating system architecture. - Architecture *string `json:"architecture" validate:"required"` - - // Images with this operating system can only be used on dedicated hosts or dedicated host groups. - DedicatedHostOnly *bool `json:"dedicated_host_only" validate:"required"` - - // A unique, display-friendly name for the operating system. - DisplayName *string `json:"display_name" validate:"required"` - - // The software family for this operating system. - Family *string `json:"family" validate:"required"` - - // The URL for this operating system. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this operating system. - Name *string `json:"name" validate:"required"` - - // The vendor of the operating system. - Vendor *string `json:"vendor" validate:"required"` - - // The major release version of this operating system. - Version *string `json:"version" validate:"required"` -} - -// UnmarshalOperatingSystem unmarshals an instance of OperatingSystem from the specified map of raw messages. -func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystem) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dedicated_host_only", &obj.DedicatedHostOnly) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vendor", &obj.Vendor) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemCollection : OperatingSystemCollection struct -type OperatingSystemCollection struct { - // A link to the first page of resources. - First *OperatingSystemCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *OperatingSystemCollectionNext `json:"next,omitempty"` - - // Collection of operating systems. - OperatingSystems []OperatingSystem `json:"operating_systems" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalOperatingSystemCollection unmarshals an instance of OperatingSystemCollection from the specified map of raw messages. -func UnmarshalOperatingSystemCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalOperatingSystemCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalOperatingSystemCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_systems", &obj.OperatingSystems, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *OperatingSystemCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// OperatingSystemCollectionFirst : A link to the first page of resources. -type OperatingSystemCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalOperatingSystemCollectionFirst unmarshals an instance of OperatingSystemCollectionFirst from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type OperatingSystemCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalOperatingSystemCollectionNext unmarshals an instance of OperatingSystemCollectionNext from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemIdentity : Identifies an operating system by a unique property. -// Models which "extend" this model: -// - OperatingSystemIdentityByName -// - OperatingSystemIdentityByHref -type OperatingSystemIdentity struct { - // The globally unique name for this operating system. - Name *string `json:"name,omitempty"` - - // The URL for this operating system. - Href *string `json:"href,omitempty"` -} - -func (*OperatingSystemIdentity) isaOperatingSystemIdentity() bool { - return true -} - -type OperatingSystemIdentityIntf interface { - isaOperatingSystemIdentity() bool -} - -// UnmarshalOperatingSystemIdentity unmarshals an instance of OperatingSystemIdentity from the specified map of raw messages. -func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PlacementGroup : PlacementGroup struct -type PlacementGroup struct { - // The date and time that the placement group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` - - // The URL for this placement group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the placement group. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this placement group. The name is unique across all placement groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource group for this placement group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` -} - -// Constants associated with the PlacementGroup.LifecycleState property. -// The lifecycle state of the placement group. -const ( - PlacementGroupLifecycleStateDeletingConst = "deleting" - PlacementGroupLifecycleStateFailedConst = "failed" - PlacementGroupLifecycleStatePendingConst = "pending" - PlacementGroupLifecycleStateStableConst = "stable" - PlacementGroupLifecycleStateSuspendedConst = "suspended" - PlacementGroupLifecycleStateUpdatingConst = "updating" - PlacementGroupLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the PlacementGroup.ResourceType property. -// The resource type. -const ( - PlacementGroupResourceTypePlacementGroupConst = "placement_group" -) - -// Constants associated with the PlacementGroup.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. -const ( - PlacementGroupStrategyHostSpreadConst = "host_spread" - PlacementGroupStrategyPowerSpreadConst = "power_spread" -) - -// UnmarshalPlacementGroup unmarshals an instance of PlacementGroup from the specified map of raw messages. -func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "strategy", &obj.Strategy) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PlacementGroupCollection : PlacementGroupCollection struct -type PlacementGroupCollection struct { - // A link to the first page of resources. - First *PlacementGroupCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *PlacementGroupCollectionNext `json:"next,omitempty"` - - // Collection of placement groups. - PlacementGroups []PlacementGroup `json:"placement_groups" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalPlacementGroupCollection unmarshals an instance of PlacementGroupCollection from the specified map of raw messages. -func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPlacementGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPlacementGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_groups", &obj.PlacementGroups, UnmarshalPlacementGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// PlacementGroupCollectionFirst : A link to the first page of resources. -type PlacementGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPlacementGroupCollectionFirst unmarshals an instance of PlacementGroupCollectionFirst from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PlacementGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PlacementGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPlacementGroupCollectionNext unmarshals an instance of PlacementGroupCollectionNext from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PlacementGroupPatch : PlacementGroupPatch struct -type PlacementGroupPatch struct { - // The name for this placement group. The name must not be used by another placement group in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalPlacementGroupPatch unmarshals an instance of PlacementGroupPatch from the specified map of raw messages. -func UnmarshalPlacementGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the PlacementGroupPatch -func (placementGroupPatch *PlacementGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(placementGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// PlacementGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type PlacementGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalPlacementGroupReferenceDeleted unmarshals an instance of PlacementGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalPlacementGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGateway : PublicGateway struct -type PublicGateway struct { - // The date and time that the public gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` - - // The floating IP bound to this public gateway. - FloatingIP *PublicGatewayFloatingIP `json:"floating_ip" validate:"required"` - - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` - - // The name for this public gateway. The name is unique across all public gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this public gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of this public gateway. - Status *string `json:"status" validate:"required"` - - // The VPC this public gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this public gateway resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the PublicGateway.ResourceType property. -// The resource type. -const ( - PublicGatewayResourceTypePublicGatewayConst = "public_gateway" -) - -// Constants associated with the PublicGateway.Status property. -// The status of this public gateway. -const ( - PublicGatewayStatusAvailableConst = "available" - PublicGatewayStatusDeletingConst = "deleting" - PublicGatewayStatusFailedConst = "failed" - PublicGatewayStatusPendingConst = "pending" -) - -// UnmarshalPublicGateway unmarshals an instance of PublicGateway from the specified map of raw messages. -func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGateway) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ip", &obj.FloatingIP, UnmarshalPublicGatewayFloatingIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayCollection : PublicGatewayCollection struct -type PublicGatewayCollection struct { - // A link to the first page of resources. - First *PublicGatewayCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *PublicGatewayCollectionNext `json:"next,omitempty"` - - // Collection of public gateways. - PublicGateways []PublicGateway `json:"public_gateways" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalPublicGatewayCollection unmarshals an instance of PublicGatewayCollection from the specified map of raw messages. -func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPublicGatewayCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPublicGatewayCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateways", &obj.PublicGateways, UnmarshalPublicGateway) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// PublicGatewayCollectionFirst : A link to the first page of resources. -type PublicGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPublicGatewayCollectionFirst unmarshals an instance of PublicGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PublicGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPublicGatewayCollectionNext unmarshals an instance of PublicGatewayCollectionNext from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIP : The floating IP bound to this public gateway. -type PublicGatewayFloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` - - // The name for this floating IP. The name is unique across all floating IPs in the region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalPublicGatewayFloatingIP unmarshals an instance of PublicGatewayFloatingIP from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototype : PublicGatewayFloatingIPPrototype struct -// Models which "extend" this model: -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentity -// - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext -type PublicGatewayFloatingIPPrototype struct { - // The unique identifier for this floating IP. - ID *string `json:"id,omitempty"` - - // The CRN for this floating IP. - CRN *string `json:"crn,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href,omitempty"` - - // The globally unique IP address. - Address *string `json:"address,omitempty"` - - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -} - -func (*PublicGatewayFloatingIPPrototype) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -type PublicGatewayFloatingIPPrototypeIntf interface { - isaPublicGatewayFloatingIPPrototype() bool -} - -// UnmarshalPublicGatewayFloatingIPPrototype unmarshals an instance of PublicGatewayFloatingIPPrototype from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayIdentity : Identifies a public gateway by a unique property. -// Models which "extend" this model: -// - PublicGatewayIdentityPublicGatewayIdentityByID -// - PublicGatewayIdentityPublicGatewayIdentityByCRN -// - PublicGatewayIdentityPublicGatewayIdentityByHref -type PublicGatewayIdentity struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href,omitempty"` -} - -func (*PublicGatewayIdentity) isaPublicGatewayIdentity() bool { - return true -} - -type PublicGatewayIdentityIntf interface { - isaPublicGatewayIdentity() bool -} - -// UnmarshalPublicGatewayIdentity unmarshals an instance of PublicGatewayIdentity from the specified map of raw messages. -func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayPatch : PublicGatewayPatch struct -type PublicGatewayPatch struct { - // The name for this public gateway. The name must not be used by another public gateway in the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalPublicGatewayPatch unmarshals an instance of PublicGatewayPatch from the specified map of raw messages. -func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the PublicGatewayPatch -func (publicGatewayPatch *PublicGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(publicGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// PublicGatewayReference : PublicGatewayReference struct -type PublicGatewayReference struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` - - // The name for this public gateway. The name is unique across all public gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the PublicGatewayReference.ResourceType property. -// The resource type. -const ( - PublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" -) - -// UnmarshalPublicGatewayReference unmarshals an instance of PublicGatewayReference from the specified map of raw messages. -func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type PublicGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalPublicGatewayReferenceDeleted unmarshals an instance of PublicGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Region : Region struct -type Region struct { - // The API endpoint for this region. - Endpoint *string `json:"endpoint" validate:"required"` - - // The URL for this region. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this region. - Name *string `json:"name" validate:"required"` - - // The availability status of this region. - Status *string `json:"status" validate:"required"` -} - -// Constants associated with the Region.Status property. -// The availability status of this region. -const ( - RegionStatusAvailableConst = "available" - RegionStatusUnavailableConst = "unavailable" -) - -// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. -func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Region) - err = core.UnmarshalPrimitive(m, "endpoint", &obj.Endpoint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RegionCollection : RegionCollection struct -type RegionCollection struct { - // Collection of regions. - Regions []Region `json:"regions" validate:"required"` -} - -// UnmarshalRegionCollection unmarshals an instance of RegionCollection from the specified map of raw messages. -func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionCollection) - err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RegionIdentity : Identifies a region by a unique property. -// Models which "extend" this model: -// - RegionIdentityByName -// - RegionIdentityByHref -type RegionIdentity struct { - // The globally unique name for this region. - Name *string `json:"name,omitempty"` - - // The URL for this region. - Href *string `json:"href,omitempty"` -} - -func (*RegionIdentity) isaRegionIdentity() bool { - return true -} - -type RegionIdentityIntf interface { - isaRegionIdentity() bool -} - -// UnmarshalRegionIdentity unmarshals an instance of RegionIdentity from the specified map of raw messages. -func UnmarshalRegionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RegionReference : RegionReference struct -type RegionReference struct { - // The URL for this region. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this region. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalRegionReference unmarshals an instance of RegionReference from the specified map of raw messages. -func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RemoveBareMetalServerNetworkInterfaceFloatingIPOptions : The RemoveBareMetalServerNetworkInterfaceFloatingIP options. -type RemoveBareMetalServerNetworkInterfaceFloatingIPOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate RemoveBareMetalServerNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - return &RemoveBareMetalServerNetworkInterfaceFloatingIPOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// RemoveEndpointGatewayIPOptions : The RemoveEndpointGatewayIP options. -type RemoveEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveEndpointGatewayIPOptions : Instantiate RemoveEndpointGatewayIPOptions -func (*VpcV1) NewRemoveEndpointGatewayIPOptions(endpointGatewayID string, id string) *RemoveEndpointGatewayIPOptions { - return &RemoveEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), - } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *RemoveEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *RemoveEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveEndpointGatewayIPOptions) SetID(id string) *RemoveEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveEndpointGatewayIPOptions) SetHeaders(param map[string]string) *RemoveEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// RemoveInstanceNetworkInterfaceFloatingIPOptions : The RemoveInstanceNetworkInterfaceFloatingIP options. -type RemoveInstanceNetworkInterfaceFloatingIPOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveInstanceNetworkInterfaceFloatingIPOptions : Instantiate RemoveInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - return &RemoveInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// RemoveNetworkInterfaceFloatingIPOptions : The RemoveNetworkInterfaceFloatingIP options. -type RemoveNetworkInterfaceFloatingIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveNetworkInterfaceFloatingIPOptions : Instantiate RemoveNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveNetworkInterfaceFloatingIPOptions(virtualNetworkInterfaceID string, id string) *RemoveNetworkInterfaceFloatingIPOptions { - return &RemoveNetworkInterfaceFloatingIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *RemoveNetworkInterfaceFloatingIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *RemoveNetworkInterfaceFloatingIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// RemoveVirtualNetworkInterfaceIPOptions : The RemoveVirtualNetworkInterfaceIP options. -type RemoveVirtualNetworkInterfaceIPOptions struct { - // The virtual network interface identifier. - VirtualNetworkInterfaceID *string `json:"virtual_network_interface_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveVirtualNetworkInterfaceIPOptions : Instantiate RemoveVirtualNetworkInterfaceIPOptions -func (*VpcV1) NewRemoveVirtualNetworkInterfaceIPOptions(virtualNetworkInterfaceID string, id string) *RemoveVirtualNetworkInterfaceIPOptions { - return &RemoveVirtualNetworkInterfaceIPOptions{ - VirtualNetworkInterfaceID: core.StringPtr(virtualNetworkInterfaceID), - ID: core.StringPtr(id), - } -} - -// SetVirtualNetworkInterfaceID : Allow user to set VirtualNetworkInterfaceID -func (_options *RemoveVirtualNetworkInterfaceIPOptions) SetVirtualNetworkInterfaceID(virtualNetworkInterfaceID string) *RemoveVirtualNetworkInterfaceIPOptions { - _options.VirtualNetworkInterfaceID = core.StringPtr(virtualNetworkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveVirtualNetworkInterfaceIPOptions) SetID(id string) *RemoveVirtualNetworkInterfaceIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string]string) *RemoveVirtualNetworkInterfaceIPOptions { - options.Headers = param - return options -} - -// RemoveVPNGatewayConnectionLocalCIDROptions : The RemoveVPNGatewayConnectionLocalCIDR options. -type RemoveVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveVPNGatewayConnectionLocalCIDROptions : Instantiate RemoveVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - return &RemoveVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} - -// RemoveVPNGatewayConnectionPeerCIDROptions : The RemoveVPNGatewayConnectionPeerCIDR options. -type RemoveVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRemoveVPNGatewayConnectionPeerCIDROptions : Instantiate RemoveVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - return &RemoveVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} - -// ReplaceLoadBalancerPoolMembersOptions : The ReplaceLoadBalancerPoolMembers options. -type ReplaceLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The member prototype objects for this pool. - Members []LoadBalancerPoolMemberPrototype `json:"members" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReplaceLoadBalancerPoolMembersOptions : Instantiate ReplaceLoadBalancerPoolMembersOptions -func (*VpcV1) NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string, members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - return &ReplaceLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Members: members, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetMembers : Allow user to set Members -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - _options.Members = members - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReplaceLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ReplaceLoadBalancerPoolMembersOptions { - options.Headers = param - return options -} - -// ReplaceSubnetNetworkACLOptions : The ReplaceSubnetNetworkACL options. -type ReplaceSubnetNetworkACLOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // The network ACL identity. - NetworkACLIdentity NetworkACLIdentityIntf `json:"NetworkACLIdentity" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReplaceSubnetNetworkACLOptions : Instantiate ReplaceSubnetNetworkACLOptions -func (*VpcV1) NewReplaceSubnetNetworkACLOptions(id string, networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - return &ReplaceSubnetNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLIdentity: networkACLIdentity, - } -} - -// SetID : Allow user to set ID -func (_options *ReplaceSubnetNetworkACLOptions) SetID(id string) *ReplaceSubnetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetNetworkACLIdentity : Allow user to set NetworkACLIdentity -func (_options *ReplaceSubnetNetworkACLOptions) SetNetworkACLIdentity(networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - _options.NetworkACLIdentity = networkACLIdentity - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetNetworkACLOptions) SetHeaders(param map[string]string) *ReplaceSubnetNetworkACLOptions { - options.Headers = param - return options -} - -// ReplaceSubnetRoutingTableOptions : The ReplaceSubnetRoutingTable options. -type ReplaceSubnetRoutingTableOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // The routing table identity. - RoutingTableIdentity RoutingTableIdentityIntf `json:"RoutingTableIdentity" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReplaceSubnetRoutingTableOptions : Instantiate ReplaceSubnetRoutingTableOptions -func (*VpcV1) NewReplaceSubnetRoutingTableOptions(id string, routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - return &ReplaceSubnetRoutingTableOptions{ - ID: core.StringPtr(id), - RoutingTableIdentity: routingTableIdentity, - } -} - -// SetID : Allow user to set ID -func (_options *ReplaceSubnetRoutingTableOptions) SetID(id string) *ReplaceSubnetRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetRoutingTableIdentity : Allow user to set RoutingTableIdentity -func (_options *ReplaceSubnetRoutingTableOptions) SetRoutingTableIdentity(routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - _options.RoutingTableIdentity = routingTableIdentity - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]string) *ReplaceSubnetRoutingTableOptions { - options.Headers = param - return options -} - -// Reservation : Reservation struct -type Reservation struct { - // The affinity policy to use for this reservation: - // - `restricted`: The reservation must be manually requested - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - AffinityPolicy *string `json:"affinity_policy" validate:"required"` - - // The capacity configuration for this reservation - // - // If absent, this reservation has no assigned capacity. - Capacity *ReservationCapacity `json:"capacity,omitempty"` - - // The committed use configuration for this reservation. - // - // If absent, this reservation has no commitment for use. - CommittedUse *ReservationCommittedUse `json:"committed_use,omitempty"` - - // The date and time that the reservation was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this reservation. - CRN *string `json:"crn" validate:"required"` - - // The URL for this reservation. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reservation. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of this reservation. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this reservation. The name is unique across all reservations in the region. - Name *string `json:"name" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. - Profile ReservationProfileIntf `json:"profile" validate:"required"` - - // The resource group for this reservation. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the reservation. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ReservationStatusReason `json:"status_reasons" validate:"required"` - - // The zone for this reservation. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Reservation.AffinityPolicy property. -// The affinity policy to use for this reservation: -// - `restricted`: The reservation must be manually requested -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationAffinityPolicyRestrictedConst = "restricted" -) - -// Constants associated with the Reservation.LifecycleState property. -// The lifecycle state of this reservation. -const ( - ReservationLifecycleStateDeletingConst = "deleting" - ReservationLifecycleStateFailedConst = "failed" - ReservationLifecycleStatePendingConst = "pending" - ReservationLifecycleStateStableConst = "stable" - ReservationLifecycleStateSuspendedConst = "suspended" - ReservationLifecycleStateUpdatingConst = "updating" - ReservationLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Reservation.ResourceType property. -// The resource type. -const ( - ReservationResourceTypeReservationConst = "reservation" -) - -// Constants associated with the Reservation.Status property. -// The status of the reservation. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationStatusActivatingConst = "activating" - ReservationStatusActiveConst = "active" - ReservationStatusDeactivatingConst = "deactivating" - ReservationStatusExpiredConst = "expired" - ReservationStatusFailedConst = "failed" - ReservationStatusInactiveConst = "inactive" -) - -// UnmarshalReservation unmarshals an instance of Reservation from the specified map of raw messages. -func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Reservation) - err = core.UnmarshalPrimitive(m, "affinity_policy", &obj.AffinityPolicy) - if err != nil { - return - } - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUse) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfile) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalReservationStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacity : The capacity configuration for this reservation -// -// If absent, this reservation has no assigned capacity. -type ReservationCapacity struct { - // The amount allocated to this capacity reservation. - Allocated *int64 `json:"allocated" validate:"required"` - - // The amount of this capacity reservation available for new attachments. - Available *int64 `json:"available" validate:"required"` - - // The status of the capacity reservation: - // - `allocating`: The capacity reservation is being allocated for use - // - `allocated`: The total capacity of the reservation has been allocated for use - // - `degraded`: The capacity reservation has been allocated for use, but some of the - // capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more - // information. - // - `unallocated`: The capacity reservation is not allocated for use - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The total amount of this capacity reservation. - Total *int64 `json:"total" validate:"required"` - - // The amount of this capacity reservation used by existing attachments. - Used *int64 `json:"used" validate:"required"` -} - -// Constants associated with the ReservationCapacity.Status property. -// The status of the capacity reservation: -// - `allocating`: The capacity reservation is being allocated for use -// - `allocated`: The total capacity of the reservation has been allocated for use -// - `degraded`: The capacity reservation has been allocated for use, but some of the -// capacity is not available. See https://cloud.ibm.com/docs/__TBD__ for more -// information. -// - `unallocated`: The capacity reservation is not allocated for use -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCapacityStatusAllocatedConst = "allocated" - ReservationCapacityStatusAllocatingConst = "allocating" - ReservationCapacityStatusDegradedConst = "degraded" - ReservationCapacityStatusUnallocatedConst = "unallocated" -) - -// UnmarshalReservationCapacity unmarshals an instance of ReservationCapacity from the specified map of raw messages. -func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacity) - err = core.UnmarshalPrimitive(m, "allocated", &obj.Allocated) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "available", &obj.Available) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total", &obj.Total) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "used", &obj.Used) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacityPatch : The capacity reservation configuration to use. -// -// The configuration can only be changed for reservations with a `status` of `inactive`. -type ReservationCapacityPatch struct { - // The total amount to use for this capacity reservation. - Total *int64 `json:"total,omitempty"` -} - -// UnmarshalReservationCapacityPatch unmarshals an instance of ReservationCapacityPatch from the specified map of raw messages. -func UnmarshalReservationCapacityPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacityPatch) - err = core.UnmarshalPrimitive(m, "total", &obj.Total) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCapacityPrototype : The capacity reservation configuration to use. -type ReservationCapacityPrototype struct { - // The total amount to use for this capacity reservation. - Total *int64 `json:"total" validate:"required"` -} - -// NewReservationCapacityPrototype : Instantiate ReservationCapacityPrototype (Generic Model Constructor) -func (*VpcV1) NewReservationCapacityPrototype(total int64) (_model *ReservationCapacityPrototype, err error) { - _model = &ReservationCapacityPrototype{ - Total: core.Int64Ptr(total), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalReservationCapacityPrototype unmarshals an instance of ReservationCapacityPrototype from the specified map of raw messages. -func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCapacityPrototype) - err = core.UnmarshalPrimitive(m, "total", &obj.Total) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCollection : ReservationCollection struct -type ReservationCollection struct { - // A link to the first page of resources. - First *ReservationCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservationCollectionNext `json:"next,omitempty"` - - // Collection of reservations. - Reservations []Reservation `json:"reservations" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservationCollection unmarshals an instance of ReservationCollection from the specified map of raw messages. -func UnmarshalReservationCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservationCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservationCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservations", &obj.Reservations, UnmarshalReservation) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservationCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservationCollectionFirst : A link to the first page of resources. -type ReservationCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservationCollectionFirst unmarshals an instance of ReservationCollectionFirst from the specified map of raw messages. -func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservationCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservationCollectionNext unmarshals an instance of ReservationCollectionNext from the specified map of raw messages. -func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCommittedUse : The committed use reservation configuration. -type ReservationCommittedUse struct { - // The expiration date and time for this committed use reservation. - ExpirationAt *strfmt.DateTime `json:"expiration_at" validate:"required"` - - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy" validate:"required"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - Term *string `json:"term" validate:"required"` -} - -// Constants associated with the ReservationCommittedUse.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUseExpirationPolicyReleaseConst = "release" - ReservationCommittedUseExpirationPolicyRenewConst = "renew" -) - -// UnmarshalReservationCommittedUse unmarshals an instance of ReservationCommittedUse from the specified map of raw messages. -func UnmarshalReservationCommittedUse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUse) - err = core.UnmarshalPrimitive(m, "expiration_at", &obj.ExpirationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCommittedUsePatch : ReservationCommittedUsePatch struct -type ReservationCommittedUsePatch struct { - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy,omitempty"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The specified value must be listed in the `reservation_terms` in the profile for this reservation. The term can only - // be changed for a reservation with a `status` of - // `inactive`. - Term *string `json:"term,omitempty"` -} - -// Constants associated with the ReservationCommittedUsePatch.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUsePatchExpirationPolicyReleaseConst = "release" - ReservationCommittedUsePatchExpirationPolicyRenewConst = "renew" -) - -// UnmarshalReservationCommittedUsePatch unmarshals an instance of ReservationCommittedUsePatch from the specified map of raw messages. -func UnmarshalReservationCommittedUsePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUsePatch) - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationCommittedUsePrototype : ReservationCommittedUsePrototype struct -type ReservationCommittedUsePrototype struct { - // The policy to apply when the committed use term expires: - // - `release`: Release any available capacity and let the reservation expire. - // - `renew`: Renew for another term, provided the term remains listed in the - // `reservation_terms` for the profile. Otherwise, let the reservation expire. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - ExpirationPolicy *string `json:"expiration_policy,omitempty"` - - // The term for this committed use reservation: - // - `one_year`: 1 year - // - `three_year`: 3 years - // - // The specified value must be listed in the `reservation_terms` in the profile for this reservation. - Term *string `json:"term" validate:"required"` -} - -// Constants associated with the ReservationCommittedUsePrototype.ExpirationPolicy property. -// The policy to apply when the committed use term expires: -// - `release`: Release any available capacity and let the reservation expire. -// - `renew`: Renew for another term, provided the term remains listed in the -// `reservation_terms` for the profile. Otherwise, let the reservation expire. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ReservationCommittedUsePrototypeExpirationPolicyReleaseConst = "release" - ReservationCommittedUsePrototypeExpirationPolicyRenewConst = "renew" -) - -// NewReservationCommittedUsePrototype : Instantiate ReservationCommittedUsePrototype (Generic Model Constructor) -func (*VpcV1) NewReservationCommittedUsePrototype(term string) (_model *ReservationCommittedUsePrototype, err error) { - _model = &ReservationCommittedUsePrototype{ - Term: core.StringPtr(term), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalReservationCommittedUsePrototype unmarshals an instance of ReservationCommittedUsePrototype from the specified map of raw messages. -func UnmarshalReservationCommittedUsePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationCommittedUsePrototype) - err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "term", &obj.Term) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationIdentity : Identifies a reservation by a unique property. -// Models which "extend" this model: -// - ReservationIdentityByID -// - ReservationIdentityByCRN -// - ReservationIdentityByHref -type ReservationIdentity struct { - // The unique identifier for this reservation. - ID *string `json:"id,omitempty"` - - // The CRN for this reservation. - CRN *string `json:"crn,omitempty"` - - // The URL for this reservation. - Href *string `json:"href,omitempty"` -} - -func (*ReservationIdentity) isaReservationIdentity() bool { - return true -} - -type ReservationIdentityIntf interface { - isaReservationIdentity() bool -} - -// UnmarshalReservationIdentity unmarshals an instance of ReservationIdentity from the specified map of raw messages. -func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationPatch : ReservationPatch struct -type ReservationPatch struct { - // The capacity reservation configuration to use. - // - // The configuration can only be changed for reservations with a `status` of `inactive`. - Capacity *ReservationCapacityPatch `json:"capacity,omitempty"` - - // The committed use configuration to use for this reservation. - CommittedUse *ReservationCommittedUsePatch `json:"committed_use,omitempty"` - - // The name for this reservation. The name must not be used by another reservation in the region. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - // reservation. - // - // The profile can only be changed for a reservation with a `status` of `inactive`. - Profile *ReservationProfilePatch `json:"profile,omitempty"` -} - -// UnmarshalReservationPatch unmarshals an instance of ReservationPatch from the specified map of raw messages. -func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationPatch) - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacityPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUsePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfilePatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ReservationPatch -func (reservationPatch *ReservationPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(reservationPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ReservationProfile : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. -// Models which "extend" this model: -// - ReservationProfileInstanceProfileReference -type ReservationProfile struct { - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` - - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the ReservationProfile.ResourceType property. -// The resource type. -const ( - ReservationProfileResourceTypeInstanceProfileConst = "instance_profile" -) - -func (*ReservationProfile) isaReservationProfile() bool { - return true -} - -type ReservationProfileIntf interface { - isaReservationProfile() bool -} - -// UnmarshalReservationProfile unmarshals an instance of ReservationProfile from the specified map of raw messages. -func UnmarshalReservationProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfile) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationProfilePatch : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. -// -// The profile can only be changed for a reservation with a `status` of `inactive`. -type ReservationProfilePatch struct { - // The globally unique name of the profile. - Name *string `json:"name,omitempty"` - - // The resource type of the profile. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the ReservationProfilePatch.ResourceType property. -// The resource type of the profile. -const ( - ReservationProfilePatchResourceTypeInstanceProfileConst = "instance_profile" -) - -// UnmarshalReservationProfilePatch unmarshals an instance of ReservationProfilePatch from the specified map of raw messages. -func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfilePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationProfilePrototype : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. -type ReservationProfilePrototype struct { - // The globally unique name of the profile. - Name *string `json:"name" validate:"required"` - - // The resource type of the profile. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservationProfilePrototype.ResourceType property. -// The resource type of the profile. -const ( - ReservationProfilePrototypeResourceTypeInstanceProfileConst = "instance_profile" -) - -// NewReservationProfilePrototype : Instantiate ReservationProfilePrototype (Generic Model Constructor) -func (*VpcV1) NewReservationProfilePrototype(name string, resourceType string) (_model *ReservationProfilePrototype, err error) { - _model = &ReservationProfilePrototype{ - Name: core.StringPtr(name), - ResourceType: core.StringPtr(resourceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalReservationProfilePrototype unmarshals an instance of ReservationProfilePrototype from the specified map of raw messages. -func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfilePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationReference : ReservationReference struct -type ReservationReference struct { - // The CRN for this reservation. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ReservationReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this reservation. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reservation. - ID *string `json:"id" validate:"required"` - - // The name for this reservation. The name is unique across all reservations in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservationReference.ResourceType property. -// The resource type. -const ( - ReservationReferenceResourceTypeReservationConst = "reservation" -) - -// UnmarshalReservationReference unmarshals an instance of ReservationReference from the specified map of raw messages. -func UnmarshalReservationReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservationReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ReservationReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalReservationReferenceDeleted unmarshals an instance of ReservationReferenceDeleted from the specified map of raw messages. -func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationStatusReason : ReservationStatusReason struct -type ReservationStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the ReservationStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ReservationStatusReasonCodeCannotActivateNoCapacityAvailableConst = "cannot_activate_no_capacity_available" - ReservationStatusReasonCodeCannotRenewUnsupportedProfileTermConst = "cannot_renew_unsupported_profile_term" -) - -// UnmarshalReservationStatusReason unmarshals an instance of ReservationStatusReason from the specified map of raw messages. -func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIP : ReservedIP struct -type ReservedIP struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the reserved IP was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the reserved IP. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` - - // The owner of the reserved IP. - Owner *string `json:"owner" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The target this reserved IP is bound to. - // - // If absent, this reserved IP is provider-owned or unbound. - Target ReservedIPTargetIntf `json:"target,omitempty"` -} - -// Constants associated with the ReservedIP.LifecycleState property. -// The lifecycle state of the reserved IP. -const ( - ReservedIPLifecycleStateDeletingConst = "deleting" - ReservedIPLifecycleStateFailedConst = "failed" - ReservedIPLifecycleStatePendingConst = "pending" - ReservedIPLifecycleStateStableConst = "stable" - ReservedIPLifecycleStateSuspendedConst = "suspended" - ReservedIPLifecycleStateUpdatingConst = "updating" - ReservedIPLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the ReservedIP.Owner property. -// The owner of the reserved IP. -const ( - ReservedIPOwnerProviderConst = "provider" - ReservedIPOwnerUserConst = "user" -) - -// Constants associated with the ReservedIP.ResourceType property. -// The resource type. -const ( - ReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) - -// UnmarshalReservedIP unmarshals an instance of ReservedIP from the specified map of raw messages. -func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "owner", &obj.Owner) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalReservedIPTarget) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollection : ReservedIPCollection struct -type ReservedIPCollection struct { - // A link to the first page of resources. - First *ReservedIPCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionNext `json:"next,omitempty"` - - // Collection of reserved IPs in this subnet. - ReservedIps []ReservedIP `json:"reserved_ips" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollection unmarshals an instance of ReservedIPCollection from the specified map of raw messages. -func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reserved_ips", &obj.ReservedIps, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservedIPCollectionBareMetalServerNetworkInterfaceContext : ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct -type ReservedIPCollectionBareMetalServerNetworkInterfaceContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to a bare metal server network interface. - Ips []ReservedIP `json:"ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst : A link to the first page of resources. -type ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionEndpointGatewayContext : ReservedIPCollectionEndpointGatewayContext struct -type ReservedIPCollectionEndpointGatewayContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionEndpointGatewayContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to an endpoint gateway. - Ips []ReservedIP `json:"ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionEndpointGatewayContextNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollectionEndpointGatewayContext unmarshals an instance of ReservedIPCollectionEndpointGatewayContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionEndpointGatewayContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionEndpointGatewayContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservedIPCollectionEndpointGatewayContextFirst : A link to the first page of resources. -type ReservedIPCollectionEndpointGatewayContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionEndpointGatewayContextFirst unmarshals an instance of ReservedIPCollectionEndpointGatewayContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionEndpointGatewayContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionEndpointGatewayContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionEndpointGatewayContextNext unmarshals an instance of ReservedIPCollectionEndpointGatewayContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionFirst : A link to the first page of resources. -type ReservedIPCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionFirst unmarshals an instance of ReservedIPCollectionFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionInstanceNetworkInterfaceContext : ReservedIPCollectionInstanceNetworkInterfaceContext struct -type ReservedIPCollectionInstanceNetworkInterfaceContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionInstanceNetworkInterfaceContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to an instance network interface. - Ips []ReservedIP `json:"ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionInstanceNetworkInterfaceContextNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionInstanceNetworkInterfaceContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservedIPCollectionInstanceNetworkInterfaceContextFirst : A link to the first page of resources. -type ReservedIPCollectionInstanceNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionInstanceNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionInstanceNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionInstanceNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionInstanceNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionNext unmarshals an instance of ReservedIPCollectionNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionVirtualNetworkInterfaceContext : ReservedIPCollectionVirtualNetworkInterfaceContext struct -type ReservedIPCollectionVirtualNetworkInterfaceContext struct { - // A link to the first page of resources. - First *ReservedIPCollectionVirtualNetworkInterfaceContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to the virtual network interface specified by the identifier in the URL. - Ips []ReservedIPReference `json:"ips" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionVirtualNetworkInterfaceContextNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionVirtualNetworkInterfaceContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionVirtualNetworkInterfaceContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservedIPCollectionVirtualNetworkInterfaceContextFirst : A link to the first page of resources. -type ReservedIPCollectionVirtualNetworkInterfaceContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionVirtualNetworkInterfaceContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollectionVirtualNetworkInterfaceContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionVirtualNetworkInterfaceContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext unmarshals an instance of ReservedIPCollectionVirtualNetworkInterfaceContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionVirtualNetworkInterfaceContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionVirtualNetworkInterfaceContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPPatch : ReservedIPPatch struct -type ReservedIPPatch struct { - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` -} - -// UnmarshalReservedIPPatch unmarshals an instance of ReservedIPPatch from the specified map of raw messages. -func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPPatch) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ReservedIPPatch -func (reservedIPPatch *ReservedIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(reservedIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ReservedIPReference : ReservedIPReference struct -type ReservedIPReference struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` - - // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPReference.ResourceType property. -// The resource type. -const ( - ReservedIPReferenceResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) - -// UnmarshalReservedIPReference unmarshals an instance of ReservedIPReference from the specified map of raw messages. -func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ReservedIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalReservedIPReferenceDeleted unmarshals an instance of ReservedIPReferenceDeleted from the specified map of raw messages. -func UnmarshalReservedIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTarget : The target this reserved IP is bound to. -// -// If absent, this reserved IP is provider-owned or unbound. -// Models which "extend" this model: -// - ReservedIPTargetEndpointGatewayReference -// - ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext -// - ReservedIPTargetNetworkInterfaceReferenceTargetContext -// - ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext -// - ReservedIPTargetLoadBalancerReference -// - ReservedIPTargetVPNGatewayReference -// - ReservedIPTargetVPNServerReference -// - ReservedIPTargetGenericResourceReference -type ReservedIPTarget struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the ReservedIPTarget.ResourceType property. -// The resource type. -const ( - ReservedIPTargetResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -func (*ReservedIPTarget) isaReservedIPTarget() bool { - return true -} - -type ReservedIPTargetIntf interface { - isaReservedIPTarget() bool -} - -// UnmarshalReservedIPTarget unmarshals an instance of ReservedIPTarget from the specified map of raw messages. -func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototype : The target to bind this reserved IP to. The target must be in the same VPC. -// -// The following targets are supported: -// - An endpoint gateway not already bound to a reserved IP in the subnet's zone. -// - A virtual network interface. -// -// If unspecified, the reserved IP will be created unbound. -// Models which "extend" this model: -// - ReservedIPTargetPrototypeEndpointGatewayIdentity -// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity -type ReservedIPTargetPrototype struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` -} - -func (*ReservedIPTargetPrototype) isaReservedIPTargetPrototype() bool { - return true -} - -type ReservedIPTargetPrototypeIntf interface { - isaReservedIPTargetPrototype() bool -} - -// UnmarshalReservedIPTargetPrototype unmarshals an instance of ReservedIPTargetPrototype from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceFilter : Identifies one or more resources according to the specified filter property. -type ResourceFilter struct { - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// UnmarshalResourceFilter unmarshals an instance of ResourceFilter from the specified map of raw messages. -func UnmarshalResourceFilter(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceFilter) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource -// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. -// Models which "extend" this model: -// - ResourceGroupIdentityByID -type ResourceGroupIdentity struct { - // The unique identifier for this resource group. - ID *string `json:"id,omitempty"` -} - -func (*ResourceGroupIdentity) isaResourceGroupIdentity() bool { - return true -} - -type ResourceGroupIdentityIntf interface { - isaResourceGroupIdentity() bool -} - -// UnmarshalResourceGroupIdentity unmarshals an instance of ResourceGroupIdentity from the specified map of raw messages. -func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceGroupReference : ResourceGroupReference struct -type ResourceGroupReference struct { - // The URL for this resource group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this resource group. - ID *string `json:"id" validate:"required"` - - // The name for this resource group. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalResourceGroupReference unmarshals an instance of ResourceGroupReference from the specified map of raw messages. -func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RestartBareMetalServerOptions : The RestartBareMetalServer options. -type RestartBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewRestartBareMetalServerOptions : Instantiate RestartBareMetalServerOptions -func (*VpcV1) NewRestartBareMetalServerOptions(id string) *RestartBareMetalServerOptions { - return &RestartBareMetalServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *RestartBareMetalServerOptions) SetID(id string) *RestartBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RestartBareMetalServerOptions) SetHeaders(param map[string]string) *RestartBareMetalServerOptions { - options.Headers = param - return options -} - -// Route : Route struct -type Route struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Route.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteActionDelegateConst = "delegate" - RouteActionDelegateVPCConst = "delegate_vpc" - RouteActionDeliverConst = "deliver" - RouteActionDropConst = "drop" -) - -// Constants associated with the Route.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteLifecycleStateDeletingConst = "deleting" - RouteLifecycleStateFailedConst = "failed" - RouteLifecycleStatePendingConst = "pending" - RouteLifecycleStateStableConst = "stable" - RouteLifecycleStateSuspendedConst = "suspended" - RouteLifecycleStateUpdatingConst = "updating" - RouteLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Route.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - RouteOriginServiceConst = "service" - RouteOriginUserConst = "user" -) - -// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. -func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Route) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollection : RouteCollection struct -type RouteCollection struct { - // A link to the first page of resources. - First *RouteCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionNext `json:"next,omitempty"` - - // Collection of routes. - Routes []Route `json:"routes" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. -func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// RouteCollectionFirst : A link to the first page of resources. -type RouteCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. -func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. -func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContext : RouteCollectionVPCContext struct -type RouteCollectionVPCContext struct { - // A link to the first page of resources. - First *RouteCollectionVPCContextFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionVPCContextNext `json:"next,omitempty"` - - // Collection of routes. - Routes []RouteCollectionVPCContextRoutesItem `json:"routes" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContext unmarshals an instance of RouteCollectionVPCContext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionVPCContextFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionVPCContextNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteCollectionVPCContextRoutesItem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollectionVPCContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// RouteCollectionVPCContextFirst : A link to the first page of resources. -type RouteCollectionVPCContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContextFirst unmarshals an instance of RouteCollectionVPCContextFirst from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionVPCContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContextNext unmarshals an instance of RouteCollectionVPCContextNext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContextRoutesItem : RouteCollectionVPCContextRoutesItem struct -type RouteCollectionVPCContextRoutesItem struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the RouteCollectionVPCContextRoutesItem.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteCollectionVPCContextRoutesItemActionDelegateConst = "delegate" - RouteCollectionVPCContextRoutesItemActionDelegateVPCConst = "delegate_vpc" - RouteCollectionVPCContextRoutesItemActionDeliverConst = "deliver" - RouteCollectionVPCContextRoutesItemActionDropConst = "drop" -) - -// Constants associated with the RouteCollectionVPCContextRoutesItem.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteCollectionVPCContextRoutesItemLifecycleStateDeletingConst = "deleting" - RouteCollectionVPCContextRoutesItemLifecycleStateFailedConst = "failed" - RouteCollectionVPCContextRoutesItemLifecycleStatePendingConst = "pending" - RouteCollectionVPCContextRoutesItemLifecycleStateStableConst = "stable" - RouteCollectionVPCContextRoutesItemLifecycleStateSuspendedConst = "suspended" - RouteCollectionVPCContextRoutesItemLifecycleStateUpdatingConst = "updating" - RouteCollectionVPCContextRoutesItemLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the RouteCollectionVPCContextRoutesItem.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - RouteCollectionVPCContextRoutesItemOriginServiceConst = "service" - RouteCollectionVPCContextRoutesItemOriginUserConst = "user" -) - -// UnmarshalRouteCollectionVPCContextRoutesItem unmarshals an instance of RouteCollectionVPCContextRoutesItem from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextRoutesItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextRoutesItem) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCreator : If present, the resource that created the route. Routes with this property present cannot be directly deleted. All -// routes with an `origin` of `service` will have this property set, and future `origin` values may also have this -// property set. -// Models which "extend" this model: -// - RouteCreatorVPNGatewayReference -// - RouteCreatorVPNServerReference -type RouteCreator struct { - // The VPN gateway's CRN. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The VPN gateway's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id,omitempty"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the RouteCreator.ResourceType property. -// The resource type. -const ( - RouteCreatorResourceTypeVPNGatewayConst = "vpn_gateway" -) - -func (*RouteCreator) isaRouteCreator() bool { - return true -} - -type RouteCreatorIntf interface { - isaRouteCreator() bool -} - -// UnmarshalRouteCreator unmarshals an instance of RouteCreator from the specified map of raw messages. -func UnmarshalRouteCreator(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreator) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHop : RouteNextHop struct -// Models which "extend" this model: -// - RouteNextHopIP -// - RouteNextHopVPNGatewayConnectionReference -type RouteNextHop struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the RouteNextHop.ResourceType property. -// The resource type. -const ( - RouteNextHopResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -func (*RouteNextHop) isaRouteNextHop() bool { - return true -} - -type RouteNextHopIntf interface { - isaRouteNextHop() bool -} - -// UnmarshalRouteNextHop unmarshals an instance of RouteNextHop from the specified map of raw messages. -func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHop) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatch : If `action` is `deliver`, the next hop that packets will be delivered to. For other -// `action` values, specify `0.0.0.0` or remove it by specifying `null`. -// -// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has -// an `action` of `deliver` and `next_hop` is an IP address. -// Models which "extend" this model: -// - RouteNextHopPatchRouteNextHopIP -// - RouteNextHopPatchVPNGatewayConnectionIdentity -type RouteNextHopPatch struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*RouteNextHopPatch) isaRouteNextHopPatch() bool { - return true -} - -type RouteNextHopPatchIntf interface { - isaRouteNextHopPatch() bool -} - -// UnmarshalRouteNextHopPatch unmarshals an instance of RouteNextHopPatch from the specified map of raw messages. -func UnmarshalRouteNextHopPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePatch : RoutePatch struct -type RoutePatch struct { - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - // - // Since all routes in a routing table with the same `destination` and `zone` must have the same `advertise` value, - // this property can only be changed for routes with a unique - // `destination` and `zone` in the routing table. For more information, see [Advertising - // routes](https://cloud.ibm.com/docs/vpc?topic=vpc-about-custom-routes#rt-advertising-routes). - Advertise *bool `json:"advertise,omitempty"` - - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. - Name *string `json:"name,omitempty"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, specify `0.0.0.0` or remove it by specifying `null`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RouteNextHopPatchIntf `json:"next_hop,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` -} - -// UnmarshalRoutePatch unmarshals an instance of RoutePatch from the specified map of raw messages. -func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePatch) - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHopPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the RoutePatch -func (routePatch *RoutePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(routePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// RoutePrototype : RoutePrototype struct -type RoutePrototype struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - // - // All routes in a routing table with the same `destination` and `zone` must have the same - // `advertise` value. - Advertise *bool `json:"advertise,omitempty"` - - // The destination CIDR of the route. The host identifier in the CIDR must be zero. - // - // At most two routes per `zone` in a table can have the same `destination` and - // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` - - // The name for this route. The name must not be used by another route in the routing table. Names starting with `ibm-` - // are reserved for system-provided routes, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For other - // `action` values, it must be omitted or specified as `0.0.0.0`. - // - // At most two routes per `zone` in a table can have the same `destination` and `priority`, - // and only when each route has an `action` of `deliver` and `next_hop` is an IP address. - NextHop RoutePrototypeNextHopIntf `json:"next_hop,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority,omitempty"` - - // The zone to apply the route to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// Constants associated with the RoutePrototype.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RoutePrototypeActionDelegateConst = "delegate" - RoutePrototypeActionDelegateVPCConst = "delegate_vpc" - RoutePrototypeActionDeliverConst = "deliver" - RoutePrototypeActionDropConst = "drop" -) - -// NewRoutePrototype : Instantiate RoutePrototype (Generic Model Constructor) -func (*VpcV1) NewRoutePrototype(destination string, zone ZoneIdentityIntf) (_model *RoutePrototype, err error) { - _model = &RoutePrototype{ - Destination: core.StringPtr(destination), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalRoutePrototype unmarshals an instance of RoutePrototype from the specified map of raw messages. -func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRoutePrototypeNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHop : If `action` is `deliver`, the next hop that packets will be delivered to. For other -// `action` values, it must be omitted or specified as `0.0.0.0`. -// -// At most two routes per `zone` in a table can have the same `destination` and `priority`, and only when each route has -// an `action` of `deliver` and `next_hop` is an IP address. -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity -type RoutePrototypeNextHop struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*RoutePrototypeNextHop) isaRoutePrototypeNextHop() bool { - return true -} - -type RoutePrototypeNextHopIntf interface { - isaRoutePrototypeNextHop() bool -} - -// UnmarshalRoutePrototypeNextHop unmarshals an instance of RoutePrototypeNextHop from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHop(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHop) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteReference : RouteReference struct -type RouteReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *RouteReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalRouteReference unmarshals an instance of RouteReference from the specified map of raw messages. -func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRouteReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type RouteReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalRouteReferenceDeleted unmarshals an instance of RouteReferenceDeleted from the specified map of raw messages. -func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTable : RoutingTable struct -type RoutingTable struct { - // The filters specifying the resources that may create routes in this routing table. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from" validate:"required"` - - // The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these - // sources. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - AdvertiseRoutesTo []string `json:"advertise_routes_to" validate:"required"` - - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this routing table. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` - - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this routing table. The name is unique across all routing tables for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from the internet. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be - // subject to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is - // an IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` - - // The routes for this routing table. - Routes []RouteReference `json:"routes" validate:"required"` - - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` -} - -// Constants associated with the RoutingTable.AdvertiseRoutesTo property. -// An ingress source that routes can be advertised to: -// -// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) -// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). -const ( - RoutingTableAdvertiseRoutesToDirectLinkConst = "direct_link" - RoutingTableAdvertiseRoutesToTransitGatewayConst = "transit_gateway" -) - -// Constants associated with the RoutingTable.LifecycleState property. -// The lifecycle state of the routing table. -const ( - RoutingTableLifecycleStateDeletingConst = "deleting" - RoutingTableLifecycleStateFailedConst = "failed" - RoutingTableLifecycleStatePendingConst = "pending" - RoutingTableLifecycleStateStableConst = "stable" - RoutingTableLifecycleStateSuspendedConst = "suspended" - RoutingTableLifecycleStateUpdatingConst = "updating" - RoutingTableLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the RoutingTable.ResourceType property. -// The resource type. -const ( - RoutingTableResourceTypeRoutingTableConst = "routing_table" -) - -// UnmarshalRoutingTable unmarshals an instance of RoutingTable from the specified map of raw messages. -func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTable) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableCollection : RoutingTableCollection struct -type RoutingTableCollection struct { - // A link to the first page of resources. - First *RoutingTableCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RoutingTableCollectionNext `json:"next,omitempty"` - - // Collection of routing tables. - RoutingTables []RoutingTable `json:"routing_tables" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalRoutingTableCollection unmarshals an instance of RoutingTableCollection from the specified map of raw messages. -func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRoutingTableCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRoutingTableCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_tables", &obj.RoutingTables, UnmarshalRoutingTable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RoutingTableCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// RoutingTableCollectionFirst : A link to the first page of resources. -type RoutingTableCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRoutingTableCollectionFirst unmarshals an instance of RoutingTableCollectionFirst from the specified map of raw messages. -func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RoutingTableCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRoutingTableCollectionNext unmarshals an instance of RoutingTableCollectionNext from the specified map of raw messages. -func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableIdentity : Identifies a routing table by a unique property. -// Models which "extend" this model: -// - RoutingTableIdentityByID -// - RoutingTableIdentityByHref -type RoutingTableIdentity struct { - // The unique identifier for this routing table. - ID *string `json:"id,omitempty"` - - // The URL for this routing table. - Href *string `json:"href,omitempty"` -} - -func (*RoutingTableIdentity) isaRoutingTableIdentity() bool { - return true -} - -type RoutingTableIdentityIntf interface { - isaRoutingTableIdentity() bool -} - -// UnmarshalRoutingTableIdentity unmarshals an instance of RoutingTableIdentity from the specified map of raw messages. -func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTablePatch : RoutingTablePatch struct -type RoutingTablePatch struct { - // The filters specifying the resources that may create routes in this routing table - // (replacing any existing filters). All routes created by resources that match a given filter will be removed when an - // existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all - // routes not directly created by the user being removed. - // - // At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter - // support is expected to expand in the future. - AcceptRoutesFrom []ResourceFilter `json:"accept_routes_from,omitempty"` - - // The ingress sources to advertise routes to, replacing any existing sources to advertise to. Routes in the table with - // `advertise` enabled will be advertised to these sources. - AdvertiseRoutesTo []string `json:"advertise_routes_to,omitempty"` - - // The name for this routing table. The name must not be used by another routing table in the VPC. - Name *string `json:"name,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` selects this routing table, provided - // no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this - // routing table. Updating to - // `false` deselects this routing table, provided `direct_link` is absent from - // `advertise_routes_to`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from the internet. Updating to `true` - // selects this routing table, provided no other routing table in the VPC already has this property set to `true`. - // Updating to `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with two exceptions: - // - Traffic destined for IP addresses associated with public gateways will not be subject - // to routes in this routing table. - // - Routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an - // IP address in a subnet in the route's `zone` that is able to accept traffic. - // Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteInternetIngress *bool `json:"route_internet_ingress,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. Updating to - // `true` selects this routing table, provided no other routing table in the VPC already has this property set to - // `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table, - // provided `transit_gateway` is absent from `advertise_routes_to`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this - // property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this - // routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address in a subnet in the route's `zone` that is - // able to accept traffic. Therefore, if an incoming packet matches a route with a `next_hop` of a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` -} - -// Constants associated with the RoutingTablePatch.AdvertiseRoutesTo property. -// An ingress source that routes can be advertised to: -// -// - `direct_link` (requires `route_direct_link_ingress` be set to `true`) -// - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`). -const ( - RoutingTablePatchAdvertiseRoutesToDirectLinkConst = "direct_link" - RoutingTablePatchAdvertiseRoutesToTransitGatewayConst = "transit_gateway" -) - -// UnmarshalRoutingTablePatch unmarshals an instance of RoutingTablePatch from the specified map of raw messages. -func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTablePatch) - err = core.UnmarshalModel(m, "accept_routes_from", &obj.AcceptRoutesFrom, UnmarshalResourceFilter) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise_routes_to", &obj.AdvertiseRoutesTo) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_internet_ingress", &obj.RouteInternetIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the RoutingTablePatch -func (routingTablePatch *RoutingTablePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(routingTablePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// RoutingTableReference : RoutingTableReference struct -type RoutingTableReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *RoutingTableReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this routing table. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` - - // The name for this routing table. The name is unique across all routing tables for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the RoutingTableReference.ResourceType property. -// The resource type. -const ( - RoutingTableReferenceResourceTypeRoutingTableConst = "routing_table" -) - -// UnmarshalRoutingTableReference unmarshals an instance of RoutingTableReference from the specified map of raw messages. -func UnmarshalRoutingTableReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRoutingTableReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type RoutingTableReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalRoutingTableReferenceDeleted unmarshals an instance of RoutingTableReferenceDeleted from the specified map of raw messages. -func UnmarshalRoutingTableReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroup : SecurityGroup struct -type SecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The rules for this security group. If no rules exist, all traffic will be denied. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` - - // The targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` - - // The VPC this security group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalSecurityGroup unmarshals an instance of SecurityGroup from the specified map of raw messages. -func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupCollection : SecurityGroupCollection struct -type SecurityGroupCollection struct { - // A link to the first page of resources. - First *SecurityGroupCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SecurityGroupCollectionNext `json:"next,omitempty"` - - // Collection of security groups. - SecurityGroups []SecurityGroup `json:"security_groups" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSecurityGroupCollection unmarshals an instance of SecurityGroupCollection from the specified map of raw messages. -func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// SecurityGroupCollectionFirst : A link to the first page of resources. -type SecurityGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSecurityGroupCollectionFirst unmarshals an instance of SecurityGroupCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSecurityGroupCollectionNext unmarshals an instance of SecurityGroupCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupIdentityByID -// - SecurityGroupIdentityByCRN -// - SecurityGroupIdentityByHref -type SecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupIdentity) isaSecurityGroupIdentity() bool { - return true -} - -type SecurityGroupIdentityIntf interface { - isaSecurityGroupIdentity() bool -} - -// UnmarshalSecurityGroupIdentity unmarshals an instance of SecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupPatch : SecurityGroupPatch struct -type SecurityGroupPatch struct { - // The name for this security group. The name must not be used by another security group for the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalSecurityGroupPatch unmarshals an instance of SecurityGroupPatch from the specified map of raw messages. -func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SecurityGroupPatch -func (securityGroupPatch *SecurityGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(securityGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// SecurityGroupReference : SecurityGroupReference struct -type SecurityGroupReference struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalSecurityGroupReference unmarshals an instance of SecurityGroupReference from the specified map of raw messages. -func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SecurityGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSecurityGroupReferenceDeleted unmarshals an instance of SecurityGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRule : SecurityGroupRule struct -// Models which "extend" this model: -// - SecurityGroupRuleSecurityGroupRuleProtocolAll -// - SecurityGroupRuleSecurityGroupRuleProtocolIcmp -// - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp -type SecurityGroupRule struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule allows traffic (or to - // which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The ICMP traffic code to allow. If absent, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to allow. If absent, all types are allowed. - Type *int64 `json:"type,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - PortMin *int64 `json:"port_min,omitempty"` -} - -// Constants associated with the SecurityGroupRule.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleDirectionInboundConst = "inbound" - SecurityGroupRuleDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRule.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRule.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleProtocolAllConst = "all" - SecurityGroupRuleProtocolIcmpConst = "icmp" - SecurityGroupRuleProtocolTCPConst = "tcp" - SecurityGroupRuleProtocolUDPConst = "udp" -) - -func (*SecurityGroupRule) isaSecurityGroupRule() bool { - return true -} - -type SecurityGroupRuleIntf interface { - isaSecurityGroupRule() bool -} - -// UnmarshalSecurityGroupRule unmarshals an instance of SecurityGroupRule from the specified map of raw messages. -func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// SecurityGroupRuleCollection : Collection of rules in a security group. -type SecurityGroupRuleCollection struct { - // Array of rules. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` -} - -// UnmarshalSecurityGroupRuleCollection unmarshals an instance of SecurityGroupRuleCollection from the specified map of raw messages. -func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRulePatch : SecurityGroupRulePatch struct -type SecurityGroupRulePatch struct { - // The ICMP traffic code to allow. If set, `type` must also be set. - // - // Specify `null` to remove an existing ICMP traffic code. - Code *int64 `json:"code,omitempty"` - - // The direction of traffic to enforce. - Direction *string `json:"direction,omitempty"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The inclusive upper bound of the protocol destination port range. If set, `port_min` must also be set, and must not - // be larger. - // - // Specify `null` to remove an existing upper bound. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of the protocol destination port range. If set, `port_max` must also be set, and must not - // be smaller. - // - // Specify `null` to remove an existing lower bound. - PortMin *int64 `json:"port_min,omitempty"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - // any destination, for outbound rules). - Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` - - // The ICMP traffic type to allow. - // - // Specify `null` to remove an existing ICMP traffic type value. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the SecurityGroupRulePatch.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePatchDirectionInboundConst = "inbound" - SecurityGroupRulePatchDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePatch.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" -) - -// UnmarshalSecurityGroupRulePatch unmarshals an instance of SecurityGroupRulePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePatch) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SecurityGroupRulePatch -func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(securityGroupRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// SecurityGroupRulePrototype : SecurityGroupRulePrototype struct -// Models which "extend" this model: -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp -type SecurityGroupRulePrototype struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` - - // The ICMP traffic code to allow. - // - // If specified, `type` must also be specified. If unspecified, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to allow. - // - // If unspecified, all types are allowed. - Type *int64 `json:"type,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - // - // If specified, `port_min` must also be specified, and must not be larger. If unspecified, - // `port_min` must also be unspecified, allowing traffic on all destination ports. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range - // - // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be - // unspecified, allowing traffic on all destination ports. - PortMin *int64 `json:"port_min,omitempty"` -} - -// Constants associated with the SecurityGroupRulePrototype.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototype.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototype.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRulePrototypeProtocolAllConst = "all" - SecurityGroupRulePrototypeProtocolIcmpConst = "icmp" - SecurityGroupRulePrototypeProtocolTCPConst = "tcp" - SecurityGroupRulePrototypeProtocolUDPConst = "udp" -) - -func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { - return true -} - -type SecurityGroupRulePrototypeIntf interface { - isaSecurityGroupRulePrototype() bool -} - -// UnmarshalSecurityGroupRulePrototype unmarshals an instance of SecurityGroupRulePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// SecurityGroupRuleRemote : The remote IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). A -// CIDR block of `0.0.0.0/0` allows traffic from any source -// (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemoteIP -// - SecurityGroupRuleRemoteCIDR -// - SecurityGroupRuleRemoteSecurityGroupReference -type SecurityGroupRuleRemote struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name,omitempty"` -} - -func (*SecurityGroupRuleRemote) isaSecurityGroupRuleRemote() bool { - return true -} - -type SecurityGroupRuleRemoteIntf interface { - isaSecurityGroupRuleRemote() bool -} - -// UnmarshalSecurityGroupRuleRemote unmarshals an instance of SecurityGroupRuleRemote from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemote) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatch : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). -// Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic -// from any source (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemotePatchIP -// - SecurityGroupRuleRemotePatchCIDR -// - SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatch struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePatch) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -type SecurityGroupRuleRemotePatchIntf interface { - isaSecurityGroupRuleRemotePatch() bool -} - -// UnmarshalSecurityGroupRuleRemotePatch unmarshals an instance of SecurityGroupRuleRemotePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototype : The remote IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). -// Can be specified as an IP address, a CIDR block, or a security group within the VPC. -// -// If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source -// (or to any destination, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeIP -// - SecurityGroupRuleRemotePrototypeCIDR -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePrototype) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -type SecurityGroupRuleRemotePrototypeIntf interface { - isaSecurityGroupRuleRemotePrototype() bool -} - -// UnmarshalSecurityGroupRuleRemotePrototype unmarshals an instance of SecurityGroupRuleRemotePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetCollection : SecurityGroupTargetCollection struct -type SecurityGroupTargetCollection struct { - // A link to the first page of resources. - First *SecurityGroupTargetCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SecurityGroupTargetCollectionNext `json:"next,omitempty"` - - // Collection of targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSecurityGroupTargetCollection unmarshals an instance of SecurityGroupTargetCollection from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupTargetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupTargetCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupTargetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// SecurityGroupTargetCollectionFirst : A link to the first page of resources. -type SecurityGroupTargetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSecurityGroupTargetCollectionFirst unmarshals an instance of SecurityGroupTargetCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupTargetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSecurityGroupTargetCollectionNext unmarshals an instance of SecurityGroupTargetCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReference : The resource types that can be security group targets are expected to expand in the future. When iterating over -// security group targets, do not assume that every target resource will be from a known set of resource types. -// Optionally halt processing and surface an error, or bypass resources of unrecognized types. -// Models which "extend" this model: -// - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext -// - SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext -// - SecurityGroupTargetReferenceLoadBalancerReference -// - SecurityGroupTargetReferenceEndpointGatewayReference -// - SecurityGroupTargetReferenceVPNServerReference -// - SecurityGroupTargetReferenceVirtualNetworkInterfaceReference -type SecurityGroupTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The name for this instance network interface. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The load balancer's CRN. - CRN *string `json:"crn,omitempty"` - - // The primary IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet,omitempty"` -} - -// Constants associated with the SecurityGroupTargetReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*SecurityGroupTargetReference) isaSecurityGroupTargetReference() bool { - return true -} - -type SecurityGroupTargetReferenceIntf interface { - isaSecurityGroupTargetReference() bool -} - -// UnmarshalSecurityGroupTargetReference unmarshals an instance of SecurityGroupTargetReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SetSubnetPublicGatewayOptions : The SetSubnetPublicGateway options. -type SetSubnetPublicGatewayOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // The public gateway identity. - PublicGatewayIdentity PublicGatewayIdentityIntf `json:"PublicGatewayIdentity" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewSetSubnetPublicGatewayOptions : Instantiate SetSubnetPublicGatewayOptions -func (*VpcV1) NewSetSubnetPublicGatewayOptions(id string, publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - return &SetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - PublicGatewayIdentity: publicGatewayIdentity, - } -} - -// SetID : Allow user to set ID -func (_options *SetSubnetPublicGatewayOptions) SetID(id string) *SetSubnetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPublicGatewayIdentity : Allow user to set PublicGatewayIdentity -func (_options *SetSubnetPublicGatewayOptions) SetPublicGatewayIdentity(publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - _options.PublicGatewayIdentity = publicGatewayIdentity - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *SetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *SetSubnetPublicGatewayOptions { - options.Headers = param - return options -} - -// Share : Share struct -type Share struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a mount - // target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // The enumerated access control mode values for this property may expand in the future. When processing this property, - // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which - // the unexpected access control mode was encountered. - AccessControlMode *string `json:"access_control_mode" validate:"required"` - - // The date and time that the file share is created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this file share. - CRN *string `json:"crn" validate:"required"` - - // The type of encryption used for this file share. - Encryption *string `json:"encryption" validate:"required"` - - // The key used to encrypt this file share. - // - // This property will be present if `encryption_type` is `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - - // The URL for this file share. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this file share. - ID *string `json:"id" validate:"required"` - - // The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the - // share will be restricted to 48,000 IOPS. - // - // The maximum IOPS for a share may increase in the future. - Iops *int64 `json:"iops" validate:"required"` - - // The latest job associated with this file share. - // - // This property will be absent if no jobs have been created for this file share. - LatestJob *ShareJob `json:"latest_job,omitempty"` - - // Information about the latest synchronization for this file share. - // - // This property will be present when the `replication_role` is `replica` and at least - // one replication sync has been completed. - LatestSync *ShareLatestSync `json:"latest_sync,omitempty"` - - // The lifecycle state of the file share. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The mount targets for the file share. - MountTargets []ShareMountTargetReference `json:"mount_targets" validate:"required"` - - // The name for this share. The name is unique across all shares in the region. - Name *string `json:"name" validate:"required"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for - // this file share. - Profile *ShareProfileReference `json:"profile" validate:"required"` - - // The replica file share for this source file share. - // - // This property will be present when the `replication_role` is `source`. - ReplicaShare *ShareReference `json:"replica_share,omitempty"` - - // The cron specification for the file share replication schedule. - // - // This property will be present when the `replication_role` is `replica`. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - - // The replication role of the file share. - // - // * `none`: This share is not participating in replication. - // * `replica`: This share is a replication target. - // * `source`: This share is a replication source. - ReplicationRole *string `json:"replication_role" validate:"required"` - - // The replication status of the file share. - // - // * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the - // replication schedule. - // * `degraded`: This is share is participating in replication, but the replica's data has fallen behind the - // replication schedule. - // * `failover_pending`: This share is performing a replication failover. - // * `initializing`: This share is initializing replication. - // * `none`: This share is not participating in replication. - // * `split_pending`: This share is performing a replication split. - ReplicationStatus *string `json:"replication_status" validate:"required"` - - // The reasons for the current replication status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - ReplicationStatusReasons []ShareReplicationStatusReason `json:"replication_status_reasons" validate:"required"` - - // The resource group for this file share. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size" validate:"required"` - - // The source file share for this replica file share. - // - // This property will be present when the `replication_role` is `replica`. - SourceShare *ShareReference `json:"source_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags" validate:"required"` - - // The zone this file share will reside in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Share.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a mount -// target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// -// The enumerated access control mode values for this property may expand in the future. When processing this property, -// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which -// the unexpected access control mode was encountered. -const ( - ShareAccessControlModeSecurityGroupConst = "security_group" - ShareAccessControlModeVPCConst = "vpc" -) - -// Constants associated with the Share.Encryption property. -// The type of encryption used for this file share. -const ( - ShareEncryptionProviderManagedConst = "provider_managed" - ShareEncryptionUserManagedConst = "user_managed" -) - -// Constants associated with the Share.LifecycleState property. -// The lifecycle state of the file share. -const ( - ShareLifecycleStateDeletingConst = "deleting" - ShareLifecycleStateFailedConst = "failed" - ShareLifecycleStatePendingConst = "pending" - ShareLifecycleStateStableConst = "stable" - ShareLifecycleStateSuspendedConst = "suspended" - ShareLifecycleStateUpdatingConst = "updating" - ShareLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Share.ReplicationRole property. -// The replication role of the file share. -// -// * `none`: This share is not participating in replication. -// * `replica`: This share is a replication target. -// * `source`: This share is a replication source. -const ( - ShareReplicationRoleNoneConst = "none" - ShareReplicationRoleReplicaConst = "replica" - ShareReplicationRoleSourceConst = "source" -) - -// Constants associated with the Share.ReplicationStatus property. -// The replication status of the file share. -// -// * `active`: This share is actively participating in replication, and the replica's data is up-to-date with the -// replication schedule. -// * `degraded`: This is share is participating in replication, but the replica's data has fallen behind the replication -// schedule. -// * `failover_pending`: This share is performing a replication failover. -// * `initializing`: This share is initializing replication. -// * `none`: This share is not participating in replication. -// * `split_pending`: This share is performing a replication split. -const ( - ShareReplicationStatusActiveConst = "active" - ShareReplicationStatusDegradedConst = "degraded" - ShareReplicationStatusFailoverPendingConst = "failover_pending" - ShareReplicationStatusInitializingConst = "initializing" - ShareReplicationStatusNoneConst = "none" - ShareReplicationStatusSplitPendingConst = "split_pending" -) - -// Constants associated with the Share.ResourceType property. -// The resource type. -const ( - ShareResourceTypeShareConst = "share" -) - -// UnmarshalShare unmarshals an instance of Share from the specified map of raw messages. -func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Share) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "latest_job", &obj.LatestJob, UnmarshalShareJob) - if err != nil { - return - } - err = core.UnmarshalModel(m, "latest_sync", &obj.LatestSync, UnmarshalShareLatestSync) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalShareReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_role", &obj.ReplicationRole) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_status", &obj.ReplicationStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replication_status_reasons", &obj.ReplicationStatusReasons, UnmarshalShareReplicationStatusReason) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareCollection : ShareCollection struct -type ShareCollection struct { - // A link to the first page of resources. - First *ShareCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ShareCollectionNext `json:"next,omitempty"` - - // Collection of file shares. - Shares []Share `json:"shares" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalShareCollection unmarshals an instance of ShareCollection from the specified map of raw messages. -func UnmarshalShareCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "shares", &obj.Shares, UnmarshalShare) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ShareCollectionFirst : A link to the first page of resources. -type ShareCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareCollectionFirst unmarshals an instance of ShareCollectionFirst from the specified map of raw messages. -func UnmarshalShareCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareCollectionNext unmarshals an instance of ShareCollectionNext from the specified map of raw messages. -func UnmarshalShareCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareIdentity : Identifies a file share by a unique property. -// Models which "extend" this model: -// - ShareIdentityByID -// - ShareIdentityByCRN -// - ShareIdentityByHref -type ShareIdentity struct { - // The unique identifier for this file share. - ID *string `json:"id,omitempty"` - - // The CRN for this file share. - CRN *string `json:"crn,omitempty"` - - // The URL for this file share. - Href *string `json:"href,omitempty"` -} - -func (*ShareIdentity) isaShareIdentity() bool { - return true -} - -type ShareIdentityIntf interface { - isaShareIdentity() bool -} - -// UnmarshalShareIdentity unmarshals an instance of ShareIdentity from the specified map of raw messages. -func UnmarshalShareIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareInitialOwner : ShareInitialOwner struct -type ShareInitialOwner struct { - // The initial group identifier for the file share. - Gid *int64 `json:"gid,omitempty"` - - // The initial user identifier for the file share. - Uid *int64 `json:"uid,omitempty"` -} - -// UnmarshalShareInitialOwner unmarshals an instance of ShareInitialOwner from the specified map of raw messages. -func UnmarshalShareInitialOwner(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareInitialOwner) - err = core.UnmarshalPrimitive(m, "gid", &obj.Gid) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uid", &obj.Uid) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareJob : ShareJob struct -type ShareJob struct { - // The status of the file share job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the - // unexpected property value was encountered. - // - // * `cancelled`: This job has been cancelled. - // * `failed`: This job has failed. - // * `queued`: This job is queued. - // * `running`: This job is running. - // * `succeeded`: This job completed successfully. - Status *string `json:"status" validate:"required"` - - // The reasons for the file share job status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ShareJobStatusReason `json:"status_reasons" validate:"required"` - - // The type of the file share job. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the - // unexpected property value was encountered. - // - // * `replication_failover`: This is a share replication failover job. - // * `replication_init`: This is a share replication is initialization job. - // * `replication_split`: This is a share replication split job. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareJob.Status property. -// The status of the file share job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the -// unexpected property value was encountered. -// -// * `cancelled`: This job has been cancelled. -// * `failed`: This job has failed. -// * `queued`: This job is queued. -// * `running`: This job is running. -// * `succeeded`: This job completed successfully. -const ( - ShareJobStatusCancelledConst = "cancelled" - ShareJobStatusFailedConst = "failed" - ShareJobStatusQueuedConst = "queued" - ShareJobStatusRunningConst = "running" - ShareJobStatusSucceededConst = "succeeded" -) - -// Constants associated with the ShareJob.Type property. -// The type of the file share job. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the file share job on which the -// unexpected property value was encountered. -// -// * `replication_failover`: This is a share replication failover job. -// * `replication_init`: This is a share replication is initialization job. -// * `replication_split`: This is a share replication split job. -const ( - ShareJobTypeReplicationFailoverConst = "replication_failover" - ShareJobTypeReplicationInitConst = "replication_init" - ShareJobTypeReplicationSplitConst = "replication_split" -) - -// UnmarshalShareJob unmarshals an instance of ShareJob from the specified map of raw messages. -func UnmarshalShareJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareJob) - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalShareJobStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareJobStatusReason : ShareJobStatusReason struct -type ShareJobStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the ShareJobStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ShareJobStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" - ShareJobStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" - ShareJobStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" -) - -// UnmarshalShareJobStatusReason unmarshals an instance of ShareJobStatusReason from the specified map of raw messages. -func UnmarshalShareJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareJobStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareLatestSync : Information about the latest synchronization for this file share. -// -// This property will be present when the `replication_role` is `replica` and at least one replication sync has been -// completed. -type ShareLatestSync struct { - // The completed date and time of last synchronization between the replica share and its source. - CompletedAt *strfmt.DateTime `json:"completed_at" validate:"required"` - - // The data transferred (in bytes) in the last synchronization between the replica and its source. - DataTransferred *int64 `json:"data_transferred" validate:"required"` - - // The start date and time of last synchronization between the replica share and its source. - StartedAt *strfmt.DateTime `json:"started_at" validate:"required"` -} - -// UnmarshalShareLatestSync unmarshals an instance of ShareLatestSync from the specified map of raw messages. -func UnmarshalShareLatestSync(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareLatestSync) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "data_transferred", &obj.DataTransferred) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTarget : ShareMountTarget struct -type ShareMountTarget struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a mount - // target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // The enumerated access control mode values for this property may expand in the future. When processing this property, - // check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which - // the unexpected access control mode was encountered. - AccessControlMode *string `json:"access_control_mode" validate:"required"` - - // The date and time that the share mount target was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the mount target. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The mount path for the share. The server component of the mount path may be either an IP address or a fully - // qualified domain name. - // - // This property will be absent if the `lifecycle_state` of the mount target is - // 'pending', `failed`, or `deleting`. - // - // If the share's `access_control_mode` is: - // - // - `security_group`: The IP address used in the mount path is the `primary_ip` - // address of the virtual network interface for this share mount target. - // - `vpc`: The fully-qualified domain name used in the mount path is an address that - // resolves to the share mount target. - MountPath *string `json:"mount_path,omitempty"` - - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` - - // The primary IP address of the virtual network interface for the share mount target. - // - // Absent if `access_control_mode` is `vpc`. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the share mount target. - // - // Absent if `access_control_mode` is `vpc`. - Subnet *SubnetReference `json:"subnet,omitempty"` - - // The transit encryption mode for this share mount target: - // - `none`: Not encrypted in transit - // - `user_managed`: Encrypted in transit using an instance identity certificate - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected - // property value was encountered. - TransitEncryption *string `json:"transit_encryption" validate:"required"` - - // The virtual network interface for this file share mount target. - // - // This property will be present when the `access_control_mode` is `security_group`. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface,omitempty"` - - // If `access_control_mode` is: - // - // - `security_group`: The VPC for the virtual network interface for this share mount - // target - // - `vpc`: The VPC in which clients can mount the file share using this share - // mount target. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the ShareMountTarget.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a mount -// target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// -// The enumerated access control mode values for this property may expand in the future. When processing this property, -// check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which -// the unexpected access control mode was encountered. -const ( - ShareMountTargetAccessControlModeSecurityGroupConst = "security_group" - ShareMountTargetAccessControlModeVPCConst = "vpc" -) - -// Constants associated with the ShareMountTarget.LifecycleState property. -// The lifecycle state of the mount target. -const ( - ShareMountTargetLifecycleStateDeletingConst = "deleting" - ShareMountTargetLifecycleStateFailedConst = "failed" - ShareMountTargetLifecycleStatePendingConst = "pending" - ShareMountTargetLifecycleStateStableConst = "stable" - ShareMountTargetLifecycleStateSuspendedConst = "suspended" - ShareMountTargetLifecycleStateUpdatingConst = "updating" - ShareMountTargetLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the ShareMountTarget.ResourceType property. -// The resource type. -const ( - ShareMountTargetResourceTypeShareMountTargetConst = "share_mount_target" -) - -// Constants associated with the ShareMountTarget.TransitEncryption property. -// The transit encryption mode for this share mount target: -// - `none`: Not encrypted in transit -// - `user_managed`: Encrypted in transit using an instance identity certificate -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected -// property value was encountered. -const ( - ShareMountTargetTransitEncryptionNoneConst = "none" - ShareMountTargetTransitEncryptionUserManagedConst = "user_managed" -) - -// UnmarshalShareMountTarget unmarshals an instance of ShareMountTarget from the specified map of raw messages. -func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTarget) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mount_path", &obj.MountPath) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetCollection : ShareMountTargetCollection struct -type ShareMountTargetCollection struct { - // A link to the first page of resources. - First *ShareMountTargetCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // Collection of share mount targets. - MountTargets []ShareMountTarget `json:"mount_targets" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ShareMountTargetCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalShareMountTargetCollection unmarshals an instance of ShareMountTargetCollection from the specified map of raw messages. -func UnmarshalShareMountTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareMountTargetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareMountTargetCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareMountTargetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ShareMountTargetCollectionFirst : A link to the first page of resources. -type ShareMountTargetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareMountTargetCollectionFirst unmarshals an instance of ShareMountTargetCollectionFirst from the specified map of raw messages. -func UnmarshalShareMountTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareMountTargetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareMountTargetCollectionNext unmarshals an instance of ShareMountTargetCollectionNext from the specified map of raw messages. -func UnmarshalShareMountTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetPatch : ShareMountTargetPatch struct -type ShareMountTargetPatch struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` -} - -// UnmarshalShareMountTargetPatch unmarshals an instance of ShareMountTargetPatch from the specified map of raw messages. -func UnmarshalShareMountTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the ShareMountTargetPatch -func (shareMountTargetPatch *ShareMountTargetPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(shareMountTargetPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ShareMountTargetPrototype : ShareMountTargetPrototype struct -// Models which "extend" this model: -// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup -// - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC -type ShareMountTargetPrototype struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface,omitempty"` - - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc,omitempty"` -} - -// Constants associated with the ShareMountTargetPrototype.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeTransitEncryptionUserManagedConst = "user_managed" -) - -func (*ShareMountTargetPrototype) isaShareMountTargetPrototype() bool { - return true -} - -type ShareMountTargetPrototypeIntf interface { - isaShareMountTargetPrototype() bool -} - -// UnmarshalShareMountTargetPrototype unmarshals an instance of ShareMountTargetPrototype from the specified map of raw messages. -func UnmarshalShareMountTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetReference : ShareMountTargetReference struct -type ShareMountTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` - - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ShareMountTargetReference.ResourceType property. -// The resource type. -const ( - ShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" -) - -// UnmarshalShareMountTargetReference unmarshals an instance of ShareMountTargetReference from the specified map of raw messages. -func UnmarshalShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ShareMountTargetReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalShareMountTargetReferenceDeleted unmarshals an instance of ShareMountTargetReferenceDeleted from the specified map of raw messages. -func UnmarshalShareMountTargetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototype : ShareMountTargetVirtualNetworkInterfacePrototype struct -// Models which "extend" this model: -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity -type ShareMountTargetVirtualNetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // share's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototype) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -type ShareMountTargetVirtualNetworkInterfacePrototypeIntf interface { - isaShareMountTargetVirtualNetworkInterfacePrototype() bool -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototype unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePatch : SharePatch struct -type SharePatch struct { - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // - // For this property to be changed, the share must have no mount targets and - // `replication_role` must be `none`. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The maximum input/output operations per second (IOPS) for the file share. The value must be in the range supported - // by the share's size. - // - // For this property to be changed, the share `lifecycle_state` must be `stable`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this share. The name must not be used by another share in the region. - Name *string `json:"name,omitempty"` - - // The profile to use for this file share. - // - // The requested profile must be in the same `family`. - Profile ShareProfileIdentityIntf `json:"profile,omitempty"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - // - // For this property to be changed, the share `replication_role` must be `replica`. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - - // The size of the file share rounded up to the next gigabyte. The value must not be less than the share's current - // size, and must not exceed the maximum supported by the share's profile and IOPS. - // - // For this property to be changed, the share `lifecycle_state` must be `stable`. - Size *int64 `json:"size,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` -} - -// Constants associated with the SharePatch.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// -// For this property to be changed, the share must have no mount targets and -// `replication_role` must be `none`. -const ( - SharePatchAccessControlModeSecurityGroupConst = "security_group" - SharePatchAccessControlModeVPCConst = "vpc" -) - -// UnmarshalSharePatch unmarshals an instance of SharePatch from the specified map of raw messages. -func UnmarshalSharePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePatch) - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SharePatch -func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(sharePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// ShareProfile : ShareProfile struct -type ShareProfile struct { - // The permitted capacity range (in gigabytes) for a share with this profile. - Capacity ShareProfileCapacityIntf `json:"capacity" validate:"required"` - - // The product family this share profile belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this share profile. - Href *string `json:"href" validate:"required"` - - // The permitted IOPS range for a share with this profile. - Iops ShareProfileIopsIntf `json:"iops" validate:"required"` - - // The globally unique name for this share profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ShareProfile.Family property. -// The product family this share profile belongs to. -const ( - ShareProfileFamilyDefinedPerformanceConst = "defined_performance" -) - -// Constants associated with the ShareProfile.ResourceType property. -// The resource type. -const ( - ShareProfileResourceTypeShareProfileConst = "share_profile" -) - -// UnmarshalShareProfile unmarshals an instance of ShareProfile from the specified map of raw messages. -func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfile) - err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalShareProfileCapacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "iops", &obj.Iops, UnmarshalShareProfileIops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacity : ShareProfileCapacity struct -// Models which "extend" this model: -// - ShareProfileCapacityFixed -// - ShareProfileCapacityRange -// - ShareProfileCapacityEnum -// - ShareProfileCapacityDependentRange -type ShareProfileCapacity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the ShareProfileCapacity.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityTypeFixedConst = "fixed" -) - -func (*ShareProfileCapacity) isaShareProfileCapacity() bool { - return true -} - -type ShareProfileCapacityIntf interface { - isaShareProfileCapacity() bool -} - -// UnmarshalShareProfileCapacity unmarshals an instance of ShareProfileCapacity from the specified map of raw messages. -func UnmarshalShareProfileCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCollection : ShareProfileCollection struct -type ShareProfileCollection struct { - // A link to the first page of resources. - First *ShareProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ShareProfileCollectionNext `json:"next,omitempty"` - - // Collection of share profiles. - Profiles []ShareProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalShareProfileCollection unmarshals an instance of ShareProfileCollection from the specified map of raw messages. -func UnmarshalShareProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalShareProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalShareProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalShareProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ShareProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ShareProfileCollectionFirst : A link to the first page of resources. -type ShareProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareProfileCollectionFirst unmarshals an instance of ShareProfileCollectionFirst from the specified map of raw messages. -func UnmarshalShareProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ShareProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalShareProfileCollectionNext unmarshals an instance of ShareProfileCollectionNext from the specified map of raw messages. -func UnmarshalShareProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIops : ShareProfileIops struct -// Models which "extend" this model: -// - ShareProfileIopsFixed -// - ShareProfileIopsRange -// - ShareProfileIopsEnum -// - ShareProfileIopsDependentRange -type ShareProfileIops struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the ShareProfileIops.Type property. -// The type for this profile field. -const ( - ShareProfileIopsTypeFixedConst = "fixed" -) - -func (*ShareProfileIops) isaShareProfileIops() bool { - return true -} - -type ShareProfileIopsIntf interface { - isaShareProfileIops() bool -} - -// UnmarshalShareProfileIops unmarshals an instance of ShareProfileIops from the specified map of raw messages. -func UnmarshalShareProfileIops(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIops) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIdentity : Identifies a share profile by a unique property. -// Models which "extend" this model: -// - ShareProfileIdentityByName -// - ShareProfileIdentityByHref -type ShareProfileIdentity struct { - // The globally unique name for this share profile. - Name *string `json:"name,omitempty"` - - // The URL for this share profile. - Href *string `json:"href,omitempty"` -} - -func (*ShareProfileIdentity) isaShareProfileIdentity() bool { - return true -} - -type ShareProfileIdentityIntf interface { - isaShareProfileIdentity() bool -} - -// UnmarshalShareProfileIdentity unmarshals an instance of ShareProfileIdentity from the specified map of raw messages. -func UnmarshalShareProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileReference : ShareProfileReference struct -type ShareProfileReference struct { - // The URL for this share profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this share profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ShareProfileReference.ResourceType property. -// The resource type. -const ( - ShareProfileReferenceResourceTypeShareProfileConst = "share_profile" -) - -// UnmarshalShareProfileReference unmarshals an instance of ShareProfileReference from the specified map of raw messages. -func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePrototype : SharePrototype struct -// Models which "extend" this model: -// - SharePrototypeShareBySize -// - SharePrototypeShareBySourceShare -type SharePrototype struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - // Configuration for a replica file share to create and associate with this file share. If - // unspecified, a replica may be subsequently added by creating a new file share with a - // `source_share` referencing this file share. - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the - // source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. Mount targets for this share - // require a virtual network interface. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // Mount targets for this share require a VPC. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The root key to use to wrap the data encryption key for the share. - // - // If unspecified, the `encryption` type for the share will be `provider_managed`. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The owner assigned to the file share at creation. Subsequent changes to the owner - // must be performed by a client that has mounted the file share. - InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size,omitempty"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner - // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). - SourceShare ShareIdentityIntf `json:"source_share,omitempty"` -} - -// Constants associated with the SharePrototype.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. Mount targets for this share -// require a virtual network interface. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// Mount targets for this share require a VPC. -const ( - SharePrototypeAccessControlModeSecurityGroupConst = "security_group" - SharePrototypeAccessControlModeVPCConst = "vpc" -) - -func (*SharePrototype) isaSharePrototype() bool { - return true -} - -type SharePrototypeIntf interface { - isaSharePrototype() bool -} - -// UnmarshalSharePrototype unmarshals an instance of SharePrototype from the specified map of raw messages. -func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototype) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePrototypeShareContext : Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be -// subsequently added by creating a new file share with a -// `source_share` referencing this file share. -type SharePrototypeShareContext struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for this replica file share. Each mount target must be in a unique VPC. - // - // A replica's mount targets must be mounted read-only. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` - - // The resource group to use. If unspecified, the resource group from - // the source share will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this replica file share will reside in. - // - // Must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewSharePrototypeShareContext : Instantiate SharePrototypeShareContext (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string, zone ZoneIdentityIntf) (_model *SharePrototypeShareContext, err error) { - _model = &SharePrototypeShareContext{ - Profile: profile, - ReplicationCronSpec: core.StringPtr(replicationCronSpec), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalSharePrototypeShareContext unmarshals an instance of SharePrototypeShareContext from the specified map of raw messages. -func UnmarshalSharePrototypeShareContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareContext) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareReference : ShareReference struct -type ShareReference struct { - // The CRN for this file share. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this file share. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this file share. - ID *string `json:"id" validate:"required"` - - // The name for this share. The name is unique across all shares in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *ShareRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ShareReference.ResourceType property. -// The resource type. -const ( - ShareReferenceResourceTypeShareConst = "share" -) - -// UnmarshalShareReference unmarshals an instance of ShareReference from the specified map of raw messages. -func UnmarshalShareReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalShareRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type ShareReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalShareReferenceDeleted unmarshals an instance of ShareReferenceDeleted from the specified map of raw messages. -func UnmarshalShareReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type ShareRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalShareRemote unmarshals an instance of ShareRemote from the specified map of raw messages. -func UnmarshalShareRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareReplicationStatusReason : ShareReplicationStatusReason struct -type ShareReplicationStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the ShareReplicationStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ShareReplicationStatusReasonCodeCannotInitializeReplicationConst = "cannot_initialize_replication" - ShareReplicationStatusReasonCodeCannotReachReplicaShareConst = "cannot_reach_replica_share" - ShareReplicationStatusReasonCodeCannotReachSourceShareConst = "cannot_reach_source_share" -) - -// UnmarshalShareReplicationStatusReason unmarshals an instance of ShareReplicationStatusReason from the specified map of raw messages. -func UnmarshalShareReplicationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareReplicationStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Snapshot : Snapshot struct -type Snapshot struct { - // If present, the backup policy plan which created this snapshot. - BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` - - // Indicates if a boot volume attachment can be created with a volume created from this snapshot. - Bootable *bool `json:"bootable" validate:"required"` - - // The date and time the data capture for this snapshot was completed. - // - // If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots - // created before 1 January 2022. - CapturedAt *strfmt.DateTime `json:"captured_at,omitempty"` - - // Clones for this snapshot. - Clones []SnapshotClone `json:"clones" validate:"required"` - - // The copies of this snapshot. - Copies []SnapshotCopiesItem `json:"copies" validate:"required"` - - // The date and time that this snapshot was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` - - // Indicates whether this snapshot can be deleted. This value will always be `true`. - // Deprecated: this field is deprecated and may be removed in a future release. - Deletable *bool `json:"deletable" validate:"required"` - - // The type of encryption used on the source volume. - Encryption *string `json:"encryption" validate:"required"` - - // The root key used to wrap the data encryption key for the source volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of this snapshot. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the - // capacity of the `source_volume`. - MinimumCapacity *int64 `json:"minimum_capacity" validate:"required"` - - // The name for this snapshot. The name is unique across all snapshots in the region. - Name *string `json:"name" validate:"required"` - - // The operating system included in this snapshot. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` - - // The resource group for this snapshot. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The [service tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with `is.snapshot:` associated with - // this snapshot. - ServiceTags []string `json:"service_tags" validate:"required"` - - // The size of this snapshot rounded up to the next gigabyte. - Size *int64 `json:"size" validate:"required"` - - // If present, the snapshot consistency group which created this snapshot. - SnapshotConsistencyGroup *SnapshotConsistencyGroupReference `json:"snapshot_consistency_group,omitempty"` - - // If present, the image from which the data on this snapshot was most directly - // provisioned. - SourceImage *ImageReference `json:"source_image,omitempty"` - - // If present, the source snapshot this snapshot was created from. - SourceSnapshot *SnapshotSourceSnapshot `json:"source_snapshot,omitempty"` - - // The source volume this snapshot was created from (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - SourceVolume *VolumeReference `json:"source_volume" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags" validate:"required"` -} - -// Constants associated with the Snapshot.Encryption property. -// The type of encryption used on the source volume. -const ( - SnapshotEncryptionProviderManagedConst = "provider_managed" - SnapshotEncryptionUserManagedConst = "user_managed" -) - -// Constants associated with the Snapshot.LifecycleState property. -// The lifecycle state of this snapshot. -const ( - SnapshotLifecycleStateDeletingConst = "deleting" - SnapshotLifecycleStateFailedConst = "failed" - SnapshotLifecycleStatePendingConst = "pending" - SnapshotLifecycleStateStableConst = "stable" - SnapshotLifecycleStateSuspendedConst = "suspended" - SnapshotLifecycleStateUpdatingConst = "updating" - SnapshotLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Snapshot.ResourceType property. -// The resource type. -const ( - SnapshotResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshot unmarshals an instance of Snapshot from the specified map of raw messages. -func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Snapshot) - err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bootable", &obj.Bootable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "captured_at", &obj.CapturedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) - if err != nil { - return - } - err = core.UnmarshalModel(m, "copies", &obj.Copies, UnmarshalSnapshotCopiesItem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "deletable", &obj.Deletable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "minimum_capacity", &obj.MinimumCapacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_tags", &obj.ServiceTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshot_consistency_group", &obj.SnapshotConsistencyGroup, UnmarshalSnapshotConsistencyGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotSourceSnapshot) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotClone : SnapshotClone struct -type SnapshotClone struct { - // Indicates whether this snapshot clone is available for use. - Available *bool `json:"available" validate:"required"` - - // The date and time that this snapshot clone was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The zone this snapshot clone resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalSnapshotClone unmarshals an instance of SnapshotClone from the specified map of raw messages. -func UnmarshalSnapshotClone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotClone) - err = core.UnmarshalPrimitive(m, "available", &obj.Available) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCloneCollection : SnapshotCloneCollection struct -type SnapshotCloneCollection struct { - // Collection of snapshot clones. - Clones []SnapshotClone `json:"clones" validate:"required"` -} - -// UnmarshalSnapshotCloneCollection unmarshals an instance of SnapshotCloneCollection from the specified map of raw messages. -func UnmarshalSnapshotCloneCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCloneCollection) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClone) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotClonePrototype : SnapshotClonePrototype struct -type SnapshotClonePrototype struct { - // The zone this snapshot clone will reside in. Must be in the same region as the - // snapshot. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewSnapshotClonePrototype : Instantiate SnapshotClonePrototype (Generic Model Constructor) -func (*VpcV1) NewSnapshotClonePrototype(zone ZoneIdentityIntf) (_model *SnapshotClonePrototype, err error) { - _model = &SnapshotClonePrototype{ - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalSnapshotClonePrototype unmarshals an instance of SnapshotClonePrototype from the specified map of raw messages. -func UnmarshalSnapshotClonePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotClonePrototype) - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCollection : SnapshotCollection struct -type SnapshotCollection struct { - // A link to the first page of resources. - First *SnapshotCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SnapshotCollectionNext `json:"next,omitempty"` - - // Collection of snapshots. - Snapshots []Snapshot `json:"snapshots" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSnapshotCollection unmarshals an instance of SnapshotCollection from the specified map of raw messages. -func UnmarshalSnapshotCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshot) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SnapshotCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// SnapshotCollectionFirst : A link to the first page of resources. -type SnapshotCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSnapshotCollectionFirst unmarshals an instance of SnapshotCollectionFirst from the specified map of raw messages. -func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SnapshotCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSnapshotCollectionNext unmarshals an instance of SnapshotCollectionNext from the specified map of raw messages. -func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroup : SnapshotConsistencyGroup struct -type SnapshotConsistencyGroup struct { - // If present, the backup policy plan which created this snapshot consistency group. - BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` - - // The date and time that this snapshot consistency group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN of this snapshot consistency group. - CRN *string `json:"crn" validate:"required"` - - // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. - DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete" validate:"required"` - - // The URL for this snapshot consistency group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this snapshot consistency group. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of this snapshot consistency group. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this snapshot consistency group. The name is unique across all snapshot consistency groups in the - // region. - Name *string `json:"name" validate:"required"` - - // The resource group for this snapshot consistency group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The [service tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot consistency - // group. Each tag is prefixed with - // [is.instance:](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-faqs). - ServiceTags []string `json:"service_tags" validate:"required"` - - // The member snapshots that are data-consistent with respect to captured time. (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - Snapshots []SnapshotConsistencyGroupSnapshotsItem `json:"snapshots" validate:"required"` -} - -// Constants associated with the SnapshotConsistencyGroup.LifecycleState property. -// The lifecycle state of this snapshot consistency group. -const ( - SnapshotConsistencyGroupLifecycleStateDeletingConst = "deleting" - SnapshotConsistencyGroupLifecycleStateFailedConst = "failed" - SnapshotConsistencyGroupLifecycleStatePendingConst = "pending" - SnapshotConsistencyGroupLifecycleStateStableConst = "stable" - SnapshotConsistencyGroupLifecycleStateSuspendedConst = "suspended" - SnapshotConsistencyGroupLifecycleStateUpdatingConst = "updating" - SnapshotConsistencyGroupLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the SnapshotConsistencyGroup.ResourceType property. -// The resource type. -const ( - SnapshotConsistencyGroupResourceTypeSnapshotConsistencyGroupConst = "snapshot_consistency_group" -) - -// UnmarshalSnapshotConsistencyGroup unmarshals an instance of SnapshotConsistencyGroup from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroup) - err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_tags", &obj.ServiceTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupSnapshotsItem) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupCollection : SnapshotConsistencyGroupCollection struct -type SnapshotConsistencyGroupCollection struct { - // A link to the first page of resources. - First *SnapshotConsistencyGroupCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SnapshotConsistencyGroupCollectionNext `json:"next,omitempty"` - - // Collection of snapshot consistency groups. - SnapshotConsistencyGroups []SnapshotConsistencyGroup `json:"snapshot_consistency_groups" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSnapshotConsistencyGroupCollection unmarshals an instance of SnapshotConsistencyGroupCollection from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotConsistencyGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotConsistencyGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshot_consistency_groups", &obj.SnapshotConsistencyGroups, UnmarshalSnapshotConsistencyGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SnapshotConsistencyGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// SnapshotConsistencyGroupCollectionFirst : A link to the first page of resources. -type SnapshotConsistencyGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSnapshotConsistencyGroupCollectionFirst unmarshals an instance of SnapshotConsistencyGroupCollectionFirst from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SnapshotConsistencyGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSnapshotConsistencyGroupCollectionNext unmarshals an instance of SnapshotConsistencyGroupCollectionNext from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupPatch : SnapshotConsistencyGroupPatch struct -type SnapshotConsistencyGroupPatch struct { - // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. - DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` - - // The name for this snapshot consistency group. The name must not be used by another snapshot consistency groups in - // the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalSnapshotConsistencyGroupPatch unmarshals an instance of SnapshotConsistencyGroupPatch from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupPatch) - err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SnapshotConsistencyGroupPatch -func (snapshotConsistencyGroupPatch *SnapshotConsistencyGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(snapshotConsistencyGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// SnapshotConsistencyGroupPrototype : SnapshotConsistencyGroupPrototype struct -// Models which "extend" this model: -// - SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots -type SnapshotConsistencyGroupPrototype struct { - // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. - DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` - - // The name for this snapshot consistency group. The name must be unique across all snapshot consistency groups in the - // region. - // - // If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The data-consistent member snapshots to create. All snapshots must specify a - // `source_volume` attached to the same virtual server instance. - Snapshots []SnapshotConsistencyGroupPrototypeSnapshotsItem `json:"snapshots,omitempty"` -} - -func (*SnapshotConsistencyGroupPrototype) isaSnapshotConsistencyGroupPrototype() bool { - return true -} - -type SnapshotConsistencyGroupPrototypeIntf interface { - isaSnapshotConsistencyGroupPrototype() bool -} - -// UnmarshalSnapshotConsistencyGroupPrototype unmarshals an instance of SnapshotConsistencyGroupPrototype from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupPrototype) - err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem : SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem struct -type SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem struct { - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` -} - -// NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem : Instantiate SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem (Generic Model Constructor) -func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem(sourceVolume VolumeIdentityIntf) (_model *SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem, err error) { - _model = &SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem{ - SourceVolume: sourceVolume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupPrototypeSnapshotsItem : SnapshotConsistencyGroupPrototypeSnapshotsItem struct -type SnapshotConsistencyGroupPrototypeSnapshotsItem struct { - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` -} - -// NewSnapshotConsistencyGroupPrototypeSnapshotsItem : Instantiate SnapshotConsistencyGroupPrototypeSnapshotsItem (Generic Model Constructor) -func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotsItem(sourceVolume VolumeIdentityIntf) (_model *SnapshotConsistencyGroupPrototypeSnapshotsItem, err error) { - _model = &SnapshotConsistencyGroupPrototypeSnapshotsItem{ - SourceVolume: sourceVolume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotsItem from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupPrototypeSnapshotsItem) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupReference : SnapshotConsistencyGroupReference struct -type SnapshotConsistencyGroupReference struct { - // The CRN of this snapshot consistency group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotConsistencyGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this snapshot consistency group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this snapshot consistency group. - ID *string `json:"id" validate:"required"` - - // The name for this snapshot consistency group. The name is unique across all snapshot consistency groups in the - // region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SnapshotConsistencyGroupReference.ResourceType property. -// The resource type. -const ( - SnapshotConsistencyGroupReferenceResourceTypeSnapshotConsistencyGroupConst = "snapshot_consistency_group" -) - -// UnmarshalSnapshotConsistencyGroupReference unmarshals an instance of SnapshotConsistencyGroupReference from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotConsistencyGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SnapshotConsistencyGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSnapshotConsistencyGroupReferenceDeleted unmarshals an instance of SnapshotConsistencyGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupSnapshotsItem : SnapshotConsistencyGroupSnapshotsItem struct -type SnapshotConsistencyGroupSnapshotsItem struct { - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` - - // The name for this snapshot. The name is unique across all snapshots in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SnapshotConsistencyGroupSnapshotsItem.ResourceType property. -// The resource type. -const ( - SnapshotConsistencyGroupSnapshotsItemResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshotConsistencyGroupSnapshotsItem unmarshals an instance of SnapshotConsistencyGroupSnapshotsItem from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupSnapshotsItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupSnapshotsItem) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotCopiesItem : SnapshotCopiesItem struct -type SnapshotCopiesItem struct { - // The CRN for the copied snapshot. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - - // The URL for the copied snapshot. - Href *string `json:"href" validate:"required"` - - // The unique identifier for the copied snapshot. - ID *string `json:"id" validate:"required"` - - // The name for the copied snapshot. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SnapshotCopiesItem.ResourceType property. -// The resource type. -const ( - SnapshotCopiesItemResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshotCopiesItem unmarshals an instance of SnapshotCopiesItem from the specified map of raw messages. -func UnmarshalSnapshotCopiesItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCopiesItem) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotIdentity : Identifies a snapshot by a unique property. -// Models which "extend" this model: -// - SnapshotIdentityByID -// - SnapshotIdentityByCRN -// - SnapshotIdentityByHref -type SnapshotIdentity struct { - // The unique identifier for this snapshot. - ID *string `json:"id,omitempty"` - - // The CRN of this snapshot. - CRN *string `json:"crn,omitempty"` - - // The URL for this snapshot. - Href *string `json:"href,omitempty"` -} - -func (*SnapshotIdentity) isaSnapshotIdentity() bool { - return true -} - -type SnapshotIdentityIntf interface { - isaSnapshotIdentity() bool -} - -// UnmarshalSnapshotIdentity unmarshals an instance of SnapshotIdentity from the specified map of raw messages. -func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotPatch : SnapshotPatch struct -type SnapshotPatch struct { - // The name for this snapshot. The name must not be used by another snapshot in the region. - Name *string `json:"name,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` -} - -// UnmarshalSnapshotPatch unmarshals an instance of SnapshotPatch from the specified map of raw messages. -func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SnapshotPatch -func (snapshotPatch *SnapshotPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(snapshotPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// SnapshotPrototype : SnapshotPrototype struct -// Models which "extend" this model: -// - SnapshotPrototypeSnapshotBySourceVolume -// - SnapshotPrototypeSnapshotBySourceSnapshot -type SnapshotPrototype struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` - - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` - - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` - - // The root key to use to wrap the data encryption key for this snapshot. - // - // A key must be specified if and only if the source snapshot has an `encryption` type of - // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify - // a key in the same region as the new snapshot, and use the same encryption key for all - // snapshots using the same source volume. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The source snapshot (in another region) to create this snapshot from. - // The specified snapshot must not already be the source of another snapshot in this - // region. - SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot,omitempty"` -} - -func (*SnapshotPrototype) isaSnapshotPrototype() bool { - return true -} - -type SnapshotPrototypeIntf interface { - isaSnapshotPrototype() bool -} - -// UnmarshalSnapshotPrototype unmarshals an instance of SnapshotPrototype from the specified map of raw messages. -func UnmarshalSnapshotPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototype) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotReference : SnapshotReference struct -type SnapshotReference struct { - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` - - // The name for this snapshot. The name is unique across all snapshots in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SnapshotReference.ResourceType property. -// The resource type. -const ( - SnapshotReferenceResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshotReference unmarshals an instance of SnapshotReference from the specified map of raw messages. -func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SnapshotReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSnapshotReferenceDeleted unmarshals an instance of SnapshotReferenceDeleted from the specified map of raw messages. -func UnmarshalSnapshotReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type SnapshotRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalSnapshotRemote unmarshals an instance of SnapshotRemote from the specified map of raw messages. -func UnmarshalSnapshotRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotSourceSnapshot : If present, the source snapshot this snapshot was created from. -type SnapshotSourceSnapshot struct { - // The CRN of the source snapshot. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - - // The URL for the source snapshot. - Href *string `json:"href" validate:"required"` - - // The unique identifier for the source snapshot. - ID *string `json:"id" validate:"required"` - - // The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *SnapshotRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SnapshotSourceSnapshot.ResourceType property. -// The resource type. -const ( - SnapshotSourceSnapshotResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshotSourceSnapshot unmarshals an instance of SnapshotSourceSnapshot from the specified map of raw messages. -func UnmarshalSnapshotSourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotSourceSnapshot) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSnapshotRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// StartBareMetalServerOptions : The StartBareMetalServer options. -type StartBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewStartBareMetalServerOptions : Instantiate StartBareMetalServerOptions -func (*VpcV1) NewStartBareMetalServerOptions(id string) *StartBareMetalServerOptions { - return &StartBareMetalServerOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *StartBareMetalServerOptions) SetID(id string) *StartBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *StartBareMetalServerOptions) SetHeaders(param map[string]string) *StartBareMetalServerOptions { - options.Headers = param - return options -} - -// StopBareMetalServerOptions : The StopBareMetalServer options. -type StopBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The type of stop operation: - // - `soft`: signal running operating system to quiesce and shutdown cleanly - // - `hard`: immediately stop the server. - Type *string `json:"type" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the StopBareMetalServerOptions.Type property. -// The type of stop operation: -// - `soft`: signal running operating system to quiesce and shutdown cleanly -// - `hard`: immediately stop the server. -const ( - StopBareMetalServerOptionsTypeHardConst = "hard" - StopBareMetalServerOptionsTypeSoftConst = "soft" -) - -// NewStopBareMetalServerOptions : Instantiate StopBareMetalServerOptions -func (*VpcV1) NewStopBareMetalServerOptions(id string, typeVar string) *StopBareMetalServerOptions { - return &StopBareMetalServerOptions{ - ID: core.StringPtr(id), - Type: core.StringPtr(typeVar), - } -} - -// SetID : Allow user to set ID -func (_options *StopBareMetalServerOptions) SetID(id string) *StopBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetType : Allow user to set Type -func (_options *StopBareMetalServerOptions) SetType(typeVar string) *StopBareMetalServerOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *StopBareMetalServerOptions) SetHeaders(param map[string]string) *StopBareMetalServerOptions { - options.Headers = param - return options -} - -// Subnet : Subnet struct -type Subnet struct { - // The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the - // provider. - AvailableIpv4AddressCount *int64 `json:"available_ipv4_address_count" validate:"required"` - - // The date and time that the subnet was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` - - // The URL for this subnet. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` - - // The IP version(s) supported by this subnet. - IPVersion *string `json:"ip_version" validate:"required"` - - // The IPv4 range of the subnet, expressed in CIDR format. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` - - // The name for this subnet. The name is unique across all subnets in the VPC. - Name *string `json:"name" validate:"required"` - - // The network ACL for this subnet. - NetworkACL *NetworkACLReference `json:"network_acl" validate:"required"` - - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway *PublicGatewayReference `json:"public_gateway,omitempty"` - - // The resource group for this subnet. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The routing table for this subnet. - RoutingTable *RoutingTableReference `json:"routing_table" validate:"required"` - - // The status of the subnet. - Status *string `json:"status" validate:"required"` - - // The total number of IPv4 addresses in this subnet. - // - // Note: This is calculated as 2(32 - prefix length). For example, the prefix length `/24` gives:
- // 2(32 - 24) = 28 = 256 addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` - - // The VPC this subnet resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this subnet resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Subnet.IPVersion property. -// The IP version(s) supported by this subnet. -const ( - SubnetIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the Subnet.ResourceType property. -// The resource type. -const ( - SubnetResourceTypeSubnetConst = "subnet" -) - -// Constants associated with the Subnet.Status property. -// The status of the subnet. -const ( - SubnetStatusAvailableConst = "available" - SubnetStatusDeletingConst = "deleting" - SubnetStatusFailedConst = "failed" - SubnetStatusPendingConst = "pending" -) - -// UnmarshalSubnet unmarshals an instance of Subnet from the specified map of raw messages. -func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Subnet) - err = core.UnmarshalPrimitive(m, "available_ipv4_address_count", &obj.AvailableIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetCollection : SubnetCollection struct -type SubnetCollection struct { - // A link to the first page of resources. - First *SubnetCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SubnetCollectionNext `json:"next,omitempty"` - - // Collection of subnets. - Subnets []Subnet `json:"subnets" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalSubnetCollection unmarshals an instance of SubnetCollection from the specified map of raw messages. -func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSubnetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSubnetCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnet) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SubnetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// SubnetCollectionFirst : A link to the first page of resources. -type SubnetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSubnetCollectionFirst unmarshals an instance of SubnetCollectionFirst from the specified map of raw messages. -func UnmarshalSubnetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SubnetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalSubnetCollectionNext unmarshals an instance of SubnetCollectionNext from the specified map of raw messages. -func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetIdentity : Identifies a subnet by a unique property. -// Models which "extend" this model: -// - SubnetIdentityByID -// - SubnetIdentityByCRN -// - SubnetIdentityByHref -type SubnetIdentity struct { - // The unique identifier for this subnet. - ID *string `json:"id,omitempty"` - - // The CRN for this subnet. - CRN *string `json:"crn,omitempty"` - - // The URL for this subnet. - Href *string `json:"href,omitempty"` -} - -func (*SubnetIdentity) isaSubnetIdentity() bool { - return true -} - -type SubnetIdentityIntf interface { - isaSubnetIdentity() bool -} - -// UnmarshalSubnetIdentity unmarshals an instance of SubnetIdentity from the specified map of raw messages. -func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPatch : SubnetPatch struct -type SubnetPatch struct { - // The name for this subnet. The name must not be used by another subnet in the VPC. - Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway SubnetPublicGatewayPatchIntf `json:"public_gateway,omitempty"` - - // The routing table to use for this subnet. The routing table properties - // `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` -} - -// UnmarshalSubnetPatch unmarshals an instance of SubnetPatch from the specified map of raw messages. -func UnmarshalSubnetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalSubnetPublicGatewayPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the SubnetPatch -func (subnetPatch *SubnetPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(subnetPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// SubnetPrototype : SubnetPrototype struct -// Models which "extend" this model: -// - SubnetPrototypeSubnetByTotalCount -// - SubnetPrototypeSubnetByCIDR -type SubnetPrototype struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. If - // unspecified, the subnet will not be attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The routing table to use for this subnet. If unspecified, the default routing table - // for the VPC is used. The routing table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` - - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the - // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count,omitempty"` - - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` - - // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` - // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of - // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix - // that contains the subnet's IPv4 CIDR. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block,omitempty"` -} - -// Constants associated with the SubnetPrototype.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeIPVersionIpv4Const = "ipv4" -) - -func (*SubnetPrototype) isaSubnetPrototype() bool { - return true -} - -type SubnetPrototypeIntf interface { - isaSubnetPrototype() bool -} - -// UnmarshalSubnetPrototype unmarshals an instance of SubnetPrototype from the specified map of raw messages. -func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototype) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatch : The public gateway to use for internet-bound traffic for this subnet. -// Models which "extend" this model: -// - SubnetPublicGatewayPatchPublicGatewayIdentityByID -// - SubnetPublicGatewayPatchPublicGatewayIdentityByCRN -// - SubnetPublicGatewayPatchPublicGatewayIdentityByHref -type SubnetPublicGatewayPatch struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href,omitempty"` -} - -func (*SubnetPublicGatewayPatch) isaSubnetPublicGatewayPatch() bool { - return true -} - -type SubnetPublicGatewayPatchIntf interface { - isaSubnetPublicGatewayPatch() bool -} - -// UnmarshalSubnetPublicGatewayPatch unmarshals an instance of SubnetPublicGatewayPatch from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetReference : SubnetReference struct -type SubnetReference struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this subnet. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` - - // The name for this subnet. The name is unique across all subnets in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SubnetReference.ResourceType property. -// The resource type. -const ( - SubnetReferenceResourceTypeSubnetConst = "subnet" -) - -// UnmarshalSubnetReference unmarshals an instance of SubnetReference from the specified map of raw messages. -func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type SubnetReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalSubnetReferenceDeleted unmarshals an instance of SubnetReferenceDeleted from the specified map of raw messages. -func UnmarshalSubnetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileIdentity : Identifies a trusted profile by a unique property. -// Models which "extend" this model: -// - TrustedProfileIdentityTrustedProfileByID -// - TrustedProfileIdentityTrustedProfileByCRN -type TrustedProfileIdentity struct { - // The unique identifier for this trusted profile. - ID *string `json:"id,omitempty"` - - // The CRN for this trusted profile. - CRN *string `json:"crn,omitempty"` -} - -func (*TrustedProfileIdentity) isaTrustedProfileIdentity() bool { - return true -} - -type TrustedProfileIdentityIntf interface { - isaTrustedProfileIdentity() bool -} - -// UnmarshalTrustedProfileIdentity unmarshals an instance of TrustedProfileIdentity from the specified map of raw messages. -func UnmarshalTrustedProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileReference : TrustedProfileReference struct -type TrustedProfileReference struct { - // The CRN for this trusted profile. - CRN *string `json:"crn" validate:"required"` - - // The unique identifier for this trusted profile. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the TrustedProfileReference.ResourceType property. -// The resource type. -const ( - TrustedProfileReferenceResourceTypeTrustedProfileConst = "trusted_profile" -) - -// UnmarshalTrustedProfileReference unmarshals an instance of TrustedProfileReference from the specified map of raw messages. -func UnmarshalTrustedProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// UnsetSubnetPublicGatewayOptions : The UnsetSubnetPublicGateway options. -type UnsetSubnetPublicGatewayOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUnsetSubnetPublicGatewayOptions : Instantiate UnsetSubnetPublicGatewayOptions -func (*VpcV1) NewUnsetSubnetPublicGatewayOptions(id string) *UnsetSubnetPublicGatewayOptions { - return &UnsetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *UnsetSubnetPublicGatewayOptions) SetID(id string) *UnsetSubnetPublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UnsetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *UnsetSubnetPublicGatewayOptions { - options.Headers = param - return options -} - -// UpdateBackupPolicyOptions : The UpdateBackupPolicy options. -type UpdateBackupPolicyOptions struct { - // The backup policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The backup policy patch. - BackupPolicyPatch map[string]interface{} `json:"BackupPolicy_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBackupPolicyOptions : Instantiate UpdateBackupPolicyOptions -func (*VpcV1) NewUpdateBackupPolicyOptions(id string, backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { - return &UpdateBackupPolicyOptions{ - ID: core.StringPtr(id), - BackupPolicyPatch: backupPolicyPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateBackupPolicyOptions) SetID(id string) *UpdateBackupPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBackupPolicyPatch : Allow user to set BackupPolicyPatch -func (_options *UpdateBackupPolicyOptions) SetBackupPolicyPatch(backupPolicyPatch map[string]interface{}) *UpdateBackupPolicyOptions { - _options.BackupPolicyPatch = backupPolicyPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateBackupPolicyOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBackupPolicyOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyOptions { - options.Headers = param - return options -} - -// UpdateBackupPolicyPlanOptions : The UpdateBackupPolicyPlan options. -type UpdateBackupPolicyPlanOptions struct { - // The backup policy identifier. - BackupPolicyID *string `json:"backup_policy_id" validate:"required,ne="` - - // The backup policy plan identifier. - ID *string `json:"id" validate:"required,ne="` - - // The backup policy plan patch. - BackupPolicyPlanPatch map[string]interface{} `json:"BackupPolicyPlan_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBackupPolicyPlanOptions : Instantiate UpdateBackupPolicyPlanOptions -func (*VpcV1) NewUpdateBackupPolicyPlanOptions(backupPolicyID string, id string, backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { - return &UpdateBackupPolicyPlanOptions{ - BackupPolicyID: core.StringPtr(backupPolicyID), - ID: core.StringPtr(id), - BackupPolicyPlanPatch: backupPolicyPlanPatch, - } -} - -// SetBackupPolicyID : Allow user to set BackupPolicyID -func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyID(backupPolicyID string) *UpdateBackupPolicyPlanOptions { - _options.BackupPolicyID = core.StringPtr(backupPolicyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBackupPolicyPlanOptions) SetID(id string) *UpdateBackupPolicyPlanOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBackupPolicyPlanPatch : Allow user to set BackupPolicyPlanPatch -func (_options *UpdateBackupPolicyPlanOptions) SetBackupPolicyPlanPatch(backupPolicyPlanPatch map[string]interface{}) *UpdateBackupPolicyPlanOptions { - _options.BackupPolicyPlanPatch = backupPolicyPlanPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateBackupPolicyPlanOptions) SetIfMatch(ifMatch string) *UpdateBackupPolicyPlanOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBackupPolicyPlanOptions) SetHeaders(param map[string]string) *UpdateBackupPolicyPlanOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerDiskOptions : The UpdateBareMetalServerDisk options. -type UpdateBareMetalServerDiskOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server disk patch. - BareMetalServerDiskPatch map[string]interface{} `json:"BareMetalServerDisk_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerDiskOptions : Instantiate UpdateBareMetalServerDiskOptions -func (*VpcV1) NewUpdateBareMetalServerDiskOptions(bareMetalServerID string, id string, bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { - return &UpdateBareMetalServerDiskOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - BareMetalServerDiskPatch: bareMetalServerDiskPatch, - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerDiskOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerDiskOptions) SetID(id string) *UpdateBareMetalServerDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerDiskPatch : Allow user to set BareMetalServerDiskPatch -func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerDiskPatch(bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { - _options.BareMetalServerDiskPatch = bareMetalServerDiskPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerDiskOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerDiskOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerNetworkAttachmentOptions : The UpdateBareMetalServerNetworkAttachment options. -type UpdateBareMetalServerNetworkAttachmentOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server network attachment patch. - BareMetalServerNetworkAttachmentPatch map[string]interface{} `json:"BareMetalServerNetworkAttachment_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerNetworkAttachmentOptions : Instantiate UpdateBareMetalServerNetworkAttachmentOptions -func (*VpcV1) NewUpdateBareMetalServerNetworkAttachmentOptions(bareMetalServerID string, id string, bareMetalServerNetworkAttachmentPatch map[string]interface{}) *UpdateBareMetalServerNetworkAttachmentOptions { - return &UpdateBareMetalServerNetworkAttachmentOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - BareMetalServerNetworkAttachmentPatch: bareMetalServerNetworkAttachmentPatch, - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetID(id string) *UpdateBareMetalServerNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerNetworkAttachmentPatch : Allow user to set BareMetalServerNetworkAttachmentPatch -func (_options *UpdateBareMetalServerNetworkAttachmentOptions) SetBareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatch map[string]interface{}) *UpdateBareMetalServerNetworkAttachmentOptions { - _options.BareMetalServerNetworkAttachmentPatch = bareMetalServerNetworkAttachmentPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerNetworkAttachmentOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkAttachmentOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerNetworkInterfaceOptions : The UpdateBareMetalServerNetworkInterface options. -type UpdateBareMetalServerNetworkInterfaceOptions struct { - // The bare metal server identifier. - BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - - // The bare metal server network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server network interface patch. - BareMetalServerNetworkInterfacePatch map[string]interface{} `json:"BareMetalServerNetworkInterface_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerNetworkInterfaceOptions : Instantiate UpdateBareMetalServerNetworkInterfaceOptions -func (*VpcV1) NewUpdateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string, bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { - return &UpdateBareMetalServerNetworkInterfaceOptions{ - BareMetalServerID: core.StringPtr(bareMetalServerID), - ID: core.StringPtr(id), - BareMetalServerNetworkInterfacePatch: bareMetalServerNetworkInterfacePatch, - } -} - -// SetBareMetalServerID : Allow user to set BareMetalServerID -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerID = core.StringPtr(bareMetalServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetID(id string) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerNetworkInterfacePatch : Allow user to set BareMetalServerNetworkInterfacePatch -func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { - _options.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkInterfaceOptions { - options.Headers = param - return options -} - -// UpdateBareMetalServerOptions : The UpdateBareMetalServer options. -type UpdateBareMetalServerOptions struct { - // The bare metal server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The bare metal server patch. - BareMetalServerPatch map[string]interface{} `json:"BareMetalServer_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateBareMetalServerOptions : Instantiate UpdateBareMetalServerOptions -func (*VpcV1) NewUpdateBareMetalServerOptions(id string, bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { - return &UpdateBareMetalServerOptions{ - ID: core.StringPtr(id), - BareMetalServerPatch: bareMetalServerPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateBareMetalServerOptions) SetID(id string) *UpdateBareMetalServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetBareMetalServerPatch : Allow user to set BareMetalServerPatch -func (_options *UpdateBareMetalServerOptions) SetBareMetalServerPatch(bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { - _options.BareMetalServerPatch = bareMetalServerPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateBareMetalServerOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerOptions { - options.Headers = param - return options -} - -// UpdateDedicatedHostDiskOptions : The UpdateDedicatedHostDisk options. -type UpdateDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // The dedicated host disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // The dedicated host disk patch. - DedicatedHostDiskPatch map[string]interface{} `json:"DedicatedHostDisk_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateDedicatedHostDiskOptions : Instantiate UpdateDedicatedHostDiskOptions -func (*VpcV1) NewUpdateDedicatedHostDiskOptions(dedicatedHostID string, id string, dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - return &UpdateDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), - DedicatedHostDiskPatch: dedicatedHostDiskPatch, - } -} - -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostDiskOptions) SetID(id string) *UpdateDedicatedHostDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetDedicatedHostDiskPatch : Allow user to set DedicatedHostDiskPatch -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostDiskPatch(dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostDiskPatch = dedicatedHostDiskPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostDiskOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostDiskOptions { - options.Headers = param - return options -} - -// UpdateDedicatedHostGroupOptions : The UpdateDedicatedHostGroup options. -type UpdateDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The dedicated host group patch. - DedicatedHostGroupPatch map[string]interface{} `json:"DedicatedHostGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateDedicatedHostGroupOptions : Instantiate UpdateDedicatedHostGroupOptions -func (*VpcV1) NewUpdateDedicatedHostGroupOptions(id string, dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - return &UpdateDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - DedicatedHostGroupPatch: dedicatedHostGroupPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostGroupOptions) SetID(id string) *UpdateDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetDedicatedHostGroupPatch : Allow user to set DedicatedHostGroupPatch -func (_options *UpdateDedicatedHostGroupOptions) SetDedicatedHostGroupPatch(dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - _options.DedicatedHostGroupPatch = dedicatedHostGroupPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostGroupOptions { - options.Headers = param - return options -} - -// UpdateDedicatedHostOptions : The UpdateDedicatedHost options. -type UpdateDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` - - // The dedicated host patch. - DedicatedHostPatch map[string]interface{} `json:"DedicatedHost_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateDedicatedHostOptions : Instantiate UpdateDedicatedHostOptions -func (*VpcV1) NewUpdateDedicatedHostOptions(id string, dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - return &UpdateDedicatedHostOptions{ - ID: core.StringPtr(id), - DedicatedHostPatch: dedicatedHostPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateDedicatedHostOptions) SetID(id string) *UpdateDedicatedHostOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetDedicatedHostPatch : Allow user to set DedicatedHostPatch -func (_options *UpdateDedicatedHostOptions) SetDedicatedHostPatch(dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - _options.DedicatedHostPatch = dedicatedHostPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostOptions { - options.Headers = param - return options -} - -// UpdateEndpointGatewayOptions : The UpdateEndpointGateway options. -type UpdateEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // The endpoint gateway patch. - EndpointGatewayPatch map[string]interface{} `json:"EndpointGateway_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateEndpointGatewayOptions : Instantiate UpdateEndpointGatewayOptions -func (*VpcV1) NewUpdateEndpointGatewayOptions(id string, endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - return &UpdateEndpointGatewayOptions{ - ID: core.StringPtr(id), - EndpointGatewayPatch: endpointGatewayPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateEndpointGatewayOptions) SetID(id string) *UpdateEndpointGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetEndpointGatewayPatch : Allow user to set EndpointGatewayPatch -func (_options *UpdateEndpointGatewayOptions) SetEndpointGatewayPatch(endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - _options.EndpointGatewayPatch = endpointGatewayPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayOptions { - options.Headers = param - return options -} - -// UpdateFloatingIPOptions : The UpdateFloatingIP options. -type UpdateFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // The floating IP patch. - FloatingIPPatch map[string]interface{} `json:"FloatingIP_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateFloatingIPOptions : Instantiate UpdateFloatingIPOptions -func (*VpcV1) NewUpdateFloatingIPOptions(id string, floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - return &UpdateFloatingIPOptions{ - ID: core.StringPtr(id), - FloatingIPPatch: floatingIPPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateFloatingIPOptions) SetID(id string) *UpdateFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetFloatingIPPatch : Allow user to set FloatingIPPatch -func (_options *UpdateFloatingIPOptions) SetFloatingIPPatch(floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - _options.FloatingIPPatch = floatingIPPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateFloatingIPOptions) SetHeaders(param map[string]string) *UpdateFloatingIPOptions { - options.Headers = param - return options -} - -// UpdateFlowLogCollectorOptions : The UpdateFlowLogCollector options. -type UpdateFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` - - // The flow log collector patch. - FlowLogCollectorPatch map[string]interface{} `json:"FlowLogCollector_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateFlowLogCollectorOptions : Instantiate UpdateFlowLogCollectorOptions -func (*VpcV1) NewUpdateFlowLogCollectorOptions(id string, flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - return &UpdateFlowLogCollectorOptions{ - ID: core.StringPtr(id), - FlowLogCollectorPatch: flowLogCollectorPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateFlowLogCollectorOptions) SetID(id string) *UpdateFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetFlowLogCollectorPatch : Allow user to set FlowLogCollectorPatch -func (_options *UpdateFlowLogCollectorOptions) SetFlowLogCollectorPatch(flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - _options.FlowLogCollectorPatch = flowLogCollectorPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateFlowLogCollectorOptions) SetHeaders(param map[string]string) *UpdateFlowLogCollectorOptions { - options.Headers = param - return options -} - -// UpdateIkePolicyOptions : The UpdateIkePolicy options. -type UpdateIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The IKE policy patch. - IkePolicyPatch map[string]interface{} `json:"IkePolicy_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateIkePolicyOptions : Instantiate UpdateIkePolicyOptions -func (*VpcV1) NewUpdateIkePolicyOptions(id string, ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - return &UpdateIkePolicyOptions{ - ID: core.StringPtr(id), - IkePolicyPatch: ikePolicyPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateIkePolicyOptions) SetID(id string) *UpdateIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIkePolicyPatch : Allow user to set IkePolicyPatch -func (_options *UpdateIkePolicyOptions) SetIkePolicyPatch(ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - _options.IkePolicyPatch = ikePolicyPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateIkePolicyOptions) SetHeaders(param map[string]string) *UpdateIkePolicyOptions { - options.Headers = param - return options -} - -// UpdateImageExportJobOptions : The UpdateImageExportJob options. -type UpdateImageExportJobOptions struct { - // The image identifier. - ImageID *string `json:"image_id" validate:"required,ne="` - - // The image export job identifier. - ID *string `json:"id" validate:"required,ne="` - - // The image export job patch. - ImageExportJobPatch map[string]interface{} `json:"ImageExportJob_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateImageExportJobOptions : Instantiate UpdateImageExportJobOptions -func (*VpcV1) NewUpdateImageExportJobOptions(imageID string, id string, imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { - return &UpdateImageExportJobOptions{ - ImageID: core.StringPtr(imageID), - ID: core.StringPtr(id), - ImageExportJobPatch: imageExportJobPatch, - } -} - -// SetImageID : Allow user to set ImageID -func (_options *UpdateImageExportJobOptions) SetImageID(imageID string) *UpdateImageExportJobOptions { - _options.ImageID = core.StringPtr(imageID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateImageExportJobOptions) SetID(id string) *UpdateImageExportJobOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetImageExportJobPatch : Allow user to set ImageExportJobPatch -func (_options *UpdateImageExportJobOptions) SetImageExportJobPatch(imageExportJobPatch map[string]interface{}) *UpdateImageExportJobOptions { - _options.ImageExportJobPatch = imageExportJobPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateImageExportJobOptions) SetHeaders(param map[string]string) *UpdateImageExportJobOptions { - options.Headers = param - return options -} - -// UpdateImageOptions : The UpdateImage options. -type UpdateImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // The image patch. - ImagePatch map[string]interface{} `json:"Image_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateImageOptions : Instantiate UpdateImageOptions -func (*VpcV1) NewUpdateImageOptions(id string, imagePatch map[string]interface{}) *UpdateImageOptions { - return &UpdateImageOptions{ - ID: core.StringPtr(id), - ImagePatch: imagePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateImageOptions) SetID(id string) *UpdateImageOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetImagePatch : Allow user to set ImagePatch -func (_options *UpdateImageOptions) SetImagePatch(imagePatch map[string]interface{}) *UpdateImageOptions { - _options.ImagePatch = imagePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateImageOptions) SetHeaders(param map[string]string) *UpdateImageOptions { - options.Headers = param - return options -} - -// UpdateInstanceDiskOptions : The UpdateInstanceDisk options. -type UpdateInstanceDiskOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance disk identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance disk patch. - InstanceDiskPatch map[string]interface{} `json:"InstanceDisk_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceDiskOptions : Instantiate UpdateInstanceDiskOptions -func (*VpcV1) NewUpdateInstanceDiskOptions(instanceID string, id string, instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - return &UpdateInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - InstanceDiskPatch: instanceDiskPatch, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceDiskOptions) SetInstanceID(instanceID string) *UpdateInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceDiskOptions) SetID(id string) *UpdateInstanceDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceDiskPatch : Allow user to set InstanceDiskPatch -func (_options *UpdateInstanceDiskOptions) SetInstanceDiskPatch(instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - _options.InstanceDiskPatch = instanceDiskPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceDiskOptions) SetHeaders(param map[string]string) *UpdateInstanceDiskOptions { - options.Headers = param - return options -} - -// UpdateInstanceGroupManagerActionOptions : The UpdateInstanceGroupManagerAction options. -type UpdateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance group manager action patch. - InstanceGroupManagerActionPatch map[string]interface{} `json:"InstanceGroupManagerAction_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceGroupManagerActionOptions : Instantiate UpdateInstanceGroupManagerActionOptions -func (*VpcV1) NewUpdateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - return &UpdateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerActionPatch: instanceGroupManagerActionPatch, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerActionOptions) SetID(id string) *UpdateInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupManagerActionPatch : Allow user to set InstanceGroupManagerActionPatch -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPatch(instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerActionOptions { - options.Headers = param - return options -} - -// UpdateInstanceGroupManagerOptions : The UpdateInstanceGroupManager options. -type UpdateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance group manager patch. - InstanceGroupManagerPatch map[string]interface{} `json:"InstanceGroupManager_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceGroupManagerOptions : Instantiate UpdateInstanceGroupManagerOptions -func (*VpcV1) NewUpdateInstanceGroupManagerOptions(instanceGroupID string, id string, instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - return &UpdateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupManagerPatch: instanceGroupManagerPatch, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerOptions) SetID(id string) *UpdateInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupManagerPatch : Allow user to set InstanceGroupManagerPatch -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupManagerPatch(instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPatch = instanceGroupManagerPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerOptions { - options.Headers = param - return options -} - -// UpdateInstanceGroupManagerPolicyOptions : The UpdateInstanceGroupManagerPolicy options. -type UpdateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance group manager policy patch. - InstanceGroupManagerPolicyPatch map[string]interface{} `json:"InstanceGroupManagerPolicy_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceGroupManagerPolicyOptions : Instantiate UpdateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - return &UpdateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerPolicyPatch: instanceGroupManagerPolicyPatch, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetID(id string) *UpdateInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupManagerPolicyPatch : Allow user to set InstanceGroupManagerPolicyPatch -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} - -// UpdateInstanceGroupMembershipOptions : The UpdateInstanceGroupMembership options. -type UpdateInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance group membership patch. - InstanceGroupMembershipPatch map[string]interface{} `json:"InstanceGroupMembership_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceGroupMembershipOptions : Instantiate UpdateInstanceGroupMembershipOptions -func (*VpcV1) NewUpdateInstanceGroupMembershipOptions(instanceGroupID string, id string, instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - return &UpdateInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupMembershipPatch: instanceGroupMembershipPatch, - } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupMembershipOptions) SetID(id string) *UpdateInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupMembershipPatch : Allow user to set InstanceGroupMembershipPatch -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupMembershipPatch(instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupMembershipPatch = instanceGroupMembershipPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupMembershipOptions { - options.Headers = param - return options -} - -// UpdateInstanceGroupOptions : The UpdateInstanceGroup options. -type UpdateInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance group patch. - InstanceGroupPatch map[string]interface{} `json:"InstanceGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceGroupOptions : Instantiate UpdateInstanceGroupOptions -func (*VpcV1) NewUpdateInstanceGroupOptions(id string, instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - return &UpdateInstanceGroupOptions{ - ID: core.StringPtr(id), - InstanceGroupPatch: instanceGroupPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceGroupOptions) SetID(id string) *UpdateInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceGroupPatch : Allow user to set InstanceGroupPatch -func (_options *UpdateInstanceGroupOptions) SetInstanceGroupPatch(instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - _options.InstanceGroupPatch = instanceGroupPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupOptions { - options.Headers = param - return options -} - -// UpdateInstanceNetworkAttachmentOptions : The UpdateInstanceNetworkAttachment options. -type UpdateInstanceNetworkAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance network attachment patch. - InstanceNetworkAttachmentPatch map[string]interface{} `json:"InstanceNetworkAttachment_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceNetworkAttachmentOptions : Instantiate UpdateInstanceNetworkAttachmentOptions -func (*VpcV1) NewUpdateInstanceNetworkAttachmentOptions(instanceID string, id string, instanceNetworkAttachmentPatch map[string]interface{}) *UpdateInstanceNetworkAttachmentOptions { - return &UpdateInstanceNetworkAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - InstanceNetworkAttachmentPatch: instanceNetworkAttachmentPatch, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceNetworkAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceNetworkAttachmentOptions) SetID(id string) *UpdateInstanceNetworkAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceNetworkAttachmentPatch : Allow user to set InstanceNetworkAttachmentPatch -func (_options *UpdateInstanceNetworkAttachmentOptions) SetInstanceNetworkAttachmentPatch(instanceNetworkAttachmentPatch map[string]interface{}) *UpdateInstanceNetworkAttachmentOptions { - _options.InstanceNetworkAttachmentPatch = instanceNetworkAttachmentPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceNetworkAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkAttachmentOptions { - options.Headers = param - return options -} - -// UpdateInstanceNetworkInterfaceOptions : The UpdateInstanceNetworkInterface options. -type UpdateInstanceNetworkInterfaceOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance network interface patch. - NetworkInterfacePatch map[string]interface{} `json:"NetworkInterface_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceNetworkInterfaceOptions : Instantiate UpdateInstanceNetworkInterfaceOptions -func (*VpcV1) NewUpdateInstanceNetworkInterfaceOptions(instanceID string, id string, networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - return &UpdateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - NetworkInterfacePatch: networkInterfacePatch, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetID(id string) *UpdateInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetNetworkInterfacePatch : Allow user to set NetworkInterfacePatch -func (_options *UpdateInstanceNetworkInterfaceOptions) SetNetworkInterfacePatch(networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - _options.NetworkInterfacePatch = networkInterfacePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} - -// UpdateInstanceOptions : The UpdateInstance options. -type UpdateInstanceOptions struct { - // The virtual server instance identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance patch. - InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceOptions : Instantiate UpdateInstanceOptions -func (*VpcV1) NewUpdateInstanceOptions(id string, instancePatch map[string]interface{}) *UpdateInstanceOptions { - return &UpdateInstanceOptions{ - ID: core.StringPtr(id), - InstancePatch: instancePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceOptions) SetID(id string) *UpdateInstanceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstancePatch : Allow user to set InstancePatch -func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string]interface{}) *UpdateInstanceOptions { - _options.InstancePatch = instancePatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateInstanceOptions) SetIfMatch(ifMatch string) *UpdateInstanceOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { - options.Headers = param - return options -} - -// UpdateInstanceTemplateOptions : The UpdateInstanceTemplate options. -type UpdateInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` - - // The instance template patch. - InstanceTemplatePatch map[string]interface{} `json:"InstanceTemplate_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceTemplateOptions : Instantiate UpdateInstanceTemplateOptions -func (*VpcV1) NewUpdateInstanceTemplateOptions(id string, instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - return &UpdateInstanceTemplateOptions{ - ID: core.StringPtr(id), - InstanceTemplatePatch: instanceTemplatePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceTemplateOptions) SetID(id string) *UpdateInstanceTemplateOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetInstanceTemplatePatch : Allow user to set InstanceTemplatePatch -func (_options *UpdateInstanceTemplateOptions) SetInstanceTemplatePatch(instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - _options.InstanceTemplatePatch = instanceTemplatePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceTemplateOptions) SetHeaders(param map[string]string) *UpdateInstanceTemplateOptions { - options.Headers = param - return options -} - -// UpdateInstanceVolumeAttachmentOptions : The UpdateInstanceVolumeAttachment options. -type UpdateInstanceVolumeAttachmentOptions struct { - // The virtual server instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` - - // The volume attachment patch. - VolumeAttachmentPatch map[string]interface{} `json:"VolumeAttachment_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateInstanceVolumeAttachmentOptions : Instantiate UpdateInstanceVolumeAttachmentOptions -func (*VpcV1) NewUpdateInstanceVolumeAttachmentOptions(instanceID string, id string, volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - return &UpdateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - VolumeAttachmentPatch: volumeAttachmentPatch, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetID(id string) *UpdateInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVolumeAttachmentPatch : Allow user to set VolumeAttachmentPatch -func (_options *UpdateInstanceVolumeAttachmentOptions) SetVolumeAttachmentPatch(volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - _options.VolumeAttachmentPatch = volumeAttachmentPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} - -// UpdateIpsecPolicyOptions : The UpdateIpsecPolicy options. -type UpdateIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The IPsec policy patch. - IPsecPolicyPatch map[string]interface{} `json:"IPsecPolicy_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateIpsecPolicyOptions : Instantiate UpdateIpsecPolicyOptions -func (*VpcV1) NewUpdateIpsecPolicyOptions(id string, iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - return &UpdateIpsecPolicyOptions{ - ID: core.StringPtr(id), - IPsecPolicyPatch: iPsecPolicyPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateIpsecPolicyOptions) SetID(id string) *UpdateIpsecPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetIPsecPolicyPatch : Allow user to set IPsecPolicyPatch -func (_options *UpdateIpsecPolicyOptions) SetIPsecPolicyPatch(iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - _options.IPsecPolicyPatch = iPsecPolicyPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateIpsecPolicyOptions) SetHeaders(param map[string]string) *UpdateIpsecPolicyOptions { - options.Headers = param - return options -} - -// UpdateKeyOptions : The UpdateKey options. -type UpdateKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` - - // The key patch. - KeyPatch map[string]interface{} `json:"Key_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateKeyOptions : Instantiate UpdateKeyOptions -func (*VpcV1) NewUpdateKeyOptions(id string, keyPatch map[string]interface{}) *UpdateKeyOptions { - return &UpdateKeyOptions{ - ID: core.StringPtr(id), - KeyPatch: keyPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateKeyOptions) SetID(id string) *UpdateKeyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetKeyPatch : Allow user to set KeyPatch -func (_options *UpdateKeyOptions) SetKeyPatch(keyPatch map[string]interface{}) *UpdateKeyOptions { - _options.KeyPatch = keyPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateKeyOptions) SetHeaders(param map[string]string) *UpdateKeyOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerListenerOptions : The UpdateLoadBalancerListener options. -type UpdateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` - - // The load balancer listener patch. - LoadBalancerListenerPatch map[string]interface{} `json:"LoadBalancerListener_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerListenerOptions : Instantiate UpdateLoadBalancerListenerOptions -func (*VpcV1) NewUpdateLoadBalancerListenerOptions(loadBalancerID string, id string, loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - return &UpdateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerListenerPatch: loadBalancerListenerPatch, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerOptions) SetID(id string) *UpdateLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerListenerPatch : Allow user to set LoadBalancerListenerPatch -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerListenerPatch(loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerListenerPatch = loadBalancerListenerPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerListenerPolicyOptions : The UpdateLoadBalancerListenerPolicy options. -type UpdateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // The listener policy patch. - LoadBalancerListenerPolicyPatch map[string]interface{} `json:"LoadBalancerListenerPolicy_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerListenerPolicyOptions : Instantiate UpdateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string, loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - return &UpdateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyPatch: loadBalancerListenerPolicyPatch, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerListenerPolicyPatch : Allow user to set LoadBalancerListenerPolicyPatch -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerListenerPolicyRuleOptions : The UpdateLoadBalancerListenerPolicyRule options. -type UpdateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // The listener policy rule patch. - LoadBalancerListenerPolicyRulePatch map[string]interface{} `json:"LoadBalancerListenerPolicyRule_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerListenerPolicyRuleOptions : Instantiate UpdateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string, loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - return &UpdateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyRulePatch: loadBalancerListenerPolicyRulePatch, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerListenerPolicyRulePatch : Allow user to set LoadBalancerListenerPolicyRulePatch -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerOptions : The UpdateLoadBalancer options. -type UpdateLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` - - // The load balancer patch. - LoadBalancerPatch map[string]interface{} `json:"LoadBalancer_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerOptions : Instantiate UpdateLoadBalancerOptions -func (*VpcV1) NewUpdateLoadBalancerOptions(id string, loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - return &UpdateLoadBalancerOptions{ - ID: core.StringPtr(id), - LoadBalancerPatch: loadBalancerPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerOptions) SetID(id string) *UpdateLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerPatch : Allow user to set LoadBalancerPatch -func (_options *UpdateLoadBalancerOptions) SetLoadBalancerPatch(loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - _options.LoadBalancerPatch = loadBalancerPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateLoadBalancerOptions) SetIfMatch(ifMatch string) *UpdateLoadBalancerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerPoolMemberOptions : The UpdateLoadBalancerPoolMember options. -type UpdateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` - - // The member identifier. - ID *string `json:"id" validate:"required,ne="` - - // The load balancer pool member patch. - LoadBalancerPoolMemberPatch map[string]interface{} `json:"LoadBalancerPoolMember_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerPoolMemberOptions : Instantiate UpdateLoadBalancerPoolMemberOptions -func (*VpcV1) NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string, loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - return &UpdateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - LoadBalancerPoolMemberPatch: loadBalancerPoolMemberPatch, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *UpdateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetID(id string) *UpdateLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerPoolMemberPatch : Allow user to set LoadBalancerPoolMemberPatch -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerPoolMemberPatch(loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolMemberOptions { - options.Headers = param - return options -} - -// UpdateLoadBalancerPoolOptions : The UpdateLoadBalancerPool options. -type UpdateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` - - // The load balancer pool patch. - LoadBalancerPoolPatch map[string]interface{} `json:"LoadBalancerPool_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateLoadBalancerPoolOptions : Instantiate UpdateLoadBalancerPoolOptions -func (*VpcV1) NewUpdateLoadBalancerPoolOptions(loadBalancerID string, id string, loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - return &UpdateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerPoolPatch: loadBalancerPoolPatch, - } -} - -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolOptions) SetID(id string) *UpdateLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetLoadBalancerPoolPatch : Allow user to set LoadBalancerPoolPatch -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerPoolPatch(loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerPoolPatch = loadBalancerPoolPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolOptions { - options.Headers = param - return options -} - -// UpdateNetworkACLOptions : The UpdateNetworkACL options. -type UpdateNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` - - // The network ACL patch. - NetworkACLPatch map[string]interface{} `json:"NetworkACL_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateNetworkACLOptions : Instantiate UpdateNetworkACLOptions -func (*VpcV1) NewUpdateNetworkACLOptions(id string, networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - return &UpdateNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLPatch: networkACLPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLOptions) SetID(id string) *UpdateNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetNetworkACLPatch : Allow user to set NetworkACLPatch -func (_options *UpdateNetworkACLOptions) SetNetworkACLPatch(networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - _options.NetworkACLPatch = networkACLPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLOptions) SetHeaders(param map[string]string) *UpdateNetworkACLOptions { - options.Headers = param - return options -} - -// UpdateNetworkACLRuleOptions : The UpdateNetworkACLRule options. -type UpdateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // The network ACL rule patch. - NetworkACLRulePatch map[string]interface{} `json:"NetworkACLRule_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateNetworkACLRuleOptions : Instantiate UpdateNetworkACLRuleOptions -func (*VpcV1) NewUpdateNetworkACLRuleOptions(networkACLID string, id string, networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - return &UpdateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - NetworkACLRulePatch: networkACLRulePatch, - } -} - -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *UpdateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLRuleOptions) SetID(id string) *UpdateNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetNetworkACLRulePatch : Allow user to set NetworkACLRulePatch -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLRulePatch(networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - _options.NetworkACLRulePatch = networkACLRulePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLRuleOptions) SetHeaders(param map[string]string) *UpdateNetworkACLRuleOptions { - options.Headers = param - return options -} - -// UpdatePlacementGroupOptions : The UpdatePlacementGroup options. -type UpdatePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The placement group patch. - PlacementGroupPatch map[string]interface{} `json:"PlacementGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdatePlacementGroupOptions : Instantiate UpdatePlacementGroupOptions -func (*VpcV1) NewUpdatePlacementGroupOptions(id string, placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - return &UpdatePlacementGroupOptions{ - ID: core.StringPtr(id), - PlacementGroupPatch: placementGroupPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdatePlacementGroupOptions) SetID(id string) *UpdatePlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPlacementGroupPatch : Allow user to set PlacementGroupPatch -func (_options *UpdatePlacementGroupOptions) SetPlacementGroupPatch(placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - _options.PlacementGroupPatch = placementGroupPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdatePlacementGroupOptions) SetHeaders(param map[string]string) *UpdatePlacementGroupOptions { - options.Headers = param - return options -} - -// UpdatePublicGatewayOptions : The UpdatePublicGateway options. -type UpdatePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // The public gateway patch. - PublicGatewayPatch map[string]interface{} `json:"PublicGateway_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdatePublicGatewayOptions : Instantiate UpdatePublicGatewayOptions -func (*VpcV1) NewUpdatePublicGatewayOptions(id string, publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - return &UpdatePublicGatewayOptions{ - ID: core.StringPtr(id), - PublicGatewayPatch: publicGatewayPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdatePublicGatewayOptions) SetID(id string) *UpdatePublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPublicGatewayPatch : Allow user to set PublicGatewayPatch -func (_options *UpdatePublicGatewayOptions) SetPublicGatewayPatch(publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - _options.PublicGatewayPatch = publicGatewayPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) *UpdatePublicGatewayOptions { - options.Headers = param - return options -} - -// UpdateReservationOptions : The UpdateReservation options. -type UpdateReservationOptions struct { - // The reservation identifier. - ID *string `json:"id" validate:"required,ne="` - - // The reservation patch. - ReservationPatch map[string]interface{} `json:"Reservation_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateReservationOptions : Instantiate UpdateReservationOptions -func (*VpcV1) NewUpdateReservationOptions(id string, reservationPatch map[string]interface{}) *UpdateReservationOptions { - return &UpdateReservationOptions{ - ID: core.StringPtr(id), - ReservationPatch: reservationPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateReservationOptions) SetID(id string) *UpdateReservationOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetReservationPatch : Allow user to set ReservationPatch -func (_options *UpdateReservationOptions) SetReservationPatch(reservationPatch map[string]interface{}) *UpdateReservationOptions { - _options.ReservationPatch = reservationPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateReservationOptions) SetHeaders(param map[string]string) *UpdateReservationOptions { - options.Headers = param - return options -} - -// UpdateSecurityGroupOptions : The UpdateSecurityGroup options. -type UpdateSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The security group patch. - SecurityGroupPatch map[string]interface{} `json:"SecurityGroup_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSecurityGroupOptions : Instantiate UpdateSecurityGroupOptions -func (*VpcV1) NewUpdateSecurityGroupOptions(id string, securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - return &UpdateSecurityGroupOptions{ - ID: core.StringPtr(id), - SecurityGroupPatch: securityGroupPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupOptions) SetID(id string) *UpdateSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSecurityGroupPatch : Allow user to set SecurityGroupPatch -func (_options *UpdateSecurityGroupOptions) SetSecurityGroupPatch(securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - _options.SecurityGroupPatch = securityGroupPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupOptions { - options.Headers = param - return options -} - -// UpdateSecurityGroupRuleOptions : The UpdateSecurityGroupRule options. -type UpdateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // The security group rule patch. - SecurityGroupRulePatch map[string]interface{} `json:"SecurityGroupRule_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSecurityGroupRuleOptions : Instantiate UpdateSecurityGroupRuleOptions -func (*VpcV1) NewUpdateSecurityGroupRuleOptions(securityGroupID string, id string, securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - return &UpdateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - SecurityGroupRulePatch: securityGroupRulePatch, - } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupRuleOptions) SetID(id string) *UpdateSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSecurityGroupRulePatch : Allow user to set SecurityGroupRulePatch -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupRulePatch(securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupRulePatch = securityGroupRulePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupRuleOptions { - options.Headers = param - return options -} - -// UpdateShareMountTargetOptions : The UpdateShareMountTarget options. -type UpdateShareMountTargetOptions struct { - // The file share identifier. - ShareID *string `json:"share_id" validate:"required,ne="` - - // The share mount target identifier. - ID *string `json:"id" validate:"required,ne="` - - // The share mount target patch. - ShareMountTargetPatch map[string]interface{} `json:"ShareMountTarget_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateShareMountTargetOptions : Instantiate UpdateShareMountTargetOptions -func (*VpcV1) NewUpdateShareMountTargetOptions(shareID string, id string, shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { - return &UpdateShareMountTargetOptions{ - ShareID: core.StringPtr(shareID), - ID: core.StringPtr(id), - ShareMountTargetPatch: shareMountTargetPatch, - } -} - -// SetShareID : Allow user to set ShareID -func (_options *UpdateShareMountTargetOptions) SetShareID(shareID string) *UpdateShareMountTargetOptions { - _options.ShareID = core.StringPtr(shareID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateShareMountTargetOptions) SetID(id string) *UpdateShareMountTargetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetShareMountTargetPatch : Allow user to set ShareMountTargetPatch -func (_options *UpdateShareMountTargetOptions) SetShareMountTargetPatch(shareMountTargetPatch map[string]interface{}) *UpdateShareMountTargetOptions { - _options.ShareMountTargetPatch = shareMountTargetPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateShareMountTargetOptions) SetHeaders(param map[string]string) *UpdateShareMountTargetOptions { - options.Headers = param - return options -} - -// UpdateShareOptions : The UpdateShare options. -type UpdateShareOptions struct { - // The file share identifier. - ID *string `json:"id" validate:"required,ne="` - - // The file share patch. - SharePatch map[string]interface{} `json:"Share_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateShareOptions : Instantiate UpdateShareOptions -func (*VpcV1) NewUpdateShareOptions(id string, sharePatch map[string]interface{}) *UpdateShareOptions { - return &UpdateShareOptions{ - ID: core.StringPtr(id), - SharePatch: sharePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateShareOptions) SetID(id string) *UpdateShareOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSharePatch : Allow user to set SharePatch -func (_options *UpdateShareOptions) SetSharePatch(sharePatch map[string]interface{}) *UpdateShareOptions { - _options.SharePatch = sharePatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateShareOptions) SetIfMatch(ifMatch string) *UpdateShareOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateShareOptions) SetHeaders(param map[string]string) *UpdateShareOptions { - options.Headers = param - return options -} - -// UpdateSnapshotConsistencyGroupOptions : The UpdateSnapshotConsistencyGroup options. -type UpdateSnapshotConsistencyGroupOptions struct { - // The snapshot consistency group identifier. - ID *string `json:"id" validate:"required,ne="` - - // The snapshot consistency group patch. - SnapshotConsistencyGroupPatch map[string]interface{} `json:"SnapshotConsistencyGroup_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSnapshotConsistencyGroupOptions : Instantiate UpdateSnapshotConsistencyGroupOptions -func (*VpcV1) NewUpdateSnapshotConsistencyGroupOptions(id string, snapshotConsistencyGroupPatch map[string]interface{}) *UpdateSnapshotConsistencyGroupOptions { - return &UpdateSnapshotConsistencyGroupOptions{ - ID: core.StringPtr(id), - SnapshotConsistencyGroupPatch: snapshotConsistencyGroupPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateSnapshotConsistencyGroupOptions) SetID(id string) *UpdateSnapshotConsistencyGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSnapshotConsistencyGroupPatch : Allow user to set SnapshotConsistencyGroupPatch -func (_options *UpdateSnapshotConsistencyGroupOptions) SetSnapshotConsistencyGroupPatch(snapshotConsistencyGroupPatch map[string]interface{}) *UpdateSnapshotConsistencyGroupOptions { - _options.SnapshotConsistencyGroupPatch = snapshotConsistencyGroupPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateSnapshotConsistencyGroupOptions) SetIfMatch(ifMatch string) *UpdateSnapshotConsistencyGroupOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSnapshotConsistencyGroupOptions) SetHeaders(param map[string]string) *UpdateSnapshotConsistencyGroupOptions { - options.Headers = param - return options -} - -// UpdateSnapshotOptions : The UpdateSnapshot options. -type UpdateSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The snapshot patch. - SnapshotPatch map[string]interface{} `json:"Snapshot_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSnapshotOptions : Instantiate UpdateSnapshotOptions -func (*VpcV1) NewUpdateSnapshotOptions(id string, snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - return &UpdateSnapshotOptions{ - ID: core.StringPtr(id), - SnapshotPatch: snapshotPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateSnapshotOptions) SetID(id string) *UpdateSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSnapshotPatch : Allow user to set SnapshotPatch -func (_options *UpdateSnapshotOptions) SetSnapshotPatch(snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - _options.SnapshotPatch = snapshotPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateSnapshotOptions) SetIfMatch(ifMatch string) *UpdateSnapshotOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSnapshotOptions) SetHeaders(param map[string]string) *UpdateSnapshotOptions { - options.Headers = param - return options -} - -// UpdateSubnetOptions : The UpdateSubnet options. -type UpdateSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // The subnet patch. - SubnetPatch map[string]interface{} `json:"Subnet_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSubnetOptions : Instantiate UpdateSubnetOptions -func (*VpcV1) NewUpdateSubnetOptions(id string, subnetPatch map[string]interface{}) *UpdateSubnetOptions { - return &UpdateSubnetOptions{ - ID: core.StringPtr(id), - SubnetPatch: subnetPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateSubnetOptions) SetID(id string) *UpdateSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetSubnetPatch : Allow user to set SubnetPatch -func (_options *UpdateSubnetOptions) SetSubnetPatch(subnetPatch map[string]interface{}) *UpdateSubnetOptions { - _options.SubnetPatch = subnetPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetOptions) SetHeaders(param map[string]string) *UpdateSubnetOptions { - options.Headers = param - return options -} - -// UpdateSubnetReservedIPOptions : The UpdateSubnetReservedIP options. -type UpdateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // The reserved IP patch. - ReservedIPPatch map[string]interface{} `json:"ReservedIP_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateSubnetReservedIPOptions : Instantiate UpdateSubnetReservedIPOptions -func (*VpcV1) NewUpdateSubnetReservedIPOptions(subnetID string, id string, reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - return &UpdateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - ReservedIPPatch: reservedIPPatch, - } -} - -// SetSubnetID : Allow user to set SubnetID -func (_options *UpdateSubnetReservedIPOptions) SetSubnetID(subnetID string) *UpdateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateSubnetReservedIPOptions) SetID(id string) *UpdateSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetReservedIPPatch : Allow user to set ReservedIPPatch -func (_options *UpdateSubnetReservedIPOptions) SetReservedIPPatch(reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - _options.ReservedIPPatch = reservedIPPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string) *UpdateSubnetReservedIPOptions { - options.Headers = param - return options -} - -// UpdateVPCRouteResponse : UpdateVPCRouteResponse struct -type UpdateVPCRouteResponse struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. - // - // If subnets are attached to the route's routing table, egress traffic from those - // subnets in this zone will be subject to this route. If this route's routing table - // has any of `route_direct_link_ingress`, `route_internet_ingress`, - // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic - // from those ingress sources arriving in this zone will be subject to this route. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the UpdateVPCRouteResponse.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - UpdateVPCRouteResponseActionDelegateConst = "delegate" - UpdateVPCRouteResponseActionDelegateVPCConst = "delegate_vpc" - UpdateVPCRouteResponseActionDeliverConst = "deliver" - UpdateVPCRouteResponseActionDropConst = "drop" -) - -// Constants associated with the UpdateVPCRouteResponse.LifecycleState property. -// The lifecycle state of the route. -const ( - UpdateVPCRouteResponseLifecycleStateDeletingConst = "deleting" - UpdateVPCRouteResponseLifecycleStateFailedConst = "failed" - UpdateVPCRouteResponseLifecycleStatePendingConst = "pending" - UpdateVPCRouteResponseLifecycleStateStableConst = "stable" - UpdateVPCRouteResponseLifecycleStateSuspendedConst = "suspended" - UpdateVPCRouteResponseLifecycleStateUpdatingConst = "updating" - UpdateVPCRouteResponseLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the UpdateVPCRouteResponse.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - UpdateVPCRouteResponseOriginServiceConst = "service" - UpdateVPCRouteResponseOriginUserConst = "user" -) - -// UnmarshalUpdateVPCRouteResponse unmarshals an instance of UpdateVPCRouteResponse from the specified map of raw messages. -func UnmarshalUpdateVPCRouteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(UpdateVPCRouteResponse) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// UpdateVirtualNetworkInterfaceOptions : The UpdateVirtualNetworkInterface options. -type UpdateVirtualNetworkInterfaceOptions struct { - // The virtual network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // The virtual network interface patch. - VirtualNetworkInterfacePatch map[string]interface{} `json:"VirtualNetworkInterface_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVirtualNetworkInterfaceOptions : Instantiate UpdateVirtualNetworkInterfaceOptions -func (*VpcV1) NewUpdateVirtualNetworkInterfaceOptions(id string, virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { - return &UpdateVirtualNetworkInterfaceOptions{ - ID: core.StringPtr(id), - VirtualNetworkInterfacePatch: virtualNetworkInterfacePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateVirtualNetworkInterfaceOptions) SetID(id string) *UpdateVirtualNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVirtualNetworkInterfacePatch : Allow user to set VirtualNetworkInterfacePatch -func (_options *UpdateVirtualNetworkInterfaceOptions) SetVirtualNetworkInterfacePatch(virtualNetworkInterfacePatch map[string]interface{}) *UpdateVirtualNetworkInterfaceOptions { - _options.VirtualNetworkInterfacePatch = virtualNetworkInterfacePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateVirtualNetworkInterfaceOptions { - options.Headers = param - return options -} - -// UpdateVolumeOptions : The UpdateVolume options. -type UpdateVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // The volume patch. - VolumePatch map[string]interface{} `json:"Volume_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVolumeOptions : Instantiate UpdateVolumeOptions -func (*VpcV1) NewUpdateVolumeOptions(id string, volumePatch map[string]interface{}) *UpdateVolumeOptions { - return &UpdateVolumeOptions{ - ID: core.StringPtr(id), - VolumePatch: volumePatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateVolumeOptions) SetID(id string) *UpdateVolumeOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVolumePatch : Allow user to set VolumePatch -func (_options *UpdateVolumeOptions) SetVolumePatch(volumePatch map[string]interface{}) *UpdateVolumeOptions { - _options.VolumePatch = volumePatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVolumeOptions) SetIfMatch(ifMatch string) *UpdateVolumeOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVolumeOptions) SetHeaders(param map[string]string) *UpdateVolumeOptions { - options.Headers = param - return options -} - -// UpdateVPCAddressPrefixOptions : The UpdateVPCAddressPrefix options. -type UpdateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` - - // The prefix patch. - AddressPrefixPatch map[string]interface{} `json:"AddressPrefix_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCAddressPrefixOptions : Instantiate UpdateVPCAddressPrefixOptions -func (*VpcV1) NewUpdateVPCAddressPrefixOptions(vpcID string, id string, addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - return &UpdateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - AddressPrefixPatch: addressPrefixPatch, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCAddressPrefixOptions) SetVPCID(vpcID string) *UpdateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCAddressPrefixOptions) SetID(id string) *UpdateVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetAddressPrefixPatch : Allow user to set AddressPrefixPatch -func (_options *UpdateVPCAddressPrefixOptions) SetAddressPrefixPatch(addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - _options.AddressPrefixPatch = addressPrefixPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *UpdateVPCAddressPrefixOptions { - options.Headers = param - return options -} - -// UpdateVPCDnsResolutionBindingOptions : The UpdateVPCDnsResolutionBinding options. -type UpdateVPCDnsResolutionBindingOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The DNS resolution binding identifier. - ID *string `json:"id" validate:"required,ne="` - - // The DNS resolution binding patch. - VpcdnsResolutionBindingPatch map[string]interface{} `json:"VpcdnsResolutionBinding_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCDnsResolutionBindingOptions : Instantiate UpdateVPCDnsResolutionBindingOptions -func (*VpcV1) NewUpdateVPCDnsResolutionBindingOptions(vpcID string, id string, vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { - return &UpdateVPCDnsResolutionBindingOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - VpcdnsResolutionBindingPatch: vpcdnsResolutionBindingPatch, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCDnsResolutionBindingOptions) SetVPCID(vpcID string) *UpdateVPCDnsResolutionBindingOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCDnsResolutionBindingOptions) SetID(id string) *UpdateVPCDnsResolutionBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVpcdnsResolutionBindingPatch : Allow user to set VpcdnsResolutionBindingPatch -func (_options *UpdateVPCDnsResolutionBindingOptions) SetVpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatch map[string]interface{}) *UpdateVPCDnsResolutionBindingOptions { - _options.VpcdnsResolutionBindingPatch = vpcdnsResolutionBindingPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCDnsResolutionBindingOptions) SetHeaders(param map[string]string) *UpdateVPCDnsResolutionBindingOptions { - options.Headers = param - return options -} - -// UpdateVPCOptions : The UpdateVPC options. -type UpdateVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPC patch. - VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCOptions : Instantiate UpdateVPCOptions -func (*VpcV1) NewUpdateVPCOptions(id string, vpcPatch map[string]interface{}) *UpdateVPCOptions { - return &UpdateVPCOptions{ - ID: core.StringPtr(id), - VPCPatch: vpcPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCOptions) SetID(id string) *UpdateVPCOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVPCPatch : Allow user to set VPCPatch -func (_options *UpdateVPCOptions) SetVPCPatch(vpcPatch map[string]interface{}) *UpdateVPCOptions { - _options.VPCPatch = vpcPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPCOptions) SetIfMatch(ifMatch string) *UpdateVPCOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCOptions) SetHeaders(param map[string]string) *UpdateVPCOptions { - options.Headers = param - return options -} - -// UpdateVPCRouteOptions : The UpdateVPCRoute options. -type UpdateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The route identifier. - ID *string `json:"id" validate:"required,ne="` - - // The route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCRouteOptions : Instantiate UpdateVPCRouteOptions -func (*VpcV1) NewUpdateVPCRouteOptions(vpcID string, id string, routePatch map[string]interface{}) *UpdateVPCRouteOptions { - return &UpdateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutePatch: routePatch, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRouteOptions) SetVPCID(vpcID string) *UpdateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCRouteOptions) SetID(id string) *UpdateVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRouteOptions { - _options.RoutePatch = routePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRouteOptions { - options.Headers = param - return options -} - -// UpdateVPCRoutingTableOptions : The UpdateVPCRoutingTable options. -type UpdateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` - - // The routing table patch. - RoutingTablePatch map[string]interface{} `json:"RoutingTable_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCRoutingTableOptions : Instantiate UpdateVPCRoutingTableOptions -func (*VpcV1) NewUpdateVPCRoutingTableOptions(vpcID string, id string, routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - return &UpdateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutingTablePatch: routingTablePatch, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableOptions) SetID(id string) *UpdateVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetRoutingTablePatch : Allow user to set RoutingTablePatch -func (_options *UpdateVPCRoutingTableOptions) SetRoutingTablePatch(routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - _options.RoutingTablePatch = routingTablePatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPCRoutingTableOptions) SetIfMatch(ifMatch string) *UpdateVPCRoutingTableOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableOptions { - options.Headers = param - return options -} - -// UpdateVPCRoutingTableRouteOptions : The UpdateVPCRoutingTableRoute options. -type UpdateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // The VPC routing table route identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPC route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPCRoutingTableRouteOptions : Instantiate UpdateVPCRoutingTableRouteOptions -func (*VpcV1) NewUpdateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string, routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - return &UpdateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), - RoutePatch: routePatch, - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *UpdateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableRouteOptions) SetID(id string) *UpdateVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - _options.RoutePatch = routePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableRouteOptions { - options.Headers = param - return options -} - -// UpdateVPNGatewayConnectionOptions : The UpdateVPNGatewayConnection options. -type UpdateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN gateway connection patch. - VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPNGatewayConnectionOptions : Instantiate UpdateVPNGatewayConnectionOptions -func (*VpcV1) NewUpdateVPNGatewayConnectionOptions(vpnGatewayID string, id string, vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - return &UpdateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - VPNGatewayConnectionPatch: vpnGatewayConnectionPatch, - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayConnectionOptions) SetID(id string) *UpdateVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVPNGatewayConnectionPatch : Allow user to set VPNGatewayConnectionPatch -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch(vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { - options.Headers = param - return options -} - -// UpdateVPNGatewayOptions : The UpdateVPNGateway options. -type UpdateVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN gateway patch. - VPNGatewayPatch map[string]interface{} `json:"VPNGateway_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPNGatewayOptions : Instantiate UpdateVPNGatewayOptions -func (*VpcV1) NewUpdateVPNGatewayOptions(id string, vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - return &UpdateVPNGatewayOptions{ - ID: core.StringPtr(id), - VPNGatewayPatch: vpnGatewayPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayOptions) SetID(id string) *UpdateVPNGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVPNGatewayPatch : Allow user to set VPNGatewayPatch -func (_options *UpdateVPNGatewayOptions) SetVPNGatewayPatch(vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - _options.VPNGatewayPatch = vpnGatewayPatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayOptions { - options.Headers = param - return options -} - -// UpdateVPNServerOptions : The UpdateVPNServer options. -type UpdateVPNServerOptions struct { - // The VPN server identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN server patch. - VPNServerPatch map[string]interface{} `json:"VPNServer_patch" validate:"required"` - - // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. - // Required if the request body includes an array. - IfMatch *string `json:"If-Match,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPNServerOptions : Instantiate UpdateVPNServerOptions -func (*VpcV1) NewUpdateVPNServerOptions(id string, vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { - return &UpdateVPNServerOptions{ - ID: core.StringPtr(id), - VPNServerPatch: vpnServerPatch, - } -} - -// SetID : Allow user to set ID -func (_options *UpdateVPNServerOptions) SetID(id string) *UpdateVPNServerOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVPNServerPatch : Allow user to set VPNServerPatch -func (_options *UpdateVPNServerOptions) SetVPNServerPatch(vpnServerPatch map[string]interface{}) *UpdateVPNServerOptions { - _options.VPNServerPatch = vpnServerPatch - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateVPNServerOptions) SetIfMatch(ifMatch string) *UpdateVPNServerOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNServerOptions) SetHeaders(param map[string]string) *UpdateVPNServerOptions { - options.Headers = param - return options -} - -// UpdateVPNServerRouteOptions : The UpdateVPNServerRoute options. -type UpdateVPNServerRouteOptions struct { - // The VPN server identifier. - VPNServerID *string `json:"vpn_server_id" validate:"required,ne="` - - // The VPN route identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN route patch. - VPNServerRoutePatch map[string]interface{} `json:"VPNServerRoute_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateVPNServerRouteOptions : Instantiate UpdateVPNServerRouteOptions -func (*VpcV1) NewUpdateVPNServerRouteOptions(vpnServerID string, id string, vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { - return &UpdateVPNServerRouteOptions{ - VPNServerID: core.StringPtr(vpnServerID), - ID: core.StringPtr(id), - VPNServerRoutePatch: vpnServerRoutePatch, - } -} - -// SetVPNServerID : Allow user to set VPNServerID -func (_options *UpdateVPNServerRouteOptions) SetVPNServerID(vpnServerID string) *UpdateVPNServerRouteOptions { - _options.VPNServerID = core.StringPtr(vpnServerID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPNServerRouteOptions) SetID(id string) *UpdateVPNServerRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetVPNServerRoutePatch : Allow user to set VPNServerRoutePatch -func (_options *UpdateVPNServerRouteOptions) SetVPNServerRoutePatch(vpnServerRoutePatch map[string]interface{}) *UpdateVPNServerRouteOptions { - _options.VPNServerRoutePatch = vpnServerRoutePatch - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNServerRouteOptions) SetHeaders(param map[string]string) *UpdateVPNServerRouteOptions { - options.Headers = param - return options -} - -// Vcpu : The VCPU configuration. -type Vcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The number of VCPUs assigned. - Count *int64 `json:"count" validate:"required"` - - // The VCPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` -} - -// UnmarshalVcpu unmarshals an instance of Vcpu from the specified map of raw messages. -func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Vcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPC : VPC struct -type VPC struct { - // Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private - // network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected - // in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access" validate:"required"` - - // The date and time that the VPC was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // The CSE ([Cloud Service Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) source IP - // addresses for the VPC. The VPC will have one CSE source IP address per zone. - CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` - - // The default network ACL to use for subnets created in this VPC. - DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` - - // The default routing table to use for subnets created in this VPC. - DefaultRoutingTable *RoutingTableReference `json:"default_routing_table" validate:"required"` - - // The default security group for this VPC. Resources created in this VPC that allow - // a security group to be optionally specified will use this security group by - // default. - DefaultSecurityGroup *SecurityGroupReference `json:"default_security_group" validate:"required"` - - // The DNS configuration for this VPC. - Dns *Vpcdns `json:"dns" validate:"required"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPCHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // The resource group for this VPC. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of this VPC. - Status *string `json:"status" validate:"required"` -} - -// Constants associated with the VPC.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPCHealthStateDegradedConst = "degraded" - VPCHealthStateFaultedConst = "faulted" - VPCHealthStateInapplicableConst = "inapplicable" - VPCHealthStateOkConst = "ok" -) - -// Constants associated with the VPC.ResourceType property. -// The resource type. -const ( - VPCResourceTypeVPCConst = "vpc" -) - -// Constants associated with the VPC.Status property. -// The status of this VPC. -const ( - VPCStatusAvailableConst = "available" - VPCStatusDeletingConst = "deleting" - VPCStatusFailedConst = "failed" - VPCStatusPendingConst = "pending" -) - -// UnmarshalVPC unmarshals an instance of VPC from the specified map of raw messages. -func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPC) - err = core.UnmarshalPrimitive(m, "classic_access", &obj.ClassicAccess) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "cse_source_ips", &obj.CseSourceIps, UnmarshalVpccseSourceIP) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_network_acl", &obj.DefaultNetworkACL, UnmarshalNetworkACLReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_routing_table", &obj.DefaultRoutingTable, UnmarshalRoutingTableReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_security_group", &obj.DefaultSecurityGroup, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdns) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPCHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpccseSourceIP : VpccseSourceIP struct -type VpccseSourceIP struct { - // The cloud service endpoint source IP address for this zone. - IP *IP `json:"ip" validate:"required"` - - // The zone this cloud service endpoint source IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalVpccseSourceIP unmarshals an instance of VpccseSourceIP from the specified map of raw messages. -func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpccseSourceIP) - err = core.UnmarshalModel(m, "ip", &obj.IP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCCollection : VPCCollection struct -type VPCCollection struct { - // A link to the first page of resources. - First *VPCCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPCCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of VPCs. - Vpcs []VPC `json:"vpcs" validate:"required"` -} - -// UnmarshalVPCCollection unmarshals an instance of VPCCollection from the specified map of raw messages. -func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPCCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPCCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpcs", &obj.Vpcs, UnmarshalVPC) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPCCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPCCollectionFirst : A link to the first page of resources. -type VPCCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPCCollectionFirst unmarshals an instance of VPCCollectionFirst from the specified map of raw messages. -func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPCCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPCCollectionNext unmarshals an instance of VPCCollectionNext from the specified map of raw messages. -func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Vpcdns : The DNS configuration for this VPC. -type Vpcdns struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - EnableHub *bool `json:"enable_hub" validate:"required"` - - // The number of DNS resolution bindings for this VPC. - ResolutionBindingCount *int64 `json:"resolution_binding_count" validate:"required"` - - // The DNS resolver configuration for the VPC. - Resolver VpcdnsResolverIntf `json:"resolver" validate:"required"` -} - -// UnmarshalVpcdns unmarshals an instance of Vpcdns from the specified map of raw messages. -func UnmarshalVpcdns(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Vpcdns) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resolution_binding_count", &obj.ResolutionBindingCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolver) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsPatch : The DNS configuration for this VPC. -type VpcdnsPatch struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - // - // Updating the value to `true` requires `allow_dns_resolution_binding` to be `true` for all endpoint gateways residing - // in this VPC. - // - // Changing the value requires `dns.resolution_binding_count` to be zero. - EnableHub *bool `json:"enable_hub,omitempty"` - - Resolver *VpcdnsResolverPatch `json:"resolver,omitempty"` -} - -// UnmarshalVpcdnsPatch unmarshals an instance of VpcdnsPatch from the specified map of raw messages. -func UnmarshalVpcdnsPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsPatch) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsPrototype : The DNS configuration for this VPC. -// -// If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint gateways within this VPC, -// and hosts on the internet. -type VpcdnsPrototype struct { - // Indicates whether this VPC is enabled as a DNS name resolution hub. - EnableHub *bool `json:"enable_hub,omitempty"` - - Resolver VpcdnsResolverPrototypeIntf `json:"resolver,omitempty"` -} - -// UnmarshalVpcdnsPrototype unmarshals an instance of VpcdnsPrototype from the specified map of raw messages. -func UnmarshalVpcdnsPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsPrototype) - err = core.UnmarshalPrimitive(m, "enable_hub", &obj.EnableHub) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resolver", &obj.Resolver, UnmarshalVpcdnsResolverPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolutionBinding : VpcdnsResolutionBinding struct -type VpcdnsResolutionBinding struct { - // The date and time that the DNS resolution binding was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The endpoint gateways that have `allow_dns_resolution_binding` set to `true` and reside in the VPC that has - // `dns.enable_hub` set to `false`. - // - // The endpoint gateways may be remote and therefore may not be directly retrievable. - EndpointGateways []EndpointGatewayReferenceRemote `json:"endpoint_gateways" validate:"required"` - - // The URL for this DNS resolution binding. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this DNS resolution binding. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the DNS resolution binding. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this DNS resolution binding. The name is unique across all DNS resolution bindings for the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The VPC bound to for DNS resolution. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceRemote `json:"vpc" validate:"required"` -} - -// Constants associated with the VpcdnsResolutionBinding.LifecycleState property. -// The lifecycle state of the DNS resolution binding. -const ( - VpcdnsResolutionBindingLifecycleStateDeletingConst = "deleting" - VpcdnsResolutionBindingLifecycleStateFailedConst = "failed" - VpcdnsResolutionBindingLifecycleStatePendingConst = "pending" - VpcdnsResolutionBindingLifecycleStateStableConst = "stable" - VpcdnsResolutionBindingLifecycleStateSuspendedConst = "suspended" - VpcdnsResolutionBindingLifecycleStateUpdatingConst = "updating" - VpcdnsResolutionBindingLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VpcdnsResolutionBinding.ResourceType property. -// The resource type. -const ( - VpcdnsResolutionBindingResourceTypeVPCDnsResolutionBindingConst = "vpc_dns_resolution_binding" -) - -// UnmarshalVpcdnsResolutionBinding unmarshals an instance of VpcdnsResolutionBinding from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBinding(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBinding) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGatewayReferenceRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceRemote) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolutionBindingCollection : VpcdnsResolutionBindingCollection struct -type VpcdnsResolutionBindingCollection struct { - // Collection of DNS resolution bindings for this VPC. - DnsResolutionBindings []VpcdnsResolutionBinding `json:"dns_resolution_bindings" validate:"required"` - - // A link to the first page of resources. - First *VpcdnsResolutionBindingCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VpcdnsResolutionBindingCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalVpcdnsResolutionBindingCollection unmarshals an instance of VpcdnsResolutionBindingCollection from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollection) - err = core.UnmarshalModel(m, "dns_resolution_bindings", &obj.DnsResolutionBindings, UnmarshalVpcdnsResolutionBinding) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVpcdnsResolutionBindingCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVpcdnsResolutionBindingCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VpcdnsResolutionBindingCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VpcdnsResolutionBindingPatch : VpcdnsResolutionBindingPatch struct -type VpcdnsResolutionBindingPatch struct { - // The name for this DNS resolution binding. The name must not be used by another DNS resolution binding for the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVpcdnsResolutionBindingPatch unmarshals an instance of VpcdnsResolutionBindingPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VpcdnsResolutionBindingPatch -func (vpcdnsResolutionBindingPatch *VpcdnsResolutionBindingPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpcdnsResolutionBindingPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VpcdnsResolver : VpcdnsResolver struct -// Models which "extend" this model: -// - VpcdnsResolverTypeDelegated -// - VpcdnsResolverTypeManual -// - VpcdnsResolverTypeSystem -type VpcdnsResolver struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The type of the DNS resolver used for the VPC. - // - // - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC - // specified in `dns.resolver.vpc`. - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses are provided by the system. - Type *string `json:"type" validate:"required"` - - // The VPC whose DNS resolver provides the DNS server addresses for this VPC. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceDnsResolverContext `json:"vpc,omitempty"` - - // The manually specified DNS servers for this VPC. - // - // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the - // affinity for that zone first, followed by the unique DNS servers from other zones. - // - // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServer `json:"manual_servers,omitempty"` - - // The configuration of the system DNS resolver for this VPC. - // - // - `custom_resolver`: A custom DNS resolver is configured for this VPC. - // - // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when - // the VPC has either or both of the following: - // - // - at least one endpoint gateway residing in it - // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it - // - // - `default`: The provider default DNS resolvers are configured for this VPC. - // - // This system DNS resolver configuration is used when the VPC has: - // - // - no custom DNS resolver configured for it, and - // - no endpoint gateways residing in it, and - // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. - Configuration *string `json:"configuration,omitempty"` -} - -// Constants associated with the VpcdnsResolver.Type property. -// The type of the DNS resolver used for the VPC. -// -// - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC -// specified in `dns.resolver.vpc`. -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses are provided by the system. -const ( - VpcdnsResolverTypeDelegatedConst = "delegated" - VpcdnsResolverTypeManualConst = "manual" - VpcdnsResolverTypeSystemConst = "system" -) - -// Constants associated with the VpcdnsResolver.Configuration property. -// The configuration of the system DNS resolver for this VPC. -// -// - `custom_resolver`: A custom DNS resolver is configured for this VPC. -// -// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when -// the VPC has either or both of the following: -// -// - at least one endpoint gateway residing in it -// -// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it -// -// - `default`: The provider default DNS resolvers are configured for this VPC. -// -// This system DNS resolver configuration is used when the VPC has: -// -// - no custom DNS resolver configured for it, and -// - no endpoint gateways residing in it, and -// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. -const ( - VpcdnsResolverConfigurationCustomResolverConst = "custom_resolver" - VpcdnsResolverConfigurationDefaultConst = "default" - VpcdnsResolverConfigurationPrivateResolverConst = "private_resolver" -) - -func (*VpcdnsResolver) isaVpcdnsResolver() bool { - return true -} - -type VpcdnsResolverIntf interface { - isaVpcdnsResolver() bool -} - -// UnmarshalVpcdnsResolver unmarshals an instance of VpcdnsResolver from the specified map of raw messages. -func UnmarshalVpcdnsResolver(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolver) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPatch : VpcdnsResolverPatch struct -type VpcdnsResolverPatch struct { - // The DNS servers to use for this VPC, replacing any existing servers. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. - // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. - // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - // - // `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is `manual`. - ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` - - // The type of the DNS resolver to use. - // - // - `delegated`: DNS server addresses will be provided by the resolver for the VPC - // specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be - // `false`. - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses will be provided by the system and depend on the - // configuration. - // - // Updating from `manual` requires `dns.resolver.manual_servers` to be specified as - // `null`. - // - // Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. - // - // Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. - Type *string `json:"type,omitempty"` - - // The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured - // with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in - // one of this VPC's DNS resolution bindings. - // - // Specify `null` to remove an existing VPC. - // - // This property must be set if and only if `dns.resolver.type` is `delegated`. - VPC VpcdnsResolverVPCPatchIntf `json:"vpc,omitempty"` -} - -// Constants associated with the VpcdnsResolverPatch.Type property. -// The type of the DNS resolver to use. -// -// - `delegated`: DNS server addresses will be provided by the resolver for the VPC -// specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be -// `false`. -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses will be provided by the system and depend on the -// configuration. -// -// Updating from `manual` requires `dns.resolver.manual_servers` to be specified as -// `null`. -// -// Updating to `manual` requires `dns.resolver.manual_servers` to be specified and not empty. -// -// Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`. -const ( - VpcdnsResolverPatchTypeDelegatedConst = "delegated" - VpcdnsResolverPatchTypeManualConst = "manual" - VpcdnsResolverPatchTypeSystemConst = "system" -) - -// UnmarshalVpcdnsResolverPatch unmarshals an instance of VpcdnsResolverPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolverPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPatch) - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVpcdnsResolverVPCPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPrototype : VpcdnsResolverPrototype struct -// Models which "extend" this model: -// - VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype -// - VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype -type VpcdnsResolverPrototype struct { - // The type of the DNS resolver to use. - // - // - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. - // - `system`: DNS server addresses will be provided by the system and depend on the - // configuration. - Type *string `json:"type,omitempty"` - - // The DNS servers to use for this VPC. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. - // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. - // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServerPrototype `json:"manual_servers,omitempty"` -} - -// Constants associated with the VpcdnsResolverPrototype.Type property. -// The type of the DNS resolver to use. -// -// - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`. -// - `system`: DNS server addresses will be provided by the system and depend on the -// configuration. -const ( - VpcdnsResolverPrototypeTypeManualConst = "manual" - VpcdnsResolverPrototypeTypeSystemConst = "system" -) - -func (*VpcdnsResolverPrototype) isaVpcdnsResolverPrototype() bool { - return true -} - -type VpcdnsResolverPrototypeIntf interface { - isaVpcdnsResolverPrototype() bool -} - -// UnmarshalVpcdnsResolverPrototype unmarshals an instance of VpcdnsResolverPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototype) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatch : The VPC to provide DNS server addresses for this VPC. The specified VPC must be configured with a [DNS -// Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and must be in one of this VPC's DNS resolution -// bindings. -// -// Specify `null` to remove an existing VPC. -// -// This property must be set if and only if `dns.resolver.type` is `delegated`. -// Models which "extend" this model: -// - VpcdnsResolverVPCPatchVPCIdentityByID -// - VpcdnsResolverVPCPatchVPCIdentityByCRN -// - VpcdnsResolverVPCPatchVPCIdentityByHref -type VpcdnsResolverVPCPatch struct { - // The unique identifier for this VPC. - ID *string `json:"id,omitempty"` - - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} - -func (*VpcdnsResolverVPCPatch) isaVpcdnsResolverVPCPatch() bool { - return true -} - -type VpcdnsResolverVPCPatchIntf interface { - isaVpcdnsResolverVPCPatch() bool -} - -// UnmarshalVpcdnsResolverVPCPatch unmarshals an instance of VpcdnsResolverVPCPatch from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCHealthReason : VPCHealthReason struct -type VPCHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPCHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPCHealthReasonCodeDnsResolutionBindingFailedConst = "dns_resolution_binding_failed" - VPCHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPCHealthReason unmarshals an instance of VPCHealthReason from the specified map of raw messages. -func UnmarshalVPCHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCIdentity : Identifies a VPC by a unique property. -// Models which "extend" this model: -// - VPCIdentityByID -// - VPCIdentityByCRN -// - VPCIdentityByHref -type VPCIdentity struct { - // The unique identifier for this VPC. - ID *string `json:"id,omitempty"` - - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} - -func (*VPCIdentity) isaVPCIdentity() bool { - return true -} - -type VPCIdentityIntf interface { - isaVPCIdentity() bool -} - -// UnmarshalVPCIdentity unmarshals an instance of VPCIdentity from the specified map of raw messages. -func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCPatch : VPCPatch struct -type VPCPatch struct { - // The DNS configuration for this VPC. - Dns *VpcdnsPatch `json:"dns,omitempty"` - - // The name for this VPC. The name must not be used by another VPC in the region. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVPCPatch unmarshals an instance of VPCPatch from the specified map of raw messages. -func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCPatch) - err = core.UnmarshalModel(m, "dns", &obj.Dns, UnmarshalVpcdnsPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPCPatch -func (vpcPatch *VPCPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpcPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPCReference : VPCReference struct -type VPCReference struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VPCReference.ResourceType property. -// The resource type. -const ( - VPCReferenceResourceTypeVPCConst = "vpc" -) - -// UnmarshalVPCReference unmarshals an instance of VPCReference from the specified map of raw messages. -func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCReferenceDnsResolverContext : A VPC whose DNS resolver is delegated to provide DNS servers for this VPC. -// -// The VPC may be remote and therefore may not be directly retrievable. -type VPCReferenceDnsResolverContext struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDnsResolverContextDeleted `json:"deleted,omitempty"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VPCRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VPCReferenceDnsResolverContext.ResourceType property. -// The resource type. -const ( - VPCReferenceDnsResolverContextResourceTypeVPCConst = "vpc" -) - -// UnmarshalVPCReferenceDnsResolverContext unmarshals an instance of VPCReferenceDnsResolverContext from the specified map of raw messages. -func UnmarshalVPCReferenceDnsResolverContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDnsResolverContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDnsResolverContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPCReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPCReferenceDeleted unmarshals an instance of VPCReferenceDeleted from the specified map of raw messages. -func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCReferenceDnsResolverContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPCReferenceDnsResolverContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPCReferenceDnsResolverContextDeleted unmarshals an instance of VPCReferenceDnsResolverContextDeleted from the specified map of raw messages. -func UnmarshalVPCReferenceDnsResolverContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDnsResolverContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCReferenceRemote : VPCReferenceRemote struct -type VPCReferenceRemote struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VPCRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VPCReferenceRemote.ResourceType property. -// The resource type. -const ( - VPCReferenceRemoteResourceTypeVPCConst = "vpc" -) - -// UnmarshalVPCReferenceRemote unmarshals an instance of VPCReferenceRemote from the specified map of raw messages. -func UnmarshalVPCReferenceRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceRemote) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVPCRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type VPCRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // account, and identifies the owning account. - Account *AccountReference `json:"account,omitempty"` - - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalVPCRemote unmarshals an instance of VPCRemote from the specified map of raw messages. -func UnmarshalVPCRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCRemote) - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGateway : VPNGateway struct -// Models which "extend" this model: -// - VPNGatewayRouteMode -// - VPNGatewayPolicyMode -type VPNGateway struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGateway.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayHealthStateDegradedConst = "degraded" - VPNGatewayHealthStateFaultedConst = "faulted" - VPNGatewayHealthStateInapplicableConst = "inapplicable" - VPNGatewayHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGateway.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayLifecycleStateDeletingConst = "deleting" - VPNGatewayLifecycleStateFailedConst = "failed" - VPNGatewayLifecycleStatePendingConst = "pending" - VPNGatewayLifecycleStateStableConst = "stable" - VPNGatewayLifecycleStateSuspendedConst = "suspended" - VPNGatewayLifecycleStateUpdatingConst = "updating" - VPNGatewayLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGateway.ResourceType property. -// The resource type. -const ( - VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" -) - -// Constants associated with the VPNGateway.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayModeRouteConst = "route" -) - -func (*VPNGateway) isaVPNGateway() bool { - return true -} - -type VPNGatewayIntf interface { - isaVPNGateway() bool -} - -// UnmarshalVPNGateway unmarshals an instance of VPNGateway from the specified map of raw messages. -func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGateway) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayCollection : VPNGatewayCollection struct -type VPNGatewayCollection struct { - // A link to the first page of resources. - First *VPNGatewayCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNGatewayCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of VPN gateways. - VPNGateways []VPNGatewayIntf `json:"vpn_gateways" validate:"required"` -} - -// UnmarshalVPNGatewayCollection unmarshals an instance of VPNGatewayCollection from the specified map of raw messages. -func UnmarshalVPNGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNGatewayCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNGatewayCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpn_gateways", &obj.VPNGateways, UnmarshalVPNGateway) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNGatewayCollectionFirst : A link to the first page of resources. -type VPNGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNGatewayCollectionFirst unmarshals an instance of VPNGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNGatewayCollectionNext unmarshals an instance of VPNGatewayCollectionNext from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnection : VPNGatewayConnection struct -// Models which "extend" this model: -// - VPNGatewayConnectionStaticRouteMode -// - VPNGatewayConnectionPolicyMode -type VPNGatewayConnection struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` - - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` - - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` - - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` - - // The VPN tunnel configuration for this VPN gateway connection (in static route mode). - Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels,omitempty"` - - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` - - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} - -// Constants associated with the VPNGatewayConnection.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionAuthenticationModePskConst = "psk" -) - -// Constants associated with the VPNGatewayConnection.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionModePolicyConst = "policy" - VPNGatewayConnectionModeRouteConst = "route" -) - -// Constants associated with the VPNGatewayConnection.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// Constants associated with the VPNGatewayConnection.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionStatusDownConst = "down" - VPNGatewayConnectionStatusUpConst = "up" -) - -// Constants associated with the VPNGatewayConnection.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionRoutingProtocolNoneConst = "none" -) - -func (*VPNGatewayConnection) isaVPNGatewayConnection() bool { - return true -} - -type VPNGatewayConnectionIntf interface { - isaVPNGatewayConnection() bool -} - -// UnmarshalVPNGatewayConnection unmarshals an instance of VPNGatewayConnection from the specified map of raw messages. -func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnection) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionCollection : Collection of VPN gateway connections in a VPN gateway. -type VPNGatewayConnectionCollection struct { - // Array of VPN gateway connections. - Connections []VPNGatewayConnectionIntf `json:"connections" validate:"required"` -} - -// UnmarshalVPNGatewayConnectionCollection unmarshals an instance of VPNGatewayConnectionCollection from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionCollection) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionDpd : The Dead Peer Detection settings. -type VPNGatewayConnectionDpd struct { - // Dead Peer Detection actions. - Action *string `json:"action" validate:"required"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval" validate:"required"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionDpd.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdActionClearConst = "clear" - VPNGatewayConnectionDpdActionHoldConst = "hold" - VPNGatewayConnectionDpdActionNoneConst = "none" - VPNGatewayConnectionDpdActionRestartConst = "restart" -) - -// UnmarshalVPNGatewayConnectionDpd unmarshals an instance of VPNGatewayConnectionDpd from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpd) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionDpdPatch : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPatch struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionDpdPatch.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPatchActionClearConst = "clear" - VPNGatewayConnectionDpdPatchActionHoldConst = "hold" - VPNGatewayConnectionDpdPatchActionNoneConst = "none" - VPNGatewayConnectionDpdPatchActionRestartConst = "restart" -) - -// UnmarshalVPNGatewayConnectionDpdPatch unmarshals an instance of VPNGatewayConnectionDpdPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionDpdPrototype : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPrototype struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionDpdPrototype.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPrototypeActionClearConst = "clear" - VPNGatewayConnectionDpdPrototypeActionHoldConst = "hold" - VPNGatewayConnectionDpdPrototypeActionNoneConst = "none" - VPNGatewayConnectionDpdPrototypeActionRestartConst = "restart" -) - -// UnmarshalVPNGatewayConnectionDpdPrototype unmarshals an instance of VPNGatewayConnectionDpdPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPatch : The IKE policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). -// Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPatch struct { - // The unique identifier for this IKE policy. - ID *string `json:"id,omitempty"` - - // The IKE policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIkePolicyPatch) isaVPNGatewayConnectionIkePolicyPatch() bool { - return true -} - -type VPNGatewayConnectionIkePolicyPatchIntf interface { - isaVPNGatewayConnectionIkePolicyPatch() bool -} - -// UnmarshalVPNGatewayConnectionIkePolicyPatch unmarshals an instance of VPNGatewayConnectionIkePolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPrototype : The IKE policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). -// Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPrototype struct { - // The unique identifier for this IKE policy. - ID *string `json:"id,omitempty"` - - // The IKE policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIkePolicyPrototype) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} - -type VPNGatewayConnectionIkePolicyPrototypeIntf interface { - isaVPNGatewayConnectionIkePolicyPrototype() bool -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototype unmarshals an instance of VPNGatewayConnectionIkePolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatch : The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPatch struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIPsecPolicyPatch) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -type VPNGatewayConnectionIPsecPolicyPatchIntf interface { - isaVPNGatewayConnectionIPsecPolicyPatch() bool -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatch unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototype : The IPsec policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPrototype struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*VPNGatewayConnectionIPsecPolicyPrototype) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -type VPNGatewayConnectionIPsecPolicyPrototypeIntf interface { - isaVPNGatewayConnectionIPsecPolicyPrototype() bool -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototype unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionLocalCIDRs : VPNGatewayConnectionLocalCIDRs struct -type VPNGatewayConnectionLocalCIDRs struct { - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` -} - -// UnmarshalVPNGatewayConnectionLocalCIDRs unmarshals an instance of VPNGatewayConnectionLocalCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionLocalCIDRs) - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct -type VPNGatewayConnectionPatch struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` - - // The IKE policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` - - // The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address,omitempty"` - - // The pre-shared key. - Psk *string `json:"psk,omitempty"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" -) - -// UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPatch) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNGatewayConnectionPatch -func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayConnectionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNGatewayConnectionPeerCIDRs : VPNGatewayConnectionPeerCIDRs struct -type VPNGatewayConnectionPeerCIDRs struct { - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} - -// UnmarshalVPNGatewayConnectionPeerCIDRs unmarshals an instance of VPNGatewayConnectionPeerCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerCIDRs) - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct -// Models which "extend" this model: -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype -type VPNGatewayConnectionPrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - // The IKE policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - - // The IPsec policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` - - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` - - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionPrototype.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPrototypeRoutingProtocolNoneConst = "none" -) - -func (*VPNGatewayConnectionPrototype) isaVPNGatewayConnectionPrototype() bool { - return true -} - -type VPNGatewayConnectionPrototypeIntf interface { - isaVPNGatewayConnectionPrototype() bool -} - -// UnmarshalVPNGatewayConnectionPrototype unmarshals an instance of VPNGatewayConnectionPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionReference : VPNGatewayConnectionReference struct -type VPNGatewayConnectionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionReference.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// UnmarshalVPNGatewayConnectionReference unmarshals an instance of VPNGatewayConnectionReference from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNGatewayConnectionReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPNGatewayConnectionReferenceDeleted unmarshals an instance of VPNGatewayConnectionReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionStaticRouteModeTunnel : VPNGatewayConnectionStaticRouteModeTunnel struct -type VPNGatewayConnectionStaticRouteModeTunnel struct { - // The IP address of the VPN gateway member in which the tunnel resides. - PublicIP *IP `json:"public_ip" validate:"required"` - - // The status of the VPN Tunnel. - Status *string `json:"status" validate:"required"` - - // The reasons for the current VPN gateway connection tunnels status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. -// The status of the VPN Tunnel. -const ( - VPNGatewayConnectionStaticRouteModeTunnelStatusDownConst = "down" - VPNGatewayConnectionStaticRouteModeTunnelStatusUpConst = "up" -) - -// UnmarshalVPNGatewayConnectionStaticRouteModeTunnel unmarshals an instance of VPNGatewayConnectionStaticRouteModeTunnel from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStaticRouteModeTunnel) - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionStatusReason : VPNGatewayConnectionStatusReason struct -type VPNGatewayConnectionStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this VPN gateway connection's status. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - VPNGatewayConnectionStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" - VPNGatewayConnectionStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" - VPNGatewayConnectionStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" - VPNGatewayConnectionStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" - VPNGatewayConnectionStatusReasonCodeInternalErrorConst = "internal_error" - VPNGatewayConnectionStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" - VPNGatewayConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" -) - -// UnmarshalVPNGatewayConnectionStatusReason unmarshals an instance of VPNGatewayConnectionStatusReason from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct -type VPNGatewayConnectionTunnelStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this VPN gateway connection tunnel's status. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionTunnelStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - VPNGatewayConnectionTunnelStatusReasonCodeCannotAuthenticateConnectionConst = "cannot_authenticate_connection" - VPNGatewayConnectionTunnelStatusReasonCodeIkePolicyMismatchConst = "ike_policy_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeIkeV1IDLocalRemoteCIDRMismatchConst = "ike_v1_id_local_remote_cidr_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeIkeV2LocalRemoteCIDRMismatchConst = "ike_v2_local_remote_cidr_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodeInternalErrorConst = "internal_error" - VPNGatewayConnectionTunnelStatusReasonCodeIpsecPolicyMismatchConst = "ipsec_policy_mismatch" - VPNGatewayConnectionTunnelStatusReasonCodePeerNotRespondingConst = "peer_not_responding" -) - -// UnmarshalVPNGatewayConnectionTunnelStatusReason unmarshals an instance of VPNGatewayConnectionTunnelStatusReason from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionTunnelStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionTunnelStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayHealthReason : VPNGatewayHealthReason struct -type VPNGatewayHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPNGatewayHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" - VPNGatewayHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNGatewayHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPNGatewayHealthReason unmarshals an instance of VPNGatewayHealthReason from the specified map of raw messages. -func UnmarshalVPNGatewayHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayLifecycleReason : VPNGatewayLifecycleReason struct -type VPNGatewayLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - VPNGatewayLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalVPNGatewayLifecycleReason unmarshals an instance of VPNGatewayLifecycleReason from the specified map of raw messages. -func UnmarshalVPNGatewayLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayMember : VPNGatewayMember struct -type VPNGatewayMember struct { - // The reasons for the current VPN gateway member health_state (if any): - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayMemberHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The reasons for the current VPN gateway member lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayMemberLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway member. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The reserved IP address assigned to the VPN gateway member. - // - // This property will be present only when the VPN gateway status is `available`. - PrivateIP *ReservedIPReference `json:"private_ip" validate:"required"` - - // The public IP address assigned to the VPN gateway member. - PublicIP *IP `json:"public_ip" validate:"required"` - - // The high availability role assigned to the VPN gateway member. - Role *string `json:"role" validate:"required"` -} - -// Constants associated with the VPNGatewayMember.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayMemberHealthStateDegradedConst = "degraded" - VPNGatewayMemberHealthStateFaultedConst = "faulted" - VPNGatewayMemberHealthStateInapplicableConst = "inapplicable" - VPNGatewayMemberHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGatewayMember.LifecycleState property. -// The lifecycle state of the VPN gateway member. -const ( - VPNGatewayMemberLifecycleStateDeletingConst = "deleting" - VPNGatewayMemberLifecycleStateFailedConst = "failed" - VPNGatewayMemberLifecycleStatePendingConst = "pending" - VPNGatewayMemberLifecycleStateStableConst = "stable" - VPNGatewayMemberLifecycleStateSuspendedConst = "suspended" - VPNGatewayMemberLifecycleStateUpdatingConst = "updating" - VPNGatewayMemberLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGatewayMember.Role property. -// The high availability role assigned to the VPN gateway member. -const ( - VPNGatewayMemberRoleActiveConst = "active" - VPNGatewayMemberRoleStandbyConst = "standby" -) - -// UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. -func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMember) - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayMemberHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayMemberLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "role", &obj.Role) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayMemberHealthReason : VPNGatewayMemberHealthReason struct -type VPNGatewayMemberHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayMemberHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPNGatewayMemberHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNGatewayMemberHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPNGatewayMemberHealthReason unmarshals an instance of VPNGatewayMemberHealthReason from the specified map of raw messages. -func UnmarshalVPNGatewayMemberHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMemberHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayMemberLifecycleReason : VPNGatewayMemberLifecycleReason struct -type VPNGatewayMemberLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNGatewayMemberLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - VPNGatewayMemberLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalVPNGatewayMemberLifecycleReason unmarshals an instance of VPNGatewayMemberLifecycleReason from the specified map of raw messages. -func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMemberLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPatch : VPNGatewayPatch struct -type VPNGatewayPatch struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. -func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNGatewayPatch -func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNGatewayPrototype : VPNGatewayPrototype struct -// Models which "extend" this model: -// - VPNGatewayPrototypeVPNGatewayRouteModePrototype -// - VPNGatewayPrototypeVPNGatewayPolicyModePrototype -type VPNGatewayPrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Identifies a subnet by a unique property. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototype.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayPrototypeModeRouteConst = "route" -) - -func (*VPNGatewayPrototype) isaVPNGatewayPrototype() bool { - return true -} - -type VPNGatewayPrototypeIntf interface { - isaVPNGatewayPrototype() bool -} - -// UnmarshalVPNGatewayPrototype unmarshals an instance of VPNGatewayPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPNGatewayReferenceDeleted unmarshals an instance of VPNGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServer : VPNServer struct -type VPNServer struct { - // The certificate instance for this VPN server. - Certificate *CertificateInstanceReference `json:"certificate" validate:"required"` - - // The methods used to authenticate VPN clients to this VPN server. VPN clients must authenticate against all specified - // methods. - ClientAuthentication []VPNServerAuthenticationIntf `json:"client_authentication" validate:"required"` - - // Indicates whether disconnected VPN clients will be automatically deleted after - // `client_auto_delete_timeout` hours have passed. At present, this is always `true`, but may be modifiable in the - // future. - ClientAutoDelete *bool `json:"client_auto_delete" validate:"required"` - - // If `client_auto_delete` is `true`, the hours after which disconnected VPN clients will be automatically deleted. If - // the value is `0`, disconnected VPN clients will be deleted immediately. This value may be modifiable in the future. - ClientAutoDeleteTimeout *int64 `json:"client_auto_delete_timeout" validate:"required"` - - // The DNS server addresses that will be provided to VPN clients that are connected to this VPN server. - ClientDnsServerIps []IP `json:"client_dns_server_ips" validate:"required"` - - // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not - // disconnect idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout" validate:"required"` - - // The VPN client IPv4 address pool, expressed in CIDR format. - ClientIPPool *string `json:"client_ip_pool" validate:"required"` - - // The date and time that the VPN server was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling" validate:"required"` - - // The reasons for the current VPN server health_state (if any): - // - `cannot_access_client_certificate`: VPN server's client certificate is inaccessible - // (verify certificate exists and that IAM policies grant `VPN server for VPC` access - // to `Secrets Manager`) - // - `cannot_access_server_certificate`: VPN server's server certificate is inaccessible - // (verify certificate exists and that IAM policies grant `VPN server for VPC` access - // to `Secrets Manager`) - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNServerHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // Fully qualified domain name assigned to this VPN server. - Hostname *string `json:"hostname" validate:"required"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN server lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNServerLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN server. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The port number used by this VPN server. - Port *int64 `json:"port" validate:"required"` - - // The reserved IPs bound to this VPN server. - PrivateIps []ReservedIPReference `json:"private_ips" validate:"required"` - - // The transport protocol used by this VPN server. - Protocol *string `json:"protocol" validate:"required"` - - // The resource group for this VPN server. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this VPN server. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The subnets this VPN server is provisioned in. - Subnets []SubnetReference `json:"subnets" validate:"required"` - - // The VPC this VPN server resides in. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// Constants associated with the VPNServer.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNServerHealthStateDegradedConst = "degraded" - VPNServerHealthStateFaultedConst = "faulted" - VPNServerHealthStateInapplicableConst = "inapplicable" - VPNServerHealthStateOkConst = "ok" -) - -// Constants associated with the VPNServer.LifecycleState property. -// The lifecycle state of the VPN server. -const ( - VPNServerLifecycleStateDeletingConst = "deleting" - VPNServerLifecycleStateFailedConst = "failed" - VPNServerLifecycleStatePendingConst = "pending" - VPNServerLifecycleStateStableConst = "stable" - VPNServerLifecycleStateSuspendedConst = "suspended" - VPNServerLifecycleStateUpdatingConst = "updating" - VPNServerLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNServer.Protocol property. -// The transport protocol used by this VPN server. -const ( - VPNServerProtocolTCPConst = "tcp" - VPNServerProtocolUDPConst = "udp" -) - -// Constants associated with the VPNServer.ResourceType property. -// The resource type. -const ( - VPNServerResourceTypeVPNServerConst = "vpn_server" -) - -// UnmarshalVPNServer unmarshals an instance of VPNServer from the specified map of raw messages. -func UnmarshalVPNServer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServer) - err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthentication) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_auto_delete", &obj.ClientAutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_auto_delete_timeout", &obj.ClientAutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthentication : An authentication method for this VPN server. -// Models which "extend" this model: -// - VPNServerAuthenticationByUsername -// - VPNServerAuthenticationByCertificate -type VPNServerAuthentication struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` - - // The certificate instance used for the VPN client certificate authority (CA). - ClientCa *CertificateInstanceReference `json:"client_ca,omitempty"` - - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` -} - -// Constants associated with the VPNServerAuthentication.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationMethodCertificateConst = "certificate" - VPNServerAuthenticationMethodUsernameConst = "username" -) - -func (*VPNServerAuthentication) isaVPNServerAuthentication() bool { - return true -} - -type VPNServerAuthenticationIntf interface { - isaVPNServerAuthentication() bool -} - -// UnmarshalVPNServerAuthentication unmarshals an instance of VPNServerAuthentication from the specified map of raw messages. -func UnmarshalVPNServerAuthentication(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthentication) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationByUsernameIDProvider : The type of identity provider to be used by VPN client. -// Models which "extend" this model: -// - VPNServerAuthenticationByUsernameIDProviderByIam -type VPNServerAuthenticationByUsernameIDProvider struct { - // The type of identity provider to be used by the VPN client. - // - `iam`: IBM identity and access management - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - ProviderType *string `json:"provider_type,omitempty"` -} - -// Constants associated with the VPNServerAuthenticationByUsernameIDProvider.ProviderType property. -// The type of identity provider to be used by the VPN client. -// - `iam`: IBM identity and access management -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - VPNServerAuthenticationByUsernameIDProviderProviderTypeIamConst = "iam" -) - -func (*VPNServerAuthenticationByUsernameIDProvider) isaVPNServerAuthenticationByUsernameIDProvider() bool { - return true -} - -type VPNServerAuthenticationByUsernameIDProviderIntf interface { - isaVPNServerAuthenticationByUsernameIDProvider() bool -} - -// UnmarshalVPNServerAuthenticationByUsernameIDProvider unmarshals an instance of VPNServerAuthenticationByUsernameIDProvider from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsernameIDProvider(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsernameIDProvider) - err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationPrototype : An authentication method for this VPN server. -// Models which "extend" this model: -// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype -// - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype -type VPNServerAuthenticationPrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider,omitempty"` - - // The certificate instance to use for the VPN client certificate authority (CA). - ClientCa CertificateInstanceIdentityIntf `json:"client_ca,omitempty"` - - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` -} - -// Constants associated with the VPNServerAuthenticationPrototype.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationPrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeMethodUsernameConst = "username" -) - -func (*VPNServerAuthenticationPrototype) isaVPNServerAuthenticationPrototype() bool { - return true -} - -type VPNServerAuthenticationPrototypeIntf interface { - isaVPNServerAuthenticationPrototype() bool -} - -// UnmarshalVPNServerAuthenticationPrototype unmarshals an instance of VPNServerAuthenticationPrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "method", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'method': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'method' not found in JSON object") - return - } - if discValue == "certificate" { - err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) - } else if discValue == "username" { - err = core.UnmarshalModel(m, "", result, UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'method': %s", discValue) - } - return -} - -// VPNServerClient : VPNServerClient struct -type VPNServerClient struct { - // The IP address assigned to this VPN client from `client_ip_pool`. - ClientIP *IP `json:"client_ip" validate:"required"` - - // The common name of client certificate that the VPN client provided when connecting to the server. - // - // This property will be present only when the `certificate` client authentication method is enabled on the VPN server. - CommonName *string `json:"common_name,omitempty"` - - // The date and time that the VPN client was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The date and time that the VPN client was disconnected. - // - // This property will be present only when the client `status` is `disconnected`. - DisconnectedAt *strfmt.DateTime `json:"disconnected_at,omitempty"` - - // The URL for this VPN client. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN client. - ID *string `json:"id" validate:"required"` - - // The remote IP address of this VPN client. - RemoteIP *IP `json:"remote_ip" validate:"required"` - - // The remote port of this VPN client. - RemotePort *int64 `json:"remote_port" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the VPN client: - // - `connected`: the VPN client is `connected` to this VPN server. - // - `disconnected`: the VPN client is `disconnected` from this VPN server. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` - - // The username that this VPN client provided when connecting to the VPN server. - // - // This property will be present only when the `username` client authentication method is enabled on the VPN server. - Username *string `json:"username,omitempty"` -} - -// Constants associated with the VPNServerClient.ResourceType property. -// The resource type. -const ( - VPNServerClientResourceTypeVPNServerClientConst = "vpn_server_client" -) - -// Constants associated with the VPNServerClient.Status property. -// The status of the VPN client: -// - `connected`: the VPN client is `connected` to this VPN server. -// - `disconnected`: the VPN client is `disconnected` from this VPN server. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN client on which the -// unexpected property value was encountered. -const ( - VPNServerClientStatusConnectedConst = "connected" - VPNServerClientStatusDisconnectedConst = "disconnected" -) - -// UnmarshalVPNServerClient unmarshals an instance of VPNServerClient from the specified map of raw messages. -func UnmarshalVPNServerClient(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClient) - err = core.UnmarshalModel(m, "client_ip", &obj.ClientIP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "common_name", &obj.CommonName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "disconnected_at", &obj.DisconnectedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote_ip", &obj.RemoteIP, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "remote_port", &obj.RemotePort) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerClientCollection : VPNServerClientCollection struct -type VPNServerClientCollection struct { - // Collection of VPN clients. - Clients []VPNServerClient `json:"clients" validate:"required"` - - // A link to the first page of resources. - First *VPNServerClientCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerClientCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalVPNServerClientCollection unmarshals an instance of VPNServerClientCollection from the specified map of raw messages. -func UnmarshalVPNServerClientCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollection) - err = core.UnmarshalModel(m, "clients", &obj.Clients, UnmarshalVPNServerClient) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerClientCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerClientCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerClientCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNServerClientCollectionFirst : A link to the first page of resources. -type VPNServerClientCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerClientCollectionFirst unmarshals an instance of VPNServerClientCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerClientCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerClientCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerClientCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerClientCollectionNext unmarshals an instance of VPNServerClientCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerClientCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerClientCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerCollection : VPNServerCollection struct -type VPNServerCollection struct { - // A link to the first page of resources. - First *VPNServerCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of VPN servers. - VPNServers []VPNServer `json:"vpn_servers" validate:"required"` -} - -// UnmarshalVPNServerCollection unmarshals an instance of VPNServerCollection from the specified map of raw messages. -func UnmarshalVPNServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpn_servers", &obj.VPNServers, UnmarshalVPNServer) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNServerCollectionFirst : A link to the first page of resources. -type VPNServerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerCollectionFirst unmarshals an instance of VPNServerCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerCollectionNext unmarshals an instance of VPNServerCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerHealthReason : VPNServerHealthReason struct -type VPNServerHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNServerHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPNServerHealthReasonCodeCannotAccessClientCertificateConst = "cannot_access_client_certificate" - VPNServerHealthReasonCodeCannotAccessServerCertificateConst = "cannot_access_server_certificate" - VPNServerHealthReasonCodeCannotCreateVPCRouteConst = "cannot_create_vpc_route" - VPNServerHealthReasonCodeCannotReserveIPAddressConst = "cannot_reserve_ip_address" - VPNServerHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPNServerHealthReason unmarshals an instance of VPNServerHealthReason from the specified map of raw messages. -func UnmarshalVPNServerHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerLifecycleReason : VPNServerLifecycleReason struct -type VPNServerLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNServerLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - VPNServerLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalVPNServerLifecycleReason unmarshals an instance of VPNServerLifecycleReason from the specified map of raw messages. -func UnmarshalVPNServerLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerPatch : VPNServerPatch struct -type VPNServerPatch struct { - // The certificate instance for this VPN server. - Certificate CertificateInstanceIdentityIntf `json:"certificate,omitempty"` - - // The authentication methods to use to authenticate VPN client on this VPN server - // (replacing any existing methods). - ClientAuthentication []VPNServerAuthenticationPrototypeIntf `json:"client_authentication,omitempty"` - - // The DNS server addresses that will be provided to VPN clients connected to this VPN server (replacing any existing - // addresses). - ClientDnsServerIps []IP `json:"client_dns_server_ips,omitempty"` - - // The seconds a VPN client can be idle before this VPN server will disconnect it. If `0`, the server will not - // disconnect idle clients. - ClientIdleTimeout *int64 `json:"client_idle_timeout,omitempty"` - - // The VPN client IPv4 address pool, expressed in CIDR format. The request must not overlap with any existing address - // prefixes in the VPC or any of the following reserved address ranges: - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) - // - // The prefix length of the client IP address pool's CIDR must be between - // `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that contains twice the number of IP addresses - // that are required to enable the maximum number of concurrent connections is recommended. - ClientIPPool *string `json:"client_ip_pool,omitempty"` - - // Indicates whether the split tunneling is enabled on this VPN server. - EnableSplitTunneling *bool `json:"enable_split_tunneling,omitempty"` - - // The name for this VPN server. The name must not be used by another VPN server in the VPC. - Name *string `json:"name,omitempty"` - - // The port number used by this VPN server. - Port *int64 `json:"port,omitempty"` - - // The transport protocol used by this VPN server. - Protocol *string `json:"protocol,omitempty"` - - // The subnets to provision this VPN server in (replacing the existing subnets). - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` -} - -// Constants associated with the VPNServerPatch.Protocol property. -// The transport protocol used by this VPN server. -const ( - VPNServerPatchProtocolTCPConst = "tcp" - VPNServerPatchProtocolUDPConst = "udp" -) - -// UnmarshalVPNServerPatch unmarshals an instance of VPNServerPatch from the specified map of raw messages. -func UnmarshalVPNServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerPatch) - err = core.UnmarshalModel(m, "certificate", &obj.Certificate, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_authentication", &obj.ClientAuthentication, UnmarshalVPNServerAuthenticationPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_dns_server_ips", &obj.ClientDnsServerIps, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_idle_timeout", &obj.ClientIdleTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "client_ip_pool", &obj.ClientIPPool) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_split_tunneling", &obj.EnableSplitTunneling) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNServerPatch -func (vpnServerPatch *VPNServerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnServerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNServerReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VPNServerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVPNServerReferenceDeleted unmarshals an instance of VPNServerReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNServerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRoute : VPNServerRoute struct -type VPNServerRoute struct { - // The action to perform with a packet matching the VPN route: - // - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. - // - `deliver`: deliver the packet into the VPC. - // - `drop`: drop the packet - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // The date and time that the VPN route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination for this VPN route in the VPN server. If an incoming packet does not match any destination, it will - // be dropped. - Destination *string `json:"destination" validate:"required"` - - // The reasons for the current VPN server route health_state (if any): - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNServerRouteHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this VPN route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN route. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN server route lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNServerRouteLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this VPN route. The name is unique across all routes for a VPN server. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VPNServerRoute.Action property. -// The action to perform with a packet matching the VPN route: -// - `translate`: translate the source IP address to one of the private IP addresses of the VPN server. -// - `deliver`: deliver the packet into the VPC. -// - `drop`: drop the packet -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the -// unexpected property value was encountered. -const ( - VPNServerRouteActionDeliverConst = "deliver" - VPNServerRouteActionDropConst = "drop" - VPNServerRouteActionTranslateConst = "translate" -) - -// Constants associated with the VPNServerRoute.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNServerRouteHealthStateDegradedConst = "degraded" - VPNServerRouteHealthStateFaultedConst = "faulted" - VPNServerRouteHealthStateInapplicableConst = "inapplicable" - VPNServerRouteHealthStateOkConst = "ok" -) - -// Constants associated with the VPNServerRoute.LifecycleState property. -// The lifecycle state of the VPN route. -const ( - VPNServerRouteLifecycleStateDeletingConst = "deleting" - VPNServerRouteLifecycleStateFailedConst = "failed" - VPNServerRouteLifecycleStatePendingConst = "pending" - VPNServerRouteLifecycleStateStableConst = "stable" - VPNServerRouteLifecycleStateSuspendedConst = "suspended" - VPNServerRouteLifecycleStateUpdatingConst = "updating" - VPNServerRouteLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNServerRoute.ResourceType property. -// The resource type. -const ( - VPNServerRouteResourceTypeVPNServerRouteConst = "vpn_server_route" -) - -// UnmarshalVPNServerRoute unmarshals an instance of VPNServerRoute from the specified map of raw messages. -func UnmarshalVPNServerRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRoute) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNServerRouteHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNServerRouteLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRouteCollection : VPNServerRouteCollection struct -type VPNServerRouteCollection struct { - // A link to the first page of resources. - First *VPNServerRouteCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNServerRouteCollectionNext `json:"next,omitempty"` - - // Collection of VPN routes. - Routes []VPNServerRoute `json:"routes" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalVPNServerRouteCollection unmarshals an instance of VPNServerRouteCollection from the specified map of raw messages. -func UnmarshalVPNServerRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNServerRouteCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNServerRouteCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalVPNServerRoute) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNServerRouteCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNServerRouteCollectionFirst : A link to the first page of resources. -type VPNServerRouteCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerRouteCollectionFirst unmarshals an instance of VPNServerRouteCollectionFirst from the specified map of raw messages. -func UnmarshalVPNServerRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNServerRouteCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNServerRouteCollectionNext unmarshals an instance of VPNServerRouteCollectionNext from the specified map of raw messages. -func UnmarshalVPNServerRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRouteHealthReason : VPNServerRouteHealthReason struct -type VPNServerRouteHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNServerRouteHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VPNServerRouteHealthReasonCodeInternalErrorConst = "internal_error" -) - -// UnmarshalVPNServerRouteHealthReason unmarshals an instance of VPNServerRouteHealthReason from the specified map of raw messages. -func UnmarshalVPNServerRouteHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRouteLifecycleReason : VPNServerRouteLifecycleReason struct -type VPNServerRouteLifecycleReason struct { - // A snake case string succinctly identifying the reason for this lifecycle state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this lifecycle state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this lifecycle state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VPNServerRouteLifecycleReason.Code property. -// A snake case string succinctly identifying the reason for this lifecycle state. -const ( - VPNServerRouteLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" -) - -// UnmarshalVPNServerRouteLifecycleReason unmarshals an instance of VPNServerRouteLifecycleReason from the specified map of raw messages. -func UnmarshalVPNServerRouteLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRouteLifecycleReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerRoutePatch : VPNServerRoutePatch struct -type VPNServerRoutePatch struct { - // The name for this VPN server route. The name must not be used by another route for the VPN server. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVPNServerRoutePatch unmarshals an instance of VPNServerRoutePatch from the specified map of raw messages. -func UnmarshalVPNServerRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerRoutePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNServerRoutePatch -func (vpnServerRoutePatch *VPNServerRoutePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnServerRoutePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VirtualNetworkInterface : VirtualNetworkInterface struct -type VirtualNetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the virtual network interface was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The reserved IPs bound to this virtual network interface. - // - // May be empty when `lifecycle_state` is `pending`. - Ips []ReservedIPReference `json:"ips" validate:"required"` - - // The lifecycle state of the virtual network interface. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The MAC address of the virtual network interface. May be absent if `lifecycle_state` is `pending`. - MacAddress *string `json:"mac_address,omitempty"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The reserved IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource group for this virtual network interface. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups for this virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The target of this virtual network interface. - // - // If absent, this virtual network interface is not attached to a target. - Target VirtualNetworkInterfaceTargetIntf `json:"target,omitempty"` - - // The VPC this virtual network interface resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this virtual network interface resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterface.LifecycleState property. -// The lifecycle state of the virtual network interface. -const ( - VirtualNetworkInterfaceLifecycleStateDeletingConst = "deleting" - VirtualNetworkInterfaceLifecycleStateFailedConst = "failed" - VirtualNetworkInterfaceLifecycleStatePendingConst = "pending" - VirtualNetworkInterfaceLifecycleStateStableConst = "stable" - VirtualNetworkInterfaceLifecycleStateSuspendedConst = "suspended" - VirtualNetworkInterfaceLifecycleStateUpdatingConst = "updating" - VirtualNetworkInterfaceLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VirtualNetworkInterface.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -// UnmarshalVirtualNetworkInterface unmarshals an instance of VirtualNetworkInterface from the specified map of raw messages. -func UnmarshalVirtualNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalVirtualNetworkInterfaceTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceCollection : VirtualNetworkInterfaceCollection struct -type VirtualNetworkInterfaceCollection struct { - // A link to the first page of resources. - First *VirtualNetworkInterfaceCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VirtualNetworkInterfaceCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of virtual network interfaces. - VirtualNetworkInterfaces []VirtualNetworkInterface `json:"virtual_network_interfaces" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceCollection unmarshals an instance of VirtualNetworkInterfaceCollection from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVirtualNetworkInterfaceCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVirtualNetworkInterfaceCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interfaces", &obj.VirtualNetworkInterfaces, UnmarshalVirtualNetworkInterface) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VirtualNetworkInterfaceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VirtualNetworkInterfaceCollectionFirst : A link to the first page of resources. -type VirtualNetworkInterfaceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceCollectionFirst unmarshals an instance of VirtualNetworkInterfaceCollectionFirst from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VirtualNetworkInterfaceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceCollectionNext unmarshals an instance of VirtualNetworkInterfaceCollectionNext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceIPPrototype : VirtualNetworkInterfaceIPPrototype struct -// Models which "extend" this model: -// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext -// - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext -type VirtualNetworkInterfaceIPPrototype struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*VirtualNetworkInterfaceIPPrototype) isaVirtualNetworkInterfaceIPPrototype() bool { - return true -} - -type VirtualNetworkInterfaceIPPrototypeIntf interface { - isaVirtualNetworkInterfaceIPPrototype() bool -} - -// UnmarshalVirtualNetworkInterfaceIPPrototype unmarshals an instance of VirtualNetworkInterfaceIPPrototype from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePatch : VirtualNetworkInterfacePatch struct -type VirtualNetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this interface. - // - // Must be `false` if `target` is a file share mount target. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. Must be `false` if the virtual network interface is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // region. Names beginning with `ibm-` are reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVirtualNetworkInterfacePatch unmarshals an instance of VirtualNetworkInterfacePatch from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VirtualNetworkInterfacePatch -func (virtualNetworkInterfacePatch *VirtualNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(virtualNetworkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VirtualNetworkInterfacePrimaryIPPrototype : VirtualNetworkInterfacePrimaryIPPrototype struct -// Models which "extend" this model: -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext -type VirtualNetworkInterfacePrimaryIPPrototype struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` - - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*VirtualNetworkInterfacePrimaryIPPrototype) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -type VirtualNetworkInterfacePrimaryIPPrototypeIntf interface { - isaVirtualNetworkInterfacePrimaryIPPrototype() bool -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototype unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototype from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceReferenceAttachmentContext : VirtualNetworkInterfaceReferenceAttachmentContext struct -type VirtualNetworkInterfaceReferenceAttachmentContext struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterfaceReferenceAttachmentContext.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceReferenceAttachmentContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -// UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext unmarshals an instance of VirtualNetworkInterfaceReferenceAttachmentContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceAttachmentContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VirtualNetworkInterfaceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVirtualNetworkInterfaceReferenceDeleted unmarshals an instance of VirtualNetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceTarget : A virtual network interface target. -// -// The resource types that can be virtual network interface targets are expected to expand in the future. When iterating -// over virtual network interface targets, do not assume that every target resource will be from a known set of resource -// types. Optionally halt processing and surface an error, or bypass resources of unrecognized types. -// Models which "extend" this model: -// - VirtualNetworkInterfaceTargetShareMountTargetReference -// - VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext -// - VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext -type VirtualNetworkInterfaceTarget struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href,omitempty"` - - // The unique identifier for this share mount target. - ID *string `json:"id,omitempty"` - - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` -} - -// Constants associated with the VirtualNetworkInterfaceTarget.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceTargetResourceTypeShareMountTargetConst = "share_mount_target" -) - -func (*VirtualNetworkInterfaceTarget) isaVirtualNetworkInterfaceTarget() bool { - return true -} - -type VirtualNetworkInterfaceTargetIntf interface { - isaVirtualNetworkInterfaceTarget() bool -} - -// UnmarshalVirtualNetworkInterfaceTarget unmarshals an instance of VirtualNetworkInterfaceTarget from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Volume : Volume struct -type Volume struct { - // Indicates whether a running virtual server instance has an attachment to this volume. - Active *bool `json:"active" validate:"required"` - - // The attachment state of the volume - // - `unattached`: Not attached to any virtual server instances - // - `attached`: Attached to a virtual server instance (even if the instance is stopped) - // - `unusable`: Not able to be attached to any virtual server instances. - AttachmentState *string `json:"attachment_state" validate:"required"` - - // The maximum bandwidth (in megabits per second) for the volume. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // Indicates whether this volume is performing an operation that must be serialized. This must be `false` to perform an - // operation that is specified to require serialization. - Busy *bool `json:"busy" validate:"required"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` - - // The date and time that the volume was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // The type of encryption used on the volume. - Encryption *string `json:"encryption" validate:"required"` - - // The root key used to wrap the data encryption key for the volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VolumeHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this volume. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` - - // The maximum I/O operations per second (IOPS) for this volume. - Iops *int64 `json:"iops" validate:"required"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` - - // The operating system associated with this volume. If absent, this volume was not - // created from an image, or the image did not include an operating system. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for - // this volume. - Profile *VolumeProfileReference `json:"profile" validate:"required"` - - // The resource group for this volume. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The image from which this volume was created (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this volume was not created from an image. - SourceImage *ImageReference `json:"source_image,omitempty"` - - // The snapshot from which this volume was cloned. - SourceSnapshot *SnapshotReference `json:"source_snapshot,omitempty"` - - // The status of the volume. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VolumeStatusReason `json:"status_reasons" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags" validate:"required"` - - // The volume attachments for this volume. - VolumeAttachments []VolumeAttachmentReferenceVolumeContext `json:"volume_attachments" validate:"required"` - - // The zone this volume resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Volume.AttachmentState property. -// The attachment state of the volume -// - `unattached`: Not attached to any virtual server instances -// - `attached`: Attached to a virtual server instance (even if the instance is stopped) -// - `unusable`: Not able to be attached to any virtual server instances. -const ( - VolumeAttachmentStateAttachedConst = "attached" - VolumeAttachmentStateUnattachedConst = "unattached" - VolumeAttachmentStateUnusableConst = "unusable" -) - -// Constants associated with the Volume.Encryption property. -// The type of encryption used on the volume. -const ( - VolumeEncryptionProviderManagedConst = "provider_managed" - VolumeEncryptionUserManagedConst = "user_managed" -) - -// Constants associated with the Volume.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VolumeHealthStateDegradedConst = "degraded" - VolumeHealthStateFaultedConst = "faulted" - VolumeHealthStateInapplicableConst = "inapplicable" - VolumeHealthStateOkConst = "ok" -) - -// Constants associated with the Volume.ResourceType property. -// The resource type. -const ( - VolumeResourceTypeVolumeConst = "volume" -) - -// Constants associated with the Volume.Status property. -// The status of the volume. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected -// property value was encountered. -const ( - VolumeStatusAvailableConst = "available" - VolumeStatusFailedConst = "failed" - VolumeStatusPendingConst = "pending" - VolumeStatusPendingDeletionConst = "pending_deletion" - VolumeStatusUnusableConst = "unusable" - VolumeStatusUpdatingConst = "updating" -) - -// UnmarshalVolume unmarshals an instance of Volume from the specified map of raw messages. -func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Volume) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "attachment_state", &obj.AttachmentState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "busy", &obj.Busy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVolumeHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachment : VolumeAttachment struct -type VolumeAttachment struct { - // The maximum bandwidth (in megabits per second) for the volume when attached to this instance. This may be lower than - // the volume bandwidth depending on the configuration of the instance. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // The date and time that the volume was attached. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` - - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` - - // The name for this volume attachment. The name is unique across all volume attachments on the instance. - Name *string `json:"name" validate:"required"` - - // The status of this volume attachment. - Status *string `json:"status" validate:"required"` - - // The type of volume attachment. - Type *string `json:"type" validate:"required"` - - // The attached volume. - // - // This property will be absent if the volume has not yet been provisioned. - Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` -} - -// Constants associated with the VolumeAttachment.Status property. -// The status of this volume attachment. -const ( - VolumeAttachmentStatusAttachedConst = "attached" - VolumeAttachmentStatusAttachingConst = "attaching" - VolumeAttachmentStatusDeletingConst = "deleting" - VolumeAttachmentStatusDetachingConst = "detaching" -) - -// Constants associated with the VolumeAttachment.Type property. -// The type of volume attachment. -const ( - VolumeAttachmentTypeBootConst = "boot" - VolumeAttachmentTypeDataConst = "data" -) - -// UnmarshalVolumeAttachment unmarshals an instance of VolumeAttachment from the specified map of raw messages. -func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachment) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentCollection : VolumeAttachmentCollection struct -type VolumeAttachmentCollection struct { - // Collection of volume attachments. - VolumeAttachments []VolumeAttachment `json:"volume_attachments" validate:"required"` -} - -// UnmarshalVolumeAttachmentCollection unmarshals an instance of VolumeAttachmentCollection from the specified map of raw messages. -func UnmarshalVolumeAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentCollection) - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachment) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentDevice : VolumeAttachmentDevice struct -type VolumeAttachmentDevice struct { - // A unique identifier for the device which is exposed to the instance operating system. - ID *string `json:"id,omitempty"` -} - -// UnmarshalVolumeAttachmentDevice unmarshals an instance of VolumeAttachmentDevice from the specified map of raw messages. -func UnmarshalVolumeAttachmentDevice(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentDevice) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPatch : VolumeAttachmentPatch struct -type VolumeAttachmentPatch struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVolumeAttachmentPatch unmarshals an instance of VolumeAttachmentPatch from the specified map of raw messages. -func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPatch) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VolumeAttachmentPatch -func (volumeAttachmentPatch *VolumeAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumeAttachmentPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VolumeAttachmentPrototype : VolumeAttachmentPrototype struct -type VolumeAttachmentPrototype struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` -} - -// NewVolumeAttachmentPrototype : Instantiate VolumeAttachmentPrototype (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototype(volume VolumeAttachmentPrototypeVolumeIntf) (_model *VolumeAttachmentPrototype, err error) { - _model = &VolumeAttachmentPrototype{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumeAttachmentPrototype unmarshals an instance of VolumeAttachmentPrototype from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototype) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentPrototypeVolume) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeInstanceByImageContext : VolumeAttachmentPrototypeInstanceByImageContext struct -type VolumeAttachmentPrototypeInstanceByImageContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // A prototype object for a new volume. - Volume *VolumePrototypeInstanceByImageContext `json:"volume" validate:"required"` -} - -// NewVolumeAttachmentPrototypeInstanceByImageContext : Instantiate VolumeAttachmentPrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByImageContext(volume *VolumePrototypeInstanceByImageContext) (_model *VolumeAttachmentPrototypeInstanceByImageContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByImageContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumeAttachmentPrototypeInstanceByImageContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceByImageContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeInstanceBySourceSnapshotContext : VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct -type VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // A prototype object for a new volume from a snapshot. - Volume *VolumePrototypeInstanceBySourceSnapshotContext `json:"volume" validate:"required"` -} - -// NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext : Instantiate VolumeAttachmentPrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume *VolumePrototypeInstanceBySourceSnapshotContext) (_model *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceBySourceSnapshotContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct -type VolumeAttachmentPrototypeInstanceByVolumeContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The name for this volume attachment. The name must not be used by another volume attachment on the instance. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // An existing volume to attach. - Volume VolumeIdentityIntf `json:"volume" validate:"required"` -} - -// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeIdentityIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolume : An existing volume to attach to the instance, or a prototype object for a new volume. -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumeIdentity -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext -type VolumeAttachmentPrototypeVolume struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} - -func (*VolumeAttachmentPrototypeVolume) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -type VolumeAttachmentPrototypeVolumeIntf interface { - isaVolumeAttachmentPrototypeVolume() bool -} - -// UnmarshalVolumeAttachmentPrototypeVolume unmarshals an instance of VolumeAttachmentPrototypeVolume from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolume) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceInstanceContext : VolumeAttachmentReferenceInstanceContext struct -type VolumeAttachmentReferenceInstanceContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeAttachmentReferenceInstanceContextDeleted `json:"deleted,omitempty"` - - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` - - // The name for this volume attachment. The name is unique across all volume attachments on the instance. - Name *string `json:"name" validate:"required"` - - // The attached volume. - // - // This property will be absent if the volume has not yet been provisioned. - Volume *VolumeReferenceVolumeAttachmentContext `json:"volume,omitempty"` -} - -// UnmarshalVolumeAttachmentReferenceInstanceContext unmarshals an instance of VolumeAttachmentReferenceInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceInstanceContextDeleted) - if err != nil { - return - } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReferenceVolumeAttachmentContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceInstanceContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeAttachmentReferenceInstanceContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceInstanceContextDeleted unmarshals an instance of VolumeAttachmentReferenceInstanceContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceVolumeContext : VolumeAttachmentReferenceVolumeContext struct -type VolumeAttachmentReferenceVolumeContext struct { - // Indicates whether deleting the instance will also delete the attached volume. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeAttachmentReferenceVolumeContextDeleted `json:"deleted,omitempty"` - - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` - - // The attached instance. - Instance *InstanceReference `json:"instance" validate:"required"` - - // The name for this volume attachment. The name is unique across all volume attachments on the instance. - Name *string `json:"name" validate:"required"` - - // The type of volume attachment. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VolumeAttachmentReferenceVolumeContext.Type property. -// The type of volume attachment. -const ( - VolumeAttachmentReferenceVolumeContextTypeBootConst = "boot" - VolumeAttachmentReferenceVolumeContextTypeDataConst = "data" -) - -// UnmarshalVolumeAttachmentReferenceVolumeContext unmarshals an instance of VolumeAttachmentReferenceVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceVolumeContextDeleted) - if err != nil { - return - } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceVolumeContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeAttachmentReferenceVolumeContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceVolumeContextDeleted unmarshals an instance of VolumeAttachmentReferenceVolumeContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeCollection : VolumeCollection struct -type VolumeCollection struct { - // A link to the first page of resources. - First *VolumeCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` - - // Collection of volumes. - Volumes []Volume `json:"volumes" validate:"required"` -} - -// UnmarshalVolumeCollection unmarshals an instance of VolumeCollection from the specified map of raw messages. -func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volumes", &obj.Volumes, UnmarshalVolume) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VolumeCollectionFirst : A link to the first page of resources. -type VolumeCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeCollectionFirst unmarshals an instance of VolumeCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeCollectionNext unmarshals an instance of VolumeCollectionNext from the specified map of raw messages. -func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeHealthReason : VolumeHealthReason struct -type VolumeHealthReason struct { - // A snake case string succinctly identifying the reason for this health state. - Code *string `json:"code" validate:"required"` - - // An explanation of the reason for this health state. - Message *string `json:"message" validate:"required"` - - // Link to documentation about the reason for this health state. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VolumeHealthReason.Code property. -// A snake case string succinctly identifying the reason for this health state. -const ( - VolumeHealthReasonCodeInitializingFromSnapshotConst = "initializing_from_snapshot" -) - -// UnmarshalVolumeHealthReason unmarshals an instance of VolumeHealthReason from the specified map of raw messages. -func UnmarshalVolumeHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeHealthReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentity : Identifies a volume by a unique property. -// Models which "extend" this model: -// - VolumeIdentityByID -// - VolumeIdentityByCRN -// - VolumeIdentityByHref -type VolumeIdentity struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` -} - -func (*VolumeIdentity) isaVolumeIdentity() bool { - return true -} - -type VolumeIdentityIntf interface { - isaVolumeIdentity() bool -} - -// UnmarshalVolumeIdentity unmarshals an instance of VolumeIdentity from the specified map of raw messages. -func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePatch : VolumePatch struct -type VolumePatch struct { - // The capacity to use for the volume (in gigabytes). The volume must be attached to a running virtual server instance, - // and the specified value must not be less than the current capacity. Additionally, if the volume is attached as a - // boot volume, the maximum value is 250 gigabytes. - // - // The minimum and maximum capacity limits for creating or updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. - Name *string `json:"name,omitempty"` - - // The profile to use for this volume. The requested profile must be in the same - // `family` as the current profile. The volume must be attached as a data volume to - // a running virtual server instance, and must have a `capacity` within the range - // supported by the specified profile. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` -} - -// UnmarshalVolumePatch unmarshals an instance of VolumePatch from the specified map of raw messages. -func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePatch) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VolumePatch -func (volumePatch *VolumePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VolumeProfile : VolumeProfile struct -type VolumeProfile struct { - // The product family this volume profile belongs to. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the - // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` - - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` -} - -// Constants associated with the VolumeProfile.Family property. -// The product family this volume profile belongs to. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the -// unexpected property value was encountered. -const ( - VolumeProfileFamilyCustomConst = "custom" - VolumeProfileFamilyTieredConst = "tiered" -) - -// UnmarshalVolumeProfile unmarshals an instance of VolumeProfile from the specified map of raw messages. -func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileCollection : VolumeProfileCollection struct -type VolumeProfileCollection struct { - // A link to the first page of resources. - First *VolumeProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeProfileCollectionNext `json:"next,omitempty"` - - // Collection of volume profiles. - Profiles []VolumeProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalVolumeProfileCollection unmarshals an instance of VolumeProfileCollection from the specified map of raw messages. -func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalVolumeProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VolumeProfileCollectionFirst : A link to the first page of resources. -type VolumeProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeProfileCollectionFirst unmarshals an instance of VolumeProfileCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeProfileCollectionNext unmarshals an instance of VolumeProfileCollectionNext from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileIdentity : Identifies a volume profile by a unique property. -// Models which "extend" this model: -// - VolumeProfileIdentityByName -// - VolumeProfileIdentityByHref -type VolumeProfileIdentity struct { - // The globally unique name for this volume profile. - Name *string `json:"name,omitempty"` - - // The URL for this volume profile. - Href *string `json:"href,omitempty"` -} - -func (*VolumeProfileIdentity) isaVolumeProfileIdentity() bool { - return true -} - -type VolumeProfileIdentityIntf interface { - isaVolumeProfileIdentity() bool -} - -// UnmarshalVolumeProfileIdentity unmarshals an instance of VolumeProfileIdentity from the specified map of raw messages. -func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileReference : VolumeProfileReference struct -type VolumeProfileReference struct { - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalVolumeProfileReference unmarshals an instance of VolumeProfileReference from the specified map of raw messages. -func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePrototype : VolumePrototype struct -// Models which "extend" this model: -// - VolumePrototypeVolumeByCapacity -// - VolumePrototypeVolumeBySourceSnapshot -type VolumePrototype struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} - -func (*VolumePrototype) isaVolumePrototype() bool { - return true -} - -type VolumePrototypeIntf interface { - isaVolumePrototype() bool -} - -// UnmarshalVolumePrototype unmarshals an instance of VolumePrototype from the specified map of raw messages. -func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototype) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePrototypeInstanceByImageContext : VolumePrototypeInstanceByImageContext struct -type VolumePrototypeInstanceByImageContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the image's - // `minimum_provisioned_size`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the image's `minimum_provisioned_size`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` -} - -// NewVolumePrototypeInstanceByImageContext : Instantiate VolumePrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeInstanceByImageContext(profile VolumeProfileIdentityIntf) (_model *VolumePrototypeInstanceByImageContext, err error) { - _model = &VolumePrototypeInstanceByImageContext{ - Profile: profile, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumePrototypeInstanceByImageContext unmarshals an instance of VolumePrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePrototypeInstanceBySourceSnapshotContext : VolumePrototypeInstanceBySourceSnapshotContext struct -type VolumePrototypeInstanceBySourceSnapshotContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` -} - -// NewVolumePrototypeInstanceBySourceSnapshotContext : Instantiate VolumePrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeInstanceBySourceSnapshotContext(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeInstanceBySourceSnapshotContext, err error) { - _model = &VolumePrototypeInstanceBySourceSnapshotContext{ - Profile: profile, - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumePrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumePrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. -func UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeInstanceBySourceSnapshotContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeReference : VolumeReference struct -type VolumeReference struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this volume. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VolumeReference.ResourceType property. -// The resource type. -const ( - VolumeReferenceResourceTypeVolumeConst = "volume" -) - -// UnmarshalVolumeReference unmarshals an instance of VolumeReference from the specified map of raw messages. -func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeReferenceDeleted unmarshals an instance of VolumeReferenceDeleted from the specified map of raw messages. -func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeReferenceVolumeAttachmentContext : VolumeReferenceVolumeAttachmentContext struct -type VolumeReferenceVolumeAttachmentContext struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceVolumeAttachmentContextDeleted `json:"deleted,omitempty"` - - // The URL for this volume. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VolumeReferenceVolumeAttachmentContext.ResourceType property. -// The resource type. -const ( - VolumeReferenceVolumeAttachmentContextResourceTypeVolumeConst = "volume" -) - -// UnmarshalVolumeReferenceVolumeAttachmentContext unmarshals an instance of VolumeReferenceVolumeAttachmentContext from the specified map of raw messages. -func UnmarshalVolumeReferenceVolumeAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceVolumeAttachmentContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceVolumeAttachmentContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeReferenceVolumeAttachmentContextDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary -// information. -type VolumeReferenceVolumeAttachmentContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeReferenceVolumeAttachmentContextDeleted unmarshals an instance of VolumeReferenceVolumeAttachmentContextDeleted from the specified map of raw messages. -func UnmarshalVolumeReferenceVolumeAttachmentContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceVolumeAttachmentContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeRemote : If present, this property indicates that the resource associated with this reference is remote and therefore may not -// be directly retrievable. -type VolumeRemote struct { - // If present, this property indicates that the referenced resource is remote to this - // region, and identifies the native region. - Region *RegionReference `json:"region,omitempty"` -} - -// UnmarshalVolumeRemote unmarshals an instance of VolumeRemote from the specified map of raw messages. -func UnmarshalVolumeRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeRemote) - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeStatusReason : VolumeStatusReason struct -type VolumeStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` - - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` -} - -// Constants associated with the VolumeStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - VolumeStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" -) - -// UnmarshalVolumeStatusReason unmarshals an instance of VolumeStatusReason from the specified map of raw messages. -func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolutionBindingCollectionFirst : A link to the first page of resources. -type VpcdnsResolutionBindingCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVpcdnsResolutionBindingCollectionFirst unmarshals an instance of VpcdnsResolutionBindingCollectionFirst from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolutionBindingCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VpcdnsResolutionBindingCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVpcdnsResolutionBindingCollectionNext unmarshals an instance of VpcdnsResolutionBindingCollectionNext from the specified map of raw messages. -func UnmarshalVpcdnsResolutionBindingCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolutionBindingCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Zone : Zone struct -type Zone struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` - - // The region this zone resides in. - Region *RegionReference `json:"region" validate:"required"` - - // The availability status of this zone. - Status *string `json:"status" validate:"required"` -} - -// Constants associated with the Zone.Status property. -// The availability status of this zone. -const ( - ZoneStatusAvailableConst = "available" - ZoneStatusImpairedConst = "impaired" - ZoneStatusUnavailableConst = "unavailable" -) - -// UnmarshalZone unmarshals an instance of Zone from the specified map of raw messages. -func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Zone) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneCollection : ZoneCollection struct -type ZoneCollection struct { - // Collection of zones. - Zones []Zone `json:"zones" validate:"required"` -} - -// UnmarshalZoneCollection unmarshals an instance of ZoneCollection from the specified map of raw messages. -func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneCollection) - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZone) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentity : Identifies a zone by a unique property. -// Models which "extend" this model: -// - ZoneIdentityByName -// - ZoneIdentityByHref -type ZoneIdentity struct { - // The globally unique name for this zone. - Name *string `json:"name,omitempty"` - - // The URL for this zone. - Href *string `json:"href,omitempty"` -} - -func (*ZoneIdentity) isaZoneIdentity() bool { - return true -} - -type ZoneIdentityIntf interface { - isaZoneIdentity() bool -} - -// UnmarshalZoneIdentity unmarshals an instance of ZoneIdentity from the specified map of raw messages. -func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneReference : ZoneReference struct -type ZoneReference struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalZoneReference unmarshals an instance of ZoneReference from the specified map of raw messages. -func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobSourceInstanceReference : BackupPolicyJobSourceInstanceReference struct -// This model "extends" BackupPolicyJobSource -type BackupPolicyJobSourceInstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -func (*BackupPolicyJobSourceInstanceReference) isaBackupPolicyJobSource() bool { - return true -} - -// UnmarshalBackupPolicyJobSourceInstanceReference unmarshals an instance of BackupPolicyJobSourceInstanceReference from the specified map of raw messages. -func UnmarshalBackupPolicyJobSourceInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobSourceInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyJobSourceVolumeReference : BackupPolicyJobSourceVolumeReference struct -// This model "extends" BackupPolicyJobSource -type BackupPolicyJobSourceVolumeReference struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this volume. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` - - // The name for this volume. The name is unique across all volumes in the region. - Name *string `json:"name" validate:"required"` - - // If present, this property indicates that the resource associated with this reference - // is remote and therefore may not be directly retrievable. - Remote *VolumeRemote `json:"remote,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyJobSourceVolumeReference.ResourceType property. -// The resource type. -const ( - BackupPolicyJobSourceVolumeReferenceResourceTypeVolumeConst = "volume" -) - -func (*BackupPolicyJobSourceVolumeReference) isaBackupPolicyJobSource() bool { - return true -} - -// UnmarshalBackupPolicyJobSourceVolumeReference unmarshals an instance of BackupPolicyJobSourceVolumeReference from the specified map of raw messages. -func UnmarshalBackupPolicyJobSourceVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyJobSourceVolumeReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalVolumeRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyMatchResourceTypeInstance : BackupPolicyMatchResourceTypeInstance struct -// This model "extends" BackupPolicy -type BackupPolicyMatchResourceTypeInstance struct { - // The date and time that the backup policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this backup policy. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this backup policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy. - ID *string `json:"id" validate:"required"` - - // The date and time that the most recent job for this backup policy completed. - // - // If absent, no job has yet completed for this backup policy. - LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` - - // The lifecycle state of the backup policy. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will - // be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name is unique across all backup policies in the region. - Name *string `json:"name" validate:"required"` - - // The plans for the backup policy. - Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` - - // The resource group for this backup policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` - - // The included content for backups created using this policy: - // - `boot_volume`: Include the instance's boot volume. - // - `data_volumes`: Include the instance's data volumes. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - IncludedContent []string `json:"included_content" validate:"required"` - - // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - MatchResourceType *string `json:"match_resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyMatchResourceTypeInstance.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - BackupPolicyMatchResourceTypeInstanceHealthStateDegradedConst = "degraded" - BackupPolicyMatchResourceTypeInstanceHealthStateFaultedConst = "faulted" - BackupPolicyMatchResourceTypeInstanceHealthStateInapplicableConst = "inapplicable" - BackupPolicyMatchResourceTypeInstanceHealthStateOkConst = "ok" -) - -// Constants associated with the BackupPolicyMatchResourceTypeInstance.LifecycleState property. -// The lifecycle state of the backup policy. -const ( - BackupPolicyMatchResourceTypeInstanceLifecycleStateDeletingConst = "deleting" - BackupPolicyMatchResourceTypeInstanceLifecycleStateFailedConst = "failed" - BackupPolicyMatchResourceTypeInstanceLifecycleStatePendingConst = "pending" - BackupPolicyMatchResourceTypeInstanceLifecycleStateStableConst = "stable" - BackupPolicyMatchResourceTypeInstanceLifecycleStateSuspendedConst = "suspended" - BackupPolicyMatchResourceTypeInstanceLifecycleStateUpdatingConst = "updating" - BackupPolicyMatchResourceTypeInstanceLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicyMatchResourceTypeInstance.ResourceType property. -// The resource type. -const ( - BackupPolicyMatchResourceTypeInstanceResourceTypeBackupPolicyConst = "backup_policy" -) - -// Constants associated with the BackupPolicyMatchResourceTypeInstance.IncludedContent property. -// An item to include. -const ( - BackupPolicyMatchResourceTypeInstanceIncludedContentBootVolumeConst = "boot_volume" - BackupPolicyMatchResourceTypeInstanceIncludedContentDataVolumesConst = "data_volumes" -) - -// Constants associated with the BackupPolicyMatchResourceTypeInstance.MatchResourceType property. -// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected -// property value was encountered. -const ( - BackupPolicyMatchResourceTypeInstanceMatchResourceTypeInstanceConst = "instance" -) - -func (*BackupPolicyMatchResourceTypeInstance) isaBackupPolicy() bool { - return true -} - -// UnmarshalBackupPolicyMatchResourceTypeInstance unmarshals an instance of BackupPolicyMatchResourceTypeInstance from the specified map of raw messages. -func UnmarshalBackupPolicyMatchResourceTypeInstance(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyMatchResourceTypeInstance) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyMatchResourceTypeVolume : BackupPolicyMatchResourceTypeVolume struct -// This model "extends" BackupPolicy -type BackupPolicyMatchResourceTypeVolume struct { - // The date and time that the backup policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this backup policy. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current `health_state` (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []BackupPolicyHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The URL for this backup policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this backup policy. - ID *string `json:"id" validate:"required"` - - // The date and time that the most recent job for this backup policy completed. - // - // If absent, no job has yet completed for this backup policy. - LastJobCompletedAt *strfmt.DateTime `json:"last_job_completed_at,omitempty"` - - // The lifecycle state of the backup policy. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will - // be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name is unique across all backup policies in the region. - Name *string `json:"name" validate:"required"` - - // The plans for the backup policy. - Plans []BackupPolicyPlanReference `json:"plans" validate:"required"` - - // The resource group for this backup policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - Scope BackupPolicyScopeIntf `json:"scope" validate:"required"` - - // The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the - // unexpected property value was encountered. - MatchResourceType *string `json:"match_resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyMatchResourceTypeVolume.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - BackupPolicyMatchResourceTypeVolumeHealthStateDegradedConst = "degraded" - BackupPolicyMatchResourceTypeVolumeHealthStateFaultedConst = "faulted" - BackupPolicyMatchResourceTypeVolumeHealthStateInapplicableConst = "inapplicable" - BackupPolicyMatchResourceTypeVolumeHealthStateOkConst = "ok" -) - -// Constants associated with the BackupPolicyMatchResourceTypeVolume.LifecycleState property. -// The lifecycle state of the backup policy. -const ( - BackupPolicyMatchResourceTypeVolumeLifecycleStateDeletingConst = "deleting" - BackupPolicyMatchResourceTypeVolumeLifecycleStateFailedConst = "failed" - BackupPolicyMatchResourceTypeVolumeLifecycleStatePendingConst = "pending" - BackupPolicyMatchResourceTypeVolumeLifecycleStateStableConst = "stable" - BackupPolicyMatchResourceTypeVolumeLifecycleStateSuspendedConst = "suspended" - BackupPolicyMatchResourceTypeVolumeLifecycleStateUpdatingConst = "updating" - BackupPolicyMatchResourceTypeVolumeLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BackupPolicyMatchResourceTypeVolume.ResourceType property. -// The resource type. -const ( - BackupPolicyMatchResourceTypeVolumeResourceTypeBackupPolicyConst = "backup_policy" -) - -// Constants associated with the BackupPolicyMatchResourceTypeVolume.MatchResourceType property. -// The resource type this backup policy applies to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the backup policy on which the unexpected -// property value was encountered. -const ( - BackupPolicyMatchResourceTypeVolumeMatchResourceTypeVolumeConst = "volume" -) - -func (*BackupPolicyMatchResourceTypeVolume) isaBackupPolicy() bool { - return true -} - -// UnmarshalBackupPolicyMatchResourceTypeVolume unmarshals an instance of BackupPolicyMatchResourceTypeVolume from the specified map of raw messages. -func UnmarshalBackupPolicyMatchResourceTypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyMatchResourceTypeVolume) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalBackupPolicyHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_job_completed_at", &obj.LastJobCompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScope) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype : BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype struct -// This model "extends" BackupPolicyPrototype -type BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype struct { - // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type - // will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The prototype objects for backup plans to be created for this backup policy. - Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` - - // The included content for backups created using this policy: - // - `boot_volume`: Include the instance's boot volume. - // - `data_volumes`: Include the instance's data volumes. - IncludedContent []string `json:"included_content,omitempty"` - - // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - MatchResourceType *string `json:"match_resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.IncludedContent property. -// An item to include. -const ( - BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeIncludedContentBootVolumeConst = "boot_volume" - BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeIncludedContentDataVolumesConst = "data_volumes" -) - -// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.MatchResourceType property. -// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -const ( - BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeMatchResourceTypeInstanceConst = "instance" -) - -// NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype : Instantiate BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(matchUserTags []string, matchResourceType string) (_model *BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype, err error) { - _model = &BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype{ - MatchUserTags: matchUserTags, - MatchResourceType: core.StringPtr(matchResourceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype) isaBackupPolicyPrototype() bool { - return true -} - -// UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype unmarshals an instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype) - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "included_content", &obj.IncludedContent) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype : BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype struct -// This model "extends" BackupPolicyPrototype -type BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype struct { - // The user tags this backup policy will apply to. Resources that have both a matching user tag and a matching type - // will be subject to the backup policy. - MatchUserTags []string `json:"match_user_tags" validate:"required"` - - // The name for this backup policy. The name must not be used by another backup policy in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The prototype objects for backup plans to be created for this backup policy. - Plans []BackupPolicyPlanPrototype `json:"plans,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Scope BackupPolicyScopePrototypeIntf `json:"scope,omitempty"` - - // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag - // will be subject to the backup policy. - MatchResourceType *string `json:"match_resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.MatchResourceType property. -// The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag -// will be subject to the backup policy. -const ( - BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototypeMatchResourceTypeVolumeConst = "volume" -) - -// NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype : Instantiate BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(matchUserTags []string, matchResourceType string) (_model *BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype, err error) { - _model = &BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype{ - MatchUserTags: matchUserTags, - MatchResourceType: core.StringPtr(matchResourceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype) isaBackupPolicyPrototype() bool { - return true -} - -// UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype unmarshals an instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype from the specified map of raw messages. -func UnmarshalBackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype) - err = core.UnmarshalPrimitive(m, "match_user_tags", &obj.MatchUserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalBackupPolicyPlanPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "scope", &obj.Scope, UnmarshalBackupPolicyScopePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "match_resource_type", &obj.MatchResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScopePrototypeEnterpriseIdentity : Identifies an enterprise by a unique property. -// Models which "extend" this model: -// - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN -// This model "extends" BackupPolicyScopePrototype -type BackupPolicyScopePrototypeEnterpriseIdentity struct { - // The CRN for this enterprise. - CRN *string `json:"crn,omitempty"` -} - -func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { - return true -} - -type BackupPolicyScopePrototypeEnterpriseIdentityIntf interface { - BackupPolicyScopePrototypeIntf - isaBackupPolicyScopePrototypeEnterpriseIdentity() bool -} - -func (*BackupPolicyScopePrototypeEnterpriseIdentity) isaBackupPolicyScopePrototype() bool { - return true -} - -// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentity from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototypeEnterpriseIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScopeAccountReference : BackupPolicyScopeAccountReference struct -// This model "extends" BackupPolicyScope -type BackupPolicyScopeAccountReference struct { - // The unique identifier for this account. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyScopeAccountReference.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeAccountReferenceResourceTypeAccountConst = "account" -) - -func (*BackupPolicyScopeAccountReference) isaBackupPolicyScope() bool { - return true -} - -// UnmarshalBackupPolicyScopeAccountReference unmarshals an instance of BackupPolicyScopeAccountReference from the specified map of raw messages. -func UnmarshalBackupPolicyScopeAccountReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopeAccountReference) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScopeEnterpriseReference : BackupPolicyScopeEnterpriseReference struct -// This model "extends" BackupPolicyScope -type BackupPolicyScopeEnterpriseReference struct { - // The CRN for this enterprise. - CRN *string `json:"crn" validate:"required"` - - // The unique identifier for this enterprise. - ID *string `json:"id" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BackupPolicyScopeEnterpriseReference.ResourceType property. -// The resource type. -const ( - BackupPolicyScopeEnterpriseReferenceResourceTypeEnterpriseConst = "enterprise" -) - -func (*BackupPolicyScopeEnterpriseReference) isaBackupPolicyScope() bool { - return true -} - -// UnmarshalBackupPolicyScopeEnterpriseReference unmarshals an instance of BackupPolicyScopeEnterpriseReference from the specified map of raw messages. -func UnmarshalBackupPolicyScopeEnterpriseReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopeEnterpriseReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerBootTargetBareMetalServerDiskReference : BareMetalServerBootTargetBareMetalServerDiskReference struct -// This model "extends" BareMetalServerBootTarget -type BareMetalServerBootTargetBareMetalServerDiskReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server disk. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server disk. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server disk. The name is unique across all disks on the bare metal server. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the BareMetalServerBootTargetBareMetalServerDiskReference.ResourceType property. -// The resource type. -const ( - BareMetalServerBootTargetBareMetalServerDiskReferenceResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" -) - -func (*BareMetalServerBootTargetBareMetalServerDiskReference) isaBareMetalServerBootTarget() bool { - return true -} - -// UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference unmarshals an instance of BareMetalServerBootTargetBareMetalServerDiskReference from the specified map of raw messages. -func UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerBootTargetBareMetalServerDiskReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount : BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct -// This model "extends" BareMetalServerInitializationUserAccount -type BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct { - // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` - - // The public SSH key used to encrypt the password. - EncryptionKey *KeyReference `json:"encryption_key" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The username for the account created at initialization. - Username *string `json:"username" validate:"required"` -} - -// Constants associated with the BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.ResourceType property. -// The resource type. -const ( - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccountResourceTypeHostUserAccountConst = "host_user_account" -) - -func (*BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) isaBareMetalServerInitializationUserAccount() bool { - return true -} - -// UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount unmarshals an instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount from the specified map of raw messages. -func UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "username", &obj.Username) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentByPci : BareMetalServerNetworkAttachmentByPci struct -// This model "extends" BareMetalServerNetworkAttachment -type BareMetalServerNetworkAttachmentByPci struct { - // The date and time that the bare metal server network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this bare metal server network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network attachment. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the bare metal server network attachment. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this bare metal server network attachment. The name is unique across all network attachments for the - // bare metal server. - Name *string `json:"name" validate:"required"` - - // The port speed for this bare metal server network attachment in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - // The primary IP address of the virtual network interface for the bare metal server network attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the bare metal server network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network attachment type. - Type *string `json:"type" validate:"required"` - - // The virtual network interface for this bare metal server network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs allowed for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` - - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentByPci.LifecycleState property. -// The lifecycle state of the bare metal server network attachment. -const ( - BareMetalServerNetworkAttachmentByPciLifecycleStateDeletingConst = "deleting" - BareMetalServerNetworkAttachmentByPciLifecycleStateFailedConst = "failed" - BareMetalServerNetworkAttachmentByPciLifecycleStatePendingConst = "pending" - BareMetalServerNetworkAttachmentByPciLifecycleStateStableConst = "stable" - BareMetalServerNetworkAttachmentByPciLifecycleStateSuspendedConst = "suspended" - BareMetalServerNetworkAttachmentByPciLifecycleStateUpdatingConst = "updating" - BareMetalServerNetworkAttachmentByPciLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByPci.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkAttachmentByPciResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByPci.Type property. -// The bare metal server network attachment type. -const ( - BareMetalServerNetworkAttachmentByPciTypePrimaryConst = "primary" - BareMetalServerNetworkAttachmentByPciTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByPci.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -const ( - BareMetalServerNetworkAttachmentByPciInterfaceTypePciConst = "pci" -) - -func (*BareMetalServerNetworkAttachmentByPci) isaBareMetalServerNetworkAttachment() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentByPci unmarshals an instance of BareMetalServerNetworkAttachmentByPci from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentByPci(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentByPci) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentByVlan : BareMetalServerNetworkAttachmentByVlan struct -// This model "extends" BareMetalServerNetworkAttachment -type BareMetalServerNetworkAttachmentByVlan struct { - // The date and time that the bare metal server network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this bare metal server network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network attachment. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the bare metal server network attachment. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this bare metal server network attachment. The name is unique across all network attachments for the - // bare metal server. - Name *string `json:"name" validate:"required"` - - // The port speed for this bare metal server network attachment in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - // The primary IP address of the virtual network interface for the bare metal server network attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the bare metal server network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network attachment type. - Type *string `json:"type" validate:"required"` - - // The virtual network interface for this bare metal server network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` - - // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for - // network attachments with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network attachment will be automatically deleted from this bare metal server and a new network attachment with - // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for - // this network attachment will be automatically be attached to the new network attachment. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including - // this network attachment's `vlan`. - AllowToFloat *bool `json:"allow_to_float" validate:"required"` - - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. - Vlan *int64 `json:"vlan" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentByVlan.LifecycleState property. -// The lifecycle state of the bare metal server network attachment. -const ( - BareMetalServerNetworkAttachmentByVlanLifecycleStateDeletingConst = "deleting" - BareMetalServerNetworkAttachmentByVlanLifecycleStateFailedConst = "failed" - BareMetalServerNetworkAttachmentByVlanLifecycleStatePendingConst = "pending" - BareMetalServerNetworkAttachmentByVlanLifecycleStateStableConst = "stable" - BareMetalServerNetworkAttachmentByVlanLifecycleStateSuspendedConst = "suspended" - BareMetalServerNetworkAttachmentByVlanLifecycleStateUpdatingConst = "updating" - BareMetalServerNetworkAttachmentByVlanLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByVlan.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkAttachmentByVlanResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByVlan.Type property. -// The bare metal server network attachment type. -const ( - BareMetalServerNetworkAttachmentByVlanTypePrimaryConst = "primary" - BareMetalServerNetworkAttachmentByVlanTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkAttachmentByVlan.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -const ( - BareMetalServerNetworkAttachmentByVlanInterfaceTypeVlanConst = "vlan" -) - -func (*BareMetalServerNetworkAttachmentByVlan) isaBareMetalServerNetworkAttachment() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentByVlan unmarshals an instance of BareMetalServerNetworkAttachmentByVlan from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentByVlan(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentByVlan) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityIntf interface { - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf - isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext : The virtual network interface for this target. -// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // bare metal server's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype : BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype struct -// This model "extends" BareMetalServerNetworkAttachmentPrototype -type BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype struct { - // The name for this bare metal server network attachment. Names must be unique within the bare metal server the - // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototypeInterfaceTypePciConst = "pci" -) - -// NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype : Instantiate BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf, interfaceType string) (_model *BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype, err error) { - _model = &BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype{ - VirtualNetworkInterface: virtualNetworkInterface, - InterfaceType: core.StringPtr(interfaceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPciPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype : BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype struct -// This model "extends" BareMetalServerNetworkAttachmentPrototype -type BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype struct { - // The name for this bare metal server network attachment. Names must be unique within the bare metal server the - // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // Indicates if the data path for the network attachment can float to another bare metal server. Can only be `true` for - // network attachments with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network attachment will be automatically deleted from this bare metal server and a new network attachment with - // the same `id`, `name` and `vlan` will be created on the other bare metal server. The virtual network interface for - // this network attachment will be automatically be attached to the new network attachment. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network attachment with `interface_type` of `pci` with `allowed_vlans` including - // this network attachment's `vlan`. - AllowToFloat *bool `json:"allow_to_float,omitempty"` - - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The IEEE 802.1Q VLAN ID that must be used for all traffic on this attachment. - Vlan *int64 `json:"vlan" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -const ( - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototypeInterfaceTypeVlanConst = "vlan" -) - -// NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype : Instantiate BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf, interfaceType string, vlan int64) (_model *BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype, err error) { - _model = &BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype{ - VirtualNetworkInterface: virtualNetworkInterface, - InterfaceType: core.StringPtr(interfaceType), - Vlan: core.Int64Ptr(vlan), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype) isaBareMetalServerNetworkAttachmentPrototype() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVlanPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_to_float", &obj.AllowToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceByHiperSocket : BareMetalServerNetworkInterfaceByHiperSocket struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByHiperSocket struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. - // - // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding - // network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated - // with the attached virtual network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the - // attached virtual network interface. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding - // network attachment. - Name *string `json:"name" validate:"required"` - - // The bare metal server network interface port speed in Mbps. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the port speed is that of its - // corresponding network attachment. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the security groups are associated - // with the attached virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a read-only representation of its - // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network interface type. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the type is that of its - // corresponding network attachment. - Type *string `json:"type" validate:"required"` - - // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByHiperSocketResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Status property. -// The status of the bare metal server network interface. -// -// If this bare metal server has network attachments, this network interface is a read-only representation of its -// corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). -const ( - BareMetalServerNetworkInterfaceByHiperSocketStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByHiperSocketStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByHiperSocketStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByHiperSocketStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.Type property. -// The bare metal server network interface type. -// -// If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the type is that of its -// corresponding network attachment. -const ( - BareMetalServerNetworkInterfaceByHiperSocketTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByHiperSocketTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByHiperSocket.InterfaceType property. -// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. -const ( - BareMetalServerNetworkInterfaceByHiperSocketInterfaceTypeHipersocketConst = "hipersocket" -) - -func (*BareMetalServerNetworkInterfaceByHiperSocket) isaBareMetalServerNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfaceByHiperSocket unmarshals an instance of BareMetalServerNetworkInterfaceByHiperSocket from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByHiperSocket(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByHiperSocket) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceByPci : BareMetalServerNetworkInterfaceByPci struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByPci struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. - // - // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding - // network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated - // with the attached virtual network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the - // attached virtual network interface. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding - // network attachment. - Name *string `json:"name" validate:"required"` - - // The bare metal server network interface port speed in Mbps. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the port speed is that of its - // corresponding network attachment. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the security groups are associated - // with the attached virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a read-only representation of its - // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network interface type. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the type is that of its - // corresponding network attachment. - Type *string `json:"type" validate:"required"` - - // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the - // `allow_vlans` of the corresponding network attachment. - AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` - - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByPciResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.Status property. -// The status of the bare metal server network interface. -// -// If this bare metal server has network attachments, this network interface is a read-only representation of its -// corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). -const ( - BareMetalServerNetworkInterfaceByPciStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByPciStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByPciStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByPciStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.Type property. -// The bare metal server network interface type. -// -// If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the type is that of its -// corresponding network attachment. -const ( - BareMetalServerNetworkInterfaceByPciTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByPciTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByPci.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -const ( - BareMetalServerNetworkInterfaceByPciInterfaceTypePciConst = "pci" -) - -func (*BareMetalServerNetworkInterfaceByPci) isaBareMetalServerNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfaceByPci unmarshals an instance of BareMetalServerNetworkInterfaceByPci from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByPci(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByPci) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfaceByVlan : BareMetalServerNetworkInterfaceByVlan struct -// This model "extends" BareMetalServerNetworkInterface -type BareMetalServerNetworkInterfaceByVlan struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the bare metal server network interface was created. - // - // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding - // network attachment was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - - // The floating IPs associated with this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated - // with the attached virtual network interface. - FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value - // will be an empty string. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the - // attached virtual network interface. - MacAddress *string `json:"mac_address" validate:"required"` - - // The name for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding - // network attachment. - Name *string `json:"name" validate:"required"` - - // The bare metal server network interface port speed in Mbps. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the port speed is that of its - // corresponding network attachment. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The security groups targeting this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the security groups are associated - // with the attached virtual network interface. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a read-only representation of its - // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - Status *string `json:"status" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The bare metal server network interface type. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the type is that of its - // corresponding network attachment. - Type *string `json:"type" validate:"required"` - - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the value of this property matches - // that of the `allow_to_float` property of the corresponding network attachment. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` - - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of - // the corresponding network attachment. - Vlan *int64 `json:"vlan" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.ResourceType property. -// The resource type. -const ( - BareMetalServerNetworkInterfaceByVlanResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Status property. -// The status of the bare metal server network interface. -// -// If this bare metal server has network attachments, this network interface is a read-only representation of its -// corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). -const ( - BareMetalServerNetworkInterfaceByVlanStatusAvailableConst = "available" - BareMetalServerNetworkInterfaceByVlanStatusDeletingConst = "deleting" - BareMetalServerNetworkInterfaceByVlanStatusFailedConst = "failed" - BareMetalServerNetworkInterfaceByVlanStatusPendingConst = "pending" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Type property. -// The bare metal server network interface type. -// -// If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its -// corresponding network attachment and its attached virtual network interface, and the type is that of its -// corresponding network attachment. -const ( - BareMetalServerNetworkInterfaceByVlanTypePrimaryConst = "primary" - BareMetalServerNetworkInterfaceByVlanTypeSecondaryConst = "secondary" -) - -// Constants associated with the BareMetalServerNetworkInterfaceByVlan.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -const ( - BareMetalServerNetworkInterfaceByVlanInterfaceTypeVlanConst = "vlan" -) - -func (*BareMetalServerNetworkInterfaceByVlan) isaBareMetalServerNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfaceByVlan unmarshals an instance of BareMetalServerNetworkInterfaceByVlan from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfaceByVlan) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity - // within a `s390x` based system. - // - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.InterfaceType property. -// - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity -// within a `s390x` based system. -// - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototypeInterfaceTypeHipersocketConst = "hipersocket" -) - -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // The VLAN IDs to allow for `vlan` interfaces using this PCI interface. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI interface - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI interface -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypePciConst = "pci" -) - -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(subnet SubnetIdentityIntf, interfaceType string) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct -// This model "extends" BareMetalServerNetworkInterfacePrototype -type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct { - // Indicates whether source IP spoofing is allowed on this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on - // the attached virtual network interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the bare metal server network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - `interface_type` must not be `hipersocket`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on - // the attached virtual network interface. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // The name for this bare metal server network interface. The name must not be used by another network interface on the - // bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the bare metal server network interface. This can be specified using an existing - // reserved IP, or a prototype object for a new reserved IP. - // - // If an existing reserved IP or a prototype object with an address is specified, it must be available on the bare - // metal server network interface's subnet. Otherwise, an available address on the subnet will be automatically - // selected and reserved. - PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The security groups to use for this bare metal server network interface. If unspecified, the VPC's default security - // group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for - // network interfaces with an `interface_type` of `vlan`. - // - // If `true`, and the network detects traffic for this data path on another bare metal server in the resource group, - // the network interface will be automatically deleted from this bare metal server and a new network interface with the - // same `id`, `name` and `vlan` will be created on the other bare metal server. - // - // For the data path to float, the other bare metal server must be in the same - // `resource_group`, and must have a network interface with `interface_type` of `pci` with `allowed_vlans` including - // this network interface's `vlan`. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the value of this property matches - // that of the `allow_to_float` property of the corresponding network attachment. - AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` - - // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array - // of `allowed_vlans`. - // - Must use an IEEE 802.1Q tag. - // - Has its own security groups and does not inherit those of the PCI device through - // which traffic flows. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type" validate:"required"` - - // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of - // the corresponding network attachment. - Vlan *int64 `json:"vlan" validate:"required"` -} - -// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.InterfaceType property. -// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array -// of `allowed_vlans`. -// - Must use an IEEE 802.1Q tag. -// - Has its own security groups and does not inherit those of the PCI device through -// which traffic flows. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeInterfaceTypeVlanConst = "vlan" -) - -// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(subnet SubnetIdentityIntf, interfaceType string, vlan int64) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype, err error) { - _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{ - Subnet: subnet, - InterfaceType: core.StringPtr(interfaceType), - Vlan: core.Int64Ptr(vlan), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype : BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype struct -// This model "extends" BareMetalServerPrimaryNetworkAttachmentPrototype -type BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype struct { - // The name for this bare metal server network attachment. Names must be unique within the bare metal server the - // network attachment resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - VirtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf `json:"virtual_network_interface" validate:"required"` - - // The VLAN IDs to allow for `vlan` attachments using this PCI attachment. - AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - - // - `pci`: a physical PCI device which can only be created or deleted when the bare metal - // server is stopped - // - Has an `allowed_vlans` property which controls the VLANs that will be permitted - // to use the PCI attachment - // - Cannot directly use an IEEE 802.1Q tag. - // - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - InterfaceType *string `json:"interface_type,omitempty"` -} - -// Constants associated with the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype.InterfaceType property. -// - `pci`: a physical PCI device which can only be created or deleted when the bare metal -// server is stopped -// - Has an `allowed_vlans` property which controls the VLANs that will be permitted -// to use the PCI attachment -// - Cannot directly use an IEEE 802.1Q tag. -// - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. -const ( - BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototypeInterfaceTypePciConst = "pci" -) - -// NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype : Instantiate BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(virtualNetworkInterface BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf) (_model *BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype, err error) { - _model = &BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype{ - VirtualNetworkInterface: virtualNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype) isaBareMetalServerPrimaryNetworkAttachmentPrototype() bool { - return true -} - -// UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype unmarshals an instance of BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype from the specified map of raw messages. -func UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPciPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidthDependent : The total bandwidth shared across the bare metal server network attachments or bare metal server network interfaces -// of a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileBandwidthDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileBandwidthDependent) isaBareMetalServerProfileBandwidth() bool { - return true -} - -// UnmarshalBareMetalServerProfileBandwidthDependent unmarshals an instance of BareMetalServerProfileBandwidthDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the bare metal server network attachments -// or bare metal server network interfaces of a bare metal server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileBandwidthEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileBandwidthEnum) isaBareMetalServerProfileBandwidth() bool { - return true -} - -// UnmarshalBareMetalServerProfileBandwidthEnum unmarshals an instance of BareMetalServerProfileBandwidthEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the bare metal server network attachments or bare metal -// server network interfaces of a bare metal server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileBandwidthFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileBandwidthFixed) isaBareMetalServerProfileBandwidth() bool { - return true -} - -// UnmarshalBareMetalServerProfileBandwidthFixed unmarshals an instance of BareMetalServerProfileBandwidthFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network attachments or network -// interfaces of a bare metal server with this profile. -// This model "extends" BareMetalServerProfileBandwidth -type BareMetalServerProfileBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileBandwidthRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileBandwidthRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileBandwidthRange) isaBareMetalServerProfileBandwidth() bool { - return true -} - -// UnmarshalBareMetalServerProfileBandwidthRange unmarshals an instance of BareMetalServerProfileBandwidthRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountDependent : The CPU core count for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileCpuCoreCountDependent) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountDependent unmarshals an instance of BareMetalServerProfileCpuCoreCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountEnum : The permitted values for CPU cores for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileCpuCoreCountEnum) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountEnum unmarshals an instance of BareMetalServerProfileCpuCoreCountEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountFixed : The CPU core count for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileCpuCoreCountFixed) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountFixed unmarshals an instance of BareMetalServerProfileCpuCoreCountFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuCoreCountRange : The permitted range for the number of CPU cores for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuCoreCount -type BareMetalServerProfileCpuCoreCountRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuCoreCountRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuCoreCountRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileCpuCoreCountRange) isaBareMetalServerProfileCpuCoreCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuCoreCountRange unmarshals an instance of BareMetalServerProfileCpuCoreCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuCoreCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuCoreCountRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuSocketCountDependent : The CPU socket count for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuSocketCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileCpuSocketCountDependent) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuSocketCountDependent unmarshals an instance of BareMetalServerProfileCpuSocketCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuSocketCountEnum : The permitted values for CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuSocketCountEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileCpuSocketCountEnum) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuSocketCountEnum unmarshals an instance of BareMetalServerProfileCpuSocketCountEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuSocketCountFixed : The number of CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuSocketCountFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileCpuSocketCountFixed) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuSocketCountFixed unmarshals an instance of BareMetalServerProfileCpuSocketCountFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileCpuSocketCountRange : The permitted range for the number of CPU sockets for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileCpuSocketCount -type BareMetalServerProfileCpuSocketCountRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileCpuSocketCountRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileCpuSocketCountRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileCpuSocketCountRange) isaBareMetalServerProfileCpuSocketCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileCpuSocketCountRange unmarshals an instance of BareMetalServerProfileCpuSocketCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileCpuSocketCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileCpuSocketCountRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskQuantityDependent : The number of disks of this configuration for a bare metal server with this profile depends on its bare metal server -// configuration. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskQuantityDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskQuantityDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileDiskQuantityDependent) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskQuantityDependent unmarshals an instance of BareMetalServerProfileDiskQuantityDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskQuantityEnum : The permitted the number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskQuantityEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskQuantityEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileDiskQuantityEnum) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskQuantityEnum unmarshals an instance of BareMetalServerProfileDiskQuantityEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskQuantityFixed : The number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskQuantityFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskQuantityFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileDiskQuantityFixed) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskQuantityFixed unmarshals an instance of BareMetalServerProfileDiskQuantityFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskQuantity -type BareMetalServerProfileDiskQuantityRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskQuantityRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskQuantityRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileDiskQuantityRange) isaBareMetalServerProfileDiskQuantity() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskQuantityRange unmarshals an instance of BareMetalServerProfileDiskQuantityRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskQuantityRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for a bare metal server with this profile depends on its bare -// metal server configuration. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskSizeDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileDiskSizeDependent) isaBareMetalServerProfileDiskSize() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskSizeDependent unmarshals an instance of BareMetalServerProfileDiskSizeDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskSizeEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileDiskSizeEnum) isaBareMetalServerProfileDiskSize() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskSizeEnum unmarshals an instance of BareMetalServerProfileDiskSizeEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSizeFixed : The size of the disk in GB (gigabytes). -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskSizeFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileDiskSizeFixed) isaBareMetalServerProfileDiskSize() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskSizeFixed unmarshals an instance of BareMetalServerProfileDiskSizeFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for a bare metal server with this -// profile. -// This model "extends" BareMetalServerProfileDiskSize -type BareMetalServerProfileDiskSizeRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileDiskSizeRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileDiskSizeRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileDiskSizeRange) isaBareMetalServerProfileDiskSize() bool { - return true -} - -// UnmarshalBareMetalServerProfileDiskSizeRange unmarshals an instance of BareMetalServerProfileDiskSizeRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileDiskSizeRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileIdentityByHref : BareMetalServerProfileIdentityByHref struct -// This model "extends" BareMetalServerProfileIdentity -type BareMetalServerProfileIdentityByHref struct { - // The URL for this bare metal server profile. - Href *string `json:"href" validate:"required"` -} - -// NewBareMetalServerProfileIdentityByHref : Instantiate BareMetalServerProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerProfileIdentityByHref(href string) (_model *BareMetalServerProfileIdentityByHref, err error) { - _model = &BareMetalServerProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerProfileIdentityByHref) isaBareMetalServerProfileIdentity() bool { - return true -} - -// UnmarshalBareMetalServerProfileIdentityByHref unmarshals an instance of BareMetalServerProfileIdentityByHref from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileIdentityByName : BareMetalServerProfileIdentityByName struct -// This model "extends" BareMetalServerProfileIdentity -type BareMetalServerProfileIdentityByName struct { - // The name for this bare metal server profile. - Name *string `json:"name" validate:"required"` -} - -// NewBareMetalServerProfileIdentityByName : Instantiate BareMetalServerProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerProfileIdentityByName(name string) (_model *BareMetalServerProfileIdentityByName, err error) { - _model = &BareMetalServerProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerProfileIdentityByName) isaBareMetalServerProfileIdentity() bool { - return true -} - -// UnmarshalBareMetalServerProfileIdentityByName unmarshals an instance of BareMetalServerProfileIdentityByName from the specified map of raw messages. -func UnmarshalBareMetalServerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemoryDependent : The memory value for a bare metal server with this profile depends on its configuration. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileMemoryDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileMemoryDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileMemoryDependent) isaBareMetalServerProfileMemory() bool { - return true -} - -// UnmarshalBareMetalServerProfileMemoryDependent unmarshals an instance of BareMetalServerProfileMemoryDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemoryEnum : The permitted memory values (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileMemoryEnum.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileMemoryEnumTypeEnumConst = "enum" -) - -func (*BareMetalServerProfileMemoryEnum) isaBareMetalServerProfileMemory() bool { - return true -} - -// UnmarshalBareMetalServerProfileMemoryEnum unmarshals an instance of BareMetalServerProfileMemoryEnum from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemoryFixed : The memory (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileMemoryFixed.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileMemoryFixedTypeFixedConst = "fixed" -) - -func (*BareMetalServerProfileMemoryFixed) isaBareMetalServerProfileMemory() bool { - return true -} - -// UnmarshalBareMetalServerProfileMemoryFixed unmarshals an instance of BareMetalServerProfileMemoryFixed from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileMemoryRange : The permitted memory range (in gibibytes) for a bare metal server with this profile. -// This model "extends" BareMetalServerProfileMemory -type BareMetalServerProfileMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileMemoryRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileMemoryRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileMemoryRange) isaBareMetalServerProfileMemory() bool { - return true -} - -// UnmarshalBareMetalServerProfileMemoryRange unmarshals an instance of BareMetalServerProfileMemoryRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkAttachmentCountDependent : The number of network attachments supported on a bare metal server with this profile is dependent on its -// configuration. -// This model "extends" BareMetalServerProfileNetworkAttachmentCount -type BareMetalServerProfileNetworkAttachmentCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileNetworkAttachmentCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkAttachmentCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileNetworkAttachmentCountDependent) isaBareMetalServerProfileNetworkAttachmentCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkAttachmentCountDependent unmarshals an instance of BareMetalServerProfileNetworkAttachmentCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkAttachmentCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkAttachmentCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkAttachmentCountRange : The number of network attachments supported on a bare metal server with this profile. -// This model "extends" BareMetalServerProfileNetworkAttachmentCount -type BareMetalServerProfileNetworkAttachmentCountRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileNetworkAttachmentCountRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkAttachmentCountRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileNetworkAttachmentCountRange) isaBareMetalServerProfileNetworkAttachmentCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkAttachmentCountRange unmarshals an instance of BareMetalServerProfileNetworkAttachmentCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkAttachmentCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkAttachmentCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkInterfaceCountDependent : The number of bare metal server network interfaces supported on a bare metal server with this profile is dependent on -// its configuration. -// This model "extends" BareMetalServerProfileNetworkInterfaceCount -type BareMetalServerProfileNetworkInterfaceCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileNetworkInterfaceCountDependent.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" -) - -func (*BareMetalServerProfileNetworkInterfaceCountDependent) isaBareMetalServerProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountDependent from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerProfileNetworkInterfaceCountRange : The number of bare metal server network interfaces supported on a bare metal server with this profile. -// This model "extends" BareMetalServerProfileNetworkInterfaceCount -type BareMetalServerProfileNetworkInterfaceCountRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the BareMetalServerProfileNetworkInterfaceCountRange.Type property. -// The type for this profile field. -const ( - BareMetalServerProfileNetworkInterfaceCountRangeTypeRangeConst = "range" -) - -func (*BareMetalServerProfileNetworkInterfaceCountRange) isaBareMetalServerProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalBareMetalServerProfileNetworkInterfaceCountRange unmarshals an instance of BareMetalServerProfileNetworkInterfaceCountRange from the specified map of raw messages. -func UnmarshalBareMetalServerProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerProfileNetworkInterfaceCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPrototypeBareMetalServerByNetworkAttachment : BareMetalServerPrototypeBareMetalServerByNetworkAttachment struct -// This model "extends" BareMetalServerPrototype -type BareMetalServerPrototypeBareMetalServerByNetworkAttachment struct { - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - - Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - - // The name for this bare metal server. The name must not be used by another bare metal server in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) to use for this bare metal - // server. - Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The zone this bare metal server will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the bare metal server. - NetworkAttachments []BareMetalServerNetworkAttachmentPrototypeIntf `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the bare metal server. - PrimaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf `json:"primary_network_attachment" validate:"required"` -} - -// NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment : Instantiate BareMetalServerPrototypeBareMetalServerByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerPrototypeBareMetalServerByNetworkAttachment(initialization *BareMetalServerInitializationPrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment BareMetalServerPrimaryNetworkAttachmentPrototypeIntf) (_model *BareMetalServerPrototypeBareMetalServerByNetworkAttachment, err error) { - _model = &BareMetalServerPrototypeBareMetalServerByNetworkAttachment{ - Initialization: initialization, - Profile: profile, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerPrototypeBareMetalServerByNetworkAttachment) isaBareMetalServerPrototype() bool { - return true -} - -// UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment unmarshals an instance of BareMetalServerPrototypeBareMetalServerByNetworkAttachment from the specified map of raw messages. -func UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrototypeBareMetalServerByNetworkAttachment) - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalBareMetalServerNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalBareMetalServerPrimaryNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerPrototypeBareMetalServerByNetworkInterface : BareMetalServerPrototypeBareMetalServerByNetworkInterface struct -// This model "extends" BareMetalServerPrototype -type BareMetalServerPrototypeBareMetalServerByNetworkInterface struct { - // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to - // boot. - EnableSecureBoot *bool `json:"enable_secure_boot,omitempty"` - - Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - - // The name for this bare metal server. The name must not be used by another bare metal server in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) to use for this bare metal - // server. - Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - TrustedPlatformModule *BareMetalServerTrustedPlatformModulePrototype `json:"trusted_platform_module,omitempty"` - - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The zone this bare metal server will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional bare metal server network interfaces to create. - NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` - - // The primary bare metal server network interface to create. - PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewBareMetalServerPrototypeBareMetalServerByNetworkInterface : Instantiate BareMetalServerPrototypeBareMetalServerByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerPrototypeBareMetalServerByNetworkInterface(initialization *BareMetalServerInitializationPrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype) (_model *BareMetalServerPrototypeBareMetalServerByNetworkInterface, err error) { - _model = &BareMetalServerPrototypeBareMetalServerByNetworkInterface{ - Initialization: initialization, - Profile: profile, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerPrototypeBareMetalServerByNetworkInterface) isaBareMetalServerPrototype() bool { - return true -} - -// UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface unmarshals an instance of BareMetalServerPrototypeBareMetalServerByNetworkInterface from the specified map of raw messages. -func UnmarshalBareMetalServerPrototypeBareMetalServerByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerPrototypeBareMetalServerByNetworkInterface) - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initialization", &obj.Initialization, UnmarshalBareMetalServerInitializationPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModulePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingIdentityCatalogOfferingByCRN : CatalogOfferingIdentityCatalogOfferingByCRN struct -// This model "extends" CatalogOfferingIdentity -type CatalogOfferingIdentityCatalogOfferingByCRN struct { - // The CRN for this - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} - -// NewCatalogOfferingIdentityCatalogOfferingByCRN : Instantiate CatalogOfferingIdentityCatalogOfferingByCRN (Generic Model Constructor) -func (*VpcV1) NewCatalogOfferingIdentityCatalogOfferingByCRN(crn string) (_model *CatalogOfferingIdentityCatalogOfferingByCRN, err error) { - _model = &CatalogOfferingIdentityCatalogOfferingByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CatalogOfferingIdentityCatalogOfferingByCRN) isaCatalogOfferingIdentity() bool { - return true -} - -// UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN unmarshals an instance of CatalogOfferingIdentityCatalogOfferingByCRN from the specified map of raw messages. -func UnmarshalCatalogOfferingIdentityCatalogOfferingByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingIdentityCatalogOfferingByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct -// This model "extends" CatalogOfferingVersionIdentity -type CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN struct { - // The CRN for this version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering. - CRN *string `json:"crn" validate:"required"` -} - -// NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN : Instantiate CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN (Generic Model Constructor) -func (*VpcV1) NewCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(crn string) (_model *CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN, err error) { - _model = &CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) isaCatalogOfferingVersionIdentity() bool { - return true -} - -// UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN unmarshals an instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN from the specified map of raw messages. -func UnmarshalCatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CertificateInstanceIdentityByCRN : CertificateInstanceIdentityByCRN struct -// This model "extends" CertificateInstanceIdentity -type CertificateInstanceIdentityByCRN struct { - // The CRN for this certificate instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewCertificateInstanceIdentityByCRN : Instantiate CertificateInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewCertificateInstanceIdentityByCRN(crn string) (_model *CertificateInstanceIdentityByCRN, err error) { - _model = &CertificateInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CertificateInstanceIdentityByCRN) isaCertificateInstanceIdentity() bool { - return true -} - -// UnmarshalCertificateInstanceIdentityByCRN unmarshals an instance of CertificateInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalCertificateInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketIdentityByCRN : CloudObjectStorageBucketIdentityByCRN struct -// This model "extends" CloudObjectStorageBucketIdentity -type CloudObjectStorageBucketIdentityByCRN struct { - // The CRN of this Cloud Object Storage bucket. - CRN *string `json:"crn" validate:"required"` -} - -// NewCloudObjectStorageBucketIdentityByCRN : Instantiate CloudObjectStorageBucketIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewCloudObjectStorageBucketIdentityByCRN(crn string) (_model *CloudObjectStorageBucketIdentityByCRN, err error) { - _model = &CloudObjectStorageBucketIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CloudObjectStorageBucketIdentityByCRN) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalCloudObjectStorageBucketIdentityByCRN unmarshals an instance of CloudObjectStorageBucketIdentityByCRN from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct -// This model "extends" CloudObjectStorageBucketIdentity -type CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) -func (*VpcV1) NewCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { - _model = &CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsInstanceIdentityByCRN : DnsInstanceIdentityByCRN struct -// This model "extends" DnsInstanceIdentity -type DnsInstanceIdentityByCRN struct { - // The CRN for this DNS instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewDnsInstanceIdentityByCRN : Instantiate DnsInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewDnsInstanceIdentityByCRN(crn string) (_model *DnsInstanceIdentityByCRN, err error) { - _model = &DnsInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DnsInstanceIdentityByCRN) isaDnsInstanceIdentity() bool { - return true -} - -// UnmarshalDnsInstanceIdentityByCRN unmarshals an instance of DnsInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalDnsInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DnsZoneIdentityByID : DnsZoneIdentityByID struct -// This model "extends" DnsZoneIdentity -type DnsZoneIdentityByID struct { - ID *string `json:"id" validate:"required"` -} - -// NewDnsZoneIdentityByID : Instantiate DnsZoneIdentityByID (Generic Model Constructor) -func (*VpcV1) NewDnsZoneIdentityByID(id string) (_model *DnsZoneIdentityByID, err error) { - _model = &DnsZoneIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DnsZoneIdentityByID) isaDnsZoneIdentity() bool { - return true -} - -// UnmarshalDnsZoneIdentityByID unmarshals an instance of DnsZoneIdentityByID from the specified map of raw messages. -func UnmarshalDnsZoneIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DnsZoneIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupIdentityByCRN : DedicatedHostGroupIdentityByCRN struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` -} - -// NewDedicatedHostGroupIdentityByCRN : Instantiate DedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByCRN(crn string) (_model *DedicatedHostGroupIdentityByCRN, err error) { - _model = &DedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostGroupIdentityByCRN) isaDedicatedHostGroupIdentity() bool { - return true -} - -// UnmarshalDedicatedHostGroupIdentityByCRN unmarshals an instance of DedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupIdentityByHref : DedicatedHostGroupIdentityByHref struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} - -// NewDedicatedHostGroupIdentityByHref : Instantiate DedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByHref(href string) (_model *DedicatedHostGroupIdentityByHref, err error) { - _model = &DedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostGroupIdentityByHref) isaDedicatedHostGroupIdentity() bool { - return true -} - -// UnmarshalDedicatedHostGroupIdentityByHref unmarshals an instance of DedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupIdentityByID : DedicatedHostGroupIdentityByID struct -// This model "extends" DedicatedHostGroupIdentity -type DedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} - -// NewDedicatedHostGroupIdentityByID : Instantiate DedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostGroupIdentityByID(id string) (_model *DedicatedHostGroupIdentityByID, err error) { - _model = &DedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostGroupIdentityByID) isaDedicatedHostGroupIdentity() bool { - return true -} - -// UnmarshalDedicatedHostGroupIdentityByID unmarshals an instance of DedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileIdentityByHref : DedicatedHostProfileIdentityByHref struct -// This model "extends" DedicatedHostProfileIdentity -type DedicatedHostProfileIdentityByHref struct { - // The URL for this dedicated host profile. - Href *string `json:"href" validate:"required"` -} - -// NewDedicatedHostProfileIdentityByHref : Instantiate DedicatedHostProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostProfileIdentityByHref(href string) (_model *DedicatedHostProfileIdentityByHref, err error) { - _model = &DedicatedHostProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostProfileIdentityByHref) isaDedicatedHostProfileIdentity() bool { - return true -} - -// UnmarshalDedicatedHostProfileIdentityByHref unmarshals an instance of DedicatedHostProfileIdentityByHref from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileIdentityByName : DedicatedHostProfileIdentityByName struct -// This model "extends" DedicatedHostProfileIdentity -type DedicatedHostProfileIdentityByName struct { - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` -} - -// NewDedicatedHostProfileIdentityByName : Instantiate DedicatedHostProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostProfileIdentityByName(name string) (_model *DedicatedHostProfileIdentityByName, err error) { - _model = &DedicatedHostProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostProfileIdentityByName) isaDedicatedHostProfileIdentity() bool { - return true -} - -// UnmarshalDedicatedHostProfileIdentityByName unmarshals an instance of DedicatedHostProfileIdentityByName from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileMemoryDependent : The memory value for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileMemoryDependent.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryDependentTypeDependentConst = "dependent" -) - -func (*DedicatedHostProfileMemoryDependent) isaDedicatedHostProfileMemory() bool { - return true -} - -// UnmarshalDedicatedHostProfileMemoryDependent unmarshals an instance of DedicatedHostProfileMemoryDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileMemoryEnum : The permitted memory values (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileMemoryEnum.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryEnumTypeEnumConst = "enum" -) - -func (*DedicatedHostProfileMemoryEnum) isaDedicatedHostProfileMemory() bool { - return true -} - -// UnmarshalDedicatedHostProfileMemoryEnum unmarshals an instance of DedicatedHostProfileMemoryEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileMemoryFixed : The memory (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileMemoryFixed.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryFixedTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileMemoryFixed) isaDedicatedHostProfileMemory() bool { - return true -} - -// UnmarshalDedicatedHostProfileMemoryFixed unmarshals an instance of DedicatedHostProfileMemoryFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileMemoryRange : The permitted memory range (in gibibytes) for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileMemory -type DedicatedHostProfileMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileMemoryRange.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryRangeTypeRangeConst = "range" -) - -func (*DedicatedHostProfileMemoryRange) isaDedicatedHostProfileMemory() bool { - return true -} - -// UnmarshalDedicatedHostProfileMemoryRange unmarshals an instance of DedicatedHostProfileMemoryRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileSocketDependent : The CPU socket count for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileSocketDependent.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketDependentTypeDependentConst = "dependent" -) - -func (*DedicatedHostProfileSocketDependent) isaDedicatedHostProfileSocket() bool { - return true -} - -// UnmarshalDedicatedHostProfileSocketDependent unmarshals an instance of DedicatedHostProfileSocketDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileSocketEnum : The permitted values for CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileSocketEnum.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketEnumTypeEnumConst = "enum" -) - -func (*DedicatedHostProfileSocketEnum) isaDedicatedHostProfileSocket() bool { - return true -} - -// UnmarshalDedicatedHostProfileSocketEnum unmarshals an instance of DedicatedHostProfileSocketEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileSocketFixed : The CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileSocketFixed.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketFixedTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileSocketFixed) isaDedicatedHostProfileSocket() bool { - return true -} - -// UnmarshalDedicatedHostProfileSocketFixed unmarshals an instance of DedicatedHostProfileSocketFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileSocketRange : The permitted range for CPU socket count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileSocket -type DedicatedHostProfileSocketRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileSocketRange.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketRangeTypeRangeConst = "range" -) - -func (*DedicatedHostProfileSocketRange) isaDedicatedHostProfileSocket() bool { - return true -} - -// UnmarshalDedicatedHostProfileSocketRange unmarshals an instance of DedicatedHostProfileSocketRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocketRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocketRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuDependent : The VCPU count for a dedicated host with this profile depends on its configuration. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuDependent.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuDependentTypeDependentConst = "dependent" -) - -func (*DedicatedHostProfileVcpuDependent) isaDedicatedHostProfileVcpu() bool { - return true -} - -// UnmarshalDedicatedHostProfileVcpuDependent unmarshals an instance of DedicatedHostProfileVcpuDependent from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuEnum : The permitted values for VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuEnum.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuEnumTypeEnumConst = "enum" -) - -func (*DedicatedHostProfileVcpuEnum) isaDedicatedHostProfileVcpu() bool { - return true -} - -// UnmarshalDedicatedHostProfileVcpuEnum unmarshals an instance of DedicatedHostProfileVcpuEnum from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuFixed : The VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuFixed.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuFixedTypeFixedConst = "fixed" -) - -func (*DedicatedHostProfileVcpuFixed) isaDedicatedHostProfileVcpu() bool { - return true -} - -// UnmarshalDedicatedHostProfileVcpuFixed unmarshals an instance of DedicatedHostProfileVcpuFixed from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostProfileVcpuRange : The permitted range for VCPU count for a dedicated host with this profile. -// This model "extends" DedicatedHostProfileVcpu -type DedicatedHostProfileVcpuRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the DedicatedHostProfileVcpuRange.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuRangeTypeRangeConst = "range" -) - -func (*DedicatedHostProfileVcpuRange) isaDedicatedHostProfileVcpu() bool { - return true -} - -// UnmarshalDedicatedHostProfileVcpuRange unmarshals an instance of DedicatedHostProfileVcpuRange from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostPrototypeDedicatedHostByGroup : DedicatedHostPrototypeDedicatedHostByGroup struct -// This model "extends" DedicatedHostPrototype -type DedicatedHostPrototypeDedicatedHostByGroup struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` - - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The dedicated host group for this dedicated host. - Group DedicatedHostGroupIdentityIntf `json:"group" validate:"required"` -} - -// NewDedicatedHostPrototypeDedicatedHostByGroup : Instantiate DedicatedHostPrototypeDedicatedHostByGroup (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByGroup(profile DedicatedHostProfileIdentityIntf, group DedicatedHostGroupIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByGroup, err error) { - _model = &DedicatedHostPrototypeDedicatedHostByGroup{ - Profile: profile, - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostPrototypeDedicatedHostByGroup) isaDedicatedHostPrototype() bool { - return true -} - -// UnmarshalDedicatedHostPrototypeDedicatedHostByGroup unmarshals an instance of DedicatedHostPrototypeDedicatedHostByGroup from the specified map of raw messages. -func UnmarshalDedicatedHostPrototypeDedicatedHostByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototypeDedicatedHostByGroup) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostPrototypeDedicatedHostByZone : DedicatedHostPrototypeDedicatedHostByZone struct -// This model "extends" DedicatedHostPrototype -type DedicatedHostPrototypeDedicatedHostByZone struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` - - // The name for this dedicated host. The name must not be used by another dedicated host in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Group *DedicatedHostGroupPrototypeDedicatedHostByZoneContext `json:"group,omitempty"` - - // The zone this dedicated host will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewDedicatedHostPrototypeDedicatedHostByZone : Instantiate DedicatedHostPrototypeDedicatedHostByZone (Generic Model Constructor) -func (*VpcV1) NewDedicatedHostPrototypeDedicatedHostByZone(profile DedicatedHostProfileIdentityIntf, zone ZoneIdentityIntf) (_model *DedicatedHostPrototypeDedicatedHostByZone, err error) { - _model = &DedicatedHostPrototypeDedicatedHostByZone{ - Profile: profile, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*DedicatedHostPrototypeDedicatedHostByZone) isaDedicatedHostPrototype() bool { - return true -} - -// UnmarshalDedicatedHostPrototypeDedicatedHostByZone unmarshals an instance of DedicatedHostPrototypeDedicatedHostByZone from the specified map of raw messages. -func UnmarshalDedicatedHostPrototypeDedicatedHostByZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototypeDedicatedHostByZone) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EncryptionKeyIdentityByCRN : EncryptionKeyIdentityByCRN struct -// This model "extends" EncryptionKeyIdentity -type EncryptionKeyIdentityByCRN struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn" validate:"required"` -} - -// NewEncryptionKeyIdentityByCRN : Instantiate EncryptionKeyIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewEncryptionKeyIdentityByCRN(crn string) (_model *EncryptionKeyIdentityByCRN, err error) { - _model = &EncryptionKeyIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EncryptionKeyIdentityByCRN) isaEncryptionKeyIdentity() bool { - return true -} - -// UnmarshalEncryptionKeyIdentityByCRN unmarshals an instance of EncryptionKeyIdentityByCRN from the specified map of raw messages. -func UnmarshalEncryptionKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPIdentity : Identifies a reserved IP by a unique property. -// Models which "extend" this model: -// - EndpointGatewayReservedIPReservedIPIdentityByID -// - EndpointGatewayReservedIPReservedIPIdentityByHref -// This model "extends" EndpointGatewayReservedIP -type EndpointGatewayReservedIPReservedIPIdentity struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} - -type EndpointGatewayReservedIPReservedIPIdentityIntf interface { - EndpointGatewayReservedIPIntf - isaEndpointGatewayReservedIPReservedIPIdentity() bool -} - -func (*EndpointGatewayReservedIPReservedIPIdentity) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPIdentity unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPPrototypeTargetContext : EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct -// This model "extends" EndpointGatewayReservedIP -type EndpointGatewayReservedIPReservedIPPrototypeTargetContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The subnet in which to create this reserved IP. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -} - -// NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext : Instantiate EndpointGatewayReservedIPReservedIPPrototypeTargetContext (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPPrototypeTargetContext(subnet SubnetIdentityIntf) (_model *EndpointGatewayReservedIPReservedIPPrototypeTargetContext, err error) { - _model = &EndpointGatewayReservedIPReservedIPPrototypeTargetContext{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayReservedIPReservedIPPrototypeTargetContext) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext unmarshals an instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPPrototypeTargetContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototypeProviderCloudServiceIdentity : EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN -// This model "extends" EndpointGatewayTargetPrototype -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentity struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` -} - -// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { - return true -} - -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityIntf interface { - EndpointGatewayTargetPrototypeIntf - isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool -} - -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) isaEndpointGatewayTargetPrototype() bool { - return true -} - -// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity : EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName -// This model "extends" EndpointGatewayTargetPrototype -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` -} - -// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { - return true -} - -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityIntf interface { - EndpointGatewayTargetPrototypeIntf - isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool -} - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) isaEndpointGatewayTargetPrototype() bool { - return true -} - -// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetProviderCloudServiceReference : EndpointGatewayTargetProviderCloudServiceReference struct -// This model "extends" EndpointGatewayTarget -type EndpointGatewayTargetProviderCloudServiceReference struct { - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn" validate:"required"` - - // The type of target. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetProviderCloudServiceReference.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetProviderCloudServiceReferenceResourceTypeProviderCloudServiceConst = "provider_cloud_service" -) - -func (*EndpointGatewayTargetProviderCloudServiceReference) isaEndpointGatewayTarget() bool { - return true -} - -// UnmarshalEndpointGatewayTargetProviderCloudServiceReference unmarshals an instance of EndpointGatewayTargetProviderCloudServiceReference from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetProviderCloudServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetProviderCloudServiceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetProviderInfrastructureServiceReference : The name of this provider infrastructure service. -// This model "extends" EndpointGatewayTarget -type EndpointGatewayTargetProviderInfrastructureServiceReference struct { - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name" validate:"required"` - - // The type of target. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetProviderInfrastructureServiceReference.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetProviderInfrastructureServiceReferenceResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -func (*EndpointGatewayTargetProviderInfrastructureServiceReference) isaEndpointGatewayTarget() bool { - return true -} - -// UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference unmarshals an instance of EndpointGatewayTargetProviderInfrastructureServiceReference from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetProviderInfrastructureServiceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetProviderInfrastructureServiceReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPPrototypeFloatingIPByTarget : FloatingIPPrototypeFloatingIPByTarget struct -// This model "extends" FloatingIPPrototype -type FloatingIPPrototypeFloatingIPByTarget struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The target resource to bind this floating IP to. - // - // The target resource must not already have a floating IP bound to it if the target - // resource is: - // - // - an instance network interface - // - a bare metal server network interface with `enable_infrastructure_nat` set to `true` - // - a virtual network interface with `enable_infrastructure_nat` set to `true`. - Target FloatingIPTargetPrototypeIntf `json:"target" validate:"required"` -} - -// NewFloatingIPPrototypeFloatingIPByTarget : Instantiate FloatingIPPrototypeFloatingIPByTarget (Generic Model Constructor) -func (*VpcV1) NewFloatingIPPrototypeFloatingIPByTarget(target FloatingIPTargetPrototypeIntf) (_model *FloatingIPPrototypeFloatingIPByTarget, err error) { - _model = &FloatingIPPrototypeFloatingIPByTarget{ - Target: target, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPPrototypeFloatingIPByTarget) isaFloatingIPPrototype() bool { - return true -} - -// UnmarshalFloatingIPPrototypeFloatingIPByTarget unmarshals an instance of FloatingIPPrototypeFloatingIPByTarget from the specified map of raw messages. -func UnmarshalFloatingIPPrototypeFloatingIPByTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototypeFloatingIPByTarget) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPPrototypeFloatingIPByZone : FloatingIPPrototypeFloatingIPByZone struct -// This model "extends" FloatingIPPrototype -type FloatingIPPrototypeFloatingIPByZone struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The zone this floating IP will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewFloatingIPPrototypeFloatingIPByZone : Instantiate FloatingIPPrototypeFloatingIPByZone (Generic Model Constructor) -func (*VpcV1) NewFloatingIPPrototypeFloatingIPByZone(zone ZoneIdentityIntf) (_model *FloatingIPPrototypeFloatingIPByZone, err error) { - _model = &FloatingIPPrototypeFloatingIPByZone{ - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPPrototypeFloatingIPByZone) isaFloatingIPPrototype() bool { - return true -} - -// UnmarshalFloatingIPPrototypeFloatingIPByZone unmarshals an instance of FloatingIPPrototypeFloatingIPByZone from the specified map of raw messages. -func UnmarshalFloatingIPPrototypeFloatingIPByZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototypeFloatingIPByZone) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPatch -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPatchIntf - isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPatch -type FloatingIPTargetPatchNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPatchNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPatchIntf - isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" FloatingIPTargetPatch -type FloatingIPTargetPatchVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPatchIntf - isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity : Identifies a bare metal server network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID -// - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPrototype -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPrototypeIntf - isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FloatingIPTargetPrototype -type FloatingIPTargetPrototypeNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPrototypeNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPrototypeIntf - isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" FloatingIPTargetPrototype -type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { - FloatingIPTargetPrototypeIntf - isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetBareMetalServerNetworkInterfaceReference : FloatingIPTargetBareMetalServerNetworkInterfaceReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetBareMetalServerNetworkInterfaceReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FloatingIPTargetBareMetalServerNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetBareMetalServerNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FloatingIPTargetBareMetalServerNetworkInterfaceReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference unmarshals an instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetBareMetalServerNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetBareMetalServerNetworkInterfaceReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetNetworkInterfaceReference : FloatingIPTargetNetworkInterfaceReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetNetworkInterfaceReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FloatingIPTargetNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetNetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FloatingIPTargetNetworkInterfaceReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetNetworkInterfaceReference unmarshals an instance of FloatingIPTargetNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetNetworkInterfaceReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPublicGatewayReference : FloatingIPTargetPublicGatewayReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetPublicGatewayReference struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` - - // The name for this public gateway. The name is unique across all public gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FloatingIPTargetPublicGatewayReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetPublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" -) - -func (*FloatingIPTargetPublicGatewayReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetPublicGatewayReference unmarshals an instance of FloatingIPTargetPublicGatewayReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPublicGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetVirtualNetworkInterfaceReference : FloatingIPTargetVirtualNetworkInterfaceReference struct -// This model "extends" FloatingIPTarget -type FloatingIPTargetVirtualNetworkInterfaceReference struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VirtualNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The primary IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the FloatingIPTargetVirtualNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - FloatingIPTargetVirtualNetworkInterfaceReferenceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -func (*FloatingIPTargetVirtualNetworkInterfaceReference) isaFloatingIPTarget() bool { - return true -} - -// UnmarshalFloatingIPTargetVirtualNetworkInterfaceReference unmarshals an instance of FloatingIPTargetVirtualNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalFloatingIPTargetVirtualNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetVirtualNetworkInterfaceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN -// - FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeInstanceIdentity struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeInstanceIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity : Identifies an instance network attachment by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID -// - FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity struct { - // The unique identifier for this instance network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this instance network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity : Identifies an instance network interface by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentity : Identifies a subnet by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN -// - FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeSubnetIdentity struct { - // The unique identifier for this subnet. - ID *string `json:"id,omitempty"` - - // The CRN for this subnet. - CRN *string `json:"crn,omitempty"` - - // The URL for this subnet. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeSubnetIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentity : Identifies a VPC by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN -// - FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeVPCIdentity struct { - // The unique identifier for this VPC. - ID *string `json:"id,omitempty"` - - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeVPCIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeVPCIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" FlowLogCollectorTargetPrototype -type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { - FlowLogCollectorTargetPrototypeIntf - isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetInstanceNetworkAttachmentReference : FlowLogCollectorTargetInstanceNetworkAttachmentReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetInstanceNetworkAttachmentReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceNetworkAttachmentReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network attachment. The name is unique across all network attachments for the instance. - Name *string `json:"name" validate:"required"` - - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetInstanceNetworkAttachmentReference.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetInstanceNetworkAttachmentReferenceResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" -) - -func (*FlowLogCollectorTargetInstanceNetworkAttachmentReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference unmarshals an instance of FlowLogCollectorTargetInstanceNetworkAttachmentReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetInstanceNetworkAttachmentReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceNetworkAttachmentReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetInstanceReference : FlowLogCollectorTargetInstanceReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetInstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -func (*FlowLogCollectorTargetInstanceReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetInstanceReference unmarshals an instance of FlowLogCollectorTargetInstanceReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext : FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetSubnetReference : FlowLogCollectorTargetSubnetReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetSubnetReference struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this subnet. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` - - // The name for this subnet. The name is unique across all subnets in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetSubnetReference.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetSubnetReferenceResourceTypeSubnetConst = "subnet" -) - -func (*FlowLogCollectorTargetSubnetReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetSubnetReference unmarshals an instance of FlowLogCollectorTargetSubnetReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetSubnetReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetVPCReference : FlowLogCollectorTargetVPCReference struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetVPCReference struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPC. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` - - // The name for this VPC. The name is unique across all VPCs in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetVPCReference.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetVPCReferenceResourceTypeVPCConst = "vpc" -) - -func (*FlowLogCollectorTargetVPCReference) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetVPCReference unmarshals an instance of FlowLogCollectorTargetVPCReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetVPCReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext : FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext struct -// This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext.ResourceType property. -// The resource type. -const ( - FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -func (*FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext) isaFlowLogCollectorTarget() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext unmarshals an instance of FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByCRN : ImageIdentityByCRN struct -// This model "extends" ImageIdentity -type ImageIdentityByCRN struct { - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` -} - -// NewImageIdentityByCRN : Instantiate ImageIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByCRN(crn string) (_model *ImageIdentityByCRN, err error) { - _model = &ImageIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByCRN) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByCRN unmarshals an instance of ImageIdentityByCRN from the specified map of raw messages. -func UnmarshalImageIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByHref : ImageIdentityByHref struct -// This model "extends" ImageIdentity -type ImageIdentityByHref struct { - // The URL for this image. - Href *string `json:"href" validate:"required"` -} - -// NewImageIdentityByHref : Instantiate ImageIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByHref(href string) (_model *ImageIdentityByHref, err error) { - _model = &ImageIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByHref) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByHref unmarshals an instance of ImageIdentityByHref from the specified map of raw messages. -func UnmarshalImageIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageIdentityByID : ImageIdentityByID struct -// This model "extends" ImageIdentity -type ImageIdentityByID struct { - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` -} - -// NewImageIdentityByID : Instantiate ImageIdentityByID (Generic Model Constructor) -func (*VpcV1) NewImageIdentityByID(id string) (_model *ImageIdentityByID, err error) { - _model = &ImageIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImageIdentityByID) isaImageIdentity() bool { - return true -} - -// UnmarshalImageIdentityByID unmarshals an instance of ImageIdentityByID from the specified map of raw messages. -func UnmarshalImageIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImagePrototypeImageByFile : ImagePrototypeImageByFile struct -// This model "extends" ImagePrototype -type ImagePrototypeImageByFile struct { - // The deprecation date and time to set for this image. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). - // - // If unspecified, no deprecation date and time will be set. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). - // - // If unspecified, no obsolescence date and time will be set. - // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. - // - // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be - // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the - // [Hyper Protect Crypto Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` - - // The root key that was used to wrap the data key (which is ultimately represented as - // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes - // created from this image (unless an alternate `encryption_key` is specified at volume - // creation). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The file from which to create the image. - File *ImageFilePrototype `json:"file" validate:"required"` - - // The [supported operating - // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this - // image. - OperatingSystem OperatingSystemIdentityIntf `json:"operating_system" validate:"required"` -} - -// NewImagePrototypeImageByFile : Instantiate ImagePrototypeImageByFile (Generic Model Constructor) -func (*VpcV1) NewImagePrototypeImageByFile(file *ImageFilePrototype, operatingSystem OperatingSystemIdentityIntf) (_model *ImagePrototypeImageByFile, err error) { - _model = &ImagePrototypeImageByFile{ - File: file, - OperatingSystem: operatingSystem, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImagePrototypeImageByFile) isaImagePrototype() bool { - return true -} - -// UnmarshalImagePrototypeImageByFile unmarshals an instance of ImagePrototypeImageByFile from the specified map of raw messages. -func UnmarshalImagePrototypeImageByFile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototypeImageByFile) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImagePrototypeImageBySourceVolume : ImagePrototypeImageBySourceVolume struct -// This model "extends" ImagePrototype -type ImagePrototypeImageBySourceVolume struct { - // The deprecation date and time to set for this image. - // - // The date and time must not be in the past, and must be earlier than `obsolescence_at` - // (if `obsolescence_at` is set). - // - // If unspecified, no deprecation date and time will be set. - // - // If the deprecation date and time is reached while the image has a status of `pending`, the image's status will - // transition to `deprecated` upon its successful creation (or - // `obsolete` if the obsolescence date and time was also reached). - DeprecationAt *strfmt.DateTime `json:"deprecation_at,omitempty"` - - // The name for this image. The name must not be used by another image in the region. Names starting with `ibm-` are - // reserved for system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // The obsolescence date and time to set for this image. - // - // The date and time must not be in the past, and must be later than `deprecation_at` (if - // `deprecation_at` is set). - // - // If unspecified, no obsolescence date and time will be set. - // - // If the obsolescence date and time is reached while the image has a status of - // `pending`, the image's status will transition to `obsolete` upon its successful creation. - ObsolescenceAt *strfmt.DateTime `json:"obsolescence_at,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The root key used to wrap the system-generated data encryption key for the image. - // - // If unspecified, the root key from `source_volume` will be used. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The volume from which to create the image. The specified volume must: - // - Have an `operating_system`, which will be used to populate this image's - // operating system information. - // - Not be `active` or `busy`. - // - // During image creation, the specified volume may briefly become `busy`. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` -} - -// NewImagePrototypeImageBySourceVolume : Instantiate ImagePrototypeImageBySourceVolume (Generic Model Constructor) -func (*VpcV1) NewImagePrototypeImageBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *ImagePrototypeImageBySourceVolume, err error) { - _model = &ImagePrototypeImageBySourceVolume{ - SourceVolume: sourceVolume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ImagePrototypeImageBySourceVolume) isaImagePrototype() bool { - return true -} - -// UnmarshalImagePrototypeImageBySourceVolume unmarshals an instance of ImagePrototypeImageBySourceVolume from the specified map of raw messages. -func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototypeImageBySourceVolume) - err = core.UnmarshalPrimitive(m, "deprecation_at", &obj.DeprecationAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "obsolescence_at", &obj.ObsolescenceAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOfferingPrototypeCatalogOfferingByOffering : InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct -// This model "extends" InstanceCatalogOfferingPrototype -type InstanceCatalogOfferingPrototypeCatalogOfferingByOffering struct { - // Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering by a unique property. - Offering CatalogOfferingIdentityIntf `json:"offering" validate:"required"` -} - -// NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByOffering (Generic Model Constructor) -func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(offering CatalogOfferingIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByOffering, err error) { - _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByOffering{ - Offering: offering, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) isaInstanceCatalogOfferingPrototype() bool { - return true -} - -// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByOffering) - err = core.UnmarshalModel(m, "offering", &obj.Offering, UnmarshalCatalogOfferingIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceCatalogOfferingPrototypeCatalogOfferingByVersion : InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct -// This model "extends" InstanceCatalogOfferingPrototype -type InstanceCatalogOfferingPrototypeCatalogOfferingByVersion struct { - // Identifies a version of a - // [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a - // unique property. - Version CatalogOfferingVersionIdentityIntf `json:"version" validate:"required"` -} - -// NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion : Instantiate InstanceCatalogOfferingPrototypeCatalogOfferingByVersion (Generic Model Constructor) -func (*VpcV1) NewInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(version CatalogOfferingVersionIdentityIntf) (_model *InstanceCatalogOfferingPrototypeCatalogOfferingByVersion, err error) { - _model = &InstanceCatalogOfferingPrototypeCatalogOfferingByVersion{ - Version: version, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) isaInstanceCatalogOfferingPrototype() bool { - return true -} - -// UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion unmarshals an instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion from the specified map of raw messages. -func UnmarshalInstanceCatalogOfferingPrototypeCatalogOfferingByVersion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCatalogOfferingPrototypeCatalogOfferingByVersion) - err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalCatalogOfferingVersionIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototype : InstanceGroupManagerActionPrototypeScheduledActionPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -// This model "extends" InstanceGroupManagerActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf interface { - InstanceGroupManagerActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionScheduledAction : InstanceGroupManagerActionScheduledAction struct -// Models which "extend" this model: -// - InstanceGroupManagerActionScheduledActionGroupTarget -// - InstanceGroupManagerActionScheduledActionManagerTarget -// This model "extends" InstanceGroupManagerAction -type InstanceGroupManagerActionScheduledAction struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` - - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` - - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` -} - -// Constants associated with the InstanceGroupManagerActionScheduledAction.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// Constants associated with the InstanceGroupManagerActionScheduledAction.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionStatusOmittedConst = "omitted" -) - -// Constants associated with the InstanceGroupManagerActionScheduledAction.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionActionTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerActionScheduledAction() bool { - return true -} - -type InstanceGroupManagerActionScheduledActionIntf interface { - InstanceGroupManagerActionIntf - isaInstanceGroupManagerActionScheduledAction() bool -} - -func (*InstanceGroupManagerActionScheduledAction) isaInstanceGroupManagerAction() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionScheduledAction unmarshals an instance of InstanceGroupManagerActionScheduledAction from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledAction) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerAutoScale : InstanceGroupManagerAutoScale struct -// This model "extends" InstanceGroupManager -type InstanceGroupManagerAutoScale struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window" validate:"required"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown" validate:"required"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count" validate:"required"` - - // The policies of the instance group manager. - Policies []InstanceGroupManagerPolicyReference `json:"policies" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerAutoScale.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerAutoScaleManagerTypeAutoscaleConst = "autoscale" -) - -func (*InstanceGroupManagerAutoScale) isaInstanceGroupManager() bool { - return true -} - -// UnmarshalInstanceGroupManagerAutoScale unmarshals an instance of InstanceGroupManagerAutoScale from the specified map of raw messages. -func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerAutoScale) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct -// This model "extends" InstanceGroupManagerPolicyPrototype -type InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct { - // The name for this instance group manager policy. The name must not be used by another policy for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type" validate:"required"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value" validate:"required"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypePolicyTypeTargetConst = "target" -) - -// NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype : Instantiate InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(metricType string, metricValue int64, policyType string) (_model *InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype, err error) { - _model = &InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype{ - MetricType: core.StringPtr(metricType), - MetricValue: core.Int64Ptr(metricValue), - PolicyType: core.StringPtr(policyType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy : InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct -// This model "extends" InstanceGroupManagerPolicy -type InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager policy. The name is unique across all policies for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager policy was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type" validate:"required"` - - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value" validate:"required"` - - // The type of policy for the instance group. - PolicyType *string `json:"policy_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyMetricTypeNetworkOutConst = "network_out" -) - -// Constants associated with the InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicyPolicyTypeTargetConst = "target" -) - -func (*InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) isaInstanceGroupManagerPolicy() bool { - return true -} - -// UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy unmarshals an instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct -// This model "extends" InstanceGroupManagerPrototype -type InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` - - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count" validate:"required"` - - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} - -// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototypeManagerTypeAutoscaleConst = "autoscale" -) - -// NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(managerType string, maxMembershipCount int64) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype, err error) { - _model = &InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype{ - ManagerType: core.StringPtr(managerType), - MaxMembershipCount: core.Int64Ptr(maxMembershipCount), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) isaInstanceGroupManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct -// This model "extends" InstanceGroupManagerPrototype -type InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The name for this instance group manager. The name must not be used by another manager for the instance group. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototypeManagerTypeScheduledConst = "scheduled" -) - -// NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype : Instantiate InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(managerType string) (_model *InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype, err error) { - _model = &InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype{ - ManagerType: core.StringPtr(managerType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) isaInstanceGroupManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype unmarshals an instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduled : InstanceGroupManagerScheduled struct -// This model "extends" InstanceGroupManager -type InstanceGroupManagerScheduled struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The actions of the instance group manager. - Actions []InstanceGroupManagerActionReference `json:"actions" validate:"required"` - - // The type of instance group manager. - ManagerType *string `json:"manager_type" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerScheduled.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerScheduledManagerTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerScheduled) isaInstanceGroupManager() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduled unmarshals an instance of InstanceGroupManagerScheduled from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduled(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduled) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerAutoScale : InstanceGroupManagerScheduledActionManagerAutoScale struct -// This model "extends" InstanceGroupManagerScheduledActionManager -type InstanceGroupManagerScheduledActionManagerAutoScale struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager. The name is unique across all managers for the instance group. - Name *string `json:"name" validate:"required"` - - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -} - -func (*InstanceGroupManagerScheduledActionManagerAutoScale) isaInstanceGroupManagerScheduledActionManager() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale unmarshals an instance of InstanceGroupManagerScheduledActionManagerAutoScale from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerAutoScale) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype : The auto scale manager to update, and one or more properties to be updated. Either `id` or `href` must be specified, -// in addition to at least one of `min_membership_count` and -// `max_membership_count`. -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { - return true -} - -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeIntf interface { - InstanceGroupManagerScheduledActionManagerPrototypeIntf - isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterface -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityIntf interface { - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceIntf - isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext : The virtual network interface for this target. -// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterface -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // virtual server instance's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePatchProfileInstanceProfileIdentityByHref : InstancePatchProfileInstanceProfileIdentityByHref struct -// This model "extends" InstancePatchProfile -type InstancePatchProfileInstanceProfileIdentityByHref struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePatchProfileInstanceProfileIdentityByHref : Instantiate InstancePatchProfileInstanceProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByHref(href string) (_model *InstancePatchProfileInstanceProfileIdentityByHref, err error) { - _model = &InstancePatchProfileInstanceProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePatchProfileInstanceProfileIdentityByHref) isaInstancePatchProfile() bool { - return true -} - -// UnmarshalInstancePatchProfileInstanceProfileIdentityByHref unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePatchProfileInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfileInstanceProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePatchProfileInstanceProfileIdentityByName : InstancePatchProfileInstanceProfileIdentityByName struct -// This model "extends" InstancePatchProfile -type InstancePatchProfileInstanceProfileIdentityByName struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` -} - -// NewInstancePatchProfileInstanceProfileIdentityByName : Instantiate InstancePatchProfileInstanceProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewInstancePatchProfileInstanceProfileIdentityByName(name string) (_model *InstancePatchProfileInstanceProfileIdentityByName, err error) { - _model = &InstancePatchProfileInstanceProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePatchProfileInstanceProfileIdentityByName) isaInstancePatchProfile() bool { - return true -} - -// UnmarshalInstancePatchProfileInstanceProfileIdentityByName unmarshals an instance of InstancePatchProfileInstanceProfileIdentityByName from the specified map of raw messages. -func UnmarshalInstancePatchProfileInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfileInstanceProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN -// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref -// This model "extends" InstancePlacementTargetPatch -type InstancePlacementTargetPatchDedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -type InstancePlacementTargetPatchDedicatedHostGroupIdentityIntf interface { - InstancePlacementTargetPatchIntf - isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostIdentity : Identifies a dedicated host by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN -// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref -// This model "extends" InstancePlacementTargetPatch -type InstancePlacementTargetPatchDedicatedHostIdentity struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} - -type InstancePlacementTargetPatchDedicatedHostIdentityIntf interface { - InstancePlacementTargetPatchIntf - isaInstancePlacementTargetPatchDedicatedHostIdentity() bool -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentity : Identifies a dedicated host by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN -// - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypeDedicatedHostIdentity struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -type InstancePlacementTargetPrototypeDedicatedHostIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentity) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentity : Identifies a placement group by a unique property. -// Models which "extend" this model: -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN -// - InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref -// This model "extends" InstancePlacementTargetPrototype -type InstancePlacementTargetPrototypePlacementGroupIdentity struct { - // The unique identifier for this placement group. - ID *string `json:"id,omitempty"` - - // The CRN for this placement group. - CRN *string `json:"crn,omitempty"` - - // The URL for this placement group. - Href *string `json:"href,omitempty"` -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -type InstancePlacementTargetPrototypePlacementGroupIdentityIntf interface { - InstancePlacementTargetPrototypeIntf - isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentity) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentity from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetDedicatedHostGroupReference : InstancePlacementTargetDedicatedHostGroupReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetDedicatedHostGroupReference struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host group. The name is unique across all dedicated host groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstancePlacementTargetDedicatedHostGroupReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetDedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) - -func (*InstancePlacementTargetDedicatedHostGroupReference) isaInstancePlacementTarget() bool { - return true -} - -// UnmarshalInstancePlacementTargetDedicatedHostGroupReference unmarshals an instance of InstancePlacementTargetDedicatedHostGroupReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetDedicatedHostGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetDedicatedHostReference : InstancePlacementTargetDedicatedHostReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetDedicatedHostReference struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` - - // The name for this dedicated host. The name is unique across all dedicated hosts in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstancePlacementTargetDedicatedHostReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetDedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" -) - -func (*InstancePlacementTargetDedicatedHostReference) isaInstancePlacementTarget() bool { - return true -} - -// UnmarshalInstancePlacementTargetDedicatedHostReference unmarshals an instance of InstancePlacementTargetDedicatedHostReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetDedicatedHostReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPlacementGroupReference : InstancePlacementTargetPlacementGroupReference struct -// This model "extends" InstancePlacementTarget -type InstancePlacementTargetPlacementGroupReference struct { - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *PlacementGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this placement group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` - - // The name for this placement group. The name is unique across all placement groups in the region. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the InstancePlacementTargetPlacementGroupReference.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetPlacementGroupReferenceResourceTypePlacementGroupConst = "placement_group" -) - -func (*InstancePlacementTargetPlacementGroupReference) isaInstancePlacementTarget() bool { - return true -} - -// UnmarshalInstancePlacementTargetPlacementGroupReference unmarshals an instance of InstancePlacementTargetPlacementGroupReference from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPlacementGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPlacementGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPlacementGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileBandwidthDependent : The total bandwidth shared across the network attachments or network interfaces and storage volumes of an instance -// with this profile depends on its configuration. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileBandwidthDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileBandwidthDependent) isaInstanceProfileBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileBandwidthDependent unmarshals an instance of InstanceProfileBandwidthDependent from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the network attachments or network -// interfaces and storage volumes of an instance with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileBandwidthEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileBandwidthEnum) isaInstanceProfileBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileBandwidthEnum unmarshals an instance of InstanceProfileBandwidthEnum from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the network attachments or network interfaces and storage -// volumes of an instance with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileBandwidthFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileBandwidthFixed) isaInstanceProfileBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileBandwidthFixed unmarshals an instance of InstanceProfileBandwidthFixed from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network attachments or network -// interfaces and storage volumes of an instance with this profile. -// This model "extends" InstanceProfileBandwidth -type InstanceProfileBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileBandwidthRange.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthRangeTypeRangeConst = "range" -) - -func (*InstanceProfileBandwidthRange) isaInstanceProfileBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileBandwidthRange unmarshals an instance of InstanceProfileBandwidthRange from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskQuantityDependent : The number of disks of this configuration for an instance with this profile depends on its instance configuration. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskQuantityDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskQuantityDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileDiskQuantityDependent) isaInstanceProfileDiskQuantity() bool { - return true -} - -// UnmarshalInstanceProfileDiskQuantityDependent unmarshals an instance of InstanceProfileDiskQuantityDependent from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskQuantityEnum : The permitted the number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskQuantityEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskQuantityEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileDiskQuantityEnum) isaInstanceProfileDiskQuantity() bool { - return true -} - -// UnmarshalInstanceProfileDiskQuantityEnum unmarshals an instance of InstanceProfileDiskQuantityEnum from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskQuantityFixed : The number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskQuantityFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskQuantityFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileDiskQuantityFixed) isaInstanceProfileDiskQuantity() bool { - return true -} - -// UnmarshalInstanceProfileDiskQuantityFixed unmarshals an instance of InstanceProfileDiskQuantityFixed from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskQuantity -type InstanceProfileDiskQuantityRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskQuantityRange.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskQuantityRangeTypeRangeConst = "range" -) - -func (*InstanceProfileDiskQuantityRange) isaInstanceProfileDiskQuantity() bool { - return true -} - -// UnmarshalInstanceProfileDiskQuantityRange unmarshals an instance of InstanceProfileDiskQuantityRange from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantityRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for an instance with this profile depends on its instance -// configuration. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskSizeDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileDiskSizeDependent) isaInstanceProfileDiskSize() bool { - return true -} - -// UnmarshalInstanceProfileDiskSizeDependent unmarshals an instance of InstanceProfileDiskSizeDependent from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for an instance with this profile. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskSizeEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileDiskSizeEnum) isaInstanceProfileDiskSize() bool { - return true -} - -// UnmarshalInstanceProfileDiskSizeEnum unmarshals an instance of InstanceProfileDiskSizeEnum from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSizeFixed : The size of the disk in GB (gigabytes). -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskSizeFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileDiskSizeFixed) isaInstanceProfileDiskSize() bool { - return true -} - -// UnmarshalInstanceProfileDiskSizeFixed unmarshals an instance of InstanceProfileDiskSizeFixed from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for an instance with this profile. -// This model "extends" InstanceProfileDiskSize -type InstanceProfileDiskSizeRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileDiskSizeRange.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeRangeTypeRangeConst = "range" -) - -func (*InstanceProfileDiskSizeRange) isaInstanceProfileDiskSize() bool { - return true -} - -// UnmarshalInstanceProfileDiskSizeRange unmarshals an instance of InstanceProfileDiskSizeRange from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSizeRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuDependent : The GPU count for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileGpuDependent) isaInstanceProfileGpu() bool { - return true -} - -// UnmarshalInstanceProfileGpuDependent unmarshals an instance of InstanceProfileGpuDependent from the specified map of raw messages. -func UnmarshalInstanceProfileGpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuEnum : The permitted GPU count values for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileGpuEnum) isaInstanceProfileGpu() bool { - return true -} - -// UnmarshalInstanceProfileGpuEnum unmarshals an instance of InstanceProfileGpuEnum from the specified map of raw messages. -func UnmarshalInstanceProfileGpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuFixed : The GPU count for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileGpuFixed) isaInstanceProfileGpu() bool { - return true -} - -// UnmarshalInstanceProfileGpuFixed unmarshals an instance of InstanceProfileGpuFixed from the specified map of raw messages. -func UnmarshalInstanceProfileGpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemoryDependent : The overall GPU memory value for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuMemoryDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileGpuMemoryDependent) isaInstanceProfileGpuMemory() bool { - return true -} - -// UnmarshalInstanceProfileGpuMemoryDependent unmarshals an instance of InstanceProfileGpuMemoryDependent from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemoryEnum : The permitted overall GPU memory values in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuMemoryEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileGpuMemoryEnum) isaInstanceProfileGpuMemory() bool { - return true -} - -// UnmarshalInstanceProfileGpuMemoryEnum unmarshals an instance of InstanceProfileGpuMemoryEnum from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemoryFixed : The overall GPU memory in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuMemoryFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileGpuMemoryFixed) isaInstanceProfileGpuMemory() bool { - return true -} - -// UnmarshalInstanceProfileGpuMemoryFixed unmarshals an instance of InstanceProfileGpuMemoryFixed from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuMemoryRange : The permitted overall GPU memory range in GiB (gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileGpuMemory -type InstanceProfileGpuMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuMemoryRange.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuMemoryRangeTypeRangeConst = "range" -) - -func (*InstanceProfileGpuMemoryRange) isaInstanceProfileGpuMemory() bool { - return true -} - -// UnmarshalInstanceProfileGpuMemoryRange unmarshals an instance of InstanceProfileGpuMemoryRange from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileGpuRange : The permitted GPU count range for an instance with this profile. -// This model "extends" InstanceProfileGpu -type InstanceProfileGpuRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileGpuRange.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuRangeTypeRangeConst = "range" -) - -func (*InstanceProfileGpuRange) isaInstanceProfileGpu() bool { - return true -} - -// UnmarshalInstanceProfileGpuRange unmarshals an instance of InstanceProfileGpuRange from the specified map of raw messages. -func UnmarshalInstanceProfileGpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileIdentityByHref : InstanceProfileIdentityByHref struct -// This model "extends" InstanceProfileIdentity -type InstanceProfileIdentityByHref struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceProfileIdentityByHref : Instantiate InstanceProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceProfileIdentityByHref(href string) (_model *InstanceProfileIdentityByHref, err error) { - _model = &InstanceProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceProfileIdentityByHref) isaInstanceProfileIdentity() bool { - return true -} - -// UnmarshalInstanceProfileIdentityByHref unmarshals an instance of InstanceProfileIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileIdentityByName : InstanceProfileIdentityByName struct -// This model "extends" InstanceProfileIdentity -type InstanceProfileIdentityByName struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` -} - -// NewInstanceProfileIdentityByName : Instantiate InstanceProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewInstanceProfileIdentityByName(name string) (_model *InstanceProfileIdentityByName, err error) { - _model = &InstanceProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceProfileIdentityByName) isaInstanceProfileIdentity() bool { - return true -} - -// UnmarshalInstanceProfileIdentityByName unmarshals an instance of InstanceProfileIdentityByName from the specified map of raw messages. -func UnmarshalInstanceProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemoryDependent : The memory value for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileMemoryDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileMemoryDependent) isaInstanceProfileMemory() bool { - return true -} - -// UnmarshalInstanceProfileMemoryDependent unmarshals an instance of InstanceProfileMemoryDependent from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemoryEnum : The permitted memory values (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileMemoryEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileMemoryEnum) isaInstanceProfileMemory() bool { - return true -} - -// UnmarshalInstanceProfileMemoryEnum unmarshals an instance of InstanceProfileMemoryEnum from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemoryFixed : The memory (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileMemoryFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileMemoryFixed) isaInstanceProfileMemory() bool { - return true -} - -// UnmarshalInstanceProfileMemoryFixed unmarshals an instance of InstanceProfileMemoryFixed from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileMemoryRange : The permitted memory range (in gibibytes) for an instance with this profile. -// This model "extends" InstanceProfileMemory -type InstanceProfileMemoryRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileMemoryRange.Type property. -// The type for this profile field. -const ( - InstanceProfileMemoryRangeTypeRangeConst = "range" -) - -func (*InstanceProfileMemoryRange) isaInstanceProfileMemory() bool { - return true -} - -// UnmarshalInstanceProfileMemoryRange unmarshals an instance of InstanceProfileMemoryRange from the specified map of raw messages. -func UnmarshalInstanceProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemoryRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNumaCountDependent : The total number of NUMA nodes for an instance with this profile depends on its configuration and the capacity -// constraints within the zone. -// This model "extends" InstanceProfileNumaCount -type InstanceProfileNumaCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNumaCountDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileNumaCountDependent) isaInstanceProfileNumaCount() bool { - return true -} - -// UnmarshalInstanceProfileNumaCountDependent unmarshals an instance of InstanceProfileNumaCountDependent from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNumaCountFixed : The total number of NUMA nodes for an instance with this profile. -// This model "extends" InstanceProfileNumaCount -type InstanceProfileNumaCountFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileNumaCountFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileNumaCountFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileNumaCountFixed) isaInstanceProfileNumaCount() bool { - return true -} - -// UnmarshalInstanceProfileNumaCountFixed unmarshals an instance of InstanceProfileNumaCountFixed from the specified map of raw messages. -func UnmarshalInstanceProfileNumaCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNumaCountFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkAttachmentCountDependent : The number of network attachments supported on an instance with this profile is dependent on its configuration. -// This model "extends" InstanceProfileNetworkAttachmentCount -type InstanceProfileNetworkAttachmentCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNetworkAttachmentCountDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkAttachmentCountDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileNetworkAttachmentCountDependent) isaInstanceProfileNetworkAttachmentCount() bool { - return true -} - -// UnmarshalInstanceProfileNetworkAttachmentCountDependent unmarshals an instance of InstanceProfileNetworkAttachmentCountDependent from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkAttachmentCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkAttachmentCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkAttachmentCountRange : The number of network attachments supported on an instance with this profile. -// This model "extends" InstanceProfileNetworkAttachmentCount -type InstanceProfileNetworkAttachmentCountRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNetworkAttachmentCountRange.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkAttachmentCountRangeTypeRangeConst = "range" -) - -func (*InstanceProfileNetworkAttachmentCountRange) isaInstanceProfileNetworkAttachmentCount() bool { - return true -} - -// UnmarshalInstanceProfileNetworkAttachmentCountRange unmarshals an instance of InstanceProfileNetworkAttachmentCountRange from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkAttachmentCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkAttachmentCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkInterfaceCountDependent : The number of network interfaces supported on an instance with this profile is dependent on its configuration. -// This model "extends" InstanceProfileNetworkInterfaceCount -type InstanceProfileNetworkInterfaceCountDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNetworkInterfaceCountDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkInterfaceCountDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileNetworkInterfaceCountDependent) isaInstanceProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalInstanceProfileNetworkInterfaceCountDependent unmarshals an instance of InstanceProfileNetworkInterfaceCountDependent from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCountDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileNetworkInterfaceCountRange : The number of network interfaces supported on an instance with this profile. -// This model "extends" InstanceProfileNetworkInterfaceCount -type InstanceProfileNetworkInterfaceCountRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileNetworkInterfaceCountRange.Type property. -// The type for this profile field. -const ( - InstanceProfileNetworkInterfaceCountRangeTypeRangeConst = "range" -) - -func (*InstanceProfileNetworkInterfaceCountRange) isaInstanceProfileNetworkInterfaceCount() bool { - return true -} - -// UnmarshalInstanceProfileNetworkInterfaceCountRange unmarshals an instance of InstanceProfileNetworkInterfaceCountRange from the specified map of raw messages. -func UnmarshalInstanceProfileNetworkInterfaceCountRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileNetworkInterfaceCountRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfilePortSpeedDependent : The port speed of each network interface of an instance with this profile depends on its configuration. -// This model "extends" InstanceProfilePortSpeed -type InstanceProfilePortSpeedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfilePortSpeedDependent.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfilePortSpeedDependent) isaInstanceProfilePortSpeed() bool { - return true -} - -// UnmarshalInstanceProfilePortSpeedDependent unmarshals an instance of InstanceProfilePortSpeedDependent from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfilePortSpeedFixed : The maximum speed (in megabits per second) of each network interface of an instance with this profile. -// This model "extends" InstanceProfilePortSpeed -type InstanceProfilePortSpeedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfilePortSpeedFixed.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfilePortSpeedFixed) isaInstanceProfilePortSpeed() bool { - return true -} - -// UnmarshalInstanceProfilePortSpeedFixed unmarshals an instance of InstanceProfilePortSpeedFixed from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuDependent : The VCPU count for an instance with this profile depends on its configuration. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileVcpuDependent) isaInstanceProfileVcpu() bool { - return true -} - -// UnmarshalInstanceProfileVcpuDependent unmarshals an instance of InstanceProfileVcpuDependent from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuEnum : The permitted values for VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileVcpuEnum) isaInstanceProfileVcpu() bool { - return true -} - -// UnmarshalInstanceProfileVcpuEnum unmarshals an instance of InstanceProfileVcpuEnum from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuFixed : The VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileVcpuFixed) isaInstanceProfileVcpu() bool { - return true -} - -// UnmarshalInstanceProfileVcpuFixed unmarshals an instance of InstanceProfileVcpuFixed from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuRange : The permitted range for VCPU count for an instance with this profile. -// This model "extends" InstanceProfileVcpu -type InstanceProfileVcpuRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuRange.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuRangeTypeRangeConst = "range" -) - -func (*InstanceProfileVcpuRange) isaInstanceProfileVcpu() bool { - return true -} - -// UnmarshalInstanceProfileVcpuRange unmarshals an instance of InstanceProfileVcpuRange from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthDependent : The storage bandwidth shared across the storage volumes of an instance with this profile depends on its -// configuration. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthDependent.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthDependentTypeDependentConst = "dependent" -) - -func (*InstanceProfileVolumeBandwidthDependent) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthDependent unmarshals an instance of InstanceProfileVolumeBandwidthDependent from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthEnum : The permitted storage bandwidth values (in megabits per second) shared across the storage volumes of an instance with -// this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthEnum.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthEnumTypeEnumConst = "enum" -) - -func (*InstanceProfileVolumeBandwidthEnum) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthEnum unmarshals an instance of InstanceProfileVolumeBandwidthEnum from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthFixed : The storage bandwidth (in megabits per second) shared across the storage volumes of an instance with this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthFixed.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthFixedTypeFixedConst = "fixed" -) - -func (*InstanceProfileVolumeBandwidthFixed) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthFixed unmarshals an instance of InstanceProfileVolumeBandwidthFixed from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidthRange : The permitted storage bandwidth range (in megabits per second) shared across the storage volumes of an instance with -// this profile. -// This model "extends" InstanceProfileVolumeBandwidth -type InstanceProfileVolumeBandwidthRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the InstanceProfileVolumeBandwidthRange.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthRangeTypeRangeConst = "range" -) - -func (*InstanceProfileVolumeBandwidthRange) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -// UnmarshalInstanceProfileVolumeBandwidthRange unmarshals an instance of InstanceProfileVolumeBandwidthRange from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidthRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByCatalogOffering : Create an instance by using a catalog offering. -// Models which "extend" this model: -// - InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment -// - InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByCatalogOffering struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototypeInstanceByCatalogOffering() bool { - return true -} - -type InstancePrototypeInstanceByCatalogOfferingIntf interface { - InstancePrototypeIntf - isaInstancePrototypeInstanceByCatalogOffering() bool -} - -func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByCatalogOffering unmarshals an instance of InstancePrototypeInstanceByCatalogOffering from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByCatalogOffering) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByImage : Create an instance by using an image. -// Models which "extend" this model: -// - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment -// - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByImage struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstancePrototypeInstanceByImage) isaInstancePrototypeInstanceByImage() bool { - return true -} - -type InstancePrototypeInstanceByImageIntf interface { - InstancePrototypeIntf - isaInstancePrototypeInstanceByImage() bool -} - -func (*InstancePrototypeInstanceByImage) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByImage unmarshals an instance of InstancePrototypeInstanceByImage from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByImage) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceBySourceSnapshot : Create an instance by using a snapshot. -// Models which "extend" this model: -// - InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment -// - InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface -// This model "extends" InstancePrototype -type InstancePrototypeInstanceBySourceSnapshot struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototypeInstanceBySourceSnapshot() bool { - return true -} - -type InstancePrototypeInstanceBySourceSnapshotIntf interface { - InstancePrototypeIntf - isaInstancePrototypeInstanceBySourceSnapshot() bool -} - -func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceBySourceSnapshot unmarshals an instance of InstancePrototypeInstanceBySourceSnapshot from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceSnapshot) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceBySourceTemplate : Create an instance by using an instance template. -// -// The `primary_network_attachment` and `network_attachments` properties may only be specified if -// `primary_network_attachment` is specified in the source template. -// -// The `primary_network_interface` and `network_interfaces` properties may only be specified if -// `primary_network_interface` is specified in the source template. -// This model "extends" InstancePrototype -type InstancePrototypeInstanceBySourceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} - -// NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { - _model = &InstancePrototypeInstanceBySourceTemplate{ - SourceTemplate: sourceTemplate, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceBySourceTemplate unmarshals an instance of InstancePrototypeInstanceBySourceTemplate from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByVolume : Create an instance by using a boot volume. -// Models which "extend" this model: -// - InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment -// - InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface -// This model "extends" InstancePrototype -type InstancePrototypeInstanceByVolume struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstancePrototypeInstanceByVolume) isaInstancePrototypeInstanceByVolume() bool { - return true -} - -type InstancePrototypeInstanceByVolumeIntf interface { - InstancePrototypeIntf - isaInstancePrototypeInstanceByVolume() bool -} - -func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByVolume) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByCRN : InstanceTemplateIdentityByCRN struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByCRN struct { - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstanceTemplateIdentityByCRN : Instantiate InstanceTemplateIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByCRN(crn string) (_model *InstanceTemplateIdentityByCRN, err error) { - _model = &InstanceTemplateIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByCRN) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByCRN unmarshals an instance of InstanceTemplateIdentityByCRN from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByHref : InstanceTemplateIdentityByHref struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByHref struct { - // The URL for this instance template. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceTemplateIdentityByHref : Instantiate InstanceTemplateIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByHref(href string) (_model *InstanceTemplateIdentityByHref, err error) { - _model = &InstanceTemplateIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByHref) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByHref unmarshals an instance of InstanceTemplateIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateIdentityByID : InstanceTemplateIdentityByID struct -// This model "extends" InstanceTemplateIdentity -type InstanceTemplateIdentityByID struct { - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` -} - -// NewInstanceTemplateIdentityByID : Instantiate InstanceTemplateIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplateIdentityByID(id string) (_model *InstanceTemplateIdentityByID, err error) { - _model = &InstanceTemplateIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplateIdentityByID) isaInstanceTemplateIdentity() bool { - return true -} - -// UnmarshalInstanceTemplateIdentityByID unmarshals an instance of InstanceTemplateIdentityByID from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByCatalogOffering : Create an instance template that creates instances by using a catalog offering. -// Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment -// - InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { - return true -} - -type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingIntf interface { - InstanceTemplatePrototypeIntf - isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByImage : Create an instance template that creates instances by using an image. -// Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment -// - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateByImage struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { - return true -} - -type InstanceTemplatePrototypeInstanceTemplateByImageIntf interface { - InstanceTemplatePrototypeIntf - isaInstanceTemplatePrototypeInstanceTemplateByImage() bool -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot : Create an instance template that creates instances by using a snapshot. -// Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment -// - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { - return true -} - -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotIntf interface { - InstanceTemplatePrototypeIntf - isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Create an instance template from an existing instance template. -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - // offering version to use when provisioning this virtual server instance. - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account, subject to - // IAM policies. - // - // If specified, `image` must not be specified, and `source_template` must not have - // `image` specified. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceTemplate (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceTemplate, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceTemplate{ - SourceTemplate: sourceTemplate, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext : Create an instance by using a catalog offering. -// Models which "extend" this model: -// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment -// - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - // or offering version to use when provisioning this virtual server instance. - // - // If an offering is specified, the latest version of that offering will be used. - // - // The specified offering or offering version may be in a different account in the same - // [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), subject - // to IAM policies. - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { - return true -} - -type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIntf interface { - InstanceTemplateIntf - isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByImageInstanceTemplateContext : Create an instance by using an image. -// Models which "extend" this model: -// - InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment -// - InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceByImageInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { - return true -} - -type InstanceTemplateInstanceByImageInstanceTemplateContextIntf interface { - InstanceTemplateIntf - isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByImageInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext : Create an instance by using a snapshot. -// Models which "extend" this model: -// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment -// - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { - return true -} - -type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIntf interface { - InstanceTemplateIntf - isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyIdentityByCRN : KeyIdentityByCRN struct -// This model "extends" KeyIdentity -type KeyIdentityByCRN struct { - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` -} - -// NewKeyIdentityByCRN : Instantiate KeyIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByCRN(crn string) (_model *KeyIdentityByCRN, err error) { - _model = &KeyIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*KeyIdentityByCRN) isaKeyIdentity() bool { - return true -} - -// UnmarshalKeyIdentityByCRN unmarshals an instance of KeyIdentityByCRN from the specified map of raw messages. -func UnmarshalKeyIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyIdentityByFingerprint : KeyIdentityByFingerprint struct -// This model "extends" KeyIdentity -type KeyIdentityByFingerprint struct { - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` -} - -// NewKeyIdentityByFingerprint : Instantiate KeyIdentityByFingerprint (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByFingerprint(fingerprint string) (_model *KeyIdentityByFingerprint, err error) { - _model = &KeyIdentityByFingerprint{ - Fingerprint: core.StringPtr(fingerprint), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*KeyIdentityByFingerprint) isaKeyIdentity() bool { - return true -} - -// UnmarshalKeyIdentityByFingerprint unmarshals an instance of KeyIdentityByFingerprint from the specified map of raw messages. -func UnmarshalKeyIdentityByFingerprint(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByFingerprint) - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyIdentityByHref : KeyIdentityByHref struct -// This model "extends" KeyIdentity -type KeyIdentityByHref struct { - // The URL for this key. - Href *string `json:"href" validate:"required"` -} - -// NewKeyIdentityByHref : Instantiate KeyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByHref(href string) (_model *KeyIdentityByHref, err error) { - _model = &KeyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*KeyIdentityByHref) isaKeyIdentity() bool { - return true -} - -// UnmarshalKeyIdentityByHref unmarshals an instance of KeyIdentityByHref from the specified map of raw messages. -func UnmarshalKeyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyIdentityByID : KeyIdentityByID struct -// This model "extends" KeyIdentity -type KeyIdentityByID struct { - // The unique identifier for this key. - ID *string `json:"id" validate:"required"` -} - -// NewKeyIdentityByID : Instantiate KeyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewKeyIdentityByID(id string) (_model *KeyIdentityByID, err error) { - _model = &KeyIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*KeyIdentityByID) isaKeyIdentity() bool { - return true -} - -// UnmarshalKeyIdentityByID unmarshals an instance of KeyIdentityByID from the specified map of raw messages. -func UnmarshalKeyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct -// This model "extends" LegacyCloudObjectStorageBucketIdentity -type LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { - // The globally unique name of this Cloud Object Storage bucket. - Name *string `json:"name" validate:"required"` -} - -// NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { - _model = &LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaLegacyCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. -func UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerIdentityByCRN : LoadBalancerIdentityByCRN struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByCRN struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` -} - -// NewLoadBalancerIdentityByCRN : Instantiate LoadBalancerIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByCRN(crn string) (_model *LoadBalancerIdentityByCRN, err error) { - _model = &LoadBalancerIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerIdentityByCRN) isaLoadBalancerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerIdentityByCRN unmarshals an instance of LoadBalancerIdentityByCRN from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerIdentityByHref : LoadBalancerIdentityByHref struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByHref struct { - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerIdentityByHref : Instantiate LoadBalancerIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByHref(href string) (_model *LoadBalancerIdentityByHref, err error) { - _model = &LoadBalancerIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerIdentityByHref) isaLoadBalancerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerIdentityByHref unmarshals an instance of LoadBalancerIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerIdentityByID : LoadBalancerIdentityByID struct -// This model "extends" LoadBalancerIdentity -type LoadBalancerIdentityByID struct { - // The unique identifier for this load balancer. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerIdentityByID : Instantiate LoadBalancerIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerIdentityByID(id string) (_model *LoadBalancerIdentityByID, err error) { - _model = &LoadBalancerIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerIdentityByID) isaLoadBalancerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerIdentityByID unmarshals an instance of LoadBalancerIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerIdentityByHref : LoadBalancerListenerIdentityByHref struct -// This model "extends" LoadBalancerListenerIdentity -type LoadBalancerListenerIdentityByHref struct { - // The listener's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerListenerIdentityByHref : Instantiate LoadBalancerListenerIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerIdentityByHref(href string) (_model *LoadBalancerListenerIdentityByHref, err error) { - _model = &LoadBalancerListenerIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerIdentityByHref) isaLoadBalancerListenerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerListenerIdentityByHref unmarshals an instance of LoadBalancerListenerIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerIdentityByID : LoadBalancerListenerIdentityByID struct -// This model "extends" LoadBalancerListenerIdentity -type LoadBalancerListenerIdentityByID struct { - // The unique identifier for this load balancer listener. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerListenerIdentityByID : Instantiate LoadBalancerListenerIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerIdentityByID(id string) (_model *LoadBalancerListenerIdentityByID, err error) { - _model = &LoadBalancerListenerIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerIdentityByID) isaLoadBalancerListenerIdentity() bool { - return true -} - -// UnmarshalLoadBalancerListenerIdentityByID unmarshals an instance of LoadBalancerListenerIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch : LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref -// This model "extends" LoadBalancerListenerPolicyTargetPatch -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool { - return true -} - -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityIntf interface { - LoadBalancerListenerPolicyTargetPatchIntf - isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - Listener: listener, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // The redirect target URL. - URL *string `json:"url" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(httpStatusCode int64, url string) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - URL: core.StringPtr(url), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref -// This model "extends" LoadBalancerListenerPolicyTargetPrototype -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool { - return true -} - -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityIntf interface { - LoadBalancerListenerPolicyTargetPrototypeIntf - isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect : LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` -} - -func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL : LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - // The redirect target URL. - URL *string `json:"url" validate:"required"` -} - -func (*LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetLoadBalancerPoolReference : LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct -// This model "extends" LoadBalancerListenerPolicyTarget -type LoadBalancerListenerPolicyTargetLoadBalancerPoolReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer pool. The name is unique across all pools for the load balancer. - Name *string `json:"name" validate:"required"` -} - -func (*LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) isaLoadBalancerListenerPolicyTarget() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference unmarshals an instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetLoadBalancerPoolReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolIdentityByHref : LoadBalancerPoolIdentityByHref struct -// This model "extends" LoadBalancerPoolIdentity -type LoadBalancerPoolIdentityByHref struct { - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerPoolIdentityByHref : Instantiate LoadBalancerPoolIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByHref(href string) (_model *LoadBalancerPoolIdentityByHref, err error) { - _model = &LoadBalancerPoolIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolIdentityByHref) isaLoadBalancerPoolIdentity() bool { - return true -} - -// UnmarshalLoadBalancerPoolIdentityByHref unmarshals an instance of LoadBalancerPoolIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolIdentityByID : LoadBalancerPoolIdentityByID struct -// This model "extends" LoadBalancerPoolIdentity -type LoadBalancerPoolIdentityByID struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerPoolIdentityByID : Instantiate LoadBalancerPoolIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByID(id string) (_model *LoadBalancerPoolIdentityByID, err error) { - _model = &LoadBalancerPoolIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolIdentityByID) isaLoadBalancerPoolIdentity() bool { - return true -} - -// UnmarshalLoadBalancerPoolIdentityByID unmarshals an instance of LoadBalancerPoolIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototypeIP : LoadBalancerPoolMemberTargetPrototypeIP struct -// This model "extends" LoadBalancerPoolMemberTargetPrototype -type LoadBalancerPoolMemberTargetPrototypeIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewLoadBalancerPoolMemberTargetPrototypeIP : Instantiate LoadBalancerPoolMemberTargetPrototypeIP (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeIP(address string) (_model *LoadBalancerPoolMemberTargetPrototypeIP, err error) { - _model = &LoadBalancerPoolMemberTargetPrototypeIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolMemberTargetPrototypeIP) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototypeIP unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototypeInstanceIdentity : Identifies a virtual server instance by a unique property. -// Models which "extend" this model: -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref -// This model "extends" LoadBalancerPoolMemberTargetPrototype -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentity struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { - return true -} - -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityIntf interface { - LoadBalancerPoolMemberTargetPrototypeIntf - isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetIP : LoadBalancerPoolMemberTargetIP struct -// This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -func (*LoadBalancerPoolMemberTargetIP) isaLoadBalancerPoolMemberTarget() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetIP unmarshals an instance of LoadBalancerPoolMemberTargetIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetInstanceReference : LoadBalancerPoolMemberTargetInstanceReference struct -// This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetInstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` - - // The name for this virtual server instance. The name is unique across all virtual server instances in the region. - Name *string `json:"name" validate:"required"` -} - -func (*LoadBalancerPoolMemberTargetInstanceReference) isaLoadBalancerPoolMemberTarget() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetInstanceReference unmarshals an instance of LoadBalancerPoolMemberTargetInstanceReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileIdentityByHref : LoadBalancerProfileIdentityByHref struct -// This model "extends" LoadBalancerProfileIdentity -type LoadBalancerProfileIdentityByHref struct { - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerProfileIdentityByHref : Instantiate LoadBalancerProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerProfileIdentityByHref(href string) (_model *LoadBalancerProfileIdentityByHref, err error) { - _model = &LoadBalancerProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerProfileIdentityByHref) isaLoadBalancerProfileIdentity() bool { - return true -} - -// UnmarshalLoadBalancerProfileIdentityByHref unmarshals an instance of LoadBalancerProfileIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileIdentityByName : LoadBalancerProfileIdentityByName struct -// This model "extends" LoadBalancerProfileIdentity -type LoadBalancerProfileIdentityByName struct { - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` -} - -// NewLoadBalancerProfileIdentityByName : Instantiate LoadBalancerProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerProfileIdentityByName(name string) (_model *LoadBalancerProfileIdentityByName, err error) { - _model = &LoadBalancerProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerProfileIdentityByName) isaLoadBalancerProfileIdentity() bool { - return true -} - -// UnmarshalLoadBalancerProfileIdentityByName unmarshals an instance of LoadBalancerProfileIdentityByName from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileInstanceGroupsSupportedDependent : The instance groups support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileInstanceGroupsSupported -type LoadBalancerProfileInstanceGroupsSupportedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedDependent.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileInstanceGroupsSupportedDependentTypeDependentConst = "dependent" -) - -func (*LoadBalancerProfileInstanceGroupsSupportedDependent) isaLoadBalancerProfileInstanceGroupsSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupportedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileInstanceGroupsSupportedFixed : The instance groups support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileInstanceGroupsSupported -type LoadBalancerProfileInstanceGroupsSupportedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileInstanceGroupsSupportedFixed.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileInstanceGroupsSupportedFixedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileInstanceGroupsSupportedFixed) isaLoadBalancerProfileInstanceGroupsSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileInstanceGroupsSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileInstanceGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileInstanceGroupsSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileRouteModeSupportedDependent : The route mode support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileRouteModeSupported -type LoadBalancerProfileRouteModeSupportedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileRouteModeSupportedDependent.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileRouteModeSupportedDependentTypeDependentConst = "dependent" -) - -func (*LoadBalancerProfileRouteModeSupportedDependent) isaLoadBalancerProfileRouteModeSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileRouteModeSupportedDependent unmarshals an instance of LoadBalancerProfileRouteModeSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupportedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileRouteModeSupportedFixed : The route mode support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileRouteModeSupported -type LoadBalancerProfileRouteModeSupportedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileRouteModeSupportedFixed.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileRouteModeSupportedFixedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileRouteModeSupportedFixed) isaLoadBalancerProfileRouteModeSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileRouteModeSupportedFixed unmarshals an instance of LoadBalancerProfileRouteModeSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileSecurityGroupsSupportedDependent : The security group support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileSecurityGroupsSupported -type LoadBalancerProfileSecurityGroupsSupportedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedDependent.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileSecurityGroupsSupportedDependentTypeDependentConst = "dependent" -) - -func (*LoadBalancerProfileSecurityGroupsSupportedDependent) isaLoadBalancerProfileSecurityGroupsSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupportedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileSecurityGroupsSupportedFixed : The security group support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileSecurityGroupsSupported -type LoadBalancerProfileSecurityGroupsSupportedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileSecurityGroupsSupportedFixed.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileSecurityGroupsSupportedFixedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileSecurityGroupsSupportedFixed) isaLoadBalancerProfileSecurityGroupsSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed unmarshals an instance of LoadBalancerProfileSecurityGroupsSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileUDPSupportedDependent : The UDP support for a load balancer with this profile depends on its configuration. -// This model "extends" LoadBalancerProfileUDPSupported -type LoadBalancerProfileUDPSupportedDependent struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileUDPSupportedDependent.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileUDPSupportedDependentTypeDependentConst = "dependent" -) - -func (*LoadBalancerProfileUDPSupportedDependent) isaLoadBalancerProfileUDPSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileUDPSupportedDependent unmarshals an instance of LoadBalancerProfileUDPSupportedDependent from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupportedDependent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupportedDependent) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileUDPSupportedFixed : The UDP support for a load balancer with this profile. -// This model "extends" LoadBalancerProfileUDPSupported -type LoadBalancerProfileUDPSupportedFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *bool `json:"value" validate:"required"` -} - -// Constants associated with the LoadBalancerProfileUDPSupportedFixed.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileUDPSupportedFixedTypeFixedConst = "fixed" -) - -func (*LoadBalancerProfileUDPSupportedFixed) isaLoadBalancerProfileUDPSupported() bool { - return true -} - -// UnmarshalLoadBalancerProfileUDPSupportedFixed unmarshals an instance of LoadBalancerProfileUDPSupportedFixed from the specified map of raw messages. -func UnmarshalLoadBalancerProfileUDPSupportedFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileUDPSupportedFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentityByCRN : NetworkACLIdentityByCRN struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByCRN struct { - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` -} - -// NewNetworkACLIdentityByCRN : Instantiate NetworkACLIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByCRN(crn string) (_model *NetworkACLIdentityByCRN, err error) { - _model = &NetworkACLIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLIdentityByCRN) isaNetworkACLIdentity() bool { - return true -} - -// UnmarshalNetworkACLIdentityByCRN unmarshals an instance of NetworkACLIdentityByCRN from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentityByHref : NetworkACLIdentityByHref struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByHref struct { - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` -} - -// NewNetworkACLIdentityByHref : Instantiate NetworkACLIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByHref(href string) (_model *NetworkACLIdentityByHref, err error) { - _model = &NetworkACLIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLIdentityByHref) isaNetworkACLIdentity() bool { - return true -} - -// UnmarshalNetworkACLIdentityByHref unmarshals an instance of NetworkACLIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLIdentityByID : NetworkACLIdentityByID struct -// This model "extends" NetworkACLIdentity -type NetworkACLIdentityByID struct { - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` -} - -// NewNetworkACLIdentityByID : Instantiate NetworkACLIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLIdentityByID(id string) (_model *NetworkACLIdentityByID, err error) { - _model = &NetworkACLIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLIdentityByID) isaNetworkACLIdentity() bool { - return true -} - -// UnmarshalNetworkACLIdentityByID unmarshals an instance of NetworkACLIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLPrototypeNetworkACLByRules : NetworkACLPrototypeNetworkACLByRules struct -// This model "extends" NetworkACLPrototype -type NetworkACLPrototypeNetworkACLByRules struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` -} - -// NewNetworkACLPrototypeNetworkACLByRules : Instantiate NetworkACLPrototypeNetworkACLByRules (Generic Model Constructor) -func (*VpcV1) NewNetworkACLPrototypeNetworkACLByRules(vpc VPCIdentityIntf) (_model *NetworkACLPrototypeNetworkACLByRules, err error) { - _model = &NetworkACLPrototypeNetworkACLByRules{ - VPC: vpc, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLPrototypeNetworkACLByRules) isaNetworkACLPrototype() bool { - return true -} - -// UnmarshalNetworkACLPrototypeNetworkACLByRules unmarshals an instance of NetworkACLPrototypeNetworkACLByRules from the specified map of raw messages. -func UnmarshalNetworkACLPrototypeNetworkACLByRules(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototypeNetworkACLByRules) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLPrototypeNetworkACLBySourceNetworkACL : NetworkACLPrototypeNetworkACLBySourceNetworkACL struct -// This model "extends" NetworkACLPrototype -type NetworkACLPrototypeNetworkACLBySourceNetworkACL struct { - // The name for this network ACL. The name must not be used by another network ACL for the VPC. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The VPC this network ACL will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // Network ACL to copy rules from. - SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl" validate:"required"` -} - -// NewNetworkACLPrototypeNetworkACLBySourceNetworkACL : Instantiate NetworkACLPrototypeNetworkACLBySourceNetworkACL (Generic Model Constructor) -func (*VpcV1) NewNetworkACLPrototypeNetworkACLBySourceNetworkACL(vpc VPCIdentityIntf, sourceNetworkACL NetworkACLIdentityIntf) (_model *NetworkACLPrototypeNetworkACLBySourceNetworkACL, err error) { - _model = &NetworkACLPrototypeNetworkACLBySourceNetworkACL{ - VPC: vpc, - SourceNetworkACL: sourceNetworkACL, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLPrototypeNetworkACLBySourceNetworkACL) isaNetworkACLPrototype() bool { - return true -} - -// UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL unmarshals an instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL from the specified map of raw messages. -func UnmarshalNetworkACLPrototypeNetworkACLBySourceNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototypeNetworkACLBySourceNetworkACL) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct -// This model "extends" NetworkACLRuleBeforePatch -type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref struct { - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` -} - -// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref, err error) { - _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePatch() bool { - return true -} - -// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct -// This model "extends" NetworkACLRuleBeforePatch -type NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` -} - -// NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID, err error) { - _model = &NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePatch() bool { - return true -} - -// UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatchNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct -// This model "extends" NetworkACLRuleBeforePrototype -type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref struct { - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` -} - -// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(href string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref, err error) { - _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) isaNetworkACLRuleBeforePrototype() bool { - return true -} - -// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct -// This model "extends" NetworkACLRuleBeforePrototype -type NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` -} - -// NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID : Instantiate NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(id string) (_model *NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID, err error) { - _model = &NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) isaNetworkACLRuleBeforePrototype() bool { - return true -} - -// UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID unmarshals an instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleItemNetworkACLRuleProtocolAll : NetworkACLRuleItemNetworkACLRuleProtocolAll struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolAllActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllProtocolAllConst = "all" -) - -func (*NetworkACLRuleItemNetworkACLRuleProtocolAll) isaNetworkACLRuleItem() bool { - return true -} - -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleItemNetworkACLRuleProtocolIcmp : NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolIcmpActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" -) - -func (*NetworkACLRuleItemNetworkACLRuleProtocolIcmp) isaNetworkACLRuleItem() bool { - return true -} - -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleItemNetworkACLRuleProtocolTcpudp : NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct -// This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the - // collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max" validate:"required"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min" validate:"required"` -} - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" - NetworkACLRuleItemNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" -) - -func (*NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) isaNetworkACLRuleItem() bool { - return true -} - -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" -) - -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" -) - -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct -// This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" -) - -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" -) - -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototype() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The ICMP traffic code to match. - // - // If specified, `type` must also be specified. If unspecified, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to match. - // - // If unspecified, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeProtocolIcmpConst = "icmp" -) - -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) isaNetworkACLRulePrototype() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct -// This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeProtocolUDPConst = "udp" -) - -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype{ - Action: core.StringPtr(action), - Destination: core.StringPtr(destination), - Direction: core.StringPtr(direction), - Source: core.StringPtr(source), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) isaNetworkACLRulePrototype() bool { - return true -} - -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleNetworkACLRuleProtocolAll : NetworkACLRuleNetworkACLRuleProtocolAll struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolAll struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolAllActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleNetworkACLRuleProtocolAllProtocolAllConst = "all" -) - -func (*NetworkACLRuleNetworkACLRuleProtocolAll) isaNetworkACLRule() bool { - return true -} - -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleNetworkACLRuleProtocolIcmp : NetworkACLRuleNetworkACLRuleProtocolIcmp struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolIcmp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolIcmpActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleNetworkACLRuleProtocolIcmpProtocolIcmpConst = "icmp" -) - -func (*NetworkACLRuleNetworkACLRuleProtocolIcmp) isaNetworkACLRule() bool { - return true -} - -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleNetworkACLRuleProtocolTcpudp : NetworkACLRuleNetworkACLRuleProtocolTcpudp struct -// This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { - // The action to perform for a packet matching the rule. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max" validate:"required"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max" validate:"required"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min" validate:"required"` -} - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolTcpudpActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolTCPConst = "tcp" - NetworkACLRuleNetworkACLRuleProtocolTcpudpProtocolUDPConst = "udp" -) - -func (*NetworkACLRuleNetworkACLRuleProtocolTcpudp) isaNetworkACLRule() bool { - return true -} - -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceIPPrototypeReservedIPIdentity : Identifies a reserved IP by a unique property. -// Models which "extend" this model: -// - NetworkInterfaceIPPrototypeReservedIPIdentityByID -// - NetworkInterfaceIPPrototypeReservedIPIdentityByHref -// This model "extends" NetworkInterfaceIPPrototype -type NetworkInterfaceIPPrototypeReservedIPIdentity struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool { - return true -} - -type NetworkInterfaceIPPrototypeReservedIPIdentityIntf interface { - NetworkInterfaceIPPrototypeIntf - isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentity) isaNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPIdentity from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext : NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct -// This model "extends" NetworkInterfaceIPPrototype -type NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) isaNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemIdentityByHref : OperatingSystemIdentityByHref struct -// This model "extends" OperatingSystemIdentity -type OperatingSystemIdentityByHref struct { - // The URL for this operating system. - Href *string `json:"href" validate:"required"` -} - -// NewOperatingSystemIdentityByHref : Instantiate OperatingSystemIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewOperatingSystemIdentityByHref(href string) (_model *OperatingSystemIdentityByHref, err error) { - _model = &OperatingSystemIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*OperatingSystemIdentityByHref) isaOperatingSystemIdentity() bool { - return true -} - -// UnmarshalOperatingSystemIdentityByHref unmarshals an instance of OperatingSystemIdentityByHref from the specified map of raw messages. -func UnmarshalOperatingSystemIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// OperatingSystemIdentityByName : OperatingSystemIdentityByName struct -// This model "extends" OperatingSystemIdentity -type OperatingSystemIdentityByName struct { - // The globally unique name for this operating system. - Name *string `json:"name" validate:"required"` -} - -// NewOperatingSystemIdentityByName : Instantiate OperatingSystemIdentityByName (Generic Model Constructor) -func (*VpcV1) NewOperatingSystemIdentityByName(name string) (_model *OperatingSystemIdentityByName, err error) { - _model = &OperatingSystemIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*OperatingSystemIdentityByName) isaOperatingSystemIdentity() bool { - return true -} - -// UnmarshalOperatingSystemIdentityByName unmarshals an instance of OperatingSystemIdentityByName from the specified map of raw messages. -func UnmarshalOperatingSystemIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentity : Identifies a floating IP by a unique property. -// Models which "extend" this model: -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress -// This model "extends" PublicGatewayFloatingIPPrototype -type PublicGatewayFloatingIPPrototypeFloatingIPIdentity struct { - // The unique identifier for this floating IP. - ID *string `json:"id,omitempty"` - - // The CRN for this floating IP. - CRN *string `json:"crn,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href,omitempty"` - - // The globally unique IP address. - Address *string `json:"address,omitempty"` -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityIntf interface { - PublicGatewayFloatingIPPrototypeIntf - isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentity) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentity from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext : PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct -// This model "extends" PublicGatewayFloatingIPPrototype -type PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext struct { - // The name for this floating IP. The name must not be used by another floating IP in the region. If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayIdentityPublicGatewayIdentityByCRN : PublicGatewayIdentityPublicGatewayIdentityByCRN struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByCRN struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` -} - -// NewPublicGatewayIdentityPublicGatewayIdentityByCRN : Instantiate PublicGatewayIdentityPublicGatewayIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByCRN(crn string) (_model *PublicGatewayIdentityPublicGatewayIdentityByCRN, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayIdentityPublicGatewayIdentityByCRN) isaPublicGatewayIdentity() bool { - return true -} - -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByCRN from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayIdentityPublicGatewayIdentityByHref : PublicGatewayIdentityPublicGatewayIdentityByHref struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByHref struct { - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` -} - -// NewPublicGatewayIdentityPublicGatewayIdentityByHref : Instantiate PublicGatewayIdentityPublicGatewayIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByHref(href string) (_model *PublicGatewayIdentityPublicGatewayIdentityByHref, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayIdentityPublicGatewayIdentityByHref) isaPublicGatewayIdentity() bool { - return true -} - -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByHref from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayIdentityPublicGatewayIdentityByID : PublicGatewayIdentityPublicGatewayIdentityByID struct -// This model "extends" PublicGatewayIdentity -type PublicGatewayIdentityPublicGatewayIdentityByID struct { - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` -} - -// NewPublicGatewayIdentityPublicGatewayIdentityByID : Instantiate PublicGatewayIdentityPublicGatewayIdentityByID (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayIdentityPublicGatewayIdentityByID(id string) (_model *PublicGatewayIdentityPublicGatewayIdentityByID, err error) { - _model = &PublicGatewayIdentityPublicGatewayIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayIdentityPublicGatewayIdentityByID) isaPublicGatewayIdentity() bool { - return true -} - -// UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID unmarshals an instance of PublicGatewayIdentityPublicGatewayIdentityByID from the specified map of raw messages. -func UnmarshalPublicGatewayIdentityPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentityPublicGatewayIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RegionIdentityByHref : RegionIdentityByHref struct -// This model "extends" RegionIdentity -type RegionIdentityByHref struct { - // The URL for this region. - Href *string `json:"href" validate:"required"` -} - -// NewRegionIdentityByHref : Instantiate RegionIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRegionIdentityByHref(href string) (_model *RegionIdentityByHref, err error) { - _model = &RegionIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RegionIdentityByHref) isaRegionIdentity() bool { - return true -} - -// UnmarshalRegionIdentityByHref unmarshals an instance of RegionIdentityByHref from the specified map of raw messages. -func UnmarshalRegionIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RegionIdentityByName : RegionIdentityByName struct -// This model "extends" RegionIdentity -type RegionIdentityByName struct { - // The globally unique name for this region. - Name *string `json:"name" validate:"required"` -} - -// NewRegionIdentityByName : Instantiate RegionIdentityByName (Generic Model Constructor) -func (*VpcV1) NewRegionIdentityByName(name string) (_model *RegionIdentityByName, err error) { - _model = &RegionIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RegionIdentityByName) isaRegionIdentity() bool { - return true -} - -// UnmarshalRegionIdentityByName unmarshals an instance of RegionIdentityByName from the specified map of raw messages. -func UnmarshalRegionIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationIdentityByCRN : ReservationIdentityByCRN struct -// This model "extends" ReservationIdentity -type ReservationIdentityByCRN struct { - // The CRN for this reservation. - CRN *string `json:"crn" validate:"required"` -} - -// NewReservationIdentityByCRN : Instantiate ReservationIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByCRN(crn string) (_model *ReservationIdentityByCRN, err error) { - _model = &ReservationIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservationIdentityByCRN) isaReservationIdentity() bool { - return true -} - -// UnmarshalReservationIdentityByCRN unmarshals an instance of ReservationIdentityByCRN from the specified map of raw messages. -func UnmarshalReservationIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationIdentityByHref : ReservationIdentityByHref struct -// This model "extends" ReservationIdentity -type ReservationIdentityByHref struct { - // The URL for this reservation. - Href *string `json:"href" validate:"required"` -} - -// NewReservationIdentityByHref : Instantiate ReservationIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByHref(href string) (_model *ReservationIdentityByHref, err error) { - _model = &ReservationIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservationIdentityByHref) isaReservationIdentity() bool { - return true -} - -// UnmarshalReservationIdentityByHref unmarshals an instance of ReservationIdentityByHref from the specified map of raw messages. -func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationIdentityByID : ReservationIdentityByID struct -// This model "extends" ReservationIdentity -type ReservationIdentityByID struct { - // The unique identifier for this reservation. - ID *string `json:"id" validate:"required"` -} - -// NewReservationIdentityByID : Instantiate ReservationIdentityByID (Generic Model Constructor) -func (*VpcV1) NewReservationIdentityByID(id string) (_model *ReservationIdentityByID, err error) { - _model = &ReservationIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservationIdentityByID) isaReservationIdentity() bool { - return true -} - -// UnmarshalReservationIdentityByID unmarshals an instance of ReservationIdentityByID from the specified map of raw messages. -func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservationProfileInstanceProfileReference : ReservationProfileInstanceProfileReference struct -// This model "extends" ReservationProfile -type ReservationProfileInstanceProfileReference struct { - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservationProfileInstanceProfileReference.ResourceType property. -// The resource type. -const ( - ReservationProfileInstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" -) - -func (*ReservationProfileInstanceProfileReference) isaReservationProfile() bool { - return true -} - -// UnmarshalReservationProfileInstanceProfileReference unmarshals an instance of ReservationProfileInstanceProfileReference from the specified map of raw messages. -func UnmarshalReservationProfileInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservationProfileInstanceProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeEndpointGatewayIdentity : ReservedIPTargetPrototypeEndpointGatewayIdentity struct -// Models which "extend" this model: -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN -// - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref -// This model "extends" ReservedIPTargetPrototype -type ReservedIPTargetPrototypeEndpointGatewayIdentity struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { - return true -} - -type ReservedIPTargetPrototypeEndpointGatewayIdentityIntf interface { - ReservedIPTargetPrototypeIntf - isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentity) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentity from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" ReservedIPTargetPrototype -type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityIntf interface { - ReservedIPTargetPrototypeIntf - isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext : ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetEndpointGatewayReference : ReservedIPTargetEndpointGatewayReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetEndpointGatewayReference struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetEndpointGatewayReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -func (*ReservedIPTargetEndpointGatewayReference) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetEndpointGatewayReference unmarshals an instance of ReservedIPTargetEndpointGatewayReference from the specified map of raw messages. -func UnmarshalReservedIPTargetEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetEndpointGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetGenericResourceReference : Identifying information for a resource that is not native to the VPC API. -// This model "extends" ReservedIPTarget -type ReservedIPTargetGenericResourceReference struct { - // The CRN for the resource. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *GenericResourceReferenceDeleted `json:"deleted,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetGenericResourceReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetGenericResourceReferenceResourceTypeCloudResourceConst = "cloud_resource" -) - -func (*ReservedIPTargetGenericResourceReference) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetGenericResourceReference unmarshals an instance of ReservedIPTargetGenericResourceReference from the specified map of raw messages. -func UnmarshalReservedIPTargetGenericResourceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetGenericResourceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalGenericResourceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetLoadBalancerReference : ReservedIPTargetLoadBalancerReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetLoadBalancerReference struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` - - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer. The name is unique across all load balancers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetLoadBalancerReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" -) - -func (*ReservedIPTargetLoadBalancerReference) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetLoadBalancerReference unmarshals an instance of ReservedIPTargetLoadBalancerReference from the specified map of raw messages. -func UnmarshalReservedIPTargetLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetLoadBalancerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetNetworkInterfaceReferenceTargetContext : ReservedIPTargetNetworkInterfaceReferenceTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - ReservedIPTargetNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*ReservedIPTargetNetworkInterfaceReferenceTargetContext) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext unmarshals an instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetVPNGatewayReference : ReservedIPTargetVPNGatewayReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVPNGatewayReference struct { - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetVPNGatewayReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" -) - -func (*ReservedIPTargetVPNGatewayReference) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetVPNGatewayReference unmarshals an instance of ReservedIPTargetVPNGatewayReference from the specified map of raw messages. -func UnmarshalReservedIPTargetVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVPNGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetVPNServerReference : ReservedIPTargetVPNServerReference struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` - - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetVPNServerReference.ResourceType property. -// The resource type. -const ( - ReservedIPTargetVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" -) - -func (*ReservedIPTargetVPNServerReference) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetVPNServerReference unmarshals an instance of ReservedIPTargetVPNServerReference from the specified map of raw messages. -func UnmarshalReservedIPTargetVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext : ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct -// This model "extends" ReservedIPTarget -type ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.ResourceType property. -// The resource type. -const ( - ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContextResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -func (*ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) isaReservedIPTarget() bool { - return true -} - -// UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext unmarshals an instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext from the specified map of raw messages. -func UnmarshalReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceGroupIdentityByID : ResourceGroupIdentityByID struct -// This model "extends" ResourceGroupIdentity -type ResourceGroupIdentityByID struct { - // The unique identifier for this resource group. - ID *string `json:"id" validate:"required"` -} - -// NewResourceGroupIdentityByID : Instantiate ResourceGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewResourceGroupIdentityByID(id string) (_model *ResourceGroupIdentityByID, err error) { - _model = &ResourceGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ResourceGroupIdentityByID) isaResourceGroupIdentity() bool { - return true -} - -// UnmarshalResourceGroupIdentityByID unmarshals an instance of ResourceGroupIdentityByID from the specified map of raw messages. -func UnmarshalResourceGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCreatorVPNGatewayReference : RouteCreatorVPNGatewayReference struct -// This model "extends" RouteCreator -type RouteCreatorVPNGatewayReference struct { - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the RouteCreatorVPNGatewayReference.ResourceType property. -// The resource type. -const ( - RouteCreatorVPNGatewayReferenceResourceTypeVPNGatewayConst = "vpn_gateway" -) - -func (*RouteCreatorVPNGatewayReference) isaRouteCreator() bool { - return true -} - -// UnmarshalRouteCreatorVPNGatewayReference unmarshals an instance of RouteCreatorVPNGatewayReference from the specified map of raw messages. -func UnmarshalRouteCreatorVPNGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreatorVPNGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCreatorVPNServerReference : RouteCreatorVPNServerReference struct -// This model "extends" RouteCreator -type RouteCreatorVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` - - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the RouteCreatorVPNServerReference.ResourceType property. -// The resource type. -const ( - RouteCreatorVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" -) - -func (*RouteCreatorVPNServerReference) isaRouteCreator() bool { - return true -} - -// UnmarshalRouteCreatorVPNServerReference unmarshals an instance of RouteCreatorVPNServerReference from the specified map of raw messages. -func UnmarshalRouteCreatorVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCreatorVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopIP : RouteNextHopIP struct -// This model "extends" RouteNextHop -type RouteNextHopIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -func (*RouteNextHopIP) isaRouteNextHop() bool { - return true -} - -// UnmarshalRouteNextHopIP unmarshals an instance of RouteNextHopIP from the specified map of raw messages. -func UnmarshalRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchRouteNextHopIP : RouteNextHopPatchRouteNextHopIP struct -// Models which "extend" this model: -// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP -// - RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP -// This model "extends" RouteNextHopPatch -type RouteNextHopPatchRouteNextHopIP struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} - -func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatchRouteNextHopIP() bool { - return true -} - -type RouteNextHopPatchRouteNextHopIPIntf interface { - RouteNextHopPatchIntf - isaRouteNextHopPatchRouteNextHopIP() bool -} - -func (*RouteNextHopPatchRouteNextHopIP) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchRouteNextHopIP unmarshals an instance of RouteNextHopPatchRouteNextHopIP from the specified map of raw messages. -func UnmarshalRouteNextHopPatchRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchRouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. -// Models which "extend" this model: -// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID -// - RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref -// This model "extends" RouteNextHopPatch -type RouteNextHopPatchVPNGatewayConnectionIdentity struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool { - return true -} - -type RouteNextHopPatchVPNGatewayConnectionIdentityIntf interface { - RouteNextHopPatchIntf - isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentity) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity unmarshals an instance of RouteNextHopPatchVPNGatewayConnectionIdentity from the specified map of raw messages. -func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchVPNGatewayConnectionIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopVPNGatewayConnectionReference : RouteNextHopVPNGatewayConnectionReference struct -// This model "extends" RouteNextHop -type RouteNextHopVPNGatewayConnectionReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the RouteNextHopVPNGatewayConnectionReference.ResourceType property. -// The resource type. -const ( - RouteNextHopVPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -func (*RouteNextHopVPNGatewayConnectionReference) isaRouteNextHop() bool { - return true -} - -// UnmarshalRouteNextHopVPNGatewayConnectionReference unmarshals an instance of RouteNextHopVPNGatewayConnectionReference from the specified map of raw messages. -func UnmarshalRouteNextHopVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopVPNGatewayConnectionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP : RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP -// - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP -// This model "extends" RoutePrototypeNextHop -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool { - return true -} - -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPIntf interface { - RoutePrototypeNextHopIntf - isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity : Identifies a VPN gateway connection by a unique property. -// Models which "extend" this model: -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID -// - RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref -// This model "extends" RoutePrototypeNextHop -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` - - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool { - return true -} - -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityIntf interface { - RoutePrototypeNextHopIntf - isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableIdentityByHref : RoutingTableIdentityByHref struct -// This model "extends" RoutingTableIdentity -type RoutingTableIdentityByHref struct { - // The URL for this routing table. - Href *string `json:"href" validate:"required"` -} - -// NewRoutingTableIdentityByHref : Instantiate RoutingTableIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRoutingTableIdentityByHref(href string) (_model *RoutingTableIdentityByHref, err error) { - _model = &RoutingTableIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutingTableIdentityByHref) isaRoutingTableIdentity() bool { - return true -} - -// UnmarshalRoutingTableIdentityByHref unmarshals an instance of RoutingTableIdentityByHref from the specified map of raw messages. -func UnmarshalRoutingTableIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableIdentityByID : RoutingTableIdentityByID struct -// This model "extends" RoutingTableIdentity -type RoutingTableIdentityByID struct { - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` -} - -// NewRoutingTableIdentityByID : Instantiate RoutingTableIdentityByID (Generic Model Constructor) -func (*VpcV1) NewRoutingTableIdentityByID(id string) (_model *RoutingTableIdentityByID, err error) { - _model = &RoutingTableIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutingTableIdentityByID) isaRoutingTableIdentity() bool { - return true -} - -// UnmarshalRoutingTableIdentityByID unmarshals an instance of RoutingTableIdentityByID from the specified map of raw messages. -func UnmarshalRoutingTableIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupIdentityByCRN : SecurityGroupIdentityByCRN struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByCRN struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` -} - -// NewSecurityGroupIdentityByCRN : Instantiate SecurityGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByCRN(crn string) (_model *SecurityGroupIdentityByCRN, err error) { - _model = &SecurityGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupIdentityByCRN) isaSecurityGroupIdentity() bool { - return true -} - -// UnmarshalSecurityGroupIdentityByCRN unmarshals an instance of SecurityGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupIdentityByHref : SecurityGroupIdentityByHref struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByHref struct { - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewSecurityGroupIdentityByHref : Instantiate SecurityGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByHref(href string) (_model *SecurityGroupIdentityByHref, err error) { - _model = &SecurityGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupIdentityByHref) isaSecurityGroupIdentity() bool { - return true -} - -// UnmarshalSecurityGroupIdentityByHref unmarshals an instance of SecurityGroupIdentityByHref from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupIdentityByID : SecurityGroupIdentityByID struct -// This model "extends" SecurityGroupIdentity -type SecurityGroupIdentityByID struct { - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` -} - -// NewSecurityGroupIdentityByID : Instantiate SecurityGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupIdentityByID(id string) (_model *SecurityGroupIdentityByID, err error) { - _model = &SecurityGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupIdentityByID) isaSecurityGroupIdentity() bool { - return true -} - -// UnmarshalSecurityGroupIdentityByID unmarshals an instance of SecurityGroupIdentityByID from the specified map of raw messages. -func UnmarshalSecurityGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` -} - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllProtocolAllConst = "all" -) - -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) isaSecurityGroupRulePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp struct { - // The ICMP traffic code to allow. - // - // If specified, `type` must also be specified. If unspecified, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` - - // The ICMP traffic type to allow. - // - // If unspecified, all types are allowed. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" -) - -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) isaSecurityGroupRulePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. -// -// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are -// allowed for the protocol. When both have the same value, that single destination port is allowed. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` - - // The inclusive upper bound of TCP/UDP destination port range. - // - // If specified, `port_min` must also be specified, and must not be larger. If unspecified, - // `port_min` must also be unspecified, allowing traffic on all destination ports. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range - // - // If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be - // unspecified, allowing traffic on all destination ports. - PortMin *int64 `json:"port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The remote IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group within the VPC. - // - // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source - // (or to any destination, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` -} - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" -) - -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRulePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchCIDR : SecurityGroupRuleRemotePatchCIDR struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` -} - -// NewSecurityGroupRuleRemotePatchCIDR : Instantiate SecurityGroupRuleRemotePatchCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePatchCIDR, err error) { - _model = &SecurityGroupRuleRemotePatchCIDR{ - CIDRBlock: core.StringPtr(cidrBlock), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePatchCIDR) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchCIDR unmarshals an instance of SecurityGroupRuleRemotePatchCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchIP : SecurityGroupRuleRemotePatchIP struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewSecurityGroupRuleRemotePatchIP : Instantiate SecurityGroupRuleRemotePatchIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchIP(address string) (_model *SecurityGroupRuleRemotePatchIP, err error) { - _model = &SecurityGroupRuleRemotePatchIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePatchIP) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchIP unmarshals an instance of SecurityGroupRuleRemotePatchIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchSecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN -// - SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchSecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { - return true -} - -type SecurityGroupRuleRemotePatchSecurityGroupIdentityIntf interface { - SecurityGroupRuleRemotePatchIntf - isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentity) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeCIDR : SecurityGroupRuleRemotePrototypeCIDR struct -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` -} - -// NewSecurityGroupRuleRemotePrototypeCIDR : Instantiate SecurityGroupRuleRemotePrototypeCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePrototypeCIDR, err error) { - _model = &SecurityGroupRuleRemotePrototypeCIDR{ - CIDRBlock: core.StringPtr(cidrBlock), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePrototypeCIDR) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeCIDR unmarshals an instance of SecurityGroupRuleRemotePrototypeCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeIP : SecurityGroupRuleRemotePrototypeIP struct -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewSecurityGroupRuleRemotePrototypeIP : Instantiate SecurityGroupRuleRemotePrototypeIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeIP(address string) (_model *SecurityGroupRuleRemotePrototypeIP, err error) { - _model = &SecurityGroupRuleRemotePrototypeIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePrototypeIP) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeIP unmarshals an instance of SecurityGroupRuleRemotePrototypeIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true -} - -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentityIntf interface { - SecurityGroupRuleRemotePrototypeIntf - isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemoteCIDR : SecurityGroupRuleRemoteCIDR struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteCIDR struct { - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block" validate:"required"` -} - -func (*SecurityGroupRuleRemoteCIDR) isaSecurityGroupRuleRemote() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemoteCIDR unmarshals an instance of SecurityGroupRuleRemoteCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemoteIP : SecurityGroupRuleRemoteIP struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteIP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -func (*SecurityGroupRuleRemoteIP) isaSecurityGroupRuleRemote() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemoteIP unmarshals an instance of SecurityGroupRuleRemoteIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemoteSecurityGroupReference : SecurityGroupRuleRemoteSecurityGroupReference struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteSecurityGroupReference struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name for this security group. The name is unique across all security groups for the VPC. - Name *string `json:"name" validate:"required"` -} - -func (*SecurityGroupRuleRemoteSecurityGroupReference) isaSecurityGroupRuleRemote() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemoteSecurityGroupReference unmarshals an instance of SecurityGroupRuleRemoteSecurityGroupReference from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteSecurityGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleSecurityGroupRuleProtocolAll : A rule allowing traffic for all supported protocols. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolAll struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllProtocolAllConst = "all" -) - -func (*SecurityGroupRuleSecurityGroupRuleProtocolAll) isaSecurityGroupRule() bool { - return true -} - -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleSecurityGroupRuleProtocolIcmp : A rule specifying the ICMP traffic to allow. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolIcmp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The ICMP traffic code to allow. If absent, all codes are allowed. - Code *int64 `json:"code,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The ICMP traffic type to allow. If absent, all types are allowed. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolIcmpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolIcmpProtocolIcmpConst = "icmp" -) - -func (*SecurityGroupRuleSecurityGroupRuleProtocolIcmp) isaSecurityGroupRule() bool { - return true -} - -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolIcmp from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolIcmp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleSecurityGroupRuleProtocolTcpudp : A rule specifying the TCP or UDP traffic to allow. -// -// Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are -// allowed for the protocol. When both have the same value, that single destination port is allowed. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolTcpudp struct { - // The direction of traffic to enforce. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - PortMax *int64 `json:"port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - PortMin *int64 `json:"port_min,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` -} - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Direction property. -// The direction of traffic to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Protocol property. -// The protocol to enforce. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolTCPConst = "tcp" - SecurityGroupRuleSecurityGroupRuleProtocolTcpudpProtocolUDPConst = "udp" -) - -func (*SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) isaSecurityGroupRule() bool { - return true -} - -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolTcpudp from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *BareMetalServerNetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceEndpointGatewayReference : SecurityGroupTargetReferenceEndpointGatewayReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceEndpointGatewayReference struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` - - // The name for this endpoint gateway. The name is unique across all endpoint gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceEndpointGatewayReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceEndpointGatewayReferenceResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -func (*SecurityGroupTargetReferenceEndpointGatewayReference) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference unmarshals an instance of SecurityGroupTargetReferenceEndpointGatewayReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceEndpointGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceEndpointGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceLoadBalancerReference : SecurityGroupTargetReferenceLoadBalancerReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceLoadBalancerReference struct { - // The load balancer's CRN. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *LoadBalancerReferenceDeleted `json:"deleted,omitempty"` - - // The load balancer's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer. - ID *string `json:"id" validate:"required"` - - // The name for this load balancer. The name is unique across all load balancers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceLoadBalancerReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceLoadBalancerReferenceResourceTypeLoadBalancerConst = "load_balancer" -) - -func (*SecurityGroupTargetReferenceLoadBalancerReference) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceLoadBalancerReference unmarshals an instance of SecurityGroupTargetReferenceLoadBalancerReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceLoadBalancerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceLoadBalancerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext : SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network interface. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContextResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext unmarshals an instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceVPNServerReference : SecurityGroupTargetReferenceVPNServerReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceVPNServerReference struct { - // The CRN for this VPN server. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VPNServerReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this VPN server. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN server. - ID *string `json:"id" validate:"required"` - - // The name for this VPN server. The name is unique across all VPN servers in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceVPNServerReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceVPNServerReferenceResourceTypeVPNServerConst = "vpn_server" -) - -func (*SecurityGroupTargetReferenceVPNServerReference) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceVPNServerReference unmarshals an instance of SecurityGroupTargetReferenceVPNServerReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceVPNServerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceVPNServerReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNServerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupTargetReferenceVirtualNetworkInterfaceReference : SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct -// This model "extends" SecurityGroupTargetReference -type SecurityGroupTargetReferenceVirtualNetworkInterfaceReference struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *VirtualNetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` - - // The name for this virtual network interface. The name is unique across all virtual network interfaces in the VPC. - Name *string `json:"name" validate:"required"` - - // The primary IP for this virtual network interface. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` -} - -// Constants associated with the SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceVirtualNetworkInterfaceReferenceResourceTypeVirtualNetworkInterfaceConst = "virtual_network_interface" -) - -func (*SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) isaSecurityGroupTargetReference() bool { - return true -} - -// UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference unmarshals an instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReferenceVirtualNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReferenceVirtualNetworkInterfaceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVirtualNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareIdentityByCRN : ShareIdentityByCRN struct -// This model "extends" ShareIdentity -type ShareIdentityByCRN struct { - // The CRN for this file share. - CRN *string `json:"crn" validate:"required"` -} - -// NewShareIdentityByCRN : Instantiate ShareIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByCRN(crn string) (_model *ShareIdentityByCRN, err error) { - _model = &ShareIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareIdentityByCRN) isaShareIdentity() bool { - return true -} - -// UnmarshalShareIdentityByCRN unmarshals an instance of ShareIdentityByCRN from the specified map of raw messages. -func UnmarshalShareIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareIdentityByHref : ShareIdentityByHref struct -// This model "extends" ShareIdentity -type ShareIdentityByHref struct { - // The URL for this file share. - Href *string `json:"href" validate:"required"` -} - -// NewShareIdentityByHref : Instantiate ShareIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByHref(href string) (_model *ShareIdentityByHref, err error) { - _model = &ShareIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareIdentityByHref) isaShareIdentity() bool { - return true -} - -// UnmarshalShareIdentityByHref unmarshals an instance of ShareIdentityByHref from the specified map of raw messages. -func UnmarshalShareIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareIdentityByID : ShareIdentityByID struct -// This model "extends" ShareIdentity -type ShareIdentityByID struct { - // The unique identifier for this file share. - ID *string `json:"id" validate:"required"` -} - -// NewShareIdentityByID : Instantiate ShareIdentityByID (Generic Model Constructor) -func (*VpcV1) NewShareIdentityByID(id string) (_model *ShareIdentityByID, err error) { - _model = &ShareIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareIdentityByID) isaShareIdentity() bool { - return true -} - -// UnmarshalShareIdentityByID unmarshals an instance of ShareIdentityByID from the specified map of raw messages. -func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : The virtual network interface for this share mount target. The virtual network interface must: -// -// - have `allow_ip_spoofing` set to `false` -// - have `enable_infrastructure_nat` set to `true` -// - not be in the same VPC as an existing mount target for this share -// - not have `ips` other than the `primary_ip` address -// -// If an existing virtual network interface is specified, it must not have a floating IP bound to it, and it must not be -// the target of a flow log collector. -// -// Required if the share's `access_control_mode` is `security_group`. -// This model "extends" ShareMountTargetPrototype -type ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface" validate:"required"` -} - -// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionUserManagedConst = "user_managed" -) - -// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { - _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup{ - VirtualNetworkInterface: virtualNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) isaShareMountTargetPrototype() bool { - return true -} - -// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup from the specified map of raw messages. -func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalShareMountTargetVirtualNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : The VPC in which clients can mount the file share using this mount target. The VPC must not be used by another mount -// target for this share. -// -// Required if the share's `access_control_mode` is `vpc`. -// This model "extends" ShareMountTargetPrototype -type ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC struct { - // The name for this share mount target. The name must not be used by another mount target for the file share. - Name *string `json:"name,omitempty"` - - // The transit encryption mode to use for this share mount target: - // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. - TransitEncryption *string `json:"transit_encryption,omitempty"` - - // Identifies a VPC by a unique property. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` -} - -// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.TransitEncryption property. -// The transit encryption mode to use for this share mount target: -// - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The -// `access_control_mode` for the share must be `security_group`. -const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionUserManagedConst = "user_managed" -) - -// NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { - _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC{ - VPC: vpc, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) isaShareMountTargetPrototype() bool { - return true -} - -// UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC from the specified map of raw messages. -func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "transit_encryption", &obj.TransitEncryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity : Identifies a virtual network interface by a unique property. -// Models which "extend" this model: -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref -// - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototype -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id,omitempty"` - - // The URL for this virtual network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual network interface. - CRN *string `json:"crn,omitempty"` -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityIntf interface { - ShareMountTargetVirtualNetworkInterfacePrototypeIntf - isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext : The virtual network interface for this target. -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototype -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext struct { - // Indicates whether source IP spoofing is allowed on this interface. If `false`, source IP spoofing is prevented on - // this interface. If `true`, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // Indicates whether this virtual network interface will be automatically deleted when - // `target` is deleted. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // If `true`: - // - The VPC infrastructure performs any needed NAT operations. - // - `floating_ips` must not have more than one floating IP. - // - // If `false`: - // - Packets are passed unchanged to/from the virtual network interface, - // allowing the workload to perform any needed NAT operations. - // - `allow_ip_spoofing` must be `false`. - // - Can only be attached to a `target` with a `resource_type` of - // `bare_metal_server_network_attachment`. - EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` - - // Additional IP addresses to bind to the virtual network interface. Each item may be either a reserved IP identity, or - // a reserved IP prototype object which will be used to create a new reserved IP. All IP addresses must be in the - // primary IP's subnet. - // - // If reserved IP identities are provided, the specified reserved IPs must be unbound. - // - // If reserved IP prototype objects with addresses are provided, the addresses must be available on the virtual network - // interface's subnet. For any prototype objects that do not specify an address, an available address on the subnet - // will be automatically selected and reserved. - Ips []VirtualNetworkInterfaceIPPrototypeIntf `json:"ips,omitempty"` - - // The name for this virtual network interface. The name must not be used by another virtual network interface in the - // VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. Names beginning with `ibm-` are - // reserved for provider-owned resources, and are not allowed. - Name *string `json:"name,omitempty"` - - // The primary IP address to bind to the virtual network interface. May be either a - // reserved IP identity, or a reserved IP prototype object which will be used to create a - // new reserved IP. - // - // If a reserved IP identity is provided, the specified reserved IP must be unbound. - // - // If a reserved IP prototype object with an address is provided, the address must be - // available on the virtual network interface's subnet. If no address is specified, - // an available address on the subnet will be automatically selected and reserved. - PrimaryIP VirtualNetworkInterfacePrimaryIPPrototypeIntf `json:"primary_ip,omitempty"` - - // The resource group to use for this virtual network interface. If unspecified, the - // share's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The security groups to use for this virtual network interface. If unspecified, the default security group of the VPC - // for the subnet is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - - // The associated subnet. Required if `primary_ip` does not specify a reserved IP - // identity. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalVirtualNetworkInterfaceIPPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalVirtualNetworkInterfacePrimaryIPPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityDependentRange : The permitted total capacity (in gigabytes) of a share with this profile depends on its configuration. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityDependentRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityDependentRange.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityDependentRangeTypeDependentConst = "dependent" - ShareProfileCapacityDependentRangeTypeDependentRangeConst = "dependent_range" -) - -func (*ShareProfileCapacityDependentRange) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityDependentRange unmarshals an instance of ShareProfileCapacityDependentRange from the specified map of raw messages. -func UnmarshalShareProfileCapacityDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityDependentRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityEnum : The permitted total capacities (in gigabytes) of a share with this profile. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityEnum.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityEnumTypeEnumConst = "enum" -) - -func (*ShareProfileCapacityEnum) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityEnum unmarshals an instance of ShareProfileCapacityEnum from the specified map of raw messages. -func UnmarshalShareProfileCapacityEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityFixed : The permitted total capacity (in gigabytes) of a share with this profile is fixed. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityFixed.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityFixedTypeFixedConst = "fixed" -) - -func (*ShareProfileCapacityFixed) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityFixed unmarshals an instance of ShareProfileCapacityFixed from the specified map of raw messages. -func UnmarshalShareProfileCapacityFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileCapacityRange : The permitted total capacity range (in gigabytes) of a share with this profile. -// This model "extends" ShareProfileCapacity -type ShareProfileCapacityRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileCapacityRange.Type property. -// The type for this profile field. -const ( - ShareProfileCapacityRangeTypeRangeConst = "range" -) - -func (*ShareProfileCapacityRange) isaShareProfileCapacity() bool { - return true -} - -// UnmarshalShareProfileCapacityRange unmarshals an instance of ShareProfileCapacityRange from the specified map of raw messages. -func UnmarshalShareProfileCapacityRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileCapacityRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsDependentRange : The permitted IOPS range of a share with this profile depends on its configuration. -// This model "extends" ShareProfileIops -type ShareProfileIopsDependentRange struct { - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileIopsDependentRange.Type property. -// The type for this profile field. -const ( - ShareProfileIopsDependentRangeTypeDependentConst = "dependent" - ShareProfileIopsDependentRangeTypeDependentRangeConst = "dependent_range" -) - -func (*ShareProfileIopsDependentRange) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsDependentRange unmarshals an instance of ShareProfileIopsDependentRange from the specified map of raw messages. -func UnmarshalShareProfileIopsDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsDependentRange) - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsEnum : The permitted IOPS values of a share with this profile. -// This model "extends" ShareProfileIops -type ShareProfileIopsEnum struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The permitted values for this profile field. - Values []int64 `json:"values" validate:"required"` -} - -// Constants associated with the ShareProfileIopsEnum.Type property. -// The type for this profile field. -const ( - ShareProfileIopsEnumTypeEnumConst = "enum" -) - -func (*ShareProfileIopsEnum) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsEnum unmarshals an instance of ShareProfileIopsEnum from the specified map of raw messages. -func UnmarshalShareProfileIopsEnum(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsEnum) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsFixed : The permitted IOPS of a share with this profile is fixed. -// This model "extends" ShareProfileIops -type ShareProfileIopsFixed struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` -} - -// Constants associated with the ShareProfileIopsFixed.Type property. -// The type for this profile field. -const ( - ShareProfileIopsFixedTypeFixedConst = "fixed" -) - -func (*ShareProfileIopsFixed) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsFixed unmarshals an instance of ShareProfileIopsFixed from the specified map of raw messages. -func UnmarshalShareProfileIopsFixed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsFixed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIopsRange : The permitted IOPS range of a share with this profile. -// This model "extends" ShareProfileIops -type ShareProfileIopsRange struct { - // The default value for this profile field. - Default *int64 `json:"default" validate:"required"` - - // The maximum value for this profile field. - Max *int64 `json:"max" validate:"required"` - - // The minimum value for this profile field. - Min *int64 `json:"min" validate:"required"` - - // The increment step value for this profile field. - Step *int64 `json:"step" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ShareProfileIopsRange.Type property. -// The type for this profile field. -const ( - ShareProfileIopsRangeTypeRangeConst = "range" -) - -func (*ShareProfileIopsRange) isaShareProfileIops() bool { - return true -} - -// UnmarshalShareProfileIopsRange unmarshals an instance of ShareProfileIopsRange from the specified map of raw messages. -func UnmarshalShareProfileIopsRange(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIopsRange) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIdentityByHref : ShareProfileIdentityByHref struct -// This model "extends" ShareProfileIdentity -type ShareProfileIdentityByHref struct { - // The URL for this share profile. - Href *string `json:"href" validate:"required"` -} - -// NewShareProfileIdentityByHref : Instantiate ShareProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewShareProfileIdentityByHref(href string) (_model *ShareProfileIdentityByHref, err error) { - _model = &ShareProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareProfileIdentityByHref) isaShareProfileIdentity() bool { - return true -} - -// UnmarshalShareProfileIdentityByHref unmarshals an instance of ShareProfileIdentityByHref from the specified map of raw messages. -func UnmarshalShareProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareProfileIdentityByName : ShareProfileIdentityByName struct -// This model "extends" ShareProfileIdentity -type ShareProfileIdentityByName struct { - // The globally unique name for this share profile. - Name *string `json:"name" validate:"required"` -} - -// NewShareProfileIdentityByName : Instantiate ShareProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewShareProfileIdentityByName(name string) (_model *ShareProfileIdentityByName, err error) { - _model = &ShareProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareProfileIdentityByName) isaShareProfileIdentity() bool { - return true -} - -// UnmarshalShareProfileIdentityByName unmarshals an instance of ShareProfileIdentityByName from the specified map of raw messages. -func UnmarshalShareProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePrototypeShareBySize : Create a file share by size. -// This model "extends" SharePrototype -type SharePrototypeShareBySize struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The - // profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The access control mode for the share: - // - // - `security_group`: The security groups on the virtual network interface for a - // mount target control access to the mount target. Mount targets for this share - // require a virtual network interface. - // - `vpc`: All clients in the VPC for a mount target have access to the mount target. - // Mount targets for this share require a VPC. - AccessControlMode *string `json:"access_control_mode,omitempty"` - - // The root key to use to wrap the data encryption key for the share. - // - // If unspecified, the `encryption` type for the share will be `provider_managed`. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The owner assigned to the file share at creation. Subsequent changes to the owner - // must be performed by a client that has mounted the file share. - InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The size of the file share rounded up to the next gigabyte. - // - // The maximum size for a share may increase in the future. - Size *int64 `json:"size" validate:"required"` -} - -// Constants associated with the SharePrototypeShareBySize.AccessControlMode property. -// The access control mode for the share: -// -// - `security_group`: The security groups on the virtual network interface for a -// mount target control access to the mount target. Mount targets for this share -// require a virtual network interface. -// - `vpc`: All clients in the VPC for a mount target have access to the mount target. -// Mount targets for this share require a VPC. -const ( - SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" - SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" -) - -// NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { - _model = &SharePrototypeShareBySize{ - Profile: profile, - Zone: zone, - Size: core.Int64Ptr(size), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SharePrototypeShareBySize) isaSharePrototype() bool { - return true -} - -// UnmarshalSharePrototypeShareBySize unmarshals an instance of SharePrototypeShareBySize from the specified map of raw messages. -func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareBySize) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "access_control_mode", &obj.AccessControlMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "initial_owner", &obj.InitialOwner, UnmarshalShareInitialOwner) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for `initial_owner`, -// `access_control_mode`, `encryption_key` and `size` will be inherited from `source_share`. -// This model "extends" SharePrototype -type SharePrototypeShareBySourceShare struct { - // The maximum input/output operations per second (IOPS) for the file share. The share must be in the - // `defined_performance` profile family, and the value must be in the range supported by the share's specified size. - // - // In addition, each client accessing the share will be restricted to 48,000 IOPS. - Iops *int64 `json:"iops,omitempty"` - - // The mount targets for the file share. Each mount target must be in a unique VPC. - MountTargets []ShareMountTargetPrototypeIntf `json:"mount_targets,omitempty"` - - // The name for this share. The name must not be used by another share in the region. If unspecified, the name will be - // a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use for this file share. The - // profile must support the share's specified IOPS and size. - Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` - - ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` - - // Tags for this resource. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this file share will reside in. - // - // For a replica share, this must be a different zone in the same region as the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The root key to use to wrap the data encryption key for the share. - // - // This property must be specified if the `source_share` is in a different region and has - // an `encryption` type of `user_managed`, and must not be specified otherwise (its value - // will be inherited from `source_share`). - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The cron specification for the file share replication schedule. - // - // Replication of a share can be scheduled to occur at most once per hour. - ReplicationCronSpec *string `json:"replication_cron_spec" validate:"required"` - - // The resource group to use. If unspecified, the resource group from - // the source share will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner - // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). - SourceShare ShareIdentityIntf `json:"source_share" validate:"required"` -} - -// NewSharePrototypeShareBySourceShare : Instantiate SharePrototypeShareBySourceShare (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, zone ZoneIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { - _model = &SharePrototypeShareBySourceShare{ - Profile: profile, - Zone: zone, - ReplicationCronSpec: core.StringPtr(replicationCronSpec), - SourceShare: sourceShare, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SharePrototypeShareBySourceShare) isaSharePrototype() bool { - return true -} - -// UnmarshalSharePrototypeShareBySourceShare unmarshals an instance of SharePrototypeShareBySourceShare from the specified map of raw messages. -func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SharePrototypeShareBySourceShare) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalModel(m, "mount_targets", &obj.MountTargets, UnmarshalShareMountTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalShareProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "replica_share", &obj.ReplicaShare, UnmarshalSharePrototypeShareContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "replication_cron_spec", &obj.ReplicationCronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_share", &obj.SourceShare, UnmarshalShareIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots : SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots struct -// This model "extends" SnapshotConsistencyGroupPrototype -type SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots struct { - // Indicates whether deleting the snapshot consistency group will also delete the snapshots in the group. - DeleteSnapshotsOnDelete *bool `json:"delete_snapshots_on_delete,omitempty"` - - // The name for this snapshot consistency group. The name must be unique across all snapshot consistency groups in the - // region. - // - // If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The data-consistent member snapshots to create. All snapshots must specify a - // `source_volume` attached to the same virtual server instance. - Snapshots []SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem `json:"snapshots" validate:"required"` -} - -// NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots : Instantiate SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots (Generic Model Constructor) -func (*VpcV1) NewSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(snapshots []SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) (_model *SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots, err error) { - _model = &SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots{ - Snapshots: snapshots, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots) isaSnapshotConsistencyGroupPrototype() bool { - return true -} - -// UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots unmarshals an instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots from the specified map of raw messages. -func UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots) - err = core.UnmarshalPrimitive(m, "delete_snapshots_on_delete", &obj.DeleteSnapshotsOnDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshotsSnapshotsItem) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotIdentityByCRN : SnapshotIdentityByCRN struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByCRN struct { - // The CRN of this snapshot. - CRN *string `json:"crn" validate:"required"` -} - -// NewSnapshotIdentityByCRN : Instantiate SnapshotIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByCRN(crn string) (_model *SnapshotIdentityByCRN, err error) { - _model = &SnapshotIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotIdentityByCRN) isaSnapshotIdentity() bool { - return true -} - -// UnmarshalSnapshotIdentityByCRN unmarshals an instance of SnapshotIdentityByCRN from the specified map of raw messages. -func UnmarshalSnapshotIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotIdentityByHref : SnapshotIdentityByHref struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByHref struct { - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` -} - -// NewSnapshotIdentityByHref : Instantiate SnapshotIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByHref(href string) (_model *SnapshotIdentityByHref, err error) { - _model = &SnapshotIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotIdentityByHref) isaSnapshotIdentity() bool { - return true -} - -// UnmarshalSnapshotIdentityByHref unmarshals an instance of SnapshotIdentityByHref from the specified map of raw messages. -func UnmarshalSnapshotIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotIdentityByID : SnapshotIdentityByID struct -// This model "extends" SnapshotIdentity -type SnapshotIdentityByID struct { - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` -} - -// NewSnapshotIdentityByID : Instantiate SnapshotIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSnapshotIdentityByID(id string) (_model *SnapshotIdentityByID, err error) { - _model = &SnapshotIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotIdentityByID) isaSnapshotIdentity() bool { - return true -} - -// UnmarshalSnapshotIdentityByID unmarshals an instance of SnapshotIdentityByID from the specified map of raw messages. -func UnmarshalSnapshotIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotPrototypeSnapshotBySourceSnapshot : SnapshotPrototypeSnapshotBySourceSnapshot struct -// This model "extends" SnapshotPrototype -type SnapshotPrototypeSnapshotBySourceSnapshot struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` - - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` - - // The root key to use to wrap the data encryption key for this snapshot. - // - // A key must be specified if and only if the source snapshot has an `encryption` type of - // `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify - // a key in the same region as the new snapshot, and use the same encryption key for all - // snapshots using the same source volume. - // - // The specified key may be in a different account, subject to IAM policies. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The source snapshot (in another region) to create this snapshot from. - // The specified snapshot must not already be the source of another snapshot in this - // region. - SourceSnapshot *SnapshotIdentityByCRN `json:"source_snapshot" validate:"required"` -} - -// NewSnapshotPrototypeSnapshotBySourceSnapshot : Instantiate SnapshotPrototypeSnapshotBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceSnapshot(sourceSnapshot *SnapshotIdentityByCRN) (_model *SnapshotPrototypeSnapshotBySourceSnapshot, err error) { - _model = &SnapshotPrototypeSnapshotBySourceSnapshot{ - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotPrototypeSnapshotBySourceSnapshot) isaSnapshotPrototype() bool { - return true -} - -// UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot unmarshals an instance of SnapshotPrototypeSnapshotBySourceSnapshot from the specified map of raw messages. -func UnmarshalSnapshotPrototypeSnapshotBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototypeSnapshotBySourceSnapshot) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentityByCRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SnapshotPrototypeSnapshotBySourceVolume : SnapshotPrototypeSnapshotBySourceVolume struct -// This model "extends" SnapshotPrototype -type SnapshotPrototypeSnapshotBySourceVolume struct { - // Clones to create for this snapshot. - Clones []SnapshotClonePrototype `json:"clones,omitempty"` - - // The name for this snapshot. The name must not be used by another snapshot in the region. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. - UserTags []string `json:"user_tags,omitempty"` - - // The volume to create this snapshot from. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` -} - -// NewSnapshotPrototypeSnapshotBySourceVolume : Instantiate SnapshotPrototypeSnapshotBySourceVolume (Generic Model Constructor) -func (*VpcV1) NewSnapshotPrototypeSnapshotBySourceVolume(sourceVolume VolumeIdentityIntf) (_model *SnapshotPrototypeSnapshotBySourceVolume, err error) { - _model = &SnapshotPrototypeSnapshotBySourceVolume{ - SourceVolume: sourceVolume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SnapshotPrototypeSnapshotBySourceVolume) isaSnapshotPrototype() bool { - return true -} - -// UnmarshalSnapshotPrototypeSnapshotBySourceVolume unmarshals an instance of SnapshotPrototypeSnapshotBySourceVolume from the specified map of raw messages. -func UnmarshalSnapshotPrototypeSnapshotBySourceVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPrototypeSnapshotBySourceVolume) - err = core.UnmarshalModel(m, "clones", &obj.Clones, UnmarshalSnapshotClonePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetIdentityByCRN : SubnetIdentityByCRN struct -// This model "extends" SubnetIdentity -type SubnetIdentityByCRN struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` -} - -// NewSubnetIdentityByCRN : Instantiate SubnetIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByCRN(crn string) (_model *SubnetIdentityByCRN, err error) { - _model = &SubnetIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetIdentityByCRN) isaSubnetIdentity() bool { - return true -} - -// UnmarshalSubnetIdentityByCRN unmarshals an instance of SubnetIdentityByCRN from the specified map of raw messages. -func UnmarshalSubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetIdentityByHref : SubnetIdentityByHref struct -// This model "extends" SubnetIdentity -type SubnetIdentityByHref struct { - // The URL for this subnet. - Href *string `json:"href" validate:"required"` -} - -// NewSubnetIdentityByHref : Instantiate SubnetIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByHref(href string) (_model *SubnetIdentityByHref, err error) { - _model = &SubnetIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetIdentityByHref) isaSubnetIdentity() bool { - return true -} - -// UnmarshalSubnetIdentityByHref unmarshals an instance of SubnetIdentityByHref from the specified map of raw messages. -func UnmarshalSubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetIdentityByID : SubnetIdentityByID struct -// This model "extends" SubnetIdentity -type SubnetIdentityByID struct { - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` -} - -// NewSubnetIdentityByID : Instantiate SubnetIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSubnetIdentityByID(id string) (_model *SubnetIdentityByID, err error) { - _model = &SubnetIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetIdentityByID) isaSubnetIdentity() bool { - return true -} - -// UnmarshalSubnetIdentityByID unmarshals an instance of SubnetIdentityByID from the specified map of raw messages. -func UnmarshalSubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPrototypeSubnetByCIDR : SubnetPrototypeSubnetByCIDR struct -// This model "extends" SubnetPrototype -type SubnetPrototypeSubnetByCIDR struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be - // attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing - // table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` - - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` - // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of - // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix - // that contains the subnet's IPv4 CIDR. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` - - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} - -// Constants associated with the SubnetPrototypeSubnetByCIDR.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeSubnetByCIDRIPVersionIpv4Const = "ipv4" -) - -// NewSubnetPrototypeSubnetByCIDR : Instantiate SubnetPrototypeSubnetByCIDR (Generic Model Constructor) -func (*VpcV1) NewSubnetPrototypeSubnetByCIDR(vpc VPCIdentityIntf, ipv4CIDRBlock string) (_model *SubnetPrototypeSubnetByCIDR, err error) { - _model = &SubnetPrototypeSubnetByCIDR{ - VPC: vpc, - Ipv4CIDRBlock: core.StringPtr(ipv4CIDRBlock), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPrototypeSubnetByCIDR) isaSubnetPrototype() bool { - return true -} - -// UnmarshalSubnetPrototypeSubnetByCIDR unmarshals an instance of SubnetPrototypeSubnetByCIDR from the specified map of raw messages. -func UnmarshalSubnetPrototypeSubnetByCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototypeSubnetByCIDR) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPrototypeSubnetByTotalCount : SubnetPrototypeSubnetByTotalCount struct -// This model "extends" SubnetPrototype -type SubnetPrototypeSubnetByTotalCount struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` - - // The name for this subnet. The name must not be used by another subnet in the VPC. If unspecified, the name will be a - // hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be - // attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing - // table properties `route_direct_link_ingress`, - // `route_internet_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` - - // The VPC the subnet will reside in. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the - // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` - - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// Constants associated with the SubnetPrototypeSubnetByTotalCount.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeSubnetByTotalCountIPVersionIpv4Const = "ipv4" -) - -// NewSubnetPrototypeSubnetByTotalCount : Instantiate SubnetPrototypeSubnetByTotalCount (Generic Model Constructor) -func (*VpcV1) NewSubnetPrototypeSubnetByTotalCount(vpc VPCIdentityIntf, totalIpv4AddressCount int64, zone ZoneIdentityIntf) (_model *SubnetPrototypeSubnetByTotalCount, err error) { - _model = &SubnetPrototypeSubnetByTotalCount{ - VPC: vpc, - TotalIpv4AddressCount: core.Int64Ptr(totalIpv4AddressCount), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPrototypeSubnetByTotalCount) isaSubnetPrototype() bool { - return true -} - -// UnmarshalSubnetPrototypeSubnetByTotalCount unmarshals an instance of SubnetPrototypeSubnetByTotalCount from the specified map of raw messages. -func UnmarshalSubnetPrototypeSubnetByTotalCount(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototypeSubnetByTotalCount) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatchPublicGatewayIdentityByCRN : SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByCRN struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` -} - -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(crn string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByCRN, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) isaSubnetPublicGatewayPatch() bool { - return true -} - -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByCRN from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatchPublicGatewayIdentityByHref : SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByHref struct { - // The URL for this public gateway. - Href *string `json:"href" validate:"required"` -} - -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByHref(href string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByHref, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByHref) isaSubnetPublicGatewayPatch() bool { - return true -} - -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByHref from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SubnetPublicGatewayPatchPublicGatewayIdentityByID : SubnetPublicGatewayPatchPublicGatewayIdentityByID struct -// This model "extends" SubnetPublicGatewayPatch -type SubnetPublicGatewayPatchPublicGatewayIdentityByID struct { - // The unique identifier for this public gateway. - ID *string `json:"id" validate:"required"` -} - -// NewSubnetPublicGatewayPatchPublicGatewayIdentityByID : Instantiate SubnetPublicGatewayPatchPublicGatewayIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSubnetPublicGatewayPatchPublicGatewayIdentityByID(id string) (_model *SubnetPublicGatewayPatchPublicGatewayIdentityByID, err error) { - _model = &SubnetPublicGatewayPatchPublicGatewayIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SubnetPublicGatewayPatchPublicGatewayIdentityByID) isaSubnetPublicGatewayPatch() bool { - return true -} - -// UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID unmarshals an instance of SubnetPublicGatewayPatchPublicGatewayIdentityByID from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatchPublicGatewayIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileIdentityTrustedProfileByCRN : TrustedProfileIdentityTrustedProfileByCRN struct -// This model "extends" TrustedProfileIdentity -type TrustedProfileIdentityTrustedProfileByCRN struct { - // The CRN for this trusted profile. - CRN *string `json:"crn" validate:"required"` -} - -// NewTrustedProfileIdentityTrustedProfileByCRN : Instantiate TrustedProfileIdentityTrustedProfileByCRN (Generic Model Constructor) -func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByCRN(crn string) (_model *TrustedProfileIdentityTrustedProfileByCRN, err error) { - _model = &TrustedProfileIdentityTrustedProfileByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*TrustedProfileIdentityTrustedProfileByCRN) isaTrustedProfileIdentity() bool { - return true -} - -// UnmarshalTrustedProfileIdentityTrustedProfileByCRN unmarshals an instance of TrustedProfileIdentityTrustedProfileByCRN from the specified map of raw messages. -func UnmarshalTrustedProfileIdentityTrustedProfileByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentityTrustedProfileByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// TrustedProfileIdentityTrustedProfileByID : TrustedProfileIdentityTrustedProfileByID struct -// This model "extends" TrustedProfileIdentity -type TrustedProfileIdentityTrustedProfileByID struct { - // The unique identifier for this trusted profile. - ID *string `json:"id" validate:"required"` -} - -// NewTrustedProfileIdentityTrustedProfileByID : Instantiate TrustedProfileIdentityTrustedProfileByID (Generic Model Constructor) -func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByID(id string) (_model *TrustedProfileIdentityTrustedProfileByID, err error) { - _model = &TrustedProfileIdentityTrustedProfileByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*TrustedProfileIdentityTrustedProfileByID) isaTrustedProfileIdentity() bool { - return true -} - -// UnmarshalTrustedProfileIdentityTrustedProfileByID unmarshals an instance of TrustedProfileIdentityTrustedProfileByID from the specified map of raw messages. -func UnmarshalTrustedProfileIdentityTrustedProfileByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(TrustedProfileIdentityTrustedProfileByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Manually specify the DNS server addresses for this VPC. -// This model "extends" VpcdnsResolverPrototype -type VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype struct { - // The DNS servers to use for this VPC. All the DNS servers must either: - // - // - have a unique `zone_affinity`, or - // - not have a `zone_affinity`. - // - // If `zone_affinity` is specified, exactly one DNS server must be specified for each zone in the region. The DHCP - // [Domain Name Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list this DNS - // server first, followed by unique DNS servers from other zones if available. - // - // If `zone_affinity` is not specified, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServerPrototype `json:"manual_servers" validate:"required"` - - // The type of the DNS resolver to use. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype.Type property. -// The type of the DNS resolver to use. -const ( - VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototypeTypeManualConst = "manual" -) - -// NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype : Instantiate VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(manualServers []DnsServerPrototype, typeVar string) (_model *VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype, err error) { - _model = &VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype{ - ManualServers: manualServers, - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) isaVpcdnsResolverPrototype() bool { - return true -} - -// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeManualPrototype) - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype : The system will provide DNS server addresses for this VPC. The system-provided DNS server addresses depend on whether -// any endpoint gateways reside in the VPC, and whether a -// [DNS Services](https://cloud.ibm.com/docs/dns-svcs) instance is configured for the VPC. -// This model "extends" VpcdnsResolverPrototype -type VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype struct { - // The type of the DNS resolver to use. - Type *string `json:"type,omitempty"` -} - -// Constants associated with the VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype.Type property. -// The type of the DNS resolver to use. -const ( - VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototypeTypeSystemConst = "system" -) - -func (*VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) isaVpcdnsResolverPrototype() bool { - return true -} - -// UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype unmarshals an instance of VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype from the specified map of raw messages. -func UnmarshalVpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverPrototypeVpcdnsResolverTypeSystemPrototype) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeDelegated : The DNS server addresses are delegated to the DNS resolver of another VPC. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeDelegated struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` - - // The VPC whose DNS resolver provides the DNS server addresses for this VPC. - // - // The VPC may be remote and therefore may not be directly retrievable. - VPC *VPCReferenceDnsResolverContext `json:"vpc" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeDelegated.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeDelegatedTypeDelegatedConst = "delegated" -) - -func (*VpcdnsResolverTypeDelegated) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeDelegated unmarshals an instance of VpcdnsResolverTypeDelegated from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeDelegated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeDelegated) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReferenceDnsResolverContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeManual : The DNS server addresses are manually specified. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeManual struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The manually specified DNS servers for this VPC. - // - // If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone will list the DNS server with the - // affinity for that zone first, followed by the unique DNS servers from other zones. - // - // If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server - // Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone will list all the manual DNS - // servers in the order specified. - ManualServers []DnsServer `json:"manual_servers" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeManual.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeManualTypeManualConst = "manual" -) - -func (*VpcdnsResolverTypeManual) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeManual unmarshals an instance of VpcdnsResolverTypeManual from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeManual(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeManual) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manual_servers", &obj.ManualServers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverTypeSystem : The DNS server addresses are provided by the system and depend on the configuration. -// This model "extends" VpcdnsResolver -type VpcdnsResolverTypeSystem struct { - // The DNS servers for this VPC. The servers are populated: - // - // - by the system when `dns.resolver.type` is `system` - // - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is `delegated` - // - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`. - Servers []DnsServer `json:"servers" validate:"required"` - - // The configuration of the system DNS resolver for this VPC. - // - // - `custom_resolver`: A custom DNS resolver is configured for this VPC. - // - // - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when - // the VPC has either or both of the following: - // - // - at least one endpoint gateway residing in it - // - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it - // - // - `default`: The provider default DNS resolvers are configured for this VPC. - // - // This system DNS resolver configuration is used when the VPC has: - // - // - no custom DNS resolver configured for it, and - // - no endpoint gateways residing in it, and - // - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. - Configuration *string `json:"configuration" validate:"required"` - - // The type of the DNS resolver used for the VPC. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the VpcdnsResolverTypeSystem.Configuration property. -// The configuration of the system DNS resolver for this VPC. -// -// - `custom_resolver`: A custom DNS resolver is configured for this VPC. -// -// - `private_resolver`: A private DNS resolver is configured for this VPC. Applicable when -// the VPC has either or both of the following: -// -// - at least one endpoint gateway residing in it -// -// - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it -// -// - `default`: The provider default DNS resolvers are configured for this VPC. -// -// This system DNS resolver configuration is used when the VPC has: -// -// - no custom DNS resolver configured for it, and -// - no endpoint gateways residing in it, and -// - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured for it. -const ( - VpcdnsResolverTypeSystemConfigurationCustomResolverConst = "custom_resolver" - VpcdnsResolverTypeSystemConfigurationDefaultConst = "default" - VpcdnsResolverTypeSystemConfigurationPrivateResolverConst = "private_resolver" -) - -// Constants associated with the VpcdnsResolverTypeSystem.Type property. -// The type of the DNS resolver used for the VPC. -const ( - VpcdnsResolverTypeSystemTypeSystemConst = "system" -) - -func (*VpcdnsResolverTypeSystem) isaVpcdnsResolver() bool { - return true -} - -// UnmarshalVpcdnsResolverTypeSystem unmarshals an instance of VpcdnsResolverTypeSystem from the specified map of raw messages. -func UnmarshalVpcdnsResolverTypeSystem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverTypeSystem) - err = core.UnmarshalModel(m, "servers", &obj.Servers, UnmarshalDnsServer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "configuration", &obj.Configuration) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByCRN : VpcdnsResolverVPCPatchVPCIdentityByCRN struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByCRN : Instantiate VpcdnsResolverVPCPatchVPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByCRN(crn string) (_model *VpcdnsResolverVPCPatchVPCIdentityByCRN, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByCRN) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByCRN from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByHref : VpcdnsResolverVPCPatchVPCIdentityByHref struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByHref : Instantiate VpcdnsResolverVPCPatchVPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByHref(href string) (_model *VpcdnsResolverVPCPatchVPCIdentityByHref, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByHref) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByHref from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpcdnsResolverVPCPatchVPCIdentityByID : VpcdnsResolverVPCPatchVPCIdentityByID struct -// This model "extends" VpcdnsResolverVPCPatch -type VpcdnsResolverVPCPatchVPCIdentityByID struct { - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` -} - -// NewVpcdnsResolverVPCPatchVPCIdentityByID : Instantiate VpcdnsResolverVPCPatchVPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVpcdnsResolverVPCPatchVPCIdentityByID(id string) (_model *VpcdnsResolverVPCPatchVPCIdentityByID, err error) { - _model = &VpcdnsResolverVPCPatchVPCIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VpcdnsResolverVPCPatchVPCIdentityByID) isaVpcdnsResolverVPCPatch() bool { - return true -} - -// UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID unmarshals an instance of VpcdnsResolverVPCPatchVPCIdentityByID from the specified map of raw messages. -func UnmarshalVpcdnsResolverVPCPatchVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpcdnsResolverVPCPatchVPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCIdentityByCRN : VPCIdentityByCRN struct -// This model "extends" VPCIdentity -type VPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewVPCIdentityByCRN : Instantiate VPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByCRN(crn string) (_model *VPCIdentityByCRN, err error) { - _model = &VPCIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPCIdentityByCRN) isaVPCIdentity() bool { - return true -} - -// UnmarshalVPCIdentityByCRN unmarshals an instance of VPCIdentityByCRN from the specified map of raw messages. -func UnmarshalVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCIdentityByHref : VPCIdentityByHref struct -// This model "extends" VPCIdentity -type VPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} - -// NewVPCIdentityByHref : Instantiate VPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByHref(href string) (_model *VPCIdentityByHref, err error) { - _model = &VPCIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPCIdentityByHref) isaVPCIdentity() bool { - return true -} - -// UnmarshalVPCIdentityByHref unmarshals an instance of VPCIdentityByHref from the specified map of raw messages. -func UnmarshalVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCIdentityByID : VPCIdentityByID struct -// This model "extends" VPCIdentity -type VPCIdentityByID struct { - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` -} - -// NewVPCIdentityByID : Instantiate VPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPCIdentityByID(id string) (_model *VPCIdentityByID, err error) { - _model = &VPCIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPCIdentityByID) isaVPCIdentity() bool { - return true -} - -// UnmarshalVPCIdentityByID unmarshals an instance of VPCIdentityByID from the specified map of raw messages. -func UnmarshalVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIkePolicyPatch -type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref struct { - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIkePolicyPatch -type VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID struct { - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIkePolicyPrototype -type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref struct { - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIkePolicyPrototype -type VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID struct { - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID : Instantiate VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(id string) (_model *VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPatch -type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref struct { - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPatch -type VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype -type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref struct { - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(href string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct -// This model "extends" VPNGatewayConnectionIPsecPolicyPrototype -type VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` -} - -// NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID : Instantiate VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(id string) (_model *VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID, err error) { - _model = &VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPolicyMode : VPNGatewayConnectionPolicyMode struct -// This model "extends" VPNGatewayConnection -type VPNGatewayConnectionPolicyMode struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` - - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` - - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` - - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs" validate:"required"` - - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionPolicyMode.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionPolicyModeAuthenticationModePskConst = "psk" -) - -// Constants associated with the VPNGatewayConnectionPolicyMode.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionPolicyModeModePolicyConst = "policy" - VPNGatewayConnectionPolicyModeModeRouteConst = "route" -) - -// Constants associated with the VPNGatewayConnectionPolicyMode.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionPolicyModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// Constants associated with the VPNGatewayConnectionPolicyMode.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionPolicyModeStatusDownConst = "down" - VPNGatewayConnectionPolicyModeStatusUpConst = "up" -) - -func (*VPNGatewayConnectionPolicyMode) isaVPNGatewayConnection() bool { - return true -} - -// UnmarshalVPNGatewayConnectionPolicyMode unmarshals an instance of VPNGatewayConnectionPolicyMode from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPolicyMode) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct -// This model "extends" VPNGatewayConnectionPrototype -type VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs" validate:"required"` - - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs" validate:"required"` -} - -// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(peerAddress string, psk string, localCIDRs []string, peerCIDRs []string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype, err error) { - _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype{ - PeerAddress: core.StringPtr(peerAddress), - Psk: core.StringPtr(psk), - LocalCIDRs: localCIDRs, - PeerCIDRs: peerCIDRs, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) isaVPNGatewayConnectionPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct -// This model "extends" VPNGatewayConnectionPrototype -type VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototypeRoutingProtocolNoneConst = "none" -) - -// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(peerAddress string, psk string) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype, err error) { - _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype{ - PeerAddress: core.StringPtr(peerAddress), - Psk: core.StringPtr(psk), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) isaVPNGatewayConnectionPrototype() bool { - return true -} - -// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayConnectionStaticRouteMode : VPNGatewayConnectionStaticRouteMode struct -// This model "extends" VPNGatewayConnection -type VPNGatewayConnectionStaticRouteMode struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` - - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` - - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` - - // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. - Name *string `json:"name" validate:"required"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The pre-shared key. - Psk *string `json:"psk" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` - - // The reasons for the current VPN gateway connection status (if any): - // - `cannot_authenticate_connection`: Failed to authenticate a connection because of - // mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration) - // - `internal_error`: Internal error (contact IBM support) - // - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable (check - // the IKE policies on both sides of the VPN) - // - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local CIDRs and - // remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs in IKE - // V1 configuration) - // - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs in IKE - // V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration) - // - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was acceptable - // (check the IPsec policies on both sides of the VPN) - // - `peer_not_responding`: No response from peer (check network ACL configuration, peer - // availability, and on-premise firewall configuration) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol" validate:"required"` - - // The VPN tunnel configuration for this VPN gateway connection (in static route mode). - Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels" validate:"required"` -} - -// Constants associated with the VPNGatewayConnectionStaticRouteMode.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionStaticRouteModeAuthenticationModePskConst = "psk" -) - -// Constants associated with the VPNGatewayConnectionStaticRouteMode.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionStaticRouteModeModePolicyConst = "policy" - VPNGatewayConnectionStaticRouteModeModeRouteConst = "route" -) - -// Constants associated with the VPNGatewayConnectionStaticRouteMode.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionStaticRouteModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// Constants associated with the VPNGatewayConnectionStaticRouteMode.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionStaticRouteModeStatusDownConst = "down" - VPNGatewayConnectionStaticRouteModeStatusUpConst = "up" -) - -// Constants associated with the VPNGatewayConnectionStaticRouteMode.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionStaticRouteModeRoutingProtocolNoneConst = "none" -) - -func (*VPNGatewayConnectionStaticRouteMode) isaVPNGatewayConnection() bool { - return true -} - -// UnmarshalVPNGatewayConnectionStaticRouteMode unmarshals an instance of VPNGatewayConnectionStaticRouteMode from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStaticRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStaticRouteMode) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPolicyMode : VPNGatewayPolicyMode struct -// This model "extends" VPNGateway -type VPNGatewayPolicyMode struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // Policy mode VPN gateway. - Mode *string `json:"mode" validate:"required"` -} - -// Constants associated with the VPNGatewayPolicyMode.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayPolicyModeHealthStateDegradedConst = "degraded" - VPNGatewayPolicyModeHealthStateFaultedConst = "faulted" - VPNGatewayPolicyModeHealthStateInapplicableConst = "inapplicable" - VPNGatewayPolicyModeHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGatewayPolicyMode.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayPolicyModeLifecycleStateDeletingConst = "deleting" - VPNGatewayPolicyModeLifecycleStateFailedConst = "failed" - VPNGatewayPolicyModeLifecycleStatePendingConst = "pending" - VPNGatewayPolicyModeLifecycleStateStableConst = "stable" - VPNGatewayPolicyModeLifecycleStateSuspendedConst = "suspended" - VPNGatewayPolicyModeLifecycleStateUpdatingConst = "updating" - VPNGatewayPolicyModeLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGatewayPolicyMode.ResourceType property. -// The resource type. -const ( - VPNGatewayPolicyModeResourceTypeVPNGatewayConst = "vpn_gateway" -) - -// Constants associated with the VPNGatewayPolicyMode.Mode property. -// Policy mode VPN gateway. -const ( - VPNGatewayPolicyModeModePolicyConst = "policy" -) - -func (*VPNGatewayPolicyMode) isaVPNGateway() bool { - return true -} - -// UnmarshalVPNGatewayPolicyMode unmarshals an instance of VPNGatewayPolicyMode from the specified map of raw messages. -func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPolicyMode) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayPolicyModePrototype : VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Policy mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayPolicyModePrototype.Mode property. -// Policy mode VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayPolicyModePrototypeModePolicyConst = "policy" -) - -// NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayPolicyModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayPolicyModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayPolicyModePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayPrototypeVPNGatewayPolicyModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayPolicyModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayRouteModePrototype : VPNGatewayPrototypeVPNGatewayRouteModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayRouteModePrototype.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayRouteModePrototypeModeRouteConst = "route" -) - -// NewVPNGatewayPrototypeVPNGatewayRouteModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayRouteModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayRouteModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayRouteModePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNGatewayPrototypeVPNGatewayRouteModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayRouteModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayRouteMode : VPNGatewayRouteMode struct -// This model "extends" VPNGateway -type VPNGatewayRouteMode struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // The reasons for the current VPN gateway health_state (if any): - // - `cannot_create_vpc_route`: VPN cannot create route (check for conflict) - // - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the VPN's - // subnet) - // - `internal_error`: Internal error (contact IBM support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" validate:"required"` - - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` - - // The reasons for the current VPN gateway lifecycle_state (if any): - // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - // support) - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode" validate:"required"` -} - -// Constants associated with the VPNGatewayRouteMode.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - VPNGatewayRouteModeHealthStateDegradedConst = "degraded" - VPNGatewayRouteModeHealthStateFaultedConst = "faulted" - VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" - VPNGatewayRouteModeHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGatewayRouteMode.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" - VPNGatewayRouteModeLifecycleStateFailedConst = "failed" - VPNGatewayRouteModeLifecycleStatePendingConst = "pending" - VPNGatewayRouteModeLifecycleStateStableConst = "stable" - VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" - VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" - VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGatewayRouteMode.ResourceType property. -// The resource type. -const ( - VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" -) - -// Constants associated with the VPNGatewayRouteMode.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayRouteModeModeRouteConst = "route" -) - -func (*VPNGatewayRouteMode) isaVPNGateway() bool { - return true -} - -// UnmarshalVPNGatewayRouteMode unmarshals an instance of VPNGatewayRouteMode from the specified map of raw messages. -func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayRouteMode) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationByCertificate : VPNServerAuthenticationByCertificate struct -// This model "extends" VPNServerAuthentication -type VPNServerAuthenticationByCertificate struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The certificate instance used for the VPN client certificate authority (CA). - ClientCa *CertificateInstanceReference `json:"client_ca" validate:"required"` - - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` -} - -// Constants associated with the VPNServerAuthenticationByCertificate.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationByCertificateMethodCertificateConst = "certificate" - VPNServerAuthenticationByCertificateMethodUsernameConst = "username" -) - -func (*VPNServerAuthenticationByCertificate) isaVPNServerAuthentication() bool { - return true -} - -// UnmarshalVPNServerAuthenticationByCertificate unmarshals an instance of VPNServerAuthenticationByCertificate from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByCertificate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByCertificate) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationByUsername : VPNServerAuthenticationByUsername struct -// This model "extends" VPNServerAuthentication -type VPNServerAuthenticationByUsername struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` -} - -// Constants associated with the VPNServerAuthenticationByUsername.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationByUsernameMethodCertificateConst = "certificate" - VPNServerAuthenticationByUsernameMethodUsernameConst = "username" -) - -func (*VPNServerAuthenticationByUsername) isaVPNServerAuthentication() bool { - return true -} - -// UnmarshalVPNServerAuthenticationByUsername unmarshals an instance of VPNServerAuthenticationByUsername from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsername(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsername) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationByUsernameIDProviderByIam : VPNServerAuthenticationByUsernameIDProviderByIam struct -// This model "extends" VPNServerAuthenticationByUsernameIDProvider -type VPNServerAuthenticationByUsernameIDProviderByIam struct { - // The type of identity provider to be used by the VPN client. - // - `iam`: IBM identity and access management - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - ProviderType *string `json:"provider_type" validate:"required"` -} - -// Constants associated with the VPNServerAuthenticationByUsernameIDProviderByIam.ProviderType property. -// The type of identity provider to be used by the VPN client. -// - `iam`: IBM identity and access management -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - VPNServerAuthenticationByUsernameIDProviderByIamProviderTypeIamConst = "iam" -) - -// NewVPNServerAuthenticationByUsernameIDProviderByIam : Instantiate VPNServerAuthenticationByUsernameIDProviderByIam (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationByUsernameIDProviderByIam(providerType string) (_model *VPNServerAuthenticationByUsernameIDProviderByIam, err error) { - _model = &VPNServerAuthenticationByUsernameIDProviderByIam{ - ProviderType: core.StringPtr(providerType), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNServerAuthenticationByUsernameIDProviderByIam) isaVPNServerAuthenticationByUsernameIDProvider() bool { - return true -} - -// UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam unmarshals an instance of VPNServerAuthenticationByUsernameIDProviderByIam from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationByUsernameIDProviderByIam(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationByUsernameIDProviderByIam) - err = core.UnmarshalPrimitive(m, "provider_type", &obj.ProviderType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct -// This model "extends" VPNServerAuthenticationPrototype -type VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The certificate instance to use for the VPN client certificate authority (CA). - ClientCa CertificateInstanceIdentityIntf `json:"client_ca" validate:"required"` - - // The certificate revocation list contents, encoded in PEM format. - Crl *string `json:"crl,omitempty"` -} - -// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototypeMethodUsernameConst = "username" -) - -// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(method string, clientCa CertificateInstanceIdentityIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype, err error) { - _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype{ - Method: core.StringPtr(method), - ClientCa: clientCa, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) isaVPNServerAuthenticationPrototype() bool { - return true -} - -// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "client_ca", &obj.ClientCa, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crl", &obj.Crl) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct -// This model "extends" VPNServerAuthenticationPrototype -type VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype struct { - // The type of authentication. - Method *string `json:"method" validate:"required"` - - // The type of identity provider to be used by VPN client. - IdentityProvider VPNServerAuthenticationByUsernameIDProviderIntf `json:"identity_provider" validate:"required"` -} - -// Constants associated with the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Method property. -// The type of authentication. -const ( - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodCertificateConst = "certificate" - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototypeMethodUsernameConst = "username" -) - -// NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype : Instantiate VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(method string, identityProvider VPNServerAuthenticationByUsernameIDProviderIntf) (_model *VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype, err error) { - _model = &VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype{ - Method: core.StringPtr(method), - IdentityProvider: identityProvider, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) isaVPNServerAuthenticationPrototype() bool { - return true -} - -// UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype unmarshals an instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype from the specified map of raw messages. -func UnmarshalVPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype) - err = core.UnmarshalPrimitive(m, "method", &obj.Method) - if err != nil { - return - } - err = core.UnmarshalModel(m, "identity_provider", &obj.IdentityProvider, UnmarshalVPNServerAuthenticationByUsernameIDProvider) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext : Identifies a reserved IP by a unique property. The reserved IP must be currently unbound and in the primary IP's -// subnet. -// Models which "extend" this model: -// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID -// - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref -// This model "extends" VirtualNetworkInterfaceIPPrototype -type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { - return true -} - -type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextIntf interface { - VirtualNetworkInterfaceIPPrototypeIntf - isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext : The prototype for a new reserved IP. Must be in the primary IP's subnet. -// This model "extends" VirtualNetworkInterfaceIPPrototype -type VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext) isaVirtualNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext : Identifies a reserved IP by a unique property. Required if `subnet` is not specified. The reserved IP must be -// currently unbound. -// Models which "extend" this model: -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID -// - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool { - return true -} - -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextIntf interface { - VirtualNetworkInterfacePrimaryIPPrototypeIntf - isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext : The prototype for a new reserved IP. Requires `subnet` to be specified. -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototype -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext struct { - // The IP address to reserve, which must not already be reserved on the subnet. - // - // If unspecified, an available address on the subnet will automatically be selected. - Address *string `json:"address,omitempty"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The name for this reserved IP. The name must not be used by another reserved IP in the subnet. Names starting with - // `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated - // list of randomly-selected words. - Name *string `json:"name,omitempty"` -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext : VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct -// This model "extends" VirtualNetworkInterfaceTarget -type VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct { - // The URL for this bare metal server network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this bare metal server network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this bare metal server network attachment. The name is unique across all network attachments for the - // bare metal server. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContextResourceTypeBareMetalServerNetworkAttachmentConst = "bare_metal_server_network_attachment" -) - -func (*VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext) isaVirtualNetworkInterfaceTarget() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext unmarshals an instance of VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext : VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct -// This model "extends" VirtualNetworkInterfaceTarget -type VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext struct { - // The URL for this instance network attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance network attachment. - ID *string `json:"id" validate:"required"` - - // The name for this instance network attachment. The name is unique across all network attachments for the instance. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContextResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" -) - -func (*VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext) isaVirtualNetworkInterfaceTarget() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext unmarshals an instance of VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceTargetShareMountTargetReference : VirtualNetworkInterfaceTargetShareMountTargetReference struct -// This model "extends" VirtualNetworkInterfaceTarget -type VirtualNetworkInterfaceTargetShareMountTargetReference struct { - // If present, this property indicates the referenced resource has been deleted, and provides - // some supplementary information. - Deleted *ShareMountTargetReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this share mount target. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this share mount target. - ID *string `json:"id" validate:"required"` - - // The name for this share mount target. The name is unique across all mount targets for the file share. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` -} - -// Constants associated with the VirtualNetworkInterfaceTargetShareMountTargetReference.ResourceType property. -// The resource type. -const ( - VirtualNetworkInterfaceTargetShareMountTargetReferenceResourceTypeShareMountTargetConst = "share_mount_target" -) - -func (*VirtualNetworkInterfaceTargetShareMountTargetReference) isaVirtualNetworkInterfaceTarget() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference unmarshals an instance of VirtualNetworkInterfaceTargetShareMountTargetReference from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceTargetShareMountTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceTargetShareMountTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalShareMountTargetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumeIdentity : Identifies a volume by a unique property. -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN -// - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref -// This model "extends" VolumeAttachmentPrototypeVolume -type VolumeAttachmentPrototypeVolumeVolumeIdentity struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { - return true -} - -type VolumeAttachmentPrototypeVolumeVolumeIdentityIntf interface { - VolumeAttachmentPrototypeVolumeIntf - isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentity) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentity from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext : VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot -// This model "extends" VolumeAttachmentPrototypeVolume -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to - // use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use for this volume. If unspecified, the instance's resource - // group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool { - return true -} - -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextIntf interface { - VolumeAttachmentPrototypeVolumeIntf - isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByCRN : VolumeIdentityByCRN struct -// This model "extends" VolumeIdentity -type VolumeIdentityByCRN struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` -} - -// NewVolumeIdentityByCRN : Instantiate VolumeIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByCRN(crn string) (_model *VolumeIdentityByCRN, err error) { - _model = &VolumeIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByCRN) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByCRN unmarshals an instance of VolumeIdentityByCRN from the specified map of raw messages. -func UnmarshalVolumeIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByHref : VolumeIdentityByHref struct -// This model "extends" VolumeIdentity -type VolumeIdentityByHref struct { - // The URL for this volume. - Href *string `json:"href" validate:"required"` -} - -// NewVolumeIdentityByHref : Instantiate VolumeIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByHref(href string) (_model *VolumeIdentityByHref, err error) { - _model = &VolumeIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByHref) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByHref unmarshals an instance of VolumeIdentityByHref from the specified map of raw messages. -func UnmarshalVolumeIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeIdentityByID : VolumeIdentityByID struct -// This model "extends" VolumeIdentity -type VolumeIdentityByID struct { - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` -} - -// NewVolumeIdentityByID : Instantiate VolumeIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVolumeIdentityByID(id string) (_model *VolumeIdentityByID, err error) { - _model = &VolumeIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeIdentityByID) isaVolumeIdentity() bool { - return true -} - -// UnmarshalVolumeIdentityByID unmarshals an instance of VolumeIdentityByID from the specified map of raw messages. -func UnmarshalVolumeIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileIdentityByHref : VolumeProfileIdentityByHref struct -// This model "extends" VolumeProfileIdentity -type VolumeProfileIdentityByHref struct { - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` -} - -// NewVolumeProfileIdentityByHref : Instantiate VolumeProfileIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVolumeProfileIdentityByHref(href string) (_model *VolumeProfileIdentityByHref, err error) { - _model = &VolumeProfileIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeProfileIdentityByHref) isaVolumeProfileIdentity() bool { - return true -} - -// UnmarshalVolumeProfileIdentityByHref unmarshals an instance of VolumeProfileIdentityByHref from the specified map of raw messages. -func UnmarshalVolumeProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeProfileIdentityByName : VolumeProfileIdentityByName struct -// This model "extends" VolumeProfileIdentity -type VolumeProfileIdentityByName struct { - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` -} - -// NewVolumeProfileIdentityByName : Instantiate VolumeProfileIdentityByName (Generic Model Constructor) -func (*VpcV1) NewVolumeProfileIdentityByName(name string) (_model *VolumeProfileIdentityByName, err error) { - _model = &VolumeProfileIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeProfileIdentityByName) isaVolumeProfileIdentity() bool { - return true -} - -// UnmarshalVolumeProfileIdentityByName unmarshals an instance of VolumeProfileIdentityByName from the specified map of raw messages. -func UnmarshalVolumeProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePrototypeVolumeByCapacity : VolumePrototypeVolumeByCapacity struct -// This model "extends" VolumePrototype -type VolumePrototypeVolumeByCapacity struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` -} - -// NewVolumePrototypeVolumeByCapacity : Instantiate VolumePrototypeVolumeByCapacity (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeVolumeByCapacity(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, capacity int64) (_model *VolumePrototypeVolumeByCapacity, err error) { - _model = &VolumePrototypeVolumeByCapacity{ - Profile: profile, - Zone: zone, - Capacity: core.Int64Ptr(capacity), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumePrototypeVolumeByCapacity) isaVolumePrototype() bool { - return true -} - -// UnmarshalVolumePrototypeVolumeByCapacity unmarshals an instance of VolumePrototypeVolumeByCapacity from the specified map of raw messages. -func UnmarshalVolumePrototypeVolumeByCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeVolumeByCapacity) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumePrototypeVolumeBySourceSnapshot : VolumePrototypeVolumeBySourceSnapshot struct -// This model "extends" VolumePrototype -type VolumePrototypeVolumeBySourceSnapshot struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` -} - -// NewVolumePrototypeVolumeBySourceSnapshot : Instantiate VolumePrototypeVolumeBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeVolumeBySourceSnapshot(profile VolumeProfileIdentityIntf, zone ZoneIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeVolumeBySourceSnapshot, err error) { - _model = &VolumePrototypeVolumeBySourceSnapshot{ - Profile: profile, - Zone: zone, - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumePrototypeVolumeBySourceSnapshot) isaVolumePrototype() bool { - return true -} - -// UnmarshalVolumePrototypeVolumeBySourceSnapshot unmarshals an instance of VolumePrototypeVolumeBySourceSnapshot from the specified map of raw messages. -func UnmarshalVolumePrototypeVolumeBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeVolumeBySourceSnapshot) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentityByHref : ZoneIdentityByHref struct -// This model "extends" ZoneIdentity -type ZoneIdentityByHref struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` -} - -// NewZoneIdentityByHref : Instantiate ZoneIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewZoneIdentityByHref(href string) (_model *ZoneIdentityByHref, err error) { - _model = &ZoneIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ZoneIdentityByHref) isaZoneIdentity() bool { - return true -} - -// UnmarshalZoneIdentityByHref unmarshals an instance of ZoneIdentityByHref from the specified map of raw messages. -func UnmarshalZoneIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneIdentityByName : ZoneIdentityByName struct -// This model "extends" ZoneIdentity -type ZoneIdentityByName struct { - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` -} - -// NewZoneIdentityByName : Instantiate ZoneIdentityByName (Generic Model Constructor) -func (*VpcV1) NewZoneIdentityByName(name string) (_model *ZoneIdentityByName, err error) { - _model = &ZoneIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ZoneIdentityByName) isaZoneIdentity() bool { - return true -} - -// UnmarshalZoneIdentityByName unmarshals an instance of ZoneIdentityByName from the specified map of raw messages. -func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct -// This model "extends" BackupPolicyScopePrototypeEnterpriseIdentity -type BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN struct { - // The CRN for this enterprise. - CRN *string `json:"crn" validate:"required"` -} - -// NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN : Instantiate BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(crn string) (_model *BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN, err error) { - _model = &BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototypeEnterpriseIdentity() bool { - return true -} - -func (*BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) isaBackupPolicyScopePrototype() bool { - return true -} - -// UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN unmarshals an instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN from the specified map of raw messages. -func UnmarshalBackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalBareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPIdentityByHref : EndpointGatewayReservedIPReservedIPIdentityByHref struct -// This model "extends" EndpointGatewayReservedIPReservedIPIdentity -type EndpointGatewayReservedIPReservedIPIdentityByHref struct { - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` -} - -// NewEndpointGatewayReservedIPReservedIPIdentityByHref : Instantiate EndpointGatewayReservedIPReservedIPIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByHref(href string) (_model *EndpointGatewayReservedIPReservedIPIdentityByHref, err error) { - _model = &EndpointGatewayReservedIPReservedIPIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} - -func (*EndpointGatewayReservedIPReservedIPIdentityByHref) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByHref from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayReservedIPReservedIPIdentityByID : EndpointGatewayReservedIPReservedIPIdentityByID struct -// This model "extends" EndpointGatewayReservedIPReservedIPIdentity -type EndpointGatewayReservedIPReservedIPIdentityByID struct { - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` -} - -// NewEndpointGatewayReservedIPReservedIPIdentityByID : Instantiate EndpointGatewayReservedIPReservedIPIdentityByID (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayReservedIPReservedIPIdentityByID(id string) (_model *EndpointGatewayReservedIPReservedIPIdentityByID, err error) { - _model = &EndpointGatewayReservedIPReservedIPIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIPReservedIPIdentity() bool { - return true -} - -func (*EndpointGatewayReservedIPReservedIPIdentityByID) isaEndpointGatewayReservedIP() bool { - return true -} - -// UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID unmarshals an instance of EndpointGatewayReservedIPReservedIPIdentityByID from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIPReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIPReservedIPIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct -// This model "extends" EndpointGatewayTargetPrototypeProviderCloudServiceIdentity -type EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRNResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -// NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN : Instantiate EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(resourceType string, crn string) (_model *EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN, err error) { - _model = &EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN{ - ResourceType: core.StringPtr(resourceType), - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototypeProviderCloudServiceIdentity() bool { - return true -} - -func (*EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) isaEndpointGatewayTargetPrototype() bool { - return true -} - -// UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN unmarshals an instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : The name of this provider infrastructure service. -// This model "extends" EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity -type EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` - - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name" validate:"required"` -} - -// Constants associated with the EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByNameResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) - -// NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName : Instantiate EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName (Generic Model Constructor) -func (*VpcV1) NewEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(resourceType string, name string) (_model *EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName, err error) { - _model = &EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName{ - ResourceType: core.StringPtr(resourceType), - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity() bool { - return true -} - -func (*EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) isaEndpointGatewayTargetPrototype() bool { - return true -} - -// UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName unmarshals an instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName) - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity -type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPatchNetworkInterfaceIdentity -type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity -type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity -type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPatchVirtualNetworkInterfaceIdentity -type FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPatchVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPatch() bool { - return true -} - -// UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref struct { - // The URL for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity -type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID struct { - // The unique identifier for this bare metal server network interface. - // - // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity -type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPrototypeNetworkInterfaceIdentity -type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity -type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity -type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity -type FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFloatingIPTargetPrototype() bool { - return true -} - -// UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref struct { - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceIdentity -type FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref : FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity -type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref struct { - // The URL for this instance network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID : FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity -type FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID struct { - // The unique identifier for this instance network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID : Instantiate FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) isaFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref struct { - // The URL for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID struct { - // The unique identifier for this instance network interface. - // - // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototypeNetworkInterfaceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref struct { - // The URL for this subnet. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeSubnetIdentity -type FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID struct { - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID : Instantiate FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototypeSubnetIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref struct { - // The URL for this VPC. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID struct { - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID : Instantiate FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototypeVPCIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity -type FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -// UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionScheduledActionGroupTarget : InstanceGroupManagerActionScheduledActionGroupTarget struct -// This model "extends" InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerActionScheduledActionGroupTarget struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` - - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` - - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroup `json:"group" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionGroupTargetStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionGroupTargetStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionGroupTargetStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionGroupTargetStatusOmittedConst = "omitted" -) - -// Constants associated with the InstanceGroupManagerActionScheduledActionGroupTarget.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionGroupTargetActionTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerActionScheduledAction() bool { - return true -} - -func (*InstanceGroupManagerActionScheduledActionGroupTarget) isaInstanceGroupManagerAction() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionGroupTarget from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledActionGroupTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledActionGroupTarget) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionScheduledActionManagerTarget : InstanceGroupManagerActionScheduledActionManagerTarget struct -// This model "extends" InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerActionScheduledActionManagerTarget struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` - - // The name for this instance group manager action. The name is unique across all actions for the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` - - // The date and time that the instance group manager action was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of action for the instance group. - ActionType *string `json:"action_type" validate:"required"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` - - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager" validate:"required"` -} - -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) - -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetStatusActiveConst = "active" - InstanceGroupManagerActionScheduledActionManagerTargetStatusCompletedConst = "completed" - InstanceGroupManagerActionScheduledActionManagerTargetStatusFailedConst = "failed" - InstanceGroupManagerActionScheduledActionManagerTargetStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionScheduledActionManagerTargetStatusOmittedConst = "omitted" -) - -// Constants associated with the InstanceGroupManagerActionScheduledActionManagerTarget.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionScheduledActionManagerTargetActionTypeScheduledConst = "scheduled" -) - -func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerActionScheduledAction() bool { - return true -} - -func (*InstanceGroupManagerActionScheduledActionManagerTarget) isaInstanceGroupManagerAction() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget unmarshals an instance of InstanceGroupManagerActionScheduledActionManagerTarget from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionScheduledActionManagerTarget) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(href string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref, err error) { - _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { - return true -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct -// This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct { - // The desired maximum number of instance group members at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The desired minimum number of instance group members at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` -} - -// NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : Instantiate InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(id string) (_model *InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID, err error) { - _model = &InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype() bool { - return true -} - -func (*InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity -type InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaInstanceNetworkAttachmentPrototypeVirtualNetworkInterface() bool { - return true -} - -// UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalInstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity -type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct -// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity -type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct { - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID, err error) { - _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatch() bool { - return true -} - -// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypeDedicatedHostIdentity -type InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID struct { - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototypeDedicatedHostIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN struct { - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref struct { - // The URL for this placement group. - Href *string `json:"href" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(href string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct -// This model "extends" InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID struct { - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` -} - -// NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID : Instantiate InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(id string) (_model *InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID, err error) { - _model = &InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototypePlacementGroupIdentity() bool { - return true -} - -func (*InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) isaInstancePlacementTargetPrototype() bool { - return true -} - -// UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID unmarshals an instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct -// This model "extends" InstancePrototypeInstanceByCatalogOffering -type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { - _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment{ - CatalogOffering: catalogOffering, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) isaInstancePrototypeInstanceByCatalogOffering() bool { - return true -} - -func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct -// This model "extends" InstancePrototypeInstanceByCatalogOffering -type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface, err error) { - _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface{ - CatalogOffering: catalogOffering, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) isaInstancePrototypeInstanceByCatalogOffering() bool { - return true -} - -func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct -// This model "extends" InstancePrototypeInstanceByImage -type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { - _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment{ - Image: image, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) isaInstancePrototypeInstanceByImage() bool { - return true -} - -func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct -// This model "extends" InstancePrototypeInstanceByImage -type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface, err error) { - _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface{ - Image: image, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) isaInstancePrototypeInstanceByImage() bool { - return true -} - -func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct -// This model "extends" InstancePrototypeInstanceBySourceSnapshot -type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { - _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) isaInstancePrototypeInstanceBySourceSnapshot() bool { - return true -} - -func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct -// This model "extends" InstancePrototypeInstanceBySourceSnapshot -type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface, err error) { - _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) isaInstancePrototypeInstanceBySourceSnapshot() bool { - return true -} - -func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct -// This model "extends" InstancePrototypeInstanceByVolume -type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { - _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) isaInstancePrototypeInstanceByVolume() bool { - return true -} - -func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct -// This model "extends" InstancePrototypeInstanceByVolume -type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this virtual server instance. The name must not be used by another virtual server instance in the - // region. If unspecified, the name will be a hyphenated list of randomly-selected words. - // - // The system hostname will be based on this name. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface, err error) { - _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) isaInstancePrototypeInstanceByVolume() bool { - return true -} - -func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) isaInstancePrototype() bool { - return true -} - -// UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering -type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment{ - CatalogOffering: catalogOffering, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering -type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface{ - CatalogOffering: catalogOffering, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage -type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment{ - Image: image, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage -type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface{ - Image: image, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkAttachment: primaryNetworkAttachment, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct -// This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot -type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name must not be used by another instance template in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface, err error) { - _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface{ - BootVolumeAttachment: bootVolumeAttachment, - Zone: zone, - PrimaryNetworkInterface: primaryNetworkInterface, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { - return true -} - -func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext -type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct -// This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext -type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext -type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct -// This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext -type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct -// This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext -type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment" validate:"required"` -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct -// This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext -type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, the keys of type `rsa` must be specified, and one will be selected to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The name for this instance template. The name is unique across all instance templates in the region. - Name *string `json:"name" validate:"required"` - - // The placement restrictions to use for the virtual server instance. - // - // If specified, `reservation_affinity.policy` must be `disabled`. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. - // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // [User data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when setting up the virtual server - // instance. - UserData *string `json:"user_data,omitempty"` - - // The additional volume attachments to create for the virtual server instance. - VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` - - // The VPC this virtual server instance will reside in. - // - // If specified, it must match the VPC for the subnets of the instance network attachments or instance network - // interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment to create for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - - // The additional network attachments to create for the virtual server instance. - NetworkAttachments []InstanceNetworkAttachmentPrototype `json:"network_attachments,omitempty"` - - // The primary network attachment to create for the virtual server instance. - PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { - return true -} - -func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref : LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref struct -// This model "extends" LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref struct { - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref : Instantiate LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(href string) (_model *LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref, err error) { - _model = &LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool { - return true -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID : LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID struct -// This model "extends" LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity -type LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID : Instantiate LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(id string) (_model *LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID, err error) { - _model = &LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) isaLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity() bool { - return true -} - -func (*LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) isaLoadBalancerListenerPolicyTargetPatch() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID unmarshals an instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref struct { - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(href string) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool { - return true -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID : LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID struct -// This model "extends" LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity -type LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID : Instantiate LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(id string) (_model *LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID, err error) { - _model = &LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) isaLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity() bool { - return true -} - -func (*LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID unmarshals an instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN : LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct -// This model "extends" LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` -} - -// NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN : Instantiate LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(crn string) (_model *LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN, err error) { - _model = &LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref : LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref struct -// This model "extends" LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref struct { - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` -} - -// NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref : Instantiate LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(href string) (_model *LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref, err error) { - _model = &LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID : LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID struct -// This model "extends" LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -type LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` -} - -// NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID : Instantiate LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID(id string) (_model *LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID, err error) { - _model = &LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID) isaLoadBalancerPoolMemberTargetPrototypeInstanceIdentity() bool { - return true -} - -func (*LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID) isaLoadBalancerPoolMemberTargetPrototype() bool { - return true -} - -// UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceIPPrototypeReservedIPIdentityByHref : NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct -// This model "extends" NetworkInterfaceIPPrototypeReservedIPIdentity -type NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct { - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` -} - -// NewNetworkInterfaceIPPrototypeReservedIPIdentityByHref : Instantiate NetworkInterfaceIPPrototypeReservedIPIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewNetworkInterfaceIPPrototypeReservedIPIdentityByHref(href string) (_model *NetworkInterfaceIPPrototypeReservedIPIdentityByHref, err error) { - _model = &NetworkInterfaceIPPrototypeReservedIPIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentityByHref) isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool { - return true -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentityByHref) isaNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByHref unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPIdentityByHref from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkInterfaceIPPrototypeReservedIPIdentityByID : NetworkInterfaceIPPrototypeReservedIPIdentityByID struct -// This model "extends" NetworkInterfaceIPPrototypeReservedIPIdentity -type NetworkInterfaceIPPrototypeReservedIPIdentityByID struct { - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` -} - -// NewNetworkInterfaceIPPrototypeReservedIPIdentityByID : Instantiate NetworkInterfaceIPPrototypeReservedIPIdentityByID (Generic Model Constructor) -func (*VpcV1) NewNetworkInterfaceIPPrototypeReservedIPIdentityByID(id string) (_model *NetworkInterfaceIPPrototypeReservedIPIdentityByID, err error) { - _model = &NetworkInterfaceIPPrototypeReservedIPIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentityByID) isaNetworkInterfaceIPPrototypeReservedIPIdentity() bool { - return true -} - -func (*NetworkInterfaceIPPrototypeReservedIPIdentityByID) isaNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByID unmarshals an instance of NetworkInterfaceIPPrototypeReservedIPIdentityByID from the specified map of raw messages. -func UnmarshalNetworkInterfaceIPPrototypeReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceIPPrototypeReservedIPIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress : PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress struct -// This model "extends" PublicGatewayFloatingIPPrototypeFloatingIPIdentity -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` -} - -// NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress : Instantiate PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(address string) (_model *PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress, err error) { - _model = &PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN : PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN struct -// This model "extends" PublicGatewayFloatingIPPrototypeFloatingIPIdentity -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN struct { - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` -} - -// NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN : Instantiate PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(crn string) (_model *PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN, err error) { - _model = &PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref : PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref struct -// This model "extends" PublicGatewayFloatingIPPrototypeFloatingIPIdentity -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref struct { - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` -} - -// NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref : Instantiate PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(href string) (_model *PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref, err error) { - _model = &PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID : PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID struct -// This model "extends" PublicGatewayFloatingIPPrototypeFloatingIPIdentity -type PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID struct { - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` -} - -// NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID : Instantiate PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID (Generic Model Constructor) -func (*VpcV1) NewPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID(id string) (_model *PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID, err error) { - _model = &PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID) isaPublicGatewayFloatingIPPrototypeFloatingIPIdentity() bool { - return true -} - -func (*PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID) isaPublicGatewayFloatingIPPrototype() bool { - return true -} - -// UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID unmarshals an instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN : ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN struct -// This model "extends" ReservedIPTargetPrototypeEndpointGatewayIdentity -type ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` -} - -// NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN : Instantiate ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(crn string) (_model *ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN, err error) { - _model = &ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref : ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref struct -// This model "extends" ReservedIPTargetPrototypeEndpointGatewayIdentity -type ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref struct { - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` -} - -// NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref : Instantiate ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(href string) (_model *ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref, err error) { - _model = &ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID : ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID struct -// This model "extends" ReservedIPTargetPrototypeEndpointGatewayIdentity -type ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` -} - -// NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID : Instantiate ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID(id string) (_model *ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID, err error) { - _model = &ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID) isaReservedIPTargetPrototypeEndpointGatewayIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID unmarshals an instance of ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity -type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity -type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity -type ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaReservedIPTargetPrototype() bool { - return true -} - -// UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP : RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP struct -// This model "extends" RouteNextHopPatchRouteNextHopIP -type RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP : Instantiate RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP (Generic Model Constructor) -func (*VpcV1) NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP(address string) (_model *RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP, err error) { - _model = &RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP) isaRouteNextHopPatchRouteNextHopIP() bool { - return true -} - -func (*RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP unmarshals an instance of RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP from the specified map of raw messages. -func UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP : RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP struct -// This model "extends" RouteNextHopPatchRouteNextHopIP -type RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP struct { - // A unicast IP address, which must not be any of the following values: - // - // - `0.0.0.0` (the sentinel IP address) - // - `224.0.0.0` to `239.255.255.255` (multicast IP addresses) - // - `255.255.255.255` (the broadcast IP address) - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP : Instantiate RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP (Generic Model Constructor) -func (*VpcV1) NewRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP(address string) (_model *RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP, err error) { - _model = &RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP) isaRouteNextHopPatchRouteNextHopIP() bool { - return true -} - -func (*RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP unmarshals an instance of RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP from the specified map of raw messages. -func UnmarshalRouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref : RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref struct -// This model "extends" RouteNextHopPatchVPNGatewayConnectionIdentity -type RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref struct { - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref : Instantiate RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(href string) (_model *RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref, err error) { - _model = &RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool { - return true -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref unmarshals an instance of RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref from the specified map of raw messages. -func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID : RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID struct -// This model "extends" RouteNextHopPatchVPNGatewayConnectionIdentity -type RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` -} - -// NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID : Instantiate RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID (Generic Model Constructor) -func (*VpcV1) NewRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(id string) (_model *RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID, err error) { - _model = &RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) isaRouteNextHopPatchVPNGatewayConnectionIdentity() bool { - return true -} - -func (*RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) isaRouteNextHopPatch() bool { - return true -} - -// UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID unmarshals an instance of RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID from the specified map of raw messages. -func UnmarshalRouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP : RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP struct -// This model "extends" RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP struct { - // The sentinel IP address (`0.0.0.0`). - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP : Instantiate RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP (Generic Model Constructor) -func (*VpcV1) NewRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP(address string) (_model *RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP, err error) { - _model = &RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP) isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool { - return true -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP : RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP struct -// This model "extends" RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP -type RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP struct { - // A unicast IP address, which must not be any of the following values: - // - // - `0.0.0.0` (the sentinel IP address) - // - `224.0.0.0` to `239.255.255.255` (multicast IP addresses) - // - `255.255.255.255` (the broadcast IP address) - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` -} - -// NewRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP : Instantiate RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP (Generic Model Constructor) -func (*VpcV1) NewRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP(address string) (_model *RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP, err error) { - _model = &RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP{ - Address: core.StringPtr(address), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP) isaRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP() bool { - return true -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref : RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref struct -// This model "extends" RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref struct { - // The VPN connection's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref : Instantiate RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(href string) (_model *RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref, err error) { - _model = &RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool { - return true -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID : RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID struct -// This model "extends" RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity -type RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID struct { - // The unique identifier for this VPN gateway connection. - ID *string `json:"id" validate:"required"` -} - -// NewRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID : Instantiate RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID (Generic Model Constructor) -func (*VpcV1) NewRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(id string) (_model *RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID, err error) { - _model = &RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) isaRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity() bool { - return true -} - -func (*RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) isaRoutePrototypeNextHop() bool { - return true -} - -// UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID unmarshals an instance of RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID from the specified map of raw messages. -func UnmarshalRoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN : SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN struct -// This model "extends" SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` -} - -// NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN : Instantiate SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(crn string) (_model *SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN, err error) { - _model = &SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref : SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref struct -// This model "extends" SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref struct { - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref : Instantiate SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(href string) (_model *SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref, err error) { - _model = &SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID : SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID struct -// This model "extends" SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID struct { - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` -} - -// NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID : Instantiate SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID(id string) (_model *SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID, err error) { - _model = &SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID) isaSecurityGroupRuleRemotePatchSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID) isaSecurityGroupRuleRemotePatch() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN : SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN struct -// This model "extends" SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN struct { - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` -} - -// NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN : Instantiate SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(crn string) (_model *SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN, err error) { - _model = &SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref : SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref struct -// This model "extends" SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref struct { - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` -} - -// NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref : Instantiate SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(href string) (_model *SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref, err error) { - _model = &SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID : SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID struct -// This model "extends" SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID struct { - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` -} - -// NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID : Instantiate SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID(id string) (_model *SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID, err error) { - _model = &SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN struct { - // The CRN for this virtual network interface. - CRN *string `json:"crn" validate:"required"` -} - -// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(crn string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN, err error) { - _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref struct { - // The URL for this virtual network interface. - Href *string `json:"href" validate:"required"` -} - -// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(href string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref, err error) { - _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct -// This model "extends" ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity -type ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID struct { - // The unique identifier for this virtual network interface. - ID *string `json:"id" validate:"required"` -} - -// NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID : Instantiate ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(id string) (_model *ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID, err error) { - _model = &ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity() bool { - return true -} - -func (*ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) isaShareMountTargetVirtualNetworkInterfacePrototype() bool { - return true -} - -// UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID unmarshals an instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID from the specified map of raw messages. -func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref : VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref struct -// This model "extends" VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext -type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref struct { - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` -} - -// NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref : Instantiate VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref (Generic Model Constructor) -func (*VpcV1) NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(href string) (_model *VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref, err error) { - _model = &VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { - return true -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) isaVirtualNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID : VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID struct -// This model "extends" VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext -type VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID struct { - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` -} - -// NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID : Instantiate VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID (Generic Model Constructor) -func (*VpcV1) NewVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(id string) (_model *VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID, err error) { - _model = &VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) isaVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() bool { - return true -} - -func (*VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) isaVirtualNetworkInterfaceIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID unmarshals an instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref : VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref struct -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref struct { - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` -} - -// NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref : Instantiate VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref (Generic Model Constructor) -func (*VpcV1) NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(href string) (_model *VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref, err error) { - _model = &VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref) isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool { - return true -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID : VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID struct -// This model "extends" VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext -type VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID struct { - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` -} - -// NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID : Instantiate VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID (Generic Model Constructor) -func (*VpcV1) NewVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID(id string) (_model *VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID, err error) { - _model = &VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID) isaVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext() bool { - return true -} - -func (*VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID) isaVirtualNetworkInterfacePrimaryIPPrototype() bool { - return true -} - -// UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID unmarshals an instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID from the specified map of raw messages. -func UnmarshalVirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN : VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN struct -// This model "extends" VolumeAttachmentPrototypeVolumeVolumeIdentity -type VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` -} - -// NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN : Instantiate VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(crn string) (_model *VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN, err error) { - _model = &VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN{ - CRN: core.StringPtr(crn), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { - return true -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref : VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref struct -// This model "extends" VolumeAttachmentPrototypeVolumeVolumeIdentity -type VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref struct { - // The URL for this volume. - Href *string `json:"href" validate:"required"` -} - -// NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref : Instantiate VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(href string) (_model *VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref, err error) { - _model = &VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { - return true -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID : VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID struct -// This model "extends" VolumeAttachmentPrototypeVolumeVolumeIdentity -type VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID struct { - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` -} - -// NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID : Instantiate VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID(id string) (_model *VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID, err error) { - _model = &VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID) isaVolumeAttachmentPrototypeVolumeVolumeIdentity() bool { - return true -} - -func (*VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity : VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity struct -// This model "extends" VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use for this volume. If unspecified, the instance's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` -} - -// NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity : Instantiate VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(profile VolumeProfileIdentityIntf, capacity int64) (_model *VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity, err error) { - _model = &VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity{ - Profile: profile, - Capacity: core.Int64Ptr(capacity), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity) isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool { - return true -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot : VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot struct -// This model "extends" VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext -type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot struct { - // The maximum I/O operations per second (IOPS) to use for this volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The name for this volume. The name must not be used by another volume in the region. If unspecified, the name will - // be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The resource group to use for this volume. If unspecified, the instance's resource group will be used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - UserTags []string `json:"user_tags,omitempty"` - - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` -} - -// NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot : Instantiate VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot, err error) { - _model = &VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot{ - Profile: profile, - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot) isaVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext() bool { - return true -} - -func (*VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot) isaVolumeAttachmentPrototypeVolume() bool { - return true -} - -// UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot unmarshals an instance of VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPCAddressPrefixesPager can be used to simplify the use of the "ListVPCAddressPrefixes" method. -type VPCAddressPrefixesPager struct { - hasNext bool - options *ListVPCAddressPrefixesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPCAddressPrefixesPager returns a new VPCAddressPrefixesPager instance. -func (vpc *VpcV1) NewVPCAddressPrefixesPager(options *ListVPCAddressPrefixesOptions) (pager *VPCAddressPrefixesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPCAddressPrefixesOptions = *options - pager = &VPCAddressPrefixesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCAddressPrefixesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCAddressPrefixesPager) GetNextWithContext(ctx context.Context) (page []AddressPrefix, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPCAddressPrefixesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.AddressPrefixes - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPCAddressPrefixesPager) GetAllWithContext(ctx context.Context) (allItems []AddressPrefix, err error) { - for pager.HasNext() { - var nextPage []AddressPrefix - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCAddressPrefixesPager) GetNext() (page []AddressPrefix, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCAddressPrefixesPager) GetAll() (allItems []AddressPrefix, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPCDnsResolutionBindingsPager can be used to simplify the use of the "ListVPCDnsResolutionBindings" method. -type VPCDnsResolutionBindingsPager struct { - hasNext bool - options *ListVPCDnsResolutionBindingsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPCDnsResolutionBindingsPager returns a new VPCDnsResolutionBindingsPager instance. -func (vpc *VpcV1) NewVPCDnsResolutionBindingsPager(options *ListVPCDnsResolutionBindingsOptions) (pager *VPCDnsResolutionBindingsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPCDnsResolutionBindingsOptions = *options - pager = &VPCDnsResolutionBindingsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCDnsResolutionBindingsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCDnsResolutionBindingsPager) GetNextWithContext(ctx context.Context) (page []VpcdnsResolutionBinding, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPCDnsResolutionBindingsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.DnsResolutionBindings - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPCDnsResolutionBindingsPager) GetAllWithContext(ctx context.Context) (allItems []VpcdnsResolutionBinding, err error) { - for pager.HasNext() { - var nextPage []VpcdnsResolutionBinding - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCDnsResolutionBindingsPager) GetNext() (page []VpcdnsResolutionBinding, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCDnsResolutionBindingsPager) GetAll() (allItems []VpcdnsResolutionBinding, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPCRoutesPager can be used to simplify the use of the "ListVPCRoutes" method. -type VPCRoutesPager struct { - hasNext bool - options *ListVPCRoutesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPCRoutesPager returns a new VPCRoutesPager instance. -func (vpc *VpcV1) NewVPCRoutesPager(options *ListVPCRoutesOptions) (pager *VPCRoutesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPCRoutesOptions = *options - pager = &VPCRoutesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCRoutesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCRoutesPager) GetNextWithContext(ctx context.Context) (page []RouteCollectionVPCContextRoutesItem, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPCRoutesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Routes - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPCRoutesPager) GetAllWithContext(ctx context.Context) (allItems []RouteCollectionVPCContextRoutesItem, err error) { - for pager.HasNext() { - var nextPage []RouteCollectionVPCContextRoutesItem - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutesPager) GetNext() (page []RouteCollectionVPCContextRoutesItem, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutesPager) GetAll() (allItems []RouteCollectionVPCContextRoutesItem, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPCRoutingTableRoutesPager can be used to simplify the use of the "ListVPCRoutingTableRoutes" method. -type VPCRoutingTableRoutesPager struct { - hasNext bool - options *ListVPCRoutingTableRoutesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPCRoutingTableRoutesPager returns a new VPCRoutingTableRoutesPager instance. -func (vpc *VpcV1) NewVPCRoutingTableRoutesPager(options *ListVPCRoutingTableRoutesOptions) (pager *VPCRoutingTableRoutesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPCRoutingTableRoutesOptions = *options - pager = &VPCRoutingTableRoutesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCRoutingTableRoutesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCRoutingTableRoutesPager) GetNextWithContext(ctx context.Context) (page []Route, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPCRoutingTableRoutesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Routes - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPCRoutingTableRoutesPager) GetAllWithContext(ctx context.Context) (allItems []Route, err error) { - for pager.HasNext() { - var nextPage []Route - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTableRoutesPager) GetNext() (page []Route, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTableRoutesPager) GetAll() (allItems []Route, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPCRoutingTablesPager can be used to simplify the use of the "ListVPCRoutingTables" method. -type VPCRoutingTablesPager struct { - hasNext bool - options *ListVPCRoutingTablesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPCRoutingTablesPager returns a new VPCRoutingTablesPager instance. -func (vpc *VpcV1) NewVPCRoutingTablesPager(options *ListVPCRoutingTablesOptions) (pager *VPCRoutingTablesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPCRoutingTablesOptions = *options - pager = &VPCRoutingTablesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPCRoutingTablesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPCRoutingTablesPager) GetNextWithContext(ctx context.Context) (page []RoutingTable, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPCRoutingTablesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.RoutingTables - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPCRoutingTablesPager) GetAllWithContext(ctx context.Context) (allItems []RoutingTable, err error) { - for pager.HasNext() { - var nextPage []RoutingTable - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTablesPager) GetNext() (page []RoutingTable, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPCRoutingTablesPager) GetAll() (allItems []RoutingTable, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VpcsPager can be used to simplify the use of the "ListVpcs" method. -type VpcsPager struct { - hasNext bool - options *ListVpcsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVpcsPager returns a new VpcsPager instance. -func (vpc *VpcV1) NewVpcsPager(options *ListVpcsOptions) (pager *VpcsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVpcsOptions = *options - pager = &VpcsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VpcsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VpcsPager) GetNextWithContext(ctx context.Context) (page []VPC, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVpcsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Vpcs - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VpcsPager) GetAllWithContext(ctx context.Context) (allItems []VPC, err error) { - for pager.HasNext() { - var nextPage []VPC - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VpcsPager) GetNext() (page []VPC, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VpcsPager) GetAll() (allItems []VPC, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SubnetReservedIpsPager can be used to simplify the use of the "ListSubnetReservedIps" method. -type SubnetReservedIpsPager struct { - hasNext bool - options *ListSubnetReservedIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSubnetReservedIpsPager returns a new SubnetReservedIpsPager instance. -func (vpc *VpcV1) NewSubnetReservedIpsPager(options *ListSubnetReservedIpsOptions) (pager *SubnetReservedIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSubnetReservedIpsOptions = *options - pager = &SubnetReservedIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SubnetReservedIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SubnetReservedIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSubnetReservedIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.ReservedIps - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SubnetReservedIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { - for pager.HasNext() { - var nextPage []ReservedIP - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SubnetReservedIpsPager) GetNext() (page []ReservedIP, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SubnetReservedIpsPager) GetAll() (allItems []ReservedIP, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SubnetsPager can be used to simplify the use of the "ListSubnets" method. -type SubnetsPager struct { - hasNext bool - options *ListSubnetsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSubnetsPager returns a new SubnetsPager instance. -func (vpc *VpcV1) NewSubnetsPager(options *ListSubnetsOptions) (pager *SubnetsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSubnetsOptions = *options - pager = &SubnetsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SubnetsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SubnetsPager) GetNextWithContext(ctx context.Context) (page []Subnet, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSubnetsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Subnets - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SubnetsPager) GetAllWithContext(ctx context.Context) (allItems []Subnet, err error) { - for pager.HasNext() { - var nextPage []Subnet - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SubnetsPager) GetNext() (page []Subnet, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SubnetsPager) GetAll() (allItems []Subnet, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// ImagesPager can be used to simplify the use of the "ListImages" method. -type ImagesPager struct { - hasNext bool - options *ListImagesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewImagesPager returns a new ImagesPager instance. -func (vpc *VpcV1) NewImagesPager(options *ListImagesOptions) (pager *ImagesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListImagesOptions = *options - pager = &ImagesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *ImagesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *ImagesPager) GetNextWithContext(ctx context.Context) (page []Image, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListImagesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Images - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *ImagesPager) GetAllWithContext(ctx context.Context) (allItems []Image, err error) { - for pager.HasNext() { - var nextPage []Image - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *ImagesPager) GetNext() (page []Image, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *ImagesPager) GetAll() (allItems []Image, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// OperatingSystemsPager can be used to simplify the use of the "ListOperatingSystems" method. -type OperatingSystemsPager struct { - hasNext bool - options *ListOperatingSystemsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewOperatingSystemsPager returns a new OperatingSystemsPager instance. -func (vpc *VpcV1) NewOperatingSystemsPager(options *ListOperatingSystemsOptions) (pager *OperatingSystemsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListOperatingSystemsOptions = *options - pager = &OperatingSystemsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *OperatingSystemsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *OperatingSystemsPager) GetNextWithContext(ctx context.Context) (page []OperatingSystem, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListOperatingSystemsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.OperatingSystems - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *OperatingSystemsPager) GetAllWithContext(ctx context.Context) (allItems []OperatingSystem, err error) { - for pager.HasNext() { - var nextPage []OperatingSystem - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *OperatingSystemsPager) GetNext() (page []OperatingSystem, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *OperatingSystemsPager) GetAll() (allItems []OperatingSystem, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// KeysPager can be used to simplify the use of the "ListKeys" method. -type KeysPager struct { - hasNext bool - options *ListKeysOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewKeysPager returns a new KeysPager instance. -func (vpc *VpcV1) NewKeysPager(options *ListKeysOptions) (pager *KeysPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListKeysOptions = *options - pager = &KeysPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *KeysPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *KeysPager) GetNextWithContext(ctx context.Context) (page []Key, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListKeysWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Keys - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *KeysPager) GetAllWithContext(ctx context.Context) (allItems []Key, err error) { - for pager.HasNext() { - var nextPage []Key - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *KeysPager) GetNext() (page []Key, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *KeysPager) GetAll() (allItems []Key, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "ListInstanceNetworkInterfaceIps" method. -type InstanceNetworkInterfaceIpsPager struct { - hasNext bool - options *ListInstanceNetworkInterfaceIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceNetworkInterfaceIpsPager returns a new InstanceNetworkInterfaceIpsPager instance. -func (vpc *VpcV1) NewInstanceNetworkInterfaceIpsPager(options *ListInstanceNetworkInterfaceIpsOptions) (pager *InstanceNetworkInterfaceIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceNetworkInterfaceIpsOptions = *options - pager = &InstanceNetworkInterfaceIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceNetworkInterfaceIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceNetworkInterfaceIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Ips - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { - for pager.HasNext() { - var nextPage []ReservedIP - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceNetworkInterfaceIpsPager) GetNext() (page []ReservedIP, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceNetworkInterfaceIpsPager) GetAll() (allItems []ReservedIP, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstancesPager can be used to simplify the use of the "ListInstances" method. -type InstancesPager struct { - hasNext bool - options *ListInstancesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstancesPager returns a new InstancesPager instance. -func (vpc *VpcV1) NewInstancesPager(options *ListInstancesOptions) (pager *InstancesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstancesOptions = *options - pager = &InstancesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstancesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstancesPager) GetNextWithContext(ctx context.Context) (page []Instance, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstancesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Instances - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstancesPager) GetAllWithContext(ctx context.Context) (allItems []Instance, err error) { - for pager.HasNext() { - var nextPage []Instance - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstancesPager) GetNext() (page []Instance, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstancesPager) GetAll() (allItems []Instance, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupManagerActionsPager can be used to simplify the use of the "ListInstanceGroupManagerActions" method. -type InstanceGroupManagerActionsPager struct { - hasNext bool - options *ListInstanceGroupManagerActionsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupManagerActionsPager returns a new InstanceGroupManagerActionsPager instance. -func (vpc *VpcV1) NewInstanceGroupManagerActionsPager(options *ListInstanceGroupManagerActionsOptions) (pager *InstanceGroupManagerActionsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupManagerActionsOptions = *options - pager = &InstanceGroupManagerActionsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupManagerActionsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupManagerActionsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerActionIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupManagerActionsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Actions - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupManagerActionsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerActionIntf, err error) { - for pager.HasNext() { - var nextPage []InstanceGroupManagerActionIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerActionsPager) GetNext() (page []InstanceGroupManagerActionIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerActionsPager) GetAll() (allItems []InstanceGroupManagerActionIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupManagerPoliciesPager can be used to simplify the use of the "ListInstanceGroupManagerPolicies" method. -type InstanceGroupManagerPoliciesPager struct { - hasNext bool - options *ListInstanceGroupManagerPoliciesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupManagerPoliciesPager returns a new InstanceGroupManagerPoliciesPager instance. -func (vpc *VpcV1) NewInstanceGroupManagerPoliciesPager(options *ListInstanceGroupManagerPoliciesOptions) (pager *InstanceGroupManagerPoliciesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupManagerPoliciesOptions = *options - pager = &InstanceGroupManagerPoliciesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupManagerPoliciesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupManagerPoliciesPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerPolicyIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupManagerPoliciesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Policies - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupManagerPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerPolicyIntf, err error) { - for pager.HasNext() { - var nextPage []InstanceGroupManagerPolicyIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerPoliciesPager) GetNext() (page []InstanceGroupManagerPolicyIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagerPoliciesPager) GetAll() (allItems []InstanceGroupManagerPolicyIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupManagersPager can be used to simplify the use of the "ListInstanceGroupManagers" method. -type InstanceGroupManagersPager struct { - hasNext bool - options *ListInstanceGroupManagersOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupManagersPager returns a new InstanceGroupManagersPager instance. -func (vpc *VpcV1) NewInstanceGroupManagersPager(options *ListInstanceGroupManagersOptions) (pager *InstanceGroupManagersPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupManagersOptions = *options - pager = &InstanceGroupManagersPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupManagersPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupManagersPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupManagerIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupManagersWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Managers - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupManagersPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupManagerIntf, err error) { - for pager.HasNext() { - var nextPage []InstanceGroupManagerIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagersPager) GetNext() (page []InstanceGroupManagerIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupManagersPager) GetAll() (allItems []InstanceGroupManagerIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupMembershipsPager can be used to simplify the use of the "ListInstanceGroupMemberships" method. -type InstanceGroupMembershipsPager struct { - hasNext bool - options *ListInstanceGroupMembershipsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupMembershipsPager returns a new InstanceGroupMembershipsPager instance. -func (vpc *VpcV1) NewInstanceGroupMembershipsPager(options *ListInstanceGroupMembershipsOptions) (pager *InstanceGroupMembershipsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupMembershipsOptions = *options - pager = &InstanceGroupMembershipsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupMembershipsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupMembershipsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroupMembership, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupMembershipsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Memberships - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupMembershipsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroupMembership, err error) { - for pager.HasNext() { - var nextPage []InstanceGroupMembership - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupMembershipsPager) GetNext() (page []InstanceGroupMembership, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMembership, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// InstanceGroupsPager can be used to simplify the use of the "ListInstanceGroups" method. -type InstanceGroupsPager struct { - hasNext bool - options *ListInstanceGroupsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewInstanceGroupsPager returns a new InstanceGroupsPager instance. -func (vpc *VpcV1) NewInstanceGroupsPager(options *ListInstanceGroupsOptions) (pager *InstanceGroupsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListInstanceGroupsOptions = *options - pager = &InstanceGroupsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *InstanceGroupsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *InstanceGroupsPager) GetNextWithContext(ctx context.Context) (page []InstanceGroup, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListInstanceGroupsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.InstanceGroups - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *InstanceGroupsPager) GetAllWithContext(ctx context.Context) (allItems []InstanceGroup, err error) { - for pager.HasNext() { - var nextPage []InstanceGroup - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupsPager) GetNext() (page []InstanceGroup, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *InstanceGroupsPager) GetAll() (allItems []InstanceGroup, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// ReservationsPager can be used to simplify the use of the "ListReservations" method. -type ReservationsPager struct { - hasNext bool - options *ListReservationsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewReservationsPager returns a new ReservationsPager instance. -func (vpc *VpcV1) NewReservationsPager(options *ListReservationsOptions) (pager *ReservationsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListReservationsOptions = *options - pager = &ReservationsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *ReservationsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *ReservationsPager) GetNextWithContext(ctx context.Context) (page []Reservation, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListReservationsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Reservations - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *ReservationsPager) GetAllWithContext(ctx context.Context) (allItems []Reservation, err error) { - for pager.HasNext() { - var nextPage []Reservation - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *ReservationsPager) GetNext() (page []Reservation, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *ReservationsPager) GetAll() (allItems []Reservation, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// DedicatedHostGroupsPager can be used to simplify the use of the "ListDedicatedHostGroups" method. -type DedicatedHostGroupsPager struct { - hasNext bool - options *ListDedicatedHostGroupsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewDedicatedHostGroupsPager returns a new DedicatedHostGroupsPager instance. -func (vpc *VpcV1) NewDedicatedHostGroupsPager(options *ListDedicatedHostGroupsOptions) (pager *DedicatedHostGroupsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListDedicatedHostGroupsOptions = *options - pager = &DedicatedHostGroupsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *DedicatedHostGroupsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *DedicatedHostGroupsPager) GetNextWithContext(ctx context.Context) (page []DedicatedHostGroup, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListDedicatedHostGroupsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Groups - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *DedicatedHostGroupsPager) GetAllWithContext(ctx context.Context) (allItems []DedicatedHostGroup, err error) { - for pager.HasNext() { - var nextPage []DedicatedHostGroup - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostGroupsPager) GetNext() (page []DedicatedHostGroup, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostGroupsPager) GetAll() (allItems []DedicatedHostGroup, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// DedicatedHostProfilesPager can be used to simplify the use of the "ListDedicatedHostProfiles" method. -type DedicatedHostProfilesPager struct { - hasNext bool - options *ListDedicatedHostProfilesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewDedicatedHostProfilesPager returns a new DedicatedHostProfilesPager instance. -func (vpc *VpcV1) NewDedicatedHostProfilesPager(options *ListDedicatedHostProfilesOptions) (pager *DedicatedHostProfilesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListDedicatedHostProfilesOptions = *options - pager = &DedicatedHostProfilesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *DedicatedHostProfilesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *DedicatedHostProfilesPager) GetNextWithContext(ctx context.Context) (page []DedicatedHostProfile, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListDedicatedHostProfilesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *DedicatedHostProfilesPager) GetAllWithContext(ctx context.Context) (allItems []DedicatedHostProfile, err error) { - for pager.HasNext() { - var nextPage []DedicatedHostProfile - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostProfilesPager) GetNext() (page []DedicatedHostProfile, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostProfilesPager) GetAll() (allItems []DedicatedHostProfile, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// DedicatedHostsPager can be used to simplify the use of the "ListDedicatedHosts" method. -type DedicatedHostsPager struct { - hasNext bool - options *ListDedicatedHostsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewDedicatedHostsPager returns a new DedicatedHostsPager instance. -func (vpc *VpcV1) NewDedicatedHostsPager(options *ListDedicatedHostsOptions) (pager *DedicatedHostsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListDedicatedHostsOptions = *options - pager = &DedicatedHostsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *DedicatedHostsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *DedicatedHostsPager) GetNextWithContext(ctx context.Context) (page []DedicatedHost, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListDedicatedHostsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.DedicatedHosts - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *DedicatedHostsPager) GetAllWithContext(ctx context.Context) (allItems []DedicatedHost, err error) { - for pager.HasNext() { - var nextPage []DedicatedHost - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostsPager) GetNext() (page []DedicatedHost, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *DedicatedHostsPager) GetAll() (allItems []DedicatedHost, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BackupPoliciesPager can be used to simplify the use of the "ListBackupPolicies" method. -type BackupPoliciesPager struct { - hasNext bool - options *ListBackupPoliciesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBackupPoliciesPager returns a new BackupPoliciesPager instance. -func (vpc *VpcV1) NewBackupPoliciesPager(options *ListBackupPoliciesOptions) (pager *BackupPoliciesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBackupPoliciesOptions = *options - pager = &BackupPoliciesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BackupPoliciesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BackupPoliciesPager) GetNextWithContext(ctx context.Context) (page []BackupPolicyIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBackupPoliciesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.BackupPolicies - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BackupPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []BackupPolicyIntf, err error) { - for pager.HasNext() { - var nextPage []BackupPolicyIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BackupPoliciesPager) GetNext() (page []BackupPolicyIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BackupPoliciesPager) GetAll() (allItems []BackupPolicyIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BackupPolicyJobsPager can be used to simplify the use of the "ListBackupPolicyJobs" method. -type BackupPolicyJobsPager struct { - hasNext bool - options *ListBackupPolicyJobsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBackupPolicyJobsPager returns a new BackupPolicyJobsPager instance. -func (vpc *VpcV1) NewBackupPolicyJobsPager(options *ListBackupPolicyJobsOptions) (pager *BackupPolicyJobsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBackupPolicyJobsOptions = *options - pager = &BackupPolicyJobsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BackupPolicyJobsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BackupPolicyJobsPager) GetNextWithContext(ctx context.Context) (page []BackupPolicyJob, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBackupPolicyJobsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Jobs - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BackupPolicyJobsPager) GetAllWithContext(ctx context.Context) (allItems []BackupPolicyJob, err error) { - for pager.HasNext() { - var nextPage []BackupPolicyJob - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BackupPolicyJobsPager) GetNext() (page []BackupPolicyJob, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BackupPolicyJobsPager) GetAll() (allItems []BackupPolicyJob, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// PlacementGroupsPager can be used to simplify the use of the "ListPlacementGroups" method. -type PlacementGroupsPager struct { - hasNext bool - options *ListPlacementGroupsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewPlacementGroupsPager returns a new PlacementGroupsPager instance. -func (vpc *VpcV1) NewPlacementGroupsPager(options *ListPlacementGroupsOptions) (pager *PlacementGroupsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListPlacementGroupsOptions = *options - pager = &PlacementGroupsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *PlacementGroupsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *PlacementGroupsPager) GetNextWithContext(ctx context.Context) (page []PlacementGroup, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListPlacementGroupsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.PlacementGroups - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *PlacementGroupsPager) GetAllWithContext(ctx context.Context) (allItems []PlacementGroup, err error) { - for pager.HasNext() { - var nextPage []PlacementGroup - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *PlacementGroupsPager) GetNext() (page []PlacementGroup, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *PlacementGroupsPager) GetAll() (allItems []PlacementGroup, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BareMetalServerNetworkAttachmentsPager can be used to simplify the use of the "ListBareMetalServerNetworkAttachments" method. -type BareMetalServerNetworkAttachmentsPager struct { - hasNext bool - options *ListBareMetalServerNetworkAttachmentsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBareMetalServerNetworkAttachmentsPager returns a new BareMetalServerNetworkAttachmentsPager instance. -func (vpc *VpcV1) NewBareMetalServerNetworkAttachmentsPager(options *ListBareMetalServerNetworkAttachmentsOptions) (pager *BareMetalServerNetworkAttachmentsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBareMetalServerNetworkAttachmentsOptions = *options - pager = &BareMetalServerNetworkAttachmentsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServerNetworkAttachmentsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServerNetworkAttachmentsPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerNetworkAttachmentIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBareMetalServerNetworkAttachmentsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.NetworkAttachments - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BareMetalServerNetworkAttachmentsPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerNetworkAttachmentIntf, err error) { - for pager.HasNext() { - var nextPage []BareMetalServerNetworkAttachmentIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkAttachmentsPager) GetNext() (page []BareMetalServerNetworkAttachmentIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkAttachmentsPager) GetAll() (allItems []BareMetalServerNetworkAttachmentIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "ListBareMetalServerNetworkInterfaces" method. -type BareMetalServerNetworkInterfacesPager struct { - hasNext bool - options *ListBareMetalServerNetworkInterfacesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBareMetalServerNetworkInterfacesPager returns a new BareMetalServerNetworkInterfacesPager instance. -func (vpc *VpcV1) NewBareMetalServerNetworkInterfacesPager(options *ListBareMetalServerNetworkInterfacesOptions) (pager *BareMetalServerNetworkInterfacesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBareMetalServerNetworkInterfacesOptions = *options - pager = &BareMetalServerNetworkInterfacesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServerNetworkInterfacesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServerNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerNetworkInterfaceIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBareMetalServerNetworkInterfacesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.NetworkInterfaces - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BareMetalServerNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerNetworkInterfaceIntf, err error) { - for pager.HasNext() { - var nextPage []BareMetalServerNetworkInterfaceIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkInterfacesPager) GetNext() (page []BareMetalServerNetworkInterfaceIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerNetworkInterfacesPager) GetAll() (allItems []BareMetalServerNetworkInterfaceIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BareMetalServerProfilesPager can be used to simplify the use of the "ListBareMetalServerProfiles" method. -type BareMetalServerProfilesPager struct { - hasNext bool - options *ListBareMetalServerProfilesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBareMetalServerProfilesPager returns a new BareMetalServerProfilesPager instance. -func (vpc *VpcV1) NewBareMetalServerProfilesPager(options *ListBareMetalServerProfilesOptions) (pager *BareMetalServerProfilesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBareMetalServerProfilesOptions = *options - pager = &BareMetalServerProfilesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServerProfilesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServerProfilesPager) GetNextWithContext(ctx context.Context) (page []BareMetalServerProfile, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBareMetalServerProfilesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BareMetalServerProfilesPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServerProfile, err error) { - for pager.HasNext() { - var nextPage []BareMetalServerProfile - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerProfilesPager) GetNext() (page []BareMetalServerProfile, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServerProfilesPager) GetAll() (allItems []BareMetalServerProfile, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// BareMetalServersPager can be used to simplify the use of the "ListBareMetalServers" method. -type BareMetalServersPager struct { - hasNext bool - options *ListBareMetalServersOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewBareMetalServersPager returns a new BareMetalServersPager instance. -func (vpc *VpcV1) NewBareMetalServersPager(options *ListBareMetalServersOptions) (pager *BareMetalServersPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListBareMetalServersOptions = *options - pager = &BareMetalServersPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *BareMetalServersPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *BareMetalServersPager) GetNextWithContext(ctx context.Context) (page []BareMetalServer, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListBareMetalServersWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.BareMetalServers - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *BareMetalServersPager) GetAllWithContext(ctx context.Context) (allItems []BareMetalServer, err error) { - for pager.HasNext() { - var nextPage []BareMetalServer - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServersPager) GetNext() (page []BareMetalServer, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *BareMetalServersPager) GetAll() (allItems []BareMetalServer, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VolumeProfilesPager can be used to simplify the use of the "ListVolumeProfiles" method. -type VolumeProfilesPager struct { - hasNext bool - options *ListVolumeProfilesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVolumeProfilesPager returns a new VolumeProfilesPager instance. -func (vpc *VpcV1) NewVolumeProfilesPager(options *ListVolumeProfilesOptions) (pager *VolumeProfilesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVolumeProfilesOptions = *options - pager = &VolumeProfilesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VolumeProfilesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VolumeProfilesPager) GetNextWithContext(ctx context.Context) (page []VolumeProfile, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVolumeProfilesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VolumeProfilesPager) GetAllWithContext(ctx context.Context) (allItems []VolumeProfile, err error) { - for pager.HasNext() { - var nextPage []VolumeProfile - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VolumeProfilesPager) GetNext() (page []VolumeProfile, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VolumeProfilesPager) GetAll() (allItems []VolumeProfile, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VolumesPager can be used to simplify the use of the "ListVolumes" method. -type VolumesPager struct { - hasNext bool - options *ListVolumesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVolumesPager returns a new VolumesPager instance. -func (vpc *VpcV1) NewVolumesPager(options *ListVolumesOptions) (pager *VolumesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVolumesOptions = *options - pager = &VolumesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VolumesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VolumesPager) GetNextWithContext(ctx context.Context) (page []Volume, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVolumesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Volumes - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VolumesPager) GetAllWithContext(ctx context.Context) (allItems []Volume, err error) { - for pager.HasNext() { - var nextPage []Volume - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VolumesPager) GetNext() (page []Volume, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VolumesPager) GetAll() (allItems []Volume, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SnapshotConsistencyGroupsPager can be used to simplify the use of the "ListSnapshotConsistencyGroups" method. -type SnapshotConsistencyGroupsPager struct { - hasNext bool - options *ListSnapshotConsistencyGroupsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSnapshotConsistencyGroupsPager returns a new SnapshotConsistencyGroupsPager instance. -func (vpc *VpcV1) NewSnapshotConsistencyGroupsPager(options *ListSnapshotConsistencyGroupsOptions) (pager *SnapshotConsistencyGroupsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSnapshotConsistencyGroupsOptions = *options - pager = &SnapshotConsistencyGroupsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SnapshotConsistencyGroupsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SnapshotConsistencyGroupsPager) GetNextWithContext(ctx context.Context) (page []SnapshotConsistencyGroup, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSnapshotConsistencyGroupsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.SnapshotConsistencyGroups - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SnapshotConsistencyGroupsPager) GetAllWithContext(ctx context.Context) (allItems []SnapshotConsistencyGroup, err error) { - for pager.HasNext() { - var nextPage []SnapshotConsistencyGroup - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SnapshotConsistencyGroupsPager) GetNext() (page []SnapshotConsistencyGroup, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SnapshotConsistencyGroupsPager) GetAll() (allItems []SnapshotConsistencyGroup, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SnapshotsPager can be used to simplify the use of the "ListSnapshots" method. -type SnapshotsPager struct { - hasNext bool - options *ListSnapshotsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSnapshotsPager returns a new SnapshotsPager instance. -func (vpc *VpcV1) NewSnapshotsPager(options *ListSnapshotsOptions) (pager *SnapshotsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSnapshotsOptions = *options - pager = &SnapshotsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SnapshotsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SnapshotsPager) GetNextWithContext(ctx context.Context) (page []Snapshot, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSnapshotsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Snapshots - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SnapshotsPager) GetAllWithContext(ctx context.Context) (allItems []Snapshot, err error) { - for pager.HasNext() { - var nextPage []Snapshot - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SnapshotsPager) GetNext() (page []Snapshot, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SnapshotsPager) GetAll() (allItems []Snapshot, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// ShareMountTargetsPager can be used to simplify the use of the "ListShareMountTargets" method. -type ShareMountTargetsPager struct { - hasNext bool - options *ListShareMountTargetsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewShareMountTargetsPager returns a new ShareMountTargetsPager instance. -func (vpc *VpcV1) NewShareMountTargetsPager(options *ListShareMountTargetsOptions) (pager *ShareMountTargetsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListShareMountTargetsOptions = *options - pager = &ShareMountTargetsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *ShareMountTargetsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *ShareMountTargetsPager) GetNextWithContext(ctx context.Context) (page []ShareMountTarget, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListShareMountTargetsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.MountTargets - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *ShareMountTargetsPager) GetAllWithContext(ctx context.Context) (allItems []ShareMountTarget, err error) { - for pager.HasNext() { - var nextPage []ShareMountTarget - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *ShareMountTargetsPager) GetNext() (page []ShareMountTarget, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *ShareMountTargetsPager) GetAll() (allItems []ShareMountTarget, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// ShareProfilesPager can be used to simplify the use of the "ListShareProfiles" method. -type ShareProfilesPager struct { - hasNext bool - options *ListShareProfilesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewShareProfilesPager returns a new ShareProfilesPager instance. -func (vpc *VpcV1) NewShareProfilesPager(options *ListShareProfilesOptions) (pager *ShareProfilesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListShareProfilesOptions = *options - pager = &ShareProfilesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *ShareProfilesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *ShareProfilesPager) GetNextWithContext(ctx context.Context) (page []ShareProfile, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListShareProfilesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *ShareProfilesPager) GetAllWithContext(ctx context.Context) (allItems []ShareProfile, err error) { - for pager.HasNext() { - var nextPage []ShareProfile - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *ShareProfilesPager) GetNext() (page []ShareProfile, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *ShareProfilesPager) GetAll() (allItems []ShareProfile, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SharesPager can be used to simplify the use of the "ListShares" method. -type SharesPager struct { - hasNext bool - options *ListSharesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSharesPager returns a new SharesPager instance. -func (vpc *VpcV1) NewSharesPager(options *ListSharesOptions) (pager *SharesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSharesOptions = *options - pager = &SharesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SharesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SharesPager) GetNextWithContext(ctx context.Context) (page []Share, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSharesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Shares - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SharesPager) GetAllWithContext(ctx context.Context) (allItems []Share, err error) { - for pager.HasNext() { - var nextPage []Share - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SharesPager) GetNext() (page []Share, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SharesPager) GetAll() (allItems []Share, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// NetworkInterfaceFloatingIpsPager can be used to simplify the use of the "ListNetworkInterfaceFloatingIps" method. -type NetworkInterfaceFloatingIpsPager struct { - hasNext bool - options *ListNetworkInterfaceFloatingIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewNetworkInterfaceFloatingIpsPager returns a new NetworkInterfaceFloatingIpsPager instance. -func (vpc *VpcV1) NewNetworkInterfaceFloatingIpsPager(options *ListNetworkInterfaceFloatingIpsOptions) (pager *NetworkInterfaceFloatingIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListNetworkInterfaceFloatingIpsOptions = *options - pager = &NetworkInterfaceFloatingIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *NetworkInterfaceFloatingIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *NetworkInterfaceFloatingIpsPager) GetNextWithContext(ctx context.Context) (page []FloatingIPReference, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListNetworkInterfaceFloatingIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.FloatingIps - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *NetworkInterfaceFloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems []FloatingIPReference, err error) { - for pager.HasNext() { - var nextPage []FloatingIPReference - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *NetworkInterfaceFloatingIpsPager) GetNext() (page []FloatingIPReference, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *NetworkInterfaceFloatingIpsPager) GetAll() (allItems []FloatingIPReference, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VirtualNetworkInterfaceIpsPager can be used to simplify the use of the "ListVirtualNetworkInterfaceIps" method. -type VirtualNetworkInterfaceIpsPager struct { - hasNext bool - options *ListVirtualNetworkInterfaceIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVirtualNetworkInterfaceIpsPager returns a new VirtualNetworkInterfaceIpsPager instance. -func (vpc *VpcV1) NewVirtualNetworkInterfaceIpsPager(options *ListVirtualNetworkInterfaceIpsOptions) (pager *VirtualNetworkInterfaceIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVirtualNetworkInterfaceIpsOptions = *options - pager = &VirtualNetworkInterfaceIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VirtualNetworkInterfaceIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VirtualNetworkInterfaceIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIPReference, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVirtualNetworkInterfaceIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Ips - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VirtualNetworkInterfaceIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIPReference, err error) { - for pager.HasNext() { - var nextPage []ReservedIPReference - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfaceIpsPager) GetNext() (page []ReservedIPReference, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfaceIpsPager) GetAll() (allItems []ReservedIPReference, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VirtualNetworkInterfacesPager can be used to simplify the use of the "ListVirtualNetworkInterfaces" method. -type VirtualNetworkInterfacesPager struct { - hasNext bool - options *ListVirtualNetworkInterfacesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVirtualNetworkInterfacesPager returns a new VirtualNetworkInterfacesPager instance. -func (vpc *VpcV1) NewVirtualNetworkInterfacesPager(options *ListVirtualNetworkInterfacesOptions) (pager *VirtualNetworkInterfacesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVirtualNetworkInterfacesOptions = *options - pager = &VirtualNetworkInterfacesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VirtualNetworkInterfacesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VirtualNetworkInterfacesPager) GetNextWithContext(ctx context.Context) (page []VirtualNetworkInterface, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVirtualNetworkInterfacesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.VirtualNetworkInterfaces - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VirtualNetworkInterfacesPager) GetAllWithContext(ctx context.Context) (allItems []VirtualNetworkInterface, err error) { - for pager.HasNext() { - var nextPage []VirtualNetworkInterface - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfacesPager) GetNext() (page []VirtualNetworkInterface, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VirtualNetworkInterfacesPager) GetAll() (allItems []VirtualNetworkInterface, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// PublicGatewaysPager can be used to simplify the use of the "ListPublicGateways" method. -type PublicGatewaysPager struct { - hasNext bool - options *ListPublicGatewaysOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewPublicGatewaysPager returns a new PublicGatewaysPager instance. -func (vpc *VpcV1) NewPublicGatewaysPager(options *ListPublicGatewaysOptions) (pager *PublicGatewaysPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListPublicGatewaysOptions = *options - pager = &PublicGatewaysPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *PublicGatewaysPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *PublicGatewaysPager) GetNextWithContext(ctx context.Context) (page []PublicGateway, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListPublicGatewaysWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.PublicGateways - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *PublicGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []PublicGateway, err error) { - for pager.HasNext() { - var nextPage []PublicGateway - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *PublicGatewaysPager) GetNext() (page []PublicGateway, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *PublicGatewaysPager) GetAll() (allItems []PublicGateway, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// FloatingIpsPager can be used to simplify the use of the "ListFloatingIps" method. -type FloatingIpsPager struct { - hasNext bool - options *ListFloatingIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewFloatingIpsPager returns a new FloatingIpsPager instance. -func (vpc *VpcV1) NewFloatingIpsPager(options *ListFloatingIpsOptions) (pager *FloatingIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListFloatingIpsOptions = *options - pager = &FloatingIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *FloatingIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *FloatingIpsPager) GetNextWithContext(ctx context.Context) (page []FloatingIP, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListFloatingIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.FloatingIps - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *FloatingIpsPager) GetAllWithContext(ctx context.Context) (allItems []FloatingIP, err error) { - for pager.HasNext() { - var nextPage []FloatingIP - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *FloatingIpsPager) GetNext() (page []FloatingIP, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *FloatingIpsPager) GetAll() (allItems []FloatingIP, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// NetworkACLRulesPager can be used to simplify the use of the "ListNetworkACLRules" method. -type NetworkACLRulesPager struct { - hasNext bool - options *ListNetworkACLRulesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewNetworkACLRulesPager returns a new NetworkACLRulesPager instance. -func (vpc *VpcV1) NewNetworkACLRulesPager(options *ListNetworkACLRulesOptions) (pager *NetworkACLRulesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListNetworkACLRulesOptions = *options - pager = &NetworkACLRulesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *NetworkACLRulesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *NetworkACLRulesPager) GetNextWithContext(ctx context.Context) (page []NetworkACLRuleItemIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListNetworkACLRulesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Rules - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *NetworkACLRulesPager) GetAllWithContext(ctx context.Context) (allItems []NetworkACLRuleItemIntf, err error) { - for pager.HasNext() { - var nextPage []NetworkACLRuleItemIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *NetworkACLRulesPager) GetNext() (page []NetworkACLRuleItemIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *NetworkACLRulesPager) GetAll() (allItems []NetworkACLRuleItemIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// NetworkAclsPager can be used to simplify the use of the "ListNetworkAcls" method. -type NetworkAclsPager struct { - hasNext bool - options *ListNetworkAclsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewNetworkAclsPager returns a new NetworkAclsPager instance. -func (vpc *VpcV1) NewNetworkAclsPager(options *ListNetworkAclsOptions) (pager *NetworkAclsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListNetworkAclsOptions = *options - pager = &NetworkAclsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *NetworkAclsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *NetworkAclsPager) GetNextWithContext(ctx context.Context) (page []NetworkACL, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListNetworkAclsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.NetworkAcls - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *NetworkAclsPager) GetAllWithContext(ctx context.Context) (allItems []NetworkACL, err error) { - for pager.HasNext() { - var nextPage []NetworkACL - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *NetworkAclsPager) GetNext() (page []NetworkACL, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *NetworkAclsPager) GetAll() (allItems []NetworkACL, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SecurityGroupTargetsPager can be used to simplify the use of the "ListSecurityGroupTargets" method. -type SecurityGroupTargetsPager struct { - hasNext bool - options *ListSecurityGroupTargetsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSecurityGroupTargetsPager returns a new SecurityGroupTargetsPager instance. -func (vpc *VpcV1) NewSecurityGroupTargetsPager(options *ListSecurityGroupTargetsOptions) (pager *SecurityGroupTargetsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSecurityGroupTargetsOptions = *options - pager = &SecurityGroupTargetsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SecurityGroupTargetsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SecurityGroupTargetsPager) GetNextWithContext(ctx context.Context) (page []SecurityGroupTargetReferenceIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSecurityGroupTargetsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Targets - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SecurityGroupTargetsPager) GetAllWithContext(ctx context.Context) (allItems []SecurityGroupTargetReferenceIntf, err error) { - for pager.HasNext() { - var nextPage []SecurityGroupTargetReferenceIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupTargetsPager) GetNext() (page []SecurityGroupTargetReferenceIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupTargetsPager) GetAll() (allItems []SecurityGroupTargetReferenceIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// SecurityGroupsPager can be used to simplify the use of the "ListSecurityGroups" method. -type SecurityGroupsPager struct { - hasNext bool - options *ListSecurityGroupsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewSecurityGroupsPager returns a new SecurityGroupsPager instance. -func (vpc *VpcV1) NewSecurityGroupsPager(options *ListSecurityGroupsOptions) (pager *SecurityGroupsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListSecurityGroupsOptions = *options - pager = &SecurityGroupsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *SecurityGroupsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *SecurityGroupsPager) GetNextWithContext(ctx context.Context) (page []SecurityGroup, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListSecurityGroupsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.SecurityGroups - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *SecurityGroupsPager) GetAllWithContext(ctx context.Context) (allItems []SecurityGroup, err error) { - for pager.HasNext() { - var nextPage []SecurityGroup - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupsPager) GetNext() (page []SecurityGroup, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *SecurityGroupsPager) GetAll() (allItems []SecurityGroup, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// IkePoliciesPager can be used to simplify the use of the "ListIkePolicies" method. -type IkePoliciesPager struct { - hasNext bool - options *ListIkePoliciesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewIkePoliciesPager returns a new IkePoliciesPager instance. -func (vpc *VpcV1) NewIkePoliciesPager(options *ListIkePoliciesOptions) (pager *IkePoliciesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListIkePoliciesOptions = *options - pager = &IkePoliciesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *IkePoliciesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *IkePoliciesPager) GetNextWithContext(ctx context.Context) (page []IkePolicy, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListIkePoliciesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.IkePolicies - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *IkePoliciesPager) GetAllWithContext(ctx context.Context) (allItems []IkePolicy, err error) { - for pager.HasNext() { - var nextPage []IkePolicy - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *IkePoliciesPager) GetNext() (page []IkePolicy, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *IkePoliciesPager) GetAll() (allItems []IkePolicy, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// IpsecPoliciesPager can be used to simplify the use of the "ListIpsecPolicies" method. -type IpsecPoliciesPager struct { - hasNext bool - options *ListIpsecPoliciesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewIpsecPoliciesPager returns a new IpsecPoliciesPager instance. -func (vpc *VpcV1) NewIpsecPoliciesPager(options *ListIpsecPoliciesOptions) (pager *IpsecPoliciesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListIpsecPoliciesOptions = *options - pager = &IpsecPoliciesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *IpsecPoliciesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *IpsecPoliciesPager) GetNextWithContext(ctx context.Context) (page []IPsecPolicy, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListIpsecPoliciesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.IpsecPolicies - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *IpsecPoliciesPager) GetAllWithContext(ctx context.Context) (allItems []IPsecPolicy, err error) { - for pager.HasNext() { - var nextPage []IPsecPolicy - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *IpsecPoliciesPager) GetNext() (page []IPsecPolicy, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *IpsecPoliciesPager) GetAll() (allItems []IPsecPolicy, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPNGatewaysPager can be used to simplify the use of the "ListVPNGateways" method. -type VPNGatewaysPager struct { - hasNext bool - options *ListVPNGatewaysOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPNGatewaysPager returns a new VPNGatewaysPager instance. -func (vpc *VpcV1) NewVPNGatewaysPager(options *ListVPNGatewaysOptions) (pager *VPNGatewaysPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPNGatewaysOptions = *options - pager = &VPNGatewaysPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNGatewaysPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNGatewaysPager) GetNextWithContext(ctx context.Context) (page []VPNGatewayIntf, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPNGatewaysWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.VPNGateways - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPNGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []VPNGatewayIntf, err error) { - for pager.HasNext() { - var nextPage []VPNGatewayIntf - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNGatewaysPager) GetNext() (page []VPNGatewayIntf, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNGatewaysPager) GetAll() (allItems []VPNGatewayIntf, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPNServerClientsPager can be used to simplify the use of the "ListVPNServerClients" method. -type VPNServerClientsPager struct { - hasNext bool - options *ListVPNServerClientsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPNServerClientsPager returns a new VPNServerClientsPager instance. -func (vpc *VpcV1) NewVPNServerClientsPager(options *ListVPNServerClientsOptions) (pager *VPNServerClientsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPNServerClientsOptions = *options - pager = &VPNServerClientsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServerClientsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServerClientsPager) GetNextWithContext(ctx context.Context) (page []VPNServerClient, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPNServerClientsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Clients - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPNServerClientsPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerClient, err error) { - for pager.HasNext() { - var nextPage []VPNServerClient - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerClientsPager) GetNext() (page []VPNServerClient, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerClientsPager) GetAll() (allItems []VPNServerClient, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPNServerRoutesPager can be used to simplify the use of the "ListVPNServerRoutes" method. -type VPNServerRoutesPager struct { - hasNext bool - options *ListVPNServerRoutesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPNServerRoutesPager returns a new VPNServerRoutesPager instance. -func (vpc *VpcV1) NewVPNServerRoutesPager(options *ListVPNServerRoutesOptions) (pager *VPNServerRoutesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPNServerRoutesOptions = *options - pager = &VPNServerRoutesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServerRoutesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServerRoutesPager) GetNextWithContext(ctx context.Context) (page []VPNServerRoute, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPNServerRoutesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Routes - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPNServerRoutesPager) GetAllWithContext(ctx context.Context) (allItems []VPNServerRoute, err error) { - for pager.HasNext() { - var nextPage []VPNServerRoute - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerRoutesPager) GetNext() (page []VPNServerRoute, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServerRoutesPager) GetAll() (allItems []VPNServerRoute, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// VPNServersPager can be used to simplify the use of the "ListVPNServers" method. -type VPNServersPager struct { - hasNext bool - options *ListVPNServersOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewVPNServersPager returns a new VPNServersPager instance. -func (vpc *VpcV1) NewVPNServersPager(options *ListVPNServersOptions) (pager *VPNServersPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListVPNServersOptions = *options - pager = &VPNServersPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *VPNServersPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *VPNServersPager) GetNextWithContext(ctx context.Context) (page []VPNServer, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListVPNServersWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.VPNServers - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *VPNServersPager) GetAllWithContext(ctx context.Context) (allItems []VPNServer, err error) { - for pager.HasNext() { - var nextPage []VPNServer - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *VPNServersPager) GetNext() (page []VPNServer, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *VPNServersPager) GetAll() (allItems []VPNServer, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// LoadBalancerProfilesPager can be used to simplify the use of the "ListLoadBalancerProfiles" method. -type LoadBalancerProfilesPager struct { - hasNext bool - options *ListLoadBalancerProfilesOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewLoadBalancerProfilesPager returns a new LoadBalancerProfilesPager instance. -func (vpc *VpcV1) NewLoadBalancerProfilesPager(options *ListLoadBalancerProfilesOptions) (pager *LoadBalancerProfilesPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListLoadBalancerProfilesOptions = *options - pager = &LoadBalancerProfilesPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *LoadBalancerProfilesPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *LoadBalancerProfilesPager) GetNextWithContext(ctx context.Context) (page []LoadBalancerProfile, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListLoadBalancerProfilesWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Profiles - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *LoadBalancerProfilesPager) GetAllWithContext(ctx context.Context) (allItems []LoadBalancerProfile, err error) { - for pager.HasNext() { - var nextPage []LoadBalancerProfile - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *LoadBalancerProfilesPager) GetNext() (page []LoadBalancerProfile, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *LoadBalancerProfilesPager) GetAll() (allItems []LoadBalancerProfile, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// LoadBalancersPager can be used to simplify the use of the "ListLoadBalancers" method. -type LoadBalancersPager struct { - hasNext bool - options *ListLoadBalancersOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewLoadBalancersPager returns a new LoadBalancersPager instance. -func (vpc *VpcV1) NewLoadBalancersPager(options *ListLoadBalancersOptions) (pager *LoadBalancersPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListLoadBalancersOptions = *options - pager = &LoadBalancersPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *LoadBalancersPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *LoadBalancersPager) GetNextWithContext(ctx context.Context) (page []LoadBalancer, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListLoadBalancersWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.LoadBalancers - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *LoadBalancersPager) GetAllWithContext(ctx context.Context) (allItems []LoadBalancer, err error) { - for pager.HasNext() { - var nextPage []LoadBalancer - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *LoadBalancersPager) GetNext() (page []LoadBalancer, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *LoadBalancersPager) GetAll() (allItems []LoadBalancer, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// EndpointGatewayIpsPager can be used to simplify the use of the "ListEndpointGatewayIps" method. -type EndpointGatewayIpsPager struct { - hasNext bool - options *ListEndpointGatewayIpsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewEndpointGatewayIpsPager returns a new EndpointGatewayIpsPager instance. -func (vpc *VpcV1) NewEndpointGatewayIpsPager(options *ListEndpointGatewayIpsOptions) (pager *EndpointGatewayIpsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListEndpointGatewayIpsOptions = *options - pager = &EndpointGatewayIpsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *EndpointGatewayIpsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *EndpointGatewayIpsPager) GetNextWithContext(ctx context.Context) (page []ReservedIP, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListEndpointGatewayIpsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.Ips - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *EndpointGatewayIpsPager) GetAllWithContext(ctx context.Context) (allItems []ReservedIP, err error) { - for pager.HasNext() { - var nextPage []ReservedIP - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewayIpsPager) GetNext() (page []ReservedIP, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewayIpsPager) GetAll() (allItems []ReservedIP, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// EndpointGatewaysPager can be used to simplify the use of the "ListEndpointGateways" method. -type EndpointGatewaysPager struct { - hasNext bool - options *ListEndpointGatewaysOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewEndpointGatewaysPager returns a new EndpointGatewaysPager instance. -func (vpc *VpcV1) NewEndpointGatewaysPager(options *ListEndpointGatewaysOptions) (pager *EndpointGatewaysPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListEndpointGatewaysOptions = *options - pager = &EndpointGatewaysPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *EndpointGatewaysPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *EndpointGatewaysPager) GetNextWithContext(ctx context.Context) (page []EndpointGateway, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListEndpointGatewaysWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.EndpointGateways - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *EndpointGatewaysPager) GetAllWithContext(ctx context.Context) (allItems []EndpointGateway, err error) { - for pager.HasNext() { - var nextPage []EndpointGateway - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewaysPager) GetNext() (page []EndpointGateway, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *EndpointGatewaysPager) GetAll() (allItems []EndpointGateway, err error) { - return pager.GetAllWithContext(context.Background()) -} - -// FlowLogCollectorsPager can be used to simplify the use of the "ListFlowLogCollectors" method. -type FlowLogCollectorsPager struct { - hasNext bool - options *ListFlowLogCollectorsOptions - client *VpcV1 - pageContext struct { - next *string - } -} - -// NewFlowLogCollectorsPager returns a new FlowLogCollectorsPager instance. -func (vpc *VpcV1) NewFlowLogCollectorsPager(options *ListFlowLogCollectorsOptions) (pager *FlowLogCollectorsPager, err error) { - if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") - return - } - - var optionsCopy ListFlowLogCollectorsOptions = *options - pager = &FlowLogCollectorsPager{ - hasNext: true, - options: &optionsCopy, - client: vpc, - } - return -} - -// HasNext returns true if there are potentially more results to be retrieved. -func (pager *FlowLogCollectorsPager) HasNext() bool { - return pager.hasNext -} - -// GetNextWithContext returns the next page of results using the specified Context. -func (pager *FlowLogCollectorsPager) GetNextWithContext(ctx context.Context) (page []FlowLogCollector, err error) { - if !pager.HasNext() { - return nil, fmt.Errorf("no more results available") - } - - pager.options.Start = pager.pageContext.next - - result, _, err := pager.client.ListFlowLogCollectorsWithContext(ctx, pager.options) - if err != nil { - return - } - - var next *string - if result.Next != nil { - var start *string - start, err = core.GetQueryParam(result.Next.Href, "start") - if err != nil { - err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) - return - } - next = start - } - pager.pageContext.next = next - pager.hasNext = (pager.pageContext.next != nil) - page = result.FlowLogCollectors - - return -} - -// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly -// until all pages of results have been retrieved. -func (pager *FlowLogCollectorsPager) GetAllWithContext(ctx context.Context) (allItems []FlowLogCollector, err error) { - for pager.HasNext() { - var nextPage []FlowLogCollector - nextPage, err = pager.GetNextWithContext(ctx) - if err != nil { - return - } - allItems = append(allItems, nextPage...) - } - return -} - -// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. -func (pager *FlowLogCollectorsPager) GetNext() (page []FlowLogCollector, err error) { - return pager.GetNextWithContext(context.Background()) -} - -// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. -func (pager *FlowLogCollectorsPager) GetAll() (allItems []FlowLogCollector, err error) { - return pager.GetAllWithContext(context.Background()) -} diff --git a/go.mod b/go.mod index 3887b67b11..28c0b7be41 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/IBM/schematics-go-sdk v0.2.3 github.com/IBM/secrets-manager-go-sdk/v2 v2.0.2 github.com/IBM/vpc-beta-go-sdk v0.6.0 - github.com/IBM/vpc-go-sdk v0.47.0 + github.com/IBM/vpc-go-sdk v0.48.0 github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 github.com/akamai/AkamaiOPEN-edgegrid-golang/v5 v5.0.0 @@ -71,6 +71,7 @@ require ( require ( cloud.google.com/go/kms v1.10.1 // indirect cloud.google.com/go/monitoring v1.13.0 // indirect + github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75 // indirect github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/PromonLogicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect @@ -89,6 +90,7 @@ require ( github.com/coreos/pkg v0.0.0-20220810130054-c7d1c02cb6cf // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect + github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/eapache/go-resiliency v1.4.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect @@ -121,6 +123,7 @@ require ( github.com/google/gnostic v0.6.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -161,6 +164,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kardianos/govendor v1.0.9 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1 // indirect github.com/leodido/go-urn v1.2.4 // indirect @@ -172,6 +176,8 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/gox v1.0.1 // indirect + github.com/mitchellh/iochan v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/spdystream v0.2.0 // indirect @@ -215,6 +221,8 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.16.0 // indirect + golang.org/x/tools/cmd/cover v0.1.0-deprecated // indirect + golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect @@ -238,8 +246,6 @@ replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt // add sdk changes. replace github.com/portworx/sched-ops v0.0.0-20200831185134-3e8010dc7056 => github.com/portworx/sched-ops v0.20.4-openstorage-rc3 // required by rook v1.7 -replace github.com/IBM/vpc-go-sdk v0.47.0 => ./common/github.com/vpc-go-sdk - exclude ( github.com/kubernetes-incubator/external-storage v0.20.4-openstorage-rc2 k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible diff --git a/go.sum b/go.sum index ee3f1764f8..5ebc353ae6 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,8 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75 h1:xGHheKK44eC6K0u5X+DZW/fRaR1LnDdqPHMZMWx5fv8= +github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75/go.mod h1:4/6eNcqZ09BZ9wLK3tZOjBA1nDj+B0728nlX5YRlSmQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -176,6 +178,8 @@ github.com/IBM/vpc-beta-go-sdk v0.6.0 h1:wfM3AcW3zOM3xsRtZ+EA6+sESlGUjQ6Yf4n5QQy github.com/IBM/vpc-beta-go-sdk v0.6.0/go.mod h1:fzHDAQIqH/5yJmYsKodKHLcqxMDT+yfH6vZjdiw8CQA= github.com/IBM/vpc-go-sdk v0.47.0 h1:2Qcjd4zQQRYjz+y4ZMDP6+aWGifyXCZ9uMmlpW7p9To= github.com/IBM/vpc-go-sdk v0.47.0/go.mod h1:4Hs5d/aClmsxAzwDQkwG+ri0vW2ykPJdpM6hDLRwKcA= +github.com/IBM/vpc-go-sdk v0.48.0 h1:4yeSxVX9mizsIW2F0rsVI47rZoNKBrZ1QK9RwwRas9Q= +github.com/IBM/vpc-go-sdk v0.48.0/go.mod h1:FDJpiokOmaYG2hNYDfqKVxUPe8mm/dPi3mdz8Zt4o/Q= github.com/Jeffail/gabs v1.1.1 h1:V0uzR08Hj22EX8+8QMhyI9sX2hwRu+/RJhJUmnwda/E= github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 h1:vuquMR410psHNax14XKNWa0Ae/kYgWJcXi0IFuX60N0= @@ -360,6 +364,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0= +github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 h1:3T8ZyTDp5QxTx3NU48JVb2u+75xc040fofcBaN+6jPA= +github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185/go.mod h1:cFRxtTwTOJkz2x3rQUNCYKWC93yP1VKjR8NUhqFxZNU= github.com/denisenkom/go-mssqldb v0.0.0-20190412130859-3b1d194e553a/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba h1:p6poVbjHDkKa+wtC8frBMwQtT3BmqGYBjzMwJ63tuR4= github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc h1:8WFBn63wegobsYAX0YjD+8suexZDga5CctH4CCTx2+8= @@ -724,6 +730,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 h1:2XF1Vzq06X+inNqgJ9tRnGuw+ZVCB3FazXODD6JE1R8= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -874,6 +882,7 @@ github.com/hashicorp/go-uuid v1.0.2-0.20191001231223-f32f5fe8d6a8/go.mod h1:6SBZ github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -1054,6 +1063,8 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kardianos/govendor v1.0.9 h1:WOH3FcVI9eOgnIZYg96iwUwrL4eOVx+aQ66oyX2R8Yc= +github.com/kardianos/govendor v1.0.9/go.mod h1:yvmR6q9ZZ7nSF5Wvh40v0wfP+3TwwL8zYQp+itoZSVM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -1164,7 +1175,10 @@ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -2037,6 +2051,10 @@ golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools/cmd/cover v0.1.0-deprecated h1:Rwy+mWYz6loAF+LnG1jHG/JWMHRMMC2/1XX3Ejkx9lA= +golang.org/x/tools/cmd/cover v0.1.0-deprecated/go.mod h1:hMDiIvlpN1NoVgmjLjUJE9tMHyxHjFX7RuQ+rW12mSA= +golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4= +golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/ibm/service/vpc/data_source_ibm_is_reservation.go b/ibm/service/vpc/data_source_ibm_is_reservation.go index 4cfb7d5cc7..66b6d820bb 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservation.go +++ b/ibm/service/vpc/data_source_ibm_is_reservation.go @@ -309,7 +309,7 @@ func dataSourceIBMIsReservationRead(context context.Context, d *schema.ResourceD } if reservation.Profile != nil { profileList := []map[string]interface{}{} - profile := reservation.Profile.(*vpcv1.ReservationProfile) + profile := reservation.Profile profileMap := dataSourceReservationProfileToMap(*profile) profileList = append(profileList, profileMap) if err = d.Set("profile", profileList); err != nil { diff --git a/ibm/service/vpc/data_source_ibm_is_reservations.go b/ibm/service/vpc/data_source_ibm_is_reservations.go index 930e8d156e..313d7625dd 100644 --- a/ibm/service/vpc/data_source_ibm_is_reservations.go +++ b/ibm/service/vpc/data_source_ibm_is_reservations.go @@ -340,7 +340,7 @@ func dataSourceReservationCollectionReservationsToMap(reservationsItem vpcv1.Res } if reservationsItem.Profile != nil { profileList := []map[string]interface{}{} - profile := reservationsItem.Profile.(*vpcv1.ReservationProfile) + profile := reservationsItem.Profile profileMap := dataSourceReservationCollectionReservationsProfileToMap(*profile) profileList = append(profileList, profileMap) reservationsMap["profile"] = profileList diff --git a/ibm/service/vpc/resource_ibm_is_reservation.go b/ibm/service/vpc/resource_ibm_is_reservation.go index c658b4cea0..b0b9c25795 100644 --- a/ibm/service/vpc/resource_ibm_is_reservation.go +++ b/ibm/service/vpc/resource_ibm_is_reservation.go @@ -495,7 +495,7 @@ func resourceIBMISReservationRead(d *schema.ResourceData, meta interface{}) erro profileMap := []map[string]interface{}{} finalList := map[string]interface{}{} - profileItem := reservation.Profile.(*vpcv1.ReservationProfile) + profileItem := reservation.Profile if profileItem.Href != nil { finalList[isReservationProfileHref] = profileItem.Href diff --git a/ibm/service/vpc/resource_ibm_is_reservation_activate.go b/ibm/service/vpc/resource_ibm_is_reservation_activate.go index 8379f63eb8..96ac3c4753 100644 --- a/ibm/service/vpc/resource_ibm_is_reservation_activate.go +++ b/ibm/service/vpc/resource_ibm_is_reservation_activate.go @@ -350,7 +350,7 @@ func resourceIBMISReservationActivateRead(d *schema.ResourceData, meta interface profileMap := []map[string]interface{}{} finalList := map[string]interface{}{} - profileItem := reservation.Profile.(*vpcv1.ReservationProfile) + profileItem := reservation.Profile if profileItem.Href != nil { finalList[isReservationProfileHref] = profileItem.Href From 93f8a0328a3c299d4508ee1aaa7476be81e12198 Mon Sep 17 00:00:00 2001 From: sreekarbvibm <139211144+sreekarbvibm@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:19:09 +0530 Subject: [PATCH 17/17] fix(reservations): UI-34823: read resource group attribute during reservation create --- ibm/service/vpc/resource_ibm_is_reservation.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ibm/service/vpc/resource_ibm_is_reservation.go b/ibm/service/vpc/resource_ibm_is_reservation.go index b0b9c25795..0d98ac3520 100644 --- a/ibm/service/vpc/resource_ibm_is_reservation.go +++ b/ibm/service/vpc/resource_ibm_is_reservation.go @@ -359,6 +359,15 @@ func resourceIBMISReservationCreate(d *schema.ResourceData, meta interface{}) er createReservationOptions.Profile = reservationProfilePrototype } + if _, ok := d.GetOk(isReservationResourceGroup); ok { + resGroup := d.Get(isReservationResourceGroup + ".0").(map[string]interface{}) + if resGroup[isReservationResourceGroupId] != nil && resGroup[isReservationResourceGroupId].(string) != "" { + createReservationOptions.ResourceGroup = &vpcv1.ResourceGroupIdentity{ + ID: core.StringPtr(resGroup[isReservationResourceGroupId].(string)), + } + } + } + if zone, ok := d.GetOk(isReservationZone); ok { if zone.(string) != "" { createReservationOptions.Zone = &vpcv1.ZoneIdentity{Name: core.StringPtr(zone.(string))}